Another fix for an objdump crash when parsing a corrupt binary.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e749cab8
L
12015-01-06 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/17809
4 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
5 x32.
6
af759df0
AM
72015-01-02 Alan Modra <amodra@gmail.com>
8
9 * version.cc (print_version): Just print current year.
10 * dwp.cc (print_version): Likewise.
11
b90efa5b
AM
122015-01-01 Alan Modra <amodra@gmail.com>
13
14 Update year range in copyright notice of all files.
15
f12d1e8a
AM
162014-12-25 Alan Modra <amodra@gmail.com>
17
18 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
19 new enums.
20 (Target_arm::merge_object_attributes, ): Likewise.
21
5c294fee
TG
222014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
23
24 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
25 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
26 AEABI_VFP_args_vfp to check that.
27 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
28 value and replace hardcoded values by enum values.
29
e30880c2
CC
302014-12-22 Cary Coutant <ccoutant@google.com>
31
32 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
33
bd040da1
L
342014-12-20 H.J. Lu <hongjiu.lu@intel.com>
35
36 PR gold/14608
37 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
38 to "return i * i * 3;".
39
e02a4046
CC
402014-12-16 Cary Coutant <ccoutant@google.com>
41
42 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
43 (Mapfile::print_output_data): Use current_data_size() to avoid
44 assert for sections requiring postprocessing; if address is not valid,
45 print 0.
46 (Mapfile::print_output_section): Use current_data_size(); print note
47 that addresses and sizes are before compression.
48
add6016b
L
492014-12-14 H.J. Lu <hongjiu.lu@intel.com>
50
51 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
52 Cast current_group_size to unsigned long when reporting error.
53
0bf32ea9
JY
542014-12-10 Jing Yu <jingyu@google.com>
55
56 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
57 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
58 Update error message.
59 (Target_aarch64::do_relax): Use absolute value of option
60 stub_group_size. Replace local variable with class member
61 stub_group_size_.
62
cbcb23fa
AM
632014-12-04 Alan Modra <amodra@gmail.com>
64
65 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
66 addend of PLTREL24 reloc when not generating a plt stub. Make
67 max_branch_offset an "Address".
fbad6518 68 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
69 (Target_powerpc::Relocate::relocate): Likewise.
70
1611bc4a
AM
712014-12-04 Alan Modra <amodra@gmail.com>
72
73 PR 17670
74 * symtab.cc (Symbol::set_undefined): Remove assertion.
75 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
76 on symbols defined in discarded sections, instead return false.
77 Rearrange params, update all callers.
78 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
79 branches to syms in discarded sections.
80 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
81 undefined and flag as discarded.
82 (Target_powerpc::Relocate::relocate): Localize variable.
83
4759c34e
L
842014-12-03 H.J. Lu <hongjiu.lu@intel.com>
85
86 PR gold/17675
87 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
88 * testsuite/Makefile.in: Regenerated.
89
1f98a074
AM
902014-12-03 Alan Modra <amodra@gmail.com>
91
92 PR 17566
93 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
94 when adding dynamic relocations against section symbols.
95
fb257835
DI
962014-12-01 Dimitry Ivanov <dimitry@google.com>
97
98 * layout.cc (Layout::finish_dynamic_section): When '-z global'
99 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
100 * options.h (General_options): New -z option (global).
101
d8e60314
CC
1022014-12-01 Cary Coutant <ccoutant@google.com>
103
104 PR gold/17578
105 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
106 is given.
107 (Layout::create_executable_stack_info): Warn when -z noexecstack is
108 given but some inputs require executable stack.
109
982bbd97
CC
1102014-11-26 Cary Coutant <ccoutant@google.com>
111
112 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
113 .debug_str_offsets; strip .debug_gnu_pubnames and
114 .debug_gnu_pubtypes.
115 (lines_only_debug_sections): Strip all four new sections.
116
bb779192
HS
1172014-11-26 Jing Yu <jingyu@google.com>
118
119 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
120 register to be x0 when to relax TLSDESC_LD64_LO12.
121
a3e60ddb
AM
1222014-11-26 Alan Modra <amodra@gmail.com>
123
124 * powerpc.cc (struct Stub_table_owner): New.
125 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
126 unsigned int vector. Update all references.
127 (powerpc_relobj::set_stub_table): Take an unsigned int param
128 rather than a Stub_table. Update callers.
129 (Powerpc_relobj::clear_stub_table): New function.
130 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
131 stub_group_size_ vars.
132 (Target_powerpc::new_stub_table): Delete.
133 (max_branch_delta): New function, extracted from..
134 (Target_powerpc::Relocate::relocate): ..here..
135 (Target_powerpc::Branch_info::make_stub): ..and here. Return
136 status on whether stub created successfully.
137 (Stub_control::Stub_control): Add "no_size_errors" param. Move
138 default sizing to..
139 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
140 reduce on relax failure.
141 (Target_powerpc::group_sections): Add "no_size_errors" param.
142 Use stub_group_size_. Set up group info in a temp vector,
143 before building Stub_table vector. Account for input sections
144 possibly already converted to relaxed sections.
145 (Stub_table::init): Delete. Merge into..
146 (Stub_table::Stub_table): ..here.
147 (Stub_table::can_reach_stub): New function.
148 (Stub_table::add_plt_call_entry): Add "from" parameter and
149 return true iff stub could be reached.
150 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
151 param too.
152 (Stub_table::clear_stubs): Add "all" param.
153
a20605cf
AM
1542014-11-26 Alan Modra <amodra@gmail.com>
155
156 * powerpc.cc (Stub_control::set_output_and_owner): New function.
157 (Target_powerpc::group_sections): Use it.
158
43b64deb
CC
1592014-11-25 Cary Coutant <ccoutant@google.com>
160
161 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
162 (Binary_to_elf::write_symbol): Add st_size parameter.
163 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
164
c924eb67
CC
1652014-11-25 Cary Coutant <ccoutant@google.com>
166
167 PR gold/17639
168 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
169 (Sized_relobj_file::do_layout): Handle deferred sections properly
170 during GC pass 1. Don't add reloc sections to deferred list twice.
171 * object.h (Sized_relobj_file::is_deferred_layout): New function.
172 (Sized_relobj_file::is_deferred_layout_): New data member.
173
9d585188
L
1742014-11-21 H.J. Lu <hongjiu.lu@intel.com>
175
176 PR gold/17619
177 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
178 Check PC-relative offset overflow in PLT entry.
179
3ffaac20
AM
1802014-11-21 Alan Modra <amodra@gmail.com>
181
182 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
183 for undefined weaks.
184
0cfb0717
AM
1852014-11-20 Alan Modra <amodra@gmail.com>
186
187 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
188 from --stub-group-size parameter divided by 1024.
189 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
190 template parameter. Update all uses.
191 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
192 has_stub_value. Set for long branches. Don't report overflow for
193 branch to undefined weak symbols. Print info message on
194 overflowing branch to stub.
195
f9dffbf0
AM
1962014-11-20 Alan Modra <amodra@gmail.com>
197
198 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
199
e88ba8d5
L
2002014-11-13 H.J. Lu <hongjiu.lu@intel.com>
201
202 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
203 entry for R_X86_64_GOTPLT64.
204 (Target_x86_64<size>::Relocate::relocate): Update comments for
205 R_X86_64_GOTPLT64.
206
d37ffe25
ED
2072014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
208
209 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
210 * plugin.h: add lock definition
211
9726c3c1
HS
2122014-10-29 Han Shen <shenhan@google.com>
213 Jing Yu <jingyu@google.com>
214
215 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
216 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
217 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
218 Symbol::TLS_REF.
219 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
220 method.
221 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
222 (Target_aarch64::tls_ld_to_le): New method.
223 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
224 for 64bit targets.
225 (Output_data_plt_aarch64::irelative_rel_): New data member.
226 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
227 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
228 (Output_data_plt_aarch64::add_relocation): New method.
229 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
230 offset. Add got_irelative size to got size.
231 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
232 type string with the new typename.
233 (AArch64_relocate_functions::update_adr): Replace parameter x with
234 immed.
235 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
236 (AArch64_relocate_functions::reloc_common): New method.
237 (AArch64_relocate_funcsions::rela_general): Extract common part out
238 into reloc_common method.
239 (AArch64_relocate_functions::rela_general): Likewise.
240 (AArch64_relocate_functions::pcrela_general): Likewise.
241 (AArch64_relocate_functions::adr): New method.
242 (AArch64_relocate_functions::adrp): Calculate immed before calling
243 update_adr.
244 (AArch64_relocate_functions::adrp): Likewise.
245 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
246 comparing x to 0. Calculate immed from ~x when x < 0.
247 (Target_aarch64::optimize_tls_reloc): Add new cases for
248 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
249 TLSLD_MOVW_DTPREL_G0_NC.
250 (Target_aarch64::possible_function_pointer_reloc): Implement this
251 method.
252 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
253 comment.
254 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
255 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
256 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
257 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
258 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
259 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
260 (Target_aarch64::make_plt_entry): Call add_entry with two more
261 parameters.
262 (Target_aarch64::make_local_ifunc_plt_entry): New method.
263 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
264 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
265 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
266 (Target_aarch64::Relocate::relocate_tls): Add cases for
267 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
268 TLSLD_MOVW_DTPREL_G0_NC.
269 * testsuite/icf_safe_so_test.cc: Correct test comment.
270 * testsuite/icf_safe_test.sh: Add AArch64 arch.
271
80272b8c
AM
2722014-10-22 Alan Modra <amodra@gmail.com>
273
274 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
275 thread_starter.
276
998a69f4
AS
2772014-10-18 Andreas Schwab <schwab@linux-m68k.org>
278
279 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
280
aed56ec5
CC
2812014-10-17 Cary Coutant <ccoutant@google.com>
282
283 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
284 Add "typename" keyword.
285
bb779192 2862014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
287 Jing Yu <jingyu@google.com>
288
289 Patch for gold aarch64 backend to support relaxation.
290 * aarch64-reloc.def: Change format.
291 * aarch64.cc (class Reloc_stub): New class.
292 (class Stub_table): New class.
293 (class AArch64_relobj): New class.
294 (class AArch64_input_section): New class.
295 (class AArch64_output_section): New class.
296 (Target_aarch64::new_stub_table): New method.
297 (Target_aarch64::new_aarch64_input_section): New method.
298 (Target_aarch64::find_aarch64_input_section): New method.
299 (Target_aarch64::scan_section_for_stubs): New method.
300 (Target_aarch64::scan_reloc_section_for_stubs): New method.
301 (Target_aarch64::relocate_stub): New method.
302 (Target_aarch64::current_target): New method.
303 (Target_aarch64::do_make_elf_object): New method.
304 (Target_aarch64::do_may_relax): New method.
305 (Target_aarch64::do_relax): New method.
306 (Target_aarch64::group_sections): New method.
307 (Target_aarch64::scan_reloc_for_stub): New method.
308 (Target_aarch64::do_make_output_section): New method.
309 (Target_aarch64::stub_tables_): New data member.
310 (Target_aarch64::aarch64_input_section_map_): New data member.
311 (AArch64_relocate_functions::maybe_apply_stub): New method.
312
db4c9594
CC
3132014-09-30 Cary Coutant <ccoutant@google.com>
314
315 PR gold/17432
316 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
317
cd6da036
KC
3182014-09-30 Kito Cheng <kito@0xlab.org>
319
320 PR gold/13597
321 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
322 hash table before sysv-style hash table.
323
5f772412
ST
3242014-09-29 Sriraman Tallam <tmsriram@google.com>
325
326 * options.h (--pic-executable): Add negative to alias to -no-pie.
327
5efeedf6
CC
3282014-09-26 Cary Coutant <ccoutant@google.com>
329
330 PR gold/16773
331 * object.cc (Sized_relobj_file): Compute value of section symbols
332 for TLS sections the same as TLS symbols.
333
1707f183
CC
3342014-09-25 Cary Coutant <ccoutant@google.com>
335
336 PR gold/17432
337 * resolve.cc (Symbol_table::resolve): Override common placeholder
338 symbols, but adjust sizes.
339 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
340 symbols to common lists.
341
00cac886
AM
3422014-09-24 Alan Modra <amodra@gmail.com>
343
344 * po/POTFILES.in: Regenerate.
345
635aa30e
CC
3462014-09-23 Taiju Tsuiki <tzik@google.com>
347 Cary Coutant <ccoutant@google.com>
348
71b9b91b 349 PR gold/14860
635aa30e
CC
350 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
351 on input_sections_blocker.
352 * layout.cc (Write_sections_task::locks): Unblock
353 input_sections_blocker_.
354 * layout.h (Write_sections_task::Write_sections_task): Add
355 input_sections_blocker.
356 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
357 to DEPENDENCIES.
358 * testsuite/Makefile.in: Regenerate.
359
c0c71592
RÁE
3602014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
361
362 * testsuite/Makefile.am (plugin_test_10): New test.
363 * testsuite/Makefile.in: Regenerate
364 * testsuite/plugin_common_test_2.c (c1): Align to 8.
365 * testsuite/plugin_test_10.sh: New file.
366
6168c2a1
RÁE
3672014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
368
369 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
370 * resolve.cc (Symbol_table::resolve): Don't override common symbols
371 during the replacement phase.
372
3a531937
JY
3732014-09-17 Han Shen <shenhan@google.com>
374 Jing Yu <jingyu@google.com>
375
376 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
377 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
378 * aarch64.cc (Target_aarch64): Add data members
379 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
380 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
381 constructor.
382 (Target_aarch64::do_reloc_symbol_index): New method.
383 (Target_aarch64::do_reloc_addend): New method.
384 (Target_aarch64::add_tlsdesc_info): New method.
385 (Target_aarch64::do_dynsym_value): New method.
386 (Target_aarch64::do_make_data_plt): Add new parameters: got,
387 got_irelative. Pass them to Output_data_plt_aarch64_standard.
388 (Target_aarch64::make_data_plt): Add new parameters: got,
389 got_irelative. Pass them to do_make_data_plt.
390 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
391 (Target_aarch64::Relocate:tls_gd_to_le): New method.
392 (Target_aarch64::Relocate:tls_ie_to_le): New method.
393 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
394 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
395 (Target_aarch64::got_tlsdesc_section): New method.
396 (Target_aarch64::make_local_ifunc_plt_entry): New method.
397 (Target_aarch64::define_tls_base_symbol): New method.
398 (Target_aarch64::reserve_tlsdesc_entries): New method.
399 (Target_aarch64::got_mod_index_entry): New method.
400 (Target_aarch64::rela_tlsdesc_section): New method.
401 (Target_aarch64::rela_irelative_section): New method.
402 (Target_aarch64::Tlsdesc_info): New struct.
403 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
404 relocations and tlsdesc relocations.
405 (Target_aarch64::optimize_tls_reloc): Implement method.
406 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
407 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
408 in constructor.
409 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
410 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
411 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
412 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
413 (Output_data_plt_aarch64::rela_tlsdesc): New method.
414 (Output_data_plt_aarch64::rela_irelative): New method.
415 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
416 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
417 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
418 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
419 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
420 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
421 (Output_data_plt_aarch64_standard): New member variables:
422 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
423 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
424 New parameter: got, got_irelative.
425 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
426 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
427 (Output_data_plt_aarch64::do_write): Replace got_address with
428 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
429 (AArch64_relocate_functions::update_movnz): New method.
430 (AArch64_relocate_functions): Correct format.
431 (AArch64_relocate_functions::movnz): New method.
432 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
433 before the switch. Add new cases to switch.
00cac886 434 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
435 tlsgd tlsdesc cases.
436 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
437 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
438 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
439 Call reloc_name_in_error_message to print unsupported reloc.
440 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
441 make_data_plt.
442 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
443 relocs. Fill in some more dynamic tags.
444 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
445 Skip call tls_get_addr when tlsgd is relaxed.
446 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
447 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
448 tlsdesc->ie relaxation.
449
62661c93
SS
4502014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
451
452 * mips.cc (Target_mips_nacl): New class.
453 (Target_selector_mips_nacl): New class.
454 (target_selector_mips32): Rename from target_selector_mips32be and use
455 Target_selector_mips_nacl instead of Target_selector_mips.
456 (target_selector_mips32el): Rename from target_selector_mips32 and use
457 Target_selector_mips_nacl instead of Target_selector_mips.
458 (target_selector_mips64): Rename from target_selector_mips64be and use
459 Target_selector_mips_nacl instead of Target_selector_mips.
460 (target_selector_mips64el): Rename from target_selector_mips64 and use
461 Target_selector_mips_nacl instead of Target_selector_mips.
462 (Target_mips::mips_info): Add const attribute.
463
54674d38
CC
4642014-09-02 Cary Coutant <ccoutant@google.com>
465
466 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
467 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
468 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
469 (Sized_incr_dynobj::do_section_name): Likewise.
470 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
471 (Sized_incr_dynobj::do_section_name): Likewise.
472 * object.h (Object::section_name): Likewise.
473 (Object::do_section_name): Likewise.
474 (Sized_relobj_file::do_section_name): Likewise.
475 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
476 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
477
9860cbcf
CC
4782014-09-02 Cary Coutant <ccoutant@google.com>
479
480 PR gold/17005
481 * ehframe.cc (Fde::write): Add output_offset parameter.
482 (Cie::write): Likewise.
483 (Eh_frame::set_final_data_size): Account for offset within output
484 section.
485 (Eh_frame::do_sized_write): Likewise.
486 * ehframe.h (Fde::write): Add output_offset parameter.
487 (Cie::write): Likewise.
488 * output.cc (Output_section::Input_section_sort_entry): Remove
489 section_has_name_; add output_section_name parameter. Use
490 output section name for non-input sections.
491 (Output_section::Input_section_sort_entry::section_has_name): Remove.
492 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
493 (Output_section::Input_section_sort_compare): Remove logic for
494 sections without names.
495 (Output_section::Input_section_sort_init_fini_compare): Likewise.
496 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
497 Likewise.
498 (Output_section::Input_section_sort_section_name_compare): Likewise.
499
8e33481e
HS
5002014-08-29 Han Shen <shenhan@google.com>
501 Jing Yu <jingyu@google.com>
502
503 * aarch64-reloc-property.cc
504 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
505 reference reloc property in the table.
506 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
507 3 other entries.
508 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
509 2 new overloaded methods.
510 (Output_data_got_aarch64::do_write): Add code to write out
511 static relocs.
512 (class Output_data_got_aarch64::Static_reloc): New class to wrap
513 static relocs.
514 (Output_data_got_aarch64::static_relocs): New vector to
515 hold static relocs.
516 (Target_aarch64::TCB_SIZE): New const static memeber.
517 (Target_aarch64::tcb_size): New method.
518 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
519 (Target_aarch64::Relocate::relocate_tls): New method.
520 (Target_aarch64::Scan::local): Add code handling new reloc types.
521 (Target_aarch64::Scan::global): Add code handling new reloc types.
522
81233653
ST
5232014-08-13 Sriraman Tallam <tmsriram@google.com>
524
525 * options.h (-no-pie): Add option.
526
9363c7c3
JY
5272014-08-08 Jing Yu <jingyu@google.com>
528 Han Shen <shenhan@google.com>
529
530 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
531 (DEFFILES): add aarch64-reloc.def.
532 (TARGETSOURCES): Add aarch64-reloc-property.cc.
533 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
534 * Makefile.in: Regenerate.
535 * aarch64-reloc-property.cc: New file.
536 * aarch64-reloc-property.h: New file.
537 * aarch64-reloc.def: New file.
538 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
539 with tab to make the format consistent.
540 (Output_data_got_aarch64::symbol_table_): New method.
541 (Target_aarch64::do_plt_address_for_global): New method.
542 (Target_aarch64::do_plt_address_for_local): New method.
543 (Target_aarch64::do_select_as_default_target): New method.
544 (Target_aarch64::do_make_data_plt): New method.
545 (Target_aarch64::make_data_plt): New method.
546 (Output_data_plt_aarch64::has_irelative_section): New method.
547 (Output_data_plt_aarch64::address_for_global): New method.
548 (Output_data_plt_aarch64::address_for_local): New method.
549 (Output_data_plt_aarch64::irelative_rel_): New parameter.
550 (Output_data_plt_aarch64::add_entry): Implement contents.
551 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
552 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
553 the got_pov entry to plt0.
554 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
555 Implement contents.
556 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
557 (AArch64_howto): New struct.
558 (aarch64_howto[]): New static const array.
559 (AArch64_relocate_functions): New class.
560 (Target_aarch64::Scan::get_reference_flags): Remove method.
561 (Target_aarch64::Scan::local): Implement to support a few relocations.
562 (Target_aarch64::Scan::global): Implement to support a few relocations.
563 (Target_aarch64::make_plt_section): Implement contents.
564 (Target_aarch64::make_plt_entry): Implement contents.
565 (Target_aarch64::do_finalize_sections): Implement contents.
566 (Target_aarch64::Relocate::relocate): Implement a few relocations.
567 (Target_aarch64::relocate_section): Implement contents.
568
ad9fe6c1
AM
5692014-08-06 Alan Modra <amodra@gmail.com>
570
571 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
572
7cd4e5b7
AM
5732014-08-06 Alan Modra <amodra@gmail.com>
574
575 PR 13227
576 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
577
5ad9b0a7
ST
5782014-07-21 Sriraman Tallam <tmsriram@google.com>
579
580 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 581 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 582
e051745c
CC
5832014-07-08 Cary Coutant <ccoutant@google.com>
584
585 * expression.cc (struct Expression::Expression_eval_info): Add
586 new fields type_pointer, vis_pointer, and nonvis_pointer.
587 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
588 nonvis_pointer parameters. Adjust all calls.
589 (Symbol_expression::value): Update type, visibility, and nonvis bits
590 in caller.
591 * script.cc (Symbol_assignment::sized_finalize): Update type,
592 visibility, and remaining st_other bits for new symbol.
593 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
594 vis_pointer, and nonvis_pointer parameters.
595 * symtab.h (Symbol::set_type): New method.
596
597 * testsuite/Makefile.am (defsym_test): New test.
598 * testsuite/Makefile.in: Regenerate.
599 * testsuite/defsym_test.c: New file.
600 * testsuite/defsym_test.sh: New file.
601
f35c4853
CC
6022014-07-08 Cary Coutant <ccoutant@google.com>
603
604 PR gold/15639
605 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
606 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
607 (Sized_dynobj::base_read_symbols): ...new method.
608 * object.h (Sized_relobj_file::base_read_symbols): New method.
609 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
610 (Sized_relobj_file::base_read_symbols): ...new method.
611 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
612 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
613 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
614
2900af2d
AM
6152014-07-04 Alan Modra <amodra@gmail.com>
616
617 * po/POTFILES.in: Regenerate.
618
053a4d68
JY
6192014-07-02 Jing Yu <jingyu@google.com>
620
621 * aarch64.cc: New file
622 * Makefile.am (TARGETSOURCES): Add aarch64.cc
623 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
624 * Makefile.in: Regenerate.
625 * configure.tgt: Add entries for aarch64*.
626 * configure.ac: Likewise.
627 * configure: Likewise.
628
7b549045
AM
6292014-06-27 Alan Modra <amodra@gmail.com>
630
631 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
632
cb818dbf
CC
6332014-06-24 Cary Coutant <ccoutant@google.com>
634
635 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
636 sections.
637 (Dwo_file::sized_read_unit_index): Likewise.
638
9810d34d
SS
6392014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
640
641 * mips.cc: New file.
642 * Makefile.am (TARGETSOURCES): Add mips.cc
643 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
644 * configure.tgt: Add entries for mips*.
645 * configure.ac: Likewise.
646 * Makefile.in: Regenerate.
647 * configure: Likewise.
648
9baa787b
CC
6492014-06-09 Cary Coutant <ccoutant@google.com>
650
651 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
652 unit_length is within section bounds.
653
8f89af0a
CC
6542014-06-09 Cary Coutant <ccoutant@google.com>
655
656 PR gold/16980
657 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
658 map.
659
a47622ac
AM
6602014-06-07 Alan Modra <amodra@gmail.com>
661
662 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
663
4320c691
CC
6642014-06-06 Cary Coutant <ccoutant@google.com>
665
666 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
667 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
668 (Dwarf_pubnames_table::read_header): Likewise.
669 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
670 .debug_gnu_pubtypes.
671
270c9937
JB
6722014-06-05 Joel Brobecker <brobecker@adacore.com>
673
674 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
675 * Makefile.in, configure: Regenerate.
676
397998fc
AM
6772014-06-03 Alan Modra <amodra@gmail.com>
678
679 * powerpc.cc (addis_12_2): Define.
680 (Stub_table::do_write): Support fusion on ELFv2 stubs.
681
61f5c66f
AM
6822014-06-03 Alan Modra <amodra@gmail.com>
683
684 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
685 st_other output.
686
f6971787
AM
6872014-06-02 Alan Modra <amodra@gmail.com>
688
689 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
690 Only ignore relocs on ELFv1.
691 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
692
f6fb8322
CC
6932014-05-30 Cary Coutant <ccoutant@google.com>
694
695 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
696 * testsuite/Makefile.in: Regenerate.
697 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
698
c23dd342
L
6992014-05-27 H.J. Lu <hongjiu.lu@intel.com>
700
701 PR gold/16945
702 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
703 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
704
5fe7ffdc
AM
7052014-05-15 Alan Modra <amodra@gmail.com>
706
707 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
708 Compare FDE contents with DW_CFA_nop rather than 0.
709
a82bef93
ST
7102014-05-13 Sriraman Tallam <tmsriram@google.com>
711
712 * symtab.h (may_need_copy_reloc): Remove check for position independent
713 code.
714 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
715 position independence before pc absolute may_need_copy_reloc call.
716 Add check for executable output befor pc relative may_need_copy_reloc
717 call.
718 * i386.cc: Ditto.
719 * arm.cc: Ditto.
720 * sparc.cc: Ditto.
721 * tilegx.cc: Ditto.
722 * powerpc.cc: Add check for no position independence before
723 may_need_copy_reloc calls.
724 * testsuite/pie_copyrelocs_test.cc: New file.
725 * testsuite/pie_copyrelocs_shared_test.cc: New file.
726 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 727 * Makefile.in: Regenerate.
a82bef93 728
53c66605
ML
7292014-05-08 Martin Liška <mliska@suse.cz>
730
731 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
732
57b2284c
CC
7332014-05-06 Cary Coutant <ccoutant@google.com>
734
735 PR gold/16900
736 * i386.cc (Output_data_got_plt_i386): New class.
737 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
738 parameter. Change all callers.
739 (Output_data_plt_i386::layout_): Remove.
740 (Output_data_plt_i386::got_plt_): Change type.
741 (Target_i386::got_plt_): Change type. Change all references.
742 (Target_i386::got_section): Create instance of new class.
743 (Output_data_got_plt_i386::do_write): New function.
744 * x86_64.cc (Output_data_got_plt_x86_64): New class.
745 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
746 parameter. Change all callers.
747 (Output_data_plt_x86_64::layout_): Remove.
748 (Output_data_plt_x86_64::got_plt_): Change type.
749 (Target_x86_64::got_plt_): Change type. Change all references.
750 (Target_x86_64::got_section): Create instance of new class.
751 (Output_data_got_plt_x86_64::do_write): New function.
752 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
753 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
754 class.
755
6b97515d 7562014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 757
6b97515d
CC
758 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
759 if we have pubnames/pubtypes.
760
d1bddd3c
CC
7612014-05-02 Cary Coutant <ccoutant@google.com>
762
5fe7ffdc
AM
763 * defstd.cc (in_segment): Define __ehdr_start here...
764 * layout.cc (Layout::finalize): ...Instead of here. Set the
765 output segment when known.
766 * resolve.cc (Symbol::override_base_with_special): Remember
767 the original binding.
768 * symtab.cc (Symbol::set_output_segment): New function.
769 (Symbol::set_undefined): New function.
770 * symtab.h (Symbol::is_weak_undefined): Check original undef
771 binding.
772 (Symbol::is_strong_undefined): New function.
773 (Symbol::set_output_segment): New function.
774 (Symbol::set_undefined): New function.
775 * target-reloc.h (is_strong_undefined): Remove.
776 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
777 Check for hidden undefs.
778 (relocate_section): Call Symbol::is_strong_undefined.
779
780 * testsuite/Makefile.am (ehdr_start_test_1)
781 (ehdr_start_test_2, ehdr_start_test_3)
782 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
783 * testsuite/Makefile.in: Regenerate.
784 * testsuite/ehdr_start_def.cc: New source file.
785 * testsuite/ehdr_start_test.cc: New source file.
786 * testsuite/ehdr_start_test.t: New linker script.
787 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 788
7849f6d8
CC
7892014-04-23 Cary Coutant <ccoutant@google.com>
790
bf2cc635 791 PR gold/16870
7849f6d8
CC
792 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
793
99fd8cff
CC
7942014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
795
796 * layout.cc (Layout::include_section): Allow a target to decide
797 whether to include a section.
798 * target.h (Target::should_include_section): New function.
799 (Target::do_should_include_section): New function.
800
91f43acd
CC
8012014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
802
803 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
804 inline into ...
805 (Copy_relocs::emit): ... here.
806 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
807 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
808 (Copy_reloc_entry::entries_): Change from private to protected.
809
c4eb27e1
ST
8102014-04-02 Sriraman Tallam <tmsriram@google.com>
811
812 * icf.cc (get_section_contents): Replace copies of reloc
813 vectors with const references.
814
ae447ddd
CC
8152014-04-02 Cary Coutant <ccoutant@google.com>
816
817 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
818 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
819 * configure: Regenerate.
820 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
821 -fno-use-linker-plugin.
822 (LINK1, CXXLINK1): Add it to the link command.
823 * testsuite/Makefile.in: Regenerate.
824
fa47fa92
AM
8252014-03-12 Alan Modra <amodra@gmail.com>
826
827 * Makefile.in: Regenerate.
828
9b12c500
CC
8292014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
830
831 * symtab.h (Symbol::set_nonvis): New function.
832
beacaa96
CC
8332014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
834
835 * symtab.cc (Sized_symbol<32>::init_output_data):
836 Instantiate the template.
837 (Sized_symbol<64>::init_output_data): Likewise.
838
800d9823
CC
8392014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
840
841 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
842 adjust dynamic symbol value.
843 * target.h (Target::adjust_dyn_symbol): New function.
844 (Target::do_adjust_dyn_symbol): New function.
845
918fc1f8 8462014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 847
918fc1f8
CC
848 * output.cc (Output_data_dynamic::Dynamic_entry::write):
849 Get the value of DYNAMIC_CUSTOM dynamic entry.
850 * output.h (Output_data_dynamic::add_custom): New function.
851 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
852 dynamic entry.
853 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
854 * target.h (Target::dynamic_tag_custom_value): New function.
855 (Target::do_dynamic_tag_custom_value): New function.
856
98ff9231
CC
8572014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
858
859 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
860 dynsym indexes.
861 * target.h (Target::has_custom_set_dynsym_indexes): New function.
862 (Target::do_has_custom_set_dynsym_indexes): New function.
863 (Target::set_dynsym_indexes): New function.
864 (Target::do_set_dynsym_indexes): New function.
865
b80eed39
AM
8662014-03-07 Alan Modra <amodra@gmail.com>
867
868 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
869 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
870 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
871 (Powerpc_relocate_functions::has_overflow_bitfield,
872 overflowed): Use the above.
873 (Target_powerpc::Relocate::relocate): Correct overflow checking
874 for a number of relocations. Modify overflow test for 16-bit
875 fields in instructions to signed/unsigned according to whether
876 the field takes a signed or unsigned value.
877
4b95cf5c
AM
8782014-03-05 Alan Modra <amodra@gmail.com>
879
880 Update copyright years.
881
45965137
AM
8822014-03-05 Alan Modra <amodra@gmail.com>
883
884 * powerpc.cc (Target_powerpc::Scan::local, global): Support
885 R_PPC64_ADDR64_LOCAL.
886 (Target_powerpc::Relocate::relocate): Likewise.
887
2c80b753
AM
8882014-03-03 Alan Modra <amodra@gmail.com>
889
890 * dwp.cc (print_version): Update copyright year to current.
891
c1c69e83
AM
8922014-02-10 Alan Modra <amodra@gmail.com>
893
894 * po/gold.pot: Regenerate.
895
dd0c4e70
CC
8962014-02-06 Cary Coutant <ccoutant@google.com>
897
898 Fix problem where -u is ignored when a weak undef is seen.
899
900 * archive.cc (Library_base::should_include_member): Reorder
901 code to check for -u option if a weak undef has already been seen.
902 * testsuite/Makefile.am (weak_undef_test_2): New test case.
903 * testsuite/Makefile.in: Regenerate.
904 * testsuite/weak_undef_file3.cc: New file.
905 * testsuite/weak_undef_file4.cc: New file.
906 * testsuite/weak_undef_test_2.cc: New file.
907
1a221d3d
CC
9082014-02-05 Cary Coutant <ccoutant@google.com>
909
910 Fix issues with gold undefined symbol diagnostics.
911
912 PR binutils/15435
913 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
914 check to here.
915 * target-reloc.h (is_strong_undefined): New function.
916 (relocate_section): Move undef vtable symbol check from here.
917 Check for is_strong_undefined.
918
e889f0a4 9192014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 920
e889f0a4
CC
921 Fix problems with the --dynamic-list option.
922
923 PR gold/13577
924 * options.cc (General_options::parse_dynamic_list):
925 Set have_dynamic_list_.
926 (General_options::General_options): Initialize have_dynamic_list_.
927 (General_options::finalize): Turn off -Bsymbolic and
928 -Bsymbolic-functions if --dynamic-list provided.
929 * options.h (General_options::have_dynamic_list): New function.
930 (General_options::have_dynamic_list_): New data member.
931 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
932 correctly.
5fe7ffdc 933
e889f0a4
CC
934 PR gold/16530
935 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
936 in --dynamic-list, mark it.
5fe7ffdc 937
e889f0a4
CC
938 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
939 (dynamic_list_2): New test case.
940 * testsuite/Makefile.in: Regenerate.
941 * testsuite/dynamic_list_2.cc: New file.
942 * testsuite/dynamic_list_2.t: New file.
943 * testsuite/dynamic_list_lib1.cc: New file.
944 * testsuite/dynamic_list_lib2.cc: New file.
945 * testsuite/gc_dynamic_list_test.c: New file.
946 * testsuite/gc_dynamic_list_test.sh: New file.
947 * testsuite/gc_dynamic_list_test.t: New file.
948
ec673e64
CC
9492014-01-28 Cary Coutant <ccoutant@google.com>
950
951 Add .gdb_index version 7 support.
952
953 * gold/dwarf_reader.cc: include <utility> (for make_pair).
954 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
955 debug sections.
956 (Dwarf_ranges_table::read_ranges_table): Likewise.
957 (Dwarf_pubnames_table::read_section): Check for GNU-style
958 sections, and for compressed debug sections.
959 (Dwarf_pubnames_table::read_header): Compute end address of table.
960 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
961 for end of list by offset, not by offset == 0.
962 (Dwarf_info_reader::do_read_string_table): Check for compressed
963 debug sections.
964 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
965 Initialize new data members.
966 (Dwarf_pubnames_table::next_name): return flag_byte.
967 (Dwarf_pubnames_table::end_of_table_): New data member.
968 (Dwarf_pubnames_table::is_gnu_style_): New data member.
969 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
970 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
971 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
972 read skeleton type unit DIEs.
973 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
974 (Gdb_index::do_write): Write flag_byte.
975 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
976 (Gdb_index::Cu_vector): Store flags along with cu indexes.
977 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
978 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
979
221fd5d5
L
9802014-01-08 H.J. Lu <hongjiu.lu@intel.com>
981
982 * version.cc (print_version): Update copyright year to 2014.
983
6c09fb0b
ILT
9842013-12-19 Dimitry Andric <dimitry@andric.com>
985
986 * stringpool.cc (Stringpool_template::reserve): Add
987 HAVE_UNORDERED_MAP case.
988 * stringpool.cc (Stringpool_template::print_stats): Likewise.
989
8356f2d0
CC
9902013-12-18 Cary Coutant <ccoutant@google.com>
991
992 * configure.ac: Check for <unordered_set> and <unordered_map>.
993 * config.in: Regenerate.
994 * configure: Regenerate.
995 * system.h: Use <unordered_set> and <unordered_map> if available.
996
f2c7d7ee
RM
9972013-12-10 Roland McGrath <mcgrathr@google.com>
998
999 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1000 with $(INSTALL_PROGRAM_ENV).
1001 * Makefile.in: Regenerate.
1002
6632e8cc
CC
10032013-11-22 Cary Coutant <ccoutant@google.com>
1004
1005 * configure.ac: Add check for which library is needed for
1006 dlopen.
1007 * configure: Regenerate.
1008
0c075858
CC
10092013-11-22 Cary Coutant <ccoutant@google.com>
1010
1011 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1012 assembler.
1013 * testsuite/Makefile.in: Regenerate.
1014
f49fe902
L
10152013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1016
1017 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1018 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1019 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1020 (Target_x86_64<size>::Scan::local): Likewise.
1021 (Target_x86_64<size>::Scan::global): Likewise.
1022 (Target_x86_64<size>::Relocate::relocate): Likewise.
1023 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1024 Likewise.
1025 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1026 R_X86_64_PC32_BND.
1027
1028 * testsuite/Makefile.am (check_PROGRAMS): Add
1029 exception_x86_64_bnd_test.
1030 (exception_x86_64_bnd_test_SOURCES): New macro.
1031 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1032 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1033 (exception_x86_64_bnd_test_LDADD): Likewise.
1034 (exception_x86_64_bnd_1.o): New rule.
1035 (exception_x86_64_bnd_2.o): Likewise.
1036 * testsuite/Makefile.in: Regenerated.
1037
9055360d
AM
10382013-11-15 Alan Modra <amodra@gmail.com>
1039
1040 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1041 accessor.
1042 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1043 Only call ppc64_local_entry_offset for 64-bit. Restrict
1044 symval_for_branch lookup to ELFv1.
1045 (Stub_table::add_plt_call_entry): Use unsigned int off.
1046 (Output_data_glink::Address, invalid_address): New.
1047 (Output_data_glink::add_eh_frame): Move out of line. Add
1048 support for ELFv2.
1049 (Output_data_glink::add_global_entry, find_global_entry,
1050 global_entry_address): New functions.
1051 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1052 ge_size): New variables.
1053 (Output_data_glink::set_final_data_size): Add global entry
1054 stub sizing.
1055 (Output_data_glink::do_write): Write global entry stubs.
1056 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1057 parameter. Return true for ELFv2. Adjust callers.
1058 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1059 ELFv1. Similarly for ifunc and dynamic relocation processing
1060 specific to ELFv1. Recognize that symbols are defined on
1061 their plt entries for ELFv2.
1062 (Target_powerpc::symval_for_branch): Assert if called for
1063 ELFv2 or ppc32.
1064 (Target_powerpc::Relocate::relocate): Use global entry plt
1065 stub for symbol value if such exists on ELFv2.
1066 (Target_powerpc::Relocate::relocate): Don't call
1067 symval_for_branch when ELFv2. Do adjust for local entry
1068 offset when ELFv2.
1069 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1070 plt stub for ELFv2.
1071 (Target_powerpc::do_plt_address_for_global): Similarly.
1072
cafdd569
CC
10732013-11-14 Cary Coutant <ccoutant@google.com>
1074
1075 Revert patch -- this did not fix the problem, and there is
1076 no race there.
1077
1078 2013-11-14 Cary Coutant <ccoutant@google.com>
1079
1080 PR gold/14860
1081 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1082 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1083 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1084 updating fde_offsets_.
1085 (Eh_frame_hdr::lock_): New data member.
1086
94e49e16
CC
10872013-11-14 Cary Coutant <ccoutant@google.com>
1088
1089 * dwp.cc (Dwo_file_entry): New type.
1090 (File_list): Use Dwo_file_entry.
1091 (Dwo_file::verify): New function.
1092 (Dwo_file::verify_dwo_list): New function.
1093 (Dwo_file::sized_verify_dwo_list): New function.
1094 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1095 list.
1096 (Dwp_options): New enum type.
1097 (dwp_options): Add --verify-only.
1098 (usage): Likewise.
1099 (main): Likewise.
1100 * dwp.h (gold_info): Add declaration.
1101
7cdd7d57
CC
11022013-11-14 Cary Coutant <ccoutant@google.com>
1103
1104 PR gold/14860
1105 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1106 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1107 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1108 updating fde_offsets_.
1109 (Eh_frame_hdr::lock_): New data member.
1110
1d946cb3
CC
11112013-11-06 Cary Coutant <ccoutant@google.com>
1112
1113 PR gold/15758
1114 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1115 before reloc sections.
1116
4f65b40e
AM
11172013-11-04 Alan Modra <amodra@gmail.com>
1118
1119 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1120 (Symbol::needs_dynamic_reloc): Test new flag.
1121 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1122 (Target_powerpc::Scan::get_reference_flags): Add target param.
1123 Return FUNC_DESC_ABI for 64-bit ELFv1.
1124 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1125 call.
1126 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1127 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1128
908794a9
CC
11292013-10-31 Cary Coutant <ccoutant@google.com>
1130
1131 Restore support for dwp v2 DWARF package file format.
1132
1133 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1134 tu_length parameter. Adjust all callers.
1135 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1136 * dwp.cc: Include dwarf.h.
1137 (Section_bounds): New struct type.
1138 (Unit_set): New struct type.
1139 (Dwo_file::Dwo_file): Initialize new data member.
1140 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1141 Combine and rename to...
1142 (Dwo_file::read_unit_index): ...this.
1143 (Dwo_file::sized_read_compunit_index)
1144 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1145 (Dwo_file::sized_read_unit_index): ...this.
1146 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1147 parameters; add section_id parameter.
1148 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1149 (Dwo_file::add_unit_set): ...this.
1150 (Dwo_file::shndx_map_): Remove.
1151 (Dwo_file::sect_offsets_): New data member.
1152 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1153 (Dwp_output_file::add_section): Rename to...
1154 (Dwp_output_file::add_contribution): ...this.
1155 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1156 (Dwp_output_file::add_tu_set): Likewise.
1157 (Dwp_output_file::Contribution): New type.
1158 (Dwp_output_file::Section::contributions): New data member.
1159 (Dwp_output_file::Cu_or_tu_set): Remove.
1160 (Dwp_output_file::Section::Section): New ctor.
1161 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1162 (Dwp_output_file::Dwp_index::Section_table): New type.
1163 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1164 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1165 parameter.
1166 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1167 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1168 (Dwp_output_file::Dwp_index::section_table): New member function.
1169 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1170 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1171 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1172 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1173 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1174 (Dwp_output_file::Dwp_index::section_table_): New data member.
1175 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1176 (Dwp_output_file::add_output_section): New member function.
1177 (Dwp_output_file::write_new_section): New member function.
1178 (Dwp_output_file::write_contributions): New member function.
1179 (Dwp_output_file::section_id_map_): New data member.
1180 (class Dwo_id_info_reader): Remove.
1181 (class Unit_reader): New class.
1182 (get_dwarf_section_name): New function.
1183 (Dwo_file::read_executable): Adjust initializations of class data.
1184 (Dwo_file::read): Add support for v2 package file format.
1185 (Dwo_file::read_unit_index): Likewise.
1186 (Dwo_file::sized_read_unit_index): Likewise.
1187 (Dwo_file::copy_section): Likewise.
1188 (Dwo_file::add_unit_set): Likewise.
1189 (Dwp_output_file::add_output_section): Likewise.
1190 (Dwp_output_file::add_contribution): Likewise.
1191 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1192 for empty slot.
1193 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1194 file format.
1195 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1196 slot.
1197 (Dwp_output_file::initialize): Remove unused function.
1198 (Dwp_output_file::finalize): Add support for v2 package file format.
1199 (Dwp_output_file::write_index): Likewise.
1200 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1201 function prototype.
1202
2500c017
CC
12032013-10-31 Cary Coutant <ccoutant@google.com>
1204
1205 * configure.ac: Fix check for -fmerge-constants.
1206 * configure.ac: Regenerate.
1207
dd0845d7
RM
12082013-10-30 Roland McGrath <mcgrathr@google.com>
1209
1210 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1211 Correct 9-byte nop sequence to match what the assembler generates.
1212
b4f7960d
AM
12132013-10-30 Alan Modra <amodra@gmail.com>
1214
1215 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1216 ppc64_local_entry_offset, ppc64_local_entry_offset,
1217 do_read_symbols): New functions.
1218 (Powerpc_relobj::e_flags_, st_other_): New vars.
1219 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1220 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1221 (Powerpc_relobj::e_flags_): New var.
1222 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1223 and adjust for ELFv2.
1224 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1225 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1226 (Powerpc_dynobj::do_find_special_sections): Likewise.
1227 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1228 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1229 to ELFv2 local entry.
1230 (Target_powerpc::do_relax): No thread safe barriers needed for
1231 ELFv2.
1232 (Output_data_plt_powerpc::initial_plt_entry_size_,
1233 plt_entry_size): Delete. Replace all uses with
1234 first_plt_entry_offset() and plt_entry_size().
1235 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1236 reserved_size parm. Update callers.
1237 (Output_data_plt_powerpc::entry_count): Update.
1238 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1239 and use Target_powerpc::first_plt_entry_offset().
1240 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1241 rename to plt_entry_size.
1242 (Output_data_plt_powerpc::add_ifunc_entry,
1243 add_local_ifunc_entry): Adjust reloc for ELFv2.
1244 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1245 (glink_eh_frame_fde_64v2): New.
1246 (Stub_table::plt_call_size): Support ELFv2 sizing.
1247 (Output_data_glink::add_eh_frame): Use the new FDE.
1248 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1249 (Stub_table::do_write): Write ELFv2 stubs and glink.
1250 (Target_powerpc::Relocate::relocate): Replaces nop after call
1251 with ld 2,24(1) and adjust local offset destination for ELFv2.
1252
f9c6b907
AM
12532013-10-30 Alan Modra <amodra@gmail.com>
1254
1255 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1256 (Target_powerpc::Scan::global, local): Likewise.
1257 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1258 on all ppc64 @h and @ha relocs.
1259
e84fe78f
AM
12602013-10-14 Alan Modra <amodra@gmail.com>
1261
1262 * output.h (Output_data_got::add_constant): Tidy.
1263 (Output_data_got::add_constant_pair): New function.
1264 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1265 methods used so as to first call reserve_ent().
1266
679e4abf
RM
12672013-10-11 Roland McGrath <mcgrathr@google.com>
1268
44dcb735
RM
1269 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1270 add_got_entry and add_got_entry_pair.
1271
13323c49
RM
1272 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1273 (HAVE_PUBNAMES): Likewise.
1274 * configure: Regenerate.
1275
1496b446
RM
1276 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1277 * testsuite/Makefile.in: Regenerate.
1278
cc84c10b
RM
1279 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1280 Remove const from declaration.
1281 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1282 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1283 * output.h (Output_file_header): Remove const from member target_
1284 and corresponding constructor argument.
1285 * output.cc (Output_file_header::Output_file_header): Update prototype.
1286 (Output_file_header::do_sized_write): Use this->target_ in place
1287 of parameters()->target().
1288
52f66a2c
RM
1289 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1290
2b64b551
RM
1291 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1292 * configure: Regenerate.
1293 * Makefile.in: Regenerate.
1294 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1295 * testsuite/merge_string_literals_2.c: Likewise.
1296 * testsuite/Makefile.am
1297 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1298 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1299 literal -fmerge-constants.
1300 * testsuite/Makefile.in: Regenerate.
1301
43819297
RM
1302 * i386.cc (Target_i386): Remove unused member dynbss_.
1303 * arm.cc (Target_arm): Likewise.
1304 * powerpc.cc (Target_powerpc): Likewise.
1305 * sparc.cc (Target_sparc): Likewise.
1306 * tilegx.cc (Target_tilegx): Likewise.
1307 * x86_64.cc (Target_x86_64): Likewise.
1308 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1309 type_signature_, type_offset_.
1310 * plugin.h (Plugin_hook): Remove unused member layout_.
1311 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1312 mapfile_.
1313 (Read_member): Remove unused members input_objects_, symtab_,
1314 mapfile_, layout_.
1315 (Check_library): Remove unused member symtab_.
1316 * archive.h (Lib_group): Remove unused member lib_.
1317 * archive.cc (Lib_group::Lib_group): Update initializer.
1318 * incremental.h (Incremental_binary): Remove unused member target_.
1319 (Incremental_script_entry): Removed unused member script_.
1320 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1321 * icf.h (Icf): Remove unused member num_tracked_relocs.
1322
39d9ead7
RM
1323 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1324 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1325 its only use.
1326 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1327
679e4abf
RM
1328 * archive.h: Use struct rather than class for forward declaration
1329 of Read_symbols_data.
1330
54de2ea6
CC
13312013-10-07 Cary Coutant <ccoutant@google.com>
1332
1333 PR gold/16010
1334 * testsuite/Makefile.am (icf_test): Fix dependencies.
1335 (icf_safe_test): Likewise.
1336 (icf_safe_so_test): Likewise.
1337 (large_symbol_alignment): Add empty _LDADD rule.
1338 * testsuite/Makefile.in: Regenerate.
1339
b14016f0
L
13402013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1341
1342 PR gold/15927
1343 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1344 relocation for R_X86_64_32 on x32.
1345
eb426534
RM
13462013-08-27 Roland McGrath <mcgrathr@google.com>
1347
1348 * output.cc (Output_segment::set_section_addresses): Take new
1349 Target* argument. If target->isolate_execinstr() and the segment
1350 is executable and starts at a target->abi_pagesize() boundary,
1351 pad its end out to a target->abi_pagesize() boundary with code fill.
1352 * output.h (Output_segment::set_section_addresses): Update decl.
1353 * layout.h (Layout::check_output_data_for_reset_values): Take new
1354 argument RELAX_OUTPUTS.
1355 (Layout): New member relax_output_list_.
1356 (Layout::add_relax_output): New method.
1357 * layout.cc (Layout::Layout): Update constructor.
1358 (Layout::reset_relax_output): New method.
1359 (Layout::clean_up_after_relaxation): Call it.
1360 (Layout::prepare_for_relaxation): Update caller.
1361 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1362 Call reset_relax_output before re-processing segments for
1363 isolate_execinstr case.
1364 (Layout::write_data): Handle relax_output_list_.
1365 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1366 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1367
9aff4b7a
NC
13682013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1369
1370 PR binutils/15834
1371 * object.h: Fix typos.
1372
93f8221c
RM
13732013-08-16 Roland McGrath <mcgrathr@google.com>
1374
1375 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1376 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1377
e44c3715
CC
13782013-08-07 Cary Coutant <ccoutant@google.com>
1379
1380 Revert support for v2 DWP files:
1381
1382 2013-03-01 Cary Coutant <ccoutant@google.com>
1383
1384 Add dwp support for v2 DWARF package file format.
1385 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1386 tu_length parameter. Adjust all callers.
1387 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1388 * dwp.cc: Include dwarf.h.
1389 (Section_bounds): New struct type.
1390 (Unit_set): New struct type.
1391 (Dwo_file::Dwo_file): Initialize new data member.
1392 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1393 Combine and rename to...
1394 (Dwo_file::read_unit_index): ...this.
1395 (Dwo_file::sized_read_compunit_index)
1396 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1397 (Dwo_file::sized_read_unit_index): ...this.
1398 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1399 parameters; add section_id parameter.
1400 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1401 (Dwo_file::add_unit_set): ...this.
1402 (Dwo_file::shndx_map_): Remove.
1403 (Dwo_file::sect_offsets_): New data member.
1404 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1405 (Dwp_output_file::add_section): Rename to...
1406 (Dwp_output_file::add_contribution): ...this.
1407 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1408 (Dwp_output_file::add_tu_set): Likewise.
1409 (Dwp_output_file::Contribution): New type.
1410 (Dwp_output_file::Section::contributions): New data member.
1411 (Dwp_output_file::Cu_or_tu_set): Remove.
1412 (Dwp_output_file::Section::Section): New ctor.
1413 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1414 (Dwp_output_file::Dwp_index::Section_table): New type.
1415 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1416 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1417 parameter.
1418 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1419 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1420 (Dwp_output_file::Dwp_index::section_table): New member function.
1421 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1422 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1423 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1424 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1425 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1426 (Dwp_output_file::Dwp_index::section_table_): New data member.
1427 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1428 (Dwp_output_file::add_output_section): New member function.
1429 (Dwp_output_file::write_new_section): New member function.
1430 (Dwp_output_file::write_contributions): New member function.
1431 (Dwp_output_file::section_id_map_): New data member.
1432 (class Dwo_id_info_reader): Remove.
1433 (class Unit_reader): New class.
1434 (get_dwarf_section_name): New function.
1435 (Dwo_file::read_executable): Adjust initializations of class data.
1436 (Dwo_file::read): Add support for v2 package file format.
1437 (Dwo_file::read_unit_index): Likewise.
1438 (Dwo_file::sized_read_unit_index): Likewise.
1439 (Dwo_file::copy_section): Likewise.
1440 (Dwo_file::add_unit_set): Likewise.
1441 (Dwp_output_file::add_output_section): Likewise.
1442 (Dwp_output_file::add_contribution): Likewise.
1443 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1444 for empty slot.
1445 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1446 file format.
1447 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1448 slot.
1449 (Dwp_output_file::initialize): Remove unused function.
1450 (Dwp_output_file::finalize): Add support for v2 package file format.
1451 (Dwp_output_file::write_index): Likewise.
1452 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1453 function prototype.
1454
c6905c28
CC
14552013-07-31 Cary Coutant <ccoutant@google.com>
1456
1457 * object.cc (Sized_relobj::do_output_section_address): New function.
1458 (Sized_relobj): Instantiate explicitly.
1459 * object.h (Object::output_section_address): New function.
1460 (Object::do_output_section_address): New function.
1461 (Sized_relobj::do_output_section_address): New function.
1462 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1463
14642013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1465 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1466
1467 * parameters.cc (Parameters::entry): Return target-specific entry
1468 symbol name.
1469 * target.h (Target::entry_symbol_name): New function.
1470 (Target_info::entry_symbol_name): New data member.
1471
1472 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1473 * i386.cc (Target_i386::i386_info): Likewise.
1474 (Target_i386_nacl::i386_nacl_info): Likewise.
1475 * sparc.cc (Target_sparc::sparc_info): Likewise.
1476 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1477 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1478 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1479 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1480
234d4ab8
SA
14812013-07-22 Sterling Augustine <saugustine@google.com>
1482
1483 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1484 Convert parameter shndx to local variable. Add parameters symtab
1485 and symtab_size. Scan over section names. Find relocation
1486 section corresponding to current section. Create and initialize
1487 reloc_mapper_ and reloc_type_.
1488 (Dwarf_pubnames_table::read_header): Add assertion. Change
1489 unit_length to off_t. Initialize member unit_length_. Fill in field
1490 cu_offset_.
1491 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1492 Initialize new fields unit_length_ and cu_offset_.
1493 (Dwarf_pubnames_table::read_section): Update prototype.
1494 (Dwarf_pubnames_table::cu_offset): New member function.
1495 (Dwarf_pubnames_table::subsection_size): Likewise.
1496 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1497 New fields.
1498 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1499 member functions public.
1500 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1501 Update comment. Rework logic. Move repeated parts to...
1502 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1503 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1504 pubtypes_table_, and stmt_list_offset.
1505 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1506 Gdb_index::find_pubtype_offset,
1507 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1508 (Gdb_index::pubnames_read): Update prototype and rework logic.
1509 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1510 Forward declare.
1511 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1512 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1513 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1514 Gdb_index::map_pubtable_to_dies):
1515 Declare functions.
1516 (Gdb_index::pubnames_read): Update declaration.
1517 (Gdb_index::Pubname_offset_map): New type.
1518 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1519 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1520 Gdb_index::stmt_list_offset): Declare.
1521 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1522 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1523 Gdb_index::pubtypes_offset_): Remove.
1524
a3ed37d8
RM
15252013-07-19 Roland McGrath <mcgrathr@google.com>
1526
1527 * options.h (General_options): Add -Trodata-segment option.
1528 * parameters.cc (Parameters::check_rodata_segment): New function.
1529 (Parameters::set_target_once): Call it.
1530 * parameters.h (Parameters): Declare it (private member function).
1531 * layout.cc (load_seg_unusable_for_headers): New function, broken
1532 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1533 then validate rodata segment rather than text segment.
1534 (relaxation_loop_body): Call that.
1535 (is_text_segment): New function. Don't admit a non-executable
1536 segment if TARGET->isolate_execinstr().
1537 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1538
eb5b4ded
CC
15392013-07-15 Shawn Landden <shawnlandden@gmail.com>
1540
1541 PR gold/15070
1542 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1543 * nacl.h (Sniff_file::View::View): Request aligned view.
1544
4d5effb9
CC
15452013-07-11 Cary Coutant <ccoutant@google.com>
1546
1547 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1548 correct BRLT entry size.
1549
ba8ca3e7
AM
15502013-07-03 Alan Modra <amodra@gmail.com>
1551
1552 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1553 comment.
1554
267257d2
CC
15552013-07-01 Cary Coutant <ccoutant@google.com>
1556
1557 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1558 reloc_type_.
1559 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1560 (Dwarf_ranges_table::lookup_reloc): New function.
1561 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1562 reloc_type_.
1563 (Dwarf_ranges_table::lookup_reloc): New function.
1564 (Dwarf_ranges_table::reloc_type_): New data member.
1565
06f30c9d
CC
15662013-06-27 Jing Yu <jingyu@google.com>
1567
1568 PR gold/15662
1569 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1570 function.
1571 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1572 (Target_powerpc::do_relax): Call the above.
1573
a2d7bf59
AM
15742013-06-27 Cary Coutant <ccoutant@google.com>
1575
1576 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1577 on garbage collected .opd section.
1578
15792013-06-27 Alan Modra <amodra@gmail.com>
1580
1581 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1582 is non-zero.
1583 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1584 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1585
32364e50
CC
15862013-06-14 Cary Coutant <ccoutant@google.com>
1587
1588 * resolve.cc (Symbol::override_base): Don't override st_type
1589 from plugin placeholder symbols.
1590 (Symbol_table::resolve): Likewise.
1591 (Symbol_table::should_override): Don't complain about TLS mismatch
1592 if the TO symbol is a plugin placeholder.
1593 * testsuite/Makefile.am (plugin_test_tls): New test.
1594 * testsuite/Makefile.in: Regenerate.
1595 * testsuite/plugin_test_tls.sh: New test script.
1596 * testsuite/two_file_test_2_tls.cc: New test source.
1597 * testsuite/two_file_test_tls.cc: New test source.
1598
7fb47cc9
CC
15992013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1600
1601 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1602 the maximum segment alignment is larger than the page size.
1603 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1604 correctly aligns the symbols with large alignemnt.
1605 * testsuite/Makefile.in: Regenerate.
1606 * testsuite/large_symbol_alignment.cc: New file.
1607
6934001a
CC
16082013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1609 Sriraman Tallam <tmsriram@google.com>
1610
1611 * options.h (sort_section): New option.
1612 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1613 Rename from Input_section_sort_section_name_special_ordering_compare.
1614 (Input_section_sort_section_name_compare): New struct.
1615 * output.cc (Output_section::Input_section_sort_section_name_compare::
1616 operator()): New function.
1617 (Output_section::sort_attached_input_sections): Use new sort function
1618 for .text if --sort-section=name is specified.
1619 * layout.cc (Layout::make_output_section):
1620 Add sorting by name when --sort-section=name is specified.
1621 * testsuite/Makefile.am (text_section_grouping): Test option
1622 --sort-section=name.
1623 * testsuite/Makefile.in: Regenerate.
1624 * testsuite/section_sorting_name.cc: New file.
1625 * testsuite/section_sorting_name.sh: New file.
1626
93acabad
CC
16272013-05-21 Cary Coutant <ccoutant@google.com>
1628
1629 * symtab.h (Symbol::is_cxx_vtable): New function.
1630 * target-reloc.h (relocate_section): Check for vtable symbol.
1631 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1632 * testsuite/Makefile.in: Regenerate.
1633 * testsuite/missing_key_func.cc: New test source.
1634 * testsuite/missing_key_func.sh: New test script.
1635
60e8b3fc
CC
16362013-05-21 Cary Coutant <ccoutant@google.com>
1637
2b64b551
RM
1638 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1639 type of enclosing symbol.
1640 (Relocate_info::location): Check symbol type when describing symbol.
1641 * object.h (Symbol_location_info): Remove unused line_number;
1642 add enclosing_symbol_type.
1643 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1644
9df9de2c
CC
16452013-05-13 Cary Coutant <ccoutant@google.com>
1646
2b64b551
RM
1647 * configure.ac: Export DEFAULT_TARGET.
1648 * configure: Regenerate.
1649 * Makefile.in: Regenerate.
1650 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1651 * testsuite/Makefile.in: Regenerate.
1652 * testsuite/debug_msg.sh: Delete duplicate tests.
1653 Don't check undef_int error message match for powerpc where the
1654 source file and line number aren't available.
9df9de2c 1655
bbc5ae17
RM
16562013-05-10 Roland McGrath <mcgrathr@google.com>
1657
1658 * options.h (General_options): Add --rosegment-gap option.
1659 * options.cc (finalize): --rosegment-gap implies --rosegment.
1660 * layout.cc (set_segment_offsets): Let user option override
1661 target->rosegment_gap().
1662
0c6e6c39
RM
16632013-05-10 Roland McGrath <mcgrathr@google.com>
1664
1665 * options.h (General_options): Remove leading space from help
1666 messages for -nostdlib and --rosegment.
1667
cde7cb01
MR
16682013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1669
1670 PR ld/15365
1671 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1672
f31ae5b8
AM
16732013-05-03 Alan Modra <amodra@gmail.com>
1674
1675 * merge.cc (Output_merge_string::do_add_input_section): Correct
1676 scan for number of strings. Rename vars to avoid shadowing.
1677 Include missing terminator in input_size_.
1678
d3a7cd45
L
16792013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1680
1681 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1682 Restore empty string handling.
1683
6ad3daba
CC
16842013-05-01 Cary Coutant <ccoutant@google.com>
1685
1686 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1687 uninitialized warning.
1688
e31908b6
CC
16892013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1690
1691 * output.cc (Output_section::add_merge_input_section): Allow
1692 to merge sections if the alignment is more than character size.
1693 * merge.h (Output_merge_string::Output_merge_string): Remove
1694 assert.
1695 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1696 only not-null strings. Check the alignment of strings.
1697 * stringpool.h
1698 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1699 alignment as the argument.
1700 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1701 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1702 Align non-zero length strings according to the addralign_.
1703 (Stringpool_template<Stringpool_char>::set_string_offsets):
1704 Updating offsets according to the given alignment.
1705 * testsuite/Makefile.am (text_section_grouping): Test if string
1706 literals are getting merged.
1707 * testsuite/Makefile.in: Regenerate.
1708 * testsuite/merge_string_literals_1.c: New file.
1709 * testsuite/merge_string_literals_2.c: Ditto.
1710 * testsuite/merge_string_literals.sh: Ditto.
1711
0e804863
ILT
17122013-04-26 Ian Lance Taylor <iant@google.com>
1713
1714 * target-reloc.h (relocate_section): If the reloc offset is out of
1715 range, pass VIEW as NULL to relocate.relocate.
1716 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1717 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1718 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1719 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1720 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1721 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1722
e7c5ea40
CC
17232013-04-26 Geoff Pike <gpike@chromium.org>
1724
1725 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1726 * layout.cc (Hash_task): New class.
1727 (Layout::queue_build_id_tasks): New function.
1728 (Layout::write_build_id): Handle single-thread portion of build ID
1729 computation. (In some cases, all of it is single-threaded.) Replace
1730 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1731 functionality in fewer lines of code.
1732 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1733 * options.h (General_options): make "--build-id" default to tree
1734 rather than sha1. Add two new options related to --build-id=tree:
1735 --build-id-chunk-size-for-treehash and
1736 --build-id-min-file-size-for-treehash.
1737 * Makefile.am: add testing of --build-id=tree and related new options
1738 (these tests will be invoked by "make check").
1739 * Makefile.in: Regenerate.
1740
49926cd0
AM
17412013-04-25 Alan Modra <amodra@gmail.com>
1742
1743 * configure.tgt: Add powerpcle and powerpc64le.
1744
a4034750
AM
17452013-04-22 Alan Modra <amodra@gmail.com>
1746
1747 PR gold/15355
1748 * layout.cc (Layout::segment_precedes): Allow more than one
1749 segment with the same type and flags.
1750
e79c84aa
CC
17512013-04-15 Cary Coutant <ccoutant@google.com>
1752
1753 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1754 allocate space in file for BSS sections.
1755
2199fbe7
CC
17562013-04-15 Cary Coutant <ccoutant@google.com>
1757
1758 * script-sections.cc (Orphan_output_section): Reset address
1759 to zero after each orphaned section for relocatable links.
1760
502e8a84
CC
17612013-04-15 Cary Coutant <ccoutant@google.com>
1762
a4034750
AM
1763 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1764 section starting address for relocatable link.
1765 * testsuite/Makefile.am (script_test_11): New test.
1766 * testsuite/Makefile.in: Regenerate.
1767 * testsuite/script_test_11.c: New source file.
1768 * testsuite/script_test_11.t: New linker script.
502e8a84 1769
0cfdc767
AM
17702013-04-13 Alan Modra <amodra@gmail.com>
1771
1772 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1773 owner when sections are not adjacent and exceed group size.
1774 (Target_powerpc::group_sections): Handle corner case.
1775 (Target_powerpc::Branch_info::make_stub): Handle case where
1776 stub table doesn't exist due to branches in non-exec sections.
1777 (Target_powerpc::Relocate::relocate): Likewise.
1778
6830ee24
AM
17792013-04-11 Alan Modra <amodra@gmail.com>
1780
1781 PR gold/15354
1782 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1783 .branch_lt to match bfd ld. Adjust comments throughout file.
1784
54a3d865
ILT
17852013-04-04 Ian Lance Taylor <iant@google.com>
1786
1787 GCC PR c++/56840
1788 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1789 sections before checking whether they are included in the link.
1790
9993ba11
ST
17912013-03-29 Sriraman Tallam <tmsriram@google.com>
1792
1793 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1794 object before calling the plugin claim_file handler. Pass the elf
1795 object of the archive to the plugin. Delete the elf object if the
1796 plugin claims the file.
1797
ebacd51e
AM
17982013-03-21 Alan Modra <amodra@gmail.com>
1799
1800 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1801 segment when omagic.
1802
117be58f
AM
18032013-03-21 Alan Modra <amodra@gmail.com>
1804
1805 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1806 comparison warning.
1807 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1808 uninitialized" warning.
1809
32e2b61d
AM
18102013-03-20 Alan Modra <amodra@gmail.com>
1811
1812 * symtab.h (Symbol::clear_version): New function.
1813 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1814 is_needed by weak references. Clear version for symbols defined
1815 in as-needed objects that are not needed.
1816
b3ccdeb5
AM
18172013-03-15 Alan Modra <amodra@gmail.com>
1818
1819 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1820 static and public. Add report_err param. Return false for data refs.
1821 (Target_powerpc::rela_dyn_section): New overloaded function.
1822 (Target_powerpc::plt_, iplt_): Elucidate.
1823 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1824 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1825 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1826 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1827 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1828 push_branch and make_plt_entry for ifunc syms when
1829 reloc_needs_plt_for_ifunc.
1830 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1831 for ifunc unless reloc_needs_plt_for_ifunc.
1832
ad3d8a2f
AM
18332013-03-15 Alan Modra <amodra@gmail.com>
1834
1835 * gc.h (gc_process_relocs): Don't look through function descriptors.
1836 * icf.cc (get_section_contents): Do so here instead.
1837
4d9aa155
AM
18382013-03-13 Alan Modra <amodra@gmail.com>
1839
1840 * powerpc.cc (is_branch_reloc): Forward declare.
1841 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1842 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1843 false for 64-bit, true for 32-bit non-branch relocs.
1844 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1845 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1846 nm output.
1847 (icf_safe_test): Generate linker map file as well as nm output.
1848 (icf_safe_so_test): Likewise.
1849 * testsuite/Makefile.in: Regenerate.
1850 * testsuite/icf_test.sh: Parse linker map file to determine
1851 section folding.
1852 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1853 * testsuite/icf_safe_so_test.sh: Likewise.
1854 (X86_32_or_ARM_specific_safe_fold): Merge into..
1855 (arch_specific_safe_fold): ..this.
1856 (X86_64_specific_safe_fold): Delete unused function.
1857
57420c20
AM
18582013-03-12 Alan Modra <amodra@gmail.com>
1859
1860 * gc.h (gc_process_relocs): Look through function descriptors
1861 to determine shndx, symvalue and addend used by ICF. Tidy
1862 variable duplication.
1863
dc3714f3
AM
18642013-03-11 Alan Modra <amodra@gmail.com>
1865
1866 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1867 * layout.cc (Layout_task_runner::run): ..to here.
1868 * symtab.h (struct Symbol_location): Extract from..
1869 (class Symbol_table): ..here.
1870 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1871 * target.h (class Target): Add function_location and
1872 do_function_location functions.
1873 (class Sized_target): Add do_function_location.
1874 * object.h (class Sized_relobj_file): Move find_shdr..
1875 (class Object): ..to here.
1876 * object.cc: Likewise. Update to suit. Instantiate.
1877 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1878 * powerpc.cc (class Powerpc_dynobj): New.
1879 (Target_powerpc::do_function_location): New function.
1880 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1881 (Powerpc_dynobj::do_read_symbols): New function.
1882 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1883
956b03bb
ILT
18842013-03-08 Ian Lance Taylor <iant@google.com>
1885
1886 * options.cc (General_options::string_to_object_format): Accept
1887 "default".
1888
4bead2d5
AM
18892013-03-08 Alan Modra <amodra@gmail.com>
1890
1891 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1892 pointer to Post_fde.
1893 (struct Post_fde): Move definition to here..
1894 * ehframe.cc (struct Post_fde): ..from here.
1895 (Cie::write): Don't alloc Post_fde.
1896 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1897
02e60bf7
AM
18982013-03-07 Alan Modra <amodra@gmail.com>
1899
1900 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1901 relocation referencing .LC0.
1902 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1903
8343f03a
AM
19042013-03-07 Alan Modra <amodra@gmail.com>
1905
1906 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1907 always_inline. Add assembly for powerpc to avoid GOT.
1908
3366d57c
AM
19092013-03-07 Alan Modra <amodra@gmail.com>
1910
1911 * testsuite/script_test_10.sh: Don't test .bss section
1912 header number.
1913
6c77229c
AM
19142013-03-06 Alan Modra <amodra@gmail.com>
1915
1916 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1917 (Target_powerpc::symval_for_branch): Add symtab param. Update
1918 all callers. Handle folded sections.
1919 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1920 to Powerpc_relobj.
1921 (Global_symbol_visitor_opd::operator()): Likewise.
1922
a39e4af6
AM
19232013-03-04 Alan Modra <amodra@gmail.com>
1924
1925 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1926 * testsuite/Makefile.in: Regenerate.
1927
d5834edb
CC
19282013-03-01 Cary Coutant <ccoutant@google.com>
1929
1930 Add dwp support for v2 DWARF package file format.
1931 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1932 tu_length parameter. Adjust all callers.
1933 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1934 * dwp.cc: Include dwarf.h.
1935 (Section_bounds): New struct type.
1936 (Unit_set): New struct type.
1937 (Dwo_file::Dwo_file): Initialize new data member.
1938 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1939 Combine and rename to...
1940 (Dwo_file::read_unit_index): ...this.
1941 (Dwo_file::sized_read_compunit_index)
1942 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1943 (Dwo_file::sized_read_unit_index): ...this.
1944 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1945 parameters; add section_id parameter.
1946 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1947 (Dwo_file::add_unit_set): ...this.
1948 (Dwo_file::shndx_map_): Remove.
1949 (Dwo_file::sect_offsets_): New data member.
1950 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1951 (Dwp_output_file::add_section): Rename to...
1952 (Dwp_output_file::add_contribution): ...this.
1953 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1954 (Dwp_output_file::add_tu_set): Likewise.
1955 (Dwp_output_file::Contribution): New type.
1956 (Dwp_output_file::Section::contributions): New data member.
1957 (Dwp_output_file::Cu_or_tu_set): Remove.
1958 (Dwp_output_file::Section::Section): New ctor.
1959 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1960 (Dwp_output_file::Dwp_index::Section_table): New type.
1961 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1962 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1963 parameter.
1964 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1965 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1966 (Dwp_output_file::Dwp_index::section_table): New member function.
1967 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1968 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1969 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1970 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1971 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1972 (Dwp_output_file::Dwp_index::section_table_): New data member.
1973 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1974 (Dwp_output_file::add_output_section): New member function.
1975 (Dwp_output_file::write_new_section): New member function.
1976 (Dwp_output_file::write_contributions): New member function.
1977 (Dwp_output_file::section_id_map_): New data member.
1978 (class Dwo_id_info_reader): Remove.
1979 (class Unit_reader): New class.
1980 (get_dwarf_section_name): New function.
1981 (Dwo_file::read_executable): Adjust initializations of class data.
1982 (Dwo_file::read): Add support for v2 package file format.
1983 (Dwo_file::read_unit_index): Likewise.
1984 (Dwo_file::sized_read_unit_index): Likewise.
1985 (Dwo_file::copy_section): Likewise.
1986 (Dwo_file::add_unit_set): Likewise.
1987 (Dwp_output_file::add_output_section): Likewise.
1988 (Dwp_output_file::add_contribution): Likewise.
1989 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1990 for empty slot.
1991 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1992 file format.
1993 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1994 slot.
1995 (Dwp_output_file::initialize): Remove unused function.
1996 (Dwp_output_file::finalize): Add support for v2 package file format.
1997 (Dwp_output_file::write_index): Likewise.
1998 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1999 function prototype.
2000
a68a081d
CC
20012013-03-01 Cary Coutant <ccoutant@google.com>
2002
2003 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2004 function into class definition in header file.
2005 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2006 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2007 New function.
2008 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2009
9d5781f8
AM
20102013-02-28 Alan Modra <amodra@gmail.com>
2011
2012 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2013 * target.cc (Target::do_plt_fde_location): New function.
2014 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2015 accessor function, and constructor param.
2016 (struct Post_fde, Post_fdes): Declare.
2017 (Cie::write): Add post_fdes param.
2018 * ehframe.cc (Fde::write): Use plt_fde_location.
2019 (struct Post_fde): Define.
2020 (Cie::write): Stash FDEs added post merge mapping.
2021 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2022 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2023 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2024 other FDEs.
2025 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2026 (Target_powerpc::has_glink): New function.
2027 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2028 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2029 glink_eh_frame_fde_32, default_fde): New data.
2030 (Stub_table::eh_frame_added_): New var.
2031 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2032 Make const.
2033 (Stub_table::add_eh_frame): New function.
2034 (Output_data_glink::add_eh_frame): New function.
2035 (Target_powerpc::make_glink_section): Call add_eh_frame.
2036
214383dd
ILT
20372013-02-15 Ian Lance Taylor <iant@google.com>
2038
2039 * options.h (DEFINE_uint64_alias): Define.
2040 (class General_options): Add -Ttext-segment as an alias for
2041 -Ttext.
2042
91c2b899
AM
20432013-02-15 Alan Modra <amodra@gmail.com>
2044
2045 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2046 (Stub_table::do_write): ..here, two places.
2047 (Stub_table::plt_call_size): Use it here too.
2048
20e2a8aa
ILT
20492013-02-11 Ian Lance Taylor <iant@google.com>
2050
2051 * descriptors.cc (Descriptors::close_all): New function.
2052 * descriptors.h (class Descriptors): Declare close_all.
2053 (close_all_descriptors): New inline function.
2054 * plugin.cc: Include "descriptors.h".
2055 (Plugin_manager::cleanup): Call close_all_descriptors.
2056
8952bc69
AM
20572013-02-06 Alan Modra <amodra@gmail.com>
2058
2059 * README: Update coding style link.
2060
29bd8b6b
CC
20612013-01-28 Cary Coutant <ccoutant@google.com>
2062
a4034750
AM
2063 * dwp.cc (File_list): New typedef.
2064 (Dwo_name_info_reader): New class.
2065 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2066 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2067 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2068 (Dwo_file::read_executable): New function.
2069 (Dwo_file::read): Move common setup code to ...
2070 (Dwo_file::make_object): ... here.
2071 (dwp_options): Add --exec/-e.
2072 (usage): Likewise.
2073 (main): Likewise.
29bd8b6b 2074
c6ac678d
ST
20752013-01-24 Sriraman Tallam <tmsriram@google.com>
2076
2077 * layout.cc (Layout::layout): Check for option text_reorder.
2078 (Layout::make_output_section): Ditto.
2079 * options.h (text_reorder): New option.
2080 * output.cc (Input_section_sort_compare): Remove special ordering
2081 of section names.
2082 (Output_section::
2083 Input_section_sort_section_name_special_ordering_compare::
2084 operator()): New function.
2085 (Output_section::sort_attached_input_sections): Use new sort function
2086 for .text.
2087 * output.h (Input_section_sort_section_name_special_ordering_compare):
2088 New struct.
2089 * testsuite/Makefile.am (text_section_grouping): Test option
2090 --no-text-reorder
2091 * testsuite/Makefile.in: Regenerate.
2092 * testsuite/text_section_grouping.sh: Check order of functions without
2093 default text reordering.
2094
50701cc1
MF
20952013-01-18 Mike Frysinger <vapier@gentoo.org>
2096
2097 * options.h (General_options): Change default to true for new_dtags.
2098
b1b00fcc
MF
20992013-01-18 Mike Frysinger <vapier@gentoo.org>
2100
2101 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2102 when enable_new_dtags is false. Only add DT_RUNPATH when
2103 enable_new_dtags is true.
2104
ec5b8187
AM
21052013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2106
2107 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2108 used in declaration and definition consistent.
2109 (Target_powerpc::symval_for_branch): Ditto.
2110
a880d4c4
ST
21112013-01-16 Sriraman Tallam <tmsriram@google.com>
2112
2113 * testsuite/plugin_final_layout.cc: Fix comment.
2114
7c381248
ST
21152013-01-16 Sriraman Tallam <tmsriram@google.com>
2116
2117 * layout.cc (Layout::layout): Do not do default sorting for
2118 text sections when section ordering is specified.
2119 (make_output_section): Ditto.
2120 * testsuite/plugin_final_layout.cc: Name the function sections
2121 to catch reordering issues.
2122
e2458743
AM
21232013-01-15 Alan Modra <amodra@gmail.com>
2124
2125 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2126 plt-thread-safe.
2127
431ed302
AM
21282013-01-15 Alan Modra <amodra@gmail.com>
2129
2130 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2131 * testsuite/Makefile.in: Regenerate.
2132
0ec6429b
AM
21332013-01-14 Alan Modra <amodra@gmail.com>
2134
2135 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2136 * testsuite/Makefile.in: Regenerate.
2137
0bf402d5
ILT
21382013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2139
36af3926 2140 PR bfd/14430
0bf402d5
ILT
2141 Fix mingw gold build with plugins enabled
2142 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2143 * configure.ac: Export DLOPEN_LIBS and add headers check.
2144 * plugin.cc: Handle non-dlfcn case.
2145 * Makefile.in: Regenerate.
2146 * config.in: Regenerate.
2147 * configure: Regenerate.
2148 * testsuite/Makefile.in: Regenerate.
2149
9e9143bc
ST
21502013-01-09 Sriraman Tallam <tmsriram@google.com>
2151
2152 * output.h (sort_attached_input_sections): Change to be public.
2153 * script-sections.cc
2154 (Output_section_definition::set_section_addresses): Sort
2155 attached input sections according to section order before linker
2156 script assigns section addresses.
2157 (Orphan_output_section::set_section_addresses): Sort
2158 attached input sections according to section order before linker
2159 script assigns section addresses.
2160 * Makefile.am (final_layout.sh): Use a simple linker script to
2161 check if section ordering still works.
2162 * Makefile.in: Regenerate.
2163
679af368
ILT
21642013-01-09 Ben Cheng <bccheng@google.com>
2165
2166 * arm.cc (Target_arm::attributes_accept_div): New function.
2167 (Target_arm::attributes_forbid_div): New function.
2168 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2169 attribute using the same new functions as what bfd/elf32_arm.c
2170 does.
2171
3136a00e
CC
21722013-01-07 Cary Coutant <ccoutant@google.com>
2173
2174 PR gold/14993
2175 * output.cc (Output_section::add_input_section): For incremental
2176 updates, don't track input sections that are allocated from patch
2177 space.
2178
f2a6224b
L
21792013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2180 Ian Lance Taylor <iant@google.com>
2181
2182 PR gold/14897
2183 * configure.ac (--enable-ld): Removed.
2184 (install_as_default): Set to yes only for --enable-gold=default
2185 or --disable-ld.
2186 * configure: Regenerated.
2187
4f46f626
L
21882013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2189
2190 * options.h (General_options): Add -fuse-ld= for GCC linker
2191 option compatibility.
2192
26e4ef59
CC
21932013-01-04 Cary Coutant <ccoutant@google.com>
2194
2195 * configure.ac: Fix typo restoring CXXFLAGS.
2196 * configure: Regenerate.
2197
3d587466
CC
21982013-01-04 Cary Coutant <ccoutant@google.com>
2199
4f46f626
L
2200 * testsuite/Makefile.am (CXXLINK_S): New macro.
2201 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2202 * testsuite/Makefile.in: Regenerate.
3d587466 2203
44db6695
L
22042013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2205
2206 * version.cc (print_version): Update copyright year to 2013.
2207
edcac0c1
ILT
22082012-12-20 Ian Lance Taylor <iant@google.com>
2209
2210 * layout.cc (Layout::special_ordering_of_input_section): New
2211 function.
2212 (Layout::layout): If input section requires special ordering, must
2213 sort input sections.
2214 (Layout::make_output_section): May sort .text input sections.
2215 (Layout::is_section_name_prefix_grouped): Remove.
2216 * layout.h (class Layout): Declare
2217 special_ordering_of_input_section. Don't declare
2218 is_section_name_prefix_grouped.
2219 * output.cc (Output_section::add_input_section): Revert last
2220 change.
2221 (Output_section::Input_section_sort::match_file_name): Don't crash
2222 if called on output section data.
2223 (Output_section::Input_section_sort_compare): Sort based on
2224 special ordering.
2225 (Output_section::Input_section_sort_section_order_index_compare):
2226 Revert last patch.
2227 (Output_section::sort_attached_input_sections): Likewise.
2228
28f2a4ac
ST
22292012-12-18 Sriraman Tallam <tmsriram@google.com>
2230
edcac0c1 2231 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2232 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2233 * output.cc (Output_section::add_input_section): Check if section
2234 name contains special prefix. Keep input sections to sort such
2235 sections.
2236 (Output_section::Input_section_sort_section_order_index_compare
2237 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2238 (Output_section::sort_attached_input_sections): Add condition to
2239 Input_section_entry constructor call.
28f2a4ac
ST
2240 * testsuite/Makefile.am (text_section_grouping): New test.
2241 * testsuite/Makefile.in: Regenerate.
2242 * testsuite/text_section_grouping.cc: New file.
2243 * testsuite/text_section_grouping.sh: New file.
2244
5bf135a7
NC
22452012-12-17 Nick Clifton <nickc@redhat.com>
2246
2247 * Makefile.am: Add copyright notice.
2248 * NEWS: Likewise.
2249 * README: Likewise.
2250 * configure.ac: Likewise.
2251 * ftruncate.c: Likewise.
2252 * Makefile.in: Regenerate.
2253
59965708
CC
22542012-12-14 Cary Coutant <ccoutant@google.com>
2255
a4034750
AM
2256 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2257 --no-as-needed flag.
2258 (exception_separate_shared_12_test): Likewise.
2259 (incremental_copy_test): Likewise.
2260 * testsuite/Makefile.in: Regenerate.
59965708 2261
2a77e2ab
CC
22622012-12-14 Cary Coutant <ccoutant@google.com>
2263
2264 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2265 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2266
e3deeb9c
AM
22672012-12-12 Alan Modra <amodra@gmail.com>
2268
2269 * powerpc.cc (class Track_tls): New.
2270 (class Relocate, class Scan): Inherit Track_tls.
2271 (Target_powerpc::Scan::local, global): Track tls optimization
2272 and avoid creating plt entry for __tls_get_addr if all uses
2273 are optimized away.
2274 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2275
d8f5a274
AM
22762012-12-12 Alan Modra <amodra@gmail.com>
2277
2278 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2279 Replace no_toc_optimize with toc_optimize.
2280 * output.h (Output_section::input_sections): Provide non-const variant.
2281 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2282 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2283 accessors.
2284 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2285 (class Sort_toc_sections): New.
2286 (Target_powerpc::do_finalize_sections): Sort toc sections.
2287 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2288
4c8a1de1
RM
22892012-12-10 Roland McGrath <mcgrathr@google.com>
2290
2291 * testsuite/binary_unittest.cc (read_all): New function.
2292 (Sized_binary_test): Use it instead of ::read.
2293 * fileread.cc (do_read): Don't assume pread always reads the whole
2294 amount in a single call.
2295
edc27beb
AM
22962012-12-10 Alan Modra <amodra@gmail.com>
2297
2298 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2299 Set EM_PPC64 or EM_PPC here.
2300 (Target_selector_powerpc::do_recognize): Delete.
2301
906b9150
AM
23022012-12-10 Alan Modra <amodra@gmail.com>
2303
2304 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2305 stub_table_.
2306 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2307
418c15ae
RM
23082012-12-07 Roland McGrath <mcgrathr@google.com>
2309
2310 * testsuite/binary_unittest.cc (Sized_binary_test):
2311 Use open_descriptor rather than ::open.
2312
decdd3bc
AM
23132012-12-07 Alan Modra <amodra@gmail.com>
2314
2315 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2316 typedef and invalid_address constant.
2317 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2318 instantiate constants.
2319
db399005
ILT
23202012-12-06 Roland McGrath <mcgrathr@google.com>
2321
2322 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2323 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2324 * aclocal.m4: Regenerate.
2325 * configure: Regenerate.
2326 * Makefile.in: Regenerate.
2327 * testsuite/Makefile.in: Regenerate.
2328
aba6bc71
AM
23292012-12-07 Alan Modra <amodra@gmail.com>
2330
2331 * options.h (General_options): Add no_toc_optimize.
2332 * powerpc.cc (ok_lo_toc_insn): New function.
2333 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2334
9e69ed50
AM
23352012-12-06 Alan Modra <amodra@gmail.com>
2336
2337 * options.h (General_options): Add plt_align, plt_static_chain,
2338 plt_thread_safe. Update stub_group_size help text.
2339 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2340 for new plt_thread_safe_ var.
2341 (use_plt_offset): Correct comments.
2342 (Target_powerpc::do_relax): Look for thread creation symbols to
2343 determine default plt_thread_safe value. Clear plt call stubs
2344 as well as branch stubs each iteration.
2345 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2346 insn constants.
2347 (l, hi, ha, write_insn): Move earlier.
2348 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2349 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2350 plt stubs too.
2351 (Stub_table::update_size): Adjust.
2352 (Stub_table::prev_size, set_prev_size): Delete.
2353 (Stub_table::stub_align): Let --plt-align affect result.
2354 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2355 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2356 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2357 (Stub_table::do_write): Support more stub variants.
2358
f43ba157
AM
23592012-12-04 Alan Modra <amodra@gmail.com>
2360
2361 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2362 (Target_powerpc::do_define_standard_symbols): New function.
2363
34171bc5
AM
23642012-12-03 Alan Modra <amodra@gmail.com>
2365
2366 * output.h: Formatting, whitespace.
2367
dc9589e9 23682012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2369
2370 * layout.h (Layout::get_executable_sections): Declare.
2371 * layout.cc (Layout::get_executable_sections): New function.
2372 * arm.cc (Target_arm::group_sections): Use it.
2373 (Arm_output_section::group_sections): Delete now redundant test.
2374 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2375 param to handle relative relocs.
2376 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2377 (Output_data_reloc::add_absolute): Adjust.
2378 (Output_data_reloc::add_relative): New function.
2379 (Output_data::reset_data_size): New function.
2380 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2381 (Output_section::set_addralign): New function.
2382 (Output_section::checkpoint_set_addralign): New function.
2383 (Output_section::clear_section_offsets_need_adjustment): New function.
2384 (Output_section::input_sections): Make public.
2385 * powerpc.cc (class Output_data_brlt_powerpc): New.
2386 (class Stub_table, class Stub_control): New.
2387 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2388 stub_table_, set_stub_table, stub_table): New vectors and accessor
2389 functions.
2390 (Target_powerpc::do_may_relax, do_relax, push_branch,
2391 new_stub_table, stub_tables, brlt_section, group_sections,
2392 add_branch_lookup_table, find_branch_lookup_table,
2393 write_branch_lookup_table, make_brlt_section): New functions.
2394 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2395 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2396 branch_info_): New vars.
2397 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2398 make call stubs here.
2399 (Output_data_glink): Remove all call stub handling from this class.
2400 (Target_powerpc::Scan::local, global): Save interesting branch
2401 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2402 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2403 functions on final link.
2404 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2405 Handle long branch destinations too.
2406 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2407 do_plt_address_for_local): Adjust lookup of plt call stubs.
2408
627b30b7
AM
24092012-11-30 Alan Modra <amodra@gmail.com>
2410
2411 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2412 relocs against protected symbols when building 32-bit shared libs.
2413
40b469d7
AM
24142012-11-30 Alan Modra <amodra@gmail.com>
2415
2416 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2417 param. Call got_section() to make .got. Update all callers
2418 and their callers and so on.
2419
bb66a627
AM
24202012-11-30 Alan Modra <amodra@gmail.com>
2421
2422 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2423 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2424 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2425 value if it already exists.
2426
d2cf1c6c
L
24272012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2428
2429 PR gold/14858
2430 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2431
edccdf7c
RM
24322012-11-14 Roland McGrath <mcgrathr@google.com>
2433
2434 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2435 than bfc instruction for data sandboxing.
2436
6febeb74
AM
24372012-11-08 Alan Modra <amodra@gmail.com>
2438
2439 * po/POTFILES.in: Regenerate.
2440
0a6f1bf2
AM
24412012-11-05 Alan Modra <amodra@gmail.com>
2442
2443 * configure.ac: Apply 2012-09-10 change to config.in here.
2444 * configure: Regenerate.
2445
26a4e9cb
AM
24462012-11-05 Alan Modra <amodra@gmail.com>
2447
2448 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2449 (struct Opd_ent): Use "Address" rather than "Offset".
2450 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2451 (Target_powerpc::got_section): Make public.
2452 (Target_powerpc::scan_relocs): Move code setting symbols..
2453 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2454 Create _SDA_BASE_ only when referenced.
2455
cc928013
RM
24562012-11-02 Roland McGrath <mcgrathr@google.com>
2457
2458 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2459 from last change.
2460
50ed5eb1
RM
24612012-11-01 Roland McGrath <mcgrathr@google.com>
2462
62fe925a
RM
2463 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2464 for offset_in_output_section parameter.
2465 (Sized_target::relocate_special_relocatable): Likewise.
2466 * arm.cc (Target_arm::relocate_relocs): Likewise.
2467 (Target_arm::relocate_special_relocatable): Likewise.
2468 * i386.cc (Target_i386::relocate_relocs): Likewise.
2469 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2470 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2471 * target-reloc.h (relocate_relocs): Likewise.
2472 * testsuite/testfile.cc (Target_test): Likewise.
2473 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2474 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2475
2476 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2477 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2478
2479 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2480 parameter, which is unused in the [!F_SETFD] case.
2481
50ed5eb1
RM
2482 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2483 SYMNDX to off_t before comparing it to this->data_size().
2484 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2485 * incremental.cc (Output_section_incremental_inputs::do_write):
2486 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2487
2cadc0bf
RM
2488 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2489
3bfcb652
NC
24902012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2491
2492 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2493 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2494 in EABI_VER5.
2495
c1a8d56e
CC
24962012-10-29 Cary Coutant <ccoutant@google.com>
2497
2498 * dwp.cc (usage): Add file and exit status parameters;
2499 add --help and --version options.
2500 (print_version): New function.
2501 (main): Add --help and --version options.
2502
b2490a7b
L
25032012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2504
2505 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2506 final_layout_sequence.txt.
2507 * testsuite/Makefile.in: Regenerated.
2508
aa543512
L
25092012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2510
2511 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2512 COMPILE generated by automake.
2513 (LINK1): Likewise.
2514 (CXXCOMPILE1): Likewise.
2515 (CXXLINK1): Likewise.
2516 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2517 (LINK): Likewise.
2518 (CXXCOMPILE): Likewise.
2519 (CXXLINK): Likewise.
2520 * testsuite/Makefile.in: Regenerated.
2521
d361fafb
L
25222012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2523
2524 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2525 on bad fwrite return.
2526
598c7410
L
25272012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2528
2529 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2530 on val.
2531
35c813e2
CC
25322012-10-23 Cary Coutant <ccoutant@google.com>
2533
2534 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2535 * testsuite/Makefile.in: Regenerate.
2536 * testsuite/dwp_test.h: New source file.
2537 * testsuite/dwp_test_1.cc: New source file.
2538 * testsuite/dwp_test_1.s: New source file.
2539 * testsuite/dwp_test_1.sh: New source file.
2540 * testsuite/dwp_test_1b.cc: New source file.
2541 * testsuite/dwp_test_1b.s: New source file.
2542 * testsuite/dwp_test_2.cc: New source file.
2543 * testsuite/dwp_test_2.s: New source file.
2544 * testsuite/dwp_test_2.sh: New source file.
2545 * testsuite/dwp_test_main.cc: New source file.
2546 * testsuite/dwp_test_main.s: New source file.
2547
77429909
CC
25482012-10-23 Cary Coutant <ccoutant@google.com>
2549
2550 * dwp.h: New header file.
2551 * dwp.cc: New source file.
2552 * gold.h: Move shared declarations to system.h.
2553 * system.h: New header file.
2554 * Makefile.am: Add dwp.
2555 * Makefile.in: Regenerate.
2556
ed5d6712
CC
25572012-10-23 Cary Coutant <ccoutant@google.com>
2558
2559 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2560 Dwarf_info_reader::read_from_pointer.
2561 (Dwarf_pubnames_table::read_header): Likewise.
2562 (Dwarf_pubnames_table::next_name): Likewise.
2563 (Dwarf_die::read_attributes): Likewise.
2564 (Dwarf_die::skip_attributes): Likewise.
2565 (Dwarf_info_reader::read_from_pointer): New function template.
2566 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2567 (Dwarf_pubnames_table): Likewise.
2568 (Dwarf_info_reader::read_from_pointer): New function template.
2569 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2570 Dwarf_pubnames_table ctor.
2571
8787852d
CC
25722012-10-23 Cary Coutant <ccoutant@google.com>
2573
2574 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2575 abbrev_shndx.
2576 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2577 abbrev_shndx_.
2578 (Dwarf_info_reader::set_abbrev_shndx): New method.
2579 (Dwarf_info_reader::abbrev_shndx_): New data member.
2580
9fc236f3
CC
25812012-10-23 Cary Coutant <ccoutant@google.com>
2582
2583 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2584 from object, not parameters.
2585 (Dwarf_info_reader::parse): Likewise.
2586 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2587 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2588 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2589 methods.
2590
effe8365
CC
25912012-10-23 Cary Coutant <ccoutant@google.com>
2592
2593 * fileread.cc (Input_file::Input_file): New constructor.
2594 * fileread.h (class Input_file): Add new constructor.
2595
1698990d
AM
25962012-10-18 Alan Modra <amodra@gmail.com>
2597
2598 PR gold/14727
2599 * object.cc (Relobj::is_section_name_included): Also match
2600 .sdata personality section.
2601
168a4726
AM
26022012-10-18 Alan Modra <amodra@gmail.com>
2603
2604 * target-reloc.h (class Default_comdat_behavior): New, package up..
2605 (get_comdat_behaviour): ..this.
2606 (relocate_section): Add Relocate_comdat_behavior template arg,
2607 adjust code to suit.
2608 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2609 (Target_arm::scan_reloc_section): Likewise.
2610 * i386.cc (Target_i386::relocate_section): Likewise.
2611 * sparc.cc (Target_sparc::relocate_section): Likewise.
2612 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2613 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2614 * powerpc.cc (class Relocate_comdat_behavior): New.
2615 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2616 gold::relocate_section with new template arg.
2617
acc276d8
AM
26182012-10-18 Alan Modra <amodra@gmail.com>
2619
2620 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2621 dynamic relocs for GOT_TPREL got entries, without symbol if
2622 resolving locally.
2623 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2624 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2625 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2626
e10f9870
AM
26272012-10-17 Alan Modra <amodra@gmail.com>
2628
2629 PR gold/14726
2630 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2631
ae034989
ST
26322012-10-16 Sriraman Tallam <tmsriram@google.com>
2633
2634 * layout.cc (Layout::include_section): Keep sections marked
2635 SHF_EXCLUDE when doing relocatable links.
2636
f3a0ed29
AM
26372012-10-16 Alan Modra <amodra@gmail.com>
2638
2639 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2640 (Target_powerpc::do_finalize_sections): Call it.
2641 (Output_data_save_res): New class and supporting functions.
2642 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2643 normal symbols defined in object files.
2644
c6de8ed4
AM
26452012-10-12 Alan Modra <amodra@gmail.com>
2646
2647 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2648 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2649 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2650 section if scan_opd_relocs not yet called.
2651 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2652
03e25981
AM
26532012-10-12 Alan Modra <amodra@gmail.com>
2654
2655 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2656 add_local_ifunc_entry): Revert last change.
2657 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2658
c9824451
AM
26592012-10-05 Alan Modra <amodra@gmail.com>
2660
2661 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2662 do_plt_address_for_global): New functions.
2663 (Output_data_got_powerpc::do_write): Don't segfault when linking
2664 statically.
2665 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2666 add_local_ifunc_entry): Return true on adding entry..
2667 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2668 glink->add_entry call. Remove unused symtab param. Adjust calls.
2669 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2670 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2671 set up symbols here.
2672 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2673 syms here. Do so even when no .iplt. Don't segfault when linking
2674 statically.
2675 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2676 new variants without reloc param.
2677 (Glink_sym_ent::Glink_sym_ent): Likewise.
2678 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2679 reloc when refs will resolve to plt call stub.
2680 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2681 R_PPC_PLTREL24 to resolve locally.
2682 (Target_powerpc::Scan::global): Correct ifunc handling.
2683 (Target_powerpc::Relocate::relocate): Correct local sym glink
2684 lookup. Don't destroy "value" when we have a plt call stub,
2685 and when checking plt call validity.
2686 (Target_powerpc::do_dynsym_value): Simplify.
2687
19fec8c1
AM
26882012-10-05 Alan Modra <amodra@gmail.com>
2689
2690 * i386.cc (Output_data_plt_i386::address_for_global,
2691 address_for_local): Add plt offset to returned value. Adjust uses.
2692 * sparc.cc (Output_data_plt_sparc::address_for_global,
2693 address_for_local): Likewise.
2694 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2695 address_for_local): Likewise.
2696 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2697 address_for_local): Likewise.
2698 * target.h (Target::plt_address_for_global, plt_address_for_local):
2699 Update comment.
2700 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2701 (Output_data_got::Got_entry::write): Nor here.
2702 * output.h: Comment fix.
2703
e867b647
WL
27042012-10-02 Jiong Wang <jiwang@tilera.com>
2705
2706 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2707 global_offset_table_ value for larget got.
2708 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2709
e5d5f5ed
AM
27102012-09-29 Alan Modra <amodra@gmail.com>
2711
2712 * powerpc.cc (Target_powerpc::iplt_): New output section.
2713 (Target_powerpc::iplt_section, make_iplt_section,
2714 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2715 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2716 Target_powerpc::plt_entry_count): Count iplt entries too.
2717 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2718 reloc section in constructor. New params.
2719 (Target_powerpc::make_plt_section): Create reloc section here instead.
2720 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2721 functions.
2722 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2723 (Output_data_glink::add_entry, find_entry): New functions to
2724 deal with local syms.
2725 (Glink_sym_ent): Add support for local syms.
2726 (Output_data_glink::do_write): Handle ifunc plt entries.
2727 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2728 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2729 (Target_powerpc::Relocate::relocate): Likewise.
2730 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2731
ec4dbad3
AM
27322012-09-25 Alan Modra <amodra@gmail.com>
2733
2734 * object.h (Sized_relobj_file::adjust_local_symbol,
2735 do_adjust_local_symbol): New functions.
2736 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2737 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2738 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2739 and irregular opd entry spacing.
2740 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2741 (Global_symbol_visitor_opd): New functor.
2742 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2743 on deleted opd entries.
2744
5c0b3823
WL
27452012-09-15 Jiong Wang <jiwang@tilera.com>
2746
2747 * tilegx.cc: New file.
2748 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2749 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2750 * configure.tgt: Add entries for tilegx*.
2751 * configure.ac: Likewise.
2752 * Makefile.in: Rebuild.
2753 * configure: Likewise.
2754 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2755 tilegx.
2756
bfdfa4cd
AM
27572012-09-13 Alan Modra <amodra@gmail.com>
2758
2759 * target-reloc.h (scan_relocs): Call scan.local for relocs
2760 against symbols in discarded sections. Pass is_discarded
2761 param.
2762 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2763 Add is_discarded param.
2764 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2765 is_discarded to flag opd entry as discarded. Don't emit dyn
2766 relocs on such entries.
2767 (Target_powerpc::Scan::global): Similarly detect and handle
2768 such opd entries.
2769 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2770 opd_ent_. Update all uses.
2771 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2772 (Target_powerpc::relocate_section): Zero out discarded opd
2773 entry relocs.
2774
d77a0555
ILT
27752012-09-12 Ian Lance Taylor <iant@google.com>
2776
2777 PR gold/14570
2778 * output.cc: Rename Output_data_got template parameter from size
2779 to got_size for all functions. Compile all variants of
2780 Output_data_got.
2781 (Output_data_got::Got_entry::write): Correct use of size for
2782 symbol value. Use local_is_tls rather than casting to
2783 Sized_relobj_file.
2784 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2785 (class Sized_relobj_file): Add do_local_is_tls.
2786 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2787
815a1205
AM
27882012-09-11 Alan Modra <amodra@gmail.com>
2789
2790 PR gold/14566
2791 * layout.cc (Layout::set_segment_offsets): When using
2792 common-page-size alignment, ensure we are on a new max-page-size
2793 page.
2794 * output.cc (Output_segment::set_section_addresses): Use
2795 abi_pagesize, not common_pagesize for relro boundary.
2796 (Output_segment::set_offset): Likewise.
2797
bd73a62d
AM
27982012-09-11 Alan Modra <amodra@gmail.com>
2799
2800 * output.h (Output_data_got::add_global_tls, add_local_tls,
2801 add_local_tls_pair): New functions.
2802 (Output_data_got::add_local_pair_with_rel): Remove second
2803 reloc param. Expand comment.
2804 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2805 use_plt_or_tls_offset_, similarly for constructor param.
2806 (Output_data_got::Got_entry::write): Add got_index param.
2807 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2808 add_local_tls_pair): New functions.
2809 (Output_data_got::Got_entry::write): Handle tls symbols
2810 with use_plt_or_tls_offset_ set specially.
2811 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2812 (Output_data_got::do_write): Replace iterator with index, pass
2813 index to entry write function.
2814 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2815 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2816 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2817 call.
2818 * i386.cc (Target_i386::Scan::local): Likewise.
2819 * sparc.cc (Target_sparc::Scan::local): Likewise.
2820 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2821 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2822 do_tls_offset_for_global): New functions.
2823 (Target_powerpc::Scan::local): Correct TLS relocations and got
2824 entry values.
2825 (Target_powerpc::Scan::global): Don't emit unnecessary
2826 dynamic relocations on TLS GOT entries.
2827
00716ab1
AM
28282012-09-10 Matthias Klose <doko@ubuntu.com>
2829
2830 * config.in: Disable sanity check for kfreebsd.
2831
c891b3f9
SA
28322012-09-10 Sterling Augustine <saugustine@google.com>
2833
2834 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2835 (Gdb_index::pubtypes_read): New parameter.
2836 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2837 to calls.
2838 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2839 pubtypes_object_.
2840
e81fea4d
AM
28412012-09-09 Alan Modra <amodra@gmail.com>
2842
2843 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2844 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2845 * gc.h (gc_process_relocs): Call target gc_add_reference.
2846 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2847 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2848 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2849 unnecessary cast.
2850 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2851 to cater for when we don't need code offset. Update use.
2852 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2853 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2854 set_opd_valid): New functions.
2855 (Target_powerpc::do_gc_add_reference): New function.
2856 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2857 stashed refs.
2858 (Target_powerpc::do_gc_mark_symbol): New function.
2859
d2d60eef
CC
28602012-09-06 Cary Coutant <ccoutant@google.com>
2861
2862 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2863 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2864 (Dwarf_die::skip_attributes): Likewise.
2865 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2866 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2867 (main): Call it.
2868 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2869
32ed4573
L
28702012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2871
2872 * testsuite/script_test_3.t: Add .got.plt output section
2873 statement.
2874 * testsuite/script_test_4.t: Likewise.
2875
f4baf0d4
AM
28762012-09-05 Alan Modra <amodra@gmail.com>
2877
2878 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2879 update all uses and lose "enum" when using type.
2880
864a1b56
AM
28812012-09-05 Alan Modra <amodra@gmail.com>
2882
2883 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2884 * configure: Regenerate.
2885 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2886 (plugin_final_layout.stdout): Likewise.
2887 (memory_test): Set page sizes to 0x1000.
2888 * testsuite/Makefile.in: Regenerate.
2889 * testsuite/discard_locals_test.sh: Add FIXME comment.
2890 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2891 * testsuite/pr14265.t: Add .got output section statement.
2892 * testsuite/script_test_2.t: Likewise.
2893 * testsuite/script_test_3.t: Likewise.
2894 * testsuite/script_test_4.t: Likewise.
2895 * testsuite/script_test_5.t: Likewise.
2896 * testsuite/script_test_6.t: Likewise.
2897 * testsuite/script_test_7.t: Likewise.
2898 * testsuite/script_test_9.t: Likewise.
2899
3ea0a085
AM
29002012-09-05 Alan Modra <amodra@gmail.com>
2901
2902 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2903 (Powerpc_relocate_functions::Status): New typedef.
2904 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2905 (Target_powerpc::Scan::local): Handle REL64.
2906 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2907 for REL32 and REL64.
2908 (Target_powerpc::symval_for_branch): New function, extracted from..
2909 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2910 checks. Report overflow errors.
2911
7404fe1b
AM
29122012-09-05 Alan Modra <amodra@gmail.com>
2913
2914 * object.h (Sized_relobj_file::emit_relocs): Delete.
2915 (Sized_relobj_file::emit_relocs_reltype): Delete.
2916 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2917 relocate_relocs for --emit-relocs.
2918 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2919 * output.h: Update comment.
2920 (Output_segment::first_section): New function.
2921 (Output_segment::first_section_load_address): Use first_section.
2922 * output.cc (Output_segment::first_section): New function extracted..
2923 (Output_segment::first_section_load_address): ..from here. Delete.
2924 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2925 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2926 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2927 adjust call to target.h function.
2928 * i386.cc (Target_i386): Likewise.
2929 * sparc.cc (Target_sparc): Likewise.
2930 * x86_64.cc (Target_x86_64): Likewise.
2931 * powerpc.cc (Target_powerpc): Likewise.
2932 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2933 first tls section has section symbol for optimised local dynamic
2934 output relocs.
2935 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2936 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2937 optimised tls code.
2938 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2939 Rename to relocate_relocs. Update error message.
2940
957564c9
AS
29412012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2942
2943 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2944 --just-symbols.
2945
dd93cd0a
AM
29462012-08-31 Alan Modra <amodra@gmail.com>
2947
2948 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2949 (Powerpc_relobj::toc_base_offset): New stub function.
2950 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2951 got_mod_index_offset to tlsld_got_offset. Update all refs.
2952 (Target_powerpc::Relocate::enum skip_tls): New.
2953 (Target_powerpc::call_tls_get_addr_): New var.
2954 (Target_powerpc::is_branch_reloc): Move to file scope.
2955 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2956 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2957 New functions.
2958 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2959 (powerpc_info): Correct common_pagesize for ppc64.
2960 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2961 (Powerpc_relocate_functions): Add overflow check enums and functions.
2962 Add non-shift version of rela, rela_ua. Delete all rel public
2963 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2964 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2965 addr16_ha3, addr14 functions.
2966 (Output_data_got_powerpc::add_constant_pair): New function.
2967 (Output_data_got_powerpc::got_base_offset): Likewise.
2968 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2969 (instruction constants): Sort, add some more.
2970 (Output_data_glink::do_write): Add and use Address typedef. Use
2971 object->toc_base_offset() stub for 64-bit.
2972 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2973 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2974 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2975 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2976 Always treat .opd relocs as against locally defined symbol.
2977 Correct condition for RELATIVE relocs.
2978 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2979 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2980 for 32-bit syms with a plt entry. Correct ppc64 toc base
2981 calculations. Handle TLS relocs, and more. Add overflow
2982 checking and adjust for Powerpc_relocate_functions changes.
2983 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2984 Reinstate --emit-relocs code with FIXME.
2985
a1373b60
AM
29862012-08-30 Alan Modra <amodra@gmail.com>
2987
2988 * layout.cc (Layout::set_segment_offsets): Set p_align to
2989 abi_pagesize, not common_pagesize.
2990 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2991 to determine whether file header can go in segment.
2992
703d02da
AM
29932012-08-30 Alan Modra <amodra@gmail.com>
2994
2995 * output.h (Output_reloc::Output_reloc <output section>): Add
2996 is_relative param. Adjust calls.
2997 (Output_reloc::add_output_section_relative): New functions.
2998 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2999 is_relative.
3000 (Output_reloc::symbol_value): Handle SECTION_CODE.
3001
16164a6b
ST
30022012-08-24 Sriraman Tallam <tmsriram@google.com>
3003
3004 * gold.cc (queue_middle_tasks): Call layout again when unique
3005 segments for sections is desired.
3006 * layout.cc (Layout::Layout): Initialize new members.
3007 (Layout::get_output_section_flags): New function.
3008 (Layout::choose_output_section): Call get_output_section_flags.
3009 (Layout::layout): Make output section for mapping to a unique segment.
3010 (Layout::insert_section_segment_map): New function.
3011 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3012 output sections marked so.
16164a6b
ST
3013 (Layout::segment_precedes): Check for unique segments when sorting.
3014 * layout.h (Layout::Unique_segment_info): New struct.
3015 (Layout::Section_segment_map): New typedef.
3016 (Layout::insert_section_segment_map): New function.
3017 (Layout::get_output_section_flags): New function.
3018 (Layout::is_unique_segment_for_sections_specified): New function.
3019 (Layout::set_unique_segment_for_sections_specified): New function.
3020 (Layout::unique_segment_for_sections_specified_): New member.
3021 (Layout::section_segment_map_): New member.
3022 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3023 Rename is_gc_pass_one to is_pass_one.
3024 Rename is_gc_pass_two to is_pass_two.
3025 Rename is_gc_or_icf to is_two_pass.
3026 Check for which pass based on whether symbols data is present.
3027 Make it two pass when unique segments for sections is desired.
3028 * output.cc (Output_section::Output_section): Initialize new
3029 members.
3030 * output.h (Output_section::is_unique_segment): New function.
3031 (Output_section::set_is_unique_segment): New function.
3032 (Output_section::is_unique_segment_): New member.
3033 (Output_section::extra_segment_flags): New function.
3034 (Output_section::set_extra_segment_flags): New function.
3035 (Output_section::extra_segment_flags_): New member.
3036 (Output_section::segment_alignment): New function.
3037 (Output_section::set_segment_alignment): New function.
3038 (Output_section::segment_alignment_): New member.
3039 (Output_segment::Output_segment): Initialize is_unique_segment_.
3040 (Output_segment::is_unique_segment): New function.
3041 (Output_segment::set_is_unique_segment): New function.
3042 (Output_segment::is_unique_segment_): New member.
3043 * plugin.cc (allow_unique_segment_for_sections): New function.
3044 (unique_segment_for_sections): New function.
3045 (Plugin::load): Add new functions to transfer vector.
3046 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3047 * Makefile.in: Regenerate.
3048 * testsuite/plugin_final_layout.sh: Check if unique segment
3049 functionality works.
3050 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3051 are available.
3052 (allow_unique_segment_for_sections): New global.
3053 (unique_segment_for_sections): New global.
3054 (claim_file_hook): Call allow_unique_segment_for_sections.
3055 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3056
1e2bee4f
CC
30572012-08-22 Cary Coutant <ccoutant@google.com>
3058
3059 * layout.cc (Layout::include_section): Don't assert on GROUP
3060 sections with --emit-relocs.
3061
1d5dfe78
CC
30622012-08-21 Cary Coutant <ccoutant@google.com>
3063
3064 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3065 if --export-dynamic-symbol names an undef symbol.
3066
c9269dff
AM
30672012-08-18 Alan Modra <amodra@gmail.com>
3068
3069 * powerpc.cc: Formatting and white space.
3070 (Powerpc_relobj): Rename got2_section_ to special_.
3071 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3072 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3073 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3074 (Target_powerpc): Add Address typedef and invalid_address. Use
3075 throughout.
3076 (Target_powerpc::is_branch_reloc): New function.
3077 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3078 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3079 for dst_mask, value and addend.
3080 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3081 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3082 (Output_data_glink::do_write): Correct toc base. Don't try to use
3083 uint16_t for 24-bit offset. Use get_output_section_offset and
3084 check return.
3085 (Target_powerpc::Scan::local): Handle more relocs.
3086 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3087 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3088 Plug in toc restoring insn after plt calls. Translate branches
3089 to function descriptor symbols to corresponding entry point.
3090 (Target_powerpc::relocate_for_relocatable): Check return from
3091 get_output_section_offset.
3092 * symtab.h: Comment typo.
3093
b1759dce
ILT
30942012-08-14 Ian Lance Taylor <iant@google.com>
3095
3096 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3097 unsupported_relocal_local to call unsupported_reloc_global.
3098
b9b2ae8b
NC
30992012-08-14 Nick Clifton <nickc@redhat.com>
3100
3101 PR ld/14265
3102 * script-sections.cc (Sections_element::output_section_name): Add
3103 keep return parameter.
3104 (Output_section_element::match_name): Add keep return parameter.
3105 Return the value of the keep_ member.
3106 * script-sections.h (class Output_section): Update
3107 output_section_name prototype.
3108 * layout.cc (Layout::keep_input_section): New public member
3109 function.
3110 (Layout::choose_output_section): Pass keep parameter to
3111 output_section_name.
3112 * layout.h (class Layout): Add keep_input_section.
3113 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3114 sections.
3115 * testsuite/Makefile.am: Add a test.
3116 * testsuite/Makefile.in: Regenerate.
3117 * testsuite/pr14265.c: Source file for the test.
3118 * testsuite/pr14265.t: Linker script for the test.
3119 * testsuite/pr14265.sh: Shell script for the test.
3120
921b5322
AM
31212012-08-14 Alan Modra <amodra@gmail.com>
3122
3123 * target.h (Target::output_section_name): New function.
3124 (Target::do_output_section_name): New function.
3125 * layout.cc (Layout::choose_output_section): Call the above.
3126 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3127
6ce78956
AM
31282012-08-14 Alan Modra <amodra@gmail.com>
3129
3130 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3131 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3132 for replace_constant call.
3133 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3134 (Output_data_glink::do_print_to_mapfile): New function.
3135 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3136 (Target_powerpc::Relocate::relocate): Likewise.
3137
d1a8cabd
AM
31382012-08-14 Alan Modra <amodra@gmail.com>
3139
3140 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3141 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3142 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3143 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3144 all references to shndx_. Handle special case for R_PPC_PLTREL24
3145 here.
3146 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3147 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3148 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3149 here.
3150 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3151 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3152
d83ce4e3
AM
31532012-08-12 Alan Modra <amodra@gmail.com>
3154
3155 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3156 (glink insn constants): Use uint32_t.
3157 (Output_data_glink::add_entry): Use insert, not [] operator.
3158
cf43a2fe
AM
31592012-08-11 Alan Modra <amodra@gmail.com>
3160
3161 * object.h (Sized_relobj_file::find_shdr): New function.
3162 (Sized_relobj_file::find_special_sections): New function.
3163 * object.cc (Sized_relobj_file::find_shdr): New function.
3164 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3165 (Sized_relobj_file::find_special_sections): New function, split out..
3166 (Sized_relobj_file::do_read_symbols): ..from here.
3167 * output.h (Output_data_got::replace_constant): New function.
3168 (Output_data_got::num_entries): New function.
3169 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3170 (Output_data_got::got_offset): Protected rather than private.
3171 (Output_data_got::replace_got_entry): New function.
3172 * output.cc (Output_data_got::replace_got_entry): New function.
3173 * powerpc.cc (class Powerpc_relobj): New.
3174 (class Powerpc_relocate_functions): Delete all psymval variants or
3175 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3176 Implement _ha functions using corresponding _hi function.
3177 (Powerpc_relobj::find_special_sections): New function.
3178 (Target_powerpc::do_make_elf_object): New function.
3179 (class Output_data_got_powerpc): New.
3180 (class Output_data_glink): New.
3181 (class Powerpc_scan_relocatable_reloc): New.
3182 Many more changes througout file.
3183
3c892704
NC
31842012-08-09 Nick Clifton <nickc@redhat.com>
3185
3186 * po/vi.po: Updated Vietnamese translation.
3187
82435b3b
ILT
31882012-08-07 Ian Lance Taylor <iant@google.com>
3189
3190 * layout.cc (Layout::add_target_dynamic_tags): If
3191 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3192 plt_rel.
3193
a6dc81d2
NC
31942012-07-30 Nick Clifton <nickc@redhat.com>
3195
3196 * po/gold.pot: Updated template.
3197 * po/es.po: Updated Spanish translation.
3198
f1415016
CC
31992012-07-18 Cary Coutant <ccoutant@google.com>
3200
3201 PR gold/14344
3202 * configure.ac: Add check for -gpubnames support.
3203 * configure: Regenerate.
3204 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3205 support; force -gno-pubnames.
3206 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3207 support.
3208 (gdb_index_test_4): New test.
3209 * testsuite/Makefile.in: Regenerate.
3210 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3211 * testsuite/gdb_index_test_2.sh: Likewise.
3212 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3213 * testsuite/gdb_index_test_4.sh: New script.
3214 * testsuite/gdb_index_test_comm.sh: New script with common code;
3215 don't look for space after colon.
3216
b7fd7c37
ST
32172012-07-16 Sriraman Tallam <tmsriram@google.com>
3218
3219 * gold.cc (queue_middle_tasks): Update function order only after
3220 deferred objects due to plugins are processed.
3221
1f3212db
ILT
32222012-07-11 Ian Lance Taylor <iant@google.com>
3223
3224 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3225 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3226 (Target_arm::scan_reloc_for_stub): Likewise.
3227 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3228 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3229 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3230 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3231 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3232
81c82a68
ILT
32332012-07-10 Dodji Seketeli <dodji@redhat.com>
3234 Ian Lance Taylor <iant@google.com>
3235
3236 PR gold/14309
3237 * configure.ac: Test whether std::tr1::hash<off_t> works.
3238 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3239 needed.
3240 * output.h (class Output_fill): Add virtual destructor.
3241 * configure, config.in: Rebuild.
3242
eabc84f4
RM
32432012-06-22 Roland McGrath <mcgrathr@google.com>
3244
3245 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3246
370e30b6
RÁE
32472012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3248
3249 * plugin.cc (Plugin::load): Handle position independent executables.
3250
fb1b895d
CC
32512012-06-06 Cary Coutant <ccoutant@google.com>
3252
3253 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3254 add .debug_macro.
3255 (lines_only_debug_sections): Likewise.
3256 (gdb_fast_lookup_sections): New static array.
3257 (is_gdb_debug_section): Rename formal parameter.
3258 (is_lines_only_debug_section): Likewise.
3259 (is_gdb_fast_lookup_section): New function.
3260 (Layout::include_section): Check for ".zdebug_" prefix; pass
3261 section name suffix to is_gdb_debug_section, et al.; check for
3262 fast-lookup sections when building .gdb_index.
3263 * options.h (--strip-debug-gdb): Update GDB version number.
3264
7c0640fa
CC
32652012-06-06 Cary Coutant <ccoutant@google.com>
3266
3267 * configure.ac: Add check for fallocate.
3268 * configure: Regenerate.
3269 * config.in: Regenerate.
3270
3271 * options.h (class General_options): Add --mmap-output-file and
3272 --posix-fallocate options.
3273 * output.cc: (posix_fallocate): Remove; replace with...
3274 (gold_fallocate): New function.
3275 (Output_file::map_no_anonymous): Call gold_fallocate.
3276 (Output_file::map): Check --mmap-output-file option.
3277
2a49eb69
DK
32782012-06-05 Jing Yu <jingyu@google.com>
3279
3280 * gold.h (textdomain): Add do {} to empty while(0).
3281 (bindtextdomain): Likewise.
3282
fad072ac
CC
32832012-06-04 Cary Coutant <ccoutant@google.com>
3284
3285 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3286 has_dynsym_index.
3287
8cc69fb6
ST
32882012-05-25 Sriraman Tallam <tmsriram@google.com>
3289
3290 * symtab.cc (Symbol_table::define_special_symbol):
3291 Initialize *poldsym to prevent uninitialized variable errors.
3292
1be75daa
CC
32932012-05-23 Cary Coutant <ccoutant@google.com>
3294
3295 * layout.cc (Layout::section_name_mapping): Add rules to handle
3296 exact match on .data.rel.ro.local or .data.rel.ro.
3297 (Layout::output_section_name): Check for exact matches.
3298
9b689de0
CC
32992012-05-23 Cary Coutant <ccoutant@google.com>
3300
3301 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3302 more carefully.
3303
b24fdbf5
CC
33042012-05-22 Cary Coutant <ccoutant@google.com>
3305
3306 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3307 object before exporting symbol.
3308
e550e1a2
L
33092012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3310
3311 * testsuite/tls_test.cc: Include "config.h" first.
3312 * testsuite/tls_test_c.c: Likewise.
3313
df7b86aa
NC
33142012-05-17 Daniel Richard G. <skunk@iskunk.org>
3315 Nick Clifton <nickc@redhat.com>
3316
3317 PR 14072
3318 * configure.in: Add check that sysdep.h has been included before
3319 any system header files.
3320 * configure: Regenerate.
3321 * config.in: Regenerate.
3322
1007b503
CC
33232012-05-14 Cary Coutant <ccoutant@google.com>
3324
3325 * layout.cc (Layout::make_output_section): Mark .tdata section
3326 as RELRO.
3327 * testsuite/relro_test.cc: Add a TLS variable.
3328
fd885f3a
L
33292012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3330
3331 PR gold/14091
3332 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3333 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3334 R_X86_64_64.
3335
80f5885c
CC
33362012-05-08 Cary Coutant <ccoutant@google.com>
3337
3338 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3339 (lines_only_debug_sections): Likewise.
3340
2e702c99
RM
33412012-05-02 Roland McGrath <mcgrathr@google.com>
3342
3343 * nacl.cc: New file.
3344 * nacl.h: New file.
3345 * Makefile.am (CCFILES, HFILES): Add them.
3346 * Makefile.in: Regenerate.
3347 * i386.cc (Output_data_plt_i386_nacl): New class.
3348 (Output_data_plt_i386_nacl_exec): New class.
3349 (Output_data_plt_i386_nacl_dyn): New class.
3350 (Target_i386_nacl): New class.
3351 (Target_selector_i386_nacl): New class.
3352 (target_selector_i386): Use it instead of Target_selector_i386.
3353 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3354 (Target_x86_64_nacl): New class.
3355 (Target_selector_x86_64_nacl): New class.
3356 (target_selector_x86_64, target_selector_x32): Use it instead of
3357 Target_selector_x86_64.
3358 * arm.cc (Output_data_plt_arm_nacl): New class.
3359 (Target_arm_nacl): New class.
3360 (Target_selector_arm_nacl): New class.
3361 (target_selector_arm, target_selector_armbe): Use it instead of
3362 Target_selector_arm.
3363
3364 * target-select.cc (select_target): Take new Input_file* and off_t
3365 arguments, pass them on to recognize method of selector.
3366 * object.cc (make_elf_sized_object): Update caller.
3367 * parameters.cc (parameters_force_valid_target): Likewise.
3368 * incremental.cc (make_sized_incremental_binary): Likewise.
3369 * target-select.h: Update decl.
3370 (Target_selector::recognize): Take new Input_file* argument,
3371 pass it on to do_recognize.
3372 (Target_selector::do_recognize): Take new Input_file* argument.
3373 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3374 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3375 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3376 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3377
3378 * target.h (Target::Target_info): New members isolate_execinstr
3379 and rosegment_gap.
3380 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3381 * arm.cc (Target_arm::arm_info): Update initializer.
3382 * i386.cc (Target_i386::i386_info): Likewise.
3383 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3384 * sparc.cc (Target_sparc::sparc_info): Likewise.
3385 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3386 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3387 * layout.cc (Layout::attach_allocated_section_to_segment):
3388 Take new const Target* argument. If target->isolate_execinstr(), act
3389 like --rosegment.
3390 (Layout::find_first_load_seg): Take new const Target* argument;
3391 if target->isolate_execinstr(), reject PF_X segments.
3392 (Layout::relaxation_loop_body): Update caller.
3393 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3394 reset file offset to zero when we hit LOAD_SEG, and then do a second
3395 loop over the segments before LOAD_SEG to reassign offsets after
3396 addresses have been determined. Handle target->rosegment_gap().
3397 (Layout::attach_section_to_segment): Take new const Target* argument;
3398 pass it to attach_allocated_section_to_segment.
3399 (Layout::make_output_section): Update caller.
3400 (Layout::attach_sections_to_segments): Take new const Target* argument;
3401 pass it to attach_section_to_segment.
3402 * gold.cc (queue_middle_tasks): Update caller.
3403 * layout.h (Layout): Update method decls with new arguments.
3404
3405 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3406 Target_info pointer to use.
3407 (Target_arm::do_make_data_plt): New virtual method.
3408 (Target_arm::make_data_plt): New method that calls it.
3409 (Target_arm::make_plt_entry): Use it.
3410 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3411 for the section alignment.
3412 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3413 method.
3414 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3415 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3416 method.
3417 (Output_data_plt_arm::get_plt_entry_size): Call it.
3418 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3419 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3420 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3421 method.
3422 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3423 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3424 method instead of sizeof(plt_entry).
3425 (Output_data_plt_arm::add_entry): Likewise.
3426 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3427 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3428 than static method.
3429 (Target_arm::plt_entry_size): Likewise.
3430 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3431 Move to ...
3432 (Output_data_plt_arm_standard): ... here, new class.
3433 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3434 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3435 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3436
3437 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3438 Take additional argument for the PLT entry size.
3439 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3440 Use get_plt_entry_size method rather than plt_entry_size variable.
3441 (Output_data_plt_x86_64::reserve_slot): Likewise.
3442 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3443 (Output_data_plt_x86_64::add_entry): Likewise.
3444 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3445 (Output_data_plt_x86_64::address_for_global): Likewise.
3446 (Output_data_plt_x86_64::address_for_local): Likewise.
3447 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3448 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3449 Make method non-static.
3450 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3451 method.
3452 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3453 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3454 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3455 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3456 virtual method.
3457 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3458 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3459 virtual method.
3460 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3461 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3462 virtual method.
3463 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3464 (Output_data_plt_x86_64::plt_entry_size)
3465 (Output_data_plt_x86_64::first_plt_entry)
3466 (Output_data_plt_x86_64::plt_entry)
3467 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3468 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3469 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3470 (Output_data_plt_x86_64_standard): ... here, new class.
3471 (Target_x86_64::Target_x86_64): Take optional argument for the
3472 Target_info pointer to use.
3473 (Target_x86_64::do_make_data_plt): New virtual method.
3474 (Target_x86_64::make_data_plt): New method to call it.
3475 (Target_x86_64::init_got_plt_for_update): Use that.
3476 Call this->plt_->add_eh_frame method here.
3477 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3478 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3479 rather than static method.
3480 (Target_x86_64::plt_entry_size): Likewise.
3481 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3482 rather than plt_entry_size variable. Move guts of PLT filling to...
3483 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3484 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3485 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3486
3487 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3488 additional argument for the section alignment.
3489 Don't do add_eh_frame_for_plt here.
3490 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3491 non-static. Use get_plt_entry_size method rather than plt_entry_size
3492 variable.
3493 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3494 method.
3495 (Output_data_plt_i386::get_plt_entry_size): Call it.
3496 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3497 (Output_data_plt_i386::add_eh_frame): New method to call it.
3498 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3499 method.
3500 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3501 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3502 method.
3503 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3504 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3505 method instead of plt_entry_size.
3506 (Output_data_plt_i386::plt_entry_size)
3507 (Output_data_plt_i386::plt_eh_frame_fde_size)
3508 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3509 (Output_data_plt_i386_standard): ... here, new class.
3510 (Output_data_plt_i386_exec): New class.
3511 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3512 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3513 (Output_data_plt_i386::exec_plt_entry): Move to ...
3514 (Output_data_plt_i386_exec::plt_entry): ... here.
3515 (Output_data_plt_i386_dyn): New class.
3516 (Output_data_plt_i386::first_plt_entry): Move to ...
3517 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3518 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3519 (Output_data_plt_i386_dyn::plt_entry): ... here.
3520 (Target_i386::Target_i386): Take optional argument for the Target_info
3521 pointer to use.
3522 (Target_i386::do_make_data_plt): New virtual method.
3523 (Target_i386::make_data_plt): New method to call it.
3524 (Target_i386::make_plt_section): Use that.
3525 Call this->plt_->add_eh_frame method here.
3526 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3527 rather than plt_entry_size variable.
3528 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3529 (Output_data_plt_i386::address_for_local): Likewise.
3530 (Output_data_plt_i386::do_write): Likewise.
3531 Move guts of PLT filling to...
3532 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3533 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3534 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3535 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3536
b9b9f2ee
CC
35372012-05-01 Cary Coutant <ccoutant@google.com>
3538
3539 * dwarf_reader.cc (Dwarf_die::read_attributes)
3540 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3541 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3542 * reduced_debug_output.cc
3543 (Output_reduced_debug_info_section::get_die_end): Remove
3544 DW_FORM_GNU_ref_index. Add default case.
3545
57923f48
MW
35462012-04-26 Mark Wielaard <mjw@redhat.com>
3547
3548 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3549 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3550 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3551 DW_AT_high_pc as offset from DW_AT_low_pc.
3552
3553 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3554 * testsuite/Makefile.in: Regenerate.
3555 * testsuite/gdb_index_test_3.c: New test source file.
3556 * testsuite/gdb_index_test_3.sh: New test source file.
3557
2c54b4f4
ILT
35582012-04-25 Ian Lance Taylor <iant@google.com>
3559
3560 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3561 pointer.
3562 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3563 as a class, not a struct.
3564 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3565 (Target_arm::apply_cortex_a8_workaround): Likewise.
3566 * gc.h: Declare Reloc_types as a struct, not a class.
3567 * object.h: Declare Symbols_data as a struct.
3568 * reloc.h: Declare Read_relocs_data as a struct.
3569 * target.h: Declare Relocate_info as a struct.
3570
a5a5f7a3
DM
35712012-04-24 David S. Miller <davem@davemloft.net>
3572
3573 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3574 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3575 and R_SPARC_WPLT30.
3576
f038d496
CC
35772012-04-24 Cary Coutant <ccoutant@google.com>
3578
3579 * incremental-dump.cc (find_input_containing_global): Replace
3580 magic number with symbolic constant.
3581 (dump_incremental_inputs): Update version number.
3582 * incremental.cc (Output_section_incremental_inputs): Update version
3583 number; import symbolic constants from Incremental_inputs_reader.
3584 (Incremental_inputs::create_data_sections): Align relocations
3585 section correctly for 64-bit targets.
3586 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3587 constants; add padding.
3588 (Output_section_incremental_inputs::write_header): Add assert for
3589 header_size.
3590 (Output_section_incremental_inputs::write_input_files): Add assert
3591 for input_entry_size.
3592 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3593 add assert for object_info_size, input_section_entry_size,
3594 global_sym_entry_size.
3595 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3596 for data structure sizes; use them.
3597 (Incremental_input_entry_reader): Import symbolic constants from
3598 Incremental_inputs_reader; use them.
3599
a4d85145
DM
36002012-04-23 David S. Miller <davem@davemloft.net>
3601
3602 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3603 and elf_flags_set_.
3604 (Target_sparc::Target_sparc): Initialize new fields.
3605 (Target_sparc::do_make_elf_object): New function.
3606 (Target_sparc::do_adjust_elf_header): New function.
3607
1d509098
CC
36082012-04-23 Cary Coutant <ccoutant@google.com>
3609
3610 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3611 CU range table of gdb index.
3612
7ebeff7f
DM
36132012-04-20 David S. Miller <davem@davemloft.net>
3614
3615 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3616 instead of false.
3617
13cf9988
DM
36182012-04-16 David S. Miller <davem@davemloft.net>
3619
2a1079e8
DM
3620 * sparc.cc (Target_sparc::got_address): New function.
3621 (Sparc_relocate_functions::gdop_hix22): New function.
3622 (Sparc_relocate_functions::gdop_lox10): New function.
3623 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3624 relocs.
3625 (Target_sparc::Scan::local): Likewise if the global symbol is not
3626 preemptible and is not IFUNC.
3627 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3628 transformations for local and non-preemptible non-IFUNC global
3629 symbols.
3630
0bc964fc
DM
3631 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3632 writing out 64-bit part of ranges.
3633
661d7a80
DM
3634 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3635 -fpic and -fpie respectively.
3636 * Makefile.in: Regenerate.
3637
8c2bf391
DM
3638 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3639 (Target_sparc::Target_sparc): Initialize new field.
3640 (Target_sparc::do_plt_section_for_global): New function.
3641 (Target_sparc::do_plt_section_for_local): New function.
3642 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3643 (Target_sparc::make_plt_section): New function, broken out of
3644 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3645 (Target_sparc::make_plt_entry): Call make_plt_section.
3646 (Target_sparc::make_local_ifunc_plt_entry): New function.
3647 (Target_sparc::rela_ifunc_section): New function.
3648 (Target_sparc::plt_section): Remove const.
3649 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3650 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3651 and ifunc_count_ fields.
3652 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3653 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3654 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3655 (Output_data_plt_sparc::rela_ifunc): New function.
3656 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3657 (Output_data_plt_sparc::has_ifunc_section): New function.
3658 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3659 (Output_data_plt_sparc::address_for_global): New function.
3660 (Output_data_plt_sparc::address_for_local): New function.
3661 (Output_data_plt_sparc::plt_index_to_offset): New function.
3662 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3663 and entry_count.
3664 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3665 entry_count.
3666 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3667 R_SPARC_JMP_IREL to switch.
3668 (Target_sparc::Scan::check_non_pic): Likewise.
3669 (Target_sparc::Scan::local): Handle IFUNC symbols.
3670 (Target_sparc::Scan::local): Likewise.
3671 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3672 and plt_address_for_local.
3673 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3674 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3675
13cf9988
DM
3676 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3677 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3678 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3679 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3680 global relocs too.
3681 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3682 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3683 calls.
3684 * sparc.cc (Target_sparc::Scan::global): Likewise.
3685 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3686
31821be0
CC
36872012-04-16 Cary Coutant <ccoutant@google.com>
3688
3689 * archive.cc (Library_base::should_include_member): Check for
3690 --export-dynamic-symbol.
3691 * options.h (class General_options): Add --export-dynamic-symbol.
3692 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3693 --export-dynamic-symbol.
3694 (Symbol_table::gc_mark_undef_symbols): Likewise.
3695 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3696
2615994e
DM
36972012-04-12 David S. Miller <davem@davemloft.net>
3698
3699 * sparc.cc (Reloc::wdisp10): New relocation method.
3700 (Reloc::h34): Likewise.
3701 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3702 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3703 R_SPARC_WDISP10.
3704 (Target_sparc::Scan::local): Likewise.
3705 (Target_sparc::Scan::global): Likewise.
3706 (Target_sparc::Relocate::relocate): Likewise.
3707
6782735d
CC
37082012-04-09 Cary Coutant <ccoutant@google.com>
3709
3710 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3711 low_pc == 0.
3712
8c7a0b00
ILT
37132012-04-06 Ian Lance Taylor <iant@google.com>
3714
3715 * timer.cc: #include <unistd.h>.
3716
58797674
RM
37172012-04-06 Roland McGrath <mcgrathr@google.com>
3718
3719 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3720 * config.in: Regenerate.
3721 * configure: Regenerate.
3722
44350750
NC
37232012-04-05 Nick Clifton <nickc@redhat.com>
3724
3725 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3726 (AM_LC_MESSAGES): Add.
3727 * aclocal.m4: Regenerate.
3728 * config.in: Regenerate.
3729 * configure: Regenerate.
3730
c1027032
CC
37312012-03-21 Cary Coutant <ccoutant@google.com>
3732
3733 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3734 * Makefile.in: Regenerate.
3735 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3736 (Sized_elf_reloc_mapper::symbol_section): New function.
3737 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3738 (make_elf_reloc_mapper): New function.
3739 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3740 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3741 (Dwarf_abbrev_table::do_get_abbrev): New function.
3742 (Dwarf_ranges_table::read_ranges_table): New function.
3743 (Dwarf_ranges_table::read_range_list): New function.
3744 (Dwarf_pubnames_table::read_section): New function.
3745 (Dwarf_pubnames_table::read_header): New function.
3746 (Dwarf_pubnames_table::next_name): New function.
3747 (Dwarf_die::Dwarf_die): New function.
3748 (Dwarf_die::read_attributes): New function.
3749 (Dwarf_die::skip_attributes): New function.
3750 (Dwarf_die::set_name): New function.
3751 (Dwarf_die::set_linkage_name): New function.
3752 (Dwarf_die::attribute): New function.
3753 (Dwarf_die::string_attribute): New function.
3754 (Dwarf_die::int_attribute): New function.
3755 (Dwarf_die::uint_attribute): New function.
3756 (Dwarf_die::ref_attribute): New function.
3757 (Dwarf_die::child_offset): New function.
3758 (Dwarf_die::sibling_offset): New function.
3759 (Dwarf_info_reader::check_buffer): New function.
3760 (Dwarf_info_reader::parse): New function.
3761 (Dwarf_info_reader::do_parse): New function.
3762 (Dwarf_info_reader::do_read_string_table): New function.
3763 (Dwarf_info_reader::lookup_reloc): New function.
3764 (Dwarf_info_reader::get_string): New function.
3765 (Dwarf_info_reader::visit_compilation_unit): New function.
3766 (Dwarf_info_reader::visit_type_unit): New function.
3767 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3768 Sized_elf_reloc_mapper.
3769 (Sized_dwarf_line_info::symbol_section): Remove function.
3770 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3771 (Sized_dwarf_line_info::read_line_mappings): Remove object
3772 parameter, adjust callers.
3773 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3774 * dwarf_reader.h: Include <sys/types.h>.
3775 (class Track_relocs): Remove forward declaration.
3776 (class Elf_reloc_mapper): New class.
3777 (class Sized_elf_reloc_mapper): New class.
3778 (class Dwarf_abbrev_table): New class.
3779 (class Dwarf_range_list): New class.
3780 (class Dwarf_ranges_table): New class.
3781 (class Dwarf_pubnames_table): New class.
3782 (class Dwarf_die): New class.
3783 (class Dwarf_info_reader): New class.
3784 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3785 (Sized_dwarf_line_info::symbol_section): Remove member function.
3786 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3787 base class.
3788 * gdb-index.cc: New source file.
3789 * gdb-index.h: New source file.
3790 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3791 and .debug_types sections, call Layout::add_to_gdb_index.
3792 (Sized_relobj_incr::do_section_name): Implement.
3793 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3794 return type; Implement.
3795 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3796 return type.
3797 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3798 parameter list and return type.
3799 (Sized_incr_dynobj::do_section_contents): Likewise.
3800 * layout.cc: Include gdb-index.h.
3801 (Layout::Layout): Initialize gdb_index_data_.
3802 (Layout::init_fixed_output_section): Check for .gdb_index section.
3803 (Layout::add_to_gdb_index): New function. Instantiate.
3804 * layout.h: Add forward declaration for class Gdb_index.
3805 (Layout::add_to_gdb_index): New member function.
3806 (Layout::gdb_index_data_): New data member.
3807 * main.cc: Include gdb-index.h.
3808 (main): Print statistics for gdb index.
3809 * object.cc (Object::section_contents): Move code into
3810 do_section_contents.
3811 (need_decompressed_section): Check for sections needed when building
3812 gdb index.
3813 (build_compressed_section_map): Likewise.
3814 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3815 gdb index.
3816 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3817 sections; call Layout::add_to_gdb_index.
3818 (Sized_relobj_file::do_decompressed_section_contents): Call
3819 do_section_contents directly.
3820 * object.h (Object::do_section_contents): Adjust parameter list and
3821 return type.
3822 (Object::do_decompressed_section_contents): Call do_section_contents
3823 directly.
3824 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3825 return type.
3826 * options.h (class General_options): Add --gdb-index option.
3827 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3828 list and return type.
3829 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3830 * reloc.h (Track_relocs::checkpoint): New function.
3831 (Track_relocs::reset): New function.
3832
3833 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3834 New test cases.
3835 * testsuite/Makefile.in: Regenerate.
3836 * testsuite/gdb_index_test.cc: New test source file.
3837 * testsuite/gdb_index_test_1.sh: New test source file.
3838 * testsuite/gdb_index_test_2.sh: New test source file.
3839
647f1574
DK
38402012-03-19 Doug Kwan <dougkwan@google.com>
3841
3842 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3843 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3844 __exidx_start and __exidx_end. Make symbol table parameter
3845 anonymous as it is not used.
3846 * gold.cc (queue_middle_tasks): Call target hook to define any
3847 target-specific symbols.
3848 * target.h (Target::define_standard_symbols): New method.
3849 (Target::do_define_standard_symbols): Same.
3850 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3851 * testsuite/Makefile.in: Regenerate.
3852 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3853 and __exidx_end.
3854 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3855 relocations are generated for __exidx_start and __exidx_end.
3856
7c6109da
DK
38572012-03-16 Doug Kwan <dougkwan@google.com>
3858
3859 * testsuite/Makefile.am: Disable test initpri3b.
3860 * testsuite/Makefile.in: Regenerate.
3861
7b8957f8
DK
38622012-03-15 Doug Kwan <dougkwan@google.com>
3863
3864 * arm.cc (Target_arm::got_section): Make .got section read-only
3865 if -z now is given.
3866
14dc9ef7
ILT
38672012-03-15 Ian Lance Taylor <iant@google.com>
3868
3869 PR gold/13850
3870 * layout.cc (Layout::make_output_section): Correctly mark
3871 SHT_INIT_ARRAY, et. al., as relro.
3872
fa40b62a
DK
38732012-03-14 Doug Kwan <dougkwan@google.com>
3874
3875 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3876 dynamic relocations for protected symbols in shared objects.
3877
fd325007
ILT
38782012-03-13 Ian Lance Taylor <iant@google.com>
3879
3880 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3881 keep the larger alignment.
3882
e8dd54e1
CC
38832012-03-12 Cary Coutant <ccoutant@google.com>
3884
3885 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3886 handling of DW_LNE_define_file.
3887
feb5f3b0
CC
38882012-03-12 Cary Coutant <ccoutant@google.com>
3889
3890 * reduced_debug_output.cc
3891 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3892 codes to switch.
3893
a1fb4256
CC
38942012-02-29 Cary Coutant <ccoutant@google.com>
3895
3896 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3897
5dd8762a
CC
38982012-02-29 Cary Coutant <ccoutant@google.com>
3899
3900 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3901 Call Object::decompressed_section_contents.
3902 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3903 New dtor.
3904 (Sized_dwarf_line_info::buffer_start_): New data member.
3905 * merge.cc (Output_merge_data::do_add_input_section): Call
3906 Object::decompressed_section_contents.
3907 (Output_merge_string::do_add_input_section): Likewise.
3908 * object.cc (need_decompressed_section): New function.
3909 (build_compressed_section_map): Decompress sections needed later.
3910 (Sized_relobj_file::do_decompressed_section_contents): New function.
3911 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3912 * object.h (Object::decompressed_section_contents): New function.
3913 (Object::discard_decompressed_sections): New function.
3914 (Object::do_decompressed_section_contents): New function.
3915 (Object::do_discard_decompressed_sections): New function.
3916 (Compressed_section_info): New type.
3917 (Compressed_section_map): Include decompressed section contents.
3918 (Sized_relobj_file::do_decompressed_section_contents): New function.
3919 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3920
7b5de7ee
CC
39212012-02-16 Cary Coutant <ccoutant@google.com>
3922
3923 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3924 * testsuite/Makefile.in: Regenerate.
3925
f9fa4a63
CC
39262012-02-14 Cary Coutant <ccoutant@google.com>
3927
3928 * options.cc (General_options::finalize): Disallow -pie and -static.
3929
2c175ebc
DK
39302012-02-03 Doug Kwan <dougkwan@google.com>
3931
3932 * arm.cc (Arm_relocate_functions::abs8,
3933 Arm_relocate_functions::abs16): Use
3934 Bits::has_signed_unsigned_overflow32.
3935 (Arm_relocate_functions::thm_abs8): Correct range of
3936 overflow check.
3937 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3938 in assertions.
3939
90cff06f
DK
39402012-02-02 Doug Kwan <dougkwan@google.com>
3941
3942 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3943 position independent outputs, not just shared objects.
3944
63887f3d
L
39452012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3946
3947 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3948 * configure: Regenerated.
3949
bef2b434
ILT
39502012-01-27 Ian Lance Taylor <iant@google.com>
3951
3952 * reloc.h (Bits): New class with static functions, copied from
3953 namespace utils in arm.cc.
3954 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3955 instead.
3956
c335b55d
L
39572012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3958
3959 * incremental.cc (write_info_blocks): Correct relocation offset.
3960
41194d9f
L
39612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3962
3963 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3964 (Relocate::tls_gd_to_le): Likewise.
3965
1bae613c
L
39662012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3967
3968 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3969
24482ca0
L
39702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3971
3972 * configure.ac: Check if -mcmodel=medium works.
3973 * configure: Regenerated.
3974
c2c7840a
CC
39752012-01-24 Cary Coutant <ccoutant@google.com>
3976
3977 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3978 definition and ...
3979 (read_unsigned_LEB_128_x): ... this new function.
3980 (read_signed_LEB_128): Replaced with inline definition and ...
3981 (read_signed_LEB_128_x): ... this new function.
3982 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3983 (read_unsigned_LEB_128): Add inline definition.
3984 (read_signed_LEB_128_x): New function.
3985 (read_signed_LEB_128): Add inline definition.
3986 * testsuite/Makefile.am (leb128_unittest): New unit test.
3987 * testsuite/Makefile.in: Regenerate.
3988 * testsuite/leb128_unittest.cc: New unit test.
3989
833de760 39902012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3991
3992 PR gold/13617
3993 * i386.cc (Target_i386::do_code_fill): When using a jmp
3994 instruction, pad with nop instructions.
3995 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3996
618d6666
L
39972012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3998
3999 * x86_64.cc (gc_process_relocs): Add typename on types used in
4000 template.
4001 (scan_relocs): Likewise.
4002 (relocate_section): Likewise.
4003 (apply_relocation): Likewise.
4004
3660ff06
L
40052012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4006
4007 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4008 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4009 under x32.
4010
fc51264f
L
40112012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4012
4013 * x86_64.cc: Initial support for x32.
4014
dd74ae06
CC
40152012-01-03 Cary Coutant <ccoutant@google.com>
4016
4017 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4018 Use abstract base class for GOT.
4019 * gold/output.h (class Output_data_got_base): New abstract base class.
4020 (class Output_data_got): Derive from new base class, adjust ctors.
4021 (Output_data_got::reserve_slot): Make virtual; rename to
4022 do_reserve_slot; Adjust callers.
4023 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4024 pointer to abstract base class.
4025 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4026
83896202
ILT
40272011-12-18 Ian Lance Taylor <iant@google.com>
4028
4029 * object.h (Relobj::local_symbol_value): New function.
4030 (Relobj::local_plt_offset): New function.
4031 (Relobj::local_has_got_offset): New function.
4032 (Relobj::local_got_offset): New function.
4033 (Relobj::set_local_got_offset): New function.
4034 (Relobj::do_local_symbol_value): New pure virtual function.
4035 (Relobj::do_local_plt_offset): Likewise.
4036 (Relobj::do_local_has_got_offset): Likewise.
4037 (Relobj::do_local_got_offset): Likewise.
4038 (Relobj::do_set_local_got_offset): Likewise.
4039 (Sized_relobj::do_local_has_got_offset): Rename from
4040 local_has_got_offset.
4041 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4042 (Sized_relobj::do_set_local_got_offset): Rename from
4043 set_local_got_offset.
4044 (Sized_relobj_file::do_local_plt_offset): Rename from
4045 local_plt_offset.
4046 (Sized_relobj_file::do_local_symbol_value): New function.
4047 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4048 local_plt_offset.
4049 * output.cc (Output_data_got::Got_entry::write): Change object to
4050 Relobj. Use local_symbol_value.
4051 (Output_data_got::add_global_with_rel): Change rel_dyn to
4052 Output_data_reloc_generic*. Use add_global_generic.
4053 (Output_data_got::add_global_with_rela): Remove. Change all
4054 callers to use add_global_with_rel.
4055 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4056 Output_data_reloc_generic*. Use add_global_generic.
4057 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4058 callers to use add_global_pair_with_rel.
4059 (Output_data_got::add_local): Change object to Relobj*.
4060 (Output_data_got::add_local_plt): Likewise.
4061 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4062 change rel_dyn to Output_data_reloc_generic*. Use
4063 add_local_generic.
4064 (Output_data_got::add_local_with_rela): Remove. Change all
4065 callers to use all_local_with_rel.
4066 (Output_data_got::add_local_pair_with_rel): Change object to
4067 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4068 add_output_section_generic.
4069 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4070 callers to use add_local_pair_with_rel.
4071 (Output_data_got::reserve_local): Change object to Relobj*.
4072 * output.h: (class Output_data_reloc_generic): Add pure virtual
4073 declarations for add_global_generic, add_local_generic,
4074 add_output_section_generic.
4075 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4076 functions for Output_data_reloc_generic. Update declarations for
4077 changes listed in output.cc.
4078 (class Output_data_got): Change template parameter to got_size.
4079 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4080 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4081 function.
4082 (Sized_relobj_incr::do_local_plt_offset): New function.
4083 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4084 add_global_generic.
4085
76677ad0
CC
40862011-12-17 Cary Coutant <ccoutant@google.com>
4087
4088 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4089 * resolve.cc (Symbol_table::resolve): Likewise.
4090 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4091 arrays.
4092 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4093
8b8dd8d5
ILT
40942011-12-16 Ian Lance Taylor <iant@google.com>
4095
4096 * output.h (Output_data_reloc_generic::add): Only call
4097 add_dynamic_reloc if this is a dynamic reloc section.
4098
d55525b9
L
40992011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4100
4101 PR gold/13505
4102 * target-reloc.h (apply_relocation): Replace <64, false> with
4103 <size, big_endian>.
4104
ff81c7c1
NC
41052011-11-25 Nick Clifton <nickc@redhat.com>
4106
4107 * po/it.po: New Italian translation.
4108
628f39be
SA
41092011-11-17 Sterling Augustine <saugustine@google.com>
4110
4111 * script.cc (script_include_directive): Implement.
4112 (read_script_file): New local variables name and search_path. Update
4113 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4114 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4115 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4116
98ef3ea4
SA
41172011-11-11 Sterling Augustine <saugustine@google.com>
4118
4119 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4120 (file_or_sections_cmd): Likewise.
4121
f4a8b6d7
DK
41222011-11-11 Doug Kwan <dougkwan@google.com>
4123
4124 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4125 if --just-symbols is given.
4126
29ab395d
DK
41272011-11-10 Doug Kwan <dougkwan@google.com>
4128
4129 PR gold/13362
4130 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4131 when processing data relocs.
4132 * reloc.h (Relocate_functions::rel_unaligned): New method.
4133 (Relocate_functions::pcrel_unaligned): Ditto.
4134 (Relocate_functions::rel32_unaligned): Ditto.
4135 (Relocate_functions::pcrel32_unaligned): Ditto.
4136
2c339f71
DK
41372011-11-09 Doug Kwan <dougkwan@google.com>
4138
4139 PR gold/13362
4140 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4141 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4142 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4143 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4144 (Relocate_functions::rel_unaligned): New.
4145 (Relocate_functions::rel32_unaligned): New.
4146 * target-reloc.h (relocate_for_relocatable): Add code to handle
4147 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4148 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4149 arm_unaligned_reloc_r): New targets.
4150 * testsuite/Makefile.in: Regenerate.
4151 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4152 linking.
4153
3f3cddf1
ILT
41542011-11-02 Ian Lance Taylor <iant@google.com>
4155
4156 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4157 NATIVE_LINKER.
4158 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4159 * options.cc (General_options::finalize): Use library search path
4160 from configure script if specified. If not native and no sysroot,
4161 only search TOOLLIBDIR.
4162 * options.h (Search_directory::Search_directory): Change name to
4163 const std::string&.
4164 (General_options::add_to_library_path_with_sysroot): Change arg to
4165 const std::string&.
4166 * configure, Makefile.in, config.in: Rebuild.
4167
a8e2273b
ILT
41682011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4169
4170 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4171 we are working around the ARM1176 Erratum.
4172 * options.h (General_options::fix_arm1176): Add option.
4173 * testsuite/Makefile.am: Add testcases, and keep current ones
4174 working.
4175 * testsuite/Makefile.in: Regenerate.
4176 * testsuite/arm_fix_1176.s: New file.
4177 * testsuite/arm_fix_1176.sh: Likewise.
4178
cd6eab1c
ILT
41792011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4180
4181 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4182 may_use_blx_.
4183 (Target_arm::may_use_blx): Remove method.
4184 (Target_arm::set_may_use_blx): Likewise.
4185 (Target_arm::may_use_v4t_interworking): New method.
4186 (Target_arm::may_use_v5t_interworking): Likewise.
4187 (Target_arm::may_use_blx_): Remove member variable.
4188 (Arm_relocate_functions::arm_branch_common): Check for v5T
4189 interworking.
4190 (Arm_relocate_functions::thumb_branch_common): Likewise.
4191 (Reloc_stub::stub_type_for_reloc): Likewise.
4192 (Target_arm::do_finalize_sections): Correct interworking checks.
4193 * testsuite/Makefile.am: Add new tests.
4194 * testsuite/Makefile.in: Regenerate.
4195 * testsuite/arm_farcall_arm_arm.s: New test.
4196 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4197 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4198 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4199 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4200 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4201 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4202 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4203
286adcf4
CC
42042011-10-31 Cary Coutant <ccoutant@google.com>
4205
4206 PR gold/13023
4207 * expression.cc (Expression::eval_with_dot): Add
4208 is_section_dot_assignment parameter.
4209 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4210 absolute and assigning to dot within a section.
4211 * script-sections.cc
4212 (Output_section_element_assignment::set_section_addresses): Pass
4213 dot_section to set_if_absolute.
4214 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4215 as is_section_dot_assignment flag to eval_with_dot.
4216 (Output_section_element_dot_assignment::set_section_addresses):
4217 Likewise.
4218 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4219 parameter. Also set value if relative to dot_section; set the
4220 symbol's output_section.
4221 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4222 parameter. Adjust all callers.
4223 (Expression::eval_maybe_dot): Likewise.
4224 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4225 Adjust all callers.
4226 * testsuite/script_test_2.t: Test assignment of an absolute value
4227 to dot within an output section element.
4228
9634ed06
CC
42292011-10-31 Cary Coutant <ccoutant@google.com>
4230
4231 * options.h (class General_options): Add --[no-]gnu-unique options.
4232 * symtab.cc (Symbol_table::sized_write_globals): Convert
4233 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4234
de4101c7
CC
42352011-10-31 Cary Coutant <ccoutant@google.com>
4236
4237 PR gold/13359
4238 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4239 unnecessary assertion.
4240 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4241
7257cc92
ST
42422011-10-31 Sriraman Tallam <tmsriram@google.com>
4243
4244 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4245 gc_mark_symbol.
4246 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4247 gc_mark_symbol.
4248 Change to just keep the section associated with symbol.
4249 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4250 they are externally visible and --export-dynamic is turned on.
4251 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4252
bfc34b3f
ILT
42532011-10-19 Ian Lance Taylor <iant@google.com>
4254
4255 PR gold/13163
4256 * script-sections.cc
4257 (Output_section_element_dot_assignment::needs_output_section): New
4258 function.
4259
ea0d8c47
ILT
42602011-10-19 Ian Lance Taylor <iant@google.com>
4261
4262 PR gold/13204
4263 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4264 --section-start option was seen.
4265 * options.h (General_options::any_section_start): New function.
4266
abd242a9
DM
42672011-10-18 David S. Miller <davem@davemloft.net>
4268
4269 PR binutils/13301
4270 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4271 member to track relocation locations that have moved during TLS
4272 reloc optimizations.
4273 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4274 (Target_sparc::Relocate::relocate): Adjust view down by 4
4275 bytes if it matches reloc_adjust_addr_.
4276 (Target_sparc::Relocate::relocate_tls): Always move the
4277 __tls_get_addr call delay slot instruction forward 4 bytes when
4278 performing relaxation.
4279
bab9090f
CC
42802011-10-18 Cary Coutant <ccoutant@google.com>
4281
4282 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4283 (Output_file::map_no_anonymous): Check for non-zero
4284 return code from posix_fallocate.
4285
f7c5b166
CC
42862011-10-17 Cary Coutant <ccoutant@google.com>
4287
4288 PR gold/13245
4289 * plugin.cc (is_visible_from_outside): Check for symbols
4290 referenced from dynamic objects.
4291 * resolve.cc (Symbol_table::resolve): Don't count references
4292 from dynamic objects as references from real ELF files.
4293 * testsuite/plugin_test_2.sh: Adjust expected result.
4294
b490c0bb
CC
42952011-10-17 Cary Coutant <ccoutant@google.com>
4296
4297 * gold.cc: Include timer.h.
4298 (queue_middle_tasks): Stamp time.
4299 (queue_final_tasks): Likewise.
4300 * main.cc (main): Store timer in parameters. Print timers
4301 for each pass.
4302 * parameters.cc (Parameters::Parameters): Initialize timer_.
4303 (Parameters::set_timer): New function.
4304 (set_parameters_timer): New function.
4305 * parameters.h (Parameters::set_timer): New function.
4306 (Parameters::timer): New function.
4307 (Parameters::timer_): New data member.
4308 (set_parameters_timer): New function.
4309 * timer.cc (Timer::stamp): New function.
4310 (Timer::get_pass_time): New function.
4311 * timer.h (Timer::stamp): New function.
4312 (Timer::get_pass_time): New function.
4313 (Timer::pass_times_): New data member.
4314
f475cf7b
CC
43152011-10-17 Cary Coutant <ccoutant@google.com>
4316
4317 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4318 task for members of lib groups.
4319
cdd7e244
CC
43202011-10-17 Cary Coutant <ccoutant@google.com>
4321
4322 PR gold/13288
4f95c8b4 4323 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4324 (File_read::make_view): Move bounds check (replace with assert)...
4325 (File_read::find_or_make_view): ... to here.
4326
dfb45471
CC
43272011-10-12 Cary Coutant <ccoutant@google.com>
4328
4f95c8b4 4329 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4330 ::read returns less than requested size.
4331
53bbcc1b
CC
43322011-10-10 Cary Coutant <ccoutant@google.com>
4333
4f95c8b4 4334 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4335 Initialize defined_count_.
4336 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4337 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4338 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4339 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4340 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4341 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4342 member.
4343 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4344 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4345 Return zeroes instead of internal error.
4346
397b129b
CC
43472011-10-10 Cary Coutant <ccoutant@google.com>
4348
4349 PR gold/13249
4f95c8b4 4350 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4351 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4352 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4353 (Output_reloc::type_): Adjust size of bit field.
4354 (Output_reloc::use_plt_offset_): New bit field.
4355 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4356 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4357 flag. Adjust all callers.
4f95c8b4 4358 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4359 creating RELATIVE relocations.
4360
d5698657
NC
43612011-10-10 Nick Clifton <nickc@redhat.com>
4362
4363 * po/es.po: Updated Spanish translation.
4364 * po/fi.po: Updated Finnish translation.
4365
6a59a5c2
DN
43662011-10-03 Diego Novillo <dnovillo@google.com>
4367
4368 * options.cc (parse_uint): Fix dereference of RETVAL.
4369
f0558624
ST
43702011-09-29 Sriraman Tallam <tmsriram@google.com>
4371
4372 * layout.h (section_order_map_): New member.
4373 (get_section_order_map): New member function.
4374 * output.cc (Output_section::add_input_section): Check for patterns
4375 only when --section-ordering-file is specified.
4376 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4377 output_sections have been formed.
4378 * layout.cc (Layout_Layout): Initialize section_order_map_.
4379 * plugin.cc (update_section_order): Store order in order_map. Do not
4380 update the order.
4381 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4382 * testsuite/Makefile.in: Regenerate.
4383 * testsuite/plugin_section_order.c: New file.
4384 * testsuite/plugin_final_layout.cc: New file.
4385 * testsuite/plugin_final_layout.sh: New file.
4386
a7dac153
CC
43872011-09-29 Cary Coutant <ccoutant@google.com>
4388
4f95c8b4 4389 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4390 Check for NULL.
4f95c8b4 4391 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4392 symbols during incremental update.
4393 (Symbol_table::add_from_dynobj): Likewise.
4394
eebd87a5
ILT
43952011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4396 Ian Lance Taylor <iant@google.com>
4397
4398 * symtab.cc (Symbol_table::define_special_symbol): Always
4399 canonicalize version string.
4400
403a3331
CC
44012011-09-26 Cary Coutant <ccoutant@google.com>
4402
4f95c8b4
CC
4403 * gold.cc (queue_initial_tasks): Move option checks ...
4404 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4405 some options; make others fatal.
4406
235061c2
CC
44072011-09-26 Cary Coutant <ccoutant@google.com>
4408
4409 gcc PR lto/47247
4410 * plugin.cc (get_symbols_v2): New function.
4411 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4412 (is_referenced_from_outside): New function.
4413 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4414 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4415 (get_symbols): Pass version parameter.
4416 (get_symbols_v2): New function.
4417 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4418 parameter.
4419 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4420 (onload): Add LDPT_GET_SYMBOLS_V2.
4421 (all_symbols_read_hook): Use get_symbols_v2; check for
4422 LDPR_PREVAILING_DEF_IRONLY_EXP.
4423 * testsuite/plugin_test_3.sh: Update expected results.
4424
dc87f620
ILT
44252011-09-23 Simon Baldwin <simonb@google.com>
4426
4427 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4428 configuration options.
4429 * configure: Regenerate.
4430 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4431 * Makefile.in: Regenerate.
4432 * testsuite/Makefile.in: Regenerate.
4433
a8279f82
ST
44342011-09-19 Sriraman Tallam <tmsriram@google.com>
4435
4436 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4437
0c9350c8
CC
44382011-09-19 Cary Coutant <ccoutant@google.com>
4439
4440 * incremental.cc (can_incremental_update): Fix typo in comment.
4441 * incremental.h (can_incremental_update): Likewise.
4442
aa06ae28
CC
44432011-09-18 Cary Coutant <ccoutant@google.com>
4444
4445 * incremental.cc (can_incremental_update): New function.
4446 * incremental.h (can_incremental_update): New function.
4447 * layout.cc (Layout::init_fixed_output_section): Call it.
4448 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4449 * object.cc (Sized_relobj_file::do_layout): Call
4450 can_incremental_update.
4451
ebb300b2
CC
44522011-09-13 Cary Coutant <ccoutant@google.com>
4453
4454 * configure.ac: Check for glibc support for gnu_indirect_function
4455 support with static linking, setting automake conditional
4456 IFUNC_STATIC.
4457 * Makefile.in: Regenerate.
4458 * configure: Regenerate.
4459
4460 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4461 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4462 for IFUNC_STATIC.
4463 * testsuite/Makefile.in: Regenerate.
4464
1206d0d5
CC
44652011-09-13 Cary Coutant <ccoutant@google.com>
4466
4467 * incremental.cc (Sized_relobj_incr::do_layout): Call
4468 report_comdat_group for kept comdat sections.
4469 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4470 * testsuite/Makefile.in: Regenerate.
4471 * testsuite/incr_comdat_test_1.cc: New source file.
4472 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4473 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4474 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4475
40b29874
ILT
44762011-09-13 Ian Lance Taylor <iant@google.com>
4477
4478 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4479 variable external_symbols_offset.
4480
1b045aac
ILT
44812011-09-12 Ian Lance Taylor <iant@google.com>
4482
4483 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4484 triggered if object has no symbols.
4485
24c6c55a
DM
44862011-09-09 David S. Miller <davem@davemloft.net>
4487
4488 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4489 (Output_fill_debug_line::do_write): Likewise.
4490
66570254
CC
44912011-08-29 Cary Coutant <ccoutant@google.com>
4492
4493 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4494 casts to match formatting specs.
4495 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4496
8ea8cd50
CC
44972011-08-26 Cary Coutant <ccoutant@google.com>
4498
4499 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4500 remaining hole size when allocating.
4501 (Layout::make_output_section): Set fill methods for debug sections.
4502 * layout.h (Free_list::Free_list_node): Move from private to
4503 public.
4504 (Free_list::set_min_hole_size): New function.
4505 (Free_list::begin, Free_list::end): New functions.
4506 (Free_list::min_hole_): New data member.
4507 * output.cc: Include dwarf.h.
4508 (Output_fill_debug_info::do_minimum_hole_size): New function.
4509 (Output_fill_debug_info::do_write): New function.
4510 (Output_fill_debug_line::do_minimum_hole_size): New function.
4511 (Output_fill_debug_line::do_write): New function.
4512 (Output_section::Output_section): Initialize new data member.
4513 (Output_section::set_final_data_size): Ensure patch space is larger
4514 than minimum hole size.
4515 (Output_section::do_write): Fill holes in debug sections.
4516 * output.h (Output_fill): New class.
4517 (Output_fill_debug_info): New class.
4518 (Output_fill_debug_line): New class.
4519 (Output_section::set_free_space_fill): New function.
4520 (Output_section::free_space_fill_): New data member.
4521 * testsuite/Makefile.am (incremental_test_3): Add
4522 --incremental-patch option.
4523 (incremental_test_4): Likewise.
4524 (incremental_test_5): Likewise.
4525 (incremental_test_6): Likewise.
4526 (incremental_copy_test): Likewise.
4527 (incremental_common_test_1): Likewise.
4528 * testsuite/Makefile.in: Regenerate.
4529
7cf80422
NC
45302011-08-26 Nick Clifton <nickc@redhat.com>
4531
4532 * po/es.po: Updated Spanish translation.
4533
c3f7b0e5
CC
45342011-08-01 Cary Coutant <ccoutant@google.com>
4535
4536 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4537 * gold/testsuite/Makefile.in: Regenerate.
4538 * gold/testsuite/justsyms_exec.c: New source file.
4539 * gold/testsuite/justsyms_lib.c: New source file.
4540
9590bf25
CC
45412011-08-01 Cary Coutant <ccoutant@google.com>
4542
4543 * layout.cc (Layout::set_segment_offsets): Don't realign text
4544 segment if -Ttext was specified.
4545 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4546 file type.
4547 * object.h (Sized_relobj_file::e_type): New function.
4548 (Sized_relobj_file::e_type_): New data member.
4549 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4550 base address for ET_EXEC files.
4551 * target.cc (Target::do_make_elf_object_implementation): Allow
4552 ET_EXEC files with --just-symbols option.
4553
dcd8d12e
CC
45542011-07-28 Cary Coutant <ccoutant@google.com>
4555
4556 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4557 Add thread_number parameter.
4558 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4559 * workqueue-threads.cc
4560 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4561 current thread if its thread number is greater than desired thread
4562 count.
4563 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4564 Add thread_number parameter.
4565 (Workqueue::should_cancel_thread): Likewise.
4566 (Workqueue::find_runnable_or_wait): Pass thread_number to
4567 should_cancel_thread.
4568 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4569 parameter.
4570
804eb480
ST
45712011-07-22 Sriraman Tallam <tmsriram@google.com>
4572
4573 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4574 only after checking if it cannot be forced local.
4575 * symtab.h (is_externally_visible): Check if the symbol is not forced
4576 local.
4577
f1ddb600
ILT
45782011-07-15 Ian Lance Taylor <iant@google.com>
4579
4580 * options.h (class General_options): Add --print-output-format.
4581 Move -EL next to -EB, for better --help output.
4582 * target-select.cc: Include <cstdio>, "options.h", and
4583 "parameters.h".
4584 (Target_selector::do_target_bfd_name): New function.
4585 (print_output_format): New function.
4586 * target-select.h (class Target_selector): Update declarations.
4587 (Target_selector::target_bfd_name): New function.
4588 (print_output_format): Declare.
4589 * main.cc: Include "target-select.h".
4590 (main): Handle --print-output-format.
4591 * gold.cc: Include "target-select.h".
4592 (queue_initial_tasks): Handle --print-output-format when there are
4593 no input files.
4594 * parameters.cc (parameters_force_valid_target): Give a better
4595 error message if -EB/-EL does not match target.
4596 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4597 function.
4598
7d172687
ILT
45992011-07-15 Ian Lance Taylor <iant@google.com>
4600
4601 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4602 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4603 (Output_data_plt_i386::do_write): Write address of .dynamic
4604 section to first entry in .got.plt section.
4605 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4606 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4607 Initialize layout_.
4608 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4609 section to first entry in .got.plt section.
4610 * layout.h (Layout::dynamic_section): New function.
4611
e9552f7e
ST
46122011-07-13 Sriraman Tallam <tmsriram@google.com>
4613
4614 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4615 to claim_file call.
4616 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4617 input_section_position_, and input_section_glob_.
4618 (read_layout_from_file): Call function section_ordering_specified.
4619 * layout.h (is_section_ordering_specified): New function.
4620 (section_ordering_specified): New function.
4621 (section_ordering_specified_): New boolean member.
4622 * main.cc(main): Call load_plugins after layout object is defined.
4623 * output.cc (Output_section::add_input_section): Use
4624 function section_ordering_specified to check if section ordering is
4625 needed.
4626 * output.cc (Output_section::add_relaxed_input_section): Use
4627 function section_ordering_specified to check if section ordering is
4628 needed.
4629 (Output_section::update_section_layout): New function.
4630 (Output_section::sort_attached_input_sections): Check if input section
4631 must be reordered.
4632 * output.h (Output_section::update_section_layout): New function.
4633 * plugin.cc (get_section_count): New function.
4634 (get_section_type): New function.
4635 (get_section_name): New function.
4636 (get_section_contents): New function.
4637 (update_section_order): New function.
58797674 4638 (allow_section_ordering): New function.
e9552f7e
ST
4639 (Plugin::load): Add the new interfaces to the transfer vector.
4640 (Plugin_manager::load_plugins): New parameter.
4641 (Plugin_manager::all_symbols_read): New parameter.
4642 (Plugin_manager::claim_file): New parameter. Save the elf object for
4643 unclaimed objects.
4644 (Plugin_manager::get_elf_object): New function.
4645 (Plugin_manager::get_view): Change to directly use the bool to check
4646 if get_view is called from claim_file_hook.
4647 * plugin.h (input_objects): New function
4648 (Plugin__manager::load_plugins): New parameter.
4649 (Plugin_manager::claim_file): New parameter.
4650 (Plugin_manager::get_elf_object): New function.
4651 (Plugin_manager::in_claim_file_handler): New function.
4652 (Plugin_manager::in_claim_file_handler_): New member.
4653 (layout): New function.
4654 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4655 handler with an extra parameter. Make the elf object before calling
4656 claim_file handler.
4657 * testsuite/plugin_test.c (get_section_count): New function pointer.
4658 (get_section_type): New function pointer.
4659 (get_section_name): New function pointer.
4660 (get_section_contents): New function pointer.
4661 (update_section_order): New function pointer.
4662 (allow_section_ordering): New function pointer.
4663 (onload): Check if the new interfaces exist.
4664
9446efde
ILT
46652011-07-13 Ian Lance Taylor <iant@google.com>
4666
4667 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4668 relro section.
4669 * x86_64.cc (Target_x86_64::got_section): Likewise.
4670 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4671 (relro_now_test_SOURCES): New variable.
4672 (relro_now_test_DEPENDENCIES): New variable.
4673 (relro_now_test_LDFLAGS): New variable.
4674 (relro_now_test_LDADD): New variable.
4675 (relro_now_test.so): New target.
4676 * testsuite/Makefile.in: Rebuild.
4677
07aa62f2
ILT
46782011-07-12 Ian Lance Taylor <iant@google.com>
4679
4680 PR gold/12980
4681 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4682 GLOB_DAT relocation rather than a RELATIVE relocation for a
4683 protected symbol when creating a shared library.
4684 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4685 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4686 * testsuite/protected_main_1.cc (main): Test that protected
4687 function has same address.
4688
e2153196
ILT
46892011-07-11 Ian Lance Taylor <iant@google.com>
4690
4691 PR gold/12979
4692 * options.h (class General_options): Add -Bgroup.
4693 * options.cc (General_options::finalize): If -Bgroup is set,
4694 default to --unresolved-symbols=report-all.
4695 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4696 * target-reloc.h (issue_undefined_symbol_error): Handle
4697 --unresolved-symbols=report-all.
4698
6daf5215
ILT
46992011-07-08 Ian Lance Taylor <iant@google.com>
4700
4701 PR gold/11985
4702 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4703 if linker script discards key sections.
4704 (Layout::create_dynamic_symtab): Likewise.
4705 (Layout::assign_local_dynsym_offsets): Likewise.
4706 (Layout::sized_create_version_sections): Likewise.
4707 (Layout::create_interp): Likewise.
4708 (Layout::finish_dynamic_section): Likewise.
4709 (Layout::set_dynamic_symbol_size): Likewise.
4710
beabb2c6
ILT
47112011-07-08 Ian Lance Taylor <iant@google.com>
4712
4713 PR gold/12386
4714 * options.h (class General_options): Add --unresolved-symbols.
4715 * target-reloc.h (issue_undefined_symbol_error): Check
4716 --unresolved-symbols. Add comments.
4717
9c16daf1
ILT
47182011-07-08 Ian Lance Taylor <iant@google.com>
4719
4720 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4721 expression more complex.
4722
191f1a2d
ILT
47232011-07-08 Ian Lance Taylor <iant@google.com>
4724
4725 PR gold/11317
4726 * target-reloc.h (issue_undefined_symbol_error): New inline
4727 function, broken out of relocate_section.
4728 (relocate_section): Call issue_undefined_symbol_error.
4729 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4730 there is no TLS segment if we are about to issue an undefined
4731 symbol error.
4732 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4733
62855347
ILT
47342011-07-08 Ian Lance Taylor <iant@google.com>
4735
4736 PR gold/12279
4737 * resolve.cc (Symbol_table::should_override): Add fromtype
4738 parameter. Change all callers. Give error when linking together
4739 TLS and non-TLS symbol.
4740 (Symbol_table::should_override_with_special): Add fromtype
4741 parameter. Change all callers.
4742 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4743 there is no TLS segment if we have reported some errors.
4744 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4745
67181c72
ILT
47462011-07-08 Ian Lance Taylor <iant@google.com>
4747
4748 PR gold/12372
4749 * target.h (Target::plt_address_for_global): New function.
4750 (Target::plt_address_for_local): New function.
4751 (Target::plt_section_for_global): Remove.
4752 (Target::plt_section_for_local): Remove.
4753 (Target::do_plt_address_for_global): New virtual function.
4754 (Target::do_plt_address_for_local): New virtual function.
4755 (Target::do_plt_section_for_global): Remove.
4756 (Target::do_plt_section_for_local): Remove.
4757 (Target::register_global_plt_entry): Add Symbol_table and Layout
4758 parameters.
4759 * output.cc (Output_data_got::Got_entry::write): Use
4760 plt_address_for_global and plt_address_for_local.
4761 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4762 address of output section.
4763 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4764 got_irelative_, and irelative_count_ fields. Update
4765 declarations.
4766 (Output_data_plt_i386::has_irelative_section): New function.
4767 (Output_data_plt_i386::entry_count): Add irelative_count_.
4768 (Output_data_plt_i386::set_final_data_size): Likewise.
4769 (class Target_i386): Add got_irelative_ and rel_irelative_
4770 fields. Update declarations.
4771 (Target_i386::Target_i386): Initialize new fields.
4772 (Target_i386::do_plt_address_for_global): New function replacing
4773 do_plt_section_for_global.
4774 (Target_i386::do_plt_address_for_local): New function replacing
4775 do_plt_section_for_local.
4776 (Target_i386::got_section): Create got_irelative_.
4777 (Target_i386::rel_irelative_section): New function.
4778 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4779 fields. Don't define __rel_iplt_{start,end}.
4780 (Output_data_plt_i386::add_entry): Add symtab and layout
4781 parameters. Change all callers. Use different PLT and GOT for
4782 IFUNC symbols.
4783 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4784 layout parameters. Change all callers. Use different PLT and
4785 GOT.
4786 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4787 (Output_data_plt_i386::rel_irelative): New function.
4788 (Output_data_plt_i386::address_for_global): New function.
4789 (Output_data_plt_i386::address_for_local): New function.
4790 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4791 IRELATIVE GOT when changing IFUNC GOT entries.
4792 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4793 reloc.
4794 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4795 if we didn't create an IRELATIVE GOT.
4796 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4797 plt_address_for_local.
4798 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4799 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4800 got_irelative_, and irelative_count_ fields. Update
4801 declarations.
4802 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4803 Initialize new fields. Remove symtab parameter. Change all
4804 callers.
4805 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4806 irelative_count_.
4807 (Output_data_plt_x86_64::has_irelative_section): New function.
4808 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4809 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4810 fields. Update declarations.
4811 (Target_x86_64::Target_x86_64): Initialize new fields.
4812 (Target_x86_64::do_plt_address_for_global): New function replacing
4813 do_plt_section_for_global.
4814 (Target_x86_64::do_plt_address_for_local): New function replacing
4815 do_plt_section_for_local.
4816 (Target_x86_64::got_section): Create got_irelative_.
4817 (Target_x86_64::rela_irelative_section): New function.
4818 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4819 all callers. Don't create __rel_iplt_{start,end}.
4820 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4821 parameters. Change all callers. Use different PLT and GOT for
4822 IFUNC symbols.
4823 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4824 layout parameters. Change all callers. Use different PLT and
4825 GOT.
4826 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4827 parameters. Change all callers. Use different PLT and GOT for
4828 IFUNC symbols.
4829 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4830 (Output_data_plt_x86_64::rela_irelative): New function.
4831 (Output_data_plt_x86_64::address_for_global): New function.
4832 (Output_data_plt_x86_64::address_for_local): New function.
4833 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4834 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4835 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4836 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4837 parameters.
4838 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4839 reloc.
4840 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4841 symbols if we didn't create an IRELATIVE GOT.
4842 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4843 plt_address_for_local.
4844 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4845 * testsuite/ifuncvar1.c: New test file.
4846 * testsuite/ifuncvar2.c: New test file.
4847 * testsuite/ifuncvar3.c: New test file.
4848 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4849 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4850 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4851 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4852 * testsuite/Makefile.in: Rebuild.
4853
33c15b45
CC
48542011-07-07 Cary Coutant <ccoutant@google.com>
4855
4856 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4857 (two_file_test_1_ndebug.o): Likewise.
4858 (two_file_test_1b_ndebug.o): Likewise.
4859 (two_file_test_2_ndebug.o): Likewise.
4860 (two_file_test_main_ndebug.o): Likewise.
4861 (incremental_test_2): Link with no-debug versions.
4862
f48b5fb7
CC
48632011-07-06 Cary Coutant <ccoutant@google.com>
4864
4865 * gold/incremental.cc
4866 (Output_section_incremental_inputs::write_info_blocks): Check for
4867 hidden and internal symbols.
4868
221597a5
CC
48692011-07-06 Cary Coutant <ccoutant@google.com>
4870
4871 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4872 Check disposition for startup file.
4873 (Incremental_inputs::report_command_line): Ignore
4874 --incremental-startup-unchanged option.
4875 * options.cc (General_options::parse_incremental_startup_unchanged):
4876 New function.
4877 (General_options::General_options): Initialize new data member.
4878 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4879 (General_options): Add --incremental-startup-unchanged option.
4880 (General_options::incremental_startup_disposition): New function.
4881 (General_options::incremental_startup_disposition_): New data member.
4882
e24719f6
CC
48832011-07-06 Cary Coutant <ccoutant@google.com>
4884
4885 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4886 input file index to Script_info ctor.
4887 (Sized_incremental_binary::do_file_has_changed): Find the
4888 command-line argument for files named in scripts.
4889 * incremental.h (Script_info::Script_info): New ctor
4890 with input file index.
4891 (Script_info::input_file_index): New function.
4892 (Script_info::input_file_index_): New data member.
4893 (Incremental_binary::get_library): Add const.
4894 (Incremental_binary::get_script_info): Add const.
4895 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4896 * testsuite/Makefile.am (incremental_test_5): New test case.
4897 (incremental_test_6): New test case.
4898 * testsuite/Makefile.in: Regenerate.
4899
8f7c81e8
CC
49002011-07-06 Cary Coutant <ccoutant@google.com>
4901
4902 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4903 debug output when command lines differ.
4904
9fbd3822
CC
49052011-07-06 Cary Coutant <ccoutant@google.com>
4906
4907 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4908 --incremental-patch option.
4909 * layout.cc (Free_list::allocate): Extend allocation beyond original
4910 end if enabled.
4911 (Layout::make_output_section): Mark sections that should get
4912 patch space.
4913 * options.cc (parse_percent): New function.
4914 * options.h (parse_percent): New function.
4915 (DEFINE_percent): New macro.
4916 (General_options): Add --incremental-patch option.
4917 * output.cc (Output_section::Output_section): Initialize new data
4918 members.
4919 (Output_section::add_input_section): Print section name when out
4920 of patch space.
4921 (Output_section::add_output_section_data): Likewise.
4922 (Output_section::set_final_data_size): Add patch space when
4923 doing --incremental-full.
4924 (Output_section::do_reset_address_and_file_offset): Remove patch
4925 space.
4926 (Output_segment::set_section_list_addresses): Print debug output
4927 only if --incremental-update.
4928 * output.h (Output_section::set_is_patch_space_allowed): New function.
4929 (Output_section::is_patch_space_allowed_): New data member.
4930 (Output_section::patch_space_): New data member.
4931 * parameters.cc (Parameters::incremental_full): New function.
4932 * parameters.h (Parameters::incremental_full): New function
4933 * testsuite/Makefile.am (incremental_test_2): Add test for
4934 --incremental-patch option.
4935 * testsuite/Makefile.in: Regenerate.
4936 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4937 (t18): Remove function body.
4938
f6cccc2c
DK
49392011-07-05 Doug Kwan <dougkwan@google.com>
4940
4941 PR gold/12771
4942 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4943 Arm_Address type for relocation result.
4944 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4945 overflow check.
4946 (Arm_relocate_functions::abs32): Use unaligned access.
4947 (Arm_relocate_functions::rel32): Ditto.
4948 (Arm_relocate_functions::prel31): Ditto.
4949 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4950 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4951 static data relocations.
4952 * testsuite/Makefile.in: Regnerate.
4953 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4954
28a13fec
ILT
49552011-07-05 Ian Lance Taylor <iant@google.com>
4956
4957 PR gold/12392
4958 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4959 symbols if necessary.
4960 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4961
24d47b34
ILT
49622011-07-05 Ian Lance Taylor <iant@google.com>
4963
4964 PR gold/12952
4965 * resolve.cc (Symbol::override_base_with_special): Simply override
4966 version with special symbol version, ignoring previous version.
4967
41f9cbbe
ILT
49682011-07-05 Ian Lance Taylor <iant@google.com>
4969
4970 * object.cc (Sized_relobj_file::include_section_group): Add
4971 information to comment about signature location.
4972
886288f1
ILT
49732011-07-02 Ian Lance Taylor <iant@google.com>
4974
4975 PR gold/12957
4976 * options.h (class General_options): Add -f and -F.
4977 * options.cc (General_options::finalize): Fatal error if -f/-F
4978 are used without -shared.
4979 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4980
ae3a6d4f
ILT
49812011-07-02 Ian Lance Taylor <iant@google.com>
4982
4983 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4984
21131061
ILT
49852011-07-01 Ian Lance Taylor <iant@google.com>
4986
4987 PR gold/12525
4988 PR gold/12952
4989 * resolve.cc (Symbol::override_base_with_special): Don't override
4990 the version if the overriding symbol has a different name.
4991 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4992 all callers. If we give an error about an undefined version,
4993 define the base version if necessary.
4994 * dynobj.h (class Versions): Update declaration.
4995 * testsuite/weak_alias_test_5.cc: New file.
4996 * testsuite/weak_alias_test.script: New file.
4997 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4998 and versioned_alias have the right value, and call t2.
4999 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5000 weak_alias_test_5.so.
5001 (weak_alias_test_LDADD): Likewise.
5002 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5003 * testsuite/Makefile.in: Rebuild.
5004
611062c0
ILT
50052011-07-01 Ian Lance Taylor <iant@google.com>
5006
5007 PR gold/12525
5008 * options.h (class General_options): Support -z notext.
5009 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5010 -Wl,-z,notext.
5011 (two_file_shared_nonpic.so): Likewise.
5012 (two_file_shared_mixed.so): Likewise.
5013 (two_file_shared_mixed_1.so): Likewise.
5014 (weak_undef_lib_nonpic.so): Likewise.
5015 (alt/weak_undef_lib_nonpic.so): Likewise.
5016 (tls_test_shared_nonpic.so): Likewise.
5017 * testsuite/Makefile.in: Rebuild.
5018
328c7c2f
ILT
50192011-07-01 Ian Lance Taylor <iant@google.com>
5020
5021 PR gold/12525
5022 * configure.ac: Test whether static linking works, setting
5023 the automake conditional HAVE_STATIC.
5024 * testsuite/Makefile.am: Disable tests using -static if
5025 HAVE_STATIC is not true.
5026 * configure, testsuite/Makefile.in: Rebuild.
5027
02d7cd44
ILT
50282011-07-01 Ian Lance Taylor <iant@google.com>
5029
5030 PR gold/12525
5031 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5032 Assert if we see DW_EH_PE_indirect.
5033 * target.h (Target::ehframe_datarel_base): New function.
5034 (Target::do_ehframe_datarel_base): New target function.
5035 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5036 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5037 function.
5038
07a60597
ILT
50392011-07-01 Ian Lance Taylor <iant@google.com>
5040
5041 PR gold/12571
5042 * options.h (class General_options): Add
5043 --ld-generated-unwind-info.
5044 * ehframe.cc (Fde::write): Add address parameter. Change all
5045 callers. If associated with PLT, fill in address and size.
5046 (Cie::set_output_offset): Only add merge mapping if there is an
5047 object.
5048 (Cie::write): Add address parameter. Change all callers.
5049 (Eh_frame::add_ehframe_for_plt): New function.
5050 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5051 input_offset_ fields into union u_, with new plt field.
5052 (Fde::Fde): Adjust for new union field.
5053 (Fde::Fde) [Output_data version]: New constructor.
5054 (Fde::add_mapping): Only add merge mapping if there is an object.
5055 (class Cie): Update declarations.
5056 (class Eh_frame): Declare add_ehframe_for_plt.
5057 * layout.cc (Layout::layout_eh_frame): Break out code into
5058 make_eh_frame_section, and call it.
5059 (Layout::make_eh_frame_section): New function.
5060 (Layout::add_eh_frame_for_plt): New function.
5061 * layout.h (class Layout): Update declarations.
5062 * merge.cc (Merge_map::add_mapping): Add assertion.
5063 * i386.cc: Include "dwarf.h".
5064 (class Output_data_plt_i386): Make first_plt_entry,
5065 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5066 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5067 and plt_eh_frame_fde.
5068 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5069 boundary. Call add_eh_frame_for_plt if appropriate.
5070 * x86_64.cc: Include "dwarf.h".
5071 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5072 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5073 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5074 and plt_eh_frame_fde.
5075 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5076 appropriate.
5077
14788a3f
ILT
50782011-06-29 Ian Lance Taylor <iant@google.com>
5079
5080 PR gold/12629
5081 * object.cc (Sized_relobj_file::layout_section): Change shdr
5082 parameter to be const.
5083 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5084 out of do_layout.
5085 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5086 appropriate. Call layout_eh_frame_section.
5087 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5088 sections.
5089 * object.h (class Sized_relobj_file): Update declarations.
5090
6c21fce1
ILT
50912011-06-29 Ian Lance Taylor <iant@google.com>
5092
37e41b03 5093 PR gold/12652
6c21fce1
ILT
5094 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5095 modifier.
5096 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5097
4d5e4e62
ILT
50982011-06-29 Ian Lance Taylor <iant@google.com>
5099
5100 PR gold/12675
5101 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5102 SHT_X86_64_UNWIND.
5103 * layout.cc (Layout::layout_eh_frame): Likewise.
5104
886f533a
ILT
51052011-06-29 Ian Lance Taylor <iant@google.com>
5106
5107 PR gold/12695
5108 * layout.cc (Layout::symtab_section_shndx): New function.
5109 * layout.h (class Layout): Declare symtab_section_shndx.
5110 * output.cc (Output_section::write_header): Call it.
5111
f3ae1b28
ILT
51122011-06-29 Ian Lance Taylor <iant@google.com>
5113
5114 PR gold/12818
5115 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5116 symbols which are not used in a relocation.
5117
aecf301f
ILT
51182011-06-28 Ian Lance Taylor <iant@google.com>
5119
5120 PR gold/12898
5121 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5122 script create indistinguishable segments.
5123 (Layout::set_segment_offsets): Use stable_sort when sorting
5124 segments. Pass this to Compare_segments constructor.
5125 * layout.h (class Layout): Make segment_precedes non-static.
5126 (class Compare_segments): Change from struct to class. Add
5127 layout_ field. Add constructor.
5128 * script-sections.cc
5129 (Script_sections::attach_sections_using_phdrs_clause): Rename
5130 local orphan to is_orphan. Don't report failure to put empty
5131 section in segment. On attachment failure, report name of
5132 section, and attach to first PT_LOAD segment.
5133
03ef7571
ILT
51342011-06-28 Ian Lance Taylor <iant@google.com>
5135
5136 PR gold/12934
5137 * target-select.cc (Target_selector::Target_selector): Add
5138 emulation parameter. Change all callers.
5139 (select_target_by_bfd_name): Rename from select_target_by_name.
5140 Change all callers.
5141 (select_target_by_emulation): New function.
5142 (supported_emulation_names): New function.
5143 * target-select.h (class Target_selector): Add emulation_ field.
5144 Update declarations.
5145 (Target_selector::recognize_by_bfd_name): Rename from
5146 recognize_by_name. Change all callers.
5147 (Target_selector::supported_bfd_names): Rename from
5148 supported_names. Change all callers.
5149 (Target_selector::recognize_by_emulation): New function.
5150 (Target_selector::supported_emulations): New function.
5151 (Target_selector::emulation): New function.
5152 (Target_selector::do_recognize_by_bfd_name): Rename from
5153 do_recognize_by_name. Change all callers.
5154 (Target_selector::do_supported_bfd_names): Rename from
5155 do_supported_names. Change all callers.
5156 (Target_selector::do_recognize_by_emulation): New function.
5157 (Target_selector::do_supported_emulations): New function.
5158 (select_target_by_bfd_name): Change name in declaration.
5159 (select_target_by_emulation): Declare.
5160 (supported_emulation_names): Declare.
5161 * parameters.cc (parameters_force_valid_target): Try to find
5162 target based on emulation from -m option.
5163 * options.h (class General_options): Change doc string for -m.
5164 * options.cc (help): Print emulations.
5165 (General_options::parse_V): Likewise.
5166 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5167 Add emulation parameter. Change all callers.
5168
200b2bb9
ILT
51692011-06-28 Ian Lance Taylor <iant@google.com>
5170
5171 * target.h (class Target): Add osabi_ field.
5172 (Target::osabi): New function.
5173 (Target::set_osabi): New function.
5174 (Target::Target): Initialize osabi_.
5175 (Target::do_adjust_elf_header): Make pure virtual.
5176 (Sized_target::do_adjust_elf_header): Declare.
5177 * target.cc (Sized_target::do_adjust_elf_header): New function.
5178 (class Sized_target): Instantiate all versions.
5179 * freebsd.h (class Target_freebsd): Remove.
5180 (Target_selector_freebsd::do_recognize): Call set_osabi on
5181 Target.
5182 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5183 (Target_selector_freebsd::set_osabi): Remove.
5184 * i386.cc (class Target_i386): Inherit from Sized_target rather
5185 than Target_freebsd.
5186 * x86_64.cc (class Target_x86_64): Likewise.
5187
b3ce541e
ILT
51882011-06-28 Ian Lance Taylor <iant@google.com>
5189
5190 * target.h (Target::can_check_for_function_pointers): Rewrite.
5191 Make non-virtual.
5192 (Target::can_icf_inline_merge_sections): Likewise.
5193 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5194 (Target::Target_info): Add can_icf_inline_merge_sections field.
5195 (Target::do_can_check_for_function_pointers): New virtual
5196 function.
5197 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5198 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5199 from can_check_for_function_pointers, move in file.
5200 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5201 section_may_have_icf_unsafe_poineters, move in file.
5202 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5203 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5204 Rename from can_check_for_function_pointers, move in file.
5205 (Target_i386::can_icf_inline_merge_sections): Remove.
5206 (Target_i386::i386_info): Initialize
5207 can_icf_inline_merge_sections.
5208 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5209 Initialize can_icf_inline_merge_sections.
5210 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5211 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5212 Rename from can_check_for_function_pointers, move in file.
5213 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5214 (Target_x86_64::x86_64_info): Initialize
5215 can_icf_inline_merge_sections.
5216 * testsuite/testfile.cc (Target_test::test_target_info):
5217 Likewise.
5218 * icf.cc (get_section_contents): Correct formatting.
5219
6d1c4efb
ILT
52202011-06-27 Ian Lance Taylor <iant@google.com>
5221
5222 * symtab.cc (Symbol::versioned_name): New function.
5223 (Symbol_table::add_to_final_symtab): Use versioned_name when
5224 appropriate.
5225 (Symbol_table::sized_write_symbol): Likewise.
5226 * symtab.h (class Symbol): Declare versioned_name.
5227 * stringpool.h (class Stringpool_template): Add variant of add
5228 which takes a std::basic_string.
5229 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5230 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5231 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5232 (ver_test_12.o): New target.
5233 * testsuite/Makefile.in: Rebuild.
5234
57eb9b50
DK
52352011-06-27 Doug Kwan <dougkwan@google.com>
5236
5237 * arm.cc (Arm_relocate_functions::thm_jump8,
5238 Arm_relocate_functions::thm_jump11): Use a wider signed
5239 type to compute offset.
5240 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5241 arm_thm_jump8.
5242 * testsuite/Makefile.in: Regenerate.
5243 * testsuite/arm_branch_in_range.sh: Check test results of
5244 arm_thm_jump11 and arm_thm_jump8.
5245 * testsuite/arm_thm_jump11.s: New test source file.
5246 * testsuite/arm_thm_jump11.t: New linker script.
5247 * testsuite/arm_thm_jump8.s: New test source file.
5248 * testsuite/arm_thm_jump8.t: New linker script.
5249
487b39df
ILT
52502011-06-24 Ian Lance Taylor <iant@google.com>
5251
5252 * layout.cc: Include "object.h".
5253 (ctors_sections_in_init_array): New static variable.
5254 (Layout::is_ctors_in_init_array): New function.
5255 (Layout::layout): Add entry to ctors_sections_in_init_array if
5256 appropriate.
5257 * layout.h (class Layout): Declare is_ctors_in_init_array.
5258 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5259 is_ctors_reverse_view is set.
5260 (Sized_relobj_file::write_sections): Add layout parameter. Change
5261 all callers. Set is_ctors_reverse_view field of View_size.
5262 (Sized_relobj_file::reverse_words): New function.
5263 * object.h (Sized_relobj_file::View_size): Add
5264 is_ctors_reverse_view field.
5265 (class Sized_relobj_file): Update declarations.
5266 * testsuite/initpri3.c: New test.
5267 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5268 initpri3b.
5269 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5270 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5271 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5272 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5273 * testsuite/Makefile.in: Rebuild.
5274
472076e4
CC
52752011-06-24 Cary Coutant <ccoutant@google.com>
5276
5277 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5278 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5279 (debug_msg_cdebug.err): New targets.
5280 * testsuite/Makefile.in: Regenerate.
5281 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5282 Fix checks for link with shared library.
5283
a60af0db
DK
52842011-06-24 Doug Kwan <dougkwan@google.com>
5285
5286 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5287 skip empty text sections.
5288 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5289
5393d741
ILT
52902011-06-22 Ian Lance Taylor <iant@google.com>
5291
5292 PR gold/12910
5293 * options.h (class General_options): Add --ctors-in-init-array.
5294 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5295 friends as SHT_PROGBITS for merging sections.
5296 (Layout::layout): Remove special handling of .init_array and
5297 friends. Don't sort if doing relocatable link. Sort for .ctors
5298 and .dtors if ctors_in_init_array.
5299 (Layout::make_output_section): Force correct section types for
5300 .init_array and friends. Don't sort if doing relocatable link,
5301 Don't sort .ctors and .dtors if ctors_in_init_array.
5302 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5303 (Layout::output_section_name): Add relobj parameter. Change all
5304 callers. Handle .ctors. and .dtors. in code rather than table.
5305 Handle .ctors and .dtors if ctors_in_init_array.
5306 (Layout::match_file_name): New function, moved from output.cc.
5307 * layout.h (class Layout): Update declarations.
5308 * output.cc: Include "layout.h".
5309 (Input_section_sort_entry::get_priority): New function.
5310 (Input_section_sort_entry::match_file_name): Just call
5311 Layout::match_file_name.
5312 (Output_section::Input_section_sort_init_fini_compare::operator()):
5313 Handle .ctors and .dtors. Sort by explicit priority rather than
5314 by name.
5315 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5316 * testsuite/initpri2.c: New test.
5317 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5318 (check_PROGRAMS): Add initpri2.
5319 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5320 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5321 * configure, testsuite/Makefile.in: Rebuild.
5322
e1f74f98
ILT
53232011-06-19 Ian Lance Taylor <iant@google.com>
5324
5325 PR gold/12880
5326 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5327 .interp section to a PT_INTERP segment even if we have seen a
5328 --dynamic-linker option. Don't do it if we have seen a PHDRS
5329 clause in a linker script.
5330 (Layout::finalize): Don't create a .interp section if we've
5331 already create a PT_INTERP segment.
5332 (Layout::create_interp): Always call choose_output_section (revert
5333 patch of 2011-06-17). Don't create PT_INTERP segment.
5334 * script-sections.cc
5335 (Script_sections::create_note_and_tls_segments): Add a .interp
5336 section to a PT_INTERP segment even if we have seen a
5337 --dynamic-linker option.
5338
766f91bb
ILT
53392011-06-18 Ian Lance Taylor <iant@google.com>
5340
5341 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5342 merely because a non-PT_LOAD segment has a dynamic reloc.
5343
0d212c3a
ILT
53442011-06-18 Ian Lance Taylor <iant@google.com>
5345
5346 * layout.cc (Layout::finish_dynamic_section): Don't create
5347 DT_FLAGS entry if not needed.
5348
911a5072
ILT
53492011-06-18 Ian Lance Taylor <iant@google.com>
5350
5351 PR gold/12745
5352 * layout.cc (Layout::layout_eh_frame): Correct handling of
5353 writable .eh_frame section.
5354
534b4e5f
ILT
53552011-06-17 Ian Lance Taylor <iant@google.com>
5356
5357 PR gold/12893
5358 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5359 symbol is redefined with the exact same object and value.
5360
10b4f102
ILT
53612011-06-17 Ian Lance Taylor <iant@google.com>
5362
5363 PR gold/12880
5364 * layout.h (class Layout): Add interp_segment_ field.
5365 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5366 (Layout::attach_allocated_section_to_segment): If making shared
5367 library, put .interp section in PT_INTERP segment.
5368 (Layout::finalize): Also call create_interp if -dynamic-linker
5369 option was used.
5370 (Layout::create_interp): Assert that there is no PT_INTERP
5371 segment. If not using a SECTIONS clause, use make_output_section.
5372 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5373 * script-sections.cc
5374 (Script_sections::create_note_and_tls_segments): If making shared
5375 library, put .interp section in PT_INTERP segment.
5376
a29b0dad
ILT
53772011-06-17 Ian Lance Taylor <iant@google.com>
5378
e588ea8d
ILT
5379 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5380 when making a shared library.
5381
53822011-06-17 Ian Lance Taylor <iant@google.com>
5383
5384 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5385 parameter. Change all callers. Don't issue warning about PC32
5386 against locally defined symbol.
a29b0dad 5387
9d3b0698
ILT
53882011-06-16 Ian Lance Taylor <iant@google.com>
5389
5390 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5391 occurs in same object.
5392
85b0f90c
AM
53932011-06-14 Alan Modra <amodra@gmail.com>
5394
5395 * po/POTFILES.in: Regenerate.
5396
a94907d9
ILT
53972011-06-09 Ian Lance Taylor <iant@google.com>
5398
5399 * script-sections.cc
5400 (Orphan_output_section::set_section_addresses): For a relocatable
5401 link set address to 0.
5402
4fb3a1c3
CC
54032011-06-09 Cary Coutant <ccoutant@google.com>
5404
5405 PR gold/12804
5406 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5407 used with --compress-debug-sections.
5408 * gold/object.cc (Sized_relobj_file::do_layout): Report
5409 uncompressed size of compressed input sections.
5410
61220854
CC
54112011-06-08 Cary Coutant <ccoutant@google.com>
5412
5413 PR gold/12804
5414 * testsuite/two_file_test_2_v1.cc: Change initialization of
5415 v2 to keep it in .data.
5416
e6455dfb
CC
54172011-06-07 Cary Coutant <ccoutant@google.com>
5418
5419 * common.cc (Symbol_table::do_allocate_commons_list): Call
5420 gold_fallback.
5421 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5422 (Errors::fallback): New function.
5423 (gold_fallback): New function.
5424 * errors.h (Errors::fallback): New function.
5425 * gold.cc (gold_exit): Change status parameter to enum; adjust
5426 all callers.
5427 (queue_initial_tasks): Call gold_fallback.
5428 * gold.h: Include cstdlib.
5429 (Exit_status): New enum type.
5430 (gold_exit): Change status parameter to enum.
5431 (gold_fallback): New function.
5432 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5433 (Layout::create_symtab_sections): Likewise.
5434 (Layout::create_shdrs): Likewise.
5435 * main.cc (main): Adjust call to gold_exit.
5436 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5437 (Output_data_got::add_got_entry_pair): Likewise.
5438 (Output_section::add_input_section): Likewise.
5439 (Output_section::add_output_section_data): Likewise.
5440 (Output_segment::set_section_list_addresses): Likewise.
5441 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5442
fb0e076f
CC
54432011-06-07 Cary Coutant <ccoutant@google.com>
5444
5445 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5446 for incremental links.
5447 * output.cc (Output_segment::set_section_list_addresses): Remove
5448 FIXME and test for TLS or BSS.
5449
a5ee4d5d
CC
54502011-06-07 Cary Coutant <ccoutant@google.com>
5451
5452 * testsuite/Makefile.am: Add incremental_copy_test,
5453 incremental_common_test_1.
5454 * testsuite/Makefile.in: Regenerate.
5455 * testsuite/common_test_1_v1.c: New source file.
5456 * testsuite/common_test_1_v2.c: New source file.
5457 * testsuite/copy_test_v1.cc: New source file.
5458
5146f448
CC
54592011-06-07 Cary Coutant <ccoutant@google.com>
5460
5461 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5462 update, allocate common from bss section's free list.
5463 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5464 linker-defined symbols.
5465 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5466 Skip GOT and PLT entries that are no longer referenced.
5467 (Output_section_incremental_inputs::write_info_blocks): Mark
5468 linker-defined symbols.
5469 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5470 * output.cc (Output_section::allocate): New function.
5471 * output.h (Output_section::allocate): New function.
5472 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5473 linker-defined symbols.
5474 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5475 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5476 (Symbol::init_base_output_data): Likewise.
5477 (Symbol::init_base_output_segment): Likewise.
5478 (Symbol::init_base_constant): Likewise.
5479 (Sized_symbol::init_output_data): Likewise.
5480 (Sized_symbol::init_output_segment): Likewise.
5481 (Sized_symbol::init_constant): Likewise.
5482 (Symbol_table::do_define_in_output_data): Likewise.
5483 (Symbol_table::do_define_in_output_segment): Likewise.
5484 (Symbol_table::do_define_as_constant): Likewise.
5485 * symtab.h (Symbol::is_predefined): New function.
5486 (Symbol::init_base_output_data): Add is_predefined parameter.
5487 (Symbol::init_base_output_segment): Likewise.
5488 (Symbol::init_base_constant): Likewise.
5489 (Symbol::is_predefined_): New data member.
5490 (Sized_symbol::init_output_data): Add is_predefined parameter.
5491 (Sized_symbol::init_output_segment): Likewise.
5492 (Sized_symbol::init_constant): Likewise.
5493 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5494
26d3c67d
CC
54952011-06-07 Cary Coutant <ccoutant@google.com>
5496
5497 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5498 instead of emit_copy_reloc.
5499 (Copy_relocs::emit_copy_reloc): Refactor.
5500 (Copy_relocs::make_copy_reloc): New function.
5501 (Copy_relocs::add_copy_reloc): Remove.
5502 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5503 section.
5504 (Copy_relocs::make_copy_reloc): New function.
5505 (Copy_relocs::add_copy_reloc): Remove.
5506 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5507 unchanged input files.
5508 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5509 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5510 Reserve BSS space for COPY relocations.
5511 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5512 (Output_section_incremental_inputs::write_info_blocks): Record
5513 whether a symbol is copied from a shared object.
5514 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5515 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5516 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5517 (Incremental_input_entry_reader::get_output_symbol_index): Add
5518 is_copy parameter.
5519 (Incremental_binary::emit_copy_relocs): New function.
5520 (Incremental_binary::do_emit_copy_relocs): New function.
5521 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5522 new data member.
5523 (Sized_incremental_binary::add_copy_reloc): New function.
5524 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5525 (Sized_incremental_binary::Copy_reloc): New struct.
5526 (Sized_incremental_binary::Copy_relocs): New typedef.
5527 (Sized_incremental_binary::copy_relocs_): New data member.
5528 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5529 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5530 * target.h (Sized_target::emit_copy_reloc): New function.
5531 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5532
7cdb37d9
CC
55332011-06-02 Cary Coutant <ccoutant@google.com>
5534
5535 PR gold/12163
5536 * gold/archive.cc (Archive::Archive): Initialize new data member.
5537 (Archive::include_all_members): Return if archive has already been
5538 included.
5539 * gold/archive.h (Archive::include_all_members_): New data member.
5540
cc643b88
NC
55412011-06-02 Nick Clifton <nickc@redhat.com>
5542
5543 * dynobj.h: Fix spelling mistake in comment.
5544 * output.cc: Likewise.
5545
f62a3ca7 55462011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5547 Asier Llano
f62a3ca7
DK
5548
5549 PR gold/12826
cc643b88 5550 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5551 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5552 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5553 redundant arm_exidx_test.so.
5554 * testsuite/Makefile.in: Regenerate.
5555 (check_SCRIPTS): Add pr12826.sh
5556 (check_DATA): Add pr12826.stdout
5557 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5558 * testsuite/pr12826.sh: New file.
5559 * testsuite/pr12826_1.s: Ditto.
5560 * testsuite/pr12826_1.s: Ditto.
5561
8dbe1edc
ILT
55622011-05-30 Ian Lance Taylor <iant@google.com>
5563
5564 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5565 sections.
5566
c49875be
ILT
55672011-05-29 Ian Lance Taylor <iant@google.com>
5568
5569 PR gold/12804
5570 * testsuite/Makefile.am: Use different file name for two_file_test
5571 temporary file for each incremental test.
5572 * testsuite/Makefile.in: Rebuild.
5573
69d53f7a
ILT
55742011-05-29 Ian Lance Taylor <iant@google.com>
5575
5576 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5577 binary input file is empty.
5578
41d0ab5f
ILT
55792011-05-27 Ian Lance Taylor <iant@google.com>
5580
5581 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5582 (ver_test_9.so): Likewise.
5583 * testsuite/Makefile.in: Rebuild.
5584
89d8a36b
CC
55852011-05-26 Cary Coutant <ccoutant@google.com>
5586
5587 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5588 * incremental.cc (Incremental_inputs::report_input_section): Fix
5589 comment, indentation.
5590 (Incremental_inputs::report_comdat_group): New function.
5591 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5592 of data for incremental input file entry.
5593 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5594 group count, COMDAT group signatures.
5595 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5596 an unchanged input file.
5597 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5598 Initialize new data member.
5599 (Incremental_object_entry::add_comdat_group): New function.
5600 (Incremental_object_entry::get_comdat_group_count): New function.
5601 (Incremental_object_entry::get_comdat_signature_key): New function.
5602 (Incremental_object_entry::groups_): New data member.
5603 (Incremental_inputs::report_comdat_group): New function.
5604 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5605 data for incremental input file entry.
5606 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5607 (Incremental_input_entry_reader::get_input_section): Adjust size of
5608 data for incremental input file entry.
5609 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5610 (Incremental_input_entry_reader::get_comdat_group_signature): New
5611 function.
5612 * object.cc (Sized_relobj::include_section_group): Report kept
5613 COMDAT groups for incremental links.
5614
1706a06f
ILT
56152011-05-24 David Meyer <pdox@google.com>
5616
5617 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5618 with name parameter. Add found_name parameter.
5619 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5620 * dirsearch.h (class Dirsearch): Update declaration.
5621
a10ae760
ILT
56222011-05-24 Ian Lance Taylor <iant@google.com>
5623
5624 * archive.cc (Library_base::should_include_member): Pull in object
5625 from archive if it defines the entry symbol.
5626 * parameters.cc (Parameters::entry): New function.
5627 * parameters.h (class Parameters): Declare entry.
5628 * output.h (class Output_file_header): Remove entry_ field.
5629 * output.cc (Output_file_header::Output_file_header): Remove entry
5630 parameter. Change all callers.
5631 (Output_file_header::entry): Use parameters->entry.
5632 * gold.cc (queue_middle_tasks): Likewise.
5633 * plugin.cc (Plugin_hook::run): Likewise.
5634
aa92d6ed
CC
56352011-05-24 Cary Coutant <ccoutant@google.com>
5636
5637 * gold.cc (queue_initial_tasks): Pass incremental base filename
5638 to Output_file::open_base_file; don't print error message.
5639 * incremental-dump.cc (main): Adjust call to
5640 Output_file::open_for_modification.
5641 * incremental-dump.cc (main): Likewise.
5642 * incremental.cc (Incremental_inputs::report_command_line):
5643 Ignore --incremental-base option when comparing command lines.
5644 Ignore parameter when given as separate argument.
5645 * options.h (class General_options): Add --incremental-base.
5646 * output.cc (Output_file::Output_file):
5647 (Output_file::open_base_file): Add base_name and writable parameters;
5648 read base file into new file; print error message here.
5649 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5650 callers.
5651 * output.h (Output_file::open_for_modification): Rename to...
5652 (Output_file::open_base_file): ...this; add base_name and
5653 writable parameters; adjust all callers.
5654 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5655 callers.
5656 * testsuite/Makefile.am (incremental_test_4): Test
5657 --incremental-base.
5658 * testsuite/Makefile.in: Regenerate.
5659
2eedd706
CC
56602011-05-24 Cary Coutant <ccoutant@google.com>
5661
5662 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5663 incremental_test_4.
5664 * testsuite/Makefile.in: Regenerate.
5665 * testsuite/two_file_test_1_v1.cc: New test source file.
5666 * testsuite/two_file_test_1b_v1.cc: New test source file.
5667 * testsuite/two_file_test_2_v1.cc: New test source file.
5668
0f1c85a6
CC
56692011-05-24 Cary Coutant <ccoutant@google.com>
5670
5671 * dynobj.h (Dynobj::do_dynobj): New function.
5672 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5673 flag and soname for shared objects.
5674 * incremental.cc (Incremental_inputs::report_object): Make
5675 either Incremental_object_entry or Incremental_dynobj_entry; add
5676 soname to string table.
5677 (Incremental_inputs::report_input_section): Add assertion.
5678 (Output_section_incremental_inputs::set_final_data_size): Adjust
5679 type of input file entry for shared libraries; adjust size of
5680 shared library info entry.
5681 (Output_section_incremental_inputs::write_input_files): Write
5682 as_needed flag for shared libraries.
5683 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5684 of input file entry for shared libraries; write soname.
5685 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5686 soname from incremental info.
5687 * incremental.h (enum Incremental_input_flags): Add
5688 INCREMENTAL_INPUT_AS_NEEDED.
5689 (Incremental_input_entry::Incremental_input_entry): Initialize new
5690 data member.
5691 (Incremental_input_entry::set_as_needed): New function.
5692 (Incremental_input_entry::as_needed): New function.
5693 (Incremental_input_entry::do_dynobj_entry): New function.
5694 (Incremental_input_entry::as_needed_): New data member.
5695 (Incremental_object_entry::Incremental_object_entry): Don't check
5696 for shared library.
5697 (Incremental_object_entry::do_type): Likewise.
5698 (class Incremental_dynobj_entry): New class.
5699 (Incremental_input_entry_reader::as_needed): New function.
5700 (Incremental_input_entry_reader::get_soname): New function.
5701 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5702 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5703 size of shared library info entry.
58797674 5704 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5705 incremental link when adding DT_NEEDED entries.
5706 * object.h (Object::Object): Initialize new data member.
5707 (Object::dynobj): New function.
5708 (Object::set_as_needed): New function.
5709 (Object::as_needed): New function.
5710 (Object::do_dynobj): New function.
5711 (Object::as_needed_): New data member.
5712
6fa2a40b
CC
57132011-05-24 Cary Coutant <ccoutant@google.com>
5714
5715 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5716 info; adjust display of GOT entries.
5717 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5718 vector of input objects; remove file_status_.
5719 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5720 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5721 got_plt reader; call target hooks to reserve GOT entries.
5722 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5723 of input file info header and GOT info entry.
5724 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5725 relocation info.
5726 (Got_plt_view_info::got_descriptor): Remove.
5727 (Got_plt_view_info::sym_index): New data member.
5728 (Got_plt_view_info::input_index): New data member.
5729 (Local_got_offset_visitor::visit): Write input file index.
5730 (Global_got_offset_visitor::visit): Write 0 for input file index.
5731 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5732 with sym_index and input_index.
5733 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5734 incremental info GOT entry; replace got_descriptor with input_index.
5735 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5736 map from input file index to object.
5737 (Sized_relobj_incr::do_layout): Replace direct data member reference
5738 with accessor function.
5739 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5740 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5741 Adjust size of input file info header.
5742 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5743 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5744 (Incremental_input_entry_reader::get_input_section): Adjust size of
5745 input file info header.
5746 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5747 of incremental info GOT entry.
5748 (Incremental_got_plt_reader::get_got_desc): Remove.
5749 (Incremental_got_plt_reader::get_got_symndx): New function.
5750 (Incremental_got_plt_reader::get_got_input_index): New function.
5751 (Sized_incremental_binary::Sized_incremental_binary): Remove
5752 file_status_; add input_objects_.
5753 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5754 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5755 (Sized_incremental_binary::file_is_unchanged): Remove.
5756 (Sized_incremental_binary::set_input_object): New function.
5757 (Sized_incremental_binary::input_object): New function.
5758 (Sized_incremental_binary::file_status_): Remove.
5759 (Sized_incremental_binary::input_objects_): New data member.
5760 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5761 references.
5762 (Sized_relobj_incr::invalid_address): Move to base class.
5763 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5764 class.
5765 (Sized_relobj_incr::do_output_section_offset): Likewise.
5766 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5767 (Sized_relobj_incr::section_offsets_): Likewise.
5768 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5769 function.
5770 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5771 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5772 with accessor function.
5773 (Sized_relobj_file::do_layout): Likewise.
5774 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5775 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5776 (Sized_relobj_file::compute_final_local_value): Replace refs to
5777 section_offsets_ with accessor function.
5778 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5779 * object.h (Relobj::Relobj): Initialize new data members.
5780 (Relobj::add_dyn_reloc): New function.
5781 (Relobj::first_dyn_reloc): New function.
5782 (Relobj::dyn_reloc_count): New function.
5783 (Relobj::first_dyn_reloc_): New data member.
5784 (Relobj::dyn_reloc_count_): New data member.
5785 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5786 references.
5787 (Sized_relobj::Address): New typedef.
5788 (Sized_relobj::invalid_address): Move here from child class.
5789 (Sized_relobj::Sized_relobj): Initialize new data members.
5790 (Sized_relobj::sized_relobj): New function.
5791 (Sized_relobj::is_output_section_offset_invalid): Move here from
5792 child class.
5793 (Sized_relobj::get_output_section_offset): Likewise.
5794 (Sized_relobj::local_has_got_offset): Likewise.
5795 (Sized_relobj::local_got_offset): Likewise.
5796 (Sized_relobj::set_local_got_offset): Likewise.
5797 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5798 (Sized_relobj::clear_got_offsets): New function.
5799 (Sized_relobj::section_offsets): Move here from child class.
5800 (Sized_relobj::do_output_section_offset): Likewise.
5801 (Sized_relobj::do_set_section_offset): Likewise.
5802 (Sized_relobj::Local_got_offsets): Likewise.
5803 (Sized_relobj::local_got_offsets_): Likewise.
5804 (Sized_relobj::section_offsets_): Likewise.
5805 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5806 references.
5807 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5808 class.
5809 (Sized_relobj_file::sized_relobj): New function
5810 (Sized_relobj_file::local_has_got_offset): Move to base class.
5811 (Sized_relobj_file::local_got_offset): Likewise.
5812 (Sized_relobj_file::set_local_got_offset): Likewise.
5813 (Sized_relobj_file::get_output_section_offset): Likewise.
5814 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5815 (Sized_relobj_file::do_output_section_offset): Likewise.
5816 (Sized_relobj_file::do_set_section_offset): Likewise.
5817 (Sized_relobj_file::Local_got_offsets): Likewise.
5818 (Sized_relobj_file::local_got_offsets_): Likewise.
5819 (Sized_relobj_file::section_offsets_): Likewise.
5820 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5821 (all constructors).
5822 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5823 (Output_reloc::get_symbol_index): Likewise.
5824 (Output_reloc::local_section_offset): Likewise.
5825 (Output_reloc::get_address): Likewise.
5826 (Output_reloc::symbol_value): Likewise.
5827 (Output_data_got::reserve_slot): Move to class definition.
5828 (Output_data_got::reserve_local): New function.
5829 (Output_data_got::reserve_slot_for_global): Remove.
5830 (Output_data_got::reserve_global): New function.
5831 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5832 (all constructors, two instantiations).
5833 (Output_reloc::get_relobj): New function (two instantiations).
5834 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5835 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5836 (Output_data_reloc::add_global): Adjust type of relobj.
5837 (Output_data_reloc::add_global_relative): Likewise.
5838 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5839 (Output_data_reloc::add_local): Likewise.
5840 (Output_data_reloc::add_local_relative): Likewise.
5841 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5842 (Output_data_reloc::add_local_section): Likewise.
5843 (Output_data_reloc::add_output_section): Likewise.
5844 (Output_data_reloc::add_absolute): Likewise.
5845 (Output_data_reloc::add_target_specific): Likewise.
5846 (Output_data_got::reserve_slot): Move definition here.
5847 (Output_data_got::reserve_local): New function.
5848 (Output_data_got::reserve_global): New function.
5849 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5850 section_offsets_ with accessor function.
5851 (Sized_relobj_file::write_sections): Likewise.
5852 (Sized_relobj_file::do_relocate_sections): Likewise.
5853 * target.h (Sized_target::reserve_local_got_entry): New function.
5854 (Sized_target::reserve_global_got_entry): New function.
5855 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5856 (Target_x86_64::reserve_global_got_entry): New function.
5857 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5858
4829d394
CC
58592011-05-23 Cary Coutant <ccoutant@google.com>
5860
5861 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5862 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5863 bit when checking got_type.
5864 * incremental.cc (Sized_incremental_binary::setup_readers):
5865 Store symbol table and string table locations; initialize bit vector
5866 of file status flags.
5867 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5868 unchanged files.
5869 (Sized_incremental_binary::do_process_got_plt): New function.
5870 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5871 (Output_section_incremental_inputs::set_final_data_size): Record
5872 file index for each input file.
5873 (Output_section_incremental_inputs::write_got_plt): Store file index
5874 instead of input entry offset for each GOT entry.
5875 * incremental.h
5876 (Incremental_input_entry::Incremental_input_entry): Initialize new
5877 data member.
5878 (Incremental_input_entry::set_offset): Store file index.
5879 (Incremental_input_entry::get_file_index): New function.
5880 (Incremental_input_entry::file_index_): New data member.
5881 (Incremental_binary::process_got_plt): New function.
5882 (Incremental_binary::do_process_got_plt): New function.
5883 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5884 data members.
5885 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5886 (Sized_incremental_binary::set_file_is_unchanged): New function.
5887 (Sized_incremental_binary::file_is_unchanged): New function.
5888 (Sized_incremental_binary::do_process_got_plt): New function.
5889 (Sized_incremental_binary::file_status_): New data member.
5890 (Sized_incremental_binary::main_symtab_loc_): New data member.
5891 (Sized_incremental_binary::main_strtab_loc_): New data member.
5892 * output.cc (Output_data_got::Got_entry::write): Add case
5893 RESERVED_CODE.
5894 (Output_data_got::add_global): Call add_got_entry.
5895 (Output_data_got::add_global_plt): Likewise.
5896 (Output_data_got::add_global_with_rel): Likewise.
5897 (Output_data_got::add_global_with_rela): Likewise.
5898 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5899 (Output_data_got::add_global_pair_with_rela): Likewise.
5900 (Output_data_got::add_local): Call add_got_entry.
5901 (Output_data_got::add_local_plt): Likewise.
5902 (Output_data_got::add_local_with_rel): Likewise.
5903 (Output_data_got::add_local_with_rela): Likewise.
5904 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5905 (Output_data_got::add_local_pair_with_rela): Likewise.
5906 (Output_data_got::reserve_slot): New function.
5907 (Output_data_got::reserve_slot_for_global): New function.
5908 (Output_data_got::add_got_entry): New function.
5909 (Output_data_got::add_got_entry_pair): New function.
5910 (Output_section::add_output_section_data): Edit FIXME.
5911 * output.h
5912 (Output_section_data_build::Output_section_data_build): New
5913 constructor with size parameter.
5914 (Output_data_space::Output_data_space): Likewise.
5915 (Output_data_got::Output_data_got): Initialize new data member; new
5916 constructor with size parameter.
5917 (Output_data_got::add_constant): Call add_got_entry.
5918 (Output_data_got::reserve_slot): New function.
5919 (Output_data_got::reserve_slot_for_global): New function.
5920 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5921 (Output_data_got::add_got_entry): New function.
5922 (Output_data_got::add_got_entry_pair): New function.
5923 (Output_data_got::free_list_): New data member.
5924 * target.h (Sized_target::init_got_plt_for_update): New function.
5925 (Sized_target::register_global_plt_entry): New function.
5926 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5927 Initialize new data member; call init; add constructor with PLT count.
5928 (Output_data_plt_x86_64::init): New function.
5929 (Output_data_plt_x86_64::add_relocation): New function.
5930 (Output_data_plt_x86_64::reserve_slot): New function.
5931 (Output_data_plt_x86_64::free_list_): New data member.
5932 (Target_x86_64::init_got_plt_for_update): New function.
5933 (Target_x86_64::register_global_plt_entry): New function.
5934 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5935 incremental updates.
5936 (Output_data_plt_x86_64::add_relocation): New function.
5937 * testsuite/object_unittest.cc (Object_test): Set default options.
5938
ec69d6da
ILT
59392011-05-16 Ian Lance Taylor <iant@google.com>
5940
5941 * options.h (class General_options): Make -i a synonym for -r.
5942
732e31de
ILT
59432011-05-16 Ian Lance Taylor <iant@google.com>
5944
5945 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5946
403676b5
CC
59472011-05-10 Cary Coutant <ccoutant@google.com>
5948
5949 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5950 strip_all (-s).
5951
5b7b7d6e
ILT
59522011-05-06 Ian Lance Taylor <iant@google.com>
5953
5954 * layout.cc (Layout::layout): If the output section flags change,
5955 update the ordering.
5956
f0f9babf
CC
59572011-04-25 Cary Coutant <ccoutant@google.com>
5958
5959 * incremental-dump.cc (dump_incremental_inputs): Print local
5960 symbol info for each input file.
5961 * incremental.cc
5962 (Output_section_incremental_inputs::set_final_data_size): Add local
5963 symbol info to input file entries in incremental info.
5964 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5965 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5966 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5967 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5968 implementation.
5969 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5970 (Sized_incr_relobj::do_relocate): Write the local symbols.
5971 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5972 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5973 Adjust size of input file header.
5974 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5975 (Incremental_inputs_reader::get_local_symbol_count): New function.
5976 (Incremental_inputs_reader::get_input_section): Adjust size of input
5977 file header.
5978 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5979 (Sized_incr_relobj::This): New typedef.
5980 (Sized_incr_relobj::sym_size): New const data member.
5981 (Sized_incr_relobj::Local_symbol): New struct.
5982 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5983 (Sized_incr_relobj::do_local_symbol_offset): New function.
5984 (Sized_incr_relobj::local_symbol_count_): New data member.
5985 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5986 (Sized_incr_relobj::local_symbol_index_): New data member.
5987 (Sized_incr_relobj::local_symbol_offset_): New data member.
5988 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5989 (Sized_incr_relobj::local_symbols_): New data member.
5990 * object.h (Relobj::output_local_symbol_count): New function.
5991 (Relobj::local_symbol_offset): New function.
5992 (Relobj::do_output_local_symbol_count): New function.
5993 (Relobj::do_local_symbol_offset): New function.
5994 (Sized_relobj::do_output_local_symbol_count): New function.
5995 (Sized_relobj::do_local_symbol_offset): New function.
5996
d0a9ace3
ILT
59972011-04-22 Vladimir Simonov <sv@sw.ru>
5998
5999 * descriptors.cc (set_close_on_exec): New function.
6000 (Descriptors::open): Use set_close_on_exec.
6001 * output.cc (S_ISLNK): Define if not defined.
6002
94a3fc8b
CC
60032011-04-22 Cary Coutant <ccoutant@google.com>
6004
6005 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6006 global symbol map.
6007 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6008 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6009 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6010 relocations.
6011 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6012 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6013 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6014 * incremental.h
6015 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6016 function.
6017 (Incremental_binary::apply_incremental_relocs): New function.
6018 (Incremental_binary::do_apply_incremental_relocs): New function.
6019 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6020 data member.
6021 (Sized_incremental_binary::add_global_symbol): New function.
6022 (Sized_incremental_binary::global_symbol): New function.
6023 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6024 (Sized_incremental_binary::symbol_map_): New data member.
6025 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6026 * target.h (Sized_target::apply_relocation): New function.
6027 * target-reloc.h (apply_relocation): New function.
6028 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6029
c87e4302
DK
60302011-04-22 Doug Kwan <dougkwan@google.com>
6031
6032 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6033 flag of a SHT_ARM_EXIDX section.
2e702c99 6034 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6035 * testsuite/Makefile.in: Regenerate.
6036 * testsuite/arm_exidx_test.s: New file.
6037 * testsuite/arm_exidx_test.sh: Same.
6038
e7782cf6
CC
60392011-04-20 Cary Coutant <ccoutant@google.com>
6040
6041 PR gold/12689
6042 * archive.h (Incremental_archive_entry::Archive_member):
6043 Initialize arg_serial_ (second constructor).
6044
308ecdc7
ILT
60452011-04-17 Ian Lance Taylor <iant@google.com>
6046
6047 * object.cc (Relocate_info::location): Simplify location string.
6048 * errors.cc (Errors::error_at_location): Don't print program
6049 name.
6050 (Errors::warning_at_location): Likewise.
6051 (Errors::undefined_symbol): Likewise.
6052 * testsuite/debug_msg.sh: Update accordingly.
6053
bec5b579
CC
60542011-04-14 Cary Coutant <ccoutant@google.com>
6055
6056 * gold/layout.cc (Layout::symtab_section_offset): New function.
6057 * gold/layout.h (Layout::symtab_section_offset): New function.
6058 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6059
88597d34
ILT
60602011-04-12 Ian Lance Taylor <iant@google.com>
6061
6062 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6063 with MREMAP_MAYMOVE.
6064 * output.h (class Output_file): Add map_is_allocated_ field.
6065 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6066 not available, provide stubs. If mremap is not available, #define
6067 it to gold_mremap.
6068 (MREMAP_MAYMOVE): Define if not defined.
6069 (Output_file::Output_file): Initialize map_is_allocated_.
6070 (Output_file::resize): Check map_is_allocated_.
6071 (Output_file::map_anonymous): If mmap fails, use malloc.
6072 (Output_file::unmap): Don't do anything for an anonymous map.
6073 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6074 is not available, provide stubs.
6075 (File_read::View::~View): Use free rather than delete[].
6076 (File_read::make_view): Use malloc rather than new[]. If mmap
6077 fails, use malloc.
6078 (File_read::find_or_make_view): Use malloc rather than new[].
6079 * gold.h: Remove HAVE_REMAP code.
6080 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6081 exists. Rename mremap to gold_mremap. If mmap is not available
6082 don't do anything.
6083 * configure, config.in: Rebuild.
6084
11e361bc
ILT
60852011-04-11 Ian Lance Taylor <iant@google.com>
6086
6087 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6088 initialize local variable v.
6089
cdc29364
CC
60902011-04-11 Cary Coutant <ccoutant@google.com>
6091
6092 * archive.cc (Archive::include_member): Adjust call to
6093 report_object.
6094 (Add_archive_symbols::run): Track argument serial numbers.
6095 (Lib_group::include_member): Likewise.
6096 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6097 * archive.h (Incremental_archive_entry::Archive_member):
6098 Initialize arg_serial_.
6099 (Archive_member::arg_serial_): New data member.
6100 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6101 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6102 incremental link.
6103 (Sized_dynobj::do_for_all_local_got_entries): New function.
6104 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6105 function.
6106 * fileread.cc (get_mtime): New function.
6107 * fileread.h (get_mtime): New function.
6108 * gold.cc (queue_initial_tasks): Check for incremental update.
6109 (process_incremental_input): New function.
6110 (queue_middle_tasks): Don't force valid target for incremental
6111 update.
6112 * incremental-dump.cc (find_input_containing_global): Adjust
6113 size of symbol info entry.
6114 (dump_incremental_inputs): Dump argument serial number and
6115 in_system_directory flag; bias shndx by 1; print symbol names
6116 when dumping per-file symbol lists; use new symbol info readers.
6117 * incremental.cc
6118 (Output_section_incremental_inputs:update_data_size): New function.
6119 (Sized_incremental_binary::setup_readers): Setup input readers
6120 for each input file; build maps for files added from libraries
6121 and scripts.
6122 (Sized_incremental_binary::check_input_args): New function.
6123 (Sized_incremental_binary::do_check_inputs): Build map of argument
6124 serial numbers to input arguments.
6125 (Sized_incremental_binary::do_file_has_changed): Rename
6126 do_file_is_unchanged to this; compare file modification times.
6127 (Sized_incremental_binary::do_init_layout): New function.
6128 (Sized_incremental_binary::do_reserve_layout): New function.
6129 (Sized_incremental_binary::do_get_input_reader): Remove.
6130 (Sized_incremental_binary::get_symtab_view): New function.
6131 (Incremental_checker::can_incrementally_link_output_file): Remove.
6132 (Incremental_inputs::report_command_line): Exclude --debug options.
6133 (Incremental_inputs::report_archive_begin): Add parameter; track
6134 argument serial numbers; don't put input file entry for archive
6135 before archive members.
6136 (Incremental_inputs::report_archive_end): Put input file entry
6137 for archive after archive members.
6138 (Incremental_inputs::report_object): Add parameter; track argument
6139 serial numbers and in_system_directory flag.
6140 (Incremental_inputs::report_script): Add parameter; track argument
6141 serial numbers.
6142 (Output_section_incremental_inputs::set_final_data_size): Adjust
6143 size of symbol info entry; check for forwarding symbols.
6144 (Output_section_incremental_inputs::write_input_files): Write
6145 in_system_directory flag and argument serial number.
6146 (Output_section_incremental_inputs::write_info_blocks): Map section
6147 indices between incremental info and original input file; store
6148 input section index for each symbol.
6149 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6150 change operator() to visit().
6151 (class Global_got_offset_visitor): Likewise.
6152 (class Global_symbol_visitor_got_plt):
6153 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6154 classes.
6155 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6156 (Sized_incr_relobj::do_read_symbols): New function.
6157 (Sized_incr_relobj::do_layout): New function.
6158 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6159 (Sized_incr_relobj::do_add_symbols): New function.
6160 (Sized_incr_relobj::do_should_include_member): New function.
6161 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6162 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6163 (Sized_incr_relobj::do_section_size): New function.
6164 (Sized_incr_relobj::do_section_name): New function.
6165 (Sized_incr_relobj::do_section_contents): New function.
6166 (Sized_incr_relobj::do_section_flags): New function.
6167 (Sized_incr_relobj::do_section_entsize): New function.
6168 (Sized_incr_relobj::do_section_address): New function.
6169 (Sized_incr_relobj::do_section_type): New function.
6170 (Sized_incr_relobj::do_section_link): New function.
6171 (Sized_incr_relobj::do_section_info): New function.
6172 (Sized_incr_relobj::do_section_addralign): New function.
6173 (Sized_incr_relobj::do_initialize_xindex): New function.
6174 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6175 (Sized_incr_relobj::do_read_relocs): New function.
6176 (Sized_incr_relobj::do_gc_process_relocs): New function.
6177 (Sized_incr_relobj::do_scan_relocs): New function.
6178 (Sized_incr_relobj::do_count_local_symbols): New function.
6179 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6180 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6181 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6182 (Sized_incr_relobj::do_relocate): New function.
6183 (Sized_incr_relobj::do_set_section_offset): New function.
6184 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6185 (Sized_incr_dynobj::do_read_symbols): New function.
6186 (Sized_incr_dynobj::do_layout): New function.
6187 (Sized_incr_dynobj::do_add_symbols): New function.
6188 (Sized_incr_dynobj::do_should_include_member): New function.
6189 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6190 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6191 (Sized_incr_dynobj::do_section_size): New function.
6192 (Sized_incr_dynobj::do_section_name): New function.
6193 (Sized_incr_dynobj::do_section_contents): New function.
6194 (Sized_incr_dynobj::do_section_flags): New function.
6195 (Sized_incr_dynobj::do_section_entsize): New function.
6196 (Sized_incr_dynobj::do_section_address): New function.
6197 (Sized_incr_dynobj::do_section_type): New function.
6198 (Sized_incr_dynobj::do_section_link): New function.
6199 (Sized_incr_dynobj::do_section_info): New function.
6200 (Sized_incr_dynobj::do_section_addralign): New function.
6201 (Sized_incr_dynobj::do_initialize_xindex): New function.
6202 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6203 (make_sized_incremental_object): New function.
6204 (Incremental_library::copy_unused_symbols): New function.
6205 (Incremental_library::do_for_all_unused_symbols): New function.
6206 * incremental.h (enum Incremental_input_flags): New type.
6207 (class Incremental_checker): Remove.
6208 (Incremental_input_entry::Incremental_input_entry): Add argument
6209 serial number.
6210 (Incremental_input_entry::arg_serial): New function.
6211 (Incremental_input_entry::set_is_in_system_directory): New function.
6212 (Incremental_input_entry::is_in_system_directory): New function.
6213 (Incremental_input_entry::arg_serial_): New data member.
6214 (Incremental_input_entry::is_in_system_directory_): New data member.
6215 (class Script_info): Move here from script.h.
6216 (Script_info::Script_info): Add filename parameter.
6217 (Script_info::filename): New function.
6218 (Script_info::filename_): New data member.
6219 (Incremental_script_entry::Incremental_script_entry): Add argument
6220 serial number.
6221 (Incremental_object_entry::Incremental_object_entry): Likewise.
6222 (Incremental_object_entry::add_input_section): Build list of input
6223 sections with map to original shndx.
6224 (Incremental_object_entry::get_input_section_index): New function.
6225 (Incremental_object_entry::shndx_): New data member.
6226 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6227 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6228 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6229 serial number.
6230 (Incremental_inputs::report_archive_begin): Likewise.
6231 (Incremental_inputs::report_object): Likewise.
6232 (Incremental_inputs::report_script): Likewise.
6233 (class Incremental_global_symbol_reader): New class.
6234 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6235 and store flags and input file type.
6236 (Incremental_input_entry_reader::arg_serial): New function.
6237 (Incremental_input_entry_reader::type): Extract type from flags.
6238 (Incremental_input_entry_reader::is_in_system_directory): New function.
6239 (Incremental_input_entry_reader::get_input_section_count): Call
6240 accessor function for type.
6241 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6242 function for type; adjust size of global symbol entry.
6243 (Incremental_input_entry_reader::get_global_symbol_count): Call
6244 accessor function for type.
6245 (Incremental_input_entry_reader::get_object_count): Likewise.
6246 (Incremental_input_entry_reader::get_object_offset): Likewise.
6247 (Incremental_input_entry_reader::get_member_count): Likewise.
6248 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6249 (Incremental_input_entry_reader::get_member_offset): Likewise.
6250 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6251 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6252 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6253 (Incremental_input_entry_reader::get_global_symbol_reader): New
6254 function.
6255 (Incremental_input_entry_reader::get_output_symbol_index): New
6256 function.
6257 (Incremental_input_entry_reader::type_): Remove.
6258 (Incremental_input_entry_reader::flags_): New data member.
6259 (Incremental_inputs_reader::input_file_offset): New function.
6260 (Incremental_inputs_reader::input_file_index): New function.
6261 (Incremental_inputs_reader::input_file): Call input_file_offset.
6262 (Incremental_inputs_reader::input_file_at_offset): New function.
6263 (Incremental_relocs_reader::get_r_type): Reformat.
6264 (Incremental_relocs_reader::get_r_shndx): Reformat.
6265 (Incremental_relocs_reader::get_r_offset): Reformat.
6266 (Incremental_relocs_reader::data): New function.
6267 (Incremental_binary::Incremental_binary): Initialize new data members.
6268 (Incremental_binary::check_inputs): Add cmdline parameter.
6269 (Incremental_binary::file_is_unchanged): Remove.
6270 (Input_reader::arg_serial): New function.
6271 (Input_reader::get_unused_symbol_count): New function.
6272 (Input_reader::get_unused_symbol): New function.
6273 (Input_reader::do_arg_serial): New function.
6274 (Input_reader::do_get_unused_symbol_count): New function.
6275 (Input_reader::do_get_unused_symbol): New function.
6276 (Incremental_binary::input_file_count): New function.
6277 (Incremental_binary::get_input_reader): Change signature to use
6278 index instead of filename.
6279 (Incremental_binary::file_has_changed): New function.
6280 (Incremental_binary::get_input_argument): New function.
6281 (Incremental_binary::get_library): New function.
6282 (Incremental_binary::get_script_info): New function.
6283 (Incremental_binary::init_layout): New function.
6284 (Incremental_binary::reserve_layout): New function.
6285 (Incremental_binary::output_file): New function.
6286 (Incremental_binary::do_check_inputs): New function.
6287 (Incremental_binary::do_file_is_unchanged): Remove.
6288 (Incremental_binary::do_file_has_changed): New function.
6289 (Incremental_binary::do_init_layout): New function.
6290 (Incremental_binary::do_reserve_layout): New function.
6291 (Incremental_binary::do_input_file_count): New function.
6292 (Incremental_binary::do_get_input_reader): Change signature.
6293 (Incremental_binary::input_args_map_): New data member.
6294 (Incremental_binary::library_map_): New data member.
6295 (Incremental_binary::script_map_): New data member.
6296 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6297 new data members.
6298 (Sized_incremental_binary::output_section): New function.
6299 (Sized_incremental_binary::inputs_reader): Add const.
6300 (Sized_incremental_binary::symtab_reader): Add const.
6301 (Sized_incremental_binary::relocs_reader): Add const.
6302 (Sized_incremental_binary::got_plt_reader): Add const.
6303 (Sized_incremental_binary::get_symtab_view): New function.
6304 (Sized_incremental_binary::Inputs_reader): New typedef.
6305 (Sized_incremental_binary::Input_entry_reader): New typedef.
6306 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6307 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6308 (Sized_incremental_binary::do_file_has_changed): New function.
6309 (Sized_incremental_binary::do_init_layout): New function.
6310 (Sized_incremental_binary::do_reserve_layout): New function.
6311 (Sized_input_reader::Inputs_reader): Remove.
6312 (Sized_input_reader::Input_entry_reader): Remove.
6313 (Sized_input_reader::do_arg_serial): New function.
6314 (Sized_input_reader::do_get_unused_symbol_count): New function.
6315 (Sized_input_reader::do_get_unused_symbol): New function.
6316 (Sized_incremental_binary::do_input_file_count): New function.
6317 (Sized_incremental_binary::do_get_input_reader): Change signature;
6318 use index instead of filename.
6319 (Sized_incremental_binary::section_map_): New data member.
6320 (Sized_incremental_binary::input_entry_readers_): New data member.
6321 (class Sized_incr_relobj): New class.
6322 (class Sized_incr_dynobj): New class.
6323 (make_sized_incremental_object): New function.
6324 (class Incremental_library): New class.
6325 * layout.cc (Free_list::num_lists): New static data member.
6326 (Free_list::num_nodes): New static data member.
6327 (Free_list::num_removes): New static data member.
6328 (Free_list::num_remove_visits): New static data member.
6329 (Free_list::num_allocates): New static data member.
6330 (Free_list::num_allocate_visits): New static data member.
6331 (Free_list::init): New function.
6332 (Free_list::remove): New function.
6333 (Free_list::allocate): New function.
6334 (Free_list::dump): New function.
6335 (Free_list::print_stats): New function.
6336 (Layout_task_runner::run): Resize output file for incremental updates.
6337 (Layout::Layout): Initialize new data members.
6338 (Layout::set_incremental_base): New function.
6339 (Layout::init_fixed_output_section): New function.
6340 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6341 incremental updates.
6342 (Layout::create_gold_note): Do not create gold note section for
6343 incremental updates.
6344 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6345 for incremental updates.
6346 (Layout::set_section_offsets): For incremental updates, allocate space
6347 from free list.
6348 (Layout::create_symtab_sections): Layout with offsets relative to
6349 start of section; for incremental updates, allocate space from free
6350 list.
6351 (Layout::create_shdrs): For incremental updates, allocate space from
6352 free list.
6353 (Layout::finish_dynamic_section): For incremental updates, do not
6354 check --as-needed (fixed in subsequent patch).
6355 * layout.h (class Free_list): New class.
6356 (Layout::set_incremental_base): New function.
6357 (Layout::incremental_base): New function.
6358 (Layout::init_fixed_output_section): New function.
6359 (Layout::allocate): New function.
6360 (Layout::incremental_base_): New data member.
6361 (Layout::free_list_): New data member.
6362 * main.cc (main): Print Free_list statistics.
6363 * object.cc (Relobj::finalize_incremental_relocs): Add
6364 clear_counts parameter; clear counts only when clear_counts is set.
6365 (Sized_relobj::Sized_relobj): Initialize new base class.
6366 (Sized_relobj::do_layout): Don't report special sections.
6367 (Sized_relobj::do_for_all_local_got_entries): New function.
6368 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6369 symtab_off to all symbol table offsets.
6370 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6371 * object.h (class Got_offset_list): Move to top of file.
6372 (Object::Object): Allow case where input_file == NULL.
6373 (Object::~Object): Likewise.
6374 (Object::input_file): Assert that input_file != NULL.
6375 (Object::lock): Allow case where input_file == NULL.
6376 (Object::unlock): Likewise.
6377 (Object::is_locked): Likewise.
6378 (Object::token): Likewise.
6379 (Object::release): Likewise.
6380 (Object::is_incremental): New function.
6381 (Object::get_mtime): New function.
6382 (Object::for_all_local_got_entries): New function.
6383 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6384 (Object::set_is_in_system_directory): New function.
6385 (Object::is_in_system_directory): New function.
6386 (Object::do_is_incremental): New function.
6387 (Object::do_get_mtime): New function.
6388 (Object::do_for_all_local_got_entries): New function.
6389 (Object::is_in_system_directory_): New data member.
6390 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6391 (class Sized_relobj_base): New class.
6392 (class Sized_relobj): Derive from Sized_relobj_base.
6393 (class Sized_relobj::Symbols): Redeclare from base class.
6394 (class Sized_relobj::local_got_offset_list): Remove.
6395 (class Sized_relobj::Output_sections): Redeclare from base class.
6396 (class Sized_relobj::do_for_all_local_got_entries): New function.
6397 (class Sized_relobj::write_local_symbols): Add offset parameter.
6398 (class Sized_relobj::local_symbol_offset_): Update comment.
6399 (class Sized_relobj::local_dynsym_offset_): Update comment.
6400 * options.cc (Input_arguments::add_file): Remove const.
6401 * options.h (Input_file_argument::Input_file_argument):
6402 Initialize arg_serial_ (all constructors).
6403 (Input_file_argument::set_arg_serial): New function.
6404 (Input_file_argument::arg_serial): New function.
6405 (Input_file_argument::arg_serial_): New data member.
6406 (Input_arguments::Input_arguments): Initialize file_count_.
6407 (Input_arguments::add_file): Remove const.
6408 (Input_arguments::number_of_input_files): New function.
6409 (Input_arguments::file_count_): New data member.
6410 (Command_line::number_of_input_files): Call
6411 Input_arguments::number_of_input_files.
6412 * output.cc (Output_segment_headers::Output_segment_headers):
6413 Set current size.
6414 (Output_section::Input_section::current_data_size): New function.
6415 (Output_section::Output_section): Initialize new data members.
6416 (Output_section::add_input_section): Don't do merge sections for
6417 an incremental link; allocate space from free list for an
6418 incremental update.
6419 (Output_section::add_output_section_data): Allocate space from
6420 free list for an incremental update.
6421 (Output_section::update_data_size): New function.
6422 (Output_section::set_fixed_layout): New function.
6423 (Output_section::reserve): New function.
6424 (Output_segment::set_section_addresses): Remove const.
6425 (Output_segment::set_section_list_addresses): Remove const; allocate
6426 space from free list for an incremental update.
6427 (Output_segment::set_offset): Adjust size of RELRO segment for an
6428 incremental update.
6429 * output.h (Output_data::current_data_size): Move here from
6430 child classes.
6431 (Output_data::pre_finalize_data_size): New function.
6432 (Output_data::update_data_size): New function.
6433 (Output_section_headers::update_data_size): new function.
6434 (Output_section_data_build::current_data_size): Move to Output_data.
6435 (Output_data_strtab::update_data_size): New function.
6436 (Output_section::current_data_size): Move to Output_data.
6437 (Output_section::set_fixed_layout): New function.
6438 (Output_section::has_fixed_layout): New function.
6439 (Output_section::reserve): New function.
6440 (Output_section::update_data_size): New function.
6441 (Output_section::has_fixed_layout_): New data member.
6442 (Output_section::free_list_): New data member.
6443 (Output_segment::set_section_addresses): Remove const.
6444 (Output_segment::set_section_list_addresses): Remove const.
6445 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6446 New function.
6447 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6448 New function.
6449 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6450 parameter when calling Add_symbols constructor; store argument
6451 serial number for members of a lib group.
6452 (Add_symbols::locks): Allow case where token == NULL.
6453 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6454 (Read_member::~Read_member): New function.
6455 (Read_member::is_runnable): New function.
6456 (Read_member::locks): New function.
6457 (Read_member::run): New function.
6458 (Check_script::~Check_script): New function.
6459 (Check_script::is_runnable): New function.
6460 (Check_script::locks): New function.
6461 (Check_script::run): New function.
6462 (Check_library::~Check_library): New function.
6463 (Check_library::is_runnable): New function.
6464 (Check_library::locks): New function.
6465 (Check_library::run): New function.
6466 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6467 (Add_symbols::library_): New data member.
6468 (class Read_member): New class.
6469 (class Check_script): New class.
6470 (class Check_library): New class.
6471 * reloc.cc (Read_relocs::is_runnable): Allow case where
6472 token == NULL.
6473 (Read_relocs::locks): Likewise.
6474 (Scan_relocs::locks): Likewise.
6475 (Relocate_task::locks): Likewise.
6476 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6477 to clear counters.
6478 (Sized_relobj::incremental_relocs_scan): Fix comment.
6479 (Sized_relobj::do_relocate): Pass output file offset to
6480 write_local_symbols.
6481 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6482 from class declaration.
6483 * script.cc (read_input_script): Allocate Script_info; pass
6484 argument serial number to report_script.
6485 * script.h (class Script_info): Move to incremental.h.
6486 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6487 * symtab.h (Symbol_table::add_from_incrobj): New function.
6488 (Symbol_table::set_file_offset): New function.
6489
b961d0d7
CC
64902011-04-05 Cary Coutant <ccoutant@google.com>
6491
6492 * incremental-dump.cc (dump_incremental_inputs): Change signature
6493 to take a Sized_incremental_binary; change caller. Use readers
6494 in Sized_incremental_binary.
6495 * incremental.cc
6496 (Sized_incremental_binary::find_incremental_inputs_sections):
6497 Rename do_find_incremental_inputs_sections to this.
6498 (Sized_incremental_binary::setup_readers): New function.
6499 (Sized_incremental_binary::do_check_inputs): Check
6500 has_incremental_info_ flag; move setup code to setup_readers;
6501 use input readers.
6502 (Sized_incremental_binary::do_file_is_unchanged): New function.
6503 (Sized_incremental_binary::do_get_input_reader): New function.
6504 * incremental.h (class Incremental_binary): Move to end of file.
6505 (Incremental_binary::file_is_unchanged): New function.
6506 (Incremental_binary::do_file_is_unchanged): New function.
6507 (Incremental_binary::Input_reader): New class.
6508 (Incremental_binary::get_input_reader): New function.
6509 (class Sized_incremental_binary): Move to end of file.
6510 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6511 input section reader classes.
6512 (Sized_incremental_binary::has_incremental_info): New function.
6513 (Sized_incremental_binary::inputs_reader): New function.
6514 (Sized_incremental_binary::symtab_reader): New function.
6515 (Sized_incremental_binary::relocs_reader): New function.
6516 (Sized_incremental_binary::got_plt_reader): New function.
6517 (Sized_incremental_binary::do_file_is_unchanged): New function.
6518 (Sized_incremental_binary::Sized_input_reader): New class.
6519 (Sized_incremental_binary::get_input_reader): New function.
6520 (Sized_incremental_binary::find_incremental_inputs_sections):
6521 Rename do_find_incremental_inputs_sections to this.
6522 (Sized_incremental_binary::setup_readers): New function.
6523 (Sized_incremental_binary::has_incremental_info_): New data member.
6524 (Sized_incremental_binary::inputs_reader_): New data member.
6525 (Sized_incremental_binary::symtab_reader_): New data member.
6526 (Sized_incremental_binary::relocs_reader_): New data member.
6527 (Sized_incremental_binary::got_plt_reader_): New data member.
6528 (Sized_incremental_binary::current_input_file_): New data member.
6529
a869183f
PP
65302011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6531
6532 PR gold/12640
6533 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6534 violation.
6535
65362011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6537
6538 * archive.cc (Archive::include_member): Adjust call to report_object.
6539 (Add_archive_symbols::run): Add script_info to call to
6540 report_archive_begin.
6541 (Lib_group::include_member): Adjust call to report_object.
6542 (Add_lib_group_symbols::run): Adjust call to report_object.
6543 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6544 blocks. Add object count for script input files.
6545 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6546 script_info parameter; change all callers.
6547 (Incremental_inputs::report_object): Add script_info parameter;
6548 change all callers.
6549 (Incremental_inputs::report_script): Store backpointer to
6550 incremental info entry.
6551 (Output_section_incremental_inputs::set_final_data_size): Record
6552 additional information for scripts.
6553 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6554 * incremental.h (Incremental_script_entry::add_object): New function.
6555 (Incremental_script_entry::get_object_count): New function.
6556 (Incremental_script_entry::get_object): New function.
6557 (Incremental_script_entry::objects_): New data member; adjust
6558 constructor.
6559 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6560 (Incremental_inputs::report_object): Add script_info parameter.
6561 (Incremental_inputs_reader::get_object_count): New function.
6562 (Incremental_inputs_reader::get_object_offset): New function.
6563 * options.cc (Input_arguments::add_file): Return reference to
6564 new input argument.
6565 * options.h (Input_argument::set_script_info): New function.
6566 (Input_argument::script_info): New function.
6567 (Input_argument::script_info_): New data member; adjust all
6568 constructors.
6569 (Input_file_group::add_file): Return reference to new input argument.
6570 (Input_file_lib::add_file): Likewise.
6571 (Input_arguments::add_file): Likewise.
6572 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6573 * script.cc (Parser_closure::Parser_closure): Add script_info
6574 parameter; adjust all callers.
6575 (Parser_closure::script_info): New function.
6576 (Parser_closure::script_info_): New data member.
6577 (read_input_script): Report scripts earlier to incremental info.
6578 (script_add_file): Set script_info in Input_argument.
6579 (script_add_library): Likewise.
6580 * script.h (Script_options::Script_info): Rewrite class.
6581
a869183f 65822011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6583
6584 * archive.cc (Library_base::should_include_member): Move
6585 method here from class Archive.
6586 (Archive::Archive): Initialize base class.
6587 (Archive::should_include_member): Move to base class.
6588 (Archive::do_for_all_unused_symbols): New function.
6589 (Add_archive_symbols::run): Remove redundant access to
6590 incremental_inputs.
6591 (Lib_group::Lib_group): Initialize base class.
6592 (Lib_group::do_filename): New function.
6593 (Lib_group::include_member): Pass pointer to Lib_group to
6594 report_object.
6595 (Lib_group::do_for_all_unused_symbols): New function.
6596 (Add_lib_group_symbols::run): Report archive information for
6597 incremental links.
6598 * archive.h (class Library_base): New base class.
6599 (class Archive): Derive from Library_base.
6600 (Archive::filename): Move to base class.
6601 (Archive::set_incremental_info): Likewise.
6602 (Archive::incremental_info): Likewise.
6603 (Archive::Should_include): Likewise.
6604 (Archive::should_include_member): Likewise.
6605 (Archive::Armap_entry): Remove.
6606 (Archive::Unused_symbol_iterator): Remove.
6607 (Archive::unused_symbols_begin): Remove.
6608 (Archive::unused_symbols_end): Remove.
6609 (Archive::do_filename): New function.
6610 (Archive::do_get_mtime): New function.
6611 (Archive::do_for_all_unused_symbols): New function.
6612 (Archive::task_): Move to base class.
6613 (Archive::incremental_info_): Likewise.
6614 (class Lib_group): Derive from Library_base.
6615 (Lib_group::do_filename): New function.
6616 (Lib_group::do_get_mtime): New function.
6617 (Lib_group::do_for_all_unused_symbols): New function.
6618 (Lib_group::task_): Move to base class.
6619 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6620 function.
6621 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6622 function.
6623 * incremental.cc (Incremental_inputs::report_archive_begin):
6624 Use Library_base; call library's get_mtime; add incremental inputs
6625 entry before members.
6626 (class Unused_symbol_visitor): New class.
6627 (Incremental_inputs::report_archive_end): Use Library_base; use
6628 visitor class to record unused symbols; don't add incremental inputs
6629 entry after members.
6630 (Incremental_inputs::report_object): Use Library_base.
6631 * incremental.h
6632 (Incremental_archive_entry::Incremental_archive_entry): Remove
6633 unused Archive parameter.
6634 (Incremental_inputs::report_archive_begin): Use Library_base.
6635 (Incremental_inputs::report_archive_end): Likewise.
6636 (Incremental_inputs::report_object): Likewise.
6637 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6638 function.
6639 * object.h (Object::for_all_global_symbols): New function.
6640 (Object::do_for_all_global_symbols): New function.
6641 (Sized_relobj::do_for_all_global_symbols): New function.
6642 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6643 function.
6644 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6645 function.
6646
61ab3e40
ILT
66472011-03-27 Ian Lance Taylor <iant@google.com>
6648
6649 * archive.cc (Archive::interpret_header): Return -1 if something
6650 goes wrong. Change callers accordingly.
6651
30e1f9e6
CC
66522011-03-25 Cary Coutant <ccoutant@google.com>
6653
6654 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6655 * testsuite/Makefile.in: Regenerate.
6656
9370ce59 66572011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6658
6659 * plugin.cc (get_view): New.
6660 (Plugin::load): Pass get_view to the plugin.
6661 (Plugin_manager::get_view): New.
6662
9312bb0a
ILT
66632011-03-21 Ian Lance Taylor <iant@google.com>
6664
6665 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6666 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6667
7e12ba9e
ST
66682011-03-21 Sriraman Tallam <tmsriram@google.com>
6669
6670 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6671 Change == to -eq.
6672 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6673 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6674 Change == to -eq.
6675 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6676 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6677
fd7a005d
ILT
66782011-03-14 Ian Lance Taylor <iant@google.com>
6679
6680 * script-sections.cc (Sort_output_sections::script_compare):
6681 Rename from is_before, change return type.
6682 (Sort_output_sections::operator()): Adjust accordingly.
6683
ed16fd1b
ILT
66842011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6685
6686 PR gold/12572
6687 * testsuite/odr_violation2.cc: Add comment to make all error line
6688 numbers double digits.
6689 * testsuite/debug_msg.sh: Adjust expected errors.
6690
71ff8986
ILT
66912011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6692
6693 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6694 but mark earlier ones as non-canonical
6695 (offset_to_iterator): Update search target and example
6696 (do_addr2line): Return extra lines in a vector*
6697 (format_file_lineno): Extract from do_addr2line
6698 (one_addr2line): Add vector* out-param
6699 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6700 when a lineno entry appeared last for its instruction
6701 (Dwarf_line_info): Add vector* out-param
6702 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6703 * symtab.cc (Odr_violation_compare): Include the lineno in the
6704 comparison again.
6705 (linenos_from_loc): New. Combine the canonical line for an
6706 address with its other lines.
6707 (True_if_intersect): New. Helper functor to make
6708 std::set_intersection a query.
6709 (detect_odr_violations): Compare sets of lines instead of just
6710 one line for each function. This became less deterministic, but
6711 has fewer false positives.
6712 * symtab.h: Declarations.
6713 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6714 mix an optimized and non-optimized object in the same binary
6715 (odr_violation2.so): Same.
6716 * testsuite/Makefile.in: Regenerate from Makefile.am.
6717 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6718 * testsuite/debug_msg.sh: Update line numbers and add
6719 assertions.
6720 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6721 non-optimized context.
6722 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6723 isn't inlined, and use OdrDerived in an optimized context.
6724 * testsuite/odr_header1.h: Defines OdrDerived, where
6725 optimization will change the
6726 first-instruction-in-the-destructor's file and line number.
6727 * testsuite/odr_header2.h: Defines OdrBase.
6728
a19fefdc
ILT
67292011-03-09 Ian Lance Taylor <iant@google.com>
6730
6731 * fileread.cc (File_read::clear_views): Don't delete the whole
6732 file view.
6733
ecb351e9
ILT
67342011-03-08 Ian Lance Taylor <iant@google.com>
6735
6736 PR gold/12525
6737 * fileread.cc: #include <climits>.
6738 (GOLD_IOV_MAX): Define.
6739 (File_read::read_multiple): Limit number of entries by iov_max.
6740 * fileread.h (class File_read): Always set max_readv_entries to
6741 128.
6742
b821d13c
ILT
67432011-03-07 Ian Lance Taylor <iant@google.com>
6744
6745 PR gold/12525
6746 * options.h (class General_options): Add -dy and -dn.
6747
89243142
CC
67482011-03-02 Cary Coutant <ccoutant@google.com>
6749
6750 * testsuite/script_test_9.t: Add TLS segment.
6751
d0773f31
ILT
67522011-03-02 Simon Baldwin <simonb@google.com>
6753
6754 * configure.ac: Add check for gnu_indirect_function support in
6755 the toolchain building binutils.
6756 * configure: Rebuild.
6757
9370ce59 67582011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6759
6760 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6761 plugin only symbols.
6762 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6763 in plugin files as not needed in the symbol table.
6764
4cf7a849
ST
67652011-02-11 Sriraman Tallam <tmsriram@google.com>
6766
6767 * output.cc (Output_section::add_input_section): Delay fill
6768 generation for section ordering.
6769
b578bd7d
ILT
67702011-02-09 Ian Lance Taylor <iant@google.com>
6771
6772 PR gold/12316
6773 * object.h (class Sized_relobj): Remove clear_local_symbols.
6774 * reloc.cc (Sized_relobj::do_relocate): Don't call
6775 clear_local_symbols.
6776
9370ce59 67772011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6778
6779 * plugin.cc (is_visible_from_outside): Return true for symbols
6780 in the -u option.
6781
55382fb7
ILT
67822011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6783
6784 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6785 filename.
6786
4e271fff
ST
67872011-02-02 Sriraman Tallam <tmsriram@google.com>
6788
6789 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6790 to std::string.
4e271fff 6791 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6792 section_name to be std::string.
4e271fff
ST
6793 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6794
d433c3ac
ILT
67952011-01-25 Ian Lance Taylor <iant@google.com>
6796
6797 * script.cc (script_add_extern): Rewrite to use
6798 add_symbol_reference.
6799
880473a6
DK
68002011-01-25 Doug Kwan <dougkwan@google.com>
6801
d433c3ac 6802 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6803
f30f86fa
ILT
68042011-01-24 Ian Lance Taylor <iant@google.com>
6805
6806 * options.h (class General_options): Accept
6807 --no-detect-odr-violations.
6808
8e51a0b9
ILT
68092011-01-24 Ian Lance Taylor <iant@google.com>
6810
6811 * version.cc (version_string): Bump to 1.11.
6812
0f3b89d8
ILT
68132011-01-24 Ian Lance Taylor <iant@google.com>
6814
6815 * plugin.cc (class Plugin_rescan): Define new class.
6816 (Plugin_manager::claim_file): Set any_claimed_.
6817 (Plugin_manager::save_archive): New function.
6818 (Plugin_manager::save_input_group): New function.
6819 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6820 necessary.
6821 (Plugin_manager::new_undefined_symbol): New function.
6822 (Plugin_manager::rescan): New function.
6823 (Plugin_manager::rescannable_defines): New function.
6824 (Plugin_manager::add_input_file): Set any_added_.
6825 * plugin.h (class Plugin_manager): define new fields rescannable_,
6826 undefined_symbols_, any_claimed_, and any_added_. Declare
6827 Plugin_rescan as friend. Declare new functions.
6828 (Plugin_manager::Rescannable): Define type.
6829 (Plugin_manager::Rescannable_list): Define type.
6830 (Plugin_manager::Undefined_symbol_list): Define type.
6831 (Plugin_manager::Plugin_manager): Initialize new fields.
6832 * archive.cc (Archive::defines_symbol): New function.
6833 (Add_archive_symbols::run): Pass archive to plugins if any.
6834 * archive.h (class Archive): Declare defines_symbol.
6835 * readsyms.cc (Input_group::~Input_group): New function.
6836 (Finish_group::run): Pass input_group to plugins if any.
6837 * readsyms.h (class Input_group): Declare destructor.
6838 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6839 any.
6840
3bb951e5
ILT
68412011-01-10 Ian Lance Taylor <iant@google.com>
6842
6843 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6844 section as relro.
6845 (Layout::set_segment_offsets): Reset increase_relro before calling
6846 set_section_addresses a second time.
6847
0aa45fac
CC
68482011-01-04 Cary Coutant <ccoutant@google.com>
6849
6850 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6851 sections before NOBITS sections.
6852
0db46eb4
L
68532011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6854
6855 * version.cc (print_version): Update copyright to 2011.
6856
829c9745
CC
68572010-12-23 Cary Coutant <ccoutant@google.com>
6858
6859 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6860 of OS to this->add. Add OD parameter to second form of the function.
6861
7500420b
ILT
68622010-12-20 Ian Lance Taylor <iant@google.com>
6863
6864 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6865 second of two consecutive entries with same offset.
6866
f8e9a930
RW
68672010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6868
6869 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6870 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6871 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6872 to avoid unneeded links against $(LDADD).
6873 * testsuite/Makefile.in: Regenerate.
6874
2fbb4320
ILT
68752010-12-15 Ian Lance Taylor <iant@google.com>
6876
6877 PR gold/12324
6878 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6879 for R_X86_64_32 and R_X86_64_PC32.
6880 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6881 ver_matching_def_pic.o.
6882 (ver_matching_def_pic.o): New target.
6883
fedb228d
RW
68842010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6885
6886 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6887 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6888 Move definition before File_read::View member definitions.
6889 (File_read::View::~View): Initialize and hold lock before
6890 updating current_mapped_bytes.
6891
9b547ce6
RW
68922010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6893
6894 * dwarf_reader.cc: Remove outdated comment.
6895 * gold-threads.cc: Fix typo in error message.
6896 * archive.cc: Fix typos in comments.
6897 * archive.h: Likewise.
6898 * arm-reloc-property.cc: Likewise.
6899 * arm-reloc-property.h: Likewise.
6900 * arm-reloc.def: Likewise.
6901 * arm.cc: Likewise.
6902 * attributes.h: Likewise.
6903 * cref.cc: Likewise.
6904 * ehframe.cc: Likewise.
6905 * fileread.h: Likewise.
6906 * gold.h: Likewise.
6907 * i386.cc: Likewise.
6908 * icf.cc: Likewise.
6909 * incremental.h: Likewise.
6910 * int_encoding.cc: Likewise.
6911 * layout.h: Likewise.
6912 * main.cc: Likewise.
6913 * merge.h: Likewise.
6914 * object.cc: Likewise.
6915 * object.h: Likewise.
6916 * options.cc: Likewise.
6917 * readsyms.cc: Likewise.
6918 * reduced_debug_output.cc: Likewise.
6919 * reloc.cc: Likewise.
6920 * script-sections.cc: Likewise.
6921 * sparc.cc: Likewise.
6922 * symtab.h: Likewise.
6923 * target-reloc.h: Likewise.
6924 * target.cc: Likewise.
6925 * target.h: Likewise.
6926 * timer.cc: Likewise.
6927 * timer.h: Likewise.
6928 * x86_64.cc: Likewise.
6929
83e17bd5
CC
69302010-12-09 Cary Coutant <ccoutant@google.com>
6931
6932 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6933 stack.
6934 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6935 parameter; change all callers.
6936 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6937 * options.h (warn_execstack): New option.
6938
017257f8
DK
69392010-12-07 Doug Kwan <dougkwan@google.com>
6940
6941 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6942 like function call relocations.
6943
c20cbc06
ILT
69442010-12-07 Ian Lance Taylor <iant@google.com>
6945
6946 * archive.cc (Archive::get_elf_object_for_member): Permit
6947 punconfigured to be NULL.
6948 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6949 (Archive::include_member): Pass NULL to get_elf_object_for_member
6950 if we searched for the archive and this is the first included
6951 object.
6952
4dbfafcc
ILT
69532010-12-01 Ian Lance Taylor <iant@google.com>
6954
6955 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6956 track_relocs_type_ field.
6957 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6958 Set track_relocs_type_.
6959 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6960 contents when using RELA relocs.
6961 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6962 reloc_map_.
6963 * reloc.cc (Track_relocs::next_addend): New function.
6964 * reloc.h (class Track_relocs): Declare next_addend.
6965
e5e19edd
ILT
69662010-12-01 Ian Lance Taylor <iant@google.com>
6967
6968 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6969 virtual destructor.
6970
9a5ce24c
ILT
69712010-12-01 Ian Lance Taylor <iant@google.com>
6972
6973 * README: Update compilers known to work and fail.
6974
c7791212
NC
69752010-11-23 Matthias Klose <doko@ubuntu.com>
6976
6977 * configure.in: For --enable-gold, handle value `default' instead of
6978 `both*'. Always install ld as ld.bfd, install as ld if gold is
6979 not the default.
6980 * configure: Regenerate.
6981
0ad220c9
DK
69822010-11-18 Doug Kwan <dougkwan@google.com>
6983
6984 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6985 and right_alignment to be zero. Store result alignment only if it is
6986 greater than existing alignment.
6987
ab8056e0
CC
69882010-11-16 Cary Coutant <ccoutant@google.com>
6989
6990 PR gold/12220
6991 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6992 Check for ".zdebug_line".
6993
fd064a5b
CC
69942010-11-16 Doug Kwan <dougkwan@google.com>
6995 Cary Coutant <ccoutant@google.com>
6996
6997 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6998 by reference; adjust all callers.
6999 * output.cc (Output_segment::set_section_addresses): Adjust references
7000 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7001 list is empty.
7002 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7003 end at page boundary.
7004
6fc6ea19
CC
70052010-11-16 Cary Coutant <ccoutant@google.com>
7006
7007 PR gold/12220
7008 * layout.cc (Layout::choose_output_section): Transform names of
7009 compressed sections even when using a script with a SECTIONS clause.
7010 (Layout::output_section_name): Remove code to transform
7011 compressed debug section names.
7012 * output.cc (Output_section::add_input_section): Use uncompressed
7013 section size when tracking input sections.
7014
95a2c8d6
RS
70152010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7016
7017 * symtab.h (Symbol::NON_PIC_REF): Remove.
7018 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7019 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7020 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7021 (Symbol::use_plt_offset): Take a flags argument and pass it
7022 directly to needs_dynamic_reloc. Restrict check for undefined
7023 weak symbols to function calls.
7024 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7025 (Target_arm::Scan::global): Use it.
7026 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7027 (Target_arm::Relocate::relocate): Likewise.
7028 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7029 parameter with an r_type parameter. Use get_reference_flags
7030 to get the flags.
7031 (Target_arm::Relocate::relocate): Update accordingly.
7032 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7033 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7034 (Target_i386::Scan::global): Likewise.
7035 (Target_i386::Relocate::relocate): Likewise.
7036 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7037 parameter with an r_type parameter. Use get_reference_flags
7038 to get the flags.
7039 (Target_i386::Relocate::relocate): Update accordingly.
7040 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7041 (Target_powerpc::Scan::global): Use it.
7042 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7043 (Target_powerpc::Relocate::relocate): Likewise.
7044 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7045 (Target_sparc::Scan::global): Use it.
7046 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7047 (Target_sparc::Relocate::relocate): Likewise.
7048 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7049 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7050 (Target_x86_64::Scan::global): Likewise.
7051 (Target_x86_64::Relocate::relocate): Likewise.
7052
f625ae50
DK
70532010-11-08 Doug Kwan <dougkwan@google.com>
7054 Cary Coutant <ccoutant@google.com>
7055
7056 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7057 (Arm_exidx_merge_section::section_contents_): New data member.
7058 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7059 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7060 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7061 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7062 in parameters instead of calling Object::section_contents without
7063 locking.
7064 (Arm_output_section::group_section): New parameter TASK. Pass it
7065 to callees that need locking objects.
7066 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7067 to lock EXIDX input sections. Fix a formatting issue. Call
7068 Arm_exidx_merged_section::build_contents to create merged section
7069 contents.
7070 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7071 to lock object of stub table owner.
7072 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7073 TEXT_SIZE to initialize data member TEXT_SIZE_.
7074 (Arm_exidx_input_section::addralign): Fix typo in comment.
7075 (Arm_exidx_input_section::text_size): New method.
7076 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7077 that require locking objects. Lock objects before scanning for stubs
7078 and updating local symbols.
7079 (Arm_input_section<big_endian>::init): Copy contents of original
7080 input section.
2e702c99 7081 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7082 original input section instead of calling Object::section_contents
7083 without locking.
7084 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7085 size without calling Object::section_size().
7086 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7087 for size. Allocate a buffer for merged EXIDX entries.
7088 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7089 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7090 building code to Arm_exidx_merged_section::build_contetns. Write
7091 out contetns in buffer instead of building it on the fly.
7092 (Arm_relobj::make_exidx_input_section): Also pass text section size
7093 to Arm_exidx_input_section constructor.
7094 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7095 (Arm_dynobj::do_read_symbols): Fix memory leak.
7096 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7097 * target.h: (class Task): Add forward declaration.
7098 (Target::relax): Add new parameter TASK and pass it to
7099 Target::do_relax().
7100 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7101
5f9bcf58
CC
71022010-11-05 Cary Coutant <ccoutant@google.com>
7103
7104 PR gold/10708
7105 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7106 object when reading from the file.
7107 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7108 second layout pass.
7109 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7110 when reading section contents.
7111 (get_section_contents): Likewise.
7112 (icf::find_identical_sections): Likewise.
7113 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7114 object when reading from the file.
7115 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7116 the object when doing deferred section layout.
7117
e597fa08
NC
71182010-11-03 Nick Clifton <nickc@redhat.com>
7119
7120 PR gold/12001
7121 * script.h (class Symbol_assignment: name): New member. Returns
7122 the name of the symbol.
7123 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7124 Returns true if the given symbol name is on the list of
7125 assignments wating to be processed.
7126 * archive.cc (should_incldue_member): If the symbol is undefined,
7127 check to see if it is on the list of symbols pending assignment.
7128
3f9a3278
ILT
71292010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7130
7131 * script-sections.cc (Script_sections::find_memory_region): Check
7132 for a NULL output section pointer.
7133
d06fb4d1
DK
71342010-10-29 Doug Kwan <dougkwan@google.com>
7135
7136 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7137 Output_section::add_relaxed_input_section.
7138 * output.cc (Output_section::add_relaxed_input_section): Add new
7139 arguments LAYOUT and NAME. Set section order index.
7140 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7141 Copy section order index.
7142 * output.h (Output_section::add_relaxed_input_section): Add new
7143 arguments LAYOUT and NAME.
7144
90e24de5
ILT
71452010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7146
7147 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7148 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7149 * testsuite/Makefile.in: Regenerate.
7150
c9484ea5
DK
71512010-10-20 Doug Kwan <dougkwan@google.com>
7152
7153 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7154 without SHF_LINK_ORDER flags.
7155 * layout.cc (Layout::choose_output_section): Do not filter
7156 SHF_LINK_ORDER flag in a relocatable link.
7157
5bc2f5be
CC
71582010-10-17 Cary Coutant <ccoutant@google.com>
7159
7160 * output.h (Output_segment::set_section_addresses): Change function
7161 signature. Update all callers.
7162 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7163 sections.
7164 (Output_segment::set_section_addresses): Align after last TLS
7165 section. Add padding before last relro section instead of after.
7166
0c91cf04
DK
71672010-10-17 Doug Kwan <dougkwan@google.com>
7168
7169 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7170 GOT output section to be writable.
7171
8c21d9d3
CC
71722010-10-14 Cary Coutant <ccoutant@google.com>
7173
7174 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7175 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7176 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7177 mode.
7178 * incremental.cc (report_command_line): Ignore all forms of
7179 --incremental.
7180 * layout.cc (Layout::Layout): Check parameters for incremental link
7181 mode.
7182 * options.cc (General_options::parse_incremental): New function.
7183 (General_options::parse_no_incremental): New function.
7184 (General_options::parse_incremental_full): New function.
7185 (General_options::parse_incremental_update): New function.
7186 (General_options::incremental_mode_): New data member.
7187 (General_options::finalize): Check incremental_mode_.
7188 * options.h (General_options): Update help text for --incremental.
7189 Add --no-incremental, --incremental-full, --incremental-update.
7190 (General_options::Incremental_mode): New enum type.
7191 (General_options::incremental_mode): New function.
7192 (General_options::incremental_mode_): New data member.
7193 * parameters.cc (Parameters::incremental_mode_): New data member.
7194 (Parameters::set_options): Set incremental_mode_.
7195 (Parameters::set_incremental_full): New function.
7196 (Parameters::incremental): New function.
7197 (Parameters::incremental_update): New function.
7198 (set_parameters_incremental_full): New function.
7199 * parameters.h (Parameters::set_incremental_full): New function.
7200 (Parameters::incremental): New function.
7201 (Parameters::incremental_update): New function.
7202 (Parameters::incremental_mode_): New data member.
7203 (set_parameters_incremental_full): New function.
7204 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7205 incremental link mode.
7206 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7207 (Sized_relobj::do_relocate_sections): Likewise.
7208 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7209 option.
7210 * testsuite/Makefile.in: Regenerate.
7211 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7212
bb32aa18 72132010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7214
7215 * script-sections.h (class Script_sections): Make
7216 Sections_elements typedef public.
7217 * script-sections.cc (class Sort_output_sections): Add elements_
7218 field. Add constructor which sets it; change all callers.
7219 (Sort_output_sections::is_before): New function.
7220 (Sort_output_sections::operator()): Call is_before.
7221 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7222 conditional.
7223 * testsuite/script_test_10.sh: New test. Test script section
7224 order.
7225 * testsuite/script_test_10.t: Likewise.
7226 * testsuite/script_test_10.s: Likewise.
7227 * testsuite/Makefile.am: Wrap the cross linker tests and the
7228 common tests into NATIVE_OR_CROSS_LINKER.
7229 (check_SCRIPTS): Add script_test_10.sh.
7230 (check_DATA): Add script_test_10.stdout.
7231 (script_test_10.o, script_test_10): New targets.
7232 (script_test_10.stdout): New target.
7233 * configure, testsuite/Makefile.in: Regenerate.
7234
3cef7179
ILT
72352010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7236
7237 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7238 error for the deprecated relocations.
7239 (Target_arm::Scan::global): Likewise.
7240 (Target_arm::Relocate::relocate): Likewise.
7241
7411e9a8
RS
72422010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7243
7244 * fileread.cc (Input_file::find_file): Initialize *found_name
7245 and *namep when using the fallback search for case 4.
7246
6a9da32a
CC
72472010-10-11 Cary Coutant <ccoutant@google.com>
7248
7249 * options.h (class General_options): Redefine -z lazy as an alias for
7250 the negation of -z now.
7251
ac897c20
ILT
72522010-10-11 Ian Lance Taylor <iant@google.com>
7253
7254 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7255 binding.
7256
ea5cae92
NC
72572010-10-06 Nick Clifton <nickc@redhat.com>
7258
7259 * script-sections.cc(class Memory_region): Remove
7260 current_lma_offset_ field. Rename current_vma_offset_ to
7261 current_offset_. Add last_section_ field.
7262 (Memory_region::get_current_vma_address): Rename to
7263 get_current_address.
7264 (Memory_region::get_current_lma_address): Delete.
7265 (Memory_region::increment_vma_offset): Rename to
7266 increment_offset.
7267 (Memory_region::increment_lma_offset): Delete.
7268 (Memory_region::attributes_compatible): New method. Returns
7269 true if the provided section is compatible with the region.
7270 (Memory_region::get_last_section): New method. Returns the last
7271 section to use the region.
7272 (Memory_region::set_last_section): New method. Stores the last
7273 section to use the region.
7274 (Script_sections::block_in_region): New method. Returns true if
7275 a block of memory is contained within a region.
7276 (Script_sections::find_memory_region): New method. Locates a
7277 memory region to be used to set a VMA or LMA address.
7278 (Output_section_definition::set_section_addresses): Add code to
7279 check for addresses set by memory regions.
7280 (Output_segment::set_section_addresses): Remove memory region
7281 walking code.
7282 (Script_sections::create_segment): Add a warning if a header
7283 segment is created outside of any region.
7284 * script-sections.h (class Script_sections): Add prototypes for
7285 find_memory_region and block_in_region methods.
7286 * testsuite/memory_test.s: Use .long instead of .word.
7287 * testsuite/memory_test.t: Add some more output sections.
7288 * testsuite/memory_test.sh: Update expected output.
7289
a9bfd952
DK
72902010-10-02 Doug Kwan <dougkwan@google.com>
7291
7292 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7293 defintion to symtab.h
7294 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7295 declaration to defintion.
7296
bacff3ab
NC
72972010-10-01 Nick Clifton <nickc@redhat.com>
7298
7299 * expression.cc (eval): Replace dummy argument with NULL.
7300 (eval_maybe_dot): Check for a NULL result section pointer.
7301 (Symbol_expression::value): Likewise.
7302 (Dot_expression::value): Likewise.
7303 (BINARY_EXPRESSION): Likewise.
7304 (Max_expression::value): Likewise.
7305 (Min_expression::value): Likewise.
7306 (Absolute_expression::value): Likewise.
7307 (Addr_expression::value_from_output_section): Likewise.
7308 (Loaddddr_expression::value_from_output_section): Likewise.
7309 (Segment_start_expression::value): Likewise.
7310 * script-sections.cc
7311 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7312 argument with NULL.
7313 (Sections_elememt_dot_assignment::set_section_addresses):
7314 Likewise.
7315 (Output_data_expression::do_write_to_buffer): Likewise.
7316 (Output_section_definition::finalize_symbols): Likewise.
7317 (Output_section_definition::set_section_addresses): Likewise.
7318
f81bc8b5
DK
73192010-09-30 Doug Kwan <dougkwan@google.com>
7320
7321 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7322
c95e9f27
ST
73232010-09-28 Sriraman Tallam <tmsriram@google.com>
7324
7325 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7326 function.
c95e9f27
ST
7327 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7328 virtual function.
7329 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7330 virtual function.
7331 * icf.cc (get_section_contents): Inline merge sections only when
7332 target allows it.
7333
3cac54d2
RW
73342010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7335
7336 * configure: Regenerate.
7337
2904037a
ILT
73382010-09-17 Ian Lance Taylor <iant@google.com>
7339
7340 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7341 * testsuite/Makefile.am (memory_test.o): New target.
7342 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7343 memory_test.t.
7344 * testsuite/Makefile.in: Rebuild.
2904037a 7345
bca7fb63
DK
73462010-09-17 Doug Kwan <dougkwan@google.com>
7347
7348 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7349 defintion if relocation uses GOT entries of the symbol.
7350 * testsuite/icf_safe_test.sh: Fix test.
7351 * testsuite/icf_safe_so_test.sh: Fix test.
7352
4ef28648
CC
73532010-09-16 Cary Coutant <ccoutant@google.com>
7354
7355 * script_sections.cc (class Memory_region): Remove "NULL" from
7356 vector initializations.
7357
793990de
CC
73582010-09-15 Cary Coutant <ccoutant@google.com>
7359
7360 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7361 Resolve forwarding symbols.
7362
81e015e2
DK
73632010-09-15 Doug Kwan <dougkwan@google.com>
7364
7365 * gold/testsuite/script_test_3.t: Add ARM special sections.
7366 * gold/testsuite/script_test_4.t: Same.
7367 * gold/testsuite/script_test_5.t: Same.
7368 * gold/testsuite/script_test_6.t: Same.
7369 * gold/testsuite/script_test_7.t: Same.
7370 * gold/testsuite/script_test_7.t: Same.
7371 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7372
36171d64
CC
73732010-09-14 Cary Coutant <ccoutant@google.com>
7374
7375 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7376 (Target_x86_64::Relocate::relocate_tls): Replace check for
7377 saw_tls_block_reloc_ with test for executable section.
7378
d89051bd
CC
73792010-09-12 Cary Coutant <ccoutant@google.com>
7380
7381 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7382 position-independent executables to shared libraries need dynamic
7383 relocations.
7384 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7385 position-independent executables.
7386 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7387 * testsuite/Makefile.in: Regenerate.
7388
fca41f0f
NC
73892010-09-10 Nick Clifton <nickc@redhat.com>
7390
7391 PR gold/11997
7392 * testsuite/memory_test.t: Discard any sections that are not
7393 needed.
7394
6695e4b3
L
73952010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7396
7397 PR gold/11996
7398 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7399 "This::" to work around a bug in gcc 4.2.
7400
7401 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7402
0f72bf6f
RÁE
74032010-09-09 Rafael Espindola <espindola@google.com>
7404
7405 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7406 sections with different PF_X flags in the same segment.
7407 (Layout::find_first_load_seg): Search all segments to find the first
7408 one.
7409 * options.h (rosegment): New.
7410
74112010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7412
05a79166 7413 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7414
aa98ff75
DK
74152010-09-08 Doug Kwan <dougkwan@google.com>
7416
7417 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7418 (Arm_relobj::do_relocate_sections): Add new parameter for output
7419 file to match the parent.
7420 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7421 of local symbols instead of input values. Update code to track
7422 changes in gold::relocate_section.
7423 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7424 (Sized_relobj::compute_final_local_value_internal): New methods.
7425 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7426 body into private version of Sized_relobj::compute_final_local_value.
7427 Call the inline method.
7428 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7429 merged symbol value if there is one.
7430 (Symbol_value::has_output_value): New method defintiion.
7431 (Sized_relobj::Compute_final_local_value_status): New enum type.
7432 (Sized_relobj::compute_final_local_value): New methods.
7433 (Sized_relobj::compute_final_local_value_internal): New methods.
7434 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7435 and arm_cortex_a8.sh.
7436 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7437 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7438 New tests.
7439 * Makefile.in: Regenerate.
7440 * testsuite/arm_bl_out_of_range.s: Update test.
7441 * testsuite/thumb_bl_out_of_range.s: Ditto.
7442 * testsuite/thumb_blx_out_of_range.s: Ditto.
7443 * testsuite/arm_branch_out_of_range.sh: New file.
7444 * testsuite/arm_cortex_a8.sh: Ditto.
7445 * testsuite/arm_cortex_a8_b.s: Ditto.
7446 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7447 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7448 * testsuite/arm_cortex_a8_bl.s: Ditto.
7449 * testsuite/arm_cortex_a8_blx.s: Ditto.
7450 * testsuite/arm_cortex_a8_local.s: Ditto.
7451 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7452 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7453
05a79166
L
74542010-09-08 Rafael Espindola <espindola@google.com>
7455
7456 * Makefile.am (memory_test.stdout): Run readelf with -W.
7457 * Makefile.in: Regenerate.
7458 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7459 64 bit output.
7460
33dbc701
RÁE
74612010-09-08 Rafael Espindola <espindola@google.com>
7462
7463 * script-sections.cc (Script_sections::add_memory_region): Convert
7464 field precision to int.
7465 * script.cc (script_set_section_region, script_set_section_region):
7466 Convert field precision to int.
7467
731ca54a
RÁE
74682010-09-08 Rafael Espindola <espindola@google.com>
7469
7470 * arm.cc (do_finalize_sections): Create the __exidx_start and
7471 __exdix_end symbols even when the section is missing.
7472
7f8cd844
NC
74732010-09-08 Nick Clifton <nickc@redhat.com>
7474
7475 * README: Remove claim that MEMORY is not supported.
7476 * expression.cc (script_exp_function_origin)
7477 (script_exp_function_length): Move from here to ...
7478 * script.cc: ... here.
7479 (script_set_section_region, script_add_memory)
7480 (script_parse_memory_attr, script_include_directive): New
7481 functions.
7482 * script-sections.cc
7483 (class Memory_region): New class.
7484 (class Output_section_definition): Add set_memory_region,
7485 set_section_vma, set_section_lma and get_section_name methods.
7486 (class Script_Sections): Add add_memory_region,
7487 find_memory_region, find_memory_region_origin,
7488 find_memory_region_length and set_memory_region methods.
7489 Have set_section_addresses method walk the list of set memory
7490 regions.
7491 Extend the print methos to display memory regions.
7492 * script-sections.h: Add prototypes for new methods.
7493 Add enum for MEMORY region attributes.
7494 * yyscript.y: Add support for parsing MEMORY regions.
7495 * script-c.h: Add prototypes for new functions.
7496 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7497 * testsuite/Makefile.in: Regenerate.
7498 * testsuite/memory_test.sh: New script.
7499 * testsuite/memory_test.s: New assembler source file.
7500 * testsuite/memory_test.t: New linker script.
7501
a4649286
DK
75022010-08-27 Doug Kwan <dougkwan@google.com>
7503
7504 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7505 reference override an existing dynamic weak reference.
7506 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7507 * testsuite/Makefile.in: Regenerate.
7508 * testsuite/dyn_weak_ref.sh: New file.
7509 * testsuite/dyn_weak_ref_1.c: Ditto.
7510 * testsuite/dyn_weak_ref_2.c: Ditto.
7511
b56648ad
ILT
75122010-08-27 Ian Lance Taylor <iant@google.com>
7513
7514 * incremental.h (class Incremental_input_entry): Add virtual
7515 destructor.
7516
809313cb
ILT
75172010-08-27 Ian Lance Taylor <iant@google.com>
7518
7519 * testsuite/start_lib_test_3.c: Mark t3 as used.
7520
11e32464
NC
75212010-08-27 Nick Clifton <nickc@redhat.com>
7522
7523 * options.cc (version_script): Fix small typo in previous
7524 whitespace tidyup.
7525
ca09d69a
NC
75262010-08-25 Nick Clifton <nickc@redhat.com>
7527
7528 * archive.cc: Formatting fixes: Remove whitespace between
7529 typename and following asterisk. Remove whitespace between
7530 function name and opening parenthesis.
7531 * archive.h: Likewise.
7532 * arm.cc: Likewise.
7533 * attributes.cc: Likewise.
7534 * attributes.h: Likewise.
7535 * common.cc: Likewise.
7536 * copy-relocs.cc: Likewise.
7537 * dirsearch.h: Likewise.
7538 * dynobj.cc: Likewise.
7539 * ehframe.cc: Likewise.
7540 * ehframe.h: Likewise.
7541 * expression.cc: Likewise.
7542 * fileread.cc: Likewise.
7543 * fileread.h: Likewise.
7544 * gc.h: Likewise.
7545 * gold-threads.cc: Likewise.
7546 * gold.cc: Likewise.
7547 * i386.cc: Likewise.
7548 * icf.h: Likewise.
7549 * incremental-dump.cc: Likewise.
7550 * incremental.cc: Likewise.
7551 * layout.cc: Likewise.
7552 * layout.h: Likewise.
7553 * main.cc: Likewise.
7554 * merge.cc: Likewise.
7555 * merge.h: Likewise.
7556 * object.cc: Likewise.
7557 * object.h: Likewise.
7558 * options.cc: Likewise.
7559 * options.h: Likewise.
7560 * output.cc: Likewise.
7561 * output.h: Likewise.
7562 * plugin.cc: Likewise.
7563 * plugin.h: Likewise.
7564 * powerpc.cc: Likewise.
7565 * reloc.cc: Likewise.
7566 * script-c.h: Likewise.
7567 * script-sections.cc: Likewise.
7568 * script.cc: Likewise.
7569 * stringpool.cc: Likewise.
7570 * symtab.cc: Likewise.
7571 * symtab.h: Likewise.
7572 * target.cc: Likewise.
7573 * timer.cc: Likewise.
7574 * timer.h: Likewise.
7575 * version.cc: Likewise.
7576 * x86_64.cc: Likewise.
7577
b8fa8750
NC
75782010-08-24 Nick Clifton <nickc@redhat.com>
7579
7580 PR 11899
7581 * layout.cc (segment_precedes): Sort segments by their physical
7582 addresses, if they have been set.
7583
9919d93b
CC
75842010-08-23 Cary Coutant <ccoutant@google.com>
7585
7586 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7587 symbols data.
7588 (Lib_group::include_member): Unlock object after deleting its
7589 symbols data.
7590 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7591 the bug fixed here.
7592
97b4be1c
CC
75932010-08-19 Neil Vachharajani <nvachhar@google.com>
7594 Cary Coutant <ccoutant@google.com>
7595
7596 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7597 constructor, and set_blocker.
7598 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7599 readsyms_blocker_.
7600 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7601 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7602 * testsuite/Makefile.am (start_lib_test): New test case.
7603 * testsuite/Makefile.in: Regenerate.
7604 * testsuite/start_lib_test_main.c: New file.
7605 * testsuite/start_lib_test_1.c: New file.
7606 * testsuite/start_lib_test_2.c: New file.
7607 * testsuite/start_lib_test_3.c: New file.
7608
dd0b1884
ILT
76092010-08-19 Ian Lance Taylor <iant@google.com>
7610
7611 * Makefile.in: Rebuild with automake 1.11.1.
7612 * aclocal.m4: Likewise.
7613 * testsuite/Makefile.in: Likewise.
7614
7223e9ca
ILT
76152010-08-19 Ian Lance Taylor <iant@google.com>
7616
7617 PR 10893
7618 * i386.cc (class Output_data_plt_i386): Update declarations.
7619 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7620 local_ifuncs_ fields.
7621 (Target_i386::do_plt_section_for_global): New function.
7622 (Target_i386::do_plt_section_for_local): New function.
7623 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7624 parameter; change all callers. Initialize global_ifuncs_ and
7625 local_ifuncs_. If doing a static link define __rel_iplt_start and
7626 __rel_iplt_end.
7627 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7628 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7629 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7630 symbols.
7631 (Target_i386::make_plt_section): New function, broken out of
7632 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7633 (Target_i386::make_plt_entry): Call make_plt_section.
7634 (Target_i386::make_local_ifunc_plt_entry): New function.
7635 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7636 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7637 R_386_IRELATIVE to switch.
7638 (Target_i386::Scan::global): Likewise.
7639 (Target_i386::Relocate::relocate): Likewise.
7640 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7641 switch.
7642 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7643 (Target_x86_64::do_plt_section_for_global): New function.
7644 (Target_x86_64::do_plt_section_for_local): New function.
7645 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7646 parameter; change all callers. If doing a static link define
7647 __rela_iplt_start and __rela_iplt_end.
7648 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7649 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7650 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7651 to point to .plt.
7652 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7653 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7654 switch.
7655 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7656 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7657 R_X86_64_IRELATIVE to switch.
7658 (Target_x86_64::Scan::global): Likewise.
7659 (Target_x86_64::Relocate::relocate): Likewise.
7660 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7661 switch.
7662 * target.h (class Target): Add plt_section_for_global and
7663 plt_section_for_local functions. Add do_plt_section_for_global
7664 and do_plt_section_for_local virtual functions.
7665 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7666 clarifying comments.
7667 (Symbol::use_plt_offset): Handle IFUNC symbol.
7668 * object.cc (Sized_relobj::Sized_relobj): Initialize
7669 local_plt_offsets_.
7670 (Sized_relobj::local_has_plt_offset): New function.
7671 (Sized_relobj::local_plt_offset): New function.
7672 (Sized_relobj::set_local_plt_offset): New function.
7673 (Sized_relobj::do_count): Handle IFUNC symbol.
7674 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7675 a bit away from input_shndx_ field. Add set_is_func_symbol and
7676 is_ifunc_symbol functions.
7677 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7678 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7679 local_plt_offsets_ field.
7680 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7681 * output.h (class Output_section_data): Add non-const
7682 output_section function.
7683 (class Output_data_got): Update declarations.
7684 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7685 Add use_plt_offset parameter to global and local constructors.
7686 Change all callers. Change local_sym_index_ field to 31 bits.
7687 Change GSYM_CODE and CONSTANT_CODE accordingly.
7688 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7689 doing a static link don't set sh_link field.
7690 (Output_data_got::Got_entry::write): Use PLT offset if
7691 appropriate.
7692 (Output_data_got::add_global_plt): New function.
7693 (Output_data_got::add_local_plt): New function.
7694 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7695 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7696 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7697 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7698 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7699 IFUNC conditional.
7700 * testsuite/ifunc-sel.h: New file.
7701 * testsuite/ifuncmain1.c: New file.
7702 * testsuite/ifuncmain1vis.c: New file.
7703 * testsuite/ifuncmod1.c: New file.
7704 * testsuite/ifuncdep2.c: New file.
7705 * testsuite/ifuncmain2.c: New file.
7706 * testsuite/ifuncmain3.c: New file.
7707 * testsuite/ifuncmod3.c: New file.
7708 * testsuite/ifuncmain4.c: New file.
7709 * testsuite/ifuncmain5.c: New file.
7710 * testsuite/ifuncmod5.c: New file.
7711 * testsuite/ifuncmain6pie.c: New file.
7712 * testsuite/ifuncmod6.c: New file.
7713 * testsuite/ifuncmain7.c: New file.
7714 * configure, testsuite/Makefile.in: Rebuild.
7715
56f75c03
ILT
77162010-08-18 Ian Lance Taylor <iant@google.com>
7717
7718 * incremental.cc
7719 (Output_section_incremental_inputs::write_input_files): Add cast
7720 to avoid signed/unsigned comparison warning.
7721 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7722
55455f89
CC
77232010-08-12 Cary Coutant <ccoutant@google.com>
7724
7725 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7726
e2054bcb
ILT
77272010-08-13 Ian Lance Taylor <iant@google.com>
7728
7729 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7730
74f67560
DK
77312010-08-12 Cary Coutant <ccoutant@google.com>
7732 Doug Kwan <dougkwan@google.com>
7733
7734 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7735 defintion overrides non-weak undef, remember that the original undef
7736 is not weak.
7737 * symtab.cc (Symbol_table::sized_write_global): For undef without
7738 an original weak binding, set binding to global in output.
7739 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7740 * testsuite/Makefile.in: Regenerate.
7741 * testsuite/strong_ref_weak_def.sh: New file.
7742 * testsuite/strong_ref_weak_def_1.c: Ditto.
7743 * testsuite/strong_ref_weak_def_2.c: Ditto.
7744
d1238d12
CC
77452010-08-12 Cary Coutant <ccoutant@google.com>
7746
7747 * testsuite/incremental_test.sh: Rewrite.
7748 * testsuite/incremental_test_1.c: Rewrite.
7749 * testsuite/incremental_test_2.c: Rewrite.
7750
0e70b911
CC
77512010-08-12 Cary Coutant <ccoutant@google.com>
7752
7753 * arm.cc (Target_arm::got_size): Add const.
7754 (Target_arm::got_entry_count): New function.
7755 (Target_arm::plt_entry_count): New function.
7756 (Target_arm::first_plt_entry_offset): New function.
7757 (Target_arm::plt_entry_size): New function.
7758 (Output_data_plt_arm::entry_count): New function.
7759 (Output_data_plt_arm::first_plt_entry_offset): New function.
7760 (Output_data_plt_arm::get_plt_entry_size): New function.
7761 * i386.cc (Target_i386::got_size): Add const.
7762 (Target_i386::got_entry_count): New function.
7763 (Target_i386::plt_entry_count): New function.
7764 (Target_i386::first_plt_entry_offset): New function.
7765 (Target_i386::plt_entry_size): New function.
7766 (Output_data_plt_i386::entry_count): New function.
7767 (Output_data_plt_i386::first_plt_entry_offset): New function.
7768 (Output_data_plt_i386::get_plt_entry_size): New function.
7769 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7770 find_incremental_inputs_sections. Dump incremental_got_plt section.
7771 * incremental.cc: Include target.h.
7772 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7773 parameter. Adjust all callers. Find incremental_got_plt section.
7774 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7775 section.
7776 (Output_section_incremental_inputs::set_final_data_size): Calculate
7777 size of incremental_got_plt section.
7778 (Output_section_incremental_inputs::do_write): Write the
7779 incremental_got_plt section.
7780 (Got_plt_view_info): New struct.
7781 (Local_got_offset_visitor): New class.
7782 (Global_got_offset_visitor): New class.
7783 (Global_symbol_visitor_got_plt): New class.
7784 (Output_section_incremental_inputs::write_got_plt): New function.
7785 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7786 Add parameter. Adjust all callers.
7787 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7788 (Incremental_inputs::got_plt_section): New function.
7789 (Incremental_inputs::got_plt_section_): New data member.
7790 (Incremental_got_plt_reader): New class.
7791 * layout.cc (Layout::create_incremental_info_sections): Add the
7792 incremental_got_plt section.
7793 * object.h (Got_offset_list::get_list): New function.
7794 (Got offset_list::for_all_got_offsets): New function.
7795 (Sized_relobj::local_got_offset_list): New function.
7796 * powerpc.cc (Target_powerpc::got_size): Add const.
7797 (Target_powerpc::got_entry_count): New function.
7798 (Target_powerpc::plt_entry_count): New function.
7799 (Target_powerpc::first_plt_entry_offset): New function.
7800 (Target_powerpc::plt_entry_size): New function.
7801 (Output_data_plt_powerpc::entry_count): New function.
7802 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7803 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7804 * sparc.cc (Target_sparc::got_size): Add const.
7805 (Target_sparc::got_entry_count): New function.
7806 (Target_sparc::plt_entry_count): New function.
7807 (Target_sparc::first_plt_entry_offset): New function.
7808 (Target_sparc::plt_entry_size): New function.
7809 (Output_data_plt_sparc::entry_count): New function.
7810 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7811 (Output_data_plt_sparc::get_plt_entry_size): New function.
7812 * symtab.h (Symbol::got_offset_list): New function.
7813 (Symbol_table::for_all_symbols): New function.
7814 * target.h (Sized_target::got_entry_count): New function.
7815 (Sized_target::plt_entry_count): New function.
7816 (Sized_target::plt_entry_size): New function.
7817 * x86_64.cc (Target_x86_64::got_size): Add const.
7818 (Target_x86_64::got_entry_count): New function.
7819 (Target_x86_64::plt_entry_count): New function.
7820 (Target_x86_64::first_plt_entry_offset): New function.
7821 (Target_x86_64::plt_entry_size): New function.
7822 (Output_data_plt_x86_64::entry_count): New function.
7823 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7824 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7825
09ec0418
CC
78262010-08-12 Cary Coutant <ccoutant@google.com>
7827
7828 * archive.cc: Include incremental.h.
7829 (Archive::Archive): Initialize incremental_info_.
7830 (Archive::include_member): Record archive members in incremental info.
7831 (Add_archive_symbols::run): Record begin and end of an archive in
7832 incremental info.
7833 (Lib_group::include_member): Record objects in incremental info.
7834 * archive.h (Incremental_archive_entry): Forward declaration.
7835 (Archive::set_incremental_info): New member function.
7836 (Archive::incremental_info): New member function.
7837 (Archive::Unused_symbol_iterator): New class.
7838 (Archive::unused_symbols_begin): New member function.
7839 (Archive::unused_symbols_end): New member function.
7840 (Archive::incremental_info_): New data member.
7841 * incremental-dump.cc (find_input_containing_global): New function.
7842 (dump_incremental_inputs): Dump new incremental info sections.
7843 * incremental.cc: Include symtab.h.
7844 (Output_section_incremental_inputs): New class.
7845 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7846 new incremental info sections.
7847 (Sized_incremental_binary::do_check_inputs): Likewise.
7848 (Incremental_inputs::report_archive): Remove.
7849 (Incremental_inputs::report_archive_begin): New function.
7850 (Incremental_inputs::report_archive_end): New function.
7851 (Incremental_inputs::report_object): New function.
7852 (Incremental_inputs::finalize_inputs): Remove.
7853 (Incremental_inputs::report_input_section): New function.
7854 (Incremental_inputs::report_script): Rewrite.
7855 (Incremental_inputs::finalize): Do nothing but finalize string table.
7856 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7857 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7858 (Incremental_inputs::create_data_sections): New function.
7859 (Incremental_inputs::relocs_entsize): New function.
7860 (Output_section_incremental_inputs::set_final_data_size): New function.
7861 (Output_section_incremental_inputs::do_write): New function.
7862 (Output_section_incremental_inputs::write_header): New function.
7863 (Output_section_incremental_inputs::write_input_files): New function.
7864 (Output_section_incremental_inputs::write_info_blocks): New function.
7865 (Output_section_incremental_inputs::write_symtab): New function.
7866 * incremental.h (Incremental_script_entry): Forward declaration.
7867 (Incremental_object_entry): Forward declaration.
7868 (Incremental_archive_entry): Forward declaration.
7869 (Incremental_inputs): Forward declaration.
7870 (Incremental_inputs_header_data): Remove.
7871 (Incremental_inputs_header): Remove.
7872 (Incremental_inputs_header_write): Remove.
7873 (Incremental_inputs_entry_data): Remove.
7874 (Incremental_inputs_entry): Remove.
7875 (Incremental_inputs_entry_write): Remove.
7876 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7877 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7878 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7879 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7880 Likewise.
7881 (Incremental_input_entry): New class.
7882 (Incremental_script_entry): New class.
7883 (Incremental_object_entry): New class.
7884 (Incremental_archive_entry): New class.
7885 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7886 (Incremental_inputs::report_inputs): Remove.
7887 (Incremental_inputs::report_archive): Remove.
7888 (Incremental_inputs::report_archive_begin): New function.
7889 (Incremental_inputs::report_archive_end): New function.
7890 (Incremental_inputs::report_object): Change prototype.
7891 (Incremental_inputs::report_input_section): New function.
7892 (Incremental_inputs::report_script): Change prototype.
7893 (Incremental_inputs::get_reloc_count): New function.
7894 (Incremental_inputs::set_reloc_count): New function.
7895 (Incremental_inputs::create_data_sections): New function.
7896 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7897 (Incremental_inputs::inputs_section): New function.
7898 (Incremental_inputs::symtab_section): New function.
7899 (Incremental_inputs::relocs_section): New function.
7900 (Incremental_inputs::get_stringpool): Add const.
7901 (Incremental_inputs::command_line): Add const.
7902 (Incremental_inputs::inputs): Remove.
7903 (Incremental_inputs::command_line_key): New function.
7904 (Incremental_inputs::input_file_count): New function.
7905 (Incremental_inputs::input_files): New function.
7906 (Incremental_inputs::relocs_entsize): New function.
7907 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7908 (Incremental_inputs::finalize_inputs): Remove.
7909 (Incremental_inputs::Input_info): Remove.
7910 (Incremental_inputs::lock_): Remove.
7911 (Incremental_inputs::inputs_): Change type.
7912 (Incremental_inputs::inputs_map_): Remove.
7913 (Incremental_inputs::current_object_entry_): New data member.
7914 (Incremental_inputs::inputs_section_): New data member.
7915 (Incremental_inputs::symtab_section_): New data member.
7916 (Incremental_inputs::relocs_section_): New data member.
7917 (Incremental_inputs::reloc_count_): New data member.
7918 (Incremental_inputs_reader): New class.
7919 (Incremental_symtab_reader): New class.
7920 (Incremental_relocs_reader): New class.
7921 * layout.cc (Layout::finalize): Move finalization of incremental info
7922 and creation of incremental info sections to follow finalization of
7923 symbol table. Set offsets for postprocessing sections.
7924 (Layout::create_incremental_info_sections): Call
7925 Incremental_inputs::create_data_sections. Add incremental symtab
7926 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7927 sections to layout after input sections.
7928 * layout.h (struct Timespec): Forward declaration.
7929 (Layout::incremental_inputs): Add const.
7930 (Layout::create_incremental_info_sections): Add parameter.
7931 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7932 * object.cc: Include incremental.h.
7933 (Relobj::finalize_incremental_relocs): New function.
7934 (Sized_relobj::do_layout): Record input sections in incremental info.
7935 * object.h (Object::output_section): New function.
7936 (Object::output_section_offset): Moved from Relobj.
7937 (Object::get_incremental_reloc_base): New function.
7938 (Object::get_incremental_reloc_count): New function.
7939 (Object::do_output_section): New function.
7940 (Object::do_output_section_offset): Moved from Relobj.
7941 (Object::do_get_incremental_reloc_base): New function.
7942 (Object::do_get_incremental_reloc_count): New function.
7943 (Object::Object): Initialize new data members.
7944 (Relobj::output_section): Renamed do_output_section and moved to
7945 protected.
7946 (Relobj::output_section_offset): Moved to Object.
7947 (Relobj::do_get_incremental_reloc_base): New function.
7948 (Relobj::do_get_incremental_reloc_count): New function.
7949 (Relobj::allocate_incremental_reloc_counts): New function.
7950 (Relobj::count_incremental_reloc): New function.
7951 (Relobj::finalize_incremental_relocs): New function.
7952 (Relobj::next_incremental_reloc_index): New function.
7953 (Relobj::reloc_counts_): New data member.
7954 (Relobj::reloc_bases_): New data member.
7955 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7956 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7957 (Sized_relobj::incremental_relocs_scan): New function.
7958 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7959 (Sized_relobj::incremental_relocs_write): New function.
7960 (Sized_relobj::incremental_relocs_write_reltype): New function.
7961 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7962 incremental link.
7963 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7964 archives and object files elsewhere.
7965 (Add_symbols::run): Report object files here.
7966 (Finish_group::run): Report end of archive at end of group.
7967 * reloc.cc: Include layout.h, incremental.h.
7968 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7969 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7970 (Sized_relobj::incremental_relocs_scan): New function.
7971 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7972 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7973 (Sized_relobj::incremental_relocs_write): New function.
7974 (Sized_relobj::incremental_relocs_write_reltype): New function.
7975 * script.cc (read_input_script): Rewrite test for incremental link.
7976 Change call to Incremental_inputs::report_script.
7977 * symtab.h (Symbol_table::first_global_index): New function.
7978 (Symbol_table::output_count): New function.
7979
ce0d1972
DK
79802010-08-12 Doug Kwan <dougkwan@google.com>
7981
7982 * arm.cc (Target_arm::merge_object_attributes): Check command line
7983 options --no-wchar-size-warning and --no-enum-size-warning.
7984 * options.h (General_options): Add ld-compatible options
7985 --no-enum-size-warning and --no-wchar-size-warning.
7986
6e5710ce
ILT
79872010-08-04 Ian Lance Taylor <iant@google.com>
7988
7989 * x86_64.cc (Target_x86_64::Scan::local): Use
7990 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7991 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7992 (Target_x86_64::Scan::global): Likewise.
7993 (Target_x86_64::Relocate::relocate): Likewise.
7994 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7995 Likewise.
7996
fef830db
CC
79972010-08-03 Cary Coutant <ccoutant@google.com>
7998
7999 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8000 to reserve space in merged_strings vector. Keep total input size
8001 for stats.
8002 (Output_merge_string::do_print_merge_stats): Print total input size.
8003 * merge.h (Output_merge_string): Add input_size_ field.
8004 * stringpool.cc (Stringpool_template::string_length): Move
8005 implementations out of Stringpool_template class and place in
8006 stringpool.h.
8007 * stringpool.h (string_length): Move out of Stringpool_template.
8008
1e3811b0
ILT
80092010-08-03 Ian Lance Taylor <iant@google.com>
8010
8011 PR 11712
8012 * layout.cc (relaxation_loop_body): If address of load segment is
8013 set, adjust address to include headers if possible.
8014
7af0c620
ILT
80152010-08-03 Ian Lance Taylor <iant@google.com>
8016
8017 * version.cc (version_string): Bump to 1.10.
8018
22f0da72
ILT
80192010-08-03 Ian Lance Taylor <iant@google.com>
8020
8021 PR 11805
8022 * layout.h (enum Output_section_order): Define.
8023 (class Layout): Update declarations.
8024 * layout.cc (Layout::get_output_section): Add order parameter.
8025 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8026 is_first_non_relro parameters. Change all callers.
8027 (Layout::choose_output_section): Likewise.
8028 (Layout::add_output_section_data): Likewise.
8029 (Layout::make_output_section): Likewise. Set order.
8030 (Layout::default_section_order): New function.
8031 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8032 * output.cc (Output_section::Output_section): Initialize order_.
8033 Don't initialize deleted fields.
8034 (Output_segment::Output_segment): Don't initialize deleted
8035 fields.
8036 (Output_segment::add_output_section_to_load): New function
8037 replacing add_output_section. Change all callers to call this or
8038 add_output_section_to_nonload.
8039 (Output_segment::add_output_section_to_nonload): New function.
8040 (Output_segment::remove_output_section): Rewrite.
8041 (Output_segment::add_initial_output_data): Likewise.
8042 (Output_segment::has_any_data_sections): Likewise.
8043 (Output_segment::is_first_section_relro): Likewise.
8044 (Output_segment::maximum_alignment): Likewise.
8045 (Output_segment::has_dynamic_reloc): New function replacing
8046 dynamic_reloc_count. Change all callers.
8047 (Output_segment::has_dynamic_reloc_list): New function replacing
8048 dynamic_reloc_count_list. Change all callers.
8049 (Output_segment::set_section_addresses): Rewrite.
8050 (Output_segment::set_offset): Rewrite.
8051 (Output_segment::find_first_and_last_list): Remove.
8052 (Output_segment::set_tls_offsets): Rewrite.
8053 (Output_segment::first_section_load_address): Likewise.
8054 (Output_segment::output_section_count): Likewise.
8055 (Output_segment::section_with_lowest_load_address): Likewise.
8056 (Output_segment::write_section_headers): Likewise.
8057 (Output_segment::print_sections_to_map): Likewise.
8058 * output.h (class Output_data): Remove dynamic_reloc_count_
8059 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8060 (Output_data::add_dynamic_reloc): Rewrite.
8061 (Output_data::has_dynamic_reloc): New function.
8062 (Output_data::dynamic_reloc_count): Remove.
8063 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8064 is_last_relro_, is_first_non_relro_, is_interp_,
8065 is_dynamic_linker_section_ fields. Add order and set_order
8066 functions. Remove is_relro_local, set_is_relro_local,
8067 is_last_relro, set_is_last_relro, is_first_non_relro,
8068 set_is_first_non_relro functions, is_interp, set_is_interp,
8069 is_dynamic_linker_section, and set_is_dynamic_linker_section
8070 functions.
8071 (class Output_segment): Change Output_data_list from std::list to
8072 std:;vector. Add output_lists_ field. Remove output_data_ and
8073 output_bss_ fields. Update declarations.
8074
3ff2ccb0
ILT
80752010-08-02 Ian Lance Taylor <iant@google.com>
8076
8077 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8078 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8079 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8080
88a4108b
ILT
80812010-08-02 Ian Lance Taylor <iant@google.com>
8082
8083 PR 11855
8084 * script.cc (Script_options::Script_options): Initialize
8085 symbol_definitions_ and symbol_references_.
8086 (Script_options::add_symbol_assignment): Update
8087 symbol_definitions_ and symbol_references_.
8088 (Script_options::add_symbol_reference): New function.
8089 (script_symbol): New function.
8090 * script.h (class Script_options): Add symbol_definitions_ and
8091 symbol_references_ fields.
8092 (Script_options::referenced_const_iterator): New type.
8093 (Script_options::referenced_begin): New function.
8094 (Script_options::referenced_end): New function.
8095 (Script_options::is_referenced): New function.
8096 (Script_options::any_unreferenced): New function.
8097 * script-c.h (script_symbol): Declare.
8098 * yyscript.y (exp): Call script_symbol.
8099 * symtab.cc: Include "script.h".
8100 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8101 Change all callers. Check symbols referenced by scripts.
8102 (Symbol_table::add_undefined_symbols_from_command_line): Add
8103 layout parameter. Change all callers.
8104 (Symbol_table::do_add_undefined_symbols_from_command_line):
8105 Likewise. Break out loop body. Check symbols referenced by
8106 scripts.
8107 (Symbol_table::add_undefined_symbol_from_command_line): New
8108 function broken out of
8109 do_add_undefined_symbols_from_command_line.
8110 * symtab.h (class Symbol_table): Update declarations.
8111 * archive.cc: Include "layout.h".
8112 (Archive::should_include_member): Add layout parameter. Change
8113 all callers. Check for symbol mentioned in expression.
8114 * archive.h (class Archive): Update declaration.
8115 * object.cc (Sized_relobj::do_should_include_member): Add layout
8116 parameter.
8117 * object.h (Object::should_include_member): Add layout parameter.
8118 Change all callers.
8119 (Object::do_should_include_member): Add layout parameter.
8120 (class Sized_relobj): Update declaration.
8121 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8122 parameter.
8123 * dynobj.h (class Sized_dynobj): Update declaration.
8124 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8125 layout parameter.
8126 * plugin.h (class Sized_pluginobj): Update declaration.
8127
5f1ab67a
ILT
81282010-08-02 Ian Lance Taylor <iant@google.com>
8129
8130 PR 11866
8131 * output.cc (Output_segment::set_offset): Search for the first and
8132 last sections rather than assuming that the list is in order.
8133 (Output_segment::find_first_and_last_list): New function.
8134 * output.h (class Output_segment): Update declarations.
8135 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8136 (relro_strip_test_SOURCES): New variable.
8137 (relro_strip_test_DEPENDENCIES): New variable.
8138 (relro_strip_test_LDFLAGS): New variable.
8139 (relro_strip_test_LDADD): New variable.
8140 (relro_strip_test.so): New target.
8141
a8df5856
ILT
81422010-08-02 Ian Lance Taylor <iant@google.com>
8143
8144 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8145 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8146 (Target_i386::got_tlsdesc_section): New function.
8147 (Target_i386::got_section): Create space for GOT entries for
8148 TLSDESC relocations.
8149 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8150 R_386_TLS_GOTDESC.
8151 (Target_i386::Scan::global): Likewise.
8152 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8153 using TLSDESC GOT.
8154 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8155 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8156 (Target_x86_64::got_tlsdesc_section): New function.
8157 (Target_x86_64::got_section): Create space for GOT entries for
8158 TLSDESC relocations.
8159 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8160 R_386_TLS_GOTDESC.
8161 (Target_x86_64::Scan::global): Likewise.
8162 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8163 using TLSDESC GOT.
8164
0c10a0a6
ILT
81652010-08-02 Ian Lance Taylor <iant@google.com>
8166
8167 * testsuite/final_layout.sh: Use dc to convert from hex to
8168 decimal.
8169
41cbeecc
ST
81702010-07-29 Sriraman Tallam <tmsriram@google.com>
8171
8172 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8173 paramter to the call to gold::gc_process_relocs.
8174 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8175 paramter to the call to gold::gc_process_relocs.
8176 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8177 parameter to the call to gold::gc_process_relocs.
8178 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8179 template parameter to the call to gold::gc_process_relocs.
8180 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8181 paramter to the call to gold::gc_process_relocs.
8182 * gc.h (get_embedded_addend_size): New function.
8183 (gc_process_relocs): Save the size of the reloc for use by ICF.
8184 * icf.cc (get_section_contents): Get the addend from the text section
8185 for SHT_REL relocation sections.
8186 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8187 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8188 * int_encoding.h (read_from_pointer): New overloaded function.
8189 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8190 * testsuite/icf_sht_rel_addend_test.sh: New file.
8191 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8192 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8193
6ea55b82
RW
81942010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8195
8196 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8197 * Makefile.in: Regenerate.
8198 * testsuite/Makefile.in: Regenerate.
8199
9691462b
ILT
82002010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8201
8202 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8203 * gold/testsuite/debug_msg.cc: Likewise.
8204 * gold/testsuite/odr_violation1.cc
8205 * gold/testsuite/odr_violation2.cc
8206
76897331
CC
82072010-07-21 Cary Coutant <ccoutant@google.com>
8208
8209 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8210 string, and length fields.
8211 (Output_merge_string::Merged_strings_list): New type.
8212 (Output_merge_string::Merged_strings_lists): New typedef.
8213 (Output_merge_string): Replace merged_strings_ with
8214 merged_strings_lists_.
8215 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8216 Merged_strings_list per input object and section. Don't store pointer
8217 to the string. Don't store length with each merged string entry.
8218 (Output_merge_string::finalize_merged_data): Loop over list of merged
8219 strings lists. Recompute length of each merged string.
8220
78384e8f
CC
82212010-07-15 Cary Coutant <ccoutant@google.com>
8222
8223 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8224 here.
8225
783659f9
ILT
82262010-07-14 Ian Lance Taylor <iant@google.com>
8227
8228 * descriptors.cc (Descriptors::open): Report correct name in error
8229 message.
8230
131687b4
DK
82312010-07-13 Doug Kwan <dougkwan@google.com>
8232
8233 * arm.cc (Arm_input_section::Arm_input_section): For a
8234 SHT_ARM_EXIDX section, always keeps the input sections.
8235 (Arm_input_section::set_exidx_section_link): New method.
8236 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8237 has_errors_ to false.
8238 (Arm_exidx_input_section::has_errors,
8239 Arm_exidx_input_section::set_has_errors): New methods.
8240 (Arm_exidx_input_section::has_errors_): New data member.
8241 (Arm_relobj::get_exidx_shndx_list): New method.
8242 (Arm_output_section::append_text_sections_to_list): Do not skip
8243 section without SHF_EXECINSTR.
8244 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8245 errors.
2e702c99 8246 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8247 section header. Make error messages more verbose. Check for
8248 a non-executable section linked to an EXIDX section.
8249 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8250 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8251 check that there is no deferred EXIDX section if we exit early.
8252 Instead of not making an EXIDX section in case of an error, make one
8253 and set the has_errors flag of it.
8254 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8255 in a relocatable link.
8256 (Target_arm::do_relax): Look for the EXIDX output section instead of
8257 assuming that it is called .ARM.exidx.
2e702c99 8258 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8259 section list. Do not check for SHF_EXECINSTR section flags but
8260 skip any input section with errors.
8261 * output.cc (Output_section::Output_section): Initialize
8262 always_keeps_input_sections_ to false.
8263 (Output_section::add_input_section): Check for
8264 always_keeps_input_sections_.
8265 * output.h (Output_section::always_keeps_input_sections,
8266 Output_section::set_always_keeps_input_sections): New methods.
8267 (Output_section::always_keeps_input_sections): New data member.
8268
69517287
RÁE
82692010-07-13 Rafael Espindola <espindola@google.com>
8270
8271 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8272 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8273
82742395
ILT
82742010-07-13 Philip Herron <herron.philip@googlemail.com>
8275 Ian Lance Taylor <iant@google.com>
8276
8277 * output.h (Output_section_lookup_maps::add_merge_section):
8278 Correct check of whether value was inserted.
8279 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8280 (Output_section_lookup_maps::add_relaxed_input_section):
8281 Likewise.
8282 * arm.cc (Target_arm::got_section): Remove used local os.
8283 * i386.cc (Target_i386::got_section): Likewise.
8284 * x86_64.cc (Target_x86_64::got_section): Likewise.
8285 * sparc.cc (Target_sparc::got_section): Likewise.
8286 (Target_sparc::relocate): Remove unused local have_got_offset.
8287 * powerpc.cc (Target_powerpc::relocate): Likewise.
8288
f2d707b5
ILT
82892010-07-13 Ian Lance Taylor <iant@google.com>
8290
241531d6
ILT
8291 * compressed_output.cc (zlib_decompress): Fix signature in
8292 !HAVE_ZLIB_H case.
8293
f2d707b5
ILT
8294 * archive.cc (Archive::include_member): Unlock an external member
8295 of a thin archive. Don't bother to delete an object we know is
8296 NULL.
8297
a2e47362
CC
82982010-07-12 Cary Coutant <ccoutant@google.com>
8299
8300 * compressed_output.cc (zlib_decompress): New function.
8301 (get_uncompressed_size): New function.
8302 (decompress_input_section): New function.
8303 * compressed_output.h (get_uncompressed_size): New function.
8304 (decompress_input_section): New function.
8305 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8306 Handle compressed debug sections.
8307 * layout.cc (is_compressed_debug_section): New function.
8308 (Layout::output_section_name): Map compressed section names to
8309 canonical names.
8310 * layout.h (is_compressed_debug_section): New function.
8311 (is_debug_info_section): Recognize compressed debug sections.
8312 * merge.cc: Include compressed_output.h.
8313 (Output_merge_data::do_add_input_section): Handle compressed
8314 debug sections.
8315 (Output_merge_string::do_add_input_section): Handle compressed
8316 debug sections.
8317 * object.cc: Include compressed_output.h.
8318 (Sized_relobj::Sized_relobj): Initialize new data members.
8319 (build_compressed_section_map): New function.
8320 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8321 * object.h (Object::section_is_compressed): New method.
8322 (Object::do_section_is_compressed): New method.
8323 (Sized_relobj::Compressed_section_map): New type.
8324 (Sized_relobj::do_section_is_compressed): New method.
8325 (Sized_relobj::compressed_sections_): New data member.
8326 * output.cc (Output_section::add_input_section): Handle compressed
8327 debug sections.
8328 * reloc.cc: Include compressed_output.h.
8329 (Sized_relobj::write_sections): Handle compressed debug sections.
8330
ce279a62
CC
83312010-07-08 Cary Coutant <ccoutant@google.com>
8332
8333 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8334 weak when resolving to a dynamic def.
8335 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8336 for weak undef/dynamic def cases. Adjust callers.
8337 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8338 undef_binding_weak_.
8339 (Symbol_table::sized_write_globals): Adjust symbol binding.
8340 (Symbol_table::sized_write_symbol): Add binding parameter.
8341 * symtab.h (Symbol::set_undef_binding): New method.
8342 (Symbol::is_undef_binding_weak): New method.
8343 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8344 (Symbol_table::should_override): Add new parameter.
8345 (Symbol_table::sized_write_symbol): Add new parameter.
8346
8347 * testsuite/weak_undef_file1.cc: Add new test case.
8348 * testsuite/weak_undef_file2.cc: Fix header comment.
8349 * testsuite/weak_undef_test.cc: Add new test case.
8350
b2286c10
DK
83512010-06-29 Doug Kwan <dougkwan@google.com>
8352
8353 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8354 Initialize USE_SYMBOL_.
8355 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8356 definition.
8357 (Arm_reloc_property::uses_symbol_): New data member declaration.
8358 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8359 uses symbol value and symbol is undefined but not weakly undefined.
8360
4802450a
RÁE
83612010-06-28 Rafael Espindola <espindola@google.com>
8362
8363 * plugin.cc (Plugin::load): Use dlerror.
8364
e5ca47ba
ILT
83652010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8366
8367 * symtab.cc (detect_odr_violations): When reporting an ODR
8368 violation, report an object where the symbol is defined.
8369
8a75a161
DK
83702010-06-25 Doug Kwan <dougkwan@google.com>
8371
8372 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8373 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8374 definition.
8375 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8376 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8377 target hook to detect function points.
8378 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8379 * icf.h (Icf::check_section_for_function_pointers): Change type of
8380 parameter SECTION_NAME to const reference to std::string. Use
8381 target hook to determine if section may have unsafe pointers.
8382 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8383 method definition.
8384
42218b9f
RÁE
83852010-06-21 Rafael Espindola <espindola@google.com>
8386
8387 * fileread.cc (Input_file::find_fie): New
8388 (Input_file::open): Use Input_file::find_fie.
8389 * fileread.h (Input_file::find_fie): New
8390 * plugin.cc (set_extra_library_path): New.
8391 (Plugin::load): Add set_extra_library_path to the transfer vector.
8392 (Plugin_manager::set_extra_library_path): New.
8393 (Plugin_manager::add_input_file): Use the extra search path if set.
8394 (set_extra_library_path(): New.
8395 * plugin.h (Plugin_manager): Add set_extra_library_path and
8396 extra_search_path_.
8397
a0506cca
CC
83982010-06-19 Cary Coutant <ccoutant@google.com>
8399
8400 * layout.cc (gdb_sections): Add .debug_types.
8401 (lines_only_debug_sections): Likewise.
8402
6508b958
RÁE
84032010-06-18 Rafael Espindola <espindola@google.com>
8404
8405 * plugin.cc (add_input_file,add_input_library)
8406 (Plugin_manager::add_input_file): Make filename arguments const.
8407 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8408 const.
8409
3e235302
DK
84102010-06-16 Doug Kwan <dougkwan@google.com>
8411
8412 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8413 .ARM.attributes section if we have not merged any input
8414 attributes sections.
8415
106e8a6c
DK
84162010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8417
8418 * arm.cc: Allow combining objects with no EABI version
8419 information.
8420
91ff43fe
RÁE
84212010-06-15 Rafael Espindola <espindola@google.com>
8422
8423 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8424
68ed838c
ILT
84252010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8426
8427 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8428 (struct iovec): Correct !HAVE_READV definition.
8429
f3a2388f
CC
84302010-06-10 Cary Coutant <ccoutant@google.com>
8431
8432 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8433 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8434 reloc sections.
8435 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8436
8437 PR 11683
8438 * symtab.h (Symbol::is_placeholder): New member function.
8439 * target-reloc.h (relocate_section): Check for placeholder symbols.
8440
8441 * testsuite/Makefile.am (plugin_test_8): New test.
8442 (plugin_test_9): New test.
8443 * testsuite/Makefile.in: Regenerate.
8444
e1df38aa
NC
84452010-06-09 Nick Clifton <nickc@redhat.com>
8446
8447 * yyscript.y (input_list_element): Allow strings prefixed with
8448 the '-' character. Treat these as libraries.
8449 * script.cc (script_add_library): New function. Adds a library
8450 specified by "-l<name>" found in an input script.
8451 * script-c.h: Add prototype for script_add_library.
8452
25bbe950
DK
84532010-06-07 Doug Kwan <dougkwan@google.com>
8454
8455 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8456 Restrict stub-group size to be within long conditional branch
8457 range when working around cortex-A8 erratum.
8458
0f32ea4c
ILT
84592010-06-07 Damien Diederen <dd@crosstwine.com>
8460
8461 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8462 #ifdef typo.
8463
8fe2a369
ST
84642010-06-03 Sriraman Tallam <tmsriram@google.com>
8465
8466 PR gold/11658
8467 * output.cc
8468 (Output_section::Input_section_sort_entry::compare_section_ordering):
8469 Change to return non-zero correctly.
8470 (Output_section::Input_section_sort_section_order_index_compare
8471 ::operator()): Change to fix ambiguity in comparisons.
8472
6e9ba2ca
ST
84732010-06-01 Sriraman Tallam <tmsriram@google.com>
8474
8475 * gold.h (is_wildcard_string): New function.
8476 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8477 (Layout::layout_eh_frame): Ditto.
8478 (Layout::find_section_order_index): New method.
8479 (Layout::read_layout_from_file): New method.
8480 * layout.h (Layout::find_section_order_index): New method.
8481 (Layout::read_layout_from_file): New method.
8482 (Layout::input_section_position_): New private member.
8483 (Layout::input_section_glob_): New private member.
8484 * main.cc (main): Call read_layout_from_file here.
8485 * options.h (--section-ordering-file): New option.
8486 * output.cc (Output_section::input_section_order_specified_): New
8487 member.
8488 (Output_section::Output_section): Initialize new member.
8489 (Output_section::add_input_section): Add new parameter.
8490 Keep input sections when --section-ordering-file is used.
8491 (Output_section::set_final_data_size): Sort input sections when
8492 section ordering file is specified.
8493 (Output_section::Input_section_sort_entry): Add new parameter.
8494 Check sorting type.
8495 (Output_section::Input_section_sort_entry::compare_section_ordering):
8496 New method.
8497 (Output_section::Input_section_sort_compare::operator()): Change to
8498 consider section_order_index.
8499 (Output_section::Input_section_sort_init_fini_compare::operator()):
8500 Change to consider section_order_index.
8501 (Output_section::Input_section_sort_section_order_index_compare
8502 ::operator()): New method.
8503 (Output_section::sort_attached_input_sections): Change to sort
8504 according to section order when specified.
e1df38aa
NC
8505 (Output_section::add_input_section<32, true>): Add new parameter.
8506 (Output_section::add_input_section<64, true>): Add new parameter.
8507 (Output_section::add_input_section<32, false>): Add new parameter.
8508 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8509 * output.h (Output_section::add_input_section): Add new parameter.
8510 (Output_section::input_section_order_specified): New
8511 method.
8512 (Output_section::set_input_section_order_specified): New method.
8513 (Input_section::Input_section): Initialize section_order_index_.
8514 (Input_section::section_order_index): New method.
8515 (Input_section::set_section_order_index): New method.
8516 (Input_section::section_order_index_): New member.
8517 (Input_section::Input_section_sort_section_order_index_compare): New
8518 struct.
8519 (Output_section::input_section_order_specified_): New member.
8520 * script-sections.cc (is_wildcard_string): Delete and move modified
8521 method to gold.h.
8522 (Output_section_element_input::Output_section_element_input): Modify
8523 call to is_wildcard_string.
8524 (Output_section_element_input::Input_section_pattern
8525 ::Input_section_pattern): Ditto.
8526 (Output_section_element_input::Output_section_element_input): Ditto.
8527 * testsuite/Makefile.am (final_layout): New test case.
8528 * testsuite/Makefile.in: Regenerate.
8529 * testsuite/final_layout.cc: New file.
8530 * testsuite/final_layout.sh: New file.
8531
3537c84b
RÁE
85322010-06-01 Rafael Espindola <espindola@google.com>
8533
8534 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8535
105b6afd
RÁE
85362010-06-01 Rafael Espindola <espindola@google.com>
8537
8538 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8539 visibility of symbols.
8540
29e11421
DK
85412010-05-27 Doug Kwan <dougkwan@google.com>
8542
8543 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8544 from start of output section instead of address for a local symbol
8545 in a merged or relaxed section when doing a relocatable link.
8546
5e0f337e
RÁE
85472010-05-26 Rafael Espindola <espindola@google.com>
8548
703d02da 8549 PR 11604
5e0f337e
RÁE
8550 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8551 adding sections the garbage collector removed.
8552 * gold/testsuite/Makefile.am: Add test.
8553 * gold/testsuite/Makefile.in: Regenerate.
8554 * gold/testsuite/plugin_test_7.sh: New.
8555 * gold/testsuite/plugin_test_7_1.c: New.
8556 * gold/testsuite/plugin_test_7_2.c: New.
8557
f4187277
RÁE
85582010-05-26 Rafael Espindola <espindola@google.com>
8559
8560 * script-sections.cc (Output_section_definition::set_section_addresses):
8561 Check for --section-start.
8562
5c388529
DK
85632010-05-26 Doug Kwan <dougkwan@google.com>
8564
8565 * arm.cc (Arm_scan_relocatable_relocs): New class.
8566 (Target_arm::relocate_special_relocatable): New method.
8567 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8568 (Arm_relocate_functions::thumb_branch_common): Same.
8569 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8570 instead of Default_scan_relocatable_relocs.
8571 * target-reloc.h (relocate_for_relocatable): Let target handle
8572 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8573 * target.h (Sized_target::relocate_special_relocatable): New method.
8574
bca1c3ae
ILT
85752010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8576
8577 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8578
0439c796
DK
85792010-05-23 Doug Kwan <dougkwan@google.com>
8580
8581 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8582 instead of a cast.
8583 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8584 with a direct branch, not a conditional branch, to a stub.
8585 * merge.cc (Output_merge_base::record_input_section): New method
8586 defintion.
8587 (Output_merge_data::do_add_input_section): Record input section if
8588 keeps-input-sections flag is set.
8589 (Output_merge_string::do_add_input_section): Ditto.
8590 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8591 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8592 INPUT_SECTIONS_.
8593 (Output_merge_base::keeps_input_sections,
8594 Output_merge_base::set_keeps_input_sections,
8595 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8596 method definitions.
8597 (Output_merge_base::Input_sections): New type declaration.
8598 (Output_merge_base::input_sections_begin,
8599 Output_merge_base::input_sections_end,
8600 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8601 (Output_merge_base::bool keeps_input_sections_,
8602 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8603 Output_merge_base::input_sections_): New data members.
8604 (Output_merge_data::do_set_keeps_input_sections): New method
8605 defintion.
8606 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8607 * output.cc (Output_section::Input_section::relobj): Move method
8608 defintion from class declaration to here and handle merge sections.
8609 (Output_section::Input_section::shndx): Ditto.
8610 (Output_section::Output_section): Remove initializations of removed
8611 data members and initialize new data member LOOKUP_MAPS_.
8612 (Output_section::add_input_section): Set keeps-input-sections flag
8613 for a newly created merge output section as appropriate. Adjust code
8614 to use Output_section_lookup_maps class.
8615 (Output_section::add_relaxed_input_section): Adjst code for lookup
8616 maps code refactoring.
2e702c99 8617 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8618 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8619 class. If adding input section to a newly created merge output
8620 section fails, remove the new merge section.
8621 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8622 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8623 (Output_section::find_merge_section): Ditto.
0439c796 8624 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8625 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8626 Output_section_lookup_maps class.
8627 (Output_section::get_input_sections): Export merge sections. Adjust
8628 code to use Output_section_lookup_maps class.
8629 (Output_section:::add_script_input_section): Adjust code to use
8630 Output_section_lookup_maps class. Update lookup maps for merge
8631 sections also.
8632 (Output_section::discard_states): Use Output_section_lookup_maps.
8633 (Output_section::restore_states): Same.
8634 * output.h (Merge_section_properties): Move class defintion out of
8635 Output_section.
8636 (Output_section_lookup_maps): New class.
8637 (Output_section::Input_section::is_merge_section): New method
8638 defintion.
8639 (Output_section::Input_section::relobj): Move defintion out of class
8640 defintion. Declare method only.
8641 (Output_section::Input_section::shndx): Ditto.
8642 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8643 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8644 (Output_section::Merge_section_by_properties_map,
8645 Output_section::Output_section_data_by_input_section_map,
8646 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8647 Remove types.
2e702c99 8648 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8649 KEEPS_INPUT_SECTIONS.
8650 (Output_section::build_lookup_maps): New method declaration.
8651 (Output_section::merge_section_map_,
8652 Output_section::merge_section_by_properties_map_,
8653 Output_section::relaxed_input_section_map_,
8654 Output_section::is_relaxed_input_section_map_valid_): Remove data
8655 members.
8656 (Output_section::lookup_maps_): New data member.
8657
76295588
L
86582010-05-21 Doug Kwan <dougkwan@google.com>
8659
8660 PR gold/11619
8661 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8662 avoid a compilation error.
8663
d103a984
RÁE
86642010-05-19 Rafael Espindola <espindola@google.com>
8665
8666 * script-sections.cc (Output_section_definition::allocate_to_segment):
8667 Update the phdrs_list even when the output section is NULL.
8668 * testsuite/Makefile.am: Add test.
8669 * testsuite/Makefile.in: Regenerate.
8670 * testsuite/script_test_9.cc: New.
8671 * testsuite/script_test_9.sh: New.
8672 * testsuite/script_test_9.t: New.
8673
6625d24e
DK
86742010-05-19 Doug Kwan <dougkwan@google.com>
8675
8676 * arm.cc (Arm_input_section::original_size): New method.
8677 (Arm_input_section::do_addralign): Add a cast.
8678 (Arm_input_section::do_output_offset): Remove static cast.
8679 (Arm_input_section::original_addralign,
8680 Arm_input_section::original_size_): Change type to uint32_t.
8681 (Arm_input_section::init): Add safe casts for section alignment
8682 and size.
8683 (Arm_input_section::set_final_data_size): Do not set address and
8684 offset of stub table.
8685 (Arm_output_section::fix_exidx_coverage): Change use of of
8686 Output_section::Simple_input_section to that of
8687 Output_section::Input_section.
8688 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8689 except for the first pass.
8690 * output.cc (Output_section::get_input_sections): Change type of
8691 input_sections to std::list<Input_section>.
8692 (Output_section::add_script_input_section): Rename from
8693 Output_section::add_simple_input_section. Change type of SIS
8694 parameter from Simple_input_section to Input_section.
8695 * output.h (Output_section::Simple_input_section): Remove class.
8696 (Output_section::Input_section): Change class visibility to public.
8697 (Output_section::Input_section::addralign): Use stored alignments
8698 for special input sections if set.
8699 (Output_section::Input_section::set_addralign): New method.
8700 (Output_section::get_input_sections): Change parameter type from
8701 list of Simple_input_section to list of Input_section.
8702 (Output_section::add_script_input_section): Rename from
8703 Output_section::add_simple_input_section. Change first parameter's
8704 type from Simple_input_section to Input_section and remove the
8705 second and third parameters.
8706 * script-sections.cc (Input_section::Input_section_list): Change
8707 type to list of Output_section::Input_section/
8708 (Input_section_info::Input_section_info): Change parameter type of
8709 INPUT_SECTION to Output_section::Input_section.
8710 (Input_section_info::input_section): Change return type.
8711 (Input_section_info::input_section_): Change type to
8712 Output_section::Input_section.
8713 (Output_section_element_input::set_section_addresses): Adjust code
8714 to use Output_section::Input_section instead of
8715 Output_section::Simple_input_section. Adjust code for renaming
8716 of Output_section::add_simple_input_section.
8717 (Orphan_output_section::set_section_addresses): Ditto.
8718
e1e82ea4
RW
87192010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8720
8721 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8722 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8723
91e75c8a
RÁE
87242010-05-18 Rafael Espindola <espindola@google.com>
8725
8726 * options.cc (General_options::finalize): Handle -nostdlib.
8727 * options.h (nostdlib): New option.
8728 * script.cc (script_add_search_dir): Handle -nostdlib.
8729
da59ad79
DK
87302010-05-12 Doug Kwan <dougkwan@google.com>
8731
8732 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8733 attributes section only if there no attributes section after merging.
8734 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8735 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8736 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8737 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8738 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8739 and arm_attr_merge_7.stdout.
8740 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8741 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8742 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8743 arm_attr_merge_7b.o): New rules.
8744 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8745 arm_attr_merge_7
8746 * testsuite/Makefile.in: Regenerate.
8747 * testsuite/arm_attr_merge.sh: New file.
8748 * testsuite/arm_attr_merge_[67][ab].s: Same.
8749
3e01a7fd
NC
87502010-05-05 Nick Clifton <nickc@redhat.com>
8751
8752 * po/es.po: Updated Spanish translation.
8753
7ad2014a
L
87542010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8755
8756 * Makefile.am (install-exec-local): Properly install gold as
8757 default cross linker.
8758 * Makefile.in: Regenerated.
8759
4fda8867
NC
87602010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8761 Nick Clifton <nickc@redhat.com>
8762
8763 * configure.ac (install_as_default): Define and set to false
8764 unless --enable-gold or --enable-gold=both/gold has been
8765 specified.
8766 * configure: Regenerate.
8767
8768 * Makefile.am (install-exec-local): Install the executable as
8769 'ld.gold'. If install_as_default is true then also install it as
8770 'ld'.
8771 * Makefile.in: Regenerated.
8772
bd288ea2
ILT
87732010-04-24 Ian Lance Taylor <iant@google.com>
8774
8775 * layout.cc (Layout::layout_reloc): In relocatable link don't
8776 combine reloc sections for grouped sections.
8777
ef38fd8a
ST
87782010-04-23 Sriraman Tallam <tmsriram@google.com>
8779
8780 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8781 sections that are not ordinary to icf.
8782 * icf.cc (get_section_contents): Handle relocation pointing to section
8783 with no object or shndx information.
8784 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8785 * testsuite/Makefile.in: Regenerate.
8786 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8787 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8788
f6973bdc
ILT
87892010-04-22 Ian Lance Taylor <iant@google.com>
8790
8791 * expression.cc (Expression::Expression_eval_info): Add
8792 result_alignment_pointer field.
8793 (Expression::eval_with_dot): Add result_alignment_pointer
8794 parameter. Change all callers.
8795 (Expression::eval_maybe_dot): Likewise.
8796 (class Binary_expression): Add alignment_pointer parameter to
8797 left_value and right_value. Change all callers.
8798 (BINARY_EXPRESSION): Set result alignment.
8799 (class Trinary_expression): Add alignment_pointer parameter to
8800 arg2_value and arg3_value. Change all callers.
8801 (Trinary_cond::value): Set result alignment.
8802 (Max_expression::value, Min_expression::value): Likewise.
8803 (Align_expression::value): Likewise.
8804 * script-sections.cc (class Sections_element): Add dot_alignment
8805 parameter to set_section_addresses virtual function. Update
8806 instantiations.
8807 (class Output_section_element): Likewise.
8808 (Script_sections::create_segments): Add dot_alignment parameter.
8809 Change all callers.
8810 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8811 (Script_sections::set_phdrs_clause_addresses): Likewise.
8812 * script-sections.h: Update declarations.
8813 * script.h: Update declarations.
8814 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8815 min_p_align.
8816 * testsuite/script_test_3.t: Set large alignment.
8817 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8818 segment has expected alignment.
8819
9c9c98a5
NC
88202010-04-22 Nick Clifton <nickc@redhat.com>
8821
8822 * po/gold.pot: Updated by the Translation project.
8823 * po/vi.po: Updated Vietnamese translation.
8824
2253bfba
L
88252010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8826
8827 * testsuite/Makefile.am (check_PROGRAMS): Add
8828 icf_virtual_function_folding_test.
8829 * testsuite/Makefile.in: Regenerated.
8830
85fdf906
AH
88312010-04-15 Andrew Haley <aph@redhat.com>
8832
8833 * options.h (merge_exidx_entries): New option.
8834 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8835 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8836 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8837 (Target_arm::merge_exidx_entries): New function.
8838 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8839 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8840 to Arm_exidx_fixup constructor.
8841 Add new arg, merge_exidx_entries.
8842 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8843 Arm_output_section::fix_exidx_coverage.
8844
ce97fa81
ST
88452010-04-18 Sriraman Tallam <tmsriram@google.com>
8846
8847 * icf.cc (get_section_contents): Check for preemptible functions.
8848 Ignore addend when appropriate.
8849 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8850 section folded.
8851 (add_from_relobj): Check for section folded.
8852 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8853 * symtab.h (should_add_dynsym_entry): Add new parameter.
8854 * target-reloc.h (scan_relocs): Check for section folded.
8855 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8856 Check reloc types for function pointers in shared objects.
8857 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8858 case.
8859 (icf_preemptible_functions_test): New test case.
8860 (icf_string_merge_test): New test case.
8861 * testsuite.Makefile.in: Regenerate.
8862 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8863 bar_glob. Refactor code.
8864 * testsuite/icf_preemptible_functions_test.cc: New file.
8865 * testsuite/icf_preemptible_functions_test.sh: New file.
8866 * testsuite/icf_string_merge_test.cc: New file.
8867 * testsuite/icf_string_merge_test.sh: New file.
8868 * testsuite/icf_virtual_function_folding_test.cc: New file.
8869 * testsuite/icf_virtual_function_folding_test.sh: New file.
8870
04ceb17c
DK
88712010-04-14 Doug Kwan <dougkwan@google.com>
8872
8873 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8874 for local symbol recounting if we remove a section due to ICF.
8875 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8876 there are no regular objects in input.
8877
153e7da4
DK
88782010-04-13 Doug Kwan <dougkwan@google.com>
8879
8880 * arm.cc (Arm_input_section::set_final_data_size): Compute
8881 accurate final data size instead of using current data size.
8882
4dbd9faf
DK
88832010-04-09 Doug Kwan <dougkwan@google.com>
8884
8885 * layout.cc (Layout::choose_output_section): Handle script section
8886 types.
8887 (Layout::make_output_section_for_script): Add section type parameter.
8888 Handle script section types.
8889 * layout.h (Layout::make_output_section_for_script): Add section
8890 type parameter.
8891 * output.cc (Output_section::Output_section): Initialize data member
8892 is_noload_.
8893 (Output_section::do_reset_address_and_file_offset): Do not set address
8894 to 0 if section is a NOLOAD section.
8895 * output.h (Output_section::is_noload): New method.
8896 (Output_section::set_is_noload): Ditto.
8897 (Output_section::is_noload_): New data member.
8898 * script-c.h (Script_section_type): New enum type.
8899 (struct Parser_output_section_header): Add new file section_type.
8900 * script-sections.cc (Sections_element::output_section_name): Add
8901 parameter for returning script section type.
8902 (Output_section_definition::output_section_name): Ditto.
8903 (Output_section_definition::section_type)P; New method.
8904 (Output_section_definiton::script_section_type_name): Ditto.
8905 (Output_section_definition::script_section_type_): New data member.
8906 (Output_section_definition::Output_section_definition): Initialize
8907 data member Output_section_definition::script_section_type_.
8908 (Output_section_definition::create_sections): Pass script section type
8909 to Layout::make_output_section_for_script.
8910 (Output_section_definition::output_section_name): Return script
8911 section type to caller.
8912 (Output_section_definition::set_section_address): Do not advance
8913 dot value and load address if section type is NOLOAD. Set address
8914 of NOLOAD sections regardless of section flags.
8915 (Output_section_definition::print): Print section type if it is
8916 not SCRIPT_SECTION_TYPE_NONE.
8917 (Output_section_definition::section_type): New method.
8918 (Output_section_definition::script_section_type_name): Ditto.
8919 (Script_sections::output_section_name): Add new parameter
8920 PSECTION_TYPE for returning script section type. Pass it to
8921 section elements. Handle discard sections.
8922 (Sort_output_sections::operator()): Handle NOLOAD sections.
8923 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8924 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8925 returning script section type.
8926 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8927 INFO and NOLOAD.
8928 * yyscript.y (union): Add new field SECTION_TYPE.
8929 (COPY, DSECT, INFO, NOLOAD): New tokens.
8930 (opt_address_and_section_type): Change type to output_section_header.
8931 (section_type): New non-terminal
8932 (section_header): Handle section type.
2253bfba 8933 (opt_address_and_section_type): Return section type value.
4dbd9faf 8934
721ea635
L
89352010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8936
8937 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8938 * testsuite/plugin_common_test_2.c (foo): Likewise.
8939
6bf924b0
DK
89402010-04-08 Doug Kwan <dougkwan@google.com>
8941
8942 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8943 Output_merge_data.
8944 * output.cc (Output_section::add_merge_input_section): Simplify
8945 code and return status of Output_merge_base::add_input_section.
e1df38aa 8946 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8947 returns true.
8948
24af6f92
DK
89492010-04-07 Doug Kwan <dougkwan@google.com>
8950
8951 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8952 if section is marked as containing instructions but has no mapping
8953 symbols.
8954 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8955 correct section index.
8956 (Arm_relobj::find_linked_text_section): Ditto.
8957
00698fc5
CC
89582010-04-07 Cary Coutant <ccoutant@google.com>
8959
8960 * archive.cc (include_member): Destroy Read_symbols_data object before
8961 releasing file.
8962 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8963 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8964 (Read_symbols_data::~Read_symbols_data) New destructor.
8965 (Section_relocs::Section_relocs) New constructor.
8966 (Section_relocs::~Section_relocs) New destructor.
8967 (Read_relocs_data::Read_relocs_data) New constructor.
8968 (Read_relocs_data::~Read_relocs_data) New destructor.
8969 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8970 pointers to NULL after deleting.
8971
7296d933
DK
89722010-04-07 Doug Kwan <dougkwan@google.com>
8973
8974 * arm.cc: Replace "endianity" with "endianness" in comments.
8975 (Arm_exidx_cantunwind): Ditto.
8976 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8977 (Arm_relobj::merge_flags_and_attributes): New method.
8978 (Arm_relobj::merge_flags_and_attributes_): New data member.
8979 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8980 (Arm_relobj::scan_sections_for_stubs): Ditto.
8981 (Arm_relobj::do_read_symbols): Check to see if we really want to
8982 merge processor-specific flags and attributes. Exit early if
8983 an object is empty except for section names and the undefined symbol.
8984 (Target_arm::do_finalize_sections): Move check for ELF format to
8985 Arm_relobj::do_read_symbols. Merge processor specific flags and
8986 attributes from a regular object only when we have determined that
8987 it is aapropriate. Do not create an .ARM.attributes section in
8988 output if there is no regular input object.
8989 (Target_arm::merge_processor_specific_flags): Check
8990 --warn-mismatch before printing any error.
8991 (Target_arm::merge_object_attributes): Ditto.
8992 * gold.cc (queue_middle_tasks): Handle the case in which there is
8993 no regular object in input.
8994 * options.cc (General_options::parse_EB): New method.
8995 (General_options::parse_EL): Same.
8996 (General_options::General_options): Initialize endianness_.
8997 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8998 New options.
8999 (General_options::Endianness): New enum.
9000 (General_options::endianness): New method.
9001 (General_options::endianness_): New data member.
9002 * parameters.cc (Parameters::set_options): Check target endianness.
9003 (Parameters::set_target_once): Ditto.
9004 (Parameters::check_target_endianness): New method.
9005 (parameters_force_valid_target): If either -EL or -EB is specified,
9006 use it to define endianness of default target.
9007 * parameters.h (Parameters::check_target_endianness): New method
9008 declaration.
9009 * target.h (class Target): Change "endianity" to "endianness"
9010 in comments.
9011
efc8d4f2
RW
90122010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9013
9014 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9015 * configure: Regenerate.
9016 * Makefile.in: Regenerate.
9017 * testsuite/Makefile.in: Regenerate.
9018
be234d88
CC
90192010-04-06 Cary Coutant <ccoutant@google.com>
9020
9021 gcc PR lto/42757
9022 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9023 prevailing definitions of common symbols.
9024 * testsuite/plugin_test_6.sh: New test case.
9025 * testsuite/plugin_common_test_1.c: New test case.
9026 * testsuite/plugin_common_test_2.c: New test case.
9027 * testsuite/Makefile.am (plugin_test_6): New test case.
9028 * testsuite/Makefile.in: Regenerate.
9029
bd32c6bd
NC
90302010-04-06 Nick Clifton <nickc@redhat.com>
9031
9032 * po/vi.po: New Vietnamese translation.
9033
323c532f
DK
90342010-03-30 Doug Kwan <dougkwan@google.com>
9035
9036 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9037
4fcd97eb
DK
90382010-03-25 Doug Kwan <dougkwan@google.com>
9039
9040 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9041 to avoid a conversion warning on a 32-bit host.
9042
4ebf39db
ILT
90432010-03-24 Ian Lance Taylor <iant@google.com>
9044
9045 * testsuite/script_test_3.t: Add a TLS segment.
9046 * testsuite/Makefile.am (check_PROGRAMS): Add
9047 tls_phdrs_script_test.
9048 (tls_phdrs_script_test_SOURCES): Define.
9049 (tls_phdrs_script_test_DEPENDENCIES): Define.
9050 (tls_phdrs_script_test_LDFLAGS): Define.
9051 (tls_phdrs_script_test_LDADD): Define.
9052 * testsuite/Makefile.in: Rebuild.
9053
4a599bdd
CC
90542010-03-23 Cary Coutant <ccoutant@google.com>
9055
9056 * fileread.cc (find_or_make_view): Fix comment.
9057
6c93b22c
ILT
90582010-03-23 Ian Lance Taylor <iant@google.com>
9059
9060 * script-sections.cc (class Orphan_section_placement): Define
9061 PLACE_TLS and PLACE_TLS_BSS.
9062 (Orphan_section_placement::Orphan_section_placement): Initialize
9063 new places.
9064 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9065 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9066 (tls_script_test_SOURCES): Define.
9067 (tls_script_test_DEPENDENCIES): Define.
9068 (tls_script_test_LDFLAGS): Define.
9069 (tls_script_test_LDADD): Define.
9070 * testsuite/Makefile.in: Rebuild.
9071
a2c7281b
DK
90722010-03-22 Doug Kwan <dougkwan@google.com>
9073
9074 * arm.cc (Arm_relocate_functions::abs8,
9075 Arm_relocate_functions::abs16): Use correct check for overflow
9076 specified in the ARM ELF specs.
9077 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9078 target of a BLX instruction specially.
9079 (Reloc_stub::stub_type_for_reloc): Ditto.
9080 (Relocate::relocate): Use symbolic names instead of numeric relocation
9081 codes to report error.
9082 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9083 workaround.
9084 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9085 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9086 thumb2_blx_out_of_range.stdout
9087 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9088 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9089 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9090 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9091 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9092 thumb2_blx_in_range, thumb2_blx_in_range.o,
9093 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9094 thumb2_blx_out_of_range.o): New rules.
2e702c99 9095 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9096 thumb2_blx_in_range and thumb2_blx_out_of_range.
9097 * testsuite/Makefile.in: Regenerate.
9098 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9099 * testsuite/thumb_blx_in_range.s: New file.
9100 * testsuite/thumb_blx_out_of_range.s: New file.
9101
b0193076
RÁE
91022010-03-22 Rafael Espindola <espindola@google.com>
9103
9104 * archive.cc (Should_include): Move to archive.h.
9105 (should_include_member): Make it a member of Archive.
9106 (Lib_group): New.
9107 (Add_lib_group_symbols): New.
9108 * archive.h: Include options.h.
9109 (Archive_member): Moved from Archive.
9110 (Should_include): Moved from archive.cc.
9111 (Lib_group): New.
9112 (Add_lib_group_symbols): New.
9113 * dynobj.cc (do_should_include_member): New.
9114 * dynobj.h (do_should_include_member): New.
9115 * gold.cc (queue_initial_tasks): Update call to queue.
9116 * main.cc (main): Print lib group stats.
9117 * object.cc (do_should_include_member): New.
9118 * object.h: Include archive.h.
9119 (Object::should_include_member): New.
9120 (Object::do_should_include_member): New.
9121 (Sized_relobj::do_should_include_member): New.
9122 * options.cc (General_options::parse_start_lib): New.
9123 (General_options::parse_end_lib): New.
9124 (Input_arguments::add_file): Handle lib groups.
9125 (Input_arguments::start_group): Check we are not in a lib.
9126 (Input_arguments::start_lib): New.
9127 (Input_arguments::end_lib): New.
9128 * options.h (General_options): Add start_lib and end_lib.
9129 (Input_argument::lib_): New.
9130 (Input_argument::lib): New.
9131 (Input_argument::is_lib): New.
9132 (Input_file_lib): New.
9133 (Input_arguments::in_lib_): New.
9134 (Input_arguments::in_lib): New.
9135 (Input_arguments::start_lib): New.
9136 (Input_arguments::end_lib_): New.
9137 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9138 in unused members as preempted.
9139 (Sized_pluginobj::do_should_include_member): New.
9140 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9141 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9142 return the blocker.
9143 (Read_symbols::do_whole_lib_group): New.
9144 (Read_symbols::do_lib_group): New.
9145 (Read_symbols::do_read_symbols): Handle lib groups.
9146 (Read_symbols::get_name): Handle lib groups.
9147 * readsyms.h (Read_symbols): Add an archive member pointer.
9148 (Read_symbols::do_whole_lib_group): New.
9149 (Read_symbols::do_lib_group): New.
9150 (Read_symbols::member_): New.
9151 * script.cc (read_input_script): Update call to queue_soon.
9152
d099120c
DK
91532010-03-19 Doug Kwan <dougkwan@google.com>
9154
9155 * arm.cc (Stub_table::Stub_table): Initialize new data members
9156 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9157 (Stub_table::add_reloc_stub): Assign stub offset and update
9158 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9159 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9160 New data members.
2e702c99 9161 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9162 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9163 instead of going over all reloc stubs.
2e702c99 9164 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9165 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9166 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9167 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9168 Stringpool_template::offset_.
9169 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9170 Stringpool_template::offset_ to zero.
9171
1aa37384
DK
91722010-03-15 Doug Kwan <dougkwan@google.com>
9173
9174 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9175 offset_.
9176 (Stringpool_template::new_key_offset): New method.
9177 (Stringpool_template::add_string): Assign offsets when adding new
9178 strings.
9179 (Stringpool_template::set_string_offsets): Do not set string offsets
9180 when not optimizing.
9181 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9182 member size_.
2e702c99
RM
9183 (Chunked_vector::clear): Clear size_.
9184 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9185 (Chunked_vector::size): Return size_.
9186 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9187 (Chunked_vector::size_): New data member.
1aa37384
DK
9188 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9189 (Stringpool_template::new_key_offset): New method declaration.
9190 (Stringpool_template::offset_): New data member.
9191
b672b057
RÁE
91922010-03-15 Rafael Espindola <espindola@google.com>
9193
9194 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9195 Add_symbols' constructor.
9196 * readsyms.h (Add_symbols): Remove the input_group member.
9197
b6848d3c
ILT
91982010-03-10 Ian Lance Taylor <iant@google.com>
9199
9200 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9201 target to ask whether a reference to a symbol requires a stack
9202 split.
9203 * target.h (Target::is_call_to_non_split): New function.
9204 (Target::do_is_call_to_non_split): Declare virtual function.
9205 * target.cc: Include "symtab.h".
9206 (Target::do_is_call_to_non_split): New function.
9207 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9208
a2a5469e
CC
92092010-03-10 Cary Coutant <ccoutant@google.com>
9210
9211 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9212 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9213 (File_read::open[2]): Add whole_file_view_ to list of views.
9214 (File_read::make_view): Remove test of whole_file_view_.
9215 (File_read::find_or_make_view): Create whole_file_view_ if
9216 necessary.
9217 (File_read::clear_views): Replace bool parameter with enum;
9218 adjust all callers. Don't delete views with permanent data;
9219 do delete cached views and views from archives if
9220 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9221 if clearing the corresponding view.
9222 * fileread.h (File_read::Clear_views_mode): New enum.
9223 (File_read::View::is_permanent_view): New method.
9224 (File_read::clear_views): Replace bool parameter
9225 with enum; adjust all callers.
9226 * options.h (General_options): Change keep_files_mapped option;
9227 add map_whole_files.
9228 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9229 releasing the file.
9230 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9231 the file.
9232
8861f32b
DM
92332010-03-10 David S. Miller <davem@davemloft.net>
9234
9235 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9236
d62d0f5f
ST
92372010-03-09 Sriraman Tallam <tmsriram@google.com>
9238
9239 * icf.cc (get_section_contents): Add '@' marker after processing the
9240 merge reloc.
9241
9177756d
DK
92422010-03-08 Doug Kwan <dougkwan@google.com>
9243
9244 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9245 due to a conversion warning.
9246 (Arm_relobj::update_output_local_symbol_count): Check for local
9247 symbol with unset output index.
9248
9e9e071b
ILT
92492010-03-05 Ian Lance Taylor <iant@google.com>
9250
9251 * options.h (class General_options): Add --spare-dynamic-tags.
9252 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9253 --spare-dynamic-tags.
9254
a81ee015
ILT
92552010-03-05 Ian Lance Taylor <iant@google.com>
9256
9257 * incremental.cc: Include "libiberty.h".
9258
44ec90b9
RO
92592010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9260
9261 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9262 function, is_info_ member.
9263 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9264 (Versions::Versions): Update caller.
9265 (Versions::define_base_version): Likewise.
9266 (Versions::add_def): Likewise.
9267
0897ed3b
ST
92682010-03-03 Sriraman Tallam <tmsriram@google.com>
9269
9270 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9271 (Scan::possible_function_pointer_reloc): New function.
9272 (Scan::local_reloc_may_be_function_pointer): Change to call
9273 possible_function_pointer_reloc.
9274 (Scan::global_reloc_may_be_function_pointer): Ditto.
9275 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9276 relocations in ".data.rel.ro._ZTV" section.
9277 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9278 * testsuite/icf_safe_so_test.cc: Ditto.
9279 * testsuite/icf_safe_test.cc: Ditto.
9280 * testsuite/icf_safe_test.sh: Ditto.
9281
d3bbad62
ILT
92822010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9283 Ian Lance Taylor <iant@google.com>
9284
9285 * target-reloc.h (relocate_section): Check the symbol table index
9286 for -1U before setting the local symbol index.
9287 (scan_relocatable_relocs): If copying the relocation, record that
9288 the local symbol is required.
9289 * object.h (Symbol_value::is_output_symtab_index_set): New
9290 function.
9291 (Symbol_value::may_be_discarded_from_output_symtab): New
9292 function.
9293 (Symbol_value::has_output_symtab_entry): New function.
9294 (Symbol_value::needs_output_symtab_entry): Remove.
9295 (Symbol_value::output_symtab_index): Make sure the symbol index is
9296 set.
9297 (Symbol_value::set_output_symtab_index): Make sure the symbol
9298 index is not set. Make sure the new index is valid.
9299 (Symbol_value::set_must_have_output_symtab_entry): New function.
9300 (Symbol_value::has_output_dynsym_entry): New function.
9301 (Symbol_value::set_output_dynsym_index): Make sure the new index
9302 is valid.
9303 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9304 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9305 local symbol if permitted.
9306 (Sized_relobj::do_finalize_local_symbols): Call
9307 is_output_symtab_index_set rather than needs_output_symtab_entry.
9308 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9309 rather than needs_output_symtab_entry. Call
9310 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9311 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9312 is_output_symtab_index_set rather than needs_output_symtab_entry.
9313 * testsuite/discard_locals_relocatable_test.c: New file.
9314 * testsuite/discard_locals_test.sh: Test -r.
9315 * testsuite/Makefile.am (check_DATA): Add
9316 discard_locals_relocatable_test1.syms,
9317 discard_local_relocatable_test2.syms.
9318 (MOSTLYCLEANFILES): Likewise. Also add
9319 discard_locals_relocatable_test1.lout and
9320 discard_locals_relocatable_test2.out.
9321 (discard_locals_relocatable_test1.syms): New target.
9322 (discard_locals_relocatable_test.o): New target.
9323 (discard_locals_relocatable_test1.out): New target.
9324 (discard_locals_relocatable_test2.syms): New target.
9325 (discard_locals_relocatable_test2.out): New target.
9326 (various): Add missing ../ld-new dependencies.
9327 * testsuite/Makefile.in: Rebuild.
9328
7e8ccf26
NC
93292010-03-03 Nick Clifton <nickc@redhat.com>
9330
9331 * po/fi.po: New Finnish translation.
9332
2a0ff005
DK
93332010-03-01 Doug Kwan <dougkwan@google.com>
9334
9335 * layout.cc (Layout::Layout): Force section types of .init_array*,
9336 .preinit_array* and .fini_array* sections.
9337 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9338 Fix check of return value of std::string::find.().
9339 (Output_section::Input_section_sort_compare::operator()): Remove
9340 comment about .init_array.
9341 (Output_section::Input_section_sort_init_fini_compare::operator()):
9342 New method.
9343 (Output_section::sort_attached_input_sections): Handle .init_array
9344 and .fini_array specially.
9345 * output.h (Output_section::Inut_section_sort_compare): Update
9346 comment.
9347 (Output_section::Input_section_sort_init_fini_compare): New struct.
9348
c3e4ae29
DK
93492010-02-26 Doug Kwan <dougkwan@google.com>
9350
9351 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9352 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9353 * testsuite/debug_msg.sh: Avoid matching source line number for
9354 use of global variable undef_int.
9355
2fd9ae7a
DK
93562010-02-26 Doug Kwan <dougkwan@google.com>
9357
9358 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9359 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9360 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9361 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9362 * options.cc (General_options::General_options): Initialize member
9363 fix_v4bx_.
9364 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9365 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9366 and rm_no_fix_v4bx.stdout
9367 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9368 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9369 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9370 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9371 and arm_no_fix_v4bx.
9372 * Makefile.in: Regenerate.
9373 * testsuite/arm_fix_v4bx.s: New file.
9374 * testsuite/arm_fix_v4bx.sh: Ditto.
9375
67ec7d0b
DK
93762010-02-24 Doug Kwan <dougkwan@google.com>
9377
9378 * arm.cc (Target_arm::got_section): Make the .got section the first
9379 non RELRO section in the data segment.
9380 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9381 suffixes of section names.
9382
10165461
DK
93832010-02-24 Doug Kwan <dougkwan@google.com>
9384
9385 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9386 flags and attributes merging if an input file is a binary file.
9387 * fileread.cc (Input_file::open): Record format of original file.
9388 * fileread.h (Input_file::Format): New enum type.
2e702c99 9389 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9390 (Input_file::format): New method definition.
9391 (Input_file::format_):: New data member.
9392
4a54abbb
DK
93932010-02-24 Doug Kwan <dougkwan@google.com>
9394
9395 * arm.cc (Arm_output_data_got): New class.
9396 (ARM_TCB_SIZE): New constant
9397 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9398 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9399 If user uses a script with a SECTIONS clause, issue only a warning
9400 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9401 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9402 garbage collection.
9403 (Target_arm::got_mode_index_entry): Handle static linking.
9404 (Target_arm::Scan::local): Ditto.
9405 (Target_arm::Scan::global): Ditto.
9406 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9407 all incorrectly implemented relocations.
e1df38aa 9408 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9409 Arm_output_section::fix_exidx_coverage.
9410 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9411 from ".ARM.exidx." and ".ARM.extab.".
9412
ca419a6f
ILT
94132010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9414
9415 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9416 section if it does not already exist.
9417 * attributes.cc (Attributes_section_data::Attributes_section_data):
9418 Don't crash if size is zero.
9419
135b9c78
ILT
94202010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9421 Ian Lance Taylor <iant@google.com>
9422
9423 * gold.cc (queue_middle_tasks): If no input files were opened,
9424 exit.
9425 * workqueue.h (Task_function::Task_function): Assert that there is
9426 a blocker.
9427
bb0bfe4f
DK
94282010-02-22 Doug Kwan <dougkwan@google.com>
9429
9430 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9431 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9432 types to avoid warnings due to different uint64_t implementations
9433 on different hosts.
9434
2a2b6d42
DK
94352010-02-21 Doug Kwan <dougkwan@google.com>
9436
9437 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9438 handling of the maximum backward branch offset.
2e702c99 9439 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9440 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9441 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9442 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9443 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9444 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9445 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9446 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9447 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9448 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9449 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9450 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9451 thumb2_bl_out_of_range.o): New rules.
9452 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9453 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9454 thumb2_bl_out_of_range
9455 * testsuite/Makefile.in: Regenerate.
9456 * testsuite/arm_bl_in_range.s: New file.
9457 * testsuite/arm_bl_out_of_range.s: Ditto.
9458 * testsuite/arm_branch_in_range.sh: Ditto.
9459 * testsuite/arm_branch_range.t: Ditto.
9460 * testsuite/thumb2_branch_range.t: Ditto.
9461 * testsuite/thumb_bl_in_range.s: Ditto.
9462 * testsuite/thumb_bl_out_of_range.s: Ditto.
9463 * testsuite/thumb_branch_range.t: Ditto.
9464
b487ad64
ST
94652010-02-20 Sriraman Tallam <tmsriram@google.com>
9466
9467 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9468 Add reloc offset information.
9469 * icf.cc (get_section_contents): Change iterators to point to the new
9470 vectors. Add reloc offset information to the contents.
9471 * icf.h (Icf::Sections_reachable_info): New typedef.
9472 (Icf::Sections_reachable_list): New typedef.
9473 (Icf::Offset_info): New typedef.
9474 (Icf::Reloc_info): New struct typedef.
9475 (Icf::Reloc_info_list): New typedef.
9476 (Icf::symbol_reloc_list): Delete method.
9477 (Icf::addend_reloc_list): Delete method.
9478 (Icf::section_reloc_list): Delete method.
9479 (Icf::reloc_info_list): New method.
9480 (Icf::reloc_info_list_): New member.
9481
f96accdf
DK
94822010-02-19 Doug Kwan <dougkwan@google.com>
9483
9484 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9485 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9486 * arm.cc (Arm_relocation_functions): New forward declaration.
9487 (Target_arm::Target_arm): Initialize new data members
9488 got_mod_index_offset_ and tls_base_symbol_defined_.
9489 (Target_arm::Relocate::relocate_tls): New method.
9490 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9491 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9492 New methods.
2e702c99 9493 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9494 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9495 (Target_arm::got_mod_index_offset_,
9496 Target_arm::tls_base_symbol_defined_): New data members.
9497 (Target_arm::Scan::local, Target::Scan::global,
9498 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9499 relocations.
9500
c8761b9a
DK
95012010-02-18 Doug Kwan <dougkwan@google.com>
9502
9503 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9504 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9505 text section as a parameter becuase some broken tools may not set
9506 the link in section header.
9507 (Target_arm::has_got_section): New method.
9508 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9509 without any mapping symbol as data only. Remove warning.
9510 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9511 link in its section header, try to discover the link by inspecting the
9512 REL31 relocation at the beginning of the section.
9513 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9514 in error message.
9515 (Target_arm::Scan::global): Treat any reference to the symbol
9516 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9517
21bb3914
ST
95182010-02-12 Sriraman Tallam <tmsriram@google.com>
9519
9520 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9521 (Scan::global_reloc_may_be_function_pointer): New function.
9522 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9523 (Scan::global_reloc_may_be_function_pointer): New function.
9524 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9525 (Scan::global_reloc_may_be_function_pointer): New function.
9526 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9527 (Scan::global_reloc_may_be_function_pointer): New function.
9528 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9529 (Scan::global_reloc_may_be_function_pointer): New function.
9530 (Scan::possible_function_pointer_reloc): New function.
9531 (Target_x86_64::can_check_for_function_pointers): New function.
9532 * gc.h (gc_process_relocs): Scan relocation types to determine if
9533 function pointers were taken for targets that support it.
9534 * icf.cc (Icf::find_identical_sections): Include functions for
9535 folding in safe ICF whose pointer is not taken.
9536 * icf.h (Secn_fptr_taken_set): New typedef.
9537 (fptr_section_id_): New member.
9538 (section_has_function_pointers): New function.
9539 (set_section_has_function_pointers): New function.
9540 (check_section_for_function_pointers): New function.
9541 * options.h: Fix comment for safe ICF option.
9542 * target.h (can_check_for_function_pointers): New function.
9543 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9544 Modify icf_safe_test for X86-64.
9545 * testsuite/Makefile.in: Regenerate.
9546 * testsuite/icf_safe_so_test.cc: New file.
9547 * testsuite/icf_safe_so_test.sh: New file.
9548 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9549 (main): Change to take pointer to function kept_func_3.
9550 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9551 folding is done correctly for X86-64.
9552
0da6fa6c
DM
95532010-02-12 David S. Miller <davem@davemloft.net>
9554
9555 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9556 is_symbolless parameter.
9557 (Output_reloc<SHT_REL>::is_symbolless): New.
9558 (Output_reloc<SHT_REL>::is_symbolless_): New.
9559 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9560 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9561 (Output_reloc<SHT_RELA>::is_symbolless): New.
9562 (Output_data_reloc::add_global): Handle is_symbolless.
9563 (Output_data_reloc::add_global_relative): Likewise.
9564 (Output_data_reloc::add_local): Likewise.
9565 (Output_data_reloc::add_local_relative): Likewise.
9566 (Output_data_reloc::add_symbolless_global_addend): New.
9567 (Output_data_reloc::add_symbolless_local_addend): New.
9568 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9569 is_symbolless.
9570 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9571 instead of ->is_relative_
9572 (Output_reloc::write): Likewise.
9573 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9574 (Output_reloc::write_rel): Simplify.
9575
9576 * sparc.cc (Target_sparc::Scan::local): Use
9577 ->add_symbolless_local_addend as needed.
9578 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9579 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9580 based upon relocation offset.
9581
e4782e83
DK
95822010-02-11 Doug Kwan <dougkwan@google.com>
9583
9584 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9585 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9586 beginning of function.
9587 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9588 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9589 parameter is_32bit in calls to should_apply_static_reloc.
9590 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9591 (check_DATA): Add arm_abs_global.stdout.
9592 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9593 arm_abs_global.stdout): New rules.
9594 (MOSTLLYCLEANFILES): Add arm_abs_global
9595 * Makefile.in: Regenerate.
9596 * testsuite/arm_abs_global.s: New file.
9597 * testsuite/arm_abs_global.sh: Ditto.
9598 * testsuite/arm_abs_lib.s: Ditto.
9599
93ceb764
ILT
96002010-02-11 Ian Lance Taylor <iant@google.com>
9601
9602 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9603 Read_relocs task.
9604 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9605 Allocate_commons_task first.
9606 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9607 task, rather than symtab_lock_.
9608 (Gc_process_relocs::~Gc_process_relocs): New function.
9609 (Gc_process_relocs::is_runnable): Check this_blocker_.
9610 (Gc_process_relocs::locks): Use next_blocker_ rather than
9611 blocker_.
9612 (Scan_relocs::~Scan_relocs): New function.
9613 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9614 symtab_lock_.
9615 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9616 next_blocker_.
9617 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9618 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9619 constructor accordingly.
9620 (class Gc_process_relocs): Likewise.
9621 (class Scan_relocs): Likewise.
9622 * common.h (class Allocate_commons_task): Remove symtab_lock_
9623 field, and corresponding constructor parameter.
9624 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9625 symtab_lock_.
9626 (Allocate_commons_task::locks): Likewise.
9627
114dfbe1
ILT
96282010-02-11 Ian Lance Taylor <iant@google.com>
9629
9630 * gold-threads.h (class Once): Define.
9631 (class Initialize_lock): Rewrite as child of Once.
9632 * gold-threads.cc (class Once_initialize): Define.
9633 (once_pointer_control): New static variable.
9634 (once_pointer, once_arg): New static variables.
9635 (c_run_once): New static function.
9636 (Once::Once, Once::run_once, Once::internal_run): New functions.
9637 (class Initialize_lock_once): Remove.
9638 (initialize_lock_control): Remove.
9639 (initialize_lock_pointer): Remove.
9640 (initialize_lock_once): Remove.
9641 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9642 (Initialize_lock::initialize): Rewrite.
9643 (Initialize_lock::do_run_once): New function.
9644 * archive.cc (Archive::interpret_header): Only clear name if it is
9645 not already empty.
9646 * fileread.cc: Include "gold-threads.h"
9647 (file_counts_lock): New static variable.
9648 (file_counts_initialize_lock): Likewise.
9649 (File_read::release): Only increment counts when using --stats.
9650 Use a lock around the increment.
9651 * parameters.cc (class Set_parameters_target_once): Define.
9652 (set_parameters_target_once): New static variable.
9653 (Parameters::Parameters): Move here from parameters.h.
9654 (Parameters::set_target): Rewrite.
9655 (Parameters::set_target_once): New function.
9656 (Parameters::clear_target): Move here and rewrite.
9657 * parameters.h (class Parameters): Update declarations. Add
9658 set_parameters_target_once_ field.
9659 (Parameters::Parameters): Move to parameters.cc.
9660 (Parameters::clear_target): Likewise.
9661 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9662 task.
9663 (Start_group::~Start_group): New function.
9664 (Start_group::is_runnable): New function.
9665 (Start_group::locks, Start_group::run): New functions.
9666 (Finish_group::run): Change saw_undefined to size_t.
9667 * readsyms.h (class Start_group): Define.
9668 (class Finish_group): Change saw_undefined_ field to size_t.
9669 (Finish_group::Finish_group): Remove saw_undefined and
9670 this_blocker parameters. Change all callers.
9671 (Finish_group::set_saw_undefined): New function.
9672 (Finish_group::set_blocker): New function.
9673 * symtab.h (class Symbol_table): Change saw_undefined to return
9674 size_t. Change saw_undefined_ field to size_t.
9675 * target-select.cc (Set_target_once::do_run_once): New function.
9676 (Target_selector::Target_selector): Initialize set_target_once_
9677 field. Don't initialize lock_ and initialize_lock_ fields.
9678 (Target_selector::instantiate_target): Rewrite.
9679 (Target_selector::set_target): New function.
9680 * target-select.h (class Set_target_once): Define.
9681 (class Target_selector): Update declarations. Make
9682 Set_target_once a friend. Remove lock_ and initialize_lock_
9683 fields. Add set_target_once_ field.
9684
fa17a3f4
ILT
96852010-02-10 Ian Lance Taylor <iant@google.com>
9686
9687 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9688 queueing any tasks.
9689 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9690 (queue_middle_tasks): Add all blockers before queueing any tasks.
9691 (queue_final_tasks): Likewise.
9692 * token.h (Task_token::add_blockers): New function.
9693 * object.h (Input_objects::number_of_relobjs): New function.
9694
c7177d31
ILT
96952010-02-10 Ian Lance Taylor <iant@google.com>
9696
5de0e392
ILT
9697 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9698 shared, not if not position independent.
9699 * x86_64.cc (Relocate::relocate_tls): Likewise.
9700 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9701 (tls_pie_pic_test): New target.
9702 * testsuite/Makefile.in: Rebuild.
9703
c7177d31
ILT
9704 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9705 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9706 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9707 * testsuite/Makefile.in: Rebuild.
9708
684b268a
DM
97092010-02-09 David S. Miller <davem@davemloft.net>
9710
9711 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9712 R_SPARC_RELATIVE using ->add_local_relative().
9713 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9714
612a8d3d
DM
9715 * output.h (Output_data_dynamic::add_section_size): New method
9716 that takes two Output_data objects.
9717 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9718 entry param. Handle it in initializers.
9719 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9720 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9721 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9722 arg.
9723 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9724 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9725 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9726 for dynrel_includes_plt.
9727 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9728 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9729 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9730 before .rela.plt
9731 (Target_sparc::do_finalize_sections): Update to pass true for
9732 dynrel_includes_plt.
9733 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9734 output before .rela.plt
9735 (Target_powerpc::do_finalize_sections): Update to pass true for
9736 dynrel_includes_plt when 32-bit.
9737
cb1be87e
DK
97382010-02-08 Doug Kwan <dougkwan@google.com>
9739
9740 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9741 method.
9742 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9743 Arm_relobj::scan_section_for_cortex_a8_stubs,
9744 Arm_relobj::do_relocation_section): Instead of calling
9745 Output_section::output_address, use faster
9746 Arm_relobj::simple_input_section_output_address.
9747
705b5121
DM
97482010-02-08 David S. Miller <davem@davemloft.net>
9749
9750 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9751 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9752 relocation helper function.
9753
024c4466
DM
9754 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9755 just like R_SPARC_GOT{10,13,22}.
9756 (Target_sparc::Scan::local): Likewise.
9757 (Target_sparc::Relocate:relocate): Likewise.
9758
9109c078
ILT
97592010-02-06 Ian Lance Taylor <iant@google.com>
9760
9761 * configure.ac: Rewrite targetobjs duplicate removal code to use
9762 only shell constructs.
9763 * configure: Rebuild.
9764
cf846138
DK
97652010-02-05 Doug Kwan <dougkwan@google.com>
9766
9767 PR 11247
9768 * arm.cc (Arm_relobj::section_is_scannable): New method.
9769 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9770 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9771
6cfaf60b
DK
97722010-02-04 Doug Kwan <dougkwan@google.com>
9773
9774 PR 11247
9775 * arm-reloc-property.cc (cstdio): Include.
9776 * configure.ac (targetobjs): Remove duplicates.
9777 * configure: Regenerate.
9778 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9779 big and little endian version for a given address size.
9780
5c57f1be
DK
97812010-02-03 Doug Kwan <dougkwan@google.com>
9782
9783 * arm-reloc-property.cc
9784 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9785 definition.
9786 * arm-reloc-property.h
9787 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9788 New method definition.
9789 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9790 declaration.
9791 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9792 overflow to N.
9793 (GOT_PREL): Change implemented to Y.
9794 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9795 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9796 (Arm_relocate_functions::movw_abs_nc): Remove method.
9797 (Arm_relocate_functions::movt_abs): Ditto.
9798 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9799 (Arm_relocate_functions::thm_movt_abs): Ditto.
9800 (Arm_relocate_functions::movw_rel_nc): Ditto.
9801 (Arm_relocate_functions::movw_rel): Ditto.
9802 (Arm_relocate_functions::movt_rel): Ditto.
9803 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9804 (Arm_relocate_functions:thm_movw_rel): Ditto.
9805 (Arm_relocate_functions:thm_movt_rel): Ditto.
9806 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9807 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9808 New method definitions.
9809 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9810 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9811 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9812 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9813 (Target_arm::Relocate::relocate): Check for non-static or
9814 unimplemented relocation code and exit early. Change calls to
9815 Target_arm::reloc_uses_thumb_bit and
9816 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9817 instead. Refactor code to handle similar relocations to increase
9818 code sharing. Remove check for unsupported relocation code in switch
9819 statement.
9820 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9821 relocation property table to find out size. Change error message to
9822 print out the name of a relocation code instead of the numeric value.
9823 (Target_arm::scan_reloc_for_stub): Use relocation property table
9824 instead of calling Target_arm::reloc_uses_thumb_bit().
9825
218c5831
DK
98262010-02-02 Doug Kwan <dougkwan@google.com>
9827
9828 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9829 types of relaxed input section.
9830
0d31c79d
DK
98312010-02-02 Doug Kwan <dougkwan@google.com>
9832
9833 * Makefile.am (HFILES): Add arm-reloc-property.h.
9834 (DEFFILES): New.
2e702c99
RM
9835 (TARGETSOURCES): Add arm-reloc-property.cc
9836 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9837 (libgold_a_SOURCES): $(DEFFILES)
9838 * Makefile.in: Regenerate.
9839 * arm-reloc-property.cc: New file.
9840 * arm-reloc-property.h: New file.
9841 * arm-reloc.def: New file.
9842 * arm.cc: Update comments.
9843 (arm-reloc-property.h): New included header.
9844 (arm_reloc_property_table): New global variable.
9845 (Target_arm::do_select_as_default_target): New method definition.
9846 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9847 arm-reloc-property to targ_extra_obj.
9848 * parameters.cc (set_parameters_target): Call
9849 Target::select_as_default_target().
9850 * target.h (Target::select_as_default_target): New method definition.
9851 (Target::do_select_as_default_target): Same.
9852
546c7457
DK
98532010-02-01 Doug Kwan <dougkwan@google.com>
9854
9855 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9856 first_output_text_section_.
9857 (Arm_exidx_fixup::first_output_text_section): New method definition.
9858 (Arm_exidx_fixup::first_output_text_section_): New data member.
9859 (Arm_exidx_fixup::process_exidx_section): Record the first text
9860 output section seen.
9861 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9862 and entsize in output section header.
9863
11b861d5
DK
98642010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9865
9866 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9867 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9868 (Arm_relocate_functions::thm_alu11): New Method.
9869 (Arm_relocate_functions::thm_pc8): New Method.
9870 (Arm_relocate_functions::thm_pc12): New Method.
9871 (Target_arm::Scan::local): Handle the relocations.
9872 (Target_arm::Scan::global): Likewise.
9873 (Target_arm::Relocate::relocate): Likewise.
9874 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9875
c9a2c125
DK
98762010-01-29 Doug Kwan <dougkwan@google.com>
9877
9878 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9879 of relocation types as ld.
9880
1521477a
DK
98812010-01-29 Doug Kwan <dougkwan@google.com>
9882
9883 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9884 to public.
9885 (Arm_relocate_functions::thumb_branch_common): Ditto.
9886 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9887 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9888 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9889 Arm_relocate_functions::jump24): Remove.
9890 (Target_arm::Relocate::relocate): Adjust code to call
9891 Arm_relocation_functions::arm_branch_common and
9892 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9893 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9894
e7eca48c
DK
98952010-01-29 Doug Kwan <dougkwan@google.com>
9896
9897 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9898 output_local_symbol_count_needs_update_.
9899 (Arm_relobj::output_local_symbol_count_needs_update,
9900 Arm_relobj::set_output_local_symbol_count_needs_update,
9901 Arm_relobj::update_output_local_symbol_count): New methods.
9902 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9903 member.
9904 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9905 of pointed function as in a R_ARM_PREL31 relocation.
9906 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9907 for output local symbol count updating.
9908 (Target_arm::do_relax): Update output local symbol counts in objects
9909 if necessary.
9910 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9911
02961d7e
ILT
99122010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9913
9914 * arm.cc: Added support for the ARM relocations:
9915 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9916 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9917 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9918 movw_prel_nc).
9919 (Arm_relocate_functions::movw_rel): New method.
9920 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9921 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9922 thm_movw_prel_nc).
9923 (Arm_relocate_functions::thm_movw_rel): New method.
9924 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9925 thm_movt_prel).
9926 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9927 relocations.
9928 (Target_arm::Scan::global): Likewise.
9929 (Target_arm::Relocate::relocate): Likewise.
9930 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9931 Likewise.
9932
b10d2873
ILT
99332010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9934
9935 * arm.cc: Added support for ARM group relocations.
9936 (Target_arm::reloc_needs_sym_origin): New method.
9937 (Arm_relocate_functions::calc_grp_kn): New method.
9938 (Arm_relocate_functions::calc_grp_residual): New method.
9939 (Arm_relocate_functions::calc_grp_gn): New method.
9940 (Arm_relocate_functions::arm_grp_alu): New Method.
9941 (Arm_relocate_functions::arm_grp_ldr): New Method.
9942 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9943 (Arm_relocate_functions::arm_grp_ldc): New Method.
9944 (Target_arm::Scan::local): Handle the ARM group relocations.
9945 (Target_arm::Scan::global): Likewise.
9946 (Target_arm::Relocate::relocate): Likewise.
9947 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9948 Likewise.
9949
2b328d4e
DK
99502010-01-26 Doug Kwan <dougkwan@google.com>
9951
9952 * arm.cc (set): Include.
9953 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9954 pointer type.
2e702c99 9955 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9956 (Arm_output_section::append_text_sections_to_list): New method.
9957 (Arm_output_section::fix_exidx_coverage): Ditto.
9958 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9959 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9960 Relobj::set_section_offset() instead of
9961 Sized_relobj::invalidate_section_offset().
2e702c99 9962 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9963 parameter for section headers. Ignore relocation sections for
9964 unallocated sections and EXIDX sections.
9965 (Target_arm::fix_exidx_coverage): New method.
9966 (Target_arm::output_section_address_less_than): New type.
9967 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9968 linked text section instead of the EXIDX section.
9969 (Arm_output_section::create_stub_group): Add an assertion to check
9970 that this is not an EXIDX output section.
9971 (Arm_output_section::append_text_sections_to_list): New method.
9972 (Arm_output_section::fix_exidx_coverage): Ditto.
9973 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9974 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9975 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9976 first pass.
9977 (Target_arm::fix_exidx_coverage): New method.
9978 * object.h (Relobj::set_output_section): New method.
9979 (Sized_relobj::invalidate_section_offset): Remove method.
9980 (Sized_relobj::do_invalidate_section_offset): Remove method.
9981 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9982
c7f3c371
DK
99832010-01-25 Doug Kwan <dougkwan@google.com>
9984
9985 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9986 Fix warning due to signed and unsigned comparison on a 32-bit host.
9987
8923b24c
DK
99882010-01-22 Doug Kwan <dougkwan@google.com>
9989
9990 * arm.cc (Target_arm::do_relax): Record an output section for section
9991 offset adjustment it contains any stub table that has changed.
9992 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9993 offsets in an output section if necessary.
9994 * output.cc (Output_section::Output_section): Initialize
9995 section_offsets_need_adjustments_.
9996 (Output_section::add_input_section_for_script): Renamed to
9997 Output_section::add_simple_input_section.
9998 (Output_section::save_states): Add a comment.
9999 (Output_section::discard_states): New method defintion.
10000 (Output_section::adjust_section_offsets): Same.
10001 * output.h (Output_section::add_input_section_for_script): Renamed to
10002 Output_section::add_simple_input_section.
10003 (Output_section::discard_states): New method declaration.
10004 (Output_section::adjust_section_offsets): Same.
10005 (Output_section::section_offsets_need_adjustment,
10006 Output_section::set_section_offsets_need_adjustment): New method
10007 definitions.
10008 (Output_section::section_offsets_need_adjustment_): New data member.
10009 * script-sections.cc
10010 (Output_section_element_input::set_section_address): Adjust code for
10011 renaming of Output_section::add_input_section_for_script.
10012 (Orphan_output_section::set_section_address): Same.
10013
9b2fd367
DK
100142010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10015
10016 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10017 Fix_v4bx enum values .
10018 * gold/options.h (General_options): New option definitions.
10019 (General_options::fix_v4bx): New method.
10020 (General_options::Fix_v4bx): New enum.
10021 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10022 (General_options::parse_fix_v4bx_interworking): New method.
10023
80d0d023
DK
100242010-01-22 Doug Kwan <dougkwan@google.com>
10025
10026 * arm.cc (Arm_exidx_fixup): New class.
10027
af2cdeae
DK
100282010-01-21 Doug Kwan <dougkwan@google.com>
10029
10030 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10031 classes.
10032 (Arm_exidx_section_offset_map): New type.
10033
993d07c1
DK
100342010-01-21 Doug Kwan <dougkwan@google.com>
10035
10036 * arm.cc (Arm_exidx_input_section): New class.
10037 (Arm_relobj::exidx_input_section_by_link,
10038 Arm_relobj::exidx_input_section_by_shndx,
10039 Arm_relobj::make_exidx_input_section): New methods.
10040 (read_arm_attributes_section): Remove.
10041 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10042 information about them.
10043 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10044 to here.
10045
5ac169d4
DK
100462010-01-20 Doug Kwan <dougkwan@google.com>
10047
10048 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10049 Input_section_specifier to Section_id.
10050 (Target_arm::new_arm_input_section: Adjust code for change of key
10051 type.
10052 (Target_arm::find_arm_input_section): Ditto.
10053 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10054 (Section_id): Remove.
10055 (Garbage_collection::Section_id_hash): Remove.
10056 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10057 (Section_id): Remove.
10058 (Icf::Section_id_hash): Remove.
10059 * object.h (Section_id, Const_section_id, Section_id_hash,
10060 Const_section_id_hash): New type definitions.
10061 * output.cc (Output_section::add_relaxed_input_section): Change to
10062 use Const_section_id instead of Input_section_specifier as key type.
10063 (Output_section::add_merge_input_section): Ditto.
10064 (Output_section::build_relaxation_map): Change to use Section_id
10065 instead of Input_section_specifier as key type.
2e702c99 10066 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10067 Ditto.
10068 (Output_section::convert_input_sections_to_relaxed_sections): Change
10069 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10070 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10071 (Output_section::find_relaxed_input_section): Ditto.
10072 * output.h (Input_section_specifier): Remove class.
10073 (Output_section::Output_section_data_by_input_section_map): Change
10074 key type to Const_section_id.
10075 (Output_section::Output_relaxed_input_section_by_input_section_map):
10076 Ditto.
10077 (Output_section::Relaxation_map): Change key type to Section_id.
10078
a2162063
ILT
100792010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10080
10081 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10082 (class Arm_v4bx_stub): New class.
10083 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10084 (Stub_factory::make_arm_v4bx_stub): New method.
10085 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10086 (Stub_table::empty): Handle v4bx stubs.
10087 (Stub_table::add_arm_v4bx_stub): New method.
10088 (Stub_table::find_arm_v4bx_stub): New method.
10089 (Arm_relocate_functions::v4bx): New method.
10090 (Target_arm::fix_v4bx): New method.
10091 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10092 (Stub_table::relocate_stubs): Likewise.
10093 (Stub_table::do_write): Likewise.
10094 (Stub_table::update_data_size_and_addralign): Likewise.
10095 (Stub_table::finalize_stubs): Likewise.
10096 (Target_arm::Scan::local): Likewise.
10097 (Target_arm::Scan::global): Likewise.
10098 (Target_arm::do_finalize_sections): Likewise.
10099 (Target_arm::Relocate::relocate): Likewise.
10100 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10101 Likewise.
10102 (Target_arm::scan_reloc_for_stub): Likewise.
10103 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10104
5696ab0b
ILT
101052010-01-19 Ian Lance Taylor <iant@google.com>
10106
10107 * output.cc (Output_section_headers::do_sized_write): Write large
10108 segment count to sh_info field.
10109 (Output_file_header::do_sized_write): For large segment count,
10110 write PN_XNUM to e_phnum field.
10111
800d0f56
ILT
101122010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10113
10114 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10115 (Arm_relocate_functions::thm_jump8): New function.
10116 (Arm_relocate_functions::thm_jump11): New function.
10117 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10118 R_ARM_THM_JUMP11.
10119 (Target_arm::Scan::global): Likewise.
10120 (Target_arm::Relocate::relocate): Likewise.
10121 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10122 Likewise.
10123
41263c05
DK
101242010-01-14 Doug Kwan <dougkwan@google.com>
10125
10126 * arm.cc (map, utility): Include headers.
10127 (Target_arm::apply_cortex_a8_workaround): New method.
10128 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10129 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10130 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10131 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10132 the --[no-]fix-cortex-a8 command line options.
10133 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10134 (Target_arm::relocate_stub): Use addend in instruction template.
10135 * options.h (DEFINE_bool): Set the user-set flag.
10136 (General_options): Add --[no-]-fix-cortex options.
10137 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10138 : Update fast look-up map after conversion.
41263c05 10139
459e9b03
ST
101402010-01-14 Sriraman Tallam <tmsriram@google.com>
10141
10142 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10143 in the first pass of do_layout.
10144
b521dfe4
DK
101452010-01-13 Doug Kwan <dougkwan@google.com>
10146
10147 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10148 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10149 apparent compiler problem of not folding static constant integral
10150 data members of elfcpp::Elf_sizes<32>.
10151
44272192
DK
101522010-01-13 Doug Kwan <dougkwan@google.com>
10153
10154 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10155 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10156 Arm_relobj::scan_section_for_cortex_a8_erratum,
10157 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10158 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10159 sections to scan for relocation stubs into a new method
10160 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10161 relocation and Cortex-A8 stub scanning.
10162 (Target_arm::do_relax): Force stubs to be after stubbed sections
10163 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10164 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10165 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10166
44b71ece
ILT
101672010-01-12 Ian Lance Taylor <iant@google.com>
10168
10169 * target-reloc.h (visibility_error): New inline function.
10170 (relocate_section): Call visibility_error.
10171 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10172 (MOSTLYCLEANFILES): Likewise.
10173 (protected_4_pic.o, protected_3.err): New targets.
10174 * testsuite/protected_4.cc: New file.
10175
a120bc7f
DK
101762010-01-12 Doug Kwan <dougkwan@google.com>
10177
10178 * arm.cc (Cortex_a8_reloc): New class.
10179 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10180 and cortex_a8_relocs_info_.
10181 (Target_arm::fix_cortex_a8): New method definition.
10182 (Target_arm::Cortex_a8_relocs_info): New type.
10183 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10184 New data member declarations.
10185 (Target_arm::scan_reloc_for_stub): Record information about
10186 relocations for THUMB branches that might be exempted from the
10187 Cortex-A8 workaround.
10188 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10189 at the beginning of a relaxation pass.
10190
20138696
DK
101912010-01-12 Doug Kwan <dougkwan@google.com>
10192
10193 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10194 (Arm_relobj::Mapping_symbol_position,
10195 Arm_reloj::Mapping_symbol_position_less,
10196 Arm_relobj::Mapping_symbols_info): New types.
10197 (Target_arm::is_mapping_symbol_name): New method definition.
10198 (Arm_relobj::do_count_local_symbols): Save information about mapping
10199 symbols.
10200
089d69dc
DK
102012010-01-11 Doug Kwan <dougkwan@google.com>
10202
10203 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10204 Arm_relocate_functions::thumb32_branch_upper,
10205 Arm_relocate_functions::thumb32_branch_lower,
10206 Arm_relocate_functions::thumb32_cond_branch_offset,
10207 Arm_relocate_functions::thumb32_cond_branch_upper,
10208 Arm_relocate_functions::thumb32_cond_branch_lower,
10209 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10210 branch offset encoding.
10211 (Arm_relocate_functions::thumb_branch_common): Use new branch
10212 offset encoding methods to avoid code duplication.
10213 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10214 (Stub_addend_reader::operator()): Use new branch encoding method
10215 to avoid code duplication.
10216
99e5bff2
DK
102172010-01-11 Doug Kwan <dougkwan@google.com>
10218
10219 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10220 (Target_arm::do_finalize_sections): Define special EXIDX section
10221 symbols only if referenced.
10222 * gc.h (Garbage_collection::add_reference): New method.
10223 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10224 code duplication.
10225
98e090bd
ILT
102262010-01-11 Ian Lance Taylor <iant@google.com>
10227
d0a91bd8
ILT
10228 * script.cc (Version_script_info::build_expression_list_lookup):
10229 Change complaing about duplicate wildcard match from error to
10230 warning.
10231
98e090bd
ILT
10232 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10233 of 2009-12-30.
10234 (Version_script_info::Version_script_info): Initialize globs_,
10235 default_version_, default_is_global_, and exact_. Don't
10236 initialize globals_ or locals_.
10237 (Version_script_info::build_lookup_tables): Build local symbols
10238 first.
10239 (Version_script_info::unquote): New function.
10240 (Version_script_info::add_exact_match): New function.
10241 (Version_script_info::build_expression_list_lookup): Remove lookup
10242 parameter. Add is_global parameter. Change all callers. Handle
10243 wildcard pattern specially. Unquote pattern. Call
10244 add_exact_match.
10245 (Version_script_info::get_name_to_match): New function.
10246 (Version_script_info::get_symbol_version): New function.
10247 (Version_script_info::get_symbol_version_helper): Remove.
10248 (Version_script_info::check_unmatched_names): Call unquote.
10249 * script.h (class Version_script_info): Change get_symbol_version
10250 to be non-inline and add is_global parameter; change all callers.
10251 Rewrite symbol_is_local. Update declarations. Define struct
10252 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10253 Remove globals_ and locals_ members. Add exact_, globs_,
10254 default_version_, is_global_.
10255 (Version_script_info::Glob): Remove pattern, add expression and
10256 is_global. Update constructor. Change all callers.
10257 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10258 default version.
10259 (Versions::symbol_section_contents): If a symbol is undefined, or
10260 defined in a dynamic object, set the version index to
10261 VER_NDX_LOCAL.
10262 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10263 symbol_is_local.
10264 (Symbol_table::add_from_pluginobj): Likewise.
10265 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10266
d56962d3
DK
102672010-01-11 Doug Kwan <dougkwan@google.com>
10268
10269 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10270 (incremental_dump_LDADD): Add linking option for libintl.
10271 * Makefile.in: Regenerate.
10272
94e6ee91
L
102732010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10274
10275 PR gold/11144
10276 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10277 instead of -Ds.
10278 * testsuite/Makefile.in: Regenerated.
10279
e96c574b
DK
102802010-01-10 Doug Kwan <dougkwan@google.com>
10281
10282 * options.h (DEFINE_var): Use parentheses around argument varname__
10283 in macro body to avoid any unintended subsequent substitutions.
10284
7198066b
ILT
102852010-01-10 Ian Lance Taylor <iant@google.com>
10286
ba4d53bf
ILT
10287 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10288 candidates before doing symbol resolution.
10289
7198066b
ILT
10290 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10291 ODR candidates if only one is weak.
10292
a2beed37
ILT
102932010-01-08 Ian Lance Taylor <iant@google.com>
10294
10295 * script.cc (Version_script_info::build_expression_list_lookup):
10296 Don't warn about ambiguous version, just record the ambiguity.
10297 (Version_script_info::get_symbol_version_helper): Give error if
10298 version is ambiguous.
10299
2fb7225c
DK
103002010-01-08 Doug Kwan <dougkwan@google.com>
10301
10302 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10303 prev_data_size_ and prev_addralign_. Remove initializer for
10304 deleted data member has_been_changed_.
10305 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10306 to determine if the table is empty.
10307 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10308 Remove.
10309 (Stub_table::add_reloc_stub): Define method in class definition
10310 instead of just declaring it there.
10311 (Stub_table::add_cortex_a8_stub): New method definition.
10312 (Stub_table::update_data_size_and_addralign): Ditto.
10313 (Stub_table::finalize_stubs): Ditto.
10314 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10315 (Stub_table::do_addralign_): Return address alignment in the
10316 (Stub_table::do_reset_address_and_file_offset): Define method in
10317 class definition instead of declaring it there. Set current data
10318 size to be the data size of the previous pass.
10319 (Stub_table::set_final_data_size): Use current data size as the
10320 final data size.
10321 (Stub_table::relocate_stub): Change parameter type of stub from
10322 Reloc_stub pointer to Stub pointer.
10323 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10324 (Stub_table::Cortex_a8_stub_list): New typedef.
10325 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10326 Stub_table::prev_addralign_): New data member.
10327 (Arm_relobj::Arm_relobj): Initialize data member
10328 section_has_cortex_a8_workaround_.
10329 (Arm_relobj::section_has_cortex_a8_workaround,
10330 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10331 definitions.
10332 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10333 declarations.
10334 (Target_arm::relocate_stub): Change parameter type of stub from
10335 Reloc_stub pointer to Stub pointer.
10336 (Insn_template::size, Insn_template::alignment): Handle
10337 THUMB16_SPECIAL_TYPE.
10338 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10339 Stub_table::update_data_size_and_addralign,
10340 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10341 definitions.
10342 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10343 (Stub_table::do_write): Ditto.
10344 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10345
880cd20d
ILT
103462010-01-08 Ian Lance Taylor <iant@google.com>
10347
10348 PR 11108
10349 * symtab.h (class Symbol): Remove fields is_target_special_ and
10350 has_plt_offset_. Add field is_defined_in_discarded_section_.
10351 (Symbol::is_defined_in_discarded_section): New function.
10352 (Symbol::set_is_defined_in_discarded_section): New function.
10353 (Symbol::has_plt_offset): Rewrite.
10354 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10355 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10356 Don't initialize is_target_special_ or has_plt_offset_.
10357 Initialize is_defined_in_discarded_section_.
10358 (Symbol_table::add_from_relobj): If appropriate, set
10359 is_defined_in_discarded_section.
10360 * resolve.cc (Symbol::override_base_with_special): Don't test
10361 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10362 * target-reloc.h (relocate_section): Do special handling for
10363 symbols defined in discarded sections for global symbols as well
10364 as local symbols.
10365
2703e3eb
ILT
103662010-01-08 Ian Lance Taylor <iant@google.com>
10367
10368 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10369 the SHT_SYMTAB case.
10370
339d40a3
ILT
103712010-01-08 Ian Lance Taylor <iant@google.com>
10372
10373 * object.cc (Sized_relobj::do_layout): Don't get confused if
10374 layout_eh_frame returns NULL.
10375
abecea76
ILT
103762010-01-08 Ian Lance Taylor <iant@google.com>
10377
10378 PR 11084
10379 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10380 dynamic symbol table, use the normal symbol table.
10381 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10382 symbol table.
10383
6b7dd3f3
ILT
103842010-01-08 Ian Lance Taylor <iant@google.com>
10385
10386 PR 11072
10387 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10388 sections.
10389
36c50e63
L
103902010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10391
10392 * version.cc (print_version): Change to "Copyright 2010".
10393
e291e7b9
ILT
103942010-01-08 Ian Lance Taylor <iant@google.com>
10395
10396 PR 10287
10397 PR 11063
10398 * i386.cc (class Target_i386): Change return type of plt_section
10399 to be non-const.
10400 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10401 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10402 tls_desc_rel_ field.
10403 (Output_data_plt_i386::rel_tls_desc): New function.
10404 (Target_i386::rel_tls_desc_section): New function.
10405 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10406 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10407 R_386_TLS_DESC reloc in rel_tls_desc_section.
10408 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10409 Define struct Tlsdesc_info.
10410 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10411 (Target_x86_64::do_reloc_symbol_index): New function.
10412 (Target_x86_64::add_tlsdesc_info): New function.
10413 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10414 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10415 tlsdesc_rel_ field.
10416 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10417 all callers.
10418 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10419 (Target_x86_64::rela_tlsdesc_section): New function.
10420 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10421 handling.
10422 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10423 (Target_x86_64::do_reloc_addend): New function.
10424 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10425 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10426 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10427 (Output_reloc::type): New function.
10428 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10429 (Output_reloc::is_target_specific): New function.
10430 (Output_reloc::target_arg): New function.
10431 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10432 absolute relocs and target specific relocs.
10433 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10434 add_target_specific.
10435 (class Output_data_reloc) [SHT_RELA]: Likewise.
10436 * output.cc (Output_reloc::Output_reloc): Add four new versions
10437 for absolute relocs and target specific relocs.
10438 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10439 (Output_reloc::get_symbol_index): Likewise.
10440 (Output_reloc::local_section_offset): Check that local_sym_index_
10441 is not TARGET_CODE or 0.
10442 (Output_reloc::symbol_value): Likewise.
10443 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10444 reloc.
10445 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10446 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10447 functions.
10448 * layout.cc (add_target_dynamic_tags): Use output section for
10449 DT_PLTRELSZ and DT_JMPREL.
10450
3a44184e
ILT
104512010-01-07 Ian Lance Taylor <iant@google.com>
10452
10453 PR 11061
10454 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10455 function.
10456 (class Output_data_reloc_generic): Define.
10457 (class Output_data_reloc_base): Change base class to
10458 Output_data_reloc_generic. Change add() method to call
10459 bump_relative_reloc_count for a relative reloc. Remove
10460 sort_relocs_ field.
10461 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10462 to sort_relocs().
10463 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10464 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10465 appropriate.
10466 * layout.h (class Layout): Update declaration.
10467
ea715a34
ILT
104682010-01-07 Ian Lance Taylor <iant@google.com>
10469
10470 * output.h (class Output_data): Add const version of
10471 output_section and do_output_section.
10472 (class Output_section_data): Add const version of
10473 do_output_section.
10474 (class Output_section): Likewise.
10475 * layout.cc (Layout::add_target_dynamic_tags): New function.
10476 * layout.h (class Layout): Update declarations.
10477 * arm.cc (Target_arm::do_finalize_sections): Use
10478 add_target_dynamic_tags.
10479 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10480 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10481 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10482 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10483
659948a4
ILT
104842010-01-07 Ian Lance Taylor <iant@google.com>
10485
10486 PR 11042
10487 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10488 object as needed.
10489
9d3b86f6
ILT
104902010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10491 Ian Lance Taylor <iant@google.com>
10492
10493 PR 11019
10494 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10495 Xindex::read_symtab_xindex.
10496
bb0d3eb0
DK
104972010-01-07 Doug Kwan <dougkwan@google.com>
10498
10499 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10500 (Insn_template::thumb16_bcond_insn): New method declaration.
10501 (Insn_template): Fix spelling.
10502 (Stub::thumb16_special): New method declaration.
10503 (Stub::do_write): Define virtual method which was previously pure
10504 virtual.
10505 (Stub::do_thumb16_special): New method declaration.
10506 (Stub::do_fixed_endian_write): New template member.
10507 (Reloc_stub::do_write): Remove.
10508 (Reloc_stub::do_fixed_endian_write): Remove.
10509 (Cortex_a8_stub): New class definition.
10510 (Stub_factory::make_cortex_a8_stub): New method definition.
10511 (Stub_factory::Stub_factory): Add missing static storage class
10512 qualifier for elf32_arm_stub_a8_veneer_blx.
10513
ffeef7df
ILT
105142010-01-07 Ian Lance Taylor <iant@google.com>
10515
dc3f80fe
ILT
10516 PR 10980
10517 * options.h (class General_options): Add --warn-unresolved-symbols
10518 and --error-unresolved-symbols.
10519 * errors.cc (Errors::undefined_symbol): Implement
10520 --warn-unresolved-symbols.
10521
ffeef7df
ILT
10522 * options.h (class General_options): Add -z text and -z textoff.
10523 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10524
f1ec9ded
ST
105252010-01-06 Sriraman Tallam <tmsriram@google.com>
10526
10527 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10528 (Garbage_collection::cident_sections): New function.
10529 (Garbage_collection::add_cident_section): New function.
10530 (Garbage_collection::cident_sections_): New member.
10531 (gc_process_relocs): Add references to sections whose names are C
10532 identifiers.
10533 * gold.h (cident_section_start_prefix): New constant.
10534 (cident_section_stop_prefix): New constant.
10535 (is_cident): New function.
10536 * layout.cc (Layout::define_section_symbols): Replace string constants
10537 with the newly defined constants.
10538 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10539 C identifiers.
10540 * testsuite/Makefile.am: Add gc_orphan_section_test.
10541 * testsuite/Makefile.in: Regenerate.
10542 * testsuite/gc_orphan_section_test.cc: New file.
10543 * testsuite/gc_orphan_section_test.sh: New file.
10544
6eda8c29
ILT
105452010-01-06 Ian Lance Taylor <iant@google.com>
10546
b9674e17
ILT
10547 PR 10980
10548 * options.h (class General_options): Add --warn-shared-textrel.
10549 * layout.cc (Layout::finish_dynamic_section): Implement
10550 --warn-shared-textrel.
10551
6eda8c29
ILT
10552 PR 10980
10553 * options.h (class General_options): Add --warn-multiple-gp.
10554
32dcd44e
ILT
105552010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10556
10557 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10558 $(THREADSLIB) and $(LIBDL).
10559 * Makefile.in: Rebuild.
10560
a192ba05
ILT
105612010-01-06 Ian Lance Taylor <iant@google.com>
10562
10563 PR 10980
10564 * options.cc (General_options::parse_section_start): New function.
10565 (General_options::section_start): New function.
10566 (General_options::General_options): Initialize all members.
10567 * options.h: Include <map>
10568 (class General_options): Add --section-start. Add section_starts_
10569 member.
10570 * layout.cc (Layout::attach_allocated_section_to_segment): If
10571 --section-start was used, set the address of the segment. Remove
10572 local sort_sections.
10573 (Layout::relaxation_loop_body): If the address of the load segment
10574 has been set by --section-start, don't use it.
10575 * output.h (Output_segment::update_flags_for_output_section): New
10576 function.
10577 * output.cc (Output_segment::add_output_section): Call
10578 update_flags_for_output_section.
10579
dde3f402
ILT
105802010-01-05 Ian Lance Taylor <iant@google.com>
10581
62dfdd4d
ILT
10582 PR 10980
10583 * options.h (class General_options): Add --undefined-version.
10584 * script.cc (struct Version_expression): Add was_matched_by_symbol
10585 field.
10586 (Version_script_info::matched_symbol): New function.
10587 (Version_script_info::get_symbol_version_helper): Call
10588 matched_symbol.
10589 (Version_script_info::check_unmatched_names): New function.
10590 * script.h (class Version_script_info): Update declarations.
10591 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10592
9c4ae156
ILT
10593 * options.h (class General_options): Use DEFINE_bool_alias for
10594 allow_multiple_definition.
10595 * resolve.cc (Symbol_table::should_override): Don't test
10596 allow_multiple_definition.
10597
dde3f402
ILT
10598 PR 10980
10599 * options.h (class General_options): Add --cref.
10600 * main.cc (main): Print cref table if --cref. Don't close mapfile
10601 until after printing cref table.
10602 * cref.cc: Include "symtab.h".
10603 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10604 (Cref_table_compare::operator()): New function.
10605 (Cref_inputs::gather_cref): New function.
10606 (filecol): New static const.
10607 (Cref_inputs::print_cref): New function.
10608 (Cref::print_cref): New function.
10609 * cref.h: Include <cstdio>.
10610 (class Cref): Update declarations.
10611 * mapfile.h (Mapfile::file): New function.
10612 * object.h (class Object): Define Symbols. Declare virtual
10613 do_get_global_symbols.
10614 (Object::get_global_symbols): New function.
10615 * object.cc (Input_objects::add_object): Pass object to cref_ if
10616 --cref.
10617 (Input_objects::archive_start): Likewise.
10618 (Input_objects::archive_stop): Likewise.
10619 (Input_objects::print_cref): New function.
10620 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10621 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10622 --cref.
10623 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10624 function.
10625 * plugin.h (class Sized_pluginobj): Update declarations.
10626
8781f709
ILT
106272010-01-05 Ian Lance Taylor <iant@google.com>
10628
10629 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10630 to is_default_version. Rename insdef to insdefault.
10631 (Symbol_table::add_from_relobj): Rename def to is_default_version
10632 and local to is_forced_local.
10633 (Symbol_table::add_from_pluginobj): Likewise.
10634 (Symbol_table::add_from_dynobj): Likewise.
10635 (Symbol_table::define_special_symbol): Rename insdef to
10636 insdefault.
10637
fe35d28d
ILT
106382010-01-04 Ian Lance Taylor <iant@google.com>
10639
30bc8c46
ILT
10640 PR 10980
10641 * options.h (class General_options): Add
10642 --allow-multiple-definition and -z muldefs.
10643 * resolve.cc (Symbol_table::should_override): Don't warn about a
10644 multiple symbol definition if --allow-multiple-definition or -z
10645 muldefs.
10646
7eaea549
ILT
10647 PR 10980
10648 * options.h (class General_options): Add --add-needed and
10649 --copy-dt-needed-entries. Tweak --as-needed help entry.
10650 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10651 error if --copy-dt-needed-entries aka --add-needed is used and
10652 would cause a change in behaviour.
10653
fe35d28d
ILT
10654 PR 10980
10655 * options.h (class General_options): Add -G as a short version of
10656 --shared. Add no-op options -assert, -g, and -i.
10657
55a2bb35
ST
106582010-01-04 Sriraman Tallam <tmsriram@google.com>
10659
10660 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10661 check for .text or .gnu.linkonce.t sections.
10662 * icf.cc (Icf::find_identical_sections): Ditto.
10663 Change the detection for mangled function name within the section
10664 name.
10665 * icf.h (is_section_foldable_candidate): New function.
10666
719328e1
ILT
106672009-12-30 Ian Lance Taylor <iant@google.com>
10668
10669 PR 10980
10670 * options.h (class General_options): Permit two dashes with
10671 --retain-symbols-file.
10672
d7bb5745
ILT
106732009-12-30 Ian Lance Taylor <iant@google.com>
10674
403a15dd
ILT
10675 PR 10979
10676 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10677 don't put the file header and segment headers in the text
10678 segment.
10679
eda294df
ILT
10680 PR 10979
10681 * common.cc (Sort_commons::operator()): Stabilize sort when both
10682 entries are NULL.
10683 (Symbol_table::do_allocate_commons_list): When allocating common
10684 symbols, skip a symbol which is no longer common.
10685 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10686 an object before checking its type.
10687 * testsuite/common_test_2.c: New file.
10688 * testsuite/common_test_3.c: New file.
10689 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10690 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10691 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10692 (common_test_2_pic.o, common_test_2.so): New targets.
10693 (common_test_3_pic.o, common_test_3.so): New targets.
10694 * testsuite/Makefile.in: Rebuild.
10695
d7bb5745
ILT
10696 PR 10979
10697 * script.cc (read_input_script): If we see a new SECTIONS clause,
10698 and we have added an input section, give an error.
10699 * layout.h (class Layout): Add have_added_input_section function.
10700 Add have_added_input_section_ field.
10701 * layout.cc (Layout::Layout): Initialize
10702 have_added_input_section_.
10703 (Layout::layout): Set have_added_input_section_.
10704 (Layout::layout_eh_frame): Likewise.
10705
fc59c572
ILT
107062009-12-30 Ian Lance Taylor <iant@google.com>
10707
10708 PR 10931
10709 * options.h (class General_options): Add --sort-common option.
10710 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10711 * common.cc (Sort_common): Add sort_order parameter to
10712 constructor. Add sort_order_ field.
10713 (Sort_commons::operator): Check sort_order_.
10714 (Symbol_table::allocate_commons): Determine the sort order.
10715 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10716 Change all callers.
10717 (Symbol_table::do_allocate_commons_list): Likewise.
10718
1c74fab0
ILT
107192009-12-30 Ian Lance Taylor <iant@google.com>
10720
10721 PR 10916
10722 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10723 symbols from this object, don't change the visibility of an
10724 undefined symbol.
10725 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10726
6affe781
ILT
107272009-12-30 Ian Lance Taylor <iant@google.com>
10728
10729 PR 10861
10730 * script.h (class Version_script_info): Define Language enum.
10731 Update declarations. Define Glob, Exact, and Lookup types. Add
10732 new fields globals_, locals_, and is_finalized_.
10733 * script.cc: Various formatting fixes.
10734 (class Parser_closure): Change language_stack_ from a vector of
10735 std::string to one of Version_script_info::Language. Adjust all
10736 uses accordingly.
10737 (class Lazy_demangler): Remove.
10738 (struct Version_expression): Change language from std::string to
10739 Version_script_info::Language.
10740 (Version_script_info::Version_script_info): New function.
10741 (Version_script_info::~Version_script_info): Don't call clear.
10742 (Version_script_info::finalize): New function.
10743 (Version_script_info::build_lookup_tables): New function.
10744 (Version_script_info::build_expression_list_lookup): New
10745 function.
10746 (Version_script_info::get_symbol_version_helper): Rewrite to use
10747 lookup tables.
10748 (Version_script_info::print_expression_list): Adjust to use
10749 Version_script_info::Language.
10750 (script_push_lex_into_version_mode): Check that the version script
10751 has not been finalized.
10752 (version_script_push_lang): Change language string to
10753 Version_script_info::Language.
10754 * options.cc (Command_line::version_script): New function.
10755 * options.h (class General_options): Add finalize_dynamic_list
10756 function. Change version_script from declaration to definition.
10757 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10758 * testsuite/version_script.map: Remove duplicate def of foo.
10759 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10760 version_script.map.
10761 * testsuite/Makefile.in: Rebuild.
10762
818bf354
ILT
107632009-12-30 Ian Lance Taylor <iant@google.com>
10764
10765 PR 10843
10766 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10767 if the input symbol index is 0, make the output symbol index 0.
10768
ebcc8304
ILT
107692009-12-30 Ian Lance Taylor <iant@google.com>
10770
10771 PR 10670
10772 * options.h (class General_options): Add -x/--discard-all.
10773 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10774 --discard-all. If the local symbol needs a dynamic entry, check
10775 that before handling --discard-locals.
10776
176fe33f
ILT
107772009-12-30 Ian Lance Taylor <iant@google.com>
10778
bb321bb1
ILT
10779 PR 10450
10780 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10781 flags to PF_R.
10782 (Output_segment::add_output_section): Don't change the flags if
10783 the type is PT_TLS.
10784
176fe33f
ILT
10785 PR 10450
10786 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10787 GNU hash table if they need a dynamic value. Otherwise, don't add
10788 them if they are defined in a dynamic object or are forced local.
10789
e8cd95c7
ILT
107902009-12-29 Ian Lance Taylor <iant@google.com>
10791
1b81fb71
ILT
10792 PR 10450
10793 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10794 .gnu.hash table for a 32-bit target.
10795
8d6d383d
ILT
10796 PR 10450
10797 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10798 regular and a dynamic object only needs a dynamic symbol table
10799 entry if it is externally visible.
10800
e785ec03
ILT
10801 PR 10450
10802 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10803 constructor. Add global_offset_table_ field.
10804 (Target_i386::got_section): Set global_offset_table_.
10805 (Target_i386::do_finalize_sections): Set global_offset_table_
10806 size.
10807 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10808 in constructor. Add global_offset_table_ field.
10809 (Target_x86_64::got_section): Set global_offset_table_.
10810 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10811 size.
10812
1a2dff53
ILT
10813 * layout.cc (Layout::Layout): Initialize increase_relro_.
10814 (Layout::get_output_section): Add is_relro, is_last_relro, and
10815 is_first_non_relro parameters. Change all callers.
10816 (Layout::choose_output_section): Likewise.
10817 (Layout::add_output_section_data): Likewise.
10818 (Layout::make_output_section): Likewise.
10819 (Layout::set_segment_offsets): Clear increase_relro when using a
10820 linker script.
10821 * layout.h (class Layout): Add increase_relro method. Add
10822 increase_relro_ field. Update declarations.
10823 * output.cc (Output_section::Output_section): Initialize
10824 is_last_relro_ and is_first_non_relro_.
10825 (Output_segment::add_output_section): Group relro sections is
10826 do_sort is true. Handle is_last_relro and is_first_non_relro.
10827 (Output_segment::maximum_alignment): Remove relro handling.
10828 (Output_segment::set_section_addresses): Add increase_relro
10829 parameter. Change all callers. Add initial alignment to align
10830 relro sections on separate page. Remove old relro handling.
10831 (Output_segment::set_section_list_addresses): Remove in_relro
10832 parameter. Change all callers.
10833 (Output_segment::set_offset): Add increase parameter. Change all
10834 callers. Remove old relro handling.
10835 * output.h (class Output_section): Add new methods: is_last_relro,
10836 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10837 Add is_last_relro_ and is_first_non_relro_ fields.
10838 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10839 Create separate .got.plt section. Call increase_relro.
10840 * x86_64.cc (Target_x86_64::got_section): Likewise.
10841 * testsuite/relro_script_test.t: Add .got.plt.
10842
f0ba79e2
ILT
10843 PR 10450
10844 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10845 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10846 (Layout::finalize): Call set_dynamic_symbol_size.
10847 (Layout::set_dynamic_symbol_size): New function.
10848 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10849 set_dynamic_symbol_size.
10850
e8cd95c7
ILT
10851 PR 10450
10852 * output.h (class Output_section): Add is_entsize_zero_ field.
10853 * output.cc (Output_section::Output_section): Initialize
10854 is_entsize_zero_.
10855 (Output_section::set_entsize): If two different entsizes are
10856 requested, force it to zero.
10857 (Output_section::add_input_section): Set flags for .debug_str
10858 before updating section flags. Set entsize.
10859 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10860 and SHF_STRING if all input sections have those flags.
10861
3e1b9a8a
RÁE
108622009-12-29 Rafael Espindola <espindola@google.com>
10863
10864 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10865 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10866 reporting.
3e1b9a8a 10867
3dcad376
ST
108682009-12-29 Sriraman Tallam <tmsriram@google.com>
10869
10870 * options.cc (General_options::parse_version): Allow -v to exit
10871 without an error if there is nothing to link.
10872
084e2665
ILT
108732009-12-29 Ian Lance Taylor <iant@google.com>
10874
10875 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10876 using a version of gcc before 4.1.
10877 * configure: Rebuild.
10878
250acde3
CD
108792009-12-28 Chris Demetriou <cgd@google.com>
10880
10881 * attributes.cc (Output_attributes_section_data::do_write): Use
10882 std::vector::front rather than std::vector::data.
10883
99fff23b
ILT
108842009-12-28 Ian Lance Taylor <iant@google.com>
10885
10886 * symtab.h (class Symbol_table): Add enum Defined.
10887 * resolve.cc (Symbol_table::should_override): Add defined
10888 parameter. Change all callers. Test whether object is NULL
10889 before calling a method on it.
10890 (Symbol_table::report_resolve_problem): Add defined parameter.
10891 Change all callers.
10892 (Symbol_table::should_override_with_special): Likewise.
10893 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10894 parameter. Change all callers.
10895 (Symbol_table::do_define_in_output_data): Likewise.
10896 (Symbol_table::define_in_output_segment): Likewise.
10897 (Symbol_table::do_define_in_output_segment): Likewise.
10898 (Symbol_table::define_as_constant): Likewise.
10899 (Symbol_table::do_define_as_constant): Likewise.
10900 * script.h (class Symbol_assignment): Add is_defsym parameter to
10901 constructor; change all callers.
10902 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10903 parameter. Change all callers. Add is_defsym_ field.
10904 (class Parser_closure): Add parsing_defsym parameter to
10905 constructor; change all callers. Add parsing_defsym accessor
10906 function. Add parsing_defsym_ field.
10907
556bd683
ILT
109082009-12-28 Ian Lance Taylor <iant@google.com>
10909
10910 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10911 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10912
1782c879
ILT
109132009-12-23 Ian Lance Taylor <iant@google.com>
10914
10915 * i386.cc (Target_i386::do_calls_non_split): Recognize
10916 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10917 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10918 -fsplit-stack prologue when using %r11.
1782c879 10919
329ca2b1
ST
109202009-12-21 Sriraman Tallam <tmsriram@google.com>
10921
10922 * options.cc (General_options::parse_version): Make -v continue and do
10923 the link like GNU ld does.
10924
d675ff46
RÁE
109252009-12-17 Rafael Avila de Espindola <espindola@google.com>
10926
10927 * Makefile.am (CCFILES): Add timer.cc.
10928 (HFILES): Add timer.h.
10929 * configure.ac: Check for sysconf and times.
10930 * main.cc: include timer.h.
10931 (main): Use Timer instead of get_run_time.
10932 * timer.cc: New.
10933 * timer.h: New.
10934 * workqueue.cc: include timer.h.
10935 (Workqueue::find_and_run_task):
10936 Report user, sys and wall time.
10937 * Makefile.in: Regenerate.
10938 * config.in: Regenerate.
10939 * configure: Regenerate.
10940
d6344fb5
DK
109412009-12-16 Doug Kwan <dougkwan@google.com>
10942
10943 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10944 sections.
10945 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10946 relaxed input sections.
10947 * output.cc (Output_section::find_relaxed_input_section): Change
10948 return type to Output_relaxed_input_section pointer. Adjust code
10949 for new type of relaxed_input_section_map_.
10950 * output.h (Output_section::find_relaxed_input_section): Change
10951 return type to Output_relaxed_input_section pointer.
10952 (Output_section::Output_relaxed_input_section_by_input_section_map):
10953 New type.
10954 (Output_section::relaxed_input_section_map_): Change type to
10955 Output_section::Output_relaxed_input_section_by_input_section_map.
10956 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10957 input section.
10958
0e0d5469
ILT
109592009-12-15 Ian Lance Taylor <iant@google.com>
10960
10961 * layout.cc (Layout::create_shstrtab): Only write out after input
10962 sections if we are compressing debug sections.
10963
0649a889
ILT
109642009-12-15 Ian Lance Taylor <iant@google.com>
10965
10966 * archive.cc (Archive::add_symbols): Only look up a symbol without
10967 a version if there is, in fact, a version.
10968
2ea97941
ILT
109692009-12-14 Ian Lance Taylor <iant@google.com>
10970
10971 Revert -Wshadow changes, all changes from:
10972 2009-12-11 Doug Kwan <dougkwan@google.com>
10973 2009-12-11 Nick Clifton <nickc@redhat.com>
10974 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10975
b0eec2cc
DK
109762009-12-11 Doug Kwan <dougkwan@google.com>
10977
10978 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10979 due to -Wshadow.
10980 * attributes.cc (Object_attribute::size): Ditto.
10981 (Attributes_section_data::size): Ditto.
10982 (Attributes_section_data::Attributes_section_data): Ditto.
10983 (Output_attributes_section_data::do_write): Ditto.
10984 * attributes.h (Object_attribute::set_type): Ditto.
10985 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10986
91d6fa6a
NC
109872009-12-11 Nick Clifton <nickc@redhat.com>
10988
10989 * archive.cc: Fix shadowed variable warnings.
10990 * arm.cc: Likewise.
10991 * compressed_output.cc: Likewise.
10992 * compressed_output.h: Likewise.
10993 * configure: Likewise.
10994 * dwarf_reader.cc: Likewise.
10995 * dynobj.cc: Likewise.
10996 * dynobj.h: Likewise.
10997 * ehframe.cc: Likewise.
10998 * ehframe.h: Likewise.
10999 * errors.cc: Likewise.
11000 * expression.cc: Likewise.
11001 * fileread.cc: Likewise.
11002 * fileread.h: Likewise.
11003 * freebsd.h: Likewise.
11004 * i386.cc: Likewise.
11005 * icf.cc: Likewise.
11006 * incremental.h: Likewise.
11007 * layout.cc: Likewise.
11008 * layout.h: Likewise.
11009 * mapfile.cc: Likewise.
11010 * merge.cc: Likewise.
11011 * merge.h: Likewise.
11012 * object.cc: Likewise.
11013 * object.h: Likewise.
11014 * options.h: Likewise.
11015 * output.cc: Likewise.
11016 * output.h: Likewise.
11017 * parameters.cc: Likewise.
11018 * plugin.cc: Likewise.
11019 * powerpc.cc: Likewise.
11020 * reduced_debug_output.cc: Likewise.
11021 * reduced_debug_output.h: Likewise.
11022 * reloc.cc: Likewise.
11023 * reloc.h: Likewise.
11024 * resolve.cc: Likewise.
11025 * script-sections.cc: Likewise.
11026 * script.cc: Likewise.
11027 * script.h: Likewise.
11028 * sparc.cc: Likewise.
11029 * symtab.cc: Likewise.
11030 * symtab.h: Likewise.
11031 * target-select.cc: Likewise.
11032 * target-select.h: Likewise.
11033 * token.h: Likewise.
11034 * workqueue.cc: Likewise.
11035 * workqueue.h: Likewise.
11036 * x86_64.cc: Likewise.
11037
a0351a69
DK
110382009-12-10 Doug Kwan <dougkwan@google.com>
11039
11040 * arm.cc (attributes.h): New include.
11041 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11042 (Arm_relobj::~Arm_relobj): Delete object pointed by
11043 attributes_section_data_.
11044 (Arm_relobj::attributes_section_data): New method definition.
11045 (Arm_relobj::attributes_section_data_): New data member declaration.
11046 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11047 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11048 attributes_section_data_.
11049 (Arm_dynobj::attributes_section_data): New method definition.
11050 (Arm_dynobj::attributes_section_data_): New data member declaration.
11051 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11052 initialization value of may_use_blx_ to false.
2e702c99 11053 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11054 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11055 object attributes to compute results instead of hard-coding.
11056 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11057 Target_arm::get_secondary_compatible_arch,
11058 Target_arm::set_secondary_compatible_arch
11059 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11060 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11061 New method declarations.
11062 (Target_arm::get_aeabi_object_attribute): New method definition.
11063 (Target_arm::attributes_section_data_): New data member declaration.
11064 (read_arm_attributes_section): New template definition.
11065 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11066 (Arm_dynobj::do_read_symbols): Ditto.
11067 (Target_arm::do_finalize_sections): Merge attributes sections from
11068 input. Check for BLX use after attributes section merging.
11069 Fix __exidx_start and __exidx_end visibility. Create an
11070 .ARM.attributes section if necessary.
11071 (Target_arm::get_secondary_compatible_arch,
11072 Target_arm::set_secondary_compatible_arch,
11073 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11074 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11075 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11076 New method definitions.
11077
b59befec
ILT
110782009-12-09 Ian Lance Taylor <iant@google.com>
11079
11080 * plugin.cc (Plugin::load): Don't cast from void* to a function
11081 pointer.
11082
1276bc89
ILT
110832009-12-09 Ian Lance Taylor <iant@google.com>
11084
11085 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11086 information fields.
11087
2f2de248
L
110882009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11089
11090 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11091 Replace two_file_shared_1.so with two_file_shared_2.so.
11092 * testsuite/Makefile.in: Regenerated.
11093
4f787271
DK
110942009-12-08 Doug Kwan <dougkwan@google.com>
11095
11096 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11097 (HFILES): Add attributes.h and int_encoding.h.
11098 * Makefile.in: Regenerate.
11099 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11100 function definitions to int_encoding.cc
11101 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11102 prototypes to int_encoding.h
11103 * reduced_debug_output.cc (int_encoding.h): New include.
11104 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11105 function definitions to int_encoding.cc
11106 (insert_into_vector, read_from_pointer): Move template definitions to
11107 int_encoding.h
11108 * attributes.cc: New file.
11109 * attributes.h: New file.
11110 * int_encoding.cc: New file.
11111 * int_encoding.h: New file.
11112
20b52f1a
RÁE
111132009-12-07 Rafael Avila de Espindola <espindola@google.com>
11114
11115 PR gold/11055
11116 * incremental-dump.cc (dump_incremental_inputs): New.
11117 (main): Use dump_incremental_inputs.
11118
53d7974c
L
111192009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11120
11121 PR gold/10893
11122 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11123 checking elfcpp::STT_FUNC.
11124 (Target_i386::Relocate::relocate): Likewise.
11125 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11126
11127 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11128 symbols from shared libraries into normal FUNC symbols.
11129
11130 * symtab.h (Symbol): Add is_func and use it.
11131
05a352e6
DK
111322009-12-05 Doug Kwan <dougkwan@google.com>
11133
11134 * arm.cc (Target_arm::arm_info): Initialize new fields
11135 attributes_section and attributes_vendor.
11136 * i386.cc (Target_i386::i386_info): Same.
11137 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11138 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11139 fields attributes_section and attributes_vendor.
53d7974c 11140 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11141 * target.h (Target::attributes_section, Target::attributes_vendor,
11142 Target::is_attributes_section, Target::attribute_arg_type,
11143 Target::attributes_order): New method definitions.
11144 (Target::Target_info::attributes_section,
11145 Target::Target_info::attributes_vendor): New fields.
11146 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11147 virtual method definitions.
11148 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11149 attributes_section and attributes_vendor.
11150 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11151
f4e5969c
DK
111522009-12-05 Doug Kwan <dougkwan@google.com>
11153
11154 * arm.cc: Update comments about interworking and stub generation.
11155 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11156 considered as non-PIC.
11157 (Arm_relocate_functions::base_abs): Fix formatting.
11158 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11159 of function to use GOT entry address instead of offset.
11160 (Target_arm::Scan::global): Issue an error if a symbol would need a
11161 PLT does not get one because it is untyped. Remove code to create
11162 dynamic symbols for relative branches.
11163 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11164 takes unsigned integer instead of boolean.
11165
1abce4a6
L
111662009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11167
11168 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11169 (two_file_test_LDADD): Likewise.
11170 (common_test_1_LDADD): Likewise.
11171 (exception_test_LDADD) Likewise.
11172 (weak_test_LDADD): Likewise.
11173 (many_sections_test_LDADD): Likewise.
11174 (initpri1_LDADD): Likewise.
11175 (script_test_1_LDADD): Likewise.
11176 (script_test_2_LDADD): Likewise.
11177 (justsyms_LDADD): Likewise.
11178 (binary_test_LDADD): Likewise.
11179 (large_LDADD): Likewise.
11180 * testsuite/Makefile.in: Regenerated.
11181
adcf2816 111822009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11183
adcf2816
L
11184 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11185 (Symbol_table::override_with_special): Likewise.
11186 (Symbol_table::add_from_object): Likewise.
11187
28e67f5d
RÁE
111882009-12-04 Rafael Avila de Espindola <espindola@google.com>
11189
11190 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11191 Don't set the data_offset twice.
11192
ae10a101
RÁE
111932009-12-04 Rafael Avila de Espindola <espindola@google.com>
11194
11195 * testsuite/Makefile.in: Regenerate.
11196
f59f41f3
DK
111972009-12-03 Doug Kwan <dougkwan@google.com>
11198
11199 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11200 (Target_arm::do_finalize_sections): Add parameter for symbol table
11201 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11202 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11203 parameter for symbol table pointer.
11204 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11205 an additional parameter for a pointer to symbol table.
11206 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11207 parameter for a symbol table pointer.
11208 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11209 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11210 Ditto.
11211 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11212 parameter for a symbol table pointer.
11213
ca55d848
RÁE
112142009-12-03 Rafael Avila de Espindola <espindola@google.com>
11215
11216 * incremental.cc (Incremental_inputs_header)
11217 (Incremental_inputs_header_write, Incremental_inputs_entry)
11218 (Incremental_inputs_entry_write): Move ...
11219 * incremental.h (Incremental_inputs_header)
11220 (Incremental_inputs_header_write, Incremental_inputs_entry)
11221 (Incremental_inputs_entry_write): here.
11222
3aec4f9c
RÁE
112232009-12-02 Rafael Avila de Espindola <espindola@google.com>
11224
11225 * incremental.cc (make_sized_incremental_binary): Set the target.
11226 Error if it is incompatible.
11227 * output.h (Output_file): Add filename method.
11228
9c0ae74d
RÁE
112292009-12-02 Rafael Avila de Espindola <espindola@google.com>
11230
11231 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11232 from the get_* methods.
11233
a45500ae
RÁE
112342009-12-02 Rafael Avila de Espindola <espindola@google.com>
11235
11236 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11237 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11238 Write 0 for the data_offset of scripts.
11239
325e6408
RÁE
112402009-12-02 Rafael Avila de Espindola <espindola@google.com>
11241
11242 * testsuite/Makefile.am: Add the incremental_test.sh test.
11243 * testsuite/incremental_test.sh: New.
11244 * testsuite/incremental_test_1.c: New.
11245 * testsuite/incremental_test_2.c: New.
11246
954c3e2e
RÁE
112472009-12-01 Rafael Avila de Espindola <espindola@google.com>
11248
703d02da 11249 * incremental-dump.cc (main): Fix typos.
954c3e2e 11250
f8086623
RÁE
112512009-11-27 Rafael Avila de Espindola <espindola@google.com>
11252
11253 PR gold/11025
11254 * incremental-dump.cc (main): Use llu to print 64 bit values.
11255
3b0dd6ac
L
112562009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11257 H.J. Lu <hongjiu.lu@intel.com>
11258
11259 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11260 $(LIBDL).
11261 (incremental_dump_LDADD): Likewise.
11262 * Makefile.in: Regenerated.
11263
a6d1ef57 112642009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11265
a6d1ef57
DK
11266 Revert:
11267
11268 2009-11-25 Doug Kwan <dougkwan@google.com>
11269
11270 * arm.cc (Target_arm::Target_arm): Move method definition
11271 outside of class definition. Add code to handle
11272 --target1-rel, --target1-abs and --target2= options.
11273 (Target_arm::get_reloc_reloc_type): Change method to be
11274 non-static and const.
11275 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11276 New data member declaration.
11277 (Target_arm::Scan::local, Target_arm::Scan::global,
11278 Target_arm::Relocate::relocate,
11279 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11280 Adjust call to Target_arm::get_real_reloc_type.
11281 (Target_arm::get_real_reloc_type): Use command line options
11282 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11283 * options.h (--target1-rel, --target1-abs, --target2): New
11284 ARM-only options.
11285
50aeb7d4
DK
112862009-11-25 Doug Kwan <dougkwan@google.com>
11287
11288 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11289 class definition. Add code to handle --target1-rel, --target1-abs
11290 and --target2= options.
11291 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11292 and const.
11293 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11294 member declaration.
11295 (Target_arm::Scan::local, Target_arm::Scan::global,
11296 Target_arm::Relocate::relocate,
11297 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11298 call to Target_arm::get_real_reloc_type.
11299 (Target_arm::get_real_reloc_type): Use command line options to
11300 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11301 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11302 options.
11303
51938283
DK
113042009-11-25 Doug Kwan <dougkwan@google.com>
11305
11306 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11307 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11308 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11309 formatting.
11310 (Arm_relocate_functions::thm_call): Replace body with a call to
11311 Arm_relocate_functions::thumb_branch_common.
11312 (Arm_relocate_functions::thm_jump24,
11313 Arm_relocate_functions::thm_xpc22): New method definitions.
11314 (Arm_relocate_functions::thumb_branch_common): New method definition.
11315 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11316 operator.
11317 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11318 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11319
e2b8f3c4
RÁE
113202009-11-24 Rafael Avila de Espindola <espindola@google.com>
11321
11322 * Makefile.am: Build incremental-dump
11323 * Makefile.in: Regenerate.
11324 * incremental-dump.cc: New.
11325 * incremental.cc (Incremental_inputs_header_data,
11326 Incremental_inputs_entry_data): Move to incremental.h
11327 * incremental.h: (Incremental_inputs_header_data,
11328 Incremental_inputs_entry_data): Move from incremental.cc
11329
bcba9aec
RÁE
113302009-11-24 Rafael Avila de Espindola <espindola@google.com>
11331
11332 * incremental.cc (Incremental_inputs_header,
11333 Incremental_inputs_header_write, Incremental_inputs_entry,
11334 Incremental_inputs_entry_write): Add a typedef with the data type.
11335
7c3afe08
RÁE
113362009-11-24 Rafael Avila de Espindola <espindola@google.com>
11337
11338 * incremental.cc (Incremental_inputs_header,
11339 Incremental_inputs_header_write, Incremental_inputs_entry,
11340 Incremental_inputs_entry_write): Update comment about which
11341 type has the filed descriptions.
11342
d204b6e9
DK
113432009-11-15 Doug Kwan <dougkwan@google.com>
11344
11345 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11346 (Arm_relocate_functions::arm_branch_common): Change method defintion
11347 in class definition to a method declaration and update list of formal
11348 parameters.
11349 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11350 Arm_relocation_functions::jump24): Adjust call to
11351 Arm_relocate_functions::arm_branch_common. Update list of formal
11352 parameters.
11353 (Arm_relocate_functions::xpc25): New method definition.
11354 (Arm_relocate_functions::arm_branch_common): Move method defintion
11355 out from class definition. Use stubs for mode-switching and extending
11356 branch ranges.
11357 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11358 specially. Change code to enable use of stubs in ARM branches.
11359
43d12afe
DK
113602009-11-10 Doug Kwan <dougkwan@google.com>
11361
11362 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11363 in method declaration.
11364 (Target_arm::relocate_stub): New method declaration.
11365 (Target_arm::default_target): Change to return a pointer instead of
11366 a const reference.
11367 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11368 Target_arm::default_target.
11369 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11370 method definition.
11371 (Target_arm::relocate_section): Adjust view.
11372 (Target_arm::relocate_stub): New method definition.
11373
ac33a407
DK
113742009-11-10 Doug Kwan <dougkwan@google.com>
11375
11376 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11377 a format warning.
11378 * incremental.cc (open_incremental_binary): Initialized local
11379 variables to avoid warnings.
11380 * object.cc (make_elf_object): Ditto.
11381 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11382 a format warning.
e1df38aa 11383
88ee28e9
L
11384009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11385
11386 PR gold/10930
11387 * testsuite/plugin_test.c: Include "config.h".
11388
2daedcd6
DK
113892009-11-09 Doug Kwan <dougkwan@google.com>
11390
11391 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11392 (arm_symbol_value): Remove.
11393 (Arm_relocate_functions::arm_branch_common,
11394 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11395 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11396 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11397 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11398 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11399 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11400 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11401 Arm_relocate_functions::thm_mobw_abs_nc,
11402 Arm_relocate_functions::thm_mov_abs,
11403 Arm_relocate_functions::movw_prel_nc,
11404 Arm_relocate_functions::thm_movt_abs,
11405 Arm_relocate_functions::movt_prel,
11406 Arm_relocate_functions::thm_movw_prel_nc,
11407 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11408 (Target_arm::Relocate::relocate): Only decompose address into two
11409 parts if relocation type uses the thumb-bit and pass the actual
11410 bit instead of a flag indicating that the thumb-bit is used. Adjust
11411 calls to methods in Arm_relocate_functions for this change.
11412
1276bc89 114132009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11414
11415 PR 10925
11416 * reloc.cc: Instantiate
11417 Sized_relobj::initialize_input_to_output_maps and
11418 Sized_relobj:free_input_to_output_maps.
11419
e53ad1b5
ILT
114202009-11-06 Ian Lance Taylor <iant@google.com>
11421
11422 PR 10876
11423 * defstd.cc (in_segment): Set only_if_ref true for "end".
11424
eb44217c
DK
114252009-11-06 Doug Kwan <dougkwan@google.com>
11426
11427 * arm.cc (class Reloc_stub): Correct a comment.
11428 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11429 (Target_arm::scan_section_for_stubs): New method declaration.
11430 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11431 Change methods from private to protected.
11432 (Target_arm::do_may_relax): New method definition.
11433 (Target_arm::do_relax, Target_arm::group_sections,
11434 Target_arm::scan_reloc_for_stub,
11435 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11436 (Target_arm::arm_input_section_map_): New data member declaration.
11437 (Target_arm::scan_reloc_for_stub,
11438 Target_arm::scan_reloc_section_for_stubs,
11439 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11440 Target_arm::do_relax): New method definitions.
11441
5d329b7d
ILT
114422009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11443
11444 * configure.ac: Check for (struct stat)::st_mtim
11445 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11446 * config.in: Regenerate.
11447 * configure: Regenerate.
11448
96a0d71b
ILT
114492009-11-05 Ian Lance Taylor <iant@google.com>
11450
11451 PR 10910
11452 * output.cc (Output_segment::add_output_section): Add missing
11453 return statement.
11454
594c8e5e
ILT
114552009-11-04 Ian Lance Taylor <iant@google.com>
11456
11457 PR 10880
11458 * object.h (class Object): Add is_needed and set_is_needed
11459 methods. Add is_needed_ field. Make bool fields into bitfields.
11460 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11461 defined in a dynamic object and referenced by a regular object,
11462 set is_needed for the dynamic object.
11463 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11464 if the file is marked with as_needed and it is not needed.
11465
22b127cc
ILT
114662009-11-04 Ian Lance Taylor <iant@google.com>
11467
11468 PR 10887
11469 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11470 tags if data is discarded by linker script.
11471 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11472 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11473 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11474 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11475
f5c870d2
ILT
114762009-11-04 Ian Lance Taylor <iant@google.com>
11477
11478 * layout.cc (Layout::get_output_section): Add is_interp and
11479 is_dynamic_linker_section parameters. Change all callers.
11480 (Layout::choose_output_section): Likewise.
11481 (Layout::make_output_section): Likewise.
11482 (Layout::add_output_section_data): Add is_dynamic_linker_section
11483 parameter. Change all callers.
11484 * layout.h (class Layout): Update declarations.
11485 * output.h (class Output_section): Add is_interp, set_is_interp,
11486 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11487 Add is_interp_, is_dynamic_linker_section_ fields. Change
11488 generate_code_fills_at_write_ to a bitfield.
11489 * output.cc (Output_section::Output_sections): Initialize new
11490 fields.
11491 (Output_segment::add_output_section): Add do_sort parameter.
11492 Change all callers.
11493
1ae4d23b
ILT
114942009-11-03 Ian Lance Taylor <iant@google.com>
11495
11496 PR 10860
11497 * options.h (class General_options): Add --warn-common.
11498 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11499 merging two common symbols.
11500 (Symbol_table::should_override): Handle --warn-common when merging
11501 a common symbol with a defined symbol. Use report_resolve_problem
11502 for multiple definitions.
11503 (Symbol_table::report_resolve_problem): New function.
11504 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11505
55da9579
DK
115062009-11-03 Doug Kwan <dougkwan@google.com>
11507
11508 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11509 stub_factory_.
11510 (Target_arm::stub_factory): New method definition.
11511 (Target_arm::new_arm_input_section,
11512 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11513 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11514 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11515 New type definitions.
11516 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11517 member declarations.
11518 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11519 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11520 New method definitions.
11521
37a9ac43
ILT
115222009-11-03 Ian Lance Taylor <iant@google.com>
11523
11524 * options.h (class General_options): Add --warn_constructors.
11525
b3d6a3d4
ILT
115262009-11-03 Ian Lance Taylor <iant@google.com>
11527
11528 PR 10893
11529 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11530 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11531
934b01dd
ILT
115322009-11-03 Ian Lance Taylor <iant@google.com>
11533
11534 PR 10895
11535 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11536 --msgid-bugs-address.
11537 (install-pdf): New target.
11538 (install-data_yes): Look up one directory to find mkinstalldirs.
11539
03c1939b
L
115402009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11541
11542 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11543 tree.
11544
ebd95253
DK
115452009-10-30 Doug Kwan <dougkwan@google.com>
11546
11547 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11548
e9bbb538
DK
115492009-10-30 Doug Kwan <dougkwan@google.com>
11550
11551 * arm.cc (Stub_addend_reader): New struct template definition
11552 and partial specializations.
11553 (Stub_addend_reader::operator()): New method definition for a
11554 partially specialized template.
11555
d5b40221
DK
115562009-10-30 Doug Kwan <dougkwan@google.com>
11557
11558 * arm.cc (Arm_relobj::processor_specific_flags): New method
11559 definition.
11560 (Arm_relobj::do_read_symbols): New method declaration.
11561 (Arm_relobj::processor_specific_flags_): New data member declaration.
11562 (Arm_dynobj): New class definition.
11563 (Target_arm::do_finalize_sections): Add input_objects parameter.
11564 (Target_arm::do_adjust_elf_header): New method declaration.
11565 (Target_arm::are_eabi_versions_compatible,
11566 (Target_arm::merge_processor_specific_flags): New method declaration.
11567 (Target_arm::do_make_elf_object): New overloaded method definitions
11568 and declaration.
11569 (Arm_relobj::do_read_symbols): New method definition.
11570 (Arm_dynobj::do_read_symbols): Ditto.
11571 (Target_arm::do_finalize_sections): Add input_objects parameters.
11572 Merge processor-specific flags from all input objects.
11573 (Target_arm::are_eabi_versions_compatible,
11574 Target_arm::merge_processor_specific_flags,
11575 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11576 New method definitions.
11577 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11578 Input_objects pointer type parameter.
11579 * layout.cc (Layout::finalize): Pass input objects to target's.
11580 finalize_sections function.
11581 * output.cc (Output_file_header::do_sized_write): Set ELF file
11582 header's processor-specific flags.
11583 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11584 Input_objects pointer type parameter.
11585 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11586 * target.h (Input_objects): New forward class declaration.
11587 (Target::processor_specific_flags,
11588 Target::are_processor_specific_flags_sect): New method definitions.
11589 (Target::finalize_sections): Add input_objects parameter.
11590 (Target::Target): Initialize processor_specific_flags_ and
11591 are_processor_specific_flags_set_.
11592 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11593 parameter.
11594 (Target::set_processor_specific_flags): New method definition.
11595 (Target::processor_specific_flags_,
11596 Target::are_processor_specific_flags_set_): New data member
11597 declarations.
11598 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11599 Input_objects pointer type parameter.
11600
ebabffbd
DK
116012009-10-30 Doug Kwan <dougkwan@google.com>
11602
11603 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11604
ad0f2072
ILT
116052009-10-28 Ian Lance Taylor <iant@google.com>
11606
11607 * object.h (class Relobj): Drop options parameter from
11608 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11609 do_scan_relocs, do_relocate. Change all callers.
11610 (class Sized_relobj): Drop options parameters from
11611 do_gc_process_relocs, do_scan_relocs, do_relocate,
11612 do_relocate_sections, relocate_sections, emit_relocs_scan,
11613 emit_relocs_scan_reltype. Change all callers.
11614 (struct Relocate_info): Remove options field and all references to
11615 it.
11616 * reloc.h (class Read_relocs): Remove options constructor
11617 parameter and options_ field. Change all callers.
11618 (class Gc_process_relocs, class Scan_relocs): Likewise.
11619 (class Relocate_task): Likewise.
11620 * target-reloc.h (scan_relocs): Remove options parameter. Change
11621 all callers.
11622 (scan_relocatable_relocs): Likewise.
11623 * target.h (class Sized_target): Remove options parameter from
11624 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11625 all callers.
11626 * gc.h (gc_process_relocs): Remove options parameter. Change all
11627 callers.
11628 * arm.cc: Update functions to remove options parameters.
11629 * i386.cc: Likewise.
11630 * powerpc.cc: Likewise.
11631 * sparc.cc: Likewise.
11632 * x86_64.cc: Likewise.
11633 * testsuite/testfile.cc: Likewise.
11634
8ffa3667
DK
116352009-10-28 Doug Kwan <dougkwan@google.com>
11636
11637 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11638 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11639 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11640 New method definitions.
11641
40f36857
CC
116422009-10-28 Cary Coutant <ccoutant@google.com>
11643
11644 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11645 (Plugin::cleanup_done_): New member.
11646 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11647 (Plugin_manager::cleanup_done_): Remove.
11648 (Plugin_manager::add_input_file): Edit error message.
11649 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11650 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11651
2c849493
ILT
116522009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11653
11654 * fileread.cc: (File_read::View::~View): Use the new
11655 data_ownership_ filed.
11656 (File_read::~File_read): Dispose the new whole_file_view_.
11657 (File_read::open): Mmap the whole file if needed.
11658 (File_read::open): Use whole_file_view_ instead of contents_.
11659 (File_read::find_view): Use whole_file_view_ if applicable.
11660 (File_read::do_read): Use whole_file_view_ instead of contents_.
11661 (File_read::make_view): Use whole_file_view_ instead of contents_,
11662 update File_read::View::View call.
11663 (File_read::find_or_make_view): Update File_read::View::View
11664 call.
11665 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11666 remove contents_
11667 (File_read::View::Data_ownership): New enum.
11668 (File_read::View::View): Replace bool mapped_ with Data_ownership
11669 argument.
11670 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11671 (File_read::View::data_ownership_): New field.
11672 (File_read::contents_): Remove (replaced by whole_file_view_).
11673 (File_read::whole_file_view_): New field.
11674 * options.h (class General_options): Add --keep-files-mapped.
11675
24998053
CC
116762009-10-27 Cary Coutant <ccoutant@google.com>
11677
11678 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11679 * testsuite/Makefile.am (plugin_test_5): New test case.
11680 * testsuite/Makefile.in: Regenerate.
11681
72adc4fa
DK
116822009-10-25 Doug Kwan <dougkwan@google.com>
11683
11684 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11685 from private to protected to allow access by child class.
11686 (Sized_relobj::do_relocate_sections): New method declaration.
11687 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11688 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11689 Sized_relobj::relocate_sections. Instantiate template explicitly
11690 for different target sizes and endianity.
11691
07f508a2
DK
116922009-10-24 Doug Kwan <dougkwan@google.com>
11693
11694 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11695 (Arm_input_section::as_arm_input_section): New method.
11696 (Arm_output_section): New class definition.
11697 (Arm_output_section::create_stub_group,
11698 Arm_output_section::group_sections): New method definitions.
11699
10ad9fe5
DK
117002009-10-22 Doug Kwan <dougkwan@google.com>
11701
11702 * arm.cc (Arm_input_section): New class definition.
11703 (Arm_input_section::init, Arm_input_section:do_write,
11704 Arm_input_section::set_final_data_size,
11705 Arm_input_section::do_reset_address_and_file_offset): New method
11706 definitions.
11707
56ee5e00
DK
117082009-10-21 Doug Kwan <dougkwan@google.com>
11709
11710 * arm.cc (Stub_table, Arm_input_section): New forward class
11711 declarations.
11712 (Stub_table): New class defintion.
11713 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11714 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11715 New method definition.
11716
b569affa
DK
117172009-10-21 Doug Kwan <dougkwan@google.com>
11718
11719 * arm.cc: Update copyright comments.
11720 (Target_arm): New forward class template declaration.
11721 (Arm_address): New type.
11722 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11723 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11724 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11725 constants.
11726 (Insn_template): Same.
11727 (DEF_STUBS): New macro.
11728 (Stub_type): New enum type.
11729 (Stub_template): New class definition.
11730 (Stub): Same.
11731 (Reloc_stub): Same.
11732 (Stub_factory): Same.
11733 (Target_arm::Target_arm): Initialize may_use_blx_ and
11734 should_force_pic_veneer_.
11735 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11736 Target_arm::should_force_pic_veneer,
11737 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11738 Target_arm::using_thumb_only, Target_arm:;default_target): New
11739 method defintions.
11740 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11741 New data member declarations.
11742 (Insn_template::size, Insn_template::alignment): New method defintions.
11743 (Stub_template::Stub_template): New method definition.
11744 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11745 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11746 (Stub_factory::Stub_factory): New method definition.
11747 * gold.h (string_hash): New template.
11748 * output.h (Input_section_specifier::hash_value): Use
11749 gold::string_hash.
11750 (Input_section_specifier::string_hash): Remove.
11751 * stringpool.cc (Stringpool_template::string_hash): Use
11752 gold::string_hash.
11753
6c172549
DK
117542009-10-20 Doug Kwan <dougkwan@google.com>
11755
11756 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11757 symbols of relaxed input sections.
11758 * output.h (Output_section::find_relaxed_input_section): Make
11759 method public.
11760
c5617f2f
DK
117612009-10-16 Doug Kwan <dougkwan@google.com>
11762
11763 * dynobj.cc (Versions::Versions): Initialize version_script_.
11764 Only insert base version symbol definition for a shared object
11765 if version script defines any version versions.
11766 (Versions::define_base_version): New method definition.
11767 (Versions::add_def): Check that base version is not needed.
11768 (Versions::add_need): Define base version lazily.
11769 * dynobj.h (Versions::define_base_version): New method declaration.
11770 (Versions::needs_base_version_): New data member declaration.
11771 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11772 (check_DATA): Add no_version_test.stdout.
11773 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11774 New make rules.
11775 * testsuite/Makefile.in: Regenerate.
11776 * testsuite/no_version_test.c: New file.
11777 * testsuite/no_version_test.sh: Ditto.
11778
3c12dcdb
DK
117792009-10-16 Doug Kwan <dougkwan@google.com>
11780
11781 * expression.cc (class Segment_start_expression): New class definition.
11782 (Segment_start_expression::value): New method definition.
11783 (script_exp_function_segment_start): Return a new
11784 Segment_start_expression.
11785 * gold/script-c.h (script_saw_segment_start_expression): New function
11786 prototype.
11787 * script-sections.cc (Script_sections::Script_sections): Initialize
11788 SAW_SEGMENT_START_EXPRESSION_ to false.
11789 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11790 and -Tbbs options to specify section addresses if given in
11791 command line and no SEGMENT_START expression is seen in a script.
11792 * script-sections.h (Script_sections::saw_segment_start_expression,
11793 Script_sections::set_saw_segment_start_expression): New method
11794 definition.
11795 (Script_sections::saw_segment_start_expression_): New data member
11796 declaration.
11797 * script.cc (script_saw_segment_start_expression): New function.
11798 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11799 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11800 script_test_7.sh and script_test_8.sh.
11801 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11802 script_test_8.stdout.
11803 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11804 (script_test_6, script_test_6.stdout, script_test_7,
11805 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11806 * Makefile.in: Regenerate.
11807 * testsuite/script_test_6.sh: New file.
11808 * testsuite/script_test_6.t: Same.
11809 * testsuite/script_test_7.sh: Same.
11810 * testsuite/script_test_7.t: Same.
11811 * testsuite/script_test_8.sh: Same.
11812
64b1ae37
DK
118132009-10-16 Doug Kwan <dougkwan@google.com>
11814
11815 * output.cc (Output_segment::set_section_list_address): Cast
11816 expressions to unsigned long long type to avoid format warnings.
11817
661be1e2
ILT
118182009-10-15 Ian Lance Taylor <iant@google.com>
11819
12edd763 11820 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11821 dot assignment to script_sections_.
12edd763
ILT
11822 * script-sections.cc (Script_sections::add_dot_assignment):
11823 Initialize if necessary.
11824
68b6574b
ILT
11825 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11826 program headers with no load segment if there is a linker script.
11827
661be1e2
ILT
11828 * layout.cc (Layout::set_segment_offsets): Align the file offset
11829 to the segment aligment for -N or -n with no load segment.
11830 * output.cc (Output_segment::add_output_section): Don't crash if
11831 the first section is a TLS section.
11832 (Output_segment::set_section_list_addresses): Print an error
11833 message if the address moves backward in a linker script.
11834 * script-sections.cc
11835 (Output_section_element_input::set_section_addresses): Don't
11836 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11837 (Orphan_output_section::set_section_addresses): Likewise.
11838
f15f61a7
DK
118392009-10-15 Doug Kwan <dougkwan@google.com>
11840
11841 * layout.cc (Layout::finish_dynamic_section): Generate tags
11842 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11843 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11844 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11845
82bb573a
ILT
118462009-10-14 Ian Lance Taylor <iant@google.com>
11847
11848 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11849 fields.
11850 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11851 data_shdr fields of relinfo.
11852 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11853 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11854 R_386_TLS_LDO_32, adjust based on section flags.
11855 (Target_i386::Relocate::fix_up_ldo): Remove.
11856
374ad285
ILT
118572009-10-13 Ian Lance Taylor <iant@google.com>
11858
11859 Add support for -pie.
11860 * options.h (class General_options): Add -pie and
11861 --pic-executable.
11862 (General_options::output_is_position_independent): Test -pie.
11863 (General_options::output_is_executable): Return true if not shared
11864 and not relocatable.
11865 (General_options::output_is_pie): Remove.
11866 * options.cc (General_options::finalize): Reject incompatible uses
11867 of -pie.
11868 * gold.cc (queue_middle_tasks): A -pie link is not static.
11869 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11870 * symtab.cc (Symbol::final_value_is_known): Return false if
11871 output_is_position_independent.
11872 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11873 output_is_position_independent.
11874 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11875 output_is_position_independent.
11876 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11877 output_is_position_independent.
11878 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11879 two_file_pie_test.
11880 (basic_pie_test.o, basic_pie_test): New targets.
11881 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11882 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11883 (two_file_pie_test): New target.
11884 * testsuite/Makefile.in: Rebuild.
11885 * README: Remove note saying that -pie is not supported.
11886
c6585162
ILT
118872009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11888
11889 * options.h (class General_options): Add -init and -fini.
11890 * layout.cc (Layout::finish_dynamic_section): Emit
11891 given init and fini functions.
11892
032ce4e9
ST
118932009-10-13 Sriraman Tallam <tmsriram@google.com>
11894
11895 * gc.h (gc_process_relocs): Check if icf is enabled using new
11896 function.
11897 * gold.cc (queue_initial_tasks): Likewise.
11898 (queue_middle_tasks): Likewise.
11899 * object.cc (do_layout): Likewise.
11900 * symtab.cc (is_section_folded): Likewise.
11901 * main.cc (main): Likewise.
11902 * reloc.cc (Read_relocs::run): Likewise.
11903 (Sized_relobj::do_scan_relocs): Likewise.
11904 * icf.cc (is_function_ctor_or_dtor): New function.
11905 (Icf::find_identical_sections): Check if function is ctor or dtor when
11906 safe icf is chosen.
11907 * options.h (General_options::icf): Change option to be an enum.
11908 (Icf_status): New enum.
11909 (icf_enabled): New method.
11910 (icf_safe_folding): New method.
11911 (set_icf_status): New method.
11912 (icf_status_): New variable.
11913 * (options.cc) (General_options::finalize): Set icf_status_.
11914 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11915 icf_test and icf_keep_unique_test to use the --icf enum flag.
11916 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11917 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11918
f345227a
ST
119192009-10-12 Sriraman Tallam <tmsriram@google.com>
11920
11921 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11922 includes to gc.h and icf.h.
11923 * arm.cc: Include gc.h.
11924 * gold.cc: Likewise.
11925 * i386.cc: Likewise.
11926 * powerpc.cc: Likewise.
11927 * sparc.cc: Likewise.
11928 * x86_64.cc: Likewise.
11929 * gc.h: Include icf.h.
11930
1c7814ed
ILT
119312009-10-11 Ian Lance Taylor <iant@google.com>
11932
11933 * plugin.cc: Include "gold.h" before other header files.
11934
ae3b5189
CD
119352009-10-10 Chris Demetriou <cgd@google.com>
11936
11937 * options.h (Input_file_argument::Input_file_type): New enum.
11938 (Input_file_argument::is_lib_): Replace with...
11939 (Input_file_argument::type_): New member.
11940 (Input_file_argument::Input_file_argument): Take Input_file_type
11941 'type' rather than boolean 'is_lib' as second argument.
11942 (Input_file_argument::is_lib): Use type_.
11943 (Input_file_argument::is_searched_file): New function.
11944 (Input_file_argument::may_need_search): Handle is_searched_file.
11945 * options.cc (General_options::parse_library): Support -l:filename.
11946 (General_options::parse_just_symbols): Update for Input_file_argument
11947 changes.
11948 (Command_line::process): Likewise.
11949 * archive.cc (Archive::get_file_and_offset): Likewise.
11950 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11951 * script.cc (read_script_file, script_add_file): Likewise.
11952 * fileread.cc (Input_file::Input_file): Likewise.
11953 (Input_file::will_search_for): Handle is_searched_file.
11954 (Input_file::open): Likewise.
11955 * readsyms.cc (Read_symbols::get_name): Likewise.
11956 * testsuite/Makefile.am (searched_file_test): New test.
11957 * testsuite/Makefile.in: Regenerate.
11958 * testsuite/searched_file_test.cc: New file.
11959 * testsuite/searched_file_test_lib.cc: New file.
11960
f3048a1d
ILT
119612009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11962 Ian Lance Taylor <iant@google.com>
11963
11964 * descriptor.cc: Include <cstdio> and "binary-io.h".
11965 (Descriptors::open): Open the files in binary mode always.
11966 * script.cc (Lex::get_token): Treat \r as whitespace.
11967
d4780e57
ILT
119682009-10-09 Ian Lance Taylor <iant@google.com>
11969
11970 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11971
d9a893b8
ILT
119722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11973 Ian Lance Taylor <iant@google.com>
11974
11975 * configure.ac: Check for readv function also.
11976 * fileread.cc (readv): Define if not HAVE_READV.
11977 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11978 does not exist.
11979 * config.in: Regenerate.
11980 * configure: Regenerate.
11981
c0a62865
DK
119822009-10-09 Doug Kwan <dougkwan@google.com>
11983
11984 * layout.cc (Layout::make_output_section): Call target hook to make
11985 ordinary output section.
11986 (Layout::finalize): Adjust parameter list of call the
11987 Target::may_relax().
11988 * layout.h (class Layout::section_list): New method.
11989 * merge.h (Output_merge_base::entsize): Change visibility to public.
11990 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11991 New methods.
11992 (Output_merge_string::do_is_string): New method.
11993 * object.cc (Sized_relobj::do_setup): renamed from
11994 Sized_relobj::set_up.
11995 * object.h (Sized_relobj::adjust_shndx,
11996 Sized_relobj::initializ_input_to_output_maps,
11997 Sized_relobj::free_input_to_output_maps): Change visibilities to
11998 protected.
11999 (Sized_relobj::setup): Virtualize.
12000 (Sized_relobj::do_setup): New method declaration.
12001 (Sized_relobj::invalidate_section_offset,
12002 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12003 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12004 * options.cc (parse_int): New function.
12005 * options.h (parse_int): New declaration.
12006 (DEFINE_int): New macro.
12007 (stub_group_size): New option.
12008 * output.cc (Output_section::Output_section): Initialize memebers
12009 merge_section_map_, merge_section_by_properties_map_,
12010 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12011 (Output_section::add_input_section): Handled deferred code-fill
12012 generation and remove an old comment.
12013 (Output_section::add_relaxed_input_section): New method definition.
12014 (Output_section::add_merge_input_section): Use merge section by
12015 properties map to speed to search. Update merge section maps
12016 as appropriate.
12017 (Output_section::build_relaxation_map): New method definition.
12018 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12019 Same.
12020 (Output_section::relax_input_section): Renamed to
12021 Output_section::convert_input_sections_to_relaxed_sections and change
12022 interface to take a vector of pointers to relaxed sections.
12023 (Output_section::find_merge_section,
12024 Output_section::find_relaxed_input_section): New method definitions.
12025 (Output_section::is_input_address_mapped,
12026 Output_section::output_offset, Output_section::output_address):
12027 Use output section data maps to speed up searching.
12028 (Output_section::find_starting_output_address): Add comments.
12029 (Output_section::do_write,
12030 Output_section::write_to_postprocessing_buffer): Do code-fill
12031 generation as appropriate.
12032 (Output_section::get_input_sections): Invalidate relaxed input section
12033 map.
12034 (Output_section::restore_states): Adjust type of checkpoint .
12035 Invalidate relaxed input section map.
12036 * output.h (Output_merge_base): New class declaration.
12037 (Input_section_specifier): New class defintion.
12038 (class Output_relaxed_input_section) Change base class to
12039 Output_section_data_build.
12040 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12041 base class initializer.
12042 (Output_section::add_relaxed_input_section): New method declaration.
12043 (Output_section::Input_section): Change visibility to protected.
2e702c99 12044 (Output_section::Input_section::relobj,
c0a62865
DK
12045 Output_section::Input_section::shndx): Handle relaxed input sections.
12046 Output_section::input_sections) Change visibility to protected. Also
12047 define overload to return a non-const pointer.
12048 (Output_section::Merge_section_properties): New class defintion.
12049 (Output_section::Merge_section_by_properties_map,
12050 Output_section::Output_section_data_by_input_section_map,
12051 Output_section::Relaxation_map): New types.
12052 (Output_section::relax_input_section): Rename method to
12053 Output_section::convert_input_sections_to_relaxed_sections and change
12054 interface to take a vector of relaxed section pointers.
12055 (Output_section::find_merge_section,
12056 Output_section::find_relaxed_input_section,
12057 Output_section::build_relaxation_map,
12058 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12059 New method declarations.
12060 (Output_section::merge_section_map_
12061 Output_section::merge_section_by_properties_map_,
12062 Output_section::relaxed_input_section_map_,
12063 Output_section::is_relaxed_input_section_map_valid_,
12064 Output_section::generate_code_fills_at_write_): New data members.
12065 * script-sections.cc
12066 (Output_section_element_input::set_section_addresses): Call
12067 current_data_size and addralign methods of relaxed input sections.
12068 (Orphan_output_section::set_section_addresses): Call current_data_size
12069 and addralign methods of relaxed input sections.
12070 * symtab.cc (Symbol_table::compute_final_value): Extract template
12071 from the body of Symbol_table::sized_finalize_symbol.
12072 (Symbol_table::sized_finalized_symbol): Call
12073 Symbol_table::compute_final_value.
12074 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12075 (Symbol_table::compute_final_value): New templated method declaration.
12076 * target.cc (Target::do_make_output_section): New method defintion.
12077 * target.h (Target::make_output_section): New method declaration.
12078 (Target::relax): Add more parameters for input objects, symbol table
12079 and layout. Adjust call to do_relax.
12080 (Target::do_make_output_section): New method declaration.
12081 (Target::do_relax): Add parameters for input objects, symbol table
12082 and layout.
12083
d446d6c4
ILT
120842009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12085
12086 * pread.c: Include stdio.h.
12087
bc06c745
ILT
120882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12089
12090 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12091 defined.
12092
75aea3d0
ILT
120932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12094
12095 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12096 Change read_shndx type to unsigned int.
12097 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12098 int.
12099 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12100 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12101 Change read_shndx type to unsigned int.
12102 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12103 int.
12104 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12105 * layout.cc (Layout::create_symtab_sections): Cast the result of
12106 local_symcount * symsize to off_t in the gold_assert.
12107
be8fcb75
ILT
121082009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12109
12110 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12111 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12112 R_ARM_BASE_ABS.
12113 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12114 (Arm_relocate_functions::thm_abs5): New function.
12115 (Arm_relocate_functions::abs12): New function.
12116 (Arm_relocate_functions::abs16): New function.
12117 (Arm_relocate_functions::base_abs): New function.
12118 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12119 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12120 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12121 R_ARM_BASE_ABS.
12122 (Scan::global): Likewise.
12123 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12124 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12125 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12126 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12127 R_ARM_BASE_ABS.
12128
c2a122b6
ILT
121292009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12130
12131 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12132 (Arm_relocate_functions::movt_prel): New function.
12133 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12134 (Arm_relocate_functions::thm_movt_prel): New function.
12135 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12136 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12137 (Scan::global, Relocate::relocate): Likewise.
12138 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12139
c4aa1e2d
ILT
121402009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12141
12142 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12143 Incremental_checker.
12144 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12145 unsigned int.
12146 (class Incremental_inputs_header): New class.
12147 (Incremental_inputs_header_writer): Edit comment.
12148 (Incremental_inputs_entry): New class.
12149 (Incremental_inputs_entry_writer): Edit comment.
12150 (Sized_incremental_binary::do_find_incremental_inputs_section):
12151 Add *strtab_shndx parameter, fill it.
12152 (Sized_incremental_binary::do_check_inputs): New method.
12153 (Incremental_checker::can_incrementally_link_output_file): Use
12154 Sized_incremental_binary::check_inputs.
12155 (Incremental_inputs::report_command_line): Save command line in
12156 command_line_.
12157 * incremental.h:
12158 (Incremental_binary::find_incremental_inputs_section): New
12159 method.
12160 (Incremental_binary::do_find_incremental_inputs_section): Add
12161 strtab_shndx parameter.
12162 (Incremental_binary::do_check_inputs): New pure virtual method.
12163 (Sized_incremental_binary::do_check_inputs): Declare.
12164 (Incremental_checker::Incremental_checker): Add incremental_inputs
12165 parameter, use it to initialize incremental_inputs_.
12166 (Incremental_checker::incremental_inputs_): New field.
12167 (Incremental_checker::command_line): New method.
12168 (Incremental_checker::inputs): New method.
12169 (Incremental_checker::command_line_): New field.
12170
c549a694
ILT
121712009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12172
12173 * incremental.cc: Include <cstdarg> and "target-select.h".
12174 (vexplain_no_incremental): New function.
12175 (explain_no_incremental): New function.
12176 (Incremental_binary::error): New method.
12177 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12178 method.
12179 (make_sized_incremental_binary): New function.
12180 (open_incremental_binary): New function.
12181 (can_incrementally_link_file): Add checks if output is ELF and has
12182 inputs section.
12183 * incremental.h: Include "elfcpp_file.h" and "output.h".
12184 (Incremental_binary): New class.
12185 (Sized_incremental_binary): New class.
12186 (open_incremental_binary): Declare.
12187 * object.cc (is_elf_object): Use
12188 elfcpp::Elf_recognizer::is_elf_file.
12189 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12190 * output.h (Output_file::filesize): New method.
12191
fd3c5f0b
ILT
121922009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12193
12194 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12195 New function.
12196 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12197 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12198 function.
12199 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12200 function.
12201 (Arm_relocate_functions::movw_abs_nc): New function.
12202 (Arm_relocate_functions::movt_abs): New function.
12203 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12204 (Arm_relocate_functions::thm_movt_abs): New function.
12205 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12206 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12207 (Scan::global): Likewise.
12208 (Relocate::relocate): Likewise.
12209 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12210
7f5309a5
ILT
122112009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12212
12213 * arm.cc (Arm_relocate_functions::got_prel) New function.
12214 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12215 (Relocate::relocate): Likewise.
12216 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12217
364c7fa5
ILT
122182009-10-06 Ian Lance Taylor <iant@google.com>
12219
12220 * options.h (class General_options): Define
12221 split_stack_adjust_size parameter.
12222 * object.h (class Object): Add uses_split_stack_ and
12223 has_no_split_stack_ fields. Add uses_split_stack and
12224 has_no_split_stack accessor functions. Declare
12225 handle_split_stack_section.
12226 (class Reloc_symbol_changes): Define.
12227 (class Sized_relobj): Define Function_offsets. Declare
12228 split_stack_adjust, split_stack_adjust_reltype, and
12229 find_functions.
12230 * object.cc (Object::handle_split_stack_section): New function.
12231 (Sized_relobj::do_layout): Call handle_split_stack_section.
12232 * dynobj.cc (Sized_dynobj::do_layout): Call
12233 handle_split_stack_section.
12234 * reloc.cc (Sized_relobj::relocate_sections): Call
12235 split_stack_adjust for executable sections in split_stack
12236 objects. Pass reloc_map to relocate_section.
12237 (Sized_relobj::split_stack_adjust): New function.
12238 (Sized_relobj::split_stack_adjust_reltype): New function.
12239 (Sized_relobj::find_functions): New function.
12240 * target-reloc.h: Include "object.h".
12241 (relocate_section): Add reloc_symbol_changes parameter. Change
12242 all callers.
12243 * target.h (class Target): Add calls_non_split method. Declare
12244 do_calls_non_split virtual method. Declare match_view and
12245 set_view_to_nop.
12246 * target.cc: Include "elfcpp.h".
12247 (Target::do_calls_non_split): New function.
12248 (Target::match_view): New function.
12249 (Target::set_view_to_nop): New function.
12250 * gold.cc (queue_middle_tasks): Give an error if mixing
12251 split-stack and non-split-stack objects with -r.
12252 * i386.cc (Target_i386::relocate_section): Add
12253 reloc_symbol_changes parameter.
12254 (Target_i386::do_calls_non_split): New function.
12255 * x86_64.cc (Target_x86_64::relocate_section): Add
12256 reloc_symbol_changes parameter.
12257 (Target_x86_64::do_calls_non_split): New function.
12258 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12259 parameter.
12260 * powerpc.cc (Target_powerpc::relocate_section): Add
12261 reloc_symbol_changes parameter.
12262 * sparc.cc (Target_sparc::relocate_section): Add
12263 reloc_symbol_changes parameter.
12264 * configure.ac: Call AM_CONDITIONAL for the default target.
12265 * configure: Rebuild.
12266 * testsuite/Makefile.am (TEST_AS): New variable.
12267 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12268 (check_DATA): Add split_i386 and split_x86_64 files.
12269 (SPLIT_DEFSYMS): Define.
12270 (split_i386_[1234n].o): New targets.
12271 (split_i386_[124]): New targets.
12272 (split_i386_[1234r].stdout): New targets.
12273 (split_x86_64_[1234n].o): New targets.
12274 (split_x86_64_[124]): New targets.
12275 (split_x86_64_[1234r].stdout): New targets.
12276 (MOSTLYCLEANFILES): Add new executables.
12277 * testsuite/split_i386.sh: New file.
12278 * testsuite/split_x86_64.sh: New file.
12279 * testsuite/split_i386_1.s: New file.
12280 * testsuite/split_i386_2.s: New file.
12281 * testsuite/split_i386_3.s: New file.
12282 * testsuite/split_i386_4.s: New file.
12283 * testsuite/split_i386_n.s: New file.
12284 * testsuite/split_x86_64_1.s: New file.
12285 * testsuite/split_x86_64_2.s: New file.
12286 * testsuite/split_x86_64_3.s: New file.
12287 * testsuite/split_x86_64_4.s: New file.
12288 * testsuite/split_x86_64_n.s: New file.
12289 * testsuite/testfile.cc (Target_test): Update relocation_section
12290 function.
12291 * testsuite/Makefile.in: Rebuild.
12292
e8a9fcda
ILT
122932009-10-06 Ian Lance Taylor <iant@google.com>
12294
12295 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12296 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12297 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12298 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12299 the address on ldo_addrs_.
12300 (Target_i386::Relocate::fix_up_ldo): New function.
12301
e99daf92
ILT
123022009-10-06 Rafael Espindola <espindola@google.com>
12303
12304 * plugin.cc (add_input_library): New.
12305 (Plugin::load): Add add_input_library to tv.
12306 (Plugin_manager::add_input_file): Add the is_lib argument.
12307 (add_input_file): Update call to Plugin_manager::add_input_file.
12308 (add_input_library): New.
12309 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12310
966d4097
DK
123112009-09-30 Doug Kwan <dougkwan@google.com>
12312
12313 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12314 symbol and call Symbol::may_need_copy_reloc to determine if
12315 a copy reloc is needed.
12316 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12317 nocopyreloc is given in command line.
12318 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12319 given in command line.
12320 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12321 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12322 of the removed Target_i386::may_need_copy_reloc.
12323 * options.h (copyreloc): New option with default value false.
12324 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12325 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12326 instead of the removed Target_powerpc::may_need_copy_reloc.
12327 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12328 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12329 instead of the removed Target_sparc::may_need_copy_reloc.
12330 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12331 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12332 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12333 instead of the removed Target_x86_64::may_need_copy_reloc.
12334
029ba973
ILT
123352009-09-30 Ian Lance Taylor <iant@google.com>
12336
12337 * object.h (class Object): Remove target_ field, and target,
12338 sized_target, and set_target methods.
12339 (Object::sized_target): Remove.
12340 (class Sized_relobj): Update declarations. Remove sized_target.
12341 * object.cc (Sized_relobj::setup): Remove target parameter.
12342 Change all callers.
12343 (Input_objects::add_object): Don't do anything with the target.
12344 (make_elf_sized_object): Add punconfigured parameter. Change all
12345 callers. Set or test parameter target.
12346 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12347 Change all callers.
12348 * parameters.cc (Parameters::set_target): Change parameter type to
12349 be non-const.
12350 (Parameters::default_target): Remove.
12351 (set_parameters_target): Change parameter type to be non-const.
12352 (parameters_force_valid_target): New function.
12353 (parameters_clear_target): New function.
12354 * parameters.h (class Parameters): Update declarations. Remove
12355 default_target method. Add sized_target and clear_target
12356 methods. Change target_ to be non-const.
12357 (set_parameters_target): Update declaration.
12358 (parameters_force_valid_target): Declare.
12359 (parameters_clear_target): Declare.
12360 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12361 as NULL if we aren't searching.
12362 (Add_symbols::run): Don't check for compatible target.
12363 * fileread.cc (Input_file::open_binary): Call
12364 parameters_force_valid_target.
12365 * gold.cc (queue_middle_tasks): Likewise.
12366 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12367 set_target on object.
12368 * dynobj.h (class Sized_dynobj): Update declarations.
12369 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12370 make_elf_object returns NULL.
12371 (Archive::include_member): Don't check whether object target is
12372 compatible.
12373 * output.cc (Output_section::add_input_section): Get target from
12374 parameters.
12375 (Output_section::relax_input_section): Likewise.
12376 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12377 parameters.
12378 (Sized_relobj::do_scan_relocs): Likewise.
12379 (Sized_relobj::relocate_sections): Likewise.
12380 * resolve.cc (Symbol_table::resolve): Likewise.
12381 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12382 parameter. Change all callers.
12383 (Symbol_table::add_from_object): Get target from parameters.
12384 (Symbol_table::add_from_relobj): Don't check object target.
12385 (Symbol_table::add_from_dynobj): Likewise.
12386 (Symbol_table::define_special_symbol): Get target from
12387 parameters.
12388 * symtab.h (class Symbol_table): Update declaration.
12389 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12390 parameter. Change all callers. Clear parameter target.
12391 (Binary_test): Test target here.
12392 * testsuite/object_unittest.cc (gold_testsuite): Remove
12393 target_test_pointer parameter. Change all callers.
12394 (Object_test): Test target here.
12395
a6a22b83
ILT
123962009-09-26 Ian Lance Taylor <iant@google.com>
12397
12398 * testsuite/initpri1.c: Don't try to use constructor priorities if
12399 compiling with gcc before 4.3.
12400
6a8f49fe
ILT
124012009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12402
12403 * testsuite/retain_symbols_file_test.sh (check_present): Change
12404 output file name to retain_symbols_file_test.stdout.
12405 (check_absent): Likewise.
12406
8c604651
CS
124072009-09-18 Craig Silverstein <csilvers@google.com>
12408
12409 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12410 * options.cc: Include <cerrno> and <fstream>.
12411 (General_options::finalize): Parse -retain-symbols-file tag.
12412 * options.h: New flag.
12413 (General_options): New method should_retain_symbol, new
12414 variable symbols_to_retain.
12415 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12416 should_retain_symbol map.
12417 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12418 * testsuite/Makefile.in: Regenerate.
12419 * testsuite/retain_symbols_file_test.sh: New file.
12420
ca58b19f
NC
124212009-09-18 Nick Clifton <nickc@redhat.com>
12422
12423 * po/es.po: Updated Spanish translation.
12424
20e6d0d6
DK
124252009-09-17 Doug Kwan <dougkwan@google.com>
12426
12427 * debug.h (DEBUG_RELAXATION): New constant.
12428 (DEBUG_ALL): Add DEBUG_RELAXATION.
12429 (debug_string_to_enum): Add relaxation debug option.
12430 * layout.cc
12431 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12432 Layout::Relaxation_debug_check::read_sections,
12433 Layout::Relaxation_debug_check::read_sections): New method definitions.
12434 (Layout::Layout): Initialize data members
12435 record_output_section_data_from_scrips_,
12436 script_output_section_data_list_ and relaxation_debug_check_.
12437 (Layout::save_segments, Layout::restore_segments,
12438 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12439 Layout::relaxation_loop_body): New method definitions.
12440 (Layout::finalize): Support relaxation. Move section layout code to
12441 Layout::relaxation_loop_body.
12442 (Layout::set_asection_address_from_script): Move code for orphan
12443 section placement out.
12444 (Layout::place_orphan_sections_in_script): New method definition.
12445 * layout.h (Output_segment_headers, Output_file_header):
12446 New forward class declarations.
12447 (Layout::~Layout): Define.
12448 (Layout::new_output_section_data_from_script): New method definition.
12449 (Layout::place_orphan_sections_in_script): New method declaration.
12450 (Layout::Segment_states): New type declaration.
12451 (Layout::save_segments, Layout::restore_segments,
12452 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12453 Layout::relaxation_loop_body): New method declarations.
12454 (Layout::Output_section_data_list): New type declaration.
12455 (Layout::Relaxation_debug_check): New class definition.
12456 (Layout::record_output_section_data_from_script_,
12457 Layout::script_output_section_data_list_, Layout::segment_states_,
12458 Layout::relaxation_debug_check_): New data members.
12459 * output.cc: (Output_section_headers::do_size): New method definition.
12460 (Output_section_headers::Output_section_headers): Move size
12461 computation to Output_section_headers::do_size.
12462 (Output_segment_headers::do_size): New method definition.
e1df38aa 12463 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12464 Output_file_header::do_size and call it.
12465 (Output_file_header::do_size): New method definition.
12466 (Output_data_group::Output_data_group): Adjust call to
12467 Output_section_data.
12468 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12469 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12470 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12471 RELAXED_INPUT_SECTION_CODE.
12472 (Output_section::Output_section): Initialize data member checkpoint_.
12473 (Output_section::~Output_section): Delete checkpoint object pointed
12474 by checkpoint_.
12475 (Output_section::add_input_section): Always add an Input_section if
12476 relaxing.
12477 (Output_section::add_merge_input_section): Add assert.
12478 (Output_section::relax_input_section): New method definition.
12479 (Output_section::set_final_data_size): Set load address to zero for
12480 an unallocated section.
12481 (Output_section::do_address_and_file_offset_have_reset_values):
12482 New method definition.
12483 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12484 Handle relaxed input section.
12485 (Output_section::sort_attached_input_sections): Checkpoint input
12486 section list lazily.
12487 (Output_section::get_input_sections): Change type of input_sections to
12488 list of Simple_input_section pointers. Checkpoint input section list
12489 lazily. Also handle relaxed input sections.
12490 (Output_section::add_input_section_for_script): Take a reference to
12491 a Simple_input_section object instead of Relobj pointer and section
12492 index as parameter. Handle relaxed input sections.
12493 (Output_section::save_states, Output_section::restore_states): New
12494 method definitions.
12495 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12496 (Output_data::is_data_size_fixed): New method definition.
12497 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12498 if it is fixed.
12499 (Output_data::address_and_file_offset_have_reset_values): New method
12500 definition.
12501 (Output_data::do_address_and_file_offset_have_reset_values): New method
12502 definition.
12503 (Output_data::set_data_size): Check that data size is not fixed.
12504 (Output_data::fix_data_size): New method definition.
12505 (Output_data::is_data_size_fixed_): New data member.
12506 (Output_section_headers::set_final_data_size): New method definition.
12507 (Output_section_headers::do_size): New method declaration.
12508 (Output_segment_headers::set_final_data_size): New method definition.
12509 (Output_segment_headers::do_size): New method declaration.
12510 (Output_file_header::set_final_data_size)::New method definition.
12511 (Output_file_header::do_size)::New method declaration.
12512 (Output_section_data::Output_section_data): Add new parameter
12513 is_data_size_fixed and use it to fix data size.
12514 (Output_data_const::Output_data_const): Adjust call to base class
12515 constructor and fix data size.
12516 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12517 base class constructor and fix data size.
12518 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12519 base class constructor and fix data size.
12520 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12521 class constructor and fix data size.
12522 (Output_data_group::set_final_data_size): New method definition.
12523 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12524 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12525 class constructor and fix data size.
12526 (Output_relaxed_input_section): New class definition.
12527 (Output_section::Simple_input_section): New class definition.
12528 (Output_section::get_input_sections): Adjust parameter list.
12529 (Output_section::add_input_section_for_script): Same.
12530 (Output_section::save_states, Output_section::restore_states,
12531 Output_section::do_address_and_file_offset_have_reset_values,
12532 (Output_section::Input_section::Input_section): Handle
12533 RELAXED_INPUT_SECTION_CODE. Add new overload for
12534 Output_relaxed_input_section.
12535 (Output_section::Input_section::is_input_section,
12536 Output_section::Input_section::set_output_section): Handle relaxed
12537 input section.
12538 (Output_section::Input_section::is_relaxed_input_section,
12539 Output_section::Input_section::output_section_data,
12540 Output_section::Input_section::relaxed_input_section): New method
12541 definitions.
12542 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12543 value.
12544 (Output_section::Input_section::u1_): Update comments.
12545 (Output_section::Input_section::u2_): Add new union member poris.
12546 (Output_section::Checkpoint_output_section): New classs definition.
12547 (Output_section::relax_input_section): New method declaration.
12548 (Output_section::checkpoint_): New data member.
12549 (Output_segment): Update comments.
12550 (Output_segment::Output_segment): Un-privatize copy constructor.
12551 (Output_segment::operator=): Un-privatize.
12552 * script-sections.cc (Output_section_element::Input_section_list):
12553 Change element type to Output_section::Simple_input_section.
12554 (Output_section_element_dot_assignment::set_section_addresses):
12555 Register output section data for relaxation clean up.
12556 (Output_data_exression::Output_data_expression): Adjust call to base
12557 constructor to fix data size.
12558 (Output_section_element_data::set_section_addresses): Register
12559 Output_data_expression object for relaxation clean up.
12560 (struct Input_section_info): Replace Relobj pointer and section index
12561 pair with Output_section::Simple_input_section and Convert struct to a
12562 class.
12563 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12564 Input_section_info data member to use accessors.
20e6d0d6
DK
12565 (Output_section_element_input::set_section_addresses): Use layout
12566 parameter. Adjust code to use Output_section::Simple_input_section
12567 and Input_secction_info classes. Register filler for relaxation
12568 clean up.
12569 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12570 and section index pair with Output_section::Simple_input_section
12571 class. Adjust code accordingly.
12572 (Phdrs_element::release_segment): New method definition.
12573 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12574 segment list.
12575 (Script_sections::release_segments): New method definition.
12576 * gold/script-sections.h (Script_sections::release_segments): New
12577 method declaration.
12578 * gold/target.h (Target::may_relax, Target::relax,
12579 Target::do_may_relax, Target::do_relax): New method definitions.
12580
5e445df6
ILT
125812009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12582
12583 * arm.cc (has_signed_unsigned_overflow): New function.
12584 (Arm_relocate_functions::abs8): New function.
12585 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12586 (Target_arm::Scan::global): Likewise.
12587 (Target_arm::relocate::relocate): Likewise.
12588 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12589 Likewise.
12590
8c604651 125912009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12592
12593 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12594 * testsuite/Makefile.in: Regenerate.
12595
1e9cc1c2
NC
125962009-09-11 Nick Clifton <nickc@redhat.com>
12597
12598 * po/gold.pot: Updated by the Translation project.
12599
6a89f575
CC
126002009-09-08 Cary Coutant <ccoutant@google.com>
12601
12602 * output.cc (Output_file::open): Add execute permission to empty file.
12603 * testsuite/Makefile.am (permission_test): New test.
12604 * testsuite/Makefile.in: Regenerate.
12605
fdcac5af
ILT
126062009-09-02 Ian Lance Taylor <iant@google.com>
12607
12608 * output.cc (Output_file::resize): Call map_no_anonymous rather
12609 than map.
12610
44453f85
ILT
126112009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12612
12613 * gold.cc: Include "incremental.h".
12614 (queue_initial_tasks): Call Incremental_checker methods.
12615 * incremental.cc: Include "output.h".
12616 (Incremental_checker::can_incrementally_link_output_file): New
12617 method.
12618 * incremental.h (Incremental_checker): New class.
12619
12620 * output.cc (Output_file::open_for_modification): New method.
12621 (Output_file::map_anonymous): Changed return type to bool. Record
12622 map in base_ field.
12623 (Output_file::map_no_anonymous): New method, broken out of map.
12624 (Output_file::map): Use map_no_anonymous and map_anonymous.
12625 * output.h (class Output_file): Update declarations.
12626
293c1386
CC
126272009-08-24 Cary Coutant <ccoutant@google.com>
12628
12629 * options.h (Command_line::Pre_options): New class.
12630 (Command_line::pre_options): New member.
12631 * options.cc (gold::options::ready_to_register): New variable.
12632 (One_option::register_option): Do nothing if not registering options.
12633 Assert if same short option registered twice.
12634 (General_options::General_options): Turn off option registration when
12635 done constructing.
12636 (Command_line::Pre_options::Pre_options): New constructor.
12637
f773f3d2
CC
126382009-08-24 Cary Coutant <ccoutant@google.com>
12639
06a73cfe
CC
12640 * options.h (General_options::no_keep_memory): Remove incorrect
12641 short option.
f773f3d2 12642
a15af8e2
RW
126432009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12644
12645 * Makefile.am (am__skiplex, am__skipyacc): New.
12646 * Makefile.in: Regenerate.
12647
c462b41b
RW
126482009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12649
14ec8efd
RW
12650 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12651 (INCLUDES): ... this.
12652 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12653 (AM_CPPFLAGS): Renamed from ...
12654 (INCLUDE): ... this.
12655 * Makefile.in, testsuite/Makefile.in: Regenerate.
12656
81ecdfbb
RW
12657 * Makefile.in: Regenerate.
12658 * aclocal.m4: Likewise.
12659 * config.in: Likewise.
12660 * configure: Likewise.
12661 * testsuite/Makefile.in: Likewise.
12662
c462b41b
RW
12663 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12664 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12665 * Makefile.in: Regenerate.
12666 * testsuite/Makefile.in: Regenerate.
12667
2da73f13
CC
126682009-08-19 Cary Coutant <ccoutant@google.com>
12669
12670 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12671 symbols in shared libraries overridden by hidden or internal symbols
12672 in the main program.
12673
2db70501
CD
126742009-08-19 Chris Demetriou <cgd@google.com>
12675
12676 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12677 checking source file names in error messages.
12678
f733487b
DK
126792009-08-18 Doug Kwan <dougkwan@google.com>
12680
12681 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12682 an elcpp::Ehdr as parameter. Adjust call to set_target.
12683 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12684 an elfcpp::Ehdr as parameter.
12685 * object.cc (Object::set_target): Remove the version that looks up
12686 a target and sets it.
12687 (Sized_relobj::setup): Take a Target object instead of
12688 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12689 (make_elf_sized_object): Find target and ask target to
12690 make an ELF object.
12691 * object.h: (Object::set_target): Remove the version that looks up
12692 a target and sets it.
12693 (Sized_relobj::setup): Take a Target object instead of
12694 an elfcpp:Ehdr as parameter.
12695 * target.cc: Include dynobj.h.
12696 (Target::do_make_elf_object_implementation): New.
2e702c99 12697 (Target::do_make_elf_object): New.
f733487b
DK
12698 * target.h (Target::make_elf_object): New template declaration.
12699 (Target::do_make_elf_object): New method declarations.
12700 (Target::do_make_elf_object_implementation): New template declaration.
12701
cc70f101
ILT
127022009-08-14 Ian Lance Taylor <iant@google.com>
12703
12704 * gold.h (FUNCTION_NAME): Define.
12705 (gold_unreachable): Use FUNCTION_NAME.
12706
ef5e0cb1
ST
127072009-08-12 Sriraman Tallam <tmsriram@google.com>
12708
12709 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12710 symbol in the --keep-unique list is not found.
12711
48c187ce
ST
127122009-08-12 Sriraman Tallam <tmsriram@google.com>
12713
12714 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12715 been maked as --keep-unique.
12716 (Icf::unfold_section): New function.
12717 * icf.h (Icf::unfold_section): New function.
12718 * options.h (General_options::keep_unique): New option.
12719 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12720 * testsuite/Makefile.in: Regenerate.
12721 * testsuite/icf_keep_unique_test.sh: New file.
12722 * testsuite/icf_keep_unique_test.cc: New file.
12723
645afe0c
CC
127242009-08-12 Cary Coutant <ccoutant@google.com>
12725
12726 PR 10471
12727 * resolve.cc (Symbol_table::resolve): Check for references from
12728 dynamic objects to hidden and internal symbols.
12729 * testsuite/Makefile.am (hidden_test.sh): New test.
12730 * testsuite/Makefile.in: Regenerate.
12731 * testsuite/hidden_test.sh: New script.
12732 * testsuite/hidden_test_1.c: New test source.
12733 * testsuite/hidden_test_main.c: New test source.
12734
11af873f
DK
127352009-08-11 Doug Kwan <dougkwan@google.com>
12736
12737 * arm.cc: Update comments.
12738 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12739 segment to locate the .ARM.exidx section if present.
12740
b9f7d72d
DK
127412009-08-09 Doug Kwan <dougkwan@google.com>
12742
12743 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12744 patch.
12745
ddd3c53c
ST
127462009-08-07 Sriraman Tallam <tmsriram@google.com>
12747 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12748 compiler warnings.
12749
27721062
ST
127502009-08-06 Sriraman Tallam <tmsriram@google.com>
12751
12752 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12753 valid tls_segment only for non-debug-section relocations.
12754 * testsuite/Makefile.am: Add gc_tls_test.
12755 * testsuite/Makefile.in: Regenerate.
12756 * testsuite/gc_tls_test.cc: New file.
12757 * testsuite/gc_tls_test.sh: New file.
12758
ef15dade 127592009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12760
ef15dade
ST
12761 * icf.cc: New file.
12762 * icf.h: New file.
12763 * Makefile.am (CCFILES): Add icf.cc.
12764 (HFILES): Add icf.h
12765 * Makefile.in: Regenerate.
12766 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12767 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12768 section, symbol and addend information for the relocs.
12769 * gold.cc (queue_middle_tasks): Call identical code folding.
12770 * gold.h: Add defines for multimap.
12771 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12772 to the call of finalize_local_symbols.
12773 * main.cc (main): Create object of class Icf.
12774 * object.cc (Sized_relobj::do_layout): Allow this function to be
12775 called twice during icf.
12776 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12777 to sections marked as identical by icf.
12778 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12779 when available.
12780 (Sized_relobj::do_section_entsize): New function.
12781 * object.h (Object::section_entsize): New function.
12782 (Object::do_section_entsize): New pure virtual function.
12783 (Relobj::finalize_local_symbols): Add new parameter.
12784 (Relobj::do_section_entsize): New function.
12785 * options.h (General_options::icf): New option.
12786 (General_options::icf_iterations): New option.
12787 (General_options::print_icf_sections): New option.
12788 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12789 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12790 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12791 icf.
12792 * symtab.cc (Symbol_table::is_section_folded): New function.
12793 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12794 to sections marked as identical by icf.
12795 * symtab.h (Symbol_table::set_icf): New function.
12796 (Symbol_table::icf): New function.
12797 (Symbol_table::is_section_folded): New function.
12798 (Symbol_table::icf_): New data member.
12799 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12800 * testsuite/Makefile.am: Add commands to build icf_test.
12801 * testsuite/Makefile.in: Regenerate.
12802 * testsuite/icf_test.sh: New file.
12803 * testsuite/icf_test.cc: New file.
12804
c3b65ac4
CD
128052009-07-24 Chris Demetriou <cgd@google.com>
12806
12807 * layout.cc (is_compressible_debug_section): Fix incorrect
12808 comment about compressed section names.
12809
1caf2c51
ILT
128102009-07-20 Ian Lance Taylor <ian@airs.com>
12811
12812 PR 10419
12813 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12814
1ef4d87f
ILT
128152009-07-16 Ian Lance Taylor <iant@google.com>
12816
12817 PR 10400
12818 * layout.h: #include <map>.
12819 (class Kept_section): Change from struct to class. Add accessors
12820 and setters. Add section size to Comdat_group mapping. Change
12821 Comdat_group to std::map. Add is_comdat_ field. Add
12822 linkonce_size field in union.
12823 (class Layout): Update declaration of find_or_add_kept_section.
12824 Don't declare find_kept_object.
12825 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12826 parameter. Add object, shndx, is_comdat, and is_group_name
12827 parameters. Change all callers. Adjust for new Kept_section.
12828 (Layout::find_kept_object): Remove.
12829 * object.cc (Sized_relobj::include_section_group): Update use of
12830 Kept_section. Rename secnum to shndx. Only record
12831 Kept_comdat_section if sections are the same size.
12832 (Sized_relobj::include_linkonce_section): Update use of
12833 Kept_section. Only record Kept_comdat_section if sections are the
12834 same size. Set size of linkonce section.
12835 (Sized_relobj::map_to_kept_section): Update call to
12836 get_kept_comdat_section.
12837 * object.h (class Sized_relobj): Rename fields in
12838 Kept_comdat_section to drop trailing underscores; change object
12839 field to Relobj*. Change Kept_comdat_section_table to store
12840 struct rather than pointer.
12841 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12842 Add kept_object and kept_shndx parameters. Change all callers.
12843 (Sized_relobj::get_kept_comdat_section): Change return type to
12844 bool. Add kept_object and kept_shndx parameters. Change all
12845 callers.
12846 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12847 Layout::find_or_add_kept_section.
12848
37c3b7b0
ILT
128492009-07-09 Ian Lance Taylor <iant@google.com>
12850
12851 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12852 Reserve space in the hash table.
12853
98fa85cb
ILT
128542009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12855
12856 * fileread.cc (File_read::get_mtime): New method.
12857 * fileread.h (Timespec): New structure.
12858 (File_read::get_mtime): New method.
12859 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12860 Renamed from timestamp_nsec.
12861 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12862 Elf_Xword.
e1df38aa 12863 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12864 timestamp_nsec.
e1df38aa 12865 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12866 (Incremental_inputs::report_obejct): Save mtime; style fix.
12867 (Incremental_inputs::report_script): Save mtime; style fix.
12868 (Incremental_inputs::finalize_inputs): Style fix.
12869 (Incremental_inputs::finalize): Style fix.
12870 (Incremental_inputs::create_input_section_data): Store inputs
12871 mtime.
12872 * incremental.h (Incremental_inputs::report_script): Add mtime
12873 argument.
12874 (Incremental_inputs::Input_info::Input_info): Intialize only one
12875 union member.
12876 (Incremental_inputs::Input_info::archive): Move to nameless
12877 union.
12878 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12879 (Incremental_inputs::Input_info::script): Move to nameless union.
12880 (Incremental_inputs::mtime): New field.
12881 * script.cc (read_input_script): Pass file mtime to
12882 Incremental_input.
12883 * script.h (Script_info::inputs): Style fix.
12884
c9d70757
ILT
128852009-07-01 Ian Lance Taylor <ian@airs.com>
12886
12887 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12888 instead of 32.
12889
9c547ec3
ILT
128902009-06-24 Ian Lance Taylor <iant@google.com>
12891
12892 PR 10156
12893 * layout.cc (Layout::choose_output_section): If we find an
12894 existing section, update the flags.
12895 (Layout::create_notes): New function, broken out of
12896 Layout::finalize.
12897 (Layout::finalize): Don't create note sections.
12898 (Layout::create_note): Don't crash if linker script discards
12899 section.
12900 (Layout::create_gold_note): Likewise.
12901 (Layout::create_build_id): Likewise. Don't set
12902 after_input_sections on the section.
12903 (Layout::create_executable_stack_info): Remove target parameter.
12904 Change caller.
12905 * layout.h (class Layout): Declare create_notes. Update
12906 declaration of create_executable_stack_info.
12907 * gold.cc (queue_middle_tasks): Call create_notes.
12908 * output.cc (Output_section::update_flags_for_input_section): Move
12909 here from output.h. If SHF_ALLOC flag is newly set, mark address
12910 invalid.
12911 * output.h (Output_data::mark_address_invalid): New function.
12912 (class Output_section): Only declare, not define,
12913 update_flags_for_input_section. Remove set_flags.
12914
55458500
ILT
129152009-06-24 Ian Lance Taylor <iant@google.com>
12916
12917 * script-sections.cc (Output_section_definition::
12918 set_section_addresses): Rename shadowing local load_address to
12919 laddr.
12920
1307d6cd
ILT
129212009-06-24 Ian Lance Taylor <iant@google.com>
12922
12923 PR 10244
12924 * reloc.cc (relocate_sections): Skip empty relocation sections.
12925
ec3f783e
ILT
129262009-06-23 Ian Lance Taylor <iant@google.com>
12927
12928 PR 10156
12929 * layout.cc (Layout::create_note): Use choose_output_section
12930 rather than make_output_section.
12931
459c9f1c
ILT
129322009-06-23 Ian Lance Taylor <iant@google.com>
12933
12934 PR 10237
12935 * options.cc (General_options::parse_V): Set printed_version_.
12936 (General_options::General_options): Initialize printed_version_.
12937 * options.h (class General_options): Add printed_version_ field.
12938 * gold.cc (queue_initial_tasks): If there are no input files,
12939 don't give a fatal error if we printed the version information.
12940 (queue_middle_tasks): If using -r with a shared object, give a
12941 fatal error rather than an ordinary error.
12942
1518dc8f
ILT
129432009-06-23 Ian Lance Taylor <iant@google.com>
12944
12945 PR 10219
12946 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12947 (Layout::make_output_section): Set have_stabstr_section_ if we see
12948 a .stab*str section.
12949 (Layout::finalize): Call link_stabs_sections.
12950 (Layout::link_stabs_sections): New file.
12951 * layout.h (class Layout): Add have_stabstr_section_ field.
12952 Declare link_stabs_sections.
12953
3d857b98
DK
129542009-06-23 Doug Kwan <dougkwan@google.com>
12955
12956 * Makefile.am (libgold_a_LIBADD): New.
12957 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12958 * Makefile.in: Regenerate.
3d857b98
DK
12959 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12960 * configure: Regenerate.
12961 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12962 * fileread.cc: Include sys/state.h
12963 * gold.h: Declare memmem and strndup if found missing.
12964 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12965
0639a6f6
ILT
129662009-06-23 Ian Lance Taylor <iant@google.com>
12967
12968 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12969 * configure: Rebuild.
12970
8d63875c
ILT
129712009-06-23 Ian Lance Taylor <iant@google.com>
12972
12973 PR 10147
12974 * object.cc (Object::section_contents): Don't try to get a view if
12975 the section has length zero.
12976 (Object::handle_gnu_warning_section): If the section is empty, use
12977 the name of the section as the warning.
12978
f7c8a183
ILT
129792009-06-23 Ian Lance Taylor <iant@google.com>
12980
12981 PR 10133
12982 * stringpool.h (class Stringpool_template): Add optimize_ field.
12983 (Stringpool_template::set_optimize): New function.
12984 * stringpool.cc (Stringpool_template::Stringpool_template):
12985 Initialize optimize_ field.
12986 (Stringpool_template::set_string_offsets): Test local optimize
12987 fild rather than parameter.
12988 * layout.cc (Layout::Layout): Call set_optimize on the section
12989 name stringpool.
12990
e6a307ba
ILT
129912009-06-22 Ian Lance Taylor <iant@google.com>
12992
12993 PR 10030
12994 * yyscript.y: Parse TARGET.
12995 * script.cc (script_set_target): New function.
12996 * script-c.h (script_set_target): Declare.
12997 * options.cc (General_options::string_to_object_format): Rename
12998 from string_to_object_format in anonymous namespace. Change
12999 callers.
13000 * options.h (class General_options): Declare
13001 string_to_object_format.
13002
3ee173de
ILT
130032009-06-22 Ian Lance Taylor <iant@google.com>
13004
13005 * script-sections.cc (Script_sections::create_segments): Don't put
13006 program headers in a PT_LOAD segment if -n or -N.
13007
130082009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13009
13010 PR 10141
13011 * options.h (class General_options): Add -z lazy and -z now. Sort
13012 -z options into alphabetical order.
13013 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13014
cd6739a1 130152009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13016
13017 * layout.cc (Layout::make_output_section): Call
13018 Target::new_output_section.
13019 (Layout::attach_allocated_section_to_segment): Put large section
13020 sections in a separate load segment with the large segment flag
13021 set.
13022 (Layout::segment_precedes): Sort large data segments after other
13023 load segments.
13024 (align_file_offset): New static function.
13025 (Layout::set_segment_offsets): Use align_file_offset.
13026 * output.h (class Output_section): Add is_small_section_ and
13027 is_large_section_ fields.
13028 (Output_section::is_small_section): New function.
13029 (Output_section::set_is_small_section): New function.
13030 (Output_section::is_large_section): New function.
13031 (Output_section::set_is_large_section): New function.
13032 (Output_section::is_large_data_section): New function.
13033 (class Output_segment): Add is_large_data_segment_ field.
13034 (Output_segment::is_large_data_segment): New function.
13035 (Output_segment::set_is_large_data_segment): New function.
13036 * output.cc (Output_section::Output_section): Initialize new
13037 fields.
13038 (Output_segment::Output_segment): Likewise.
13039 (Output_segment::add_output_section): Add assertion that large
13040 data sections always go in large data segments. Force small data
13041 sections to the end of the list of data sections. Force small BSS
13042 sections to the start of the list of BSS sections. For large BSS
13043 sections to the end of the list of BSS sections.
13044 * symtab.h (class Symbol): Declare is_common_shndx.
13045 (Symbol::is_defined): Check Symbol::is_common_shndx.
13046 (Symbol::is_common): Likewise.
13047 (class Symbol_table): Define enum Commons_section_type. Update
13048 declarations. Add small_commons_ and large_commons_ fields.
13049 * symtab.cc (Symbol::is_common_shndx): New function.
13050 (Symbol_table::Symbol_table): Initialize new fields.
13051 (Symbol_table::add_from_object): Put small and large common
13052 symbols in the right list.
13053 (Symbol_table::sized_finalized_symbol): Check
13054 Symbol::is_common_shndx.
13055 (Symbol_table::sized_write_globals): Likewise.
13056 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13057 common symbol lists. Don't call do_allocate_commons_list if the
13058 list is empty.
13059 (Symbol_table::do_allocate_commons_list): Remove is_tls
13060 parameter. Add comons_section_type parameter. Change all
13061 callers. Handle small and large common symbols.
13062 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13063 Symbol::is_common_shndx.
13064 * resolve.cc (symbol_to_bits): Likewise.
13065 * target.h (Target::small_common_shndx): New function.
13066 (Target::small_common_section_flags): New function.
13067 (Target::large_common_shndx): New function.
13068 (Target::large_common_section_flags): New function.
13069 (Target::new_output_section): New function.
13070 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13071 small_common_section_flags, and large_common_section_flags
13072 fields.
13073 (Target::do_new_output_section): New virtual function.
13074 * arm.cc (Target_arm::arm_info): Initialize new fields.
13075 * i386.cc (Target_i386::i386_info): Likewise.
13076 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13077 Likewise.
13078 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13079 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13080 (Target_x86_64::do_new_output_section): New function.
13081 * configure.ac: Define conditional MCMODEL_MEDIUM.
13082 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13083 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13084 (large_LDFLAGS): Define.
13085 * testsuite/large.c: New file.
13086 * testsuite/testfile.cc (Target_test::test_target_info):
13087 Initialize new fields.
13088 * configure, testsuite/Makefile.in: Rebuild.
13089
bb04269c
DK
130902009-06-05 Doug Kwan <dougkwan@google.com>
13091
13092 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13093 * Makefile.in: Regenerate.
bb04269c
DK
13094 * i386.cc (class Target_i386): Define new virtual method to
13095 override do_is_local_label_name in parent.
13096 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13097 local symbols if --discard-locals or -X is given.
13098 * options.h (class General_options): Declare new options
13099 '--discard-locals' and '-X' for discarding locals.
13100 * target.h (class Target): Define new methods is_local_label_name.
13101 Declare new virtual method do_is_local_label_name.
13102 * target.cc: New file.
13103 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13104 (check_SCRIPTS): Add discard_locals_test.sh.
13105 (check_DATA): Add discard_local_tests.syms.
13106 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13107 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13108 * testsuite/Makefile.in: Regenerate.
13109 * testsuite/discard_locals_test.c: New file.
13110 * testsuite/discard_locals_test.sh: Same.
13111
805bb01c
DK
131122009-06-05 Doug Kwan <dougkwan@google.com>
13113
13114 * object.cc (Sized_relobj::Sized_relobj): Initialize
13115 discarded_eh_frame_shndx_ to -1U.
13116 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13117 section.
13118 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13119 a discarded .eh_frame section.
13120 (Sized_relobj::do_finalize_local_symbols): Ditto.
13121 * object.h (class Sized_relobj): Declare new member
13122 discarded_eh_frame_shndx_.
13123 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13124 (local_labels_test.o, local_labels_test): New rules.
13125 * testsuite/Makefile.in: Regenerate.
13126
1dcd334d
DK
131272009-06-04 Doug Kwan <dougkwan@google.com>
13128
13129 * layout.cc (Layout::section_name_mapping): Add mapping for
13130 special ARM sections.
13131
96d49306
DK
131322009-06-03 Doug Kwan <dougkwan@google.com>
13133
13134 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13135 (utils::has_overflow): Same.
13136
dff16297
ILT
131372009-06-03 Ian Lance Taylor <iant@google.com>
13138
13139 * layout.cc (Layout::section_name_mapping): New array, replacing
13140 Layout::linkonce_mapping.
13141 (Layout::section_name_mapping_count): New variable, replacing
13142 Layout::linkonce_mapping_count.
13143 (Layout::linkonce_output_name): Remove.
13144 (Layout::output_section_name): Rewrite.
13145 * layout.h (class Layout): Rename Linkonce_mapping to
13146 Section_name_mapping, linkonce_mapping to section_name_mapping,
13147 linkonce_mapping_count to section_name_mapping_count. Don't
13148 declare linkonce_output_name.
13149
c121c671
DK
131502009-06-03 Doug Kwan <dougkwan@google.com>
13151
13152 * gold/arm.cc (namespace utils): New.
13153 (Target_arm::reloc_is_non_pic): Define new method.
13154 (class Arm_relocate_functions): New.
13155 (Target_arm::Relocate::relocate): Handle relocation types used by
13156 Android.
13157
07800fab
ILT
131582009-06-03 Ian Lance Taylor <iant@google.com>
13159
13160 * arm.cc (Target_arm::scan::global): Use || instead of |.
13161
c121c671
DK
131622009-06-02 Doug Kwan <dougkwan@google.com>
13163
13164 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13165 issued_non_pic_error_.
13166 (class Target_arm::Scan): Declare new method check_non_pic.
13167 Define new method symbol_needs_plt_entry.
13168 Declare new data member issued_non_pic_error_.
13169 (class Target_arm::Relocate): Declare new method
13170 should_apply_static_reloc.
13171 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13172 (Target_arm::Scan::check_non_pic): Define new method.
13173 (Target_arm::Scan::local): Handle a small subset of reloc types used
13174 by Android.
13175 (Target_arm::Scan::local): Same.
13176 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13177
b19b0c6d
ILT
131782009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13179
13180 * incremental.cc (Incremental_inputs::report_command_line): Filter
13181 out --incremental-* options.
13182
94cdfcff
DK
131832009-05-29 Doug Kwan <dougkwan@google.com>
13184
13185 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13186 template class.
13187 (class Target_arm): Update comment.
13188 (Target_arm::Target_arm): Initialize new data members GOT_,
13189 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13190 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13191 and Target_arm::rel_dyn_section.
13192 Declare new_enum Target_arm::Got_type.
13193 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13194 and DYNBSS_.
13195 Update commments for member do_dynsym_value.
13196 (Target_arm::got_size, Target_arm::plt_section,
13197 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13198 new methods inside class defintion.
13199 (Target_arm::got_section): Define new method.
13200 (Target_arm::rel_dyn_section): Same.
13201 (Output_data_plt_arm): New template class.
13202 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13203 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13204 (Output_data_plt_arm::add_entry): Same.
13205 (Output_data_plt_arm::first_plt_entry): Define new
13206 static data member for PLT instruction template.
13207 (Output_data_plt_arm::plt_entry): Same.
13208 (Output_data_plt_arm::do_write): Define new method.
13209 (Target_arm::make_plt_entry): Same.
13210 (Target_arm::do_finalize_sections): Same.
13211 (Target_arm::do_dynsym_value): Same.
13212
4a657b0d
DK
132132009-05-28 Doug Kwan <dougkwan@google.com>
13214
13215 * Makefile.am (TARGETSOURCES): Add arm.cc.
13216 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13217 * Makefile.in: Regenerate.
13218 * arm.cc: New file.
13219 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13220
e7ae8c36
DK
132212009-05-26 Doug Kwan <dougkwan@google.com>
13222
13223 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13224 (General_options::check_excluded_libs): Strip off directories in
13225 archive name before matching like GNU ld does.
13226 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13227 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13228 (exclude_libs_test_LDFLAGS): Add linker option
13229 -Wl,--exclude-libs,libexclude_libs_test_3
13230 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13231 an explicit archive without using -l.
13232 (alt/libexclude_libs_test_3.a): New make rule.
13233 * testsuite/Makefile.in: Regenerate.
13234 * testsuite/exclude_libs_test.c : Declare lib3_default().
13235 (main): Call it.
13236 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13237 * exclude_libs_test_3.c: New file.
13238
f12e7348
NC
132392009-05-26 Nick Clifton <nickc@redhat.com>
13240
13241 * po/id.po: New Indonesian translation.
13242 * po/gold.pot: Updated template file.
13243
4daadc0d
ST
132442009-05-22 Sriraman Tallam <tmsriram@google.com>
13245
e1df38aa 13246 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13247 gc_comdat_test files. Add -Wl,--gc-sections to build
13248 gc_comdat_test.
13249 * testsuite/Makefile.in: Regenerate.
13250 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13251
531813ad
ST
132522009-05-21 Sriraman Tallam <tmsriram@google.com>
13253
13254 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13255 kept comdat section was garbage collected.
13256 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13257 * testsuite/Makefile.in: Regenerate.
13258 * testsuite/gc_comdat_test.sh: New file.
13259 * testsuite/gc_comdat_test_1.cc: New file.
13260 * testsuite/gc_comdat_test_2.cc: New file.
13261
65514900
CC
132622009-05-19 Doug Kwan <dougkwan@google.com>
13263
13264 * archive.cc (Archive::Archive): Move constructor from archive.h
13265 to here. Initialize no_export_.
13266 (Archive::get_elf_object_for_member): Set no_export flag of object.
13267 * archive.h (Archive::Archive): Move constructor body to
13268 archive.cc.
13269 (Archive::no_export): New method.
13270 (Archive::no_export_): New field.
13271 * object.h (Object::Object): Initialize no_export_ to false.
13272 (Object::no_export, Object::set_no_export): New methods.
13273 (Object::no_export_): New field.
13274 * options.cc (General_options::parse_exclude_libs): New method.
13275 (General_options::check_excluded_libs) Same.
13276 * options.h (exclude_libs): New option.
13277 (General_options::check_excluded_libs): New method declaration.
13278 (General_options::excluded_libs_): New field.
13279 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13280 default or protected visibility if an object has no-export flag set.
13281 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13282 (check_SCRIPTS): Add exclude_libs_test.sh.
13283 (check_DATA): Add exclude_libs_test.syms.
13284 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13285 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13286 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13287 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13288 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13289 libexclude_libs_test_2.a): New rules.
13290 * testsuite/Makefile.in: Regenerate.
13291 * testsuite/exclude_libs_test.c: New file.
13292 * testsuite/exclude_libs_test.sh: Ditto.
13293 * testsuite/exclude_libs_test_1.c: Ditto.
13294 * testsuite/exclude_libs_test_2.c: Ditto.
13295
1b77ea50
ILT
132962009-05-15 Ian Lance Taylor <iant@google.com>
13297
13298 * configure.ac: Check for declarations for cases where libiberty.h
13299 checks HAVE_DECL_xxx.
13300 * configure, config.in: Rebuild.
13301
072fe7ce
ILT
133022009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13303
13304 * gold.h (Incremental_argument_list): Remove (invalid) forward
13305 declaration.
13306 * incremental.cc (Incremental_inputs::report_achive): New method.
13307 (Incremental_inputs::report_object): New method.
13308 (Incremental_inputs::report_script): New method.
13309 (Incremental_inputs::finalize_inputs): New method.
13310 (Incremental_inputs::finalize): Call finalize_inputs().
13311 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13312 Create inputs entries.
13313 * incremental.h (Incremental_input_type): New enum.
13314 (Incremental_inputs::Incremental_input): Initialize new fields.
13315 (Incremental_inputs::report_inputs): New method.
13316 (Incremental_inputs::report_achive): New method.
13317 (Incremental_inputs::report_object): New method.
13318 (Incremental_inputs::report_script): New method.
13319 (Incremental_inputs::finalize_inputs): New method.
13320 (Incremental_inputs::Input_info): New struct.
13321 (Incremental_inputs::Input_info_map): New typedef.
13322 (Incremental_inputs::lock_): New field.
13323 (Incremental_inputs::Inputs_): New field.
13324 (Incremental_inputs::Inputs_map): New field.
13325 * main.cc (main): Call Incremental_input::report_inputs.
13326 * options.h (Input_argument_list): Typedef moved from
13327 Input_arguments.
13328 (Input_file_group::Files): Remove, use ::Input_argument_list.
13329 (Input_file_group::Input_argument_list): Remove, use
13330 ::Input_argument_list.
13331 * plugin.cc (Plugin_manager::add_input_file): Add error in
13332 incremental build.
13333 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13334 functions.
13335 * script.cc (read_input_script): Call
13336 Incremental_input::report_script.
13337 * script.h (Script_info): New class.
13338
b0481b0b
ILT
133392009-04-27 Ian Lance Taylor <iant@google.com>
13340
13341 * x86_64.cc (do_adjust_output_section): Set entsize to
13342 plt_entry_size.
13343
b22a5a41 133442009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13345
13346 * output.cc (Output_file::close): After short writes, continue
13347 writing from the correct offset in the buffer being written.
13348
40fde488
CD
133492009-04-23 Chris Demetriou <cgd@google.com>
13350
13351 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13352 * configure: Regenerate.
13353 * config.in: Regenerate.
13354 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13355 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13356
3ce2c28e
ILT
133572009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13358
13359 * incremental.cc (Incremental_inputs_header_data): Renamed from
13360 Incremental_input_header_data.
13361 (Incremental_inputs_header_data::data_size): New field.
13362 (Incremental_inputs_header_data::put_input_file_count): Renamed
13363 from input_file_count.
13364 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13365 from command_line_offset.
13366 (Incremental_inputs_header_data::put_reserved): Renamed from
13367 put_reserved.
13368 (Incremental_inputs_entry_data): Renamed from
13369 Incremental_input_entry_data.
13370 (Incremental_inputs_entry_data::data_size): New field.
13371 (Incremental_inputs::report_command_line): New method.
13372 (Incremental_inputs::finalize): New method.
13373 (Incremental_inputs::create_incremental_inputs_data): New method.
13374 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13375 * incremental.h: New file.
13376 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13377 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13378 incremental builds.
703d02da 13379 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13380 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13381 (Layout::create_incremental_info_sections): New method.
13382 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13383 * main.cc (main): Notify Incremental_input of the command line.
13384
e55bde5e
ILT
133852009-04-01 Ian Lance Taylor <iant@google.com>
13386 Mikolaj Zalewski <mikolajz@google.com>
13387
13388 * gold.h (reserve_unordered_map): Define, three versions, one for
13389 each version of Unordered_map.
13390 * layout.cc (Layout::Layout): Remove options parameter. Add
13391 number_of_input_files parameter. Don't initialize options_.
13392 Initialize number_of_input_files_ and resized_signatures_. Move
13393 sections_are_attached_.
13394 (Layout::layout_group): Reserve space for group_signatures_.
13395 (Layout::find_or_add_kept_section): Change name parameter to be a
13396 reference. Resize signatures_ map when it gets large enough.
13397 (Layout::layout_eh_frame): Use parameters->options() instead of
13398 this->options_.
13399 (Layout::make_output_section): Likewise.
13400 (Layout::attach_allocated_section_to_segment): Likewise.
13401 (Layout::finalize, Layout::create_executable_stack): Likewise.
13402 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13403 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13404 * layout.h (class Layout): Update declarations. Remove options_
13405 field. Add number_of_input_files_ and resized_signatures_
13406 fields. Move sections_are_attached_ field.
13407 * main.cc (main): Pass number of input files to Layout
13408 constructor. Don't pass options.
13409
154b857c
ILT
134102009-03-30 Ian Lance Taylor <iant@google.com>
13411
13412 * ffsll.c (ffsll): Correct implementation.
13413
2f35ab9b
ILT
134142009-03-27 Ian Lance Taylor <iant@google.com>
13415
fd03461a
ILT
13416 * ffsll.c: New file.
13417 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13418 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13419 * ftruncate.c (ftruncate): Declare before definition.
13420 * mremap.c (mremap): Likewise.
13421 * pread.c (pread): Likewise.
13422 * configure, Makefile.in, config.in: Rebuild.
13423
2f35ab9b
ILT
13424 * mremap.c: New file.
13425 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13426 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13427 (mremap): Declare if HAVE_MREMAP is not defined.
13428 * configure, Makefile.in, config.in: Rebuild.
13429
33aea2fd
CC
134302009-03-27 Cary Coutant <ccoutant@google.com>
13431
13432 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13433 position independent.
13434 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13435 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13436
6d479619
CC
134372009-03-24 Cary Coutant <ccoutant@google.com>
13438
13439 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13440 an executable.
13441 (needs_dynamic_reloc): Likewise.
13442
afc06bb8
ILT
134432009-03-24 Ian Lance Taylor <iant@google.com>
13444
13445 * yyscript.y (file_cmd): Recognize EXTERN.
13446 (extern_name_list, extern_name_list_body): New nonterminals.
13447 * script.cc (script_add_extern): Define.
13448 * script-c.h (script_add_extern): Declare.
13449
f6060a4d
ILT
134502009-03-24 Rafael Avila de Espindola <espindola@google.com>
13451
13452 * object.cc (is_elf_object): Define.
13453 * object.h (is_elf_object): Declare.
13454 * archive.cc (Archive::get_elf_object_for_member): Call
13455 is_elf_object.
33aea2fd 13456 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13457
26736d8e
ILT
134582009-03-24 Elliott Hughes <enh@google.com>
13459
13460 * output.cc (Output_file::map_anonymous): Define.
13461 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13462 try an anonymous one. Report the size if the mmap fails.
13463 * output.h (class Output_file): Declare map_anonymous.
13464
22fd9730
ILT
134652009-03-24 Ian Lance Taylor <iant@google.com>
13466
13467 * target-select.cc (instantiate_target): Don't acquire the lock if
13468 the instantiated_target_ field has already been set.
13469
cb010894
ILT
134702009-03-23 Ian Lance Taylor <iant@google.com>
13471
7f055c20
ILT
13472 * gold-threads.h (class Initialize_lock): Define.
13473 * gold-threads.cc (class Initialize_lock_once): Define.
13474 (initialize_lock_control): New static variable.
13475 (initialize_lock_pointer): New static variable.
13476 (initialize_lock_once): New static function.
13477 (Initialize_lock::Initialize_lock): Define.
13478 (Initialize_lock::initialize): Define.
13479 * target-select.h: Include "gold-threads.h".
13480 (class Target_selector): Add lock_ and initialize_lock_ fields.
13481 Don't define instantiate_target, just declare it.
13482 * target-select.cc (Target_selector::Target_selector): Initialize
13483 new fields.
13484 (Target_selector::instantiate_target): Define.
13485 * descriptors.h: Include "gold-threads.h".
13486 (class Descriptors): Add initialize_lock_ field.
13487 * descriptors.cc (Descriptors::Descriptors): Initialize new
13488 field.
13489 (Descriptors::open): Use initialize_lock_ field
13490 * errors.h (class Errors): Add initialize_lock_ field.
13491 * errors.cc (Errors::Errors): Initialize new field.
13492 (Errors::initialize_lock): Use initialize_lock_ field.
13493 * powerpc.cc (class Target_selector_powerpc): Remove
13494 instantiated_target_ field. In do_recognize call
13495 instantiate_target rather than do_instantiate_target. In
13496 do_instantiate_target just allocate a new target.
13497 * sparc.cc (class Target_selector_sparc): Likewise.
13498
36959681
ILT
13499 * freebsd.h: New file.
13500 * i386.cc: Include "freebsd.h".
13501 (Target_i386): Derive from Target_freebsd rather than
13502 Sized_target.
13503 (Target_selector_i386): Derive from Target_selector_freebsd rather
13504 than Target_selector.
13505 * x86_64.cc: Include "freebsd.h".
13506 (Target_x86_64): Derive from Target_freebsd rather than
13507 Sized_target.
13508 (Target_selector_x86_64): Derive from Target_selector_freebsd
13509 rather than Target_selector.
13510 * target.h (class Target): Add adjust_elf_header and
13511 do_adjust_elf_header.
13512 * output.cc (Output_file_header:: do_sized_write): Call target
13513 adjust_elf_header routine.
13514 * configure.tgt: Set targ_osabi.
13515 * configure.ac: Define GOLD_DEFAULT_OSABI.
13516 * parameters.cc (Parameters::default_target): Pass
13517 GOLD_DEFAULT_OSABI to select_target.
13518 * target-select.h (class Target_selector): Make instantiate_target
13519 protected rather than private.
13520 * Makefile.am (HFILES): Add freebsd.h.
13521 * configure, Makefile.in, config.in: Rebuild.
13522
cb010894
ILT
13523 * merge.cc (do_add_input_section): Correct pend value. Change
13524 message about last entry not being null terminated from error to
13525 warning.
13526
0e879927
ILT
135272009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13528
13529 * incremental.cc: New file.
13530 * Makefile.am (CCFILES): Add incremental.cc.
13531 * Makefile.in: Rebuild.
13532
41105937
PP
135332009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13534
13535 * layout.cc (Layout::output_section_name): Preserve names
13536 of '.note.' sections.
e1df38aa 13537
60439920
ILT
135382009-03-19 Ian Lance Taylor <iant@google.com>
13539
13540 * descriptors.cc (Descriptors::open): Check that the options are
13541 valid before using them.
13542
0d371ad3
ILT
135432009-03-18 Ian Lance Taylor <iant@google.com>
13544
13545 * script-sections.h: Include <list>.
13546 (class Script_sections): Change Sections_elements from std::vector
13547 to std::list. Typedef public Elements_iterator. Add
13548 orphan_section_placement_, data_segment_align_start_, and
13549 saw_data_segment_align_ fields. Remove data_segment_align_index_
13550 field.
13551 * script-sections.cc (class Orphan_section_placement): New class.
13552 (class Sections_element): Add virtual functions is_relro and
13553 orphan_section_init. Remove virtual function place_orphan_here.
13554 (class Output_section_definition): Add is_relro and
13555 orphan_section_init. Remove place_orphan_here.
13556 (class Orphan_output_section): Likewise.
13557 (Script_sections::Script_sections): Update for field changes.
13558 (Script_sections::data_segment_align): Set saw_data_segment_align_
13559 and data_segment_align_start_, not data_segment_align_index.
13560 (Script_sections::data_segment_relro_end): Check
13561 saw_data_segment_align_. Use data_segment_align_start_ rather
13562 than data_segment_align_index_.
13563 (Script_sections::place_orphan): Rewrite to use
13564 Orphan_section_placement.
13565
9201d894
ILT
135662009-03-17 Ian Lance Taylor <iant@google.com>
13567
9c5b8369
ILT
13568 * archive.cc (Archive::add_symbols): Check for a version attached
13569 to the symbol name in the archive map.
13570 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13571 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13572 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13573 (ver_test_11.a): New target.
13574 * testsuite/Makefile.in: Rebuild.
13575
9201d894
ILT
13576 * configure.ac: Check for chsize and posix_fallocate. Replace
13577 ftruncate.
13578 * ftruncate.c: New file, from gnulib.
13579 * output.cc (posix_fallocate): Define dummy version if not
13580 HAVE_POSIX_FALLOCATE.
13581 (Output_file::map): Call posix_fallocate rather than lseek and
13582 write.
13583 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13584 * configure, Makefile.in, config.in: Rebuild.
13585
ef4ab7a8 135862009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13587
ef4ab7a8
PP
13588 * layout.h (Layout::create_note): Add section_name parameter.
13589 * layout.cc (Layout::create_note): Likewise.
13590 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13591
8c500701
ILT
135922009-03-17 Ian Lance Taylor <iant@google.com>
13593
e85b18e1
ILT
13594 * descriptors.cc: Include "options.h".
13595 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13596 (Descriptors::open): Always use O_CLOEXEC when opening a new
13597 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13598 then set FD_CLOEXEC.
13599
9efe6174
ILT
13600 * sparc.cc (class Target_sparc): Add has_got_section.
13601 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13602 make sure we have a GOT section.
13603
13604 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13605 (Target_sparc::Scan::local): Likewise.
13606 (Target_sparc::Scan::global): Likewise.
13607 (Target_sparc::Relocate::relocate): Likewise.
13608 (Target_sparc::Relocate::relocate_tls): Likewise.
13609
8c500701
ILT
13610 * symtab.cc (Symbol_table::define_default_version): New function,
13611 broken out of add_from_object.
13612 (Symbol_table::add_from_object): Call define_default_version.
13613 (Symbol_table::define_special_symbol): Add resolve_oldsym
13614 parameter. Change all callers. If the version for a symbol comes
13615 from a version script, resolve it with the symbol with the same
13616 name with no version. Also add the symbol without a version if
13617 appropriate.
13618 (do_define_in_output_data): If resolving with oldsym, don't delete
13619 sym.
13620 (do_define_in_output_segment): Likewise.
13621 (do_define_as_constant): Likewise.
13622 * symtab.h (class Symbol_table): Update declarations.
13623
f1ed28fb
ILT
136242009-03-13 Ian Lance Taylor <iant@google.com>
13625
15f8229b
ILT
13626 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13627 (Read_symbols::requeue): New function.
13628 (Read_symbols::do_read_symbols): If make_elf_object fails because
13629 the target type is not configured, and the file was searched for,
13630 issue a warning and retry with the next directory.
13631 (Add_symbols::run): If the file has an incompatible format, and
13632 it was searched for, requeue the Read_symbols task. On error,
13633 release the object.
13634 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13635 dirindex parameter to constructor. Change all callers. Declare
13636 incompatible_warning and requeue.
13637 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13638 input_argument_ and input_group_ fields. Add them to
13639 constructor. Change all callers.
13640 (class Read_script): Add dirindex_ field. Add it to constructor.
13641 Change all callers.
13642 * archive.cc (Archive::setup): Remove input_objects parameter.
13643 Change all callers.
13644 (Archive::get_file_and_offset): Likewise.
13645 (Archive::read_all_symbols): Likewise.
13646 (Archive::read_symbols): Likewise.
13647 (Archive::get_elf_object_for_member): Remove input_objects
13648 parameter. Add punconfigured parameter. Change all callers.
13649 (Archive::add_symbols): Change return type to bool. Check return
13650 value of include_member.
13651 (Archive::include_all_members): Likewise.
13652 (Archive::include_member): Change return type to bool. Return
13653 false if first included object has incompatible target. Set
13654 included_member_ field.
13655 (Add_archive_symbols::run): If add_symbols returns false, requeue
13656 Read_symbols task.
13657 * archive.h (class Archive): Add included_member_ field.
13658 Initialize it in constructor. Add input_file and searched_for
13659 methods. Update declarations.
13660 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13661 input_argument_ fields. Add them to constructor. Change all
13662 callers.
13663 * script.cc: Include "target-select.h".
13664 (class Parser_closure): Add skip_on_incompatible_target_ and
13665 found_incompatible_target_ fields. Add
13666 skip_on_incompatible_target parameter to constructor. Change all
13667 callers. Add methods skip_on_incompatible_target,
13668 clear_skip_on_incompatible_target, found_incompatible_target, and
13669 set_found_incompatible_target.
13670 (read_input_script): Add dirindex parameter. Change all callers.
13671 If parser finds an incompatible target, requeue Read_symbols
13672 task.
13673 (script_set_symbol): Clear skip_on_incompatible_target in
13674 closure.
13675 (script_add_assertion, script_parse_option): Likewise.
13676 (script_start_sections, script_add_phdr): Likewise.
13677 (script_check_output_format): New function.
13678 * script.h (read_input_script): Update declaration.
13679 * script-c.h (script_check_output_format): Declare.
13680 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13681 (ignore_cmd): Remove OUTPUT_FORMAT.
13682 * fileread.cc (Input_file::Input_file): Add explicit this.
13683 (Input_file::will_search_for): New function.
13684 (Input_file::open): Add pindex parameter. Change all callers.
13685 * fileread.h (class Input_file): Add input_file_argument method.
13686 Declare will_search_for. Update declarations.
13687 * object.cc (make_elf_object): Add punconfigured parameter.
13688 Change all callers.
13689 * object.h (class Object): Make input_file public. Add
13690 searched_for method.
13691 (make_elf_object): Update declaration.
13692 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13693 restart search.
13694 * dirsearch.h (class Dirsearch): Update declaration.
13695 * options.h (class General_options): Add --warn-search-mismatch.
13696 * parameters.cc (Parameters::is_compatible_target): New function.
13697 * parameters.h (class Parameters): Declare is_compatible_target.
13698 * workqueue.cc (Workqueue::add_blocker): New function.
13699 * workqueue.h (class Workqueue): Declare add_blocker.
13700
f1ed28fb
ILT
13701 * fileread.cc (Input_file::open): Remove options parameter.
13702 Change all callers.
13703 (Input_file::open_binary): Likewise.
13704 * script.cc (read_input_script): Likewise.
13705 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13706 options parameter from constructor. Change all callers.
13707 (class Read_script): Likewise.
13708 * fileread.h (class Input_file): Update declarations.
13709 * script.h (read_input_script): Update declaration.
13710
34dd024a
NC
137112009-03-10 Nick Clifton <nickc@redhat.com>
13712
13713 * po/es.po: New Spanish translation.
13714
6d71b17c
CC
137152009-03-06 Cary Coutant <ccoutant@google.com>
13716
13717 * options.cc (parse_short_option): Keep dash_z from registering itself.
13718
031cdbed
ILT
137192009-03-03 Ian Lance Taylor <iant@google.com>
13720
13721 PR 9918
13722 * target-reloc.h (relocate_section): Pass output_section to
13723 relocate.
13724 * i386.cc (Target_i386::should_apply_static_reloc): Add
13725 output_section parameter. Change all callers.
13726 (Target_i386::Relocate::relocate): Add output_section parameter.
13727 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13728 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13729 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13730 * testsuite/two_file_shared.sh: New script.
13731 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13732 (check_DATA): Add two_file_shared.dbg.
13733 (two_file_shared.dbg): New target.
13734 * testsuite/Makefile.in: Rebuild.
13735
15d5fa16
ILT
137362009-03-01 Ian Lance Taylor <iant@google.com>
13737
13738 * configure.ac: Check for byteswap.h.
13739 * configure: Rebuild.
13740 * config.in: Rebuild.
13741
8a4c0b0d
ILT
137422009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13743
13744 * layout.cc (Layout::find_or_add_kept_section): New function.
13745 (Layout::add_comdat): Removed.
13746 * layout.h (struct Kept_section): Move out of class Layout.
13747 Remove trailing underscores from field names. Add group_sections
13748 field. Rename group_ field to is_group. Change all uses.
13749 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13750 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13751 comdat_groups_ field.
13752 (Sized_relobj::include_section_group): Use
13753 find_or_add_kept_section and Kept_section::group_sections.
13754 (Sized_relobj::include_linkonce_section): Likewise.
13755 * object.cc (class Sized_relobj): Don't define Comdat_group or
13756 Comdat_group_table. Remove find_comdat_group and
13757 add_comdat_group. Remove comdat_groups_ field.
13758 * plugin.cc (include_comdat_group): Use
13759 Layout::find_or_add_kept_section.
13760
b4ecf66b
ILT
137612009-02-28 Ian Lance Taylor <iant@google.com>
13762
14359ca0
ILT
13763 * README: --gc-sections and map files are now supported. Document
13764 some build requirements.
13765
b4ecf66b
ILT
13766 PR 6992
13767 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13768 relocatable link set the value of the section symbol to zero.
13769 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13770 relocatable link don't include the section address in the local
13771 symbol value.
13772
0602e05a
ILT
137732009-02-27 Ian Lance Taylor <iant@google.com>
13774
fd9d194f
ILT
13775 PR 6811
13776 * options.h (class Search_directory): Add is_system_directory.
13777 (class General_options): Declare is_in_system_directory.
13778 * options.cc (get_relative_sysroot): Make static.
13779 (get_default_sysroot): Make static.
13780 (General_optoins::is_in_system_directory): New function.
13781 * fileread.cc (Input_file::is_in_system_directory): New function.
13782 * fileread.h (class Input_file): Declare is_in_system_directory.
13783 * object.h (class Object): Add is_in_system_directory.
13784 (class Input_objects): Remove system_library_directory_ field.
13785 * object.cc (Input_objects::add_object): Don't set
13786 system_library_directory_.
13787 (input_objects::found_in_system_library_directory): Remove.
13788 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13789 parameter. Change all callers.
13790 (Symbol_table::sized_write_globals): Likewise.
13791 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13792 Call Object::is_in_system_directory.
13793 * symtab.h (class Symbol_table): Update declarations.
13794
61edd21f
ILT
13795 PR 5990
13796 * descriptors.h (Open_descriptor): Add is_on_stack field.
13797 * descriptors.cc (Descriptors::open): If the descriptor is on the
13798 top of the stack, remove it. Initialize is_on_stack field.
13799 (Descriptors::release): Only add pod to stack if it is not on the
13800 stack already.
13801 (Descriptors::close_some_descriptor): Clear stack_next and
13802 is_on_stack fields.
13803
e29e076a
ILT
13804 PR 7091
13805 * output.cc (Output_section::find_starting_output_address): Rename
13806 from starting_output_address; add PADDR parameter; change return
13807 type.
13808 * output.h (class Output_section): Declare
13809 find_starting_output_address instead of starting_output_address.
13810 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13811 section symbol for which we can't find a merge section.
13812
0602e05a
ILT
13813 PR 9836
13814 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13815 hidden or internal, force the symbol to be local.
13816 * resolve.cc (Symbol::override_visibility): Define.
13817 (Symbol::override_base): Use override_visibility.
13818 (Symbol_table::resolve): Likewise.
13819 (Symbol::override_base_with_special): Likewise.
13820 (Symbol_table::override_with_special): If the visibility is hidden
13821 or internal, force the symbol to be local.
13822 * symtab.h (class Symbol): Add set_visibility and
13823 override_visibility.
13824 * testsuite/ver_test_1.sh: New file.
13825 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13826 (check_DATA): Add ver_test_1.syms.
13827 (ver_test_1.syms): New target.
13828 * testsuite/Makefile.in: Rebuild.
13829
401a9a73
CC
138302009-02-25 Cary Coutant <ccoutant@google.com>
13831
13832 * layout.cc (Layout::choose_output_section): Don't rename sections
13833 when using a linker script that has a SECTIONS clause.
13834 * Makefile.in: Regenerate.
13835
13836 * testsuite/Makefile.am (script_test_5.sh): New test case.
13837 * testsuite/Makefile.in: Regenerate.
13838 * testsuite/script_test_5.cc: New file.
13839 * testsuite/script_test_5.sh: New file.
13840 * testsuite/script_test_5.t: New file.
13841
f488e4b0
CC
138422009-02-13 Rafael Avila de Espindola <espindola@google.com>
13843
13844 * archive.cc (Archive::include_member): Update calls to add_symbols.
13845 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13846 the Layout argument.
13847 * dynobj.h (do_add_symbols): Add the Layout argument.
13848 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13849 Layout argument.
13850 * object.h (Object::add_symbols): Add the Layout argument.
13851 (Object::do_add_symbols): Add the Layout argument.
13852 (Sized_relobj::do_add_symbols): Add the Layout argument.
13853 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13854 Unify the two versions.
13855 (Add_plugin_symbols): Remove.
13856 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13857 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13858 (Add_plugin_symbols): Remove.
13859 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13860 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13861 (Add_symbols::run): Make it work with Pulginobj.
13862
89dd1680
ILT
138632009-02-06 Ian Lance Taylor <iant@google.com>
13864
13865 * object.cc (Sized_relobj::do_layout): Make info message start
13866 with lower case letter.
13867
266d0a74
ILT
138682009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13869
602b464e
ILT
13870 * binary.cc: Fix file comment.
13871
266d0a74
ILT
13872 * options.h (enum Incremental_disposition): Define.
13873 (class General_options): Add new options: --incremental,
13874 --incremental_changed, --incremental_unchanged,
13875 --incremental_unknown. Add incremental_disposition_ and
13876 implicit_incremental_ fields.
13877 (General_options::incremental_disposition): New function.
13878 (class Position_dependent_options): Add incremental_disposition
13879 option.
13880 (Position_dependent_options::copy_from_options): Set incremental
13881 dispositions.
13882 * options.cc (General_options::parse_incremental_changed): New
13883 function.
2e702c99
RM
13884 (General_options::parse_incremental_unchanged): New function.
13885 (General_options::parse_incremental_unknown): New function.
13886 (General_options::General_options): Initialize new fields
266d0a74 13887 incremental_disposition_ and implicit_incremental_.
2e702c99 13888 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13889 without --incremental.
13890
f073bbf7
CD
138912009-02-06 Chris Demetriou <cgd@google.com>
13892
13893 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13894 pointer and to report location as the file name associated with
13895 the symbol.
13896 (gold_undefined_symbol_at_location): New function to replace the
13897 old gold_undefined_symbol functionality.
13898 * target-reloc.h (relocate_section): Update to use
13899 gold_undefined_symbol_at_location.
13900 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13901 Call gold_undefined_symbol function rather than gold_error.
13902 * errors.h (Errors::undefined_symbol): Take location as a
13903 string, rather than calculating it from a relocation.
13904 * errors.cc (Errors::fatal): Print "fatal error:" before the
13905 formatted message.
13906 (Errors::error, Errors::error_at_location): Print "error: "
13907 before the formatted message.
13908 (Errors::undefined_symbol): Take location as a string, rather
13909 than calculating it from a relocation.
13910 (gold_undefined_symbol_at_location): New function akin to
13911 old gold_undefined_symbol, calculates location from relocation.
13912 (gold_undefined_symbol): Change to take only a Symbol pointer
13913 and to report location as the file name associated with the symbol.
13914 * testsuite/debug_msg.sh: Update for changed error messages.
13915 * testsuite/undef_symbol.sh: Likewise.
13916
8e94a90c
ILT
139172009-02-04 Duncan Sands <baldrick@free.fr>
13918
13919 PR 9812
13920 * reduced_debug_output.h
13921 (Output_reduced_debug_abbrev_section::failed): Use format for
13922 gold_warning.
13923 (Output_reduced_debug_info_section::faild): Likewise.
13924
88a0e15b
ILT
139252009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13926
13927 * script.cc (Lazy_demangler): New class.
2e702c99 13928 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13929 symbol only once.
13930
5efc7cd2
CC
139312009-01-29 Cary Coutant <ccoutant@google.com>
13932
13933 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13934 to __tls_get_addr.
13935 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13936
e0ebcf42
ILT
139372009-01-28 Ian Lance Taylor <iant@google.com>
13938
5efc7cd2 13939 * version.cc (version_string): Bump to 1.9.
75fe7426 13940
e0ebcf42
ILT
13941 * gold.h: Include <cstring> and <stdint.h>.
13942 * version.cc: Include <cstdio>.
13943 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13944 warning.
13945 * reduced_debug_output.cc (insert_into_vector): Rename from
13946 Insert_into_vector; change all callers. Use Swap_unaligned to
13947 avoid aliasing issue; remove union since it is unnecessary.
13948
8e2813be 139492009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13950
13951 * Makefile.am (CCFILES): Add gc.cc.
13952 (HFILES): Add gc.h.
13953 * Makefile.in: Regenerate.
13954 * gold.cc (Gc_runner): New class.
13955 (queue_initial_tasks): Call garbage collection related tasks
13956 when corresponding options are invoked.
13957 (queue_middle_gc_tasks): New function.
13958 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13959 processed early before laying out sections during garbage collection.
13960 * gold.h (queue_middle_gc_tasks): New function.
13961 (is_prefix_of): Move from "layout.cc".
13962 * i386.cc (Target_i386::gc_process_relocs): New function.
13963 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13964 * main.cc (main): Create object of class "Garbage_collection".
13965 * object.cc (Relobj::copy_symbols_data): New function.
13966 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13967 (Sized_relobj::do_layout): Allow this function to be called twice
13968 during garbage collection and defer layout of section during the
6d03d481
ST
13969 first call.
13970 * object.h (Relobj::get_symbols_data): New function.
13971 (Relobj::is_section_name_included): New function.
13972 (Relobj::copy_symbols_data): New function.
13973 (Relobj::set_symbols_data): New function.
13974 (Relobj::get_relocs_data): New function.
13975 (Relobj::set_relocs_data): New function.
13976 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13977 (Relobj::gc_process_relocs): New function.
13978 (Relobj::do_gc_process_relocs): New pure virtual function.
13979 (Relobj::sd_): New data member.
13980 (Sized_relobj::is_output_section_offset_invalid): New function.
13981 (Sized_relobj::do_gc_process_relocs): New function.
13982 * options.h (General_options::gc_sections): Modify to not be a no-op.
13983 (General_options::print_gc_sections): New option.
13984 * plugin.cc (Plugin_finish::run): Remove function call to
13985 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13986 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13987 * reloc.cc (Read_relocs::run): Add task to process relocs and
13988 determine unreferenced sections when doing garbage collection.
13989 (Gc_process_relocs): New class.
13990 (Sized_relobj::do_gc_process_relocs): New function.
13991 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13992 sections that are garbage collected.
13993 * reloc.h (Gc_process_relocs): New class.
13994 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13995 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13996 symbols whose corresponding sections are garbage collected.
13997 (Symbol_table::Symbol_table): Add new parameter for the garbage
13998 collection object.
13999 (Symbol_table::gc_mark_undef_symbols): New function.
14000 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14001 (Symbol_table::gc_mark_dyn_syms): New function.
14002 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14003 as garbage.
14004 (Symbol_table::add_from_object): Likewise.
14005 (Symbol_table::add_from_relobj): When building shared objects, do not
14006 treat externally visible symbols as garbage.
14007 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14008 table information for static and relocatable links.
14009 * symtab.h (Symbol_table::set_gc): New function.
14010 (Symbol_table::gc): New function.
14011 (Symbol_table::gc_mark_undef_symbols): New function.
14012 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14013 (Symbol_table::gc_mark_dyn_syms): New function.
14014 (Symbol_table::gc_): New data member.
e1df38aa 14015 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14016 function.
14017 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14018 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14019
3b293544
CF
140202009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14021
14022 * options.h (General_options::gc_sections): Define as a no-op for now.
14023 (General_options::no_keep_memory): Ditto.
14024 (General_options::Bshareable): Define.
14025 * options.cc (General_options::finalize): Honor -Bshareable.
14026
83d22aa8
AS
140272009-01-20 Andreas Schwab <schwab@suse.de>
14028
14029 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14030 read the value in the contents, since we don't use it. Use the
14031 template endianness when writing.
14032 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14033
cd536b21
AS
140342009-01-19 Andreas Schwab <schwab@suse.de>
14035
14036 * configure.tgt (powerpc64-*): Fix targ_obj.
14037
99e9a495
ILT
140382009-01-15 Ian Lance Taylor <iant@google.com>
14039
14040 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14041 local symbols when stripping all symbols.
14042
bbbfea06
CC
140432009-01-14 Cary Coutant <ccoutant@google.com>
14044
99e9a495 14045 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14046
0f7c0701
CC
140472009-01-14 Cary Coutant <ccoutant@google.com>
14048
14049 * archive.cc (Archive::get_elf_object_for_member): Remove call
14050 to File_read::claim_for_plugin.
14051 * descriptors.cc (Descriptors::open): Remove reference to
14052 is_claimed.
14053 (Descriptors::claim_for_plugin): Remove.
14054 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14055 (Descriptors::is_claimed): Remove.
14056 (claim_descriptor_for_plugin): Remove.
14057 * fileread.cc (File_read::claim_for_plugin): Remove.
14058 * fileread.h (File_read::claim_for_plugin): Remove.
14059 (File_read::descriptor): Reopen descriptor if necessary.
14060 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14061 (Plugin_manager::all_symbols_read): Add task parameter. Change
14062 all callers.
14063 (Plugin_manager::get_input_file): New function.
14064 (Plugin_manager::release_input_file): New function.
14065 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14066 corresponding data member.
14067 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14068 and pass to base constructor. Change all callers.
14069 (get_input_file, release_input_file): New functions.
14070 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14071 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14072 (Plugin_manager::all_symbols_read): Add task parameter.
14073 (Plugin_manager::get_input_file): New function.
14074 (Plugin_manager::release_input_file): New function.
14075 (Plugin_manager::task_): New data member.
14076 (Pluginobj::Pluginobj): Add filesize parameter.
14077 (Pluginobj::filename): New function.
14078 (Pluginobj::descriptor): New function.
14079 (Pluginobj::filesize): New function.
14080 (Pluginobj::filesize_): New data member.
14081 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14082 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14083 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14084
14085 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14086 with archive libraries.
14087 * testsuite/Makefile.in: Regenerate.
14088 * testsuite/plugin_test.c (struct sym_info): New type.
14089 (get_input_file, release_input_file): New static variables.
14090 (onload): Capture new transfer vector entries.
14091 (claim_file_hook): Stop reading at end of file according to filesize.
14092 Factor out parsing of readelf output into separate function.
14093 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14094 APIs and get the source file name from the symbol table. Convert
14095 source file name to corresponding object file name. Print info
14096 message when adding new input files.
14097 (parse_readelf_line): New function.
14098 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14099 * testsuite/plugin_test_2.sh: Likewise.
14100 * testsuite/plugin_test_3.sh: Likewise.
14101 * testsuite/plugin_test_4.sh: New test case.
14102
62a6d109
ILT
141032009-01-07 Ian Lance Taylor <iant@google.com>
14104
14105 * version.cc (version_string): Bump to 1.8.
14106
483620e8
CC
141072008-12-23 Cary Coutant <ccoutant@google.com>
14108
14109 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14110 * plugin.cc (Plugin_manager::finish): Rename as
14111 layout_deferred_objects. Move cleanup to separate function.
14112 (Plugin_manager::cleanup): New function.
14113 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14114 separately.
14115 * plugin.h (Plugin_manager::finish): Rename as
14116 layout_deferred_objects.
14117 (Plugin_manager::cleanup): New function.
14118 (Plugin_manager::cleanup_done): New field.
14119
d66a9eb3
CC
141202008-12-23 Cary Coutant <ccoutant@google.com>
14121
14122 * plugin.cc (is_visible_from_outside): New function.
14123 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14124 so we don't return "IR only" status for exported symbols or -r links.
14125
14126 * testsuite/Makefile.am (plugin_test_3): New test case.
14127 * testsuite/Makefile.in: Regenerate.
14128 * testsuite/plugin_test_3.sh: New file.
14129
5995b570
CC
141302008-12-22 Cary Coutant <ccoutant@google.com>
14131
14132 * object.cc (Sized_relobj::layout_section): New function.
14133 (Sized_relobj::do_layout): Defer layout of input sections until after
14134 plugin has provided replacement files.
14135 (Sized_relobj::do_layout_deferred_sections): New function.
14136 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14137 (Relobj::layout_deferred_sections): New function.
14138 (Relobj::do_layout_deferred_sections): New function.
14139 (Sized_relobj::do_layout_deferred_sections): New function.
14140 (Sized_relobj::layout_section): New function.
14141 (Sized_relobj::Deferred_layout): New structure.
14142 (Sized_relobj::deferred_layout_): New field.
14143 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14144 Change all callers. Layout deferred sections.
14145 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14146 references.
14147 (Plugin_hook::run): Move code from do_plugin_hook inline.
14148 (Plugin_hook::do_plugin_hook): Remove.
14149 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14150 (Plugin_manager::finish): Renamed, was cleanup.
14151 (Plugin_manager::should_defer_layout): New function.
14152 (Plugin_manager::add_deferred_layout_object): New function.
14153 (Plugin_manager::Deferred_layout_list): New type.
14154 (Plugin_manager::deferred_layout_objects_): New field.
14155 (Plugin_hook::do_plugin_hook): Remove.
14156
ee769c88
ILT
141572008-12-17 Ian Lance Taylor <iant@google.com>
14158
14159 * options.h (class General_options): Add --no case for
14160 --export-dynamic.
14161
abc8dcba
CC
141622008-12-16 Cary Coutant <ccoutant@google.com>
14163
14164 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14165 vector.
14166 (Plugin_manager::claim_file): Create plugin object even if
14167 plugin did not call the add_symbols callback.
14168 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14169 asking for more symbols than were added.
14170 * testsuite/Makefile.am (plugin_test_1): Add test case with
14171 no global symbols.
14172 (empty.syms): New target.
14173 * testsuite/Makefile.in: Regenerate.
14174 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14175 message. Don't call add_symbols if no globals.
14176 (all_symbols_read_hook): Don't provide replacement for empty
14177 claimed file.
14178
b0074644
ILT
141792008-12-12 Ian Lance Taylor <iant@google.com>
14180
68943102
ILT
14181 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14182 r_type == 0 for a local symbol with r_sym == 0.
14183 (scan_relocatable_relocs): Pass r_sym to
14184 local_non_section_strategy.
14185 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14186 r_sym parameter.
14187
b0074644
ILT
14188 * configure.ac: Update test for TLS descriptors: they are
14189 supported as of glibc 2.9.
14190 * configure: Rebuild.
14191
c2508178
ILT
141922008-12-11 Ian Lance Taylor <iant@google.com>
14193
14194 PR 7091
14195 * target-reloc.h (Default_scan_relocatable_relocs): For each
14196 function, map r_type == 0 to RELOC_DISCARD.
14197
2756a258
CC
141982008-12-10 Cary Coutant <ccoutant@google.com>
14199
14200 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14201 object to override a kept COMDAT group from a plugin object.
14202
bb6f53d3
ILT
142032008-12-09 Ian Lance Taylor <iant@google.com>
14204
fbc558e1
ILT
14205 PR 7088
14206 * yyscript.y (file_cmd): Handle INPUT.
14207
bb6f53d3
ILT
14208 * testsuite/initpri1.c: Change all declarations to be full
14209 prototypes by adding void, to avoid compiler warnings.
14210
4674ecfc
CC
142112008-12-05 Rafael Avila de Espindola <espindola@google.com>
14212
14213 * options.cc (General_options::parse_plugin_opt): New.
14214 (General_options::add_plugin): The argument now is just the filename.
14215 (General_options::add_plugin_option): New.
14216 * options.h (plugin_opt): New.
14217 (add_plugin): Change argument name.
14218 (add_plugin_option): New.
14219 * plugin.cc (Plugin::load): Don't parse the plugin option.
14220 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14221 (Plugin::add_option): New.
14222 (Plugin::args_): Change type.
14223 (Plugin::filename_): New.
14224 (Plugin_manager::add_plugin_option): New.
14225 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14226 * testsuite/Makefile.in: Regenerate.
14227
fd06b4aa
CC
142282008-12-05 Cary Coutant <ccoutant@google.com>
14229
14230 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14231 Handle --strip-lto-sections option.
14232 * options.h (strip_lto_sections): New option.
14233
6c52134c
CC
142342008-12-01 Cary Coutant <ccoutant@google.com>
14235
14236 * plugin.cc (ld_plugin_message): Change format parameter to const.
14237 Fix mismatch between new[] and delete.
14238
a45248e0
CC
142392008-11-14 Cary Coutant <ccoutant@google.com>
14240
14241 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14242 instead of -1U.
14243
c82fbeee
CS
142442008-11-05 Craig Silverstein <csilvers@google.com>
14245
14246 * options.cc (General_options::parse_dynamic_list): New function.
14247 * options.h (General_options): New flags dynamic_list,
14248 dynamic_list_data, dynamic_list_cpp_new, and
14249 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14250 (General_options::in_dynamic_list): New function.
14251 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14252 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14253 (Lex::can_continue_name): Likewise.
14254 (yylex): Likewise.
14255 (read_script_file): New parameter script_options.
14256 (read_dynamic_list): New function.
14257 (Script_options::define_dynamic_list): New function.
14258 (dynamic_list_keyword_parsecodes): New variable.
14259 (dynamic_list_keywords): New variable.
14260 * script.h (Script_options::define_dynamic_list): New function
14261 prototype.
14262 (read_dynamic_list): New function prototype.
14263 * symtab.cc (strprefix): New macro.
14264 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14265 dynamic_list_data, dynamic_list_cpp_new, and
14266 dynamic_list_cpp_typeinfo.
14267 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14268 (dynamic_list_expr): New rule.
14269 (dynamic_list_nodes): Likewise.
14270 (dynamic_list_node): Likewise.
14271 * testsuite/Makefile.am (dynamic_list): New test.
14272 * testsuite/Makefile.in: Regenerated.
14273 * testsuite/dynamic_list.t: New file.
14274 * testsuite/dynamic_list.sh: New file.
14275
e0bb29a5
CS
142762008-11-05 Craig Silverstein <csilvers@google.com>
14277
14278 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14279 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14280 (t11_last): Likewise.
14281 * testsuite/ver_test_6.c (main): Likewise.
14282
4e1e25e0
CC
142832008-10-07 Cary Coutant <ccoutant@google.com>
14284
14285 * options.c (General_options::finalize): Add check for -static and
14286 -shared.
14287 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14288 is not empty.
14289
92f03fcb
CC
142902008-10-02 Cary Coutant <ccoutant@google.com>
14291
14292 * plugin.cc (make_sized_plugin_object): Fix conditional
14293 compilation to work when not all targets are enabled.
14294
fbd8a257
CC
142952008-09-29 Cary Coutant <ccoutant@google.com>
14296
14297 * archive.cc (Archive::get_file_and_offset): Use filename instead
14298 of name to get library path.
14299 (Archive::include_member): Unlock external member of a thin archive.
14300
14301 * testsuite/Makefile.am (TEST_AR): New variable.
14302 (thin_archive_test_1): New test.
14303 (thin_archive_test_2): New test.
81636b3f
CC
14304 * testsuite/Makefile.in: Regenerate.
14305 * testsuite/thin_archive_main.cc: New file.
14306 * testsuite/thin_archive_test_1.cc: New file.
14307 * testsuite/thin_archive_test_2.cc: New file.
14308 * testsuite/thin_archive_test_3.cc: New file.
14309 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14310
eff45813
CC
143112008-09-29 Cary Coutant <ccoutant@google.com>
14312
14313 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14314 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14315 instead of -1U.
14316 (Sized_relobj::do_finalize_local_symbols): Likewise.
14317 (Sized_relobj::map_to_kept_section): Likewise.
14318 * object.h (Sized_relobj::invalid_address): New constant.
14319 (Sized_relobj::do_output_section_offset): Check for invalid_address
14320 and return -1ULL.
14321 * output.cc (Output_reloc::local_section_offset): Use constant
14322 invalid_address instead of -1U.
14323 (Output_reloc::get_address): Likewise.
14324 (Output_section::output_address): Change -1U to -1ULL.
14325 * output.h (Output_reloc::invalid_address): New constant.
14326 * reloc.cc (Sized_relobj::write_sections): Use constant
14327 invalid_address instead of -1U.
14328 (Sized_relobj::relocate_sections): Likewise.
14329 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14330 values for merge sections.
14331 * target-reloc.h (relocate_for_relocatable): Use constant
14332 invalid_address instead of -1U.
14333
89fc3421
CC
143342008-09-19 Cary Coutant <ccoutant@google.com>
14335
14336 Add plugin functionality for link-time optimization (LTO).
14337 * configure.ac (plugins): Add --enable-plugins option.
14338 * configure: Regenerate.
14339 * config.in: Regenerate.
14340 * Makefile.am (LIBDL): New variable.
14341 (CCFILES): Add plugin.cc.
14342 (HFILES): Add plugin.h.
14343 (ldadd_var): Add LIBDL.
14344 * Makefile.in: Regenerate.
14345
14346 * archive.cc: Include "plugin.h".
14347 (Archive::setup): Don't preread archive symbols when using a plugin.
14348 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14349 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14350 files.
14351 (Archive::include_member): Add symbols from plugin objects.
14352 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14353 * descriptors.cc (Descriptors::open): Check for file descriptors
14354 abandoned by plugins.
14355 (Descriptors::claim_for_plugin): New function.
14356 * descriptors.h (Descriptors::claim_for_plugin): New function.
14357 (Open_descriptor::is_claimed): New field.
14358 (claim_descriptor_for_plugin): New function.
14359 * fileread.cc (File_read::claim_for_plugin): New function.
14360 * fileread.h (File_read::claim_for_plugin): New function.
14361 (File_read::descriptor): New function.
14362 * gold.cc: Include "plugin.h".
14363 (queue_initial_tasks): Add task to call plugin hooks for generating
14364 new object files.
14365 * main.cc: Include "plugin.h".
14366 (main): Load plugin libraries.
14367 * object.h (Pluginobj): Declare.
14368 (Object::pluginobj): New function.
14369 (Object::do_pluginobj): New function.
14370 (Object::set_target): New function.
14371 * options.cc: Include "plugin.h".
14372 (General_options::parse_plugin): New function.
14373 (General_options::General_options): Initialize plugins_ field.
14374 (General_options::add_plugin): New function.
14375 * options.h (Plugin_manager): Declare.
14376 (General_options): Add --plugin option.
14377 (General_options::has_plugins): New function.
14378 (General_options::plugins): New function.
14379 (General_options::add_plugin): New function.
14380 (General_options::plugins_): New field.
14381 * plugin.cc: New file.
14382 * plugin.h: New file.
14383 * readsyms.cc: Include "plugin.h".
14384 (Read_symbols::do_read_symbols): Check for archive before checking
14385 for ELF file. Call plugin hooks to claim files.
14386 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14387 from a real object file; force override when processing replacement
14388 files.
14389 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14390 (Symbol::init_base_object): Likewise.
14391 (Symbol::init_base_output_data): Likewise.
14392 (Symbol::init_base_output_segment): Likewise.
14393 (Symbol::init_base_constant): Likewise.
14394 (Symbol::init_base_undefined): Likewise.
14395 (Symbol::output_section): Assert that object is not a plugin.
14396 (Symbol_table::add_from_pluginobj): New function.
14397 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14398 undefined.
14399 (Symbol_table::sized_write_globals): Likewise.
14400 (Symbol_table::add_from_pluginobj): Instantiate template.
14401 * symtab.h (Sized_pluginobj): Declare.
14402 (Symbol::in_real_elf): New function.
14403 (Symbol::set_in_real_elf): New function.
14404 (Symbol::in_real_elf_): New field.
14405 (Symbol_table::add_from_pluginobj): New function.
14406
14407 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14408 (LIBDL): New variable.
14409 (LDADD): Add LIBDL.
14410 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14411 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14412 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14413 (MOSTLYCLEANFILES): Likewise.
14414 * testsuite/Makefile.in: Regenerate.
14415 * testsuite/plugin_test.c: New file.
14416 * testsuite/plugin_test_1.sh: New file.
14417 * testsuite/plugin_test_2.sh: New file.
14418
de31bda5
ILT
144192008-09-16 Ian Lance Taylor <iant@google.com>
14420
9c2d0ef9
ILT
14421 * target-reloc.h (relocate_section): Check whether a symbol is
14422 defined by the ABI before reporting an undefined symbol error.
14423 * target.h (Target::is_defined_by_abi): Make parameter const.
14424 (Target::do_is_defined_by_abi): Likewise.
14425 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14426 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14427 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14428 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14429 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14430 * testsuite/Makefile.in: Rebuild.
14431
de31bda5
ILT
14432 * fileread.cc (make_view): Add casts to avoid warning.
14433
9fa33bee
AO
144342008-09-16 Alexandre Oliva <aoliva@redhat.com>
14435
14436 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14437 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14438
183fd0e3
AO
144392008-09-16 Alexandre Oliva <aoliva@redhat.com>
14440
14441 * options.h (General_options::output_is_executable): New.
14442 (General_options::output_is_pie): New.
14443 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14444 for shared libraries.
14445 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14446
7be8330a
CD
144472008-09-11 Chris Demetriou <cgd@google.com>
14448
14449 * options.h (origin): New -z option.
14450 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14451 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14452 in DT_FLAGS_1.
14453
a9caad02
CC
144542008-09-05 Cary Coutant <ccoutant@google.com>
14455
14456 * fileread.cc (File_read::make_view): Add check for attempt to map
14457 beyond end of file.
14458
ae6dce4d
CC
144592008-09-05 Cary Coutant <ccoutant@google.com>
14460
14461 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14462 explicit instantiations.
14463
d7ab2a47
KVH
144642008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14465
14466 PR gold/6858
14467 * options.cc (General_options::finalize): Allow undefined symbols
14468 in shlibs if linking -shared.
14469
14470 PR gold/6859
14471 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14472 symbols as not needing a dynsym entry.
14473
1e52a9c1
CS
144742008-08-20 Craig Silverstein <csilvers@google.com>
14475
14476 * fileread.cc (File_read::open): Do not lock the file unless it
14477 was successfully opened.
14478
d85c80a3
CC
144792008-08-14 Cary Coutant <ccoutant@google.com>
14480
14481 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14482 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14483 * testsuite/tls_test.cc (struct int128): 128-bit struct
14484 for testing TLS relocs with non-zero addend.
14485 (v12): New TLS variable.
14486 (t12): New test.
14487 (t_last): Add check for v12.
14488 * testsuite/tls_test.h (t12): New function.
14489 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14490
2d924fd9
ILT
144912008-08-13 Ian Lance Taylor <iant@google.com>
14492
14493 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14494 set tls_segment_ or relro_segment_.
14495 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14496 when appropriate.
14497 * output.h (Output_section::clear_is_relro): New function.
14498 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14499 sections specially even when output_data_ is empty.
14500 (Output_segment::maximum_alignment): When first section is relro,
14501 only force alignment for PT_LOAD segments.
14502 * script.cc (script_data_segment_align): New function.
14503 (script_data_segment_relro_end): New function.
14504 * script-c.h (script_data_segment_align): Declare.
14505 (script_data_segment_relro_end): Declare.
14506 * script-sections.h (class Script_sections): Declare
14507 data_segment_align and data_segment_relro_end. Add fields
14508 segment_align_index_ and saw_relro_end_.
14509 * script-sections.cc (class Sections_element): Add set_is_relro
14510 virtual function. Add new bool* parameter to place_orphan_here.
14511 Add get_output_section virtual function.
14512 (class Output_section_definition): Add set_is_relro. Add new
14513 bool* parameter to place_orphan_here. Add get_output_section.
14514 Add is_relro_ field.
14515 (Output_section_definition::Output_section_definition): Initialize
14516 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14517 and is_relro_ fields.
14518 (Output_section_definition::place_orphan_here): Add is_relro
14519 parameter.
14520 (Output_section_definition::set_section_addresses): Set relro for
14521 output section.
14522 (Output_section_definition::alternate_constraint): Likewise.
14523 (class Orphan_output_section): Add new bool* parameter to
14524 place_orphan_here. Add get_output_section.
14525 (Orphan_output_section::place_orphan_here): Add is_relro
14526 parameter.
14527 (Script_sections::Script_sections): Initialize
14528 data_segment_align_index_ and saw_relro_end_.
14529 (Script_sections::data_segment_align): New function.
14530 (Script_sections::data_segment_relro_end): New function.
14531 (Script_sections::place_orphan): Set or clear is_relro.
14532 (Script_sections::set_section_addresses): Force alignment of first
14533 TLS section.
14534 * yyscript.y (exp): Call script_data_segment_align and
14535 script_data_segment_relro_end.
14536 * testsuite/relro_script_test.t: New file.
14537 * testsuite/relro_test.cc (using_script): Declare.
14538 (t1, t2): Test using_script.
14539 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14540 (relro_script_test_SOURCES): Define.
14541 (relro_script_test_DEPENDENCIES): Define.
14542 (relro_script_test_LDFLAGS): Define.
14543 (relro_script_test_LDADD): Define.
14544 (relro_script_test.so): New target.
14545 * testsuite/Makefile.in: Rebuild.
14546
f827c9a9
CC
145472008-08-06 Cary Coutant <ccoutant@google.com>
14548
14549 * archive.cc (Archive::total_archives, Archive::total_members)
14550 (Archive::total_members_loaded): New variables.
14551 (Archive::setup): Add parameter. Add option to preread
14552 archive symbols.
14553 (Archive::read_armap): Add counter.
14554 (Archive::get_file_and_offset): New function.
14555 (Archive::get_elf_object_for_member): New function.
14556 (Archive::read_all_symbols): New function.
14557 (Archive::read_symbols): New function.
14558 (Archive::add_symbols): Add counters.
14559 (Archive::include_all_members): Use armap to find members if it's
14560 already built.
14561 (Archive::include_member): Skip reading symbols if already read.
14562 Factored code into Archive::get_file_and_offset and
14563 Archive::get_elf_object_for_member. Changed call to
14564 Mapfile::report_include_archive_member.
14565 (Archive::print_stats): New function.
14566 * archive.h: Declare Object and Read_symbols_data classes.
14567 (Archive::Archive): Add initializers for new members.
14568 (Archive::setup): Add parameter.
14569 (Archive::print_stats): New function.
14570 (Archive::total_archives, Archive::total_members)
14571 (Archive::total_members_loaded): New variables.
14572 (Archive::get_file_and_offset): New function.
14573 (Archive::get_elf_object_for_member): New function.
14574 (Archive::read_all_symbols): New function.
14575 (Archive::read_symbols): New function.
14576 (Archive::Archive_member): New class.
14577 (Archive::members_): New member.
14578 (Archive::num_members_): New member.
14579 * main.cc: Include archive.h.
14580 (main): Call Archive::print_stats.
14581 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14582 archive parameter; member_name is now the fully-decorated name.
14583 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14584 * options.h: (General_options): Add --preread-archive-symbols option.
14585 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14586 Archive::setup.
14587
de4c45bd
ILT
145882008-08-04 Ian Lance Taylor <iant@google.com>
14589
14590 * symtab.h (Symbol::use_plt_offset): New function.
14591 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14592 * powerpc.cc (Relocate::relocate): Likewise.
14593 * sparc.cc (Relocate::relocate): Likewise.
14594 * x86_64.cc (Relocate::relocate): Likewise.
14595 * testsuite/weak_plt.sh: New test.
14596 * testsuite/weak_plt_main.cc: New test.
14597 * testsuite/weak_plt_shared.cc: New test.
14598 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14599 (check_PROGRAMS): Add weak_plt.
14600 (check_DATA): Add weak_plt_shared.so.
14601 (weak_plt_main_pic.o, weak_plt): New targets.
14602 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14603 * testsuite/Makefile.in: Rebuild.
14604
14605 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14606 gcctestdir/ld.
14607 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14608 * testsuite/Makefile.in: Rebuild.
14609
323ee3f4
AM
146102008-08-04 Alan Modra <amodra@bigpond.net.au>
14611
14612 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14613 * Makefile.in: Regenerate.
14614 * po/POTFILES.in: Regenerate.
14615
7c07ecec
ILT
146162008-07-29 Ian Lance Taylor <iant@google.com>
14617
14618 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14619 symbols before other symbols.
14620 * testsuite/script_test_2.cc (test_addr): Declare.
14621 (test_addr_alias): Declare.
14622 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14623 values.
7c07ecec
ILT
14624 * testsuite/script_test_2.t: Define test_addr_alias and
14625 test_addr.
14626
5778530e
ILT
146272008-07-24 Ian Lance Taylor <iant@google.com>
14628
2a00e4fb
ILT
14629 PR 5990
14630 * descriptors.cc: New file.
14631 * descriptors.h: New file.
14632 * gold-threads.h (class Hold_optional_lock): New class.
14633 * fileread.cc: Include "descriptors.h".
14634 (File_read::~File_read): Release descriptor rather than closing
14635 it.
14636 (File_read::open) [file]: Call open_descriptor rather than open.
14637 Set is_descriptor_opened_.
14638 (File_read::open) [memory]: Assert that descriptor is not open.
14639 (File_read::reopen_descriptor): New function.
14640 (File_read::release): Release descriptor.
14641 (File_read::do_read): Make non-const. Reopen descriptor.
14642 (File_read::read): Make non-const.
14643 (File_read::make_view): Reopen descriptor.
14644 (File_read::do_readv): Likewise.
14645 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14646 Update declarations.
14647 * layout.cc: Include "descriptors.h".
14648 (Layout::create_build_id): Use open_descriptor rather than open.
14649 * output.cc: Include "descriptors.h".
14650 (Output_file::open): Use open_descriptor rather than open.
14651 * archive.cc (Archive::const_iterator): Change Archive to be
14652 non-const.
14653 (Archive::begin, Archive::end): Make non-const.
14654 (Archive::count_members): Likewise.
14655 * archive.h (class Archive): Update declarations.
14656 * object.h (Object::read): Make non-const.
14657 * Makefile.am (CCFILES): Add descriptors.cc.
14658 (HFILES): Add descriptors.h.
14659 * Makefile.in: Rebuild.
14660
801647d1
ILT
14661 PR 6716
14662 * gold.h: Always include <clocale>. Add Solaris workarounds
14663 following code in binutils/sysdep.h.
14664
5edd166e
ILT
14665 PR 6048
14666 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14667 this->eh_frame_hdr_ is NULL before using it.
14668
c89ad728
ILT
14669 * dynobj.cc (Versions::Versions): Update comment.
14670
aa86f06b
ILT
14671 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14672 the base version name.
14673
5778530e
ILT
14674 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14675 array size plus one.
14676 (Stringpool_template::set_string_offsets): Subtract one from key
14677 before using it as an array index.
14678 (Stringpool_template::get_offset_with_length): Likewise.
14679 (Stringpool_template::write_to_buffer): Likewise.
14680 * stringpool.h (Stringpool_template::get_offset_from_key):
14681 Likewise.
14682
057ead22
ILT
146832008-07-23 Ian Lance Taylor <iant@google.com>
14684
7f649c59
ILT
14685 PR 6658
14686 * object.h (Merged_symbol_value::value): Do our best to handle a
14687 negative addend.
14688
057ead22
ILT
14689 PR 6647
14690 * script.cc (Version_script_info::get_versions): Don't add empty
14691 version tag to return value.
14692 (Version_script_info::get_symbol_version_helper): Change return
14693 type to bool. Add pversion parameter. Change all callers.
14694 (script_register_vers_node): Don't require a non-NULL tag.
14695 * script.h (class Version_script_info): Update declarations.
14696 (Version_script_info::get_symbol_version): Change return type to
14697 bool. Add version parameter. Change all callers.
14698 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14699 handling. Handle an empty version from a version script.
14700 (Symbol_table::define_special_symbol): Likewise.
14701 * testsuite/ver_test_10.script: New file.
14702 * testsuite/ver_test_10.sh: New file.
14703 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14704 (check_DATA): Add ver_test_10.syms.
14705 (ver_test_10.syms, ver_test_10.so): New target.
14706 * testsuite/Makefile.in: Rebuild.
14707
58e54ac2
CD
147082008-07-23 Simon Baldwin <simonb@google.com>
14709
14710 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14711 to zero for undefined symbols from dynamic libraries.
14712
95d14cd3
ILT
147132008-07-23 Ian Lance Taylor <iant@google.com>
14714
14715 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14716 Change all callers.
14717 * symtab.h (class Symbol_table): Update declaration.
14718 * testsuite/ver_test_9.cc: New file.
14719 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14720 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14721 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14722 (ver_test_9.so, ver_test_9.o): New targets.
14723 * testsuite/Makefile.in: Rebuild.
14724
92de84a6
ILT
147252008-07-22 Ian Lance Taylor <iant@google.com>
14726
34810851
ILT
14727 * options.h (class General_options): Define --check-sections.
14728 * layout.cc (Layout::set_segment_offsets): Handle
14729 --check-sections.
14730
af6156ef
ILT
14731 * options.h (class General_options): Define -n/--nmagic and
14732 -N/--omagic.
14733 * options.cc (General_options::finalize): For -n/--nmagic or
14734 -N/--omagic, set -static.
14735 * layout.cc (Layout::attach_allocated_section_to_segment): If
14736 -N/--omagic, don't put read-only and read-write sections in
14737 different segments.
14738 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14739 finding a read-only segment.
14740 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14741 don't set the minimum segment alignment to the common page size,
14742 and don't set the file offset to the address modulo the page size.
14743 * script-sections.cc (Script_sections::create_segments): If
14744 -n/--omagic, don't put read-only and read-write sections in
14745 different segments.
14746
92de84a6
ILT
14747 * cref.cc: New file.
14748 * cref.h: New file.
14749 * options.h (class General_options): Add --print-symbol-counts.
14750 * main.cc (main): Issue defined symbol report if requested.
14751 * archive.cc (Archive::interpret_header): Make into a const member
14752 function.
14753 (Archive::add_symbols): Call Input_objects::archive_start and
14754 archive_stop.
14755 (Archive::const_iterator): Define new class.
14756 (Archive::begin, Archive::end): New functions.
14757 (Archive::include_all_members): Rewrite to use iterator.
14758 (Archive::count_members): New function.
14759 * archive.h (class Archive): Update declarations.
14760 (Archive::filename): New function.
14761 * object.cc: Include "cref.h".
14762 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14763 (Sized_relobj::do_get_global_symbol_counts): New function.
14764 (Input_objects::add_object): Add object to cross-referencer.
14765 (Input_objects::archive_start): New function.
14766 (Input_objects::archive_stop): New function.
14767 (Input_objects::print_symbol_counts): New function.
14768 * object.h: Declare Cref and Archive.
14769 (Object::get_global_symbol_counts): New function.
14770 (Object::do_get_global_symbol_counts): New pure virtual function.
14771 (class Sized_relobj): Add defined_count_ field. Update
14772 declarations.
14773 (class Input_objects): Add cref_ field. Update constructor.
14774 Update declarations.
14775 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14776 defined_count_.
14777 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14778 symbol counts.
14779 (Sized_dynobj::do_get_global_symbol_counts): New function.
14780 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14781 defined_count_. Update declarations. Define Symbols typedef.
14782 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14783 parameter. Change all callers.
14784 (Symbol_table::add_from_dynobj): Add sympointers and defined
14785 parameters. Change all callers.
14786 * symtab.h (class Symbol_table): Update declarations.
14787 * Makefile.am (CCFILES): Add cref.cc.
14788 (HFILES): Add cref.h.
14789 * Makefile.in: Rebuild.
14790
3f7c5e1d
CD
147912008-07-22 Simon Baldwin <simonb@google.com>
14792
14793 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14794 to zero when writing undefined symbols.
14795
e0b64032
ILT
147962008-07-22 Ian Lance Taylor <iant@google.com>
14797
14798 * output.cc (Output_section::add_input_section): Don't try to
14799 merge empty merge sections.
14800
096b02cf
CS
148012008-07-21 Craig Silverstein <csilvers@google.com>
14802
14803 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14804 Include symbol version in error message.
cd536b21 14805
1d1f116d
CD
148062008-07-20 Chris Demetriou <cgd@google.com>
14807
cd536b21 14808 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14809 (RANDOM_SEED_CFLAGS): New substituted variable.
14810 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14811 * configure: Rebuild.
14812 * Makefile.in: Likewise.
14813 * testsuite/Makefile.in: Likewise.
14814
a18f591e
ILT
148152008-07-18 Ian Lance Taylor <iant@google.com>
14816
14817 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14818 where we see NAME/NULL and NAME/VERSION as separate symbols.
14819 * testsuite/ver_test_main.cc (main): Call t4.
14820 (t4, t4_2a): Define.
14821 * testsuite/ver_test_2.cc (t4_2): Define.
14822 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14823 * testsuite/ver_test_4.cc (t4_2a): Define.
14824 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14825 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14826
c6e3f6ed
ILT
148272008-07-17 Ian Lance Taylor <iant@google.com>
14828
14829 * dynobj.cc (Versions::add_def): If we give an error about a
14830 missing version, go ahead and create the version anyhow.
14831
ef9beddf
ILT
148322008-07-10 Ian Lance Taylor <iant@google.com>
14833
14834 Handle output sections with more than 0x7fffffff bytes.
14835 * object.h (class Relobj): Change map_to_output_ to
14836 output_sections_, and just keep a section pointer. Change all
14837 uses. Move comdat group support to Sized_relobj.
14838 (Relobj::is_section_specially_mapped): Remove.
14839 (Relobj::output_section): Remove poff parameter. Change all
14840 callers.
14841 (Relobj::output_section_offset): New function.
14842 (Relobj::set_section_offset): Rewrite.
14843 (Relobj::map_to_output): Remove.
14844 (Relobj::output_sections): New function.
14845 (Relobj::do_output_section_offset): New pure virtual function.
14846 (Relobj::do_set_section_offset): Likewise.
14847 (class Sized_relobj): Add section_offsets_ field. Add comdat
14848 group support from Relobj. Update declarations.
14849 (Sized_relobj::get_output_section_offset): New function.
14850 (Sized_relobj::do_output_section_offset): New function.
14851 (Sized_relobj::do_set_section_offset): New function.
14852 * object.cc (Relobj::output_section_address): Remove.
14853 (Sized_relobj::Sized_relobj): Initialize new fields.
14854 (Sized_relobj::include_section_group): Cast find_kept_object to
14855 Sized_relobj.
14856 (Sized_relobj::include_linkonce_section): Likewise.
14857 (Sized_relobj::do_layout): Use separate arrays for output section
14858 and output offset.
14859 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14860 output_sections.
14861 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14862 output_sections and section_offsets.
14863 (Sized_relobj::write_local_symbols): Likewise.
14864 (map_to_kept_section): Compute output address directly.
14865 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14866 output_sections and section_offsets.
14867 (Sized_relobj::write_sections): Likewise.
14868 (Sized_relobj::relocate_sections): Likewise.
14869 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14870 * output.h (class Output_reloc): Update declarations. Change
14871 u2_.relobj to Sized_relobj*.
14872 (class Output_data_reloc): Change add functions to use
14873 Sized_relobj*.
14874 * output.cc (Output_reloc::Output_reloc): Change relobj to
14875 Sized_relobj*.
14876 (Output_reloc::local_section_offset): Change return type to
14877 Elf_Addr. Use get_output_section_offset.
14878 (Output_reloc::get_address): Likewise.
14879 (Output_section::is_input_address_mapped): Don't call
14880 is_section_specially_mapped.
14881 (Output_section::output_offset): Likewise.
14882 (Output_section::output_address): Likewise.
14883 (Output_section::starting_output_address): Likewise.
14884 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14885 parameter to Sized_relobj*.
14886 (Copy_relocs::need_copy_reloc): Likewise.
14887 (Copy_relocs::save): Likewise.
14888 * copy-relocs.h (class Copy_relocs): Update declarations.
14889 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14890 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14891 * target-reloc.h (relocate_for_relocatable): Change
14892 offset_in_output_section type to Elf_Addr. Change code that uses
14893 it as well.
14894 * layout.cc (Layout::layout): Always set *off.
14895 * mapfile.cc (Mapfile::print_input_section): Use
14896 output_section_offset.
14897 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14898 Sized_relobj*.
14899 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14900 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14901 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14902
5cb66f97
ILT
149032008-07-03 Ian Lance Taylor <iant@google.com>
14904
14905 * layout.cc (Layout::include_section): Do not discard unrecognized
14906 SHT_STRTAB sections.
14907
afe47622
CS
149082008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14909
14910 * script.cc (Lex::can_continue_name): Make '?' allowable in
14911 version-script names.
14912 * testsuite/version_script.map: Change glob pattern to use '?'
14913
5adf9721
ILT
149142008-06-30 Manish Singh <yosh@gimp.org>
14915
14916 PR 6585
14917 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14918 Correct typo.
14919
e6fde208
ILT
149202008-06-30 Ian Lance Taylor <iant@google.com>
14921
14922 PR 6660
14923 PR 6682
14924 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14925 versions]: Don't try to read the value in the contents, since we
14926 don't use it. Use the template endianness when writing.
14927
3f2e6a2d
CC
149282008-06-25 Cary Coutant <ccoutant@google.com>
14929
14930 * fileread.cc (File_read::make_view): Assert on zero-length view.
14931 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14932 symbol table when there are no symbols to read.
14933
c43d3a48
CS
149342008-06-23 Craig Silverstein <csilvers@google.com>
14935
14936 * version.cc (version_string): Bump to 1.7
14937
5f494ea0
CS
149382008-06-18 Craig Silverstein <csilvers@google.com>
14939
14940 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14941 constant 0xFFFF to type Valtype.
14942 (Powerpc_relocate_functions::rel16_ha): Likewise.
14943
c42e122e
ILT
149442008-06-17 Ian Lance Taylor <iant@google.com>
14945
f34787f8
ILT
14946 * output.h (Output_section::Input_section): Initialize p2align_ to
14947 zero for Output_section_data constructors.
14948 (Output_section::Input_section::addralign): If not an input
14949 section, return the alignment of the Output_section_data.
14950 * testsuite/copy_test.cc: New file.
14951 * testsuite/copy_test_1.cc: New file.
14952 * testsuite/copy_test_2.cc: New file.
14953 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14954 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14955 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14956 (copy_test_1_pic.o, copy_test_1.so): New targets.
14957 (copy_test_2_pic.o, copy_test_2.so): New targets.
14958 * testsuite/Makefile.in: Rebuild.
14959
c42e122e
ILT
14960 * script-sections.cc (Script_sections::place_orphan): Initialize
14961 local variable exact.
14962
ce3ac18a
DE
149632008-06-13 David Edelsohn <edelsohn@gnu.org>
14964
14965 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14966
42cacb20
DE
149672008-06-12 David Edelsohn <edelsohn@gnu.org>
14968 David S. Miller <davem@davemloft.net>
14969
14970 * powerpc.cc: New file.
14971 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14972 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14973 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14974 * Makefile.in: Rebuild.
14975
7b308235
ILT
149762008-06-09 Ian Lance Taylor <iant@google.com>
14977
14978 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14979 <exception>.
14980 (throwing, orig_terminate): New static variables.
14981 (terminate_handler): New static function.
14982 (t2): Set terminate handler.
14983
f0b886e3
ILT
149842008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14985
14986 PR 6584
cd536b21 14987 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14988 alignment.
14989
3e90f135
CC
149902008-05-30 Cary Coutant <ccoutant@google.com>
14991
14992 * archive.cc (Archive::include_all_members) Correct to step
14993 over symbol table and extended name table in thin archives.
14994
e09ad04a
ILT
149952008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14996
14997 PR 6407
14998 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14999 calculation.
15000
62b01cb5
ILT
150012008-05-28 Caleb Howe <cshowe@google.com>
15002
15003 * reduced_debug_output.cc: New file.
15004 * reduced_debug_output.h: New file.
92de84a6 15005 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15006 * options.cc (General_options::finalize): Add strip_debug_non_line
15007 to the strip heirarchy.
15008 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15009 fields.
15010 * layout.cc: Include "reduced_debug_output.h".
15011 (Layout::Layout): Initialize new fields.
15012 (line_only_debug_sections): New static array.
15013 (is_lines_only_debug_sections): New static inline function.
15014 (Layout::include_section): Handle --strip-debug-non-line.
15015 (Layout::make_output_section): If --strip-debug-non-line, build
15016 new output sections for .debug_abbrev and .debug_info.
15017 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15018 gold. Warn about possible overflow.
15019 (read_signed_LEB_128): Likewise.
15020 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15021 (read_signed_LEB_128): Declare.
15022 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15023 (HFILES): Add reduced_debug_output.h.
15024 * Makefile.in: Rebuild.
15025
7d9e3d98
ILT
150262008-05-21 Ian Lance Taylor <iant@google.com>
15027
15028 * mapfile.cc: New file.
15029 * mapfile.h: New file.
15030 * options.h (class General_options): Add -M/--print-map and -Map.
15031 * options.cc (General_options::finalize): Make -M equivalent to
15032 -Map -.
15033 * main.cc: Include <cstdio> and "mapfile.h".
15034 (main): Open mapfile if requested.
15035 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15036 constructor. Change caller.
15037 (queue_initial_tasks): Add mapfile parameter. Change caller.
15038 (queue_middle_tasks): Likewise.
15039 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15040 declarations.
15041 * archive.cc: Include "mapfile.h".
15042 (Archive::add_symbols): Add mapfile parameter. Change all
15043 callers. Pass mapfile, symbol, and reason to include_member.
15044 (Archive::include_all_members): Add mapfile parameter. Change all
15045 callers.
15046 (Archive::include_member): Add mapfile, sym, and why parameters.
15047 Change all callers. Report inclusion to map file.
15048 * archive.h: Include "fileread.h".
15049 (class Archive): Update declarations.
15050 (Archive::file): New const method.
15051 (class Add_archive_symbols): Add mapfile_ field. Update
15052 constructor. Change all callers.
15053 * readsyms.h (class Read_symbols): Likewise.
15054 (class Finish_group): Likewise.
15055 (class Read_script): Likewise.
15056 * common.cc: Include "mapfile.h".
15057 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15058 all callers.
15059 (Symbol_table::do_allocate_commons): Likewise.
15060 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15061 symbol allocation to mapfile.
15062 * common.h (class Allocate_commons_task): Add mapfile_ field.
15063 Update constructor. Change all callers.
15064 * symtab.h (class Symbol_table): Update declarations.
15065 * layout.cc: Include "mapfile.h".
15066 (Layout_task_runner::run): Print information to mapfile.
15067 (Layout::create_gold_note): Change Output_data_fixed_space to
15068 Output_data_zero_fill.
15069 (Layout::create_build_id): Likewise.
15070 (Layout::print_to_mapfile): New function.
15071 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15072 constructor. Change caller.
15073 (class Layout): Declare print_to_mapfile.
15074 * output.cc (Output_section::Input_section::print_to_mapfile): New
15075 function.
15076 (Output_section::add_input_section): If producing a map, always
15077 add to input_sections_ list.
15078 (Output_section::do_print_to_mapfile): New function.
15079 (Output_segment::print_sections_to_mapfile): New function.
15080 (Output_segment::print_section_list_to_mapfile): New function.
15081 * output.h: Include "mapfile.h".
15082 (Output_data::print_to_mapfile): New function.
15083 (Output_data::do_print_to_mapfile): New virtual function.
15084 (Output_segment_headers::do_print_to_mapfile): New function.
15085 (Output_file_header::do_print_to_mapfile): New function.
15086 (Output_data_const::do_print_to_mapfile): New function.
15087 (class Output_data_const_buffer): Add map_name_ field. Update
15088 constructor. Change all callers. Add do_print_to_mapfile
15089 function.
15090 (class Output_data_fixed_space): Likewise.
15091 (class Output_data_space): Likewise.
15092 (class Output_data_zero_fill): New class.
15093 (Output_data_strtab::do_print_to_mapfile): New function.
15094 (Output_data_reloc_base::do_print_to_mapfile): New function.
15095 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15096 (Output_data_group::do_print_to_mapfile): New function.
15097 (Output_data_got::do_print_to_mapfile): New function.
15098 (Output_data_dynamic::do_print_to_mapfile): New function.
15099 (Output_symtab_xindex::do_print_to_mapfile): New function.
15100 (class Output_section): Declare do_print_to_mapflie. Declare
15101 print_to_mapfile in Input_section.
15102 (class Output_segment): Declare new functions.
15103 * object.h (Sized_relobj::symbol_count): New function.
15104 * script-sections.cc
15105 (Output_section_element_dot_assignment::set_section_addresses):
15106 Change Output_data_fixed_space to Output_data_zero_fill.
15107 (Output_data_expression::do_print_to_mapfile): New function.
15108 * script.cc (read_input_script): Add mapfile parameter. Change
15109 all callers.
15110 * script.h (read_input_script): Update declaration.
15111 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15112 (Eh_frame::do_print_to_mapfile): New function.
15113 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15114 (Output_merge_string::do_print_to_mapfile): New function.
15115 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15116 function.
15117 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15118 function.
15119 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15120 function.
15121 * Makefile.am (CCFILES): Add mapfile.cc.
15122 (HFILES): Add mapfile.h.
15123 * Makefile.in: Rebuild.
15124
9f1d377b
ILT
151252008-05-19 Ian Lance Taylor <iant@google.com>
15126
15127 * options.h (class General_options): Add -z relro.
15128 * layout.cc (Layout::Layout): Initialize relro_segment_.
15129 (Layout::add_output_section_data): Return the output section.
15130 (Layout::make_output_section): Rcognize relro sections and mark
15131 them appropriately.
15132 (Layout::attach_allocated_section_to_segment): Put relro sections
15133 in a PT_GNU_RELRO segment.
15134 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15135 section as relro.
15136 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15137 PT_TLS segments.
15138 (Layout::linkonce_mapping): Map d.rel.ro.local to
15139 .data.rel.ro.local.
15140 (Layout::output_section_name): Us .data.rel.ro.local for any
15141 section which begins with that.
15142 * layout.h (class Layout): Update add_output_section_data
15143 declaration. Add relro_segment_ field.
15144 * output.cc (Output_section::Output_section): Initialize is_relro_
15145 and is_relro_local_ fields.
15146 (Output_segment::add_output_section): Group relro sections.
15147 (Output_segment::is_first_section_relro): New function.
15148 (Output_segment::maximum_alignment): If there is a relro section,
15149 align the segment to the common page size.
15150 (Output_segment::set_section_addresses): Track whether we are
15151 looking at relro sections. If the last section is a relro
15152 section, align to the common page size.
15153 (Output_segment::set_section_list_addresses): Add in_relro
15154 parameter. Change all callers. Align to the page size when
15155 moving from relro to non-relro section.
15156 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15157 segment.
15158 * output.h (class Output_section): Add is_relro_ and
15159 is_relro_local_ fields.
15160 (Output_section::is_relro): New function.
15161 (Output_section::set_is_relro): New function.
15162 (Output_section::is_relro_local): New function.
15163 (Output_section::set_is_relro_local): New function.
15164 (class Output_segment): Update declarations.
15165 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15166 * sparc.cc (Target_sparc::got_section): Likewise.
15167 * x86_64.cc (Target_x86_64::got_section): Likewise.
15168 * testsuite/relro_test_main.cc: New file.
15169 * testsuite/relro_test.cc: New file.
15170 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15171 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15172 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15173 (relro_test.so, relro_test_pic.o): New targets.
15174 * testsuite/Makefile.in: Rebuild.
15175
a984ee1d
ILT
151762008-05-16 Ian Lance Taylor <iant@google.com>
15177
01676dcd
ILT
15178 * output.cc (Output_segment::add_output_section): Remove front
15179 parameter.
15180 * output.h (class Output_segment): Remove
15181 add_initial_output_section and overloaded add_output_section.
15182 Update declaration of remaining add_output_section.
15183 * layout.cc (Layout::create_interp): Call add_output_section
15184 rather than add_initial_output_section.
15185 (Layout::finish_dynamic_section): Likewise.
15186
497897f9
ILT
15187 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15188 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15189 know the dynamic type.
15190 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15191 field. Initialize it in constructor.
15192 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15193 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15194 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15195 reloc.
15196
a984ee1d
ILT
15197 * output.cc (Output_reloc::get_address): Change return type to
15198 Elf_Addr.
15199 * output.h (class Output_reloc): Update get_address declaration.
15200 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15201 for section addresses.
15202
55ba0940
ILT
152032008-05-09 Ian Lance Taylor <iant@google.com>
15204
15205 PR 6493
15206 * gold.cc (gold_nomem): Use return value of write.
15207
75517b77
ILT
152082008-05-08 Ian Lance Taylor <iant@google.com>
15209
15210 * symtab.c (Symbol::init_base_output_data): Add version
15211 parameter. Change all callers.
15212 (Symbol::init_base_output_segment): Likewise.
15213 (Symbol::init_base_constant): Likewise.
15214 (Symbol::init_base_undefined): Likewise.
15215 (Sized_symbol::init_output_data): Likewise.
15216 (Sized_symbol::init_output_segment): Likewise.
15217 (Sized_symbol::init_constant): Likewise.
15218 (Sized_symbol::init_undefined): Likewise.
15219 (Symbol_table::do_define_in_output_data): If the new symbol has a
15220 version, mark it as the default.
15221 (Symbol_table::do_define_in_output_segment): Likewise.
15222 (Symbol_table::do_define_as_constant): Likewise.
15223 * symtab.h (class Symbol): Update declarations.
15224 (class Sized_symbol): Likewise.
15225 * resolve.cc (Symbol::override_version): New function.
c42e122e 15226 (Symbol::override_base): Call override_version.
75517b77
ILT
15227 (Symbol::override_base_with_special): Likewise.
15228 * testsuite/ver_script_8.script: New file.
15229 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15230 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15231 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15232 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15233
f1f70eae
ILT
152342008-05-06 Ian Lance Taylor <iant@google.com>
15235
f3e9c5c5
ILT
15236 PR 6049
15237 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15238 functions.
15239 (class General_options): Remove existing --undefined, and add
15240 --no-undefined instead. Add new --undefined as synonym for -u.
15241 * archive.cc (Archive::add_symbols): Check whether symbol was
15242 named with -u.
15243 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15244 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15245 all uses. Add IS_UNDEFINED. Update declarations to split
15246 different versions of init_base. Declare init_base_undefined.
15247 (Symbol::is_defined): Handle IS_UNDEFINED.
15248 (Symbol::is_undefined): Likewise.
15249 (Symbol::is_weak_undefined): Call is_undefined.
15250 (Symbol::is_absolute): Handle IS_CONSTANT.
15251 (class Sized_symbol): Update declarations to split different
15252 versions of init. Declare init_undefined.
15253 (class Symbol_table): Declare new functions.
15254 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15255 Change all callers.
15256 (Symbol::init_base_output_data): Likewise.
15257 (Symbol::init_base_output_segment): Likewise.
15258 (Symbol::init_base_constant): Likewise.
15259 (Symbol::init_base_undefined): New function.
15260 (Sized_symbol::init_object): Rename from init. Change all
15261 callers.
15262 (Sized_symbol::init_output_data): Likewise.
15263 (Sized_symbol::init_output_segment): Likewise.
15264 (Sized_symbol::init_constant): Likewise.
15265 (Sized_symbol::init_undefined): New function.
15266 (Symbol_table::add_undefined_symbols_from_command_line): New
15267 function.
15268 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15269 function.
15270 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15271 (Symbol::output_section): Likewise.
15272 (Symbol::set_output_section): Likewise.
15273 (Symbol_table::sized_finalize_symbol): Likewise.
15274 (Symbol_table::sized_write_globals): Likewise.
15275 * resolve.cc (Symbol_table::should_override): Likewise.
15276 (Symbol::override_base_with_special): Likewise.
15277
8bdcdf2c
ILT
15278 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15279 symbol, change it to have default visibility.
15280 * testsuite/protected_1.cc: New file.
15281 * testsuite/protected_2.cc: New file.
15282 * testsuite/protected_3.cc: New file.
15283 * testsuite/protected_main_1.cc: New file.
15284 * testsuite/protected_main_2.cc: New file.
15285 * testsuite/protected_main_3.cc: New file.
15286 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15287 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15288 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15289 (protected_1.so): New target.
15290 (protected_1_pic.o, protected_2_pic.o): New targets.
15291 (protected_3_pic.o): New target.
15292 (check_PROGRAMS): Add protected_2.
15293 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15294 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15295 * testsuite/Makefile.in: Rebuild.
15296
2b706932
ILT
15297 * options.h (DEFINE_var): Add set_user_set_##varname__.
15298 (DEFINE_bool_alias): New macro.
15299 (class General_options): Define -Bstatic using DEFINE_bool_alias
15300 rather than DEFINE_special. Add --undefined as an alias for -z
15301 defs.
15302 * options.cc (General_options::parse_Bstatic): Remove.
15303
d82a5bcc
ILT
15304 * options.h (class General_options): Add --fatal-warnings.
15305 * main.cc (main): Implement --fatal-warnings.
15306 * errors.h (Errors::warning_count): New function.
15307
f1f70eae
ILT
15308 * options.h (class General_options): Add -Bsymbolic-functions.
15309 * symtab.h (Symbol::is_preemptible): Check for
15310 -Bsymbolic-functions.
15311
8825ac63
ILT
153122008-05-05 Ian Lance Taylor <iant@google.com>
15313
d98bc257
ILT
15314 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15315 as noVARNAME rather than no-VARNAME.
15316 (class General_options): Add option -z combreloc.
15317 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15318 get_address.
15319 (Output_reloc::sort_before) [SHT_REL]: New function.
15320 (Output_reloc::sort_before) [SHT_RELA]: New function.
15321 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15322 Sort_relocs_comparison.
15323 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15324 parameter. Change all callers.
15325 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15326 sort_relocs parameter. Change all callers.
15327 * output.cc (Output_reloc::get_address): New function, broken out
15328 of write_rel.
15329 (Output_reloc::write_rel): Call it.
15330 (Output_reloc::compare): New function.
15331 (Output_data_reloc_base::do_write): Optionally sort relocs.
15332
60b2b4e7
ILT
15333 * configure.ac: If targ_extra_obj is set, link it in.
15334 * configure.tgt: Initialize all variables.
15335 (x86_64*): Set targ_extra_obj and targ_extra_size.
15336 * configure: Rebuild.
15337
8825ac63
ILT
15338 * object.cc (Sized_relobj::include_section_group): Adjust section
15339 indexes read from group data. Build vector to pass to
15340 layout_group.
15341 * layout.cc (Layout::layout_group): Add flags and shndxes
15342 parameters. Remove contents parameter. Change caller. Update
15343 explicit instantiations.
15344 * layout.h (class Layout): Update layout_group declaration.
15345 * output.cc (Output_data_group::Output_data_group): Add flags and
15346 input_shndxes parameters. Remove contents parameter. Change
15347 caller.
15348 (Output_data_group::do_write): Change input_sections_ to
15349 input_shndxes_.
15350 * output.h (class Output_data_group): Update constructor
15351 declaration. Rename input_sections_ to input_shndxes_.
15352 * testsuite/many_sections_test.cc: Add template.
15353
e94cf127
CC
153542008-04-30 Cary Coutant <ccoutant@google.com>
15355
4418b2d5
CC
15356 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15357
e94cf127
CC
15358 * layout.cc (Layout::include_section): Refactored check for debug
15359 info section.
15360 (Layout::add_comdat): Add new parameters. Change type
15361 of signature parameter. Add object and shndx to signatures table.
15362 (Layout::find_kept_object): New function.
15363 * layout.h: Include <cstring>.
15364 (Layout::is_debug_info_section): New function.
15365 (Layout::add_comdat): Add new parameters.
15366 (Layout::find_kept_object): New function.
15367 (Layout::Kept_section): New struct.
15368 (Layout::Signatures): Change type of map range.
15369 * object.cc (Relobj::output_section_address): New function.
15370 (Sized_relobj::include_section_group): Add new parameters. Change
15371 calls to Layout::add_comdat. Change to build table of kept comdat
15372 groups and table mapping discarded sections to kept sections.
15373 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15374 (Sized_relobj::do_layout): Change calls to include_section_group and
15375 include_linkonce_section.
15376 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15377 value to zero when section is discarded.
15378 (Sized_relobj::map_to_kept_section): New function.
15379 * object.h (Relobj::output_section_address): New function.
15380 (Relobj::Comdat_group): New type.
15381 (Relobj::find_comdat_group): New function.
15382 (Relobj::Comdat_group_table): New type.
15383 (Relobj::Kept_comdat_section): New type.
15384 (Relobj::Kept_comdat_section_table): New type.
15385 (Relobj::add_comdat_group): New function.
15386 (Relobj::set_kept_comdat_section): New function.
15387 (Relobj::get_kept_comdat_section): New function.
15388 (Relobj::comdat_groups_): New field.
15389 (Relobj::kept_comdat_sections_): New field.
15390 (Symbol_value::input_value): Update comment.
15391 (Sized_relobj::map_to_kept_section) New function.
15392 (Sized_relobj::include_linkonce_section): Add new parameter.
15393 * target-reloc.h (Comdat_behavior): New type.
15394 (get_comdat_behavior): New function.
15395 (relocate_section): Add code to map a discarded section to the
15396 corresponding kept section when applying a relocation.
15397
e4e5049b
CS
153982008-04-30 Craig Silverstein <csilvers@google.com>
15399
15400 * dwarf_reader.cc (next_generation_count): New static var.
15401 (Addr2line_cache_entry): New struct.
15402 (addr2line_cache): New static var.
15403 (Dwarf_line_info::one_addr2line): Added caching.
15404 (Dwarf_line_info::clear_addr2line_cache): New function.
15405 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15406 cache-size parameter.
15407 (Dwarf_line_info::one_addr2line_cache): New function.
15408 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15409 new cache-size argument to one_addr2line(), and clear cache.
15410
d09e9154
CC
154112008-04-28 Cary Coutant <ccoutant@google.com>
15412
15413 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15414 R_386_PC8 relocations.
15415
7ef73768
ILT
154162008-04-23 Ian Lance Taylor <iant@google.com>
15417
55438702
ILT
15418 * object.cc (Sized_relobj::include_section_group): Check for
15419 invalid section group.
15420
c165fb93
ILT
15421 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15422 header size.
15423
7ef73768
ILT
15424 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15425 than read for file header.
15426 * archive.cc (Archive::include_member): Likewise.
15427
6194aaab
L
154282008-04-23 Paolo Bonzini <bonzini@gnu.org>
15429
15430 * aclocal.m4: Regenerate.
15431 * configure: Regenerate.
15432
d491d34e
ILT
154332008-04-19 Ian Lance Taylor <iant@google.com>
15434
5ea2bac6
ILT
15435 * version.cc (version_string): Bump to 1.6.
15436
7bc3e21a
ILT
15437 * testsuite/Makefile.am (many_sections_r_test): New target.
15438 (many_sections_r_test_SOURCES): Remove.
15439 (many_sections_r_test_DEPENDENCIES): Remove.
15440 (many_sections_r_test_LDFLAGS): Remove.
15441 (many_sections_r_test_LDADD): Remove.
15442
7fcd3aa9
ILT
15443 * object.cc (Sized_relobj::do_add_symbols): Always pass
15444 local_symbol_count_ to add_from_relobj.
15445
4c94d6ae
ILT
15446 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15447 every thousand variables.
15448 * testsuite/Makefile.in: Rebuild.
15449
d491d34e
ILT
15450 * object.cc (Xindex::initialize_symtab_xindex): New function.
15451 (Xindex::read_symtab_xindex): New function.
15452 (Xindex::sym_xindex_to_shndx): New function.
15453 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15454 available.
15455 (Sized_relobj::do_initialize_xindex): New function.
15456 (Sized_relobj::do_read_symbols): Adjust section links.
15457 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15458 parameter. Change all callers.
15459 (Sized_relobj::include_section_group): Adjust section links and
15460 symbol section indexes.
15461 (Sized_relobj::do_layout): Adjust section links.
15462 (Sized_relobj::do_count_local_symbols): Adjust section links and
15463 symbol section indexes.
15464 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15465 ordinary and special symbols.
15466 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15467 dynsym_xindex parameters. Change all callers. Adjust section
15468 links. Use SHN_XINDEX when needed.
15469 (Sized_relobj::get_symbol_location_info): Adjust section links.
15470 Don't get fooled by special symbols.
15471 * object.h (class Xindex): Define.
15472 (class Object): Add xindex_ parameter. Declare virtual functoin
15473 do_initialize_xindex.
15474 (Object::adjust_sym_shndx): New function.
15475 (Object::set_xindex): New protected function.
15476 (class Symbol_value): Add is_ordinary_shndx_ field.
15477 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15478 (Symbol_value::value): Assert ordinary section.
15479 (Symbol_value::initialize_input_to_output_map): Likewise.
15480 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15481 Change all callers.
15482 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15483 all callers.
15484 (class Sized_relobj): Update declarations.
15485 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15486 parameter. Change all callers.
15487 (Sized_relobj::adjust_shndx): New function.
15488 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15489 field.
15490 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15491 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15492 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15493 (Sized_dynobj::read_dynsym_section): Adjust section links.
15494 (Sized_dynobj::read_dynamic): Likewise.
15495 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15496 section links.
15497 (Sized_dynobj::do_initialize_xindex): New function.
15498 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15499 do_initialize_xindex.
15500 (Sized_dynobj::adjust_shndx): New function.
15501 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15502 dynsym_xindex_ fields.
15503 (Layout::finalize): Add a call to set_section_indexes before
15504 creating the symtab sections.
15505 (Layout::set_section_indexes): Don't do anything if the section
15506 already has a section index.
15507 (Layout::create_symtab_sections): Add shnum parameter. Change
15508 caller. Create .symtab_shndx section if needed.
15509 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15510 caller.
15511 (Layout::allocated_output_section_count): New function.
15512 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15513 needed.
15514 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15515 fields. Update declarations.
15516 (Layout::symtab_xindex): New function.
15517 (Layout::dynsym_xindex): New function.
15518 (class Write_symbols_task): Add layout_ field.
15519 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15520 Change caller.
15521 * output.cc (Output_section_headers::Output_section_headers): Add
15522 shstrtab_section parameter. Change all callers.
15523 (Output_section_headers::do_sized_write): Store overflow values
15524 for section count and section string table section index in
15525 section header zero.
15526 (Output_file_header::do_sized_write): Check for overflow of
15527 section count and section string table section index.
15528 (Output_symtab_xindex::do_write): New function.
15529 (Output_symtab_xindex::endian_do_write): New function.
15530 * output.h (class Output_section_headers): Add shstrtab_section_.
15531 Update declarations.
15532 (class Output_symtab_xindex): Define.
15533 (Output_section::has_out_shndx): New function.
15534 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15535 field.
15536 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15537 Change all callers.
15538 (Sized_symbol::init): Likewise.
15539 (Symbol::output_section): Check for ordinary symbol.
15540 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15541 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15542 callers.
15543 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15544 Change all callers. Simplify handling of symbols from sections
15545 not included in the link.
15546 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15547 distinction.
15548 (Weak_alias_sorter::operator()): Assert that symbols are
15549 ordinary.
15550 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15551 distinction.
15552 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15553 parameters. Change all callers.
15554 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15555 symbol distinction. Use SHN_XINDEX when needed.
15556 (Symbol_table::write_section_symbol): Add symtab_xindex
15557 parameter. Change all callers.
15558 (Symbol_table::sized_write_section_symbol): Likewise. Use
15559 SHN_XINDEX when needed.
15560 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15561 declarations.
15562 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15563 (Symbol::is_defined): Check is_ordinary.
15564 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15565 (Symbol::is_absolute, Symbol::is_common): Likewise.
15566 (class Sized_symbol): Update declarations.
15567 (class Symbol_table): Update declarations.
15568 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15569 parameters. Change all callers.
15570 (Sized_symbol::override): Likewise.
15571 (Symbol_table::override): Likewise.
15572 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15573 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15574 is_ordinary, and orig_st_shndx parameters. Change all callers.
15575 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15576 to be in an ordinary section.
15577 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15578 object and is_ordinary parameters. Change all callers.
15579 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15580 Change all callers. Don't add undefined or non-ordinary symbols
15581 to reloc_map_.
15582 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15583 Change all callers.
15584 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15585 declarations.
15586 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15587 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15588 (Sized_relobj::relocate_sections): Likewise.
15589 * target-reloc.h (scan_relocs): Adjust section symbol index.
15590 (scan_relocatable_relocs): Likewise.
15591 * i386.cc (Scan::local): Check for ordinary symbols.
15592 * sparc.cc (Scan::local): Likewise.
15593 * x86_64.cc (Scan::local): Likewise.
15594 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15595 to symbol_section_and_value.
15596 * testsuite/many_sections_test.cc: New file.
15597 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15598 (check_PROGRAMS): Add many_sections_test.
15599 (many_sections_test_SOURCES): Define.
15600 (many_sections_test_DEPENDENCIES): Define.
15601 (many_sections_test_LDFLAGS): Define.
15602 (BUILT_SOURCES): Add many_sections_define.h.
15603 (many_sections_define.h): New target.
15604 (BUILT_SOURCES): Add many_sections_check.h.
15605 (many_sections_check.h): New target.
15606 (check_PROGRAMS): Add many_sections_r_test.
15607 (many_sections_r_test_SOURCES): Define.
15608 (many_sections_r_test_DEPENDENCIES): Define.
15609 (many_sections_r_test_LDFLAGS): Define.
15610 (many_sections_r_test_LDADD): Define.
15611 (many_sections_r_test.o): New target.
15612 * testsuite/Makefile.in: Rebuild.
15613
c5818ff1
CC
156142008-04-17 Cary Coutant <ccoutant@google.com>
15615
15616 * errors.cc (Errors::info): New function.
15617 (gold_info): New function.
15618 * errors.h (Errors::info): New function.
15619 * gold.h (gold_info): New function.
15620 * object.cc (Input_objects::add_object): Print trace output.
15621 * options.cc (options::parse_set): New function.
15622 (General_options::parse_wrap): Deleted.
15623 (General_options::General_options): Deleted initializer.
15624 * options.h (options::String_set): New typedef.
15625 (options::parse_set): New function.
15626 (DEFINE_set): New macro.
15627 (General_options::wrap): Changed to use DEFINE_set. Changed
15628 callers of any_wrap_symbols and is_wrap_symbol.
15629 (General_options::trace, General_options::trace_symbol):
15630 New options.
15631 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15632 (General_options::wrap_symbols_): Deleted.
15633 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15634
b5be4a7c
DM
156352008-04-17 David S. Miller <davem@davemloft.net>
15636
15637 * options.cc (General_options::parse_V): New function.
15638 * options.h: Add entries for -V and -Qy.
15639
155a0dd7
ILT
156402008-04-17 Ian Lance Taylor <iant@google.com>
15641
15642 * common.cc (Symbol_table::allocate_commons): Remove options
15643 parameter. Change caller.
15644 (Symbol_table::do_allocate_commons): Remove options parameter.
15645 Change caller. Just call do_allocate_commons_list twice.
15646 (Symbol_table::do_allocate_commons_list): New function, broken out
15647 of do_allocate_commons.
15648 * common.h (class Allocate_commons_task): Remove options_ field.
15649 Update constructor.
15650 * symtab.cc (Symbol_table::Symbol_table): Initialize
15651 tls_commons_.
15652 (Symbol_table::add_from_object): Put TLS common symbols on
15653 tls_commons_ list.
15654 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15655 which are IN_OUTPUT_DATA.
15656 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15657 allocate_commons and do_allocate_commons declarations. Declare
15658 do_allocate_commons_list.
15659 * gold.cc (queue_middle_tasks): Update creation of
15660 Allocate_commons_task to not pass options.
15661 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15662 (TLS_TEST_C_FLAGS): New variable.
15663 (tls_test_c_pic.o): New target.
15664 (tls_test_shared.so): Link in tls_test_c_pic.o.
15665 (tls_test_c_pic_ie.o): New target.
15666 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15667 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15668 (tls_test_c.o): New target.
15669 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15670 (tls_pic_test_LDADD): Likewise.
15671 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15672 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15673 (tls_test_c_gnu2.o): New target.
15674 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15675 tls_test_c_gnu2.o.
15676 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15677 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15678 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15679 * testsuite/tls_test.cc: Include "config.h".
15680 (t_last): Call t11_last.
15681 * testsuite/tls_test.h (t11, t11_last): Declare.
15682 * testsuite/tls_test_c.c: New file.
15683 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15684 * configure.ac: Check for OpenMP support.
15685 * configure, config.in, Makefile.in: Rebuild.
15686 * testsuite/Makefile.in: Rebuild.
15687
edfbb029
CC
156882008-04-16 Cary Coutant <ccoutant@google.com>
15689
15690 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15691 (Target_i386::tls_base_symbol_defined_): New field.
15692 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15693 (Target_i386::Scan::global): Likewise.
15694 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15695 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15696 (Target_x86_64::tls_base_symbol_defined_): New field.
15697 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15698 (Target_x86_64::Scan::global): Likewise.
15699
f3c69fca
CC
157002008-04-16 Cary Coutant <ccoutant@google.com>
15701
15702 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15703 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15704 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15705 building shared libraries.
15706 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15707 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15708 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15709 * testsuite/Makefile.in: Rebuild.
15710 * testsuite/weak_undef.h: New file.
15711 * testsuite/weak_undef_file1.cc: Add extra test cases.
15712 * testsuite/weak_undef_file2.cc: Likewise.
15713 * testsuite/weak_undef_test.cc: Likewise.
15714
7c414435
DM
157152008-04-16 David S. Miller <davem@davemloft.net>
15716
32b769e1
DM
15717 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15718 Add issued_non_pic_error_ field. Declare check_non_pic.
15719 (Target_sparc::Scan::check_non_pic): New function.
15720 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15721 (Target_sparc::Scan::global): Likewise.
15722
11936fb1
DM
15723 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15724 * configure: Rebuild.
15725
7c414435
DM
15726 * options.h (DEFINE_enable): New macro.
15727 (new_dtags): New enable option.
15728 (initfirst, interpose, loadfltr, nodefaultlib,
15729 nodelete, nodlopen, nodump): New -z options.
15730 * layout.cc (Layout:finish_dynamic_section): If new
15731 dtags enabled, emit DT_RUNPATH. Also, emit a
15732 DT_FLAGS_1 containing any specified -z flags.
15733
85c7bf8b
ILT
157342008-04-16 Ian Lance Taylor <iant@google.com>
15735
12c0daef
ILT
15736 * copy-relocs.cc: New file.
15737 * copy-relocs.h: New file.
15738 * reloc.cc: Remove Copy_relocs code.
15739 * reloc.h: Likewise.
15740 * reloc-types.h (struct Reloc_types) [both versions]: Add
15741 get_reloc_addend_noerror.
15742 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15743 variants of add_global which take an addend which must be zero.
15744 * i386.cc: Include "copy-relocs.h".
15745 (class Target_i386): Change type of copy_relocs_ to variable,
15746 update initializer.
15747 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15748 Change all callers.
15749 (Target_i386::do_finalize_sections): Change handling of
15750 copy_relocs_.
15751 * sparc.cc: Include "copy-relocs.h".
15752 (class Target_sparc): Change type of copy_relocs_ to variable,
15753 update initializer.
15754 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15755 Change all callers.
15756 (Target_sparc::do_finalize_sections): Change handling of
15757 copy_relocs_.
15758 * x86_64.cc: Include "copy-relocs.h".
15759 (class Target_x86_64): Change type of copy_relocs_ to variable,
15760 update initializer.
15761 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15762 class. Change all callers.
15763 (Target_x86_64::do_finalize_sections): Change handling of
15764 copy_relocs_.
15765 * Makefile.am (CCFILES): Add copy-relocs.cc.
15766 (HFILES): Add copy-relocs.h.
15767
4f4995b6
ILT
15768 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15769
85c7bf8b
ILT
15770 * testsuite/script_test_4.sh: Permit leading zeroes.
15771
4f2a9edd
ILT
157722008-04-15 Ian Lance Taylor <iant@google.com>
15773
e6188289
ILT
15774 * script-sections.cc (Script_sections::create_segments): Use
15775 header_size_adjustment even when there is enough room for the
15776 headers.
15777 * testsuite/script_test_4.sh: New file.
15778 * testsuite/script_test_4.t: New file.
15779 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15780 (check_DATA): Add script_test_4.stdout.
15781 (MOSTLYCLEANFILES): Likewise.
15782 (script_test_4): New target.
15783 (script_test_4.stdout): New target.
15784 * testsuite/Makefile.in: Rebuild.
15785
4f2a9edd
ILT
15786 * sparc.cc: Add definitions for Output_data_plt_sparc class
15787 constants.
15788
f5314dd5
DM
157892008-04-14 David S. Miller <davem@davemloft.net>
15790
15791 * sparc.cc: New file.
15792 * Makefile.am (TARGETSOURCES): Add sparc.cc
15793 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15794 * configure.tgt: Document targ_extra_size and
15795 targ_extra_big_endian. Add entries for sparc-* and
15796 sparc64-*.
15797 * configure.ac: Handle targ_extra_size and
15798 targ_extra_big_endian.
15799 * Makefile.in: Rebuild.
15800 * configure: Likewise.
15801 * po/POTFILES.in: Likewise.
15802 * po/gold.pot: Likewise.
15803
154e0e9a
ILT
158042008-04-14 Ian Lance Taylor <iant@google.com>
15805
15806 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15807 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15808 in the name/type/flags to section mapping. Don't call
15809 allocate_output_section.
15810 (Layout::choose_output_section): Change parameter from adjust_name
15811 to is_input_section. Don't permit input sections after sections
15812 are attached to segments. Don't call allocate_output_section.
15813 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15814 not write_enable_output_section.
15815 (Layout::make_output_section): Don't push to
15816 unattached_section_list_ nor call attach_to_segment. Call
15817 attach_section_to_segment if sections are attached.
15818 (Layout::attach_sections_to_segments): New function.
15819 (Layout::attach_section_to_segment): New function.
15820 (Layout::attach_allocated_section_to_segment): Rename from
15821 attach_to_segment. Remove flags parameter.
15822 (Layout::allocate_output_section): Remove function.
15823 (Layout::write_enable_output_section): Remove function.
15824 * layout.h (class Layout): Update for above changes. Add new
15825 field sections_are_attached_.
15826 * output.h (Output_section::update_flags_for_input_section): New
15827 function.
15828 * output.cc (Output_section::add_input_section): Call
15829 update_flags_for_input_section.
15830 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15831
009a67a2
CC
158322008-04-11 Cary Coutant <ccoutant@google.com>
15833
15834 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15835 thought unnecessary.
15836 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15837
759b1a24
ILT
158382008-04-11 Ian Lance Taylor <iant@google.com>
15839
15840 * output.h (class Output_section_data): Remove inline definition
15841 of set_addralign.
15842 * output.cc (Output_section_data::set_addralign): New function.
15843
c2b45e22
CC
158442008-04-11 Cary Coutant <ccoutant@google.com>
15845
15846 Add support for TLS descriptors for i386 and x86_64.
15847 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15848 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15849 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15850 GOT_TYPE_TLS_DESC.
15851 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15852 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15853 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15854 relocations.
15855 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15856 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15857 Fix problem with initial-exec relocations.
15858 (Target_i386::Relocate::relocate_tls): Likewise.
15859 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15860 relaxation.
15861 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15862 support for section-plus-offset dynamic table entries.
15863 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15864 (Output_data_dynamic::Dynamic_entry): Add support for
15865 section-plus-offset dynamic table entries.
15866 (Output_data_dynamic::Classification): Likewise.
15867 (Output_data_dynamic::classification_): Renamed offset_.
15868 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15869 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15870 (Target_x86_64::make_plt_section): New function.
15871 (Target_x86_64::reserve_tlsdesc_entries): New function.
15872 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15873 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15874 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15875 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15876 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15877 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15878 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15879 add extra PLT entry for TLS descriptors.
15880 (Output_data_plt_x86_64::got_): New field.
15881 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15882 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15883 fields.
15884 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15885 descriptors.
15886 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15887 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15888 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15889 R_386_TLS_DESC_CALL relocations.
15890 (Target_x86_64::Scan::global): Likewise.
15891 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15892 for TLS descriptors.
15893 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15894 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15895 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15896 GD-to-IE relaxation.
15897 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15898 and TLS_DESCRIPTORS.
15899 * Makefile.in: Rebuild.
15900 * configure: Rebuild.
15901 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15902 (tls_test_shared2.so): New target.
15903 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15904 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15905 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15906 (tls_shared_gd_to_ie_test_LDADD): New variable.
15907 (tls_shared_gnu2_gd_to_ie_test): New target.
15908 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15909 New targets.
15910 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15911 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15912 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15913 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15914 (tls_shared_gnu2_test): New target.
15915 (tls_test_gnu2_shared.so): New target.
15916 (tls_shared_gnu2_test_SOURCES): New variable.
15917 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15918 (tls_shared_gnu2_test_LDFLAGS): New variable.
15919 (tls_shared_gnu2_test_LDADD): New variable.
15920 * testsuite/Makefile.in: Rebuild.
15921 * testsuite/Makefile.
15922
83bfb6b7
ILT
159232008-04-11 Ian Lance Taylor <iant@google.com>
15924
15925 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15926 justsyms.t.
15927 * testsuite/Makefile.in: Rebuild.
15928
15929 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15930 long.
15931 * testsuite/script_test_2.cc (main): Adjust test.
15932
706e1f5e
ILT
159332008-04-11 David S. Miller <davem@davemloft.net>
15934 Ian Lance Taylor <iant@google.com>
15935
15936 * options.h (General_options): Add entries for '-Y' and
15937 '-relax'.
15938 * options.cc (General_options:finalize): If -Y was used, add those
15939 entries to the library path instead of the default "/lib" and
15940 "/usr/lib".
15941
7c98e6bb
DM
159422008-04-11 David S. Miller <davem@davemloft.net>
15943
15944 * testsuite/justsyms.t: Start at 0x100.
15945 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15946 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15947 long.
15948 * testsuite/script_test_2.cc: Adjust string and section length
15949 checks.
7c98e6bb 15950
99a37bfd
ILT
159512008-04-09 Ian Lance Taylor <iant@google.com>
15952
2cefc357
ILT
15953 PR gold/5996
15954 * script-sections.cc (Sections_element::allocate_to_segment): Add
15955 orphan parameter.
15956 (Output_section_definition::allocate_to_segment): Likewise.
15957 (Orphan_output_section::allocate_to_segment): Likewise.
15958 (Script_sections::attach_sections_using_phdrs_clause): Don't
15959 propagate non-PT_LOAD segments to orphan sections.
15960 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15961 readelf rather than objdump.
15962 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15963 .interp section and PT_INTERP segment are the same size.
15964 * testsuite/Makefile.in: Rebuild.
15965
99a37bfd
ILT
15966 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15967 aliases for symbols defined in the same object.
15968 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15969 (weak_alias_test_SOURCES): New variable.
15970 (weak_alias_test_DEPENDENCIES): New variable.
15971 (weak_alias_test_LDFLAGS): New variable.
15972 (weak_alias_test_LDADD): New variable.
15973 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15974 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15975 (weak_alias_test_3.o): New target.
15976 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15977 * testsuite/weak_alias_test_main.cc: New file.
15978 * testsuite/weak_alias_test_1.cc: New file.
15979 * testsuite/weak_alias_test_2.cc: New file.
15980 * testsuite/weak_alias_test_3.cc: New file.
15981
780e49c5
ILT
159822008-04-08 Ian Lance Taylor <iant@google.com>
15983
cdb0b8f5
ILT
15984 * options.h (class General_options): Add --noinhibit-exec option.
15985 * main.cc (main): Check --noinhibit-exec.
15986
0864d551
ILT
15987 * options.h (class General_options): Define --wrap as a special
15988 option. Add wrap_symbols_ field.
15989 (General_options::any_wrap_symbols): New function.
15990 (General_options::is_wrap_symbol): New function.
15991 * options.cc (General_options::parse_wrap): New function.
15992 (General_options::General_options): Initialize wrap_symbols_.
15993 * symtab.cc (Symbol_table::wrap_symbol): New function.
15994 (Symbol_table::add_from_object): Handle --wrap.
15995 * symtab.h (class Symbol_table): Declare wrap_symbol.
15996 * target.h (Target::wrap_char): New function.
15997 (Target::Target_info): Add wrap_char field.
15998 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15999 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16000 * testsuite/testfile.cc (Target_test::test_target_info):
16001 Likewise.
16002
789aa6de
ILT
16003 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16004 there is one.
16005
2c38906f
ILT
16006 * layout.h (class Layout): Add added_eh_frame_data_ field.
16007 * layout.cc (Layout::Layout): Initialize new field.
16008 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16009 output section until we find a section we merged successfully.
16010 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16011 that the size be non-zero.
16012
780e49c5
ILT
16013 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16014 qualifier.
16015
7fcd0256
ILT
160162008-04-08 Craig Silverstein <csilvers@google.com>
16017
16018 * configure.ac: Export new conditional variable HAVE_ZLIB.
16019 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16020 on HAVE_ZLIB.
16021 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16022 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16023
6835af53
ILT
160242008-04-07 Ian Lance Taylor <iant@google.com>
16025
e24f324c
ILT
16026 * version.cc (version_string): Set to "1.5".
16027
a036edd8
ILT
16028 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16029 Add issued_non_pic_error_ field. Declare check_non_pic.
16030 (Target_x86_64::Scan::check_non_pic): New function.
16031 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16032 (Target_x86_64::Scan::global): Likewise.
16033
624f8810
ILT
16034 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16035 addend parameter. Change caller. Handle merge sections.
16036 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16037 Address to Addend. Don't add in the result of
16038 local_section_offset, pass down the addend and use the returned
16039 value.
16040 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16041 Update declarations of local_section_offset and symbol_value.
16042 * testsuite/two_file_test_1.cc (t18): New function.
16043 * testsuite/two_file_test_2.cc (f18): New function.
16044 * testsuite/two_file_test_main.cc (main): Call t18.
16045 * testsuite/two_file_test.h (t18, f18): Declare.
16046
6835af53
ILT
16047 * configure.ac: Don't test for objdump, c++filt, or readelf.
16048 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16049 conditionals.
16050 (TEST_READELF): New variable.
16051 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16052 (check_PROGRAMS): Add two_file_strip_test.
16053 (two_file_strip_test): New target.
16054 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16055 (two_file_same_shared_strip_test_SOURCES): New variable.
16056 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16057 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16058 (two_file_same_shared_strip_test_LDADD): New variable.
16059 (two_file_shared_strip.so): New target.
16060 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16061 (ver_test_5.syms, ver_test_7.syms): Likewise.
16062 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16063 (strip_test_3.stdout): Use TEST_OBJDUMP.
16064 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16065
86925eef
CC
160662008-04-04 Cary Coutant <ccoutant@google.com>
16067
16068 * symtab.h (Symbol::is_weak_undefined): New function.
16069 (Symbol::is_strong_undefined): New function.
16070 (Symbol::is_absolute): New function.
16071 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16072 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16073 absolute symbols.
16074 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16075 (weak_undef_test): New target.
16076 * testsuite/Makefile.in: Rebuild.
16077 * testsuite/weak_undef_file1.cc: New file.
16078 * testsuite/weak_undef_file2.cc: New file.
16079 * testsuite/weak_undef_test.cc: New file.
16080
126f3ece
ILT
160812008-04-03 Craig Silverstein <csilvers@google.com>
16082
16083 * compressed_output.h (class Output_compressed_section): Use
16084 unsigned buffer.
16085 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16086 add zlib header.
16087 (zlib_compressed_suffix): Removed.
16088 (Output_compressed_section::set_final_data_size): Use unsigned
16089 buffers.
16090 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16091 Fix linker invocation.
16092 (flagstest_o_specialfile_and_compress_debug_sections):
16093 Likewise.
16094 * testsuite/Makefile.in: Regenerated.
16095
deae2a14
DM
160962008-04-02 David S. Miller <davem@davemloft.net>
16097
16098 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16099 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16100
70752818
ILT
161012008-04-02 Craig Silverstein <csilvers@google.com>
16102
16103 * TODO: New file.
16104
39d0cb0e
ILT
161052008-04-02 Ian Lance Taylor <iant@google.com>
16106
16107 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16108 parameters. Update for new key type to views_. Change all
16109 callers.
16110 (File_read::read): Adjust for byteshift in returned view.
16111 (File_read::add_view): New function, broken out of
16112 find_and_make_view.
16113 (File_read::make_view): New function, broken out of
16114 find_and_make_view.
16115 (File_read::find_or_make_view): Add offset and aligned
16116 parameters. Rewrite accordingly. Change all callers.
16117 (File_read::get_view): Add offset and aligned parameters. Adjust
16118 for byteshift in return value.
16119 (File_read::get_lasting_view): Likewise.
16120 * fileread.h (class File_read): Update declarations.
16121 (class File_read::View): Add byteshift_ field. Add byteshift to
16122 constructor. Add byteshift method.
16123 * archive.h (Archive::clear_uncached_views): New function.
16124 (Archive::get_view): Add aligned parameter. Change all callers.
16125 * object.h (Object::get_view): Add aligned parameter. Change all
16126 callers.
16127 (Object::get_lasting_view): Likewise.
16128
16129 * fileread.cc (File_read::release): Don't call clear_views if
16130 there are multiple objects.
16131 * fileread.h (File_read::clear_uncached_views): New function.
16132 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16133 on the archive.
16134
a1207466
CC
161352008-03-31 Cary Coutant <ccoutant@google.com>
16136
16137 Add thin archive support.
16138 * archive.cc (Archive::armagt): New const.
16139 (Archive::setup): Remove task parameter and calls to unlock.
16140 (Archive::unlock_nested_archives): New function.
16141 (Archive::read_header): Add nested_off parameter. Change
16142 all callers.
16143 (Archive::interpret_header): Likewise.
16144 (Archive::include_all_members): Change to handle thin
16145 archives.
16146 (Archive::include_member): Likewise.
16147 * archive.h (Archive::Archive): Add new parameters and
16148 initializers.
16149 (Archive::armagt): New const.
16150 (Archive::setup): Remove task parameter.
16151 (Archive::unlock_nested_archives): New function.
16152 (Archive::read_header): Add nested_off parameter.
16153 (Archive::interpret_header): Likewise.
16154 (Archive::Nested_archive_table): New typedef.
16155 (Archive::is_thin_archive_): New field.
16156 (Archive::nested_archives_): New field.
16157 (Archive::options_): New field.
16158 (Archive::dirpath_): New field.
16159 (Archive::task_): New field.
16160 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16161 for thin archives. Pass additional parameters to
16162 Archive::Archive. Unlock the archive file after calling
16163 Archive::setup.
cd536b21 16164
479f6503
ILT
161652008-03-29 Ian Lance Taylor <iant@google.com>
16166
686c8caf
ILT
16167 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16168 version symbol to be local.
16169 * testsuite/ver_test_4.sh: New file.
16170 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16171 (check_DATA): Add ver_test_4.syms.
16172 (ver_test_4.syms): New target.
16173 * testsuite/Makefile.in: Rebuild.
16174
ab794b6b
ILT
16175 * output.cc
16176 (Output_section::Input_section_sort_entry::has_priority): New
16177 function.
16178 (Output_section::Input_section_sort_entry::match_file_name): New
16179 function.
16180 (Output_section::Input_section_sort_entry::match_section_name):
16181 Remove.
16182 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16183 Remove.
16184 (Output_section::Input_section_sort_entry::match_section_file):
16185 Remove.
16186 (Output_section::Input_section_sort_compare::operator()): Rewrite
16187 using new Input_section_sort_entry functions. Sort crtbegin and
16188 crtend first. Sort sections with no priority before sections with
16189 a priority.
16190 * testsuite/initpri1.c (d3): Check j != 4.
16191 (cd5): New constructor/destructor function.
16192 (main): Check j != 2.
16193
479f6503
ILT
16194 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16195 new symbol when resolving, don't call set_is_default.
16196 * testsuite/ver_test_7.cc: New file.
16197 * testsuite/ver_test_7.sh: New file.
16198 * testsuite/Makefile.am (ver_test_7.so): New target.
16199 (ver_test_7.o): New target.
16200 (check_SCRIPTS): Add ver_test_7.sh.
16201 (check_DATA): Add ver_test_7.syms.
16202 (ver_test_7.syms): New target.
16203
2fd32231
ILT
162042008-03-28 Ian Lance Taylor <iant@google.com>
16205
16206 * layout.cc (Layout::layout): If we see an input section with a
16207 name that needs sorting, set the must_sort flag for the output
16208 section.
16209 (Layout::make_output_section): If the name of the output section
16210 indicates that it might require sorting, set the may_sort flag.
16211 * output.h (Output_section::may_sort_attached_input_sections): New
16212 function.
16213 (Output_section::set_may_sort_attached_input_sections): New
16214 function.
16215 (Output_section::must_sort_attached_input_sections): New
16216 function.
16217 (Output_section::set_must_sort_attached_input_sections): New
16218 function.
16219 (class Output_section): Declare Input_section_sort_entry. Define
16220 Input_section_sort_compare. Declare
16221 sort_attached_input_sections. Add new fields:
16222 may_sort_attached_input_sections_,
16223 must_sort_attached_input_sections_,
16224 attached_input_sections_are_sorted_.
16225 * output.cc (Output_section::Output_section): Initialize new
16226 fields.
16227 (Output_section::add_input_section): Add an entry to
16228 input_sections_ if may_sort or must_sort are true.
16229 (Output_section::set_final_data_size): Call
16230 sort_attached_input_sections if necessary.
16231 (Output_section::Input_section_sort_entry): Define new class.
16232 (Output_section::Input_section_sort_compare::operator()): New
16233 function.
16234 (Output_section::sort_attached_input_sections): New function.
16235 * configure.ac: Check whether the compiler supports constructor
16236 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16237 * testsuite/initpri1.c: New file.
16238 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16239 CONSTRUCTOR_PRIORITY.
16240 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16241 (initpri1_LDFLAGS): New variable.
16242 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16243
18e6b24e
ILT
162442008-03-27 Ian Lance Taylor <iant@google.com>
16245
49bdd526
ILT
16246 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16247 * testsuite/common_test_1.c: New file.
16248 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16249 (common_test_1_SOURCES): New variable.
16250 (common_test_1_DEPENDENCIES): New variable.
16251 (common_test_1_LDFLAGS): New variable.
16252
18e6b24e
ILT
16253 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16254 and commons_ correctly when NAME/VERSION does not override
16255 NAME/NULL.
16256 * testsuite/ver_test_6.c: New file.
16257 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16258 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16259 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16260
04bf7072
ILT
162612008-03-26 Ian Lance Taylor <iant@google.com>
16262
5871526f
ILT
16263 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16264 of an undefined symbol from a version script.
16265 * testsuite/Makefile.am (ver_test_5.so): New target.
16266 (ver_test_5.o): New target.
16267 (check_SCRIPTS): Add ver_test_5.sh.
16268 (check_DATA): Add ver_test_5.syms.
16269 (ver_test_5.syms): New target.
16270 * testsuite/ver_test_5.cc: New file.
16271 * testsuite/ver_test_5.script: New file.
16272 * testsuite/ver_test_5.sh: New file.
16273 * Makefile.in, testsuite/Makefile.in: Rebuild.
16274
04bf7072
ILT
16275 PR gold/5986
16276 Fix problems building gold with gcc 4.3.0.
16277 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16278 (gold_error_at_location, gold_warning_at_location): Use it.
16279 * configure.ac: Check whether we can compile and use a template
16280 function with a printf attribute.
16281 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16282 when jumping over bytes.
16283 * object.cc: Instantiate Object::read_section_data.
16284 * debug.h: Include <cstring>
16285 * dwarf_reader.cc: Include <algorithm>
16286 * main.cc: Include <cstring>.
16287 * options.cc: Include <cstring>.
16288 * output.cc: Include <cstring>.
16289 * script.cc: Include <cstring>.
16290 * script.h: Include <string>.
16291 * symtab.cc: Include <cstring> and <algorithm>.
16292 * target-select.cc: Include <cstring>.
16293 * version.cc: Include <string>.
16294 * testsuite/testmain.cc: Include <cstdlib>.
16295 * configure, config.in: Rebuild.
16296
874c5b28
ILT
162972008-03-25 Ian Lance Taylor <iant@google.com>
16298
819d6c3a
ILT
16299 * options.cc: Include "../bfd/bfdver.h".
16300 (options::help): Print bug reporting address.
16301
f4b2c6f5
ILT
16302 * version.cc (print_version): Adjust output for current value of
16303 BFD_VERSION_STRING.
16304
16305 * NEWS: New file.
16306
e96caa79
ILT
16307 * options.cc (options::help): Print list of supported targets.
16308 * target-select.h: Include <vector>.
16309 (class Target_selector): Make machine_, size_, and is_big_endian_
16310 fields const. Add bfd_name_ and instantiated_target_ fields.
16311 (Target_selector::Target_selector): Add bfd_name parameter.
16312 (Target_selector::recognize): Make non-virtual, call
16313 do_recognize.
16314 (Target_selector::recognize_by_name): Make non-virtual, call
16315 do_recognize_by_name.
16316 (Target_selector::supported_names): New function.
16317 (Target_selector::bfd_name): New function.
16318 (Target_selector::do_instantiate_target): New pure virtual
16319 function.
16320 (Target_selector::do_recognize): New virtual function.
16321 (Target_selector::do_recognize_by_name): New virtual function.
16322 (Target_selector::instantiate_target): New private function.
16323 (supported_target_names): Declare.
16324 * target-select.cc (Target_selector::Target_selector): Update for
16325 new parameter and fields.
16326 (select_target_by_name): Check that the name matches before
16327 calling recognize_by_name.
16328 (supported_target_names): New function.
16329 * i386.cc (class Target_selector_i386): Update Target_selector
16330 constructor call. Remove recognize and recognize_by_name. Add
16331 do_instantiate_target.
16332 * x86_64.cc (class Target_selector_x86_64): Likewise.
16333 * testsuite/testfile.cc (class Target_selector_test): Update for
16334 changes to Target_selector.
16335
874c5b28
ILT
16336 * README: Rewrite, with some notes on unsupported features.
16337
0a65a3a7
CC
163382008-03-24 Cary Coutant <ccoutant@google.com>
16339
16340 * i386.cc (Target_i386::Got_type): New enum declaration.
16341 (Target_i386::Scan::local): Updated callers of Output_data_got
16342 member functions.
16343 (Target_i386::Scan::global): Likewise.
16344 (Target_i386::Relocate::relocate): Likewise.
16345 (Target_i386::Relocate::relocate_tls): Likewise.
16346 * object.h (Got_offset_list): New class.
16347 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16348 (Sized_relobj::local_got_offset): Likewise.
16349 (Sized_relobj::set_local_got_offset): Likewise.
16350 (Sized_relobj::local_has_tls_got_offset): Removed.
16351 (Sized_relobj::local_tls_got_offset): Removed.
16352 (Sized_relobj::set_local_tls_got_offset): Removed.
16353 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16354 * output.cc (Output_data_got::add_global): Added got_type parameter.
16355 (Output_data_got::add_global_with_rel): Likewise.
16356 (Output_data_got::add_global_with_rela): Likewise.
16357 (Output_data_got::add_global_pair_with_rel): New function.
16358 (Output_data_got::add_global_pair_with_rela): New function.
16359 (Output_data_got::add_local): Added got_type parameter.
16360 (Output_data_got::add_local_with_rel): Likewise.
16361 (Output_data_got::add_local_with_rela): Likewise.
16362 (Output_data_got::add_local_pair_with_rel): New function.
16363 (Output_data_got::add_local_pair_with_rela): New function.
16364 (Output_data_got::add_global_tls): Removed.
16365 (Output_data_got::add_global_tls_with_rel): Removed.
16366 (Output_data_got::add_global_tls_with_rela): Removed.
16367 (Output_data_got::add_local_tls): Removed.
16368 (Output_data_got::add_local_tls_with_rel): Removed.
16369 (Output_data_got::add_local_tls_with_rela): Removed.
16370 * output.h (Output_data_got::add_global): Added got_type parameter.
16371 (Output_data_got::add_global_with_rel): Likewise.
16372 (Output_data_got::add_global_with_rela): Likewise.
16373 (Output_data_got::add_global_pair_with_rel): New function.
16374 (Output_data_got::add_global_pair_with_rela): New function.
16375 (Output_data_got::add_local): Added got_type parameter.
16376 (Output_data_got::add_local_with_rel): Likewise.
16377 (Output_data_got::add_local_with_rela): Likewise.
16378 (Output_data_got::add_local_pair_with_rel): New function.
16379 (Output_data_got::add_local_pair_with_rela): New function.
16380 (Output_data_got::add_global_tls): Removed.
16381 (Output_data_got::add_global_tls_with_rel): Removed.
16382 (Output_data_got::add_global_tls_with_rela): Removed.
16383 (Output_data_got::add_local_tls): Removed.
16384 (Output_data_got::add_local_tls_with_rel): Removed.
16385 (Output_data_got::add_local_tls_with_rela): Removed.
16386 * resolve.cc (Symbol::override_base_with_special): Removed
16387 reference to has_got_offset_ field.
16388 * symtab.cc (Symbol::init_fields): Replaced initialization
16389 of got_offset_ with got_offsets_. Removed initialization
16390 of has_got_offset_
53fcba31 16391 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16392 (Symbol::got_offset): Likewise.
16393 (Symbol::set_got_offset): Likewise.
16394 (Symbol::has_tls_got_offset): Removed.
16395 (Symbol::tls_got_offset): Removed.
16396 (Symbol::set_tls_got_offset): Removed.
16397 (Symbol::got_offset_): Removed.
16398 (Symbol::tls_mod_got_offset_): Removed.
16399 (Symbol::tls_pair_got_offset_): Removed.
16400 (Symbol::got_offsets_): New field.
16401 (Symbol::has_got_offset): Removed.
16402 (Symbol::has_tls_mod_got_offset): Removed.
16403 (Symbol::has_tls_pair_got_offset): Removed.
16404 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16405 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16406 member functions.
16407 (Target_x86_64::Scan::global): Likewise.
16408 (Target_x86_64::Relocate::relocate): Likewise.
16409 (Target_x86_64::Relocate::relocate_tls): Likewise.
16410
bd52eafb
BE
164112008-03-25 Ben Elliston <bje@au.ibm.com>
16412
16413 * yyscript.y: Fix spelling error in comment.
16414
8b105e34
ILT
164152008-03-24 Ian Lance Taylor <iant@google.com>
16416
8ed814a9
ILT
16417 * options.h (class General_options): Define build_id option.
16418 * layout.h (class Layout): Declare write_build_id, create_note,
16419 create_build_id. Add build_id_note_ member.
16420 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16421 "libiberty.h", "md5.h", "sha1.h".
16422 (Layout::Layout): Initialize eh_frame_data_,
16423 eh_frame_hdr_section_, and build_id_note_.
16424 (Layout::finalize): Call create_build_id.
16425 (Layout::create_note): New function, broken out of
16426 Layout::create_gold_note.
16427 (Layout::create_gold_note): Call create_note.
16428 (Layout::create_build_id): New function.
16429 (Layout::write_build_id): New function.
16430 (Close_task_runner::run): Call write_build_id.
16431
8b105e34
ILT
16432 * x86_64.cc: Correct license to GPLv3.
16433
086a1841
ILT
164342008-03-23 Ian Lance Taylor <iant@google.com>
16435
16436 * options.cc: Include "demangle.h".
16437 (parse_optional_string): New function.
16438 (parse_long_option): Handle takes_optional_argument.
16439 (parse_short_option): Update dash_z initializer. Handle
16440 takes_optional_argument.
16441 (General_options::General_options): Initialize do_demangle_.
16442 (General_options::finalize): Set do_demangle_. Handle demangling
16443 style.
16444 * options.h (parse_optional_string): Declare.
16445 (struct One_option): Add optional_arg field. Update constructor.
16446 Update call constructor calls. Add takes_optional_argument
16447 function.
16448 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16449 (DEFINE_optional_string): Define.
16450 (General_options::demangle): Change from DEFINE_bool to
16451 DEFINE_optional_string.
16452 (General_options::no_demangle): New function.
16453 (General_options::do_demangle): New function.
16454 (General_options::set_do_demangle): New function.
16455 (General_options::execstack_status_): Move definition to end of
16456 class definition.
16457 (General_options::static_): Likewise.
16458 (General_options::do_demangle_): New field.
16459 * object.cc (big_endian>::get_symbol_location_info): Call
16460 Options::do_demangle, not Options::demangle.
16461 * symtab.cc (demangle): Likewise.
16462
cbb93e63
ILT
164632008-03-22 Ian Lance Taylor <iant@google.com>
16464
16465 * gold.h: Include <cstddef> and <sys/types.h>
16466 * options.h: Include <cstring>.
16467
ec531623
ILT
164682008-03-21 Ian Lance Taylor <iant@google.com>
16469
16470 * Added source code to GNU binutils.
752937aa 16471\f
b90efa5b 16472Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16473
16474Copying and distribution of this file, with or without modification,
16475are permitted in any medium without royalty provided the copyright
16476notice and this notice are preserved.
16477
16478Local Variables:
16479mode: change-log
16480left-margin: 8
16481fill-column: 74
16482version-control: never
16483End:
This page took 1.026002 seconds and 4 git commands to generate.