Update year range in copyright notice of all files owned by the GDB project.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
f12d1e8a
AM
12014-12-25 Alan Modra <amodra@gmail.com>
2
3 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
4 new enums.
5 (Target_arm::merge_object_attributes, ): Likewise.
6
5c294fee
TG
72014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
8
9 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
10 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
11 AEABI_VFP_args_vfp to check that.
12 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
13 value and replace hardcoded values by enum values.
14
e30880c2
CC
152014-12-22 Cary Coutant <ccoutant@google.com>
16
17 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
18
bd040da1
L
192014-12-20 H.J. Lu <hongjiu.lu@intel.com>
20
21 PR gold/14608
22 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
23 to "return i * i * 3;".
24
e02a4046
CC
252014-12-16 Cary Coutant <ccoutant@google.com>
26
27 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
28 (Mapfile::print_output_data): Use current_data_size() to avoid
29 assert for sections requiring postprocessing; if address is not valid,
30 print 0.
31 (Mapfile::print_output_section): Use current_data_size(); print note
32 that addresses and sizes are before compression.
33
add6016b
L
342014-12-14 H.J. Lu <hongjiu.lu@intel.com>
35
36 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
37 Cast current_group_size to unsigned long when reporting error.
38
0bf32ea9
JY
392014-12-10 Jing Yu <jingyu@google.com>
40
41 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
42 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
43 Update error message.
44 (Target_aarch64::do_relax): Use absolute value of option
45 stub_group_size. Replace local variable with class member
46 stub_group_size_.
47
cbcb23fa
AM
482014-12-04 Alan Modra <amodra@gmail.com>
49
50 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
51 addend of PLTREL24 reloc when not generating a plt stub. Make
52 max_branch_offset an "Address".
fbad6518 53 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
54 (Target_powerpc::Relocate::relocate): Likewise.
55
1611bc4a
AM
562014-12-04 Alan Modra <amodra@gmail.com>
57
58 PR 17670
59 * symtab.cc (Symbol::set_undefined): Remove assertion.
60 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
61 on symbols defined in discarded sections, instead return false.
62 Rearrange params, update all callers.
63 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
64 branches to syms in discarded sections.
65 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
66 undefined and flag as discarded.
67 (Target_powerpc::Relocate::relocate): Localize variable.
68
4759c34e
L
692014-12-03 H.J. Lu <hongjiu.lu@intel.com>
70
71 PR gold/17675
72 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
73 * testsuite/Makefile.in: Regenerated.
74
1f98a074
AM
752014-12-03 Alan Modra <amodra@gmail.com>
76
77 PR 17566
78 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
79 when adding dynamic relocations against section symbols.
80
fb257835
DI
812014-12-01 Dimitry Ivanov <dimitry@google.com>
82
83 * layout.cc (Layout::finish_dynamic_section): When '-z global'
84 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
85 * options.h (General_options): New -z option (global).
86
d8e60314
CC
872014-12-01 Cary Coutant <ccoutant@google.com>
88
89 PR gold/17578
90 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
91 is given.
92 (Layout::create_executable_stack_info): Warn when -z noexecstack is
93 given but some inputs require executable stack.
94
982bbd97
CC
952014-11-26 Cary Coutant <ccoutant@google.com>
96
97 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
98 .debug_str_offsets; strip .debug_gnu_pubnames and
99 .debug_gnu_pubtypes.
100 (lines_only_debug_sections): Strip all four new sections.
101
bb779192
HS
1022014-11-26 Jing Yu <jingyu@google.com>
103
104 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
105 register to be x0 when to relax TLSDESC_LD64_LO12.
106
a3e60ddb
AM
1072014-11-26 Alan Modra <amodra@gmail.com>
108
109 * powerpc.cc (struct Stub_table_owner): New.
110 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
111 unsigned int vector. Update all references.
112 (powerpc_relobj::set_stub_table): Take an unsigned int param
113 rather than a Stub_table. Update callers.
114 (Powerpc_relobj::clear_stub_table): New function.
115 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
116 stub_group_size_ vars.
117 (Target_powerpc::new_stub_table): Delete.
118 (max_branch_delta): New function, extracted from..
119 (Target_powerpc::Relocate::relocate): ..here..
120 (Target_powerpc::Branch_info::make_stub): ..and here. Return
121 status on whether stub created successfully.
122 (Stub_control::Stub_control): Add "no_size_errors" param. Move
123 default sizing to..
124 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
125 reduce on relax failure.
126 (Target_powerpc::group_sections): Add "no_size_errors" param.
127 Use stub_group_size_. Set up group info in a temp vector,
128 before building Stub_table vector. Account for input sections
129 possibly already converted to relaxed sections.
130 (Stub_table::init): Delete. Merge into..
131 (Stub_table::Stub_table): ..here.
132 (Stub_table::can_reach_stub): New function.
133 (Stub_table::add_plt_call_entry): Add "from" parameter and
134 return true iff stub could be reached.
135 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
136 param too.
137 (Stub_table::clear_stubs): Add "all" param.
138
a20605cf
AM
1392014-11-26 Alan Modra <amodra@gmail.com>
140
141 * powerpc.cc (Stub_control::set_output_and_owner): New function.
142 (Target_powerpc::group_sections): Use it.
143
43b64deb
CC
1442014-11-25 Cary Coutant <ccoutant@google.com>
145
146 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
147 (Binary_to_elf::write_symbol): Add st_size parameter.
148 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
149
c924eb67
CC
1502014-11-25 Cary Coutant <ccoutant@google.com>
151
152 PR gold/17639
153 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
154 (Sized_relobj_file::do_layout): Handle deferred sections properly
155 during GC pass 1. Don't add reloc sections to deferred list twice.
156 * object.h (Sized_relobj_file::is_deferred_layout): New function.
157 (Sized_relobj_file::is_deferred_layout_): New data member.
158
9d585188
L
1592014-11-21 H.J. Lu <hongjiu.lu@intel.com>
160
161 PR gold/17619
162 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
163 Check PC-relative offset overflow in PLT entry.
164
3ffaac20
AM
1652014-11-21 Alan Modra <amodra@gmail.com>
166
167 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
168 for undefined weaks.
169
0cfb0717
AM
1702014-11-20 Alan Modra <amodra@gmail.com>
171
172 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
173 from --stub-group-size parameter divided by 1024.
174 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
175 template parameter. Update all uses.
176 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
177 has_stub_value. Set for long branches. Don't report overflow for
178 branch to undefined weak symbols. Print info message on
179 overflowing branch to stub.
180
f9dffbf0
AM
1812014-11-20 Alan Modra <amodra@gmail.com>
182
183 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
184
e88ba8d5
L
1852014-11-13 H.J. Lu <hongjiu.lu@intel.com>
186
187 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
188 entry for R_X86_64_GOTPLT64.
189 (Target_x86_64<size>::Relocate::relocate): Update comments for
190 R_X86_64_GOTPLT64.
191
d37ffe25
ED
1922014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
193
194 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
195 * plugin.h: add lock definition
196
9726c3c1
HS
1972014-10-29 Han Shen <shenhan@google.com>
198 Jing Yu <jingyu@google.com>
199
200 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
201 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
202 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
203 Symbol::TLS_REF.
204 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
205 method.
206 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
207 (Target_aarch64::tls_ld_to_le): New method.
208 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
209 for 64bit targets.
210 (Output_data_plt_aarch64::irelative_rel_): New data member.
211 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
212 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
213 (Output_data_plt_aarch64::add_relocation): New method.
214 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
215 offset. Add got_irelative size to got size.
216 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
217 type string with the new typename.
218 (AArch64_relocate_functions::update_adr): Replace parameter x with
219 immed.
220 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
221 (AArch64_relocate_functions::reloc_common): New method.
222 (AArch64_relocate_funcsions::rela_general): Extract common part out
223 into reloc_common method.
224 (AArch64_relocate_functions::rela_general): Likewise.
225 (AArch64_relocate_functions::pcrela_general): Likewise.
226 (AArch64_relocate_functions::adr): New method.
227 (AArch64_relocate_functions::adrp): Calculate immed before calling
228 update_adr.
229 (AArch64_relocate_functions::adrp): Likewise.
230 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
231 comparing x to 0. Calculate immed from ~x when x < 0.
232 (Target_aarch64::optimize_tls_reloc): Add new cases for
233 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
234 TLSLD_MOVW_DTPREL_G0_NC.
235 (Target_aarch64::possible_function_pointer_reloc): Implement this
236 method.
237 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
238 comment.
239 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
240 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
241 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
242 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
243 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
244 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
245 (Target_aarch64::make_plt_entry): Call add_entry with two more
246 parameters.
247 (Target_aarch64::make_local_ifunc_plt_entry): New method.
248 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
249 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
250 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
251 (Target_aarch64::Relocate::relocate_tls): Add cases for
252 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
253 TLSLD_MOVW_DTPREL_G0_NC.
254 * testsuite/icf_safe_so_test.cc: Correct test comment.
255 * testsuite/icf_safe_test.sh: Add AArch64 arch.
256
80272b8c
AM
2572014-10-22 Alan Modra <amodra@gmail.com>
258
259 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
260 thread_starter.
261
998a69f4
AS
2622014-10-18 Andreas Schwab <schwab@linux-m68k.org>
263
264 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
265
aed56ec5
CC
2662014-10-17 Cary Coutant <ccoutant@google.com>
267
268 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
269 Add "typename" keyword.
270
bb779192 2712014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
272 Jing Yu <jingyu@google.com>
273
274 Patch for gold aarch64 backend to support relaxation.
275 * aarch64-reloc.def: Change format.
276 * aarch64.cc (class Reloc_stub): New class.
277 (class Stub_table): New class.
278 (class AArch64_relobj): New class.
279 (class AArch64_input_section): New class.
280 (class AArch64_output_section): New class.
281 (Target_aarch64::new_stub_table): New method.
282 (Target_aarch64::new_aarch64_input_section): New method.
283 (Target_aarch64::find_aarch64_input_section): New method.
284 (Target_aarch64::scan_section_for_stubs): New method.
285 (Target_aarch64::scan_reloc_section_for_stubs): New method.
286 (Target_aarch64::relocate_stub): New method.
287 (Target_aarch64::current_target): New method.
288 (Target_aarch64::do_make_elf_object): New method.
289 (Target_aarch64::do_may_relax): New method.
290 (Target_aarch64::do_relax): New method.
291 (Target_aarch64::group_sections): New method.
292 (Target_aarch64::scan_reloc_for_stub): New method.
293 (Target_aarch64::do_make_output_section): New method.
294 (Target_aarch64::stub_tables_): New data member.
295 (Target_aarch64::aarch64_input_section_map_): New data member.
296 (AArch64_relocate_functions::maybe_apply_stub): New method.
297
db4c9594
CC
2982014-09-30 Cary Coutant <ccoutant@google.com>
299
300 PR gold/17432
301 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
302
cd6da036
KC
3032014-09-30 Kito Cheng <kito@0xlab.org>
304
305 PR gold/13597
306 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
307 hash table before sysv-style hash table.
308
5f772412
ST
3092014-09-29 Sriraman Tallam <tmsriram@google.com>
310
311 * options.h (--pic-executable): Add negative to alias to -no-pie.
312
5efeedf6
CC
3132014-09-26 Cary Coutant <ccoutant@google.com>
314
315 PR gold/16773
316 * object.cc (Sized_relobj_file): Compute value of section symbols
317 for TLS sections the same as TLS symbols.
318
1707f183
CC
3192014-09-25 Cary Coutant <ccoutant@google.com>
320
321 PR gold/17432
322 * resolve.cc (Symbol_table::resolve): Override common placeholder
323 symbols, but adjust sizes.
324 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
325 symbols to common lists.
326
00cac886
AM
3272014-09-24 Alan Modra <amodra@gmail.com>
328
329 * po/POTFILES.in: Regenerate.
330
635aa30e
CC
3312014-09-23 Taiju Tsuiki <tzik@google.com>
332 Cary Coutant <ccoutant@google.com>
333
71b9b91b 334 PR gold/14860
635aa30e
CC
335 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
336 on input_sections_blocker.
337 * layout.cc (Write_sections_task::locks): Unblock
338 input_sections_blocker_.
339 * layout.h (Write_sections_task::Write_sections_task): Add
340 input_sections_blocker.
341 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
342 to DEPENDENCIES.
343 * testsuite/Makefile.in: Regenerate.
344
c0c71592
RÁE
3452014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
346
347 * testsuite/Makefile.am (plugin_test_10): New test.
348 * testsuite/Makefile.in: Regenerate
349 * testsuite/plugin_common_test_2.c (c1): Align to 8.
350 * testsuite/plugin_test_10.sh: New file.
351
6168c2a1
RÁE
3522014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
353
354 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
355 * resolve.cc (Symbol_table::resolve): Don't override common symbols
356 during the replacement phase.
357
3a531937
JY
3582014-09-17 Han Shen <shenhan@google.com>
359 Jing Yu <jingyu@google.com>
360
361 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
362 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
363 * aarch64.cc (Target_aarch64): Add data members
364 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
365 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
366 constructor.
367 (Target_aarch64::do_reloc_symbol_index): New method.
368 (Target_aarch64::do_reloc_addend): New method.
369 (Target_aarch64::add_tlsdesc_info): New method.
370 (Target_aarch64::do_dynsym_value): New method.
371 (Target_aarch64::do_make_data_plt): Add new parameters: got,
372 got_irelative. Pass them to Output_data_plt_aarch64_standard.
373 (Target_aarch64::make_data_plt): Add new parameters: got,
374 got_irelative. Pass them to do_make_data_plt.
375 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
376 (Target_aarch64::Relocate:tls_gd_to_le): New method.
377 (Target_aarch64::Relocate:tls_ie_to_le): New method.
378 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
379 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
380 (Target_aarch64::got_tlsdesc_section): New method.
381 (Target_aarch64::make_local_ifunc_plt_entry): New method.
382 (Target_aarch64::define_tls_base_symbol): New method.
383 (Target_aarch64::reserve_tlsdesc_entries): New method.
384 (Target_aarch64::got_mod_index_entry): New method.
385 (Target_aarch64::rela_tlsdesc_section): New method.
386 (Target_aarch64::rela_irelative_section): New method.
387 (Target_aarch64::Tlsdesc_info): New struct.
388 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
389 relocations and tlsdesc relocations.
390 (Target_aarch64::optimize_tls_reloc): Implement method.
391 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
392 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
393 in constructor.
394 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
395 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
396 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
397 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
398 (Output_data_plt_aarch64::rela_tlsdesc): New method.
399 (Output_data_plt_aarch64::rela_irelative): New method.
400 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
401 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
402 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
403 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
404 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
405 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
406 (Output_data_plt_aarch64_standard): New member variables:
407 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
408 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
409 New parameter: got, got_irelative.
410 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
411 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
412 (Output_data_plt_aarch64::do_write): Replace got_address with
413 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
414 (AArch64_relocate_functions::update_movnz): New method.
415 (AArch64_relocate_functions): Correct format.
416 (AArch64_relocate_functions::movnz): New method.
417 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
418 before the switch. Add new cases to switch.
00cac886 419 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
420 tlsgd tlsdesc cases.
421 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
422 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
423 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
424 Call reloc_name_in_error_message to print unsupported reloc.
425 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
426 make_data_plt.
427 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
428 relocs. Fill in some more dynamic tags.
429 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
430 Skip call tls_get_addr when tlsgd is relaxed.
431 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
432 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
433 tlsdesc->ie relaxation.
434
62661c93
SS
4352014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
436
437 * mips.cc (Target_mips_nacl): New class.
438 (Target_selector_mips_nacl): New class.
439 (target_selector_mips32): Rename from target_selector_mips32be and use
440 Target_selector_mips_nacl instead of Target_selector_mips.
441 (target_selector_mips32el): Rename from target_selector_mips32 and use
442 Target_selector_mips_nacl instead of Target_selector_mips.
443 (target_selector_mips64): Rename from target_selector_mips64be and use
444 Target_selector_mips_nacl instead of Target_selector_mips.
445 (target_selector_mips64el): Rename from target_selector_mips64 and use
446 Target_selector_mips_nacl instead of Target_selector_mips.
447 (Target_mips::mips_info): Add const attribute.
448
54674d38
CC
4492014-09-02 Cary Coutant <ccoutant@google.com>
450
451 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
452 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
453 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
454 (Sized_incr_dynobj::do_section_name): Likewise.
455 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
456 (Sized_incr_dynobj::do_section_name): Likewise.
457 * object.h (Object::section_name): Likewise.
458 (Object::do_section_name): Likewise.
459 (Sized_relobj_file::do_section_name): Likewise.
460 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
461 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
462
9860cbcf
CC
4632014-09-02 Cary Coutant <ccoutant@google.com>
464
465 PR gold/17005
466 * ehframe.cc (Fde::write): Add output_offset parameter.
467 (Cie::write): Likewise.
468 (Eh_frame::set_final_data_size): Account for offset within output
469 section.
470 (Eh_frame::do_sized_write): Likewise.
471 * ehframe.h (Fde::write): Add output_offset parameter.
472 (Cie::write): Likewise.
473 * output.cc (Output_section::Input_section_sort_entry): Remove
474 section_has_name_; add output_section_name parameter. Use
475 output section name for non-input sections.
476 (Output_section::Input_section_sort_entry::section_has_name): Remove.
477 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
478 (Output_section::Input_section_sort_compare): Remove logic for
479 sections without names.
480 (Output_section::Input_section_sort_init_fini_compare): Likewise.
481 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
482 Likewise.
483 (Output_section::Input_section_sort_section_name_compare): Likewise.
484
8e33481e
HS
4852014-08-29 Han Shen <shenhan@google.com>
486 Jing Yu <jingyu@google.com>
487
488 * aarch64-reloc-property.cc
489 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
490 reference reloc property in the table.
491 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
492 3 other entries.
493 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
494 2 new overloaded methods.
495 (Output_data_got_aarch64::do_write): Add code to write out
496 static relocs.
497 (class Output_data_got_aarch64::Static_reloc): New class to wrap
498 static relocs.
499 (Output_data_got_aarch64::static_relocs): New vector to
500 hold static relocs.
501 (Target_aarch64::TCB_SIZE): New const static memeber.
502 (Target_aarch64::tcb_size): New method.
503 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
504 (Target_aarch64::Relocate::relocate_tls): New method.
505 (Target_aarch64::Scan::local): Add code handling new reloc types.
506 (Target_aarch64::Scan::global): Add code handling new reloc types.
507
81233653
ST
5082014-08-13 Sriraman Tallam <tmsriram@google.com>
509
510 * options.h (-no-pie): Add option.
511
9363c7c3
JY
5122014-08-08 Jing Yu <jingyu@google.com>
513 Han Shen <shenhan@google.com>
514
515 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
516 (DEFFILES): add aarch64-reloc.def.
517 (TARGETSOURCES): Add aarch64-reloc-property.cc.
518 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
519 * Makefile.in: Regenerate.
520 * aarch64-reloc-property.cc: New file.
521 * aarch64-reloc-property.h: New file.
522 * aarch64-reloc.def: New file.
523 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
524 with tab to make the format consistent.
525 (Output_data_got_aarch64::symbol_table_): New method.
526 (Target_aarch64::do_plt_address_for_global): New method.
527 (Target_aarch64::do_plt_address_for_local): New method.
528 (Target_aarch64::do_select_as_default_target): New method.
529 (Target_aarch64::do_make_data_plt): New method.
530 (Target_aarch64::make_data_plt): New method.
531 (Output_data_plt_aarch64::has_irelative_section): New method.
532 (Output_data_plt_aarch64::address_for_global): New method.
533 (Output_data_plt_aarch64::address_for_local): New method.
534 (Output_data_plt_aarch64::irelative_rel_): New parameter.
535 (Output_data_plt_aarch64::add_entry): Implement contents.
536 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
537 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
538 the got_pov entry to plt0.
539 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
540 Implement contents.
541 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
542 (AArch64_howto): New struct.
543 (aarch64_howto[]): New static const array.
544 (AArch64_relocate_functions): New class.
545 (Target_aarch64::Scan::get_reference_flags): Remove method.
546 (Target_aarch64::Scan::local): Implement to support a few relocations.
547 (Target_aarch64::Scan::global): Implement to support a few relocations.
548 (Target_aarch64::make_plt_section): Implement contents.
549 (Target_aarch64::make_plt_entry): Implement contents.
550 (Target_aarch64::do_finalize_sections): Implement contents.
551 (Target_aarch64::Relocate::relocate): Implement a few relocations.
552 (Target_aarch64::relocate_section): Implement contents.
553
ad9fe6c1
AM
5542014-08-06 Alan Modra <amodra@gmail.com>
555
556 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
557
7cd4e5b7
AM
5582014-08-06 Alan Modra <amodra@gmail.com>
559
560 PR 13227
561 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
562
5ad9b0a7
ST
5632014-07-21 Sriraman Tallam <tmsriram@google.com>
564
565 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 566 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 567
e051745c
CC
5682014-07-08 Cary Coutant <ccoutant@google.com>
569
570 * expression.cc (struct Expression::Expression_eval_info): Add
571 new fields type_pointer, vis_pointer, and nonvis_pointer.
572 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
573 nonvis_pointer parameters. Adjust all calls.
574 (Symbol_expression::value): Update type, visibility, and nonvis bits
575 in caller.
576 * script.cc (Symbol_assignment::sized_finalize): Update type,
577 visibility, and remaining st_other bits for new symbol.
578 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
579 vis_pointer, and nonvis_pointer parameters.
580 * symtab.h (Symbol::set_type): New method.
581
582 * testsuite/Makefile.am (defsym_test): New test.
583 * testsuite/Makefile.in: Regenerate.
584 * testsuite/defsym_test.c: New file.
585 * testsuite/defsym_test.sh: New file.
586
f35c4853
CC
5872014-07-08 Cary Coutant <ccoutant@google.com>
588
589 PR gold/15639
590 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
591 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
592 (Sized_dynobj::base_read_symbols): ...new method.
593 * object.h (Sized_relobj_file::base_read_symbols): New method.
594 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
595 (Sized_relobj_file::base_read_symbols): ...new method.
596 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
597 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
598 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
599
2900af2d
AM
6002014-07-04 Alan Modra <amodra@gmail.com>
601
602 * po/POTFILES.in: Regenerate.
603
053a4d68
JY
6042014-07-02 Jing Yu <jingyu@google.com>
605
606 * aarch64.cc: New file
607 * Makefile.am (TARGETSOURCES): Add aarch64.cc
608 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
609 * Makefile.in: Regenerate.
610 * configure.tgt: Add entries for aarch64*.
611 * configure.ac: Likewise.
612 * configure: Likewise.
613
7b549045
AM
6142014-06-27 Alan Modra <amodra@gmail.com>
615
616 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
617
cb818dbf
CC
6182014-06-24 Cary Coutant <ccoutant@google.com>
619
620 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
621 sections.
622 (Dwo_file::sized_read_unit_index): Likewise.
623
9810d34d
SS
6242014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
625
626 * mips.cc: New file.
627 * Makefile.am (TARGETSOURCES): Add mips.cc
628 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
629 * configure.tgt: Add entries for mips*.
630 * configure.ac: Likewise.
631 * Makefile.in: Regenerate.
632 * configure: Likewise.
633
9baa787b
CC
6342014-06-09 Cary Coutant <ccoutant@google.com>
635
636 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
637 unit_length is within section bounds.
638
8f89af0a
CC
6392014-06-09 Cary Coutant <ccoutant@google.com>
640
641 PR gold/16980
642 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
643 map.
644
a47622ac
AM
6452014-06-07 Alan Modra <amodra@gmail.com>
646
647 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
648
4320c691
CC
6492014-06-06 Cary Coutant <ccoutant@google.com>
650
651 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
652 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
653 (Dwarf_pubnames_table::read_header): Likewise.
654 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
655 .debug_gnu_pubtypes.
656
270c9937
JB
6572014-06-05 Joel Brobecker <brobecker@adacore.com>
658
659 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
660 * Makefile.in, configure: Regenerate.
661
397998fc
AM
6622014-06-03 Alan Modra <amodra@gmail.com>
663
664 * powerpc.cc (addis_12_2): Define.
665 (Stub_table::do_write): Support fusion on ELFv2 stubs.
666
61f5c66f
AM
6672014-06-03 Alan Modra <amodra@gmail.com>
668
669 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
670 st_other output.
671
f6971787
AM
6722014-06-02 Alan Modra <amodra@gmail.com>
673
674 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
675 Only ignore relocs on ELFv1.
676 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
677
f6fb8322
CC
6782014-05-30 Cary Coutant <ccoutant@google.com>
679
680 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
681 * testsuite/Makefile.in: Regenerate.
682 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
683
c23dd342
L
6842014-05-27 H.J. Lu <hongjiu.lu@intel.com>
685
686 PR gold/16945
687 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
688 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
689
5fe7ffdc
AM
6902014-05-15 Alan Modra <amodra@gmail.com>
691
692 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
693 Compare FDE contents with DW_CFA_nop rather than 0.
694
a82bef93
ST
6952014-05-13 Sriraman Tallam <tmsriram@google.com>
696
697 * symtab.h (may_need_copy_reloc): Remove check for position independent
698 code.
699 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
700 position independence before pc absolute may_need_copy_reloc call.
701 Add check for executable output befor pc relative may_need_copy_reloc
702 call.
703 * i386.cc: Ditto.
704 * arm.cc: Ditto.
705 * sparc.cc: Ditto.
706 * tilegx.cc: Ditto.
707 * powerpc.cc: Add check for no position independence before
708 may_need_copy_reloc calls.
709 * testsuite/pie_copyrelocs_test.cc: New file.
710 * testsuite/pie_copyrelocs_shared_test.cc: New file.
711 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 712 * Makefile.in: Regenerate.
a82bef93 713
53c66605
ML
7142014-05-08 Martin Liška <mliska@suse.cz>
715
716 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
717
57b2284c
CC
7182014-05-06 Cary Coutant <ccoutant@google.com>
719
720 PR gold/16900
721 * i386.cc (Output_data_got_plt_i386): New class.
722 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
723 parameter. Change all callers.
724 (Output_data_plt_i386::layout_): Remove.
725 (Output_data_plt_i386::got_plt_): Change type.
726 (Target_i386::got_plt_): Change type. Change all references.
727 (Target_i386::got_section): Create instance of new class.
728 (Output_data_got_plt_i386::do_write): New function.
729 * x86_64.cc (Output_data_got_plt_x86_64): New class.
730 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
731 parameter. Change all callers.
732 (Output_data_plt_x86_64::layout_): Remove.
733 (Output_data_plt_x86_64::got_plt_): Change type.
734 (Target_x86_64::got_plt_): Change type. Change all references.
735 (Target_x86_64::got_section): Create instance of new class.
736 (Output_data_got_plt_x86_64::do_write): New function.
737 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
738 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
739 class.
740
6b97515d 7412014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 742
6b97515d
CC
743 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
744 if we have pubnames/pubtypes.
745
d1bddd3c
CC
7462014-05-02 Cary Coutant <ccoutant@google.com>
747
5fe7ffdc
AM
748 * defstd.cc (in_segment): Define __ehdr_start here...
749 * layout.cc (Layout::finalize): ...Instead of here. Set the
750 output segment when known.
751 * resolve.cc (Symbol::override_base_with_special): Remember
752 the original binding.
753 * symtab.cc (Symbol::set_output_segment): New function.
754 (Symbol::set_undefined): New function.
755 * symtab.h (Symbol::is_weak_undefined): Check original undef
756 binding.
757 (Symbol::is_strong_undefined): New function.
758 (Symbol::set_output_segment): New function.
759 (Symbol::set_undefined): New function.
760 * target-reloc.h (is_strong_undefined): Remove.
761 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
762 Check for hidden undefs.
763 (relocate_section): Call Symbol::is_strong_undefined.
764
765 * testsuite/Makefile.am (ehdr_start_test_1)
766 (ehdr_start_test_2, ehdr_start_test_3)
767 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
768 * testsuite/Makefile.in: Regenerate.
769 * testsuite/ehdr_start_def.cc: New source file.
770 * testsuite/ehdr_start_test.cc: New source file.
771 * testsuite/ehdr_start_test.t: New linker script.
772 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 773
7849f6d8
CC
7742014-04-23 Cary Coutant <ccoutant@google.com>
775
bf2cc635 776 PR gold/16870
7849f6d8
CC
777 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
778
99fd8cff
CC
7792014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
780
781 * layout.cc (Layout::include_section): Allow a target to decide
782 whether to include a section.
783 * target.h (Target::should_include_section): New function.
784 (Target::do_should_include_section): New function.
785
91f43acd
CC
7862014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
787
788 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
789 inline into ...
790 (Copy_relocs::emit): ... here.
791 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
792 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
793 (Copy_reloc_entry::entries_): Change from private to protected.
794
c4eb27e1
ST
7952014-04-02 Sriraman Tallam <tmsriram@google.com>
796
797 * icf.cc (get_section_contents): Replace copies of reloc
798 vectors with const references.
799
ae447ddd
CC
8002014-04-02 Cary Coutant <ccoutant@google.com>
801
802 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
803 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
804 * configure: Regenerate.
805 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
806 -fno-use-linker-plugin.
807 (LINK1, CXXLINK1): Add it to the link command.
808 * testsuite/Makefile.in: Regenerate.
809
fa47fa92
AM
8102014-03-12 Alan Modra <amodra@gmail.com>
811
812 * Makefile.in: Regenerate.
813
9b12c500
CC
8142014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
815
816 * symtab.h (Symbol::set_nonvis): New function.
817
beacaa96
CC
8182014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
819
820 * symtab.cc (Sized_symbol<32>::init_output_data):
821 Instantiate the template.
822 (Sized_symbol<64>::init_output_data): Likewise.
823
800d9823
CC
8242014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
825
826 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
827 adjust dynamic symbol value.
828 * target.h (Target::adjust_dyn_symbol): New function.
829 (Target::do_adjust_dyn_symbol): New function.
830
918fc1f8 8312014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 832
918fc1f8
CC
833 * output.cc (Output_data_dynamic::Dynamic_entry::write):
834 Get the value of DYNAMIC_CUSTOM dynamic entry.
835 * output.h (Output_data_dynamic::add_custom): New function.
836 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
837 dynamic entry.
838 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
839 * target.h (Target::dynamic_tag_custom_value): New function.
840 (Target::do_dynamic_tag_custom_value): New function.
841
98ff9231
CC
8422014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
843
844 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
845 dynsym indexes.
846 * target.h (Target::has_custom_set_dynsym_indexes): New function.
847 (Target::do_has_custom_set_dynsym_indexes): New function.
848 (Target::set_dynsym_indexes): New function.
849 (Target::do_set_dynsym_indexes): New function.
850
b80eed39
AM
8512014-03-07 Alan Modra <amodra@gmail.com>
852
853 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
854 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
855 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
856 (Powerpc_relocate_functions::has_overflow_bitfield,
857 overflowed): Use the above.
858 (Target_powerpc::Relocate::relocate): Correct overflow checking
859 for a number of relocations. Modify overflow test for 16-bit
860 fields in instructions to signed/unsigned according to whether
861 the field takes a signed or unsigned value.
862
4b95cf5c
AM
8632014-03-05 Alan Modra <amodra@gmail.com>
864
865 Update copyright years.
866
45965137
AM
8672014-03-05 Alan Modra <amodra@gmail.com>
868
869 * powerpc.cc (Target_powerpc::Scan::local, global): Support
870 R_PPC64_ADDR64_LOCAL.
871 (Target_powerpc::Relocate::relocate): Likewise.
872
2c80b753
AM
8732014-03-03 Alan Modra <amodra@gmail.com>
874
875 * dwp.cc (print_version): Update copyright year to current.
876
c1c69e83
AM
8772014-02-10 Alan Modra <amodra@gmail.com>
878
879 * po/gold.pot: Regenerate.
880
dd0c4e70
CC
8812014-02-06 Cary Coutant <ccoutant@google.com>
882
883 Fix problem where -u is ignored when a weak undef is seen.
884
885 * archive.cc (Library_base::should_include_member): Reorder
886 code to check for -u option if a weak undef has already been seen.
887 * testsuite/Makefile.am (weak_undef_test_2): New test case.
888 * testsuite/Makefile.in: Regenerate.
889 * testsuite/weak_undef_file3.cc: New file.
890 * testsuite/weak_undef_file4.cc: New file.
891 * testsuite/weak_undef_test_2.cc: New file.
892
1a221d3d
CC
8932014-02-05 Cary Coutant <ccoutant@google.com>
894
895 Fix issues with gold undefined symbol diagnostics.
896
897 PR binutils/15435
898 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
899 check to here.
900 * target-reloc.h (is_strong_undefined): New function.
901 (relocate_section): Move undef vtable symbol check from here.
902 Check for is_strong_undefined.
903
e889f0a4 9042014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 905
e889f0a4
CC
906 Fix problems with the --dynamic-list option.
907
908 PR gold/13577
909 * options.cc (General_options::parse_dynamic_list):
910 Set have_dynamic_list_.
911 (General_options::General_options): Initialize have_dynamic_list_.
912 (General_options::finalize): Turn off -Bsymbolic and
913 -Bsymbolic-functions if --dynamic-list provided.
914 * options.h (General_options::have_dynamic_list): New function.
915 (General_options::have_dynamic_list_): New data member.
916 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
917 correctly.
5fe7ffdc 918
e889f0a4
CC
919 PR gold/16530
920 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
921 in --dynamic-list, mark it.
5fe7ffdc 922
e889f0a4
CC
923 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
924 (dynamic_list_2): New test case.
925 * testsuite/Makefile.in: Regenerate.
926 * testsuite/dynamic_list_2.cc: New file.
927 * testsuite/dynamic_list_2.t: New file.
928 * testsuite/dynamic_list_lib1.cc: New file.
929 * testsuite/dynamic_list_lib2.cc: New file.
930 * testsuite/gc_dynamic_list_test.c: New file.
931 * testsuite/gc_dynamic_list_test.sh: New file.
932 * testsuite/gc_dynamic_list_test.t: New file.
933
ec673e64
CC
9342014-01-28 Cary Coutant <ccoutant@google.com>
935
936 Add .gdb_index version 7 support.
937
938 * gold/dwarf_reader.cc: include <utility> (for make_pair).
939 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
940 debug sections.
941 (Dwarf_ranges_table::read_ranges_table): Likewise.
942 (Dwarf_pubnames_table::read_section): Check for GNU-style
943 sections, and for compressed debug sections.
944 (Dwarf_pubnames_table::read_header): Compute end address of table.
945 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
946 for end of list by offset, not by offset == 0.
947 (Dwarf_info_reader::do_read_string_table): Check for compressed
948 debug sections.
949 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
950 Initialize new data members.
951 (Dwarf_pubnames_table::next_name): return flag_byte.
952 (Dwarf_pubnames_table::end_of_table_): New data member.
953 (Dwarf_pubnames_table::is_gnu_style_): New data member.
954 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
955 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
956 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
957 read skeleton type unit DIEs.
958 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
959 (Gdb_index::do_write): Write flag_byte.
960 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
961 (Gdb_index::Cu_vector): Store flags along with cu indexes.
962 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
963 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
964
221fd5d5
L
9652014-01-08 H.J. Lu <hongjiu.lu@intel.com>
966
967 * version.cc (print_version): Update copyright year to 2014.
968
6c09fb0b
ILT
9692013-12-19 Dimitry Andric <dimitry@andric.com>
970
971 * stringpool.cc (Stringpool_template::reserve): Add
972 HAVE_UNORDERED_MAP case.
973 * stringpool.cc (Stringpool_template::print_stats): Likewise.
974
8356f2d0
CC
9752013-12-18 Cary Coutant <ccoutant@google.com>
976
977 * configure.ac: Check for <unordered_set> and <unordered_map>.
978 * config.in: Regenerate.
979 * configure: Regenerate.
980 * system.h: Use <unordered_set> and <unordered_map> if available.
981
f2c7d7ee
RM
9822013-12-10 Roland McGrath <mcgrathr@google.com>
983
984 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
985 with $(INSTALL_PROGRAM_ENV).
986 * Makefile.in: Regenerate.
987
6632e8cc
CC
9882013-11-22 Cary Coutant <ccoutant@google.com>
989
990 * configure.ac: Add check for which library is needed for
991 dlopen.
992 * configure: Regenerate.
993
0c075858
CC
9942013-11-22 Cary Coutant <ccoutant@google.com>
995
996 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
997 assembler.
998 * testsuite/Makefile.in: Regenerate.
999
f49fe902
L
10002013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1001
1002 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1003 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1004 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1005 (Target_x86_64<size>::Scan::local): Likewise.
1006 (Target_x86_64<size>::Scan::global): Likewise.
1007 (Target_x86_64<size>::Relocate::relocate): Likewise.
1008 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1009 Likewise.
1010 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1011 R_X86_64_PC32_BND.
1012
1013 * testsuite/Makefile.am (check_PROGRAMS): Add
1014 exception_x86_64_bnd_test.
1015 (exception_x86_64_bnd_test_SOURCES): New macro.
1016 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1017 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1018 (exception_x86_64_bnd_test_LDADD): Likewise.
1019 (exception_x86_64_bnd_1.o): New rule.
1020 (exception_x86_64_bnd_2.o): Likewise.
1021 * testsuite/Makefile.in: Regenerated.
1022
9055360d
AM
10232013-11-15 Alan Modra <amodra@gmail.com>
1024
1025 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1026 accessor.
1027 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1028 Only call ppc64_local_entry_offset for 64-bit. Restrict
1029 symval_for_branch lookup to ELFv1.
1030 (Stub_table::add_plt_call_entry): Use unsigned int off.
1031 (Output_data_glink::Address, invalid_address): New.
1032 (Output_data_glink::add_eh_frame): Move out of line. Add
1033 support for ELFv2.
1034 (Output_data_glink::add_global_entry, find_global_entry,
1035 global_entry_address): New functions.
1036 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1037 ge_size): New variables.
1038 (Output_data_glink::set_final_data_size): Add global entry
1039 stub sizing.
1040 (Output_data_glink::do_write): Write global entry stubs.
1041 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1042 parameter. Return true for ELFv2. Adjust callers.
1043 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1044 ELFv1. Similarly for ifunc and dynamic relocation processing
1045 specific to ELFv1. Recognize that symbols are defined on
1046 their plt entries for ELFv2.
1047 (Target_powerpc::symval_for_branch): Assert if called for
1048 ELFv2 or ppc32.
1049 (Target_powerpc::Relocate::relocate): Use global entry plt
1050 stub for symbol value if such exists on ELFv2.
1051 (Target_powerpc::Relocate::relocate): Don't call
1052 symval_for_branch when ELFv2. Do adjust for local entry
1053 offset when ELFv2.
1054 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1055 plt stub for ELFv2.
1056 (Target_powerpc::do_plt_address_for_global): Similarly.
1057
cafdd569
CC
10582013-11-14 Cary Coutant <ccoutant@google.com>
1059
1060 Revert patch -- this did not fix the problem, and there is
1061 no race there.
1062
1063 2013-11-14 Cary Coutant <ccoutant@google.com>
1064
1065 PR gold/14860
1066 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1067 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1068 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1069 updating fde_offsets_.
1070 (Eh_frame_hdr::lock_): New data member.
1071
94e49e16
CC
10722013-11-14 Cary Coutant <ccoutant@google.com>
1073
1074 * dwp.cc (Dwo_file_entry): New type.
1075 (File_list): Use Dwo_file_entry.
1076 (Dwo_file::verify): New function.
1077 (Dwo_file::verify_dwo_list): New function.
1078 (Dwo_file::sized_verify_dwo_list): New function.
1079 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1080 list.
1081 (Dwp_options): New enum type.
1082 (dwp_options): Add --verify-only.
1083 (usage): Likewise.
1084 (main): Likewise.
1085 * dwp.h (gold_info): Add declaration.
1086
7cdd7d57
CC
10872013-11-14 Cary Coutant <ccoutant@google.com>
1088
1089 PR gold/14860
1090 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1091 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1092 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1093 updating fde_offsets_.
1094 (Eh_frame_hdr::lock_): New data member.
1095
1d946cb3
CC
10962013-11-06 Cary Coutant <ccoutant@google.com>
1097
1098 PR gold/15758
1099 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1100 before reloc sections.
1101
4f65b40e
AM
11022013-11-04 Alan Modra <amodra@gmail.com>
1103
1104 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1105 (Symbol::needs_dynamic_reloc): Test new flag.
1106 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1107 (Target_powerpc::Scan::get_reference_flags): Add target param.
1108 Return FUNC_DESC_ABI for 64-bit ELFv1.
1109 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1110 call.
1111 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1112 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1113
908794a9
CC
11142013-10-31 Cary Coutant <ccoutant@google.com>
1115
1116 Restore support for dwp v2 DWARF package file format.
1117
1118 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1119 tu_length parameter. Adjust all callers.
1120 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1121 * dwp.cc: Include dwarf.h.
1122 (Section_bounds): New struct type.
1123 (Unit_set): New struct type.
1124 (Dwo_file::Dwo_file): Initialize new data member.
1125 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1126 Combine and rename to...
1127 (Dwo_file::read_unit_index): ...this.
1128 (Dwo_file::sized_read_compunit_index)
1129 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1130 (Dwo_file::sized_read_unit_index): ...this.
1131 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1132 parameters; add section_id parameter.
1133 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1134 (Dwo_file::add_unit_set): ...this.
1135 (Dwo_file::shndx_map_): Remove.
1136 (Dwo_file::sect_offsets_): New data member.
1137 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1138 (Dwp_output_file::add_section): Rename to...
1139 (Dwp_output_file::add_contribution): ...this.
1140 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1141 (Dwp_output_file::add_tu_set): Likewise.
1142 (Dwp_output_file::Contribution): New type.
1143 (Dwp_output_file::Section::contributions): New data member.
1144 (Dwp_output_file::Cu_or_tu_set): Remove.
1145 (Dwp_output_file::Section::Section): New ctor.
1146 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1147 (Dwp_output_file::Dwp_index::Section_table): New type.
1148 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1149 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1150 parameter.
1151 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1152 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1153 (Dwp_output_file::Dwp_index::section_table): New member function.
1154 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1155 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1156 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1157 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1158 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1159 (Dwp_output_file::Dwp_index::section_table_): New data member.
1160 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1161 (Dwp_output_file::add_output_section): New member function.
1162 (Dwp_output_file::write_new_section): New member function.
1163 (Dwp_output_file::write_contributions): New member function.
1164 (Dwp_output_file::section_id_map_): New data member.
1165 (class Dwo_id_info_reader): Remove.
1166 (class Unit_reader): New class.
1167 (get_dwarf_section_name): New function.
1168 (Dwo_file::read_executable): Adjust initializations of class data.
1169 (Dwo_file::read): Add support for v2 package file format.
1170 (Dwo_file::read_unit_index): Likewise.
1171 (Dwo_file::sized_read_unit_index): Likewise.
1172 (Dwo_file::copy_section): Likewise.
1173 (Dwo_file::add_unit_set): Likewise.
1174 (Dwp_output_file::add_output_section): Likewise.
1175 (Dwp_output_file::add_contribution): Likewise.
1176 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1177 for empty slot.
1178 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1179 file format.
1180 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1181 slot.
1182 (Dwp_output_file::initialize): Remove unused function.
1183 (Dwp_output_file::finalize): Add support for v2 package file format.
1184 (Dwp_output_file::write_index): Likewise.
1185 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1186 function prototype.
1187
2500c017
CC
11882013-10-31 Cary Coutant <ccoutant@google.com>
1189
1190 * configure.ac: Fix check for -fmerge-constants.
1191 * configure.ac: Regenerate.
1192
dd0845d7
RM
11932013-10-30 Roland McGrath <mcgrathr@google.com>
1194
1195 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1196 Correct 9-byte nop sequence to match what the assembler generates.
1197
b4f7960d
AM
11982013-10-30 Alan Modra <amodra@gmail.com>
1199
1200 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1201 ppc64_local_entry_offset, ppc64_local_entry_offset,
1202 do_read_symbols): New functions.
1203 (Powerpc_relobj::e_flags_, st_other_): New vars.
1204 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1205 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1206 (Powerpc_relobj::e_flags_): New var.
1207 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1208 and adjust for ELFv2.
1209 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1210 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1211 (Powerpc_dynobj::do_find_special_sections): Likewise.
1212 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1213 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1214 to ELFv2 local entry.
1215 (Target_powerpc::do_relax): No thread safe barriers needed for
1216 ELFv2.
1217 (Output_data_plt_powerpc::initial_plt_entry_size_,
1218 plt_entry_size): Delete. Replace all uses with
1219 first_plt_entry_offset() and plt_entry_size().
1220 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1221 reserved_size parm. Update callers.
1222 (Output_data_plt_powerpc::entry_count): Update.
1223 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1224 and use Target_powerpc::first_plt_entry_offset().
1225 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1226 rename to plt_entry_size.
1227 (Output_data_plt_powerpc::add_ifunc_entry,
1228 add_local_ifunc_entry): Adjust reloc for ELFv2.
1229 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1230 (glink_eh_frame_fde_64v2): New.
1231 (Stub_table::plt_call_size): Support ELFv2 sizing.
1232 (Output_data_glink::add_eh_frame): Use the new FDE.
1233 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1234 (Stub_table::do_write): Write ELFv2 stubs and glink.
1235 (Target_powerpc::Relocate::relocate): Replaces nop after call
1236 with ld 2,24(1) and adjust local offset destination for ELFv2.
1237
f9c6b907
AM
12382013-10-30 Alan Modra <amodra@gmail.com>
1239
1240 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1241 (Target_powerpc::Scan::global, local): Likewise.
1242 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1243 on all ppc64 @h and @ha relocs.
1244
e84fe78f
AM
12452013-10-14 Alan Modra <amodra@gmail.com>
1246
1247 * output.h (Output_data_got::add_constant): Tidy.
1248 (Output_data_got::add_constant_pair): New function.
1249 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1250 methods used so as to first call reserve_ent().
1251
679e4abf
RM
12522013-10-11 Roland McGrath <mcgrathr@google.com>
1253
44dcb735
RM
1254 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1255 add_got_entry and add_got_entry_pair.
1256
13323c49
RM
1257 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1258 (HAVE_PUBNAMES): Likewise.
1259 * configure: Regenerate.
1260
1496b446
RM
1261 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1262 * testsuite/Makefile.in: Regenerate.
1263
cc84c10b
RM
1264 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1265 Remove const from declaration.
1266 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1267 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1268 * output.h (Output_file_header): Remove const from member target_
1269 and corresponding constructor argument.
1270 * output.cc (Output_file_header::Output_file_header): Update prototype.
1271 (Output_file_header::do_sized_write): Use this->target_ in place
1272 of parameters()->target().
1273
52f66a2c
RM
1274 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1275
2b64b551
RM
1276 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1277 * configure: Regenerate.
1278 * Makefile.in: Regenerate.
1279 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1280 * testsuite/merge_string_literals_2.c: Likewise.
1281 * testsuite/Makefile.am
1282 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1283 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1284 literal -fmerge-constants.
1285 * testsuite/Makefile.in: Regenerate.
1286
43819297
RM
1287 * i386.cc (Target_i386): Remove unused member dynbss_.
1288 * arm.cc (Target_arm): Likewise.
1289 * powerpc.cc (Target_powerpc): Likewise.
1290 * sparc.cc (Target_sparc): Likewise.
1291 * tilegx.cc (Target_tilegx): Likewise.
1292 * x86_64.cc (Target_x86_64): Likewise.
1293 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1294 type_signature_, type_offset_.
1295 * plugin.h (Plugin_hook): Remove unused member layout_.
1296 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1297 mapfile_.
1298 (Read_member): Remove unused members input_objects_, symtab_,
1299 mapfile_, layout_.
1300 (Check_library): Remove unused member symtab_.
1301 * archive.h (Lib_group): Remove unused member lib_.
1302 * archive.cc (Lib_group::Lib_group): Update initializer.
1303 * incremental.h (Incremental_binary): Remove unused member target_.
1304 (Incremental_script_entry): Removed unused member script_.
1305 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1306 * icf.h (Icf): Remove unused member num_tracked_relocs.
1307
39d9ead7
RM
1308 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1309 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1310 its only use.
1311 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1312
679e4abf
RM
1313 * archive.h: Use struct rather than class for forward declaration
1314 of Read_symbols_data.
1315
54de2ea6
CC
13162013-10-07 Cary Coutant <ccoutant@google.com>
1317
1318 PR gold/16010
1319 * testsuite/Makefile.am (icf_test): Fix dependencies.
1320 (icf_safe_test): Likewise.
1321 (icf_safe_so_test): Likewise.
1322 (large_symbol_alignment): Add empty _LDADD rule.
1323 * testsuite/Makefile.in: Regenerate.
1324
b14016f0
L
13252013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1326
1327 PR gold/15927
1328 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1329 relocation for R_X86_64_32 on x32.
1330
eb426534
RM
13312013-08-27 Roland McGrath <mcgrathr@google.com>
1332
1333 * output.cc (Output_segment::set_section_addresses): Take new
1334 Target* argument. If target->isolate_execinstr() and the segment
1335 is executable and starts at a target->abi_pagesize() boundary,
1336 pad its end out to a target->abi_pagesize() boundary with code fill.
1337 * output.h (Output_segment::set_section_addresses): Update decl.
1338 * layout.h (Layout::check_output_data_for_reset_values): Take new
1339 argument RELAX_OUTPUTS.
1340 (Layout): New member relax_output_list_.
1341 (Layout::add_relax_output): New method.
1342 * layout.cc (Layout::Layout): Update constructor.
1343 (Layout::reset_relax_output): New method.
1344 (Layout::clean_up_after_relaxation): Call it.
1345 (Layout::prepare_for_relaxation): Update caller.
1346 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1347 Call reset_relax_output before re-processing segments for
1348 isolate_execinstr case.
1349 (Layout::write_data): Handle relax_output_list_.
1350 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1351 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1352
9aff4b7a
NC
13532013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1354
1355 PR binutils/15834
1356 * object.h: Fix typos.
1357
93f8221c
RM
13582013-08-16 Roland McGrath <mcgrathr@google.com>
1359
1360 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1361 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1362
e44c3715
CC
13632013-08-07 Cary Coutant <ccoutant@google.com>
1364
1365 Revert support for v2 DWP files:
1366
1367 2013-03-01 Cary Coutant <ccoutant@google.com>
1368
1369 Add dwp support for v2 DWARF package file format.
1370 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1371 tu_length parameter. Adjust all callers.
1372 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1373 * dwp.cc: Include dwarf.h.
1374 (Section_bounds): New struct type.
1375 (Unit_set): New struct type.
1376 (Dwo_file::Dwo_file): Initialize new data member.
1377 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1378 Combine and rename to...
1379 (Dwo_file::read_unit_index): ...this.
1380 (Dwo_file::sized_read_compunit_index)
1381 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1382 (Dwo_file::sized_read_unit_index): ...this.
1383 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1384 parameters; add section_id parameter.
1385 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1386 (Dwo_file::add_unit_set): ...this.
1387 (Dwo_file::shndx_map_): Remove.
1388 (Dwo_file::sect_offsets_): New data member.
1389 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1390 (Dwp_output_file::add_section): Rename to...
1391 (Dwp_output_file::add_contribution): ...this.
1392 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1393 (Dwp_output_file::add_tu_set): Likewise.
1394 (Dwp_output_file::Contribution): New type.
1395 (Dwp_output_file::Section::contributions): New data member.
1396 (Dwp_output_file::Cu_or_tu_set): Remove.
1397 (Dwp_output_file::Section::Section): New ctor.
1398 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1399 (Dwp_output_file::Dwp_index::Section_table): New type.
1400 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1401 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1402 parameter.
1403 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1404 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1405 (Dwp_output_file::Dwp_index::section_table): New member function.
1406 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1407 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1408 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1409 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1410 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1411 (Dwp_output_file::Dwp_index::section_table_): New data member.
1412 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1413 (Dwp_output_file::add_output_section): New member function.
1414 (Dwp_output_file::write_new_section): New member function.
1415 (Dwp_output_file::write_contributions): New member function.
1416 (Dwp_output_file::section_id_map_): New data member.
1417 (class Dwo_id_info_reader): Remove.
1418 (class Unit_reader): New class.
1419 (get_dwarf_section_name): New function.
1420 (Dwo_file::read_executable): Adjust initializations of class data.
1421 (Dwo_file::read): Add support for v2 package file format.
1422 (Dwo_file::read_unit_index): Likewise.
1423 (Dwo_file::sized_read_unit_index): Likewise.
1424 (Dwo_file::copy_section): Likewise.
1425 (Dwo_file::add_unit_set): Likewise.
1426 (Dwp_output_file::add_output_section): Likewise.
1427 (Dwp_output_file::add_contribution): Likewise.
1428 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1429 for empty slot.
1430 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1431 file format.
1432 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1433 slot.
1434 (Dwp_output_file::initialize): Remove unused function.
1435 (Dwp_output_file::finalize): Add support for v2 package file format.
1436 (Dwp_output_file::write_index): Likewise.
1437 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1438 function prototype.
1439
c6905c28
CC
14402013-07-31 Cary Coutant <ccoutant@google.com>
1441
1442 * object.cc (Sized_relobj::do_output_section_address): New function.
1443 (Sized_relobj): Instantiate explicitly.
1444 * object.h (Object::output_section_address): New function.
1445 (Object::do_output_section_address): New function.
1446 (Sized_relobj::do_output_section_address): New function.
1447 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1448
14492013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1450 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1451
1452 * parameters.cc (Parameters::entry): Return target-specific entry
1453 symbol name.
1454 * target.h (Target::entry_symbol_name): New function.
1455 (Target_info::entry_symbol_name): New data member.
1456
1457 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1458 * i386.cc (Target_i386::i386_info): Likewise.
1459 (Target_i386_nacl::i386_nacl_info): Likewise.
1460 * sparc.cc (Target_sparc::sparc_info): Likewise.
1461 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1462 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1463 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1464 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1465
234d4ab8
SA
14662013-07-22 Sterling Augustine <saugustine@google.com>
1467
1468 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1469 Convert parameter shndx to local variable. Add parameters symtab
1470 and symtab_size. Scan over section names. Find relocation
1471 section corresponding to current section. Create and initialize
1472 reloc_mapper_ and reloc_type_.
1473 (Dwarf_pubnames_table::read_header): Add assertion. Change
1474 unit_length to off_t. Initialize member unit_length_. Fill in field
1475 cu_offset_.
1476 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1477 Initialize new fields unit_length_ and cu_offset_.
1478 (Dwarf_pubnames_table::read_section): Update prototype.
1479 (Dwarf_pubnames_table::cu_offset): New member function.
1480 (Dwarf_pubnames_table::subsection_size): Likewise.
1481 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1482 New fields.
1483 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1484 member functions public.
1485 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1486 Update comment. Rework logic. Move repeated parts to...
1487 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1488 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1489 pubtypes_table_, and stmt_list_offset.
1490 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1491 Gdb_index::find_pubtype_offset,
1492 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1493 (Gdb_index::pubnames_read): Update prototype and rework logic.
1494 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1495 Forward declare.
1496 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1497 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1498 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1499 Gdb_index::map_pubtable_to_dies):
1500 Declare functions.
1501 (Gdb_index::pubnames_read): Update declaration.
1502 (Gdb_index::Pubname_offset_map): New type.
1503 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1504 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1505 Gdb_index::stmt_list_offset): Declare.
1506 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1507 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1508 Gdb_index::pubtypes_offset_): Remove.
1509
a3ed37d8
RM
15102013-07-19 Roland McGrath <mcgrathr@google.com>
1511
1512 * options.h (General_options): Add -Trodata-segment option.
1513 * parameters.cc (Parameters::check_rodata_segment): New function.
1514 (Parameters::set_target_once): Call it.
1515 * parameters.h (Parameters): Declare it (private member function).
1516 * layout.cc (load_seg_unusable_for_headers): New function, broken
1517 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1518 then validate rodata segment rather than text segment.
1519 (relaxation_loop_body): Call that.
1520 (is_text_segment): New function. Don't admit a non-executable
1521 segment if TARGET->isolate_execinstr().
1522 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1523
eb5b4ded
CC
15242013-07-15 Shawn Landden <shawnlandden@gmail.com>
1525
1526 PR gold/15070
1527 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1528 * nacl.h (Sniff_file::View::View): Request aligned view.
1529
4d5effb9
CC
15302013-07-11 Cary Coutant <ccoutant@google.com>
1531
1532 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1533 correct BRLT entry size.
1534
ba8ca3e7
AM
15352013-07-03 Alan Modra <amodra@gmail.com>
1536
1537 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1538 comment.
1539
267257d2
CC
15402013-07-01 Cary Coutant <ccoutant@google.com>
1541
1542 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1543 reloc_type_.
1544 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1545 (Dwarf_ranges_table::lookup_reloc): New function.
1546 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1547 reloc_type_.
1548 (Dwarf_ranges_table::lookup_reloc): New function.
1549 (Dwarf_ranges_table::reloc_type_): New data member.
1550
06f30c9d
CC
15512013-06-27 Jing Yu <jingyu@google.com>
1552
1553 PR gold/15662
1554 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1555 function.
1556 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1557 (Target_powerpc::do_relax): Call the above.
1558
a2d7bf59
AM
15592013-06-27 Cary Coutant <ccoutant@google.com>
1560
1561 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1562 on garbage collected .opd section.
1563
15642013-06-27 Alan Modra <amodra@gmail.com>
1565
1566 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1567 is non-zero.
1568 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1569 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1570
32364e50
CC
15712013-06-14 Cary Coutant <ccoutant@google.com>
1572
1573 * resolve.cc (Symbol::override_base): Don't override st_type
1574 from plugin placeholder symbols.
1575 (Symbol_table::resolve): Likewise.
1576 (Symbol_table::should_override): Don't complain about TLS mismatch
1577 if the TO symbol is a plugin placeholder.
1578 * testsuite/Makefile.am (plugin_test_tls): New test.
1579 * testsuite/Makefile.in: Regenerate.
1580 * testsuite/plugin_test_tls.sh: New test script.
1581 * testsuite/two_file_test_2_tls.cc: New test source.
1582 * testsuite/two_file_test_tls.cc: New test source.
1583
7fb47cc9
CC
15842013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1585
1586 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1587 the maximum segment alignment is larger than the page size.
1588 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1589 correctly aligns the symbols with large alignemnt.
1590 * testsuite/Makefile.in: Regenerate.
1591 * testsuite/large_symbol_alignment.cc: New file.
1592
6934001a
CC
15932013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1594 Sriraman Tallam <tmsriram@google.com>
1595
1596 * options.h (sort_section): New option.
1597 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1598 Rename from Input_section_sort_section_name_special_ordering_compare.
1599 (Input_section_sort_section_name_compare): New struct.
1600 * output.cc (Output_section::Input_section_sort_section_name_compare::
1601 operator()): New function.
1602 (Output_section::sort_attached_input_sections): Use new sort function
1603 for .text if --sort-section=name is specified.
1604 * layout.cc (Layout::make_output_section):
1605 Add sorting by name when --sort-section=name is specified.
1606 * testsuite/Makefile.am (text_section_grouping): Test option
1607 --sort-section=name.
1608 * testsuite/Makefile.in: Regenerate.
1609 * testsuite/section_sorting_name.cc: New file.
1610 * testsuite/section_sorting_name.sh: New file.
1611
93acabad
CC
16122013-05-21 Cary Coutant <ccoutant@google.com>
1613
1614 * symtab.h (Symbol::is_cxx_vtable): New function.
1615 * target-reloc.h (relocate_section): Check for vtable symbol.
1616 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1617 * testsuite/Makefile.in: Regenerate.
1618 * testsuite/missing_key_func.cc: New test source.
1619 * testsuite/missing_key_func.sh: New test script.
1620
60e8b3fc
CC
16212013-05-21 Cary Coutant <ccoutant@google.com>
1622
2b64b551
RM
1623 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1624 type of enclosing symbol.
1625 (Relocate_info::location): Check symbol type when describing symbol.
1626 * object.h (Symbol_location_info): Remove unused line_number;
1627 add enclosing_symbol_type.
1628 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1629
9df9de2c
CC
16302013-05-13 Cary Coutant <ccoutant@google.com>
1631
2b64b551
RM
1632 * configure.ac: Export DEFAULT_TARGET.
1633 * configure: Regenerate.
1634 * Makefile.in: Regenerate.
1635 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1636 * testsuite/Makefile.in: Regenerate.
1637 * testsuite/debug_msg.sh: Delete duplicate tests.
1638 Don't check undef_int error message match for powerpc where the
1639 source file and line number aren't available.
9df9de2c 1640
bbc5ae17
RM
16412013-05-10 Roland McGrath <mcgrathr@google.com>
1642
1643 * options.h (General_options): Add --rosegment-gap option.
1644 * options.cc (finalize): --rosegment-gap implies --rosegment.
1645 * layout.cc (set_segment_offsets): Let user option override
1646 target->rosegment_gap().
1647
0c6e6c39
RM
16482013-05-10 Roland McGrath <mcgrathr@google.com>
1649
1650 * options.h (General_options): Remove leading space from help
1651 messages for -nostdlib and --rosegment.
1652
cde7cb01
MR
16532013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1654
1655 PR ld/15365
1656 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1657
f31ae5b8
AM
16582013-05-03 Alan Modra <amodra@gmail.com>
1659
1660 * merge.cc (Output_merge_string::do_add_input_section): Correct
1661 scan for number of strings. Rename vars to avoid shadowing.
1662 Include missing terminator in input_size_.
1663
d3a7cd45
L
16642013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1665
1666 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1667 Restore empty string handling.
1668
6ad3daba
CC
16692013-05-01 Cary Coutant <ccoutant@google.com>
1670
1671 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1672 uninitialized warning.
1673
e31908b6
CC
16742013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1675
1676 * output.cc (Output_section::add_merge_input_section): Allow
1677 to merge sections if the alignment is more than character size.
1678 * merge.h (Output_merge_string::Output_merge_string): Remove
1679 assert.
1680 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1681 only not-null strings. Check the alignment of strings.
1682 * stringpool.h
1683 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1684 alignment as the argument.
1685 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1686 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1687 Align non-zero length strings according to the addralign_.
1688 (Stringpool_template<Stringpool_char>::set_string_offsets):
1689 Updating offsets according to the given alignment.
1690 * testsuite/Makefile.am (text_section_grouping): Test if string
1691 literals are getting merged.
1692 * testsuite/Makefile.in: Regenerate.
1693 * testsuite/merge_string_literals_1.c: New file.
1694 * testsuite/merge_string_literals_2.c: Ditto.
1695 * testsuite/merge_string_literals.sh: Ditto.
1696
0e804863
ILT
16972013-04-26 Ian Lance Taylor <iant@google.com>
1698
1699 * target-reloc.h (relocate_section): If the reloc offset is out of
1700 range, pass VIEW as NULL to relocate.relocate.
1701 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1702 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1703 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1704 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1705 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1706 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1707
e7c5ea40
CC
17082013-04-26 Geoff Pike <gpike@chromium.org>
1709
1710 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1711 * layout.cc (Hash_task): New class.
1712 (Layout::queue_build_id_tasks): New function.
1713 (Layout::write_build_id): Handle single-thread portion of build ID
1714 computation. (In some cases, all of it is single-threaded.) Replace
1715 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1716 functionality in fewer lines of code.
1717 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1718 * options.h (General_options): make "--build-id" default to tree
1719 rather than sha1. Add two new options related to --build-id=tree:
1720 --build-id-chunk-size-for-treehash and
1721 --build-id-min-file-size-for-treehash.
1722 * Makefile.am: add testing of --build-id=tree and related new options
1723 (these tests will be invoked by "make check").
1724 * Makefile.in: Regenerate.
1725
49926cd0
AM
17262013-04-25 Alan Modra <amodra@gmail.com>
1727
1728 * configure.tgt: Add powerpcle and powerpc64le.
1729
a4034750
AM
17302013-04-22 Alan Modra <amodra@gmail.com>
1731
1732 PR gold/15355
1733 * layout.cc (Layout::segment_precedes): Allow more than one
1734 segment with the same type and flags.
1735
e79c84aa
CC
17362013-04-15 Cary Coutant <ccoutant@google.com>
1737
1738 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1739 allocate space in file for BSS sections.
1740
2199fbe7
CC
17412013-04-15 Cary Coutant <ccoutant@google.com>
1742
1743 * script-sections.cc (Orphan_output_section): Reset address
1744 to zero after each orphaned section for relocatable links.
1745
502e8a84
CC
17462013-04-15 Cary Coutant <ccoutant@google.com>
1747
a4034750
AM
1748 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1749 section starting address for relocatable link.
1750 * testsuite/Makefile.am (script_test_11): New test.
1751 * testsuite/Makefile.in: Regenerate.
1752 * testsuite/script_test_11.c: New source file.
1753 * testsuite/script_test_11.t: New linker script.
502e8a84 1754
0cfdc767
AM
17552013-04-13 Alan Modra <amodra@gmail.com>
1756
1757 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1758 owner when sections are not adjacent and exceed group size.
1759 (Target_powerpc::group_sections): Handle corner case.
1760 (Target_powerpc::Branch_info::make_stub): Handle case where
1761 stub table doesn't exist due to branches in non-exec sections.
1762 (Target_powerpc::Relocate::relocate): Likewise.
1763
6830ee24
AM
17642013-04-11 Alan Modra <amodra@gmail.com>
1765
1766 PR gold/15354
1767 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1768 .branch_lt to match bfd ld. Adjust comments throughout file.
1769
54a3d865
ILT
17702013-04-04 Ian Lance Taylor <iant@google.com>
1771
1772 GCC PR c++/56840
1773 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1774 sections before checking whether they are included in the link.
1775
9993ba11
ST
17762013-03-29 Sriraman Tallam <tmsriram@google.com>
1777
1778 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1779 object before calling the plugin claim_file handler. Pass the elf
1780 object of the archive to the plugin. Delete the elf object if the
1781 plugin claims the file.
1782
ebacd51e
AM
17832013-03-21 Alan Modra <amodra@gmail.com>
1784
1785 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1786 segment when omagic.
1787
117be58f
AM
17882013-03-21 Alan Modra <amodra@gmail.com>
1789
1790 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1791 comparison warning.
1792 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1793 uninitialized" warning.
1794
32e2b61d
AM
17952013-03-20 Alan Modra <amodra@gmail.com>
1796
1797 * symtab.h (Symbol::clear_version): New function.
1798 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1799 is_needed by weak references. Clear version for symbols defined
1800 in as-needed objects that are not needed.
1801
b3ccdeb5
AM
18022013-03-15 Alan Modra <amodra@gmail.com>
1803
1804 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1805 static and public. Add report_err param. Return false for data refs.
1806 (Target_powerpc::rela_dyn_section): New overloaded function.
1807 (Target_powerpc::plt_, iplt_): Elucidate.
1808 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1809 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1810 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1811 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1812 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1813 push_branch and make_plt_entry for ifunc syms when
1814 reloc_needs_plt_for_ifunc.
1815 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1816 for ifunc unless reloc_needs_plt_for_ifunc.
1817
ad3d8a2f
AM
18182013-03-15 Alan Modra <amodra@gmail.com>
1819
1820 * gc.h (gc_process_relocs): Don't look through function descriptors.
1821 * icf.cc (get_section_contents): Do so here instead.
1822
4d9aa155
AM
18232013-03-13 Alan Modra <amodra@gmail.com>
1824
1825 * powerpc.cc (is_branch_reloc): Forward declare.
1826 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1827 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1828 false for 64-bit, true for 32-bit non-branch relocs.
1829 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1830 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1831 nm output.
1832 (icf_safe_test): Generate linker map file as well as nm output.
1833 (icf_safe_so_test): Likewise.
1834 * testsuite/Makefile.in: Regenerate.
1835 * testsuite/icf_test.sh: Parse linker map file to determine
1836 section folding.
1837 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1838 * testsuite/icf_safe_so_test.sh: Likewise.
1839 (X86_32_or_ARM_specific_safe_fold): Merge into..
1840 (arch_specific_safe_fold): ..this.
1841 (X86_64_specific_safe_fold): Delete unused function.
1842
57420c20
AM
18432013-03-12 Alan Modra <amodra@gmail.com>
1844
1845 * gc.h (gc_process_relocs): Look through function descriptors
1846 to determine shndx, symvalue and addend used by ICF. Tidy
1847 variable duplication.
1848
dc3714f3
AM
18492013-03-11 Alan Modra <amodra@gmail.com>
1850
1851 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1852 * layout.cc (Layout_task_runner::run): ..to here.
1853 * symtab.h (struct Symbol_location): Extract from..
1854 (class Symbol_table): ..here.
1855 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1856 * target.h (class Target): Add function_location and
1857 do_function_location functions.
1858 (class Sized_target): Add do_function_location.
1859 * object.h (class Sized_relobj_file): Move find_shdr..
1860 (class Object): ..to here.
1861 * object.cc: Likewise. Update to suit. Instantiate.
1862 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1863 * powerpc.cc (class Powerpc_dynobj): New.
1864 (Target_powerpc::do_function_location): New function.
1865 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1866 (Powerpc_dynobj::do_read_symbols): New function.
1867 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1868
956b03bb
ILT
18692013-03-08 Ian Lance Taylor <iant@google.com>
1870
1871 * options.cc (General_options::string_to_object_format): Accept
1872 "default".
1873
4bead2d5
AM
18742013-03-08 Alan Modra <amodra@gmail.com>
1875
1876 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1877 pointer to Post_fde.
1878 (struct Post_fde): Move definition to here..
1879 * ehframe.cc (struct Post_fde): ..from here.
1880 (Cie::write): Don't alloc Post_fde.
1881 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1882
02e60bf7
AM
18832013-03-07 Alan Modra <amodra@gmail.com>
1884
1885 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1886 relocation referencing .LC0.
1887 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1888
8343f03a
AM
18892013-03-07 Alan Modra <amodra@gmail.com>
1890
1891 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1892 always_inline. Add assembly for powerpc to avoid GOT.
1893
3366d57c
AM
18942013-03-07 Alan Modra <amodra@gmail.com>
1895
1896 * testsuite/script_test_10.sh: Don't test .bss section
1897 header number.
1898
6c77229c
AM
18992013-03-06 Alan Modra <amodra@gmail.com>
1900
1901 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1902 (Target_powerpc::symval_for_branch): Add symtab param. Update
1903 all callers. Handle folded sections.
1904 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1905 to Powerpc_relobj.
1906 (Global_symbol_visitor_opd::operator()): Likewise.
1907
a39e4af6
AM
19082013-03-04 Alan Modra <amodra@gmail.com>
1909
1910 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1911 * testsuite/Makefile.in: Regenerate.
1912
d5834edb
CC
19132013-03-01 Cary Coutant <ccoutant@google.com>
1914
1915 Add dwp support for v2 DWARF package file format.
1916 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1917 tu_length parameter. Adjust all callers.
1918 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1919 * dwp.cc: Include dwarf.h.
1920 (Section_bounds): New struct type.
1921 (Unit_set): New struct type.
1922 (Dwo_file::Dwo_file): Initialize new data member.
1923 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1924 Combine and rename to...
1925 (Dwo_file::read_unit_index): ...this.
1926 (Dwo_file::sized_read_compunit_index)
1927 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1928 (Dwo_file::sized_read_unit_index): ...this.
1929 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1930 parameters; add section_id parameter.
1931 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1932 (Dwo_file::add_unit_set): ...this.
1933 (Dwo_file::shndx_map_): Remove.
1934 (Dwo_file::sect_offsets_): New data member.
1935 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1936 (Dwp_output_file::add_section): Rename to...
1937 (Dwp_output_file::add_contribution): ...this.
1938 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1939 (Dwp_output_file::add_tu_set): Likewise.
1940 (Dwp_output_file::Contribution): New type.
1941 (Dwp_output_file::Section::contributions): New data member.
1942 (Dwp_output_file::Cu_or_tu_set): Remove.
1943 (Dwp_output_file::Section::Section): New ctor.
1944 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1945 (Dwp_output_file::Dwp_index::Section_table): New type.
1946 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1947 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1948 parameter.
1949 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1950 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1951 (Dwp_output_file::Dwp_index::section_table): New member function.
1952 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1953 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1954 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1955 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1956 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1957 (Dwp_output_file::Dwp_index::section_table_): New data member.
1958 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1959 (Dwp_output_file::add_output_section): New member function.
1960 (Dwp_output_file::write_new_section): New member function.
1961 (Dwp_output_file::write_contributions): New member function.
1962 (Dwp_output_file::section_id_map_): New data member.
1963 (class Dwo_id_info_reader): Remove.
1964 (class Unit_reader): New class.
1965 (get_dwarf_section_name): New function.
1966 (Dwo_file::read_executable): Adjust initializations of class data.
1967 (Dwo_file::read): Add support for v2 package file format.
1968 (Dwo_file::read_unit_index): Likewise.
1969 (Dwo_file::sized_read_unit_index): Likewise.
1970 (Dwo_file::copy_section): Likewise.
1971 (Dwo_file::add_unit_set): Likewise.
1972 (Dwp_output_file::add_output_section): Likewise.
1973 (Dwp_output_file::add_contribution): Likewise.
1974 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1975 for empty slot.
1976 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1977 file format.
1978 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1979 slot.
1980 (Dwp_output_file::initialize): Remove unused function.
1981 (Dwp_output_file::finalize): Add support for v2 package file format.
1982 (Dwp_output_file::write_index): Likewise.
1983 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1984 function prototype.
1985
a68a081d
CC
19862013-03-01 Cary Coutant <ccoutant@google.com>
1987
1988 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1989 function into class definition in header file.
1990 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1991 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1992 New function.
1993 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1994
9d5781f8
AM
19952013-02-28 Alan Modra <amodra@gmail.com>
1996
1997 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1998 * target.cc (Target::do_plt_fde_location): New function.
1999 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2000 accessor function, and constructor param.
2001 (struct Post_fde, Post_fdes): Declare.
2002 (Cie::write): Add post_fdes param.
2003 * ehframe.cc (Fde::write): Use plt_fde_location.
2004 (struct Post_fde): Define.
2005 (Cie::write): Stash FDEs added post merge mapping.
2006 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2007 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2008 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2009 other FDEs.
2010 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2011 (Target_powerpc::has_glink): New function.
2012 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2013 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2014 glink_eh_frame_fde_32, default_fde): New data.
2015 (Stub_table::eh_frame_added_): New var.
2016 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2017 Make const.
2018 (Stub_table::add_eh_frame): New function.
2019 (Output_data_glink::add_eh_frame): New function.
2020 (Target_powerpc::make_glink_section): Call add_eh_frame.
2021
214383dd
ILT
20222013-02-15 Ian Lance Taylor <iant@google.com>
2023
2024 * options.h (DEFINE_uint64_alias): Define.
2025 (class General_options): Add -Ttext-segment as an alias for
2026 -Ttext.
2027
91c2b899
AM
20282013-02-15 Alan Modra <amodra@gmail.com>
2029
2030 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2031 (Stub_table::do_write): ..here, two places.
2032 (Stub_table::plt_call_size): Use it here too.
2033
20e2a8aa
ILT
20342013-02-11 Ian Lance Taylor <iant@google.com>
2035
2036 * descriptors.cc (Descriptors::close_all): New function.
2037 * descriptors.h (class Descriptors): Declare close_all.
2038 (close_all_descriptors): New inline function.
2039 * plugin.cc: Include "descriptors.h".
2040 (Plugin_manager::cleanup): Call close_all_descriptors.
2041
8952bc69
AM
20422013-02-06 Alan Modra <amodra@gmail.com>
2043
2044 * README: Update coding style link.
2045
29bd8b6b
CC
20462013-01-28 Cary Coutant <ccoutant@google.com>
2047
a4034750
AM
2048 * dwp.cc (File_list): New typedef.
2049 (Dwo_name_info_reader): New class.
2050 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2051 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2052 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2053 (Dwo_file::read_executable): New function.
2054 (Dwo_file::read): Move common setup code to ...
2055 (Dwo_file::make_object): ... here.
2056 (dwp_options): Add --exec/-e.
2057 (usage): Likewise.
2058 (main): Likewise.
29bd8b6b 2059
c6ac678d
ST
20602013-01-24 Sriraman Tallam <tmsriram@google.com>
2061
2062 * layout.cc (Layout::layout): Check for option text_reorder.
2063 (Layout::make_output_section): Ditto.
2064 * options.h (text_reorder): New option.
2065 * output.cc (Input_section_sort_compare): Remove special ordering
2066 of section names.
2067 (Output_section::
2068 Input_section_sort_section_name_special_ordering_compare::
2069 operator()): New function.
2070 (Output_section::sort_attached_input_sections): Use new sort function
2071 for .text.
2072 * output.h (Input_section_sort_section_name_special_ordering_compare):
2073 New struct.
2074 * testsuite/Makefile.am (text_section_grouping): Test option
2075 --no-text-reorder
2076 * testsuite/Makefile.in: Regenerate.
2077 * testsuite/text_section_grouping.sh: Check order of functions without
2078 default text reordering.
2079
50701cc1
MF
20802013-01-18 Mike Frysinger <vapier@gentoo.org>
2081
2082 * options.h (General_options): Change default to true for new_dtags.
2083
b1b00fcc
MF
20842013-01-18 Mike Frysinger <vapier@gentoo.org>
2085
2086 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2087 when enable_new_dtags is false. Only add DT_RUNPATH when
2088 enable_new_dtags is true.
2089
ec5b8187
AM
20902013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2091
2092 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2093 used in declaration and definition consistent.
2094 (Target_powerpc::symval_for_branch): Ditto.
2095
a880d4c4
ST
20962013-01-16 Sriraman Tallam <tmsriram@google.com>
2097
2098 * testsuite/plugin_final_layout.cc: Fix comment.
2099
7c381248
ST
21002013-01-16 Sriraman Tallam <tmsriram@google.com>
2101
2102 * layout.cc (Layout::layout): Do not do default sorting for
2103 text sections when section ordering is specified.
2104 (make_output_section): Ditto.
2105 * testsuite/plugin_final_layout.cc: Name the function sections
2106 to catch reordering issues.
2107
e2458743
AM
21082013-01-15 Alan Modra <amodra@gmail.com>
2109
2110 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2111 plt-thread-safe.
2112
431ed302
AM
21132013-01-15 Alan Modra <amodra@gmail.com>
2114
2115 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2116 * testsuite/Makefile.in: Regenerate.
2117
0ec6429b
AM
21182013-01-14 Alan Modra <amodra@gmail.com>
2119
2120 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2121 * testsuite/Makefile.in: Regenerate.
2122
0bf402d5
ILT
21232013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2124
36af3926 2125 PR bfd/14430
0bf402d5
ILT
2126 Fix mingw gold build with plugins enabled
2127 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2128 * configure.ac: Export DLOPEN_LIBS and add headers check.
2129 * plugin.cc: Handle non-dlfcn case.
2130 * Makefile.in: Regenerate.
2131 * config.in: Regenerate.
2132 * configure: Regenerate.
2133 * testsuite/Makefile.in: Regenerate.
2134
9e9143bc
ST
21352013-01-09 Sriraman Tallam <tmsriram@google.com>
2136
2137 * output.h (sort_attached_input_sections): Change to be public.
2138 * script-sections.cc
2139 (Output_section_definition::set_section_addresses): Sort
2140 attached input sections according to section order before linker
2141 script assigns section addresses.
2142 (Orphan_output_section::set_section_addresses): Sort
2143 attached input sections according to section order before linker
2144 script assigns section addresses.
2145 * Makefile.am (final_layout.sh): Use a simple linker script to
2146 check if section ordering still works.
2147 * Makefile.in: Regenerate.
2148
679af368
ILT
21492013-01-09 Ben Cheng <bccheng@google.com>
2150
2151 * arm.cc (Target_arm::attributes_accept_div): New function.
2152 (Target_arm::attributes_forbid_div): New function.
2153 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2154 attribute using the same new functions as what bfd/elf32_arm.c
2155 does.
2156
3136a00e
CC
21572013-01-07 Cary Coutant <ccoutant@google.com>
2158
2159 PR gold/14993
2160 * output.cc (Output_section::add_input_section): For incremental
2161 updates, don't track input sections that are allocated from patch
2162 space.
2163
f2a6224b
L
21642013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2165 Ian Lance Taylor <iant@google.com>
2166
2167 PR gold/14897
2168 * configure.ac (--enable-ld): Removed.
2169 (install_as_default): Set to yes only for --enable-gold=default
2170 or --disable-ld.
2171 * configure: Regenerated.
2172
4f46f626
L
21732013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2174
2175 * options.h (General_options): Add -fuse-ld= for GCC linker
2176 option compatibility.
2177
26e4ef59
CC
21782013-01-04 Cary Coutant <ccoutant@google.com>
2179
2180 * configure.ac: Fix typo restoring CXXFLAGS.
2181 * configure: Regenerate.
2182
3d587466
CC
21832013-01-04 Cary Coutant <ccoutant@google.com>
2184
4f46f626
L
2185 * testsuite/Makefile.am (CXXLINK_S): New macro.
2186 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2187 * testsuite/Makefile.in: Regenerate.
3d587466 2188
44db6695
L
21892013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2190
2191 * version.cc (print_version): Update copyright year to 2013.
2192
edcac0c1
ILT
21932012-12-20 Ian Lance Taylor <iant@google.com>
2194
2195 * layout.cc (Layout::special_ordering_of_input_section): New
2196 function.
2197 (Layout::layout): If input section requires special ordering, must
2198 sort input sections.
2199 (Layout::make_output_section): May sort .text input sections.
2200 (Layout::is_section_name_prefix_grouped): Remove.
2201 * layout.h (class Layout): Declare
2202 special_ordering_of_input_section. Don't declare
2203 is_section_name_prefix_grouped.
2204 * output.cc (Output_section::add_input_section): Revert last
2205 change.
2206 (Output_section::Input_section_sort::match_file_name): Don't crash
2207 if called on output section data.
2208 (Output_section::Input_section_sort_compare): Sort based on
2209 special ordering.
2210 (Output_section::Input_section_sort_section_order_index_compare):
2211 Revert last patch.
2212 (Output_section::sort_attached_input_sections): Likewise.
2213
28f2a4ac
ST
22142012-12-18 Sriraman Tallam <tmsriram@google.com>
2215
edcac0c1 2216 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2217 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2218 * output.cc (Output_section::add_input_section): Check if section
2219 name contains special prefix. Keep input sections to sort such
2220 sections.
2221 (Output_section::Input_section_sort_section_order_index_compare
2222 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2223 (Output_section::sort_attached_input_sections): Add condition to
2224 Input_section_entry constructor call.
28f2a4ac
ST
2225 * testsuite/Makefile.am (text_section_grouping): New test.
2226 * testsuite/Makefile.in: Regenerate.
2227 * testsuite/text_section_grouping.cc: New file.
2228 * testsuite/text_section_grouping.sh: New file.
2229
5bf135a7
NC
22302012-12-17 Nick Clifton <nickc@redhat.com>
2231
2232 * Makefile.am: Add copyright notice.
2233 * NEWS: Likewise.
2234 * README: Likewise.
2235 * configure.ac: Likewise.
2236 * ftruncate.c: Likewise.
2237 * Makefile.in: Regenerate.
2238
59965708
CC
22392012-12-14 Cary Coutant <ccoutant@google.com>
2240
a4034750
AM
2241 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2242 --no-as-needed flag.
2243 (exception_separate_shared_12_test): Likewise.
2244 (incremental_copy_test): Likewise.
2245 * testsuite/Makefile.in: Regenerate.
59965708 2246
2a77e2ab
CC
22472012-12-14 Cary Coutant <ccoutant@google.com>
2248
2249 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2250 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2251
e3deeb9c
AM
22522012-12-12 Alan Modra <amodra@gmail.com>
2253
2254 * powerpc.cc (class Track_tls): New.
2255 (class Relocate, class Scan): Inherit Track_tls.
2256 (Target_powerpc::Scan::local, global): Track tls optimization
2257 and avoid creating plt entry for __tls_get_addr if all uses
2258 are optimized away.
2259 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2260
d8f5a274
AM
22612012-12-12 Alan Modra <amodra@gmail.com>
2262
2263 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2264 Replace no_toc_optimize with toc_optimize.
2265 * output.h (Output_section::input_sections): Provide non-const variant.
2266 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2267 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2268 accessors.
2269 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2270 (class Sort_toc_sections): New.
2271 (Target_powerpc::do_finalize_sections): Sort toc sections.
2272 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2273
4c8a1de1
RM
22742012-12-10 Roland McGrath <mcgrathr@google.com>
2275
2276 * testsuite/binary_unittest.cc (read_all): New function.
2277 (Sized_binary_test): Use it instead of ::read.
2278 * fileread.cc (do_read): Don't assume pread always reads the whole
2279 amount in a single call.
2280
edc27beb
AM
22812012-12-10 Alan Modra <amodra@gmail.com>
2282
2283 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2284 Set EM_PPC64 or EM_PPC here.
2285 (Target_selector_powerpc::do_recognize): Delete.
2286
906b9150
AM
22872012-12-10 Alan Modra <amodra@gmail.com>
2288
2289 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2290 stub_table_.
2291 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2292
418c15ae
RM
22932012-12-07 Roland McGrath <mcgrathr@google.com>
2294
2295 * testsuite/binary_unittest.cc (Sized_binary_test):
2296 Use open_descriptor rather than ::open.
2297
decdd3bc
AM
22982012-12-07 Alan Modra <amodra@gmail.com>
2299
2300 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2301 typedef and invalid_address constant.
2302 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2303 instantiate constants.
2304
db399005
ILT
23052012-12-06 Roland McGrath <mcgrathr@google.com>
2306
2307 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2308 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2309 * aclocal.m4: Regenerate.
2310 * configure: Regenerate.
2311 * Makefile.in: Regenerate.
2312 * testsuite/Makefile.in: Regenerate.
2313
aba6bc71
AM
23142012-12-07 Alan Modra <amodra@gmail.com>
2315
2316 * options.h (General_options): Add no_toc_optimize.
2317 * powerpc.cc (ok_lo_toc_insn): New function.
2318 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2319
9e69ed50
AM
23202012-12-06 Alan Modra <amodra@gmail.com>
2321
2322 * options.h (General_options): Add plt_align, plt_static_chain,
2323 plt_thread_safe. Update stub_group_size help text.
2324 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2325 for new plt_thread_safe_ var.
2326 (use_plt_offset): Correct comments.
2327 (Target_powerpc::do_relax): Look for thread creation symbols to
2328 determine default plt_thread_safe value. Clear plt call stubs
2329 as well as branch stubs each iteration.
2330 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2331 insn constants.
2332 (l, hi, ha, write_insn): Move earlier.
2333 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2334 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2335 plt stubs too.
2336 (Stub_table::update_size): Adjust.
2337 (Stub_table::prev_size, set_prev_size): Delete.
2338 (Stub_table::stub_align): Let --plt-align affect result.
2339 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2340 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2341 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2342 (Stub_table::do_write): Support more stub variants.
2343
f43ba157
AM
23442012-12-04 Alan Modra <amodra@gmail.com>
2345
2346 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2347 (Target_powerpc::do_define_standard_symbols): New function.
2348
34171bc5
AM
23492012-12-03 Alan Modra <amodra@gmail.com>
2350
2351 * output.h: Formatting, whitespace.
2352
dc9589e9 23532012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2354
2355 * layout.h (Layout::get_executable_sections): Declare.
2356 * layout.cc (Layout::get_executable_sections): New function.
2357 * arm.cc (Target_arm::group_sections): Use it.
2358 (Arm_output_section::group_sections): Delete now redundant test.
2359 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2360 param to handle relative relocs.
2361 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2362 (Output_data_reloc::add_absolute): Adjust.
2363 (Output_data_reloc::add_relative): New function.
2364 (Output_data::reset_data_size): New function.
2365 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2366 (Output_section::set_addralign): New function.
2367 (Output_section::checkpoint_set_addralign): New function.
2368 (Output_section::clear_section_offsets_need_adjustment): New function.
2369 (Output_section::input_sections): Make public.
2370 * powerpc.cc (class Output_data_brlt_powerpc): New.
2371 (class Stub_table, class Stub_control): New.
2372 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2373 stub_table_, set_stub_table, stub_table): New vectors and accessor
2374 functions.
2375 (Target_powerpc::do_may_relax, do_relax, push_branch,
2376 new_stub_table, stub_tables, brlt_section, group_sections,
2377 add_branch_lookup_table, find_branch_lookup_table,
2378 write_branch_lookup_table, make_brlt_section): New functions.
2379 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2380 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2381 branch_info_): New vars.
2382 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2383 make call stubs here.
2384 (Output_data_glink): Remove all call stub handling from this class.
2385 (Target_powerpc::Scan::local, global): Save interesting branch
2386 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2387 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2388 functions on final link.
2389 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2390 Handle long branch destinations too.
2391 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2392 do_plt_address_for_local): Adjust lookup of plt call stubs.
2393
627b30b7
AM
23942012-11-30 Alan Modra <amodra@gmail.com>
2395
2396 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2397 relocs against protected symbols when building 32-bit shared libs.
2398
40b469d7
AM
23992012-11-30 Alan Modra <amodra@gmail.com>
2400
2401 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2402 param. Call got_section() to make .got. Update all callers
2403 and their callers and so on.
2404
bb66a627
AM
24052012-11-30 Alan Modra <amodra@gmail.com>
2406
2407 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2408 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2409 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2410 value if it already exists.
2411
d2cf1c6c
L
24122012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2413
2414 PR gold/14858
2415 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2416
edccdf7c
RM
24172012-11-14 Roland McGrath <mcgrathr@google.com>
2418
2419 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2420 than bfc instruction for data sandboxing.
2421
6febeb74
AM
24222012-11-08 Alan Modra <amodra@gmail.com>
2423
2424 * po/POTFILES.in: Regenerate.
2425
0a6f1bf2
AM
24262012-11-05 Alan Modra <amodra@gmail.com>
2427
2428 * configure.ac: Apply 2012-09-10 change to config.in here.
2429 * configure: Regenerate.
2430
26a4e9cb
AM
24312012-11-05 Alan Modra <amodra@gmail.com>
2432
2433 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2434 (struct Opd_ent): Use "Address" rather than "Offset".
2435 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2436 (Target_powerpc::got_section): Make public.
2437 (Target_powerpc::scan_relocs): Move code setting symbols..
2438 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2439 Create _SDA_BASE_ only when referenced.
2440
cc928013
RM
24412012-11-02 Roland McGrath <mcgrathr@google.com>
2442
2443 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2444 from last change.
2445
50ed5eb1
RM
24462012-11-01 Roland McGrath <mcgrathr@google.com>
2447
62fe925a
RM
2448 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2449 for offset_in_output_section parameter.
2450 (Sized_target::relocate_special_relocatable): Likewise.
2451 * arm.cc (Target_arm::relocate_relocs): Likewise.
2452 (Target_arm::relocate_special_relocatable): Likewise.
2453 * i386.cc (Target_i386::relocate_relocs): Likewise.
2454 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2455 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2456 * target-reloc.h (relocate_relocs): Likewise.
2457 * testsuite/testfile.cc (Target_test): Likewise.
2458 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2459 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2460
2461 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2462 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2463
2464 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2465 parameter, which is unused in the [!F_SETFD] case.
2466
50ed5eb1
RM
2467 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2468 SYMNDX to off_t before comparing it to this->data_size().
2469 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2470 * incremental.cc (Output_section_incremental_inputs::do_write):
2471 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2472
2cadc0bf
RM
2473 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2474
3bfcb652
NC
24752012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2476
2477 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2478 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2479 in EABI_VER5.
2480
c1a8d56e
CC
24812012-10-29 Cary Coutant <ccoutant@google.com>
2482
2483 * dwp.cc (usage): Add file and exit status parameters;
2484 add --help and --version options.
2485 (print_version): New function.
2486 (main): Add --help and --version options.
2487
b2490a7b
L
24882012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2489
2490 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2491 final_layout_sequence.txt.
2492 * testsuite/Makefile.in: Regenerated.
2493
aa543512
L
24942012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2495
2496 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2497 COMPILE generated by automake.
2498 (LINK1): Likewise.
2499 (CXXCOMPILE1): Likewise.
2500 (CXXLINK1): Likewise.
2501 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2502 (LINK): Likewise.
2503 (CXXCOMPILE): Likewise.
2504 (CXXLINK): Likewise.
2505 * testsuite/Makefile.in: Regenerated.
2506
d361fafb
L
25072012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2508
2509 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2510 on bad fwrite return.
2511
598c7410
L
25122012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2513
2514 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2515 on val.
2516
35c813e2
CC
25172012-10-23 Cary Coutant <ccoutant@google.com>
2518
2519 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2520 * testsuite/Makefile.in: Regenerate.
2521 * testsuite/dwp_test.h: New source file.
2522 * testsuite/dwp_test_1.cc: New source file.
2523 * testsuite/dwp_test_1.s: New source file.
2524 * testsuite/dwp_test_1.sh: New source file.
2525 * testsuite/dwp_test_1b.cc: New source file.
2526 * testsuite/dwp_test_1b.s: New source file.
2527 * testsuite/dwp_test_2.cc: New source file.
2528 * testsuite/dwp_test_2.s: New source file.
2529 * testsuite/dwp_test_2.sh: New source file.
2530 * testsuite/dwp_test_main.cc: New source file.
2531 * testsuite/dwp_test_main.s: New source file.
2532
77429909
CC
25332012-10-23 Cary Coutant <ccoutant@google.com>
2534
2535 * dwp.h: New header file.
2536 * dwp.cc: New source file.
2537 * gold.h: Move shared declarations to system.h.
2538 * system.h: New header file.
2539 * Makefile.am: Add dwp.
2540 * Makefile.in: Regenerate.
2541
ed5d6712
CC
25422012-10-23 Cary Coutant <ccoutant@google.com>
2543
2544 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2545 Dwarf_info_reader::read_from_pointer.
2546 (Dwarf_pubnames_table::read_header): Likewise.
2547 (Dwarf_pubnames_table::next_name): Likewise.
2548 (Dwarf_die::read_attributes): Likewise.
2549 (Dwarf_die::skip_attributes): Likewise.
2550 (Dwarf_info_reader::read_from_pointer): New function template.
2551 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2552 (Dwarf_pubnames_table): Likewise.
2553 (Dwarf_info_reader::read_from_pointer): New function template.
2554 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2555 Dwarf_pubnames_table ctor.
2556
8787852d
CC
25572012-10-23 Cary Coutant <ccoutant@google.com>
2558
2559 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2560 abbrev_shndx.
2561 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2562 abbrev_shndx_.
2563 (Dwarf_info_reader::set_abbrev_shndx): New method.
2564 (Dwarf_info_reader::abbrev_shndx_): New data member.
2565
9fc236f3
CC
25662012-10-23 Cary Coutant <ccoutant@google.com>
2567
2568 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2569 from object, not parameters.
2570 (Dwarf_info_reader::parse): Likewise.
2571 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2572 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2573 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2574 methods.
2575
effe8365
CC
25762012-10-23 Cary Coutant <ccoutant@google.com>
2577
2578 * fileread.cc (Input_file::Input_file): New constructor.
2579 * fileread.h (class Input_file): Add new constructor.
2580
1698990d
AM
25812012-10-18 Alan Modra <amodra@gmail.com>
2582
2583 PR gold/14727
2584 * object.cc (Relobj::is_section_name_included): Also match
2585 .sdata personality section.
2586
168a4726
AM
25872012-10-18 Alan Modra <amodra@gmail.com>
2588
2589 * target-reloc.h (class Default_comdat_behavior): New, package up..
2590 (get_comdat_behaviour): ..this.
2591 (relocate_section): Add Relocate_comdat_behavior template arg,
2592 adjust code to suit.
2593 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2594 (Target_arm::scan_reloc_section): Likewise.
2595 * i386.cc (Target_i386::relocate_section): Likewise.
2596 * sparc.cc (Target_sparc::relocate_section): Likewise.
2597 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2598 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2599 * powerpc.cc (class Relocate_comdat_behavior): New.
2600 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2601 gold::relocate_section with new template arg.
2602
acc276d8
AM
26032012-10-18 Alan Modra <amodra@gmail.com>
2604
2605 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2606 dynamic relocs for GOT_TPREL got entries, without symbol if
2607 resolving locally.
2608 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2609 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2610 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2611
e10f9870
AM
26122012-10-17 Alan Modra <amodra@gmail.com>
2613
2614 PR gold/14726
2615 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2616
ae034989
ST
26172012-10-16 Sriraman Tallam <tmsriram@google.com>
2618
2619 * layout.cc (Layout::include_section): Keep sections marked
2620 SHF_EXCLUDE when doing relocatable links.
2621
f3a0ed29
AM
26222012-10-16 Alan Modra <amodra@gmail.com>
2623
2624 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2625 (Target_powerpc::do_finalize_sections): Call it.
2626 (Output_data_save_res): New class and supporting functions.
2627 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2628 normal symbols defined in object files.
2629
c6de8ed4
AM
26302012-10-12 Alan Modra <amodra@gmail.com>
2631
2632 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2633 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2634 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2635 section if scan_opd_relocs not yet called.
2636 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2637
03e25981
AM
26382012-10-12 Alan Modra <amodra@gmail.com>
2639
2640 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2641 add_local_ifunc_entry): Revert last change.
2642 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2643
c9824451
AM
26442012-10-05 Alan Modra <amodra@gmail.com>
2645
2646 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2647 do_plt_address_for_global): New functions.
2648 (Output_data_got_powerpc::do_write): Don't segfault when linking
2649 statically.
2650 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2651 add_local_ifunc_entry): Return true on adding entry..
2652 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2653 glink->add_entry call. Remove unused symtab param. Adjust calls.
2654 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2655 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2656 set up symbols here.
2657 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2658 syms here. Do so even when no .iplt. Don't segfault when linking
2659 statically.
2660 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2661 new variants without reloc param.
2662 (Glink_sym_ent::Glink_sym_ent): Likewise.
2663 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2664 reloc when refs will resolve to plt call stub.
2665 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2666 R_PPC_PLTREL24 to resolve locally.
2667 (Target_powerpc::Scan::global): Correct ifunc handling.
2668 (Target_powerpc::Relocate::relocate): Correct local sym glink
2669 lookup. Don't destroy "value" when we have a plt call stub,
2670 and when checking plt call validity.
2671 (Target_powerpc::do_dynsym_value): Simplify.
2672
19fec8c1
AM
26732012-10-05 Alan Modra <amodra@gmail.com>
2674
2675 * i386.cc (Output_data_plt_i386::address_for_global,
2676 address_for_local): Add plt offset to returned value. Adjust uses.
2677 * sparc.cc (Output_data_plt_sparc::address_for_global,
2678 address_for_local): Likewise.
2679 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2680 address_for_local): Likewise.
2681 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2682 address_for_local): Likewise.
2683 * target.h (Target::plt_address_for_global, plt_address_for_local):
2684 Update comment.
2685 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2686 (Output_data_got::Got_entry::write): Nor here.
2687 * output.h: Comment fix.
2688
e867b647
WL
26892012-10-02 Jiong Wang <jiwang@tilera.com>
2690
2691 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2692 global_offset_table_ value for larget got.
2693 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2694
e5d5f5ed
AM
26952012-09-29 Alan Modra <amodra@gmail.com>
2696
2697 * powerpc.cc (Target_powerpc::iplt_): New output section.
2698 (Target_powerpc::iplt_section, make_iplt_section,
2699 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2700 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2701 Target_powerpc::plt_entry_count): Count iplt entries too.
2702 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2703 reloc section in constructor. New params.
2704 (Target_powerpc::make_plt_section): Create reloc section here instead.
2705 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2706 functions.
2707 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2708 (Output_data_glink::add_entry, find_entry): New functions to
2709 deal with local syms.
2710 (Glink_sym_ent): Add support for local syms.
2711 (Output_data_glink::do_write): Handle ifunc plt entries.
2712 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2713 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2714 (Target_powerpc::Relocate::relocate): Likewise.
2715 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2716
ec4dbad3
AM
27172012-09-25 Alan Modra <amodra@gmail.com>
2718
2719 * object.h (Sized_relobj_file::adjust_local_symbol,
2720 do_adjust_local_symbol): New functions.
2721 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2722 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2723 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2724 and irregular opd entry spacing.
2725 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2726 (Global_symbol_visitor_opd): New functor.
2727 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2728 on deleted opd entries.
2729
5c0b3823
WL
27302012-09-15 Jiong Wang <jiwang@tilera.com>
2731
2732 * tilegx.cc: New file.
2733 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2734 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2735 * configure.tgt: Add entries for tilegx*.
2736 * configure.ac: Likewise.
2737 * Makefile.in: Rebuild.
2738 * configure: Likewise.
2739 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2740 tilegx.
2741
bfdfa4cd
AM
27422012-09-13 Alan Modra <amodra@gmail.com>
2743
2744 * target-reloc.h (scan_relocs): Call scan.local for relocs
2745 against symbols in discarded sections. Pass is_discarded
2746 param.
2747 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2748 Add is_discarded param.
2749 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2750 is_discarded to flag opd entry as discarded. Don't emit dyn
2751 relocs on such entries.
2752 (Target_powerpc::Scan::global): Similarly detect and handle
2753 such opd entries.
2754 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2755 opd_ent_. Update all uses.
2756 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2757 (Target_powerpc::relocate_section): Zero out discarded opd
2758 entry relocs.
2759
d77a0555
ILT
27602012-09-12 Ian Lance Taylor <iant@google.com>
2761
2762 PR gold/14570
2763 * output.cc: Rename Output_data_got template parameter from size
2764 to got_size for all functions. Compile all variants of
2765 Output_data_got.
2766 (Output_data_got::Got_entry::write): Correct use of size for
2767 symbol value. Use local_is_tls rather than casting to
2768 Sized_relobj_file.
2769 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2770 (class Sized_relobj_file): Add do_local_is_tls.
2771 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2772
815a1205
AM
27732012-09-11 Alan Modra <amodra@gmail.com>
2774
2775 PR gold/14566
2776 * layout.cc (Layout::set_segment_offsets): When using
2777 common-page-size alignment, ensure we are on a new max-page-size
2778 page.
2779 * output.cc (Output_segment::set_section_addresses): Use
2780 abi_pagesize, not common_pagesize for relro boundary.
2781 (Output_segment::set_offset): Likewise.
2782
bd73a62d
AM
27832012-09-11 Alan Modra <amodra@gmail.com>
2784
2785 * output.h (Output_data_got::add_global_tls, add_local_tls,
2786 add_local_tls_pair): New functions.
2787 (Output_data_got::add_local_pair_with_rel): Remove second
2788 reloc param. Expand comment.
2789 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2790 use_plt_or_tls_offset_, similarly for constructor param.
2791 (Output_data_got::Got_entry::write): Add got_index param.
2792 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2793 add_local_tls_pair): New functions.
2794 (Output_data_got::Got_entry::write): Handle tls symbols
2795 with use_plt_or_tls_offset_ set specially.
2796 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2797 (Output_data_got::do_write): Replace iterator with index, pass
2798 index to entry write function.
2799 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2800 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2801 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2802 call.
2803 * i386.cc (Target_i386::Scan::local): Likewise.
2804 * sparc.cc (Target_sparc::Scan::local): Likewise.
2805 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2806 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2807 do_tls_offset_for_global): New functions.
2808 (Target_powerpc::Scan::local): Correct TLS relocations and got
2809 entry values.
2810 (Target_powerpc::Scan::global): Don't emit unnecessary
2811 dynamic relocations on TLS GOT entries.
2812
00716ab1
AM
28132012-09-10 Matthias Klose <doko@ubuntu.com>
2814
2815 * config.in: Disable sanity check for kfreebsd.
2816
c891b3f9
SA
28172012-09-10 Sterling Augustine <saugustine@google.com>
2818
2819 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2820 (Gdb_index::pubtypes_read): New parameter.
2821 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2822 to calls.
2823 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2824 pubtypes_object_.
2825
e81fea4d
AM
28262012-09-09 Alan Modra <amodra@gmail.com>
2827
2828 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2829 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2830 * gc.h (gc_process_relocs): Call target gc_add_reference.
2831 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2832 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2833 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2834 unnecessary cast.
2835 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2836 to cater for when we don't need code offset. Update use.
2837 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2838 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2839 set_opd_valid): New functions.
2840 (Target_powerpc::do_gc_add_reference): New function.
2841 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2842 stashed refs.
2843 (Target_powerpc::do_gc_mark_symbol): New function.
2844
d2d60eef
CC
28452012-09-06 Cary Coutant <ccoutant@google.com>
2846
2847 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2848 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2849 (Dwarf_die::skip_attributes): Likewise.
2850 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2851 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2852 (main): Call it.
2853 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2854
32ed4573
L
28552012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2856
2857 * testsuite/script_test_3.t: Add .got.plt output section
2858 statement.
2859 * testsuite/script_test_4.t: Likewise.
2860
f4baf0d4
AM
28612012-09-05 Alan Modra <amodra@gmail.com>
2862
2863 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2864 update all uses and lose "enum" when using type.
2865
864a1b56
AM
28662012-09-05 Alan Modra <amodra@gmail.com>
2867
2868 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2869 * configure: Regenerate.
2870 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2871 (plugin_final_layout.stdout): Likewise.
2872 (memory_test): Set page sizes to 0x1000.
2873 * testsuite/Makefile.in: Regenerate.
2874 * testsuite/discard_locals_test.sh: Add FIXME comment.
2875 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2876 * testsuite/pr14265.t: Add .got output section statement.
2877 * testsuite/script_test_2.t: Likewise.
2878 * testsuite/script_test_3.t: Likewise.
2879 * testsuite/script_test_4.t: Likewise.
2880 * testsuite/script_test_5.t: Likewise.
2881 * testsuite/script_test_6.t: Likewise.
2882 * testsuite/script_test_7.t: Likewise.
2883 * testsuite/script_test_9.t: Likewise.
2884
3ea0a085
AM
28852012-09-05 Alan Modra <amodra@gmail.com>
2886
2887 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2888 (Powerpc_relocate_functions::Status): New typedef.
2889 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2890 (Target_powerpc::Scan::local): Handle REL64.
2891 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2892 for REL32 and REL64.
2893 (Target_powerpc::symval_for_branch): New function, extracted from..
2894 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2895 checks. Report overflow errors.
2896
7404fe1b
AM
28972012-09-05 Alan Modra <amodra@gmail.com>
2898
2899 * object.h (Sized_relobj_file::emit_relocs): Delete.
2900 (Sized_relobj_file::emit_relocs_reltype): Delete.
2901 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2902 relocate_relocs for --emit-relocs.
2903 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2904 * output.h: Update comment.
2905 (Output_segment::first_section): New function.
2906 (Output_segment::first_section_load_address): Use first_section.
2907 * output.cc (Output_segment::first_section): New function extracted..
2908 (Output_segment::first_section_load_address): ..from here. Delete.
2909 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2910 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2911 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2912 adjust call to target.h function.
2913 * i386.cc (Target_i386): Likewise.
2914 * sparc.cc (Target_sparc): Likewise.
2915 * x86_64.cc (Target_x86_64): Likewise.
2916 * powerpc.cc (Target_powerpc): Likewise.
2917 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2918 first tls section has section symbol for optimised local dynamic
2919 output relocs.
2920 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2921 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2922 optimised tls code.
2923 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2924 Rename to relocate_relocs. Update error message.
2925
957564c9
AS
29262012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2927
2928 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2929 --just-symbols.
2930
dd93cd0a
AM
29312012-08-31 Alan Modra <amodra@gmail.com>
2932
2933 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2934 (Powerpc_relobj::toc_base_offset): New stub function.
2935 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2936 got_mod_index_offset to tlsld_got_offset. Update all refs.
2937 (Target_powerpc::Relocate::enum skip_tls): New.
2938 (Target_powerpc::call_tls_get_addr_): New var.
2939 (Target_powerpc::is_branch_reloc): Move to file scope.
2940 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2941 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2942 New functions.
2943 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2944 (powerpc_info): Correct common_pagesize for ppc64.
2945 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2946 (Powerpc_relocate_functions): Add overflow check enums and functions.
2947 Add non-shift version of rela, rela_ua. Delete all rel public
2948 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2949 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2950 addr16_ha3, addr14 functions.
2951 (Output_data_got_powerpc::add_constant_pair): New function.
2952 (Output_data_got_powerpc::got_base_offset): Likewise.
2953 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2954 (instruction constants): Sort, add some more.
2955 (Output_data_glink::do_write): Add and use Address typedef. Use
2956 object->toc_base_offset() stub for 64-bit.
2957 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2958 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2959 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2960 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2961 Always treat .opd relocs as against locally defined symbol.
2962 Correct condition for RELATIVE relocs.
2963 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2964 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2965 for 32-bit syms with a plt entry. Correct ppc64 toc base
2966 calculations. Handle TLS relocs, and more. Add overflow
2967 checking and adjust for Powerpc_relocate_functions changes.
2968 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2969 Reinstate --emit-relocs code with FIXME.
2970
a1373b60
AM
29712012-08-30 Alan Modra <amodra@gmail.com>
2972
2973 * layout.cc (Layout::set_segment_offsets): Set p_align to
2974 abi_pagesize, not common_pagesize.
2975 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2976 to determine whether file header can go in segment.
2977
703d02da
AM
29782012-08-30 Alan Modra <amodra@gmail.com>
2979
2980 * output.h (Output_reloc::Output_reloc <output section>): Add
2981 is_relative param. Adjust calls.
2982 (Output_reloc::add_output_section_relative): New functions.
2983 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2984 is_relative.
2985 (Output_reloc::symbol_value): Handle SECTION_CODE.
2986
16164a6b
ST
29872012-08-24 Sriraman Tallam <tmsriram@google.com>
2988
2989 * gold.cc (queue_middle_tasks): Call layout again when unique
2990 segments for sections is desired.
2991 * layout.cc (Layout::Layout): Initialize new members.
2992 (Layout::get_output_section_flags): New function.
2993 (Layout::choose_output_section): Call get_output_section_flags.
2994 (Layout::layout): Make output section for mapping to a unique segment.
2995 (Layout::insert_section_segment_map): New function.
2996 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2997 output sections marked so.
16164a6b
ST
2998 (Layout::segment_precedes): Check for unique segments when sorting.
2999 * layout.h (Layout::Unique_segment_info): New struct.
3000 (Layout::Section_segment_map): New typedef.
3001 (Layout::insert_section_segment_map): New function.
3002 (Layout::get_output_section_flags): New function.
3003 (Layout::is_unique_segment_for_sections_specified): New function.
3004 (Layout::set_unique_segment_for_sections_specified): New function.
3005 (Layout::unique_segment_for_sections_specified_): New member.
3006 (Layout::section_segment_map_): New member.
3007 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3008 Rename is_gc_pass_one to is_pass_one.
3009 Rename is_gc_pass_two to is_pass_two.
3010 Rename is_gc_or_icf to is_two_pass.
3011 Check for which pass based on whether symbols data is present.
3012 Make it two pass when unique segments for sections is desired.
3013 * output.cc (Output_section::Output_section): Initialize new
3014 members.
3015 * output.h (Output_section::is_unique_segment): New function.
3016 (Output_section::set_is_unique_segment): New function.
3017 (Output_section::is_unique_segment_): New member.
3018 (Output_section::extra_segment_flags): New function.
3019 (Output_section::set_extra_segment_flags): New function.
3020 (Output_section::extra_segment_flags_): New member.
3021 (Output_section::segment_alignment): New function.
3022 (Output_section::set_segment_alignment): New function.
3023 (Output_section::segment_alignment_): New member.
3024 (Output_segment::Output_segment): Initialize is_unique_segment_.
3025 (Output_segment::is_unique_segment): New function.
3026 (Output_segment::set_is_unique_segment): New function.
3027 (Output_segment::is_unique_segment_): New member.
3028 * plugin.cc (allow_unique_segment_for_sections): New function.
3029 (unique_segment_for_sections): New function.
3030 (Plugin::load): Add new functions to transfer vector.
3031 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3032 * Makefile.in: Regenerate.
3033 * testsuite/plugin_final_layout.sh: Check if unique segment
3034 functionality works.
3035 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3036 are available.
3037 (allow_unique_segment_for_sections): New global.
3038 (unique_segment_for_sections): New global.
3039 (claim_file_hook): Call allow_unique_segment_for_sections.
3040 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3041
1e2bee4f
CC
30422012-08-22 Cary Coutant <ccoutant@google.com>
3043
3044 * layout.cc (Layout::include_section): Don't assert on GROUP
3045 sections with --emit-relocs.
3046
1d5dfe78
CC
30472012-08-21 Cary Coutant <ccoutant@google.com>
3048
3049 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3050 if --export-dynamic-symbol names an undef symbol.
3051
c9269dff
AM
30522012-08-18 Alan Modra <amodra@gmail.com>
3053
3054 * powerpc.cc: Formatting and white space.
3055 (Powerpc_relobj): Rename got2_section_ to special_.
3056 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3057 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3058 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3059 (Target_powerpc): Add Address typedef and invalid_address. Use
3060 throughout.
3061 (Target_powerpc::is_branch_reloc): New function.
3062 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3063 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3064 for dst_mask, value and addend.
3065 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3066 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3067 (Output_data_glink::do_write): Correct toc base. Don't try to use
3068 uint16_t for 24-bit offset. Use get_output_section_offset and
3069 check return.
3070 (Target_powerpc::Scan::local): Handle more relocs.
3071 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3072 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3073 Plug in toc restoring insn after plt calls. Translate branches
3074 to function descriptor symbols to corresponding entry point.
3075 (Target_powerpc::relocate_for_relocatable): Check return from
3076 get_output_section_offset.
3077 * symtab.h: Comment typo.
3078
b1759dce
ILT
30792012-08-14 Ian Lance Taylor <iant@google.com>
3080
3081 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3082 unsupported_relocal_local to call unsupported_reloc_global.
3083
b9b2ae8b
NC
30842012-08-14 Nick Clifton <nickc@redhat.com>
3085
3086 PR ld/14265
3087 * script-sections.cc (Sections_element::output_section_name): Add
3088 keep return parameter.
3089 (Output_section_element::match_name): Add keep return parameter.
3090 Return the value of the keep_ member.
3091 * script-sections.h (class Output_section): Update
3092 output_section_name prototype.
3093 * layout.cc (Layout::keep_input_section): New public member
3094 function.
3095 (Layout::choose_output_section): Pass keep parameter to
3096 output_section_name.
3097 * layout.h (class Layout): Add keep_input_section.
3098 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3099 sections.
3100 * testsuite/Makefile.am: Add a test.
3101 * testsuite/Makefile.in: Regenerate.
3102 * testsuite/pr14265.c: Source file for the test.
3103 * testsuite/pr14265.t: Linker script for the test.
3104 * testsuite/pr14265.sh: Shell script for the test.
3105
921b5322
AM
31062012-08-14 Alan Modra <amodra@gmail.com>
3107
3108 * target.h (Target::output_section_name): New function.
3109 (Target::do_output_section_name): New function.
3110 * layout.cc (Layout::choose_output_section): Call the above.
3111 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3112
6ce78956
AM
31132012-08-14 Alan Modra <amodra@gmail.com>
3114
3115 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3116 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3117 for replace_constant call.
3118 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3119 (Output_data_glink::do_print_to_mapfile): New function.
3120 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3121 (Target_powerpc::Relocate::relocate): Likewise.
3122
d1a8cabd
AM
31232012-08-14 Alan Modra <amodra@gmail.com>
3124
3125 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3126 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3127 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3128 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3129 all references to shndx_. Handle special case for R_PPC_PLTREL24
3130 here.
3131 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3132 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3133 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3134 here.
3135 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3136 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3137
d83ce4e3
AM
31382012-08-12 Alan Modra <amodra@gmail.com>
3139
3140 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3141 (glink insn constants): Use uint32_t.
3142 (Output_data_glink::add_entry): Use insert, not [] operator.
3143
cf43a2fe
AM
31442012-08-11 Alan Modra <amodra@gmail.com>
3145
3146 * object.h (Sized_relobj_file::find_shdr): New function.
3147 (Sized_relobj_file::find_special_sections): New function.
3148 * object.cc (Sized_relobj_file::find_shdr): New function.
3149 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3150 (Sized_relobj_file::find_special_sections): New function, split out..
3151 (Sized_relobj_file::do_read_symbols): ..from here.
3152 * output.h (Output_data_got::replace_constant): New function.
3153 (Output_data_got::num_entries): New function.
3154 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3155 (Output_data_got::got_offset): Protected rather than private.
3156 (Output_data_got::replace_got_entry): New function.
3157 * output.cc (Output_data_got::replace_got_entry): New function.
3158 * powerpc.cc (class Powerpc_relobj): New.
3159 (class Powerpc_relocate_functions): Delete all psymval variants or
3160 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3161 Implement _ha functions using corresponding _hi function.
3162 (Powerpc_relobj::find_special_sections): New function.
3163 (Target_powerpc::do_make_elf_object): New function.
3164 (class Output_data_got_powerpc): New.
3165 (class Output_data_glink): New.
3166 (class Powerpc_scan_relocatable_reloc): New.
3167 Many more changes througout file.
3168
3c892704
NC
31692012-08-09 Nick Clifton <nickc@redhat.com>
3170
3171 * po/vi.po: Updated Vietnamese translation.
3172
82435b3b
ILT
31732012-08-07 Ian Lance Taylor <iant@google.com>
3174
3175 * layout.cc (Layout::add_target_dynamic_tags): If
3176 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3177 plt_rel.
3178
a6dc81d2
NC
31792012-07-30 Nick Clifton <nickc@redhat.com>
3180
3181 * po/gold.pot: Updated template.
3182 * po/es.po: Updated Spanish translation.
3183
f1415016
CC
31842012-07-18 Cary Coutant <ccoutant@google.com>
3185
3186 PR gold/14344
3187 * configure.ac: Add check for -gpubnames support.
3188 * configure: Regenerate.
3189 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3190 support; force -gno-pubnames.
3191 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3192 support.
3193 (gdb_index_test_4): New test.
3194 * testsuite/Makefile.in: Regenerate.
3195 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3196 * testsuite/gdb_index_test_2.sh: Likewise.
3197 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3198 * testsuite/gdb_index_test_4.sh: New script.
3199 * testsuite/gdb_index_test_comm.sh: New script with common code;
3200 don't look for space after colon.
3201
b7fd7c37
ST
32022012-07-16 Sriraman Tallam <tmsriram@google.com>
3203
3204 * gold.cc (queue_middle_tasks): Update function order only after
3205 deferred objects due to plugins are processed.
3206
1f3212db
ILT
32072012-07-11 Ian Lance Taylor <iant@google.com>
3208
3209 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3210 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3211 (Target_arm::scan_reloc_for_stub): Likewise.
3212 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3213 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3214 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3215 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3216 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3217
81c82a68
ILT
32182012-07-10 Dodji Seketeli <dodji@redhat.com>
3219 Ian Lance Taylor <iant@google.com>
3220
3221 PR gold/14309
3222 * configure.ac: Test whether std::tr1::hash<off_t> works.
3223 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3224 needed.
3225 * output.h (class Output_fill): Add virtual destructor.
3226 * configure, config.in: Rebuild.
3227
eabc84f4
RM
32282012-06-22 Roland McGrath <mcgrathr@google.com>
3229
3230 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3231
370e30b6
RÁE
32322012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3233
3234 * plugin.cc (Plugin::load): Handle position independent executables.
3235
fb1b895d
CC
32362012-06-06 Cary Coutant <ccoutant@google.com>
3237
3238 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3239 add .debug_macro.
3240 (lines_only_debug_sections): Likewise.
3241 (gdb_fast_lookup_sections): New static array.
3242 (is_gdb_debug_section): Rename formal parameter.
3243 (is_lines_only_debug_section): Likewise.
3244 (is_gdb_fast_lookup_section): New function.
3245 (Layout::include_section): Check for ".zdebug_" prefix; pass
3246 section name suffix to is_gdb_debug_section, et al.; check for
3247 fast-lookup sections when building .gdb_index.
3248 * options.h (--strip-debug-gdb): Update GDB version number.
3249
7c0640fa
CC
32502012-06-06 Cary Coutant <ccoutant@google.com>
3251
3252 * configure.ac: Add check for fallocate.
3253 * configure: Regenerate.
3254 * config.in: Regenerate.
3255
3256 * options.h (class General_options): Add --mmap-output-file and
3257 --posix-fallocate options.
3258 * output.cc: (posix_fallocate): Remove; replace with...
3259 (gold_fallocate): New function.
3260 (Output_file::map_no_anonymous): Call gold_fallocate.
3261 (Output_file::map): Check --mmap-output-file option.
3262
2a49eb69
DK
32632012-06-05 Jing Yu <jingyu@google.com>
3264
3265 * gold.h (textdomain): Add do {} to empty while(0).
3266 (bindtextdomain): Likewise.
3267
fad072ac
CC
32682012-06-04 Cary Coutant <ccoutant@google.com>
3269
3270 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3271 has_dynsym_index.
3272
8cc69fb6
ST
32732012-05-25 Sriraman Tallam <tmsriram@google.com>
3274
3275 * symtab.cc (Symbol_table::define_special_symbol):
3276 Initialize *poldsym to prevent uninitialized variable errors.
3277
1be75daa
CC
32782012-05-23 Cary Coutant <ccoutant@google.com>
3279
3280 * layout.cc (Layout::section_name_mapping): Add rules to handle
3281 exact match on .data.rel.ro.local or .data.rel.ro.
3282 (Layout::output_section_name): Check for exact matches.
3283
9b689de0
CC
32842012-05-23 Cary Coutant <ccoutant@google.com>
3285
3286 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3287 more carefully.
3288
b24fdbf5
CC
32892012-05-22 Cary Coutant <ccoutant@google.com>
3290
3291 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3292 object before exporting symbol.
3293
e550e1a2
L
32942012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3295
3296 * testsuite/tls_test.cc: Include "config.h" first.
3297 * testsuite/tls_test_c.c: Likewise.
3298
df7b86aa
NC
32992012-05-17 Daniel Richard G. <skunk@iskunk.org>
3300 Nick Clifton <nickc@redhat.com>
3301
3302 PR 14072
3303 * configure.in: Add check that sysdep.h has been included before
3304 any system header files.
3305 * configure: Regenerate.
3306 * config.in: Regenerate.
3307
1007b503
CC
33082012-05-14 Cary Coutant <ccoutant@google.com>
3309
3310 * layout.cc (Layout::make_output_section): Mark .tdata section
3311 as RELRO.
3312 * testsuite/relro_test.cc: Add a TLS variable.
3313
fd885f3a
L
33142012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3315
3316 PR gold/14091
3317 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3318 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3319 R_X86_64_64.
3320
80f5885c
CC
33212012-05-08 Cary Coutant <ccoutant@google.com>
3322
3323 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3324 (lines_only_debug_sections): Likewise.
3325
2e702c99
RM
33262012-05-02 Roland McGrath <mcgrathr@google.com>
3327
3328 * nacl.cc: New file.
3329 * nacl.h: New file.
3330 * Makefile.am (CCFILES, HFILES): Add them.
3331 * Makefile.in: Regenerate.
3332 * i386.cc (Output_data_plt_i386_nacl): New class.
3333 (Output_data_plt_i386_nacl_exec): New class.
3334 (Output_data_plt_i386_nacl_dyn): New class.
3335 (Target_i386_nacl): New class.
3336 (Target_selector_i386_nacl): New class.
3337 (target_selector_i386): Use it instead of Target_selector_i386.
3338 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3339 (Target_x86_64_nacl): New class.
3340 (Target_selector_x86_64_nacl): New class.
3341 (target_selector_x86_64, target_selector_x32): Use it instead of
3342 Target_selector_x86_64.
3343 * arm.cc (Output_data_plt_arm_nacl): New class.
3344 (Target_arm_nacl): New class.
3345 (Target_selector_arm_nacl): New class.
3346 (target_selector_arm, target_selector_armbe): Use it instead of
3347 Target_selector_arm.
3348
3349 * target-select.cc (select_target): Take new Input_file* and off_t
3350 arguments, pass them on to recognize method of selector.
3351 * object.cc (make_elf_sized_object): Update caller.
3352 * parameters.cc (parameters_force_valid_target): Likewise.
3353 * incremental.cc (make_sized_incremental_binary): Likewise.
3354 * target-select.h: Update decl.
3355 (Target_selector::recognize): Take new Input_file* argument,
3356 pass it on to do_recognize.
3357 (Target_selector::do_recognize): Take new Input_file* argument.
3358 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3359 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3360 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3361 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3362
3363 * target.h (Target::Target_info): New members isolate_execinstr
3364 and rosegment_gap.
3365 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3366 * arm.cc (Target_arm::arm_info): Update initializer.
3367 * i386.cc (Target_i386::i386_info): Likewise.
3368 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3369 * sparc.cc (Target_sparc::sparc_info): Likewise.
3370 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3371 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3372 * layout.cc (Layout::attach_allocated_section_to_segment):
3373 Take new const Target* argument. If target->isolate_execinstr(), act
3374 like --rosegment.
3375 (Layout::find_first_load_seg): Take new const Target* argument;
3376 if target->isolate_execinstr(), reject PF_X segments.
3377 (Layout::relaxation_loop_body): Update caller.
3378 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3379 reset file offset to zero when we hit LOAD_SEG, and then do a second
3380 loop over the segments before LOAD_SEG to reassign offsets after
3381 addresses have been determined. Handle target->rosegment_gap().
3382 (Layout::attach_section_to_segment): Take new const Target* argument;
3383 pass it to attach_allocated_section_to_segment.
3384 (Layout::make_output_section): Update caller.
3385 (Layout::attach_sections_to_segments): Take new const Target* argument;
3386 pass it to attach_section_to_segment.
3387 * gold.cc (queue_middle_tasks): Update caller.
3388 * layout.h (Layout): Update method decls with new arguments.
3389
3390 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3391 Target_info pointer to use.
3392 (Target_arm::do_make_data_plt): New virtual method.
3393 (Target_arm::make_data_plt): New method that calls it.
3394 (Target_arm::make_plt_entry): Use it.
3395 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3396 for the section alignment.
3397 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3398 method.
3399 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3400 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3401 method.
3402 (Output_data_plt_arm::get_plt_entry_size): Call it.
3403 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3404 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3405 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3406 method.
3407 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3408 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3409 method instead of sizeof(plt_entry).
3410 (Output_data_plt_arm::add_entry): Likewise.
3411 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3412 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3413 than static method.
3414 (Target_arm::plt_entry_size): Likewise.
3415 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3416 Move to ...
3417 (Output_data_plt_arm_standard): ... here, new class.
3418 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3419 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3420 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3421
3422 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3423 Take additional argument for the PLT entry size.
3424 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3425 Use get_plt_entry_size method rather than plt_entry_size variable.
3426 (Output_data_plt_x86_64::reserve_slot): Likewise.
3427 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3428 (Output_data_plt_x86_64::add_entry): Likewise.
3429 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3430 (Output_data_plt_x86_64::address_for_global): Likewise.
3431 (Output_data_plt_x86_64::address_for_local): Likewise.
3432 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3433 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3434 Make method non-static.
3435 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3436 method.
3437 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3438 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3439 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3440 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3441 virtual method.
3442 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3443 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3444 virtual method.
3445 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3446 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3447 virtual method.
3448 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3449 (Output_data_plt_x86_64::plt_entry_size)
3450 (Output_data_plt_x86_64::first_plt_entry)
3451 (Output_data_plt_x86_64::plt_entry)
3452 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3453 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3454 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3455 (Output_data_plt_x86_64_standard): ... here, new class.
3456 (Target_x86_64::Target_x86_64): Take optional argument for the
3457 Target_info pointer to use.
3458 (Target_x86_64::do_make_data_plt): New virtual method.
3459 (Target_x86_64::make_data_plt): New method to call it.
3460 (Target_x86_64::init_got_plt_for_update): Use that.
3461 Call this->plt_->add_eh_frame method here.
3462 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3463 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3464 rather than static method.
3465 (Target_x86_64::plt_entry_size): Likewise.
3466 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3467 rather than plt_entry_size variable. Move guts of PLT filling to...
3468 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3469 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3470 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3471
3472 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3473 additional argument for the section alignment.
3474 Don't do add_eh_frame_for_plt here.
3475 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3476 non-static. Use get_plt_entry_size method rather than plt_entry_size
3477 variable.
3478 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3479 method.
3480 (Output_data_plt_i386::get_plt_entry_size): Call it.
3481 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3482 (Output_data_plt_i386::add_eh_frame): New method to call it.
3483 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3484 method.
3485 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3486 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3487 method.
3488 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3489 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3490 method instead of plt_entry_size.
3491 (Output_data_plt_i386::plt_entry_size)
3492 (Output_data_plt_i386::plt_eh_frame_fde_size)
3493 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3494 (Output_data_plt_i386_standard): ... here, new class.
3495 (Output_data_plt_i386_exec): New class.
3496 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3497 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3498 (Output_data_plt_i386::exec_plt_entry): Move to ...
3499 (Output_data_plt_i386_exec::plt_entry): ... here.
3500 (Output_data_plt_i386_dyn): New class.
3501 (Output_data_plt_i386::first_plt_entry): Move to ...
3502 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3503 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3504 (Output_data_plt_i386_dyn::plt_entry): ... here.
3505 (Target_i386::Target_i386): Take optional argument for the Target_info
3506 pointer to use.
3507 (Target_i386::do_make_data_plt): New virtual method.
3508 (Target_i386::make_data_plt): New method to call it.
3509 (Target_i386::make_plt_section): Use that.
3510 Call this->plt_->add_eh_frame method here.
3511 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3512 rather than plt_entry_size variable.
3513 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3514 (Output_data_plt_i386::address_for_local): Likewise.
3515 (Output_data_plt_i386::do_write): Likewise.
3516 Move guts of PLT filling to...
3517 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3518 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3519 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3520 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3521
b9b9f2ee
CC
35222012-05-01 Cary Coutant <ccoutant@google.com>
3523
3524 * dwarf_reader.cc (Dwarf_die::read_attributes)
3525 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3526 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3527 * reduced_debug_output.cc
3528 (Output_reduced_debug_info_section::get_die_end): Remove
3529 DW_FORM_GNU_ref_index. Add default case.
3530
57923f48
MW
35312012-04-26 Mark Wielaard <mjw@redhat.com>
3532
3533 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3534 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3535 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3536 DW_AT_high_pc as offset from DW_AT_low_pc.
3537
3538 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3539 * testsuite/Makefile.in: Regenerate.
3540 * testsuite/gdb_index_test_3.c: New test source file.
3541 * testsuite/gdb_index_test_3.sh: New test source file.
3542
2c54b4f4
ILT
35432012-04-25 Ian Lance Taylor <iant@google.com>
3544
3545 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3546 pointer.
3547 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3548 as a class, not a struct.
3549 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3550 (Target_arm::apply_cortex_a8_workaround): Likewise.
3551 * gc.h: Declare Reloc_types as a struct, not a class.
3552 * object.h: Declare Symbols_data as a struct.
3553 * reloc.h: Declare Read_relocs_data as a struct.
3554 * target.h: Declare Relocate_info as a struct.
3555
a5a5f7a3
DM
35562012-04-24 David S. Miller <davem@davemloft.net>
3557
3558 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3559 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3560 and R_SPARC_WPLT30.
3561
f038d496
CC
35622012-04-24 Cary Coutant <ccoutant@google.com>
3563
3564 * incremental-dump.cc (find_input_containing_global): Replace
3565 magic number with symbolic constant.
3566 (dump_incremental_inputs): Update version number.
3567 * incremental.cc (Output_section_incremental_inputs): Update version
3568 number; import symbolic constants from Incremental_inputs_reader.
3569 (Incremental_inputs::create_data_sections): Align relocations
3570 section correctly for 64-bit targets.
3571 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3572 constants; add padding.
3573 (Output_section_incremental_inputs::write_header): Add assert for
3574 header_size.
3575 (Output_section_incremental_inputs::write_input_files): Add assert
3576 for input_entry_size.
3577 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3578 add assert for object_info_size, input_section_entry_size,
3579 global_sym_entry_size.
3580 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3581 for data structure sizes; use them.
3582 (Incremental_input_entry_reader): Import symbolic constants from
3583 Incremental_inputs_reader; use them.
3584
a4d85145
DM
35852012-04-23 David S. Miller <davem@davemloft.net>
3586
3587 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3588 and elf_flags_set_.
3589 (Target_sparc::Target_sparc): Initialize new fields.
3590 (Target_sparc::do_make_elf_object): New function.
3591 (Target_sparc::do_adjust_elf_header): New function.
3592
1d509098
CC
35932012-04-23 Cary Coutant <ccoutant@google.com>
3594
3595 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3596 CU range table of gdb index.
3597
7ebeff7f
DM
35982012-04-20 David S. Miller <davem@davemloft.net>
3599
3600 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3601 instead of false.
3602
13cf9988
DM
36032012-04-16 David S. Miller <davem@davemloft.net>
3604
2a1079e8
DM
3605 * sparc.cc (Target_sparc::got_address): New function.
3606 (Sparc_relocate_functions::gdop_hix22): New function.
3607 (Sparc_relocate_functions::gdop_lox10): New function.
3608 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3609 relocs.
3610 (Target_sparc::Scan::local): Likewise if the global symbol is not
3611 preemptible and is not IFUNC.
3612 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3613 transformations for local and non-preemptible non-IFUNC global
3614 symbols.
3615
0bc964fc
DM
3616 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3617 writing out 64-bit part of ranges.
3618
661d7a80
DM
3619 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3620 -fpic and -fpie respectively.
3621 * Makefile.in: Regenerate.
3622
8c2bf391
DM
3623 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3624 (Target_sparc::Target_sparc): Initialize new field.
3625 (Target_sparc::do_plt_section_for_global): New function.
3626 (Target_sparc::do_plt_section_for_local): New function.
3627 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3628 (Target_sparc::make_plt_section): New function, broken out of
3629 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3630 (Target_sparc::make_plt_entry): Call make_plt_section.
3631 (Target_sparc::make_local_ifunc_plt_entry): New function.
3632 (Target_sparc::rela_ifunc_section): New function.
3633 (Target_sparc::plt_section): Remove const.
3634 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3635 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3636 and ifunc_count_ fields.
3637 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3638 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3639 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3640 (Output_data_plt_sparc::rela_ifunc): New function.
3641 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3642 (Output_data_plt_sparc::has_ifunc_section): New function.
3643 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3644 (Output_data_plt_sparc::address_for_global): New function.
3645 (Output_data_plt_sparc::address_for_local): New function.
3646 (Output_data_plt_sparc::plt_index_to_offset): New function.
3647 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3648 and entry_count.
3649 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3650 entry_count.
3651 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3652 R_SPARC_JMP_IREL to switch.
3653 (Target_sparc::Scan::check_non_pic): Likewise.
3654 (Target_sparc::Scan::local): Handle IFUNC symbols.
3655 (Target_sparc::Scan::local): Likewise.
3656 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3657 and plt_address_for_local.
3658 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3659 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3660
13cf9988
DM
3661 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3662 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3663 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3664 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3665 global relocs too.
3666 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3667 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3668 calls.
3669 * sparc.cc (Target_sparc::Scan::global): Likewise.
3670 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3671
31821be0
CC
36722012-04-16 Cary Coutant <ccoutant@google.com>
3673
3674 * archive.cc (Library_base::should_include_member): Check for
3675 --export-dynamic-symbol.
3676 * options.h (class General_options): Add --export-dynamic-symbol.
3677 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3678 --export-dynamic-symbol.
3679 (Symbol_table::gc_mark_undef_symbols): Likewise.
3680 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3681
2615994e
DM
36822012-04-12 David S. Miller <davem@davemloft.net>
3683
3684 * sparc.cc (Reloc::wdisp10): New relocation method.
3685 (Reloc::h34): Likewise.
3686 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3687 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3688 R_SPARC_WDISP10.
3689 (Target_sparc::Scan::local): Likewise.
3690 (Target_sparc::Scan::global): Likewise.
3691 (Target_sparc::Relocate::relocate): Likewise.
3692
6782735d
CC
36932012-04-09 Cary Coutant <ccoutant@google.com>
3694
3695 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3696 low_pc == 0.
3697
8c7a0b00
ILT
36982012-04-06 Ian Lance Taylor <iant@google.com>
3699
3700 * timer.cc: #include <unistd.h>.
3701
58797674
RM
37022012-04-06 Roland McGrath <mcgrathr@google.com>
3703
3704 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3705 * config.in: Regenerate.
3706 * configure: Regenerate.
3707
44350750
NC
37082012-04-05 Nick Clifton <nickc@redhat.com>
3709
3710 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3711 (AM_LC_MESSAGES): Add.
3712 * aclocal.m4: Regenerate.
3713 * config.in: Regenerate.
3714 * configure: Regenerate.
3715
c1027032
CC
37162012-03-21 Cary Coutant <ccoutant@google.com>
3717
3718 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3719 * Makefile.in: Regenerate.
3720 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3721 (Sized_elf_reloc_mapper::symbol_section): New function.
3722 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3723 (make_elf_reloc_mapper): New function.
3724 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3725 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3726 (Dwarf_abbrev_table::do_get_abbrev): New function.
3727 (Dwarf_ranges_table::read_ranges_table): New function.
3728 (Dwarf_ranges_table::read_range_list): New function.
3729 (Dwarf_pubnames_table::read_section): New function.
3730 (Dwarf_pubnames_table::read_header): New function.
3731 (Dwarf_pubnames_table::next_name): New function.
3732 (Dwarf_die::Dwarf_die): New function.
3733 (Dwarf_die::read_attributes): New function.
3734 (Dwarf_die::skip_attributes): New function.
3735 (Dwarf_die::set_name): New function.
3736 (Dwarf_die::set_linkage_name): New function.
3737 (Dwarf_die::attribute): New function.
3738 (Dwarf_die::string_attribute): New function.
3739 (Dwarf_die::int_attribute): New function.
3740 (Dwarf_die::uint_attribute): New function.
3741 (Dwarf_die::ref_attribute): New function.
3742 (Dwarf_die::child_offset): New function.
3743 (Dwarf_die::sibling_offset): New function.
3744 (Dwarf_info_reader::check_buffer): New function.
3745 (Dwarf_info_reader::parse): New function.
3746 (Dwarf_info_reader::do_parse): New function.
3747 (Dwarf_info_reader::do_read_string_table): New function.
3748 (Dwarf_info_reader::lookup_reloc): New function.
3749 (Dwarf_info_reader::get_string): New function.
3750 (Dwarf_info_reader::visit_compilation_unit): New function.
3751 (Dwarf_info_reader::visit_type_unit): New function.
3752 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3753 Sized_elf_reloc_mapper.
3754 (Sized_dwarf_line_info::symbol_section): Remove function.
3755 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3756 (Sized_dwarf_line_info::read_line_mappings): Remove object
3757 parameter, adjust callers.
3758 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3759 * dwarf_reader.h: Include <sys/types.h>.
3760 (class Track_relocs): Remove forward declaration.
3761 (class Elf_reloc_mapper): New class.
3762 (class Sized_elf_reloc_mapper): New class.
3763 (class Dwarf_abbrev_table): New class.
3764 (class Dwarf_range_list): New class.
3765 (class Dwarf_ranges_table): New class.
3766 (class Dwarf_pubnames_table): New class.
3767 (class Dwarf_die): New class.
3768 (class Dwarf_info_reader): New class.
3769 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3770 (Sized_dwarf_line_info::symbol_section): Remove member function.
3771 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3772 base class.
3773 * gdb-index.cc: New source file.
3774 * gdb-index.h: New source file.
3775 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3776 and .debug_types sections, call Layout::add_to_gdb_index.
3777 (Sized_relobj_incr::do_section_name): Implement.
3778 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3779 return type; Implement.
3780 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3781 return type.
3782 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3783 parameter list and return type.
3784 (Sized_incr_dynobj::do_section_contents): Likewise.
3785 * layout.cc: Include gdb-index.h.
3786 (Layout::Layout): Initialize gdb_index_data_.
3787 (Layout::init_fixed_output_section): Check for .gdb_index section.
3788 (Layout::add_to_gdb_index): New function. Instantiate.
3789 * layout.h: Add forward declaration for class Gdb_index.
3790 (Layout::add_to_gdb_index): New member function.
3791 (Layout::gdb_index_data_): New data member.
3792 * main.cc: Include gdb-index.h.
3793 (main): Print statistics for gdb index.
3794 * object.cc (Object::section_contents): Move code into
3795 do_section_contents.
3796 (need_decompressed_section): Check for sections needed when building
3797 gdb index.
3798 (build_compressed_section_map): Likewise.
3799 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3800 gdb index.
3801 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3802 sections; call Layout::add_to_gdb_index.
3803 (Sized_relobj_file::do_decompressed_section_contents): Call
3804 do_section_contents directly.
3805 * object.h (Object::do_section_contents): Adjust parameter list and
3806 return type.
3807 (Object::do_decompressed_section_contents): Call do_section_contents
3808 directly.
3809 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3810 return type.
3811 * options.h (class General_options): Add --gdb-index option.
3812 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3813 list and return type.
3814 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3815 * reloc.h (Track_relocs::checkpoint): New function.
3816 (Track_relocs::reset): New function.
3817
3818 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3819 New test cases.
3820 * testsuite/Makefile.in: Regenerate.
3821 * testsuite/gdb_index_test.cc: New test source file.
3822 * testsuite/gdb_index_test_1.sh: New test source file.
3823 * testsuite/gdb_index_test_2.sh: New test source file.
3824
647f1574
DK
38252012-03-19 Doug Kwan <dougkwan@google.com>
3826
3827 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3828 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3829 __exidx_start and __exidx_end. Make symbol table parameter
3830 anonymous as it is not used.
3831 * gold.cc (queue_middle_tasks): Call target hook to define any
3832 target-specific symbols.
3833 * target.h (Target::define_standard_symbols): New method.
3834 (Target::do_define_standard_symbols): Same.
3835 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3836 * testsuite/Makefile.in: Regenerate.
3837 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3838 and __exidx_end.
3839 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3840 relocations are generated for __exidx_start and __exidx_end.
3841
7c6109da
DK
38422012-03-16 Doug Kwan <dougkwan@google.com>
3843
3844 * testsuite/Makefile.am: Disable test initpri3b.
3845 * testsuite/Makefile.in: Regenerate.
3846
7b8957f8
DK
38472012-03-15 Doug Kwan <dougkwan@google.com>
3848
3849 * arm.cc (Target_arm::got_section): Make .got section read-only
3850 if -z now is given.
3851
14dc9ef7
ILT
38522012-03-15 Ian Lance Taylor <iant@google.com>
3853
3854 PR gold/13850
3855 * layout.cc (Layout::make_output_section): Correctly mark
3856 SHT_INIT_ARRAY, et. al., as relro.
3857
fa40b62a
DK
38582012-03-14 Doug Kwan <dougkwan@google.com>
3859
3860 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3861 dynamic relocations for protected symbols in shared objects.
3862
fd325007
ILT
38632012-03-13 Ian Lance Taylor <iant@google.com>
3864
3865 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3866 keep the larger alignment.
3867
e8dd54e1
CC
38682012-03-12 Cary Coutant <ccoutant@google.com>
3869
3870 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3871 handling of DW_LNE_define_file.
3872
feb5f3b0
CC
38732012-03-12 Cary Coutant <ccoutant@google.com>
3874
3875 * reduced_debug_output.cc
3876 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3877 codes to switch.
3878
a1fb4256
CC
38792012-02-29 Cary Coutant <ccoutant@google.com>
3880
3881 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3882
5dd8762a
CC
38832012-02-29 Cary Coutant <ccoutant@google.com>
3884
3885 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3886 Call Object::decompressed_section_contents.
3887 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3888 New dtor.
3889 (Sized_dwarf_line_info::buffer_start_): New data member.
3890 * merge.cc (Output_merge_data::do_add_input_section): Call
3891 Object::decompressed_section_contents.
3892 (Output_merge_string::do_add_input_section): Likewise.
3893 * object.cc (need_decompressed_section): New function.
3894 (build_compressed_section_map): Decompress sections needed later.
3895 (Sized_relobj_file::do_decompressed_section_contents): New function.
3896 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3897 * object.h (Object::decompressed_section_contents): New function.
3898 (Object::discard_decompressed_sections): New function.
3899 (Object::do_decompressed_section_contents): New function.
3900 (Object::do_discard_decompressed_sections): New function.
3901 (Compressed_section_info): New type.
3902 (Compressed_section_map): Include decompressed section contents.
3903 (Sized_relobj_file::do_decompressed_section_contents): New function.
3904 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3905
7b5de7ee
CC
39062012-02-16 Cary Coutant <ccoutant@google.com>
3907
3908 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3909 * testsuite/Makefile.in: Regenerate.
3910
f9fa4a63
CC
39112012-02-14 Cary Coutant <ccoutant@google.com>
3912
3913 * options.cc (General_options::finalize): Disallow -pie and -static.
3914
2c175ebc
DK
39152012-02-03 Doug Kwan <dougkwan@google.com>
3916
3917 * arm.cc (Arm_relocate_functions::abs8,
3918 Arm_relocate_functions::abs16): Use
3919 Bits::has_signed_unsigned_overflow32.
3920 (Arm_relocate_functions::thm_abs8): Correct range of
3921 overflow check.
3922 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3923 in assertions.
3924
90cff06f
DK
39252012-02-02 Doug Kwan <dougkwan@google.com>
3926
3927 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3928 position independent outputs, not just shared objects.
3929
63887f3d
L
39302012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3931
3932 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3933 * configure: Regenerated.
3934
bef2b434
ILT
39352012-01-27 Ian Lance Taylor <iant@google.com>
3936
3937 * reloc.h (Bits): New class with static functions, copied from
3938 namespace utils in arm.cc.
3939 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3940 instead.
3941
c335b55d
L
39422012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3943
3944 * incremental.cc (write_info_blocks): Correct relocation offset.
3945
41194d9f
L
39462012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3947
3948 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3949 (Relocate::tls_gd_to_le): Likewise.
3950
1bae613c
L
39512012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3952
3953 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3954
24482ca0
L
39552012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3956
3957 * configure.ac: Check if -mcmodel=medium works.
3958 * configure: Regenerated.
3959
c2c7840a
CC
39602012-01-24 Cary Coutant <ccoutant@google.com>
3961
3962 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3963 definition and ...
3964 (read_unsigned_LEB_128_x): ... this new function.
3965 (read_signed_LEB_128): Replaced with inline definition and ...
3966 (read_signed_LEB_128_x): ... this new function.
3967 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3968 (read_unsigned_LEB_128): Add inline definition.
3969 (read_signed_LEB_128_x): New function.
3970 (read_signed_LEB_128): Add inline definition.
3971 * testsuite/Makefile.am (leb128_unittest): New unit test.
3972 * testsuite/Makefile.in: Regenerate.
3973 * testsuite/leb128_unittest.cc: New unit test.
3974
833de760 39752012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3976
3977 PR gold/13617
3978 * i386.cc (Target_i386::do_code_fill): When using a jmp
3979 instruction, pad with nop instructions.
3980 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3981
618d6666
L
39822012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3983
3984 * x86_64.cc (gc_process_relocs): Add typename on types used in
3985 template.
3986 (scan_relocs): Likewise.
3987 (relocate_section): Likewise.
3988 (apply_relocation): Likewise.
3989
3660ff06
L
39902012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3991
3992 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3993 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3994 under x32.
3995
fc51264f
L
39962012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3997
3998 * x86_64.cc: Initial support for x32.
3999
dd74ae06
CC
40002012-01-03 Cary Coutant <ccoutant@google.com>
4001
4002 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4003 Use abstract base class for GOT.
4004 * gold/output.h (class Output_data_got_base): New abstract base class.
4005 (class Output_data_got): Derive from new base class, adjust ctors.
4006 (Output_data_got::reserve_slot): Make virtual; rename to
4007 do_reserve_slot; Adjust callers.
4008 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4009 pointer to abstract base class.
4010 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4011
83896202
ILT
40122011-12-18 Ian Lance Taylor <iant@google.com>
4013
4014 * object.h (Relobj::local_symbol_value): New function.
4015 (Relobj::local_plt_offset): New function.
4016 (Relobj::local_has_got_offset): New function.
4017 (Relobj::local_got_offset): New function.
4018 (Relobj::set_local_got_offset): New function.
4019 (Relobj::do_local_symbol_value): New pure virtual function.
4020 (Relobj::do_local_plt_offset): Likewise.
4021 (Relobj::do_local_has_got_offset): Likewise.
4022 (Relobj::do_local_got_offset): Likewise.
4023 (Relobj::do_set_local_got_offset): Likewise.
4024 (Sized_relobj::do_local_has_got_offset): Rename from
4025 local_has_got_offset.
4026 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4027 (Sized_relobj::do_set_local_got_offset): Rename from
4028 set_local_got_offset.
4029 (Sized_relobj_file::do_local_plt_offset): Rename from
4030 local_plt_offset.
4031 (Sized_relobj_file::do_local_symbol_value): New function.
4032 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4033 local_plt_offset.
4034 * output.cc (Output_data_got::Got_entry::write): Change object to
4035 Relobj. Use local_symbol_value.
4036 (Output_data_got::add_global_with_rel): Change rel_dyn to
4037 Output_data_reloc_generic*. Use add_global_generic.
4038 (Output_data_got::add_global_with_rela): Remove. Change all
4039 callers to use add_global_with_rel.
4040 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4041 Output_data_reloc_generic*. Use add_global_generic.
4042 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4043 callers to use add_global_pair_with_rel.
4044 (Output_data_got::add_local): Change object to Relobj*.
4045 (Output_data_got::add_local_plt): Likewise.
4046 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4047 change rel_dyn to Output_data_reloc_generic*. Use
4048 add_local_generic.
4049 (Output_data_got::add_local_with_rela): Remove. Change all
4050 callers to use all_local_with_rel.
4051 (Output_data_got::add_local_pair_with_rel): Change object to
4052 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4053 add_output_section_generic.
4054 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4055 callers to use add_local_pair_with_rel.
4056 (Output_data_got::reserve_local): Change object to Relobj*.
4057 * output.h: (class Output_data_reloc_generic): Add pure virtual
4058 declarations for add_global_generic, add_local_generic,
4059 add_output_section_generic.
4060 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4061 functions for Output_data_reloc_generic. Update declarations for
4062 changes listed in output.cc.
4063 (class Output_data_got): Change template parameter to got_size.
4064 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4065 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4066 function.
4067 (Sized_relobj_incr::do_local_plt_offset): New function.
4068 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4069 add_global_generic.
4070
76677ad0
CC
40712011-12-17 Cary Coutant <ccoutant@google.com>
4072
4073 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4074 * resolve.cc (Symbol_table::resolve): Likewise.
4075 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4076 arrays.
4077 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4078
8b8dd8d5
ILT
40792011-12-16 Ian Lance Taylor <iant@google.com>
4080
4081 * output.h (Output_data_reloc_generic::add): Only call
4082 add_dynamic_reloc if this is a dynamic reloc section.
4083
d55525b9
L
40842011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4085
4086 PR gold/13505
4087 * target-reloc.h (apply_relocation): Replace <64, false> with
4088 <size, big_endian>.
4089
ff81c7c1
NC
40902011-11-25 Nick Clifton <nickc@redhat.com>
4091
4092 * po/it.po: New Italian translation.
4093
628f39be
SA
40942011-11-17 Sterling Augustine <saugustine@google.com>
4095
4096 * script.cc (script_include_directive): Implement.
4097 (read_script_file): New local variables name and search_path. Update
4098 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4099 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4100 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4101
98ef3ea4
SA
41022011-11-11 Sterling Augustine <saugustine@google.com>
4103
4104 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4105 (file_or_sections_cmd): Likewise.
4106
f4a8b6d7
DK
41072011-11-11 Doug Kwan <dougkwan@google.com>
4108
4109 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4110 if --just-symbols is given.
4111
29ab395d
DK
41122011-11-10 Doug Kwan <dougkwan@google.com>
4113
4114 PR gold/13362
4115 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4116 when processing data relocs.
4117 * reloc.h (Relocate_functions::rel_unaligned): New method.
4118 (Relocate_functions::pcrel_unaligned): Ditto.
4119 (Relocate_functions::rel32_unaligned): Ditto.
4120 (Relocate_functions::pcrel32_unaligned): Ditto.
4121
2c339f71
DK
41222011-11-09 Doug Kwan <dougkwan@google.com>
4123
4124 PR gold/13362
4125 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4126 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4127 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4128 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4129 (Relocate_functions::rel_unaligned): New.
4130 (Relocate_functions::rel32_unaligned): New.
4131 * target-reloc.h (relocate_for_relocatable): Add code to handle
4132 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4133 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4134 arm_unaligned_reloc_r): New targets.
4135 * testsuite/Makefile.in: Regenerate.
4136 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4137 linking.
4138
3f3cddf1
ILT
41392011-11-02 Ian Lance Taylor <iant@google.com>
4140
4141 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4142 NATIVE_LINKER.
4143 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4144 * options.cc (General_options::finalize): Use library search path
4145 from configure script if specified. If not native and no sysroot,
4146 only search TOOLLIBDIR.
4147 * options.h (Search_directory::Search_directory): Change name to
4148 const std::string&.
4149 (General_options::add_to_library_path_with_sysroot): Change arg to
4150 const std::string&.
4151 * configure, Makefile.in, config.in: Rebuild.
4152
a8e2273b
ILT
41532011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4154
4155 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4156 we are working around the ARM1176 Erratum.
4157 * options.h (General_options::fix_arm1176): Add option.
4158 * testsuite/Makefile.am: Add testcases, and keep current ones
4159 working.
4160 * testsuite/Makefile.in: Regenerate.
4161 * testsuite/arm_fix_1176.s: New file.
4162 * testsuite/arm_fix_1176.sh: Likewise.
4163
cd6eab1c
ILT
41642011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4165
4166 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4167 may_use_blx_.
4168 (Target_arm::may_use_blx): Remove method.
4169 (Target_arm::set_may_use_blx): Likewise.
4170 (Target_arm::may_use_v4t_interworking): New method.
4171 (Target_arm::may_use_v5t_interworking): Likewise.
4172 (Target_arm::may_use_blx_): Remove member variable.
4173 (Arm_relocate_functions::arm_branch_common): Check for v5T
4174 interworking.
4175 (Arm_relocate_functions::thumb_branch_common): Likewise.
4176 (Reloc_stub::stub_type_for_reloc): Likewise.
4177 (Target_arm::do_finalize_sections): Correct interworking checks.
4178 * testsuite/Makefile.am: Add new tests.
4179 * testsuite/Makefile.in: Regenerate.
4180 * testsuite/arm_farcall_arm_arm.s: New test.
4181 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4182 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4183 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4184 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4185 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4186 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4187 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4188
286adcf4
CC
41892011-10-31 Cary Coutant <ccoutant@google.com>
4190
4191 PR gold/13023
4192 * expression.cc (Expression::eval_with_dot): Add
4193 is_section_dot_assignment parameter.
4194 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4195 absolute and assigning to dot within a section.
4196 * script-sections.cc
4197 (Output_section_element_assignment::set_section_addresses): Pass
4198 dot_section to set_if_absolute.
4199 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4200 as is_section_dot_assignment flag to eval_with_dot.
4201 (Output_section_element_dot_assignment::set_section_addresses):
4202 Likewise.
4203 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4204 parameter. Also set value if relative to dot_section; set the
4205 symbol's output_section.
4206 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4207 parameter. Adjust all callers.
4208 (Expression::eval_maybe_dot): Likewise.
4209 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4210 Adjust all callers.
4211 * testsuite/script_test_2.t: Test assignment of an absolute value
4212 to dot within an output section element.
4213
9634ed06
CC
42142011-10-31 Cary Coutant <ccoutant@google.com>
4215
4216 * options.h (class General_options): Add --[no-]gnu-unique options.
4217 * symtab.cc (Symbol_table::sized_write_globals): Convert
4218 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4219
de4101c7
CC
42202011-10-31 Cary Coutant <ccoutant@google.com>
4221
4222 PR gold/13359
4223 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4224 unnecessary assertion.
4225 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4226
7257cc92
ST
42272011-10-31 Sriraman Tallam <tmsriram@google.com>
4228
4229 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4230 gc_mark_symbol.
4231 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4232 gc_mark_symbol.
4233 Change to just keep the section associated with symbol.
4234 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4235 they are externally visible and --export-dynamic is turned on.
4236 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4237
bfc34b3f
ILT
42382011-10-19 Ian Lance Taylor <iant@google.com>
4239
4240 PR gold/13163
4241 * script-sections.cc
4242 (Output_section_element_dot_assignment::needs_output_section): New
4243 function.
4244
ea0d8c47
ILT
42452011-10-19 Ian Lance Taylor <iant@google.com>
4246
4247 PR gold/13204
4248 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4249 --section-start option was seen.
4250 * options.h (General_options::any_section_start): New function.
4251
abd242a9
DM
42522011-10-18 David S. Miller <davem@davemloft.net>
4253
4254 PR binutils/13301
4255 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4256 member to track relocation locations that have moved during TLS
4257 reloc optimizations.
4258 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4259 (Target_sparc::Relocate::relocate): Adjust view down by 4
4260 bytes if it matches reloc_adjust_addr_.
4261 (Target_sparc::Relocate::relocate_tls): Always move the
4262 __tls_get_addr call delay slot instruction forward 4 bytes when
4263 performing relaxation.
4264
bab9090f
CC
42652011-10-18 Cary Coutant <ccoutant@google.com>
4266
4267 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4268 (Output_file::map_no_anonymous): Check for non-zero
4269 return code from posix_fallocate.
4270
f7c5b166
CC
42712011-10-17 Cary Coutant <ccoutant@google.com>
4272
4273 PR gold/13245
4274 * plugin.cc (is_visible_from_outside): Check for symbols
4275 referenced from dynamic objects.
4276 * resolve.cc (Symbol_table::resolve): Don't count references
4277 from dynamic objects as references from real ELF files.
4278 * testsuite/plugin_test_2.sh: Adjust expected result.
4279
b490c0bb
CC
42802011-10-17 Cary Coutant <ccoutant@google.com>
4281
4282 * gold.cc: Include timer.h.
4283 (queue_middle_tasks): Stamp time.
4284 (queue_final_tasks): Likewise.
4285 * main.cc (main): Store timer in parameters. Print timers
4286 for each pass.
4287 * parameters.cc (Parameters::Parameters): Initialize timer_.
4288 (Parameters::set_timer): New function.
4289 (set_parameters_timer): New function.
4290 * parameters.h (Parameters::set_timer): New function.
4291 (Parameters::timer): New function.
4292 (Parameters::timer_): New data member.
4293 (set_parameters_timer): New function.
4294 * timer.cc (Timer::stamp): New function.
4295 (Timer::get_pass_time): New function.
4296 * timer.h (Timer::stamp): New function.
4297 (Timer::get_pass_time): New function.
4298 (Timer::pass_times_): New data member.
4299
f475cf7b
CC
43002011-10-17 Cary Coutant <ccoutant@google.com>
4301
4302 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4303 task for members of lib groups.
4304
cdd7e244
CC
43052011-10-17 Cary Coutant <ccoutant@google.com>
4306
4307 PR gold/13288
4f95c8b4 4308 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4309 (File_read::make_view): Move bounds check (replace with assert)...
4310 (File_read::find_or_make_view): ... to here.
4311
dfb45471
CC
43122011-10-12 Cary Coutant <ccoutant@google.com>
4313
4f95c8b4 4314 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4315 ::read returns less than requested size.
4316
53bbcc1b
CC
43172011-10-10 Cary Coutant <ccoutant@google.com>
4318
4f95c8b4 4319 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4320 Initialize defined_count_.
4321 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4322 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4323 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4324 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4325 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4326 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4327 member.
4328 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4329 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4330 Return zeroes instead of internal error.
4331
397b129b
CC
43322011-10-10 Cary Coutant <ccoutant@google.com>
4333
4334 PR gold/13249
4f95c8b4 4335 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4336 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4337 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4338 (Output_reloc::type_): Adjust size of bit field.
4339 (Output_reloc::use_plt_offset_): New bit field.
4340 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4341 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4342 flag. Adjust all callers.
4f95c8b4 4343 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4344 creating RELATIVE relocations.
4345
d5698657
NC
43462011-10-10 Nick Clifton <nickc@redhat.com>
4347
4348 * po/es.po: Updated Spanish translation.
4349 * po/fi.po: Updated Finnish translation.
4350
6a59a5c2
DN
43512011-10-03 Diego Novillo <dnovillo@google.com>
4352
4353 * options.cc (parse_uint): Fix dereference of RETVAL.
4354
f0558624
ST
43552011-09-29 Sriraman Tallam <tmsriram@google.com>
4356
4357 * layout.h (section_order_map_): New member.
4358 (get_section_order_map): New member function.
4359 * output.cc (Output_section::add_input_section): Check for patterns
4360 only when --section-ordering-file is specified.
4361 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4362 output_sections have been formed.
4363 * layout.cc (Layout_Layout): Initialize section_order_map_.
4364 * plugin.cc (update_section_order): Store order in order_map. Do not
4365 update the order.
4366 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4367 * testsuite/Makefile.in: Regenerate.
4368 * testsuite/plugin_section_order.c: New file.
4369 * testsuite/plugin_final_layout.cc: New file.
4370 * testsuite/plugin_final_layout.sh: New file.
4371
a7dac153
CC
43722011-09-29 Cary Coutant <ccoutant@google.com>
4373
4f95c8b4 4374 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4375 Check for NULL.
4f95c8b4 4376 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4377 symbols during incremental update.
4378 (Symbol_table::add_from_dynobj): Likewise.
4379
eebd87a5
ILT
43802011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4381 Ian Lance Taylor <iant@google.com>
4382
4383 * symtab.cc (Symbol_table::define_special_symbol): Always
4384 canonicalize version string.
4385
403a3331
CC
43862011-09-26 Cary Coutant <ccoutant@google.com>
4387
4f95c8b4
CC
4388 * gold.cc (queue_initial_tasks): Move option checks ...
4389 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4390 some options; make others fatal.
4391
235061c2
CC
43922011-09-26 Cary Coutant <ccoutant@google.com>
4393
4394 gcc PR lto/47247
4395 * plugin.cc (get_symbols_v2): New function.
4396 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4397 (is_referenced_from_outside): New function.
4398 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4399 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4400 (get_symbols): Pass version parameter.
4401 (get_symbols_v2): New function.
4402 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4403 parameter.
4404 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4405 (onload): Add LDPT_GET_SYMBOLS_V2.
4406 (all_symbols_read_hook): Use get_symbols_v2; check for
4407 LDPR_PREVAILING_DEF_IRONLY_EXP.
4408 * testsuite/plugin_test_3.sh: Update expected results.
4409
dc87f620
ILT
44102011-09-23 Simon Baldwin <simonb@google.com>
4411
4412 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4413 configuration options.
4414 * configure: Regenerate.
4415 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4416 * Makefile.in: Regenerate.
4417 * testsuite/Makefile.in: Regenerate.
4418
a8279f82
ST
44192011-09-19 Sriraman Tallam <tmsriram@google.com>
4420
4421 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4422
0c9350c8
CC
44232011-09-19 Cary Coutant <ccoutant@google.com>
4424
4425 * incremental.cc (can_incremental_update): Fix typo in comment.
4426 * incremental.h (can_incremental_update): Likewise.
4427
aa06ae28
CC
44282011-09-18 Cary Coutant <ccoutant@google.com>
4429
4430 * incremental.cc (can_incremental_update): New function.
4431 * incremental.h (can_incremental_update): New function.
4432 * layout.cc (Layout::init_fixed_output_section): Call it.
4433 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4434 * object.cc (Sized_relobj_file::do_layout): Call
4435 can_incremental_update.
4436
ebb300b2
CC
44372011-09-13 Cary Coutant <ccoutant@google.com>
4438
4439 * configure.ac: Check for glibc support for gnu_indirect_function
4440 support with static linking, setting automake conditional
4441 IFUNC_STATIC.
4442 * Makefile.in: Regenerate.
4443 * configure: Regenerate.
4444
4445 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4446 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4447 for IFUNC_STATIC.
4448 * testsuite/Makefile.in: Regenerate.
4449
1206d0d5
CC
44502011-09-13 Cary Coutant <ccoutant@google.com>
4451
4452 * incremental.cc (Sized_relobj_incr::do_layout): Call
4453 report_comdat_group for kept comdat sections.
4454 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4455 * testsuite/Makefile.in: Regenerate.
4456 * testsuite/incr_comdat_test_1.cc: New source file.
4457 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4458 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4459 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4460
40b29874
ILT
44612011-09-13 Ian Lance Taylor <iant@google.com>
4462
4463 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4464 variable external_symbols_offset.
4465
1b045aac
ILT
44662011-09-12 Ian Lance Taylor <iant@google.com>
4467
4468 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4469 triggered if object has no symbols.
4470
24c6c55a
DM
44712011-09-09 David S. Miller <davem@davemloft.net>
4472
4473 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4474 (Output_fill_debug_line::do_write): Likewise.
4475
66570254
CC
44762011-08-29 Cary Coutant <ccoutant@google.com>
4477
4478 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4479 casts to match formatting specs.
4480 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4481
8ea8cd50
CC
44822011-08-26 Cary Coutant <ccoutant@google.com>
4483
4484 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4485 remaining hole size when allocating.
4486 (Layout::make_output_section): Set fill methods for debug sections.
4487 * layout.h (Free_list::Free_list_node): Move from private to
4488 public.
4489 (Free_list::set_min_hole_size): New function.
4490 (Free_list::begin, Free_list::end): New functions.
4491 (Free_list::min_hole_): New data member.
4492 * output.cc: Include dwarf.h.
4493 (Output_fill_debug_info::do_minimum_hole_size): New function.
4494 (Output_fill_debug_info::do_write): New function.
4495 (Output_fill_debug_line::do_minimum_hole_size): New function.
4496 (Output_fill_debug_line::do_write): New function.
4497 (Output_section::Output_section): Initialize new data member.
4498 (Output_section::set_final_data_size): Ensure patch space is larger
4499 than minimum hole size.
4500 (Output_section::do_write): Fill holes in debug sections.
4501 * output.h (Output_fill): New class.
4502 (Output_fill_debug_info): New class.
4503 (Output_fill_debug_line): New class.
4504 (Output_section::set_free_space_fill): New function.
4505 (Output_section::free_space_fill_): New data member.
4506 * testsuite/Makefile.am (incremental_test_3): Add
4507 --incremental-patch option.
4508 (incremental_test_4): Likewise.
4509 (incremental_test_5): Likewise.
4510 (incremental_test_6): Likewise.
4511 (incremental_copy_test): Likewise.
4512 (incremental_common_test_1): Likewise.
4513 * testsuite/Makefile.in: Regenerate.
4514
7cf80422
NC
45152011-08-26 Nick Clifton <nickc@redhat.com>
4516
4517 * po/es.po: Updated Spanish translation.
4518
c3f7b0e5
CC
45192011-08-01 Cary Coutant <ccoutant@google.com>
4520
4521 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4522 * gold/testsuite/Makefile.in: Regenerate.
4523 * gold/testsuite/justsyms_exec.c: New source file.
4524 * gold/testsuite/justsyms_lib.c: New source file.
4525
9590bf25
CC
45262011-08-01 Cary Coutant <ccoutant@google.com>
4527
4528 * layout.cc (Layout::set_segment_offsets): Don't realign text
4529 segment if -Ttext was specified.
4530 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4531 file type.
4532 * object.h (Sized_relobj_file::e_type): New function.
4533 (Sized_relobj_file::e_type_): New data member.
4534 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4535 base address for ET_EXEC files.
4536 * target.cc (Target::do_make_elf_object_implementation): Allow
4537 ET_EXEC files with --just-symbols option.
4538
dcd8d12e
CC
45392011-07-28 Cary Coutant <ccoutant@google.com>
4540
4541 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4542 Add thread_number parameter.
4543 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4544 * workqueue-threads.cc
4545 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4546 current thread if its thread number is greater than desired thread
4547 count.
4548 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4549 Add thread_number parameter.
4550 (Workqueue::should_cancel_thread): Likewise.
4551 (Workqueue::find_runnable_or_wait): Pass thread_number to
4552 should_cancel_thread.
4553 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4554 parameter.
4555
804eb480
ST
45562011-07-22 Sriraman Tallam <tmsriram@google.com>
4557
4558 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4559 only after checking if it cannot be forced local.
4560 * symtab.h (is_externally_visible): Check if the symbol is not forced
4561 local.
4562
f1ddb600
ILT
45632011-07-15 Ian Lance Taylor <iant@google.com>
4564
4565 * options.h (class General_options): Add --print-output-format.
4566 Move -EL next to -EB, for better --help output.
4567 * target-select.cc: Include <cstdio>, "options.h", and
4568 "parameters.h".
4569 (Target_selector::do_target_bfd_name): New function.
4570 (print_output_format): New function.
4571 * target-select.h (class Target_selector): Update declarations.
4572 (Target_selector::target_bfd_name): New function.
4573 (print_output_format): Declare.
4574 * main.cc: Include "target-select.h".
4575 (main): Handle --print-output-format.
4576 * gold.cc: Include "target-select.h".
4577 (queue_initial_tasks): Handle --print-output-format when there are
4578 no input files.
4579 * parameters.cc (parameters_force_valid_target): Give a better
4580 error message if -EB/-EL does not match target.
4581 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4582 function.
4583
7d172687
ILT
45842011-07-15 Ian Lance Taylor <iant@google.com>
4585
4586 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4587 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4588 (Output_data_plt_i386::do_write): Write address of .dynamic
4589 section to first entry in .got.plt section.
4590 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4591 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4592 Initialize layout_.
4593 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4594 section to first entry in .got.plt section.
4595 * layout.h (Layout::dynamic_section): New function.
4596
e9552f7e
ST
45972011-07-13 Sriraman Tallam <tmsriram@google.com>
4598
4599 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4600 to claim_file call.
4601 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4602 input_section_position_, and input_section_glob_.
4603 (read_layout_from_file): Call function section_ordering_specified.
4604 * layout.h (is_section_ordering_specified): New function.
4605 (section_ordering_specified): New function.
4606 (section_ordering_specified_): New boolean member.
4607 * main.cc(main): Call load_plugins after layout object is defined.
4608 * output.cc (Output_section::add_input_section): Use
4609 function section_ordering_specified to check if section ordering is
4610 needed.
4611 * output.cc (Output_section::add_relaxed_input_section): Use
4612 function section_ordering_specified to check if section ordering is
4613 needed.
4614 (Output_section::update_section_layout): New function.
4615 (Output_section::sort_attached_input_sections): Check if input section
4616 must be reordered.
4617 * output.h (Output_section::update_section_layout): New function.
4618 * plugin.cc (get_section_count): New function.
4619 (get_section_type): New function.
4620 (get_section_name): New function.
4621 (get_section_contents): New function.
4622 (update_section_order): New function.
58797674 4623 (allow_section_ordering): New function.
e9552f7e
ST
4624 (Plugin::load): Add the new interfaces to the transfer vector.
4625 (Plugin_manager::load_plugins): New parameter.
4626 (Plugin_manager::all_symbols_read): New parameter.
4627 (Plugin_manager::claim_file): New parameter. Save the elf object for
4628 unclaimed objects.
4629 (Plugin_manager::get_elf_object): New function.
4630 (Plugin_manager::get_view): Change to directly use the bool to check
4631 if get_view is called from claim_file_hook.
4632 * plugin.h (input_objects): New function
4633 (Plugin__manager::load_plugins): New parameter.
4634 (Plugin_manager::claim_file): New parameter.
4635 (Plugin_manager::get_elf_object): New function.
4636 (Plugin_manager::in_claim_file_handler): New function.
4637 (Plugin_manager::in_claim_file_handler_): New member.
4638 (layout): New function.
4639 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4640 handler with an extra parameter. Make the elf object before calling
4641 claim_file handler.
4642 * testsuite/plugin_test.c (get_section_count): New function pointer.
4643 (get_section_type): New function pointer.
4644 (get_section_name): New function pointer.
4645 (get_section_contents): New function pointer.
4646 (update_section_order): New function pointer.
4647 (allow_section_ordering): New function pointer.
4648 (onload): Check if the new interfaces exist.
4649
9446efde
ILT
46502011-07-13 Ian Lance Taylor <iant@google.com>
4651
4652 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4653 relro section.
4654 * x86_64.cc (Target_x86_64::got_section): Likewise.
4655 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4656 (relro_now_test_SOURCES): New variable.
4657 (relro_now_test_DEPENDENCIES): New variable.
4658 (relro_now_test_LDFLAGS): New variable.
4659 (relro_now_test_LDADD): New variable.
4660 (relro_now_test.so): New target.
4661 * testsuite/Makefile.in: Rebuild.
4662
07aa62f2
ILT
46632011-07-12 Ian Lance Taylor <iant@google.com>
4664
4665 PR gold/12980
4666 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4667 GLOB_DAT relocation rather than a RELATIVE relocation for a
4668 protected symbol when creating a shared library.
4669 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4670 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4671 * testsuite/protected_main_1.cc (main): Test that protected
4672 function has same address.
4673
e2153196
ILT
46742011-07-11 Ian Lance Taylor <iant@google.com>
4675
4676 PR gold/12979
4677 * options.h (class General_options): Add -Bgroup.
4678 * options.cc (General_options::finalize): If -Bgroup is set,
4679 default to --unresolved-symbols=report-all.
4680 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4681 * target-reloc.h (issue_undefined_symbol_error): Handle
4682 --unresolved-symbols=report-all.
4683
6daf5215
ILT
46842011-07-08 Ian Lance Taylor <iant@google.com>
4685
4686 PR gold/11985
4687 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4688 if linker script discards key sections.
4689 (Layout::create_dynamic_symtab): Likewise.
4690 (Layout::assign_local_dynsym_offsets): Likewise.
4691 (Layout::sized_create_version_sections): Likewise.
4692 (Layout::create_interp): Likewise.
4693 (Layout::finish_dynamic_section): Likewise.
4694 (Layout::set_dynamic_symbol_size): Likewise.
4695
beabb2c6
ILT
46962011-07-08 Ian Lance Taylor <iant@google.com>
4697
4698 PR gold/12386
4699 * options.h (class General_options): Add --unresolved-symbols.
4700 * target-reloc.h (issue_undefined_symbol_error): Check
4701 --unresolved-symbols. Add comments.
4702
9c16daf1
ILT
47032011-07-08 Ian Lance Taylor <iant@google.com>
4704
4705 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4706 expression more complex.
4707
191f1a2d
ILT
47082011-07-08 Ian Lance Taylor <iant@google.com>
4709
4710 PR gold/11317
4711 * target-reloc.h (issue_undefined_symbol_error): New inline
4712 function, broken out of relocate_section.
4713 (relocate_section): Call issue_undefined_symbol_error.
4714 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4715 there is no TLS segment if we are about to issue an undefined
4716 symbol error.
4717 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4718
62855347
ILT
47192011-07-08 Ian Lance Taylor <iant@google.com>
4720
4721 PR gold/12279
4722 * resolve.cc (Symbol_table::should_override): Add fromtype
4723 parameter. Change all callers. Give error when linking together
4724 TLS and non-TLS symbol.
4725 (Symbol_table::should_override_with_special): Add fromtype
4726 parameter. Change all callers.
4727 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4728 there is no TLS segment if we have reported some errors.
4729 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4730
67181c72
ILT
47312011-07-08 Ian Lance Taylor <iant@google.com>
4732
4733 PR gold/12372
4734 * target.h (Target::plt_address_for_global): New function.
4735 (Target::plt_address_for_local): New function.
4736 (Target::plt_section_for_global): Remove.
4737 (Target::plt_section_for_local): Remove.
4738 (Target::do_plt_address_for_global): New virtual function.
4739 (Target::do_plt_address_for_local): New virtual function.
4740 (Target::do_plt_section_for_global): Remove.
4741 (Target::do_plt_section_for_local): Remove.
4742 (Target::register_global_plt_entry): Add Symbol_table and Layout
4743 parameters.
4744 * output.cc (Output_data_got::Got_entry::write): Use
4745 plt_address_for_global and plt_address_for_local.
4746 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4747 address of output section.
4748 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4749 got_irelative_, and irelative_count_ fields. Update
4750 declarations.
4751 (Output_data_plt_i386::has_irelative_section): New function.
4752 (Output_data_plt_i386::entry_count): Add irelative_count_.
4753 (Output_data_plt_i386::set_final_data_size): Likewise.
4754 (class Target_i386): Add got_irelative_ and rel_irelative_
4755 fields. Update declarations.
4756 (Target_i386::Target_i386): Initialize new fields.
4757 (Target_i386::do_plt_address_for_global): New function replacing
4758 do_plt_section_for_global.
4759 (Target_i386::do_plt_address_for_local): New function replacing
4760 do_plt_section_for_local.
4761 (Target_i386::got_section): Create got_irelative_.
4762 (Target_i386::rel_irelative_section): New function.
4763 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4764 fields. Don't define __rel_iplt_{start,end}.
4765 (Output_data_plt_i386::add_entry): Add symtab and layout
4766 parameters. Change all callers. Use different PLT and GOT for
4767 IFUNC symbols.
4768 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4769 layout parameters. Change all callers. Use different PLT and
4770 GOT.
4771 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4772 (Output_data_plt_i386::rel_irelative): New function.
4773 (Output_data_plt_i386::address_for_global): New function.
4774 (Output_data_plt_i386::address_for_local): New function.
4775 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4776 IRELATIVE GOT when changing IFUNC GOT entries.
4777 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4778 reloc.
4779 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4780 if we didn't create an IRELATIVE GOT.
4781 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4782 plt_address_for_local.
4783 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4784 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4785 got_irelative_, and irelative_count_ fields. Update
4786 declarations.
4787 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4788 Initialize new fields. Remove symtab parameter. Change all
4789 callers.
4790 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4791 irelative_count_.
4792 (Output_data_plt_x86_64::has_irelative_section): New function.
4793 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4794 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4795 fields. Update declarations.
4796 (Target_x86_64::Target_x86_64): Initialize new fields.
4797 (Target_x86_64::do_plt_address_for_global): New function replacing
4798 do_plt_section_for_global.
4799 (Target_x86_64::do_plt_address_for_local): New function replacing
4800 do_plt_section_for_local.
4801 (Target_x86_64::got_section): Create got_irelative_.
4802 (Target_x86_64::rela_irelative_section): New function.
4803 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4804 all callers. Don't create __rel_iplt_{start,end}.
4805 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4806 parameters. Change all callers. Use different PLT and GOT for
4807 IFUNC symbols.
4808 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4809 layout parameters. Change all callers. Use different PLT and
4810 GOT.
4811 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4812 parameters. Change all callers. Use different PLT and GOT for
4813 IFUNC symbols.
4814 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4815 (Output_data_plt_x86_64::rela_irelative): New function.
4816 (Output_data_plt_x86_64::address_for_global): New function.
4817 (Output_data_plt_x86_64::address_for_local): New function.
4818 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4819 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4820 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4821 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4822 parameters.
4823 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4824 reloc.
4825 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4826 symbols if we didn't create an IRELATIVE GOT.
4827 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4828 plt_address_for_local.
4829 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4830 * testsuite/ifuncvar1.c: New test file.
4831 * testsuite/ifuncvar2.c: New test file.
4832 * testsuite/ifuncvar3.c: New test file.
4833 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4834 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4835 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4836 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4837 * testsuite/Makefile.in: Rebuild.
4838
33c15b45
CC
48392011-07-07 Cary Coutant <ccoutant@google.com>
4840
4841 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4842 (two_file_test_1_ndebug.o): Likewise.
4843 (two_file_test_1b_ndebug.o): Likewise.
4844 (two_file_test_2_ndebug.o): Likewise.
4845 (two_file_test_main_ndebug.o): Likewise.
4846 (incremental_test_2): Link with no-debug versions.
4847
f48b5fb7
CC
48482011-07-06 Cary Coutant <ccoutant@google.com>
4849
4850 * gold/incremental.cc
4851 (Output_section_incremental_inputs::write_info_blocks): Check for
4852 hidden and internal symbols.
4853
221597a5
CC
48542011-07-06 Cary Coutant <ccoutant@google.com>
4855
4856 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4857 Check disposition for startup file.
4858 (Incremental_inputs::report_command_line): Ignore
4859 --incremental-startup-unchanged option.
4860 * options.cc (General_options::parse_incremental_startup_unchanged):
4861 New function.
4862 (General_options::General_options): Initialize new data member.
4863 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4864 (General_options): Add --incremental-startup-unchanged option.
4865 (General_options::incremental_startup_disposition): New function.
4866 (General_options::incremental_startup_disposition_): New data member.
4867
e24719f6
CC
48682011-07-06 Cary Coutant <ccoutant@google.com>
4869
4870 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4871 input file index to Script_info ctor.
4872 (Sized_incremental_binary::do_file_has_changed): Find the
4873 command-line argument for files named in scripts.
4874 * incremental.h (Script_info::Script_info): New ctor
4875 with input file index.
4876 (Script_info::input_file_index): New function.
4877 (Script_info::input_file_index_): New data member.
4878 (Incremental_binary::get_library): Add const.
4879 (Incremental_binary::get_script_info): Add const.
4880 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4881 * testsuite/Makefile.am (incremental_test_5): New test case.
4882 (incremental_test_6): New test case.
4883 * testsuite/Makefile.in: Regenerate.
4884
8f7c81e8
CC
48852011-07-06 Cary Coutant <ccoutant@google.com>
4886
4887 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4888 debug output when command lines differ.
4889
9fbd3822
CC
48902011-07-06 Cary Coutant <ccoutant@google.com>
4891
4892 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4893 --incremental-patch option.
4894 * layout.cc (Free_list::allocate): Extend allocation beyond original
4895 end if enabled.
4896 (Layout::make_output_section): Mark sections that should get
4897 patch space.
4898 * options.cc (parse_percent): New function.
4899 * options.h (parse_percent): New function.
4900 (DEFINE_percent): New macro.
4901 (General_options): Add --incremental-patch option.
4902 * output.cc (Output_section::Output_section): Initialize new data
4903 members.
4904 (Output_section::add_input_section): Print section name when out
4905 of patch space.
4906 (Output_section::add_output_section_data): Likewise.
4907 (Output_section::set_final_data_size): Add patch space when
4908 doing --incremental-full.
4909 (Output_section::do_reset_address_and_file_offset): Remove patch
4910 space.
4911 (Output_segment::set_section_list_addresses): Print debug output
4912 only if --incremental-update.
4913 * output.h (Output_section::set_is_patch_space_allowed): New function.
4914 (Output_section::is_patch_space_allowed_): New data member.
4915 (Output_section::patch_space_): New data member.
4916 * parameters.cc (Parameters::incremental_full): New function.
4917 * parameters.h (Parameters::incremental_full): New function
4918 * testsuite/Makefile.am (incremental_test_2): Add test for
4919 --incremental-patch option.
4920 * testsuite/Makefile.in: Regenerate.
4921 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4922 (t18): Remove function body.
4923
f6cccc2c
DK
49242011-07-05 Doug Kwan <dougkwan@google.com>
4925
4926 PR gold/12771
4927 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4928 Arm_Address type for relocation result.
4929 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4930 overflow check.
4931 (Arm_relocate_functions::abs32): Use unaligned access.
4932 (Arm_relocate_functions::rel32): Ditto.
4933 (Arm_relocate_functions::prel31): Ditto.
4934 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4935 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4936 static data relocations.
4937 * testsuite/Makefile.in: Regnerate.
4938 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4939
28a13fec
ILT
49402011-07-05 Ian Lance Taylor <iant@google.com>
4941
4942 PR gold/12392
4943 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4944 symbols if necessary.
4945 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4946
24d47b34
ILT
49472011-07-05 Ian Lance Taylor <iant@google.com>
4948
4949 PR gold/12952
4950 * resolve.cc (Symbol::override_base_with_special): Simply override
4951 version with special symbol version, ignoring previous version.
4952
41f9cbbe
ILT
49532011-07-05 Ian Lance Taylor <iant@google.com>
4954
4955 * object.cc (Sized_relobj_file::include_section_group): Add
4956 information to comment about signature location.
4957
886288f1
ILT
49582011-07-02 Ian Lance Taylor <iant@google.com>
4959
4960 PR gold/12957
4961 * options.h (class General_options): Add -f and -F.
4962 * options.cc (General_options::finalize): Fatal error if -f/-F
4963 are used without -shared.
4964 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4965
ae3a6d4f
ILT
49662011-07-02 Ian Lance Taylor <iant@google.com>
4967
4968 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4969
21131061
ILT
49702011-07-01 Ian Lance Taylor <iant@google.com>
4971
4972 PR gold/12525
4973 PR gold/12952
4974 * resolve.cc (Symbol::override_base_with_special): Don't override
4975 the version if the overriding symbol has a different name.
4976 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4977 all callers. If we give an error about an undefined version,
4978 define the base version if necessary.
4979 * dynobj.h (class Versions): Update declaration.
4980 * testsuite/weak_alias_test_5.cc: New file.
4981 * testsuite/weak_alias_test.script: New file.
4982 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4983 and versioned_alias have the right value, and call t2.
4984 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4985 weak_alias_test_5.so.
4986 (weak_alias_test_LDADD): Likewise.
4987 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4988 * testsuite/Makefile.in: Rebuild.
4989
611062c0
ILT
49902011-07-01 Ian Lance Taylor <iant@google.com>
4991
4992 PR gold/12525
4993 * options.h (class General_options): Support -z notext.
4994 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4995 -Wl,-z,notext.
4996 (two_file_shared_nonpic.so): Likewise.
4997 (two_file_shared_mixed.so): Likewise.
4998 (two_file_shared_mixed_1.so): Likewise.
4999 (weak_undef_lib_nonpic.so): Likewise.
5000 (alt/weak_undef_lib_nonpic.so): Likewise.
5001 (tls_test_shared_nonpic.so): Likewise.
5002 * testsuite/Makefile.in: Rebuild.
5003
328c7c2f
ILT
50042011-07-01 Ian Lance Taylor <iant@google.com>
5005
5006 PR gold/12525
5007 * configure.ac: Test whether static linking works, setting
5008 the automake conditional HAVE_STATIC.
5009 * testsuite/Makefile.am: Disable tests using -static if
5010 HAVE_STATIC is not true.
5011 * configure, testsuite/Makefile.in: Rebuild.
5012
02d7cd44
ILT
50132011-07-01 Ian Lance Taylor <iant@google.com>
5014
5015 PR gold/12525
5016 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5017 Assert if we see DW_EH_PE_indirect.
5018 * target.h (Target::ehframe_datarel_base): New function.
5019 (Target::do_ehframe_datarel_base): New target function.
5020 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5021 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5022 function.
5023
07a60597
ILT
50242011-07-01 Ian Lance Taylor <iant@google.com>
5025
5026 PR gold/12571
5027 * options.h (class General_options): Add
5028 --ld-generated-unwind-info.
5029 * ehframe.cc (Fde::write): Add address parameter. Change all
5030 callers. If associated with PLT, fill in address and size.
5031 (Cie::set_output_offset): Only add merge mapping if there is an
5032 object.
5033 (Cie::write): Add address parameter. Change all callers.
5034 (Eh_frame::add_ehframe_for_plt): New function.
5035 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5036 input_offset_ fields into union u_, with new plt field.
5037 (Fde::Fde): Adjust for new union field.
5038 (Fde::Fde) [Output_data version]: New constructor.
5039 (Fde::add_mapping): Only add merge mapping if there is an object.
5040 (class Cie): Update declarations.
5041 (class Eh_frame): Declare add_ehframe_for_plt.
5042 * layout.cc (Layout::layout_eh_frame): Break out code into
5043 make_eh_frame_section, and call it.
5044 (Layout::make_eh_frame_section): New function.
5045 (Layout::add_eh_frame_for_plt): New function.
5046 * layout.h (class Layout): Update declarations.
5047 * merge.cc (Merge_map::add_mapping): Add assertion.
5048 * i386.cc: Include "dwarf.h".
5049 (class Output_data_plt_i386): Make first_plt_entry,
5050 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5051 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5052 and plt_eh_frame_fde.
5053 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5054 boundary. Call add_eh_frame_for_plt if appropriate.
5055 * x86_64.cc: Include "dwarf.h".
5056 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5057 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5058 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5059 and plt_eh_frame_fde.
5060 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5061 appropriate.
5062
14788a3f
ILT
50632011-06-29 Ian Lance Taylor <iant@google.com>
5064
5065 PR gold/12629
5066 * object.cc (Sized_relobj_file::layout_section): Change shdr
5067 parameter to be const.
5068 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5069 out of do_layout.
5070 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5071 appropriate. Call layout_eh_frame_section.
5072 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5073 sections.
5074 * object.h (class Sized_relobj_file): Update declarations.
5075
6c21fce1
ILT
50762011-06-29 Ian Lance Taylor <iant@google.com>
5077
37e41b03 5078 PR gold/12652
6c21fce1
ILT
5079 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5080 modifier.
5081 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5082
4d5e4e62
ILT
50832011-06-29 Ian Lance Taylor <iant@google.com>
5084
5085 PR gold/12675
5086 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5087 SHT_X86_64_UNWIND.
5088 * layout.cc (Layout::layout_eh_frame): Likewise.
5089
886f533a
ILT
50902011-06-29 Ian Lance Taylor <iant@google.com>
5091
5092 PR gold/12695
5093 * layout.cc (Layout::symtab_section_shndx): New function.
5094 * layout.h (class Layout): Declare symtab_section_shndx.
5095 * output.cc (Output_section::write_header): Call it.
5096
f3ae1b28
ILT
50972011-06-29 Ian Lance Taylor <iant@google.com>
5098
5099 PR gold/12818
5100 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5101 symbols which are not used in a relocation.
5102
aecf301f
ILT
51032011-06-28 Ian Lance Taylor <iant@google.com>
5104
5105 PR gold/12898
5106 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5107 script create indistinguishable segments.
5108 (Layout::set_segment_offsets): Use stable_sort when sorting
5109 segments. Pass this to Compare_segments constructor.
5110 * layout.h (class Layout): Make segment_precedes non-static.
5111 (class Compare_segments): Change from struct to class. Add
5112 layout_ field. Add constructor.
5113 * script-sections.cc
5114 (Script_sections::attach_sections_using_phdrs_clause): Rename
5115 local orphan to is_orphan. Don't report failure to put empty
5116 section in segment. On attachment failure, report name of
5117 section, and attach to first PT_LOAD segment.
5118
03ef7571
ILT
51192011-06-28 Ian Lance Taylor <iant@google.com>
5120
5121 PR gold/12934
5122 * target-select.cc (Target_selector::Target_selector): Add
5123 emulation parameter. Change all callers.
5124 (select_target_by_bfd_name): Rename from select_target_by_name.
5125 Change all callers.
5126 (select_target_by_emulation): New function.
5127 (supported_emulation_names): New function.
5128 * target-select.h (class Target_selector): Add emulation_ field.
5129 Update declarations.
5130 (Target_selector::recognize_by_bfd_name): Rename from
5131 recognize_by_name. Change all callers.
5132 (Target_selector::supported_bfd_names): Rename from
5133 supported_names. Change all callers.
5134 (Target_selector::recognize_by_emulation): New function.
5135 (Target_selector::supported_emulations): New function.
5136 (Target_selector::emulation): New function.
5137 (Target_selector::do_recognize_by_bfd_name): Rename from
5138 do_recognize_by_name. Change all callers.
5139 (Target_selector::do_supported_bfd_names): Rename from
5140 do_supported_names. Change all callers.
5141 (Target_selector::do_recognize_by_emulation): New function.
5142 (Target_selector::do_supported_emulations): New function.
5143 (select_target_by_bfd_name): Change name in declaration.
5144 (select_target_by_emulation): Declare.
5145 (supported_emulation_names): Declare.
5146 * parameters.cc (parameters_force_valid_target): Try to find
5147 target based on emulation from -m option.
5148 * options.h (class General_options): Change doc string for -m.
5149 * options.cc (help): Print emulations.
5150 (General_options::parse_V): Likewise.
5151 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5152 Add emulation parameter. Change all callers.
5153
200b2bb9
ILT
51542011-06-28 Ian Lance Taylor <iant@google.com>
5155
5156 * target.h (class Target): Add osabi_ field.
5157 (Target::osabi): New function.
5158 (Target::set_osabi): New function.
5159 (Target::Target): Initialize osabi_.
5160 (Target::do_adjust_elf_header): Make pure virtual.
5161 (Sized_target::do_adjust_elf_header): Declare.
5162 * target.cc (Sized_target::do_adjust_elf_header): New function.
5163 (class Sized_target): Instantiate all versions.
5164 * freebsd.h (class Target_freebsd): Remove.
5165 (Target_selector_freebsd::do_recognize): Call set_osabi on
5166 Target.
5167 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5168 (Target_selector_freebsd::set_osabi): Remove.
5169 * i386.cc (class Target_i386): Inherit from Sized_target rather
5170 than Target_freebsd.
5171 * x86_64.cc (class Target_x86_64): Likewise.
5172
b3ce541e
ILT
51732011-06-28 Ian Lance Taylor <iant@google.com>
5174
5175 * target.h (Target::can_check_for_function_pointers): Rewrite.
5176 Make non-virtual.
5177 (Target::can_icf_inline_merge_sections): Likewise.
5178 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5179 (Target::Target_info): Add can_icf_inline_merge_sections field.
5180 (Target::do_can_check_for_function_pointers): New virtual
5181 function.
5182 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5183 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5184 from can_check_for_function_pointers, move in file.
5185 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5186 section_may_have_icf_unsafe_poineters, move in file.
5187 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5188 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5189 Rename from can_check_for_function_pointers, move in file.
5190 (Target_i386::can_icf_inline_merge_sections): Remove.
5191 (Target_i386::i386_info): Initialize
5192 can_icf_inline_merge_sections.
5193 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5194 Initialize can_icf_inline_merge_sections.
5195 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5196 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5197 Rename from can_check_for_function_pointers, move in file.
5198 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5199 (Target_x86_64::x86_64_info): Initialize
5200 can_icf_inline_merge_sections.
5201 * testsuite/testfile.cc (Target_test::test_target_info):
5202 Likewise.
5203 * icf.cc (get_section_contents): Correct formatting.
5204
6d1c4efb
ILT
52052011-06-27 Ian Lance Taylor <iant@google.com>
5206
5207 * symtab.cc (Symbol::versioned_name): New function.
5208 (Symbol_table::add_to_final_symtab): Use versioned_name when
5209 appropriate.
5210 (Symbol_table::sized_write_symbol): Likewise.
5211 * symtab.h (class Symbol): Declare versioned_name.
5212 * stringpool.h (class Stringpool_template): Add variant of add
5213 which takes a std::basic_string.
5214 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5215 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5216 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5217 (ver_test_12.o): New target.
5218 * testsuite/Makefile.in: Rebuild.
5219
57eb9b50
DK
52202011-06-27 Doug Kwan <dougkwan@google.com>
5221
5222 * arm.cc (Arm_relocate_functions::thm_jump8,
5223 Arm_relocate_functions::thm_jump11): Use a wider signed
5224 type to compute offset.
5225 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5226 arm_thm_jump8.
5227 * testsuite/Makefile.in: Regenerate.
5228 * testsuite/arm_branch_in_range.sh: Check test results of
5229 arm_thm_jump11 and arm_thm_jump8.
5230 * testsuite/arm_thm_jump11.s: New test source file.
5231 * testsuite/arm_thm_jump11.t: New linker script.
5232 * testsuite/arm_thm_jump8.s: New test source file.
5233 * testsuite/arm_thm_jump8.t: New linker script.
5234
487b39df
ILT
52352011-06-24 Ian Lance Taylor <iant@google.com>
5236
5237 * layout.cc: Include "object.h".
5238 (ctors_sections_in_init_array): New static variable.
5239 (Layout::is_ctors_in_init_array): New function.
5240 (Layout::layout): Add entry to ctors_sections_in_init_array if
5241 appropriate.
5242 * layout.h (class Layout): Declare is_ctors_in_init_array.
5243 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5244 is_ctors_reverse_view is set.
5245 (Sized_relobj_file::write_sections): Add layout parameter. Change
5246 all callers. Set is_ctors_reverse_view field of View_size.
5247 (Sized_relobj_file::reverse_words): New function.
5248 * object.h (Sized_relobj_file::View_size): Add
5249 is_ctors_reverse_view field.
5250 (class Sized_relobj_file): Update declarations.
5251 * testsuite/initpri3.c: New test.
5252 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5253 initpri3b.
5254 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5255 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5256 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5257 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5258 * testsuite/Makefile.in: Rebuild.
5259
472076e4
CC
52602011-06-24 Cary Coutant <ccoutant@google.com>
5261
5262 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5263 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5264 (debug_msg_cdebug.err): New targets.
5265 * testsuite/Makefile.in: Regenerate.
5266 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5267 Fix checks for link with shared library.
5268
a60af0db
DK
52692011-06-24 Doug Kwan <dougkwan@google.com>
5270
5271 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5272 skip empty text sections.
5273 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5274
5393d741
ILT
52752011-06-22 Ian Lance Taylor <iant@google.com>
5276
5277 PR gold/12910
5278 * options.h (class General_options): Add --ctors-in-init-array.
5279 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5280 friends as SHT_PROGBITS for merging sections.
5281 (Layout::layout): Remove special handling of .init_array and
5282 friends. Don't sort if doing relocatable link. Sort for .ctors
5283 and .dtors if ctors_in_init_array.
5284 (Layout::make_output_section): Force correct section types for
5285 .init_array and friends. Don't sort if doing relocatable link,
5286 Don't sort .ctors and .dtors if ctors_in_init_array.
5287 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5288 (Layout::output_section_name): Add relobj parameter. Change all
5289 callers. Handle .ctors. and .dtors. in code rather than table.
5290 Handle .ctors and .dtors if ctors_in_init_array.
5291 (Layout::match_file_name): New function, moved from output.cc.
5292 * layout.h (class Layout): Update declarations.
5293 * output.cc: Include "layout.h".
5294 (Input_section_sort_entry::get_priority): New function.
5295 (Input_section_sort_entry::match_file_name): Just call
5296 Layout::match_file_name.
5297 (Output_section::Input_section_sort_init_fini_compare::operator()):
5298 Handle .ctors and .dtors. Sort by explicit priority rather than
5299 by name.
5300 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5301 * testsuite/initpri2.c: New test.
5302 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5303 (check_PROGRAMS): Add initpri2.
5304 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5305 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5306 * configure, testsuite/Makefile.in: Rebuild.
5307
e1f74f98
ILT
53082011-06-19 Ian Lance Taylor <iant@google.com>
5309
5310 PR gold/12880
5311 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5312 .interp section to a PT_INTERP segment even if we have seen a
5313 --dynamic-linker option. Don't do it if we have seen a PHDRS
5314 clause in a linker script.
5315 (Layout::finalize): Don't create a .interp section if we've
5316 already create a PT_INTERP segment.
5317 (Layout::create_interp): Always call choose_output_section (revert
5318 patch of 2011-06-17). Don't create PT_INTERP segment.
5319 * script-sections.cc
5320 (Script_sections::create_note_and_tls_segments): Add a .interp
5321 section to a PT_INTERP segment even if we have seen a
5322 --dynamic-linker option.
5323
766f91bb
ILT
53242011-06-18 Ian Lance Taylor <iant@google.com>
5325
5326 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5327 merely because a non-PT_LOAD segment has a dynamic reloc.
5328
0d212c3a
ILT
53292011-06-18 Ian Lance Taylor <iant@google.com>
5330
5331 * layout.cc (Layout::finish_dynamic_section): Don't create
5332 DT_FLAGS entry if not needed.
5333
911a5072
ILT
53342011-06-18 Ian Lance Taylor <iant@google.com>
5335
5336 PR gold/12745
5337 * layout.cc (Layout::layout_eh_frame): Correct handling of
5338 writable .eh_frame section.
5339
534b4e5f
ILT
53402011-06-17 Ian Lance Taylor <iant@google.com>
5341
5342 PR gold/12893
5343 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5344 symbol is redefined with the exact same object and value.
5345
10b4f102
ILT
53462011-06-17 Ian Lance Taylor <iant@google.com>
5347
5348 PR gold/12880
5349 * layout.h (class Layout): Add interp_segment_ field.
5350 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5351 (Layout::attach_allocated_section_to_segment): If making shared
5352 library, put .interp section in PT_INTERP segment.
5353 (Layout::finalize): Also call create_interp if -dynamic-linker
5354 option was used.
5355 (Layout::create_interp): Assert that there is no PT_INTERP
5356 segment. If not using a SECTIONS clause, use make_output_section.
5357 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5358 * script-sections.cc
5359 (Script_sections::create_note_and_tls_segments): If making shared
5360 library, put .interp section in PT_INTERP segment.
5361
a29b0dad
ILT
53622011-06-17 Ian Lance Taylor <iant@google.com>
5363
e588ea8d
ILT
5364 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5365 when making a shared library.
5366
53672011-06-17 Ian Lance Taylor <iant@google.com>
5368
5369 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5370 parameter. Change all callers. Don't issue warning about PC32
5371 against locally defined symbol.
a29b0dad 5372
9d3b0698
ILT
53732011-06-16 Ian Lance Taylor <iant@google.com>
5374
5375 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5376 occurs in same object.
5377
85b0f90c
AM
53782011-06-14 Alan Modra <amodra@gmail.com>
5379
5380 * po/POTFILES.in: Regenerate.
5381
a94907d9
ILT
53822011-06-09 Ian Lance Taylor <iant@google.com>
5383
5384 * script-sections.cc
5385 (Orphan_output_section::set_section_addresses): For a relocatable
5386 link set address to 0.
5387
4fb3a1c3
CC
53882011-06-09 Cary Coutant <ccoutant@google.com>
5389
5390 PR gold/12804
5391 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5392 used with --compress-debug-sections.
5393 * gold/object.cc (Sized_relobj_file::do_layout): Report
5394 uncompressed size of compressed input sections.
5395
61220854
CC
53962011-06-08 Cary Coutant <ccoutant@google.com>
5397
5398 PR gold/12804
5399 * testsuite/two_file_test_2_v1.cc: Change initialization of
5400 v2 to keep it in .data.
5401
e6455dfb
CC
54022011-06-07 Cary Coutant <ccoutant@google.com>
5403
5404 * common.cc (Symbol_table::do_allocate_commons_list): Call
5405 gold_fallback.
5406 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5407 (Errors::fallback): New function.
5408 (gold_fallback): New function.
5409 * errors.h (Errors::fallback): New function.
5410 * gold.cc (gold_exit): Change status parameter to enum; adjust
5411 all callers.
5412 (queue_initial_tasks): Call gold_fallback.
5413 * gold.h: Include cstdlib.
5414 (Exit_status): New enum type.
5415 (gold_exit): Change status parameter to enum.
5416 (gold_fallback): New function.
5417 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5418 (Layout::create_symtab_sections): Likewise.
5419 (Layout::create_shdrs): Likewise.
5420 * main.cc (main): Adjust call to gold_exit.
5421 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5422 (Output_data_got::add_got_entry_pair): Likewise.
5423 (Output_section::add_input_section): Likewise.
5424 (Output_section::add_output_section_data): Likewise.
5425 (Output_segment::set_section_list_addresses): Likewise.
5426 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5427
fb0e076f
CC
54282011-06-07 Cary Coutant <ccoutant@google.com>
5429
5430 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5431 for incremental links.
5432 * output.cc (Output_segment::set_section_list_addresses): Remove
5433 FIXME and test for TLS or BSS.
5434
a5ee4d5d
CC
54352011-06-07 Cary Coutant <ccoutant@google.com>
5436
5437 * testsuite/Makefile.am: Add incremental_copy_test,
5438 incremental_common_test_1.
5439 * testsuite/Makefile.in: Regenerate.
5440 * testsuite/common_test_1_v1.c: New source file.
5441 * testsuite/common_test_1_v2.c: New source file.
5442 * testsuite/copy_test_v1.cc: New source file.
5443
5146f448
CC
54442011-06-07 Cary Coutant <ccoutant@google.com>
5445
5446 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5447 update, allocate common from bss section's free list.
5448 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5449 linker-defined symbols.
5450 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5451 Skip GOT and PLT entries that are no longer referenced.
5452 (Output_section_incremental_inputs::write_info_blocks): Mark
5453 linker-defined symbols.
5454 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5455 * output.cc (Output_section::allocate): New function.
5456 * output.h (Output_section::allocate): New function.
5457 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5458 linker-defined symbols.
5459 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5460 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5461 (Symbol::init_base_output_data): Likewise.
5462 (Symbol::init_base_output_segment): Likewise.
5463 (Symbol::init_base_constant): Likewise.
5464 (Sized_symbol::init_output_data): Likewise.
5465 (Sized_symbol::init_output_segment): Likewise.
5466 (Sized_symbol::init_constant): Likewise.
5467 (Symbol_table::do_define_in_output_data): Likewise.
5468 (Symbol_table::do_define_in_output_segment): Likewise.
5469 (Symbol_table::do_define_as_constant): Likewise.
5470 * symtab.h (Symbol::is_predefined): New function.
5471 (Symbol::init_base_output_data): Add is_predefined parameter.
5472 (Symbol::init_base_output_segment): Likewise.
5473 (Symbol::init_base_constant): Likewise.
5474 (Symbol::is_predefined_): New data member.
5475 (Sized_symbol::init_output_data): Add is_predefined parameter.
5476 (Sized_symbol::init_output_segment): Likewise.
5477 (Sized_symbol::init_constant): Likewise.
5478 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5479
26d3c67d
CC
54802011-06-07 Cary Coutant <ccoutant@google.com>
5481
5482 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5483 instead of emit_copy_reloc.
5484 (Copy_relocs::emit_copy_reloc): Refactor.
5485 (Copy_relocs::make_copy_reloc): New function.
5486 (Copy_relocs::add_copy_reloc): Remove.
5487 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5488 section.
5489 (Copy_relocs::make_copy_reloc): New function.
5490 (Copy_relocs::add_copy_reloc): Remove.
5491 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5492 unchanged input files.
5493 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5494 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5495 Reserve BSS space for COPY relocations.
5496 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5497 (Output_section_incremental_inputs::write_info_blocks): Record
5498 whether a symbol is copied from a shared object.
5499 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5500 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5501 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5502 (Incremental_input_entry_reader::get_output_symbol_index): Add
5503 is_copy parameter.
5504 (Incremental_binary::emit_copy_relocs): New function.
5505 (Incremental_binary::do_emit_copy_relocs): New function.
5506 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5507 new data member.
5508 (Sized_incremental_binary::add_copy_reloc): New function.
5509 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5510 (Sized_incremental_binary::Copy_reloc): New struct.
5511 (Sized_incremental_binary::Copy_relocs): New typedef.
5512 (Sized_incremental_binary::copy_relocs_): New data member.
5513 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5514 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5515 * target.h (Sized_target::emit_copy_reloc): New function.
5516 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5517
7cdb37d9
CC
55182011-06-02 Cary Coutant <ccoutant@google.com>
5519
5520 PR gold/12163
5521 * gold/archive.cc (Archive::Archive): Initialize new data member.
5522 (Archive::include_all_members): Return if archive has already been
5523 included.
5524 * gold/archive.h (Archive::include_all_members_): New data member.
5525
cc643b88
NC
55262011-06-02 Nick Clifton <nickc@redhat.com>
5527
5528 * dynobj.h: Fix spelling mistake in comment.
5529 * output.cc: Likewise.
5530
f62a3ca7 55312011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5532 Asier Llano
f62a3ca7
DK
5533
5534 PR gold/12826
cc643b88 5535 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5536 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5537 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5538 redundant arm_exidx_test.so.
5539 * testsuite/Makefile.in: Regenerate.
5540 (check_SCRIPTS): Add pr12826.sh
5541 (check_DATA): Add pr12826.stdout
5542 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5543 * testsuite/pr12826.sh: New file.
5544 * testsuite/pr12826_1.s: Ditto.
5545 * testsuite/pr12826_1.s: Ditto.
5546
8dbe1edc
ILT
55472011-05-30 Ian Lance Taylor <iant@google.com>
5548
5549 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5550 sections.
5551
c49875be
ILT
55522011-05-29 Ian Lance Taylor <iant@google.com>
5553
5554 PR gold/12804
5555 * testsuite/Makefile.am: Use different file name for two_file_test
5556 temporary file for each incremental test.
5557 * testsuite/Makefile.in: Rebuild.
5558
69d53f7a
ILT
55592011-05-29 Ian Lance Taylor <iant@google.com>
5560
5561 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5562 binary input file is empty.
5563
41d0ab5f
ILT
55642011-05-27 Ian Lance Taylor <iant@google.com>
5565
5566 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5567 (ver_test_9.so): Likewise.
5568 * testsuite/Makefile.in: Rebuild.
5569
89d8a36b
CC
55702011-05-26 Cary Coutant <ccoutant@google.com>
5571
5572 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5573 * incremental.cc (Incremental_inputs::report_input_section): Fix
5574 comment, indentation.
5575 (Incremental_inputs::report_comdat_group): New function.
5576 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5577 of data for incremental input file entry.
5578 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5579 group count, COMDAT group signatures.
5580 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5581 an unchanged input file.
5582 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5583 Initialize new data member.
5584 (Incremental_object_entry::add_comdat_group): New function.
5585 (Incremental_object_entry::get_comdat_group_count): New function.
5586 (Incremental_object_entry::get_comdat_signature_key): New function.
5587 (Incremental_object_entry::groups_): New data member.
5588 (Incremental_inputs::report_comdat_group): New function.
5589 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5590 data for incremental input file entry.
5591 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5592 (Incremental_input_entry_reader::get_input_section): Adjust size of
5593 data for incremental input file entry.
5594 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5595 (Incremental_input_entry_reader::get_comdat_group_signature): New
5596 function.
5597 * object.cc (Sized_relobj::include_section_group): Report kept
5598 COMDAT groups for incremental links.
5599
1706a06f
ILT
56002011-05-24 David Meyer <pdox@google.com>
5601
5602 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5603 with name parameter. Add found_name parameter.
5604 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5605 * dirsearch.h (class Dirsearch): Update declaration.
5606
a10ae760
ILT
56072011-05-24 Ian Lance Taylor <iant@google.com>
5608
5609 * archive.cc (Library_base::should_include_member): Pull in object
5610 from archive if it defines the entry symbol.
5611 * parameters.cc (Parameters::entry): New function.
5612 * parameters.h (class Parameters): Declare entry.
5613 * output.h (class Output_file_header): Remove entry_ field.
5614 * output.cc (Output_file_header::Output_file_header): Remove entry
5615 parameter. Change all callers.
5616 (Output_file_header::entry): Use parameters->entry.
5617 * gold.cc (queue_middle_tasks): Likewise.
5618 * plugin.cc (Plugin_hook::run): Likewise.
5619
aa92d6ed
CC
56202011-05-24 Cary Coutant <ccoutant@google.com>
5621
5622 * gold.cc (queue_initial_tasks): Pass incremental base filename
5623 to Output_file::open_base_file; don't print error message.
5624 * incremental-dump.cc (main): Adjust call to
5625 Output_file::open_for_modification.
5626 * incremental-dump.cc (main): Likewise.
5627 * incremental.cc (Incremental_inputs::report_command_line):
5628 Ignore --incremental-base option when comparing command lines.
5629 Ignore parameter when given as separate argument.
5630 * options.h (class General_options): Add --incremental-base.
5631 * output.cc (Output_file::Output_file):
5632 (Output_file::open_base_file): Add base_name and writable parameters;
5633 read base file into new file; print error message here.
5634 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5635 callers.
5636 * output.h (Output_file::open_for_modification): Rename to...
5637 (Output_file::open_base_file): ...this; add base_name and
5638 writable parameters; adjust all callers.
5639 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5640 callers.
5641 * testsuite/Makefile.am (incremental_test_4): Test
5642 --incremental-base.
5643 * testsuite/Makefile.in: Regenerate.
5644
2eedd706
CC
56452011-05-24 Cary Coutant <ccoutant@google.com>
5646
5647 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5648 incremental_test_4.
5649 * testsuite/Makefile.in: Regenerate.
5650 * testsuite/two_file_test_1_v1.cc: New test source file.
5651 * testsuite/two_file_test_1b_v1.cc: New test source file.
5652 * testsuite/two_file_test_2_v1.cc: New test source file.
5653
0f1c85a6
CC
56542011-05-24 Cary Coutant <ccoutant@google.com>
5655
5656 * dynobj.h (Dynobj::do_dynobj): New function.
5657 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5658 flag and soname for shared objects.
5659 * incremental.cc (Incremental_inputs::report_object): Make
5660 either Incremental_object_entry or Incremental_dynobj_entry; add
5661 soname to string table.
5662 (Incremental_inputs::report_input_section): Add assertion.
5663 (Output_section_incremental_inputs::set_final_data_size): Adjust
5664 type of input file entry for shared libraries; adjust size of
5665 shared library info entry.
5666 (Output_section_incremental_inputs::write_input_files): Write
5667 as_needed flag for shared libraries.
5668 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5669 of input file entry for shared libraries; write soname.
5670 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5671 soname from incremental info.
5672 * incremental.h (enum Incremental_input_flags): Add
5673 INCREMENTAL_INPUT_AS_NEEDED.
5674 (Incremental_input_entry::Incremental_input_entry): Initialize new
5675 data member.
5676 (Incremental_input_entry::set_as_needed): New function.
5677 (Incremental_input_entry::as_needed): New function.
5678 (Incremental_input_entry::do_dynobj_entry): New function.
5679 (Incremental_input_entry::as_needed_): New data member.
5680 (Incremental_object_entry::Incremental_object_entry): Don't check
5681 for shared library.
5682 (Incremental_object_entry::do_type): Likewise.
5683 (class Incremental_dynobj_entry): New class.
5684 (Incremental_input_entry_reader::as_needed): New function.
5685 (Incremental_input_entry_reader::get_soname): New function.
5686 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5687 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5688 size of shared library info entry.
58797674 5689 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5690 incremental link when adding DT_NEEDED entries.
5691 * object.h (Object::Object): Initialize new data member.
5692 (Object::dynobj): New function.
5693 (Object::set_as_needed): New function.
5694 (Object::as_needed): New function.
5695 (Object::do_dynobj): New function.
5696 (Object::as_needed_): New data member.
5697
6fa2a40b
CC
56982011-05-24 Cary Coutant <ccoutant@google.com>
5699
5700 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5701 info; adjust display of GOT entries.
5702 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5703 vector of input objects; remove file_status_.
5704 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5705 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5706 got_plt reader; call target hooks to reserve GOT entries.
5707 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5708 of input file info header and GOT info entry.
5709 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5710 relocation info.
5711 (Got_plt_view_info::got_descriptor): Remove.
5712 (Got_plt_view_info::sym_index): New data member.
5713 (Got_plt_view_info::input_index): New data member.
5714 (Local_got_offset_visitor::visit): Write input file index.
5715 (Global_got_offset_visitor::visit): Write 0 for input file index.
5716 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5717 with sym_index and input_index.
5718 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5719 incremental info GOT entry; replace got_descriptor with input_index.
5720 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5721 map from input file index to object.
5722 (Sized_relobj_incr::do_layout): Replace direct data member reference
5723 with accessor function.
5724 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5725 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5726 Adjust size of input file info header.
5727 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5728 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5729 (Incremental_input_entry_reader::get_input_section): Adjust size of
5730 input file info header.
5731 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5732 of incremental info GOT entry.
5733 (Incremental_got_plt_reader::get_got_desc): Remove.
5734 (Incremental_got_plt_reader::get_got_symndx): New function.
5735 (Incremental_got_plt_reader::get_got_input_index): New function.
5736 (Sized_incremental_binary::Sized_incremental_binary): Remove
5737 file_status_; add input_objects_.
5738 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5739 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5740 (Sized_incremental_binary::file_is_unchanged): Remove.
5741 (Sized_incremental_binary::set_input_object): New function.
5742 (Sized_incremental_binary::input_object): New function.
5743 (Sized_incremental_binary::file_status_): Remove.
5744 (Sized_incremental_binary::input_objects_): New data member.
5745 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5746 references.
5747 (Sized_relobj_incr::invalid_address): Move to base class.
5748 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5749 class.
5750 (Sized_relobj_incr::do_output_section_offset): Likewise.
5751 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5752 (Sized_relobj_incr::section_offsets_): Likewise.
5753 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5754 function.
5755 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5756 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5757 with accessor function.
5758 (Sized_relobj_file::do_layout): Likewise.
5759 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5760 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5761 (Sized_relobj_file::compute_final_local_value): Replace refs to
5762 section_offsets_ with accessor function.
5763 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5764 * object.h (Relobj::Relobj): Initialize new data members.
5765 (Relobj::add_dyn_reloc): New function.
5766 (Relobj::first_dyn_reloc): New function.
5767 (Relobj::dyn_reloc_count): New function.
5768 (Relobj::first_dyn_reloc_): New data member.
5769 (Relobj::dyn_reloc_count_): New data member.
5770 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5771 references.
5772 (Sized_relobj::Address): New typedef.
5773 (Sized_relobj::invalid_address): Move here from child class.
5774 (Sized_relobj::Sized_relobj): Initialize new data members.
5775 (Sized_relobj::sized_relobj): New function.
5776 (Sized_relobj::is_output_section_offset_invalid): Move here from
5777 child class.
5778 (Sized_relobj::get_output_section_offset): Likewise.
5779 (Sized_relobj::local_has_got_offset): Likewise.
5780 (Sized_relobj::local_got_offset): Likewise.
5781 (Sized_relobj::set_local_got_offset): Likewise.
5782 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5783 (Sized_relobj::clear_got_offsets): New function.
5784 (Sized_relobj::section_offsets): Move here from child class.
5785 (Sized_relobj::do_output_section_offset): Likewise.
5786 (Sized_relobj::do_set_section_offset): Likewise.
5787 (Sized_relobj::Local_got_offsets): Likewise.
5788 (Sized_relobj::local_got_offsets_): Likewise.
5789 (Sized_relobj::section_offsets_): Likewise.
5790 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5791 references.
5792 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5793 class.
5794 (Sized_relobj_file::sized_relobj): New function
5795 (Sized_relobj_file::local_has_got_offset): Move to base class.
5796 (Sized_relobj_file::local_got_offset): Likewise.
5797 (Sized_relobj_file::set_local_got_offset): Likewise.
5798 (Sized_relobj_file::get_output_section_offset): Likewise.
5799 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5800 (Sized_relobj_file::do_output_section_offset): Likewise.
5801 (Sized_relobj_file::do_set_section_offset): Likewise.
5802 (Sized_relobj_file::Local_got_offsets): Likewise.
5803 (Sized_relobj_file::local_got_offsets_): Likewise.
5804 (Sized_relobj_file::section_offsets_): Likewise.
5805 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5806 (all constructors).
5807 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5808 (Output_reloc::get_symbol_index): Likewise.
5809 (Output_reloc::local_section_offset): Likewise.
5810 (Output_reloc::get_address): Likewise.
5811 (Output_reloc::symbol_value): Likewise.
5812 (Output_data_got::reserve_slot): Move to class definition.
5813 (Output_data_got::reserve_local): New function.
5814 (Output_data_got::reserve_slot_for_global): Remove.
5815 (Output_data_got::reserve_global): New function.
5816 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5817 (all constructors, two instantiations).
5818 (Output_reloc::get_relobj): New function (two instantiations).
5819 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5820 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5821 (Output_data_reloc::add_global): Adjust type of relobj.
5822 (Output_data_reloc::add_global_relative): Likewise.
5823 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5824 (Output_data_reloc::add_local): Likewise.
5825 (Output_data_reloc::add_local_relative): Likewise.
5826 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5827 (Output_data_reloc::add_local_section): Likewise.
5828 (Output_data_reloc::add_output_section): Likewise.
5829 (Output_data_reloc::add_absolute): Likewise.
5830 (Output_data_reloc::add_target_specific): Likewise.
5831 (Output_data_got::reserve_slot): Move definition here.
5832 (Output_data_got::reserve_local): New function.
5833 (Output_data_got::reserve_global): New function.
5834 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5835 section_offsets_ with accessor function.
5836 (Sized_relobj_file::write_sections): Likewise.
5837 (Sized_relobj_file::do_relocate_sections): Likewise.
5838 * target.h (Sized_target::reserve_local_got_entry): New function.
5839 (Sized_target::reserve_global_got_entry): New function.
5840 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5841 (Target_x86_64::reserve_global_got_entry): New function.
5842 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5843
4829d394
CC
58442011-05-23 Cary Coutant <ccoutant@google.com>
5845
5846 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5847 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5848 bit when checking got_type.
5849 * incremental.cc (Sized_incremental_binary::setup_readers):
5850 Store symbol table and string table locations; initialize bit vector
5851 of file status flags.
5852 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5853 unchanged files.
5854 (Sized_incremental_binary::do_process_got_plt): New function.
5855 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5856 (Output_section_incremental_inputs::set_final_data_size): Record
5857 file index for each input file.
5858 (Output_section_incremental_inputs::write_got_plt): Store file index
5859 instead of input entry offset for each GOT entry.
5860 * incremental.h
5861 (Incremental_input_entry::Incremental_input_entry): Initialize new
5862 data member.
5863 (Incremental_input_entry::set_offset): Store file index.
5864 (Incremental_input_entry::get_file_index): New function.
5865 (Incremental_input_entry::file_index_): New data member.
5866 (Incremental_binary::process_got_plt): New function.
5867 (Incremental_binary::do_process_got_plt): New function.
5868 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5869 data members.
5870 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5871 (Sized_incremental_binary::set_file_is_unchanged): New function.
5872 (Sized_incremental_binary::file_is_unchanged): New function.
5873 (Sized_incremental_binary::do_process_got_plt): New function.
5874 (Sized_incremental_binary::file_status_): New data member.
5875 (Sized_incremental_binary::main_symtab_loc_): New data member.
5876 (Sized_incremental_binary::main_strtab_loc_): New data member.
5877 * output.cc (Output_data_got::Got_entry::write): Add case
5878 RESERVED_CODE.
5879 (Output_data_got::add_global): Call add_got_entry.
5880 (Output_data_got::add_global_plt): Likewise.
5881 (Output_data_got::add_global_with_rel): Likewise.
5882 (Output_data_got::add_global_with_rela): Likewise.
5883 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5884 (Output_data_got::add_global_pair_with_rela): Likewise.
5885 (Output_data_got::add_local): Call add_got_entry.
5886 (Output_data_got::add_local_plt): Likewise.
5887 (Output_data_got::add_local_with_rel): Likewise.
5888 (Output_data_got::add_local_with_rela): Likewise.
5889 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5890 (Output_data_got::add_local_pair_with_rela): Likewise.
5891 (Output_data_got::reserve_slot): New function.
5892 (Output_data_got::reserve_slot_for_global): New function.
5893 (Output_data_got::add_got_entry): New function.
5894 (Output_data_got::add_got_entry_pair): New function.
5895 (Output_section::add_output_section_data): Edit FIXME.
5896 * output.h
5897 (Output_section_data_build::Output_section_data_build): New
5898 constructor with size parameter.
5899 (Output_data_space::Output_data_space): Likewise.
5900 (Output_data_got::Output_data_got): Initialize new data member; new
5901 constructor with size parameter.
5902 (Output_data_got::add_constant): Call add_got_entry.
5903 (Output_data_got::reserve_slot): New function.
5904 (Output_data_got::reserve_slot_for_global): New function.
5905 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5906 (Output_data_got::add_got_entry): New function.
5907 (Output_data_got::add_got_entry_pair): New function.
5908 (Output_data_got::free_list_): New data member.
5909 * target.h (Sized_target::init_got_plt_for_update): New function.
5910 (Sized_target::register_global_plt_entry): New function.
5911 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5912 Initialize new data member; call init; add constructor with PLT count.
5913 (Output_data_plt_x86_64::init): New function.
5914 (Output_data_plt_x86_64::add_relocation): New function.
5915 (Output_data_plt_x86_64::reserve_slot): New function.
5916 (Output_data_plt_x86_64::free_list_): New data member.
5917 (Target_x86_64::init_got_plt_for_update): New function.
5918 (Target_x86_64::register_global_plt_entry): New function.
5919 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5920 incremental updates.
5921 (Output_data_plt_x86_64::add_relocation): New function.
5922 * testsuite/object_unittest.cc (Object_test): Set default options.
5923
ec69d6da
ILT
59242011-05-16 Ian Lance Taylor <iant@google.com>
5925
5926 * options.h (class General_options): Make -i a synonym for -r.
5927
732e31de
ILT
59282011-05-16 Ian Lance Taylor <iant@google.com>
5929
5930 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5931
403676b5
CC
59322011-05-10 Cary Coutant <ccoutant@google.com>
5933
5934 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5935 strip_all (-s).
5936
5b7b7d6e
ILT
59372011-05-06 Ian Lance Taylor <iant@google.com>
5938
5939 * layout.cc (Layout::layout): If the output section flags change,
5940 update the ordering.
5941
f0f9babf
CC
59422011-04-25 Cary Coutant <ccoutant@google.com>
5943
5944 * incremental-dump.cc (dump_incremental_inputs): Print local
5945 symbol info for each input file.
5946 * incremental.cc
5947 (Output_section_incremental_inputs::set_final_data_size): Add local
5948 symbol info to input file entries in incremental info.
5949 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5950 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5951 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5952 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5953 implementation.
5954 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5955 (Sized_incr_relobj::do_relocate): Write the local symbols.
5956 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5957 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5958 Adjust size of input file header.
5959 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5960 (Incremental_inputs_reader::get_local_symbol_count): New function.
5961 (Incremental_inputs_reader::get_input_section): Adjust size of input
5962 file header.
5963 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5964 (Sized_incr_relobj::This): New typedef.
5965 (Sized_incr_relobj::sym_size): New const data member.
5966 (Sized_incr_relobj::Local_symbol): New struct.
5967 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5968 (Sized_incr_relobj::do_local_symbol_offset): New function.
5969 (Sized_incr_relobj::local_symbol_count_): New data member.
5970 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5971 (Sized_incr_relobj::local_symbol_index_): New data member.
5972 (Sized_incr_relobj::local_symbol_offset_): New data member.
5973 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5974 (Sized_incr_relobj::local_symbols_): New data member.
5975 * object.h (Relobj::output_local_symbol_count): New function.
5976 (Relobj::local_symbol_offset): New function.
5977 (Relobj::do_output_local_symbol_count): New function.
5978 (Relobj::do_local_symbol_offset): New function.
5979 (Sized_relobj::do_output_local_symbol_count): New function.
5980 (Sized_relobj::do_local_symbol_offset): New function.
5981
d0a9ace3
ILT
59822011-04-22 Vladimir Simonov <sv@sw.ru>
5983
5984 * descriptors.cc (set_close_on_exec): New function.
5985 (Descriptors::open): Use set_close_on_exec.
5986 * output.cc (S_ISLNK): Define if not defined.
5987
94a3fc8b
CC
59882011-04-22 Cary Coutant <ccoutant@google.com>
5989
5990 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5991 global symbol map.
5992 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5993 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5994 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5995 relocations.
5996 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5997 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5998 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5999 * incremental.h
6000 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6001 function.
6002 (Incremental_binary::apply_incremental_relocs): New function.
6003 (Incremental_binary::do_apply_incremental_relocs): New function.
6004 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6005 data member.
6006 (Sized_incremental_binary::add_global_symbol): New function.
6007 (Sized_incremental_binary::global_symbol): New function.
6008 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6009 (Sized_incremental_binary::symbol_map_): New data member.
6010 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6011 * target.h (Sized_target::apply_relocation): New function.
6012 * target-reloc.h (apply_relocation): New function.
6013 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6014
c87e4302
DK
60152011-04-22 Doug Kwan <dougkwan@google.com>
6016
6017 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6018 flag of a SHT_ARM_EXIDX section.
2e702c99 6019 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6020 * testsuite/Makefile.in: Regenerate.
6021 * testsuite/arm_exidx_test.s: New file.
6022 * testsuite/arm_exidx_test.sh: Same.
6023
e7782cf6
CC
60242011-04-20 Cary Coutant <ccoutant@google.com>
6025
6026 PR gold/12689
6027 * archive.h (Incremental_archive_entry::Archive_member):
6028 Initialize arg_serial_ (second constructor).
6029
308ecdc7
ILT
60302011-04-17 Ian Lance Taylor <iant@google.com>
6031
6032 * object.cc (Relocate_info::location): Simplify location string.
6033 * errors.cc (Errors::error_at_location): Don't print program
6034 name.
6035 (Errors::warning_at_location): Likewise.
6036 (Errors::undefined_symbol): Likewise.
6037 * testsuite/debug_msg.sh: Update accordingly.
6038
bec5b579
CC
60392011-04-14 Cary Coutant <ccoutant@google.com>
6040
6041 * gold/layout.cc (Layout::symtab_section_offset): New function.
6042 * gold/layout.h (Layout::symtab_section_offset): New function.
6043 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6044
88597d34
ILT
60452011-04-12 Ian Lance Taylor <iant@google.com>
6046
6047 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6048 with MREMAP_MAYMOVE.
6049 * output.h (class Output_file): Add map_is_allocated_ field.
6050 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6051 not available, provide stubs. If mremap is not available, #define
6052 it to gold_mremap.
6053 (MREMAP_MAYMOVE): Define if not defined.
6054 (Output_file::Output_file): Initialize map_is_allocated_.
6055 (Output_file::resize): Check map_is_allocated_.
6056 (Output_file::map_anonymous): If mmap fails, use malloc.
6057 (Output_file::unmap): Don't do anything for an anonymous map.
6058 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6059 is not available, provide stubs.
6060 (File_read::View::~View): Use free rather than delete[].
6061 (File_read::make_view): Use malloc rather than new[]. If mmap
6062 fails, use malloc.
6063 (File_read::find_or_make_view): Use malloc rather than new[].
6064 * gold.h: Remove HAVE_REMAP code.
6065 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6066 exists. Rename mremap to gold_mremap. If mmap is not available
6067 don't do anything.
6068 * configure, config.in: Rebuild.
6069
11e361bc
ILT
60702011-04-11 Ian Lance Taylor <iant@google.com>
6071
6072 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6073 initialize local variable v.
6074
cdc29364
CC
60752011-04-11 Cary Coutant <ccoutant@google.com>
6076
6077 * archive.cc (Archive::include_member): Adjust call to
6078 report_object.
6079 (Add_archive_symbols::run): Track argument serial numbers.
6080 (Lib_group::include_member): Likewise.
6081 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6082 * archive.h (Incremental_archive_entry::Archive_member):
6083 Initialize arg_serial_.
6084 (Archive_member::arg_serial_): New data member.
6085 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6086 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6087 incremental link.
6088 (Sized_dynobj::do_for_all_local_got_entries): New function.
6089 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6090 function.
6091 * fileread.cc (get_mtime): New function.
6092 * fileread.h (get_mtime): New function.
6093 * gold.cc (queue_initial_tasks): Check for incremental update.
6094 (process_incremental_input): New function.
6095 (queue_middle_tasks): Don't force valid target for incremental
6096 update.
6097 * incremental-dump.cc (find_input_containing_global): Adjust
6098 size of symbol info entry.
6099 (dump_incremental_inputs): Dump argument serial number and
6100 in_system_directory flag; bias shndx by 1; print symbol names
6101 when dumping per-file symbol lists; use new symbol info readers.
6102 * incremental.cc
6103 (Output_section_incremental_inputs:update_data_size): New function.
6104 (Sized_incremental_binary::setup_readers): Setup input readers
6105 for each input file; build maps for files added from libraries
6106 and scripts.
6107 (Sized_incremental_binary::check_input_args): New function.
6108 (Sized_incremental_binary::do_check_inputs): Build map of argument
6109 serial numbers to input arguments.
6110 (Sized_incremental_binary::do_file_has_changed): Rename
6111 do_file_is_unchanged to this; compare file modification times.
6112 (Sized_incremental_binary::do_init_layout): New function.
6113 (Sized_incremental_binary::do_reserve_layout): New function.
6114 (Sized_incremental_binary::do_get_input_reader): Remove.
6115 (Sized_incremental_binary::get_symtab_view): New function.
6116 (Incremental_checker::can_incrementally_link_output_file): Remove.
6117 (Incremental_inputs::report_command_line): Exclude --debug options.
6118 (Incremental_inputs::report_archive_begin): Add parameter; track
6119 argument serial numbers; don't put input file entry for archive
6120 before archive members.
6121 (Incremental_inputs::report_archive_end): Put input file entry
6122 for archive after archive members.
6123 (Incremental_inputs::report_object): Add parameter; track argument
6124 serial numbers and in_system_directory flag.
6125 (Incremental_inputs::report_script): Add parameter; track argument
6126 serial numbers.
6127 (Output_section_incremental_inputs::set_final_data_size): Adjust
6128 size of symbol info entry; check for forwarding symbols.
6129 (Output_section_incremental_inputs::write_input_files): Write
6130 in_system_directory flag and argument serial number.
6131 (Output_section_incremental_inputs::write_info_blocks): Map section
6132 indices between incremental info and original input file; store
6133 input section index for each symbol.
6134 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6135 change operator() to visit().
6136 (class Global_got_offset_visitor): Likewise.
6137 (class Global_symbol_visitor_got_plt):
6138 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6139 classes.
6140 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6141 (Sized_incr_relobj::do_read_symbols): New function.
6142 (Sized_incr_relobj::do_layout): New function.
6143 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6144 (Sized_incr_relobj::do_add_symbols): New function.
6145 (Sized_incr_relobj::do_should_include_member): New function.
6146 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6147 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6148 (Sized_incr_relobj::do_section_size): New function.
6149 (Sized_incr_relobj::do_section_name): New function.
6150 (Sized_incr_relobj::do_section_contents): New function.
6151 (Sized_incr_relobj::do_section_flags): New function.
6152 (Sized_incr_relobj::do_section_entsize): New function.
6153 (Sized_incr_relobj::do_section_address): New function.
6154 (Sized_incr_relobj::do_section_type): New function.
6155 (Sized_incr_relobj::do_section_link): New function.
6156 (Sized_incr_relobj::do_section_info): New function.
6157 (Sized_incr_relobj::do_section_addralign): New function.
6158 (Sized_incr_relobj::do_initialize_xindex): New function.
6159 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6160 (Sized_incr_relobj::do_read_relocs): New function.
6161 (Sized_incr_relobj::do_gc_process_relocs): New function.
6162 (Sized_incr_relobj::do_scan_relocs): New function.
6163 (Sized_incr_relobj::do_count_local_symbols): New function.
6164 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6165 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6166 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6167 (Sized_incr_relobj::do_relocate): New function.
6168 (Sized_incr_relobj::do_set_section_offset): New function.
6169 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6170 (Sized_incr_dynobj::do_read_symbols): New function.
6171 (Sized_incr_dynobj::do_layout): New function.
6172 (Sized_incr_dynobj::do_add_symbols): New function.
6173 (Sized_incr_dynobj::do_should_include_member): New function.
6174 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6175 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6176 (Sized_incr_dynobj::do_section_size): New function.
6177 (Sized_incr_dynobj::do_section_name): New function.
6178 (Sized_incr_dynobj::do_section_contents): New function.
6179 (Sized_incr_dynobj::do_section_flags): New function.
6180 (Sized_incr_dynobj::do_section_entsize): New function.
6181 (Sized_incr_dynobj::do_section_address): New function.
6182 (Sized_incr_dynobj::do_section_type): New function.
6183 (Sized_incr_dynobj::do_section_link): New function.
6184 (Sized_incr_dynobj::do_section_info): New function.
6185 (Sized_incr_dynobj::do_section_addralign): New function.
6186 (Sized_incr_dynobj::do_initialize_xindex): New function.
6187 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6188 (make_sized_incremental_object): New function.
6189 (Incremental_library::copy_unused_symbols): New function.
6190 (Incremental_library::do_for_all_unused_symbols): New function.
6191 * incremental.h (enum Incremental_input_flags): New type.
6192 (class Incremental_checker): Remove.
6193 (Incremental_input_entry::Incremental_input_entry): Add argument
6194 serial number.
6195 (Incremental_input_entry::arg_serial): New function.
6196 (Incremental_input_entry::set_is_in_system_directory): New function.
6197 (Incremental_input_entry::is_in_system_directory): New function.
6198 (Incremental_input_entry::arg_serial_): New data member.
6199 (Incremental_input_entry::is_in_system_directory_): New data member.
6200 (class Script_info): Move here from script.h.
6201 (Script_info::Script_info): Add filename parameter.
6202 (Script_info::filename): New function.
6203 (Script_info::filename_): New data member.
6204 (Incremental_script_entry::Incremental_script_entry): Add argument
6205 serial number.
6206 (Incremental_object_entry::Incremental_object_entry): Likewise.
6207 (Incremental_object_entry::add_input_section): Build list of input
6208 sections with map to original shndx.
6209 (Incremental_object_entry::get_input_section_index): New function.
6210 (Incremental_object_entry::shndx_): New data member.
6211 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6212 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6213 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6214 serial number.
6215 (Incremental_inputs::report_archive_begin): Likewise.
6216 (Incremental_inputs::report_object): Likewise.
6217 (Incremental_inputs::report_script): Likewise.
6218 (class Incremental_global_symbol_reader): New class.
6219 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6220 and store flags and input file type.
6221 (Incremental_input_entry_reader::arg_serial): New function.
6222 (Incremental_input_entry_reader::type): Extract type from flags.
6223 (Incremental_input_entry_reader::is_in_system_directory): New function.
6224 (Incremental_input_entry_reader::get_input_section_count): Call
6225 accessor function for type.
6226 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6227 function for type; adjust size of global symbol entry.
6228 (Incremental_input_entry_reader::get_global_symbol_count): Call
6229 accessor function for type.
6230 (Incremental_input_entry_reader::get_object_count): Likewise.
6231 (Incremental_input_entry_reader::get_object_offset): Likewise.
6232 (Incremental_input_entry_reader::get_member_count): Likewise.
6233 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6234 (Incremental_input_entry_reader::get_member_offset): Likewise.
6235 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6236 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6237 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6238 (Incremental_input_entry_reader::get_global_symbol_reader): New
6239 function.
6240 (Incremental_input_entry_reader::get_output_symbol_index): New
6241 function.
6242 (Incremental_input_entry_reader::type_): Remove.
6243 (Incremental_input_entry_reader::flags_): New data member.
6244 (Incremental_inputs_reader::input_file_offset): New function.
6245 (Incremental_inputs_reader::input_file_index): New function.
6246 (Incremental_inputs_reader::input_file): Call input_file_offset.
6247 (Incremental_inputs_reader::input_file_at_offset): New function.
6248 (Incremental_relocs_reader::get_r_type): Reformat.
6249 (Incremental_relocs_reader::get_r_shndx): Reformat.
6250 (Incremental_relocs_reader::get_r_offset): Reformat.
6251 (Incremental_relocs_reader::data): New function.
6252 (Incremental_binary::Incremental_binary): Initialize new data members.
6253 (Incremental_binary::check_inputs): Add cmdline parameter.
6254 (Incremental_binary::file_is_unchanged): Remove.
6255 (Input_reader::arg_serial): New function.
6256 (Input_reader::get_unused_symbol_count): New function.
6257 (Input_reader::get_unused_symbol): New function.
6258 (Input_reader::do_arg_serial): New function.
6259 (Input_reader::do_get_unused_symbol_count): New function.
6260 (Input_reader::do_get_unused_symbol): New function.
6261 (Incremental_binary::input_file_count): New function.
6262 (Incremental_binary::get_input_reader): Change signature to use
6263 index instead of filename.
6264 (Incremental_binary::file_has_changed): New function.
6265 (Incremental_binary::get_input_argument): New function.
6266 (Incremental_binary::get_library): New function.
6267 (Incremental_binary::get_script_info): New function.
6268 (Incremental_binary::init_layout): New function.
6269 (Incremental_binary::reserve_layout): New function.
6270 (Incremental_binary::output_file): New function.
6271 (Incremental_binary::do_check_inputs): New function.
6272 (Incremental_binary::do_file_is_unchanged): Remove.
6273 (Incremental_binary::do_file_has_changed): New function.
6274 (Incremental_binary::do_init_layout): New function.
6275 (Incremental_binary::do_reserve_layout): New function.
6276 (Incremental_binary::do_input_file_count): New function.
6277 (Incremental_binary::do_get_input_reader): Change signature.
6278 (Incremental_binary::input_args_map_): New data member.
6279 (Incremental_binary::library_map_): New data member.
6280 (Incremental_binary::script_map_): New data member.
6281 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6282 new data members.
6283 (Sized_incremental_binary::output_section): New function.
6284 (Sized_incremental_binary::inputs_reader): Add const.
6285 (Sized_incremental_binary::symtab_reader): Add const.
6286 (Sized_incremental_binary::relocs_reader): Add const.
6287 (Sized_incremental_binary::got_plt_reader): Add const.
6288 (Sized_incremental_binary::get_symtab_view): New function.
6289 (Sized_incremental_binary::Inputs_reader): New typedef.
6290 (Sized_incremental_binary::Input_entry_reader): New typedef.
6291 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6292 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6293 (Sized_incremental_binary::do_file_has_changed): New function.
6294 (Sized_incremental_binary::do_init_layout): New function.
6295 (Sized_incremental_binary::do_reserve_layout): New function.
6296 (Sized_input_reader::Inputs_reader): Remove.
6297 (Sized_input_reader::Input_entry_reader): Remove.
6298 (Sized_input_reader::do_arg_serial): New function.
6299 (Sized_input_reader::do_get_unused_symbol_count): New function.
6300 (Sized_input_reader::do_get_unused_symbol): New function.
6301 (Sized_incremental_binary::do_input_file_count): New function.
6302 (Sized_incremental_binary::do_get_input_reader): Change signature;
6303 use index instead of filename.
6304 (Sized_incremental_binary::section_map_): New data member.
6305 (Sized_incremental_binary::input_entry_readers_): New data member.
6306 (class Sized_incr_relobj): New class.
6307 (class Sized_incr_dynobj): New class.
6308 (make_sized_incremental_object): New function.
6309 (class Incremental_library): New class.
6310 * layout.cc (Free_list::num_lists): New static data member.
6311 (Free_list::num_nodes): New static data member.
6312 (Free_list::num_removes): New static data member.
6313 (Free_list::num_remove_visits): New static data member.
6314 (Free_list::num_allocates): New static data member.
6315 (Free_list::num_allocate_visits): New static data member.
6316 (Free_list::init): New function.
6317 (Free_list::remove): New function.
6318 (Free_list::allocate): New function.
6319 (Free_list::dump): New function.
6320 (Free_list::print_stats): New function.
6321 (Layout_task_runner::run): Resize output file for incremental updates.
6322 (Layout::Layout): Initialize new data members.
6323 (Layout::set_incremental_base): New function.
6324 (Layout::init_fixed_output_section): New function.
6325 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6326 incremental updates.
6327 (Layout::create_gold_note): Do not create gold note section for
6328 incremental updates.
6329 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6330 for incremental updates.
6331 (Layout::set_section_offsets): For incremental updates, allocate space
6332 from free list.
6333 (Layout::create_symtab_sections): Layout with offsets relative to
6334 start of section; for incremental updates, allocate space from free
6335 list.
6336 (Layout::create_shdrs): For incremental updates, allocate space from
6337 free list.
6338 (Layout::finish_dynamic_section): For incremental updates, do not
6339 check --as-needed (fixed in subsequent patch).
6340 * layout.h (class Free_list): New class.
6341 (Layout::set_incremental_base): New function.
6342 (Layout::incremental_base): New function.
6343 (Layout::init_fixed_output_section): New function.
6344 (Layout::allocate): New function.
6345 (Layout::incremental_base_): New data member.
6346 (Layout::free_list_): New data member.
6347 * main.cc (main): Print Free_list statistics.
6348 * object.cc (Relobj::finalize_incremental_relocs): Add
6349 clear_counts parameter; clear counts only when clear_counts is set.
6350 (Sized_relobj::Sized_relobj): Initialize new base class.
6351 (Sized_relobj::do_layout): Don't report special sections.
6352 (Sized_relobj::do_for_all_local_got_entries): New function.
6353 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6354 symtab_off to all symbol table offsets.
6355 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6356 * object.h (class Got_offset_list): Move to top of file.
6357 (Object::Object): Allow case where input_file == NULL.
6358 (Object::~Object): Likewise.
6359 (Object::input_file): Assert that input_file != NULL.
6360 (Object::lock): Allow case where input_file == NULL.
6361 (Object::unlock): Likewise.
6362 (Object::is_locked): Likewise.
6363 (Object::token): Likewise.
6364 (Object::release): Likewise.
6365 (Object::is_incremental): New function.
6366 (Object::get_mtime): New function.
6367 (Object::for_all_local_got_entries): New function.
6368 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6369 (Object::set_is_in_system_directory): New function.
6370 (Object::is_in_system_directory): New function.
6371 (Object::do_is_incremental): New function.
6372 (Object::do_get_mtime): New function.
6373 (Object::do_for_all_local_got_entries): New function.
6374 (Object::is_in_system_directory_): New data member.
6375 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6376 (class Sized_relobj_base): New class.
6377 (class Sized_relobj): Derive from Sized_relobj_base.
6378 (class Sized_relobj::Symbols): Redeclare from base class.
6379 (class Sized_relobj::local_got_offset_list): Remove.
6380 (class Sized_relobj::Output_sections): Redeclare from base class.
6381 (class Sized_relobj::do_for_all_local_got_entries): New function.
6382 (class Sized_relobj::write_local_symbols): Add offset parameter.
6383 (class Sized_relobj::local_symbol_offset_): Update comment.
6384 (class Sized_relobj::local_dynsym_offset_): Update comment.
6385 * options.cc (Input_arguments::add_file): Remove const.
6386 * options.h (Input_file_argument::Input_file_argument):
6387 Initialize arg_serial_ (all constructors).
6388 (Input_file_argument::set_arg_serial): New function.
6389 (Input_file_argument::arg_serial): New function.
6390 (Input_file_argument::arg_serial_): New data member.
6391 (Input_arguments::Input_arguments): Initialize file_count_.
6392 (Input_arguments::add_file): Remove const.
6393 (Input_arguments::number_of_input_files): New function.
6394 (Input_arguments::file_count_): New data member.
6395 (Command_line::number_of_input_files): Call
6396 Input_arguments::number_of_input_files.
6397 * output.cc (Output_segment_headers::Output_segment_headers):
6398 Set current size.
6399 (Output_section::Input_section::current_data_size): New function.
6400 (Output_section::Output_section): Initialize new data members.
6401 (Output_section::add_input_section): Don't do merge sections for
6402 an incremental link; allocate space from free list for an
6403 incremental update.
6404 (Output_section::add_output_section_data): Allocate space from
6405 free list for an incremental update.
6406 (Output_section::update_data_size): New function.
6407 (Output_section::set_fixed_layout): New function.
6408 (Output_section::reserve): New function.
6409 (Output_segment::set_section_addresses): Remove const.
6410 (Output_segment::set_section_list_addresses): Remove const; allocate
6411 space from free list for an incremental update.
6412 (Output_segment::set_offset): Adjust size of RELRO segment for an
6413 incremental update.
6414 * output.h (Output_data::current_data_size): Move here from
6415 child classes.
6416 (Output_data::pre_finalize_data_size): New function.
6417 (Output_data::update_data_size): New function.
6418 (Output_section_headers::update_data_size): new function.
6419 (Output_section_data_build::current_data_size): Move to Output_data.
6420 (Output_data_strtab::update_data_size): New function.
6421 (Output_section::current_data_size): Move to Output_data.
6422 (Output_section::set_fixed_layout): New function.
6423 (Output_section::has_fixed_layout): New function.
6424 (Output_section::reserve): New function.
6425 (Output_section::update_data_size): New function.
6426 (Output_section::has_fixed_layout_): New data member.
6427 (Output_section::free_list_): New data member.
6428 (Output_segment::set_section_addresses): Remove const.
6429 (Output_segment::set_section_list_addresses): Remove const.
6430 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6431 New function.
6432 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6433 New function.
6434 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6435 parameter when calling Add_symbols constructor; store argument
6436 serial number for members of a lib group.
6437 (Add_symbols::locks): Allow case where token == NULL.
6438 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6439 (Read_member::~Read_member): New function.
6440 (Read_member::is_runnable): New function.
6441 (Read_member::locks): New function.
6442 (Read_member::run): New function.
6443 (Check_script::~Check_script): New function.
6444 (Check_script::is_runnable): New function.
6445 (Check_script::locks): New function.
6446 (Check_script::run): New function.
6447 (Check_library::~Check_library): New function.
6448 (Check_library::is_runnable): New function.
6449 (Check_library::locks): New function.
6450 (Check_library::run): New function.
6451 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6452 (Add_symbols::library_): New data member.
6453 (class Read_member): New class.
6454 (class Check_script): New class.
6455 (class Check_library): New class.
6456 * reloc.cc (Read_relocs::is_runnable): Allow case where
6457 token == NULL.
6458 (Read_relocs::locks): Likewise.
6459 (Scan_relocs::locks): Likewise.
6460 (Relocate_task::locks): Likewise.
6461 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6462 to clear counters.
6463 (Sized_relobj::incremental_relocs_scan): Fix comment.
6464 (Sized_relobj::do_relocate): Pass output file offset to
6465 write_local_symbols.
6466 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6467 from class declaration.
6468 * script.cc (read_input_script): Allocate Script_info; pass
6469 argument serial number to report_script.
6470 * script.h (class Script_info): Move to incremental.h.
6471 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6472 * symtab.h (Symbol_table::add_from_incrobj): New function.
6473 (Symbol_table::set_file_offset): New function.
6474
b961d0d7
CC
64752011-04-05 Cary Coutant <ccoutant@google.com>
6476
6477 * incremental-dump.cc (dump_incremental_inputs): Change signature
6478 to take a Sized_incremental_binary; change caller. Use readers
6479 in Sized_incremental_binary.
6480 * incremental.cc
6481 (Sized_incremental_binary::find_incremental_inputs_sections):
6482 Rename do_find_incremental_inputs_sections to this.
6483 (Sized_incremental_binary::setup_readers): New function.
6484 (Sized_incremental_binary::do_check_inputs): Check
6485 has_incremental_info_ flag; move setup code to setup_readers;
6486 use input readers.
6487 (Sized_incremental_binary::do_file_is_unchanged): New function.
6488 (Sized_incremental_binary::do_get_input_reader): New function.
6489 * incremental.h (class Incremental_binary): Move to end of file.
6490 (Incremental_binary::file_is_unchanged): New function.
6491 (Incremental_binary::do_file_is_unchanged): New function.
6492 (Incremental_binary::Input_reader): New class.
6493 (Incremental_binary::get_input_reader): New function.
6494 (class Sized_incremental_binary): Move to end of file.
6495 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6496 input section reader classes.
6497 (Sized_incremental_binary::has_incremental_info): New function.
6498 (Sized_incremental_binary::inputs_reader): New function.
6499 (Sized_incremental_binary::symtab_reader): New function.
6500 (Sized_incremental_binary::relocs_reader): New function.
6501 (Sized_incremental_binary::got_plt_reader): New function.
6502 (Sized_incremental_binary::do_file_is_unchanged): New function.
6503 (Sized_incremental_binary::Sized_input_reader): New class.
6504 (Sized_incremental_binary::get_input_reader): New function.
6505 (Sized_incremental_binary::find_incremental_inputs_sections):
6506 Rename do_find_incremental_inputs_sections to this.
6507 (Sized_incremental_binary::setup_readers): New function.
6508 (Sized_incremental_binary::has_incremental_info_): New data member.
6509 (Sized_incremental_binary::inputs_reader_): New data member.
6510 (Sized_incremental_binary::symtab_reader_): New data member.
6511 (Sized_incremental_binary::relocs_reader_): New data member.
6512 (Sized_incremental_binary::got_plt_reader_): New data member.
6513 (Sized_incremental_binary::current_input_file_): New data member.
6514
a869183f
PP
65152011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6516
6517 PR gold/12640
6518 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6519 violation.
6520
65212011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6522
6523 * archive.cc (Archive::include_member): Adjust call to report_object.
6524 (Add_archive_symbols::run): Add script_info to call to
6525 report_archive_begin.
6526 (Lib_group::include_member): Adjust call to report_object.
6527 (Add_lib_group_symbols::run): Adjust call to report_object.
6528 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6529 blocks. Add object count for script input files.
6530 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6531 script_info parameter; change all callers.
6532 (Incremental_inputs::report_object): Add script_info parameter;
6533 change all callers.
6534 (Incremental_inputs::report_script): Store backpointer to
6535 incremental info entry.
6536 (Output_section_incremental_inputs::set_final_data_size): Record
6537 additional information for scripts.
6538 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6539 * incremental.h (Incremental_script_entry::add_object): New function.
6540 (Incremental_script_entry::get_object_count): New function.
6541 (Incremental_script_entry::get_object): New function.
6542 (Incremental_script_entry::objects_): New data member; adjust
6543 constructor.
6544 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6545 (Incremental_inputs::report_object): Add script_info parameter.
6546 (Incremental_inputs_reader::get_object_count): New function.
6547 (Incremental_inputs_reader::get_object_offset): New function.
6548 * options.cc (Input_arguments::add_file): Return reference to
6549 new input argument.
6550 * options.h (Input_argument::set_script_info): New function.
6551 (Input_argument::script_info): New function.
6552 (Input_argument::script_info_): New data member; adjust all
6553 constructors.
6554 (Input_file_group::add_file): Return reference to new input argument.
6555 (Input_file_lib::add_file): Likewise.
6556 (Input_arguments::add_file): Likewise.
6557 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6558 * script.cc (Parser_closure::Parser_closure): Add script_info
6559 parameter; adjust all callers.
6560 (Parser_closure::script_info): New function.
6561 (Parser_closure::script_info_): New data member.
6562 (read_input_script): Report scripts earlier to incremental info.
6563 (script_add_file): Set script_info in Input_argument.
6564 (script_add_library): Likewise.
6565 * script.h (Script_options::Script_info): Rewrite class.
6566
a869183f 65672011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6568
6569 * archive.cc (Library_base::should_include_member): Move
6570 method here from class Archive.
6571 (Archive::Archive): Initialize base class.
6572 (Archive::should_include_member): Move to base class.
6573 (Archive::do_for_all_unused_symbols): New function.
6574 (Add_archive_symbols::run): Remove redundant access to
6575 incremental_inputs.
6576 (Lib_group::Lib_group): Initialize base class.
6577 (Lib_group::do_filename): New function.
6578 (Lib_group::include_member): Pass pointer to Lib_group to
6579 report_object.
6580 (Lib_group::do_for_all_unused_symbols): New function.
6581 (Add_lib_group_symbols::run): Report archive information for
6582 incremental links.
6583 * archive.h (class Library_base): New base class.
6584 (class Archive): Derive from Library_base.
6585 (Archive::filename): Move to base class.
6586 (Archive::set_incremental_info): Likewise.
6587 (Archive::incremental_info): Likewise.
6588 (Archive::Should_include): Likewise.
6589 (Archive::should_include_member): Likewise.
6590 (Archive::Armap_entry): Remove.
6591 (Archive::Unused_symbol_iterator): Remove.
6592 (Archive::unused_symbols_begin): Remove.
6593 (Archive::unused_symbols_end): Remove.
6594 (Archive::do_filename): New function.
6595 (Archive::do_get_mtime): New function.
6596 (Archive::do_for_all_unused_symbols): New function.
6597 (Archive::task_): Move to base class.
6598 (Archive::incremental_info_): Likewise.
6599 (class Lib_group): Derive from Library_base.
6600 (Lib_group::do_filename): New function.
6601 (Lib_group::do_get_mtime): New function.
6602 (Lib_group::do_for_all_unused_symbols): New function.
6603 (Lib_group::task_): Move to base class.
6604 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6605 function.
6606 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6607 function.
6608 * incremental.cc (Incremental_inputs::report_archive_begin):
6609 Use Library_base; call library's get_mtime; add incremental inputs
6610 entry before members.
6611 (class Unused_symbol_visitor): New class.
6612 (Incremental_inputs::report_archive_end): Use Library_base; use
6613 visitor class to record unused symbols; don't add incremental inputs
6614 entry after members.
6615 (Incremental_inputs::report_object): Use Library_base.
6616 * incremental.h
6617 (Incremental_archive_entry::Incremental_archive_entry): Remove
6618 unused Archive parameter.
6619 (Incremental_inputs::report_archive_begin): Use Library_base.
6620 (Incremental_inputs::report_archive_end): Likewise.
6621 (Incremental_inputs::report_object): Likewise.
6622 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6623 function.
6624 * object.h (Object::for_all_global_symbols): New function.
6625 (Object::do_for_all_global_symbols): New function.
6626 (Sized_relobj::do_for_all_global_symbols): New function.
6627 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6628 function.
6629 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6630 function.
6631
61ab3e40
ILT
66322011-03-27 Ian Lance Taylor <iant@google.com>
6633
6634 * archive.cc (Archive::interpret_header): Return -1 if something
6635 goes wrong. Change callers accordingly.
6636
30e1f9e6
CC
66372011-03-25 Cary Coutant <ccoutant@google.com>
6638
6639 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6640 * testsuite/Makefile.in: Regenerate.
6641
9370ce59 66422011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6643
6644 * plugin.cc (get_view): New.
6645 (Plugin::load): Pass get_view to the plugin.
6646 (Plugin_manager::get_view): New.
6647
9312bb0a
ILT
66482011-03-21 Ian Lance Taylor <iant@google.com>
6649
6650 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6651 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6652
7e12ba9e
ST
66532011-03-21 Sriraman Tallam <tmsriram@google.com>
6654
6655 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6656 Change == to -eq.
6657 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6658 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6659 Change == to -eq.
6660 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6661 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6662
fd7a005d
ILT
66632011-03-14 Ian Lance Taylor <iant@google.com>
6664
6665 * script-sections.cc (Sort_output_sections::script_compare):
6666 Rename from is_before, change return type.
6667 (Sort_output_sections::operator()): Adjust accordingly.
6668
ed16fd1b
ILT
66692011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6670
6671 PR gold/12572
6672 * testsuite/odr_violation2.cc: Add comment to make all error line
6673 numbers double digits.
6674 * testsuite/debug_msg.sh: Adjust expected errors.
6675
71ff8986
ILT
66762011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6677
6678 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6679 but mark earlier ones as non-canonical
6680 (offset_to_iterator): Update search target and example
6681 (do_addr2line): Return extra lines in a vector*
6682 (format_file_lineno): Extract from do_addr2line
6683 (one_addr2line): Add vector* out-param
6684 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6685 when a lineno entry appeared last for its instruction
6686 (Dwarf_line_info): Add vector* out-param
6687 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6688 * symtab.cc (Odr_violation_compare): Include the lineno in the
6689 comparison again.
6690 (linenos_from_loc): New. Combine the canonical line for an
6691 address with its other lines.
6692 (True_if_intersect): New. Helper functor to make
6693 std::set_intersection a query.
6694 (detect_odr_violations): Compare sets of lines instead of just
6695 one line for each function. This became less deterministic, but
6696 has fewer false positives.
6697 * symtab.h: Declarations.
6698 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6699 mix an optimized and non-optimized object in the same binary
6700 (odr_violation2.so): Same.
6701 * testsuite/Makefile.in: Regenerate from Makefile.am.
6702 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6703 * testsuite/debug_msg.sh: Update line numbers and add
6704 assertions.
6705 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6706 non-optimized context.
6707 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6708 isn't inlined, and use OdrDerived in an optimized context.
6709 * testsuite/odr_header1.h: Defines OdrDerived, where
6710 optimization will change the
6711 first-instruction-in-the-destructor's file and line number.
6712 * testsuite/odr_header2.h: Defines OdrBase.
6713
a19fefdc
ILT
67142011-03-09 Ian Lance Taylor <iant@google.com>
6715
6716 * fileread.cc (File_read::clear_views): Don't delete the whole
6717 file view.
6718
ecb351e9
ILT
67192011-03-08 Ian Lance Taylor <iant@google.com>
6720
6721 PR gold/12525
6722 * fileread.cc: #include <climits>.
6723 (GOLD_IOV_MAX): Define.
6724 (File_read::read_multiple): Limit number of entries by iov_max.
6725 * fileread.h (class File_read): Always set max_readv_entries to
6726 128.
6727
b821d13c
ILT
67282011-03-07 Ian Lance Taylor <iant@google.com>
6729
6730 PR gold/12525
6731 * options.h (class General_options): Add -dy and -dn.
6732
89243142
CC
67332011-03-02 Cary Coutant <ccoutant@google.com>
6734
6735 * testsuite/script_test_9.t: Add TLS segment.
6736
d0773f31
ILT
67372011-03-02 Simon Baldwin <simonb@google.com>
6738
6739 * configure.ac: Add check for gnu_indirect_function support in
6740 the toolchain building binutils.
6741 * configure: Rebuild.
6742
9370ce59 67432011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6744
6745 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6746 plugin only symbols.
6747 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6748 in plugin files as not needed in the symbol table.
6749
4cf7a849
ST
67502011-02-11 Sriraman Tallam <tmsriram@google.com>
6751
6752 * output.cc (Output_section::add_input_section): Delay fill
6753 generation for section ordering.
6754
b578bd7d
ILT
67552011-02-09 Ian Lance Taylor <iant@google.com>
6756
6757 PR gold/12316
6758 * object.h (class Sized_relobj): Remove clear_local_symbols.
6759 * reloc.cc (Sized_relobj::do_relocate): Don't call
6760 clear_local_symbols.
6761
9370ce59 67622011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6763
6764 * plugin.cc (is_visible_from_outside): Return true for symbols
6765 in the -u option.
6766
55382fb7
ILT
67672011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6768
6769 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6770 filename.
6771
4e271fff
ST
67722011-02-02 Sriraman Tallam <tmsriram@google.com>
6773
6774 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6775 to std::string.
4e271fff 6776 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6777 section_name to be std::string.
4e271fff
ST
6778 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6779
d433c3ac
ILT
67802011-01-25 Ian Lance Taylor <iant@google.com>
6781
6782 * script.cc (script_add_extern): Rewrite to use
6783 add_symbol_reference.
6784
880473a6
DK
67852011-01-25 Doug Kwan <dougkwan@google.com>
6786
d433c3ac 6787 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6788
f30f86fa
ILT
67892011-01-24 Ian Lance Taylor <iant@google.com>
6790
6791 * options.h (class General_options): Accept
6792 --no-detect-odr-violations.
6793
8e51a0b9
ILT
67942011-01-24 Ian Lance Taylor <iant@google.com>
6795
6796 * version.cc (version_string): Bump to 1.11.
6797
0f3b89d8
ILT
67982011-01-24 Ian Lance Taylor <iant@google.com>
6799
6800 * plugin.cc (class Plugin_rescan): Define new class.
6801 (Plugin_manager::claim_file): Set any_claimed_.
6802 (Plugin_manager::save_archive): New function.
6803 (Plugin_manager::save_input_group): New function.
6804 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6805 necessary.
6806 (Plugin_manager::new_undefined_symbol): New function.
6807 (Plugin_manager::rescan): New function.
6808 (Plugin_manager::rescannable_defines): New function.
6809 (Plugin_manager::add_input_file): Set any_added_.
6810 * plugin.h (class Plugin_manager): define new fields rescannable_,
6811 undefined_symbols_, any_claimed_, and any_added_. Declare
6812 Plugin_rescan as friend. Declare new functions.
6813 (Plugin_manager::Rescannable): Define type.
6814 (Plugin_manager::Rescannable_list): Define type.
6815 (Plugin_manager::Undefined_symbol_list): Define type.
6816 (Plugin_manager::Plugin_manager): Initialize new fields.
6817 * archive.cc (Archive::defines_symbol): New function.
6818 (Add_archive_symbols::run): Pass archive to plugins if any.
6819 * archive.h (class Archive): Declare defines_symbol.
6820 * readsyms.cc (Input_group::~Input_group): New function.
6821 (Finish_group::run): Pass input_group to plugins if any.
6822 * readsyms.h (class Input_group): Declare destructor.
6823 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6824 any.
6825
3bb951e5
ILT
68262011-01-10 Ian Lance Taylor <iant@google.com>
6827
6828 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6829 section as relro.
6830 (Layout::set_segment_offsets): Reset increase_relro before calling
6831 set_section_addresses a second time.
6832
0aa45fac
CC
68332011-01-04 Cary Coutant <ccoutant@google.com>
6834
6835 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6836 sections before NOBITS sections.
6837
0db46eb4
L
68382011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6839
6840 * version.cc (print_version): Update copyright to 2011.
6841
829c9745
CC
68422010-12-23 Cary Coutant <ccoutant@google.com>
6843
6844 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6845 of OS to this->add. Add OD parameter to second form of the function.
6846
7500420b
ILT
68472010-12-20 Ian Lance Taylor <iant@google.com>
6848
6849 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6850 second of two consecutive entries with same offset.
6851
f8e9a930
RW
68522010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6853
6854 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6855 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6856 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6857 to avoid unneeded links against $(LDADD).
6858 * testsuite/Makefile.in: Regenerate.
6859
2fbb4320
ILT
68602010-12-15 Ian Lance Taylor <iant@google.com>
6861
6862 PR gold/12324
6863 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6864 for R_X86_64_32 and R_X86_64_PC32.
6865 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6866 ver_matching_def_pic.o.
6867 (ver_matching_def_pic.o): New target.
6868
fedb228d
RW
68692010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6870
6871 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6872 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6873 Move definition before File_read::View member definitions.
6874 (File_read::View::~View): Initialize and hold lock before
6875 updating current_mapped_bytes.
6876
9b547ce6
RW
68772010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6878
6879 * dwarf_reader.cc: Remove outdated comment.
6880 * gold-threads.cc: Fix typo in error message.
6881 * archive.cc: Fix typos in comments.
6882 * archive.h: Likewise.
6883 * arm-reloc-property.cc: Likewise.
6884 * arm-reloc-property.h: Likewise.
6885 * arm-reloc.def: Likewise.
6886 * arm.cc: Likewise.
6887 * attributes.h: Likewise.
6888 * cref.cc: Likewise.
6889 * ehframe.cc: Likewise.
6890 * fileread.h: Likewise.
6891 * gold.h: Likewise.
6892 * i386.cc: Likewise.
6893 * icf.cc: Likewise.
6894 * incremental.h: Likewise.
6895 * int_encoding.cc: Likewise.
6896 * layout.h: Likewise.
6897 * main.cc: Likewise.
6898 * merge.h: Likewise.
6899 * object.cc: Likewise.
6900 * object.h: Likewise.
6901 * options.cc: Likewise.
6902 * readsyms.cc: Likewise.
6903 * reduced_debug_output.cc: Likewise.
6904 * reloc.cc: Likewise.
6905 * script-sections.cc: Likewise.
6906 * sparc.cc: Likewise.
6907 * symtab.h: Likewise.
6908 * target-reloc.h: Likewise.
6909 * target.cc: Likewise.
6910 * target.h: Likewise.
6911 * timer.cc: Likewise.
6912 * timer.h: Likewise.
6913 * x86_64.cc: Likewise.
6914
83e17bd5
CC
69152010-12-09 Cary Coutant <ccoutant@google.com>
6916
6917 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6918 stack.
6919 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6920 parameter; change all callers.
6921 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6922 * options.h (warn_execstack): New option.
6923
017257f8
DK
69242010-12-07 Doug Kwan <dougkwan@google.com>
6925
6926 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6927 like function call relocations.
6928
c20cbc06
ILT
69292010-12-07 Ian Lance Taylor <iant@google.com>
6930
6931 * archive.cc (Archive::get_elf_object_for_member): Permit
6932 punconfigured to be NULL.
6933 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6934 (Archive::include_member): Pass NULL to get_elf_object_for_member
6935 if we searched for the archive and this is the first included
6936 object.
6937
4dbfafcc
ILT
69382010-12-01 Ian Lance Taylor <iant@google.com>
6939
6940 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6941 track_relocs_type_ field.
6942 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6943 Set track_relocs_type_.
6944 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6945 contents when using RELA relocs.
6946 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6947 reloc_map_.
6948 * reloc.cc (Track_relocs::next_addend): New function.
6949 * reloc.h (class Track_relocs): Declare next_addend.
6950
e5e19edd
ILT
69512010-12-01 Ian Lance Taylor <iant@google.com>
6952
6953 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6954 virtual destructor.
6955
9a5ce24c
ILT
69562010-12-01 Ian Lance Taylor <iant@google.com>
6957
6958 * README: Update compilers known to work and fail.
6959
c7791212
NC
69602010-11-23 Matthias Klose <doko@ubuntu.com>
6961
6962 * configure.in: For --enable-gold, handle value `default' instead of
6963 `both*'. Always install ld as ld.bfd, install as ld if gold is
6964 not the default.
6965 * configure: Regenerate.
6966
0ad220c9
DK
69672010-11-18 Doug Kwan <dougkwan@google.com>
6968
6969 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6970 and right_alignment to be zero. Store result alignment only if it is
6971 greater than existing alignment.
6972
ab8056e0
CC
69732010-11-16 Cary Coutant <ccoutant@google.com>
6974
6975 PR gold/12220
6976 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6977 Check for ".zdebug_line".
6978
fd064a5b
CC
69792010-11-16 Doug Kwan <dougkwan@google.com>
6980 Cary Coutant <ccoutant@google.com>
6981
6982 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6983 by reference; adjust all callers.
6984 * output.cc (Output_segment::set_section_addresses): Adjust references
6985 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6986 list is empty.
6987 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6988 end at page boundary.
6989
6fc6ea19
CC
69902010-11-16 Cary Coutant <ccoutant@google.com>
6991
6992 PR gold/12220
6993 * layout.cc (Layout::choose_output_section): Transform names of
6994 compressed sections even when using a script with a SECTIONS clause.
6995 (Layout::output_section_name): Remove code to transform
6996 compressed debug section names.
6997 * output.cc (Output_section::add_input_section): Use uncompressed
6998 section size when tracking input sections.
6999
95a2c8d6
RS
70002010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7001
7002 * symtab.h (Symbol::NON_PIC_REF): Remove.
7003 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7004 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7005 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7006 (Symbol::use_plt_offset): Take a flags argument and pass it
7007 directly to needs_dynamic_reloc. Restrict check for undefined
7008 weak symbols to function calls.
7009 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7010 (Target_arm::Scan::global): Use it.
7011 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7012 (Target_arm::Relocate::relocate): Likewise.
7013 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7014 parameter with an r_type parameter. Use get_reference_flags
7015 to get the flags.
7016 (Target_arm::Relocate::relocate): Update accordingly.
7017 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7018 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7019 (Target_i386::Scan::global): Likewise.
7020 (Target_i386::Relocate::relocate): Likewise.
7021 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7022 parameter with an r_type parameter. Use get_reference_flags
7023 to get the flags.
7024 (Target_i386::Relocate::relocate): Update accordingly.
7025 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7026 (Target_powerpc::Scan::global): Use it.
7027 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7028 (Target_powerpc::Relocate::relocate): Likewise.
7029 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7030 (Target_sparc::Scan::global): Use it.
7031 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7032 (Target_sparc::Relocate::relocate): Likewise.
7033 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7034 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7035 (Target_x86_64::Scan::global): Likewise.
7036 (Target_x86_64::Relocate::relocate): Likewise.
7037
f625ae50
DK
70382010-11-08 Doug Kwan <dougkwan@google.com>
7039 Cary Coutant <ccoutant@google.com>
7040
7041 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7042 (Arm_exidx_merge_section::section_contents_): New data member.
7043 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7044 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7045 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7046 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7047 in parameters instead of calling Object::section_contents without
7048 locking.
7049 (Arm_output_section::group_section): New parameter TASK. Pass it
7050 to callees that need locking objects.
7051 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7052 to lock EXIDX input sections. Fix a formatting issue. Call
7053 Arm_exidx_merged_section::build_contents to create merged section
7054 contents.
7055 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7056 to lock object of stub table owner.
7057 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7058 TEXT_SIZE to initialize data member TEXT_SIZE_.
7059 (Arm_exidx_input_section::addralign): Fix typo in comment.
7060 (Arm_exidx_input_section::text_size): New method.
7061 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7062 that require locking objects. Lock objects before scanning for stubs
7063 and updating local symbols.
7064 (Arm_input_section<big_endian>::init): Copy contents of original
7065 input section.
2e702c99 7066 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7067 original input section instead of calling Object::section_contents
7068 without locking.
7069 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7070 size without calling Object::section_size().
7071 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7072 for size. Allocate a buffer for merged EXIDX entries.
7073 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7074 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7075 building code to Arm_exidx_merged_section::build_contetns. Write
7076 out contetns in buffer instead of building it on the fly.
7077 (Arm_relobj::make_exidx_input_section): Also pass text section size
7078 to Arm_exidx_input_section constructor.
7079 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7080 (Arm_dynobj::do_read_symbols): Fix memory leak.
7081 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7082 * target.h: (class Task): Add forward declaration.
7083 (Target::relax): Add new parameter TASK and pass it to
7084 Target::do_relax().
7085 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7086
5f9bcf58
CC
70872010-11-05 Cary Coutant <ccoutant@google.com>
7088
7089 PR gold/10708
7090 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7091 object when reading from the file.
7092 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7093 second layout pass.
7094 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7095 when reading section contents.
7096 (get_section_contents): Likewise.
7097 (icf::find_identical_sections): Likewise.
7098 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7099 object when reading from the file.
7100 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7101 the object when doing deferred section layout.
7102
e597fa08
NC
71032010-11-03 Nick Clifton <nickc@redhat.com>
7104
7105 PR gold/12001
7106 * script.h (class Symbol_assignment: name): New member. Returns
7107 the name of the symbol.
7108 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7109 Returns true if the given symbol name is on the list of
7110 assignments wating to be processed.
7111 * archive.cc (should_incldue_member): If the symbol is undefined,
7112 check to see if it is on the list of symbols pending assignment.
7113
3f9a3278
ILT
71142010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7115
7116 * script-sections.cc (Script_sections::find_memory_region): Check
7117 for a NULL output section pointer.
7118
d06fb4d1
DK
71192010-10-29 Doug Kwan <dougkwan@google.com>
7120
7121 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7122 Output_section::add_relaxed_input_section.
7123 * output.cc (Output_section::add_relaxed_input_section): Add new
7124 arguments LAYOUT and NAME. Set section order index.
7125 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7126 Copy section order index.
7127 * output.h (Output_section::add_relaxed_input_section): Add new
7128 arguments LAYOUT and NAME.
7129
90e24de5
ILT
71302010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7131
7132 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7133 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7134 * testsuite/Makefile.in: Regenerate.
7135
c9484ea5
DK
71362010-10-20 Doug Kwan <dougkwan@google.com>
7137
7138 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7139 without SHF_LINK_ORDER flags.
7140 * layout.cc (Layout::choose_output_section): Do not filter
7141 SHF_LINK_ORDER flag in a relocatable link.
7142
5bc2f5be
CC
71432010-10-17 Cary Coutant <ccoutant@google.com>
7144
7145 * output.h (Output_segment::set_section_addresses): Change function
7146 signature. Update all callers.
7147 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7148 sections.
7149 (Output_segment::set_section_addresses): Align after last TLS
7150 section. Add padding before last relro section instead of after.
7151
0c91cf04
DK
71522010-10-17 Doug Kwan <dougkwan@google.com>
7153
7154 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7155 GOT output section to be writable.
7156
8c21d9d3
CC
71572010-10-14 Cary Coutant <ccoutant@google.com>
7158
7159 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7160 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7161 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7162 mode.
7163 * incremental.cc (report_command_line): Ignore all forms of
7164 --incremental.
7165 * layout.cc (Layout::Layout): Check parameters for incremental link
7166 mode.
7167 * options.cc (General_options::parse_incremental): New function.
7168 (General_options::parse_no_incremental): New function.
7169 (General_options::parse_incremental_full): New function.
7170 (General_options::parse_incremental_update): New function.
7171 (General_options::incremental_mode_): New data member.
7172 (General_options::finalize): Check incremental_mode_.
7173 * options.h (General_options): Update help text for --incremental.
7174 Add --no-incremental, --incremental-full, --incremental-update.
7175 (General_options::Incremental_mode): New enum type.
7176 (General_options::incremental_mode): New function.
7177 (General_options::incremental_mode_): New data member.
7178 * parameters.cc (Parameters::incremental_mode_): New data member.
7179 (Parameters::set_options): Set incremental_mode_.
7180 (Parameters::set_incremental_full): New function.
7181 (Parameters::incremental): New function.
7182 (Parameters::incremental_update): New function.
7183 (set_parameters_incremental_full): New function.
7184 * parameters.h (Parameters::set_incremental_full): New function.
7185 (Parameters::incremental): New function.
7186 (Parameters::incremental_update): New function.
7187 (Parameters::incremental_mode_): New data member.
7188 (set_parameters_incremental_full): New function.
7189 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7190 incremental link mode.
7191 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7192 (Sized_relobj::do_relocate_sections): Likewise.
7193 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7194 option.
7195 * testsuite/Makefile.in: Regenerate.
7196 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7197
bb32aa18 71982010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7199
7200 * script-sections.h (class Script_sections): Make
7201 Sections_elements typedef public.
7202 * script-sections.cc (class Sort_output_sections): Add elements_
7203 field. Add constructor which sets it; change all callers.
7204 (Sort_output_sections::is_before): New function.
7205 (Sort_output_sections::operator()): Call is_before.
7206 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7207 conditional.
7208 * testsuite/script_test_10.sh: New test. Test script section
7209 order.
7210 * testsuite/script_test_10.t: Likewise.
7211 * testsuite/script_test_10.s: Likewise.
7212 * testsuite/Makefile.am: Wrap the cross linker tests and the
7213 common tests into NATIVE_OR_CROSS_LINKER.
7214 (check_SCRIPTS): Add script_test_10.sh.
7215 (check_DATA): Add script_test_10.stdout.
7216 (script_test_10.o, script_test_10): New targets.
7217 (script_test_10.stdout): New target.
7218 * configure, testsuite/Makefile.in: Regenerate.
7219
3cef7179
ILT
72202010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7221
7222 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7223 error for the deprecated relocations.
7224 (Target_arm::Scan::global): Likewise.
7225 (Target_arm::Relocate::relocate): Likewise.
7226
7411e9a8
RS
72272010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7228
7229 * fileread.cc (Input_file::find_file): Initialize *found_name
7230 and *namep when using the fallback search for case 4.
7231
6a9da32a
CC
72322010-10-11 Cary Coutant <ccoutant@google.com>
7233
7234 * options.h (class General_options): Redefine -z lazy as an alias for
7235 the negation of -z now.
7236
ac897c20
ILT
72372010-10-11 Ian Lance Taylor <iant@google.com>
7238
7239 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7240 binding.
7241
ea5cae92
NC
72422010-10-06 Nick Clifton <nickc@redhat.com>
7243
7244 * script-sections.cc(class Memory_region): Remove
7245 current_lma_offset_ field. Rename current_vma_offset_ to
7246 current_offset_. Add last_section_ field.
7247 (Memory_region::get_current_vma_address): Rename to
7248 get_current_address.
7249 (Memory_region::get_current_lma_address): Delete.
7250 (Memory_region::increment_vma_offset): Rename to
7251 increment_offset.
7252 (Memory_region::increment_lma_offset): Delete.
7253 (Memory_region::attributes_compatible): New method. Returns
7254 true if the provided section is compatible with the region.
7255 (Memory_region::get_last_section): New method. Returns the last
7256 section to use the region.
7257 (Memory_region::set_last_section): New method. Stores the last
7258 section to use the region.
7259 (Script_sections::block_in_region): New method. Returns true if
7260 a block of memory is contained within a region.
7261 (Script_sections::find_memory_region): New method. Locates a
7262 memory region to be used to set a VMA or LMA address.
7263 (Output_section_definition::set_section_addresses): Add code to
7264 check for addresses set by memory regions.
7265 (Output_segment::set_section_addresses): Remove memory region
7266 walking code.
7267 (Script_sections::create_segment): Add a warning if a header
7268 segment is created outside of any region.
7269 * script-sections.h (class Script_sections): Add prototypes for
7270 find_memory_region and block_in_region methods.
7271 * testsuite/memory_test.s: Use .long instead of .word.
7272 * testsuite/memory_test.t: Add some more output sections.
7273 * testsuite/memory_test.sh: Update expected output.
7274
a9bfd952
DK
72752010-10-02 Doug Kwan <dougkwan@google.com>
7276
7277 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7278 defintion to symtab.h
7279 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7280 declaration to defintion.
7281
bacff3ab
NC
72822010-10-01 Nick Clifton <nickc@redhat.com>
7283
7284 * expression.cc (eval): Replace dummy argument with NULL.
7285 (eval_maybe_dot): Check for a NULL result section pointer.
7286 (Symbol_expression::value): Likewise.
7287 (Dot_expression::value): Likewise.
7288 (BINARY_EXPRESSION): Likewise.
7289 (Max_expression::value): Likewise.
7290 (Min_expression::value): Likewise.
7291 (Absolute_expression::value): Likewise.
7292 (Addr_expression::value_from_output_section): Likewise.
7293 (Loaddddr_expression::value_from_output_section): Likewise.
7294 (Segment_start_expression::value): Likewise.
7295 * script-sections.cc
7296 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7297 argument with NULL.
7298 (Sections_elememt_dot_assignment::set_section_addresses):
7299 Likewise.
7300 (Output_data_expression::do_write_to_buffer): Likewise.
7301 (Output_section_definition::finalize_symbols): Likewise.
7302 (Output_section_definition::set_section_addresses): Likewise.
7303
f81bc8b5
DK
73042010-09-30 Doug Kwan <dougkwan@google.com>
7305
7306 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7307
c95e9f27
ST
73082010-09-28 Sriraman Tallam <tmsriram@google.com>
7309
7310 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7311 function.
c95e9f27
ST
7312 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7313 virtual function.
7314 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7315 virtual function.
7316 * icf.cc (get_section_contents): Inline merge sections only when
7317 target allows it.
7318
3cac54d2
RW
73192010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7320
7321 * configure: Regenerate.
7322
2904037a
ILT
73232010-09-17 Ian Lance Taylor <iant@google.com>
7324
7325 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7326 * testsuite/Makefile.am (memory_test.o): New target.
7327 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7328 memory_test.t.
7329 * testsuite/Makefile.in: Rebuild.
2904037a 7330
bca7fb63
DK
73312010-09-17 Doug Kwan <dougkwan@google.com>
7332
7333 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7334 defintion if relocation uses GOT entries of the symbol.
7335 * testsuite/icf_safe_test.sh: Fix test.
7336 * testsuite/icf_safe_so_test.sh: Fix test.
7337
4ef28648
CC
73382010-09-16 Cary Coutant <ccoutant@google.com>
7339
7340 * script_sections.cc (class Memory_region): Remove "NULL" from
7341 vector initializations.
7342
793990de
CC
73432010-09-15 Cary Coutant <ccoutant@google.com>
7344
7345 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7346 Resolve forwarding symbols.
7347
81e015e2
DK
73482010-09-15 Doug Kwan <dougkwan@google.com>
7349
7350 * gold/testsuite/script_test_3.t: Add ARM special sections.
7351 * gold/testsuite/script_test_4.t: Same.
7352 * gold/testsuite/script_test_5.t: Same.
7353 * gold/testsuite/script_test_6.t: Same.
7354 * gold/testsuite/script_test_7.t: Same.
7355 * gold/testsuite/script_test_7.t: Same.
7356 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7357
36171d64
CC
73582010-09-14 Cary Coutant <ccoutant@google.com>
7359
7360 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7361 (Target_x86_64::Relocate::relocate_tls): Replace check for
7362 saw_tls_block_reloc_ with test for executable section.
7363
d89051bd
CC
73642010-09-12 Cary Coutant <ccoutant@google.com>
7365
7366 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7367 position-independent executables to shared libraries need dynamic
7368 relocations.
7369 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7370 position-independent executables.
7371 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7372 * testsuite/Makefile.in: Regenerate.
7373
fca41f0f
NC
73742010-09-10 Nick Clifton <nickc@redhat.com>
7375
7376 PR gold/11997
7377 * testsuite/memory_test.t: Discard any sections that are not
7378 needed.
7379
6695e4b3
L
73802010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7381
7382 PR gold/11996
7383 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7384 "This::" to work around a bug in gcc 4.2.
7385
7386 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7387
0f72bf6f
RÁE
73882010-09-09 Rafael Espindola <espindola@google.com>
7389
7390 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7391 sections with different PF_X flags in the same segment.
7392 (Layout::find_first_load_seg): Search all segments to find the first
7393 one.
7394 * options.h (rosegment): New.
7395
73962010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7397
05a79166 7398 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7399
aa98ff75
DK
74002010-09-08 Doug Kwan <dougkwan@google.com>
7401
7402 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7403 (Arm_relobj::do_relocate_sections): Add new parameter for output
7404 file to match the parent.
7405 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7406 of local symbols instead of input values. Update code to track
7407 changes in gold::relocate_section.
7408 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7409 (Sized_relobj::compute_final_local_value_internal): New methods.
7410 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7411 body into private version of Sized_relobj::compute_final_local_value.
7412 Call the inline method.
7413 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7414 merged symbol value if there is one.
7415 (Symbol_value::has_output_value): New method defintiion.
7416 (Sized_relobj::Compute_final_local_value_status): New enum type.
7417 (Sized_relobj::compute_final_local_value): New methods.
7418 (Sized_relobj::compute_final_local_value_internal): New methods.
7419 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7420 and arm_cortex_a8.sh.
7421 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7422 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7423 New tests.
7424 * Makefile.in: Regenerate.
7425 * testsuite/arm_bl_out_of_range.s: Update test.
7426 * testsuite/thumb_bl_out_of_range.s: Ditto.
7427 * testsuite/thumb_blx_out_of_range.s: Ditto.
7428 * testsuite/arm_branch_out_of_range.sh: New file.
7429 * testsuite/arm_cortex_a8.sh: Ditto.
7430 * testsuite/arm_cortex_a8_b.s: Ditto.
7431 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7432 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7433 * testsuite/arm_cortex_a8_bl.s: Ditto.
7434 * testsuite/arm_cortex_a8_blx.s: Ditto.
7435 * testsuite/arm_cortex_a8_local.s: Ditto.
7436 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7437 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7438
05a79166
L
74392010-09-08 Rafael Espindola <espindola@google.com>
7440
7441 * Makefile.am (memory_test.stdout): Run readelf with -W.
7442 * Makefile.in: Regenerate.
7443 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7444 64 bit output.
7445
33dbc701
RÁE
74462010-09-08 Rafael Espindola <espindola@google.com>
7447
7448 * script-sections.cc (Script_sections::add_memory_region): Convert
7449 field precision to int.
7450 * script.cc (script_set_section_region, script_set_section_region):
7451 Convert field precision to int.
7452
731ca54a
RÁE
74532010-09-08 Rafael Espindola <espindola@google.com>
7454
7455 * arm.cc (do_finalize_sections): Create the __exidx_start and
7456 __exdix_end symbols even when the section is missing.
7457
7f8cd844
NC
74582010-09-08 Nick Clifton <nickc@redhat.com>
7459
7460 * README: Remove claim that MEMORY is not supported.
7461 * expression.cc (script_exp_function_origin)
7462 (script_exp_function_length): Move from here to ...
7463 * script.cc: ... here.
7464 (script_set_section_region, script_add_memory)
7465 (script_parse_memory_attr, script_include_directive): New
7466 functions.
7467 * script-sections.cc
7468 (class Memory_region): New class.
7469 (class Output_section_definition): Add set_memory_region,
7470 set_section_vma, set_section_lma and get_section_name methods.
7471 (class Script_Sections): Add add_memory_region,
7472 find_memory_region, find_memory_region_origin,
7473 find_memory_region_length and set_memory_region methods.
7474 Have set_section_addresses method walk the list of set memory
7475 regions.
7476 Extend the print methos to display memory regions.
7477 * script-sections.h: Add prototypes for new methods.
7478 Add enum for MEMORY region attributes.
7479 * yyscript.y: Add support for parsing MEMORY regions.
7480 * script-c.h: Add prototypes for new functions.
7481 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7482 * testsuite/Makefile.in: Regenerate.
7483 * testsuite/memory_test.sh: New script.
7484 * testsuite/memory_test.s: New assembler source file.
7485 * testsuite/memory_test.t: New linker script.
7486
a4649286
DK
74872010-08-27 Doug Kwan <dougkwan@google.com>
7488
7489 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7490 reference override an existing dynamic weak reference.
7491 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7492 * testsuite/Makefile.in: Regenerate.
7493 * testsuite/dyn_weak_ref.sh: New file.
7494 * testsuite/dyn_weak_ref_1.c: Ditto.
7495 * testsuite/dyn_weak_ref_2.c: Ditto.
7496
b56648ad
ILT
74972010-08-27 Ian Lance Taylor <iant@google.com>
7498
7499 * incremental.h (class Incremental_input_entry): Add virtual
7500 destructor.
7501
809313cb
ILT
75022010-08-27 Ian Lance Taylor <iant@google.com>
7503
7504 * testsuite/start_lib_test_3.c: Mark t3 as used.
7505
11e32464
NC
75062010-08-27 Nick Clifton <nickc@redhat.com>
7507
7508 * options.cc (version_script): Fix small typo in previous
7509 whitespace tidyup.
7510
ca09d69a
NC
75112010-08-25 Nick Clifton <nickc@redhat.com>
7512
7513 * archive.cc: Formatting fixes: Remove whitespace between
7514 typename and following asterisk. Remove whitespace between
7515 function name and opening parenthesis.
7516 * archive.h: Likewise.
7517 * arm.cc: Likewise.
7518 * attributes.cc: Likewise.
7519 * attributes.h: Likewise.
7520 * common.cc: Likewise.
7521 * copy-relocs.cc: Likewise.
7522 * dirsearch.h: Likewise.
7523 * dynobj.cc: Likewise.
7524 * ehframe.cc: Likewise.
7525 * ehframe.h: Likewise.
7526 * expression.cc: Likewise.
7527 * fileread.cc: Likewise.
7528 * fileread.h: Likewise.
7529 * gc.h: Likewise.
7530 * gold-threads.cc: Likewise.
7531 * gold.cc: Likewise.
7532 * i386.cc: Likewise.
7533 * icf.h: Likewise.
7534 * incremental-dump.cc: Likewise.
7535 * incremental.cc: Likewise.
7536 * layout.cc: Likewise.
7537 * layout.h: Likewise.
7538 * main.cc: Likewise.
7539 * merge.cc: Likewise.
7540 * merge.h: Likewise.
7541 * object.cc: Likewise.
7542 * object.h: Likewise.
7543 * options.cc: Likewise.
7544 * options.h: Likewise.
7545 * output.cc: Likewise.
7546 * output.h: Likewise.
7547 * plugin.cc: Likewise.
7548 * plugin.h: Likewise.
7549 * powerpc.cc: Likewise.
7550 * reloc.cc: Likewise.
7551 * script-c.h: Likewise.
7552 * script-sections.cc: Likewise.
7553 * script.cc: Likewise.
7554 * stringpool.cc: Likewise.
7555 * symtab.cc: Likewise.
7556 * symtab.h: Likewise.
7557 * target.cc: Likewise.
7558 * timer.cc: Likewise.
7559 * timer.h: Likewise.
7560 * version.cc: Likewise.
7561 * x86_64.cc: Likewise.
7562
b8fa8750
NC
75632010-08-24 Nick Clifton <nickc@redhat.com>
7564
7565 PR 11899
7566 * layout.cc (segment_precedes): Sort segments by their physical
7567 addresses, if they have been set.
7568
9919d93b
CC
75692010-08-23 Cary Coutant <ccoutant@google.com>
7570
7571 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7572 symbols data.
7573 (Lib_group::include_member): Unlock object after deleting its
7574 symbols data.
7575 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7576 the bug fixed here.
7577
97b4be1c
CC
75782010-08-19 Neil Vachharajani <nvachhar@google.com>
7579 Cary Coutant <ccoutant@google.com>
7580
7581 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7582 constructor, and set_blocker.
7583 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7584 readsyms_blocker_.
7585 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7586 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7587 * testsuite/Makefile.am (start_lib_test): New test case.
7588 * testsuite/Makefile.in: Regenerate.
7589 * testsuite/start_lib_test_main.c: New file.
7590 * testsuite/start_lib_test_1.c: New file.
7591 * testsuite/start_lib_test_2.c: New file.
7592 * testsuite/start_lib_test_3.c: New file.
7593
dd0b1884
ILT
75942010-08-19 Ian Lance Taylor <iant@google.com>
7595
7596 * Makefile.in: Rebuild with automake 1.11.1.
7597 * aclocal.m4: Likewise.
7598 * testsuite/Makefile.in: Likewise.
7599
7223e9ca
ILT
76002010-08-19 Ian Lance Taylor <iant@google.com>
7601
7602 PR 10893
7603 * i386.cc (class Output_data_plt_i386): Update declarations.
7604 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7605 local_ifuncs_ fields.
7606 (Target_i386::do_plt_section_for_global): New function.
7607 (Target_i386::do_plt_section_for_local): New function.
7608 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7609 parameter; change all callers. Initialize global_ifuncs_ and
7610 local_ifuncs_. If doing a static link define __rel_iplt_start and
7611 __rel_iplt_end.
7612 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7613 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7614 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7615 symbols.
7616 (Target_i386::make_plt_section): New function, broken out of
7617 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7618 (Target_i386::make_plt_entry): Call make_plt_section.
7619 (Target_i386::make_local_ifunc_plt_entry): New function.
7620 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7621 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7622 R_386_IRELATIVE to switch.
7623 (Target_i386::Scan::global): Likewise.
7624 (Target_i386::Relocate::relocate): Likewise.
7625 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7626 switch.
7627 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7628 (Target_x86_64::do_plt_section_for_global): New function.
7629 (Target_x86_64::do_plt_section_for_local): New function.
7630 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7631 parameter; change all callers. If doing a static link define
7632 __rela_iplt_start and __rela_iplt_end.
7633 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7634 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7635 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7636 to point to .plt.
7637 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7638 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7639 switch.
7640 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7641 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7642 R_X86_64_IRELATIVE to switch.
7643 (Target_x86_64::Scan::global): Likewise.
7644 (Target_x86_64::Relocate::relocate): Likewise.
7645 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7646 switch.
7647 * target.h (class Target): Add plt_section_for_global and
7648 plt_section_for_local functions. Add do_plt_section_for_global
7649 and do_plt_section_for_local virtual functions.
7650 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7651 clarifying comments.
7652 (Symbol::use_plt_offset): Handle IFUNC symbol.
7653 * object.cc (Sized_relobj::Sized_relobj): Initialize
7654 local_plt_offsets_.
7655 (Sized_relobj::local_has_plt_offset): New function.
7656 (Sized_relobj::local_plt_offset): New function.
7657 (Sized_relobj::set_local_plt_offset): New function.
7658 (Sized_relobj::do_count): Handle IFUNC symbol.
7659 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7660 a bit away from input_shndx_ field. Add set_is_func_symbol and
7661 is_ifunc_symbol functions.
7662 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7663 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7664 local_plt_offsets_ field.
7665 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7666 * output.h (class Output_section_data): Add non-const
7667 output_section function.
7668 (class Output_data_got): Update declarations.
7669 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7670 Add use_plt_offset parameter to global and local constructors.
7671 Change all callers. Change local_sym_index_ field to 31 bits.
7672 Change GSYM_CODE and CONSTANT_CODE accordingly.
7673 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7674 doing a static link don't set sh_link field.
7675 (Output_data_got::Got_entry::write): Use PLT offset if
7676 appropriate.
7677 (Output_data_got::add_global_plt): New function.
7678 (Output_data_got::add_local_plt): New function.
7679 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7680 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7681 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7682 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7683 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7684 IFUNC conditional.
7685 * testsuite/ifunc-sel.h: New file.
7686 * testsuite/ifuncmain1.c: New file.
7687 * testsuite/ifuncmain1vis.c: New file.
7688 * testsuite/ifuncmod1.c: New file.
7689 * testsuite/ifuncdep2.c: New file.
7690 * testsuite/ifuncmain2.c: New file.
7691 * testsuite/ifuncmain3.c: New file.
7692 * testsuite/ifuncmod3.c: New file.
7693 * testsuite/ifuncmain4.c: New file.
7694 * testsuite/ifuncmain5.c: New file.
7695 * testsuite/ifuncmod5.c: New file.
7696 * testsuite/ifuncmain6pie.c: New file.
7697 * testsuite/ifuncmod6.c: New file.
7698 * testsuite/ifuncmain7.c: New file.
7699 * configure, testsuite/Makefile.in: Rebuild.
7700
56f75c03
ILT
77012010-08-18 Ian Lance Taylor <iant@google.com>
7702
7703 * incremental.cc
7704 (Output_section_incremental_inputs::write_input_files): Add cast
7705 to avoid signed/unsigned comparison warning.
7706 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7707
55455f89
CC
77082010-08-12 Cary Coutant <ccoutant@google.com>
7709
7710 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7711
e2054bcb
ILT
77122010-08-13 Ian Lance Taylor <iant@google.com>
7713
7714 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7715
74f67560
DK
77162010-08-12 Cary Coutant <ccoutant@google.com>
7717 Doug Kwan <dougkwan@google.com>
7718
7719 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7720 defintion overrides non-weak undef, remember that the original undef
7721 is not weak.
7722 * symtab.cc (Symbol_table::sized_write_global): For undef without
7723 an original weak binding, set binding to global in output.
7724 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7725 * testsuite/Makefile.in: Regenerate.
7726 * testsuite/strong_ref_weak_def.sh: New file.
7727 * testsuite/strong_ref_weak_def_1.c: Ditto.
7728 * testsuite/strong_ref_weak_def_2.c: Ditto.
7729
d1238d12
CC
77302010-08-12 Cary Coutant <ccoutant@google.com>
7731
7732 * testsuite/incremental_test.sh: Rewrite.
7733 * testsuite/incremental_test_1.c: Rewrite.
7734 * testsuite/incremental_test_2.c: Rewrite.
7735
0e70b911
CC
77362010-08-12 Cary Coutant <ccoutant@google.com>
7737
7738 * arm.cc (Target_arm::got_size): Add const.
7739 (Target_arm::got_entry_count): New function.
7740 (Target_arm::plt_entry_count): New function.
7741 (Target_arm::first_plt_entry_offset): New function.
7742 (Target_arm::plt_entry_size): New function.
7743 (Output_data_plt_arm::entry_count): New function.
7744 (Output_data_plt_arm::first_plt_entry_offset): New function.
7745 (Output_data_plt_arm::get_plt_entry_size): New function.
7746 * i386.cc (Target_i386::got_size): Add const.
7747 (Target_i386::got_entry_count): New function.
7748 (Target_i386::plt_entry_count): New function.
7749 (Target_i386::first_plt_entry_offset): New function.
7750 (Target_i386::plt_entry_size): New function.
7751 (Output_data_plt_i386::entry_count): New function.
7752 (Output_data_plt_i386::first_plt_entry_offset): New function.
7753 (Output_data_plt_i386::get_plt_entry_size): New function.
7754 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7755 find_incremental_inputs_sections. Dump incremental_got_plt section.
7756 * incremental.cc: Include target.h.
7757 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7758 parameter. Adjust all callers. Find incremental_got_plt section.
7759 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7760 section.
7761 (Output_section_incremental_inputs::set_final_data_size): Calculate
7762 size of incremental_got_plt section.
7763 (Output_section_incremental_inputs::do_write): Write the
7764 incremental_got_plt section.
7765 (Got_plt_view_info): New struct.
7766 (Local_got_offset_visitor): New class.
7767 (Global_got_offset_visitor): New class.
7768 (Global_symbol_visitor_got_plt): New class.
7769 (Output_section_incremental_inputs::write_got_plt): New function.
7770 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7771 Add parameter. Adjust all callers.
7772 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7773 (Incremental_inputs::got_plt_section): New function.
7774 (Incremental_inputs::got_plt_section_): New data member.
7775 (Incremental_got_plt_reader): New class.
7776 * layout.cc (Layout::create_incremental_info_sections): Add the
7777 incremental_got_plt section.
7778 * object.h (Got_offset_list::get_list): New function.
7779 (Got offset_list::for_all_got_offsets): New function.
7780 (Sized_relobj::local_got_offset_list): New function.
7781 * powerpc.cc (Target_powerpc::got_size): Add const.
7782 (Target_powerpc::got_entry_count): New function.
7783 (Target_powerpc::plt_entry_count): New function.
7784 (Target_powerpc::first_plt_entry_offset): New function.
7785 (Target_powerpc::plt_entry_size): New function.
7786 (Output_data_plt_powerpc::entry_count): New function.
7787 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7788 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7789 * sparc.cc (Target_sparc::got_size): Add const.
7790 (Target_sparc::got_entry_count): New function.
7791 (Target_sparc::plt_entry_count): New function.
7792 (Target_sparc::first_plt_entry_offset): New function.
7793 (Target_sparc::plt_entry_size): New function.
7794 (Output_data_plt_sparc::entry_count): New function.
7795 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7796 (Output_data_plt_sparc::get_plt_entry_size): New function.
7797 * symtab.h (Symbol::got_offset_list): New function.
7798 (Symbol_table::for_all_symbols): New function.
7799 * target.h (Sized_target::got_entry_count): New function.
7800 (Sized_target::plt_entry_count): New function.
7801 (Sized_target::plt_entry_size): New function.
7802 * x86_64.cc (Target_x86_64::got_size): Add const.
7803 (Target_x86_64::got_entry_count): New function.
7804 (Target_x86_64::plt_entry_count): New function.
7805 (Target_x86_64::first_plt_entry_offset): New function.
7806 (Target_x86_64::plt_entry_size): New function.
7807 (Output_data_plt_x86_64::entry_count): New function.
7808 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7809 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7810
09ec0418
CC
78112010-08-12 Cary Coutant <ccoutant@google.com>
7812
7813 * archive.cc: Include incremental.h.
7814 (Archive::Archive): Initialize incremental_info_.
7815 (Archive::include_member): Record archive members in incremental info.
7816 (Add_archive_symbols::run): Record begin and end of an archive in
7817 incremental info.
7818 (Lib_group::include_member): Record objects in incremental info.
7819 * archive.h (Incremental_archive_entry): Forward declaration.
7820 (Archive::set_incremental_info): New member function.
7821 (Archive::incremental_info): New member function.
7822 (Archive::Unused_symbol_iterator): New class.
7823 (Archive::unused_symbols_begin): New member function.
7824 (Archive::unused_symbols_end): New member function.
7825 (Archive::incremental_info_): New data member.
7826 * incremental-dump.cc (find_input_containing_global): New function.
7827 (dump_incremental_inputs): Dump new incremental info sections.
7828 * incremental.cc: Include symtab.h.
7829 (Output_section_incremental_inputs): New class.
7830 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7831 new incremental info sections.
7832 (Sized_incremental_binary::do_check_inputs): Likewise.
7833 (Incremental_inputs::report_archive): Remove.
7834 (Incremental_inputs::report_archive_begin): New function.
7835 (Incremental_inputs::report_archive_end): New function.
7836 (Incremental_inputs::report_object): New function.
7837 (Incremental_inputs::finalize_inputs): Remove.
7838 (Incremental_inputs::report_input_section): New function.
7839 (Incremental_inputs::report_script): Rewrite.
7840 (Incremental_inputs::finalize): Do nothing but finalize string table.
7841 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7842 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7843 (Incremental_inputs::create_data_sections): New function.
7844 (Incremental_inputs::relocs_entsize): New function.
7845 (Output_section_incremental_inputs::set_final_data_size): New function.
7846 (Output_section_incremental_inputs::do_write): New function.
7847 (Output_section_incremental_inputs::write_header): New function.
7848 (Output_section_incremental_inputs::write_input_files): New function.
7849 (Output_section_incremental_inputs::write_info_blocks): New function.
7850 (Output_section_incremental_inputs::write_symtab): New function.
7851 * incremental.h (Incremental_script_entry): Forward declaration.
7852 (Incremental_object_entry): Forward declaration.
7853 (Incremental_archive_entry): Forward declaration.
7854 (Incremental_inputs): Forward declaration.
7855 (Incremental_inputs_header_data): Remove.
7856 (Incremental_inputs_header): Remove.
7857 (Incremental_inputs_header_write): Remove.
7858 (Incremental_inputs_entry_data): Remove.
7859 (Incremental_inputs_entry): Remove.
7860 (Incremental_inputs_entry_write): Remove.
7861 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7862 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7863 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7864 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7865 Likewise.
7866 (Incremental_input_entry): New class.
7867 (Incremental_script_entry): New class.
7868 (Incremental_object_entry): New class.
7869 (Incremental_archive_entry): New class.
7870 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7871 (Incremental_inputs::report_inputs): Remove.
7872 (Incremental_inputs::report_archive): Remove.
7873 (Incremental_inputs::report_archive_begin): New function.
7874 (Incremental_inputs::report_archive_end): New function.
7875 (Incremental_inputs::report_object): Change prototype.
7876 (Incremental_inputs::report_input_section): New function.
7877 (Incremental_inputs::report_script): Change prototype.
7878 (Incremental_inputs::get_reloc_count): New function.
7879 (Incremental_inputs::set_reloc_count): New function.
7880 (Incremental_inputs::create_data_sections): New function.
7881 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7882 (Incremental_inputs::inputs_section): New function.
7883 (Incremental_inputs::symtab_section): New function.
7884 (Incremental_inputs::relocs_section): New function.
7885 (Incremental_inputs::get_stringpool): Add const.
7886 (Incremental_inputs::command_line): Add const.
7887 (Incremental_inputs::inputs): Remove.
7888 (Incremental_inputs::command_line_key): New function.
7889 (Incremental_inputs::input_file_count): New function.
7890 (Incremental_inputs::input_files): New function.
7891 (Incremental_inputs::relocs_entsize): New function.
7892 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7893 (Incremental_inputs::finalize_inputs): Remove.
7894 (Incremental_inputs::Input_info): Remove.
7895 (Incremental_inputs::lock_): Remove.
7896 (Incremental_inputs::inputs_): Change type.
7897 (Incremental_inputs::inputs_map_): Remove.
7898 (Incremental_inputs::current_object_entry_): New data member.
7899 (Incremental_inputs::inputs_section_): New data member.
7900 (Incremental_inputs::symtab_section_): New data member.
7901 (Incremental_inputs::relocs_section_): New data member.
7902 (Incremental_inputs::reloc_count_): New data member.
7903 (Incremental_inputs_reader): New class.
7904 (Incremental_symtab_reader): New class.
7905 (Incremental_relocs_reader): New class.
7906 * layout.cc (Layout::finalize): Move finalization of incremental info
7907 and creation of incremental info sections to follow finalization of
7908 symbol table. Set offsets for postprocessing sections.
7909 (Layout::create_incremental_info_sections): Call
7910 Incremental_inputs::create_data_sections. Add incremental symtab
7911 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7912 sections to layout after input sections.
7913 * layout.h (struct Timespec): Forward declaration.
7914 (Layout::incremental_inputs): Add const.
7915 (Layout::create_incremental_info_sections): Add parameter.
7916 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7917 * object.cc: Include incremental.h.
7918 (Relobj::finalize_incremental_relocs): New function.
7919 (Sized_relobj::do_layout): Record input sections in incremental info.
7920 * object.h (Object::output_section): New function.
7921 (Object::output_section_offset): Moved from Relobj.
7922 (Object::get_incremental_reloc_base): New function.
7923 (Object::get_incremental_reloc_count): New function.
7924 (Object::do_output_section): New function.
7925 (Object::do_output_section_offset): Moved from Relobj.
7926 (Object::do_get_incremental_reloc_base): New function.
7927 (Object::do_get_incremental_reloc_count): New function.
7928 (Object::Object): Initialize new data members.
7929 (Relobj::output_section): Renamed do_output_section and moved to
7930 protected.
7931 (Relobj::output_section_offset): Moved to Object.
7932 (Relobj::do_get_incremental_reloc_base): New function.
7933 (Relobj::do_get_incremental_reloc_count): New function.
7934 (Relobj::allocate_incremental_reloc_counts): New function.
7935 (Relobj::count_incremental_reloc): New function.
7936 (Relobj::finalize_incremental_relocs): New function.
7937 (Relobj::next_incremental_reloc_index): New function.
7938 (Relobj::reloc_counts_): New data member.
7939 (Relobj::reloc_bases_): New data member.
7940 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7941 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7942 (Sized_relobj::incremental_relocs_scan): New function.
7943 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7944 (Sized_relobj::incremental_relocs_write): New function.
7945 (Sized_relobj::incremental_relocs_write_reltype): New function.
7946 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7947 incremental link.
7948 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7949 archives and object files elsewhere.
7950 (Add_symbols::run): Report object files here.
7951 (Finish_group::run): Report end of archive at end of group.
7952 * reloc.cc: Include layout.h, incremental.h.
7953 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7954 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7955 (Sized_relobj::incremental_relocs_scan): New function.
7956 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7957 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7958 (Sized_relobj::incremental_relocs_write): New function.
7959 (Sized_relobj::incremental_relocs_write_reltype): New function.
7960 * script.cc (read_input_script): Rewrite test for incremental link.
7961 Change call to Incremental_inputs::report_script.
7962 * symtab.h (Symbol_table::first_global_index): New function.
7963 (Symbol_table::output_count): New function.
7964
ce0d1972
DK
79652010-08-12 Doug Kwan <dougkwan@google.com>
7966
7967 * arm.cc (Target_arm::merge_object_attributes): Check command line
7968 options --no-wchar-size-warning and --no-enum-size-warning.
7969 * options.h (General_options): Add ld-compatible options
7970 --no-enum-size-warning and --no-wchar-size-warning.
7971
6e5710ce
ILT
79722010-08-04 Ian Lance Taylor <iant@google.com>
7973
7974 * x86_64.cc (Target_x86_64::Scan::local): Use
7975 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7976 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7977 (Target_x86_64::Scan::global): Likewise.
7978 (Target_x86_64::Relocate::relocate): Likewise.
7979 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7980 Likewise.
7981
fef830db
CC
79822010-08-03 Cary Coutant <ccoutant@google.com>
7983
7984 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7985 to reserve space in merged_strings vector. Keep total input size
7986 for stats.
7987 (Output_merge_string::do_print_merge_stats): Print total input size.
7988 * merge.h (Output_merge_string): Add input_size_ field.
7989 * stringpool.cc (Stringpool_template::string_length): Move
7990 implementations out of Stringpool_template class and place in
7991 stringpool.h.
7992 * stringpool.h (string_length): Move out of Stringpool_template.
7993
1e3811b0
ILT
79942010-08-03 Ian Lance Taylor <iant@google.com>
7995
7996 PR 11712
7997 * layout.cc (relaxation_loop_body): If address of load segment is
7998 set, adjust address to include headers if possible.
7999
7af0c620
ILT
80002010-08-03 Ian Lance Taylor <iant@google.com>
8001
8002 * version.cc (version_string): Bump to 1.10.
8003
22f0da72
ILT
80042010-08-03 Ian Lance Taylor <iant@google.com>
8005
8006 PR 11805
8007 * layout.h (enum Output_section_order): Define.
8008 (class Layout): Update declarations.
8009 * layout.cc (Layout::get_output_section): Add order parameter.
8010 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8011 is_first_non_relro parameters. Change all callers.
8012 (Layout::choose_output_section): Likewise.
8013 (Layout::add_output_section_data): Likewise.
8014 (Layout::make_output_section): Likewise. Set order.
8015 (Layout::default_section_order): New function.
8016 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8017 * output.cc (Output_section::Output_section): Initialize order_.
8018 Don't initialize deleted fields.
8019 (Output_segment::Output_segment): Don't initialize deleted
8020 fields.
8021 (Output_segment::add_output_section_to_load): New function
8022 replacing add_output_section. Change all callers to call this or
8023 add_output_section_to_nonload.
8024 (Output_segment::add_output_section_to_nonload): New function.
8025 (Output_segment::remove_output_section): Rewrite.
8026 (Output_segment::add_initial_output_data): Likewise.
8027 (Output_segment::has_any_data_sections): Likewise.
8028 (Output_segment::is_first_section_relro): Likewise.
8029 (Output_segment::maximum_alignment): Likewise.
8030 (Output_segment::has_dynamic_reloc): New function replacing
8031 dynamic_reloc_count. Change all callers.
8032 (Output_segment::has_dynamic_reloc_list): New function replacing
8033 dynamic_reloc_count_list. Change all callers.
8034 (Output_segment::set_section_addresses): Rewrite.
8035 (Output_segment::set_offset): Rewrite.
8036 (Output_segment::find_first_and_last_list): Remove.
8037 (Output_segment::set_tls_offsets): Rewrite.
8038 (Output_segment::first_section_load_address): Likewise.
8039 (Output_segment::output_section_count): Likewise.
8040 (Output_segment::section_with_lowest_load_address): Likewise.
8041 (Output_segment::write_section_headers): Likewise.
8042 (Output_segment::print_sections_to_map): Likewise.
8043 * output.h (class Output_data): Remove dynamic_reloc_count_
8044 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8045 (Output_data::add_dynamic_reloc): Rewrite.
8046 (Output_data::has_dynamic_reloc): New function.
8047 (Output_data::dynamic_reloc_count): Remove.
8048 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8049 is_last_relro_, is_first_non_relro_, is_interp_,
8050 is_dynamic_linker_section_ fields. Add order and set_order
8051 functions. Remove is_relro_local, set_is_relro_local,
8052 is_last_relro, set_is_last_relro, is_first_non_relro,
8053 set_is_first_non_relro functions, is_interp, set_is_interp,
8054 is_dynamic_linker_section, and set_is_dynamic_linker_section
8055 functions.
8056 (class Output_segment): Change Output_data_list from std::list to
8057 std:;vector. Add output_lists_ field. Remove output_data_ and
8058 output_bss_ fields. Update declarations.
8059
3ff2ccb0
ILT
80602010-08-02 Ian Lance Taylor <iant@google.com>
8061
8062 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8063 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8064 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8065
88a4108b
ILT
80662010-08-02 Ian Lance Taylor <iant@google.com>
8067
8068 PR 11855
8069 * script.cc (Script_options::Script_options): Initialize
8070 symbol_definitions_ and symbol_references_.
8071 (Script_options::add_symbol_assignment): Update
8072 symbol_definitions_ and symbol_references_.
8073 (Script_options::add_symbol_reference): New function.
8074 (script_symbol): New function.
8075 * script.h (class Script_options): Add symbol_definitions_ and
8076 symbol_references_ fields.
8077 (Script_options::referenced_const_iterator): New type.
8078 (Script_options::referenced_begin): New function.
8079 (Script_options::referenced_end): New function.
8080 (Script_options::is_referenced): New function.
8081 (Script_options::any_unreferenced): New function.
8082 * script-c.h (script_symbol): Declare.
8083 * yyscript.y (exp): Call script_symbol.
8084 * symtab.cc: Include "script.h".
8085 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8086 Change all callers. Check symbols referenced by scripts.
8087 (Symbol_table::add_undefined_symbols_from_command_line): Add
8088 layout parameter. Change all callers.
8089 (Symbol_table::do_add_undefined_symbols_from_command_line):
8090 Likewise. Break out loop body. Check symbols referenced by
8091 scripts.
8092 (Symbol_table::add_undefined_symbol_from_command_line): New
8093 function broken out of
8094 do_add_undefined_symbols_from_command_line.
8095 * symtab.h (class Symbol_table): Update declarations.
8096 * archive.cc: Include "layout.h".
8097 (Archive::should_include_member): Add layout parameter. Change
8098 all callers. Check for symbol mentioned in expression.
8099 * archive.h (class Archive): Update declaration.
8100 * object.cc (Sized_relobj::do_should_include_member): Add layout
8101 parameter.
8102 * object.h (Object::should_include_member): Add layout parameter.
8103 Change all callers.
8104 (Object::do_should_include_member): Add layout parameter.
8105 (class Sized_relobj): Update declaration.
8106 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8107 parameter.
8108 * dynobj.h (class Sized_dynobj): Update declaration.
8109 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8110 layout parameter.
8111 * plugin.h (class Sized_pluginobj): Update declaration.
8112
5f1ab67a
ILT
81132010-08-02 Ian Lance Taylor <iant@google.com>
8114
8115 PR 11866
8116 * output.cc (Output_segment::set_offset): Search for the first and
8117 last sections rather than assuming that the list is in order.
8118 (Output_segment::find_first_and_last_list): New function.
8119 * output.h (class Output_segment): Update declarations.
8120 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8121 (relro_strip_test_SOURCES): New variable.
8122 (relro_strip_test_DEPENDENCIES): New variable.
8123 (relro_strip_test_LDFLAGS): New variable.
8124 (relro_strip_test_LDADD): New variable.
8125 (relro_strip_test.so): New target.
8126
a8df5856
ILT
81272010-08-02 Ian Lance Taylor <iant@google.com>
8128
8129 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8130 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8131 (Target_i386::got_tlsdesc_section): New function.
8132 (Target_i386::got_section): Create space for GOT entries for
8133 TLSDESC relocations.
8134 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8135 R_386_TLS_GOTDESC.
8136 (Target_i386::Scan::global): Likewise.
8137 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8138 using TLSDESC GOT.
8139 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8140 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8141 (Target_x86_64::got_tlsdesc_section): New function.
8142 (Target_x86_64::got_section): Create space for GOT entries for
8143 TLSDESC relocations.
8144 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8145 R_386_TLS_GOTDESC.
8146 (Target_x86_64::Scan::global): Likewise.
8147 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8148 using TLSDESC GOT.
8149
0c10a0a6
ILT
81502010-08-02 Ian Lance Taylor <iant@google.com>
8151
8152 * testsuite/final_layout.sh: Use dc to convert from hex to
8153 decimal.
8154
41cbeecc
ST
81552010-07-29 Sriraman Tallam <tmsriram@google.com>
8156
8157 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8158 paramter to the call to gold::gc_process_relocs.
8159 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8160 paramter to the call to gold::gc_process_relocs.
8161 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8162 parameter to the call to gold::gc_process_relocs.
8163 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8164 template parameter to the call to gold::gc_process_relocs.
8165 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8166 paramter to the call to gold::gc_process_relocs.
8167 * gc.h (get_embedded_addend_size): New function.
8168 (gc_process_relocs): Save the size of the reloc for use by ICF.
8169 * icf.cc (get_section_contents): Get the addend from the text section
8170 for SHT_REL relocation sections.
8171 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8172 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8173 * int_encoding.h (read_from_pointer): New overloaded function.
8174 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8175 * testsuite/icf_sht_rel_addend_test.sh: New file.
8176 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8177 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8178
6ea55b82
RW
81792010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8180
8181 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8182 * Makefile.in: Regenerate.
8183 * testsuite/Makefile.in: Regenerate.
8184
9691462b
ILT
81852010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8186
8187 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8188 * gold/testsuite/debug_msg.cc: Likewise.
8189 * gold/testsuite/odr_violation1.cc
8190 * gold/testsuite/odr_violation2.cc
8191
76897331
CC
81922010-07-21 Cary Coutant <ccoutant@google.com>
8193
8194 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8195 string, and length fields.
8196 (Output_merge_string::Merged_strings_list): New type.
8197 (Output_merge_string::Merged_strings_lists): New typedef.
8198 (Output_merge_string): Replace merged_strings_ with
8199 merged_strings_lists_.
8200 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8201 Merged_strings_list per input object and section. Don't store pointer
8202 to the string. Don't store length with each merged string entry.
8203 (Output_merge_string::finalize_merged_data): Loop over list of merged
8204 strings lists. Recompute length of each merged string.
8205
78384e8f
CC
82062010-07-15 Cary Coutant <ccoutant@google.com>
8207
8208 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8209 here.
8210
783659f9
ILT
82112010-07-14 Ian Lance Taylor <iant@google.com>
8212
8213 * descriptors.cc (Descriptors::open): Report correct name in error
8214 message.
8215
131687b4
DK
82162010-07-13 Doug Kwan <dougkwan@google.com>
8217
8218 * arm.cc (Arm_input_section::Arm_input_section): For a
8219 SHT_ARM_EXIDX section, always keeps the input sections.
8220 (Arm_input_section::set_exidx_section_link): New method.
8221 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8222 has_errors_ to false.
8223 (Arm_exidx_input_section::has_errors,
8224 Arm_exidx_input_section::set_has_errors): New methods.
8225 (Arm_exidx_input_section::has_errors_): New data member.
8226 (Arm_relobj::get_exidx_shndx_list): New method.
8227 (Arm_output_section::append_text_sections_to_list): Do not skip
8228 section without SHF_EXECINSTR.
8229 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8230 errors.
2e702c99 8231 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8232 section header. Make error messages more verbose. Check for
8233 a non-executable section linked to an EXIDX section.
8234 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8235 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8236 check that there is no deferred EXIDX section if we exit early.
8237 Instead of not making an EXIDX section in case of an error, make one
8238 and set the has_errors flag of it.
8239 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8240 in a relocatable link.
8241 (Target_arm::do_relax): Look for the EXIDX output section instead of
8242 assuming that it is called .ARM.exidx.
2e702c99 8243 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8244 section list. Do not check for SHF_EXECINSTR section flags but
8245 skip any input section with errors.
8246 * output.cc (Output_section::Output_section): Initialize
8247 always_keeps_input_sections_ to false.
8248 (Output_section::add_input_section): Check for
8249 always_keeps_input_sections_.
8250 * output.h (Output_section::always_keeps_input_sections,
8251 Output_section::set_always_keeps_input_sections): New methods.
8252 (Output_section::always_keeps_input_sections): New data member.
8253
69517287
RÁE
82542010-07-13 Rafael Espindola <espindola@google.com>
8255
8256 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8257 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8258
82742395
ILT
82592010-07-13 Philip Herron <herron.philip@googlemail.com>
8260 Ian Lance Taylor <iant@google.com>
8261
8262 * output.h (Output_section_lookup_maps::add_merge_section):
8263 Correct check of whether value was inserted.
8264 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8265 (Output_section_lookup_maps::add_relaxed_input_section):
8266 Likewise.
8267 * arm.cc (Target_arm::got_section): Remove used local os.
8268 * i386.cc (Target_i386::got_section): Likewise.
8269 * x86_64.cc (Target_x86_64::got_section): Likewise.
8270 * sparc.cc (Target_sparc::got_section): Likewise.
8271 (Target_sparc::relocate): Remove unused local have_got_offset.
8272 * powerpc.cc (Target_powerpc::relocate): Likewise.
8273
f2d707b5
ILT
82742010-07-13 Ian Lance Taylor <iant@google.com>
8275
241531d6
ILT
8276 * compressed_output.cc (zlib_decompress): Fix signature in
8277 !HAVE_ZLIB_H case.
8278
f2d707b5
ILT
8279 * archive.cc (Archive::include_member): Unlock an external member
8280 of a thin archive. Don't bother to delete an object we know is
8281 NULL.
8282
a2e47362
CC
82832010-07-12 Cary Coutant <ccoutant@google.com>
8284
8285 * compressed_output.cc (zlib_decompress): New function.
8286 (get_uncompressed_size): New function.
8287 (decompress_input_section): New function.
8288 * compressed_output.h (get_uncompressed_size): New function.
8289 (decompress_input_section): New function.
8290 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8291 Handle compressed debug sections.
8292 * layout.cc (is_compressed_debug_section): New function.
8293 (Layout::output_section_name): Map compressed section names to
8294 canonical names.
8295 * layout.h (is_compressed_debug_section): New function.
8296 (is_debug_info_section): Recognize compressed debug sections.
8297 * merge.cc: Include compressed_output.h.
8298 (Output_merge_data::do_add_input_section): Handle compressed
8299 debug sections.
8300 (Output_merge_string::do_add_input_section): Handle compressed
8301 debug sections.
8302 * object.cc: Include compressed_output.h.
8303 (Sized_relobj::Sized_relobj): Initialize new data members.
8304 (build_compressed_section_map): New function.
8305 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8306 * object.h (Object::section_is_compressed): New method.
8307 (Object::do_section_is_compressed): New method.
8308 (Sized_relobj::Compressed_section_map): New type.
8309 (Sized_relobj::do_section_is_compressed): New method.
8310 (Sized_relobj::compressed_sections_): New data member.
8311 * output.cc (Output_section::add_input_section): Handle compressed
8312 debug sections.
8313 * reloc.cc: Include compressed_output.h.
8314 (Sized_relobj::write_sections): Handle compressed debug sections.
8315
ce279a62
CC
83162010-07-08 Cary Coutant <ccoutant@google.com>
8317
8318 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8319 weak when resolving to a dynamic def.
8320 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8321 for weak undef/dynamic def cases. Adjust callers.
8322 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8323 undef_binding_weak_.
8324 (Symbol_table::sized_write_globals): Adjust symbol binding.
8325 (Symbol_table::sized_write_symbol): Add binding parameter.
8326 * symtab.h (Symbol::set_undef_binding): New method.
8327 (Symbol::is_undef_binding_weak): New method.
8328 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8329 (Symbol_table::should_override): Add new parameter.
8330 (Symbol_table::sized_write_symbol): Add new parameter.
8331
8332 * testsuite/weak_undef_file1.cc: Add new test case.
8333 * testsuite/weak_undef_file2.cc: Fix header comment.
8334 * testsuite/weak_undef_test.cc: Add new test case.
8335
b2286c10
DK
83362010-06-29 Doug Kwan <dougkwan@google.com>
8337
8338 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8339 Initialize USE_SYMBOL_.
8340 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8341 definition.
8342 (Arm_reloc_property::uses_symbol_): New data member declaration.
8343 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8344 uses symbol value and symbol is undefined but not weakly undefined.
8345
4802450a
RÁE
83462010-06-28 Rafael Espindola <espindola@google.com>
8347
8348 * plugin.cc (Plugin::load): Use dlerror.
8349
e5ca47ba
ILT
83502010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8351
8352 * symtab.cc (detect_odr_violations): When reporting an ODR
8353 violation, report an object where the symbol is defined.
8354
8a75a161
DK
83552010-06-25 Doug Kwan <dougkwan@google.com>
8356
8357 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8358 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8359 definition.
8360 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8361 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8362 target hook to detect function points.
8363 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8364 * icf.h (Icf::check_section_for_function_pointers): Change type of
8365 parameter SECTION_NAME to const reference to std::string. Use
8366 target hook to determine if section may have unsafe pointers.
8367 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8368 method definition.
8369
42218b9f
RÁE
83702010-06-21 Rafael Espindola <espindola@google.com>
8371
8372 * fileread.cc (Input_file::find_fie): New
8373 (Input_file::open): Use Input_file::find_fie.
8374 * fileread.h (Input_file::find_fie): New
8375 * plugin.cc (set_extra_library_path): New.
8376 (Plugin::load): Add set_extra_library_path to the transfer vector.
8377 (Plugin_manager::set_extra_library_path): New.
8378 (Plugin_manager::add_input_file): Use the extra search path if set.
8379 (set_extra_library_path(): New.
8380 * plugin.h (Plugin_manager): Add set_extra_library_path and
8381 extra_search_path_.
8382
a0506cca
CC
83832010-06-19 Cary Coutant <ccoutant@google.com>
8384
8385 * layout.cc (gdb_sections): Add .debug_types.
8386 (lines_only_debug_sections): Likewise.
8387
6508b958
RÁE
83882010-06-18 Rafael Espindola <espindola@google.com>
8389
8390 * plugin.cc (add_input_file,add_input_library)
8391 (Plugin_manager::add_input_file): Make filename arguments const.
8392 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8393 const.
8394
3e235302
DK
83952010-06-16 Doug Kwan <dougkwan@google.com>
8396
8397 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8398 .ARM.attributes section if we have not merged any input
8399 attributes sections.
8400
106e8a6c
DK
84012010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8402
8403 * arm.cc: Allow combining objects with no EABI version
8404 information.
8405
91ff43fe
RÁE
84062010-06-15 Rafael Espindola <espindola@google.com>
8407
8408 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8409
68ed838c
ILT
84102010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8411
8412 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8413 (struct iovec): Correct !HAVE_READV definition.
8414
f3a2388f
CC
84152010-06-10 Cary Coutant <ccoutant@google.com>
8416
8417 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8418 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8419 reloc sections.
8420 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8421
8422 PR 11683
8423 * symtab.h (Symbol::is_placeholder): New member function.
8424 * target-reloc.h (relocate_section): Check for placeholder symbols.
8425
8426 * testsuite/Makefile.am (plugin_test_8): New test.
8427 (plugin_test_9): New test.
8428 * testsuite/Makefile.in: Regenerate.
8429
e1df38aa
NC
84302010-06-09 Nick Clifton <nickc@redhat.com>
8431
8432 * yyscript.y (input_list_element): Allow strings prefixed with
8433 the '-' character. Treat these as libraries.
8434 * script.cc (script_add_library): New function. Adds a library
8435 specified by "-l<name>" found in an input script.
8436 * script-c.h: Add prototype for script_add_library.
8437
25bbe950
DK
84382010-06-07 Doug Kwan <dougkwan@google.com>
8439
8440 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8441 Restrict stub-group size to be within long conditional branch
8442 range when working around cortex-A8 erratum.
8443
0f32ea4c
ILT
84442010-06-07 Damien Diederen <dd@crosstwine.com>
8445
8446 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8447 #ifdef typo.
8448
8fe2a369
ST
84492010-06-03 Sriraman Tallam <tmsriram@google.com>
8450
8451 PR gold/11658
8452 * output.cc
8453 (Output_section::Input_section_sort_entry::compare_section_ordering):
8454 Change to return non-zero correctly.
8455 (Output_section::Input_section_sort_section_order_index_compare
8456 ::operator()): Change to fix ambiguity in comparisons.
8457
6e9ba2ca
ST
84582010-06-01 Sriraman Tallam <tmsriram@google.com>
8459
8460 * gold.h (is_wildcard_string): New function.
8461 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8462 (Layout::layout_eh_frame): Ditto.
8463 (Layout::find_section_order_index): New method.
8464 (Layout::read_layout_from_file): New method.
8465 * layout.h (Layout::find_section_order_index): New method.
8466 (Layout::read_layout_from_file): New method.
8467 (Layout::input_section_position_): New private member.
8468 (Layout::input_section_glob_): New private member.
8469 * main.cc (main): Call read_layout_from_file here.
8470 * options.h (--section-ordering-file): New option.
8471 * output.cc (Output_section::input_section_order_specified_): New
8472 member.
8473 (Output_section::Output_section): Initialize new member.
8474 (Output_section::add_input_section): Add new parameter.
8475 Keep input sections when --section-ordering-file is used.
8476 (Output_section::set_final_data_size): Sort input sections when
8477 section ordering file is specified.
8478 (Output_section::Input_section_sort_entry): Add new parameter.
8479 Check sorting type.
8480 (Output_section::Input_section_sort_entry::compare_section_ordering):
8481 New method.
8482 (Output_section::Input_section_sort_compare::operator()): Change to
8483 consider section_order_index.
8484 (Output_section::Input_section_sort_init_fini_compare::operator()):
8485 Change to consider section_order_index.
8486 (Output_section::Input_section_sort_section_order_index_compare
8487 ::operator()): New method.
8488 (Output_section::sort_attached_input_sections): Change to sort
8489 according to section order when specified.
e1df38aa
NC
8490 (Output_section::add_input_section<32, true>): Add new parameter.
8491 (Output_section::add_input_section<64, true>): Add new parameter.
8492 (Output_section::add_input_section<32, false>): Add new parameter.
8493 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8494 * output.h (Output_section::add_input_section): Add new parameter.
8495 (Output_section::input_section_order_specified): New
8496 method.
8497 (Output_section::set_input_section_order_specified): New method.
8498 (Input_section::Input_section): Initialize section_order_index_.
8499 (Input_section::section_order_index): New method.
8500 (Input_section::set_section_order_index): New method.
8501 (Input_section::section_order_index_): New member.
8502 (Input_section::Input_section_sort_section_order_index_compare): New
8503 struct.
8504 (Output_section::input_section_order_specified_): New member.
8505 * script-sections.cc (is_wildcard_string): Delete and move modified
8506 method to gold.h.
8507 (Output_section_element_input::Output_section_element_input): Modify
8508 call to is_wildcard_string.
8509 (Output_section_element_input::Input_section_pattern
8510 ::Input_section_pattern): Ditto.
8511 (Output_section_element_input::Output_section_element_input): Ditto.
8512 * testsuite/Makefile.am (final_layout): New test case.
8513 * testsuite/Makefile.in: Regenerate.
8514 * testsuite/final_layout.cc: New file.
8515 * testsuite/final_layout.sh: New file.
8516
3537c84b
RÁE
85172010-06-01 Rafael Espindola <espindola@google.com>
8518
8519 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8520
105b6afd
RÁE
85212010-06-01 Rafael Espindola <espindola@google.com>
8522
8523 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8524 visibility of symbols.
8525
29e11421
DK
85262010-05-27 Doug Kwan <dougkwan@google.com>
8527
8528 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8529 from start of output section instead of address for a local symbol
8530 in a merged or relaxed section when doing a relocatable link.
8531
5e0f337e
RÁE
85322010-05-26 Rafael Espindola <espindola@google.com>
8533
703d02da 8534 PR 11604
5e0f337e
RÁE
8535 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8536 adding sections the garbage collector removed.
8537 * gold/testsuite/Makefile.am: Add test.
8538 * gold/testsuite/Makefile.in: Regenerate.
8539 * gold/testsuite/plugin_test_7.sh: New.
8540 * gold/testsuite/plugin_test_7_1.c: New.
8541 * gold/testsuite/plugin_test_7_2.c: New.
8542
f4187277
RÁE
85432010-05-26 Rafael Espindola <espindola@google.com>
8544
8545 * script-sections.cc (Output_section_definition::set_section_addresses):
8546 Check for --section-start.
8547
5c388529
DK
85482010-05-26 Doug Kwan <dougkwan@google.com>
8549
8550 * arm.cc (Arm_scan_relocatable_relocs): New class.
8551 (Target_arm::relocate_special_relocatable): New method.
8552 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8553 (Arm_relocate_functions::thumb_branch_common): Same.
8554 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8555 instead of Default_scan_relocatable_relocs.
8556 * target-reloc.h (relocate_for_relocatable): Let target handle
8557 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8558 * target.h (Sized_target::relocate_special_relocatable): New method.
8559
bca1c3ae
ILT
85602010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8561
8562 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8563
0439c796
DK
85642010-05-23 Doug Kwan <dougkwan@google.com>
8565
8566 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8567 instead of a cast.
8568 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8569 with a direct branch, not a conditional branch, to a stub.
8570 * merge.cc (Output_merge_base::record_input_section): New method
8571 defintion.
8572 (Output_merge_data::do_add_input_section): Record input section if
8573 keeps-input-sections flag is set.
8574 (Output_merge_string::do_add_input_section): Ditto.
8575 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8576 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8577 INPUT_SECTIONS_.
8578 (Output_merge_base::keeps_input_sections,
8579 Output_merge_base::set_keeps_input_sections,
8580 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8581 method definitions.
8582 (Output_merge_base::Input_sections): New type declaration.
8583 (Output_merge_base::input_sections_begin,
8584 Output_merge_base::input_sections_end,
8585 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8586 (Output_merge_base::bool keeps_input_sections_,
8587 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8588 Output_merge_base::input_sections_): New data members.
8589 (Output_merge_data::do_set_keeps_input_sections): New method
8590 defintion.
8591 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8592 * output.cc (Output_section::Input_section::relobj): Move method
8593 defintion from class declaration to here and handle merge sections.
8594 (Output_section::Input_section::shndx): Ditto.
8595 (Output_section::Output_section): Remove initializations of removed
8596 data members and initialize new data member LOOKUP_MAPS_.
8597 (Output_section::add_input_section): Set keeps-input-sections flag
8598 for a newly created merge output section as appropriate. Adjust code
8599 to use Output_section_lookup_maps class.
8600 (Output_section::add_relaxed_input_section): Adjst code for lookup
8601 maps code refactoring.
2e702c99 8602 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8603 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8604 class. If adding input section to a newly created merge output
8605 section fails, remove the new merge section.
8606 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8607 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8608 (Output_section::find_merge_section): Ditto.
0439c796 8609 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8610 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8611 Output_section_lookup_maps class.
8612 (Output_section::get_input_sections): Export merge sections. Adjust
8613 code to use Output_section_lookup_maps class.
8614 (Output_section:::add_script_input_section): Adjust code to use
8615 Output_section_lookup_maps class. Update lookup maps for merge
8616 sections also.
8617 (Output_section::discard_states): Use Output_section_lookup_maps.
8618 (Output_section::restore_states): Same.
8619 * output.h (Merge_section_properties): Move class defintion out of
8620 Output_section.
8621 (Output_section_lookup_maps): New class.
8622 (Output_section::Input_section::is_merge_section): New method
8623 defintion.
8624 (Output_section::Input_section::relobj): Move defintion out of class
8625 defintion. Declare method only.
8626 (Output_section::Input_section::shndx): Ditto.
8627 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8628 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8629 (Output_section::Merge_section_by_properties_map,
8630 Output_section::Output_section_data_by_input_section_map,
8631 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8632 Remove types.
2e702c99 8633 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8634 KEEPS_INPUT_SECTIONS.
8635 (Output_section::build_lookup_maps): New method declaration.
8636 (Output_section::merge_section_map_,
8637 Output_section::merge_section_by_properties_map_,
8638 Output_section::relaxed_input_section_map_,
8639 Output_section::is_relaxed_input_section_map_valid_): Remove data
8640 members.
8641 (Output_section::lookup_maps_): New data member.
8642
76295588
L
86432010-05-21 Doug Kwan <dougkwan@google.com>
8644
8645 PR gold/11619
8646 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8647 avoid a compilation error.
8648
d103a984
RÁE
86492010-05-19 Rafael Espindola <espindola@google.com>
8650
8651 * script-sections.cc (Output_section_definition::allocate_to_segment):
8652 Update the phdrs_list even when the output section is NULL.
8653 * testsuite/Makefile.am: Add test.
8654 * testsuite/Makefile.in: Regenerate.
8655 * testsuite/script_test_9.cc: New.
8656 * testsuite/script_test_9.sh: New.
8657 * testsuite/script_test_9.t: New.
8658
6625d24e
DK
86592010-05-19 Doug Kwan <dougkwan@google.com>
8660
8661 * arm.cc (Arm_input_section::original_size): New method.
8662 (Arm_input_section::do_addralign): Add a cast.
8663 (Arm_input_section::do_output_offset): Remove static cast.
8664 (Arm_input_section::original_addralign,
8665 Arm_input_section::original_size_): Change type to uint32_t.
8666 (Arm_input_section::init): Add safe casts for section alignment
8667 and size.
8668 (Arm_input_section::set_final_data_size): Do not set address and
8669 offset of stub table.
8670 (Arm_output_section::fix_exidx_coverage): Change use of of
8671 Output_section::Simple_input_section to that of
8672 Output_section::Input_section.
8673 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8674 except for the first pass.
8675 * output.cc (Output_section::get_input_sections): Change type of
8676 input_sections to std::list<Input_section>.
8677 (Output_section::add_script_input_section): Rename from
8678 Output_section::add_simple_input_section. Change type of SIS
8679 parameter from Simple_input_section to Input_section.
8680 * output.h (Output_section::Simple_input_section): Remove class.
8681 (Output_section::Input_section): Change class visibility to public.
8682 (Output_section::Input_section::addralign): Use stored alignments
8683 for special input sections if set.
8684 (Output_section::Input_section::set_addralign): New method.
8685 (Output_section::get_input_sections): Change parameter type from
8686 list of Simple_input_section to list of Input_section.
8687 (Output_section::add_script_input_section): Rename from
8688 Output_section::add_simple_input_section. Change first parameter's
8689 type from Simple_input_section to Input_section and remove the
8690 second and third parameters.
8691 * script-sections.cc (Input_section::Input_section_list): Change
8692 type to list of Output_section::Input_section/
8693 (Input_section_info::Input_section_info): Change parameter type of
8694 INPUT_SECTION to Output_section::Input_section.
8695 (Input_section_info::input_section): Change return type.
8696 (Input_section_info::input_section_): Change type to
8697 Output_section::Input_section.
8698 (Output_section_element_input::set_section_addresses): Adjust code
8699 to use Output_section::Input_section instead of
8700 Output_section::Simple_input_section. Adjust code for renaming
8701 of Output_section::add_simple_input_section.
8702 (Orphan_output_section::set_section_addresses): Ditto.
8703
e1e82ea4
RW
87042010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8705
8706 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8707 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8708
91e75c8a
RÁE
87092010-05-18 Rafael Espindola <espindola@google.com>
8710
8711 * options.cc (General_options::finalize): Handle -nostdlib.
8712 * options.h (nostdlib): New option.
8713 * script.cc (script_add_search_dir): Handle -nostdlib.
8714
da59ad79
DK
87152010-05-12 Doug Kwan <dougkwan@google.com>
8716
8717 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8718 attributes section only if there no attributes section after merging.
8719 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8720 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8721 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8722 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8723 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8724 and arm_attr_merge_7.stdout.
8725 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8726 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8727 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8728 arm_attr_merge_7b.o): New rules.
8729 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8730 arm_attr_merge_7
8731 * testsuite/Makefile.in: Regenerate.
8732 * testsuite/arm_attr_merge.sh: New file.
8733 * testsuite/arm_attr_merge_[67][ab].s: Same.
8734
3e01a7fd
NC
87352010-05-05 Nick Clifton <nickc@redhat.com>
8736
8737 * po/es.po: Updated Spanish translation.
8738
7ad2014a
L
87392010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8740
8741 * Makefile.am (install-exec-local): Properly install gold as
8742 default cross linker.
8743 * Makefile.in: Regenerated.
8744
4fda8867
NC
87452010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8746 Nick Clifton <nickc@redhat.com>
8747
8748 * configure.ac (install_as_default): Define and set to false
8749 unless --enable-gold or --enable-gold=both/gold has been
8750 specified.
8751 * configure: Regenerate.
8752
8753 * Makefile.am (install-exec-local): Install the executable as
8754 'ld.gold'. If install_as_default is true then also install it as
8755 'ld'.
8756 * Makefile.in: Regenerated.
8757
bd288ea2
ILT
87582010-04-24 Ian Lance Taylor <iant@google.com>
8759
8760 * layout.cc (Layout::layout_reloc): In relocatable link don't
8761 combine reloc sections for grouped sections.
8762
ef38fd8a
ST
87632010-04-23 Sriraman Tallam <tmsriram@google.com>
8764
8765 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8766 sections that are not ordinary to icf.
8767 * icf.cc (get_section_contents): Handle relocation pointing to section
8768 with no object or shndx information.
8769 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8770 * testsuite/Makefile.in: Regenerate.
8771 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8772 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8773
f6973bdc
ILT
87742010-04-22 Ian Lance Taylor <iant@google.com>
8775
8776 * expression.cc (Expression::Expression_eval_info): Add
8777 result_alignment_pointer field.
8778 (Expression::eval_with_dot): Add result_alignment_pointer
8779 parameter. Change all callers.
8780 (Expression::eval_maybe_dot): Likewise.
8781 (class Binary_expression): Add alignment_pointer parameter to
8782 left_value and right_value. Change all callers.
8783 (BINARY_EXPRESSION): Set result alignment.
8784 (class Trinary_expression): Add alignment_pointer parameter to
8785 arg2_value and arg3_value. Change all callers.
8786 (Trinary_cond::value): Set result alignment.
8787 (Max_expression::value, Min_expression::value): Likewise.
8788 (Align_expression::value): Likewise.
8789 * script-sections.cc (class Sections_element): Add dot_alignment
8790 parameter to set_section_addresses virtual function. Update
8791 instantiations.
8792 (class Output_section_element): Likewise.
8793 (Script_sections::create_segments): Add dot_alignment parameter.
8794 Change all callers.
8795 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8796 (Script_sections::set_phdrs_clause_addresses): Likewise.
8797 * script-sections.h: Update declarations.
8798 * script.h: Update declarations.
8799 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8800 min_p_align.
8801 * testsuite/script_test_3.t: Set large alignment.
8802 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8803 segment has expected alignment.
8804
9c9c98a5
NC
88052010-04-22 Nick Clifton <nickc@redhat.com>
8806
8807 * po/gold.pot: Updated by the Translation project.
8808 * po/vi.po: Updated Vietnamese translation.
8809
2253bfba
L
88102010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8811
8812 * testsuite/Makefile.am (check_PROGRAMS): Add
8813 icf_virtual_function_folding_test.
8814 * testsuite/Makefile.in: Regenerated.
8815
85fdf906
AH
88162010-04-15 Andrew Haley <aph@redhat.com>
8817
8818 * options.h (merge_exidx_entries): New option.
8819 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8820 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8821 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8822 (Target_arm::merge_exidx_entries): New function.
8823 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8824 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8825 to Arm_exidx_fixup constructor.
8826 Add new arg, merge_exidx_entries.
8827 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8828 Arm_output_section::fix_exidx_coverage.
8829
ce97fa81
ST
88302010-04-18 Sriraman Tallam <tmsriram@google.com>
8831
8832 * icf.cc (get_section_contents): Check for preemptible functions.
8833 Ignore addend when appropriate.
8834 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8835 section folded.
8836 (add_from_relobj): Check for section folded.
8837 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8838 * symtab.h (should_add_dynsym_entry): Add new parameter.
8839 * target-reloc.h (scan_relocs): Check for section folded.
8840 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8841 Check reloc types for function pointers in shared objects.
8842 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8843 case.
8844 (icf_preemptible_functions_test): New test case.
8845 (icf_string_merge_test): New test case.
8846 * testsuite.Makefile.in: Regenerate.
8847 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8848 bar_glob. Refactor code.
8849 * testsuite/icf_preemptible_functions_test.cc: New file.
8850 * testsuite/icf_preemptible_functions_test.sh: New file.
8851 * testsuite/icf_string_merge_test.cc: New file.
8852 * testsuite/icf_string_merge_test.sh: New file.
8853 * testsuite/icf_virtual_function_folding_test.cc: New file.
8854 * testsuite/icf_virtual_function_folding_test.sh: New file.
8855
04ceb17c
DK
88562010-04-14 Doug Kwan <dougkwan@google.com>
8857
8858 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8859 for local symbol recounting if we remove a section due to ICF.
8860 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8861 there are no regular objects in input.
8862
153e7da4
DK
88632010-04-13 Doug Kwan <dougkwan@google.com>
8864
8865 * arm.cc (Arm_input_section::set_final_data_size): Compute
8866 accurate final data size instead of using current data size.
8867
4dbd9faf
DK
88682010-04-09 Doug Kwan <dougkwan@google.com>
8869
8870 * layout.cc (Layout::choose_output_section): Handle script section
8871 types.
8872 (Layout::make_output_section_for_script): Add section type parameter.
8873 Handle script section types.
8874 * layout.h (Layout::make_output_section_for_script): Add section
8875 type parameter.
8876 * output.cc (Output_section::Output_section): Initialize data member
8877 is_noload_.
8878 (Output_section::do_reset_address_and_file_offset): Do not set address
8879 to 0 if section is a NOLOAD section.
8880 * output.h (Output_section::is_noload): New method.
8881 (Output_section::set_is_noload): Ditto.
8882 (Output_section::is_noload_): New data member.
8883 * script-c.h (Script_section_type): New enum type.
8884 (struct Parser_output_section_header): Add new file section_type.
8885 * script-sections.cc (Sections_element::output_section_name): Add
8886 parameter for returning script section type.
8887 (Output_section_definition::output_section_name): Ditto.
8888 (Output_section_definition::section_type)P; New method.
8889 (Output_section_definiton::script_section_type_name): Ditto.
8890 (Output_section_definition::script_section_type_): New data member.
8891 (Output_section_definition::Output_section_definition): Initialize
8892 data member Output_section_definition::script_section_type_.
8893 (Output_section_definition::create_sections): Pass script section type
8894 to Layout::make_output_section_for_script.
8895 (Output_section_definition::output_section_name): Return script
8896 section type to caller.
8897 (Output_section_definition::set_section_address): Do not advance
8898 dot value and load address if section type is NOLOAD. Set address
8899 of NOLOAD sections regardless of section flags.
8900 (Output_section_definition::print): Print section type if it is
8901 not SCRIPT_SECTION_TYPE_NONE.
8902 (Output_section_definition::section_type): New method.
8903 (Output_section_definition::script_section_type_name): Ditto.
8904 (Script_sections::output_section_name): Add new parameter
8905 PSECTION_TYPE for returning script section type. Pass it to
8906 section elements. Handle discard sections.
8907 (Sort_output_sections::operator()): Handle NOLOAD sections.
8908 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8909 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8910 returning script section type.
8911 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8912 INFO and NOLOAD.
8913 * yyscript.y (union): Add new field SECTION_TYPE.
8914 (COPY, DSECT, INFO, NOLOAD): New tokens.
8915 (opt_address_and_section_type): Change type to output_section_header.
8916 (section_type): New non-terminal
8917 (section_header): Handle section type.
2253bfba 8918 (opt_address_and_section_type): Return section type value.
4dbd9faf 8919
721ea635
L
89202010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8921
8922 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8923 * testsuite/plugin_common_test_2.c (foo): Likewise.
8924
6bf924b0
DK
89252010-04-08 Doug Kwan <dougkwan@google.com>
8926
8927 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8928 Output_merge_data.
8929 * output.cc (Output_section::add_merge_input_section): Simplify
8930 code and return status of Output_merge_base::add_input_section.
e1df38aa 8931 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8932 returns true.
8933
24af6f92
DK
89342010-04-07 Doug Kwan <dougkwan@google.com>
8935
8936 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8937 if section is marked as containing instructions but has no mapping
8938 symbols.
8939 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8940 correct section index.
8941 (Arm_relobj::find_linked_text_section): Ditto.
8942
00698fc5
CC
89432010-04-07 Cary Coutant <ccoutant@google.com>
8944
8945 * archive.cc (include_member): Destroy Read_symbols_data object before
8946 releasing file.
8947 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8948 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8949 (Read_symbols_data::~Read_symbols_data) New destructor.
8950 (Section_relocs::Section_relocs) New constructor.
8951 (Section_relocs::~Section_relocs) New destructor.
8952 (Read_relocs_data::Read_relocs_data) New constructor.
8953 (Read_relocs_data::~Read_relocs_data) New destructor.
8954 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8955 pointers to NULL after deleting.
8956
7296d933
DK
89572010-04-07 Doug Kwan <dougkwan@google.com>
8958
8959 * arm.cc: Replace "endianity" with "endianness" in comments.
8960 (Arm_exidx_cantunwind): Ditto.
8961 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8962 (Arm_relobj::merge_flags_and_attributes): New method.
8963 (Arm_relobj::merge_flags_and_attributes_): New data member.
8964 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8965 (Arm_relobj::scan_sections_for_stubs): Ditto.
8966 (Arm_relobj::do_read_symbols): Check to see if we really want to
8967 merge processor-specific flags and attributes. Exit early if
8968 an object is empty except for section names and the undefined symbol.
8969 (Target_arm::do_finalize_sections): Move check for ELF format to
8970 Arm_relobj::do_read_symbols. Merge processor specific flags and
8971 attributes from a regular object only when we have determined that
8972 it is aapropriate. Do not create an .ARM.attributes section in
8973 output if there is no regular input object.
8974 (Target_arm::merge_processor_specific_flags): Check
8975 --warn-mismatch before printing any error.
8976 (Target_arm::merge_object_attributes): Ditto.
8977 * gold.cc (queue_middle_tasks): Handle the case in which there is
8978 no regular object in input.
8979 * options.cc (General_options::parse_EB): New method.
8980 (General_options::parse_EL): Same.
8981 (General_options::General_options): Initialize endianness_.
8982 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8983 New options.
8984 (General_options::Endianness): New enum.
8985 (General_options::endianness): New method.
8986 (General_options::endianness_): New data member.
8987 * parameters.cc (Parameters::set_options): Check target endianness.
8988 (Parameters::set_target_once): Ditto.
8989 (Parameters::check_target_endianness): New method.
8990 (parameters_force_valid_target): If either -EL or -EB is specified,
8991 use it to define endianness of default target.
8992 * parameters.h (Parameters::check_target_endianness): New method
8993 declaration.
8994 * target.h (class Target): Change "endianity" to "endianness"
8995 in comments.
8996
efc8d4f2
RW
89972010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8998
8999 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9000 * configure: Regenerate.
9001 * Makefile.in: Regenerate.
9002 * testsuite/Makefile.in: Regenerate.
9003
be234d88
CC
90042010-04-06 Cary Coutant <ccoutant@google.com>
9005
9006 gcc PR lto/42757
9007 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9008 prevailing definitions of common symbols.
9009 * testsuite/plugin_test_6.sh: New test case.
9010 * testsuite/plugin_common_test_1.c: New test case.
9011 * testsuite/plugin_common_test_2.c: New test case.
9012 * testsuite/Makefile.am (plugin_test_6): New test case.
9013 * testsuite/Makefile.in: Regenerate.
9014
bd32c6bd
NC
90152010-04-06 Nick Clifton <nickc@redhat.com>
9016
9017 * po/vi.po: New Vietnamese translation.
9018
323c532f
DK
90192010-03-30 Doug Kwan <dougkwan@google.com>
9020
9021 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9022
4fcd97eb
DK
90232010-03-25 Doug Kwan <dougkwan@google.com>
9024
9025 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9026 to avoid a conversion warning on a 32-bit host.
9027
4ebf39db
ILT
90282010-03-24 Ian Lance Taylor <iant@google.com>
9029
9030 * testsuite/script_test_3.t: Add a TLS segment.
9031 * testsuite/Makefile.am (check_PROGRAMS): Add
9032 tls_phdrs_script_test.
9033 (tls_phdrs_script_test_SOURCES): Define.
9034 (tls_phdrs_script_test_DEPENDENCIES): Define.
9035 (tls_phdrs_script_test_LDFLAGS): Define.
9036 (tls_phdrs_script_test_LDADD): Define.
9037 * testsuite/Makefile.in: Rebuild.
9038
4a599bdd
CC
90392010-03-23 Cary Coutant <ccoutant@google.com>
9040
9041 * fileread.cc (find_or_make_view): Fix comment.
9042
6c93b22c
ILT
90432010-03-23 Ian Lance Taylor <iant@google.com>
9044
9045 * script-sections.cc (class Orphan_section_placement): Define
9046 PLACE_TLS and PLACE_TLS_BSS.
9047 (Orphan_section_placement::Orphan_section_placement): Initialize
9048 new places.
9049 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9050 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9051 (tls_script_test_SOURCES): Define.
9052 (tls_script_test_DEPENDENCIES): Define.
9053 (tls_script_test_LDFLAGS): Define.
9054 (tls_script_test_LDADD): Define.
9055 * testsuite/Makefile.in: Rebuild.
9056
a2c7281b
DK
90572010-03-22 Doug Kwan <dougkwan@google.com>
9058
9059 * arm.cc (Arm_relocate_functions::abs8,
9060 Arm_relocate_functions::abs16): Use correct check for overflow
9061 specified in the ARM ELF specs.
9062 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9063 target of a BLX instruction specially.
9064 (Reloc_stub::stub_type_for_reloc): Ditto.
9065 (Relocate::relocate): Use symbolic names instead of numeric relocation
9066 codes to report error.
9067 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9068 workaround.
9069 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9070 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9071 thumb2_blx_out_of_range.stdout
9072 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9073 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9074 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9075 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9076 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9077 thumb2_blx_in_range, thumb2_blx_in_range.o,
9078 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9079 thumb2_blx_out_of_range.o): New rules.
2e702c99 9080 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9081 thumb2_blx_in_range and thumb2_blx_out_of_range.
9082 * testsuite/Makefile.in: Regenerate.
9083 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9084 * testsuite/thumb_blx_in_range.s: New file.
9085 * testsuite/thumb_blx_out_of_range.s: New file.
9086
b0193076
RÁE
90872010-03-22 Rafael Espindola <espindola@google.com>
9088
9089 * archive.cc (Should_include): Move to archive.h.
9090 (should_include_member): Make it a member of Archive.
9091 (Lib_group): New.
9092 (Add_lib_group_symbols): New.
9093 * archive.h: Include options.h.
9094 (Archive_member): Moved from Archive.
9095 (Should_include): Moved from archive.cc.
9096 (Lib_group): New.
9097 (Add_lib_group_symbols): New.
9098 * dynobj.cc (do_should_include_member): New.
9099 * dynobj.h (do_should_include_member): New.
9100 * gold.cc (queue_initial_tasks): Update call to queue.
9101 * main.cc (main): Print lib group stats.
9102 * object.cc (do_should_include_member): New.
9103 * object.h: Include archive.h.
9104 (Object::should_include_member): New.
9105 (Object::do_should_include_member): New.
9106 (Sized_relobj::do_should_include_member): New.
9107 * options.cc (General_options::parse_start_lib): New.
9108 (General_options::parse_end_lib): New.
9109 (Input_arguments::add_file): Handle lib groups.
9110 (Input_arguments::start_group): Check we are not in a lib.
9111 (Input_arguments::start_lib): New.
9112 (Input_arguments::end_lib): New.
9113 * options.h (General_options): Add start_lib and end_lib.
9114 (Input_argument::lib_): New.
9115 (Input_argument::lib): New.
9116 (Input_argument::is_lib): New.
9117 (Input_file_lib): New.
9118 (Input_arguments::in_lib_): New.
9119 (Input_arguments::in_lib): New.
9120 (Input_arguments::start_lib): New.
9121 (Input_arguments::end_lib_): New.
9122 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9123 in unused members as preempted.
9124 (Sized_pluginobj::do_should_include_member): New.
9125 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9126 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9127 return the blocker.
9128 (Read_symbols::do_whole_lib_group): New.
9129 (Read_symbols::do_lib_group): New.
9130 (Read_symbols::do_read_symbols): Handle lib groups.
9131 (Read_symbols::get_name): Handle lib groups.
9132 * readsyms.h (Read_symbols): Add an archive member pointer.
9133 (Read_symbols::do_whole_lib_group): New.
9134 (Read_symbols::do_lib_group): New.
9135 (Read_symbols::member_): New.
9136 * script.cc (read_input_script): Update call to queue_soon.
9137
d099120c
DK
91382010-03-19 Doug Kwan <dougkwan@google.com>
9139
9140 * arm.cc (Stub_table::Stub_table): Initialize new data members
9141 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9142 (Stub_table::add_reloc_stub): Assign stub offset and update
9143 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9144 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9145 New data members.
2e702c99 9146 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9147 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9148 instead of going over all reloc stubs.
2e702c99 9149 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9150 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9151 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9152 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9153 Stringpool_template::offset_.
9154 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9155 Stringpool_template::offset_ to zero.
9156
1aa37384
DK
91572010-03-15 Doug Kwan <dougkwan@google.com>
9158
9159 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9160 offset_.
9161 (Stringpool_template::new_key_offset): New method.
9162 (Stringpool_template::add_string): Assign offsets when adding new
9163 strings.
9164 (Stringpool_template::set_string_offsets): Do not set string offsets
9165 when not optimizing.
9166 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9167 member size_.
2e702c99
RM
9168 (Chunked_vector::clear): Clear size_.
9169 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9170 (Chunked_vector::size): Return size_.
9171 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9172 (Chunked_vector::size_): New data member.
1aa37384
DK
9173 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9174 (Stringpool_template::new_key_offset): New method declaration.
9175 (Stringpool_template::offset_): New data member.
9176
b672b057
RÁE
91772010-03-15 Rafael Espindola <espindola@google.com>
9178
9179 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9180 Add_symbols' constructor.
9181 * readsyms.h (Add_symbols): Remove the input_group member.
9182
b6848d3c
ILT
91832010-03-10 Ian Lance Taylor <iant@google.com>
9184
9185 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9186 target to ask whether a reference to a symbol requires a stack
9187 split.
9188 * target.h (Target::is_call_to_non_split): New function.
9189 (Target::do_is_call_to_non_split): Declare virtual function.
9190 * target.cc: Include "symtab.h".
9191 (Target::do_is_call_to_non_split): New function.
9192 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9193
a2a5469e
CC
91942010-03-10 Cary Coutant <ccoutant@google.com>
9195
9196 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9197 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9198 (File_read::open[2]): Add whole_file_view_ to list of views.
9199 (File_read::make_view): Remove test of whole_file_view_.
9200 (File_read::find_or_make_view): Create whole_file_view_ if
9201 necessary.
9202 (File_read::clear_views): Replace bool parameter with enum;
9203 adjust all callers. Don't delete views with permanent data;
9204 do delete cached views and views from archives if
9205 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9206 if clearing the corresponding view.
9207 * fileread.h (File_read::Clear_views_mode): New enum.
9208 (File_read::View::is_permanent_view): New method.
9209 (File_read::clear_views): Replace bool parameter
9210 with enum; adjust all callers.
9211 * options.h (General_options): Change keep_files_mapped option;
9212 add map_whole_files.
9213 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9214 releasing the file.
9215 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9216 the file.
9217
8861f32b
DM
92182010-03-10 David S. Miller <davem@davemloft.net>
9219
9220 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9221
d62d0f5f
ST
92222010-03-09 Sriraman Tallam <tmsriram@google.com>
9223
9224 * icf.cc (get_section_contents): Add '@' marker after processing the
9225 merge reloc.
9226
9177756d
DK
92272010-03-08 Doug Kwan <dougkwan@google.com>
9228
9229 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9230 due to a conversion warning.
9231 (Arm_relobj::update_output_local_symbol_count): Check for local
9232 symbol with unset output index.
9233
9e9e071b
ILT
92342010-03-05 Ian Lance Taylor <iant@google.com>
9235
9236 * options.h (class General_options): Add --spare-dynamic-tags.
9237 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9238 --spare-dynamic-tags.
9239
a81ee015
ILT
92402010-03-05 Ian Lance Taylor <iant@google.com>
9241
9242 * incremental.cc: Include "libiberty.h".
9243
44ec90b9
RO
92442010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9245
9246 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9247 function, is_info_ member.
9248 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9249 (Versions::Versions): Update caller.
9250 (Versions::define_base_version): Likewise.
9251 (Versions::add_def): Likewise.
9252
0897ed3b
ST
92532010-03-03 Sriraman Tallam <tmsriram@google.com>
9254
9255 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9256 (Scan::possible_function_pointer_reloc): New function.
9257 (Scan::local_reloc_may_be_function_pointer): Change to call
9258 possible_function_pointer_reloc.
9259 (Scan::global_reloc_may_be_function_pointer): Ditto.
9260 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9261 relocations in ".data.rel.ro._ZTV" section.
9262 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9263 * testsuite/icf_safe_so_test.cc: Ditto.
9264 * testsuite/icf_safe_test.cc: Ditto.
9265 * testsuite/icf_safe_test.sh: Ditto.
9266
d3bbad62
ILT
92672010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9268 Ian Lance Taylor <iant@google.com>
9269
9270 * target-reloc.h (relocate_section): Check the symbol table index
9271 for -1U before setting the local symbol index.
9272 (scan_relocatable_relocs): If copying the relocation, record that
9273 the local symbol is required.
9274 * object.h (Symbol_value::is_output_symtab_index_set): New
9275 function.
9276 (Symbol_value::may_be_discarded_from_output_symtab): New
9277 function.
9278 (Symbol_value::has_output_symtab_entry): New function.
9279 (Symbol_value::needs_output_symtab_entry): Remove.
9280 (Symbol_value::output_symtab_index): Make sure the symbol index is
9281 set.
9282 (Symbol_value::set_output_symtab_index): Make sure the symbol
9283 index is not set. Make sure the new index is valid.
9284 (Symbol_value::set_must_have_output_symtab_entry): New function.
9285 (Symbol_value::has_output_dynsym_entry): New function.
9286 (Symbol_value::set_output_dynsym_index): Make sure the new index
9287 is valid.
9288 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9289 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9290 local symbol if permitted.
9291 (Sized_relobj::do_finalize_local_symbols): Call
9292 is_output_symtab_index_set rather than needs_output_symtab_entry.
9293 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9294 rather than needs_output_symtab_entry. Call
9295 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9296 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9297 is_output_symtab_index_set rather than needs_output_symtab_entry.
9298 * testsuite/discard_locals_relocatable_test.c: New file.
9299 * testsuite/discard_locals_test.sh: Test -r.
9300 * testsuite/Makefile.am (check_DATA): Add
9301 discard_locals_relocatable_test1.syms,
9302 discard_local_relocatable_test2.syms.
9303 (MOSTLYCLEANFILES): Likewise. Also add
9304 discard_locals_relocatable_test1.lout and
9305 discard_locals_relocatable_test2.out.
9306 (discard_locals_relocatable_test1.syms): New target.
9307 (discard_locals_relocatable_test.o): New target.
9308 (discard_locals_relocatable_test1.out): New target.
9309 (discard_locals_relocatable_test2.syms): New target.
9310 (discard_locals_relocatable_test2.out): New target.
9311 (various): Add missing ../ld-new dependencies.
9312 * testsuite/Makefile.in: Rebuild.
9313
7e8ccf26
NC
93142010-03-03 Nick Clifton <nickc@redhat.com>
9315
9316 * po/fi.po: New Finnish translation.
9317
2a0ff005
DK
93182010-03-01 Doug Kwan <dougkwan@google.com>
9319
9320 * layout.cc (Layout::Layout): Force section types of .init_array*,
9321 .preinit_array* and .fini_array* sections.
9322 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9323 Fix check of return value of std::string::find.().
9324 (Output_section::Input_section_sort_compare::operator()): Remove
9325 comment about .init_array.
9326 (Output_section::Input_section_sort_init_fini_compare::operator()):
9327 New method.
9328 (Output_section::sort_attached_input_sections): Handle .init_array
9329 and .fini_array specially.
9330 * output.h (Output_section::Inut_section_sort_compare): Update
9331 comment.
9332 (Output_section::Input_section_sort_init_fini_compare): New struct.
9333
c3e4ae29
DK
93342010-02-26 Doug Kwan <dougkwan@google.com>
9335
9336 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9337 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9338 * testsuite/debug_msg.sh: Avoid matching source line number for
9339 use of global variable undef_int.
9340
2fd9ae7a
DK
93412010-02-26 Doug Kwan <dougkwan@google.com>
9342
9343 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9344 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9345 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9346 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9347 * options.cc (General_options::General_options): Initialize member
9348 fix_v4bx_.
9349 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9350 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9351 and rm_no_fix_v4bx.stdout
9352 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9353 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9354 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9355 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9356 and arm_no_fix_v4bx.
9357 * Makefile.in: Regenerate.
9358 * testsuite/arm_fix_v4bx.s: New file.
9359 * testsuite/arm_fix_v4bx.sh: Ditto.
9360
67ec7d0b
DK
93612010-02-24 Doug Kwan <dougkwan@google.com>
9362
9363 * arm.cc (Target_arm::got_section): Make the .got section the first
9364 non RELRO section in the data segment.
9365 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9366 suffixes of section names.
9367
10165461
DK
93682010-02-24 Doug Kwan <dougkwan@google.com>
9369
9370 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9371 flags and attributes merging if an input file is a binary file.
9372 * fileread.cc (Input_file::open): Record format of original file.
9373 * fileread.h (Input_file::Format): New enum type.
2e702c99 9374 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9375 (Input_file::format): New method definition.
9376 (Input_file::format_):: New data member.
9377
4a54abbb
DK
93782010-02-24 Doug Kwan <dougkwan@google.com>
9379
9380 * arm.cc (Arm_output_data_got): New class.
9381 (ARM_TCB_SIZE): New constant
9382 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9383 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9384 If user uses a script with a SECTIONS clause, issue only a warning
9385 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9386 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9387 garbage collection.
9388 (Target_arm::got_mode_index_entry): Handle static linking.
9389 (Target_arm::Scan::local): Ditto.
9390 (Target_arm::Scan::global): Ditto.
9391 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9392 all incorrectly implemented relocations.
e1df38aa 9393 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9394 Arm_output_section::fix_exidx_coverage.
9395 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9396 from ".ARM.exidx." and ".ARM.extab.".
9397
ca419a6f
ILT
93982010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9399
9400 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9401 section if it does not already exist.
9402 * attributes.cc (Attributes_section_data::Attributes_section_data):
9403 Don't crash if size is zero.
9404
135b9c78
ILT
94052010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9406 Ian Lance Taylor <iant@google.com>
9407
9408 * gold.cc (queue_middle_tasks): If no input files were opened,
9409 exit.
9410 * workqueue.h (Task_function::Task_function): Assert that there is
9411 a blocker.
9412
bb0bfe4f
DK
94132010-02-22 Doug Kwan <dougkwan@google.com>
9414
9415 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9416 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9417 types to avoid warnings due to different uint64_t implementations
9418 on different hosts.
9419
2a2b6d42
DK
94202010-02-21 Doug Kwan <dougkwan@google.com>
9421
9422 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9423 handling of the maximum backward branch offset.
2e702c99 9424 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9425 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9426 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9427 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9428 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9429 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9430 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9431 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9432 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9433 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9434 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9435 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9436 thumb2_bl_out_of_range.o): New rules.
9437 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9438 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9439 thumb2_bl_out_of_range
9440 * testsuite/Makefile.in: Regenerate.
9441 * testsuite/arm_bl_in_range.s: New file.
9442 * testsuite/arm_bl_out_of_range.s: Ditto.
9443 * testsuite/arm_branch_in_range.sh: Ditto.
9444 * testsuite/arm_branch_range.t: Ditto.
9445 * testsuite/thumb2_branch_range.t: Ditto.
9446 * testsuite/thumb_bl_in_range.s: Ditto.
9447 * testsuite/thumb_bl_out_of_range.s: Ditto.
9448 * testsuite/thumb_branch_range.t: Ditto.
9449
b487ad64
ST
94502010-02-20 Sriraman Tallam <tmsriram@google.com>
9451
9452 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9453 Add reloc offset information.
9454 * icf.cc (get_section_contents): Change iterators to point to the new
9455 vectors. Add reloc offset information to the contents.
9456 * icf.h (Icf::Sections_reachable_info): New typedef.
9457 (Icf::Sections_reachable_list): New typedef.
9458 (Icf::Offset_info): New typedef.
9459 (Icf::Reloc_info): New struct typedef.
9460 (Icf::Reloc_info_list): New typedef.
9461 (Icf::symbol_reloc_list): Delete method.
9462 (Icf::addend_reloc_list): Delete method.
9463 (Icf::section_reloc_list): Delete method.
9464 (Icf::reloc_info_list): New method.
9465 (Icf::reloc_info_list_): New member.
9466
f96accdf
DK
94672010-02-19 Doug Kwan <dougkwan@google.com>
9468
9469 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9470 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9471 * arm.cc (Arm_relocation_functions): New forward declaration.
9472 (Target_arm::Target_arm): Initialize new data members
9473 got_mod_index_offset_ and tls_base_symbol_defined_.
9474 (Target_arm::Relocate::relocate_tls): New method.
9475 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9476 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9477 New methods.
2e702c99 9478 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9479 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9480 (Target_arm::got_mod_index_offset_,
9481 Target_arm::tls_base_symbol_defined_): New data members.
9482 (Target_arm::Scan::local, Target::Scan::global,
9483 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9484 relocations.
9485
c8761b9a
DK
94862010-02-18 Doug Kwan <dougkwan@google.com>
9487
9488 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9489 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9490 text section as a parameter becuase some broken tools may not set
9491 the link in section header.
9492 (Target_arm::has_got_section): New method.
9493 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9494 without any mapping symbol as data only. Remove warning.
9495 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9496 link in its section header, try to discover the link by inspecting the
9497 REL31 relocation at the beginning of the section.
9498 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9499 in error message.
9500 (Target_arm::Scan::global): Treat any reference to the symbol
9501 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9502
21bb3914
ST
95032010-02-12 Sriraman Tallam <tmsriram@google.com>
9504
9505 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9506 (Scan::global_reloc_may_be_function_pointer): New function.
9507 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9508 (Scan::global_reloc_may_be_function_pointer): New function.
9509 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9510 (Scan::global_reloc_may_be_function_pointer): New function.
9511 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9512 (Scan::global_reloc_may_be_function_pointer): New function.
9513 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9514 (Scan::global_reloc_may_be_function_pointer): New function.
9515 (Scan::possible_function_pointer_reloc): New function.
9516 (Target_x86_64::can_check_for_function_pointers): New function.
9517 * gc.h (gc_process_relocs): Scan relocation types to determine if
9518 function pointers were taken for targets that support it.
9519 * icf.cc (Icf::find_identical_sections): Include functions for
9520 folding in safe ICF whose pointer is not taken.
9521 * icf.h (Secn_fptr_taken_set): New typedef.
9522 (fptr_section_id_): New member.
9523 (section_has_function_pointers): New function.
9524 (set_section_has_function_pointers): New function.
9525 (check_section_for_function_pointers): New function.
9526 * options.h: Fix comment for safe ICF option.
9527 * target.h (can_check_for_function_pointers): New function.
9528 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9529 Modify icf_safe_test for X86-64.
9530 * testsuite/Makefile.in: Regenerate.
9531 * testsuite/icf_safe_so_test.cc: New file.
9532 * testsuite/icf_safe_so_test.sh: New file.
9533 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9534 (main): Change to take pointer to function kept_func_3.
9535 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9536 folding is done correctly for X86-64.
9537
0da6fa6c
DM
95382010-02-12 David S. Miller <davem@davemloft.net>
9539
9540 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9541 is_symbolless parameter.
9542 (Output_reloc<SHT_REL>::is_symbolless): New.
9543 (Output_reloc<SHT_REL>::is_symbolless_): New.
9544 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9545 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9546 (Output_reloc<SHT_RELA>::is_symbolless): New.
9547 (Output_data_reloc::add_global): Handle is_symbolless.
9548 (Output_data_reloc::add_global_relative): Likewise.
9549 (Output_data_reloc::add_local): Likewise.
9550 (Output_data_reloc::add_local_relative): Likewise.
9551 (Output_data_reloc::add_symbolless_global_addend): New.
9552 (Output_data_reloc::add_symbolless_local_addend): New.
9553 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9554 is_symbolless.
9555 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9556 instead of ->is_relative_
9557 (Output_reloc::write): Likewise.
9558 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9559 (Output_reloc::write_rel): Simplify.
9560
9561 * sparc.cc (Target_sparc::Scan::local): Use
9562 ->add_symbolless_local_addend as needed.
9563 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9564 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9565 based upon relocation offset.
9566
e4782e83
DK
95672010-02-11 Doug Kwan <dougkwan@google.com>
9568
9569 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9570 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9571 beginning of function.
9572 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9573 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9574 parameter is_32bit in calls to should_apply_static_reloc.
9575 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9576 (check_DATA): Add arm_abs_global.stdout.
9577 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9578 arm_abs_global.stdout): New rules.
9579 (MOSTLLYCLEANFILES): Add arm_abs_global
9580 * Makefile.in: Regenerate.
9581 * testsuite/arm_abs_global.s: New file.
9582 * testsuite/arm_abs_global.sh: Ditto.
9583 * testsuite/arm_abs_lib.s: Ditto.
9584
93ceb764
ILT
95852010-02-11 Ian Lance Taylor <iant@google.com>
9586
9587 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9588 Read_relocs task.
9589 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9590 Allocate_commons_task first.
9591 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9592 task, rather than symtab_lock_.
9593 (Gc_process_relocs::~Gc_process_relocs): New function.
9594 (Gc_process_relocs::is_runnable): Check this_blocker_.
9595 (Gc_process_relocs::locks): Use next_blocker_ rather than
9596 blocker_.
9597 (Scan_relocs::~Scan_relocs): New function.
9598 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9599 symtab_lock_.
9600 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9601 next_blocker_.
9602 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9603 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9604 constructor accordingly.
9605 (class Gc_process_relocs): Likewise.
9606 (class Scan_relocs): Likewise.
9607 * common.h (class Allocate_commons_task): Remove symtab_lock_
9608 field, and corresponding constructor parameter.
9609 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9610 symtab_lock_.
9611 (Allocate_commons_task::locks): Likewise.
9612
114dfbe1
ILT
96132010-02-11 Ian Lance Taylor <iant@google.com>
9614
9615 * gold-threads.h (class Once): Define.
9616 (class Initialize_lock): Rewrite as child of Once.
9617 * gold-threads.cc (class Once_initialize): Define.
9618 (once_pointer_control): New static variable.
9619 (once_pointer, once_arg): New static variables.
9620 (c_run_once): New static function.
9621 (Once::Once, Once::run_once, Once::internal_run): New functions.
9622 (class Initialize_lock_once): Remove.
9623 (initialize_lock_control): Remove.
9624 (initialize_lock_pointer): Remove.
9625 (initialize_lock_once): Remove.
9626 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9627 (Initialize_lock::initialize): Rewrite.
9628 (Initialize_lock::do_run_once): New function.
9629 * archive.cc (Archive::interpret_header): Only clear name if it is
9630 not already empty.
9631 * fileread.cc: Include "gold-threads.h"
9632 (file_counts_lock): New static variable.
9633 (file_counts_initialize_lock): Likewise.
9634 (File_read::release): Only increment counts when using --stats.
9635 Use a lock around the increment.
9636 * parameters.cc (class Set_parameters_target_once): Define.
9637 (set_parameters_target_once): New static variable.
9638 (Parameters::Parameters): Move here from parameters.h.
9639 (Parameters::set_target): Rewrite.
9640 (Parameters::set_target_once): New function.
9641 (Parameters::clear_target): Move here and rewrite.
9642 * parameters.h (class Parameters): Update declarations. Add
9643 set_parameters_target_once_ field.
9644 (Parameters::Parameters): Move to parameters.cc.
9645 (Parameters::clear_target): Likewise.
9646 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9647 task.
9648 (Start_group::~Start_group): New function.
9649 (Start_group::is_runnable): New function.
9650 (Start_group::locks, Start_group::run): New functions.
9651 (Finish_group::run): Change saw_undefined to size_t.
9652 * readsyms.h (class Start_group): Define.
9653 (class Finish_group): Change saw_undefined_ field to size_t.
9654 (Finish_group::Finish_group): Remove saw_undefined and
9655 this_blocker parameters. Change all callers.
9656 (Finish_group::set_saw_undefined): New function.
9657 (Finish_group::set_blocker): New function.
9658 * symtab.h (class Symbol_table): Change saw_undefined to return
9659 size_t. Change saw_undefined_ field to size_t.
9660 * target-select.cc (Set_target_once::do_run_once): New function.
9661 (Target_selector::Target_selector): Initialize set_target_once_
9662 field. Don't initialize lock_ and initialize_lock_ fields.
9663 (Target_selector::instantiate_target): Rewrite.
9664 (Target_selector::set_target): New function.
9665 * target-select.h (class Set_target_once): Define.
9666 (class Target_selector): Update declarations. Make
9667 Set_target_once a friend. Remove lock_ and initialize_lock_
9668 fields. Add set_target_once_ field.
9669
fa17a3f4
ILT
96702010-02-10 Ian Lance Taylor <iant@google.com>
9671
9672 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9673 queueing any tasks.
9674 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9675 (queue_middle_tasks): Add all blockers before queueing any tasks.
9676 (queue_final_tasks): Likewise.
9677 * token.h (Task_token::add_blockers): New function.
9678 * object.h (Input_objects::number_of_relobjs): New function.
9679
c7177d31
ILT
96802010-02-10 Ian Lance Taylor <iant@google.com>
9681
5de0e392
ILT
9682 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9683 shared, not if not position independent.
9684 * x86_64.cc (Relocate::relocate_tls): Likewise.
9685 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9686 (tls_pie_pic_test): New target.
9687 * testsuite/Makefile.in: Rebuild.
9688
c7177d31
ILT
9689 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9690 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9691 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9692 * testsuite/Makefile.in: Rebuild.
9693
684b268a
DM
96942010-02-09 David S. Miller <davem@davemloft.net>
9695
9696 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9697 R_SPARC_RELATIVE using ->add_local_relative().
9698 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9699
612a8d3d
DM
9700 * output.h (Output_data_dynamic::add_section_size): New method
9701 that takes two Output_data objects.
9702 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9703 entry param. Handle it in initializers.
9704 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9705 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9706 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9707 arg.
9708 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9709 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9710 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9711 for dynrel_includes_plt.
9712 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9713 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9714 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9715 before .rela.plt
9716 (Target_sparc::do_finalize_sections): Update to pass true for
9717 dynrel_includes_plt.
9718 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9719 output before .rela.plt
9720 (Target_powerpc::do_finalize_sections): Update to pass true for
9721 dynrel_includes_plt when 32-bit.
9722
cb1be87e
DK
97232010-02-08 Doug Kwan <dougkwan@google.com>
9724
9725 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9726 method.
9727 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9728 Arm_relobj::scan_section_for_cortex_a8_stubs,
9729 Arm_relobj::do_relocation_section): Instead of calling
9730 Output_section::output_address, use faster
9731 Arm_relobj::simple_input_section_output_address.
9732
705b5121
DM
97332010-02-08 David S. Miller <davem@davemloft.net>
9734
9735 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9736 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9737 relocation helper function.
9738
024c4466
DM
9739 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9740 just like R_SPARC_GOT{10,13,22}.
9741 (Target_sparc::Scan::local): Likewise.
9742 (Target_sparc::Relocate:relocate): Likewise.
9743
9109c078
ILT
97442010-02-06 Ian Lance Taylor <iant@google.com>
9745
9746 * configure.ac: Rewrite targetobjs duplicate removal code to use
9747 only shell constructs.
9748 * configure: Rebuild.
9749
cf846138
DK
97502010-02-05 Doug Kwan <dougkwan@google.com>
9751
9752 PR 11247
9753 * arm.cc (Arm_relobj::section_is_scannable): New method.
9754 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9755 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9756
6cfaf60b
DK
97572010-02-04 Doug Kwan <dougkwan@google.com>
9758
9759 PR 11247
9760 * arm-reloc-property.cc (cstdio): Include.
9761 * configure.ac (targetobjs): Remove duplicates.
9762 * configure: Regenerate.
9763 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9764 big and little endian version for a given address size.
9765
5c57f1be
DK
97662010-02-03 Doug Kwan <dougkwan@google.com>
9767
9768 * arm-reloc-property.cc
9769 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9770 definition.
9771 * arm-reloc-property.h
9772 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9773 New method definition.
9774 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9775 declaration.
9776 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9777 overflow to N.
9778 (GOT_PREL): Change implemented to Y.
9779 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9780 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9781 (Arm_relocate_functions::movw_abs_nc): Remove method.
9782 (Arm_relocate_functions::movt_abs): Ditto.
9783 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9784 (Arm_relocate_functions::thm_movt_abs): Ditto.
9785 (Arm_relocate_functions::movw_rel_nc): Ditto.
9786 (Arm_relocate_functions::movw_rel): Ditto.
9787 (Arm_relocate_functions::movt_rel): Ditto.
9788 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9789 (Arm_relocate_functions:thm_movw_rel): Ditto.
9790 (Arm_relocate_functions:thm_movt_rel): Ditto.
9791 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9792 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9793 New method definitions.
9794 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9795 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9796 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9797 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9798 (Target_arm::Relocate::relocate): Check for non-static or
9799 unimplemented relocation code and exit early. Change calls to
9800 Target_arm::reloc_uses_thumb_bit and
9801 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9802 instead. Refactor code to handle similar relocations to increase
9803 code sharing. Remove check for unsupported relocation code in switch
9804 statement.
9805 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9806 relocation property table to find out size. Change error message to
9807 print out the name of a relocation code instead of the numeric value.
9808 (Target_arm::scan_reloc_for_stub): Use relocation property table
9809 instead of calling Target_arm::reloc_uses_thumb_bit().
9810
218c5831
DK
98112010-02-02 Doug Kwan <dougkwan@google.com>
9812
9813 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9814 types of relaxed input section.
9815
0d31c79d
DK
98162010-02-02 Doug Kwan <dougkwan@google.com>
9817
9818 * Makefile.am (HFILES): Add arm-reloc-property.h.
9819 (DEFFILES): New.
2e702c99
RM
9820 (TARGETSOURCES): Add arm-reloc-property.cc
9821 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9822 (libgold_a_SOURCES): $(DEFFILES)
9823 * Makefile.in: Regenerate.
9824 * arm-reloc-property.cc: New file.
9825 * arm-reloc-property.h: New file.
9826 * arm-reloc.def: New file.
9827 * arm.cc: Update comments.
9828 (arm-reloc-property.h): New included header.
9829 (arm_reloc_property_table): New global variable.
9830 (Target_arm::do_select_as_default_target): New method definition.
9831 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9832 arm-reloc-property to targ_extra_obj.
9833 * parameters.cc (set_parameters_target): Call
9834 Target::select_as_default_target().
9835 * target.h (Target::select_as_default_target): New method definition.
9836 (Target::do_select_as_default_target): Same.
9837
546c7457
DK
98382010-02-01 Doug Kwan <dougkwan@google.com>
9839
9840 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9841 first_output_text_section_.
9842 (Arm_exidx_fixup::first_output_text_section): New method definition.
9843 (Arm_exidx_fixup::first_output_text_section_): New data member.
9844 (Arm_exidx_fixup::process_exidx_section): Record the first text
9845 output section seen.
9846 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9847 and entsize in output section header.
9848
11b861d5
DK
98492010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9850
9851 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9852 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9853 (Arm_relocate_functions::thm_alu11): New Method.
9854 (Arm_relocate_functions::thm_pc8): New Method.
9855 (Arm_relocate_functions::thm_pc12): New Method.
9856 (Target_arm::Scan::local): Handle the relocations.
9857 (Target_arm::Scan::global): Likewise.
9858 (Target_arm::Relocate::relocate): Likewise.
9859 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9860
c9a2c125
DK
98612010-01-29 Doug Kwan <dougkwan@google.com>
9862
9863 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9864 of relocation types as ld.
9865
1521477a
DK
98662010-01-29 Doug Kwan <dougkwan@google.com>
9867
9868 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9869 to public.
9870 (Arm_relocate_functions::thumb_branch_common): Ditto.
9871 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9872 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9873 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9874 Arm_relocate_functions::jump24): Remove.
9875 (Target_arm::Relocate::relocate): Adjust code to call
9876 Arm_relocation_functions::arm_branch_common and
9877 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9878 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9879
e7eca48c
DK
98802010-01-29 Doug Kwan <dougkwan@google.com>
9881
9882 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9883 output_local_symbol_count_needs_update_.
9884 (Arm_relobj::output_local_symbol_count_needs_update,
9885 Arm_relobj::set_output_local_symbol_count_needs_update,
9886 Arm_relobj::update_output_local_symbol_count): New methods.
9887 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9888 member.
9889 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9890 of pointed function as in a R_ARM_PREL31 relocation.
9891 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9892 for output local symbol count updating.
9893 (Target_arm::do_relax): Update output local symbol counts in objects
9894 if necessary.
9895 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9896
02961d7e
ILT
98972010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9898
9899 * arm.cc: Added support for the ARM relocations:
9900 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9901 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9902 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9903 movw_prel_nc).
9904 (Arm_relocate_functions::movw_rel): New method.
9905 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9906 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9907 thm_movw_prel_nc).
9908 (Arm_relocate_functions::thm_movw_rel): New method.
9909 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9910 thm_movt_prel).
9911 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9912 relocations.
9913 (Target_arm::Scan::global): Likewise.
9914 (Target_arm::Relocate::relocate): Likewise.
9915 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9916 Likewise.
9917
b10d2873
ILT
99182010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9919
9920 * arm.cc: Added support for ARM group relocations.
9921 (Target_arm::reloc_needs_sym_origin): New method.
9922 (Arm_relocate_functions::calc_grp_kn): New method.
9923 (Arm_relocate_functions::calc_grp_residual): New method.
9924 (Arm_relocate_functions::calc_grp_gn): New method.
9925 (Arm_relocate_functions::arm_grp_alu): New Method.
9926 (Arm_relocate_functions::arm_grp_ldr): New Method.
9927 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9928 (Arm_relocate_functions::arm_grp_ldc): New Method.
9929 (Target_arm::Scan::local): Handle the ARM group relocations.
9930 (Target_arm::Scan::global): Likewise.
9931 (Target_arm::Relocate::relocate): Likewise.
9932 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9933 Likewise.
9934
2b328d4e
DK
99352010-01-26 Doug Kwan <dougkwan@google.com>
9936
9937 * arm.cc (set): Include.
9938 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9939 pointer type.
2e702c99 9940 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9941 (Arm_output_section::append_text_sections_to_list): New method.
9942 (Arm_output_section::fix_exidx_coverage): Ditto.
9943 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9944 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9945 Relobj::set_section_offset() instead of
9946 Sized_relobj::invalidate_section_offset().
2e702c99 9947 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9948 parameter for section headers. Ignore relocation sections for
9949 unallocated sections and EXIDX sections.
9950 (Target_arm::fix_exidx_coverage): New method.
9951 (Target_arm::output_section_address_less_than): New type.
9952 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9953 linked text section instead of the EXIDX section.
9954 (Arm_output_section::create_stub_group): Add an assertion to check
9955 that this is not an EXIDX output section.
9956 (Arm_output_section::append_text_sections_to_list): New method.
9957 (Arm_output_section::fix_exidx_coverage): Ditto.
9958 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9959 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9960 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9961 first pass.
9962 (Target_arm::fix_exidx_coverage): New method.
9963 * object.h (Relobj::set_output_section): New method.
9964 (Sized_relobj::invalidate_section_offset): Remove method.
9965 (Sized_relobj::do_invalidate_section_offset): Remove method.
9966 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9967
c7f3c371
DK
99682010-01-25 Doug Kwan <dougkwan@google.com>
9969
9970 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9971 Fix warning due to signed and unsigned comparison on a 32-bit host.
9972
8923b24c
DK
99732010-01-22 Doug Kwan <dougkwan@google.com>
9974
9975 * arm.cc (Target_arm::do_relax): Record an output section for section
9976 offset adjustment it contains any stub table that has changed.
9977 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9978 offsets in an output section if necessary.
9979 * output.cc (Output_section::Output_section): Initialize
9980 section_offsets_need_adjustments_.
9981 (Output_section::add_input_section_for_script): Renamed to
9982 Output_section::add_simple_input_section.
9983 (Output_section::save_states): Add a comment.
9984 (Output_section::discard_states): New method defintion.
9985 (Output_section::adjust_section_offsets): Same.
9986 * output.h (Output_section::add_input_section_for_script): Renamed to
9987 Output_section::add_simple_input_section.
9988 (Output_section::discard_states): New method declaration.
9989 (Output_section::adjust_section_offsets): Same.
9990 (Output_section::section_offsets_need_adjustment,
9991 Output_section::set_section_offsets_need_adjustment): New method
9992 definitions.
9993 (Output_section::section_offsets_need_adjustment_): New data member.
9994 * script-sections.cc
9995 (Output_section_element_input::set_section_address): Adjust code for
9996 renaming of Output_section::add_input_section_for_script.
9997 (Orphan_output_section::set_section_address): Same.
9998
9b2fd367
DK
99992010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10000
10001 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10002 Fix_v4bx enum values .
10003 * gold/options.h (General_options): New option definitions.
10004 (General_options::fix_v4bx): New method.
10005 (General_options::Fix_v4bx): New enum.
10006 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10007 (General_options::parse_fix_v4bx_interworking): New method.
10008
80d0d023
DK
100092010-01-22 Doug Kwan <dougkwan@google.com>
10010
10011 * arm.cc (Arm_exidx_fixup): New class.
10012
af2cdeae
DK
100132010-01-21 Doug Kwan <dougkwan@google.com>
10014
10015 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10016 classes.
10017 (Arm_exidx_section_offset_map): New type.
10018
993d07c1
DK
100192010-01-21 Doug Kwan <dougkwan@google.com>
10020
10021 * arm.cc (Arm_exidx_input_section): New class.
10022 (Arm_relobj::exidx_input_section_by_link,
10023 Arm_relobj::exidx_input_section_by_shndx,
10024 Arm_relobj::make_exidx_input_section): New methods.
10025 (read_arm_attributes_section): Remove.
10026 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10027 information about them.
10028 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10029 to here.
10030
5ac169d4
DK
100312010-01-20 Doug Kwan <dougkwan@google.com>
10032
10033 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10034 Input_section_specifier to Section_id.
10035 (Target_arm::new_arm_input_section: Adjust code for change of key
10036 type.
10037 (Target_arm::find_arm_input_section): Ditto.
10038 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10039 (Section_id): Remove.
10040 (Garbage_collection::Section_id_hash): Remove.
10041 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10042 (Section_id): Remove.
10043 (Icf::Section_id_hash): Remove.
10044 * object.h (Section_id, Const_section_id, Section_id_hash,
10045 Const_section_id_hash): New type definitions.
10046 * output.cc (Output_section::add_relaxed_input_section): Change to
10047 use Const_section_id instead of Input_section_specifier as key type.
10048 (Output_section::add_merge_input_section): Ditto.
10049 (Output_section::build_relaxation_map): Change to use Section_id
10050 instead of Input_section_specifier as key type.
2e702c99 10051 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10052 Ditto.
10053 (Output_section::convert_input_sections_to_relaxed_sections): Change
10054 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10055 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10056 (Output_section::find_relaxed_input_section): Ditto.
10057 * output.h (Input_section_specifier): Remove class.
10058 (Output_section::Output_section_data_by_input_section_map): Change
10059 key type to Const_section_id.
10060 (Output_section::Output_relaxed_input_section_by_input_section_map):
10061 Ditto.
10062 (Output_section::Relaxation_map): Change key type to Section_id.
10063
a2162063
ILT
100642010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10065
10066 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10067 (class Arm_v4bx_stub): New class.
10068 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10069 (Stub_factory::make_arm_v4bx_stub): New method.
10070 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10071 (Stub_table::empty): Handle v4bx stubs.
10072 (Stub_table::add_arm_v4bx_stub): New method.
10073 (Stub_table::find_arm_v4bx_stub): New method.
10074 (Arm_relocate_functions::v4bx): New method.
10075 (Target_arm::fix_v4bx): New method.
10076 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10077 (Stub_table::relocate_stubs): Likewise.
10078 (Stub_table::do_write): Likewise.
10079 (Stub_table::update_data_size_and_addralign): Likewise.
10080 (Stub_table::finalize_stubs): Likewise.
10081 (Target_arm::Scan::local): Likewise.
10082 (Target_arm::Scan::global): Likewise.
10083 (Target_arm::do_finalize_sections): Likewise.
10084 (Target_arm::Relocate::relocate): Likewise.
10085 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10086 Likewise.
10087 (Target_arm::scan_reloc_for_stub): Likewise.
10088 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10089
5696ab0b
ILT
100902010-01-19 Ian Lance Taylor <iant@google.com>
10091
10092 * output.cc (Output_section_headers::do_sized_write): Write large
10093 segment count to sh_info field.
10094 (Output_file_header::do_sized_write): For large segment count,
10095 write PN_XNUM to e_phnum field.
10096
800d0f56
ILT
100972010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10098
10099 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10100 (Arm_relocate_functions::thm_jump8): New function.
10101 (Arm_relocate_functions::thm_jump11): New function.
10102 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10103 R_ARM_THM_JUMP11.
10104 (Target_arm::Scan::global): Likewise.
10105 (Target_arm::Relocate::relocate): Likewise.
10106 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10107 Likewise.
10108
41263c05
DK
101092010-01-14 Doug Kwan <dougkwan@google.com>
10110
10111 * arm.cc (map, utility): Include headers.
10112 (Target_arm::apply_cortex_a8_workaround): New method.
10113 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10114 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10115 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10116 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10117 the --[no-]fix-cortex-a8 command line options.
10118 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10119 (Target_arm::relocate_stub): Use addend in instruction template.
10120 * options.h (DEFINE_bool): Set the user-set flag.
10121 (General_options): Add --[no-]-fix-cortex options.
10122 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10123 : Update fast look-up map after conversion.
41263c05 10124
459e9b03
ST
101252010-01-14 Sriraman Tallam <tmsriram@google.com>
10126
10127 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10128 in the first pass of do_layout.
10129
b521dfe4
DK
101302010-01-13 Doug Kwan <dougkwan@google.com>
10131
10132 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10133 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10134 apparent compiler problem of not folding static constant integral
10135 data members of elfcpp::Elf_sizes<32>.
10136
44272192
DK
101372010-01-13 Doug Kwan <dougkwan@google.com>
10138
10139 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10140 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10141 Arm_relobj::scan_section_for_cortex_a8_erratum,
10142 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10143 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10144 sections to scan for relocation stubs into a new method
10145 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10146 relocation and Cortex-A8 stub scanning.
10147 (Target_arm::do_relax): Force stubs to be after stubbed sections
10148 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10149 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10150 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10151
44b71ece
ILT
101522010-01-12 Ian Lance Taylor <iant@google.com>
10153
10154 * target-reloc.h (visibility_error): New inline function.
10155 (relocate_section): Call visibility_error.
10156 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10157 (MOSTLYCLEANFILES): Likewise.
10158 (protected_4_pic.o, protected_3.err): New targets.
10159 * testsuite/protected_4.cc: New file.
10160
a120bc7f
DK
101612010-01-12 Doug Kwan <dougkwan@google.com>
10162
10163 * arm.cc (Cortex_a8_reloc): New class.
10164 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10165 and cortex_a8_relocs_info_.
10166 (Target_arm::fix_cortex_a8): New method definition.
10167 (Target_arm::Cortex_a8_relocs_info): New type.
10168 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10169 New data member declarations.
10170 (Target_arm::scan_reloc_for_stub): Record information about
10171 relocations for THUMB branches that might be exempted from the
10172 Cortex-A8 workaround.
10173 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10174 at the beginning of a relaxation pass.
10175
20138696
DK
101762010-01-12 Doug Kwan <dougkwan@google.com>
10177
10178 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10179 (Arm_relobj::Mapping_symbol_position,
10180 Arm_reloj::Mapping_symbol_position_less,
10181 Arm_relobj::Mapping_symbols_info): New types.
10182 (Target_arm::is_mapping_symbol_name): New method definition.
10183 (Arm_relobj::do_count_local_symbols): Save information about mapping
10184 symbols.
10185
089d69dc
DK
101862010-01-11 Doug Kwan <dougkwan@google.com>
10187
10188 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10189 Arm_relocate_functions::thumb32_branch_upper,
10190 Arm_relocate_functions::thumb32_branch_lower,
10191 Arm_relocate_functions::thumb32_cond_branch_offset,
10192 Arm_relocate_functions::thumb32_cond_branch_upper,
10193 Arm_relocate_functions::thumb32_cond_branch_lower,
10194 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10195 branch offset encoding.
10196 (Arm_relocate_functions::thumb_branch_common): Use new branch
10197 offset encoding methods to avoid code duplication.
10198 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10199 (Stub_addend_reader::operator()): Use new branch encoding method
10200 to avoid code duplication.
10201
99e5bff2
DK
102022010-01-11 Doug Kwan <dougkwan@google.com>
10203
10204 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10205 (Target_arm::do_finalize_sections): Define special EXIDX section
10206 symbols only if referenced.
10207 * gc.h (Garbage_collection::add_reference): New method.
10208 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10209 code duplication.
10210
98e090bd
ILT
102112010-01-11 Ian Lance Taylor <iant@google.com>
10212
d0a91bd8
ILT
10213 * script.cc (Version_script_info::build_expression_list_lookup):
10214 Change complaing about duplicate wildcard match from error to
10215 warning.
10216
98e090bd
ILT
10217 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10218 of 2009-12-30.
10219 (Version_script_info::Version_script_info): Initialize globs_,
10220 default_version_, default_is_global_, and exact_. Don't
10221 initialize globals_ or locals_.
10222 (Version_script_info::build_lookup_tables): Build local symbols
10223 first.
10224 (Version_script_info::unquote): New function.
10225 (Version_script_info::add_exact_match): New function.
10226 (Version_script_info::build_expression_list_lookup): Remove lookup
10227 parameter. Add is_global parameter. Change all callers. Handle
10228 wildcard pattern specially. Unquote pattern. Call
10229 add_exact_match.
10230 (Version_script_info::get_name_to_match): New function.
10231 (Version_script_info::get_symbol_version): New function.
10232 (Version_script_info::get_symbol_version_helper): Remove.
10233 (Version_script_info::check_unmatched_names): Call unquote.
10234 * script.h (class Version_script_info): Change get_symbol_version
10235 to be non-inline and add is_global parameter; change all callers.
10236 Rewrite symbol_is_local. Update declarations. Define struct
10237 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10238 Remove globals_ and locals_ members. Add exact_, globs_,
10239 default_version_, is_global_.
10240 (Version_script_info::Glob): Remove pattern, add expression and
10241 is_global. Update constructor. Change all callers.
10242 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10243 default version.
10244 (Versions::symbol_section_contents): If a symbol is undefined, or
10245 defined in a dynamic object, set the version index to
10246 VER_NDX_LOCAL.
10247 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10248 symbol_is_local.
10249 (Symbol_table::add_from_pluginobj): Likewise.
10250 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10251
d56962d3
DK
102522010-01-11 Doug Kwan <dougkwan@google.com>
10253
10254 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10255 (incremental_dump_LDADD): Add linking option for libintl.
10256 * Makefile.in: Regenerate.
10257
94e6ee91
L
102582010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10259
10260 PR gold/11144
10261 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10262 instead of -Ds.
10263 * testsuite/Makefile.in: Regenerated.
10264
e96c574b
DK
102652010-01-10 Doug Kwan <dougkwan@google.com>
10266
10267 * options.h (DEFINE_var): Use parentheses around argument varname__
10268 in macro body to avoid any unintended subsequent substitutions.
10269
7198066b
ILT
102702010-01-10 Ian Lance Taylor <iant@google.com>
10271
ba4d53bf
ILT
10272 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10273 candidates before doing symbol resolution.
10274
7198066b
ILT
10275 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10276 ODR candidates if only one is weak.
10277
a2beed37
ILT
102782010-01-08 Ian Lance Taylor <iant@google.com>
10279
10280 * script.cc (Version_script_info::build_expression_list_lookup):
10281 Don't warn about ambiguous version, just record the ambiguity.
10282 (Version_script_info::get_symbol_version_helper): Give error if
10283 version is ambiguous.
10284
2fb7225c
DK
102852010-01-08 Doug Kwan <dougkwan@google.com>
10286
10287 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10288 prev_data_size_ and prev_addralign_. Remove initializer for
10289 deleted data member has_been_changed_.
10290 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10291 to determine if the table is empty.
10292 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10293 Remove.
10294 (Stub_table::add_reloc_stub): Define method in class definition
10295 instead of just declaring it there.
10296 (Stub_table::add_cortex_a8_stub): New method definition.
10297 (Stub_table::update_data_size_and_addralign): Ditto.
10298 (Stub_table::finalize_stubs): Ditto.
10299 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10300 (Stub_table::do_addralign_): Return address alignment in the
10301 (Stub_table::do_reset_address_and_file_offset): Define method in
10302 class definition instead of declaring it there. Set current data
10303 size to be the data size of the previous pass.
10304 (Stub_table::set_final_data_size): Use current data size as the
10305 final data size.
10306 (Stub_table::relocate_stub): Change parameter type of stub from
10307 Reloc_stub pointer to Stub pointer.
10308 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10309 (Stub_table::Cortex_a8_stub_list): New typedef.
10310 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10311 Stub_table::prev_addralign_): New data member.
10312 (Arm_relobj::Arm_relobj): Initialize data member
10313 section_has_cortex_a8_workaround_.
10314 (Arm_relobj::section_has_cortex_a8_workaround,
10315 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10316 definitions.
10317 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10318 declarations.
10319 (Target_arm::relocate_stub): Change parameter type of stub from
10320 Reloc_stub pointer to Stub pointer.
10321 (Insn_template::size, Insn_template::alignment): Handle
10322 THUMB16_SPECIAL_TYPE.
10323 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10324 Stub_table::update_data_size_and_addralign,
10325 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10326 definitions.
10327 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10328 (Stub_table::do_write): Ditto.
10329 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10330
880cd20d
ILT
103312010-01-08 Ian Lance Taylor <iant@google.com>
10332
10333 PR 11108
10334 * symtab.h (class Symbol): Remove fields is_target_special_ and
10335 has_plt_offset_. Add field is_defined_in_discarded_section_.
10336 (Symbol::is_defined_in_discarded_section): New function.
10337 (Symbol::set_is_defined_in_discarded_section): New function.
10338 (Symbol::has_plt_offset): Rewrite.
10339 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10340 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10341 Don't initialize is_target_special_ or has_plt_offset_.
10342 Initialize is_defined_in_discarded_section_.
10343 (Symbol_table::add_from_relobj): If appropriate, set
10344 is_defined_in_discarded_section.
10345 * resolve.cc (Symbol::override_base_with_special): Don't test
10346 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10347 * target-reloc.h (relocate_section): Do special handling for
10348 symbols defined in discarded sections for global symbols as well
10349 as local symbols.
10350
2703e3eb
ILT
103512010-01-08 Ian Lance Taylor <iant@google.com>
10352
10353 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10354 the SHT_SYMTAB case.
10355
339d40a3
ILT
103562010-01-08 Ian Lance Taylor <iant@google.com>
10357
10358 * object.cc (Sized_relobj::do_layout): Don't get confused if
10359 layout_eh_frame returns NULL.
10360
abecea76
ILT
103612010-01-08 Ian Lance Taylor <iant@google.com>
10362
10363 PR 11084
10364 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10365 dynamic symbol table, use the normal symbol table.
10366 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10367 symbol table.
10368
6b7dd3f3
ILT
103692010-01-08 Ian Lance Taylor <iant@google.com>
10370
10371 PR 11072
10372 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10373 sections.
10374
36c50e63
L
103752010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10376
10377 * version.cc (print_version): Change to "Copyright 2010".
10378
e291e7b9
ILT
103792010-01-08 Ian Lance Taylor <iant@google.com>
10380
10381 PR 10287
10382 PR 11063
10383 * i386.cc (class Target_i386): Change return type of plt_section
10384 to be non-const.
10385 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10386 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10387 tls_desc_rel_ field.
10388 (Output_data_plt_i386::rel_tls_desc): New function.
10389 (Target_i386::rel_tls_desc_section): New function.
10390 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10391 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10392 R_386_TLS_DESC reloc in rel_tls_desc_section.
10393 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10394 Define struct Tlsdesc_info.
10395 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10396 (Target_x86_64::do_reloc_symbol_index): New function.
10397 (Target_x86_64::add_tlsdesc_info): New function.
10398 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10399 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10400 tlsdesc_rel_ field.
10401 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10402 all callers.
10403 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10404 (Target_x86_64::rela_tlsdesc_section): New function.
10405 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10406 handling.
10407 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10408 (Target_x86_64::do_reloc_addend): New function.
10409 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10410 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10411 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10412 (Output_reloc::type): New function.
10413 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10414 (Output_reloc::is_target_specific): New function.
10415 (Output_reloc::target_arg): New function.
10416 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10417 absolute relocs and target specific relocs.
10418 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10419 add_target_specific.
10420 (class Output_data_reloc) [SHT_RELA]: Likewise.
10421 * output.cc (Output_reloc::Output_reloc): Add four new versions
10422 for absolute relocs and target specific relocs.
10423 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10424 (Output_reloc::get_symbol_index): Likewise.
10425 (Output_reloc::local_section_offset): Check that local_sym_index_
10426 is not TARGET_CODE or 0.
10427 (Output_reloc::symbol_value): Likewise.
10428 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10429 reloc.
10430 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10431 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10432 functions.
10433 * layout.cc (add_target_dynamic_tags): Use output section for
10434 DT_PLTRELSZ and DT_JMPREL.
10435
3a44184e
ILT
104362010-01-07 Ian Lance Taylor <iant@google.com>
10437
10438 PR 11061
10439 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10440 function.
10441 (class Output_data_reloc_generic): Define.
10442 (class Output_data_reloc_base): Change base class to
10443 Output_data_reloc_generic. Change add() method to call
10444 bump_relative_reloc_count for a relative reloc. Remove
10445 sort_relocs_ field.
10446 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10447 to sort_relocs().
10448 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10449 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10450 appropriate.
10451 * layout.h (class Layout): Update declaration.
10452
ea715a34
ILT
104532010-01-07 Ian Lance Taylor <iant@google.com>
10454
10455 * output.h (class Output_data): Add const version of
10456 output_section and do_output_section.
10457 (class Output_section_data): Add const version of
10458 do_output_section.
10459 (class Output_section): Likewise.
10460 * layout.cc (Layout::add_target_dynamic_tags): New function.
10461 * layout.h (class Layout): Update declarations.
10462 * arm.cc (Target_arm::do_finalize_sections): Use
10463 add_target_dynamic_tags.
10464 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10465 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10466 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10467 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10468
659948a4
ILT
104692010-01-07 Ian Lance Taylor <iant@google.com>
10470
10471 PR 11042
10472 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10473 object as needed.
10474
9d3b86f6
ILT
104752010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10476 Ian Lance Taylor <iant@google.com>
10477
10478 PR 11019
10479 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10480 Xindex::read_symtab_xindex.
10481
bb0d3eb0
DK
104822010-01-07 Doug Kwan <dougkwan@google.com>
10483
10484 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10485 (Insn_template::thumb16_bcond_insn): New method declaration.
10486 (Insn_template): Fix spelling.
10487 (Stub::thumb16_special): New method declaration.
10488 (Stub::do_write): Define virtual method which was previously pure
10489 virtual.
10490 (Stub::do_thumb16_special): New method declaration.
10491 (Stub::do_fixed_endian_write): New template member.
10492 (Reloc_stub::do_write): Remove.
10493 (Reloc_stub::do_fixed_endian_write): Remove.
10494 (Cortex_a8_stub): New class definition.
10495 (Stub_factory::make_cortex_a8_stub): New method definition.
10496 (Stub_factory::Stub_factory): Add missing static storage class
10497 qualifier for elf32_arm_stub_a8_veneer_blx.
10498
ffeef7df
ILT
104992010-01-07 Ian Lance Taylor <iant@google.com>
10500
dc3f80fe
ILT
10501 PR 10980
10502 * options.h (class General_options): Add --warn-unresolved-symbols
10503 and --error-unresolved-symbols.
10504 * errors.cc (Errors::undefined_symbol): Implement
10505 --warn-unresolved-symbols.
10506
ffeef7df
ILT
10507 * options.h (class General_options): Add -z text and -z textoff.
10508 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10509
f1ec9ded
ST
105102010-01-06 Sriraman Tallam <tmsriram@google.com>
10511
10512 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10513 (Garbage_collection::cident_sections): New function.
10514 (Garbage_collection::add_cident_section): New function.
10515 (Garbage_collection::cident_sections_): New member.
10516 (gc_process_relocs): Add references to sections whose names are C
10517 identifiers.
10518 * gold.h (cident_section_start_prefix): New constant.
10519 (cident_section_stop_prefix): New constant.
10520 (is_cident): New function.
10521 * layout.cc (Layout::define_section_symbols): Replace string constants
10522 with the newly defined constants.
10523 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10524 C identifiers.
10525 * testsuite/Makefile.am: Add gc_orphan_section_test.
10526 * testsuite/Makefile.in: Regenerate.
10527 * testsuite/gc_orphan_section_test.cc: New file.
10528 * testsuite/gc_orphan_section_test.sh: New file.
10529
6eda8c29
ILT
105302010-01-06 Ian Lance Taylor <iant@google.com>
10531
b9674e17
ILT
10532 PR 10980
10533 * options.h (class General_options): Add --warn-shared-textrel.
10534 * layout.cc (Layout::finish_dynamic_section): Implement
10535 --warn-shared-textrel.
10536
6eda8c29
ILT
10537 PR 10980
10538 * options.h (class General_options): Add --warn-multiple-gp.
10539
32dcd44e
ILT
105402010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10541
10542 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10543 $(THREADSLIB) and $(LIBDL).
10544 * Makefile.in: Rebuild.
10545
a192ba05
ILT
105462010-01-06 Ian Lance Taylor <iant@google.com>
10547
10548 PR 10980
10549 * options.cc (General_options::parse_section_start): New function.
10550 (General_options::section_start): New function.
10551 (General_options::General_options): Initialize all members.
10552 * options.h: Include <map>
10553 (class General_options): Add --section-start. Add section_starts_
10554 member.
10555 * layout.cc (Layout::attach_allocated_section_to_segment): If
10556 --section-start was used, set the address of the segment. Remove
10557 local sort_sections.
10558 (Layout::relaxation_loop_body): If the address of the load segment
10559 has been set by --section-start, don't use it.
10560 * output.h (Output_segment::update_flags_for_output_section): New
10561 function.
10562 * output.cc (Output_segment::add_output_section): Call
10563 update_flags_for_output_section.
10564
dde3f402
ILT
105652010-01-05 Ian Lance Taylor <iant@google.com>
10566
62dfdd4d
ILT
10567 PR 10980
10568 * options.h (class General_options): Add --undefined-version.
10569 * script.cc (struct Version_expression): Add was_matched_by_symbol
10570 field.
10571 (Version_script_info::matched_symbol): New function.
10572 (Version_script_info::get_symbol_version_helper): Call
10573 matched_symbol.
10574 (Version_script_info::check_unmatched_names): New function.
10575 * script.h (class Version_script_info): Update declarations.
10576 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10577
9c4ae156
ILT
10578 * options.h (class General_options): Use DEFINE_bool_alias for
10579 allow_multiple_definition.
10580 * resolve.cc (Symbol_table::should_override): Don't test
10581 allow_multiple_definition.
10582
dde3f402
ILT
10583 PR 10980
10584 * options.h (class General_options): Add --cref.
10585 * main.cc (main): Print cref table if --cref. Don't close mapfile
10586 until after printing cref table.
10587 * cref.cc: Include "symtab.h".
10588 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10589 (Cref_table_compare::operator()): New function.
10590 (Cref_inputs::gather_cref): New function.
10591 (filecol): New static const.
10592 (Cref_inputs::print_cref): New function.
10593 (Cref::print_cref): New function.
10594 * cref.h: Include <cstdio>.
10595 (class Cref): Update declarations.
10596 * mapfile.h (Mapfile::file): New function.
10597 * object.h (class Object): Define Symbols. Declare virtual
10598 do_get_global_symbols.
10599 (Object::get_global_symbols): New function.
10600 * object.cc (Input_objects::add_object): Pass object to cref_ if
10601 --cref.
10602 (Input_objects::archive_start): Likewise.
10603 (Input_objects::archive_stop): Likewise.
10604 (Input_objects::print_cref): New function.
10605 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10606 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10607 --cref.
10608 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10609 function.
10610 * plugin.h (class Sized_pluginobj): Update declarations.
10611
8781f709
ILT
106122010-01-05 Ian Lance Taylor <iant@google.com>
10613
10614 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10615 to is_default_version. Rename insdef to insdefault.
10616 (Symbol_table::add_from_relobj): Rename def to is_default_version
10617 and local to is_forced_local.
10618 (Symbol_table::add_from_pluginobj): Likewise.
10619 (Symbol_table::add_from_dynobj): Likewise.
10620 (Symbol_table::define_special_symbol): Rename insdef to
10621 insdefault.
10622
fe35d28d
ILT
106232010-01-04 Ian Lance Taylor <iant@google.com>
10624
30bc8c46
ILT
10625 PR 10980
10626 * options.h (class General_options): Add
10627 --allow-multiple-definition and -z muldefs.
10628 * resolve.cc (Symbol_table::should_override): Don't warn about a
10629 multiple symbol definition if --allow-multiple-definition or -z
10630 muldefs.
10631
7eaea549
ILT
10632 PR 10980
10633 * options.h (class General_options): Add --add-needed and
10634 --copy-dt-needed-entries. Tweak --as-needed help entry.
10635 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10636 error if --copy-dt-needed-entries aka --add-needed is used and
10637 would cause a change in behaviour.
10638
fe35d28d
ILT
10639 PR 10980
10640 * options.h (class General_options): Add -G as a short version of
10641 --shared. Add no-op options -assert, -g, and -i.
10642
55a2bb35
ST
106432010-01-04 Sriraman Tallam <tmsriram@google.com>
10644
10645 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10646 check for .text or .gnu.linkonce.t sections.
10647 * icf.cc (Icf::find_identical_sections): Ditto.
10648 Change the detection for mangled function name within the section
10649 name.
10650 * icf.h (is_section_foldable_candidate): New function.
10651
719328e1
ILT
106522009-12-30 Ian Lance Taylor <iant@google.com>
10653
10654 PR 10980
10655 * options.h (class General_options): Permit two dashes with
10656 --retain-symbols-file.
10657
d7bb5745
ILT
106582009-12-30 Ian Lance Taylor <iant@google.com>
10659
403a15dd
ILT
10660 PR 10979
10661 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10662 don't put the file header and segment headers in the text
10663 segment.
10664
eda294df
ILT
10665 PR 10979
10666 * common.cc (Sort_commons::operator()): Stabilize sort when both
10667 entries are NULL.
10668 (Symbol_table::do_allocate_commons_list): When allocating common
10669 symbols, skip a symbol which is no longer common.
10670 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10671 an object before checking its type.
10672 * testsuite/common_test_2.c: New file.
10673 * testsuite/common_test_3.c: New file.
10674 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10675 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10676 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10677 (common_test_2_pic.o, common_test_2.so): New targets.
10678 (common_test_3_pic.o, common_test_3.so): New targets.
10679 * testsuite/Makefile.in: Rebuild.
10680
d7bb5745
ILT
10681 PR 10979
10682 * script.cc (read_input_script): If we see a new SECTIONS clause,
10683 and we have added an input section, give an error.
10684 * layout.h (class Layout): Add have_added_input_section function.
10685 Add have_added_input_section_ field.
10686 * layout.cc (Layout::Layout): Initialize
10687 have_added_input_section_.
10688 (Layout::layout): Set have_added_input_section_.
10689 (Layout::layout_eh_frame): Likewise.
10690
fc59c572
ILT
106912009-12-30 Ian Lance Taylor <iant@google.com>
10692
10693 PR 10931
10694 * options.h (class General_options): Add --sort-common option.
10695 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10696 * common.cc (Sort_common): Add sort_order parameter to
10697 constructor. Add sort_order_ field.
10698 (Sort_commons::operator): Check sort_order_.
10699 (Symbol_table::allocate_commons): Determine the sort order.
10700 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10701 Change all callers.
10702 (Symbol_table::do_allocate_commons_list): Likewise.
10703
1c74fab0
ILT
107042009-12-30 Ian Lance Taylor <iant@google.com>
10705
10706 PR 10916
10707 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10708 symbols from this object, don't change the visibility of an
10709 undefined symbol.
10710 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10711
6affe781
ILT
107122009-12-30 Ian Lance Taylor <iant@google.com>
10713
10714 PR 10861
10715 * script.h (class Version_script_info): Define Language enum.
10716 Update declarations. Define Glob, Exact, and Lookup types. Add
10717 new fields globals_, locals_, and is_finalized_.
10718 * script.cc: Various formatting fixes.
10719 (class Parser_closure): Change language_stack_ from a vector of
10720 std::string to one of Version_script_info::Language. Adjust all
10721 uses accordingly.
10722 (class Lazy_demangler): Remove.
10723 (struct Version_expression): Change language from std::string to
10724 Version_script_info::Language.
10725 (Version_script_info::Version_script_info): New function.
10726 (Version_script_info::~Version_script_info): Don't call clear.
10727 (Version_script_info::finalize): New function.
10728 (Version_script_info::build_lookup_tables): New function.
10729 (Version_script_info::build_expression_list_lookup): New
10730 function.
10731 (Version_script_info::get_symbol_version_helper): Rewrite to use
10732 lookup tables.
10733 (Version_script_info::print_expression_list): Adjust to use
10734 Version_script_info::Language.
10735 (script_push_lex_into_version_mode): Check that the version script
10736 has not been finalized.
10737 (version_script_push_lang): Change language string to
10738 Version_script_info::Language.
10739 * options.cc (Command_line::version_script): New function.
10740 * options.h (class General_options): Add finalize_dynamic_list
10741 function. Change version_script from declaration to definition.
10742 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10743 * testsuite/version_script.map: Remove duplicate def of foo.
10744 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10745 version_script.map.
10746 * testsuite/Makefile.in: Rebuild.
10747
818bf354
ILT
107482009-12-30 Ian Lance Taylor <iant@google.com>
10749
10750 PR 10843
10751 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10752 if the input symbol index is 0, make the output symbol index 0.
10753
ebcc8304
ILT
107542009-12-30 Ian Lance Taylor <iant@google.com>
10755
10756 PR 10670
10757 * options.h (class General_options): Add -x/--discard-all.
10758 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10759 --discard-all. If the local symbol needs a dynamic entry, check
10760 that before handling --discard-locals.
10761
176fe33f
ILT
107622009-12-30 Ian Lance Taylor <iant@google.com>
10763
bb321bb1
ILT
10764 PR 10450
10765 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10766 flags to PF_R.
10767 (Output_segment::add_output_section): Don't change the flags if
10768 the type is PT_TLS.
10769
176fe33f
ILT
10770 PR 10450
10771 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10772 GNU hash table if they need a dynamic value. Otherwise, don't add
10773 them if they are defined in a dynamic object or are forced local.
10774
e8cd95c7
ILT
107752009-12-29 Ian Lance Taylor <iant@google.com>
10776
1b81fb71
ILT
10777 PR 10450
10778 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10779 .gnu.hash table for a 32-bit target.
10780
8d6d383d
ILT
10781 PR 10450
10782 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10783 regular and a dynamic object only needs a dynamic symbol table
10784 entry if it is externally visible.
10785
e785ec03
ILT
10786 PR 10450
10787 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10788 constructor. Add global_offset_table_ field.
10789 (Target_i386::got_section): Set global_offset_table_.
10790 (Target_i386::do_finalize_sections): Set global_offset_table_
10791 size.
10792 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10793 in constructor. Add global_offset_table_ field.
10794 (Target_x86_64::got_section): Set global_offset_table_.
10795 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10796 size.
10797
1a2dff53
ILT
10798 * layout.cc (Layout::Layout): Initialize increase_relro_.
10799 (Layout::get_output_section): Add is_relro, is_last_relro, and
10800 is_first_non_relro parameters. Change all callers.
10801 (Layout::choose_output_section): Likewise.
10802 (Layout::add_output_section_data): Likewise.
10803 (Layout::make_output_section): Likewise.
10804 (Layout::set_segment_offsets): Clear increase_relro when using a
10805 linker script.
10806 * layout.h (class Layout): Add increase_relro method. Add
10807 increase_relro_ field. Update declarations.
10808 * output.cc (Output_section::Output_section): Initialize
10809 is_last_relro_ and is_first_non_relro_.
10810 (Output_segment::add_output_section): Group relro sections is
10811 do_sort is true. Handle is_last_relro and is_first_non_relro.
10812 (Output_segment::maximum_alignment): Remove relro handling.
10813 (Output_segment::set_section_addresses): Add increase_relro
10814 parameter. Change all callers. Add initial alignment to align
10815 relro sections on separate page. Remove old relro handling.
10816 (Output_segment::set_section_list_addresses): Remove in_relro
10817 parameter. Change all callers.
10818 (Output_segment::set_offset): Add increase parameter. Change all
10819 callers. Remove old relro handling.
10820 * output.h (class Output_section): Add new methods: is_last_relro,
10821 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10822 Add is_last_relro_ and is_first_non_relro_ fields.
10823 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10824 Create separate .got.plt section. Call increase_relro.
10825 * x86_64.cc (Target_x86_64::got_section): Likewise.
10826 * testsuite/relro_script_test.t: Add .got.plt.
10827
f0ba79e2
ILT
10828 PR 10450
10829 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10830 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10831 (Layout::finalize): Call set_dynamic_symbol_size.
10832 (Layout::set_dynamic_symbol_size): New function.
10833 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10834 set_dynamic_symbol_size.
10835
e8cd95c7
ILT
10836 PR 10450
10837 * output.h (class Output_section): Add is_entsize_zero_ field.
10838 * output.cc (Output_section::Output_section): Initialize
10839 is_entsize_zero_.
10840 (Output_section::set_entsize): If two different entsizes are
10841 requested, force it to zero.
10842 (Output_section::add_input_section): Set flags for .debug_str
10843 before updating section flags. Set entsize.
10844 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10845 and SHF_STRING if all input sections have those flags.
10846
3e1b9a8a
RÁE
108472009-12-29 Rafael Espindola <espindola@google.com>
10848
10849 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10850 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10851 reporting.
3e1b9a8a 10852
3dcad376
ST
108532009-12-29 Sriraman Tallam <tmsriram@google.com>
10854
10855 * options.cc (General_options::parse_version): Allow -v to exit
10856 without an error if there is nothing to link.
10857
084e2665
ILT
108582009-12-29 Ian Lance Taylor <iant@google.com>
10859
10860 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10861 using a version of gcc before 4.1.
10862 * configure: Rebuild.
10863
250acde3
CD
108642009-12-28 Chris Demetriou <cgd@google.com>
10865
10866 * attributes.cc (Output_attributes_section_data::do_write): Use
10867 std::vector::front rather than std::vector::data.
10868
99fff23b
ILT
108692009-12-28 Ian Lance Taylor <iant@google.com>
10870
10871 * symtab.h (class Symbol_table): Add enum Defined.
10872 * resolve.cc (Symbol_table::should_override): Add defined
10873 parameter. Change all callers. Test whether object is NULL
10874 before calling a method on it.
10875 (Symbol_table::report_resolve_problem): Add defined parameter.
10876 Change all callers.
10877 (Symbol_table::should_override_with_special): Likewise.
10878 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10879 parameter. Change all callers.
10880 (Symbol_table::do_define_in_output_data): Likewise.
10881 (Symbol_table::define_in_output_segment): Likewise.
10882 (Symbol_table::do_define_in_output_segment): Likewise.
10883 (Symbol_table::define_as_constant): Likewise.
10884 (Symbol_table::do_define_as_constant): Likewise.
10885 * script.h (class Symbol_assignment): Add is_defsym parameter to
10886 constructor; change all callers.
10887 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10888 parameter. Change all callers. Add is_defsym_ field.
10889 (class Parser_closure): Add parsing_defsym parameter to
10890 constructor; change all callers. Add parsing_defsym accessor
10891 function. Add parsing_defsym_ field.
10892
556bd683
ILT
108932009-12-28 Ian Lance Taylor <iant@google.com>
10894
10895 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10896 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10897
1782c879
ILT
108982009-12-23 Ian Lance Taylor <iant@google.com>
10899
10900 * i386.cc (Target_i386::do_calls_non_split): Recognize
10901 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10902 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10903 -fsplit-stack prologue when using %r11.
1782c879 10904
329ca2b1
ST
109052009-12-21 Sriraman Tallam <tmsriram@google.com>
10906
10907 * options.cc (General_options::parse_version): Make -v continue and do
10908 the link like GNU ld does.
10909
d675ff46
RÁE
109102009-12-17 Rafael Avila de Espindola <espindola@google.com>
10911
10912 * Makefile.am (CCFILES): Add timer.cc.
10913 (HFILES): Add timer.h.
10914 * configure.ac: Check for sysconf and times.
10915 * main.cc: include timer.h.
10916 (main): Use Timer instead of get_run_time.
10917 * timer.cc: New.
10918 * timer.h: New.
10919 * workqueue.cc: include timer.h.
10920 (Workqueue::find_and_run_task):
10921 Report user, sys and wall time.
10922 * Makefile.in: Regenerate.
10923 * config.in: Regenerate.
10924 * configure: Regenerate.
10925
d6344fb5
DK
109262009-12-16 Doug Kwan <dougkwan@google.com>
10927
10928 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10929 sections.
10930 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10931 relaxed input sections.
10932 * output.cc (Output_section::find_relaxed_input_section): Change
10933 return type to Output_relaxed_input_section pointer. Adjust code
10934 for new type of relaxed_input_section_map_.
10935 * output.h (Output_section::find_relaxed_input_section): Change
10936 return type to Output_relaxed_input_section pointer.
10937 (Output_section::Output_relaxed_input_section_by_input_section_map):
10938 New type.
10939 (Output_section::relaxed_input_section_map_): Change type to
10940 Output_section::Output_relaxed_input_section_by_input_section_map.
10941 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10942 input section.
10943
0e0d5469
ILT
109442009-12-15 Ian Lance Taylor <iant@google.com>
10945
10946 * layout.cc (Layout::create_shstrtab): Only write out after input
10947 sections if we are compressing debug sections.
10948
0649a889
ILT
109492009-12-15 Ian Lance Taylor <iant@google.com>
10950
10951 * archive.cc (Archive::add_symbols): Only look up a symbol without
10952 a version if there is, in fact, a version.
10953
2ea97941
ILT
109542009-12-14 Ian Lance Taylor <iant@google.com>
10955
10956 Revert -Wshadow changes, all changes from:
10957 2009-12-11 Doug Kwan <dougkwan@google.com>
10958 2009-12-11 Nick Clifton <nickc@redhat.com>
10959 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10960
b0eec2cc
DK
109612009-12-11 Doug Kwan <dougkwan@google.com>
10962
10963 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10964 due to -Wshadow.
10965 * attributes.cc (Object_attribute::size): Ditto.
10966 (Attributes_section_data::size): Ditto.
10967 (Attributes_section_data::Attributes_section_data): Ditto.
10968 (Output_attributes_section_data::do_write): Ditto.
10969 * attributes.h (Object_attribute::set_type): Ditto.
10970 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10971
91d6fa6a
NC
109722009-12-11 Nick Clifton <nickc@redhat.com>
10973
10974 * archive.cc: Fix shadowed variable warnings.
10975 * arm.cc: Likewise.
10976 * compressed_output.cc: Likewise.
10977 * compressed_output.h: Likewise.
10978 * configure: Likewise.
10979 * dwarf_reader.cc: Likewise.
10980 * dynobj.cc: Likewise.
10981 * dynobj.h: Likewise.
10982 * ehframe.cc: Likewise.
10983 * ehframe.h: Likewise.
10984 * errors.cc: Likewise.
10985 * expression.cc: Likewise.
10986 * fileread.cc: Likewise.
10987 * fileread.h: Likewise.
10988 * freebsd.h: Likewise.
10989 * i386.cc: Likewise.
10990 * icf.cc: Likewise.
10991 * incremental.h: Likewise.
10992 * layout.cc: Likewise.
10993 * layout.h: Likewise.
10994 * mapfile.cc: Likewise.
10995 * merge.cc: Likewise.
10996 * merge.h: Likewise.
10997 * object.cc: Likewise.
10998 * object.h: Likewise.
10999 * options.h: Likewise.
11000 * output.cc: Likewise.
11001 * output.h: Likewise.
11002 * parameters.cc: Likewise.
11003 * plugin.cc: Likewise.
11004 * powerpc.cc: Likewise.
11005 * reduced_debug_output.cc: Likewise.
11006 * reduced_debug_output.h: Likewise.
11007 * reloc.cc: Likewise.
11008 * reloc.h: Likewise.
11009 * resolve.cc: Likewise.
11010 * script-sections.cc: Likewise.
11011 * script.cc: Likewise.
11012 * script.h: Likewise.
11013 * sparc.cc: Likewise.
11014 * symtab.cc: Likewise.
11015 * symtab.h: Likewise.
11016 * target-select.cc: Likewise.
11017 * target-select.h: Likewise.
11018 * token.h: Likewise.
11019 * workqueue.cc: Likewise.
11020 * workqueue.h: Likewise.
11021 * x86_64.cc: Likewise.
11022
a0351a69
DK
110232009-12-10 Doug Kwan <dougkwan@google.com>
11024
11025 * arm.cc (attributes.h): New include.
11026 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11027 (Arm_relobj::~Arm_relobj): Delete object pointed by
11028 attributes_section_data_.
11029 (Arm_relobj::attributes_section_data): New method definition.
11030 (Arm_relobj::attributes_section_data_): New data member declaration.
11031 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11032 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11033 attributes_section_data_.
11034 (Arm_dynobj::attributes_section_data): New method definition.
11035 (Arm_dynobj::attributes_section_data_): New data member declaration.
11036 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11037 initialization value of may_use_blx_ to false.
2e702c99 11038 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11039 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11040 object attributes to compute results instead of hard-coding.
11041 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11042 Target_arm::get_secondary_compatible_arch,
11043 Target_arm::set_secondary_compatible_arch
11044 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11045 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11046 New method declarations.
11047 (Target_arm::get_aeabi_object_attribute): New method definition.
11048 (Target_arm::attributes_section_data_): New data member declaration.
11049 (read_arm_attributes_section): New template definition.
11050 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11051 (Arm_dynobj::do_read_symbols): Ditto.
11052 (Target_arm::do_finalize_sections): Merge attributes sections from
11053 input. Check for BLX use after attributes section merging.
11054 Fix __exidx_start and __exidx_end visibility. Create an
11055 .ARM.attributes section if necessary.
11056 (Target_arm::get_secondary_compatible_arch,
11057 Target_arm::set_secondary_compatible_arch,
11058 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11059 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11060 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11061 New method definitions.
11062
b59befec
ILT
110632009-12-09 Ian Lance Taylor <iant@google.com>
11064
11065 * plugin.cc (Plugin::load): Don't cast from void* to a function
11066 pointer.
11067
1276bc89
ILT
110682009-12-09 Ian Lance Taylor <iant@google.com>
11069
11070 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11071 information fields.
11072
2f2de248
L
110732009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11074
11075 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11076 Replace two_file_shared_1.so with two_file_shared_2.so.
11077 * testsuite/Makefile.in: Regenerated.
11078
4f787271
DK
110792009-12-08 Doug Kwan <dougkwan@google.com>
11080
11081 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11082 (HFILES): Add attributes.h and int_encoding.h.
11083 * Makefile.in: Regenerate.
11084 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11085 function definitions to int_encoding.cc
11086 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11087 prototypes to int_encoding.h
11088 * reduced_debug_output.cc (int_encoding.h): New include.
11089 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11090 function definitions to int_encoding.cc
11091 (insert_into_vector, read_from_pointer): Move template definitions to
11092 int_encoding.h
11093 * attributes.cc: New file.
11094 * attributes.h: New file.
11095 * int_encoding.cc: New file.
11096 * int_encoding.h: New file.
11097
20b52f1a
RÁE
110982009-12-07 Rafael Avila de Espindola <espindola@google.com>
11099
11100 PR gold/11055
11101 * incremental-dump.cc (dump_incremental_inputs): New.
11102 (main): Use dump_incremental_inputs.
11103
53d7974c
L
111042009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11105
11106 PR gold/10893
11107 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11108 checking elfcpp::STT_FUNC.
11109 (Target_i386::Relocate::relocate): Likewise.
11110 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11111
11112 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11113 symbols from shared libraries into normal FUNC symbols.
11114
11115 * symtab.h (Symbol): Add is_func and use it.
11116
05a352e6
DK
111172009-12-05 Doug Kwan <dougkwan@google.com>
11118
11119 * arm.cc (Target_arm::arm_info): Initialize new fields
11120 attributes_section and attributes_vendor.
11121 * i386.cc (Target_i386::i386_info): Same.
11122 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11123 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11124 fields attributes_section and attributes_vendor.
53d7974c 11125 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11126 * target.h (Target::attributes_section, Target::attributes_vendor,
11127 Target::is_attributes_section, Target::attribute_arg_type,
11128 Target::attributes_order): New method definitions.
11129 (Target::Target_info::attributes_section,
11130 Target::Target_info::attributes_vendor): New fields.
11131 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11132 virtual method definitions.
11133 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11134 attributes_section and attributes_vendor.
11135 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11136
f4e5969c
DK
111372009-12-05 Doug Kwan <dougkwan@google.com>
11138
11139 * arm.cc: Update comments about interworking and stub generation.
11140 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11141 considered as non-PIC.
11142 (Arm_relocate_functions::base_abs): Fix formatting.
11143 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11144 of function to use GOT entry address instead of offset.
11145 (Target_arm::Scan::global): Issue an error if a symbol would need a
11146 PLT does not get one because it is untyped. Remove code to create
11147 dynamic symbols for relative branches.
11148 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11149 takes unsigned integer instead of boolean.
11150
1abce4a6
L
111512009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11152
11153 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11154 (two_file_test_LDADD): Likewise.
11155 (common_test_1_LDADD): Likewise.
11156 (exception_test_LDADD) Likewise.
11157 (weak_test_LDADD): Likewise.
11158 (many_sections_test_LDADD): Likewise.
11159 (initpri1_LDADD): Likewise.
11160 (script_test_1_LDADD): Likewise.
11161 (script_test_2_LDADD): Likewise.
11162 (justsyms_LDADD): Likewise.
11163 (binary_test_LDADD): Likewise.
11164 (large_LDADD): Likewise.
11165 * testsuite/Makefile.in: Regenerated.
11166
adcf2816 111672009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11168
adcf2816
L
11169 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11170 (Symbol_table::override_with_special): Likewise.
11171 (Symbol_table::add_from_object): Likewise.
11172
28e67f5d
RÁE
111732009-12-04 Rafael Avila de Espindola <espindola@google.com>
11174
11175 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11176 Don't set the data_offset twice.
11177
ae10a101
RÁE
111782009-12-04 Rafael Avila de Espindola <espindola@google.com>
11179
11180 * testsuite/Makefile.in: Regenerate.
11181
f59f41f3
DK
111822009-12-03 Doug Kwan <dougkwan@google.com>
11183
11184 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11185 (Target_arm::do_finalize_sections): Add parameter for symbol table
11186 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11187 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11188 parameter for symbol table pointer.
11189 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11190 an additional parameter for a pointer to symbol table.
11191 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11192 parameter for a symbol table pointer.
11193 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11194 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11195 Ditto.
11196 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11197 parameter for a symbol table pointer.
11198
ca55d848
RÁE
111992009-12-03 Rafael Avila de Espindola <espindola@google.com>
11200
11201 * incremental.cc (Incremental_inputs_header)
11202 (Incremental_inputs_header_write, Incremental_inputs_entry)
11203 (Incremental_inputs_entry_write): Move ...
11204 * incremental.h (Incremental_inputs_header)
11205 (Incremental_inputs_header_write, Incremental_inputs_entry)
11206 (Incremental_inputs_entry_write): here.
11207
3aec4f9c
RÁE
112082009-12-02 Rafael Avila de Espindola <espindola@google.com>
11209
11210 * incremental.cc (make_sized_incremental_binary): Set the target.
11211 Error if it is incompatible.
11212 * output.h (Output_file): Add filename method.
11213
9c0ae74d
RÁE
112142009-12-02 Rafael Avila de Espindola <espindola@google.com>
11215
11216 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11217 from the get_* methods.
11218
a45500ae
RÁE
112192009-12-02 Rafael Avila de Espindola <espindola@google.com>
11220
11221 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11222 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11223 Write 0 for the data_offset of scripts.
11224
325e6408
RÁE
112252009-12-02 Rafael Avila de Espindola <espindola@google.com>
11226
11227 * testsuite/Makefile.am: Add the incremental_test.sh test.
11228 * testsuite/incremental_test.sh: New.
11229 * testsuite/incremental_test_1.c: New.
11230 * testsuite/incremental_test_2.c: New.
11231
954c3e2e
RÁE
112322009-12-01 Rafael Avila de Espindola <espindola@google.com>
11233
703d02da 11234 * incremental-dump.cc (main): Fix typos.
954c3e2e 11235
f8086623
RÁE
112362009-11-27 Rafael Avila de Espindola <espindola@google.com>
11237
11238 PR gold/11025
11239 * incremental-dump.cc (main): Use llu to print 64 bit values.
11240
3b0dd6ac
L
112412009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11242 H.J. Lu <hongjiu.lu@intel.com>
11243
11244 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11245 $(LIBDL).
11246 (incremental_dump_LDADD): Likewise.
11247 * Makefile.in: Regenerated.
11248
a6d1ef57 112492009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11250
a6d1ef57
DK
11251 Revert:
11252
11253 2009-11-25 Doug Kwan <dougkwan@google.com>
11254
11255 * arm.cc (Target_arm::Target_arm): Move method definition
11256 outside of class definition. Add code to handle
11257 --target1-rel, --target1-abs and --target2= options.
11258 (Target_arm::get_reloc_reloc_type): Change method to be
11259 non-static and const.
11260 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11261 New data member declaration.
11262 (Target_arm::Scan::local, Target_arm::Scan::global,
11263 Target_arm::Relocate::relocate,
11264 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11265 Adjust call to Target_arm::get_real_reloc_type.
11266 (Target_arm::get_real_reloc_type): Use command line options
11267 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11268 * options.h (--target1-rel, --target1-abs, --target2): New
11269 ARM-only options.
11270
50aeb7d4
DK
112712009-11-25 Doug Kwan <dougkwan@google.com>
11272
11273 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11274 class definition. Add code to handle --target1-rel, --target1-abs
11275 and --target2= options.
11276 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11277 and const.
11278 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11279 member declaration.
11280 (Target_arm::Scan::local, Target_arm::Scan::global,
11281 Target_arm::Relocate::relocate,
11282 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11283 call to Target_arm::get_real_reloc_type.
11284 (Target_arm::get_real_reloc_type): Use command line options to
11285 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11286 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11287 options.
11288
51938283
DK
112892009-11-25 Doug Kwan <dougkwan@google.com>
11290
11291 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11292 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11293 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11294 formatting.
11295 (Arm_relocate_functions::thm_call): Replace body with a call to
11296 Arm_relocate_functions::thumb_branch_common.
11297 (Arm_relocate_functions::thm_jump24,
11298 Arm_relocate_functions::thm_xpc22): New method definitions.
11299 (Arm_relocate_functions::thumb_branch_common): New method definition.
11300 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11301 operator.
11302 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11303 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11304
e2b8f3c4
RÁE
113052009-11-24 Rafael Avila de Espindola <espindola@google.com>
11306
11307 * Makefile.am: Build incremental-dump
11308 * Makefile.in: Regenerate.
11309 * incremental-dump.cc: New.
11310 * incremental.cc (Incremental_inputs_header_data,
11311 Incremental_inputs_entry_data): Move to incremental.h
11312 * incremental.h: (Incremental_inputs_header_data,
11313 Incremental_inputs_entry_data): Move from incremental.cc
11314
bcba9aec
RÁE
113152009-11-24 Rafael Avila de Espindola <espindola@google.com>
11316
11317 * incremental.cc (Incremental_inputs_header,
11318 Incremental_inputs_header_write, Incremental_inputs_entry,
11319 Incremental_inputs_entry_write): Add a typedef with the data type.
11320
7c3afe08
RÁE
113212009-11-24 Rafael Avila de Espindola <espindola@google.com>
11322
11323 * incremental.cc (Incremental_inputs_header,
11324 Incremental_inputs_header_write, Incremental_inputs_entry,
11325 Incremental_inputs_entry_write): Update comment about which
11326 type has the filed descriptions.
11327
d204b6e9
DK
113282009-11-15 Doug Kwan <dougkwan@google.com>
11329
11330 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11331 (Arm_relocate_functions::arm_branch_common): Change method defintion
11332 in class definition to a method declaration and update list of formal
11333 parameters.
11334 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11335 Arm_relocation_functions::jump24): Adjust call to
11336 Arm_relocate_functions::arm_branch_common. Update list of formal
11337 parameters.
11338 (Arm_relocate_functions::xpc25): New method definition.
11339 (Arm_relocate_functions::arm_branch_common): Move method defintion
11340 out from class definition. Use stubs for mode-switching and extending
11341 branch ranges.
11342 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11343 specially. Change code to enable use of stubs in ARM branches.
11344
43d12afe
DK
113452009-11-10 Doug Kwan <dougkwan@google.com>
11346
11347 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11348 in method declaration.
11349 (Target_arm::relocate_stub): New method declaration.
11350 (Target_arm::default_target): Change to return a pointer instead of
11351 a const reference.
11352 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11353 Target_arm::default_target.
11354 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11355 method definition.
11356 (Target_arm::relocate_section): Adjust view.
11357 (Target_arm::relocate_stub): New method definition.
11358
ac33a407
DK
113592009-11-10 Doug Kwan <dougkwan@google.com>
11360
11361 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11362 a format warning.
11363 * incremental.cc (open_incremental_binary): Initialized local
11364 variables to avoid warnings.
11365 * object.cc (make_elf_object): Ditto.
11366 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11367 a format warning.
e1df38aa 11368
88ee28e9
L
11369009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11370
11371 PR gold/10930
11372 * testsuite/plugin_test.c: Include "config.h".
11373
2daedcd6
DK
113742009-11-09 Doug Kwan <dougkwan@google.com>
11375
11376 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11377 (arm_symbol_value): Remove.
11378 (Arm_relocate_functions::arm_branch_common,
11379 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11380 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11381 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11382 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11383 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11384 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11385 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11386 Arm_relocate_functions::thm_mobw_abs_nc,
11387 Arm_relocate_functions::thm_mov_abs,
11388 Arm_relocate_functions::movw_prel_nc,
11389 Arm_relocate_functions::thm_movt_abs,
11390 Arm_relocate_functions::movt_prel,
11391 Arm_relocate_functions::thm_movw_prel_nc,
11392 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11393 (Target_arm::Relocate::relocate): Only decompose address into two
11394 parts if relocation type uses the thumb-bit and pass the actual
11395 bit instead of a flag indicating that the thumb-bit is used. Adjust
11396 calls to methods in Arm_relocate_functions for this change.
11397
1276bc89 113982009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11399
11400 PR 10925
11401 * reloc.cc: Instantiate
11402 Sized_relobj::initialize_input_to_output_maps and
11403 Sized_relobj:free_input_to_output_maps.
11404
e53ad1b5
ILT
114052009-11-06 Ian Lance Taylor <iant@google.com>
11406
11407 PR 10876
11408 * defstd.cc (in_segment): Set only_if_ref true for "end".
11409
eb44217c
DK
114102009-11-06 Doug Kwan <dougkwan@google.com>
11411
11412 * arm.cc (class Reloc_stub): Correct a comment.
11413 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11414 (Target_arm::scan_section_for_stubs): New method declaration.
11415 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11416 Change methods from private to protected.
11417 (Target_arm::do_may_relax): New method definition.
11418 (Target_arm::do_relax, Target_arm::group_sections,
11419 Target_arm::scan_reloc_for_stub,
11420 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11421 (Target_arm::arm_input_section_map_): New data member declaration.
11422 (Target_arm::scan_reloc_for_stub,
11423 Target_arm::scan_reloc_section_for_stubs,
11424 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11425 Target_arm::do_relax): New method definitions.
11426
5d329b7d
ILT
114272009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11428
11429 * configure.ac: Check for (struct stat)::st_mtim
11430 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11431 * config.in: Regenerate.
11432 * configure: Regenerate.
11433
96a0d71b
ILT
114342009-11-05 Ian Lance Taylor <iant@google.com>
11435
11436 PR 10910
11437 * output.cc (Output_segment::add_output_section): Add missing
11438 return statement.
11439
594c8e5e
ILT
114402009-11-04 Ian Lance Taylor <iant@google.com>
11441
11442 PR 10880
11443 * object.h (class Object): Add is_needed and set_is_needed
11444 methods. Add is_needed_ field. Make bool fields into bitfields.
11445 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11446 defined in a dynamic object and referenced by a regular object,
11447 set is_needed for the dynamic object.
11448 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11449 if the file is marked with as_needed and it is not needed.
11450
22b127cc
ILT
114512009-11-04 Ian Lance Taylor <iant@google.com>
11452
11453 PR 10887
11454 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11455 tags if data is discarded by linker script.
11456 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11457 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11458 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11459 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11460
f5c870d2
ILT
114612009-11-04 Ian Lance Taylor <iant@google.com>
11462
11463 * layout.cc (Layout::get_output_section): Add is_interp and
11464 is_dynamic_linker_section parameters. Change all callers.
11465 (Layout::choose_output_section): Likewise.
11466 (Layout::make_output_section): Likewise.
11467 (Layout::add_output_section_data): Add is_dynamic_linker_section
11468 parameter. Change all callers.
11469 * layout.h (class Layout): Update declarations.
11470 * output.h (class Output_section): Add is_interp, set_is_interp,
11471 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11472 Add is_interp_, is_dynamic_linker_section_ fields. Change
11473 generate_code_fills_at_write_ to a bitfield.
11474 * output.cc (Output_section::Output_sections): Initialize new
11475 fields.
11476 (Output_segment::add_output_section): Add do_sort parameter.
11477 Change all callers.
11478
1ae4d23b
ILT
114792009-11-03 Ian Lance Taylor <iant@google.com>
11480
11481 PR 10860
11482 * options.h (class General_options): Add --warn-common.
11483 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11484 merging two common symbols.
11485 (Symbol_table::should_override): Handle --warn-common when merging
11486 a common symbol with a defined symbol. Use report_resolve_problem
11487 for multiple definitions.
11488 (Symbol_table::report_resolve_problem): New function.
11489 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11490
55da9579
DK
114912009-11-03 Doug Kwan <dougkwan@google.com>
11492
11493 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11494 stub_factory_.
11495 (Target_arm::stub_factory): New method definition.
11496 (Target_arm::new_arm_input_section,
11497 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11498 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11499 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11500 New type definitions.
11501 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11502 member declarations.
11503 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11504 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11505 New method definitions.
11506
37a9ac43
ILT
115072009-11-03 Ian Lance Taylor <iant@google.com>
11508
11509 * options.h (class General_options): Add --warn_constructors.
11510
b3d6a3d4
ILT
115112009-11-03 Ian Lance Taylor <iant@google.com>
11512
11513 PR 10893
11514 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11515 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11516
934b01dd
ILT
115172009-11-03 Ian Lance Taylor <iant@google.com>
11518
11519 PR 10895
11520 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11521 --msgid-bugs-address.
11522 (install-pdf): New target.
11523 (install-data_yes): Look up one directory to find mkinstalldirs.
11524
03c1939b
L
115252009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11526
11527 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11528 tree.
11529
ebd95253
DK
115302009-10-30 Doug Kwan <dougkwan@google.com>
11531
11532 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11533
e9bbb538
DK
115342009-10-30 Doug Kwan <dougkwan@google.com>
11535
11536 * arm.cc (Stub_addend_reader): New struct template definition
11537 and partial specializations.
11538 (Stub_addend_reader::operator()): New method definition for a
11539 partially specialized template.
11540
d5b40221
DK
115412009-10-30 Doug Kwan <dougkwan@google.com>
11542
11543 * arm.cc (Arm_relobj::processor_specific_flags): New method
11544 definition.
11545 (Arm_relobj::do_read_symbols): New method declaration.
11546 (Arm_relobj::processor_specific_flags_): New data member declaration.
11547 (Arm_dynobj): New class definition.
11548 (Target_arm::do_finalize_sections): Add input_objects parameter.
11549 (Target_arm::do_adjust_elf_header): New method declaration.
11550 (Target_arm::are_eabi_versions_compatible,
11551 (Target_arm::merge_processor_specific_flags): New method declaration.
11552 (Target_arm::do_make_elf_object): New overloaded method definitions
11553 and declaration.
11554 (Arm_relobj::do_read_symbols): New method definition.
11555 (Arm_dynobj::do_read_symbols): Ditto.
11556 (Target_arm::do_finalize_sections): Add input_objects parameters.
11557 Merge processor-specific flags from all input objects.
11558 (Target_arm::are_eabi_versions_compatible,
11559 Target_arm::merge_processor_specific_flags,
11560 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11561 New method definitions.
11562 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11563 Input_objects pointer type parameter.
11564 * layout.cc (Layout::finalize): Pass input objects to target's.
11565 finalize_sections function.
11566 * output.cc (Output_file_header::do_sized_write): Set ELF file
11567 header's processor-specific flags.
11568 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11569 Input_objects pointer type parameter.
11570 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11571 * target.h (Input_objects): New forward class declaration.
11572 (Target::processor_specific_flags,
11573 Target::are_processor_specific_flags_sect): New method definitions.
11574 (Target::finalize_sections): Add input_objects parameter.
11575 (Target::Target): Initialize processor_specific_flags_ and
11576 are_processor_specific_flags_set_.
11577 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11578 parameter.
11579 (Target::set_processor_specific_flags): New method definition.
11580 (Target::processor_specific_flags_,
11581 Target::are_processor_specific_flags_set_): New data member
11582 declarations.
11583 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11584 Input_objects pointer type parameter.
11585
ebabffbd
DK
115862009-10-30 Doug Kwan <dougkwan@google.com>
11587
11588 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11589
ad0f2072
ILT
115902009-10-28 Ian Lance Taylor <iant@google.com>
11591
11592 * object.h (class Relobj): Drop options parameter from
11593 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11594 do_scan_relocs, do_relocate. Change all callers.
11595 (class Sized_relobj): Drop options parameters from
11596 do_gc_process_relocs, do_scan_relocs, do_relocate,
11597 do_relocate_sections, relocate_sections, emit_relocs_scan,
11598 emit_relocs_scan_reltype. Change all callers.
11599 (struct Relocate_info): Remove options field and all references to
11600 it.
11601 * reloc.h (class Read_relocs): Remove options constructor
11602 parameter and options_ field. Change all callers.
11603 (class Gc_process_relocs, class Scan_relocs): Likewise.
11604 (class Relocate_task): Likewise.
11605 * target-reloc.h (scan_relocs): Remove options parameter. Change
11606 all callers.
11607 (scan_relocatable_relocs): Likewise.
11608 * target.h (class Sized_target): Remove options parameter from
11609 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11610 all callers.
11611 * gc.h (gc_process_relocs): Remove options parameter. Change all
11612 callers.
11613 * arm.cc: Update functions to remove options parameters.
11614 * i386.cc: Likewise.
11615 * powerpc.cc: Likewise.
11616 * sparc.cc: Likewise.
11617 * x86_64.cc: Likewise.
11618 * testsuite/testfile.cc: Likewise.
11619
8ffa3667
DK
116202009-10-28 Doug Kwan <dougkwan@google.com>
11621
11622 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11623 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11624 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11625 New method definitions.
11626
40f36857
CC
116272009-10-28 Cary Coutant <ccoutant@google.com>
11628
11629 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11630 (Plugin::cleanup_done_): New member.
11631 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11632 (Plugin_manager::cleanup_done_): Remove.
11633 (Plugin_manager::add_input_file): Edit error message.
11634 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11635 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11636
2c849493
ILT
116372009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11638
11639 * fileread.cc: (File_read::View::~View): Use the new
11640 data_ownership_ filed.
11641 (File_read::~File_read): Dispose the new whole_file_view_.
11642 (File_read::open): Mmap the whole file if needed.
11643 (File_read::open): Use whole_file_view_ instead of contents_.
11644 (File_read::find_view): Use whole_file_view_ if applicable.
11645 (File_read::do_read): Use whole_file_view_ instead of contents_.
11646 (File_read::make_view): Use whole_file_view_ instead of contents_,
11647 update File_read::View::View call.
11648 (File_read::find_or_make_view): Update File_read::View::View
11649 call.
11650 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11651 remove contents_
11652 (File_read::View::Data_ownership): New enum.
11653 (File_read::View::View): Replace bool mapped_ with Data_ownership
11654 argument.
11655 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11656 (File_read::View::data_ownership_): New field.
11657 (File_read::contents_): Remove (replaced by whole_file_view_).
11658 (File_read::whole_file_view_): New field.
11659 * options.h (class General_options): Add --keep-files-mapped.
11660
24998053
CC
116612009-10-27 Cary Coutant <ccoutant@google.com>
11662
11663 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11664 * testsuite/Makefile.am (plugin_test_5): New test case.
11665 * testsuite/Makefile.in: Regenerate.
11666
72adc4fa
DK
116672009-10-25 Doug Kwan <dougkwan@google.com>
11668
11669 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11670 from private to protected to allow access by child class.
11671 (Sized_relobj::do_relocate_sections): New method declaration.
11672 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11673 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11674 Sized_relobj::relocate_sections. Instantiate template explicitly
11675 for different target sizes and endianity.
11676
07f508a2
DK
116772009-10-24 Doug Kwan <dougkwan@google.com>
11678
11679 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11680 (Arm_input_section::as_arm_input_section): New method.
11681 (Arm_output_section): New class definition.
11682 (Arm_output_section::create_stub_group,
11683 Arm_output_section::group_sections): New method definitions.
11684
10ad9fe5
DK
116852009-10-22 Doug Kwan <dougkwan@google.com>
11686
11687 * arm.cc (Arm_input_section): New class definition.
11688 (Arm_input_section::init, Arm_input_section:do_write,
11689 Arm_input_section::set_final_data_size,
11690 Arm_input_section::do_reset_address_and_file_offset): New method
11691 definitions.
11692
56ee5e00
DK
116932009-10-21 Doug Kwan <dougkwan@google.com>
11694
11695 * arm.cc (Stub_table, Arm_input_section): New forward class
11696 declarations.
11697 (Stub_table): New class defintion.
11698 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11699 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11700 New method definition.
11701
b569affa
DK
117022009-10-21 Doug Kwan <dougkwan@google.com>
11703
11704 * arm.cc: Update copyright comments.
11705 (Target_arm): New forward class template declaration.
11706 (Arm_address): New type.
11707 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11708 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11709 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11710 constants.
11711 (Insn_template): Same.
11712 (DEF_STUBS): New macro.
11713 (Stub_type): New enum type.
11714 (Stub_template): New class definition.
11715 (Stub): Same.
11716 (Reloc_stub): Same.
11717 (Stub_factory): Same.
11718 (Target_arm::Target_arm): Initialize may_use_blx_ and
11719 should_force_pic_veneer_.
11720 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11721 Target_arm::should_force_pic_veneer,
11722 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11723 Target_arm::using_thumb_only, Target_arm:;default_target): New
11724 method defintions.
11725 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11726 New data member declarations.
11727 (Insn_template::size, Insn_template::alignment): New method defintions.
11728 (Stub_template::Stub_template): New method definition.
11729 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11730 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11731 (Stub_factory::Stub_factory): New method definition.
11732 * gold.h (string_hash): New template.
11733 * output.h (Input_section_specifier::hash_value): Use
11734 gold::string_hash.
11735 (Input_section_specifier::string_hash): Remove.
11736 * stringpool.cc (Stringpool_template::string_hash): Use
11737 gold::string_hash.
11738
6c172549
DK
117392009-10-20 Doug Kwan <dougkwan@google.com>
11740
11741 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11742 symbols of relaxed input sections.
11743 * output.h (Output_section::find_relaxed_input_section): Make
11744 method public.
11745
c5617f2f
DK
117462009-10-16 Doug Kwan <dougkwan@google.com>
11747
11748 * dynobj.cc (Versions::Versions): Initialize version_script_.
11749 Only insert base version symbol definition for a shared object
11750 if version script defines any version versions.
11751 (Versions::define_base_version): New method definition.
11752 (Versions::add_def): Check that base version is not needed.
11753 (Versions::add_need): Define base version lazily.
11754 * dynobj.h (Versions::define_base_version): New method declaration.
11755 (Versions::needs_base_version_): New data member declaration.
11756 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11757 (check_DATA): Add no_version_test.stdout.
11758 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11759 New make rules.
11760 * testsuite/Makefile.in: Regenerate.
11761 * testsuite/no_version_test.c: New file.
11762 * testsuite/no_version_test.sh: Ditto.
11763
3c12dcdb
DK
117642009-10-16 Doug Kwan <dougkwan@google.com>
11765
11766 * expression.cc (class Segment_start_expression): New class definition.
11767 (Segment_start_expression::value): New method definition.
11768 (script_exp_function_segment_start): Return a new
11769 Segment_start_expression.
11770 * gold/script-c.h (script_saw_segment_start_expression): New function
11771 prototype.
11772 * script-sections.cc (Script_sections::Script_sections): Initialize
11773 SAW_SEGMENT_START_EXPRESSION_ to false.
11774 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11775 and -Tbbs options to specify section addresses if given in
11776 command line and no SEGMENT_START expression is seen in a script.
11777 * script-sections.h (Script_sections::saw_segment_start_expression,
11778 Script_sections::set_saw_segment_start_expression): New method
11779 definition.
11780 (Script_sections::saw_segment_start_expression_): New data member
11781 declaration.
11782 * script.cc (script_saw_segment_start_expression): New function.
11783 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11784 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11785 script_test_7.sh and script_test_8.sh.
11786 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11787 script_test_8.stdout.
11788 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11789 (script_test_6, script_test_6.stdout, script_test_7,
11790 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11791 * Makefile.in: Regenerate.
11792 * testsuite/script_test_6.sh: New file.
11793 * testsuite/script_test_6.t: Same.
11794 * testsuite/script_test_7.sh: Same.
11795 * testsuite/script_test_7.t: Same.
11796 * testsuite/script_test_8.sh: Same.
11797
64b1ae37
DK
117982009-10-16 Doug Kwan <dougkwan@google.com>
11799
11800 * output.cc (Output_segment::set_section_list_address): Cast
11801 expressions to unsigned long long type to avoid format warnings.
11802
661be1e2
ILT
118032009-10-15 Ian Lance Taylor <iant@google.com>
11804
12edd763 11805 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11806 dot assignment to script_sections_.
12edd763
ILT
11807 * script-sections.cc (Script_sections::add_dot_assignment):
11808 Initialize if necessary.
11809
68b6574b
ILT
11810 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11811 program headers with no load segment if there is a linker script.
11812
661be1e2
ILT
11813 * layout.cc (Layout::set_segment_offsets): Align the file offset
11814 to the segment aligment for -N or -n with no load segment.
11815 * output.cc (Output_segment::add_output_section): Don't crash if
11816 the first section is a TLS section.
11817 (Output_segment::set_section_list_addresses): Print an error
11818 message if the address moves backward in a linker script.
11819 * script-sections.cc
11820 (Output_section_element_input::set_section_addresses): Don't
11821 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11822 (Orphan_output_section::set_section_addresses): Likewise.
11823
f15f61a7
DK
118242009-10-15 Doug Kwan <dougkwan@google.com>
11825
11826 * layout.cc (Layout::finish_dynamic_section): Generate tags
11827 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11828 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11829 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11830
82bb573a
ILT
118312009-10-14 Ian Lance Taylor <iant@google.com>
11832
11833 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11834 fields.
11835 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11836 data_shdr fields of relinfo.
11837 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11838 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11839 R_386_TLS_LDO_32, adjust based on section flags.
11840 (Target_i386::Relocate::fix_up_ldo): Remove.
11841
374ad285
ILT
118422009-10-13 Ian Lance Taylor <iant@google.com>
11843
11844 Add support for -pie.
11845 * options.h (class General_options): Add -pie and
11846 --pic-executable.
11847 (General_options::output_is_position_independent): Test -pie.
11848 (General_options::output_is_executable): Return true if not shared
11849 and not relocatable.
11850 (General_options::output_is_pie): Remove.
11851 * options.cc (General_options::finalize): Reject incompatible uses
11852 of -pie.
11853 * gold.cc (queue_middle_tasks): A -pie link is not static.
11854 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11855 * symtab.cc (Symbol::final_value_is_known): Return false if
11856 output_is_position_independent.
11857 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11858 output_is_position_independent.
11859 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11860 output_is_position_independent.
11861 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11862 output_is_position_independent.
11863 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11864 two_file_pie_test.
11865 (basic_pie_test.o, basic_pie_test): New targets.
11866 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11867 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11868 (two_file_pie_test): New target.
11869 * testsuite/Makefile.in: Rebuild.
11870 * README: Remove note saying that -pie is not supported.
11871
c6585162
ILT
118722009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11873
11874 * options.h (class General_options): Add -init and -fini.
11875 * layout.cc (Layout::finish_dynamic_section): Emit
11876 given init and fini functions.
11877
032ce4e9
ST
118782009-10-13 Sriraman Tallam <tmsriram@google.com>
11879
11880 * gc.h (gc_process_relocs): Check if icf is enabled using new
11881 function.
11882 * gold.cc (queue_initial_tasks): Likewise.
11883 (queue_middle_tasks): Likewise.
11884 * object.cc (do_layout): Likewise.
11885 * symtab.cc (is_section_folded): Likewise.
11886 * main.cc (main): Likewise.
11887 * reloc.cc (Read_relocs::run): Likewise.
11888 (Sized_relobj::do_scan_relocs): Likewise.
11889 * icf.cc (is_function_ctor_or_dtor): New function.
11890 (Icf::find_identical_sections): Check if function is ctor or dtor when
11891 safe icf is chosen.
11892 * options.h (General_options::icf): Change option to be an enum.
11893 (Icf_status): New enum.
11894 (icf_enabled): New method.
11895 (icf_safe_folding): New method.
11896 (set_icf_status): New method.
11897 (icf_status_): New variable.
11898 * (options.cc) (General_options::finalize): Set icf_status_.
11899 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11900 icf_test and icf_keep_unique_test to use the --icf enum flag.
11901 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11902 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11903
f345227a
ST
119042009-10-12 Sriraman Tallam <tmsriram@google.com>
11905
11906 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11907 includes to gc.h and icf.h.
11908 * arm.cc: Include gc.h.
11909 * gold.cc: Likewise.
11910 * i386.cc: Likewise.
11911 * powerpc.cc: Likewise.
11912 * sparc.cc: Likewise.
11913 * x86_64.cc: Likewise.
11914 * gc.h: Include icf.h.
11915
1c7814ed
ILT
119162009-10-11 Ian Lance Taylor <iant@google.com>
11917
11918 * plugin.cc: Include "gold.h" before other header files.
11919
ae3b5189
CD
119202009-10-10 Chris Demetriou <cgd@google.com>
11921
11922 * options.h (Input_file_argument::Input_file_type): New enum.
11923 (Input_file_argument::is_lib_): Replace with...
11924 (Input_file_argument::type_): New member.
11925 (Input_file_argument::Input_file_argument): Take Input_file_type
11926 'type' rather than boolean 'is_lib' as second argument.
11927 (Input_file_argument::is_lib): Use type_.
11928 (Input_file_argument::is_searched_file): New function.
11929 (Input_file_argument::may_need_search): Handle is_searched_file.
11930 * options.cc (General_options::parse_library): Support -l:filename.
11931 (General_options::parse_just_symbols): Update for Input_file_argument
11932 changes.
11933 (Command_line::process): Likewise.
11934 * archive.cc (Archive::get_file_and_offset): Likewise.
11935 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11936 * script.cc (read_script_file, script_add_file): Likewise.
11937 * fileread.cc (Input_file::Input_file): Likewise.
11938 (Input_file::will_search_for): Handle is_searched_file.
11939 (Input_file::open): Likewise.
11940 * readsyms.cc (Read_symbols::get_name): Likewise.
11941 * testsuite/Makefile.am (searched_file_test): New test.
11942 * testsuite/Makefile.in: Regenerate.
11943 * testsuite/searched_file_test.cc: New file.
11944 * testsuite/searched_file_test_lib.cc: New file.
11945
f3048a1d
ILT
119462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11947 Ian Lance Taylor <iant@google.com>
11948
11949 * descriptor.cc: Include <cstdio> and "binary-io.h".
11950 (Descriptors::open): Open the files in binary mode always.
11951 * script.cc (Lex::get_token): Treat \r as whitespace.
11952
d4780e57
ILT
119532009-10-09 Ian Lance Taylor <iant@google.com>
11954
11955 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11956
d9a893b8
ILT
119572009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11958 Ian Lance Taylor <iant@google.com>
11959
11960 * configure.ac: Check for readv function also.
11961 * fileread.cc (readv): Define if not HAVE_READV.
11962 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11963 does not exist.
11964 * config.in: Regenerate.
11965 * configure: Regenerate.
11966
c0a62865
DK
119672009-10-09 Doug Kwan <dougkwan@google.com>
11968
11969 * layout.cc (Layout::make_output_section): Call target hook to make
11970 ordinary output section.
11971 (Layout::finalize): Adjust parameter list of call the
11972 Target::may_relax().
11973 * layout.h (class Layout::section_list): New method.
11974 * merge.h (Output_merge_base::entsize): Change visibility to public.
11975 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11976 New methods.
11977 (Output_merge_string::do_is_string): New method.
11978 * object.cc (Sized_relobj::do_setup): renamed from
11979 Sized_relobj::set_up.
11980 * object.h (Sized_relobj::adjust_shndx,
11981 Sized_relobj::initializ_input_to_output_maps,
11982 Sized_relobj::free_input_to_output_maps): Change visibilities to
11983 protected.
11984 (Sized_relobj::setup): Virtualize.
11985 (Sized_relobj::do_setup): New method declaration.
11986 (Sized_relobj::invalidate_section_offset,
11987 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11988 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11989 * options.cc (parse_int): New function.
11990 * options.h (parse_int): New declaration.
11991 (DEFINE_int): New macro.
11992 (stub_group_size): New option.
11993 * output.cc (Output_section::Output_section): Initialize memebers
11994 merge_section_map_, merge_section_by_properties_map_,
11995 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11996 (Output_section::add_input_section): Handled deferred code-fill
11997 generation and remove an old comment.
11998 (Output_section::add_relaxed_input_section): New method definition.
11999 (Output_section::add_merge_input_section): Use merge section by
12000 properties map to speed to search. Update merge section maps
12001 as appropriate.
12002 (Output_section::build_relaxation_map): New method definition.
12003 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12004 Same.
12005 (Output_section::relax_input_section): Renamed to
12006 Output_section::convert_input_sections_to_relaxed_sections and change
12007 interface to take a vector of pointers to relaxed sections.
12008 (Output_section::find_merge_section,
12009 Output_section::find_relaxed_input_section): New method definitions.
12010 (Output_section::is_input_address_mapped,
12011 Output_section::output_offset, Output_section::output_address):
12012 Use output section data maps to speed up searching.
12013 (Output_section::find_starting_output_address): Add comments.
12014 (Output_section::do_write,
12015 Output_section::write_to_postprocessing_buffer): Do code-fill
12016 generation as appropriate.
12017 (Output_section::get_input_sections): Invalidate relaxed input section
12018 map.
12019 (Output_section::restore_states): Adjust type of checkpoint .
12020 Invalidate relaxed input section map.
12021 * output.h (Output_merge_base): New class declaration.
12022 (Input_section_specifier): New class defintion.
12023 (class Output_relaxed_input_section) Change base class to
12024 Output_section_data_build.
12025 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12026 base class initializer.
12027 (Output_section::add_relaxed_input_section): New method declaration.
12028 (Output_section::Input_section): Change visibility to protected.
2e702c99 12029 (Output_section::Input_section::relobj,
c0a62865
DK
12030 Output_section::Input_section::shndx): Handle relaxed input sections.
12031 Output_section::input_sections) Change visibility to protected. Also
12032 define overload to return a non-const pointer.
12033 (Output_section::Merge_section_properties): New class defintion.
12034 (Output_section::Merge_section_by_properties_map,
12035 Output_section::Output_section_data_by_input_section_map,
12036 Output_section::Relaxation_map): New types.
12037 (Output_section::relax_input_section): Rename method to
12038 Output_section::convert_input_sections_to_relaxed_sections and change
12039 interface to take a vector of relaxed section pointers.
12040 (Output_section::find_merge_section,
12041 Output_section::find_relaxed_input_section,
12042 Output_section::build_relaxation_map,
12043 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12044 New method declarations.
12045 (Output_section::merge_section_map_
12046 Output_section::merge_section_by_properties_map_,
12047 Output_section::relaxed_input_section_map_,
12048 Output_section::is_relaxed_input_section_map_valid_,
12049 Output_section::generate_code_fills_at_write_): New data members.
12050 * script-sections.cc
12051 (Output_section_element_input::set_section_addresses): Call
12052 current_data_size and addralign methods of relaxed input sections.
12053 (Orphan_output_section::set_section_addresses): Call current_data_size
12054 and addralign methods of relaxed input sections.
12055 * symtab.cc (Symbol_table::compute_final_value): Extract template
12056 from the body of Symbol_table::sized_finalize_symbol.
12057 (Symbol_table::sized_finalized_symbol): Call
12058 Symbol_table::compute_final_value.
12059 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12060 (Symbol_table::compute_final_value): New templated method declaration.
12061 * target.cc (Target::do_make_output_section): New method defintion.
12062 * target.h (Target::make_output_section): New method declaration.
12063 (Target::relax): Add more parameters for input objects, symbol table
12064 and layout. Adjust call to do_relax.
12065 (Target::do_make_output_section): New method declaration.
12066 (Target::do_relax): Add parameters for input objects, symbol table
12067 and layout.
12068
d446d6c4
ILT
120692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12070
12071 * pread.c: Include stdio.h.
12072
bc06c745
ILT
120732009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12074
12075 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12076 defined.
12077
75aea3d0
ILT
120782009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12079
12080 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12081 Change read_shndx type to unsigned int.
12082 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12083 int.
12084 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12085 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12086 Change read_shndx type to unsigned int.
12087 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12088 int.
12089 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12090 * layout.cc (Layout::create_symtab_sections): Cast the result of
12091 local_symcount * symsize to off_t in the gold_assert.
12092
be8fcb75
ILT
120932009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12094
12095 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12096 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12097 R_ARM_BASE_ABS.
12098 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12099 (Arm_relocate_functions::thm_abs5): New function.
12100 (Arm_relocate_functions::abs12): New function.
12101 (Arm_relocate_functions::abs16): New function.
12102 (Arm_relocate_functions::base_abs): New function.
12103 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12104 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12105 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12106 R_ARM_BASE_ABS.
12107 (Scan::global): Likewise.
12108 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12109 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12110 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12111 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12112 R_ARM_BASE_ABS.
12113
c2a122b6
ILT
121142009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12115
12116 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12117 (Arm_relocate_functions::movt_prel): New function.
12118 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12119 (Arm_relocate_functions::thm_movt_prel): New function.
12120 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12121 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12122 (Scan::global, Relocate::relocate): Likewise.
12123 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12124
c4aa1e2d
ILT
121252009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12126
12127 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12128 Incremental_checker.
12129 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12130 unsigned int.
12131 (class Incremental_inputs_header): New class.
12132 (Incremental_inputs_header_writer): Edit comment.
12133 (Incremental_inputs_entry): New class.
12134 (Incremental_inputs_entry_writer): Edit comment.
12135 (Sized_incremental_binary::do_find_incremental_inputs_section):
12136 Add *strtab_shndx parameter, fill it.
12137 (Sized_incremental_binary::do_check_inputs): New method.
12138 (Incremental_checker::can_incrementally_link_output_file): Use
12139 Sized_incremental_binary::check_inputs.
12140 (Incremental_inputs::report_command_line): Save command line in
12141 command_line_.
12142 * incremental.h:
12143 (Incremental_binary::find_incremental_inputs_section): New
12144 method.
12145 (Incremental_binary::do_find_incremental_inputs_section): Add
12146 strtab_shndx parameter.
12147 (Incremental_binary::do_check_inputs): New pure virtual method.
12148 (Sized_incremental_binary::do_check_inputs): Declare.
12149 (Incremental_checker::Incremental_checker): Add incremental_inputs
12150 parameter, use it to initialize incremental_inputs_.
12151 (Incremental_checker::incremental_inputs_): New field.
12152 (Incremental_checker::command_line): New method.
12153 (Incremental_checker::inputs): New method.
12154 (Incremental_checker::command_line_): New field.
12155
c549a694
ILT
121562009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12157
12158 * incremental.cc: Include <cstdarg> and "target-select.h".
12159 (vexplain_no_incremental): New function.
12160 (explain_no_incremental): New function.
12161 (Incremental_binary::error): New method.
12162 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12163 method.
12164 (make_sized_incremental_binary): New function.
12165 (open_incremental_binary): New function.
12166 (can_incrementally_link_file): Add checks if output is ELF and has
12167 inputs section.
12168 * incremental.h: Include "elfcpp_file.h" and "output.h".
12169 (Incremental_binary): New class.
12170 (Sized_incremental_binary): New class.
12171 (open_incremental_binary): Declare.
12172 * object.cc (is_elf_object): Use
12173 elfcpp::Elf_recognizer::is_elf_file.
12174 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12175 * output.h (Output_file::filesize): New method.
12176
fd3c5f0b
ILT
121772009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12178
12179 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12180 New function.
12181 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12182 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12183 function.
12184 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12185 function.
12186 (Arm_relocate_functions::movw_abs_nc): New function.
12187 (Arm_relocate_functions::movt_abs): New function.
12188 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12189 (Arm_relocate_functions::thm_movt_abs): New function.
12190 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12191 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12192 (Scan::global): Likewise.
12193 (Relocate::relocate): Likewise.
12194 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12195
7f5309a5
ILT
121962009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12197
12198 * arm.cc (Arm_relocate_functions::got_prel) New function.
12199 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12200 (Relocate::relocate): Likewise.
12201 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12202
364c7fa5
ILT
122032009-10-06 Ian Lance Taylor <iant@google.com>
12204
12205 * options.h (class General_options): Define
12206 split_stack_adjust_size parameter.
12207 * object.h (class Object): Add uses_split_stack_ and
12208 has_no_split_stack_ fields. Add uses_split_stack and
12209 has_no_split_stack accessor functions. Declare
12210 handle_split_stack_section.
12211 (class Reloc_symbol_changes): Define.
12212 (class Sized_relobj): Define Function_offsets. Declare
12213 split_stack_adjust, split_stack_adjust_reltype, and
12214 find_functions.
12215 * object.cc (Object::handle_split_stack_section): New function.
12216 (Sized_relobj::do_layout): Call handle_split_stack_section.
12217 * dynobj.cc (Sized_dynobj::do_layout): Call
12218 handle_split_stack_section.
12219 * reloc.cc (Sized_relobj::relocate_sections): Call
12220 split_stack_adjust for executable sections in split_stack
12221 objects. Pass reloc_map to relocate_section.
12222 (Sized_relobj::split_stack_adjust): New function.
12223 (Sized_relobj::split_stack_adjust_reltype): New function.
12224 (Sized_relobj::find_functions): New function.
12225 * target-reloc.h: Include "object.h".
12226 (relocate_section): Add reloc_symbol_changes parameter. Change
12227 all callers.
12228 * target.h (class Target): Add calls_non_split method. Declare
12229 do_calls_non_split virtual method. Declare match_view and
12230 set_view_to_nop.
12231 * target.cc: Include "elfcpp.h".
12232 (Target::do_calls_non_split): New function.
12233 (Target::match_view): New function.
12234 (Target::set_view_to_nop): New function.
12235 * gold.cc (queue_middle_tasks): Give an error if mixing
12236 split-stack and non-split-stack objects with -r.
12237 * i386.cc (Target_i386::relocate_section): Add
12238 reloc_symbol_changes parameter.
12239 (Target_i386::do_calls_non_split): New function.
12240 * x86_64.cc (Target_x86_64::relocate_section): Add
12241 reloc_symbol_changes parameter.
12242 (Target_x86_64::do_calls_non_split): New function.
12243 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12244 parameter.
12245 * powerpc.cc (Target_powerpc::relocate_section): Add
12246 reloc_symbol_changes parameter.
12247 * sparc.cc (Target_sparc::relocate_section): Add
12248 reloc_symbol_changes parameter.
12249 * configure.ac: Call AM_CONDITIONAL for the default target.
12250 * configure: Rebuild.
12251 * testsuite/Makefile.am (TEST_AS): New variable.
12252 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12253 (check_DATA): Add split_i386 and split_x86_64 files.
12254 (SPLIT_DEFSYMS): Define.
12255 (split_i386_[1234n].o): New targets.
12256 (split_i386_[124]): New targets.
12257 (split_i386_[1234r].stdout): New targets.
12258 (split_x86_64_[1234n].o): New targets.
12259 (split_x86_64_[124]): New targets.
12260 (split_x86_64_[1234r].stdout): New targets.
12261 (MOSTLYCLEANFILES): Add new executables.
12262 * testsuite/split_i386.sh: New file.
12263 * testsuite/split_x86_64.sh: New file.
12264 * testsuite/split_i386_1.s: New file.
12265 * testsuite/split_i386_2.s: New file.
12266 * testsuite/split_i386_3.s: New file.
12267 * testsuite/split_i386_4.s: New file.
12268 * testsuite/split_i386_n.s: New file.
12269 * testsuite/split_x86_64_1.s: New file.
12270 * testsuite/split_x86_64_2.s: New file.
12271 * testsuite/split_x86_64_3.s: New file.
12272 * testsuite/split_x86_64_4.s: New file.
12273 * testsuite/split_x86_64_n.s: New file.
12274 * testsuite/testfile.cc (Target_test): Update relocation_section
12275 function.
12276 * testsuite/Makefile.in: Rebuild.
12277
e8a9fcda
ILT
122782009-10-06 Ian Lance Taylor <iant@google.com>
12279
12280 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12281 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12282 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12283 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12284 the address on ldo_addrs_.
12285 (Target_i386::Relocate::fix_up_ldo): New function.
12286
e99daf92
ILT
122872009-10-06 Rafael Espindola <espindola@google.com>
12288
12289 * plugin.cc (add_input_library): New.
12290 (Plugin::load): Add add_input_library to tv.
12291 (Plugin_manager::add_input_file): Add the is_lib argument.
12292 (add_input_file): Update call to Plugin_manager::add_input_file.
12293 (add_input_library): New.
12294 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12295
966d4097
DK
122962009-09-30 Doug Kwan <dougkwan@google.com>
12297
12298 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12299 symbol and call Symbol::may_need_copy_reloc to determine if
12300 a copy reloc is needed.
12301 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12302 nocopyreloc is given in command line.
12303 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12304 given in command line.
12305 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12306 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12307 of the removed Target_i386::may_need_copy_reloc.
12308 * options.h (copyreloc): New option with default value false.
12309 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12310 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12311 instead of the removed Target_powerpc::may_need_copy_reloc.
12312 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12313 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12314 instead of the removed Target_sparc::may_need_copy_reloc.
12315 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12316 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12317 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12318 instead of the removed Target_x86_64::may_need_copy_reloc.
12319
029ba973
ILT
123202009-09-30 Ian Lance Taylor <iant@google.com>
12321
12322 * object.h (class Object): Remove target_ field, and target,
12323 sized_target, and set_target methods.
12324 (Object::sized_target): Remove.
12325 (class Sized_relobj): Update declarations. Remove sized_target.
12326 * object.cc (Sized_relobj::setup): Remove target parameter.
12327 Change all callers.
12328 (Input_objects::add_object): Don't do anything with the target.
12329 (make_elf_sized_object): Add punconfigured parameter. Change all
12330 callers. Set or test parameter target.
12331 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12332 Change all callers.
12333 * parameters.cc (Parameters::set_target): Change parameter type to
12334 be non-const.
12335 (Parameters::default_target): Remove.
12336 (set_parameters_target): Change parameter type to be non-const.
12337 (parameters_force_valid_target): New function.
12338 (parameters_clear_target): New function.
12339 * parameters.h (class Parameters): Update declarations. Remove
12340 default_target method. Add sized_target and clear_target
12341 methods. Change target_ to be non-const.
12342 (set_parameters_target): Update declaration.
12343 (parameters_force_valid_target): Declare.
12344 (parameters_clear_target): Declare.
12345 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12346 as NULL if we aren't searching.
12347 (Add_symbols::run): Don't check for compatible target.
12348 * fileread.cc (Input_file::open_binary): Call
12349 parameters_force_valid_target.
12350 * gold.cc (queue_middle_tasks): Likewise.
12351 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12352 set_target on object.
12353 * dynobj.h (class Sized_dynobj): Update declarations.
12354 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12355 make_elf_object returns NULL.
12356 (Archive::include_member): Don't check whether object target is
12357 compatible.
12358 * output.cc (Output_section::add_input_section): Get target from
12359 parameters.
12360 (Output_section::relax_input_section): Likewise.
12361 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12362 parameters.
12363 (Sized_relobj::do_scan_relocs): Likewise.
12364 (Sized_relobj::relocate_sections): Likewise.
12365 * resolve.cc (Symbol_table::resolve): Likewise.
12366 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12367 parameter. Change all callers.
12368 (Symbol_table::add_from_object): Get target from parameters.
12369 (Symbol_table::add_from_relobj): Don't check object target.
12370 (Symbol_table::add_from_dynobj): Likewise.
12371 (Symbol_table::define_special_symbol): Get target from
12372 parameters.
12373 * symtab.h (class Symbol_table): Update declaration.
12374 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12375 parameter. Change all callers. Clear parameter target.
12376 (Binary_test): Test target here.
12377 * testsuite/object_unittest.cc (gold_testsuite): Remove
12378 target_test_pointer parameter. Change all callers.
12379 (Object_test): Test target here.
12380
a6a22b83
ILT
123812009-09-26 Ian Lance Taylor <iant@google.com>
12382
12383 * testsuite/initpri1.c: Don't try to use constructor priorities if
12384 compiling with gcc before 4.3.
12385
6a8f49fe
ILT
123862009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12387
12388 * testsuite/retain_symbols_file_test.sh (check_present): Change
12389 output file name to retain_symbols_file_test.stdout.
12390 (check_absent): Likewise.
12391
8c604651
CS
123922009-09-18 Craig Silverstein <csilvers@google.com>
12393
12394 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12395 * options.cc: Include <cerrno> and <fstream>.
12396 (General_options::finalize): Parse -retain-symbols-file tag.
12397 * options.h: New flag.
12398 (General_options): New method should_retain_symbol, new
12399 variable symbols_to_retain.
12400 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12401 should_retain_symbol map.
12402 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12403 * testsuite/Makefile.in: Regenerate.
12404 * testsuite/retain_symbols_file_test.sh: New file.
12405
ca58b19f
NC
124062009-09-18 Nick Clifton <nickc@redhat.com>
12407
12408 * po/es.po: Updated Spanish translation.
12409
20e6d0d6
DK
124102009-09-17 Doug Kwan <dougkwan@google.com>
12411
12412 * debug.h (DEBUG_RELAXATION): New constant.
12413 (DEBUG_ALL): Add DEBUG_RELAXATION.
12414 (debug_string_to_enum): Add relaxation debug option.
12415 * layout.cc
12416 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12417 Layout::Relaxation_debug_check::read_sections,
12418 Layout::Relaxation_debug_check::read_sections): New method definitions.
12419 (Layout::Layout): Initialize data members
12420 record_output_section_data_from_scrips_,
12421 script_output_section_data_list_ and relaxation_debug_check_.
12422 (Layout::save_segments, Layout::restore_segments,
12423 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12424 Layout::relaxation_loop_body): New method definitions.
12425 (Layout::finalize): Support relaxation. Move section layout code to
12426 Layout::relaxation_loop_body.
12427 (Layout::set_asection_address_from_script): Move code for orphan
12428 section placement out.
12429 (Layout::place_orphan_sections_in_script): New method definition.
12430 * layout.h (Output_segment_headers, Output_file_header):
12431 New forward class declarations.
12432 (Layout::~Layout): Define.
12433 (Layout::new_output_section_data_from_script): New method definition.
12434 (Layout::place_orphan_sections_in_script): New method declaration.
12435 (Layout::Segment_states): New type declaration.
12436 (Layout::save_segments, Layout::restore_segments,
12437 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12438 Layout::relaxation_loop_body): New method declarations.
12439 (Layout::Output_section_data_list): New type declaration.
12440 (Layout::Relaxation_debug_check): New class definition.
12441 (Layout::record_output_section_data_from_script_,
12442 Layout::script_output_section_data_list_, Layout::segment_states_,
12443 Layout::relaxation_debug_check_): New data members.
12444 * output.cc: (Output_section_headers::do_size): New method definition.
12445 (Output_section_headers::Output_section_headers): Move size
12446 computation to Output_section_headers::do_size.
12447 (Output_segment_headers::do_size): New method definition.
e1df38aa 12448 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12449 Output_file_header::do_size and call it.
12450 (Output_file_header::do_size): New method definition.
12451 (Output_data_group::Output_data_group): Adjust call to
12452 Output_section_data.
12453 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12454 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12455 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12456 RELAXED_INPUT_SECTION_CODE.
12457 (Output_section::Output_section): Initialize data member checkpoint_.
12458 (Output_section::~Output_section): Delete checkpoint object pointed
12459 by checkpoint_.
12460 (Output_section::add_input_section): Always add an Input_section if
12461 relaxing.
12462 (Output_section::add_merge_input_section): Add assert.
12463 (Output_section::relax_input_section): New method definition.
12464 (Output_section::set_final_data_size): Set load address to zero for
12465 an unallocated section.
12466 (Output_section::do_address_and_file_offset_have_reset_values):
12467 New method definition.
12468 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12469 Handle relaxed input section.
12470 (Output_section::sort_attached_input_sections): Checkpoint input
12471 section list lazily.
12472 (Output_section::get_input_sections): Change type of input_sections to
12473 list of Simple_input_section pointers. Checkpoint input section list
12474 lazily. Also handle relaxed input sections.
12475 (Output_section::add_input_section_for_script): Take a reference to
12476 a Simple_input_section object instead of Relobj pointer and section
12477 index as parameter. Handle relaxed input sections.
12478 (Output_section::save_states, Output_section::restore_states): New
12479 method definitions.
12480 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12481 (Output_data::is_data_size_fixed): New method definition.
12482 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12483 if it is fixed.
12484 (Output_data::address_and_file_offset_have_reset_values): New method
12485 definition.
12486 (Output_data::do_address_and_file_offset_have_reset_values): New method
12487 definition.
12488 (Output_data::set_data_size): Check that data size is not fixed.
12489 (Output_data::fix_data_size): New method definition.
12490 (Output_data::is_data_size_fixed_): New data member.
12491 (Output_section_headers::set_final_data_size): New method definition.
12492 (Output_section_headers::do_size): New method declaration.
12493 (Output_segment_headers::set_final_data_size): New method definition.
12494 (Output_segment_headers::do_size): New method declaration.
12495 (Output_file_header::set_final_data_size)::New method definition.
12496 (Output_file_header::do_size)::New method declaration.
12497 (Output_section_data::Output_section_data): Add new parameter
12498 is_data_size_fixed and use it to fix data size.
12499 (Output_data_const::Output_data_const): Adjust call to base class
12500 constructor and fix data size.
12501 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12502 base class constructor and fix data size.
12503 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12504 base class constructor and fix data size.
12505 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12506 class constructor and fix data size.
12507 (Output_data_group::set_final_data_size): New method definition.
12508 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12509 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12510 class constructor and fix data size.
12511 (Output_relaxed_input_section): New class definition.
12512 (Output_section::Simple_input_section): New class definition.
12513 (Output_section::get_input_sections): Adjust parameter list.
12514 (Output_section::add_input_section_for_script): Same.
12515 (Output_section::save_states, Output_section::restore_states,
12516 Output_section::do_address_and_file_offset_have_reset_values,
12517 (Output_section::Input_section::Input_section): Handle
12518 RELAXED_INPUT_SECTION_CODE. Add new overload for
12519 Output_relaxed_input_section.
12520 (Output_section::Input_section::is_input_section,
12521 Output_section::Input_section::set_output_section): Handle relaxed
12522 input section.
12523 (Output_section::Input_section::is_relaxed_input_section,
12524 Output_section::Input_section::output_section_data,
12525 Output_section::Input_section::relaxed_input_section): New method
12526 definitions.
12527 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12528 value.
12529 (Output_section::Input_section::u1_): Update comments.
12530 (Output_section::Input_section::u2_): Add new union member poris.
12531 (Output_section::Checkpoint_output_section): New classs definition.
12532 (Output_section::relax_input_section): New method declaration.
12533 (Output_section::checkpoint_): New data member.
12534 (Output_segment): Update comments.
12535 (Output_segment::Output_segment): Un-privatize copy constructor.
12536 (Output_segment::operator=): Un-privatize.
12537 * script-sections.cc (Output_section_element::Input_section_list):
12538 Change element type to Output_section::Simple_input_section.
12539 (Output_section_element_dot_assignment::set_section_addresses):
12540 Register output section data for relaxation clean up.
12541 (Output_data_exression::Output_data_expression): Adjust call to base
12542 constructor to fix data size.
12543 (Output_section_element_data::set_section_addresses): Register
12544 Output_data_expression object for relaxation clean up.
12545 (struct Input_section_info): Replace Relobj pointer and section index
12546 pair with Output_section::Simple_input_section and Convert struct to a
12547 class.
12548 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12549 Input_section_info data member to use accessors.
20e6d0d6
DK
12550 (Output_section_element_input::set_section_addresses): Use layout
12551 parameter. Adjust code to use Output_section::Simple_input_section
12552 and Input_secction_info classes. Register filler for relaxation
12553 clean up.
12554 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12555 and section index pair with Output_section::Simple_input_section
12556 class. Adjust code accordingly.
12557 (Phdrs_element::release_segment): New method definition.
12558 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12559 segment list.
12560 (Script_sections::release_segments): New method definition.
12561 * gold/script-sections.h (Script_sections::release_segments): New
12562 method declaration.
12563 * gold/target.h (Target::may_relax, Target::relax,
12564 Target::do_may_relax, Target::do_relax): New method definitions.
12565
5e445df6
ILT
125662009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12567
12568 * arm.cc (has_signed_unsigned_overflow): New function.
12569 (Arm_relocate_functions::abs8): New function.
12570 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12571 (Target_arm::Scan::global): Likewise.
12572 (Target_arm::relocate::relocate): Likewise.
12573 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12574 Likewise.
12575
8c604651 125762009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12577
12578 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12579 * testsuite/Makefile.in: Regenerate.
12580
1e9cc1c2
NC
125812009-09-11 Nick Clifton <nickc@redhat.com>
12582
12583 * po/gold.pot: Updated by the Translation project.
12584
6a89f575
CC
125852009-09-08 Cary Coutant <ccoutant@google.com>
12586
12587 * output.cc (Output_file::open): Add execute permission to empty file.
12588 * testsuite/Makefile.am (permission_test): New test.
12589 * testsuite/Makefile.in: Regenerate.
12590
fdcac5af
ILT
125912009-09-02 Ian Lance Taylor <iant@google.com>
12592
12593 * output.cc (Output_file::resize): Call map_no_anonymous rather
12594 than map.
12595
44453f85
ILT
125962009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12597
12598 * gold.cc: Include "incremental.h".
12599 (queue_initial_tasks): Call Incremental_checker methods.
12600 * incremental.cc: Include "output.h".
12601 (Incremental_checker::can_incrementally_link_output_file): New
12602 method.
12603 * incremental.h (Incremental_checker): New class.
12604
12605 * output.cc (Output_file::open_for_modification): New method.
12606 (Output_file::map_anonymous): Changed return type to bool. Record
12607 map in base_ field.
12608 (Output_file::map_no_anonymous): New method, broken out of map.
12609 (Output_file::map): Use map_no_anonymous and map_anonymous.
12610 * output.h (class Output_file): Update declarations.
12611
293c1386
CC
126122009-08-24 Cary Coutant <ccoutant@google.com>
12613
12614 * options.h (Command_line::Pre_options): New class.
12615 (Command_line::pre_options): New member.
12616 * options.cc (gold::options::ready_to_register): New variable.
12617 (One_option::register_option): Do nothing if not registering options.
12618 Assert if same short option registered twice.
12619 (General_options::General_options): Turn off option registration when
12620 done constructing.
12621 (Command_line::Pre_options::Pre_options): New constructor.
12622
f773f3d2
CC
126232009-08-24 Cary Coutant <ccoutant@google.com>
12624
06a73cfe
CC
12625 * options.h (General_options::no_keep_memory): Remove incorrect
12626 short option.
f773f3d2 12627
a15af8e2
RW
126282009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12629
12630 * Makefile.am (am__skiplex, am__skipyacc): New.
12631 * Makefile.in: Regenerate.
12632
c462b41b
RW
126332009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12634
14ec8efd
RW
12635 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12636 (INCLUDES): ... this.
12637 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12638 (AM_CPPFLAGS): Renamed from ...
12639 (INCLUDE): ... this.
12640 * Makefile.in, testsuite/Makefile.in: Regenerate.
12641
81ecdfbb
RW
12642 * Makefile.in: Regenerate.
12643 * aclocal.m4: Likewise.
12644 * config.in: Likewise.
12645 * configure: Likewise.
12646 * testsuite/Makefile.in: Likewise.
12647
c462b41b
RW
12648 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12649 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12650 * Makefile.in: Regenerate.
12651 * testsuite/Makefile.in: Regenerate.
12652
2da73f13
CC
126532009-08-19 Cary Coutant <ccoutant@google.com>
12654
12655 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12656 symbols in shared libraries overridden by hidden or internal symbols
12657 in the main program.
12658
2db70501
CD
126592009-08-19 Chris Demetriou <cgd@google.com>
12660
12661 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12662 checking source file names in error messages.
12663
f733487b
DK
126642009-08-18 Doug Kwan <dougkwan@google.com>
12665
12666 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12667 an elcpp::Ehdr as parameter. Adjust call to set_target.
12668 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12669 an elfcpp::Ehdr as parameter.
12670 * object.cc (Object::set_target): Remove the version that looks up
12671 a target and sets it.
12672 (Sized_relobj::setup): Take a Target object instead of
12673 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12674 (make_elf_sized_object): Find target and ask target to
12675 make an ELF object.
12676 * object.h: (Object::set_target): Remove the version that looks up
12677 a target and sets it.
12678 (Sized_relobj::setup): Take a Target object instead of
12679 an elfcpp:Ehdr as parameter.
12680 * target.cc: Include dynobj.h.
12681 (Target::do_make_elf_object_implementation): New.
2e702c99 12682 (Target::do_make_elf_object): New.
f733487b
DK
12683 * target.h (Target::make_elf_object): New template declaration.
12684 (Target::do_make_elf_object): New method declarations.
12685 (Target::do_make_elf_object_implementation): New template declaration.
12686
cc70f101
ILT
126872009-08-14 Ian Lance Taylor <iant@google.com>
12688
12689 * gold.h (FUNCTION_NAME): Define.
12690 (gold_unreachable): Use FUNCTION_NAME.
12691
ef5e0cb1
ST
126922009-08-12 Sriraman Tallam <tmsriram@google.com>
12693
12694 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12695 symbol in the --keep-unique list is not found.
12696
48c187ce
ST
126972009-08-12 Sriraman Tallam <tmsriram@google.com>
12698
12699 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12700 been maked as --keep-unique.
12701 (Icf::unfold_section): New function.
12702 * icf.h (Icf::unfold_section): New function.
12703 * options.h (General_options::keep_unique): New option.
12704 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12705 * testsuite/Makefile.in: Regenerate.
12706 * testsuite/icf_keep_unique_test.sh: New file.
12707 * testsuite/icf_keep_unique_test.cc: New file.
12708
645afe0c
CC
127092009-08-12 Cary Coutant <ccoutant@google.com>
12710
12711 PR 10471
12712 * resolve.cc (Symbol_table::resolve): Check for references from
12713 dynamic objects to hidden and internal symbols.
12714 * testsuite/Makefile.am (hidden_test.sh): New test.
12715 * testsuite/Makefile.in: Regenerate.
12716 * testsuite/hidden_test.sh: New script.
12717 * testsuite/hidden_test_1.c: New test source.
12718 * testsuite/hidden_test_main.c: New test source.
12719
11af873f
DK
127202009-08-11 Doug Kwan <dougkwan@google.com>
12721
12722 * arm.cc: Update comments.
12723 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12724 segment to locate the .ARM.exidx section if present.
12725
b9f7d72d
DK
127262009-08-09 Doug Kwan <dougkwan@google.com>
12727
12728 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12729 patch.
12730
ddd3c53c
ST
127312009-08-07 Sriraman Tallam <tmsriram@google.com>
12732 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12733 compiler warnings.
12734
27721062
ST
127352009-08-06 Sriraman Tallam <tmsriram@google.com>
12736
12737 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12738 valid tls_segment only for non-debug-section relocations.
12739 * testsuite/Makefile.am: Add gc_tls_test.
12740 * testsuite/Makefile.in: Regenerate.
12741 * testsuite/gc_tls_test.cc: New file.
12742 * testsuite/gc_tls_test.sh: New file.
12743
ef15dade 127442009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12745
ef15dade
ST
12746 * icf.cc: New file.
12747 * icf.h: New file.
12748 * Makefile.am (CCFILES): Add icf.cc.
12749 (HFILES): Add icf.h
12750 * Makefile.in: Regenerate.
12751 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12752 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12753 section, symbol and addend information for the relocs.
12754 * gold.cc (queue_middle_tasks): Call identical code folding.
12755 * gold.h: Add defines for multimap.
12756 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12757 to the call of finalize_local_symbols.
12758 * main.cc (main): Create object of class Icf.
12759 * object.cc (Sized_relobj::do_layout): Allow this function to be
12760 called twice during icf.
12761 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12762 to sections marked as identical by icf.
12763 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12764 when available.
12765 (Sized_relobj::do_section_entsize): New function.
12766 * object.h (Object::section_entsize): New function.
12767 (Object::do_section_entsize): New pure virtual function.
12768 (Relobj::finalize_local_symbols): Add new parameter.
12769 (Relobj::do_section_entsize): New function.
12770 * options.h (General_options::icf): New option.
12771 (General_options::icf_iterations): New option.
12772 (General_options::print_icf_sections): New option.
12773 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12774 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12775 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12776 icf.
12777 * symtab.cc (Symbol_table::is_section_folded): New function.
12778 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12779 to sections marked as identical by icf.
12780 * symtab.h (Symbol_table::set_icf): New function.
12781 (Symbol_table::icf): New function.
12782 (Symbol_table::is_section_folded): New function.
12783 (Symbol_table::icf_): New data member.
12784 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12785 * testsuite/Makefile.am: Add commands to build icf_test.
12786 * testsuite/Makefile.in: Regenerate.
12787 * testsuite/icf_test.sh: New file.
12788 * testsuite/icf_test.cc: New file.
12789
c3b65ac4
CD
127902009-07-24 Chris Demetriou <cgd@google.com>
12791
12792 * layout.cc (is_compressible_debug_section): Fix incorrect
12793 comment about compressed section names.
12794
1caf2c51
ILT
127952009-07-20 Ian Lance Taylor <ian@airs.com>
12796
12797 PR 10419
12798 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12799
1ef4d87f
ILT
128002009-07-16 Ian Lance Taylor <iant@google.com>
12801
12802 PR 10400
12803 * layout.h: #include <map>.
12804 (class Kept_section): Change from struct to class. Add accessors
12805 and setters. Add section size to Comdat_group mapping. Change
12806 Comdat_group to std::map. Add is_comdat_ field. Add
12807 linkonce_size field in union.
12808 (class Layout): Update declaration of find_or_add_kept_section.
12809 Don't declare find_kept_object.
12810 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12811 parameter. Add object, shndx, is_comdat, and is_group_name
12812 parameters. Change all callers. Adjust for new Kept_section.
12813 (Layout::find_kept_object): Remove.
12814 * object.cc (Sized_relobj::include_section_group): Update use of
12815 Kept_section. Rename secnum to shndx. Only record
12816 Kept_comdat_section if sections are the same size.
12817 (Sized_relobj::include_linkonce_section): Update use of
12818 Kept_section. Only record Kept_comdat_section if sections are the
12819 same size. Set size of linkonce section.
12820 (Sized_relobj::map_to_kept_section): Update call to
12821 get_kept_comdat_section.
12822 * object.h (class Sized_relobj): Rename fields in
12823 Kept_comdat_section to drop trailing underscores; change object
12824 field to Relobj*. Change Kept_comdat_section_table to store
12825 struct rather than pointer.
12826 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12827 Add kept_object and kept_shndx parameters. Change all callers.
12828 (Sized_relobj::get_kept_comdat_section): Change return type to
12829 bool. Add kept_object and kept_shndx parameters. Change all
12830 callers.
12831 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12832 Layout::find_or_add_kept_section.
12833
37c3b7b0
ILT
128342009-07-09 Ian Lance Taylor <iant@google.com>
12835
12836 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12837 Reserve space in the hash table.
12838
98fa85cb
ILT
128392009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12840
12841 * fileread.cc (File_read::get_mtime): New method.
12842 * fileread.h (Timespec): New structure.
12843 (File_read::get_mtime): New method.
12844 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12845 Renamed from timestamp_nsec.
12846 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12847 Elf_Xword.
e1df38aa 12848 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12849 timestamp_nsec.
e1df38aa 12850 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12851 (Incremental_inputs::report_obejct): Save mtime; style fix.
12852 (Incremental_inputs::report_script): Save mtime; style fix.
12853 (Incremental_inputs::finalize_inputs): Style fix.
12854 (Incremental_inputs::finalize): Style fix.
12855 (Incremental_inputs::create_input_section_data): Store inputs
12856 mtime.
12857 * incremental.h (Incremental_inputs::report_script): Add mtime
12858 argument.
12859 (Incremental_inputs::Input_info::Input_info): Intialize only one
12860 union member.
12861 (Incremental_inputs::Input_info::archive): Move to nameless
12862 union.
12863 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12864 (Incremental_inputs::Input_info::script): Move to nameless union.
12865 (Incremental_inputs::mtime): New field.
12866 * script.cc (read_input_script): Pass file mtime to
12867 Incremental_input.
12868 * script.h (Script_info::inputs): Style fix.
12869
c9d70757
ILT
128702009-07-01 Ian Lance Taylor <ian@airs.com>
12871
12872 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12873 instead of 32.
12874
9c547ec3
ILT
128752009-06-24 Ian Lance Taylor <iant@google.com>
12876
12877 PR 10156
12878 * layout.cc (Layout::choose_output_section): If we find an
12879 existing section, update the flags.
12880 (Layout::create_notes): New function, broken out of
12881 Layout::finalize.
12882 (Layout::finalize): Don't create note sections.
12883 (Layout::create_note): Don't crash if linker script discards
12884 section.
12885 (Layout::create_gold_note): Likewise.
12886 (Layout::create_build_id): Likewise. Don't set
12887 after_input_sections on the section.
12888 (Layout::create_executable_stack_info): Remove target parameter.
12889 Change caller.
12890 * layout.h (class Layout): Declare create_notes. Update
12891 declaration of create_executable_stack_info.
12892 * gold.cc (queue_middle_tasks): Call create_notes.
12893 * output.cc (Output_section::update_flags_for_input_section): Move
12894 here from output.h. If SHF_ALLOC flag is newly set, mark address
12895 invalid.
12896 * output.h (Output_data::mark_address_invalid): New function.
12897 (class Output_section): Only declare, not define,
12898 update_flags_for_input_section. Remove set_flags.
12899
55458500
ILT
129002009-06-24 Ian Lance Taylor <iant@google.com>
12901
12902 * script-sections.cc (Output_section_definition::
12903 set_section_addresses): Rename shadowing local load_address to
12904 laddr.
12905
1307d6cd
ILT
129062009-06-24 Ian Lance Taylor <iant@google.com>
12907
12908 PR 10244
12909 * reloc.cc (relocate_sections): Skip empty relocation sections.
12910
ec3f783e
ILT
129112009-06-23 Ian Lance Taylor <iant@google.com>
12912
12913 PR 10156
12914 * layout.cc (Layout::create_note): Use choose_output_section
12915 rather than make_output_section.
12916
459c9f1c
ILT
129172009-06-23 Ian Lance Taylor <iant@google.com>
12918
12919 PR 10237
12920 * options.cc (General_options::parse_V): Set printed_version_.
12921 (General_options::General_options): Initialize printed_version_.
12922 * options.h (class General_options): Add printed_version_ field.
12923 * gold.cc (queue_initial_tasks): If there are no input files,
12924 don't give a fatal error if we printed the version information.
12925 (queue_middle_tasks): If using -r with a shared object, give a
12926 fatal error rather than an ordinary error.
12927
1518dc8f
ILT
129282009-06-23 Ian Lance Taylor <iant@google.com>
12929
12930 PR 10219
12931 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12932 (Layout::make_output_section): Set have_stabstr_section_ if we see
12933 a .stab*str section.
12934 (Layout::finalize): Call link_stabs_sections.
12935 (Layout::link_stabs_sections): New file.
12936 * layout.h (class Layout): Add have_stabstr_section_ field.
12937 Declare link_stabs_sections.
12938
3d857b98
DK
129392009-06-23 Doug Kwan <dougkwan@google.com>
12940
12941 * Makefile.am (libgold_a_LIBADD): New.
12942 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12943 * Makefile.in: Regenerate.
3d857b98
DK
12944 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12945 * configure: Regenerate.
12946 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12947 * fileread.cc: Include sys/state.h
12948 * gold.h: Declare memmem and strndup if found missing.
12949 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12950
0639a6f6
ILT
129512009-06-23 Ian Lance Taylor <iant@google.com>
12952
12953 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12954 * configure: Rebuild.
12955
8d63875c
ILT
129562009-06-23 Ian Lance Taylor <iant@google.com>
12957
12958 PR 10147
12959 * object.cc (Object::section_contents): Don't try to get a view if
12960 the section has length zero.
12961 (Object::handle_gnu_warning_section): If the section is empty, use
12962 the name of the section as the warning.
12963
f7c8a183
ILT
129642009-06-23 Ian Lance Taylor <iant@google.com>
12965
12966 PR 10133
12967 * stringpool.h (class Stringpool_template): Add optimize_ field.
12968 (Stringpool_template::set_optimize): New function.
12969 * stringpool.cc (Stringpool_template::Stringpool_template):
12970 Initialize optimize_ field.
12971 (Stringpool_template::set_string_offsets): Test local optimize
12972 fild rather than parameter.
12973 * layout.cc (Layout::Layout): Call set_optimize on the section
12974 name stringpool.
12975
e6a307ba
ILT
129762009-06-22 Ian Lance Taylor <iant@google.com>
12977
12978 PR 10030
12979 * yyscript.y: Parse TARGET.
12980 * script.cc (script_set_target): New function.
12981 * script-c.h (script_set_target): Declare.
12982 * options.cc (General_options::string_to_object_format): Rename
12983 from string_to_object_format in anonymous namespace. Change
12984 callers.
12985 * options.h (class General_options): Declare
12986 string_to_object_format.
12987
3ee173de
ILT
129882009-06-22 Ian Lance Taylor <iant@google.com>
12989
12990 * script-sections.cc (Script_sections::create_segments): Don't put
12991 program headers in a PT_LOAD segment if -n or -N.
12992
129932009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12994
12995 PR 10141
12996 * options.h (class General_options): Add -z lazy and -z now. Sort
12997 -z options into alphabetical order.
12998 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12999
cd6739a1 130002009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13001
13002 * layout.cc (Layout::make_output_section): Call
13003 Target::new_output_section.
13004 (Layout::attach_allocated_section_to_segment): Put large section
13005 sections in a separate load segment with the large segment flag
13006 set.
13007 (Layout::segment_precedes): Sort large data segments after other
13008 load segments.
13009 (align_file_offset): New static function.
13010 (Layout::set_segment_offsets): Use align_file_offset.
13011 * output.h (class Output_section): Add is_small_section_ and
13012 is_large_section_ fields.
13013 (Output_section::is_small_section): New function.
13014 (Output_section::set_is_small_section): New function.
13015 (Output_section::is_large_section): New function.
13016 (Output_section::set_is_large_section): New function.
13017 (Output_section::is_large_data_section): New function.
13018 (class Output_segment): Add is_large_data_segment_ field.
13019 (Output_segment::is_large_data_segment): New function.
13020 (Output_segment::set_is_large_data_segment): New function.
13021 * output.cc (Output_section::Output_section): Initialize new
13022 fields.
13023 (Output_segment::Output_segment): Likewise.
13024 (Output_segment::add_output_section): Add assertion that large
13025 data sections always go in large data segments. Force small data
13026 sections to the end of the list of data sections. Force small BSS
13027 sections to the start of the list of BSS sections. For large BSS
13028 sections to the end of the list of BSS sections.
13029 * symtab.h (class Symbol): Declare is_common_shndx.
13030 (Symbol::is_defined): Check Symbol::is_common_shndx.
13031 (Symbol::is_common): Likewise.
13032 (class Symbol_table): Define enum Commons_section_type. Update
13033 declarations. Add small_commons_ and large_commons_ fields.
13034 * symtab.cc (Symbol::is_common_shndx): New function.
13035 (Symbol_table::Symbol_table): Initialize new fields.
13036 (Symbol_table::add_from_object): Put small and large common
13037 symbols in the right list.
13038 (Symbol_table::sized_finalized_symbol): Check
13039 Symbol::is_common_shndx.
13040 (Symbol_table::sized_write_globals): Likewise.
13041 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13042 common symbol lists. Don't call do_allocate_commons_list if the
13043 list is empty.
13044 (Symbol_table::do_allocate_commons_list): Remove is_tls
13045 parameter. Add comons_section_type parameter. Change all
13046 callers. Handle small and large common symbols.
13047 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13048 Symbol::is_common_shndx.
13049 * resolve.cc (symbol_to_bits): Likewise.
13050 * target.h (Target::small_common_shndx): New function.
13051 (Target::small_common_section_flags): New function.
13052 (Target::large_common_shndx): New function.
13053 (Target::large_common_section_flags): New function.
13054 (Target::new_output_section): New function.
13055 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13056 small_common_section_flags, and large_common_section_flags
13057 fields.
13058 (Target::do_new_output_section): New virtual function.
13059 * arm.cc (Target_arm::arm_info): Initialize new fields.
13060 * i386.cc (Target_i386::i386_info): Likewise.
13061 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13062 Likewise.
13063 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13064 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13065 (Target_x86_64::do_new_output_section): New function.
13066 * configure.ac: Define conditional MCMODEL_MEDIUM.
13067 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13068 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13069 (large_LDFLAGS): Define.
13070 * testsuite/large.c: New file.
13071 * testsuite/testfile.cc (Target_test::test_target_info):
13072 Initialize new fields.
13073 * configure, testsuite/Makefile.in: Rebuild.
13074
bb04269c
DK
130752009-06-05 Doug Kwan <dougkwan@google.com>
13076
13077 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13078 * Makefile.in: Regenerate.
bb04269c
DK
13079 * i386.cc (class Target_i386): Define new virtual method to
13080 override do_is_local_label_name in parent.
13081 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13082 local symbols if --discard-locals or -X is given.
13083 * options.h (class General_options): Declare new options
13084 '--discard-locals' and '-X' for discarding locals.
13085 * target.h (class Target): Define new methods is_local_label_name.
13086 Declare new virtual method do_is_local_label_name.
13087 * target.cc: New file.
13088 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13089 (check_SCRIPTS): Add discard_locals_test.sh.
13090 (check_DATA): Add discard_local_tests.syms.
13091 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13092 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13093 * testsuite/Makefile.in: Regenerate.
13094 * testsuite/discard_locals_test.c: New file.
13095 * testsuite/discard_locals_test.sh: Same.
13096
805bb01c
DK
130972009-06-05 Doug Kwan <dougkwan@google.com>
13098
13099 * object.cc (Sized_relobj::Sized_relobj): Initialize
13100 discarded_eh_frame_shndx_ to -1U.
13101 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13102 section.
13103 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13104 a discarded .eh_frame section.
13105 (Sized_relobj::do_finalize_local_symbols): Ditto.
13106 * object.h (class Sized_relobj): Declare new member
13107 discarded_eh_frame_shndx_.
13108 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13109 (local_labels_test.o, local_labels_test): New rules.
13110 * testsuite/Makefile.in: Regenerate.
13111
1dcd334d
DK
131122009-06-04 Doug Kwan <dougkwan@google.com>
13113
13114 * layout.cc (Layout::section_name_mapping): Add mapping for
13115 special ARM sections.
13116
96d49306
DK
131172009-06-03 Doug Kwan <dougkwan@google.com>
13118
13119 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13120 (utils::has_overflow): Same.
13121
dff16297
ILT
131222009-06-03 Ian Lance Taylor <iant@google.com>
13123
13124 * layout.cc (Layout::section_name_mapping): New array, replacing
13125 Layout::linkonce_mapping.
13126 (Layout::section_name_mapping_count): New variable, replacing
13127 Layout::linkonce_mapping_count.
13128 (Layout::linkonce_output_name): Remove.
13129 (Layout::output_section_name): Rewrite.
13130 * layout.h (class Layout): Rename Linkonce_mapping to
13131 Section_name_mapping, linkonce_mapping to section_name_mapping,
13132 linkonce_mapping_count to section_name_mapping_count. Don't
13133 declare linkonce_output_name.
13134
c121c671
DK
131352009-06-03 Doug Kwan <dougkwan@google.com>
13136
13137 * gold/arm.cc (namespace utils): New.
13138 (Target_arm::reloc_is_non_pic): Define new method.
13139 (class Arm_relocate_functions): New.
13140 (Target_arm::Relocate::relocate): Handle relocation types used by
13141 Android.
13142
07800fab
ILT
131432009-06-03 Ian Lance Taylor <iant@google.com>
13144
13145 * arm.cc (Target_arm::scan::global): Use || instead of |.
13146
c121c671
DK
131472009-06-02 Doug Kwan <dougkwan@google.com>
13148
13149 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13150 issued_non_pic_error_.
13151 (class Target_arm::Scan): Declare new method check_non_pic.
13152 Define new method symbol_needs_plt_entry.
13153 Declare new data member issued_non_pic_error_.
13154 (class Target_arm::Relocate): Declare new method
13155 should_apply_static_reloc.
13156 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13157 (Target_arm::Scan::check_non_pic): Define new method.
13158 (Target_arm::Scan::local): Handle a small subset of reloc types used
13159 by Android.
13160 (Target_arm::Scan::local): Same.
13161 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13162
b19b0c6d
ILT
131632009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13164
13165 * incremental.cc (Incremental_inputs::report_command_line): Filter
13166 out --incremental-* options.
13167
94cdfcff
DK
131682009-05-29 Doug Kwan <dougkwan@google.com>
13169
13170 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13171 template class.
13172 (class Target_arm): Update comment.
13173 (Target_arm::Target_arm): Initialize new data members GOT_,
13174 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13175 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13176 and Target_arm::rel_dyn_section.
13177 Declare new_enum Target_arm::Got_type.
13178 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13179 and DYNBSS_.
13180 Update commments for member do_dynsym_value.
13181 (Target_arm::got_size, Target_arm::plt_section,
13182 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13183 new methods inside class defintion.
13184 (Target_arm::got_section): Define new method.
13185 (Target_arm::rel_dyn_section): Same.
13186 (Output_data_plt_arm): New template class.
13187 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13188 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13189 (Output_data_plt_arm::add_entry): Same.
13190 (Output_data_plt_arm::first_plt_entry): Define new
13191 static data member for PLT instruction template.
13192 (Output_data_plt_arm::plt_entry): Same.
13193 (Output_data_plt_arm::do_write): Define new method.
13194 (Target_arm::make_plt_entry): Same.
13195 (Target_arm::do_finalize_sections): Same.
13196 (Target_arm::do_dynsym_value): Same.
13197
4a657b0d
DK
131982009-05-28 Doug Kwan <dougkwan@google.com>
13199
13200 * Makefile.am (TARGETSOURCES): Add arm.cc.
13201 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13202 * Makefile.in: Regenerate.
13203 * arm.cc: New file.
13204 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13205
e7ae8c36
DK
132062009-05-26 Doug Kwan <dougkwan@google.com>
13207
13208 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13209 (General_options::check_excluded_libs): Strip off directories in
13210 archive name before matching like GNU ld does.
13211 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13212 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13213 (exclude_libs_test_LDFLAGS): Add linker option
13214 -Wl,--exclude-libs,libexclude_libs_test_3
13215 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13216 an explicit archive without using -l.
13217 (alt/libexclude_libs_test_3.a): New make rule.
13218 * testsuite/Makefile.in: Regenerate.
13219 * testsuite/exclude_libs_test.c : Declare lib3_default().
13220 (main): Call it.
13221 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13222 * exclude_libs_test_3.c: New file.
13223
f12e7348
NC
132242009-05-26 Nick Clifton <nickc@redhat.com>
13225
13226 * po/id.po: New Indonesian translation.
13227 * po/gold.pot: Updated template file.
13228
4daadc0d
ST
132292009-05-22 Sriraman Tallam <tmsriram@google.com>
13230
e1df38aa 13231 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13232 gc_comdat_test files. Add -Wl,--gc-sections to build
13233 gc_comdat_test.
13234 * testsuite/Makefile.in: Regenerate.
13235 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13236
531813ad
ST
132372009-05-21 Sriraman Tallam <tmsriram@google.com>
13238
13239 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13240 kept comdat section was garbage collected.
13241 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13242 * testsuite/Makefile.in: Regenerate.
13243 * testsuite/gc_comdat_test.sh: New file.
13244 * testsuite/gc_comdat_test_1.cc: New file.
13245 * testsuite/gc_comdat_test_2.cc: New file.
13246
65514900
CC
132472009-05-19 Doug Kwan <dougkwan@google.com>
13248
13249 * archive.cc (Archive::Archive): Move constructor from archive.h
13250 to here. Initialize no_export_.
13251 (Archive::get_elf_object_for_member): Set no_export flag of object.
13252 * archive.h (Archive::Archive): Move constructor body to
13253 archive.cc.
13254 (Archive::no_export): New method.
13255 (Archive::no_export_): New field.
13256 * object.h (Object::Object): Initialize no_export_ to false.
13257 (Object::no_export, Object::set_no_export): New methods.
13258 (Object::no_export_): New field.
13259 * options.cc (General_options::parse_exclude_libs): New method.
13260 (General_options::check_excluded_libs) Same.
13261 * options.h (exclude_libs): New option.
13262 (General_options::check_excluded_libs): New method declaration.
13263 (General_options::excluded_libs_): New field.
13264 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13265 default or protected visibility if an object has no-export flag set.
13266 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13267 (check_SCRIPTS): Add exclude_libs_test.sh.
13268 (check_DATA): Add exclude_libs_test.syms.
13269 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13270 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13271 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13272 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13273 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13274 libexclude_libs_test_2.a): New rules.
13275 * testsuite/Makefile.in: Regenerate.
13276 * testsuite/exclude_libs_test.c: New file.
13277 * testsuite/exclude_libs_test.sh: Ditto.
13278 * testsuite/exclude_libs_test_1.c: Ditto.
13279 * testsuite/exclude_libs_test_2.c: Ditto.
13280
1b77ea50
ILT
132812009-05-15 Ian Lance Taylor <iant@google.com>
13282
13283 * configure.ac: Check for declarations for cases where libiberty.h
13284 checks HAVE_DECL_xxx.
13285 * configure, config.in: Rebuild.
13286
072fe7ce
ILT
132872009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13288
13289 * gold.h (Incremental_argument_list): Remove (invalid) forward
13290 declaration.
13291 * incremental.cc (Incremental_inputs::report_achive): New method.
13292 (Incremental_inputs::report_object): New method.
13293 (Incremental_inputs::report_script): New method.
13294 (Incremental_inputs::finalize_inputs): New method.
13295 (Incremental_inputs::finalize): Call finalize_inputs().
13296 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13297 Create inputs entries.
13298 * incremental.h (Incremental_input_type): New enum.
13299 (Incremental_inputs::Incremental_input): Initialize new fields.
13300 (Incremental_inputs::report_inputs): New method.
13301 (Incremental_inputs::report_achive): New method.
13302 (Incremental_inputs::report_object): New method.
13303 (Incremental_inputs::report_script): New method.
13304 (Incremental_inputs::finalize_inputs): New method.
13305 (Incremental_inputs::Input_info): New struct.
13306 (Incremental_inputs::Input_info_map): New typedef.
13307 (Incremental_inputs::lock_): New field.
13308 (Incremental_inputs::Inputs_): New field.
13309 (Incremental_inputs::Inputs_map): New field.
13310 * main.cc (main): Call Incremental_input::report_inputs.
13311 * options.h (Input_argument_list): Typedef moved from
13312 Input_arguments.
13313 (Input_file_group::Files): Remove, use ::Input_argument_list.
13314 (Input_file_group::Input_argument_list): Remove, use
13315 ::Input_argument_list.
13316 * plugin.cc (Plugin_manager::add_input_file): Add error in
13317 incremental build.
13318 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13319 functions.
13320 * script.cc (read_input_script): Call
13321 Incremental_input::report_script.
13322 * script.h (Script_info): New class.
13323
b0481b0b
ILT
133242009-04-27 Ian Lance Taylor <iant@google.com>
13325
13326 * x86_64.cc (do_adjust_output_section): Set entsize to
13327 plt_entry_size.
13328
b22a5a41 133292009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13330
13331 * output.cc (Output_file::close): After short writes, continue
13332 writing from the correct offset in the buffer being written.
13333
40fde488
CD
133342009-04-23 Chris Demetriou <cgd@google.com>
13335
13336 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13337 * configure: Regenerate.
13338 * config.in: Regenerate.
13339 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13340 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13341
3ce2c28e
ILT
133422009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13343
13344 * incremental.cc (Incremental_inputs_header_data): Renamed from
13345 Incremental_input_header_data.
13346 (Incremental_inputs_header_data::data_size): New field.
13347 (Incremental_inputs_header_data::put_input_file_count): Renamed
13348 from input_file_count.
13349 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13350 from command_line_offset.
13351 (Incremental_inputs_header_data::put_reserved): Renamed from
13352 put_reserved.
13353 (Incremental_inputs_entry_data): Renamed from
13354 Incremental_input_entry_data.
13355 (Incremental_inputs_entry_data::data_size): New field.
13356 (Incremental_inputs::report_command_line): New method.
13357 (Incremental_inputs::finalize): New method.
13358 (Incremental_inputs::create_incremental_inputs_data): New method.
13359 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13360 * incremental.h: New file.
13361 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13362 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13363 incremental builds.
703d02da 13364 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13365 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13366 (Layout::create_incremental_info_sections): New method.
13367 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13368 * main.cc (main): Notify Incremental_input of the command line.
13369
e55bde5e
ILT
133702009-04-01 Ian Lance Taylor <iant@google.com>
13371 Mikolaj Zalewski <mikolajz@google.com>
13372
13373 * gold.h (reserve_unordered_map): Define, three versions, one for
13374 each version of Unordered_map.
13375 * layout.cc (Layout::Layout): Remove options parameter. Add
13376 number_of_input_files parameter. Don't initialize options_.
13377 Initialize number_of_input_files_ and resized_signatures_. Move
13378 sections_are_attached_.
13379 (Layout::layout_group): Reserve space for group_signatures_.
13380 (Layout::find_or_add_kept_section): Change name parameter to be a
13381 reference. Resize signatures_ map when it gets large enough.
13382 (Layout::layout_eh_frame): Use parameters->options() instead of
13383 this->options_.
13384 (Layout::make_output_section): Likewise.
13385 (Layout::attach_allocated_section_to_segment): Likewise.
13386 (Layout::finalize, Layout::create_executable_stack): Likewise.
13387 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13388 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13389 * layout.h (class Layout): Update declarations. Remove options_
13390 field. Add number_of_input_files_ and resized_signatures_
13391 fields. Move sections_are_attached_ field.
13392 * main.cc (main): Pass number of input files to Layout
13393 constructor. Don't pass options.
13394
154b857c
ILT
133952009-03-30 Ian Lance Taylor <iant@google.com>
13396
13397 * ffsll.c (ffsll): Correct implementation.
13398
2f35ab9b
ILT
133992009-03-27 Ian Lance Taylor <iant@google.com>
13400
fd03461a
ILT
13401 * ffsll.c: New file.
13402 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13403 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13404 * ftruncate.c (ftruncate): Declare before definition.
13405 * mremap.c (mremap): Likewise.
13406 * pread.c (pread): Likewise.
13407 * configure, Makefile.in, config.in: Rebuild.
13408
2f35ab9b
ILT
13409 * mremap.c: New file.
13410 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13411 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13412 (mremap): Declare if HAVE_MREMAP is not defined.
13413 * configure, Makefile.in, config.in: Rebuild.
13414
33aea2fd
CC
134152009-03-27 Cary Coutant <ccoutant@google.com>
13416
13417 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13418 position independent.
13419 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13420 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13421
6d479619
CC
134222009-03-24 Cary Coutant <ccoutant@google.com>
13423
13424 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13425 an executable.
13426 (needs_dynamic_reloc): Likewise.
13427
afc06bb8
ILT
134282009-03-24 Ian Lance Taylor <iant@google.com>
13429
13430 * yyscript.y (file_cmd): Recognize EXTERN.
13431 (extern_name_list, extern_name_list_body): New nonterminals.
13432 * script.cc (script_add_extern): Define.
13433 * script-c.h (script_add_extern): Declare.
13434
f6060a4d
ILT
134352009-03-24 Rafael Avila de Espindola <espindola@google.com>
13436
13437 * object.cc (is_elf_object): Define.
13438 * object.h (is_elf_object): Declare.
13439 * archive.cc (Archive::get_elf_object_for_member): Call
13440 is_elf_object.
33aea2fd 13441 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13442
26736d8e
ILT
134432009-03-24 Elliott Hughes <enh@google.com>
13444
13445 * output.cc (Output_file::map_anonymous): Define.
13446 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13447 try an anonymous one. Report the size if the mmap fails.
13448 * output.h (class Output_file): Declare map_anonymous.
13449
22fd9730
ILT
134502009-03-24 Ian Lance Taylor <iant@google.com>
13451
13452 * target-select.cc (instantiate_target): Don't acquire the lock if
13453 the instantiated_target_ field has already been set.
13454
cb010894
ILT
134552009-03-23 Ian Lance Taylor <iant@google.com>
13456
7f055c20
ILT
13457 * gold-threads.h (class Initialize_lock): Define.
13458 * gold-threads.cc (class Initialize_lock_once): Define.
13459 (initialize_lock_control): New static variable.
13460 (initialize_lock_pointer): New static variable.
13461 (initialize_lock_once): New static function.
13462 (Initialize_lock::Initialize_lock): Define.
13463 (Initialize_lock::initialize): Define.
13464 * target-select.h: Include "gold-threads.h".
13465 (class Target_selector): Add lock_ and initialize_lock_ fields.
13466 Don't define instantiate_target, just declare it.
13467 * target-select.cc (Target_selector::Target_selector): Initialize
13468 new fields.
13469 (Target_selector::instantiate_target): Define.
13470 * descriptors.h: Include "gold-threads.h".
13471 (class Descriptors): Add initialize_lock_ field.
13472 * descriptors.cc (Descriptors::Descriptors): Initialize new
13473 field.
13474 (Descriptors::open): Use initialize_lock_ field
13475 * errors.h (class Errors): Add initialize_lock_ field.
13476 * errors.cc (Errors::Errors): Initialize new field.
13477 (Errors::initialize_lock): Use initialize_lock_ field.
13478 * powerpc.cc (class Target_selector_powerpc): Remove
13479 instantiated_target_ field. In do_recognize call
13480 instantiate_target rather than do_instantiate_target. In
13481 do_instantiate_target just allocate a new target.
13482 * sparc.cc (class Target_selector_sparc): Likewise.
13483
36959681
ILT
13484 * freebsd.h: New file.
13485 * i386.cc: Include "freebsd.h".
13486 (Target_i386): Derive from Target_freebsd rather than
13487 Sized_target.
13488 (Target_selector_i386): Derive from Target_selector_freebsd rather
13489 than Target_selector.
13490 * x86_64.cc: Include "freebsd.h".
13491 (Target_x86_64): Derive from Target_freebsd rather than
13492 Sized_target.
13493 (Target_selector_x86_64): Derive from Target_selector_freebsd
13494 rather than Target_selector.
13495 * target.h (class Target): Add adjust_elf_header and
13496 do_adjust_elf_header.
13497 * output.cc (Output_file_header:: do_sized_write): Call target
13498 adjust_elf_header routine.
13499 * configure.tgt: Set targ_osabi.
13500 * configure.ac: Define GOLD_DEFAULT_OSABI.
13501 * parameters.cc (Parameters::default_target): Pass
13502 GOLD_DEFAULT_OSABI to select_target.
13503 * target-select.h (class Target_selector): Make instantiate_target
13504 protected rather than private.
13505 * Makefile.am (HFILES): Add freebsd.h.
13506 * configure, Makefile.in, config.in: Rebuild.
13507
cb010894
ILT
13508 * merge.cc (do_add_input_section): Correct pend value. Change
13509 message about last entry not being null terminated from error to
13510 warning.
13511
0e879927
ILT
135122009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13513
13514 * incremental.cc: New file.
13515 * Makefile.am (CCFILES): Add incremental.cc.
13516 * Makefile.in: Rebuild.
13517
41105937
PP
135182009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13519
13520 * layout.cc (Layout::output_section_name): Preserve names
13521 of '.note.' sections.
e1df38aa 13522
60439920
ILT
135232009-03-19 Ian Lance Taylor <iant@google.com>
13524
13525 * descriptors.cc (Descriptors::open): Check that the options are
13526 valid before using them.
13527
0d371ad3
ILT
135282009-03-18 Ian Lance Taylor <iant@google.com>
13529
13530 * script-sections.h: Include <list>.
13531 (class Script_sections): Change Sections_elements from std::vector
13532 to std::list. Typedef public Elements_iterator. Add
13533 orphan_section_placement_, data_segment_align_start_, and
13534 saw_data_segment_align_ fields. Remove data_segment_align_index_
13535 field.
13536 * script-sections.cc (class Orphan_section_placement): New class.
13537 (class Sections_element): Add virtual functions is_relro and
13538 orphan_section_init. Remove virtual function place_orphan_here.
13539 (class Output_section_definition): Add is_relro and
13540 orphan_section_init. Remove place_orphan_here.
13541 (class Orphan_output_section): Likewise.
13542 (Script_sections::Script_sections): Update for field changes.
13543 (Script_sections::data_segment_align): Set saw_data_segment_align_
13544 and data_segment_align_start_, not data_segment_align_index.
13545 (Script_sections::data_segment_relro_end): Check
13546 saw_data_segment_align_. Use data_segment_align_start_ rather
13547 than data_segment_align_index_.
13548 (Script_sections::place_orphan): Rewrite to use
13549 Orphan_section_placement.
13550
9201d894
ILT
135512009-03-17 Ian Lance Taylor <iant@google.com>
13552
9c5b8369
ILT
13553 * archive.cc (Archive::add_symbols): Check for a version attached
13554 to the symbol name in the archive map.
13555 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13556 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13557 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13558 (ver_test_11.a): New target.
13559 * testsuite/Makefile.in: Rebuild.
13560
9201d894
ILT
13561 * configure.ac: Check for chsize and posix_fallocate. Replace
13562 ftruncate.
13563 * ftruncate.c: New file, from gnulib.
13564 * output.cc (posix_fallocate): Define dummy version if not
13565 HAVE_POSIX_FALLOCATE.
13566 (Output_file::map): Call posix_fallocate rather than lseek and
13567 write.
13568 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13569 * configure, Makefile.in, config.in: Rebuild.
13570
ef4ab7a8 135712009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13572
ef4ab7a8
PP
13573 * layout.h (Layout::create_note): Add section_name parameter.
13574 * layout.cc (Layout::create_note): Likewise.
13575 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13576
8c500701
ILT
135772009-03-17 Ian Lance Taylor <iant@google.com>
13578
e85b18e1
ILT
13579 * descriptors.cc: Include "options.h".
13580 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13581 (Descriptors::open): Always use O_CLOEXEC when opening a new
13582 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13583 then set FD_CLOEXEC.
13584
9efe6174
ILT
13585 * sparc.cc (class Target_sparc): Add has_got_section.
13586 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13587 make sure we have a GOT section.
13588
13589 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13590 (Target_sparc::Scan::local): Likewise.
13591 (Target_sparc::Scan::global): Likewise.
13592 (Target_sparc::Relocate::relocate): Likewise.
13593 (Target_sparc::Relocate::relocate_tls): Likewise.
13594
8c500701
ILT
13595 * symtab.cc (Symbol_table::define_default_version): New function,
13596 broken out of add_from_object.
13597 (Symbol_table::add_from_object): Call define_default_version.
13598 (Symbol_table::define_special_symbol): Add resolve_oldsym
13599 parameter. Change all callers. If the version for a symbol comes
13600 from a version script, resolve it with the symbol with the same
13601 name with no version. Also add the symbol without a version if
13602 appropriate.
13603 (do_define_in_output_data): If resolving with oldsym, don't delete
13604 sym.
13605 (do_define_in_output_segment): Likewise.
13606 (do_define_as_constant): Likewise.
13607 * symtab.h (class Symbol_table): Update declarations.
13608
f1ed28fb
ILT
136092009-03-13 Ian Lance Taylor <iant@google.com>
13610
15f8229b
ILT
13611 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13612 (Read_symbols::requeue): New function.
13613 (Read_symbols::do_read_symbols): If make_elf_object fails because
13614 the target type is not configured, and the file was searched for,
13615 issue a warning and retry with the next directory.
13616 (Add_symbols::run): If the file has an incompatible format, and
13617 it was searched for, requeue the Read_symbols task. On error,
13618 release the object.
13619 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13620 dirindex parameter to constructor. Change all callers. Declare
13621 incompatible_warning and requeue.
13622 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13623 input_argument_ and input_group_ fields. Add them to
13624 constructor. Change all callers.
13625 (class Read_script): Add dirindex_ field. Add it to constructor.
13626 Change all callers.
13627 * archive.cc (Archive::setup): Remove input_objects parameter.
13628 Change all callers.
13629 (Archive::get_file_and_offset): Likewise.
13630 (Archive::read_all_symbols): Likewise.
13631 (Archive::read_symbols): Likewise.
13632 (Archive::get_elf_object_for_member): Remove input_objects
13633 parameter. Add punconfigured parameter. Change all callers.
13634 (Archive::add_symbols): Change return type to bool. Check return
13635 value of include_member.
13636 (Archive::include_all_members): Likewise.
13637 (Archive::include_member): Change return type to bool. Return
13638 false if first included object has incompatible target. Set
13639 included_member_ field.
13640 (Add_archive_symbols::run): If add_symbols returns false, requeue
13641 Read_symbols task.
13642 * archive.h (class Archive): Add included_member_ field.
13643 Initialize it in constructor. Add input_file and searched_for
13644 methods. Update declarations.
13645 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13646 input_argument_ fields. Add them to constructor. Change all
13647 callers.
13648 * script.cc: Include "target-select.h".
13649 (class Parser_closure): Add skip_on_incompatible_target_ and
13650 found_incompatible_target_ fields. Add
13651 skip_on_incompatible_target parameter to constructor. Change all
13652 callers. Add methods skip_on_incompatible_target,
13653 clear_skip_on_incompatible_target, found_incompatible_target, and
13654 set_found_incompatible_target.
13655 (read_input_script): Add dirindex parameter. Change all callers.
13656 If parser finds an incompatible target, requeue Read_symbols
13657 task.
13658 (script_set_symbol): Clear skip_on_incompatible_target in
13659 closure.
13660 (script_add_assertion, script_parse_option): Likewise.
13661 (script_start_sections, script_add_phdr): Likewise.
13662 (script_check_output_format): New function.
13663 * script.h (read_input_script): Update declaration.
13664 * script-c.h (script_check_output_format): Declare.
13665 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13666 (ignore_cmd): Remove OUTPUT_FORMAT.
13667 * fileread.cc (Input_file::Input_file): Add explicit this.
13668 (Input_file::will_search_for): New function.
13669 (Input_file::open): Add pindex parameter. Change all callers.
13670 * fileread.h (class Input_file): Add input_file_argument method.
13671 Declare will_search_for. Update declarations.
13672 * object.cc (make_elf_object): Add punconfigured parameter.
13673 Change all callers.
13674 * object.h (class Object): Make input_file public. Add
13675 searched_for method.
13676 (make_elf_object): Update declaration.
13677 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13678 restart search.
13679 * dirsearch.h (class Dirsearch): Update declaration.
13680 * options.h (class General_options): Add --warn-search-mismatch.
13681 * parameters.cc (Parameters::is_compatible_target): New function.
13682 * parameters.h (class Parameters): Declare is_compatible_target.
13683 * workqueue.cc (Workqueue::add_blocker): New function.
13684 * workqueue.h (class Workqueue): Declare add_blocker.
13685
f1ed28fb
ILT
13686 * fileread.cc (Input_file::open): Remove options parameter.
13687 Change all callers.
13688 (Input_file::open_binary): Likewise.
13689 * script.cc (read_input_script): Likewise.
13690 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13691 options parameter from constructor. Change all callers.
13692 (class Read_script): Likewise.
13693 * fileread.h (class Input_file): Update declarations.
13694 * script.h (read_input_script): Update declaration.
13695
34dd024a
NC
136962009-03-10 Nick Clifton <nickc@redhat.com>
13697
13698 * po/es.po: New Spanish translation.
13699
6d71b17c
CC
137002009-03-06 Cary Coutant <ccoutant@google.com>
13701
13702 * options.cc (parse_short_option): Keep dash_z from registering itself.
13703
031cdbed
ILT
137042009-03-03 Ian Lance Taylor <iant@google.com>
13705
13706 PR 9918
13707 * target-reloc.h (relocate_section): Pass output_section to
13708 relocate.
13709 * i386.cc (Target_i386::should_apply_static_reloc): Add
13710 output_section parameter. Change all callers.
13711 (Target_i386::Relocate::relocate): Add output_section parameter.
13712 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13713 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13714 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13715 * testsuite/two_file_shared.sh: New script.
13716 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13717 (check_DATA): Add two_file_shared.dbg.
13718 (two_file_shared.dbg): New target.
13719 * testsuite/Makefile.in: Rebuild.
13720
15d5fa16
ILT
137212009-03-01 Ian Lance Taylor <iant@google.com>
13722
13723 * configure.ac: Check for byteswap.h.
13724 * configure: Rebuild.
13725 * config.in: Rebuild.
13726
8a4c0b0d
ILT
137272009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13728
13729 * layout.cc (Layout::find_or_add_kept_section): New function.
13730 (Layout::add_comdat): Removed.
13731 * layout.h (struct Kept_section): Move out of class Layout.
13732 Remove trailing underscores from field names. Add group_sections
13733 field. Rename group_ field to is_group. Change all uses.
13734 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13735 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13736 comdat_groups_ field.
13737 (Sized_relobj::include_section_group): Use
13738 find_or_add_kept_section and Kept_section::group_sections.
13739 (Sized_relobj::include_linkonce_section): Likewise.
13740 * object.cc (class Sized_relobj): Don't define Comdat_group or
13741 Comdat_group_table. Remove find_comdat_group and
13742 add_comdat_group. Remove comdat_groups_ field.
13743 * plugin.cc (include_comdat_group): Use
13744 Layout::find_or_add_kept_section.
13745
b4ecf66b
ILT
137462009-02-28 Ian Lance Taylor <iant@google.com>
13747
14359ca0
ILT
13748 * README: --gc-sections and map files are now supported. Document
13749 some build requirements.
13750
b4ecf66b
ILT
13751 PR 6992
13752 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13753 relocatable link set the value of the section symbol to zero.
13754 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13755 relocatable link don't include the section address in the local
13756 symbol value.
13757
0602e05a
ILT
137582009-02-27 Ian Lance Taylor <iant@google.com>
13759
fd9d194f
ILT
13760 PR 6811
13761 * options.h (class Search_directory): Add is_system_directory.
13762 (class General_options): Declare is_in_system_directory.
13763 * options.cc (get_relative_sysroot): Make static.
13764 (get_default_sysroot): Make static.
13765 (General_optoins::is_in_system_directory): New function.
13766 * fileread.cc (Input_file::is_in_system_directory): New function.
13767 * fileread.h (class Input_file): Declare is_in_system_directory.
13768 * object.h (class Object): Add is_in_system_directory.
13769 (class Input_objects): Remove system_library_directory_ field.
13770 * object.cc (Input_objects::add_object): Don't set
13771 system_library_directory_.
13772 (input_objects::found_in_system_library_directory): Remove.
13773 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13774 parameter. Change all callers.
13775 (Symbol_table::sized_write_globals): Likewise.
13776 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13777 Call Object::is_in_system_directory.
13778 * symtab.h (class Symbol_table): Update declarations.
13779
61edd21f
ILT
13780 PR 5990
13781 * descriptors.h (Open_descriptor): Add is_on_stack field.
13782 * descriptors.cc (Descriptors::open): If the descriptor is on the
13783 top of the stack, remove it. Initialize is_on_stack field.
13784 (Descriptors::release): Only add pod to stack if it is not on the
13785 stack already.
13786 (Descriptors::close_some_descriptor): Clear stack_next and
13787 is_on_stack fields.
13788
e29e076a
ILT
13789 PR 7091
13790 * output.cc (Output_section::find_starting_output_address): Rename
13791 from starting_output_address; add PADDR parameter; change return
13792 type.
13793 * output.h (class Output_section): Declare
13794 find_starting_output_address instead of starting_output_address.
13795 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13796 section symbol for which we can't find a merge section.
13797
0602e05a
ILT
13798 PR 9836
13799 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13800 hidden or internal, force the symbol to be local.
13801 * resolve.cc (Symbol::override_visibility): Define.
13802 (Symbol::override_base): Use override_visibility.
13803 (Symbol_table::resolve): Likewise.
13804 (Symbol::override_base_with_special): Likewise.
13805 (Symbol_table::override_with_special): If the visibility is hidden
13806 or internal, force the symbol to be local.
13807 * symtab.h (class Symbol): Add set_visibility and
13808 override_visibility.
13809 * testsuite/ver_test_1.sh: New file.
13810 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13811 (check_DATA): Add ver_test_1.syms.
13812 (ver_test_1.syms): New target.
13813 * testsuite/Makefile.in: Rebuild.
13814
401a9a73
CC
138152009-02-25 Cary Coutant <ccoutant@google.com>
13816
13817 * layout.cc (Layout::choose_output_section): Don't rename sections
13818 when using a linker script that has a SECTIONS clause.
13819 * Makefile.in: Regenerate.
13820
13821 * testsuite/Makefile.am (script_test_5.sh): New test case.
13822 * testsuite/Makefile.in: Regenerate.
13823 * testsuite/script_test_5.cc: New file.
13824 * testsuite/script_test_5.sh: New file.
13825 * testsuite/script_test_5.t: New file.
13826
f488e4b0
CC
138272009-02-13 Rafael Avila de Espindola <espindola@google.com>
13828
13829 * archive.cc (Archive::include_member): Update calls to add_symbols.
13830 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13831 the Layout argument.
13832 * dynobj.h (do_add_symbols): Add the Layout argument.
13833 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13834 Layout argument.
13835 * object.h (Object::add_symbols): Add the Layout argument.
13836 (Object::do_add_symbols): Add the Layout argument.
13837 (Sized_relobj::do_add_symbols): Add the Layout argument.
13838 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13839 Unify the two versions.
13840 (Add_plugin_symbols): Remove.
13841 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13842 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13843 (Add_plugin_symbols): Remove.
13844 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13845 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13846 (Add_symbols::run): Make it work with Pulginobj.
13847
89dd1680
ILT
138482009-02-06 Ian Lance Taylor <iant@google.com>
13849
13850 * object.cc (Sized_relobj::do_layout): Make info message start
13851 with lower case letter.
13852
266d0a74
ILT
138532009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13854
602b464e
ILT
13855 * binary.cc: Fix file comment.
13856
266d0a74
ILT
13857 * options.h (enum Incremental_disposition): Define.
13858 (class General_options): Add new options: --incremental,
13859 --incremental_changed, --incremental_unchanged,
13860 --incremental_unknown. Add incremental_disposition_ and
13861 implicit_incremental_ fields.
13862 (General_options::incremental_disposition): New function.
13863 (class Position_dependent_options): Add incremental_disposition
13864 option.
13865 (Position_dependent_options::copy_from_options): Set incremental
13866 dispositions.
13867 * options.cc (General_options::parse_incremental_changed): New
13868 function.
2e702c99
RM
13869 (General_options::parse_incremental_unchanged): New function.
13870 (General_options::parse_incremental_unknown): New function.
13871 (General_options::General_options): Initialize new fields
266d0a74 13872 incremental_disposition_ and implicit_incremental_.
2e702c99 13873 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13874 without --incremental.
13875
f073bbf7
CD
138762009-02-06 Chris Demetriou <cgd@google.com>
13877
13878 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13879 pointer and to report location as the file name associated with
13880 the symbol.
13881 (gold_undefined_symbol_at_location): New function to replace the
13882 old gold_undefined_symbol functionality.
13883 * target-reloc.h (relocate_section): Update to use
13884 gold_undefined_symbol_at_location.
13885 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13886 Call gold_undefined_symbol function rather than gold_error.
13887 * errors.h (Errors::undefined_symbol): Take location as a
13888 string, rather than calculating it from a relocation.
13889 * errors.cc (Errors::fatal): Print "fatal error:" before the
13890 formatted message.
13891 (Errors::error, Errors::error_at_location): Print "error: "
13892 before the formatted message.
13893 (Errors::undefined_symbol): Take location as a string, rather
13894 than calculating it from a relocation.
13895 (gold_undefined_symbol_at_location): New function akin to
13896 old gold_undefined_symbol, calculates location from relocation.
13897 (gold_undefined_symbol): Change to take only a Symbol pointer
13898 and to report location as the file name associated with the symbol.
13899 * testsuite/debug_msg.sh: Update for changed error messages.
13900 * testsuite/undef_symbol.sh: Likewise.
13901
8e94a90c
ILT
139022009-02-04 Duncan Sands <baldrick@free.fr>
13903
13904 PR 9812
13905 * reduced_debug_output.h
13906 (Output_reduced_debug_abbrev_section::failed): Use format for
13907 gold_warning.
13908 (Output_reduced_debug_info_section::faild): Likewise.
13909
88a0e15b
ILT
139102009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13911
13912 * script.cc (Lazy_demangler): New class.
2e702c99 13913 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13914 symbol only once.
13915
5efc7cd2
CC
139162009-01-29 Cary Coutant <ccoutant@google.com>
13917
13918 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13919 to __tls_get_addr.
13920 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13921
e0ebcf42
ILT
139222009-01-28 Ian Lance Taylor <iant@google.com>
13923
5efc7cd2 13924 * version.cc (version_string): Bump to 1.9.
75fe7426 13925
e0ebcf42
ILT
13926 * gold.h: Include <cstring> and <stdint.h>.
13927 * version.cc: Include <cstdio>.
13928 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13929 warning.
13930 * reduced_debug_output.cc (insert_into_vector): Rename from
13931 Insert_into_vector; change all callers. Use Swap_unaligned to
13932 avoid aliasing issue; remove union since it is unnecessary.
13933
8e2813be 139342009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13935
13936 * Makefile.am (CCFILES): Add gc.cc.
13937 (HFILES): Add gc.h.
13938 * Makefile.in: Regenerate.
13939 * gold.cc (Gc_runner): New class.
13940 (queue_initial_tasks): Call garbage collection related tasks
13941 when corresponding options are invoked.
13942 (queue_middle_gc_tasks): New function.
13943 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13944 processed early before laying out sections during garbage collection.
13945 * gold.h (queue_middle_gc_tasks): New function.
13946 (is_prefix_of): Move from "layout.cc".
13947 * i386.cc (Target_i386::gc_process_relocs): New function.
13948 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13949 * main.cc (main): Create object of class "Garbage_collection".
13950 * object.cc (Relobj::copy_symbols_data): New function.
13951 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13952 (Sized_relobj::do_layout): Allow this function to be called twice
13953 during garbage collection and defer layout of section during the
6d03d481
ST
13954 first call.
13955 * object.h (Relobj::get_symbols_data): New function.
13956 (Relobj::is_section_name_included): New function.
13957 (Relobj::copy_symbols_data): New function.
13958 (Relobj::set_symbols_data): New function.
13959 (Relobj::get_relocs_data): New function.
13960 (Relobj::set_relocs_data): New function.
13961 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13962 (Relobj::gc_process_relocs): New function.
13963 (Relobj::do_gc_process_relocs): New pure virtual function.
13964 (Relobj::sd_): New data member.
13965 (Sized_relobj::is_output_section_offset_invalid): New function.
13966 (Sized_relobj::do_gc_process_relocs): New function.
13967 * options.h (General_options::gc_sections): Modify to not be a no-op.
13968 (General_options::print_gc_sections): New option.
13969 * plugin.cc (Plugin_finish::run): Remove function call to
13970 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13971 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13972 * reloc.cc (Read_relocs::run): Add task to process relocs and
13973 determine unreferenced sections when doing garbage collection.
13974 (Gc_process_relocs): New class.
13975 (Sized_relobj::do_gc_process_relocs): New function.
13976 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13977 sections that are garbage collected.
13978 * reloc.h (Gc_process_relocs): New class.
13979 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13980 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13981 symbols whose corresponding sections are garbage collected.
13982 (Symbol_table::Symbol_table): Add new parameter for the garbage
13983 collection object.
13984 (Symbol_table::gc_mark_undef_symbols): New function.
13985 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13986 (Symbol_table::gc_mark_dyn_syms): New function.
13987 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13988 as garbage.
13989 (Symbol_table::add_from_object): Likewise.
13990 (Symbol_table::add_from_relobj): When building shared objects, do not
13991 treat externally visible symbols as garbage.
13992 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13993 table information for static and relocatable links.
13994 * symtab.h (Symbol_table::set_gc): New function.
13995 (Symbol_table::gc): New function.
13996 (Symbol_table::gc_mark_undef_symbols): New function.
13997 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13998 (Symbol_table::gc_mark_dyn_syms): New function.
13999 (Symbol_table::gc_): New data member.
e1df38aa 14000 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14001 function.
14002 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14003 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14004
3b293544
CF
140052009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14006
14007 * options.h (General_options::gc_sections): Define as a no-op for now.
14008 (General_options::no_keep_memory): Ditto.
14009 (General_options::Bshareable): Define.
14010 * options.cc (General_options::finalize): Honor -Bshareable.
14011
83d22aa8
AS
140122009-01-20 Andreas Schwab <schwab@suse.de>
14013
14014 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14015 read the value in the contents, since we don't use it. Use the
14016 template endianness when writing.
14017 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14018
cd536b21
AS
140192009-01-19 Andreas Schwab <schwab@suse.de>
14020
14021 * configure.tgt (powerpc64-*): Fix targ_obj.
14022
99e9a495
ILT
140232009-01-15 Ian Lance Taylor <iant@google.com>
14024
14025 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14026 local symbols when stripping all symbols.
14027
bbbfea06
CC
140282009-01-14 Cary Coutant <ccoutant@google.com>
14029
99e9a495 14030 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14031
0f7c0701
CC
140322009-01-14 Cary Coutant <ccoutant@google.com>
14033
14034 * archive.cc (Archive::get_elf_object_for_member): Remove call
14035 to File_read::claim_for_plugin.
14036 * descriptors.cc (Descriptors::open): Remove reference to
14037 is_claimed.
14038 (Descriptors::claim_for_plugin): Remove.
14039 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14040 (Descriptors::is_claimed): Remove.
14041 (claim_descriptor_for_plugin): Remove.
14042 * fileread.cc (File_read::claim_for_plugin): Remove.
14043 * fileread.h (File_read::claim_for_plugin): Remove.
14044 (File_read::descriptor): Reopen descriptor if necessary.
14045 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14046 (Plugin_manager::all_symbols_read): Add task parameter. Change
14047 all callers.
14048 (Plugin_manager::get_input_file): New function.
14049 (Plugin_manager::release_input_file): New function.
14050 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14051 corresponding data member.
14052 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14053 and pass to base constructor. Change all callers.
14054 (get_input_file, release_input_file): New functions.
14055 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14056 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14057 (Plugin_manager::all_symbols_read): Add task parameter.
14058 (Plugin_manager::get_input_file): New function.
14059 (Plugin_manager::release_input_file): New function.
14060 (Plugin_manager::task_): New data member.
14061 (Pluginobj::Pluginobj): Add filesize parameter.
14062 (Pluginobj::filename): New function.
14063 (Pluginobj::descriptor): New function.
14064 (Pluginobj::filesize): New function.
14065 (Pluginobj::filesize_): New data member.
14066 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14067 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14068 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14069
14070 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14071 with archive libraries.
14072 * testsuite/Makefile.in: Regenerate.
14073 * testsuite/plugin_test.c (struct sym_info): New type.
14074 (get_input_file, release_input_file): New static variables.
14075 (onload): Capture new transfer vector entries.
14076 (claim_file_hook): Stop reading at end of file according to filesize.
14077 Factor out parsing of readelf output into separate function.
14078 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14079 APIs and get the source file name from the symbol table. Convert
14080 source file name to corresponding object file name. Print info
14081 message when adding new input files.
14082 (parse_readelf_line): New function.
14083 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14084 * testsuite/plugin_test_2.sh: Likewise.
14085 * testsuite/plugin_test_3.sh: Likewise.
14086 * testsuite/plugin_test_4.sh: New test case.
14087
62a6d109
ILT
140882009-01-07 Ian Lance Taylor <iant@google.com>
14089
14090 * version.cc (version_string): Bump to 1.8.
14091
483620e8
CC
140922008-12-23 Cary Coutant <ccoutant@google.com>
14093
14094 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14095 * plugin.cc (Plugin_manager::finish): Rename as
14096 layout_deferred_objects. Move cleanup to separate function.
14097 (Plugin_manager::cleanup): New function.
14098 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14099 separately.
14100 * plugin.h (Plugin_manager::finish): Rename as
14101 layout_deferred_objects.
14102 (Plugin_manager::cleanup): New function.
14103 (Plugin_manager::cleanup_done): New field.
14104
d66a9eb3
CC
141052008-12-23 Cary Coutant <ccoutant@google.com>
14106
14107 * plugin.cc (is_visible_from_outside): New function.
14108 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14109 so we don't return "IR only" status for exported symbols or -r links.
14110
14111 * testsuite/Makefile.am (plugin_test_3): New test case.
14112 * testsuite/Makefile.in: Regenerate.
14113 * testsuite/plugin_test_3.sh: New file.
14114
5995b570
CC
141152008-12-22 Cary Coutant <ccoutant@google.com>
14116
14117 * object.cc (Sized_relobj::layout_section): New function.
14118 (Sized_relobj::do_layout): Defer layout of input sections until after
14119 plugin has provided replacement files.
14120 (Sized_relobj::do_layout_deferred_sections): New function.
14121 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14122 (Relobj::layout_deferred_sections): New function.
14123 (Relobj::do_layout_deferred_sections): New function.
14124 (Sized_relobj::do_layout_deferred_sections): New function.
14125 (Sized_relobj::layout_section): New function.
14126 (Sized_relobj::Deferred_layout): New structure.
14127 (Sized_relobj::deferred_layout_): New field.
14128 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14129 Change all callers. Layout deferred sections.
14130 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14131 references.
14132 (Plugin_hook::run): Move code from do_plugin_hook inline.
14133 (Plugin_hook::do_plugin_hook): Remove.
14134 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14135 (Plugin_manager::finish): Renamed, was cleanup.
14136 (Plugin_manager::should_defer_layout): New function.
14137 (Plugin_manager::add_deferred_layout_object): New function.
14138 (Plugin_manager::Deferred_layout_list): New type.
14139 (Plugin_manager::deferred_layout_objects_): New field.
14140 (Plugin_hook::do_plugin_hook): Remove.
14141
ee769c88
ILT
141422008-12-17 Ian Lance Taylor <iant@google.com>
14143
14144 * options.h (class General_options): Add --no case for
14145 --export-dynamic.
14146
abc8dcba
CC
141472008-12-16 Cary Coutant <ccoutant@google.com>
14148
14149 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14150 vector.
14151 (Plugin_manager::claim_file): Create plugin object even if
14152 plugin did not call the add_symbols callback.
14153 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14154 asking for more symbols than were added.
14155 * testsuite/Makefile.am (plugin_test_1): Add test case with
14156 no global symbols.
14157 (empty.syms): New target.
14158 * testsuite/Makefile.in: Regenerate.
14159 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14160 message. Don't call add_symbols if no globals.
14161 (all_symbols_read_hook): Don't provide replacement for empty
14162 claimed file.
14163
b0074644
ILT
141642008-12-12 Ian Lance Taylor <iant@google.com>
14165
68943102
ILT
14166 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14167 r_type == 0 for a local symbol with r_sym == 0.
14168 (scan_relocatable_relocs): Pass r_sym to
14169 local_non_section_strategy.
14170 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14171 r_sym parameter.
14172
b0074644
ILT
14173 * configure.ac: Update test for TLS descriptors: they are
14174 supported as of glibc 2.9.
14175 * configure: Rebuild.
14176
c2508178
ILT
141772008-12-11 Ian Lance Taylor <iant@google.com>
14178
14179 PR 7091
14180 * target-reloc.h (Default_scan_relocatable_relocs): For each
14181 function, map r_type == 0 to RELOC_DISCARD.
14182
2756a258
CC
141832008-12-10 Cary Coutant <ccoutant@google.com>
14184
14185 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14186 object to override a kept COMDAT group from a plugin object.
14187
bb6f53d3
ILT
141882008-12-09 Ian Lance Taylor <iant@google.com>
14189
fbc558e1
ILT
14190 PR 7088
14191 * yyscript.y (file_cmd): Handle INPUT.
14192
bb6f53d3
ILT
14193 * testsuite/initpri1.c: Change all declarations to be full
14194 prototypes by adding void, to avoid compiler warnings.
14195
4674ecfc
CC
141962008-12-05 Rafael Avila de Espindola <espindola@google.com>
14197
14198 * options.cc (General_options::parse_plugin_opt): New.
14199 (General_options::add_plugin): The argument now is just the filename.
14200 (General_options::add_plugin_option): New.
14201 * options.h (plugin_opt): New.
14202 (add_plugin): Change argument name.
14203 (add_plugin_option): New.
14204 * plugin.cc (Plugin::load): Don't parse the plugin option.
14205 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14206 (Plugin::add_option): New.
14207 (Plugin::args_): Change type.
14208 (Plugin::filename_): New.
14209 (Plugin_manager::add_plugin_option): New.
14210 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14211 * testsuite/Makefile.in: Regenerate.
14212
fd06b4aa
CC
142132008-12-05 Cary Coutant <ccoutant@google.com>
14214
14215 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14216 Handle --strip-lto-sections option.
14217 * options.h (strip_lto_sections): New option.
14218
6c52134c
CC
142192008-12-01 Cary Coutant <ccoutant@google.com>
14220
14221 * plugin.cc (ld_plugin_message): Change format parameter to const.
14222 Fix mismatch between new[] and delete.
14223
a45248e0
CC
142242008-11-14 Cary Coutant <ccoutant@google.com>
14225
14226 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14227 instead of -1U.
14228
c82fbeee
CS
142292008-11-05 Craig Silverstein <csilvers@google.com>
14230
14231 * options.cc (General_options::parse_dynamic_list): New function.
14232 * options.h (General_options): New flags dynamic_list,
14233 dynamic_list_data, dynamic_list_cpp_new, and
14234 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14235 (General_options::in_dynamic_list): New function.
14236 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14237 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14238 (Lex::can_continue_name): Likewise.
14239 (yylex): Likewise.
14240 (read_script_file): New parameter script_options.
14241 (read_dynamic_list): New function.
14242 (Script_options::define_dynamic_list): New function.
14243 (dynamic_list_keyword_parsecodes): New variable.
14244 (dynamic_list_keywords): New variable.
14245 * script.h (Script_options::define_dynamic_list): New function
14246 prototype.
14247 (read_dynamic_list): New function prototype.
14248 * symtab.cc (strprefix): New macro.
14249 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14250 dynamic_list_data, dynamic_list_cpp_new, and
14251 dynamic_list_cpp_typeinfo.
14252 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14253 (dynamic_list_expr): New rule.
14254 (dynamic_list_nodes): Likewise.
14255 (dynamic_list_node): Likewise.
14256 * testsuite/Makefile.am (dynamic_list): New test.
14257 * testsuite/Makefile.in: Regenerated.
14258 * testsuite/dynamic_list.t: New file.
14259 * testsuite/dynamic_list.sh: New file.
14260
e0bb29a5
CS
142612008-11-05 Craig Silverstein <csilvers@google.com>
14262
14263 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14264 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14265 (t11_last): Likewise.
14266 * testsuite/ver_test_6.c (main): Likewise.
14267
4e1e25e0
CC
142682008-10-07 Cary Coutant <ccoutant@google.com>
14269
14270 * options.c (General_options::finalize): Add check for -static and
14271 -shared.
14272 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14273 is not empty.
14274
92f03fcb
CC
142752008-10-02 Cary Coutant <ccoutant@google.com>
14276
14277 * plugin.cc (make_sized_plugin_object): Fix conditional
14278 compilation to work when not all targets are enabled.
14279
fbd8a257
CC
142802008-09-29 Cary Coutant <ccoutant@google.com>
14281
14282 * archive.cc (Archive::get_file_and_offset): Use filename instead
14283 of name to get library path.
14284 (Archive::include_member): Unlock external member of a thin archive.
14285
14286 * testsuite/Makefile.am (TEST_AR): New variable.
14287 (thin_archive_test_1): New test.
14288 (thin_archive_test_2): New test.
81636b3f
CC
14289 * testsuite/Makefile.in: Regenerate.
14290 * testsuite/thin_archive_main.cc: New file.
14291 * testsuite/thin_archive_test_1.cc: New file.
14292 * testsuite/thin_archive_test_2.cc: New file.
14293 * testsuite/thin_archive_test_3.cc: New file.
14294 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14295
eff45813
CC
142962008-09-29 Cary Coutant <ccoutant@google.com>
14297
14298 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14299 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14300 instead of -1U.
14301 (Sized_relobj::do_finalize_local_symbols): Likewise.
14302 (Sized_relobj::map_to_kept_section): Likewise.
14303 * object.h (Sized_relobj::invalid_address): New constant.
14304 (Sized_relobj::do_output_section_offset): Check for invalid_address
14305 and return -1ULL.
14306 * output.cc (Output_reloc::local_section_offset): Use constant
14307 invalid_address instead of -1U.
14308 (Output_reloc::get_address): Likewise.
14309 (Output_section::output_address): Change -1U to -1ULL.
14310 * output.h (Output_reloc::invalid_address): New constant.
14311 * reloc.cc (Sized_relobj::write_sections): Use constant
14312 invalid_address instead of -1U.
14313 (Sized_relobj::relocate_sections): Likewise.
14314 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14315 values for merge sections.
14316 * target-reloc.h (relocate_for_relocatable): Use constant
14317 invalid_address instead of -1U.
14318
89fc3421
CC
143192008-09-19 Cary Coutant <ccoutant@google.com>
14320
14321 Add plugin functionality for link-time optimization (LTO).
14322 * configure.ac (plugins): Add --enable-plugins option.
14323 * configure: Regenerate.
14324 * config.in: Regenerate.
14325 * Makefile.am (LIBDL): New variable.
14326 (CCFILES): Add plugin.cc.
14327 (HFILES): Add plugin.h.
14328 (ldadd_var): Add LIBDL.
14329 * Makefile.in: Regenerate.
14330
14331 * archive.cc: Include "plugin.h".
14332 (Archive::setup): Don't preread archive symbols when using a plugin.
14333 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14334 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14335 files.
14336 (Archive::include_member): Add symbols from plugin objects.
14337 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14338 * descriptors.cc (Descriptors::open): Check for file descriptors
14339 abandoned by plugins.
14340 (Descriptors::claim_for_plugin): New function.
14341 * descriptors.h (Descriptors::claim_for_plugin): New function.
14342 (Open_descriptor::is_claimed): New field.
14343 (claim_descriptor_for_plugin): New function.
14344 * fileread.cc (File_read::claim_for_plugin): New function.
14345 * fileread.h (File_read::claim_for_plugin): New function.
14346 (File_read::descriptor): New function.
14347 * gold.cc: Include "plugin.h".
14348 (queue_initial_tasks): Add task to call plugin hooks for generating
14349 new object files.
14350 * main.cc: Include "plugin.h".
14351 (main): Load plugin libraries.
14352 * object.h (Pluginobj): Declare.
14353 (Object::pluginobj): New function.
14354 (Object::do_pluginobj): New function.
14355 (Object::set_target): New function.
14356 * options.cc: Include "plugin.h".
14357 (General_options::parse_plugin): New function.
14358 (General_options::General_options): Initialize plugins_ field.
14359 (General_options::add_plugin): New function.
14360 * options.h (Plugin_manager): Declare.
14361 (General_options): Add --plugin option.
14362 (General_options::has_plugins): New function.
14363 (General_options::plugins): New function.
14364 (General_options::add_plugin): New function.
14365 (General_options::plugins_): New field.
14366 * plugin.cc: New file.
14367 * plugin.h: New file.
14368 * readsyms.cc: Include "plugin.h".
14369 (Read_symbols::do_read_symbols): Check for archive before checking
14370 for ELF file. Call plugin hooks to claim files.
14371 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14372 from a real object file; force override when processing replacement
14373 files.
14374 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14375 (Symbol::init_base_object): Likewise.
14376 (Symbol::init_base_output_data): Likewise.
14377 (Symbol::init_base_output_segment): Likewise.
14378 (Symbol::init_base_constant): Likewise.
14379 (Symbol::init_base_undefined): Likewise.
14380 (Symbol::output_section): Assert that object is not a plugin.
14381 (Symbol_table::add_from_pluginobj): New function.
14382 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14383 undefined.
14384 (Symbol_table::sized_write_globals): Likewise.
14385 (Symbol_table::add_from_pluginobj): Instantiate template.
14386 * symtab.h (Sized_pluginobj): Declare.
14387 (Symbol::in_real_elf): New function.
14388 (Symbol::set_in_real_elf): New function.
14389 (Symbol::in_real_elf_): New field.
14390 (Symbol_table::add_from_pluginobj): New function.
14391
14392 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14393 (LIBDL): New variable.
14394 (LDADD): Add LIBDL.
14395 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14396 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14397 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14398 (MOSTLYCLEANFILES): Likewise.
14399 * testsuite/Makefile.in: Regenerate.
14400 * testsuite/plugin_test.c: New file.
14401 * testsuite/plugin_test_1.sh: New file.
14402 * testsuite/plugin_test_2.sh: New file.
14403
de31bda5
ILT
144042008-09-16 Ian Lance Taylor <iant@google.com>
14405
9c2d0ef9
ILT
14406 * target-reloc.h (relocate_section): Check whether a symbol is
14407 defined by the ABI before reporting an undefined symbol error.
14408 * target.h (Target::is_defined_by_abi): Make parameter const.
14409 (Target::do_is_defined_by_abi): Likewise.
14410 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14411 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14412 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14413 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14414 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14415 * testsuite/Makefile.in: Rebuild.
14416
de31bda5
ILT
14417 * fileread.cc (make_view): Add casts to avoid warning.
14418
9fa33bee
AO
144192008-09-16 Alexandre Oliva <aoliva@redhat.com>
14420
14421 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14422 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14423
183fd0e3
AO
144242008-09-16 Alexandre Oliva <aoliva@redhat.com>
14425
14426 * options.h (General_options::output_is_executable): New.
14427 (General_options::output_is_pie): New.
14428 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14429 for shared libraries.
14430 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14431
7be8330a
CD
144322008-09-11 Chris Demetriou <cgd@google.com>
14433
14434 * options.h (origin): New -z option.
14435 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14436 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14437 in DT_FLAGS_1.
14438
a9caad02
CC
144392008-09-05 Cary Coutant <ccoutant@google.com>
14440
14441 * fileread.cc (File_read::make_view): Add check for attempt to map
14442 beyond end of file.
14443
ae6dce4d
CC
144442008-09-05 Cary Coutant <ccoutant@google.com>
14445
14446 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14447 explicit instantiations.
14448
d7ab2a47
KVH
144492008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14450
14451 PR gold/6858
14452 * options.cc (General_options::finalize): Allow undefined symbols
14453 in shlibs if linking -shared.
14454
14455 PR gold/6859
14456 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14457 symbols as not needing a dynsym entry.
14458
1e52a9c1
CS
144592008-08-20 Craig Silverstein <csilvers@google.com>
14460
14461 * fileread.cc (File_read::open): Do not lock the file unless it
14462 was successfully opened.
14463
d85c80a3
CC
144642008-08-14 Cary Coutant <ccoutant@google.com>
14465
14466 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14467 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14468 * testsuite/tls_test.cc (struct int128): 128-bit struct
14469 for testing TLS relocs with non-zero addend.
14470 (v12): New TLS variable.
14471 (t12): New test.
14472 (t_last): Add check for v12.
14473 * testsuite/tls_test.h (t12): New function.
14474 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14475
2d924fd9
ILT
144762008-08-13 Ian Lance Taylor <iant@google.com>
14477
14478 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14479 set tls_segment_ or relro_segment_.
14480 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14481 when appropriate.
14482 * output.h (Output_section::clear_is_relro): New function.
14483 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14484 sections specially even when output_data_ is empty.
14485 (Output_segment::maximum_alignment): When first section is relro,
14486 only force alignment for PT_LOAD segments.
14487 * script.cc (script_data_segment_align): New function.
14488 (script_data_segment_relro_end): New function.
14489 * script-c.h (script_data_segment_align): Declare.
14490 (script_data_segment_relro_end): Declare.
14491 * script-sections.h (class Script_sections): Declare
14492 data_segment_align and data_segment_relro_end. Add fields
14493 segment_align_index_ and saw_relro_end_.
14494 * script-sections.cc (class Sections_element): Add set_is_relro
14495 virtual function. Add new bool* parameter to place_orphan_here.
14496 Add get_output_section virtual function.
14497 (class Output_section_definition): Add set_is_relro. Add new
14498 bool* parameter to place_orphan_here. Add get_output_section.
14499 Add is_relro_ field.
14500 (Output_section_definition::Output_section_definition): Initialize
14501 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14502 and is_relro_ fields.
14503 (Output_section_definition::place_orphan_here): Add is_relro
14504 parameter.
14505 (Output_section_definition::set_section_addresses): Set relro for
14506 output section.
14507 (Output_section_definition::alternate_constraint): Likewise.
14508 (class Orphan_output_section): Add new bool* parameter to
14509 place_orphan_here. Add get_output_section.
14510 (Orphan_output_section::place_orphan_here): Add is_relro
14511 parameter.
14512 (Script_sections::Script_sections): Initialize
14513 data_segment_align_index_ and saw_relro_end_.
14514 (Script_sections::data_segment_align): New function.
14515 (Script_sections::data_segment_relro_end): New function.
14516 (Script_sections::place_orphan): Set or clear is_relro.
14517 (Script_sections::set_section_addresses): Force alignment of first
14518 TLS section.
14519 * yyscript.y (exp): Call script_data_segment_align and
14520 script_data_segment_relro_end.
14521 * testsuite/relro_script_test.t: New file.
14522 * testsuite/relro_test.cc (using_script): Declare.
14523 (t1, t2): Test using_script.
14524 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14525 (relro_script_test_SOURCES): Define.
14526 (relro_script_test_DEPENDENCIES): Define.
14527 (relro_script_test_LDFLAGS): Define.
14528 (relro_script_test_LDADD): Define.
14529 (relro_script_test.so): New target.
14530 * testsuite/Makefile.in: Rebuild.
14531
f827c9a9
CC
145322008-08-06 Cary Coutant <ccoutant@google.com>
14533
14534 * archive.cc (Archive::total_archives, Archive::total_members)
14535 (Archive::total_members_loaded): New variables.
14536 (Archive::setup): Add parameter. Add option to preread
14537 archive symbols.
14538 (Archive::read_armap): Add counter.
14539 (Archive::get_file_and_offset): New function.
14540 (Archive::get_elf_object_for_member): New function.
14541 (Archive::read_all_symbols): New function.
14542 (Archive::read_symbols): New function.
14543 (Archive::add_symbols): Add counters.
14544 (Archive::include_all_members): Use armap to find members if it's
14545 already built.
14546 (Archive::include_member): Skip reading symbols if already read.
14547 Factored code into Archive::get_file_and_offset and
14548 Archive::get_elf_object_for_member. Changed call to
14549 Mapfile::report_include_archive_member.
14550 (Archive::print_stats): New function.
14551 * archive.h: Declare Object and Read_symbols_data classes.
14552 (Archive::Archive): Add initializers for new members.
14553 (Archive::setup): Add parameter.
14554 (Archive::print_stats): New function.
14555 (Archive::total_archives, Archive::total_members)
14556 (Archive::total_members_loaded): New variables.
14557 (Archive::get_file_and_offset): New function.
14558 (Archive::get_elf_object_for_member): New function.
14559 (Archive::read_all_symbols): New function.
14560 (Archive::read_symbols): New function.
14561 (Archive::Archive_member): New class.
14562 (Archive::members_): New member.
14563 (Archive::num_members_): New member.
14564 * main.cc: Include archive.h.
14565 (main): Call Archive::print_stats.
14566 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14567 archive parameter; member_name is now the fully-decorated name.
14568 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14569 * options.h: (General_options): Add --preread-archive-symbols option.
14570 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14571 Archive::setup.
14572
de4c45bd
ILT
145732008-08-04 Ian Lance Taylor <iant@google.com>
14574
14575 * symtab.h (Symbol::use_plt_offset): New function.
14576 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14577 * powerpc.cc (Relocate::relocate): Likewise.
14578 * sparc.cc (Relocate::relocate): Likewise.
14579 * x86_64.cc (Relocate::relocate): Likewise.
14580 * testsuite/weak_plt.sh: New test.
14581 * testsuite/weak_plt_main.cc: New test.
14582 * testsuite/weak_plt_shared.cc: New test.
14583 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14584 (check_PROGRAMS): Add weak_plt.
14585 (check_DATA): Add weak_plt_shared.so.
14586 (weak_plt_main_pic.o, weak_plt): New targets.
14587 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14588 * testsuite/Makefile.in: Rebuild.
14589
14590 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14591 gcctestdir/ld.
14592 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14593 * testsuite/Makefile.in: Rebuild.
14594
323ee3f4
AM
145952008-08-04 Alan Modra <amodra@bigpond.net.au>
14596
14597 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14598 * Makefile.in: Regenerate.
14599 * po/POTFILES.in: Regenerate.
14600
7c07ecec
ILT
146012008-07-29 Ian Lance Taylor <iant@google.com>
14602
14603 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14604 symbols before other symbols.
14605 * testsuite/script_test_2.cc (test_addr): Declare.
14606 (test_addr_alias): Declare.
14607 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14608 values.
7c07ecec
ILT
14609 * testsuite/script_test_2.t: Define test_addr_alias and
14610 test_addr.
14611
5778530e
ILT
146122008-07-24 Ian Lance Taylor <iant@google.com>
14613
2a00e4fb
ILT
14614 PR 5990
14615 * descriptors.cc: New file.
14616 * descriptors.h: New file.
14617 * gold-threads.h (class Hold_optional_lock): New class.
14618 * fileread.cc: Include "descriptors.h".
14619 (File_read::~File_read): Release descriptor rather than closing
14620 it.
14621 (File_read::open) [file]: Call open_descriptor rather than open.
14622 Set is_descriptor_opened_.
14623 (File_read::open) [memory]: Assert that descriptor is not open.
14624 (File_read::reopen_descriptor): New function.
14625 (File_read::release): Release descriptor.
14626 (File_read::do_read): Make non-const. Reopen descriptor.
14627 (File_read::read): Make non-const.
14628 (File_read::make_view): Reopen descriptor.
14629 (File_read::do_readv): Likewise.
14630 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14631 Update declarations.
14632 * layout.cc: Include "descriptors.h".
14633 (Layout::create_build_id): Use open_descriptor rather than open.
14634 * output.cc: Include "descriptors.h".
14635 (Output_file::open): Use open_descriptor rather than open.
14636 * archive.cc (Archive::const_iterator): Change Archive to be
14637 non-const.
14638 (Archive::begin, Archive::end): Make non-const.
14639 (Archive::count_members): Likewise.
14640 * archive.h (class Archive): Update declarations.
14641 * object.h (Object::read): Make non-const.
14642 * Makefile.am (CCFILES): Add descriptors.cc.
14643 (HFILES): Add descriptors.h.
14644 * Makefile.in: Rebuild.
14645
801647d1
ILT
14646 PR 6716
14647 * gold.h: Always include <clocale>. Add Solaris workarounds
14648 following code in binutils/sysdep.h.
14649
5edd166e
ILT
14650 PR 6048
14651 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14652 this->eh_frame_hdr_ is NULL before using it.
14653
c89ad728
ILT
14654 * dynobj.cc (Versions::Versions): Update comment.
14655
aa86f06b
ILT
14656 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14657 the base version name.
14658
5778530e
ILT
14659 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14660 array size plus one.
14661 (Stringpool_template::set_string_offsets): Subtract one from key
14662 before using it as an array index.
14663 (Stringpool_template::get_offset_with_length): Likewise.
14664 (Stringpool_template::write_to_buffer): Likewise.
14665 * stringpool.h (Stringpool_template::get_offset_from_key):
14666 Likewise.
14667
057ead22
ILT
146682008-07-23 Ian Lance Taylor <iant@google.com>
14669
7f649c59
ILT
14670 PR 6658
14671 * object.h (Merged_symbol_value::value): Do our best to handle a
14672 negative addend.
14673
057ead22
ILT
14674 PR 6647
14675 * script.cc (Version_script_info::get_versions): Don't add empty
14676 version tag to return value.
14677 (Version_script_info::get_symbol_version_helper): Change return
14678 type to bool. Add pversion parameter. Change all callers.
14679 (script_register_vers_node): Don't require a non-NULL tag.
14680 * script.h (class Version_script_info): Update declarations.
14681 (Version_script_info::get_symbol_version): Change return type to
14682 bool. Add version parameter. Change all callers.
14683 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14684 handling. Handle an empty version from a version script.
14685 (Symbol_table::define_special_symbol): Likewise.
14686 * testsuite/ver_test_10.script: New file.
14687 * testsuite/ver_test_10.sh: New file.
14688 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14689 (check_DATA): Add ver_test_10.syms.
14690 (ver_test_10.syms, ver_test_10.so): New target.
14691 * testsuite/Makefile.in: Rebuild.
14692
58e54ac2
CD
146932008-07-23 Simon Baldwin <simonb@google.com>
14694
14695 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14696 to zero for undefined symbols from dynamic libraries.
14697
95d14cd3
ILT
146982008-07-23 Ian Lance Taylor <iant@google.com>
14699
14700 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14701 Change all callers.
14702 * symtab.h (class Symbol_table): Update declaration.
14703 * testsuite/ver_test_9.cc: New file.
14704 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14705 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14706 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14707 (ver_test_9.so, ver_test_9.o): New targets.
14708 * testsuite/Makefile.in: Rebuild.
14709
92de84a6
ILT
147102008-07-22 Ian Lance Taylor <iant@google.com>
14711
34810851
ILT
14712 * options.h (class General_options): Define --check-sections.
14713 * layout.cc (Layout::set_segment_offsets): Handle
14714 --check-sections.
14715
af6156ef
ILT
14716 * options.h (class General_options): Define -n/--nmagic and
14717 -N/--omagic.
14718 * options.cc (General_options::finalize): For -n/--nmagic or
14719 -N/--omagic, set -static.
14720 * layout.cc (Layout::attach_allocated_section_to_segment): If
14721 -N/--omagic, don't put read-only and read-write sections in
14722 different segments.
14723 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14724 finding a read-only segment.
14725 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14726 don't set the minimum segment alignment to the common page size,
14727 and don't set the file offset to the address modulo the page size.
14728 * script-sections.cc (Script_sections::create_segments): If
14729 -n/--omagic, don't put read-only and read-write sections in
14730 different segments.
14731
92de84a6
ILT
14732 * cref.cc: New file.
14733 * cref.h: New file.
14734 * options.h (class General_options): Add --print-symbol-counts.
14735 * main.cc (main): Issue defined symbol report if requested.
14736 * archive.cc (Archive::interpret_header): Make into a const member
14737 function.
14738 (Archive::add_symbols): Call Input_objects::archive_start and
14739 archive_stop.
14740 (Archive::const_iterator): Define new class.
14741 (Archive::begin, Archive::end): New functions.
14742 (Archive::include_all_members): Rewrite to use iterator.
14743 (Archive::count_members): New function.
14744 * archive.h (class Archive): Update declarations.
14745 (Archive::filename): New function.
14746 * object.cc: Include "cref.h".
14747 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14748 (Sized_relobj::do_get_global_symbol_counts): New function.
14749 (Input_objects::add_object): Add object to cross-referencer.
14750 (Input_objects::archive_start): New function.
14751 (Input_objects::archive_stop): New function.
14752 (Input_objects::print_symbol_counts): New function.
14753 * object.h: Declare Cref and Archive.
14754 (Object::get_global_symbol_counts): New function.
14755 (Object::do_get_global_symbol_counts): New pure virtual function.
14756 (class Sized_relobj): Add defined_count_ field. Update
14757 declarations.
14758 (class Input_objects): Add cref_ field. Update constructor.
14759 Update declarations.
14760 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14761 defined_count_.
14762 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14763 symbol counts.
14764 (Sized_dynobj::do_get_global_symbol_counts): New function.
14765 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14766 defined_count_. Update declarations. Define Symbols typedef.
14767 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14768 parameter. Change all callers.
14769 (Symbol_table::add_from_dynobj): Add sympointers and defined
14770 parameters. Change all callers.
14771 * symtab.h (class Symbol_table): Update declarations.
14772 * Makefile.am (CCFILES): Add cref.cc.
14773 (HFILES): Add cref.h.
14774 * Makefile.in: Rebuild.
14775
3f7c5e1d
CD
147762008-07-22 Simon Baldwin <simonb@google.com>
14777
14778 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14779 to zero when writing undefined symbols.
14780
e0b64032
ILT
147812008-07-22 Ian Lance Taylor <iant@google.com>
14782
14783 * output.cc (Output_section::add_input_section): Don't try to
14784 merge empty merge sections.
14785
096b02cf
CS
147862008-07-21 Craig Silverstein <csilvers@google.com>
14787
14788 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14789 Include symbol version in error message.
cd536b21 14790
1d1f116d
CD
147912008-07-20 Chris Demetriou <cgd@google.com>
14792
cd536b21 14793 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14794 (RANDOM_SEED_CFLAGS): New substituted variable.
14795 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14796 * configure: Rebuild.
14797 * Makefile.in: Likewise.
14798 * testsuite/Makefile.in: Likewise.
14799
a18f591e
ILT
148002008-07-18 Ian Lance Taylor <iant@google.com>
14801
14802 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14803 where we see NAME/NULL and NAME/VERSION as separate symbols.
14804 * testsuite/ver_test_main.cc (main): Call t4.
14805 (t4, t4_2a): Define.
14806 * testsuite/ver_test_2.cc (t4_2): Define.
14807 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14808 * testsuite/ver_test_4.cc (t4_2a): Define.
14809 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14810 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14811
c6e3f6ed
ILT
148122008-07-17 Ian Lance Taylor <iant@google.com>
14813
14814 * dynobj.cc (Versions::add_def): If we give an error about a
14815 missing version, go ahead and create the version anyhow.
14816
ef9beddf
ILT
148172008-07-10 Ian Lance Taylor <iant@google.com>
14818
14819 Handle output sections with more than 0x7fffffff bytes.
14820 * object.h (class Relobj): Change map_to_output_ to
14821 output_sections_, and just keep a section pointer. Change all
14822 uses. Move comdat group support to Sized_relobj.
14823 (Relobj::is_section_specially_mapped): Remove.
14824 (Relobj::output_section): Remove poff parameter. Change all
14825 callers.
14826 (Relobj::output_section_offset): New function.
14827 (Relobj::set_section_offset): Rewrite.
14828 (Relobj::map_to_output): Remove.
14829 (Relobj::output_sections): New function.
14830 (Relobj::do_output_section_offset): New pure virtual function.
14831 (Relobj::do_set_section_offset): Likewise.
14832 (class Sized_relobj): Add section_offsets_ field. Add comdat
14833 group support from Relobj. Update declarations.
14834 (Sized_relobj::get_output_section_offset): New function.
14835 (Sized_relobj::do_output_section_offset): New function.
14836 (Sized_relobj::do_set_section_offset): New function.
14837 * object.cc (Relobj::output_section_address): Remove.
14838 (Sized_relobj::Sized_relobj): Initialize new fields.
14839 (Sized_relobj::include_section_group): Cast find_kept_object to
14840 Sized_relobj.
14841 (Sized_relobj::include_linkonce_section): Likewise.
14842 (Sized_relobj::do_layout): Use separate arrays for output section
14843 and output offset.
14844 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14845 output_sections.
14846 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14847 output_sections and section_offsets.
14848 (Sized_relobj::write_local_symbols): Likewise.
14849 (map_to_kept_section): Compute output address directly.
14850 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14851 output_sections and section_offsets.
14852 (Sized_relobj::write_sections): Likewise.
14853 (Sized_relobj::relocate_sections): Likewise.
14854 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14855 * output.h (class Output_reloc): Update declarations. Change
14856 u2_.relobj to Sized_relobj*.
14857 (class Output_data_reloc): Change add functions to use
14858 Sized_relobj*.
14859 * output.cc (Output_reloc::Output_reloc): Change relobj to
14860 Sized_relobj*.
14861 (Output_reloc::local_section_offset): Change return type to
14862 Elf_Addr. Use get_output_section_offset.
14863 (Output_reloc::get_address): Likewise.
14864 (Output_section::is_input_address_mapped): Don't call
14865 is_section_specially_mapped.
14866 (Output_section::output_offset): Likewise.
14867 (Output_section::output_address): Likewise.
14868 (Output_section::starting_output_address): Likewise.
14869 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14870 parameter to Sized_relobj*.
14871 (Copy_relocs::need_copy_reloc): Likewise.
14872 (Copy_relocs::save): Likewise.
14873 * copy-relocs.h (class Copy_relocs): Update declarations.
14874 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14875 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14876 * target-reloc.h (relocate_for_relocatable): Change
14877 offset_in_output_section type to Elf_Addr. Change code that uses
14878 it as well.
14879 * layout.cc (Layout::layout): Always set *off.
14880 * mapfile.cc (Mapfile::print_input_section): Use
14881 output_section_offset.
14882 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14883 Sized_relobj*.
14884 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14885 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14886 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14887
5cb66f97
ILT
148882008-07-03 Ian Lance Taylor <iant@google.com>
14889
14890 * layout.cc (Layout::include_section): Do not discard unrecognized
14891 SHT_STRTAB sections.
14892
afe47622
CS
148932008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14894
14895 * script.cc (Lex::can_continue_name): Make '?' allowable in
14896 version-script names.
14897 * testsuite/version_script.map: Change glob pattern to use '?'
14898
5adf9721
ILT
148992008-06-30 Manish Singh <yosh@gimp.org>
14900
14901 PR 6585
14902 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14903 Correct typo.
14904
e6fde208
ILT
149052008-06-30 Ian Lance Taylor <iant@google.com>
14906
14907 PR 6660
14908 PR 6682
14909 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14910 versions]: Don't try to read the value in the contents, since we
14911 don't use it. Use the template endianness when writing.
14912
3f2e6a2d
CC
149132008-06-25 Cary Coutant <ccoutant@google.com>
14914
14915 * fileread.cc (File_read::make_view): Assert on zero-length view.
14916 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14917 symbol table when there are no symbols to read.
14918
c43d3a48
CS
149192008-06-23 Craig Silverstein <csilvers@google.com>
14920
14921 * version.cc (version_string): Bump to 1.7
14922
5f494ea0
CS
149232008-06-18 Craig Silverstein <csilvers@google.com>
14924
14925 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14926 constant 0xFFFF to type Valtype.
14927 (Powerpc_relocate_functions::rel16_ha): Likewise.
14928
c42e122e
ILT
149292008-06-17 Ian Lance Taylor <iant@google.com>
14930
f34787f8
ILT
14931 * output.h (Output_section::Input_section): Initialize p2align_ to
14932 zero for Output_section_data constructors.
14933 (Output_section::Input_section::addralign): If not an input
14934 section, return the alignment of the Output_section_data.
14935 * testsuite/copy_test.cc: New file.
14936 * testsuite/copy_test_1.cc: New file.
14937 * testsuite/copy_test_2.cc: New file.
14938 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14939 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14940 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14941 (copy_test_1_pic.o, copy_test_1.so): New targets.
14942 (copy_test_2_pic.o, copy_test_2.so): New targets.
14943 * testsuite/Makefile.in: Rebuild.
14944
c42e122e
ILT
14945 * script-sections.cc (Script_sections::place_orphan): Initialize
14946 local variable exact.
14947
ce3ac18a
DE
149482008-06-13 David Edelsohn <edelsohn@gnu.org>
14949
14950 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14951
42cacb20
DE
149522008-06-12 David Edelsohn <edelsohn@gnu.org>
14953 David S. Miller <davem@davemloft.net>
14954
14955 * powerpc.cc: New file.
14956 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14957 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14958 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14959 * Makefile.in: Rebuild.
14960
7b308235
ILT
149612008-06-09 Ian Lance Taylor <iant@google.com>
14962
14963 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14964 <exception>.
14965 (throwing, orig_terminate): New static variables.
14966 (terminate_handler): New static function.
14967 (t2): Set terminate handler.
14968
f0b886e3
ILT
149692008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14970
14971 PR 6584
cd536b21 14972 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14973 alignment.
14974
3e90f135
CC
149752008-05-30 Cary Coutant <ccoutant@google.com>
14976
14977 * archive.cc (Archive::include_all_members) Correct to step
14978 over symbol table and extended name table in thin archives.
14979
e09ad04a
ILT
149802008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14981
14982 PR 6407
14983 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14984 calculation.
14985
62b01cb5
ILT
149862008-05-28 Caleb Howe <cshowe@google.com>
14987
14988 * reduced_debug_output.cc: New file.
14989 * reduced_debug_output.h: New file.
92de84a6 14990 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14991 * options.cc (General_options::finalize): Add strip_debug_non_line
14992 to the strip heirarchy.
14993 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14994 fields.
14995 * layout.cc: Include "reduced_debug_output.h".
14996 (Layout::Layout): Initialize new fields.
14997 (line_only_debug_sections): New static array.
14998 (is_lines_only_debug_sections): New static inline function.
14999 (Layout::include_section): Handle --strip-debug-non-line.
15000 (Layout::make_output_section): If --strip-debug-non-line, build
15001 new output sections for .debug_abbrev and .debug_info.
15002 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15003 gold. Warn about possible overflow.
15004 (read_signed_LEB_128): Likewise.
15005 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15006 (read_signed_LEB_128): Declare.
15007 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15008 (HFILES): Add reduced_debug_output.h.
15009 * Makefile.in: Rebuild.
15010
7d9e3d98
ILT
150112008-05-21 Ian Lance Taylor <iant@google.com>
15012
15013 * mapfile.cc: New file.
15014 * mapfile.h: New file.
15015 * options.h (class General_options): Add -M/--print-map and -Map.
15016 * options.cc (General_options::finalize): Make -M equivalent to
15017 -Map -.
15018 * main.cc: Include <cstdio> and "mapfile.h".
15019 (main): Open mapfile if requested.
15020 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15021 constructor. Change caller.
15022 (queue_initial_tasks): Add mapfile parameter. Change caller.
15023 (queue_middle_tasks): Likewise.
15024 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15025 declarations.
15026 * archive.cc: Include "mapfile.h".
15027 (Archive::add_symbols): Add mapfile parameter. Change all
15028 callers. Pass mapfile, symbol, and reason to include_member.
15029 (Archive::include_all_members): Add mapfile parameter. Change all
15030 callers.
15031 (Archive::include_member): Add mapfile, sym, and why parameters.
15032 Change all callers. Report inclusion to map file.
15033 * archive.h: Include "fileread.h".
15034 (class Archive): Update declarations.
15035 (Archive::file): New const method.
15036 (class Add_archive_symbols): Add mapfile_ field. Update
15037 constructor. Change all callers.
15038 * readsyms.h (class Read_symbols): Likewise.
15039 (class Finish_group): Likewise.
15040 (class Read_script): Likewise.
15041 * common.cc: Include "mapfile.h".
15042 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15043 all callers.
15044 (Symbol_table::do_allocate_commons): Likewise.
15045 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15046 symbol allocation to mapfile.
15047 * common.h (class Allocate_commons_task): Add mapfile_ field.
15048 Update constructor. Change all callers.
15049 * symtab.h (class Symbol_table): Update declarations.
15050 * layout.cc: Include "mapfile.h".
15051 (Layout_task_runner::run): Print information to mapfile.
15052 (Layout::create_gold_note): Change Output_data_fixed_space to
15053 Output_data_zero_fill.
15054 (Layout::create_build_id): Likewise.
15055 (Layout::print_to_mapfile): New function.
15056 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15057 constructor. Change caller.
15058 (class Layout): Declare print_to_mapfile.
15059 * output.cc (Output_section::Input_section::print_to_mapfile): New
15060 function.
15061 (Output_section::add_input_section): If producing a map, always
15062 add to input_sections_ list.
15063 (Output_section::do_print_to_mapfile): New function.
15064 (Output_segment::print_sections_to_mapfile): New function.
15065 (Output_segment::print_section_list_to_mapfile): New function.
15066 * output.h: Include "mapfile.h".
15067 (Output_data::print_to_mapfile): New function.
15068 (Output_data::do_print_to_mapfile): New virtual function.
15069 (Output_segment_headers::do_print_to_mapfile): New function.
15070 (Output_file_header::do_print_to_mapfile): New function.
15071 (Output_data_const::do_print_to_mapfile): New function.
15072 (class Output_data_const_buffer): Add map_name_ field. Update
15073 constructor. Change all callers. Add do_print_to_mapfile
15074 function.
15075 (class Output_data_fixed_space): Likewise.
15076 (class Output_data_space): Likewise.
15077 (class Output_data_zero_fill): New class.
15078 (Output_data_strtab::do_print_to_mapfile): New function.
15079 (Output_data_reloc_base::do_print_to_mapfile): New function.
15080 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15081 (Output_data_group::do_print_to_mapfile): New function.
15082 (Output_data_got::do_print_to_mapfile): New function.
15083 (Output_data_dynamic::do_print_to_mapfile): New function.
15084 (Output_symtab_xindex::do_print_to_mapfile): New function.
15085 (class Output_section): Declare do_print_to_mapflie. Declare
15086 print_to_mapfile in Input_section.
15087 (class Output_segment): Declare new functions.
15088 * object.h (Sized_relobj::symbol_count): New function.
15089 * script-sections.cc
15090 (Output_section_element_dot_assignment::set_section_addresses):
15091 Change Output_data_fixed_space to Output_data_zero_fill.
15092 (Output_data_expression::do_print_to_mapfile): New function.
15093 * script.cc (read_input_script): Add mapfile parameter. Change
15094 all callers.
15095 * script.h (read_input_script): Update declaration.
15096 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15097 (Eh_frame::do_print_to_mapfile): New function.
15098 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15099 (Output_merge_string::do_print_to_mapfile): New function.
15100 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15101 function.
15102 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15103 function.
15104 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15105 function.
15106 * Makefile.am (CCFILES): Add mapfile.cc.
15107 (HFILES): Add mapfile.h.
15108 * Makefile.in: Rebuild.
15109
9f1d377b
ILT
151102008-05-19 Ian Lance Taylor <iant@google.com>
15111
15112 * options.h (class General_options): Add -z relro.
15113 * layout.cc (Layout::Layout): Initialize relro_segment_.
15114 (Layout::add_output_section_data): Return the output section.
15115 (Layout::make_output_section): Rcognize relro sections and mark
15116 them appropriately.
15117 (Layout::attach_allocated_section_to_segment): Put relro sections
15118 in a PT_GNU_RELRO segment.
15119 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15120 section as relro.
15121 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15122 PT_TLS segments.
15123 (Layout::linkonce_mapping): Map d.rel.ro.local to
15124 .data.rel.ro.local.
15125 (Layout::output_section_name): Us .data.rel.ro.local for any
15126 section which begins with that.
15127 * layout.h (class Layout): Update add_output_section_data
15128 declaration. Add relro_segment_ field.
15129 * output.cc (Output_section::Output_section): Initialize is_relro_
15130 and is_relro_local_ fields.
15131 (Output_segment::add_output_section): Group relro sections.
15132 (Output_segment::is_first_section_relro): New function.
15133 (Output_segment::maximum_alignment): If there is a relro section,
15134 align the segment to the common page size.
15135 (Output_segment::set_section_addresses): Track whether we are
15136 looking at relro sections. If the last section is a relro
15137 section, align to the common page size.
15138 (Output_segment::set_section_list_addresses): Add in_relro
15139 parameter. Change all callers. Align to the page size when
15140 moving from relro to non-relro section.
15141 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15142 segment.
15143 * output.h (class Output_section): Add is_relro_ and
15144 is_relro_local_ fields.
15145 (Output_section::is_relro): New function.
15146 (Output_section::set_is_relro): New function.
15147 (Output_section::is_relro_local): New function.
15148 (Output_section::set_is_relro_local): New function.
15149 (class Output_segment): Update declarations.
15150 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15151 * sparc.cc (Target_sparc::got_section): Likewise.
15152 * x86_64.cc (Target_x86_64::got_section): Likewise.
15153 * testsuite/relro_test_main.cc: New file.
15154 * testsuite/relro_test.cc: New file.
15155 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15156 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15157 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15158 (relro_test.so, relro_test_pic.o): New targets.
15159 * testsuite/Makefile.in: Rebuild.
15160
a984ee1d
ILT
151612008-05-16 Ian Lance Taylor <iant@google.com>
15162
01676dcd
ILT
15163 * output.cc (Output_segment::add_output_section): Remove front
15164 parameter.
15165 * output.h (class Output_segment): Remove
15166 add_initial_output_section and overloaded add_output_section.
15167 Update declaration of remaining add_output_section.
15168 * layout.cc (Layout::create_interp): Call add_output_section
15169 rather than add_initial_output_section.
15170 (Layout::finish_dynamic_section): Likewise.
15171
497897f9
ILT
15172 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15173 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15174 know the dynamic type.
15175 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15176 field. Initialize it in constructor.
15177 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15178 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15179 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15180 reloc.
15181
a984ee1d
ILT
15182 * output.cc (Output_reloc::get_address): Change return type to
15183 Elf_Addr.
15184 * output.h (class Output_reloc): Update get_address declaration.
15185 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15186 for section addresses.
15187
55ba0940
ILT
151882008-05-09 Ian Lance Taylor <iant@google.com>
15189
15190 PR 6493
15191 * gold.cc (gold_nomem): Use return value of write.
15192
75517b77
ILT
151932008-05-08 Ian Lance Taylor <iant@google.com>
15194
15195 * symtab.c (Symbol::init_base_output_data): Add version
15196 parameter. Change all callers.
15197 (Symbol::init_base_output_segment): Likewise.
15198 (Symbol::init_base_constant): Likewise.
15199 (Symbol::init_base_undefined): Likewise.
15200 (Sized_symbol::init_output_data): Likewise.
15201 (Sized_symbol::init_output_segment): Likewise.
15202 (Sized_symbol::init_constant): Likewise.
15203 (Sized_symbol::init_undefined): Likewise.
15204 (Symbol_table::do_define_in_output_data): If the new symbol has a
15205 version, mark it as the default.
15206 (Symbol_table::do_define_in_output_segment): Likewise.
15207 (Symbol_table::do_define_as_constant): Likewise.
15208 * symtab.h (class Symbol): Update declarations.
15209 (class Sized_symbol): Likewise.
15210 * resolve.cc (Symbol::override_version): New function.
c42e122e 15211 (Symbol::override_base): Call override_version.
75517b77
ILT
15212 (Symbol::override_base_with_special): Likewise.
15213 * testsuite/ver_script_8.script: New file.
15214 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15215 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15216 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15217 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15218
f1f70eae
ILT
152192008-05-06 Ian Lance Taylor <iant@google.com>
15220
f3e9c5c5
ILT
15221 PR 6049
15222 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15223 functions.
15224 (class General_options): Remove existing --undefined, and add
15225 --no-undefined instead. Add new --undefined as synonym for -u.
15226 * archive.cc (Archive::add_symbols): Check whether symbol was
15227 named with -u.
15228 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15229 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15230 all uses. Add IS_UNDEFINED. Update declarations to split
15231 different versions of init_base. Declare init_base_undefined.
15232 (Symbol::is_defined): Handle IS_UNDEFINED.
15233 (Symbol::is_undefined): Likewise.
15234 (Symbol::is_weak_undefined): Call is_undefined.
15235 (Symbol::is_absolute): Handle IS_CONSTANT.
15236 (class Sized_symbol): Update declarations to split different
15237 versions of init. Declare init_undefined.
15238 (class Symbol_table): Declare new functions.
15239 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15240 Change all callers.
15241 (Symbol::init_base_output_data): Likewise.
15242 (Symbol::init_base_output_segment): Likewise.
15243 (Symbol::init_base_constant): Likewise.
15244 (Symbol::init_base_undefined): New function.
15245 (Sized_symbol::init_object): Rename from init. Change all
15246 callers.
15247 (Sized_symbol::init_output_data): Likewise.
15248 (Sized_symbol::init_output_segment): Likewise.
15249 (Sized_symbol::init_constant): Likewise.
15250 (Sized_symbol::init_undefined): New function.
15251 (Symbol_table::add_undefined_symbols_from_command_line): New
15252 function.
15253 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15254 function.
15255 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15256 (Symbol::output_section): Likewise.
15257 (Symbol::set_output_section): Likewise.
15258 (Symbol_table::sized_finalize_symbol): Likewise.
15259 (Symbol_table::sized_write_globals): Likewise.
15260 * resolve.cc (Symbol_table::should_override): Likewise.
15261 (Symbol::override_base_with_special): Likewise.
15262
8bdcdf2c
ILT
15263 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15264 symbol, change it to have default visibility.
15265 * testsuite/protected_1.cc: New file.
15266 * testsuite/protected_2.cc: New file.
15267 * testsuite/protected_3.cc: New file.
15268 * testsuite/protected_main_1.cc: New file.
15269 * testsuite/protected_main_2.cc: New file.
15270 * testsuite/protected_main_3.cc: New file.
15271 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15272 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15273 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15274 (protected_1.so): New target.
15275 (protected_1_pic.o, protected_2_pic.o): New targets.
15276 (protected_3_pic.o): New target.
15277 (check_PROGRAMS): Add protected_2.
15278 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15279 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15280 * testsuite/Makefile.in: Rebuild.
15281
2b706932
ILT
15282 * options.h (DEFINE_var): Add set_user_set_##varname__.
15283 (DEFINE_bool_alias): New macro.
15284 (class General_options): Define -Bstatic using DEFINE_bool_alias
15285 rather than DEFINE_special. Add --undefined as an alias for -z
15286 defs.
15287 * options.cc (General_options::parse_Bstatic): Remove.
15288
d82a5bcc
ILT
15289 * options.h (class General_options): Add --fatal-warnings.
15290 * main.cc (main): Implement --fatal-warnings.
15291 * errors.h (Errors::warning_count): New function.
15292
f1f70eae
ILT
15293 * options.h (class General_options): Add -Bsymbolic-functions.
15294 * symtab.h (Symbol::is_preemptible): Check for
15295 -Bsymbolic-functions.
15296
8825ac63
ILT
152972008-05-05 Ian Lance Taylor <iant@google.com>
15298
d98bc257
ILT
15299 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15300 as noVARNAME rather than no-VARNAME.
15301 (class General_options): Add option -z combreloc.
15302 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15303 get_address.
15304 (Output_reloc::sort_before) [SHT_REL]: New function.
15305 (Output_reloc::sort_before) [SHT_RELA]: New function.
15306 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15307 Sort_relocs_comparison.
15308 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15309 parameter. Change all callers.
15310 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15311 sort_relocs parameter. Change all callers.
15312 * output.cc (Output_reloc::get_address): New function, broken out
15313 of write_rel.
15314 (Output_reloc::write_rel): Call it.
15315 (Output_reloc::compare): New function.
15316 (Output_data_reloc_base::do_write): Optionally sort relocs.
15317
60b2b4e7
ILT
15318 * configure.ac: If targ_extra_obj is set, link it in.
15319 * configure.tgt: Initialize all variables.
15320 (x86_64*): Set targ_extra_obj and targ_extra_size.
15321 * configure: Rebuild.
15322
8825ac63
ILT
15323 * object.cc (Sized_relobj::include_section_group): Adjust section
15324 indexes read from group data. Build vector to pass to
15325 layout_group.
15326 * layout.cc (Layout::layout_group): Add flags and shndxes
15327 parameters. Remove contents parameter. Change caller. Update
15328 explicit instantiations.
15329 * layout.h (class Layout): Update layout_group declaration.
15330 * output.cc (Output_data_group::Output_data_group): Add flags and
15331 input_shndxes parameters. Remove contents parameter. Change
15332 caller.
15333 (Output_data_group::do_write): Change input_sections_ to
15334 input_shndxes_.
15335 * output.h (class Output_data_group): Update constructor
15336 declaration. Rename input_sections_ to input_shndxes_.
15337 * testsuite/many_sections_test.cc: Add template.
15338
e94cf127
CC
153392008-04-30 Cary Coutant <ccoutant@google.com>
15340
4418b2d5
CC
15341 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15342
e94cf127
CC
15343 * layout.cc (Layout::include_section): Refactored check for debug
15344 info section.
15345 (Layout::add_comdat): Add new parameters. Change type
15346 of signature parameter. Add object and shndx to signatures table.
15347 (Layout::find_kept_object): New function.
15348 * layout.h: Include <cstring>.
15349 (Layout::is_debug_info_section): New function.
15350 (Layout::add_comdat): Add new parameters.
15351 (Layout::find_kept_object): New function.
15352 (Layout::Kept_section): New struct.
15353 (Layout::Signatures): Change type of map range.
15354 * object.cc (Relobj::output_section_address): New function.
15355 (Sized_relobj::include_section_group): Add new parameters. Change
15356 calls to Layout::add_comdat. Change to build table of kept comdat
15357 groups and table mapping discarded sections to kept sections.
15358 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15359 (Sized_relobj::do_layout): Change calls to include_section_group and
15360 include_linkonce_section.
15361 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15362 value to zero when section is discarded.
15363 (Sized_relobj::map_to_kept_section): New function.
15364 * object.h (Relobj::output_section_address): New function.
15365 (Relobj::Comdat_group): New type.
15366 (Relobj::find_comdat_group): New function.
15367 (Relobj::Comdat_group_table): New type.
15368 (Relobj::Kept_comdat_section): New type.
15369 (Relobj::Kept_comdat_section_table): New type.
15370 (Relobj::add_comdat_group): New function.
15371 (Relobj::set_kept_comdat_section): New function.
15372 (Relobj::get_kept_comdat_section): New function.
15373 (Relobj::comdat_groups_): New field.
15374 (Relobj::kept_comdat_sections_): New field.
15375 (Symbol_value::input_value): Update comment.
15376 (Sized_relobj::map_to_kept_section) New function.
15377 (Sized_relobj::include_linkonce_section): Add new parameter.
15378 * target-reloc.h (Comdat_behavior): New type.
15379 (get_comdat_behavior): New function.
15380 (relocate_section): Add code to map a discarded section to the
15381 corresponding kept section when applying a relocation.
15382
e4e5049b
CS
153832008-04-30 Craig Silverstein <csilvers@google.com>
15384
15385 * dwarf_reader.cc (next_generation_count): New static var.
15386 (Addr2line_cache_entry): New struct.
15387 (addr2line_cache): New static var.
15388 (Dwarf_line_info::one_addr2line): Added caching.
15389 (Dwarf_line_info::clear_addr2line_cache): New function.
15390 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15391 cache-size parameter.
15392 (Dwarf_line_info::one_addr2line_cache): New function.
15393 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15394 new cache-size argument to one_addr2line(), and clear cache.
15395
d09e9154
CC
153962008-04-28 Cary Coutant <ccoutant@google.com>
15397
15398 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15399 R_386_PC8 relocations.
15400
7ef73768
ILT
154012008-04-23 Ian Lance Taylor <iant@google.com>
15402
55438702
ILT
15403 * object.cc (Sized_relobj::include_section_group): Check for
15404 invalid section group.
15405
c165fb93
ILT
15406 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15407 header size.
15408
7ef73768
ILT
15409 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15410 than read for file header.
15411 * archive.cc (Archive::include_member): Likewise.
15412
6194aaab
L
154132008-04-23 Paolo Bonzini <bonzini@gnu.org>
15414
15415 * aclocal.m4: Regenerate.
15416 * configure: Regenerate.
15417
d491d34e
ILT
154182008-04-19 Ian Lance Taylor <iant@google.com>
15419
5ea2bac6
ILT
15420 * version.cc (version_string): Bump to 1.6.
15421
7bc3e21a
ILT
15422 * testsuite/Makefile.am (many_sections_r_test): New target.
15423 (many_sections_r_test_SOURCES): Remove.
15424 (many_sections_r_test_DEPENDENCIES): Remove.
15425 (many_sections_r_test_LDFLAGS): Remove.
15426 (many_sections_r_test_LDADD): Remove.
15427
7fcd3aa9
ILT
15428 * object.cc (Sized_relobj::do_add_symbols): Always pass
15429 local_symbol_count_ to add_from_relobj.
15430
4c94d6ae
ILT
15431 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15432 every thousand variables.
15433 * testsuite/Makefile.in: Rebuild.
15434
d491d34e
ILT
15435 * object.cc (Xindex::initialize_symtab_xindex): New function.
15436 (Xindex::read_symtab_xindex): New function.
15437 (Xindex::sym_xindex_to_shndx): New function.
15438 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15439 available.
15440 (Sized_relobj::do_initialize_xindex): New function.
15441 (Sized_relobj::do_read_symbols): Adjust section links.
15442 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15443 parameter. Change all callers.
15444 (Sized_relobj::include_section_group): Adjust section links and
15445 symbol section indexes.
15446 (Sized_relobj::do_layout): Adjust section links.
15447 (Sized_relobj::do_count_local_symbols): Adjust section links and
15448 symbol section indexes.
15449 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15450 ordinary and special symbols.
15451 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15452 dynsym_xindex parameters. Change all callers. Adjust section
15453 links. Use SHN_XINDEX when needed.
15454 (Sized_relobj::get_symbol_location_info): Adjust section links.
15455 Don't get fooled by special symbols.
15456 * object.h (class Xindex): Define.
15457 (class Object): Add xindex_ parameter. Declare virtual functoin
15458 do_initialize_xindex.
15459 (Object::adjust_sym_shndx): New function.
15460 (Object::set_xindex): New protected function.
15461 (class Symbol_value): Add is_ordinary_shndx_ field.
15462 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15463 (Symbol_value::value): Assert ordinary section.
15464 (Symbol_value::initialize_input_to_output_map): Likewise.
15465 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15466 Change all callers.
15467 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15468 all callers.
15469 (class Sized_relobj): Update declarations.
15470 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15471 parameter. Change all callers.
15472 (Sized_relobj::adjust_shndx): New function.
15473 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15474 field.
15475 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15476 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15477 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15478 (Sized_dynobj::read_dynsym_section): Adjust section links.
15479 (Sized_dynobj::read_dynamic): Likewise.
15480 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15481 section links.
15482 (Sized_dynobj::do_initialize_xindex): New function.
15483 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15484 do_initialize_xindex.
15485 (Sized_dynobj::adjust_shndx): New function.
15486 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15487 dynsym_xindex_ fields.
15488 (Layout::finalize): Add a call to set_section_indexes before
15489 creating the symtab sections.
15490 (Layout::set_section_indexes): Don't do anything if the section
15491 already has a section index.
15492 (Layout::create_symtab_sections): Add shnum parameter. Change
15493 caller. Create .symtab_shndx section if needed.
15494 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15495 caller.
15496 (Layout::allocated_output_section_count): New function.
15497 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15498 needed.
15499 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15500 fields. Update declarations.
15501 (Layout::symtab_xindex): New function.
15502 (Layout::dynsym_xindex): New function.
15503 (class Write_symbols_task): Add layout_ field.
15504 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15505 Change caller.
15506 * output.cc (Output_section_headers::Output_section_headers): Add
15507 shstrtab_section parameter. Change all callers.
15508 (Output_section_headers::do_sized_write): Store overflow values
15509 for section count and section string table section index in
15510 section header zero.
15511 (Output_file_header::do_sized_write): Check for overflow of
15512 section count and section string table section index.
15513 (Output_symtab_xindex::do_write): New function.
15514 (Output_symtab_xindex::endian_do_write): New function.
15515 * output.h (class Output_section_headers): Add shstrtab_section_.
15516 Update declarations.
15517 (class Output_symtab_xindex): Define.
15518 (Output_section::has_out_shndx): New function.
15519 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15520 field.
15521 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15522 Change all callers.
15523 (Sized_symbol::init): Likewise.
15524 (Symbol::output_section): Check for ordinary symbol.
15525 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15526 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15527 callers.
15528 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15529 Change all callers. Simplify handling of symbols from sections
15530 not included in the link.
15531 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15532 distinction.
15533 (Weak_alias_sorter::operator()): Assert that symbols are
15534 ordinary.
15535 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15536 distinction.
15537 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15538 parameters. Change all callers.
15539 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15540 symbol distinction. Use SHN_XINDEX when needed.
15541 (Symbol_table::write_section_symbol): Add symtab_xindex
15542 parameter. Change all callers.
15543 (Symbol_table::sized_write_section_symbol): Likewise. Use
15544 SHN_XINDEX when needed.
15545 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15546 declarations.
15547 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15548 (Symbol::is_defined): Check is_ordinary.
15549 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15550 (Symbol::is_absolute, Symbol::is_common): Likewise.
15551 (class Sized_symbol): Update declarations.
15552 (class Symbol_table): Update declarations.
15553 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15554 parameters. Change all callers.
15555 (Sized_symbol::override): Likewise.
15556 (Symbol_table::override): Likewise.
15557 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15558 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15559 is_ordinary, and orig_st_shndx parameters. Change all callers.
15560 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15561 to be in an ordinary section.
15562 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15563 object and is_ordinary parameters. Change all callers.
15564 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15565 Change all callers. Don't add undefined or non-ordinary symbols
15566 to reloc_map_.
15567 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15568 Change all callers.
15569 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15570 declarations.
15571 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15572 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15573 (Sized_relobj::relocate_sections): Likewise.
15574 * target-reloc.h (scan_relocs): Adjust section symbol index.
15575 (scan_relocatable_relocs): Likewise.
15576 * i386.cc (Scan::local): Check for ordinary symbols.
15577 * sparc.cc (Scan::local): Likewise.
15578 * x86_64.cc (Scan::local): Likewise.
15579 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15580 to symbol_section_and_value.
15581 * testsuite/many_sections_test.cc: New file.
15582 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15583 (check_PROGRAMS): Add many_sections_test.
15584 (many_sections_test_SOURCES): Define.
15585 (many_sections_test_DEPENDENCIES): Define.
15586 (many_sections_test_LDFLAGS): Define.
15587 (BUILT_SOURCES): Add many_sections_define.h.
15588 (many_sections_define.h): New target.
15589 (BUILT_SOURCES): Add many_sections_check.h.
15590 (many_sections_check.h): New target.
15591 (check_PROGRAMS): Add many_sections_r_test.
15592 (many_sections_r_test_SOURCES): Define.
15593 (many_sections_r_test_DEPENDENCIES): Define.
15594 (many_sections_r_test_LDFLAGS): Define.
15595 (many_sections_r_test_LDADD): Define.
15596 (many_sections_r_test.o): New target.
15597 * testsuite/Makefile.in: Rebuild.
15598
c5818ff1
CC
155992008-04-17 Cary Coutant <ccoutant@google.com>
15600
15601 * errors.cc (Errors::info): New function.
15602 (gold_info): New function.
15603 * errors.h (Errors::info): New function.
15604 * gold.h (gold_info): New function.
15605 * object.cc (Input_objects::add_object): Print trace output.
15606 * options.cc (options::parse_set): New function.
15607 (General_options::parse_wrap): Deleted.
15608 (General_options::General_options): Deleted initializer.
15609 * options.h (options::String_set): New typedef.
15610 (options::parse_set): New function.
15611 (DEFINE_set): New macro.
15612 (General_options::wrap): Changed to use DEFINE_set. Changed
15613 callers of any_wrap_symbols and is_wrap_symbol.
15614 (General_options::trace, General_options::trace_symbol):
15615 New options.
15616 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15617 (General_options::wrap_symbols_): Deleted.
15618 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15619
b5be4a7c
DM
156202008-04-17 David S. Miller <davem@davemloft.net>
15621
15622 * options.cc (General_options::parse_V): New function.
15623 * options.h: Add entries for -V and -Qy.
15624
155a0dd7
ILT
156252008-04-17 Ian Lance Taylor <iant@google.com>
15626
15627 * common.cc (Symbol_table::allocate_commons): Remove options
15628 parameter. Change caller.
15629 (Symbol_table::do_allocate_commons): Remove options parameter.
15630 Change caller. Just call do_allocate_commons_list twice.
15631 (Symbol_table::do_allocate_commons_list): New function, broken out
15632 of do_allocate_commons.
15633 * common.h (class Allocate_commons_task): Remove options_ field.
15634 Update constructor.
15635 * symtab.cc (Symbol_table::Symbol_table): Initialize
15636 tls_commons_.
15637 (Symbol_table::add_from_object): Put TLS common symbols on
15638 tls_commons_ list.
15639 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15640 which are IN_OUTPUT_DATA.
15641 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15642 allocate_commons and do_allocate_commons declarations. Declare
15643 do_allocate_commons_list.
15644 * gold.cc (queue_middle_tasks): Update creation of
15645 Allocate_commons_task to not pass options.
15646 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15647 (TLS_TEST_C_FLAGS): New variable.
15648 (tls_test_c_pic.o): New target.
15649 (tls_test_shared.so): Link in tls_test_c_pic.o.
15650 (tls_test_c_pic_ie.o): New target.
15651 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15652 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15653 (tls_test_c.o): New target.
15654 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15655 (tls_pic_test_LDADD): Likewise.
15656 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15657 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15658 (tls_test_c_gnu2.o): New target.
15659 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15660 tls_test_c_gnu2.o.
15661 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15662 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15663 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15664 * testsuite/tls_test.cc: Include "config.h".
15665 (t_last): Call t11_last.
15666 * testsuite/tls_test.h (t11, t11_last): Declare.
15667 * testsuite/tls_test_c.c: New file.
15668 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15669 * configure.ac: Check for OpenMP support.
15670 * configure, config.in, Makefile.in: Rebuild.
15671 * testsuite/Makefile.in: Rebuild.
15672
edfbb029
CC
156732008-04-16 Cary Coutant <ccoutant@google.com>
15674
15675 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15676 (Target_i386::tls_base_symbol_defined_): New field.
15677 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15678 (Target_i386::Scan::global): Likewise.
15679 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15680 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15681 (Target_x86_64::tls_base_symbol_defined_): New field.
15682 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15683 (Target_x86_64::Scan::global): Likewise.
15684
f3c69fca
CC
156852008-04-16 Cary Coutant <ccoutant@google.com>
15686
15687 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15688 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15689 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15690 building shared libraries.
15691 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15692 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15693 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15694 * testsuite/Makefile.in: Rebuild.
15695 * testsuite/weak_undef.h: New file.
15696 * testsuite/weak_undef_file1.cc: Add extra test cases.
15697 * testsuite/weak_undef_file2.cc: Likewise.
15698 * testsuite/weak_undef_test.cc: Likewise.
15699
7c414435
DM
157002008-04-16 David S. Miller <davem@davemloft.net>
15701
32b769e1
DM
15702 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15703 Add issued_non_pic_error_ field. Declare check_non_pic.
15704 (Target_sparc::Scan::check_non_pic): New function.
15705 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15706 (Target_sparc::Scan::global): Likewise.
15707
11936fb1
DM
15708 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15709 * configure: Rebuild.
15710
7c414435
DM
15711 * options.h (DEFINE_enable): New macro.
15712 (new_dtags): New enable option.
15713 (initfirst, interpose, loadfltr, nodefaultlib,
15714 nodelete, nodlopen, nodump): New -z options.
15715 * layout.cc (Layout:finish_dynamic_section): If new
15716 dtags enabled, emit DT_RUNPATH. Also, emit a
15717 DT_FLAGS_1 containing any specified -z flags.
15718
85c7bf8b
ILT
157192008-04-16 Ian Lance Taylor <iant@google.com>
15720
12c0daef
ILT
15721 * copy-relocs.cc: New file.
15722 * copy-relocs.h: New file.
15723 * reloc.cc: Remove Copy_relocs code.
15724 * reloc.h: Likewise.
15725 * reloc-types.h (struct Reloc_types) [both versions]: Add
15726 get_reloc_addend_noerror.
15727 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15728 variants of add_global which take an addend which must be zero.
15729 * i386.cc: Include "copy-relocs.h".
15730 (class Target_i386): Change type of copy_relocs_ to variable,
15731 update initializer.
15732 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15733 Change all callers.
15734 (Target_i386::do_finalize_sections): Change handling of
15735 copy_relocs_.
15736 * sparc.cc: Include "copy-relocs.h".
15737 (class Target_sparc): Change type of copy_relocs_ to variable,
15738 update initializer.
15739 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15740 Change all callers.
15741 (Target_sparc::do_finalize_sections): Change handling of
15742 copy_relocs_.
15743 * x86_64.cc: Include "copy-relocs.h".
15744 (class Target_x86_64): Change type of copy_relocs_ to variable,
15745 update initializer.
15746 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15747 class. Change all callers.
15748 (Target_x86_64::do_finalize_sections): Change handling of
15749 copy_relocs_.
15750 * Makefile.am (CCFILES): Add copy-relocs.cc.
15751 (HFILES): Add copy-relocs.h.
15752
4f4995b6
ILT
15753 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15754
85c7bf8b
ILT
15755 * testsuite/script_test_4.sh: Permit leading zeroes.
15756
4f2a9edd
ILT
157572008-04-15 Ian Lance Taylor <iant@google.com>
15758
e6188289
ILT
15759 * script-sections.cc (Script_sections::create_segments): Use
15760 header_size_adjustment even when there is enough room for the
15761 headers.
15762 * testsuite/script_test_4.sh: New file.
15763 * testsuite/script_test_4.t: New file.
15764 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15765 (check_DATA): Add script_test_4.stdout.
15766 (MOSTLYCLEANFILES): Likewise.
15767 (script_test_4): New target.
15768 (script_test_4.stdout): New target.
15769 * testsuite/Makefile.in: Rebuild.
15770
4f2a9edd
ILT
15771 * sparc.cc: Add definitions for Output_data_plt_sparc class
15772 constants.
15773
f5314dd5
DM
157742008-04-14 David S. Miller <davem@davemloft.net>
15775
15776 * sparc.cc: New file.
15777 * Makefile.am (TARGETSOURCES): Add sparc.cc
15778 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15779 * configure.tgt: Document targ_extra_size and
15780 targ_extra_big_endian. Add entries for sparc-* and
15781 sparc64-*.
15782 * configure.ac: Handle targ_extra_size and
15783 targ_extra_big_endian.
15784 * Makefile.in: Rebuild.
15785 * configure: Likewise.
15786 * po/POTFILES.in: Likewise.
15787 * po/gold.pot: Likewise.
15788
154e0e9a
ILT
157892008-04-14 Ian Lance Taylor <iant@google.com>
15790
15791 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15792 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15793 in the name/type/flags to section mapping. Don't call
15794 allocate_output_section.
15795 (Layout::choose_output_section): Change parameter from adjust_name
15796 to is_input_section. Don't permit input sections after sections
15797 are attached to segments. Don't call allocate_output_section.
15798 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15799 not write_enable_output_section.
15800 (Layout::make_output_section): Don't push to
15801 unattached_section_list_ nor call attach_to_segment. Call
15802 attach_section_to_segment if sections are attached.
15803 (Layout::attach_sections_to_segments): New function.
15804 (Layout::attach_section_to_segment): New function.
15805 (Layout::attach_allocated_section_to_segment): Rename from
15806 attach_to_segment. Remove flags parameter.
15807 (Layout::allocate_output_section): Remove function.
15808 (Layout::write_enable_output_section): Remove function.
15809 * layout.h (class Layout): Update for above changes. Add new
15810 field sections_are_attached_.
15811 * output.h (Output_section::update_flags_for_input_section): New
15812 function.
15813 * output.cc (Output_section::add_input_section): Call
15814 update_flags_for_input_section.
15815 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15816
009a67a2
CC
158172008-04-11 Cary Coutant <ccoutant@google.com>
15818
15819 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15820 thought unnecessary.
15821 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15822
759b1a24
ILT
158232008-04-11 Ian Lance Taylor <iant@google.com>
15824
15825 * output.h (class Output_section_data): Remove inline definition
15826 of set_addralign.
15827 * output.cc (Output_section_data::set_addralign): New function.
15828
c2b45e22
CC
158292008-04-11 Cary Coutant <ccoutant@google.com>
15830
15831 Add support for TLS descriptors for i386 and x86_64.
15832 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15833 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15834 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15835 GOT_TYPE_TLS_DESC.
15836 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15837 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15838 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15839 relocations.
15840 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15841 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15842 Fix problem with initial-exec relocations.
15843 (Target_i386::Relocate::relocate_tls): Likewise.
15844 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15845 relaxation.
15846 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15847 support for section-plus-offset dynamic table entries.
15848 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15849 (Output_data_dynamic::Dynamic_entry): Add support for
15850 section-plus-offset dynamic table entries.
15851 (Output_data_dynamic::Classification): Likewise.
15852 (Output_data_dynamic::classification_): Renamed offset_.
15853 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15854 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15855 (Target_x86_64::make_plt_section): New function.
15856 (Target_x86_64::reserve_tlsdesc_entries): New function.
15857 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15858 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15859 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15860 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15861 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15862 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15863 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15864 add extra PLT entry for TLS descriptors.
15865 (Output_data_plt_x86_64::got_): New field.
15866 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15867 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15868 fields.
15869 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15870 descriptors.
15871 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15872 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15873 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15874 R_386_TLS_DESC_CALL relocations.
15875 (Target_x86_64::Scan::global): Likewise.
15876 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15877 for TLS descriptors.
15878 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15879 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15880 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15881 GD-to-IE relaxation.
15882 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15883 and TLS_DESCRIPTORS.
15884 * Makefile.in: Rebuild.
15885 * configure: Rebuild.
15886 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15887 (tls_test_shared2.so): New target.
15888 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15889 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15890 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15891 (tls_shared_gd_to_ie_test_LDADD): New variable.
15892 (tls_shared_gnu2_gd_to_ie_test): New target.
15893 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15894 New targets.
15895 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15896 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15897 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15898 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15899 (tls_shared_gnu2_test): New target.
15900 (tls_test_gnu2_shared.so): New target.
15901 (tls_shared_gnu2_test_SOURCES): New variable.
15902 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15903 (tls_shared_gnu2_test_LDFLAGS): New variable.
15904 (tls_shared_gnu2_test_LDADD): New variable.
15905 * testsuite/Makefile.in: Rebuild.
15906 * testsuite/Makefile.
15907
83bfb6b7
ILT
159082008-04-11 Ian Lance Taylor <iant@google.com>
15909
15910 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15911 justsyms.t.
15912 * testsuite/Makefile.in: Rebuild.
15913
15914 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15915 long.
15916 * testsuite/script_test_2.cc (main): Adjust test.
15917
706e1f5e
ILT
159182008-04-11 David S. Miller <davem@davemloft.net>
15919 Ian Lance Taylor <iant@google.com>
15920
15921 * options.h (General_options): Add entries for '-Y' and
15922 '-relax'.
15923 * options.cc (General_options:finalize): If -Y was used, add those
15924 entries to the library path instead of the default "/lib" and
15925 "/usr/lib".
15926
7c98e6bb
DM
159272008-04-11 David S. Miller <davem@davemloft.net>
15928
15929 * testsuite/justsyms.t: Start at 0x100.
15930 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15931 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15932 long.
15933 * testsuite/script_test_2.cc: Adjust string and section length
15934 checks.
7c98e6bb 15935
99a37bfd
ILT
159362008-04-09 Ian Lance Taylor <iant@google.com>
15937
2cefc357
ILT
15938 PR gold/5996
15939 * script-sections.cc (Sections_element::allocate_to_segment): Add
15940 orphan parameter.
15941 (Output_section_definition::allocate_to_segment): Likewise.
15942 (Orphan_output_section::allocate_to_segment): Likewise.
15943 (Script_sections::attach_sections_using_phdrs_clause): Don't
15944 propagate non-PT_LOAD segments to orphan sections.
15945 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15946 readelf rather than objdump.
15947 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15948 .interp section and PT_INTERP segment are the same size.
15949 * testsuite/Makefile.in: Rebuild.
15950
99a37bfd
ILT
15951 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15952 aliases for symbols defined in the same object.
15953 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15954 (weak_alias_test_SOURCES): New variable.
15955 (weak_alias_test_DEPENDENCIES): New variable.
15956 (weak_alias_test_LDFLAGS): New variable.
15957 (weak_alias_test_LDADD): New variable.
15958 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15959 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15960 (weak_alias_test_3.o): New target.
15961 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15962 * testsuite/weak_alias_test_main.cc: New file.
15963 * testsuite/weak_alias_test_1.cc: New file.
15964 * testsuite/weak_alias_test_2.cc: New file.
15965 * testsuite/weak_alias_test_3.cc: New file.
15966
780e49c5
ILT
159672008-04-08 Ian Lance Taylor <iant@google.com>
15968
cdb0b8f5
ILT
15969 * options.h (class General_options): Add --noinhibit-exec option.
15970 * main.cc (main): Check --noinhibit-exec.
15971
0864d551
ILT
15972 * options.h (class General_options): Define --wrap as a special
15973 option. Add wrap_symbols_ field.
15974 (General_options::any_wrap_symbols): New function.
15975 (General_options::is_wrap_symbol): New function.
15976 * options.cc (General_options::parse_wrap): New function.
15977 (General_options::General_options): Initialize wrap_symbols_.
15978 * symtab.cc (Symbol_table::wrap_symbol): New function.
15979 (Symbol_table::add_from_object): Handle --wrap.
15980 * symtab.h (class Symbol_table): Declare wrap_symbol.
15981 * target.h (Target::wrap_char): New function.
15982 (Target::Target_info): Add wrap_char field.
15983 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15984 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15985 * testsuite/testfile.cc (Target_test::test_target_info):
15986 Likewise.
15987
789aa6de
ILT
15988 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15989 there is one.
15990
2c38906f
ILT
15991 * layout.h (class Layout): Add added_eh_frame_data_ field.
15992 * layout.cc (Layout::Layout): Initialize new field.
15993 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15994 output section until we find a section we merged successfully.
15995 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15996 that the size be non-zero.
15997
780e49c5
ILT
15998 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15999 qualifier.
16000
7fcd0256
ILT
160012008-04-08 Craig Silverstein <csilvers@google.com>
16002
16003 * configure.ac: Export new conditional variable HAVE_ZLIB.
16004 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16005 on HAVE_ZLIB.
16006 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16007 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16008
6835af53
ILT
160092008-04-07 Ian Lance Taylor <iant@google.com>
16010
e24f324c
ILT
16011 * version.cc (version_string): Set to "1.5".
16012
a036edd8
ILT
16013 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16014 Add issued_non_pic_error_ field. Declare check_non_pic.
16015 (Target_x86_64::Scan::check_non_pic): New function.
16016 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16017 (Target_x86_64::Scan::global): Likewise.
16018
624f8810
ILT
16019 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16020 addend parameter. Change caller. Handle merge sections.
16021 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16022 Address to Addend. Don't add in the result of
16023 local_section_offset, pass down the addend and use the returned
16024 value.
16025 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16026 Update declarations of local_section_offset and symbol_value.
16027 * testsuite/two_file_test_1.cc (t18): New function.
16028 * testsuite/two_file_test_2.cc (f18): New function.
16029 * testsuite/two_file_test_main.cc (main): Call t18.
16030 * testsuite/two_file_test.h (t18, f18): Declare.
16031
6835af53
ILT
16032 * configure.ac: Don't test for objdump, c++filt, or readelf.
16033 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16034 conditionals.
16035 (TEST_READELF): New variable.
16036 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16037 (check_PROGRAMS): Add two_file_strip_test.
16038 (two_file_strip_test): New target.
16039 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16040 (two_file_same_shared_strip_test_SOURCES): New variable.
16041 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16042 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16043 (two_file_same_shared_strip_test_LDADD): New variable.
16044 (two_file_shared_strip.so): New target.
16045 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16046 (ver_test_5.syms, ver_test_7.syms): Likewise.
16047 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16048 (strip_test_3.stdout): Use TEST_OBJDUMP.
16049 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16050
86925eef
CC
160512008-04-04 Cary Coutant <ccoutant@google.com>
16052
16053 * symtab.h (Symbol::is_weak_undefined): New function.
16054 (Symbol::is_strong_undefined): New function.
16055 (Symbol::is_absolute): New function.
16056 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16057 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16058 absolute symbols.
16059 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16060 (weak_undef_test): New target.
16061 * testsuite/Makefile.in: Rebuild.
16062 * testsuite/weak_undef_file1.cc: New file.
16063 * testsuite/weak_undef_file2.cc: New file.
16064 * testsuite/weak_undef_test.cc: New file.
16065
126f3ece
ILT
160662008-04-03 Craig Silverstein <csilvers@google.com>
16067
16068 * compressed_output.h (class Output_compressed_section): Use
16069 unsigned buffer.
16070 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16071 add zlib header.
16072 (zlib_compressed_suffix): Removed.
16073 (Output_compressed_section::set_final_data_size): Use unsigned
16074 buffers.
16075 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16076 Fix linker invocation.
16077 (flagstest_o_specialfile_and_compress_debug_sections):
16078 Likewise.
16079 * testsuite/Makefile.in: Regenerated.
16080
deae2a14
DM
160812008-04-02 David S. Miller <davem@davemloft.net>
16082
16083 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16084 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16085
70752818
ILT
160862008-04-02 Craig Silverstein <csilvers@google.com>
16087
16088 * TODO: New file.
16089
39d0cb0e
ILT
160902008-04-02 Ian Lance Taylor <iant@google.com>
16091
16092 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16093 parameters. Update for new key type to views_. Change all
16094 callers.
16095 (File_read::read): Adjust for byteshift in returned view.
16096 (File_read::add_view): New function, broken out of
16097 find_and_make_view.
16098 (File_read::make_view): New function, broken out of
16099 find_and_make_view.
16100 (File_read::find_or_make_view): Add offset and aligned
16101 parameters. Rewrite accordingly. Change all callers.
16102 (File_read::get_view): Add offset and aligned parameters. Adjust
16103 for byteshift in return value.
16104 (File_read::get_lasting_view): Likewise.
16105 * fileread.h (class File_read): Update declarations.
16106 (class File_read::View): Add byteshift_ field. Add byteshift to
16107 constructor. Add byteshift method.
16108 * archive.h (Archive::clear_uncached_views): New function.
16109 (Archive::get_view): Add aligned parameter. Change all callers.
16110 * object.h (Object::get_view): Add aligned parameter. Change all
16111 callers.
16112 (Object::get_lasting_view): Likewise.
16113
16114 * fileread.cc (File_read::release): Don't call clear_views if
16115 there are multiple objects.
16116 * fileread.h (File_read::clear_uncached_views): New function.
16117 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16118 on the archive.
16119
a1207466
CC
161202008-03-31 Cary Coutant <ccoutant@google.com>
16121
16122 Add thin archive support.
16123 * archive.cc (Archive::armagt): New const.
16124 (Archive::setup): Remove task parameter and calls to unlock.
16125 (Archive::unlock_nested_archives): New function.
16126 (Archive::read_header): Add nested_off parameter. Change
16127 all callers.
16128 (Archive::interpret_header): Likewise.
16129 (Archive::include_all_members): Change to handle thin
16130 archives.
16131 (Archive::include_member): Likewise.
16132 * archive.h (Archive::Archive): Add new parameters and
16133 initializers.
16134 (Archive::armagt): New const.
16135 (Archive::setup): Remove task parameter.
16136 (Archive::unlock_nested_archives): New function.
16137 (Archive::read_header): Add nested_off parameter.
16138 (Archive::interpret_header): Likewise.
16139 (Archive::Nested_archive_table): New typedef.
16140 (Archive::is_thin_archive_): New field.
16141 (Archive::nested_archives_): New field.
16142 (Archive::options_): New field.
16143 (Archive::dirpath_): New field.
16144 (Archive::task_): New field.
16145 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16146 for thin archives. Pass additional parameters to
16147 Archive::Archive. Unlock the archive file after calling
16148 Archive::setup.
cd536b21 16149
479f6503
ILT
161502008-03-29 Ian Lance Taylor <iant@google.com>
16151
686c8caf
ILT
16152 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16153 version symbol to be local.
16154 * testsuite/ver_test_4.sh: New file.
16155 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16156 (check_DATA): Add ver_test_4.syms.
16157 (ver_test_4.syms): New target.
16158 * testsuite/Makefile.in: Rebuild.
16159
ab794b6b
ILT
16160 * output.cc
16161 (Output_section::Input_section_sort_entry::has_priority): New
16162 function.
16163 (Output_section::Input_section_sort_entry::match_file_name): New
16164 function.
16165 (Output_section::Input_section_sort_entry::match_section_name):
16166 Remove.
16167 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16168 Remove.
16169 (Output_section::Input_section_sort_entry::match_section_file):
16170 Remove.
16171 (Output_section::Input_section_sort_compare::operator()): Rewrite
16172 using new Input_section_sort_entry functions. Sort crtbegin and
16173 crtend first. Sort sections with no priority before sections with
16174 a priority.
16175 * testsuite/initpri1.c (d3): Check j != 4.
16176 (cd5): New constructor/destructor function.
16177 (main): Check j != 2.
16178
479f6503
ILT
16179 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16180 new symbol when resolving, don't call set_is_default.
16181 * testsuite/ver_test_7.cc: New file.
16182 * testsuite/ver_test_7.sh: New file.
16183 * testsuite/Makefile.am (ver_test_7.so): New target.
16184 (ver_test_7.o): New target.
16185 (check_SCRIPTS): Add ver_test_7.sh.
16186 (check_DATA): Add ver_test_7.syms.
16187 (ver_test_7.syms): New target.
16188
2fd32231
ILT
161892008-03-28 Ian Lance Taylor <iant@google.com>
16190
16191 * layout.cc (Layout::layout): If we see an input section with a
16192 name that needs sorting, set the must_sort flag for the output
16193 section.
16194 (Layout::make_output_section): If the name of the output section
16195 indicates that it might require sorting, set the may_sort flag.
16196 * output.h (Output_section::may_sort_attached_input_sections): New
16197 function.
16198 (Output_section::set_may_sort_attached_input_sections): New
16199 function.
16200 (Output_section::must_sort_attached_input_sections): New
16201 function.
16202 (Output_section::set_must_sort_attached_input_sections): New
16203 function.
16204 (class Output_section): Declare Input_section_sort_entry. Define
16205 Input_section_sort_compare. Declare
16206 sort_attached_input_sections. Add new fields:
16207 may_sort_attached_input_sections_,
16208 must_sort_attached_input_sections_,
16209 attached_input_sections_are_sorted_.
16210 * output.cc (Output_section::Output_section): Initialize new
16211 fields.
16212 (Output_section::add_input_section): Add an entry to
16213 input_sections_ if may_sort or must_sort are true.
16214 (Output_section::set_final_data_size): Call
16215 sort_attached_input_sections if necessary.
16216 (Output_section::Input_section_sort_entry): Define new class.
16217 (Output_section::Input_section_sort_compare::operator()): New
16218 function.
16219 (Output_section::sort_attached_input_sections): New function.
16220 * configure.ac: Check whether the compiler supports constructor
16221 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16222 * testsuite/initpri1.c: New file.
16223 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16224 CONSTRUCTOR_PRIORITY.
16225 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16226 (initpri1_LDFLAGS): New variable.
16227 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16228
18e6b24e
ILT
162292008-03-27 Ian Lance Taylor <iant@google.com>
16230
49bdd526
ILT
16231 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16232 * testsuite/common_test_1.c: New file.
16233 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16234 (common_test_1_SOURCES): New variable.
16235 (common_test_1_DEPENDENCIES): New variable.
16236 (common_test_1_LDFLAGS): New variable.
16237
18e6b24e
ILT
16238 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16239 and commons_ correctly when NAME/VERSION does not override
16240 NAME/NULL.
16241 * testsuite/ver_test_6.c: New file.
16242 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16243 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16244 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16245
04bf7072
ILT
162462008-03-26 Ian Lance Taylor <iant@google.com>
16247
5871526f
ILT
16248 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16249 of an undefined symbol from a version script.
16250 * testsuite/Makefile.am (ver_test_5.so): New target.
16251 (ver_test_5.o): New target.
16252 (check_SCRIPTS): Add ver_test_5.sh.
16253 (check_DATA): Add ver_test_5.syms.
16254 (ver_test_5.syms): New target.
16255 * testsuite/ver_test_5.cc: New file.
16256 * testsuite/ver_test_5.script: New file.
16257 * testsuite/ver_test_5.sh: New file.
16258 * Makefile.in, testsuite/Makefile.in: Rebuild.
16259
04bf7072
ILT
16260 PR gold/5986
16261 Fix problems building gold with gcc 4.3.0.
16262 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16263 (gold_error_at_location, gold_warning_at_location): Use it.
16264 * configure.ac: Check whether we can compile and use a template
16265 function with a printf attribute.
16266 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16267 when jumping over bytes.
16268 * object.cc: Instantiate Object::read_section_data.
16269 * debug.h: Include <cstring>
16270 * dwarf_reader.cc: Include <algorithm>
16271 * main.cc: Include <cstring>.
16272 * options.cc: Include <cstring>.
16273 * output.cc: Include <cstring>.
16274 * script.cc: Include <cstring>.
16275 * script.h: Include <string>.
16276 * symtab.cc: Include <cstring> and <algorithm>.
16277 * target-select.cc: Include <cstring>.
16278 * version.cc: Include <string>.
16279 * testsuite/testmain.cc: Include <cstdlib>.
16280 * configure, config.in: Rebuild.
16281
874c5b28
ILT
162822008-03-25 Ian Lance Taylor <iant@google.com>
16283
819d6c3a
ILT
16284 * options.cc: Include "../bfd/bfdver.h".
16285 (options::help): Print bug reporting address.
16286
f4b2c6f5
ILT
16287 * version.cc (print_version): Adjust output for current value of
16288 BFD_VERSION_STRING.
16289
16290 * NEWS: New file.
16291
e96caa79
ILT
16292 * options.cc (options::help): Print list of supported targets.
16293 * target-select.h: Include <vector>.
16294 (class Target_selector): Make machine_, size_, and is_big_endian_
16295 fields const. Add bfd_name_ and instantiated_target_ fields.
16296 (Target_selector::Target_selector): Add bfd_name parameter.
16297 (Target_selector::recognize): Make non-virtual, call
16298 do_recognize.
16299 (Target_selector::recognize_by_name): Make non-virtual, call
16300 do_recognize_by_name.
16301 (Target_selector::supported_names): New function.
16302 (Target_selector::bfd_name): New function.
16303 (Target_selector::do_instantiate_target): New pure virtual
16304 function.
16305 (Target_selector::do_recognize): New virtual function.
16306 (Target_selector::do_recognize_by_name): New virtual function.
16307 (Target_selector::instantiate_target): New private function.
16308 (supported_target_names): Declare.
16309 * target-select.cc (Target_selector::Target_selector): Update for
16310 new parameter and fields.
16311 (select_target_by_name): Check that the name matches before
16312 calling recognize_by_name.
16313 (supported_target_names): New function.
16314 * i386.cc (class Target_selector_i386): Update Target_selector
16315 constructor call. Remove recognize and recognize_by_name. Add
16316 do_instantiate_target.
16317 * x86_64.cc (class Target_selector_x86_64): Likewise.
16318 * testsuite/testfile.cc (class Target_selector_test): Update for
16319 changes to Target_selector.
16320
874c5b28
ILT
16321 * README: Rewrite, with some notes on unsupported features.
16322
0a65a3a7
CC
163232008-03-24 Cary Coutant <ccoutant@google.com>
16324
16325 * i386.cc (Target_i386::Got_type): New enum declaration.
16326 (Target_i386::Scan::local): Updated callers of Output_data_got
16327 member functions.
16328 (Target_i386::Scan::global): Likewise.
16329 (Target_i386::Relocate::relocate): Likewise.
16330 (Target_i386::Relocate::relocate_tls): Likewise.
16331 * object.h (Got_offset_list): New class.
16332 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16333 (Sized_relobj::local_got_offset): Likewise.
16334 (Sized_relobj::set_local_got_offset): Likewise.
16335 (Sized_relobj::local_has_tls_got_offset): Removed.
16336 (Sized_relobj::local_tls_got_offset): Removed.
16337 (Sized_relobj::set_local_tls_got_offset): Removed.
16338 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16339 * output.cc (Output_data_got::add_global): Added got_type parameter.
16340 (Output_data_got::add_global_with_rel): Likewise.
16341 (Output_data_got::add_global_with_rela): Likewise.
16342 (Output_data_got::add_global_pair_with_rel): New function.
16343 (Output_data_got::add_global_pair_with_rela): New function.
16344 (Output_data_got::add_local): Added got_type parameter.
16345 (Output_data_got::add_local_with_rel): Likewise.
16346 (Output_data_got::add_local_with_rela): Likewise.
16347 (Output_data_got::add_local_pair_with_rel): New function.
16348 (Output_data_got::add_local_pair_with_rela): New function.
16349 (Output_data_got::add_global_tls): Removed.
16350 (Output_data_got::add_global_tls_with_rel): Removed.
16351 (Output_data_got::add_global_tls_with_rela): Removed.
16352 (Output_data_got::add_local_tls): Removed.
16353 (Output_data_got::add_local_tls_with_rel): Removed.
16354 (Output_data_got::add_local_tls_with_rela): Removed.
16355 * output.h (Output_data_got::add_global): Added got_type parameter.
16356 (Output_data_got::add_global_with_rel): Likewise.
16357 (Output_data_got::add_global_with_rela): Likewise.
16358 (Output_data_got::add_global_pair_with_rel): New function.
16359 (Output_data_got::add_global_pair_with_rela): New function.
16360 (Output_data_got::add_local): Added got_type parameter.
16361 (Output_data_got::add_local_with_rel): Likewise.
16362 (Output_data_got::add_local_with_rela): Likewise.
16363 (Output_data_got::add_local_pair_with_rel): New function.
16364 (Output_data_got::add_local_pair_with_rela): New function.
16365 (Output_data_got::add_global_tls): Removed.
16366 (Output_data_got::add_global_tls_with_rel): Removed.
16367 (Output_data_got::add_global_tls_with_rela): Removed.
16368 (Output_data_got::add_local_tls): Removed.
16369 (Output_data_got::add_local_tls_with_rel): Removed.
16370 (Output_data_got::add_local_tls_with_rela): Removed.
16371 * resolve.cc (Symbol::override_base_with_special): Removed
16372 reference to has_got_offset_ field.
16373 * symtab.cc (Symbol::init_fields): Replaced initialization
16374 of got_offset_ with got_offsets_. Removed initialization
16375 of has_got_offset_
53fcba31 16376 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16377 (Symbol::got_offset): Likewise.
16378 (Symbol::set_got_offset): Likewise.
16379 (Symbol::has_tls_got_offset): Removed.
16380 (Symbol::tls_got_offset): Removed.
16381 (Symbol::set_tls_got_offset): Removed.
16382 (Symbol::got_offset_): Removed.
16383 (Symbol::tls_mod_got_offset_): Removed.
16384 (Symbol::tls_pair_got_offset_): Removed.
16385 (Symbol::got_offsets_): New field.
16386 (Symbol::has_got_offset): Removed.
16387 (Symbol::has_tls_mod_got_offset): Removed.
16388 (Symbol::has_tls_pair_got_offset): Removed.
16389 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16390 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16391 member functions.
16392 (Target_x86_64::Scan::global): Likewise.
16393 (Target_x86_64::Relocate::relocate): Likewise.
16394 (Target_x86_64::Relocate::relocate_tls): Likewise.
16395
bd52eafb
BE
163962008-03-25 Ben Elliston <bje@au.ibm.com>
16397
16398 * yyscript.y: Fix spelling error in comment.
16399
8b105e34
ILT
164002008-03-24 Ian Lance Taylor <iant@google.com>
16401
8ed814a9
ILT
16402 * options.h (class General_options): Define build_id option.
16403 * layout.h (class Layout): Declare write_build_id, create_note,
16404 create_build_id. Add build_id_note_ member.
16405 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16406 "libiberty.h", "md5.h", "sha1.h".
16407 (Layout::Layout): Initialize eh_frame_data_,
16408 eh_frame_hdr_section_, and build_id_note_.
16409 (Layout::finalize): Call create_build_id.
16410 (Layout::create_note): New function, broken out of
16411 Layout::create_gold_note.
16412 (Layout::create_gold_note): Call create_note.
16413 (Layout::create_build_id): New function.
16414 (Layout::write_build_id): New function.
16415 (Close_task_runner::run): Call write_build_id.
16416
8b105e34
ILT
16417 * x86_64.cc: Correct license to GPLv3.
16418
086a1841
ILT
164192008-03-23 Ian Lance Taylor <iant@google.com>
16420
16421 * options.cc: Include "demangle.h".
16422 (parse_optional_string): New function.
16423 (parse_long_option): Handle takes_optional_argument.
16424 (parse_short_option): Update dash_z initializer. Handle
16425 takes_optional_argument.
16426 (General_options::General_options): Initialize do_demangle_.
16427 (General_options::finalize): Set do_demangle_. Handle demangling
16428 style.
16429 * options.h (parse_optional_string): Declare.
16430 (struct One_option): Add optional_arg field. Update constructor.
16431 Update call constructor calls. Add takes_optional_argument
16432 function.
16433 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16434 (DEFINE_optional_string): Define.
16435 (General_options::demangle): Change from DEFINE_bool to
16436 DEFINE_optional_string.
16437 (General_options::no_demangle): New function.
16438 (General_options::do_demangle): New function.
16439 (General_options::set_do_demangle): New function.
16440 (General_options::execstack_status_): Move definition to end of
16441 class definition.
16442 (General_options::static_): Likewise.
16443 (General_options::do_demangle_): New field.
16444 * object.cc (big_endian>::get_symbol_location_info): Call
16445 Options::do_demangle, not Options::demangle.
16446 * symtab.cc (demangle): Likewise.
16447
cbb93e63
ILT
164482008-03-22 Ian Lance Taylor <iant@google.com>
16449
16450 * gold.h: Include <cstddef> and <sys/types.h>
16451 * options.h: Include <cstring>.
16452
ec531623
ILT
164532008-03-21 Ian Lance Taylor <iant@google.com>
16454
16455 * Added source code to GNU binutils.
752937aa 16456\f
4b95cf5c 16457Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16458
16459Copying and distribution of this file, with or without modification,
16460are permitted in any medium without royalty provided the copyright
16461notice and this notice are preserved.
16462
16463Local Variables:
16464mode: change-log
16465left-margin: 8
16466fill-column: 74
16467version-control: never
16468End:
This page took 1.041056 seconds and 4 git commands to generate.