Fix memory access violations for objdump triggered by fuzzed binaries.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
af759df0
AM
12015-01-02 Alan Modra <amodra@gmail.com>
2
3 * version.cc (print_version): Just print current year.
4 * dwp.cc (print_version): Likewise.
5
b90efa5b
AM
62015-01-01 Alan Modra <amodra@gmail.com>
7
8 Update year range in copyright notice of all files.
9
f12d1e8a
AM
102014-12-25 Alan Modra <amodra@gmail.com>
11
12 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
13 new enums.
14 (Target_arm::merge_object_attributes, ): Likewise.
15
5c294fee
TG
162014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
17
18 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
19 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
20 AEABI_VFP_args_vfp to check that.
21 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
22 value and replace hardcoded values by enum values.
23
e30880c2
CC
242014-12-22 Cary Coutant <ccoutant@google.com>
25
26 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
27
bd040da1
L
282014-12-20 H.J. Lu <hongjiu.lu@intel.com>
29
30 PR gold/14608
31 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
32 to "return i * i * 3;".
33
e02a4046
CC
342014-12-16 Cary Coutant <ccoutant@google.com>
35
36 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
37 (Mapfile::print_output_data): Use current_data_size() to avoid
38 assert for sections requiring postprocessing; if address is not valid,
39 print 0.
40 (Mapfile::print_output_section): Use current_data_size(); print note
41 that addresses and sizes are before compression.
42
add6016b
L
432014-12-14 H.J. Lu <hongjiu.lu@intel.com>
44
45 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
46 Cast current_group_size to unsigned long when reporting error.
47
0bf32ea9
JY
482014-12-10 Jing Yu <jingyu@google.com>
49
50 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
51 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
52 Update error message.
53 (Target_aarch64::do_relax): Use absolute value of option
54 stub_group_size. Replace local variable with class member
55 stub_group_size_.
56
cbcb23fa
AM
572014-12-04 Alan Modra <amodra@gmail.com>
58
59 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
60 addend of PLTREL24 reloc when not generating a plt stub. Make
61 max_branch_offset an "Address".
fbad6518 62 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
63 (Target_powerpc::Relocate::relocate): Likewise.
64
1611bc4a
AM
652014-12-04 Alan Modra <amodra@gmail.com>
66
67 PR 17670
68 * symtab.cc (Symbol::set_undefined): Remove assertion.
69 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
70 on symbols defined in discarded sections, instead return false.
71 Rearrange params, update all callers.
72 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
73 branches to syms in discarded sections.
74 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
75 undefined and flag as discarded.
76 (Target_powerpc::Relocate::relocate): Localize variable.
77
4759c34e
L
782014-12-03 H.J. Lu <hongjiu.lu@intel.com>
79
80 PR gold/17675
81 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
82 * testsuite/Makefile.in: Regenerated.
83
1f98a074
AM
842014-12-03 Alan Modra <amodra@gmail.com>
85
86 PR 17566
87 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
88 when adding dynamic relocations against section symbols.
89
fb257835
DI
902014-12-01 Dimitry Ivanov <dimitry@google.com>
91
92 * layout.cc (Layout::finish_dynamic_section): When '-z global'
93 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
94 * options.h (General_options): New -z option (global).
95
d8e60314
CC
962014-12-01 Cary Coutant <ccoutant@google.com>
97
98 PR gold/17578
99 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
100 is given.
101 (Layout::create_executable_stack_info): Warn when -z noexecstack is
102 given but some inputs require executable stack.
103
982bbd97
CC
1042014-11-26 Cary Coutant <ccoutant@google.com>
105
106 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
107 .debug_str_offsets; strip .debug_gnu_pubnames and
108 .debug_gnu_pubtypes.
109 (lines_only_debug_sections): Strip all four new sections.
110
bb779192
HS
1112014-11-26 Jing Yu <jingyu@google.com>
112
113 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
114 register to be x0 when to relax TLSDESC_LD64_LO12.
115
a3e60ddb
AM
1162014-11-26 Alan Modra <amodra@gmail.com>
117
118 * powerpc.cc (struct Stub_table_owner): New.
119 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
120 unsigned int vector. Update all references.
121 (powerpc_relobj::set_stub_table): Take an unsigned int param
122 rather than a Stub_table. Update callers.
123 (Powerpc_relobj::clear_stub_table): New function.
124 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
125 stub_group_size_ vars.
126 (Target_powerpc::new_stub_table): Delete.
127 (max_branch_delta): New function, extracted from..
128 (Target_powerpc::Relocate::relocate): ..here..
129 (Target_powerpc::Branch_info::make_stub): ..and here. Return
130 status on whether stub created successfully.
131 (Stub_control::Stub_control): Add "no_size_errors" param. Move
132 default sizing to..
133 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
134 reduce on relax failure.
135 (Target_powerpc::group_sections): Add "no_size_errors" param.
136 Use stub_group_size_. Set up group info in a temp vector,
137 before building Stub_table vector. Account for input sections
138 possibly already converted to relaxed sections.
139 (Stub_table::init): Delete. Merge into..
140 (Stub_table::Stub_table): ..here.
141 (Stub_table::can_reach_stub): New function.
142 (Stub_table::add_plt_call_entry): Add "from" parameter and
143 return true iff stub could be reached.
144 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
145 param too.
146 (Stub_table::clear_stubs): Add "all" param.
147
a20605cf
AM
1482014-11-26 Alan Modra <amodra@gmail.com>
149
150 * powerpc.cc (Stub_control::set_output_and_owner): New function.
151 (Target_powerpc::group_sections): Use it.
152
43b64deb
CC
1532014-11-25 Cary Coutant <ccoutant@google.com>
154
155 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
156 (Binary_to_elf::write_symbol): Add st_size parameter.
157 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
158
c924eb67
CC
1592014-11-25 Cary Coutant <ccoutant@google.com>
160
161 PR gold/17639
162 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
163 (Sized_relobj_file::do_layout): Handle deferred sections properly
164 during GC pass 1. Don't add reloc sections to deferred list twice.
165 * object.h (Sized_relobj_file::is_deferred_layout): New function.
166 (Sized_relobj_file::is_deferred_layout_): New data member.
167
9d585188
L
1682014-11-21 H.J. Lu <hongjiu.lu@intel.com>
169
170 PR gold/17619
171 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
172 Check PC-relative offset overflow in PLT entry.
173
3ffaac20
AM
1742014-11-21 Alan Modra <amodra@gmail.com>
175
176 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
177 for undefined weaks.
178
0cfb0717
AM
1792014-11-20 Alan Modra <amodra@gmail.com>
180
181 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
182 from --stub-group-size parameter divided by 1024.
183 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
184 template parameter. Update all uses.
185 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
186 has_stub_value. Set for long branches. Don't report overflow for
187 branch to undefined weak symbols. Print info message on
188 overflowing branch to stub.
189
f9dffbf0
AM
1902014-11-20 Alan Modra <amodra@gmail.com>
191
192 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
193
e88ba8d5
L
1942014-11-13 H.J. Lu <hongjiu.lu@intel.com>
195
196 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
197 entry for R_X86_64_GOTPLT64.
198 (Target_x86_64<size>::Relocate::relocate): Update comments for
199 R_X86_64_GOTPLT64.
200
d37ffe25
ED
2012014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
202
203 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
204 * plugin.h: add lock definition
205
9726c3c1
HS
2062014-10-29 Han Shen <shenhan@google.com>
207 Jing Yu <jingyu@google.com>
208
209 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
210 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
211 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
212 Symbol::TLS_REF.
213 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
214 method.
215 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
216 (Target_aarch64::tls_ld_to_le): New method.
217 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
218 for 64bit targets.
219 (Output_data_plt_aarch64::irelative_rel_): New data member.
220 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
221 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
222 (Output_data_plt_aarch64::add_relocation): New method.
223 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
224 offset. Add got_irelative size to got size.
225 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
226 type string with the new typename.
227 (AArch64_relocate_functions::update_adr): Replace parameter x with
228 immed.
229 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
230 (AArch64_relocate_functions::reloc_common): New method.
231 (AArch64_relocate_funcsions::rela_general): Extract common part out
232 into reloc_common method.
233 (AArch64_relocate_functions::rela_general): Likewise.
234 (AArch64_relocate_functions::pcrela_general): Likewise.
235 (AArch64_relocate_functions::adr): New method.
236 (AArch64_relocate_functions::adrp): Calculate immed before calling
237 update_adr.
238 (AArch64_relocate_functions::adrp): Likewise.
239 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
240 comparing x to 0. Calculate immed from ~x when x < 0.
241 (Target_aarch64::optimize_tls_reloc): Add new cases for
242 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
243 TLSLD_MOVW_DTPREL_G0_NC.
244 (Target_aarch64::possible_function_pointer_reloc): Implement this
245 method.
246 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
247 comment.
248 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
249 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
250 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
251 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
252 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
253 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
254 (Target_aarch64::make_plt_entry): Call add_entry with two more
255 parameters.
256 (Target_aarch64::make_local_ifunc_plt_entry): New method.
257 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
258 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
259 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
260 (Target_aarch64::Relocate::relocate_tls): Add cases for
261 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
262 TLSLD_MOVW_DTPREL_G0_NC.
263 * testsuite/icf_safe_so_test.cc: Correct test comment.
264 * testsuite/icf_safe_test.sh: Add AArch64 arch.
265
80272b8c
AM
2662014-10-22 Alan Modra <amodra@gmail.com>
267
268 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
269 thread_starter.
270
998a69f4
AS
2712014-10-18 Andreas Schwab <schwab@linux-m68k.org>
272
273 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
274
aed56ec5
CC
2752014-10-17 Cary Coutant <ccoutant@google.com>
276
277 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
278 Add "typename" keyword.
279
bb779192 2802014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
281 Jing Yu <jingyu@google.com>
282
283 Patch for gold aarch64 backend to support relaxation.
284 * aarch64-reloc.def: Change format.
285 * aarch64.cc (class Reloc_stub): New class.
286 (class Stub_table): New class.
287 (class AArch64_relobj): New class.
288 (class AArch64_input_section): New class.
289 (class AArch64_output_section): New class.
290 (Target_aarch64::new_stub_table): New method.
291 (Target_aarch64::new_aarch64_input_section): New method.
292 (Target_aarch64::find_aarch64_input_section): New method.
293 (Target_aarch64::scan_section_for_stubs): New method.
294 (Target_aarch64::scan_reloc_section_for_stubs): New method.
295 (Target_aarch64::relocate_stub): New method.
296 (Target_aarch64::current_target): New method.
297 (Target_aarch64::do_make_elf_object): New method.
298 (Target_aarch64::do_may_relax): New method.
299 (Target_aarch64::do_relax): New method.
300 (Target_aarch64::group_sections): New method.
301 (Target_aarch64::scan_reloc_for_stub): New method.
302 (Target_aarch64::do_make_output_section): New method.
303 (Target_aarch64::stub_tables_): New data member.
304 (Target_aarch64::aarch64_input_section_map_): New data member.
305 (AArch64_relocate_functions::maybe_apply_stub): New method.
306
db4c9594
CC
3072014-09-30 Cary Coutant <ccoutant@google.com>
308
309 PR gold/17432
310 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
311
cd6da036
KC
3122014-09-30 Kito Cheng <kito@0xlab.org>
313
314 PR gold/13597
315 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
316 hash table before sysv-style hash table.
317
5f772412
ST
3182014-09-29 Sriraman Tallam <tmsriram@google.com>
319
320 * options.h (--pic-executable): Add negative to alias to -no-pie.
321
5efeedf6
CC
3222014-09-26 Cary Coutant <ccoutant@google.com>
323
324 PR gold/16773
325 * object.cc (Sized_relobj_file): Compute value of section symbols
326 for TLS sections the same as TLS symbols.
327
1707f183
CC
3282014-09-25 Cary Coutant <ccoutant@google.com>
329
330 PR gold/17432
331 * resolve.cc (Symbol_table::resolve): Override common placeholder
332 symbols, but adjust sizes.
333 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
334 symbols to common lists.
335
00cac886
AM
3362014-09-24 Alan Modra <amodra@gmail.com>
337
338 * po/POTFILES.in: Regenerate.
339
635aa30e
CC
3402014-09-23 Taiju Tsuiki <tzik@google.com>
341 Cary Coutant <ccoutant@google.com>
342
71b9b91b 343 PR gold/14860
635aa30e
CC
344 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
345 on input_sections_blocker.
346 * layout.cc (Write_sections_task::locks): Unblock
347 input_sections_blocker_.
348 * layout.h (Write_sections_task::Write_sections_task): Add
349 input_sections_blocker.
350 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
351 to DEPENDENCIES.
352 * testsuite/Makefile.in: Regenerate.
353
c0c71592
RÁE
3542014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
355
356 * testsuite/Makefile.am (plugin_test_10): New test.
357 * testsuite/Makefile.in: Regenerate
358 * testsuite/plugin_common_test_2.c (c1): Align to 8.
359 * testsuite/plugin_test_10.sh: New file.
360
6168c2a1
RÁE
3612014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
362
363 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
364 * resolve.cc (Symbol_table::resolve): Don't override common symbols
365 during the replacement phase.
366
3a531937
JY
3672014-09-17 Han Shen <shenhan@google.com>
368 Jing Yu <jingyu@google.com>
369
370 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
371 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
372 * aarch64.cc (Target_aarch64): Add data members
373 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
374 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
375 constructor.
376 (Target_aarch64::do_reloc_symbol_index): New method.
377 (Target_aarch64::do_reloc_addend): New method.
378 (Target_aarch64::add_tlsdesc_info): New method.
379 (Target_aarch64::do_dynsym_value): New method.
380 (Target_aarch64::do_make_data_plt): Add new parameters: got,
381 got_irelative. Pass them to Output_data_plt_aarch64_standard.
382 (Target_aarch64::make_data_plt): Add new parameters: got,
383 got_irelative. Pass them to do_make_data_plt.
384 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
385 (Target_aarch64::Relocate:tls_gd_to_le): New method.
386 (Target_aarch64::Relocate:tls_ie_to_le): New method.
387 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
388 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
389 (Target_aarch64::got_tlsdesc_section): New method.
390 (Target_aarch64::make_local_ifunc_plt_entry): New method.
391 (Target_aarch64::define_tls_base_symbol): New method.
392 (Target_aarch64::reserve_tlsdesc_entries): New method.
393 (Target_aarch64::got_mod_index_entry): New method.
394 (Target_aarch64::rela_tlsdesc_section): New method.
395 (Target_aarch64::rela_irelative_section): New method.
396 (Target_aarch64::Tlsdesc_info): New struct.
397 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
398 relocations and tlsdesc relocations.
399 (Target_aarch64::optimize_tls_reloc): Implement method.
400 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
401 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
402 in constructor.
403 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
404 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
405 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
406 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
407 (Output_data_plt_aarch64::rela_tlsdesc): New method.
408 (Output_data_plt_aarch64::rela_irelative): New method.
409 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
410 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
411 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
412 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
413 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
414 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
415 (Output_data_plt_aarch64_standard): New member variables:
416 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
417 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
418 New parameter: got, got_irelative.
419 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
420 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
421 (Output_data_plt_aarch64::do_write): Replace got_address with
422 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
423 (AArch64_relocate_functions::update_movnz): New method.
424 (AArch64_relocate_functions): Correct format.
425 (AArch64_relocate_functions::movnz): New method.
426 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
427 before the switch. Add new cases to switch.
00cac886 428 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
429 tlsgd tlsdesc cases.
430 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
431 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
432 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
433 Call reloc_name_in_error_message to print unsupported reloc.
434 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
435 make_data_plt.
436 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
437 relocs. Fill in some more dynamic tags.
438 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
439 Skip call tls_get_addr when tlsgd is relaxed.
440 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
441 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
442 tlsdesc->ie relaxation.
443
62661c93
SS
4442014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
445
446 * mips.cc (Target_mips_nacl): New class.
447 (Target_selector_mips_nacl): New class.
448 (target_selector_mips32): Rename from target_selector_mips32be and use
449 Target_selector_mips_nacl instead of Target_selector_mips.
450 (target_selector_mips32el): Rename from target_selector_mips32 and use
451 Target_selector_mips_nacl instead of Target_selector_mips.
452 (target_selector_mips64): Rename from target_selector_mips64be and use
453 Target_selector_mips_nacl instead of Target_selector_mips.
454 (target_selector_mips64el): Rename from target_selector_mips64 and use
455 Target_selector_mips_nacl instead of Target_selector_mips.
456 (Target_mips::mips_info): Add const attribute.
457
54674d38
CC
4582014-09-02 Cary Coutant <ccoutant@google.com>
459
460 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
461 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
462 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
463 (Sized_incr_dynobj::do_section_name): Likewise.
464 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
465 (Sized_incr_dynobj::do_section_name): Likewise.
466 * object.h (Object::section_name): Likewise.
467 (Object::do_section_name): Likewise.
468 (Sized_relobj_file::do_section_name): Likewise.
469 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
470 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
471
9860cbcf
CC
4722014-09-02 Cary Coutant <ccoutant@google.com>
473
474 PR gold/17005
475 * ehframe.cc (Fde::write): Add output_offset parameter.
476 (Cie::write): Likewise.
477 (Eh_frame::set_final_data_size): Account for offset within output
478 section.
479 (Eh_frame::do_sized_write): Likewise.
480 * ehframe.h (Fde::write): Add output_offset parameter.
481 (Cie::write): Likewise.
482 * output.cc (Output_section::Input_section_sort_entry): Remove
483 section_has_name_; add output_section_name parameter. Use
484 output section name for non-input sections.
485 (Output_section::Input_section_sort_entry::section_has_name): Remove.
486 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
487 (Output_section::Input_section_sort_compare): Remove logic for
488 sections without names.
489 (Output_section::Input_section_sort_init_fini_compare): Likewise.
490 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
491 Likewise.
492 (Output_section::Input_section_sort_section_name_compare): Likewise.
493
8e33481e
HS
4942014-08-29 Han Shen <shenhan@google.com>
495 Jing Yu <jingyu@google.com>
496
497 * aarch64-reloc-property.cc
498 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
499 reference reloc property in the table.
500 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
501 3 other entries.
502 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
503 2 new overloaded methods.
504 (Output_data_got_aarch64::do_write): Add code to write out
505 static relocs.
506 (class Output_data_got_aarch64::Static_reloc): New class to wrap
507 static relocs.
508 (Output_data_got_aarch64::static_relocs): New vector to
509 hold static relocs.
510 (Target_aarch64::TCB_SIZE): New const static memeber.
511 (Target_aarch64::tcb_size): New method.
512 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
513 (Target_aarch64::Relocate::relocate_tls): New method.
514 (Target_aarch64::Scan::local): Add code handling new reloc types.
515 (Target_aarch64::Scan::global): Add code handling new reloc types.
516
81233653
ST
5172014-08-13 Sriraman Tallam <tmsriram@google.com>
518
519 * options.h (-no-pie): Add option.
520
9363c7c3
JY
5212014-08-08 Jing Yu <jingyu@google.com>
522 Han Shen <shenhan@google.com>
523
524 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
525 (DEFFILES): add aarch64-reloc.def.
526 (TARGETSOURCES): Add aarch64-reloc-property.cc.
527 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
528 * Makefile.in: Regenerate.
529 * aarch64-reloc-property.cc: New file.
530 * aarch64-reloc-property.h: New file.
531 * aarch64-reloc.def: New file.
532 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
533 with tab to make the format consistent.
534 (Output_data_got_aarch64::symbol_table_): New method.
535 (Target_aarch64::do_plt_address_for_global): New method.
536 (Target_aarch64::do_plt_address_for_local): New method.
537 (Target_aarch64::do_select_as_default_target): New method.
538 (Target_aarch64::do_make_data_plt): New method.
539 (Target_aarch64::make_data_plt): New method.
540 (Output_data_plt_aarch64::has_irelative_section): New method.
541 (Output_data_plt_aarch64::address_for_global): New method.
542 (Output_data_plt_aarch64::address_for_local): New method.
543 (Output_data_plt_aarch64::irelative_rel_): New parameter.
544 (Output_data_plt_aarch64::add_entry): Implement contents.
545 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
546 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
547 the got_pov entry to plt0.
548 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
549 Implement contents.
550 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
551 (AArch64_howto): New struct.
552 (aarch64_howto[]): New static const array.
553 (AArch64_relocate_functions): New class.
554 (Target_aarch64::Scan::get_reference_flags): Remove method.
555 (Target_aarch64::Scan::local): Implement to support a few relocations.
556 (Target_aarch64::Scan::global): Implement to support a few relocations.
557 (Target_aarch64::make_plt_section): Implement contents.
558 (Target_aarch64::make_plt_entry): Implement contents.
559 (Target_aarch64::do_finalize_sections): Implement contents.
560 (Target_aarch64::Relocate::relocate): Implement a few relocations.
561 (Target_aarch64::relocate_section): Implement contents.
562
ad9fe6c1
AM
5632014-08-06 Alan Modra <amodra@gmail.com>
564
565 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
566
7cd4e5b7
AM
5672014-08-06 Alan Modra <amodra@gmail.com>
568
569 PR 13227
570 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
571
5ad9b0a7
ST
5722014-07-21 Sriraman Tallam <tmsriram@google.com>
573
574 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 575 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 576
e051745c
CC
5772014-07-08 Cary Coutant <ccoutant@google.com>
578
579 * expression.cc (struct Expression::Expression_eval_info): Add
580 new fields type_pointer, vis_pointer, and nonvis_pointer.
581 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
582 nonvis_pointer parameters. Adjust all calls.
583 (Symbol_expression::value): Update type, visibility, and nonvis bits
584 in caller.
585 * script.cc (Symbol_assignment::sized_finalize): Update type,
586 visibility, and remaining st_other bits for new symbol.
587 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
588 vis_pointer, and nonvis_pointer parameters.
589 * symtab.h (Symbol::set_type): New method.
590
591 * testsuite/Makefile.am (defsym_test): New test.
592 * testsuite/Makefile.in: Regenerate.
593 * testsuite/defsym_test.c: New file.
594 * testsuite/defsym_test.sh: New file.
595
f35c4853
CC
5962014-07-08 Cary Coutant <ccoutant@google.com>
597
598 PR gold/15639
599 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
600 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
601 (Sized_dynobj::base_read_symbols): ...new method.
602 * object.h (Sized_relobj_file::base_read_symbols): New method.
603 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
604 (Sized_relobj_file::base_read_symbols): ...new method.
605 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
606 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
607 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
608
2900af2d
AM
6092014-07-04 Alan Modra <amodra@gmail.com>
610
611 * po/POTFILES.in: Regenerate.
612
053a4d68
JY
6132014-07-02 Jing Yu <jingyu@google.com>
614
615 * aarch64.cc: New file
616 * Makefile.am (TARGETSOURCES): Add aarch64.cc
617 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
618 * Makefile.in: Regenerate.
619 * configure.tgt: Add entries for aarch64*.
620 * configure.ac: Likewise.
621 * configure: Likewise.
622
7b549045
AM
6232014-06-27 Alan Modra <amodra@gmail.com>
624
625 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
626
cb818dbf
CC
6272014-06-24 Cary Coutant <ccoutant@google.com>
628
629 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
630 sections.
631 (Dwo_file::sized_read_unit_index): Likewise.
632
9810d34d
SS
6332014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
634
635 * mips.cc: New file.
636 * Makefile.am (TARGETSOURCES): Add mips.cc
637 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
638 * configure.tgt: Add entries for mips*.
639 * configure.ac: Likewise.
640 * Makefile.in: Regenerate.
641 * configure: Likewise.
642
9baa787b
CC
6432014-06-09 Cary Coutant <ccoutant@google.com>
644
645 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
646 unit_length is within section bounds.
647
8f89af0a
CC
6482014-06-09 Cary Coutant <ccoutant@google.com>
649
650 PR gold/16980
651 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
652 map.
653
a47622ac
AM
6542014-06-07 Alan Modra <amodra@gmail.com>
655
656 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
657
4320c691
CC
6582014-06-06 Cary Coutant <ccoutant@google.com>
659
660 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
661 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
662 (Dwarf_pubnames_table::read_header): Likewise.
663 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
664 .debug_gnu_pubtypes.
665
270c9937
JB
6662014-06-05 Joel Brobecker <brobecker@adacore.com>
667
668 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
669 * Makefile.in, configure: Regenerate.
670
397998fc
AM
6712014-06-03 Alan Modra <amodra@gmail.com>
672
673 * powerpc.cc (addis_12_2): Define.
674 (Stub_table::do_write): Support fusion on ELFv2 stubs.
675
61f5c66f
AM
6762014-06-03 Alan Modra <amodra@gmail.com>
677
678 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
679 st_other output.
680
f6971787
AM
6812014-06-02 Alan Modra <amodra@gmail.com>
682
683 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
684 Only ignore relocs on ELFv1.
685 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
686
f6fb8322
CC
6872014-05-30 Cary Coutant <ccoutant@google.com>
688
689 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
690 * testsuite/Makefile.in: Regenerate.
691 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
692
c23dd342
L
6932014-05-27 H.J. Lu <hongjiu.lu@intel.com>
694
695 PR gold/16945
696 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
697 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
698
5fe7ffdc
AM
6992014-05-15 Alan Modra <amodra@gmail.com>
700
701 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
702 Compare FDE contents with DW_CFA_nop rather than 0.
703
a82bef93
ST
7042014-05-13 Sriraman Tallam <tmsriram@google.com>
705
706 * symtab.h (may_need_copy_reloc): Remove check for position independent
707 code.
708 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
709 position independence before pc absolute may_need_copy_reloc call.
710 Add check for executable output befor pc relative may_need_copy_reloc
711 call.
712 * i386.cc: Ditto.
713 * arm.cc: Ditto.
714 * sparc.cc: Ditto.
715 * tilegx.cc: Ditto.
716 * powerpc.cc: Add check for no position independence before
717 may_need_copy_reloc calls.
718 * testsuite/pie_copyrelocs_test.cc: New file.
719 * testsuite/pie_copyrelocs_shared_test.cc: New file.
720 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 721 * Makefile.in: Regenerate.
a82bef93 722
53c66605
ML
7232014-05-08 Martin Liška <mliska@suse.cz>
724
725 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
726
57b2284c
CC
7272014-05-06 Cary Coutant <ccoutant@google.com>
728
729 PR gold/16900
730 * i386.cc (Output_data_got_plt_i386): New class.
731 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
732 parameter. Change all callers.
733 (Output_data_plt_i386::layout_): Remove.
734 (Output_data_plt_i386::got_plt_): Change type.
735 (Target_i386::got_plt_): Change type. Change all references.
736 (Target_i386::got_section): Create instance of new class.
737 (Output_data_got_plt_i386::do_write): New function.
738 * x86_64.cc (Output_data_got_plt_x86_64): New class.
739 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
740 parameter. Change all callers.
741 (Output_data_plt_x86_64::layout_): Remove.
742 (Output_data_plt_x86_64::got_plt_): Change type.
743 (Target_x86_64::got_plt_): Change type. Change all references.
744 (Target_x86_64::got_section): Create instance of new class.
745 (Output_data_got_plt_x86_64::do_write): New function.
746 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
747 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
748 class.
749
6b97515d 7502014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 751
6b97515d
CC
752 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
753 if we have pubnames/pubtypes.
754
d1bddd3c
CC
7552014-05-02 Cary Coutant <ccoutant@google.com>
756
5fe7ffdc
AM
757 * defstd.cc (in_segment): Define __ehdr_start here...
758 * layout.cc (Layout::finalize): ...Instead of here. Set the
759 output segment when known.
760 * resolve.cc (Symbol::override_base_with_special): Remember
761 the original binding.
762 * symtab.cc (Symbol::set_output_segment): New function.
763 (Symbol::set_undefined): New function.
764 * symtab.h (Symbol::is_weak_undefined): Check original undef
765 binding.
766 (Symbol::is_strong_undefined): New function.
767 (Symbol::set_output_segment): New function.
768 (Symbol::set_undefined): New function.
769 * target-reloc.h (is_strong_undefined): Remove.
770 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
771 Check for hidden undefs.
772 (relocate_section): Call Symbol::is_strong_undefined.
773
774 * testsuite/Makefile.am (ehdr_start_test_1)
775 (ehdr_start_test_2, ehdr_start_test_3)
776 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
777 * testsuite/Makefile.in: Regenerate.
778 * testsuite/ehdr_start_def.cc: New source file.
779 * testsuite/ehdr_start_test.cc: New source file.
780 * testsuite/ehdr_start_test.t: New linker script.
781 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 782
7849f6d8
CC
7832014-04-23 Cary Coutant <ccoutant@google.com>
784
bf2cc635 785 PR gold/16870
7849f6d8
CC
786 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
787
99fd8cff
CC
7882014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
789
790 * layout.cc (Layout::include_section): Allow a target to decide
791 whether to include a section.
792 * target.h (Target::should_include_section): New function.
793 (Target::do_should_include_section): New function.
794
91f43acd
CC
7952014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
796
797 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
798 inline into ...
799 (Copy_relocs::emit): ... here.
800 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
801 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
802 (Copy_reloc_entry::entries_): Change from private to protected.
803
c4eb27e1
ST
8042014-04-02 Sriraman Tallam <tmsriram@google.com>
805
806 * icf.cc (get_section_contents): Replace copies of reloc
807 vectors with const references.
808
ae447ddd
CC
8092014-04-02 Cary Coutant <ccoutant@google.com>
810
811 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
812 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
813 * configure: Regenerate.
814 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
815 -fno-use-linker-plugin.
816 (LINK1, CXXLINK1): Add it to the link command.
817 * testsuite/Makefile.in: Regenerate.
818
fa47fa92
AM
8192014-03-12 Alan Modra <amodra@gmail.com>
820
821 * Makefile.in: Regenerate.
822
9b12c500
CC
8232014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
824
825 * symtab.h (Symbol::set_nonvis): New function.
826
beacaa96
CC
8272014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
828
829 * symtab.cc (Sized_symbol<32>::init_output_data):
830 Instantiate the template.
831 (Sized_symbol<64>::init_output_data): Likewise.
832
800d9823
CC
8332014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
834
835 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
836 adjust dynamic symbol value.
837 * target.h (Target::adjust_dyn_symbol): New function.
838 (Target::do_adjust_dyn_symbol): New function.
839
918fc1f8 8402014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 841
918fc1f8
CC
842 * output.cc (Output_data_dynamic::Dynamic_entry::write):
843 Get the value of DYNAMIC_CUSTOM dynamic entry.
844 * output.h (Output_data_dynamic::add_custom): New function.
845 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
846 dynamic entry.
847 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
848 * target.h (Target::dynamic_tag_custom_value): New function.
849 (Target::do_dynamic_tag_custom_value): New function.
850
98ff9231
CC
8512014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
852
853 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
854 dynsym indexes.
855 * target.h (Target::has_custom_set_dynsym_indexes): New function.
856 (Target::do_has_custom_set_dynsym_indexes): New function.
857 (Target::set_dynsym_indexes): New function.
858 (Target::do_set_dynsym_indexes): New function.
859
b80eed39
AM
8602014-03-07 Alan Modra <amodra@gmail.com>
861
862 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
863 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
864 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
865 (Powerpc_relocate_functions::has_overflow_bitfield,
866 overflowed): Use the above.
867 (Target_powerpc::Relocate::relocate): Correct overflow checking
868 for a number of relocations. Modify overflow test for 16-bit
869 fields in instructions to signed/unsigned according to whether
870 the field takes a signed or unsigned value.
871
4b95cf5c
AM
8722014-03-05 Alan Modra <amodra@gmail.com>
873
874 Update copyright years.
875
45965137
AM
8762014-03-05 Alan Modra <amodra@gmail.com>
877
878 * powerpc.cc (Target_powerpc::Scan::local, global): Support
879 R_PPC64_ADDR64_LOCAL.
880 (Target_powerpc::Relocate::relocate): Likewise.
881
2c80b753
AM
8822014-03-03 Alan Modra <amodra@gmail.com>
883
884 * dwp.cc (print_version): Update copyright year to current.
885
c1c69e83
AM
8862014-02-10 Alan Modra <amodra@gmail.com>
887
888 * po/gold.pot: Regenerate.
889
dd0c4e70
CC
8902014-02-06 Cary Coutant <ccoutant@google.com>
891
892 Fix problem where -u is ignored when a weak undef is seen.
893
894 * archive.cc (Library_base::should_include_member): Reorder
895 code to check for -u option if a weak undef has already been seen.
896 * testsuite/Makefile.am (weak_undef_test_2): New test case.
897 * testsuite/Makefile.in: Regenerate.
898 * testsuite/weak_undef_file3.cc: New file.
899 * testsuite/weak_undef_file4.cc: New file.
900 * testsuite/weak_undef_test_2.cc: New file.
901
1a221d3d
CC
9022014-02-05 Cary Coutant <ccoutant@google.com>
903
904 Fix issues with gold undefined symbol diagnostics.
905
906 PR binutils/15435
907 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
908 check to here.
909 * target-reloc.h (is_strong_undefined): New function.
910 (relocate_section): Move undef vtable symbol check from here.
911 Check for is_strong_undefined.
912
e889f0a4 9132014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 914
e889f0a4
CC
915 Fix problems with the --dynamic-list option.
916
917 PR gold/13577
918 * options.cc (General_options::parse_dynamic_list):
919 Set have_dynamic_list_.
920 (General_options::General_options): Initialize have_dynamic_list_.
921 (General_options::finalize): Turn off -Bsymbolic and
922 -Bsymbolic-functions if --dynamic-list provided.
923 * options.h (General_options::have_dynamic_list): New function.
924 (General_options::have_dynamic_list_): New data member.
925 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
926 correctly.
5fe7ffdc 927
e889f0a4
CC
928 PR gold/16530
929 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
930 in --dynamic-list, mark it.
5fe7ffdc 931
e889f0a4
CC
932 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
933 (dynamic_list_2): New test case.
934 * testsuite/Makefile.in: Regenerate.
935 * testsuite/dynamic_list_2.cc: New file.
936 * testsuite/dynamic_list_2.t: New file.
937 * testsuite/dynamic_list_lib1.cc: New file.
938 * testsuite/dynamic_list_lib2.cc: New file.
939 * testsuite/gc_dynamic_list_test.c: New file.
940 * testsuite/gc_dynamic_list_test.sh: New file.
941 * testsuite/gc_dynamic_list_test.t: New file.
942
ec673e64
CC
9432014-01-28 Cary Coutant <ccoutant@google.com>
944
945 Add .gdb_index version 7 support.
946
947 * gold/dwarf_reader.cc: include <utility> (for make_pair).
948 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
949 debug sections.
950 (Dwarf_ranges_table::read_ranges_table): Likewise.
951 (Dwarf_pubnames_table::read_section): Check for GNU-style
952 sections, and for compressed debug sections.
953 (Dwarf_pubnames_table::read_header): Compute end address of table.
954 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
955 for end of list by offset, not by offset == 0.
956 (Dwarf_info_reader::do_read_string_table): Check for compressed
957 debug sections.
958 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
959 Initialize new data members.
960 (Dwarf_pubnames_table::next_name): return flag_byte.
961 (Dwarf_pubnames_table::end_of_table_): New data member.
962 (Dwarf_pubnames_table::is_gnu_style_): New data member.
963 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
964 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
965 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
966 read skeleton type unit DIEs.
967 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
968 (Gdb_index::do_write): Write flag_byte.
969 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
970 (Gdb_index::Cu_vector): Store flags along with cu indexes.
971 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
972 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
973
221fd5d5
L
9742014-01-08 H.J. Lu <hongjiu.lu@intel.com>
975
976 * version.cc (print_version): Update copyright year to 2014.
977
6c09fb0b
ILT
9782013-12-19 Dimitry Andric <dimitry@andric.com>
979
980 * stringpool.cc (Stringpool_template::reserve): Add
981 HAVE_UNORDERED_MAP case.
982 * stringpool.cc (Stringpool_template::print_stats): Likewise.
983
8356f2d0
CC
9842013-12-18 Cary Coutant <ccoutant@google.com>
985
986 * configure.ac: Check for <unordered_set> and <unordered_map>.
987 * config.in: Regenerate.
988 * configure: Regenerate.
989 * system.h: Use <unordered_set> and <unordered_map> if available.
990
f2c7d7ee
RM
9912013-12-10 Roland McGrath <mcgrathr@google.com>
992
993 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
994 with $(INSTALL_PROGRAM_ENV).
995 * Makefile.in: Regenerate.
996
6632e8cc
CC
9972013-11-22 Cary Coutant <ccoutant@google.com>
998
999 * configure.ac: Add check for which library is needed for
1000 dlopen.
1001 * configure: Regenerate.
1002
0c075858
CC
10032013-11-22 Cary Coutant <ccoutant@google.com>
1004
1005 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1006 assembler.
1007 * testsuite/Makefile.in: Regenerate.
1008
f49fe902
L
10092013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1010
1011 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1012 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1013 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1014 (Target_x86_64<size>::Scan::local): Likewise.
1015 (Target_x86_64<size>::Scan::global): Likewise.
1016 (Target_x86_64<size>::Relocate::relocate): Likewise.
1017 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1018 Likewise.
1019 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1020 R_X86_64_PC32_BND.
1021
1022 * testsuite/Makefile.am (check_PROGRAMS): Add
1023 exception_x86_64_bnd_test.
1024 (exception_x86_64_bnd_test_SOURCES): New macro.
1025 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1026 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1027 (exception_x86_64_bnd_test_LDADD): Likewise.
1028 (exception_x86_64_bnd_1.o): New rule.
1029 (exception_x86_64_bnd_2.o): Likewise.
1030 * testsuite/Makefile.in: Regenerated.
1031
9055360d
AM
10322013-11-15 Alan Modra <amodra@gmail.com>
1033
1034 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1035 accessor.
1036 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1037 Only call ppc64_local_entry_offset for 64-bit. Restrict
1038 symval_for_branch lookup to ELFv1.
1039 (Stub_table::add_plt_call_entry): Use unsigned int off.
1040 (Output_data_glink::Address, invalid_address): New.
1041 (Output_data_glink::add_eh_frame): Move out of line. Add
1042 support for ELFv2.
1043 (Output_data_glink::add_global_entry, find_global_entry,
1044 global_entry_address): New functions.
1045 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1046 ge_size): New variables.
1047 (Output_data_glink::set_final_data_size): Add global entry
1048 stub sizing.
1049 (Output_data_glink::do_write): Write global entry stubs.
1050 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1051 parameter. Return true for ELFv2. Adjust callers.
1052 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1053 ELFv1. Similarly for ifunc and dynamic relocation processing
1054 specific to ELFv1. Recognize that symbols are defined on
1055 their plt entries for ELFv2.
1056 (Target_powerpc::symval_for_branch): Assert if called for
1057 ELFv2 or ppc32.
1058 (Target_powerpc::Relocate::relocate): Use global entry plt
1059 stub for symbol value if such exists on ELFv2.
1060 (Target_powerpc::Relocate::relocate): Don't call
1061 symval_for_branch when ELFv2. Do adjust for local entry
1062 offset when ELFv2.
1063 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1064 plt stub for ELFv2.
1065 (Target_powerpc::do_plt_address_for_global): Similarly.
1066
cafdd569
CC
10672013-11-14 Cary Coutant <ccoutant@google.com>
1068
1069 Revert patch -- this did not fix the problem, and there is
1070 no race there.
1071
1072 2013-11-14 Cary Coutant <ccoutant@google.com>
1073
1074 PR gold/14860
1075 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1076 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1077 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1078 updating fde_offsets_.
1079 (Eh_frame_hdr::lock_): New data member.
1080
94e49e16
CC
10812013-11-14 Cary Coutant <ccoutant@google.com>
1082
1083 * dwp.cc (Dwo_file_entry): New type.
1084 (File_list): Use Dwo_file_entry.
1085 (Dwo_file::verify): New function.
1086 (Dwo_file::verify_dwo_list): New function.
1087 (Dwo_file::sized_verify_dwo_list): New function.
1088 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1089 list.
1090 (Dwp_options): New enum type.
1091 (dwp_options): Add --verify-only.
1092 (usage): Likewise.
1093 (main): Likewise.
1094 * dwp.h (gold_info): Add declaration.
1095
7cdd7d57
CC
10962013-11-14 Cary Coutant <ccoutant@google.com>
1097
1098 PR gold/14860
1099 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1100 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1101 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1102 updating fde_offsets_.
1103 (Eh_frame_hdr::lock_): New data member.
1104
1d946cb3
CC
11052013-11-06 Cary Coutant <ccoutant@google.com>
1106
1107 PR gold/15758
1108 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1109 before reloc sections.
1110
4f65b40e
AM
11112013-11-04 Alan Modra <amodra@gmail.com>
1112
1113 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1114 (Symbol::needs_dynamic_reloc): Test new flag.
1115 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1116 (Target_powerpc::Scan::get_reference_flags): Add target param.
1117 Return FUNC_DESC_ABI for 64-bit ELFv1.
1118 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1119 call.
1120 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1121 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1122
908794a9
CC
11232013-10-31 Cary Coutant <ccoutant@google.com>
1124
1125 Restore support for dwp v2 DWARF package file format.
1126
1127 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1128 tu_length parameter. Adjust all callers.
1129 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1130 * dwp.cc: Include dwarf.h.
1131 (Section_bounds): New struct type.
1132 (Unit_set): New struct type.
1133 (Dwo_file::Dwo_file): Initialize new data member.
1134 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1135 Combine and rename to...
1136 (Dwo_file::read_unit_index): ...this.
1137 (Dwo_file::sized_read_compunit_index)
1138 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1139 (Dwo_file::sized_read_unit_index): ...this.
1140 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1141 parameters; add section_id parameter.
1142 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1143 (Dwo_file::add_unit_set): ...this.
1144 (Dwo_file::shndx_map_): Remove.
1145 (Dwo_file::sect_offsets_): New data member.
1146 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1147 (Dwp_output_file::add_section): Rename to...
1148 (Dwp_output_file::add_contribution): ...this.
1149 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1150 (Dwp_output_file::add_tu_set): Likewise.
1151 (Dwp_output_file::Contribution): New type.
1152 (Dwp_output_file::Section::contributions): New data member.
1153 (Dwp_output_file::Cu_or_tu_set): Remove.
1154 (Dwp_output_file::Section::Section): New ctor.
1155 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1156 (Dwp_output_file::Dwp_index::Section_table): New type.
1157 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1158 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1159 parameter.
1160 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1161 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1162 (Dwp_output_file::Dwp_index::section_table): New member function.
1163 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1164 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1165 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1166 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1167 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1168 (Dwp_output_file::Dwp_index::section_table_): New data member.
1169 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1170 (Dwp_output_file::add_output_section): New member function.
1171 (Dwp_output_file::write_new_section): New member function.
1172 (Dwp_output_file::write_contributions): New member function.
1173 (Dwp_output_file::section_id_map_): New data member.
1174 (class Dwo_id_info_reader): Remove.
1175 (class Unit_reader): New class.
1176 (get_dwarf_section_name): New function.
1177 (Dwo_file::read_executable): Adjust initializations of class data.
1178 (Dwo_file::read): Add support for v2 package file format.
1179 (Dwo_file::read_unit_index): Likewise.
1180 (Dwo_file::sized_read_unit_index): Likewise.
1181 (Dwo_file::copy_section): Likewise.
1182 (Dwo_file::add_unit_set): Likewise.
1183 (Dwp_output_file::add_output_section): Likewise.
1184 (Dwp_output_file::add_contribution): Likewise.
1185 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1186 for empty slot.
1187 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1188 file format.
1189 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1190 slot.
1191 (Dwp_output_file::initialize): Remove unused function.
1192 (Dwp_output_file::finalize): Add support for v2 package file format.
1193 (Dwp_output_file::write_index): Likewise.
1194 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1195 function prototype.
1196
2500c017
CC
11972013-10-31 Cary Coutant <ccoutant@google.com>
1198
1199 * configure.ac: Fix check for -fmerge-constants.
1200 * configure.ac: Regenerate.
1201
dd0845d7
RM
12022013-10-30 Roland McGrath <mcgrathr@google.com>
1203
1204 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1205 Correct 9-byte nop sequence to match what the assembler generates.
1206
b4f7960d
AM
12072013-10-30 Alan Modra <amodra@gmail.com>
1208
1209 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1210 ppc64_local_entry_offset, ppc64_local_entry_offset,
1211 do_read_symbols): New functions.
1212 (Powerpc_relobj::e_flags_, st_other_): New vars.
1213 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1214 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1215 (Powerpc_relobj::e_flags_): New var.
1216 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1217 and adjust for ELFv2.
1218 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1219 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1220 (Powerpc_dynobj::do_find_special_sections): Likewise.
1221 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1222 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1223 to ELFv2 local entry.
1224 (Target_powerpc::do_relax): No thread safe barriers needed for
1225 ELFv2.
1226 (Output_data_plt_powerpc::initial_plt_entry_size_,
1227 plt_entry_size): Delete. Replace all uses with
1228 first_plt_entry_offset() and plt_entry_size().
1229 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1230 reserved_size parm. Update callers.
1231 (Output_data_plt_powerpc::entry_count): Update.
1232 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1233 and use Target_powerpc::first_plt_entry_offset().
1234 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1235 rename to plt_entry_size.
1236 (Output_data_plt_powerpc::add_ifunc_entry,
1237 add_local_ifunc_entry): Adjust reloc for ELFv2.
1238 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1239 (glink_eh_frame_fde_64v2): New.
1240 (Stub_table::plt_call_size): Support ELFv2 sizing.
1241 (Output_data_glink::add_eh_frame): Use the new FDE.
1242 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1243 (Stub_table::do_write): Write ELFv2 stubs and glink.
1244 (Target_powerpc::Relocate::relocate): Replaces nop after call
1245 with ld 2,24(1) and adjust local offset destination for ELFv2.
1246
f9c6b907
AM
12472013-10-30 Alan Modra <amodra@gmail.com>
1248
1249 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1250 (Target_powerpc::Scan::global, local): Likewise.
1251 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1252 on all ppc64 @h and @ha relocs.
1253
e84fe78f
AM
12542013-10-14 Alan Modra <amodra@gmail.com>
1255
1256 * output.h (Output_data_got::add_constant): Tidy.
1257 (Output_data_got::add_constant_pair): New function.
1258 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1259 methods used so as to first call reserve_ent().
1260
679e4abf
RM
12612013-10-11 Roland McGrath <mcgrathr@google.com>
1262
44dcb735
RM
1263 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1264 add_got_entry and add_got_entry_pair.
1265
13323c49
RM
1266 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1267 (HAVE_PUBNAMES): Likewise.
1268 * configure: Regenerate.
1269
1496b446
RM
1270 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1271 * testsuite/Makefile.in: Regenerate.
1272
cc84c10b
RM
1273 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1274 Remove const from declaration.
1275 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1276 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1277 * output.h (Output_file_header): Remove const from member target_
1278 and corresponding constructor argument.
1279 * output.cc (Output_file_header::Output_file_header): Update prototype.
1280 (Output_file_header::do_sized_write): Use this->target_ in place
1281 of parameters()->target().
1282
52f66a2c
RM
1283 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1284
2b64b551
RM
1285 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1286 * configure: Regenerate.
1287 * Makefile.in: Regenerate.
1288 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1289 * testsuite/merge_string_literals_2.c: Likewise.
1290 * testsuite/Makefile.am
1291 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1292 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1293 literal -fmerge-constants.
1294 * testsuite/Makefile.in: Regenerate.
1295
43819297
RM
1296 * i386.cc (Target_i386): Remove unused member dynbss_.
1297 * arm.cc (Target_arm): Likewise.
1298 * powerpc.cc (Target_powerpc): Likewise.
1299 * sparc.cc (Target_sparc): Likewise.
1300 * tilegx.cc (Target_tilegx): Likewise.
1301 * x86_64.cc (Target_x86_64): Likewise.
1302 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1303 type_signature_, type_offset_.
1304 * plugin.h (Plugin_hook): Remove unused member layout_.
1305 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1306 mapfile_.
1307 (Read_member): Remove unused members input_objects_, symtab_,
1308 mapfile_, layout_.
1309 (Check_library): Remove unused member symtab_.
1310 * archive.h (Lib_group): Remove unused member lib_.
1311 * archive.cc (Lib_group::Lib_group): Update initializer.
1312 * incremental.h (Incremental_binary): Remove unused member target_.
1313 (Incremental_script_entry): Removed unused member script_.
1314 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1315 * icf.h (Icf): Remove unused member num_tracked_relocs.
1316
39d9ead7
RM
1317 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1318 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1319 its only use.
1320 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1321
679e4abf
RM
1322 * archive.h: Use struct rather than class for forward declaration
1323 of Read_symbols_data.
1324
54de2ea6
CC
13252013-10-07 Cary Coutant <ccoutant@google.com>
1326
1327 PR gold/16010
1328 * testsuite/Makefile.am (icf_test): Fix dependencies.
1329 (icf_safe_test): Likewise.
1330 (icf_safe_so_test): Likewise.
1331 (large_symbol_alignment): Add empty _LDADD rule.
1332 * testsuite/Makefile.in: Regenerate.
1333
b14016f0
L
13342013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1335
1336 PR gold/15927
1337 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1338 relocation for R_X86_64_32 on x32.
1339
eb426534
RM
13402013-08-27 Roland McGrath <mcgrathr@google.com>
1341
1342 * output.cc (Output_segment::set_section_addresses): Take new
1343 Target* argument. If target->isolate_execinstr() and the segment
1344 is executable and starts at a target->abi_pagesize() boundary,
1345 pad its end out to a target->abi_pagesize() boundary with code fill.
1346 * output.h (Output_segment::set_section_addresses): Update decl.
1347 * layout.h (Layout::check_output_data_for_reset_values): Take new
1348 argument RELAX_OUTPUTS.
1349 (Layout): New member relax_output_list_.
1350 (Layout::add_relax_output): New method.
1351 * layout.cc (Layout::Layout): Update constructor.
1352 (Layout::reset_relax_output): New method.
1353 (Layout::clean_up_after_relaxation): Call it.
1354 (Layout::prepare_for_relaxation): Update caller.
1355 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1356 Call reset_relax_output before re-processing segments for
1357 isolate_execinstr case.
1358 (Layout::write_data): Handle relax_output_list_.
1359 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1360 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1361
9aff4b7a
NC
13622013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1363
1364 PR binutils/15834
1365 * object.h: Fix typos.
1366
93f8221c
RM
13672013-08-16 Roland McGrath <mcgrathr@google.com>
1368
1369 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1370 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1371
e44c3715
CC
13722013-08-07 Cary Coutant <ccoutant@google.com>
1373
1374 Revert support for v2 DWP files:
1375
1376 2013-03-01 Cary Coutant <ccoutant@google.com>
1377
1378 Add dwp support for v2 DWARF package file format.
1379 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1380 tu_length parameter. Adjust all callers.
1381 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1382 * dwp.cc: Include dwarf.h.
1383 (Section_bounds): New struct type.
1384 (Unit_set): New struct type.
1385 (Dwo_file::Dwo_file): Initialize new data member.
1386 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1387 Combine and rename to...
1388 (Dwo_file::read_unit_index): ...this.
1389 (Dwo_file::sized_read_compunit_index)
1390 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1391 (Dwo_file::sized_read_unit_index): ...this.
1392 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1393 parameters; add section_id parameter.
1394 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1395 (Dwo_file::add_unit_set): ...this.
1396 (Dwo_file::shndx_map_): Remove.
1397 (Dwo_file::sect_offsets_): New data member.
1398 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1399 (Dwp_output_file::add_section): Rename to...
1400 (Dwp_output_file::add_contribution): ...this.
1401 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1402 (Dwp_output_file::add_tu_set): Likewise.
1403 (Dwp_output_file::Contribution): New type.
1404 (Dwp_output_file::Section::contributions): New data member.
1405 (Dwp_output_file::Cu_or_tu_set): Remove.
1406 (Dwp_output_file::Section::Section): New ctor.
1407 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1408 (Dwp_output_file::Dwp_index::Section_table): New type.
1409 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1410 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1411 parameter.
1412 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1413 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1414 (Dwp_output_file::Dwp_index::section_table): New member function.
1415 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1416 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1417 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1418 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1419 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1420 (Dwp_output_file::Dwp_index::section_table_): New data member.
1421 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1422 (Dwp_output_file::add_output_section): New member function.
1423 (Dwp_output_file::write_new_section): New member function.
1424 (Dwp_output_file::write_contributions): New member function.
1425 (Dwp_output_file::section_id_map_): New data member.
1426 (class Dwo_id_info_reader): Remove.
1427 (class Unit_reader): New class.
1428 (get_dwarf_section_name): New function.
1429 (Dwo_file::read_executable): Adjust initializations of class data.
1430 (Dwo_file::read): Add support for v2 package file format.
1431 (Dwo_file::read_unit_index): Likewise.
1432 (Dwo_file::sized_read_unit_index): Likewise.
1433 (Dwo_file::copy_section): Likewise.
1434 (Dwo_file::add_unit_set): Likewise.
1435 (Dwp_output_file::add_output_section): Likewise.
1436 (Dwp_output_file::add_contribution): Likewise.
1437 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1438 for empty slot.
1439 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1440 file format.
1441 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1442 slot.
1443 (Dwp_output_file::initialize): Remove unused function.
1444 (Dwp_output_file::finalize): Add support for v2 package file format.
1445 (Dwp_output_file::write_index): Likewise.
1446 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1447 function prototype.
1448
c6905c28
CC
14492013-07-31 Cary Coutant <ccoutant@google.com>
1450
1451 * object.cc (Sized_relobj::do_output_section_address): New function.
1452 (Sized_relobj): Instantiate explicitly.
1453 * object.h (Object::output_section_address): New function.
1454 (Object::do_output_section_address): New function.
1455 (Sized_relobj::do_output_section_address): New function.
1456 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1457
14582013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1459 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1460
1461 * parameters.cc (Parameters::entry): Return target-specific entry
1462 symbol name.
1463 * target.h (Target::entry_symbol_name): New function.
1464 (Target_info::entry_symbol_name): New data member.
1465
1466 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1467 * i386.cc (Target_i386::i386_info): Likewise.
1468 (Target_i386_nacl::i386_nacl_info): Likewise.
1469 * sparc.cc (Target_sparc::sparc_info): Likewise.
1470 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1471 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1472 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1473 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1474
234d4ab8
SA
14752013-07-22 Sterling Augustine <saugustine@google.com>
1476
1477 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1478 Convert parameter shndx to local variable. Add parameters symtab
1479 and symtab_size. Scan over section names. Find relocation
1480 section corresponding to current section. Create and initialize
1481 reloc_mapper_ and reloc_type_.
1482 (Dwarf_pubnames_table::read_header): Add assertion. Change
1483 unit_length to off_t. Initialize member unit_length_. Fill in field
1484 cu_offset_.
1485 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1486 Initialize new fields unit_length_ and cu_offset_.
1487 (Dwarf_pubnames_table::read_section): Update prototype.
1488 (Dwarf_pubnames_table::cu_offset): New member function.
1489 (Dwarf_pubnames_table::subsection_size): Likewise.
1490 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1491 New fields.
1492 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1493 member functions public.
1494 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1495 Update comment. Rework logic. Move repeated parts to...
1496 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1497 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1498 pubtypes_table_, and stmt_list_offset.
1499 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1500 Gdb_index::find_pubtype_offset,
1501 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1502 (Gdb_index::pubnames_read): Update prototype and rework logic.
1503 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1504 Forward declare.
1505 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1506 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1507 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1508 Gdb_index::map_pubtable_to_dies):
1509 Declare functions.
1510 (Gdb_index::pubnames_read): Update declaration.
1511 (Gdb_index::Pubname_offset_map): New type.
1512 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1513 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1514 Gdb_index::stmt_list_offset): Declare.
1515 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1516 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1517 Gdb_index::pubtypes_offset_): Remove.
1518
a3ed37d8
RM
15192013-07-19 Roland McGrath <mcgrathr@google.com>
1520
1521 * options.h (General_options): Add -Trodata-segment option.
1522 * parameters.cc (Parameters::check_rodata_segment): New function.
1523 (Parameters::set_target_once): Call it.
1524 * parameters.h (Parameters): Declare it (private member function).
1525 * layout.cc (load_seg_unusable_for_headers): New function, broken
1526 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1527 then validate rodata segment rather than text segment.
1528 (relaxation_loop_body): Call that.
1529 (is_text_segment): New function. Don't admit a non-executable
1530 segment if TARGET->isolate_execinstr().
1531 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1532
eb5b4ded
CC
15332013-07-15 Shawn Landden <shawnlandden@gmail.com>
1534
1535 PR gold/15070
1536 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1537 * nacl.h (Sniff_file::View::View): Request aligned view.
1538
4d5effb9
CC
15392013-07-11 Cary Coutant <ccoutant@google.com>
1540
1541 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1542 correct BRLT entry size.
1543
ba8ca3e7
AM
15442013-07-03 Alan Modra <amodra@gmail.com>
1545
1546 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1547 comment.
1548
267257d2
CC
15492013-07-01 Cary Coutant <ccoutant@google.com>
1550
1551 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1552 reloc_type_.
1553 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1554 (Dwarf_ranges_table::lookup_reloc): New function.
1555 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1556 reloc_type_.
1557 (Dwarf_ranges_table::lookup_reloc): New function.
1558 (Dwarf_ranges_table::reloc_type_): New data member.
1559
06f30c9d
CC
15602013-06-27 Jing Yu <jingyu@google.com>
1561
1562 PR gold/15662
1563 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1564 function.
1565 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1566 (Target_powerpc::do_relax): Call the above.
1567
a2d7bf59
AM
15682013-06-27 Cary Coutant <ccoutant@google.com>
1569
1570 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1571 on garbage collected .opd section.
1572
15732013-06-27 Alan Modra <amodra@gmail.com>
1574
1575 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1576 is non-zero.
1577 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1578 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1579
32364e50
CC
15802013-06-14 Cary Coutant <ccoutant@google.com>
1581
1582 * resolve.cc (Symbol::override_base): Don't override st_type
1583 from plugin placeholder symbols.
1584 (Symbol_table::resolve): Likewise.
1585 (Symbol_table::should_override): Don't complain about TLS mismatch
1586 if the TO symbol is a plugin placeholder.
1587 * testsuite/Makefile.am (plugin_test_tls): New test.
1588 * testsuite/Makefile.in: Regenerate.
1589 * testsuite/plugin_test_tls.sh: New test script.
1590 * testsuite/two_file_test_2_tls.cc: New test source.
1591 * testsuite/two_file_test_tls.cc: New test source.
1592
7fb47cc9
CC
15932013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1594
1595 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1596 the maximum segment alignment is larger than the page size.
1597 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1598 correctly aligns the symbols with large alignemnt.
1599 * testsuite/Makefile.in: Regenerate.
1600 * testsuite/large_symbol_alignment.cc: New file.
1601
6934001a
CC
16022013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1603 Sriraman Tallam <tmsriram@google.com>
1604
1605 * options.h (sort_section): New option.
1606 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1607 Rename from Input_section_sort_section_name_special_ordering_compare.
1608 (Input_section_sort_section_name_compare): New struct.
1609 * output.cc (Output_section::Input_section_sort_section_name_compare::
1610 operator()): New function.
1611 (Output_section::sort_attached_input_sections): Use new sort function
1612 for .text if --sort-section=name is specified.
1613 * layout.cc (Layout::make_output_section):
1614 Add sorting by name when --sort-section=name is specified.
1615 * testsuite/Makefile.am (text_section_grouping): Test option
1616 --sort-section=name.
1617 * testsuite/Makefile.in: Regenerate.
1618 * testsuite/section_sorting_name.cc: New file.
1619 * testsuite/section_sorting_name.sh: New file.
1620
93acabad
CC
16212013-05-21 Cary Coutant <ccoutant@google.com>
1622
1623 * symtab.h (Symbol::is_cxx_vtable): New function.
1624 * target-reloc.h (relocate_section): Check for vtable symbol.
1625 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1626 * testsuite/Makefile.in: Regenerate.
1627 * testsuite/missing_key_func.cc: New test source.
1628 * testsuite/missing_key_func.sh: New test script.
1629
60e8b3fc
CC
16302013-05-21 Cary Coutant <ccoutant@google.com>
1631
2b64b551
RM
1632 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1633 type of enclosing symbol.
1634 (Relocate_info::location): Check symbol type when describing symbol.
1635 * object.h (Symbol_location_info): Remove unused line_number;
1636 add enclosing_symbol_type.
1637 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1638
9df9de2c
CC
16392013-05-13 Cary Coutant <ccoutant@google.com>
1640
2b64b551
RM
1641 * configure.ac: Export DEFAULT_TARGET.
1642 * configure: Regenerate.
1643 * Makefile.in: Regenerate.
1644 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1645 * testsuite/Makefile.in: Regenerate.
1646 * testsuite/debug_msg.sh: Delete duplicate tests.
1647 Don't check undef_int error message match for powerpc where the
1648 source file and line number aren't available.
9df9de2c 1649
bbc5ae17
RM
16502013-05-10 Roland McGrath <mcgrathr@google.com>
1651
1652 * options.h (General_options): Add --rosegment-gap option.
1653 * options.cc (finalize): --rosegment-gap implies --rosegment.
1654 * layout.cc (set_segment_offsets): Let user option override
1655 target->rosegment_gap().
1656
0c6e6c39
RM
16572013-05-10 Roland McGrath <mcgrathr@google.com>
1658
1659 * options.h (General_options): Remove leading space from help
1660 messages for -nostdlib and --rosegment.
1661
cde7cb01
MR
16622013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1663
1664 PR ld/15365
1665 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1666
f31ae5b8
AM
16672013-05-03 Alan Modra <amodra@gmail.com>
1668
1669 * merge.cc (Output_merge_string::do_add_input_section): Correct
1670 scan for number of strings. Rename vars to avoid shadowing.
1671 Include missing terminator in input_size_.
1672
d3a7cd45
L
16732013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1674
1675 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1676 Restore empty string handling.
1677
6ad3daba
CC
16782013-05-01 Cary Coutant <ccoutant@google.com>
1679
1680 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1681 uninitialized warning.
1682
e31908b6
CC
16832013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1684
1685 * output.cc (Output_section::add_merge_input_section): Allow
1686 to merge sections if the alignment is more than character size.
1687 * merge.h (Output_merge_string::Output_merge_string): Remove
1688 assert.
1689 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1690 only not-null strings. Check the alignment of strings.
1691 * stringpool.h
1692 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1693 alignment as the argument.
1694 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1695 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1696 Align non-zero length strings according to the addralign_.
1697 (Stringpool_template<Stringpool_char>::set_string_offsets):
1698 Updating offsets according to the given alignment.
1699 * testsuite/Makefile.am (text_section_grouping): Test if string
1700 literals are getting merged.
1701 * testsuite/Makefile.in: Regenerate.
1702 * testsuite/merge_string_literals_1.c: New file.
1703 * testsuite/merge_string_literals_2.c: Ditto.
1704 * testsuite/merge_string_literals.sh: Ditto.
1705
0e804863
ILT
17062013-04-26 Ian Lance Taylor <iant@google.com>
1707
1708 * target-reloc.h (relocate_section): If the reloc offset is out of
1709 range, pass VIEW as NULL to relocate.relocate.
1710 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1711 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1712 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1713 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1714 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1715 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1716
e7c5ea40
CC
17172013-04-26 Geoff Pike <gpike@chromium.org>
1718
1719 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1720 * layout.cc (Hash_task): New class.
1721 (Layout::queue_build_id_tasks): New function.
1722 (Layout::write_build_id): Handle single-thread portion of build ID
1723 computation. (In some cases, all of it is single-threaded.) Replace
1724 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1725 functionality in fewer lines of code.
1726 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1727 * options.h (General_options): make "--build-id" default to tree
1728 rather than sha1. Add two new options related to --build-id=tree:
1729 --build-id-chunk-size-for-treehash and
1730 --build-id-min-file-size-for-treehash.
1731 * Makefile.am: add testing of --build-id=tree and related new options
1732 (these tests will be invoked by "make check").
1733 * Makefile.in: Regenerate.
1734
49926cd0
AM
17352013-04-25 Alan Modra <amodra@gmail.com>
1736
1737 * configure.tgt: Add powerpcle and powerpc64le.
1738
a4034750
AM
17392013-04-22 Alan Modra <amodra@gmail.com>
1740
1741 PR gold/15355
1742 * layout.cc (Layout::segment_precedes): Allow more than one
1743 segment with the same type and flags.
1744
e79c84aa
CC
17452013-04-15 Cary Coutant <ccoutant@google.com>
1746
1747 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1748 allocate space in file for BSS sections.
1749
2199fbe7
CC
17502013-04-15 Cary Coutant <ccoutant@google.com>
1751
1752 * script-sections.cc (Orphan_output_section): Reset address
1753 to zero after each orphaned section for relocatable links.
1754
502e8a84
CC
17552013-04-15 Cary Coutant <ccoutant@google.com>
1756
a4034750
AM
1757 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1758 section starting address for relocatable link.
1759 * testsuite/Makefile.am (script_test_11): New test.
1760 * testsuite/Makefile.in: Regenerate.
1761 * testsuite/script_test_11.c: New source file.
1762 * testsuite/script_test_11.t: New linker script.
502e8a84 1763
0cfdc767
AM
17642013-04-13 Alan Modra <amodra@gmail.com>
1765
1766 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1767 owner when sections are not adjacent and exceed group size.
1768 (Target_powerpc::group_sections): Handle corner case.
1769 (Target_powerpc::Branch_info::make_stub): Handle case where
1770 stub table doesn't exist due to branches in non-exec sections.
1771 (Target_powerpc::Relocate::relocate): Likewise.
1772
6830ee24
AM
17732013-04-11 Alan Modra <amodra@gmail.com>
1774
1775 PR gold/15354
1776 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1777 .branch_lt to match bfd ld. Adjust comments throughout file.
1778
54a3d865
ILT
17792013-04-04 Ian Lance Taylor <iant@google.com>
1780
1781 GCC PR c++/56840
1782 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1783 sections before checking whether they are included in the link.
1784
9993ba11
ST
17852013-03-29 Sriraman Tallam <tmsriram@google.com>
1786
1787 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1788 object before calling the plugin claim_file handler. Pass the elf
1789 object of the archive to the plugin. Delete the elf object if the
1790 plugin claims the file.
1791
ebacd51e
AM
17922013-03-21 Alan Modra <amodra@gmail.com>
1793
1794 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1795 segment when omagic.
1796
117be58f
AM
17972013-03-21 Alan Modra <amodra@gmail.com>
1798
1799 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1800 comparison warning.
1801 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1802 uninitialized" warning.
1803
32e2b61d
AM
18042013-03-20 Alan Modra <amodra@gmail.com>
1805
1806 * symtab.h (Symbol::clear_version): New function.
1807 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1808 is_needed by weak references. Clear version for symbols defined
1809 in as-needed objects that are not needed.
1810
b3ccdeb5
AM
18112013-03-15 Alan Modra <amodra@gmail.com>
1812
1813 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1814 static and public. Add report_err param. Return false for data refs.
1815 (Target_powerpc::rela_dyn_section): New overloaded function.
1816 (Target_powerpc::plt_, iplt_): Elucidate.
1817 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1818 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1819 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1820 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1821 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1822 push_branch and make_plt_entry for ifunc syms when
1823 reloc_needs_plt_for_ifunc.
1824 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1825 for ifunc unless reloc_needs_plt_for_ifunc.
1826
ad3d8a2f
AM
18272013-03-15 Alan Modra <amodra@gmail.com>
1828
1829 * gc.h (gc_process_relocs): Don't look through function descriptors.
1830 * icf.cc (get_section_contents): Do so here instead.
1831
4d9aa155
AM
18322013-03-13 Alan Modra <amodra@gmail.com>
1833
1834 * powerpc.cc (is_branch_reloc): Forward declare.
1835 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1836 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1837 false for 64-bit, true for 32-bit non-branch relocs.
1838 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1839 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1840 nm output.
1841 (icf_safe_test): Generate linker map file as well as nm output.
1842 (icf_safe_so_test): Likewise.
1843 * testsuite/Makefile.in: Regenerate.
1844 * testsuite/icf_test.sh: Parse linker map file to determine
1845 section folding.
1846 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1847 * testsuite/icf_safe_so_test.sh: Likewise.
1848 (X86_32_or_ARM_specific_safe_fold): Merge into..
1849 (arch_specific_safe_fold): ..this.
1850 (X86_64_specific_safe_fold): Delete unused function.
1851
57420c20
AM
18522013-03-12 Alan Modra <amodra@gmail.com>
1853
1854 * gc.h (gc_process_relocs): Look through function descriptors
1855 to determine shndx, symvalue and addend used by ICF. Tidy
1856 variable duplication.
1857
dc3714f3
AM
18582013-03-11 Alan Modra <amodra@gmail.com>
1859
1860 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1861 * layout.cc (Layout_task_runner::run): ..to here.
1862 * symtab.h (struct Symbol_location): Extract from..
1863 (class Symbol_table): ..here.
1864 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1865 * target.h (class Target): Add function_location and
1866 do_function_location functions.
1867 (class Sized_target): Add do_function_location.
1868 * object.h (class Sized_relobj_file): Move find_shdr..
1869 (class Object): ..to here.
1870 * object.cc: Likewise. Update to suit. Instantiate.
1871 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1872 * powerpc.cc (class Powerpc_dynobj): New.
1873 (Target_powerpc::do_function_location): New function.
1874 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1875 (Powerpc_dynobj::do_read_symbols): New function.
1876 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1877
956b03bb
ILT
18782013-03-08 Ian Lance Taylor <iant@google.com>
1879
1880 * options.cc (General_options::string_to_object_format): Accept
1881 "default".
1882
4bead2d5
AM
18832013-03-08 Alan Modra <amodra@gmail.com>
1884
1885 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1886 pointer to Post_fde.
1887 (struct Post_fde): Move definition to here..
1888 * ehframe.cc (struct Post_fde): ..from here.
1889 (Cie::write): Don't alloc Post_fde.
1890 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1891
02e60bf7
AM
18922013-03-07 Alan Modra <amodra@gmail.com>
1893
1894 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1895 relocation referencing .LC0.
1896 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1897
8343f03a
AM
18982013-03-07 Alan Modra <amodra@gmail.com>
1899
1900 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1901 always_inline. Add assembly for powerpc to avoid GOT.
1902
3366d57c
AM
19032013-03-07 Alan Modra <amodra@gmail.com>
1904
1905 * testsuite/script_test_10.sh: Don't test .bss section
1906 header number.
1907
6c77229c
AM
19082013-03-06 Alan Modra <amodra@gmail.com>
1909
1910 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1911 (Target_powerpc::symval_for_branch): Add symtab param. Update
1912 all callers. Handle folded sections.
1913 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1914 to Powerpc_relobj.
1915 (Global_symbol_visitor_opd::operator()): Likewise.
1916
a39e4af6
AM
19172013-03-04 Alan Modra <amodra@gmail.com>
1918
1919 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1920 * testsuite/Makefile.in: Regenerate.
1921
d5834edb
CC
19222013-03-01 Cary Coutant <ccoutant@google.com>
1923
1924 Add dwp support for v2 DWARF package file format.
1925 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1926 tu_length parameter. Adjust all callers.
1927 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1928 * dwp.cc: Include dwarf.h.
1929 (Section_bounds): New struct type.
1930 (Unit_set): New struct type.
1931 (Dwo_file::Dwo_file): Initialize new data member.
1932 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1933 Combine and rename to...
1934 (Dwo_file::read_unit_index): ...this.
1935 (Dwo_file::sized_read_compunit_index)
1936 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1937 (Dwo_file::sized_read_unit_index): ...this.
1938 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1939 parameters; add section_id parameter.
1940 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1941 (Dwo_file::add_unit_set): ...this.
1942 (Dwo_file::shndx_map_): Remove.
1943 (Dwo_file::sect_offsets_): New data member.
1944 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1945 (Dwp_output_file::add_section): Rename to...
1946 (Dwp_output_file::add_contribution): ...this.
1947 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1948 (Dwp_output_file::add_tu_set): Likewise.
1949 (Dwp_output_file::Contribution): New type.
1950 (Dwp_output_file::Section::contributions): New data member.
1951 (Dwp_output_file::Cu_or_tu_set): Remove.
1952 (Dwp_output_file::Section::Section): New ctor.
1953 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1954 (Dwp_output_file::Dwp_index::Section_table): New type.
1955 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1956 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1957 parameter.
1958 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1959 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1960 (Dwp_output_file::Dwp_index::section_table): New member function.
1961 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1962 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1963 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1964 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1965 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1966 (Dwp_output_file::Dwp_index::section_table_): New data member.
1967 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1968 (Dwp_output_file::add_output_section): New member function.
1969 (Dwp_output_file::write_new_section): New member function.
1970 (Dwp_output_file::write_contributions): New member function.
1971 (Dwp_output_file::section_id_map_): New data member.
1972 (class Dwo_id_info_reader): Remove.
1973 (class Unit_reader): New class.
1974 (get_dwarf_section_name): New function.
1975 (Dwo_file::read_executable): Adjust initializations of class data.
1976 (Dwo_file::read): Add support for v2 package file format.
1977 (Dwo_file::read_unit_index): Likewise.
1978 (Dwo_file::sized_read_unit_index): Likewise.
1979 (Dwo_file::copy_section): Likewise.
1980 (Dwo_file::add_unit_set): Likewise.
1981 (Dwp_output_file::add_output_section): Likewise.
1982 (Dwp_output_file::add_contribution): Likewise.
1983 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1984 for empty slot.
1985 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1986 file format.
1987 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1988 slot.
1989 (Dwp_output_file::initialize): Remove unused function.
1990 (Dwp_output_file::finalize): Add support for v2 package file format.
1991 (Dwp_output_file::write_index): Likewise.
1992 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1993 function prototype.
1994
a68a081d
CC
19952013-03-01 Cary Coutant <ccoutant@google.com>
1996
1997 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1998 function into class definition in header file.
1999 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2000 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2001 New function.
2002 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2003
9d5781f8
AM
20042013-02-28 Alan Modra <amodra@gmail.com>
2005
2006 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2007 * target.cc (Target::do_plt_fde_location): New function.
2008 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2009 accessor function, and constructor param.
2010 (struct Post_fde, Post_fdes): Declare.
2011 (Cie::write): Add post_fdes param.
2012 * ehframe.cc (Fde::write): Use plt_fde_location.
2013 (struct Post_fde): Define.
2014 (Cie::write): Stash FDEs added post merge mapping.
2015 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2016 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2017 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2018 other FDEs.
2019 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2020 (Target_powerpc::has_glink): New function.
2021 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2022 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2023 glink_eh_frame_fde_32, default_fde): New data.
2024 (Stub_table::eh_frame_added_): New var.
2025 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2026 Make const.
2027 (Stub_table::add_eh_frame): New function.
2028 (Output_data_glink::add_eh_frame): New function.
2029 (Target_powerpc::make_glink_section): Call add_eh_frame.
2030
214383dd
ILT
20312013-02-15 Ian Lance Taylor <iant@google.com>
2032
2033 * options.h (DEFINE_uint64_alias): Define.
2034 (class General_options): Add -Ttext-segment as an alias for
2035 -Ttext.
2036
91c2b899
AM
20372013-02-15 Alan Modra <amodra@gmail.com>
2038
2039 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2040 (Stub_table::do_write): ..here, two places.
2041 (Stub_table::plt_call_size): Use it here too.
2042
20e2a8aa
ILT
20432013-02-11 Ian Lance Taylor <iant@google.com>
2044
2045 * descriptors.cc (Descriptors::close_all): New function.
2046 * descriptors.h (class Descriptors): Declare close_all.
2047 (close_all_descriptors): New inline function.
2048 * plugin.cc: Include "descriptors.h".
2049 (Plugin_manager::cleanup): Call close_all_descriptors.
2050
8952bc69
AM
20512013-02-06 Alan Modra <amodra@gmail.com>
2052
2053 * README: Update coding style link.
2054
29bd8b6b
CC
20552013-01-28 Cary Coutant <ccoutant@google.com>
2056
a4034750
AM
2057 * dwp.cc (File_list): New typedef.
2058 (Dwo_name_info_reader): New class.
2059 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2060 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2061 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2062 (Dwo_file::read_executable): New function.
2063 (Dwo_file::read): Move common setup code to ...
2064 (Dwo_file::make_object): ... here.
2065 (dwp_options): Add --exec/-e.
2066 (usage): Likewise.
2067 (main): Likewise.
29bd8b6b 2068
c6ac678d
ST
20692013-01-24 Sriraman Tallam <tmsriram@google.com>
2070
2071 * layout.cc (Layout::layout): Check for option text_reorder.
2072 (Layout::make_output_section): Ditto.
2073 * options.h (text_reorder): New option.
2074 * output.cc (Input_section_sort_compare): Remove special ordering
2075 of section names.
2076 (Output_section::
2077 Input_section_sort_section_name_special_ordering_compare::
2078 operator()): New function.
2079 (Output_section::sort_attached_input_sections): Use new sort function
2080 for .text.
2081 * output.h (Input_section_sort_section_name_special_ordering_compare):
2082 New struct.
2083 * testsuite/Makefile.am (text_section_grouping): Test option
2084 --no-text-reorder
2085 * testsuite/Makefile.in: Regenerate.
2086 * testsuite/text_section_grouping.sh: Check order of functions without
2087 default text reordering.
2088
50701cc1
MF
20892013-01-18 Mike Frysinger <vapier@gentoo.org>
2090
2091 * options.h (General_options): Change default to true for new_dtags.
2092
b1b00fcc
MF
20932013-01-18 Mike Frysinger <vapier@gentoo.org>
2094
2095 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2096 when enable_new_dtags is false. Only add DT_RUNPATH when
2097 enable_new_dtags is true.
2098
ec5b8187
AM
20992013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2100
2101 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2102 used in declaration and definition consistent.
2103 (Target_powerpc::symval_for_branch): Ditto.
2104
a880d4c4
ST
21052013-01-16 Sriraman Tallam <tmsriram@google.com>
2106
2107 * testsuite/plugin_final_layout.cc: Fix comment.
2108
7c381248
ST
21092013-01-16 Sriraman Tallam <tmsriram@google.com>
2110
2111 * layout.cc (Layout::layout): Do not do default sorting for
2112 text sections when section ordering is specified.
2113 (make_output_section): Ditto.
2114 * testsuite/plugin_final_layout.cc: Name the function sections
2115 to catch reordering issues.
2116
e2458743
AM
21172013-01-15 Alan Modra <amodra@gmail.com>
2118
2119 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2120 plt-thread-safe.
2121
431ed302
AM
21222013-01-15 Alan Modra <amodra@gmail.com>
2123
2124 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2125 * testsuite/Makefile.in: Regenerate.
2126
0ec6429b
AM
21272013-01-14 Alan Modra <amodra@gmail.com>
2128
2129 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2130 * testsuite/Makefile.in: Regenerate.
2131
0bf402d5
ILT
21322013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2133
36af3926 2134 PR bfd/14430
0bf402d5
ILT
2135 Fix mingw gold build with plugins enabled
2136 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2137 * configure.ac: Export DLOPEN_LIBS and add headers check.
2138 * plugin.cc: Handle non-dlfcn case.
2139 * Makefile.in: Regenerate.
2140 * config.in: Regenerate.
2141 * configure: Regenerate.
2142 * testsuite/Makefile.in: Regenerate.
2143
9e9143bc
ST
21442013-01-09 Sriraman Tallam <tmsriram@google.com>
2145
2146 * output.h (sort_attached_input_sections): Change to be public.
2147 * script-sections.cc
2148 (Output_section_definition::set_section_addresses): Sort
2149 attached input sections according to section order before linker
2150 script assigns section addresses.
2151 (Orphan_output_section::set_section_addresses): Sort
2152 attached input sections according to section order before linker
2153 script assigns section addresses.
2154 * Makefile.am (final_layout.sh): Use a simple linker script to
2155 check if section ordering still works.
2156 * Makefile.in: Regenerate.
2157
679af368
ILT
21582013-01-09 Ben Cheng <bccheng@google.com>
2159
2160 * arm.cc (Target_arm::attributes_accept_div): New function.
2161 (Target_arm::attributes_forbid_div): New function.
2162 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2163 attribute using the same new functions as what bfd/elf32_arm.c
2164 does.
2165
3136a00e
CC
21662013-01-07 Cary Coutant <ccoutant@google.com>
2167
2168 PR gold/14993
2169 * output.cc (Output_section::add_input_section): For incremental
2170 updates, don't track input sections that are allocated from patch
2171 space.
2172
f2a6224b
L
21732013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2174 Ian Lance Taylor <iant@google.com>
2175
2176 PR gold/14897
2177 * configure.ac (--enable-ld): Removed.
2178 (install_as_default): Set to yes only for --enable-gold=default
2179 or --disable-ld.
2180 * configure: Regenerated.
2181
4f46f626
L
21822013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2183
2184 * options.h (General_options): Add -fuse-ld= for GCC linker
2185 option compatibility.
2186
26e4ef59
CC
21872013-01-04 Cary Coutant <ccoutant@google.com>
2188
2189 * configure.ac: Fix typo restoring CXXFLAGS.
2190 * configure: Regenerate.
2191
3d587466
CC
21922013-01-04 Cary Coutant <ccoutant@google.com>
2193
4f46f626
L
2194 * testsuite/Makefile.am (CXXLINK_S): New macro.
2195 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2196 * testsuite/Makefile.in: Regenerate.
3d587466 2197
44db6695
L
21982013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2199
2200 * version.cc (print_version): Update copyright year to 2013.
2201
edcac0c1
ILT
22022012-12-20 Ian Lance Taylor <iant@google.com>
2203
2204 * layout.cc (Layout::special_ordering_of_input_section): New
2205 function.
2206 (Layout::layout): If input section requires special ordering, must
2207 sort input sections.
2208 (Layout::make_output_section): May sort .text input sections.
2209 (Layout::is_section_name_prefix_grouped): Remove.
2210 * layout.h (class Layout): Declare
2211 special_ordering_of_input_section. Don't declare
2212 is_section_name_prefix_grouped.
2213 * output.cc (Output_section::add_input_section): Revert last
2214 change.
2215 (Output_section::Input_section_sort::match_file_name): Don't crash
2216 if called on output section data.
2217 (Output_section::Input_section_sort_compare): Sort based on
2218 special ordering.
2219 (Output_section::Input_section_sort_section_order_index_compare):
2220 Revert last patch.
2221 (Output_section::sort_attached_input_sections): Likewise.
2222
28f2a4ac
ST
22232012-12-18 Sriraman Tallam <tmsriram@google.com>
2224
edcac0c1 2225 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2226 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2227 * output.cc (Output_section::add_input_section): Check if section
2228 name contains special prefix. Keep input sections to sort such
2229 sections.
2230 (Output_section::Input_section_sort_section_order_index_compare
2231 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2232 (Output_section::sort_attached_input_sections): Add condition to
2233 Input_section_entry constructor call.
28f2a4ac
ST
2234 * testsuite/Makefile.am (text_section_grouping): New test.
2235 * testsuite/Makefile.in: Regenerate.
2236 * testsuite/text_section_grouping.cc: New file.
2237 * testsuite/text_section_grouping.sh: New file.
2238
5bf135a7
NC
22392012-12-17 Nick Clifton <nickc@redhat.com>
2240
2241 * Makefile.am: Add copyright notice.
2242 * NEWS: Likewise.
2243 * README: Likewise.
2244 * configure.ac: Likewise.
2245 * ftruncate.c: Likewise.
2246 * Makefile.in: Regenerate.
2247
59965708
CC
22482012-12-14 Cary Coutant <ccoutant@google.com>
2249
a4034750
AM
2250 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2251 --no-as-needed flag.
2252 (exception_separate_shared_12_test): Likewise.
2253 (incremental_copy_test): Likewise.
2254 * testsuite/Makefile.in: Regenerate.
59965708 2255
2a77e2ab
CC
22562012-12-14 Cary Coutant <ccoutant@google.com>
2257
2258 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2259 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2260
e3deeb9c
AM
22612012-12-12 Alan Modra <amodra@gmail.com>
2262
2263 * powerpc.cc (class Track_tls): New.
2264 (class Relocate, class Scan): Inherit Track_tls.
2265 (Target_powerpc::Scan::local, global): Track tls optimization
2266 and avoid creating plt entry for __tls_get_addr if all uses
2267 are optimized away.
2268 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2269
d8f5a274
AM
22702012-12-12 Alan Modra <amodra@gmail.com>
2271
2272 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2273 Replace no_toc_optimize with toc_optimize.
2274 * output.h (Output_section::input_sections): Provide non-const variant.
2275 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2276 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2277 accessors.
2278 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2279 (class Sort_toc_sections): New.
2280 (Target_powerpc::do_finalize_sections): Sort toc sections.
2281 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2282
4c8a1de1
RM
22832012-12-10 Roland McGrath <mcgrathr@google.com>
2284
2285 * testsuite/binary_unittest.cc (read_all): New function.
2286 (Sized_binary_test): Use it instead of ::read.
2287 * fileread.cc (do_read): Don't assume pread always reads the whole
2288 amount in a single call.
2289
edc27beb
AM
22902012-12-10 Alan Modra <amodra@gmail.com>
2291
2292 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2293 Set EM_PPC64 or EM_PPC here.
2294 (Target_selector_powerpc::do_recognize): Delete.
2295
906b9150
AM
22962012-12-10 Alan Modra <amodra@gmail.com>
2297
2298 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2299 stub_table_.
2300 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2301
418c15ae
RM
23022012-12-07 Roland McGrath <mcgrathr@google.com>
2303
2304 * testsuite/binary_unittest.cc (Sized_binary_test):
2305 Use open_descriptor rather than ::open.
2306
decdd3bc
AM
23072012-12-07 Alan Modra <amodra@gmail.com>
2308
2309 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2310 typedef and invalid_address constant.
2311 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2312 instantiate constants.
2313
db399005
ILT
23142012-12-06 Roland McGrath <mcgrathr@google.com>
2315
2316 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2317 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2318 * aclocal.m4: Regenerate.
2319 * configure: Regenerate.
2320 * Makefile.in: Regenerate.
2321 * testsuite/Makefile.in: Regenerate.
2322
aba6bc71
AM
23232012-12-07 Alan Modra <amodra@gmail.com>
2324
2325 * options.h (General_options): Add no_toc_optimize.
2326 * powerpc.cc (ok_lo_toc_insn): New function.
2327 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2328
9e69ed50
AM
23292012-12-06 Alan Modra <amodra@gmail.com>
2330
2331 * options.h (General_options): Add plt_align, plt_static_chain,
2332 plt_thread_safe. Update stub_group_size help text.
2333 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2334 for new plt_thread_safe_ var.
2335 (use_plt_offset): Correct comments.
2336 (Target_powerpc::do_relax): Look for thread creation symbols to
2337 determine default plt_thread_safe value. Clear plt call stubs
2338 as well as branch stubs each iteration.
2339 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2340 insn constants.
2341 (l, hi, ha, write_insn): Move earlier.
2342 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2343 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2344 plt stubs too.
2345 (Stub_table::update_size): Adjust.
2346 (Stub_table::prev_size, set_prev_size): Delete.
2347 (Stub_table::stub_align): Let --plt-align affect result.
2348 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2349 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2350 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2351 (Stub_table::do_write): Support more stub variants.
2352
f43ba157
AM
23532012-12-04 Alan Modra <amodra@gmail.com>
2354
2355 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2356 (Target_powerpc::do_define_standard_symbols): New function.
2357
34171bc5
AM
23582012-12-03 Alan Modra <amodra@gmail.com>
2359
2360 * output.h: Formatting, whitespace.
2361
dc9589e9 23622012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2363
2364 * layout.h (Layout::get_executable_sections): Declare.
2365 * layout.cc (Layout::get_executable_sections): New function.
2366 * arm.cc (Target_arm::group_sections): Use it.
2367 (Arm_output_section::group_sections): Delete now redundant test.
2368 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2369 param to handle relative relocs.
2370 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2371 (Output_data_reloc::add_absolute): Adjust.
2372 (Output_data_reloc::add_relative): New function.
2373 (Output_data::reset_data_size): New function.
2374 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2375 (Output_section::set_addralign): New function.
2376 (Output_section::checkpoint_set_addralign): New function.
2377 (Output_section::clear_section_offsets_need_adjustment): New function.
2378 (Output_section::input_sections): Make public.
2379 * powerpc.cc (class Output_data_brlt_powerpc): New.
2380 (class Stub_table, class Stub_control): New.
2381 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2382 stub_table_, set_stub_table, stub_table): New vectors and accessor
2383 functions.
2384 (Target_powerpc::do_may_relax, do_relax, push_branch,
2385 new_stub_table, stub_tables, brlt_section, group_sections,
2386 add_branch_lookup_table, find_branch_lookup_table,
2387 write_branch_lookup_table, make_brlt_section): New functions.
2388 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2389 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2390 branch_info_): New vars.
2391 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2392 make call stubs here.
2393 (Output_data_glink): Remove all call stub handling from this class.
2394 (Target_powerpc::Scan::local, global): Save interesting branch
2395 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2396 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2397 functions on final link.
2398 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2399 Handle long branch destinations too.
2400 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2401 do_plt_address_for_local): Adjust lookup of plt call stubs.
2402
627b30b7
AM
24032012-11-30 Alan Modra <amodra@gmail.com>
2404
2405 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2406 relocs against protected symbols when building 32-bit shared libs.
2407
40b469d7
AM
24082012-11-30 Alan Modra <amodra@gmail.com>
2409
2410 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2411 param. Call got_section() to make .got. Update all callers
2412 and their callers and so on.
2413
bb66a627
AM
24142012-11-30 Alan Modra <amodra@gmail.com>
2415
2416 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2417 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2418 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2419 value if it already exists.
2420
d2cf1c6c
L
24212012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2422
2423 PR gold/14858
2424 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2425
edccdf7c
RM
24262012-11-14 Roland McGrath <mcgrathr@google.com>
2427
2428 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2429 than bfc instruction for data sandboxing.
2430
6febeb74
AM
24312012-11-08 Alan Modra <amodra@gmail.com>
2432
2433 * po/POTFILES.in: Regenerate.
2434
0a6f1bf2
AM
24352012-11-05 Alan Modra <amodra@gmail.com>
2436
2437 * configure.ac: Apply 2012-09-10 change to config.in here.
2438 * configure: Regenerate.
2439
26a4e9cb
AM
24402012-11-05 Alan Modra <amodra@gmail.com>
2441
2442 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2443 (struct Opd_ent): Use "Address" rather than "Offset".
2444 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2445 (Target_powerpc::got_section): Make public.
2446 (Target_powerpc::scan_relocs): Move code setting symbols..
2447 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2448 Create _SDA_BASE_ only when referenced.
2449
cc928013
RM
24502012-11-02 Roland McGrath <mcgrathr@google.com>
2451
2452 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2453 from last change.
2454
50ed5eb1
RM
24552012-11-01 Roland McGrath <mcgrathr@google.com>
2456
62fe925a
RM
2457 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2458 for offset_in_output_section parameter.
2459 (Sized_target::relocate_special_relocatable): Likewise.
2460 * arm.cc (Target_arm::relocate_relocs): Likewise.
2461 (Target_arm::relocate_special_relocatable): Likewise.
2462 * i386.cc (Target_i386::relocate_relocs): Likewise.
2463 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2464 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2465 * target-reloc.h (relocate_relocs): Likewise.
2466 * testsuite/testfile.cc (Target_test): Likewise.
2467 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2468 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2469
2470 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2471 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2472
2473 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2474 parameter, which is unused in the [!F_SETFD] case.
2475
50ed5eb1
RM
2476 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2477 SYMNDX to off_t before comparing it to this->data_size().
2478 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2479 * incremental.cc (Output_section_incremental_inputs::do_write):
2480 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2481
2cadc0bf
RM
2482 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2483
3bfcb652
NC
24842012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2485
2486 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2487 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2488 in EABI_VER5.
2489
c1a8d56e
CC
24902012-10-29 Cary Coutant <ccoutant@google.com>
2491
2492 * dwp.cc (usage): Add file and exit status parameters;
2493 add --help and --version options.
2494 (print_version): New function.
2495 (main): Add --help and --version options.
2496
b2490a7b
L
24972012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2498
2499 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2500 final_layout_sequence.txt.
2501 * testsuite/Makefile.in: Regenerated.
2502
aa543512
L
25032012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2504
2505 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2506 COMPILE generated by automake.
2507 (LINK1): Likewise.
2508 (CXXCOMPILE1): Likewise.
2509 (CXXLINK1): Likewise.
2510 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2511 (LINK): Likewise.
2512 (CXXCOMPILE): Likewise.
2513 (CXXLINK): Likewise.
2514 * testsuite/Makefile.in: Regenerated.
2515
d361fafb
L
25162012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2517
2518 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2519 on bad fwrite return.
2520
598c7410
L
25212012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2522
2523 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2524 on val.
2525
35c813e2
CC
25262012-10-23 Cary Coutant <ccoutant@google.com>
2527
2528 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2529 * testsuite/Makefile.in: Regenerate.
2530 * testsuite/dwp_test.h: New source file.
2531 * testsuite/dwp_test_1.cc: New source file.
2532 * testsuite/dwp_test_1.s: New source file.
2533 * testsuite/dwp_test_1.sh: New source file.
2534 * testsuite/dwp_test_1b.cc: New source file.
2535 * testsuite/dwp_test_1b.s: New source file.
2536 * testsuite/dwp_test_2.cc: New source file.
2537 * testsuite/dwp_test_2.s: New source file.
2538 * testsuite/dwp_test_2.sh: New source file.
2539 * testsuite/dwp_test_main.cc: New source file.
2540 * testsuite/dwp_test_main.s: New source file.
2541
77429909
CC
25422012-10-23 Cary Coutant <ccoutant@google.com>
2543
2544 * dwp.h: New header file.
2545 * dwp.cc: New source file.
2546 * gold.h: Move shared declarations to system.h.
2547 * system.h: New header file.
2548 * Makefile.am: Add dwp.
2549 * Makefile.in: Regenerate.
2550
ed5d6712
CC
25512012-10-23 Cary Coutant <ccoutant@google.com>
2552
2553 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2554 Dwarf_info_reader::read_from_pointer.
2555 (Dwarf_pubnames_table::read_header): Likewise.
2556 (Dwarf_pubnames_table::next_name): Likewise.
2557 (Dwarf_die::read_attributes): Likewise.
2558 (Dwarf_die::skip_attributes): Likewise.
2559 (Dwarf_info_reader::read_from_pointer): New function template.
2560 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2561 (Dwarf_pubnames_table): Likewise.
2562 (Dwarf_info_reader::read_from_pointer): New function template.
2563 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2564 Dwarf_pubnames_table ctor.
2565
8787852d
CC
25662012-10-23 Cary Coutant <ccoutant@google.com>
2567
2568 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2569 abbrev_shndx.
2570 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2571 abbrev_shndx_.
2572 (Dwarf_info_reader::set_abbrev_shndx): New method.
2573 (Dwarf_info_reader::abbrev_shndx_): New data member.
2574
9fc236f3
CC
25752012-10-23 Cary Coutant <ccoutant@google.com>
2576
2577 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2578 from object, not parameters.
2579 (Dwarf_info_reader::parse): Likewise.
2580 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2581 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2582 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2583 methods.
2584
effe8365
CC
25852012-10-23 Cary Coutant <ccoutant@google.com>
2586
2587 * fileread.cc (Input_file::Input_file): New constructor.
2588 * fileread.h (class Input_file): Add new constructor.
2589
1698990d
AM
25902012-10-18 Alan Modra <amodra@gmail.com>
2591
2592 PR gold/14727
2593 * object.cc (Relobj::is_section_name_included): Also match
2594 .sdata personality section.
2595
168a4726
AM
25962012-10-18 Alan Modra <amodra@gmail.com>
2597
2598 * target-reloc.h (class Default_comdat_behavior): New, package up..
2599 (get_comdat_behaviour): ..this.
2600 (relocate_section): Add Relocate_comdat_behavior template arg,
2601 adjust code to suit.
2602 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2603 (Target_arm::scan_reloc_section): Likewise.
2604 * i386.cc (Target_i386::relocate_section): Likewise.
2605 * sparc.cc (Target_sparc::relocate_section): Likewise.
2606 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2607 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2608 * powerpc.cc (class Relocate_comdat_behavior): New.
2609 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2610 gold::relocate_section with new template arg.
2611
acc276d8
AM
26122012-10-18 Alan Modra <amodra@gmail.com>
2613
2614 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2615 dynamic relocs for GOT_TPREL got entries, without symbol if
2616 resolving locally.
2617 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2618 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2619 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2620
e10f9870
AM
26212012-10-17 Alan Modra <amodra@gmail.com>
2622
2623 PR gold/14726
2624 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2625
ae034989
ST
26262012-10-16 Sriraman Tallam <tmsriram@google.com>
2627
2628 * layout.cc (Layout::include_section): Keep sections marked
2629 SHF_EXCLUDE when doing relocatable links.
2630
f3a0ed29
AM
26312012-10-16 Alan Modra <amodra@gmail.com>
2632
2633 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2634 (Target_powerpc::do_finalize_sections): Call it.
2635 (Output_data_save_res): New class and supporting functions.
2636 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2637 normal symbols defined in object files.
2638
c6de8ed4
AM
26392012-10-12 Alan Modra <amodra@gmail.com>
2640
2641 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2642 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2643 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2644 section if scan_opd_relocs not yet called.
2645 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2646
03e25981
AM
26472012-10-12 Alan Modra <amodra@gmail.com>
2648
2649 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2650 add_local_ifunc_entry): Revert last change.
2651 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2652
c9824451
AM
26532012-10-05 Alan Modra <amodra@gmail.com>
2654
2655 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2656 do_plt_address_for_global): New functions.
2657 (Output_data_got_powerpc::do_write): Don't segfault when linking
2658 statically.
2659 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2660 add_local_ifunc_entry): Return true on adding entry..
2661 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2662 glink->add_entry call. Remove unused symtab param. Adjust calls.
2663 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2664 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2665 set up symbols here.
2666 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2667 syms here. Do so even when no .iplt. Don't segfault when linking
2668 statically.
2669 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2670 new variants without reloc param.
2671 (Glink_sym_ent::Glink_sym_ent): Likewise.
2672 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2673 reloc when refs will resolve to plt call stub.
2674 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2675 R_PPC_PLTREL24 to resolve locally.
2676 (Target_powerpc::Scan::global): Correct ifunc handling.
2677 (Target_powerpc::Relocate::relocate): Correct local sym glink
2678 lookup. Don't destroy "value" when we have a plt call stub,
2679 and when checking plt call validity.
2680 (Target_powerpc::do_dynsym_value): Simplify.
2681
19fec8c1
AM
26822012-10-05 Alan Modra <amodra@gmail.com>
2683
2684 * i386.cc (Output_data_plt_i386::address_for_global,
2685 address_for_local): Add plt offset to returned value. Adjust uses.
2686 * sparc.cc (Output_data_plt_sparc::address_for_global,
2687 address_for_local): Likewise.
2688 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2689 address_for_local): Likewise.
2690 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2691 address_for_local): Likewise.
2692 * target.h (Target::plt_address_for_global, plt_address_for_local):
2693 Update comment.
2694 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2695 (Output_data_got::Got_entry::write): Nor here.
2696 * output.h: Comment fix.
2697
e867b647
WL
26982012-10-02 Jiong Wang <jiwang@tilera.com>
2699
2700 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2701 global_offset_table_ value for larget got.
2702 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2703
e5d5f5ed
AM
27042012-09-29 Alan Modra <amodra@gmail.com>
2705
2706 * powerpc.cc (Target_powerpc::iplt_): New output section.
2707 (Target_powerpc::iplt_section, make_iplt_section,
2708 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2709 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2710 Target_powerpc::plt_entry_count): Count iplt entries too.
2711 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2712 reloc section in constructor. New params.
2713 (Target_powerpc::make_plt_section): Create reloc section here instead.
2714 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2715 functions.
2716 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2717 (Output_data_glink::add_entry, find_entry): New functions to
2718 deal with local syms.
2719 (Glink_sym_ent): Add support for local syms.
2720 (Output_data_glink::do_write): Handle ifunc plt entries.
2721 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2722 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2723 (Target_powerpc::Relocate::relocate): Likewise.
2724 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2725
ec4dbad3
AM
27262012-09-25 Alan Modra <amodra@gmail.com>
2727
2728 * object.h (Sized_relobj_file::adjust_local_symbol,
2729 do_adjust_local_symbol): New functions.
2730 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2731 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2732 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2733 and irregular opd entry spacing.
2734 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2735 (Global_symbol_visitor_opd): New functor.
2736 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2737 on deleted opd entries.
2738
5c0b3823
WL
27392012-09-15 Jiong Wang <jiwang@tilera.com>
2740
2741 * tilegx.cc: New file.
2742 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2743 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2744 * configure.tgt: Add entries for tilegx*.
2745 * configure.ac: Likewise.
2746 * Makefile.in: Rebuild.
2747 * configure: Likewise.
2748 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2749 tilegx.
2750
bfdfa4cd
AM
27512012-09-13 Alan Modra <amodra@gmail.com>
2752
2753 * target-reloc.h (scan_relocs): Call scan.local for relocs
2754 against symbols in discarded sections. Pass is_discarded
2755 param.
2756 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2757 Add is_discarded param.
2758 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2759 is_discarded to flag opd entry as discarded. Don't emit dyn
2760 relocs on such entries.
2761 (Target_powerpc::Scan::global): Similarly detect and handle
2762 such opd entries.
2763 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2764 opd_ent_. Update all uses.
2765 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2766 (Target_powerpc::relocate_section): Zero out discarded opd
2767 entry relocs.
2768
d77a0555
ILT
27692012-09-12 Ian Lance Taylor <iant@google.com>
2770
2771 PR gold/14570
2772 * output.cc: Rename Output_data_got template parameter from size
2773 to got_size for all functions. Compile all variants of
2774 Output_data_got.
2775 (Output_data_got::Got_entry::write): Correct use of size for
2776 symbol value. Use local_is_tls rather than casting to
2777 Sized_relobj_file.
2778 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2779 (class Sized_relobj_file): Add do_local_is_tls.
2780 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2781
815a1205
AM
27822012-09-11 Alan Modra <amodra@gmail.com>
2783
2784 PR gold/14566
2785 * layout.cc (Layout::set_segment_offsets): When using
2786 common-page-size alignment, ensure we are on a new max-page-size
2787 page.
2788 * output.cc (Output_segment::set_section_addresses): Use
2789 abi_pagesize, not common_pagesize for relro boundary.
2790 (Output_segment::set_offset): Likewise.
2791
bd73a62d
AM
27922012-09-11 Alan Modra <amodra@gmail.com>
2793
2794 * output.h (Output_data_got::add_global_tls, add_local_tls,
2795 add_local_tls_pair): New functions.
2796 (Output_data_got::add_local_pair_with_rel): Remove second
2797 reloc param. Expand comment.
2798 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2799 use_plt_or_tls_offset_, similarly for constructor param.
2800 (Output_data_got::Got_entry::write): Add got_index param.
2801 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2802 add_local_tls_pair): New functions.
2803 (Output_data_got::Got_entry::write): Handle tls symbols
2804 with use_plt_or_tls_offset_ set specially.
2805 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2806 (Output_data_got::do_write): Replace iterator with index, pass
2807 index to entry write function.
2808 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2809 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2810 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2811 call.
2812 * i386.cc (Target_i386::Scan::local): Likewise.
2813 * sparc.cc (Target_sparc::Scan::local): Likewise.
2814 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2815 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2816 do_tls_offset_for_global): New functions.
2817 (Target_powerpc::Scan::local): Correct TLS relocations and got
2818 entry values.
2819 (Target_powerpc::Scan::global): Don't emit unnecessary
2820 dynamic relocations on TLS GOT entries.
2821
00716ab1
AM
28222012-09-10 Matthias Klose <doko@ubuntu.com>
2823
2824 * config.in: Disable sanity check for kfreebsd.
2825
c891b3f9
SA
28262012-09-10 Sterling Augustine <saugustine@google.com>
2827
2828 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2829 (Gdb_index::pubtypes_read): New parameter.
2830 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2831 to calls.
2832 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2833 pubtypes_object_.
2834
e81fea4d
AM
28352012-09-09 Alan Modra <amodra@gmail.com>
2836
2837 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2838 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2839 * gc.h (gc_process_relocs): Call target gc_add_reference.
2840 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2841 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2842 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2843 unnecessary cast.
2844 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2845 to cater for when we don't need code offset. Update use.
2846 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2847 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2848 set_opd_valid): New functions.
2849 (Target_powerpc::do_gc_add_reference): New function.
2850 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2851 stashed refs.
2852 (Target_powerpc::do_gc_mark_symbol): New function.
2853
d2d60eef
CC
28542012-09-06 Cary Coutant <ccoutant@google.com>
2855
2856 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2857 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2858 (Dwarf_die::skip_attributes): Likewise.
2859 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2860 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2861 (main): Call it.
2862 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2863
32ed4573
L
28642012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2865
2866 * testsuite/script_test_3.t: Add .got.plt output section
2867 statement.
2868 * testsuite/script_test_4.t: Likewise.
2869
f4baf0d4
AM
28702012-09-05 Alan Modra <amodra@gmail.com>
2871
2872 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2873 update all uses and lose "enum" when using type.
2874
864a1b56
AM
28752012-09-05 Alan Modra <amodra@gmail.com>
2876
2877 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2878 * configure: Regenerate.
2879 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2880 (plugin_final_layout.stdout): Likewise.
2881 (memory_test): Set page sizes to 0x1000.
2882 * testsuite/Makefile.in: Regenerate.
2883 * testsuite/discard_locals_test.sh: Add FIXME comment.
2884 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2885 * testsuite/pr14265.t: Add .got output section statement.
2886 * testsuite/script_test_2.t: Likewise.
2887 * testsuite/script_test_3.t: Likewise.
2888 * testsuite/script_test_4.t: Likewise.
2889 * testsuite/script_test_5.t: Likewise.
2890 * testsuite/script_test_6.t: Likewise.
2891 * testsuite/script_test_7.t: Likewise.
2892 * testsuite/script_test_9.t: Likewise.
2893
3ea0a085
AM
28942012-09-05 Alan Modra <amodra@gmail.com>
2895
2896 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2897 (Powerpc_relocate_functions::Status): New typedef.
2898 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2899 (Target_powerpc::Scan::local): Handle REL64.
2900 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2901 for REL32 and REL64.
2902 (Target_powerpc::symval_for_branch): New function, extracted from..
2903 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2904 checks. Report overflow errors.
2905
7404fe1b
AM
29062012-09-05 Alan Modra <amodra@gmail.com>
2907
2908 * object.h (Sized_relobj_file::emit_relocs): Delete.
2909 (Sized_relobj_file::emit_relocs_reltype): Delete.
2910 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2911 relocate_relocs for --emit-relocs.
2912 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2913 * output.h: Update comment.
2914 (Output_segment::first_section): New function.
2915 (Output_segment::first_section_load_address): Use first_section.
2916 * output.cc (Output_segment::first_section): New function extracted..
2917 (Output_segment::first_section_load_address): ..from here. Delete.
2918 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2919 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2920 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2921 adjust call to target.h function.
2922 * i386.cc (Target_i386): Likewise.
2923 * sparc.cc (Target_sparc): Likewise.
2924 * x86_64.cc (Target_x86_64): Likewise.
2925 * powerpc.cc (Target_powerpc): Likewise.
2926 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2927 first tls section has section symbol for optimised local dynamic
2928 output relocs.
2929 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2930 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2931 optimised tls code.
2932 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2933 Rename to relocate_relocs. Update error message.
2934
957564c9
AS
29352012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2936
2937 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2938 --just-symbols.
2939
dd93cd0a
AM
29402012-08-31 Alan Modra <amodra@gmail.com>
2941
2942 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2943 (Powerpc_relobj::toc_base_offset): New stub function.
2944 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2945 got_mod_index_offset to tlsld_got_offset. Update all refs.
2946 (Target_powerpc::Relocate::enum skip_tls): New.
2947 (Target_powerpc::call_tls_get_addr_): New var.
2948 (Target_powerpc::is_branch_reloc): Move to file scope.
2949 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2950 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2951 New functions.
2952 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2953 (powerpc_info): Correct common_pagesize for ppc64.
2954 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2955 (Powerpc_relocate_functions): Add overflow check enums and functions.
2956 Add non-shift version of rela, rela_ua. Delete all rel public
2957 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2958 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2959 addr16_ha3, addr14 functions.
2960 (Output_data_got_powerpc::add_constant_pair): New function.
2961 (Output_data_got_powerpc::got_base_offset): Likewise.
2962 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2963 (instruction constants): Sort, add some more.
2964 (Output_data_glink::do_write): Add and use Address typedef. Use
2965 object->toc_base_offset() stub for 64-bit.
2966 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2967 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2968 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2969 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2970 Always treat .opd relocs as against locally defined symbol.
2971 Correct condition for RELATIVE relocs.
2972 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2973 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2974 for 32-bit syms with a plt entry. Correct ppc64 toc base
2975 calculations. Handle TLS relocs, and more. Add overflow
2976 checking and adjust for Powerpc_relocate_functions changes.
2977 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2978 Reinstate --emit-relocs code with FIXME.
2979
a1373b60
AM
29802012-08-30 Alan Modra <amodra@gmail.com>
2981
2982 * layout.cc (Layout::set_segment_offsets): Set p_align to
2983 abi_pagesize, not common_pagesize.
2984 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2985 to determine whether file header can go in segment.
2986
703d02da
AM
29872012-08-30 Alan Modra <amodra@gmail.com>
2988
2989 * output.h (Output_reloc::Output_reloc <output section>): Add
2990 is_relative param. Adjust calls.
2991 (Output_reloc::add_output_section_relative): New functions.
2992 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2993 is_relative.
2994 (Output_reloc::symbol_value): Handle SECTION_CODE.
2995
16164a6b
ST
29962012-08-24 Sriraman Tallam <tmsriram@google.com>
2997
2998 * gold.cc (queue_middle_tasks): Call layout again when unique
2999 segments for sections is desired.
3000 * layout.cc (Layout::Layout): Initialize new members.
3001 (Layout::get_output_section_flags): New function.
3002 (Layout::choose_output_section): Call get_output_section_flags.
3003 (Layout::layout): Make output section for mapping to a unique segment.
3004 (Layout::insert_section_segment_map): New function.
3005 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3006 output sections marked so.
16164a6b
ST
3007 (Layout::segment_precedes): Check for unique segments when sorting.
3008 * layout.h (Layout::Unique_segment_info): New struct.
3009 (Layout::Section_segment_map): New typedef.
3010 (Layout::insert_section_segment_map): New function.
3011 (Layout::get_output_section_flags): New function.
3012 (Layout::is_unique_segment_for_sections_specified): New function.
3013 (Layout::set_unique_segment_for_sections_specified): New function.
3014 (Layout::unique_segment_for_sections_specified_): New member.
3015 (Layout::section_segment_map_): New member.
3016 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3017 Rename is_gc_pass_one to is_pass_one.
3018 Rename is_gc_pass_two to is_pass_two.
3019 Rename is_gc_or_icf to is_two_pass.
3020 Check for which pass based on whether symbols data is present.
3021 Make it two pass when unique segments for sections is desired.
3022 * output.cc (Output_section::Output_section): Initialize new
3023 members.
3024 * output.h (Output_section::is_unique_segment): New function.
3025 (Output_section::set_is_unique_segment): New function.
3026 (Output_section::is_unique_segment_): New member.
3027 (Output_section::extra_segment_flags): New function.
3028 (Output_section::set_extra_segment_flags): New function.
3029 (Output_section::extra_segment_flags_): New member.
3030 (Output_section::segment_alignment): New function.
3031 (Output_section::set_segment_alignment): New function.
3032 (Output_section::segment_alignment_): New member.
3033 (Output_segment::Output_segment): Initialize is_unique_segment_.
3034 (Output_segment::is_unique_segment): New function.
3035 (Output_segment::set_is_unique_segment): New function.
3036 (Output_segment::is_unique_segment_): New member.
3037 * plugin.cc (allow_unique_segment_for_sections): New function.
3038 (unique_segment_for_sections): New function.
3039 (Plugin::load): Add new functions to transfer vector.
3040 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3041 * Makefile.in: Regenerate.
3042 * testsuite/plugin_final_layout.sh: Check if unique segment
3043 functionality works.
3044 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3045 are available.
3046 (allow_unique_segment_for_sections): New global.
3047 (unique_segment_for_sections): New global.
3048 (claim_file_hook): Call allow_unique_segment_for_sections.
3049 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3050
1e2bee4f
CC
30512012-08-22 Cary Coutant <ccoutant@google.com>
3052
3053 * layout.cc (Layout::include_section): Don't assert on GROUP
3054 sections with --emit-relocs.
3055
1d5dfe78
CC
30562012-08-21 Cary Coutant <ccoutant@google.com>
3057
3058 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3059 if --export-dynamic-symbol names an undef symbol.
3060
c9269dff
AM
30612012-08-18 Alan Modra <amodra@gmail.com>
3062
3063 * powerpc.cc: Formatting and white space.
3064 (Powerpc_relobj): Rename got2_section_ to special_.
3065 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3066 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3067 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3068 (Target_powerpc): Add Address typedef and invalid_address. Use
3069 throughout.
3070 (Target_powerpc::is_branch_reloc): New function.
3071 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3072 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3073 for dst_mask, value and addend.
3074 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3075 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3076 (Output_data_glink::do_write): Correct toc base. Don't try to use
3077 uint16_t for 24-bit offset. Use get_output_section_offset and
3078 check return.
3079 (Target_powerpc::Scan::local): Handle more relocs.
3080 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3081 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3082 Plug in toc restoring insn after plt calls. Translate branches
3083 to function descriptor symbols to corresponding entry point.
3084 (Target_powerpc::relocate_for_relocatable): Check return from
3085 get_output_section_offset.
3086 * symtab.h: Comment typo.
3087
b1759dce
ILT
30882012-08-14 Ian Lance Taylor <iant@google.com>
3089
3090 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3091 unsupported_relocal_local to call unsupported_reloc_global.
3092
b9b2ae8b
NC
30932012-08-14 Nick Clifton <nickc@redhat.com>
3094
3095 PR ld/14265
3096 * script-sections.cc (Sections_element::output_section_name): Add
3097 keep return parameter.
3098 (Output_section_element::match_name): Add keep return parameter.
3099 Return the value of the keep_ member.
3100 * script-sections.h (class Output_section): Update
3101 output_section_name prototype.
3102 * layout.cc (Layout::keep_input_section): New public member
3103 function.
3104 (Layout::choose_output_section): Pass keep parameter to
3105 output_section_name.
3106 * layout.h (class Layout): Add keep_input_section.
3107 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3108 sections.
3109 * testsuite/Makefile.am: Add a test.
3110 * testsuite/Makefile.in: Regenerate.
3111 * testsuite/pr14265.c: Source file for the test.
3112 * testsuite/pr14265.t: Linker script for the test.
3113 * testsuite/pr14265.sh: Shell script for the test.
3114
921b5322
AM
31152012-08-14 Alan Modra <amodra@gmail.com>
3116
3117 * target.h (Target::output_section_name): New function.
3118 (Target::do_output_section_name): New function.
3119 * layout.cc (Layout::choose_output_section): Call the above.
3120 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3121
6ce78956
AM
31222012-08-14 Alan Modra <amodra@gmail.com>
3123
3124 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3125 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3126 for replace_constant call.
3127 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3128 (Output_data_glink::do_print_to_mapfile): New function.
3129 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3130 (Target_powerpc::Relocate::relocate): Likewise.
3131
d1a8cabd
AM
31322012-08-14 Alan Modra <amodra@gmail.com>
3133
3134 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3135 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3136 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3137 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3138 all references to shndx_. Handle special case for R_PPC_PLTREL24
3139 here.
3140 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3141 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3142 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3143 here.
3144 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3145 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3146
d83ce4e3
AM
31472012-08-12 Alan Modra <amodra@gmail.com>
3148
3149 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3150 (glink insn constants): Use uint32_t.
3151 (Output_data_glink::add_entry): Use insert, not [] operator.
3152
cf43a2fe
AM
31532012-08-11 Alan Modra <amodra@gmail.com>
3154
3155 * object.h (Sized_relobj_file::find_shdr): New function.
3156 (Sized_relobj_file::find_special_sections): New function.
3157 * object.cc (Sized_relobj_file::find_shdr): New function.
3158 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3159 (Sized_relobj_file::find_special_sections): New function, split out..
3160 (Sized_relobj_file::do_read_symbols): ..from here.
3161 * output.h (Output_data_got::replace_constant): New function.
3162 (Output_data_got::num_entries): New function.
3163 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3164 (Output_data_got::got_offset): Protected rather than private.
3165 (Output_data_got::replace_got_entry): New function.
3166 * output.cc (Output_data_got::replace_got_entry): New function.
3167 * powerpc.cc (class Powerpc_relobj): New.
3168 (class Powerpc_relocate_functions): Delete all psymval variants or
3169 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3170 Implement _ha functions using corresponding _hi function.
3171 (Powerpc_relobj::find_special_sections): New function.
3172 (Target_powerpc::do_make_elf_object): New function.
3173 (class Output_data_got_powerpc): New.
3174 (class Output_data_glink): New.
3175 (class Powerpc_scan_relocatable_reloc): New.
3176 Many more changes througout file.
3177
3c892704
NC
31782012-08-09 Nick Clifton <nickc@redhat.com>
3179
3180 * po/vi.po: Updated Vietnamese translation.
3181
82435b3b
ILT
31822012-08-07 Ian Lance Taylor <iant@google.com>
3183
3184 * layout.cc (Layout::add_target_dynamic_tags): If
3185 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3186 plt_rel.
3187
a6dc81d2
NC
31882012-07-30 Nick Clifton <nickc@redhat.com>
3189
3190 * po/gold.pot: Updated template.
3191 * po/es.po: Updated Spanish translation.
3192
f1415016
CC
31932012-07-18 Cary Coutant <ccoutant@google.com>
3194
3195 PR gold/14344
3196 * configure.ac: Add check for -gpubnames support.
3197 * configure: Regenerate.
3198 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3199 support; force -gno-pubnames.
3200 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3201 support.
3202 (gdb_index_test_4): New test.
3203 * testsuite/Makefile.in: Regenerate.
3204 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3205 * testsuite/gdb_index_test_2.sh: Likewise.
3206 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3207 * testsuite/gdb_index_test_4.sh: New script.
3208 * testsuite/gdb_index_test_comm.sh: New script with common code;
3209 don't look for space after colon.
3210
b7fd7c37
ST
32112012-07-16 Sriraman Tallam <tmsriram@google.com>
3212
3213 * gold.cc (queue_middle_tasks): Update function order only after
3214 deferred objects due to plugins are processed.
3215
1f3212db
ILT
32162012-07-11 Ian Lance Taylor <iant@google.com>
3217
3218 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3219 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3220 (Target_arm::scan_reloc_for_stub): Likewise.
3221 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3222 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3223 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3224 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3225 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3226
81c82a68
ILT
32272012-07-10 Dodji Seketeli <dodji@redhat.com>
3228 Ian Lance Taylor <iant@google.com>
3229
3230 PR gold/14309
3231 * configure.ac: Test whether std::tr1::hash<off_t> works.
3232 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3233 needed.
3234 * output.h (class Output_fill): Add virtual destructor.
3235 * configure, config.in: Rebuild.
3236
eabc84f4
RM
32372012-06-22 Roland McGrath <mcgrathr@google.com>
3238
3239 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3240
370e30b6
RÁE
32412012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3242
3243 * plugin.cc (Plugin::load): Handle position independent executables.
3244
fb1b895d
CC
32452012-06-06 Cary Coutant <ccoutant@google.com>
3246
3247 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3248 add .debug_macro.
3249 (lines_only_debug_sections): Likewise.
3250 (gdb_fast_lookup_sections): New static array.
3251 (is_gdb_debug_section): Rename formal parameter.
3252 (is_lines_only_debug_section): Likewise.
3253 (is_gdb_fast_lookup_section): New function.
3254 (Layout::include_section): Check for ".zdebug_" prefix; pass
3255 section name suffix to is_gdb_debug_section, et al.; check for
3256 fast-lookup sections when building .gdb_index.
3257 * options.h (--strip-debug-gdb): Update GDB version number.
3258
7c0640fa
CC
32592012-06-06 Cary Coutant <ccoutant@google.com>
3260
3261 * configure.ac: Add check for fallocate.
3262 * configure: Regenerate.
3263 * config.in: Regenerate.
3264
3265 * options.h (class General_options): Add --mmap-output-file and
3266 --posix-fallocate options.
3267 * output.cc: (posix_fallocate): Remove; replace with...
3268 (gold_fallocate): New function.
3269 (Output_file::map_no_anonymous): Call gold_fallocate.
3270 (Output_file::map): Check --mmap-output-file option.
3271
2a49eb69
DK
32722012-06-05 Jing Yu <jingyu@google.com>
3273
3274 * gold.h (textdomain): Add do {} to empty while(0).
3275 (bindtextdomain): Likewise.
3276
fad072ac
CC
32772012-06-04 Cary Coutant <ccoutant@google.com>
3278
3279 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3280 has_dynsym_index.
3281
8cc69fb6
ST
32822012-05-25 Sriraman Tallam <tmsriram@google.com>
3283
3284 * symtab.cc (Symbol_table::define_special_symbol):
3285 Initialize *poldsym to prevent uninitialized variable errors.
3286
1be75daa
CC
32872012-05-23 Cary Coutant <ccoutant@google.com>
3288
3289 * layout.cc (Layout::section_name_mapping): Add rules to handle
3290 exact match on .data.rel.ro.local or .data.rel.ro.
3291 (Layout::output_section_name): Check for exact matches.
3292
9b689de0
CC
32932012-05-23 Cary Coutant <ccoutant@google.com>
3294
3295 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3296 more carefully.
3297
b24fdbf5
CC
32982012-05-22 Cary Coutant <ccoutant@google.com>
3299
3300 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3301 object before exporting symbol.
3302
e550e1a2
L
33032012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3304
3305 * testsuite/tls_test.cc: Include "config.h" first.
3306 * testsuite/tls_test_c.c: Likewise.
3307
df7b86aa
NC
33082012-05-17 Daniel Richard G. <skunk@iskunk.org>
3309 Nick Clifton <nickc@redhat.com>
3310
3311 PR 14072
3312 * configure.in: Add check that sysdep.h has been included before
3313 any system header files.
3314 * configure: Regenerate.
3315 * config.in: Regenerate.
3316
1007b503
CC
33172012-05-14 Cary Coutant <ccoutant@google.com>
3318
3319 * layout.cc (Layout::make_output_section): Mark .tdata section
3320 as RELRO.
3321 * testsuite/relro_test.cc: Add a TLS variable.
3322
fd885f3a
L
33232012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3324
3325 PR gold/14091
3326 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3327 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3328 R_X86_64_64.
3329
80f5885c
CC
33302012-05-08 Cary Coutant <ccoutant@google.com>
3331
3332 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3333 (lines_only_debug_sections): Likewise.
3334
2e702c99
RM
33352012-05-02 Roland McGrath <mcgrathr@google.com>
3336
3337 * nacl.cc: New file.
3338 * nacl.h: New file.
3339 * Makefile.am (CCFILES, HFILES): Add them.
3340 * Makefile.in: Regenerate.
3341 * i386.cc (Output_data_plt_i386_nacl): New class.
3342 (Output_data_plt_i386_nacl_exec): New class.
3343 (Output_data_plt_i386_nacl_dyn): New class.
3344 (Target_i386_nacl): New class.
3345 (Target_selector_i386_nacl): New class.
3346 (target_selector_i386): Use it instead of Target_selector_i386.
3347 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3348 (Target_x86_64_nacl): New class.
3349 (Target_selector_x86_64_nacl): New class.
3350 (target_selector_x86_64, target_selector_x32): Use it instead of
3351 Target_selector_x86_64.
3352 * arm.cc (Output_data_plt_arm_nacl): New class.
3353 (Target_arm_nacl): New class.
3354 (Target_selector_arm_nacl): New class.
3355 (target_selector_arm, target_selector_armbe): Use it instead of
3356 Target_selector_arm.
3357
3358 * target-select.cc (select_target): Take new Input_file* and off_t
3359 arguments, pass them on to recognize method of selector.
3360 * object.cc (make_elf_sized_object): Update caller.
3361 * parameters.cc (parameters_force_valid_target): Likewise.
3362 * incremental.cc (make_sized_incremental_binary): Likewise.
3363 * target-select.h: Update decl.
3364 (Target_selector::recognize): Take new Input_file* argument,
3365 pass it on to do_recognize.
3366 (Target_selector::do_recognize): Take new Input_file* argument.
3367 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3368 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3369 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3370 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3371
3372 * target.h (Target::Target_info): New members isolate_execinstr
3373 and rosegment_gap.
3374 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3375 * arm.cc (Target_arm::arm_info): Update initializer.
3376 * i386.cc (Target_i386::i386_info): Likewise.
3377 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3378 * sparc.cc (Target_sparc::sparc_info): Likewise.
3379 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3380 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3381 * layout.cc (Layout::attach_allocated_section_to_segment):
3382 Take new const Target* argument. If target->isolate_execinstr(), act
3383 like --rosegment.
3384 (Layout::find_first_load_seg): Take new const Target* argument;
3385 if target->isolate_execinstr(), reject PF_X segments.
3386 (Layout::relaxation_loop_body): Update caller.
3387 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3388 reset file offset to zero when we hit LOAD_SEG, and then do a second
3389 loop over the segments before LOAD_SEG to reassign offsets after
3390 addresses have been determined. Handle target->rosegment_gap().
3391 (Layout::attach_section_to_segment): Take new const Target* argument;
3392 pass it to attach_allocated_section_to_segment.
3393 (Layout::make_output_section): Update caller.
3394 (Layout::attach_sections_to_segments): Take new const Target* argument;
3395 pass it to attach_section_to_segment.
3396 * gold.cc (queue_middle_tasks): Update caller.
3397 * layout.h (Layout): Update method decls with new arguments.
3398
3399 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3400 Target_info pointer to use.
3401 (Target_arm::do_make_data_plt): New virtual method.
3402 (Target_arm::make_data_plt): New method that calls it.
3403 (Target_arm::make_plt_entry): Use it.
3404 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3405 for the section alignment.
3406 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3407 method.
3408 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3409 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3410 method.
3411 (Output_data_plt_arm::get_plt_entry_size): Call it.
3412 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3413 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3414 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3415 method.
3416 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3417 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3418 method instead of sizeof(plt_entry).
3419 (Output_data_plt_arm::add_entry): Likewise.
3420 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3421 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3422 than static method.
3423 (Target_arm::plt_entry_size): Likewise.
3424 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3425 Move to ...
3426 (Output_data_plt_arm_standard): ... here, new class.
3427 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3428 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3429 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3430
3431 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3432 Take additional argument for the PLT entry size.
3433 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3434 Use get_plt_entry_size method rather than plt_entry_size variable.
3435 (Output_data_plt_x86_64::reserve_slot): Likewise.
3436 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3437 (Output_data_plt_x86_64::add_entry): Likewise.
3438 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3439 (Output_data_plt_x86_64::address_for_global): Likewise.
3440 (Output_data_plt_x86_64::address_for_local): Likewise.
3441 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3442 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3443 Make method non-static.
3444 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3445 method.
3446 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3447 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3448 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3449 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3450 virtual method.
3451 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3452 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3453 virtual method.
3454 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3455 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3456 virtual method.
3457 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3458 (Output_data_plt_x86_64::plt_entry_size)
3459 (Output_data_plt_x86_64::first_plt_entry)
3460 (Output_data_plt_x86_64::plt_entry)
3461 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3462 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3463 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3464 (Output_data_plt_x86_64_standard): ... here, new class.
3465 (Target_x86_64::Target_x86_64): Take optional argument for the
3466 Target_info pointer to use.
3467 (Target_x86_64::do_make_data_plt): New virtual method.
3468 (Target_x86_64::make_data_plt): New method to call it.
3469 (Target_x86_64::init_got_plt_for_update): Use that.
3470 Call this->plt_->add_eh_frame method here.
3471 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3472 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3473 rather than static method.
3474 (Target_x86_64::plt_entry_size): Likewise.
3475 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3476 rather than plt_entry_size variable. Move guts of PLT filling to...
3477 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3478 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3479 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3480
3481 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3482 additional argument for the section alignment.
3483 Don't do add_eh_frame_for_plt here.
3484 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3485 non-static. Use get_plt_entry_size method rather than plt_entry_size
3486 variable.
3487 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3488 method.
3489 (Output_data_plt_i386::get_plt_entry_size): Call it.
3490 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3491 (Output_data_plt_i386::add_eh_frame): New method to call it.
3492 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3493 method.
3494 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3495 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3496 method.
3497 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3498 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3499 method instead of plt_entry_size.
3500 (Output_data_plt_i386::plt_entry_size)
3501 (Output_data_plt_i386::plt_eh_frame_fde_size)
3502 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3503 (Output_data_plt_i386_standard): ... here, new class.
3504 (Output_data_plt_i386_exec): New class.
3505 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3506 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3507 (Output_data_plt_i386::exec_plt_entry): Move to ...
3508 (Output_data_plt_i386_exec::plt_entry): ... here.
3509 (Output_data_plt_i386_dyn): New class.
3510 (Output_data_plt_i386::first_plt_entry): Move to ...
3511 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3512 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3513 (Output_data_plt_i386_dyn::plt_entry): ... here.
3514 (Target_i386::Target_i386): Take optional argument for the Target_info
3515 pointer to use.
3516 (Target_i386::do_make_data_plt): New virtual method.
3517 (Target_i386::make_data_plt): New method to call it.
3518 (Target_i386::make_plt_section): Use that.
3519 Call this->plt_->add_eh_frame method here.
3520 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3521 rather than plt_entry_size variable.
3522 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3523 (Output_data_plt_i386::address_for_local): Likewise.
3524 (Output_data_plt_i386::do_write): Likewise.
3525 Move guts of PLT filling to...
3526 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3527 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3528 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3529 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3530
b9b9f2ee
CC
35312012-05-01 Cary Coutant <ccoutant@google.com>
3532
3533 * dwarf_reader.cc (Dwarf_die::read_attributes)
3534 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3535 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3536 * reduced_debug_output.cc
3537 (Output_reduced_debug_info_section::get_die_end): Remove
3538 DW_FORM_GNU_ref_index. Add default case.
3539
57923f48
MW
35402012-04-26 Mark Wielaard <mjw@redhat.com>
3541
3542 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3543 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3544 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3545 DW_AT_high_pc as offset from DW_AT_low_pc.
3546
3547 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3548 * testsuite/Makefile.in: Regenerate.
3549 * testsuite/gdb_index_test_3.c: New test source file.
3550 * testsuite/gdb_index_test_3.sh: New test source file.
3551
2c54b4f4
ILT
35522012-04-25 Ian Lance Taylor <iant@google.com>
3553
3554 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3555 pointer.
3556 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3557 as a class, not a struct.
3558 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3559 (Target_arm::apply_cortex_a8_workaround): Likewise.
3560 * gc.h: Declare Reloc_types as a struct, not a class.
3561 * object.h: Declare Symbols_data as a struct.
3562 * reloc.h: Declare Read_relocs_data as a struct.
3563 * target.h: Declare Relocate_info as a struct.
3564
a5a5f7a3
DM
35652012-04-24 David S. Miller <davem@davemloft.net>
3566
3567 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3568 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3569 and R_SPARC_WPLT30.
3570
f038d496
CC
35712012-04-24 Cary Coutant <ccoutant@google.com>
3572
3573 * incremental-dump.cc (find_input_containing_global): Replace
3574 magic number with symbolic constant.
3575 (dump_incremental_inputs): Update version number.
3576 * incremental.cc (Output_section_incremental_inputs): Update version
3577 number; import symbolic constants from Incremental_inputs_reader.
3578 (Incremental_inputs::create_data_sections): Align relocations
3579 section correctly for 64-bit targets.
3580 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3581 constants; add padding.
3582 (Output_section_incremental_inputs::write_header): Add assert for
3583 header_size.
3584 (Output_section_incremental_inputs::write_input_files): Add assert
3585 for input_entry_size.
3586 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3587 add assert for object_info_size, input_section_entry_size,
3588 global_sym_entry_size.
3589 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3590 for data structure sizes; use them.
3591 (Incremental_input_entry_reader): Import symbolic constants from
3592 Incremental_inputs_reader; use them.
3593
a4d85145
DM
35942012-04-23 David S. Miller <davem@davemloft.net>
3595
3596 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3597 and elf_flags_set_.
3598 (Target_sparc::Target_sparc): Initialize new fields.
3599 (Target_sparc::do_make_elf_object): New function.
3600 (Target_sparc::do_adjust_elf_header): New function.
3601
1d509098
CC
36022012-04-23 Cary Coutant <ccoutant@google.com>
3603
3604 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3605 CU range table of gdb index.
3606
7ebeff7f
DM
36072012-04-20 David S. Miller <davem@davemloft.net>
3608
3609 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3610 instead of false.
3611
13cf9988
DM
36122012-04-16 David S. Miller <davem@davemloft.net>
3613
2a1079e8
DM
3614 * sparc.cc (Target_sparc::got_address): New function.
3615 (Sparc_relocate_functions::gdop_hix22): New function.
3616 (Sparc_relocate_functions::gdop_lox10): New function.
3617 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3618 relocs.
3619 (Target_sparc::Scan::local): Likewise if the global symbol is not
3620 preemptible and is not IFUNC.
3621 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3622 transformations for local and non-preemptible non-IFUNC global
3623 symbols.
3624
0bc964fc
DM
3625 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3626 writing out 64-bit part of ranges.
3627
661d7a80
DM
3628 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3629 -fpic and -fpie respectively.
3630 * Makefile.in: Regenerate.
3631
8c2bf391
DM
3632 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3633 (Target_sparc::Target_sparc): Initialize new field.
3634 (Target_sparc::do_plt_section_for_global): New function.
3635 (Target_sparc::do_plt_section_for_local): New function.
3636 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3637 (Target_sparc::make_plt_section): New function, broken out of
3638 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3639 (Target_sparc::make_plt_entry): Call make_plt_section.
3640 (Target_sparc::make_local_ifunc_plt_entry): New function.
3641 (Target_sparc::rela_ifunc_section): New function.
3642 (Target_sparc::plt_section): Remove const.
3643 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3644 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3645 and ifunc_count_ fields.
3646 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3647 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3648 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3649 (Output_data_plt_sparc::rela_ifunc): New function.
3650 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3651 (Output_data_plt_sparc::has_ifunc_section): New function.
3652 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3653 (Output_data_plt_sparc::address_for_global): New function.
3654 (Output_data_plt_sparc::address_for_local): New function.
3655 (Output_data_plt_sparc::plt_index_to_offset): New function.
3656 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3657 and entry_count.
3658 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3659 entry_count.
3660 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3661 R_SPARC_JMP_IREL to switch.
3662 (Target_sparc::Scan::check_non_pic): Likewise.
3663 (Target_sparc::Scan::local): Handle IFUNC symbols.
3664 (Target_sparc::Scan::local): Likewise.
3665 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3666 and plt_address_for_local.
3667 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3668 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3669
13cf9988
DM
3670 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3671 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3672 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3673 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3674 global relocs too.
3675 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3676 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3677 calls.
3678 * sparc.cc (Target_sparc::Scan::global): Likewise.
3679 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3680
31821be0
CC
36812012-04-16 Cary Coutant <ccoutant@google.com>
3682
3683 * archive.cc (Library_base::should_include_member): Check for
3684 --export-dynamic-symbol.
3685 * options.h (class General_options): Add --export-dynamic-symbol.
3686 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3687 --export-dynamic-symbol.
3688 (Symbol_table::gc_mark_undef_symbols): Likewise.
3689 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3690
2615994e
DM
36912012-04-12 David S. Miller <davem@davemloft.net>
3692
3693 * sparc.cc (Reloc::wdisp10): New relocation method.
3694 (Reloc::h34): Likewise.
3695 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3696 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3697 R_SPARC_WDISP10.
3698 (Target_sparc::Scan::local): Likewise.
3699 (Target_sparc::Scan::global): Likewise.
3700 (Target_sparc::Relocate::relocate): Likewise.
3701
6782735d
CC
37022012-04-09 Cary Coutant <ccoutant@google.com>
3703
3704 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3705 low_pc == 0.
3706
8c7a0b00
ILT
37072012-04-06 Ian Lance Taylor <iant@google.com>
3708
3709 * timer.cc: #include <unistd.h>.
3710
58797674
RM
37112012-04-06 Roland McGrath <mcgrathr@google.com>
3712
3713 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3714 * config.in: Regenerate.
3715 * configure: Regenerate.
3716
44350750
NC
37172012-04-05 Nick Clifton <nickc@redhat.com>
3718
3719 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3720 (AM_LC_MESSAGES): Add.
3721 * aclocal.m4: Regenerate.
3722 * config.in: Regenerate.
3723 * configure: Regenerate.
3724
c1027032
CC
37252012-03-21 Cary Coutant <ccoutant@google.com>
3726
3727 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3728 * Makefile.in: Regenerate.
3729 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3730 (Sized_elf_reloc_mapper::symbol_section): New function.
3731 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3732 (make_elf_reloc_mapper): New function.
3733 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3734 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3735 (Dwarf_abbrev_table::do_get_abbrev): New function.
3736 (Dwarf_ranges_table::read_ranges_table): New function.
3737 (Dwarf_ranges_table::read_range_list): New function.
3738 (Dwarf_pubnames_table::read_section): New function.
3739 (Dwarf_pubnames_table::read_header): New function.
3740 (Dwarf_pubnames_table::next_name): New function.
3741 (Dwarf_die::Dwarf_die): New function.
3742 (Dwarf_die::read_attributes): New function.
3743 (Dwarf_die::skip_attributes): New function.
3744 (Dwarf_die::set_name): New function.
3745 (Dwarf_die::set_linkage_name): New function.
3746 (Dwarf_die::attribute): New function.
3747 (Dwarf_die::string_attribute): New function.
3748 (Dwarf_die::int_attribute): New function.
3749 (Dwarf_die::uint_attribute): New function.
3750 (Dwarf_die::ref_attribute): New function.
3751 (Dwarf_die::child_offset): New function.
3752 (Dwarf_die::sibling_offset): New function.
3753 (Dwarf_info_reader::check_buffer): New function.
3754 (Dwarf_info_reader::parse): New function.
3755 (Dwarf_info_reader::do_parse): New function.
3756 (Dwarf_info_reader::do_read_string_table): New function.
3757 (Dwarf_info_reader::lookup_reloc): New function.
3758 (Dwarf_info_reader::get_string): New function.
3759 (Dwarf_info_reader::visit_compilation_unit): New function.
3760 (Dwarf_info_reader::visit_type_unit): New function.
3761 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3762 Sized_elf_reloc_mapper.
3763 (Sized_dwarf_line_info::symbol_section): Remove function.
3764 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3765 (Sized_dwarf_line_info::read_line_mappings): Remove object
3766 parameter, adjust callers.
3767 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3768 * dwarf_reader.h: Include <sys/types.h>.
3769 (class Track_relocs): Remove forward declaration.
3770 (class Elf_reloc_mapper): New class.
3771 (class Sized_elf_reloc_mapper): New class.
3772 (class Dwarf_abbrev_table): New class.
3773 (class Dwarf_range_list): New class.
3774 (class Dwarf_ranges_table): New class.
3775 (class Dwarf_pubnames_table): New class.
3776 (class Dwarf_die): New class.
3777 (class Dwarf_info_reader): New class.
3778 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3779 (Sized_dwarf_line_info::symbol_section): Remove member function.
3780 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3781 base class.
3782 * gdb-index.cc: New source file.
3783 * gdb-index.h: New source file.
3784 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3785 and .debug_types sections, call Layout::add_to_gdb_index.
3786 (Sized_relobj_incr::do_section_name): Implement.
3787 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3788 return type; Implement.
3789 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3790 return type.
3791 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3792 parameter list and return type.
3793 (Sized_incr_dynobj::do_section_contents): Likewise.
3794 * layout.cc: Include gdb-index.h.
3795 (Layout::Layout): Initialize gdb_index_data_.
3796 (Layout::init_fixed_output_section): Check for .gdb_index section.
3797 (Layout::add_to_gdb_index): New function. Instantiate.
3798 * layout.h: Add forward declaration for class Gdb_index.
3799 (Layout::add_to_gdb_index): New member function.
3800 (Layout::gdb_index_data_): New data member.
3801 * main.cc: Include gdb-index.h.
3802 (main): Print statistics for gdb index.
3803 * object.cc (Object::section_contents): Move code into
3804 do_section_contents.
3805 (need_decompressed_section): Check for sections needed when building
3806 gdb index.
3807 (build_compressed_section_map): Likewise.
3808 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3809 gdb index.
3810 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3811 sections; call Layout::add_to_gdb_index.
3812 (Sized_relobj_file::do_decompressed_section_contents): Call
3813 do_section_contents directly.
3814 * object.h (Object::do_section_contents): Adjust parameter list and
3815 return type.
3816 (Object::do_decompressed_section_contents): Call do_section_contents
3817 directly.
3818 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3819 return type.
3820 * options.h (class General_options): Add --gdb-index option.
3821 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3822 list and return type.
3823 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3824 * reloc.h (Track_relocs::checkpoint): New function.
3825 (Track_relocs::reset): New function.
3826
3827 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3828 New test cases.
3829 * testsuite/Makefile.in: Regenerate.
3830 * testsuite/gdb_index_test.cc: New test source file.
3831 * testsuite/gdb_index_test_1.sh: New test source file.
3832 * testsuite/gdb_index_test_2.sh: New test source file.
3833
647f1574
DK
38342012-03-19 Doug Kwan <dougkwan@google.com>
3835
3836 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3837 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3838 __exidx_start and __exidx_end. Make symbol table parameter
3839 anonymous as it is not used.
3840 * gold.cc (queue_middle_tasks): Call target hook to define any
3841 target-specific symbols.
3842 * target.h (Target::define_standard_symbols): New method.
3843 (Target::do_define_standard_symbols): Same.
3844 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3845 * testsuite/Makefile.in: Regenerate.
3846 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3847 and __exidx_end.
3848 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3849 relocations are generated for __exidx_start and __exidx_end.
3850
7c6109da
DK
38512012-03-16 Doug Kwan <dougkwan@google.com>
3852
3853 * testsuite/Makefile.am: Disable test initpri3b.
3854 * testsuite/Makefile.in: Regenerate.
3855
7b8957f8
DK
38562012-03-15 Doug Kwan <dougkwan@google.com>
3857
3858 * arm.cc (Target_arm::got_section): Make .got section read-only
3859 if -z now is given.
3860
14dc9ef7
ILT
38612012-03-15 Ian Lance Taylor <iant@google.com>
3862
3863 PR gold/13850
3864 * layout.cc (Layout::make_output_section): Correctly mark
3865 SHT_INIT_ARRAY, et. al., as relro.
3866
fa40b62a
DK
38672012-03-14 Doug Kwan <dougkwan@google.com>
3868
3869 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3870 dynamic relocations for protected symbols in shared objects.
3871
fd325007
ILT
38722012-03-13 Ian Lance Taylor <iant@google.com>
3873
3874 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3875 keep the larger alignment.
3876
e8dd54e1
CC
38772012-03-12 Cary Coutant <ccoutant@google.com>
3878
3879 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3880 handling of DW_LNE_define_file.
3881
feb5f3b0
CC
38822012-03-12 Cary Coutant <ccoutant@google.com>
3883
3884 * reduced_debug_output.cc
3885 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3886 codes to switch.
3887
a1fb4256
CC
38882012-02-29 Cary Coutant <ccoutant@google.com>
3889
3890 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3891
5dd8762a
CC
38922012-02-29 Cary Coutant <ccoutant@google.com>
3893
3894 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3895 Call Object::decompressed_section_contents.
3896 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3897 New dtor.
3898 (Sized_dwarf_line_info::buffer_start_): New data member.
3899 * merge.cc (Output_merge_data::do_add_input_section): Call
3900 Object::decompressed_section_contents.
3901 (Output_merge_string::do_add_input_section): Likewise.
3902 * object.cc (need_decompressed_section): New function.
3903 (build_compressed_section_map): Decompress sections needed later.
3904 (Sized_relobj_file::do_decompressed_section_contents): New function.
3905 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3906 * object.h (Object::decompressed_section_contents): New function.
3907 (Object::discard_decompressed_sections): New function.
3908 (Object::do_decompressed_section_contents): New function.
3909 (Object::do_discard_decompressed_sections): New function.
3910 (Compressed_section_info): New type.
3911 (Compressed_section_map): Include decompressed section contents.
3912 (Sized_relobj_file::do_decompressed_section_contents): New function.
3913 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3914
7b5de7ee
CC
39152012-02-16 Cary Coutant <ccoutant@google.com>
3916
3917 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3918 * testsuite/Makefile.in: Regenerate.
3919
f9fa4a63
CC
39202012-02-14 Cary Coutant <ccoutant@google.com>
3921
3922 * options.cc (General_options::finalize): Disallow -pie and -static.
3923
2c175ebc
DK
39242012-02-03 Doug Kwan <dougkwan@google.com>
3925
3926 * arm.cc (Arm_relocate_functions::abs8,
3927 Arm_relocate_functions::abs16): Use
3928 Bits::has_signed_unsigned_overflow32.
3929 (Arm_relocate_functions::thm_abs8): Correct range of
3930 overflow check.
3931 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3932 in assertions.
3933
90cff06f
DK
39342012-02-02 Doug Kwan <dougkwan@google.com>
3935
3936 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3937 position independent outputs, not just shared objects.
3938
63887f3d
L
39392012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3940
3941 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3942 * configure: Regenerated.
3943
bef2b434
ILT
39442012-01-27 Ian Lance Taylor <iant@google.com>
3945
3946 * reloc.h (Bits): New class with static functions, copied from
3947 namespace utils in arm.cc.
3948 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3949 instead.
3950
c335b55d
L
39512012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3952
3953 * incremental.cc (write_info_blocks): Correct relocation offset.
3954
41194d9f
L
39552012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3956
3957 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3958 (Relocate::tls_gd_to_le): Likewise.
3959
1bae613c
L
39602012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3961
3962 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3963
24482ca0
L
39642012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3965
3966 * configure.ac: Check if -mcmodel=medium works.
3967 * configure: Regenerated.
3968
c2c7840a
CC
39692012-01-24 Cary Coutant <ccoutant@google.com>
3970
3971 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3972 definition and ...
3973 (read_unsigned_LEB_128_x): ... this new function.
3974 (read_signed_LEB_128): Replaced with inline definition and ...
3975 (read_signed_LEB_128_x): ... this new function.
3976 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3977 (read_unsigned_LEB_128): Add inline definition.
3978 (read_signed_LEB_128_x): New function.
3979 (read_signed_LEB_128): Add inline definition.
3980 * testsuite/Makefile.am (leb128_unittest): New unit test.
3981 * testsuite/Makefile.in: Regenerate.
3982 * testsuite/leb128_unittest.cc: New unit test.
3983
833de760 39842012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3985
3986 PR gold/13617
3987 * i386.cc (Target_i386::do_code_fill): When using a jmp
3988 instruction, pad with nop instructions.
3989 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3990
618d6666
L
39912012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3992
3993 * x86_64.cc (gc_process_relocs): Add typename on types used in
3994 template.
3995 (scan_relocs): Likewise.
3996 (relocate_section): Likewise.
3997 (apply_relocation): Likewise.
3998
3660ff06
L
39992012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4000
4001 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4002 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4003 under x32.
4004
fc51264f
L
40052012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4006
4007 * x86_64.cc: Initial support for x32.
4008
dd74ae06
CC
40092012-01-03 Cary Coutant <ccoutant@google.com>
4010
4011 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4012 Use abstract base class for GOT.
4013 * gold/output.h (class Output_data_got_base): New abstract base class.
4014 (class Output_data_got): Derive from new base class, adjust ctors.
4015 (Output_data_got::reserve_slot): Make virtual; rename to
4016 do_reserve_slot; Adjust callers.
4017 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4018 pointer to abstract base class.
4019 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4020
83896202
ILT
40212011-12-18 Ian Lance Taylor <iant@google.com>
4022
4023 * object.h (Relobj::local_symbol_value): New function.
4024 (Relobj::local_plt_offset): New function.
4025 (Relobj::local_has_got_offset): New function.
4026 (Relobj::local_got_offset): New function.
4027 (Relobj::set_local_got_offset): New function.
4028 (Relobj::do_local_symbol_value): New pure virtual function.
4029 (Relobj::do_local_plt_offset): Likewise.
4030 (Relobj::do_local_has_got_offset): Likewise.
4031 (Relobj::do_local_got_offset): Likewise.
4032 (Relobj::do_set_local_got_offset): Likewise.
4033 (Sized_relobj::do_local_has_got_offset): Rename from
4034 local_has_got_offset.
4035 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4036 (Sized_relobj::do_set_local_got_offset): Rename from
4037 set_local_got_offset.
4038 (Sized_relobj_file::do_local_plt_offset): Rename from
4039 local_plt_offset.
4040 (Sized_relobj_file::do_local_symbol_value): New function.
4041 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4042 local_plt_offset.
4043 * output.cc (Output_data_got::Got_entry::write): Change object to
4044 Relobj. Use local_symbol_value.
4045 (Output_data_got::add_global_with_rel): Change rel_dyn to
4046 Output_data_reloc_generic*. Use add_global_generic.
4047 (Output_data_got::add_global_with_rela): Remove. Change all
4048 callers to use add_global_with_rel.
4049 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4050 Output_data_reloc_generic*. Use add_global_generic.
4051 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4052 callers to use add_global_pair_with_rel.
4053 (Output_data_got::add_local): Change object to Relobj*.
4054 (Output_data_got::add_local_plt): Likewise.
4055 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4056 change rel_dyn to Output_data_reloc_generic*. Use
4057 add_local_generic.
4058 (Output_data_got::add_local_with_rela): Remove. Change all
4059 callers to use all_local_with_rel.
4060 (Output_data_got::add_local_pair_with_rel): Change object to
4061 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4062 add_output_section_generic.
4063 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4064 callers to use add_local_pair_with_rel.
4065 (Output_data_got::reserve_local): Change object to Relobj*.
4066 * output.h: (class Output_data_reloc_generic): Add pure virtual
4067 declarations for add_global_generic, add_local_generic,
4068 add_output_section_generic.
4069 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4070 functions for Output_data_reloc_generic. Update declarations for
4071 changes listed in output.cc.
4072 (class Output_data_got): Change template parameter to got_size.
4073 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4074 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4075 function.
4076 (Sized_relobj_incr::do_local_plt_offset): New function.
4077 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4078 add_global_generic.
4079
76677ad0
CC
40802011-12-17 Cary Coutant <ccoutant@google.com>
4081
4082 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4083 * resolve.cc (Symbol_table::resolve): Likewise.
4084 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4085 arrays.
4086 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4087
8b8dd8d5
ILT
40882011-12-16 Ian Lance Taylor <iant@google.com>
4089
4090 * output.h (Output_data_reloc_generic::add): Only call
4091 add_dynamic_reloc if this is a dynamic reloc section.
4092
d55525b9
L
40932011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4094
4095 PR gold/13505
4096 * target-reloc.h (apply_relocation): Replace <64, false> with
4097 <size, big_endian>.
4098
ff81c7c1
NC
40992011-11-25 Nick Clifton <nickc@redhat.com>
4100
4101 * po/it.po: New Italian translation.
4102
628f39be
SA
41032011-11-17 Sterling Augustine <saugustine@google.com>
4104
4105 * script.cc (script_include_directive): Implement.
4106 (read_script_file): New local variables name and search_path. Update
4107 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4108 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4109 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4110
98ef3ea4
SA
41112011-11-11 Sterling Augustine <saugustine@google.com>
4112
4113 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4114 (file_or_sections_cmd): Likewise.
4115
f4a8b6d7
DK
41162011-11-11 Doug Kwan <dougkwan@google.com>
4117
4118 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4119 if --just-symbols is given.
4120
29ab395d
DK
41212011-11-10 Doug Kwan <dougkwan@google.com>
4122
4123 PR gold/13362
4124 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4125 when processing data relocs.
4126 * reloc.h (Relocate_functions::rel_unaligned): New method.
4127 (Relocate_functions::pcrel_unaligned): Ditto.
4128 (Relocate_functions::rel32_unaligned): Ditto.
4129 (Relocate_functions::pcrel32_unaligned): Ditto.
4130
2c339f71
DK
41312011-11-09 Doug Kwan <dougkwan@google.com>
4132
4133 PR gold/13362
4134 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4135 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4136 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4137 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4138 (Relocate_functions::rel_unaligned): New.
4139 (Relocate_functions::rel32_unaligned): New.
4140 * target-reloc.h (relocate_for_relocatable): Add code to handle
4141 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4142 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4143 arm_unaligned_reloc_r): New targets.
4144 * testsuite/Makefile.in: Regenerate.
4145 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4146 linking.
4147
3f3cddf1
ILT
41482011-11-02 Ian Lance Taylor <iant@google.com>
4149
4150 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4151 NATIVE_LINKER.
4152 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4153 * options.cc (General_options::finalize): Use library search path
4154 from configure script if specified. If not native and no sysroot,
4155 only search TOOLLIBDIR.
4156 * options.h (Search_directory::Search_directory): Change name to
4157 const std::string&.
4158 (General_options::add_to_library_path_with_sysroot): Change arg to
4159 const std::string&.
4160 * configure, Makefile.in, config.in: Rebuild.
4161
a8e2273b
ILT
41622011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4163
4164 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4165 we are working around the ARM1176 Erratum.
4166 * options.h (General_options::fix_arm1176): Add option.
4167 * testsuite/Makefile.am: Add testcases, and keep current ones
4168 working.
4169 * testsuite/Makefile.in: Regenerate.
4170 * testsuite/arm_fix_1176.s: New file.
4171 * testsuite/arm_fix_1176.sh: Likewise.
4172
cd6eab1c
ILT
41732011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4174
4175 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4176 may_use_blx_.
4177 (Target_arm::may_use_blx): Remove method.
4178 (Target_arm::set_may_use_blx): Likewise.
4179 (Target_arm::may_use_v4t_interworking): New method.
4180 (Target_arm::may_use_v5t_interworking): Likewise.
4181 (Target_arm::may_use_blx_): Remove member variable.
4182 (Arm_relocate_functions::arm_branch_common): Check for v5T
4183 interworking.
4184 (Arm_relocate_functions::thumb_branch_common): Likewise.
4185 (Reloc_stub::stub_type_for_reloc): Likewise.
4186 (Target_arm::do_finalize_sections): Correct interworking checks.
4187 * testsuite/Makefile.am: Add new tests.
4188 * testsuite/Makefile.in: Regenerate.
4189 * testsuite/arm_farcall_arm_arm.s: New test.
4190 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4191 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4192 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4193 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4194 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4195 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4196 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4197
286adcf4
CC
41982011-10-31 Cary Coutant <ccoutant@google.com>
4199
4200 PR gold/13023
4201 * expression.cc (Expression::eval_with_dot): Add
4202 is_section_dot_assignment parameter.
4203 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4204 absolute and assigning to dot within a section.
4205 * script-sections.cc
4206 (Output_section_element_assignment::set_section_addresses): Pass
4207 dot_section to set_if_absolute.
4208 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4209 as is_section_dot_assignment flag to eval_with_dot.
4210 (Output_section_element_dot_assignment::set_section_addresses):
4211 Likewise.
4212 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4213 parameter. Also set value if relative to dot_section; set the
4214 symbol's output_section.
4215 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4216 parameter. Adjust all callers.
4217 (Expression::eval_maybe_dot): Likewise.
4218 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4219 Adjust all callers.
4220 * testsuite/script_test_2.t: Test assignment of an absolute value
4221 to dot within an output section element.
4222
9634ed06
CC
42232011-10-31 Cary Coutant <ccoutant@google.com>
4224
4225 * options.h (class General_options): Add --[no-]gnu-unique options.
4226 * symtab.cc (Symbol_table::sized_write_globals): Convert
4227 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4228
de4101c7
CC
42292011-10-31 Cary Coutant <ccoutant@google.com>
4230
4231 PR gold/13359
4232 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4233 unnecessary assertion.
4234 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4235
7257cc92
ST
42362011-10-31 Sriraman Tallam <tmsriram@google.com>
4237
4238 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4239 gc_mark_symbol.
4240 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4241 gc_mark_symbol.
4242 Change to just keep the section associated with symbol.
4243 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4244 they are externally visible and --export-dynamic is turned on.
4245 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4246
bfc34b3f
ILT
42472011-10-19 Ian Lance Taylor <iant@google.com>
4248
4249 PR gold/13163
4250 * script-sections.cc
4251 (Output_section_element_dot_assignment::needs_output_section): New
4252 function.
4253
ea0d8c47
ILT
42542011-10-19 Ian Lance Taylor <iant@google.com>
4255
4256 PR gold/13204
4257 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4258 --section-start option was seen.
4259 * options.h (General_options::any_section_start): New function.
4260
abd242a9
DM
42612011-10-18 David S. Miller <davem@davemloft.net>
4262
4263 PR binutils/13301
4264 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4265 member to track relocation locations that have moved during TLS
4266 reloc optimizations.
4267 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4268 (Target_sparc::Relocate::relocate): Adjust view down by 4
4269 bytes if it matches reloc_adjust_addr_.
4270 (Target_sparc::Relocate::relocate_tls): Always move the
4271 __tls_get_addr call delay slot instruction forward 4 bytes when
4272 performing relaxation.
4273
bab9090f
CC
42742011-10-18 Cary Coutant <ccoutant@google.com>
4275
4276 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4277 (Output_file::map_no_anonymous): Check for non-zero
4278 return code from posix_fallocate.
4279
f7c5b166
CC
42802011-10-17 Cary Coutant <ccoutant@google.com>
4281
4282 PR gold/13245
4283 * plugin.cc (is_visible_from_outside): Check for symbols
4284 referenced from dynamic objects.
4285 * resolve.cc (Symbol_table::resolve): Don't count references
4286 from dynamic objects as references from real ELF files.
4287 * testsuite/plugin_test_2.sh: Adjust expected result.
4288
b490c0bb
CC
42892011-10-17 Cary Coutant <ccoutant@google.com>
4290
4291 * gold.cc: Include timer.h.
4292 (queue_middle_tasks): Stamp time.
4293 (queue_final_tasks): Likewise.
4294 * main.cc (main): Store timer in parameters. Print timers
4295 for each pass.
4296 * parameters.cc (Parameters::Parameters): Initialize timer_.
4297 (Parameters::set_timer): New function.
4298 (set_parameters_timer): New function.
4299 * parameters.h (Parameters::set_timer): New function.
4300 (Parameters::timer): New function.
4301 (Parameters::timer_): New data member.
4302 (set_parameters_timer): New function.
4303 * timer.cc (Timer::stamp): New function.
4304 (Timer::get_pass_time): New function.
4305 * timer.h (Timer::stamp): New function.
4306 (Timer::get_pass_time): New function.
4307 (Timer::pass_times_): New data member.
4308
f475cf7b
CC
43092011-10-17 Cary Coutant <ccoutant@google.com>
4310
4311 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4312 task for members of lib groups.
4313
cdd7e244
CC
43142011-10-17 Cary Coutant <ccoutant@google.com>
4315
4316 PR gold/13288
4f95c8b4 4317 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4318 (File_read::make_view): Move bounds check (replace with assert)...
4319 (File_read::find_or_make_view): ... to here.
4320
dfb45471
CC
43212011-10-12 Cary Coutant <ccoutant@google.com>
4322
4f95c8b4 4323 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4324 ::read returns less than requested size.
4325
53bbcc1b
CC
43262011-10-10 Cary Coutant <ccoutant@google.com>
4327
4f95c8b4 4328 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4329 Initialize defined_count_.
4330 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4331 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4332 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4333 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4334 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4335 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4336 member.
4337 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4338 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4339 Return zeroes instead of internal error.
4340
397b129b
CC
43412011-10-10 Cary Coutant <ccoutant@google.com>
4342
4343 PR gold/13249
4f95c8b4 4344 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4345 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4346 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4347 (Output_reloc::type_): Adjust size of bit field.
4348 (Output_reloc::use_plt_offset_): New bit field.
4349 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4350 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4351 flag. Adjust all callers.
4f95c8b4 4352 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4353 creating RELATIVE relocations.
4354
d5698657
NC
43552011-10-10 Nick Clifton <nickc@redhat.com>
4356
4357 * po/es.po: Updated Spanish translation.
4358 * po/fi.po: Updated Finnish translation.
4359
6a59a5c2
DN
43602011-10-03 Diego Novillo <dnovillo@google.com>
4361
4362 * options.cc (parse_uint): Fix dereference of RETVAL.
4363
f0558624
ST
43642011-09-29 Sriraman Tallam <tmsriram@google.com>
4365
4366 * layout.h (section_order_map_): New member.
4367 (get_section_order_map): New member function.
4368 * output.cc (Output_section::add_input_section): Check for patterns
4369 only when --section-ordering-file is specified.
4370 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4371 output_sections have been formed.
4372 * layout.cc (Layout_Layout): Initialize section_order_map_.
4373 * plugin.cc (update_section_order): Store order in order_map. Do not
4374 update the order.
4375 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4376 * testsuite/Makefile.in: Regenerate.
4377 * testsuite/plugin_section_order.c: New file.
4378 * testsuite/plugin_final_layout.cc: New file.
4379 * testsuite/plugin_final_layout.sh: New file.
4380
a7dac153
CC
43812011-09-29 Cary Coutant <ccoutant@google.com>
4382
4f95c8b4 4383 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4384 Check for NULL.
4f95c8b4 4385 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4386 symbols during incremental update.
4387 (Symbol_table::add_from_dynobj): Likewise.
4388
eebd87a5
ILT
43892011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4390 Ian Lance Taylor <iant@google.com>
4391
4392 * symtab.cc (Symbol_table::define_special_symbol): Always
4393 canonicalize version string.
4394
403a3331
CC
43952011-09-26 Cary Coutant <ccoutant@google.com>
4396
4f95c8b4
CC
4397 * gold.cc (queue_initial_tasks): Move option checks ...
4398 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4399 some options; make others fatal.
4400
235061c2
CC
44012011-09-26 Cary Coutant <ccoutant@google.com>
4402
4403 gcc PR lto/47247
4404 * plugin.cc (get_symbols_v2): New function.
4405 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4406 (is_referenced_from_outside): New function.
4407 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4408 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4409 (get_symbols): Pass version parameter.
4410 (get_symbols_v2): New function.
4411 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4412 parameter.
4413 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4414 (onload): Add LDPT_GET_SYMBOLS_V2.
4415 (all_symbols_read_hook): Use get_symbols_v2; check for
4416 LDPR_PREVAILING_DEF_IRONLY_EXP.
4417 * testsuite/plugin_test_3.sh: Update expected results.
4418
dc87f620
ILT
44192011-09-23 Simon Baldwin <simonb@google.com>
4420
4421 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4422 configuration options.
4423 * configure: Regenerate.
4424 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4425 * Makefile.in: Regenerate.
4426 * testsuite/Makefile.in: Regenerate.
4427
a8279f82
ST
44282011-09-19 Sriraman Tallam <tmsriram@google.com>
4429
4430 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4431
0c9350c8
CC
44322011-09-19 Cary Coutant <ccoutant@google.com>
4433
4434 * incremental.cc (can_incremental_update): Fix typo in comment.
4435 * incremental.h (can_incremental_update): Likewise.
4436
aa06ae28
CC
44372011-09-18 Cary Coutant <ccoutant@google.com>
4438
4439 * incremental.cc (can_incremental_update): New function.
4440 * incremental.h (can_incremental_update): New function.
4441 * layout.cc (Layout::init_fixed_output_section): Call it.
4442 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4443 * object.cc (Sized_relobj_file::do_layout): Call
4444 can_incremental_update.
4445
ebb300b2
CC
44462011-09-13 Cary Coutant <ccoutant@google.com>
4447
4448 * configure.ac: Check for glibc support for gnu_indirect_function
4449 support with static linking, setting automake conditional
4450 IFUNC_STATIC.
4451 * Makefile.in: Regenerate.
4452 * configure: Regenerate.
4453
4454 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4455 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4456 for IFUNC_STATIC.
4457 * testsuite/Makefile.in: Regenerate.
4458
1206d0d5
CC
44592011-09-13 Cary Coutant <ccoutant@google.com>
4460
4461 * incremental.cc (Sized_relobj_incr::do_layout): Call
4462 report_comdat_group for kept comdat sections.
4463 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4464 * testsuite/Makefile.in: Regenerate.
4465 * testsuite/incr_comdat_test_1.cc: New source file.
4466 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4467 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4468 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4469
40b29874
ILT
44702011-09-13 Ian Lance Taylor <iant@google.com>
4471
4472 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4473 variable external_symbols_offset.
4474
1b045aac
ILT
44752011-09-12 Ian Lance Taylor <iant@google.com>
4476
4477 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4478 triggered if object has no symbols.
4479
24c6c55a
DM
44802011-09-09 David S. Miller <davem@davemloft.net>
4481
4482 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4483 (Output_fill_debug_line::do_write): Likewise.
4484
66570254
CC
44852011-08-29 Cary Coutant <ccoutant@google.com>
4486
4487 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4488 casts to match formatting specs.
4489 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4490
8ea8cd50
CC
44912011-08-26 Cary Coutant <ccoutant@google.com>
4492
4493 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4494 remaining hole size when allocating.
4495 (Layout::make_output_section): Set fill methods for debug sections.
4496 * layout.h (Free_list::Free_list_node): Move from private to
4497 public.
4498 (Free_list::set_min_hole_size): New function.
4499 (Free_list::begin, Free_list::end): New functions.
4500 (Free_list::min_hole_): New data member.
4501 * output.cc: Include dwarf.h.
4502 (Output_fill_debug_info::do_minimum_hole_size): New function.
4503 (Output_fill_debug_info::do_write): New function.
4504 (Output_fill_debug_line::do_minimum_hole_size): New function.
4505 (Output_fill_debug_line::do_write): New function.
4506 (Output_section::Output_section): Initialize new data member.
4507 (Output_section::set_final_data_size): Ensure patch space is larger
4508 than minimum hole size.
4509 (Output_section::do_write): Fill holes in debug sections.
4510 * output.h (Output_fill): New class.
4511 (Output_fill_debug_info): New class.
4512 (Output_fill_debug_line): New class.
4513 (Output_section::set_free_space_fill): New function.
4514 (Output_section::free_space_fill_): New data member.
4515 * testsuite/Makefile.am (incremental_test_3): Add
4516 --incremental-patch option.
4517 (incremental_test_4): Likewise.
4518 (incremental_test_5): Likewise.
4519 (incremental_test_6): Likewise.
4520 (incremental_copy_test): Likewise.
4521 (incremental_common_test_1): Likewise.
4522 * testsuite/Makefile.in: Regenerate.
4523
7cf80422
NC
45242011-08-26 Nick Clifton <nickc@redhat.com>
4525
4526 * po/es.po: Updated Spanish translation.
4527
c3f7b0e5
CC
45282011-08-01 Cary Coutant <ccoutant@google.com>
4529
4530 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4531 * gold/testsuite/Makefile.in: Regenerate.
4532 * gold/testsuite/justsyms_exec.c: New source file.
4533 * gold/testsuite/justsyms_lib.c: New source file.
4534
9590bf25
CC
45352011-08-01 Cary Coutant <ccoutant@google.com>
4536
4537 * layout.cc (Layout::set_segment_offsets): Don't realign text
4538 segment if -Ttext was specified.
4539 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4540 file type.
4541 * object.h (Sized_relobj_file::e_type): New function.
4542 (Sized_relobj_file::e_type_): New data member.
4543 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4544 base address for ET_EXEC files.
4545 * target.cc (Target::do_make_elf_object_implementation): Allow
4546 ET_EXEC files with --just-symbols option.
4547
dcd8d12e
CC
45482011-07-28 Cary Coutant <ccoutant@google.com>
4549
4550 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4551 Add thread_number parameter.
4552 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4553 * workqueue-threads.cc
4554 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4555 current thread if its thread number is greater than desired thread
4556 count.
4557 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4558 Add thread_number parameter.
4559 (Workqueue::should_cancel_thread): Likewise.
4560 (Workqueue::find_runnable_or_wait): Pass thread_number to
4561 should_cancel_thread.
4562 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4563 parameter.
4564
804eb480
ST
45652011-07-22 Sriraman Tallam <tmsriram@google.com>
4566
4567 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4568 only after checking if it cannot be forced local.
4569 * symtab.h (is_externally_visible): Check if the symbol is not forced
4570 local.
4571
f1ddb600
ILT
45722011-07-15 Ian Lance Taylor <iant@google.com>
4573
4574 * options.h (class General_options): Add --print-output-format.
4575 Move -EL next to -EB, for better --help output.
4576 * target-select.cc: Include <cstdio>, "options.h", and
4577 "parameters.h".
4578 (Target_selector::do_target_bfd_name): New function.
4579 (print_output_format): New function.
4580 * target-select.h (class Target_selector): Update declarations.
4581 (Target_selector::target_bfd_name): New function.
4582 (print_output_format): Declare.
4583 * main.cc: Include "target-select.h".
4584 (main): Handle --print-output-format.
4585 * gold.cc: Include "target-select.h".
4586 (queue_initial_tasks): Handle --print-output-format when there are
4587 no input files.
4588 * parameters.cc (parameters_force_valid_target): Give a better
4589 error message if -EB/-EL does not match target.
4590 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4591 function.
4592
7d172687
ILT
45932011-07-15 Ian Lance Taylor <iant@google.com>
4594
4595 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4596 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4597 (Output_data_plt_i386::do_write): Write address of .dynamic
4598 section to first entry in .got.plt section.
4599 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4600 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4601 Initialize layout_.
4602 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4603 section to first entry in .got.plt section.
4604 * layout.h (Layout::dynamic_section): New function.
4605
e9552f7e
ST
46062011-07-13 Sriraman Tallam <tmsriram@google.com>
4607
4608 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4609 to claim_file call.
4610 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4611 input_section_position_, and input_section_glob_.
4612 (read_layout_from_file): Call function section_ordering_specified.
4613 * layout.h (is_section_ordering_specified): New function.
4614 (section_ordering_specified): New function.
4615 (section_ordering_specified_): New boolean member.
4616 * main.cc(main): Call load_plugins after layout object is defined.
4617 * output.cc (Output_section::add_input_section): Use
4618 function section_ordering_specified to check if section ordering is
4619 needed.
4620 * output.cc (Output_section::add_relaxed_input_section): Use
4621 function section_ordering_specified to check if section ordering is
4622 needed.
4623 (Output_section::update_section_layout): New function.
4624 (Output_section::sort_attached_input_sections): Check if input section
4625 must be reordered.
4626 * output.h (Output_section::update_section_layout): New function.
4627 * plugin.cc (get_section_count): New function.
4628 (get_section_type): New function.
4629 (get_section_name): New function.
4630 (get_section_contents): New function.
4631 (update_section_order): New function.
58797674 4632 (allow_section_ordering): New function.
e9552f7e
ST
4633 (Plugin::load): Add the new interfaces to the transfer vector.
4634 (Plugin_manager::load_plugins): New parameter.
4635 (Plugin_manager::all_symbols_read): New parameter.
4636 (Plugin_manager::claim_file): New parameter. Save the elf object for
4637 unclaimed objects.
4638 (Plugin_manager::get_elf_object): New function.
4639 (Plugin_manager::get_view): Change to directly use the bool to check
4640 if get_view is called from claim_file_hook.
4641 * plugin.h (input_objects): New function
4642 (Plugin__manager::load_plugins): New parameter.
4643 (Plugin_manager::claim_file): New parameter.
4644 (Plugin_manager::get_elf_object): New function.
4645 (Plugin_manager::in_claim_file_handler): New function.
4646 (Plugin_manager::in_claim_file_handler_): New member.
4647 (layout): New function.
4648 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4649 handler with an extra parameter. Make the elf object before calling
4650 claim_file handler.
4651 * testsuite/plugin_test.c (get_section_count): New function pointer.
4652 (get_section_type): New function pointer.
4653 (get_section_name): New function pointer.
4654 (get_section_contents): New function pointer.
4655 (update_section_order): New function pointer.
4656 (allow_section_ordering): New function pointer.
4657 (onload): Check if the new interfaces exist.
4658
9446efde
ILT
46592011-07-13 Ian Lance Taylor <iant@google.com>
4660
4661 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4662 relro section.
4663 * x86_64.cc (Target_x86_64::got_section): Likewise.
4664 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4665 (relro_now_test_SOURCES): New variable.
4666 (relro_now_test_DEPENDENCIES): New variable.
4667 (relro_now_test_LDFLAGS): New variable.
4668 (relro_now_test_LDADD): New variable.
4669 (relro_now_test.so): New target.
4670 * testsuite/Makefile.in: Rebuild.
4671
07aa62f2
ILT
46722011-07-12 Ian Lance Taylor <iant@google.com>
4673
4674 PR gold/12980
4675 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4676 GLOB_DAT relocation rather than a RELATIVE relocation for a
4677 protected symbol when creating a shared library.
4678 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4679 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4680 * testsuite/protected_main_1.cc (main): Test that protected
4681 function has same address.
4682
e2153196
ILT
46832011-07-11 Ian Lance Taylor <iant@google.com>
4684
4685 PR gold/12979
4686 * options.h (class General_options): Add -Bgroup.
4687 * options.cc (General_options::finalize): If -Bgroup is set,
4688 default to --unresolved-symbols=report-all.
4689 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4690 * target-reloc.h (issue_undefined_symbol_error): Handle
4691 --unresolved-symbols=report-all.
4692
6daf5215
ILT
46932011-07-08 Ian Lance Taylor <iant@google.com>
4694
4695 PR gold/11985
4696 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4697 if linker script discards key sections.
4698 (Layout::create_dynamic_symtab): Likewise.
4699 (Layout::assign_local_dynsym_offsets): Likewise.
4700 (Layout::sized_create_version_sections): Likewise.
4701 (Layout::create_interp): Likewise.
4702 (Layout::finish_dynamic_section): Likewise.
4703 (Layout::set_dynamic_symbol_size): Likewise.
4704
beabb2c6
ILT
47052011-07-08 Ian Lance Taylor <iant@google.com>
4706
4707 PR gold/12386
4708 * options.h (class General_options): Add --unresolved-symbols.
4709 * target-reloc.h (issue_undefined_symbol_error): Check
4710 --unresolved-symbols. Add comments.
4711
9c16daf1
ILT
47122011-07-08 Ian Lance Taylor <iant@google.com>
4713
4714 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4715 expression more complex.
4716
191f1a2d
ILT
47172011-07-08 Ian Lance Taylor <iant@google.com>
4718
4719 PR gold/11317
4720 * target-reloc.h (issue_undefined_symbol_error): New inline
4721 function, broken out of relocate_section.
4722 (relocate_section): Call issue_undefined_symbol_error.
4723 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4724 there is no TLS segment if we are about to issue an undefined
4725 symbol error.
4726 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4727
62855347
ILT
47282011-07-08 Ian Lance Taylor <iant@google.com>
4729
4730 PR gold/12279
4731 * resolve.cc (Symbol_table::should_override): Add fromtype
4732 parameter. Change all callers. Give error when linking together
4733 TLS and non-TLS symbol.
4734 (Symbol_table::should_override_with_special): Add fromtype
4735 parameter. Change all callers.
4736 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4737 there is no TLS segment if we have reported some errors.
4738 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4739
67181c72
ILT
47402011-07-08 Ian Lance Taylor <iant@google.com>
4741
4742 PR gold/12372
4743 * target.h (Target::plt_address_for_global): New function.
4744 (Target::plt_address_for_local): New function.
4745 (Target::plt_section_for_global): Remove.
4746 (Target::plt_section_for_local): Remove.
4747 (Target::do_plt_address_for_global): New virtual function.
4748 (Target::do_plt_address_for_local): New virtual function.
4749 (Target::do_plt_section_for_global): Remove.
4750 (Target::do_plt_section_for_local): Remove.
4751 (Target::register_global_plt_entry): Add Symbol_table and Layout
4752 parameters.
4753 * output.cc (Output_data_got::Got_entry::write): Use
4754 plt_address_for_global and plt_address_for_local.
4755 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4756 address of output section.
4757 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4758 got_irelative_, and irelative_count_ fields. Update
4759 declarations.
4760 (Output_data_plt_i386::has_irelative_section): New function.
4761 (Output_data_plt_i386::entry_count): Add irelative_count_.
4762 (Output_data_plt_i386::set_final_data_size): Likewise.
4763 (class Target_i386): Add got_irelative_ and rel_irelative_
4764 fields. Update declarations.
4765 (Target_i386::Target_i386): Initialize new fields.
4766 (Target_i386::do_plt_address_for_global): New function replacing
4767 do_plt_section_for_global.
4768 (Target_i386::do_plt_address_for_local): New function replacing
4769 do_plt_section_for_local.
4770 (Target_i386::got_section): Create got_irelative_.
4771 (Target_i386::rel_irelative_section): New function.
4772 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4773 fields. Don't define __rel_iplt_{start,end}.
4774 (Output_data_plt_i386::add_entry): Add symtab and layout
4775 parameters. Change all callers. Use different PLT and GOT for
4776 IFUNC symbols.
4777 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4778 layout parameters. Change all callers. Use different PLT and
4779 GOT.
4780 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4781 (Output_data_plt_i386::rel_irelative): New function.
4782 (Output_data_plt_i386::address_for_global): New function.
4783 (Output_data_plt_i386::address_for_local): New function.
4784 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4785 IRELATIVE GOT when changing IFUNC GOT entries.
4786 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4787 reloc.
4788 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4789 if we didn't create an IRELATIVE GOT.
4790 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4791 plt_address_for_local.
4792 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4793 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4794 got_irelative_, and irelative_count_ fields. Update
4795 declarations.
4796 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4797 Initialize new fields. Remove symtab parameter. Change all
4798 callers.
4799 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4800 irelative_count_.
4801 (Output_data_plt_x86_64::has_irelative_section): New function.
4802 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4803 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4804 fields. Update declarations.
4805 (Target_x86_64::Target_x86_64): Initialize new fields.
4806 (Target_x86_64::do_plt_address_for_global): New function replacing
4807 do_plt_section_for_global.
4808 (Target_x86_64::do_plt_address_for_local): New function replacing
4809 do_plt_section_for_local.
4810 (Target_x86_64::got_section): Create got_irelative_.
4811 (Target_x86_64::rela_irelative_section): New function.
4812 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4813 all callers. Don't create __rel_iplt_{start,end}.
4814 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4815 parameters. Change all callers. Use different PLT and GOT for
4816 IFUNC symbols.
4817 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4818 layout parameters. Change all callers. Use different PLT and
4819 GOT.
4820 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4821 parameters. Change all callers. Use different PLT and GOT for
4822 IFUNC symbols.
4823 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4824 (Output_data_plt_x86_64::rela_irelative): New function.
4825 (Output_data_plt_x86_64::address_for_global): New function.
4826 (Output_data_plt_x86_64::address_for_local): New function.
4827 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4828 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4829 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4830 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4831 parameters.
4832 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4833 reloc.
4834 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4835 symbols if we didn't create an IRELATIVE GOT.
4836 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4837 plt_address_for_local.
4838 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4839 * testsuite/ifuncvar1.c: New test file.
4840 * testsuite/ifuncvar2.c: New test file.
4841 * testsuite/ifuncvar3.c: New test file.
4842 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4843 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4844 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4845 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4846 * testsuite/Makefile.in: Rebuild.
4847
33c15b45
CC
48482011-07-07 Cary Coutant <ccoutant@google.com>
4849
4850 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4851 (two_file_test_1_ndebug.o): Likewise.
4852 (two_file_test_1b_ndebug.o): Likewise.
4853 (two_file_test_2_ndebug.o): Likewise.
4854 (two_file_test_main_ndebug.o): Likewise.
4855 (incremental_test_2): Link with no-debug versions.
4856
f48b5fb7
CC
48572011-07-06 Cary Coutant <ccoutant@google.com>
4858
4859 * gold/incremental.cc
4860 (Output_section_incremental_inputs::write_info_blocks): Check for
4861 hidden and internal symbols.
4862
221597a5
CC
48632011-07-06 Cary Coutant <ccoutant@google.com>
4864
4865 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4866 Check disposition for startup file.
4867 (Incremental_inputs::report_command_line): Ignore
4868 --incremental-startup-unchanged option.
4869 * options.cc (General_options::parse_incremental_startup_unchanged):
4870 New function.
4871 (General_options::General_options): Initialize new data member.
4872 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4873 (General_options): Add --incremental-startup-unchanged option.
4874 (General_options::incremental_startup_disposition): New function.
4875 (General_options::incremental_startup_disposition_): New data member.
4876
e24719f6
CC
48772011-07-06 Cary Coutant <ccoutant@google.com>
4878
4879 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4880 input file index to Script_info ctor.
4881 (Sized_incremental_binary::do_file_has_changed): Find the
4882 command-line argument for files named in scripts.
4883 * incremental.h (Script_info::Script_info): New ctor
4884 with input file index.
4885 (Script_info::input_file_index): New function.
4886 (Script_info::input_file_index_): New data member.
4887 (Incremental_binary::get_library): Add const.
4888 (Incremental_binary::get_script_info): Add const.
4889 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4890 * testsuite/Makefile.am (incremental_test_5): New test case.
4891 (incremental_test_6): New test case.
4892 * testsuite/Makefile.in: Regenerate.
4893
8f7c81e8
CC
48942011-07-06 Cary Coutant <ccoutant@google.com>
4895
4896 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4897 debug output when command lines differ.
4898
9fbd3822
CC
48992011-07-06 Cary Coutant <ccoutant@google.com>
4900
4901 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4902 --incremental-patch option.
4903 * layout.cc (Free_list::allocate): Extend allocation beyond original
4904 end if enabled.
4905 (Layout::make_output_section): Mark sections that should get
4906 patch space.
4907 * options.cc (parse_percent): New function.
4908 * options.h (parse_percent): New function.
4909 (DEFINE_percent): New macro.
4910 (General_options): Add --incremental-patch option.
4911 * output.cc (Output_section::Output_section): Initialize new data
4912 members.
4913 (Output_section::add_input_section): Print section name when out
4914 of patch space.
4915 (Output_section::add_output_section_data): Likewise.
4916 (Output_section::set_final_data_size): Add patch space when
4917 doing --incremental-full.
4918 (Output_section::do_reset_address_and_file_offset): Remove patch
4919 space.
4920 (Output_segment::set_section_list_addresses): Print debug output
4921 only if --incremental-update.
4922 * output.h (Output_section::set_is_patch_space_allowed): New function.
4923 (Output_section::is_patch_space_allowed_): New data member.
4924 (Output_section::patch_space_): New data member.
4925 * parameters.cc (Parameters::incremental_full): New function.
4926 * parameters.h (Parameters::incremental_full): New function
4927 * testsuite/Makefile.am (incremental_test_2): Add test for
4928 --incremental-patch option.
4929 * testsuite/Makefile.in: Regenerate.
4930 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4931 (t18): Remove function body.
4932
f6cccc2c
DK
49332011-07-05 Doug Kwan <dougkwan@google.com>
4934
4935 PR gold/12771
4936 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4937 Arm_Address type for relocation result.
4938 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4939 overflow check.
4940 (Arm_relocate_functions::abs32): Use unaligned access.
4941 (Arm_relocate_functions::rel32): Ditto.
4942 (Arm_relocate_functions::prel31): Ditto.
4943 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4944 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4945 static data relocations.
4946 * testsuite/Makefile.in: Regnerate.
4947 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4948
28a13fec
ILT
49492011-07-05 Ian Lance Taylor <iant@google.com>
4950
4951 PR gold/12392
4952 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4953 symbols if necessary.
4954 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4955
24d47b34
ILT
49562011-07-05 Ian Lance Taylor <iant@google.com>
4957
4958 PR gold/12952
4959 * resolve.cc (Symbol::override_base_with_special): Simply override
4960 version with special symbol version, ignoring previous version.
4961
41f9cbbe
ILT
49622011-07-05 Ian Lance Taylor <iant@google.com>
4963
4964 * object.cc (Sized_relobj_file::include_section_group): Add
4965 information to comment about signature location.
4966
886288f1
ILT
49672011-07-02 Ian Lance Taylor <iant@google.com>
4968
4969 PR gold/12957
4970 * options.h (class General_options): Add -f and -F.
4971 * options.cc (General_options::finalize): Fatal error if -f/-F
4972 are used without -shared.
4973 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4974
ae3a6d4f
ILT
49752011-07-02 Ian Lance Taylor <iant@google.com>
4976
4977 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4978
21131061
ILT
49792011-07-01 Ian Lance Taylor <iant@google.com>
4980
4981 PR gold/12525
4982 PR gold/12952
4983 * resolve.cc (Symbol::override_base_with_special): Don't override
4984 the version if the overriding symbol has a different name.
4985 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4986 all callers. If we give an error about an undefined version,
4987 define the base version if necessary.
4988 * dynobj.h (class Versions): Update declaration.
4989 * testsuite/weak_alias_test_5.cc: New file.
4990 * testsuite/weak_alias_test.script: New file.
4991 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4992 and versioned_alias have the right value, and call t2.
4993 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4994 weak_alias_test_5.so.
4995 (weak_alias_test_LDADD): Likewise.
4996 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4997 * testsuite/Makefile.in: Rebuild.
4998
611062c0
ILT
49992011-07-01 Ian Lance Taylor <iant@google.com>
5000
5001 PR gold/12525
5002 * options.h (class General_options): Support -z notext.
5003 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5004 -Wl,-z,notext.
5005 (two_file_shared_nonpic.so): Likewise.
5006 (two_file_shared_mixed.so): Likewise.
5007 (two_file_shared_mixed_1.so): Likewise.
5008 (weak_undef_lib_nonpic.so): Likewise.
5009 (alt/weak_undef_lib_nonpic.so): Likewise.
5010 (tls_test_shared_nonpic.so): Likewise.
5011 * testsuite/Makefile.in: Rebuild.
5012
328c7c2f
ILT
50132011-07-01 Ian Lance Taylor <iant@google.com>
5014
5015 PR gold/12525
5016 * configure.ac: Test whether static linking works, setting
5017 the automake conditional HAVE_STATIC.
5018 * testsuite/Makefile.am: Disable tests using -static if
5019 HAVE_STATIC is not true.
5020 * configure, testsuite/Makefile.in: Rebuild.
5021
02d7cd44
ILT
50222011-07-01 Ian Lance Taylor <iant@google.com>
5023
5024 PR gold/12525
5025 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5026 Assert if we see DW_EH_PE_indirect.
5027 * target.h (Target::ehframe_datarel_base): New function.
5028 (Target::do_ehframe_datarel_base): New target function.
5029 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5030 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5031 function.
5032
07a60597
ILT
50332011-07-01 Ian Lance Taylor <iant@google.com>
5034
5035 PR gold/12571
5036 * options.h (class General_options): Add
5037 --ld-generated-unwind-info.
5038 * ehframe.cc (Fde::write): Add address parameter. Change all
5039 callers. If associated with PLT, fill in address and size.
5040 (Cie::set_output_offset): Only add merge mapping if there is an
5041 object.
5042 (Cie::write): Add address parameter. Change all callers.
5043 (Eh_frame::add_ehframe_for_plt): New function.
5044 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5045 input_offset_ fields into union u_, with new plt field.
5046 (Fde::Fde): Adjust for new union field.
5047 (Fde::Fde) [Output_data version]: New constructor.
5048 (Fde::add_mapping): Only add merge mapping if there is an object.
5049 (class Cie): Update declarations.
5050 (class Eh_frame): Declare add_ehframe_for_plt.
5051 * layout.cc (Layout::layout_eh_frame): Break out code into
5052 make_eh_frame_section, and call it.
5053 (Layout::make_eh_frame_section): New function.
5054 (Layout::add_eh_frame_for_plt): New function.
5055 * layout.h (class Layout): Update declarations.
5056 * merge.cc (Merge_map::add_mapping): Add assertion.
5057 * i386.cc: Include "dwarf.h".
5058 (class Output_data_plt_i386): Make first_plt_entry,
5059 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5060 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5061 and plt_eh_frame_fde.
5062 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5063 boundary. Call add_eh_frame_for_plt if appropriate.
5064 * x86_64.cc: Include "dwarf.h".
5065 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5066 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5067 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5068 and plt_eh_frame_fde.
5069 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5070 appropriate.
5071
14788a3f
ILT
50722011-06-29 Ian Lance Taylor <iant@google.com>
5073
5074 PR gold/12629
5075 * object.cc (Sized_relobj_file::layout_section): Change shdr
5076 parameter to be const.
5077 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5078 out of do_layout.
5079 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5080 appropriate. Call layout_eh_frame_section.
5081 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5082 sections.
5083 * object.h (class Sized_relobj_file): Update declarations.
5084
6c21fce1
ILT
50852011-06-29 Ian Lance Taylor <iant@google.com>
5086
37e41b03 5087 PR gold/12652
6c21fce1
ILT
5088 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5089 modifier.
5090 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5091
4d5e4e62
ILT
50922011-06-29 Ian Lance Taylor <iant@google.com>
5093
5094 PR gold/12675
5095 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5096 SHT_X86_64_UNWIND.
5097 * layout.cc (Layout::layout_eh_frame): Likewise.
5098
886f533a
ILT
50992011-06-29 Ian Lance Taylor <iant@google.com>
5100
5101 PR gold/12695
5102 * layout.cc (Layout::symtab_section_shndx): New function.
5103 * layout.h (class Layout): Declare symtab_section_shndx.
5104 * output.cc (Output_section::write_header): Call it.
5105
f3ae1b28
ILT
51062011-06-29 Ian Lance Taylor <iant@google.com>
5107
5108 PR gold/12818
5109 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5110 symbols which are not used in a relocation.
5111
aecf301f
ILT
51122011-06-28 Ian Lance Taylor <iant@google.com>
5113
5114 PR gold/12898
5115 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5116 script create indistinguishable segments.
5117 (Layout::set_segment_offsets): Use stable_sort when sorting
5118 segments. Pass this to Compare_segments constructor.
5119 * layout.h (class Layout): Make segment_precedes non-static.
5120 (class Compare_segments): Change from struct to class. Add
5121 layout_ field. Add constructor.
5122 * script-sections.cc
5123 (Script_sections::attach_sections_using_phdrs_clause): Rename
5124 local orphan to is_orphan. Don't report failure to put empty
5125 section in segment. On attachment failure, report name of
5126 section, and attach to first PT_LOAD segment.
5127
03ef7571
ILT
51282011-06-28 Ian Lance Taylor <iant@google.com>
5129
5130 PR gold/12934
5131 * target-select.cc (Target_selector::Target_selector): Add
5132 emulation parameter. Change all callers.
5133 (select_target_by_bfd_name): Rename from select_target_by_name.
5134 Change all callers.
5135 (select_target_by_emulation): New function.
5136 (supported_emulation_names): New function.
5137 * target-select.h (class Target_selector): Add emulation_ field.
5138 Update declarations.
5139 (Target_selector::recognize_by_bfd_name): Rename from
5140 recognize_by_name. Change all callers.
5141 (Target_selector::supported_bfd_names): Rename from
5142 supported_names. Change all callers.
5143 (Target_selector::recognize_by_emulation): New function.
5144 (Target_selector::supported_emulations): New function.
5145 (Target_selector::emulation): New function.
5146 (Target_selector::do_recognize_by_bfd_name): Rename from
5147 do_recognize_by_name. Change all callers.
5148 (Target_selector::do_supported_bfd_names): Rename from
5149 do_supported_names. Change all callers.
5150 (Target_selector::do_recognize_by_emulation): New function.
5151 (Target_selector::do_supported_emulations): New function.
5152 (select_target_by_bfd_name): Change name in declaration.
5153 (select_target_by_emulation): Declare.
5154 (supported_emulation_names): Declare.
5155 * parameters.cc (parameters_force_valid_target): Try to find
5156 target based on emulation from -m option.
5157 * options.h (class General_options): Change doc string for -m.
5158 * options.cc (help): Print emulations.
5159 (General_options::parse_V): Likewise.
5160 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5161 Add emulation parameter. Change all callers.
5162
200b2bb9
ILT
51632011-06-28 Ian Lance Taylor <iant@google.com>
5164
5165 * target.h (class Target): Add osabi_ field.
5166 (Target::osabi): New function.
5167 (Target::set_osabi): New function.
5168 (Target::Target): Initialize osabi_.
5169 (Target::do_adjust_elf_header): Make pure virtual.
5170 (Sized_target::do_adjust_elf_header): Declare.
5171 * target.cc (Sized_target::do_adjust_elf_header): New function.
5172 (class Sized_target): Instantiate all versions.
5173 * freebsd.h (class Target_freebsd): Remove.
5174 (Target_selector_freebsd::do_recognize): Call set_osabi on
5175 Target.
5176 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5177 (Target_selector_freebsd::set_osabi): Remove.
5178 * i386.cc (class Target_i386): Inherit from Sized_target rather
5179 than Target_freebsd.
5180 * x86_64.cc (class Target_x86_64): Likewise.
5181
b3ce541e
ILT
51822011-06-28 Ian Lance Taylor <iant@google.com>
5183
5184 * target.h (Target::can_check_for_function_pointers): Rewrite.
5185 Make non-virtual.
5186 (Target::can_icf_inline_merge_sections): Likewise.
5187 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5188 (Target::Target_info): Add can_icf_inline_merge_sections field.
5189 (Target::do_can_check_for_function_pointers): New virtual
5190 function.
5191 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5192 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5193 from can_check_for_function_pointers, move in file.
5194 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5195 section_may_have_icf_unsafe_poineters, move in file.
5196 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5197 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5198 Rename from can_check_for_function_pointers, move in file.
5199 (Target_i386::can_icf_inline_merge_sections): Remove.
5200 (Target_i386::i386_info): Initialize
5201 can_icf_inline_merge_sections.
5202 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5203 Initialize can_icf_inline_merge_sections.
5204 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5205 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5206 Rename from can_check_for_function_pointers, move in file.
5207 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5208 (Target_x86_64::x86_64_info): Initialize
5209 can_icf_inline_merge_sections.
5210 * testsuite/testfile.cc (Target_test::test_target_info):
5211 Likewise.
5212 * icf.cc (get_section_contents): Correct formatting.
5213
6d1c4efb
ILT
52142011-06-27 Ian Lance Taylor <iant@google.com>
5215
5216 * symtab.cc (Symbol::versioned_name): New function.
5217 (Symbol_table::add_to_final_symtab): Use versioned_name when
5218 appropriate.
5219 (Symbol_table::sized_write_symbol): Likewise.
5220 * symtab.h (class Symbol): Declare versioned_name.
5221 * stringpool.h (class Stringpool_template): Add variant of add
5222 which takes a std::basic_string.
5223 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5224 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5225 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5226 (ver_test_12.o): New target.
5227 * testsuite/Makefile.in: Rebuild.
5228
57eb9b50
DK
52292011-06-27 Doug Kwan <dougkwan@google.com>
5230
5231 * arm.cc (Arm_relocate_functions::thm_jump8,
5232 Arm_relocate_functions::thm_jump11): Use a wider signed
5233 type to compute offset.
5234 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5235 arm_thm_jump8.
5236 * testsuite/Makefile.in: Regenerate.
5237 * testsuite/arm_branch_in_range.sh: Check test results of
5238 arm_thm_jump11 and arm_thm_jump8.
5239 * testsuite/arm_thm_jump11.s: New test source file.
5240 * testsuite/arm_thm_jump11.t: New linker script.
5241 * testsuite/arm_thm_jump8.s: New test source file.
5242 * testsuite/arm_thm_jump8.t: New linker script.
5243
487b39df
ILT
52442011-06-24 Ian Lance Taylor <iant@google.com>
5245
5246 * layout.cc: Include "object.h".
5247 (ctors_sections_in_init_array): New static variable.
5248 (Layout::is_ctors_in_init_array): New function.
5249 (Layout::layout): Add entry to ctors_sections_in_init_array if
5250 appropriate.
5251 * layout.h (class Layout): Declare is_ctors_in_init_array.
5252 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5253 is_ctors_reverse_view is set.
5254 (Sized_relobj_file::write_sections): Add layout parameter. Change
5255 all callers. Set is_ctors_reverse_view field of View_size.
5256 (Sized_relobj_file::reverse_words): New function.
5257 * object.h (Sized_relobj_file::View_size): Add
5258 is_ctors_reverse_view field.
5259 (class Sized_relobj_file): Update declarations.
5260 * testsuite/initpri3.c: New test.
5261 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5262 initpri3b.
5263 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5264 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5265 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5266 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5267 * testsuite/Makefile.in: Rebuild.
5268
472076e4
CC
52692011-06-24 Cary Coutant <ccoutant@google.com>
5270
5271 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5272 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5273 (debug_msg_cdebug.err): New targets.
5274 * testsuite/Makefile.in: Regenerate.
5275 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5276 Fix checks for link with shared library.
5277
a60af0db
DK
52782011-06-24 Doug Kwan <dougkwan@google.com>
5279
5280 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5281 skip empty text sections.
5282 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5283
5393d741
ILT
52842011-06-22 Ian Lance Taylor <iant@google.com>
5285
5286 PR gold/12910
5287 * options.h (class General_options): Add --ctors-in-init-array.
5288 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5289 friends as SHT_PROGBITS for merging sections.
5290 (Layout::layout): Remove special handling of .init_array and
5291 friends. Don't sort if doing relocatable link. Sort for .ctors
5292 and .dtors if ctors_in_init_array.
5293 (Layout::make_output_section): Force correct section types for
5294 .init_array and friends. Don't sort if doing relocatable link,
5295 Don't sort .ctors and .dtors if ctors_in_init_array.
5296 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5297 (Layout::output_section_name): Add relobj parameter. Change all
5298 callers. Handle .ctors. and .dtors. in code rather than table.
5299 Handle .ctors and .dtors if ctors_in_init_array.
5300 (Layout::match_file_name): New function, moved from output.cc.
5301 * layout.h (class Layout): Update declarations.
5302 * output.cc: Include "layout.h".
5303 (Input_section_sort_entry::get_priority): New function.
5304 (Input_section_sort_entry::match_file_name): Just call
5305 Layout::match_file_name.
5306 (Output_section::Input_section_sort_init_fini_compare::operator()):
5307 Handle .ctors and .dtors. Sort by explicit priority rather than
5308 by name.
5309 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5310 * testsuite/initpri2.c: New test.
5311 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5312 (check_PROGRAMS): Add initpri2.
5313 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5314 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5315 * configure, testsuite/Makefile.in: Rebuild.
5316
e1f74f98
ILT
53172011-06-19 Ian Lance Taylor <iant@google.com>
5318
5319 PR gold/12880
5320 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5321 .interp section to a PT_INTERP segment even if we have seen a
5322 --dynamic-linker option. Don't do it if we have seen a PHDRS
5323 clause in a linker script.
5324 (Layout::finalize): Don't create a .interp section if we've
5325 already create a PT_INTERP segment.
5326 (Layout::create_interp): Always call choose_output_section (revert
5327 patch of 2011-06-17). Don't create PT_INTERP segment.
5328 * script-sections.cc
5329 (Script_sections::create_note_and_tls_segments): Add a .interp
5330 section to a PT_INTERP segment even if we have seen a
5331 --dynamic-linker option.
5332
766f91bb
ILT
53332011-06-18 Ian Lance Taylor <iant@google.com>
5334
5335 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5336 merely because a non-PT_LOAD segment has a dynamic reloc.
5337
0d212c3a
ILT
53382011-06-18 Ian Lance Taylor <iant@google.com>
5339
5340 * layout.cc (Layout::finish_dynamic_section): Don't create
5341 DT_FLAGS entry if not needed.
5342
911a5072
ILT
53432011-06-18 Ian Lance Taylor <iant@google.com>
5344
5345 PR gold/12745
5346 * layout.cc (Layout::layout_eh_frame): Correct handling of
5347 writable .eh_frame section.
5348
534b4e5f
ILT
53492011-06-17 Ian Lance Taylor <iant@google.com>
5350
5351 PR gold/12893
5352 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5353 symbol is redefined with the exact same object and value.
5354
10b4f102
ILT
53552011-06-17 Ian Lance Taylor <iant@google.com>
5356
5357 PR gold/12880
5358 * layout.h (class Layout): Add interp_segment_ field.
5359 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5360 (Layout::attach_allocated_section_to_segment): If making shared
5361 library, put .interp section in PT_INTERP segment.
5362 (Layout::finalize): Also call create_interp if -dynamic-linker
5363 option was used.
5364 (Layout::create_interp): Assert that there is no PT_INTERP
5365 segment. If not using a SECTIONS clause, use make_output_section.
5366 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5367 * script-sections.cc
5368 (Script_sections::create_note_and_tls_segments): If making shared
5369 library, put .interp section in PT_INTERP segment.
5370
a29b0dad
ILT
53712011-06-17 Ian Lance Taylor <iant@google.com>
5372
e588ea8d
ILT
5373 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5374 when making a shared library.
5375
53762011-06-17 Ian Lance Taylor <iant@google.com>
5377
5378 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5379 parameter. Change all callers. Don't issue warning about PC32
5380 against locally defined symbol.
a29b0dad 5381
9d3b0698
ILT
53822011-06-16 Ian Lance Taylor <iant@google.com>
5383
5384 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5385 occurs in same object.
5386
85b0f90c
AM
53872011-06-14 Alan Modra <amodra@gmail.com>
5388
5389 * po/POTFILES.in: Regenerate.
5390
a94907d9
ILT
53912011-06-09 Ian Lance Taylor <iant@google.com>
5392
5393 * script-sections.cc
5394 (Orphan_output_section::set_section_addresses): For a relocatable
5395 link set address to 0.
5396
4fb3a1c3
CC
53972011-06-09 Cary Coutant <ccoutant@google.com>
5398
5399 PR gold/12804
5400 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5401 used with --compress-debug-sections.
5402 * gold/object.cc (Sized_relobj_file::do_layout): Report
5403 uncompressed size of compressed input sections.
5404
61220854
CC
54052011-06-08 Cary Coutant <ccoutant@google.com>
5406
5407 PR gold/12804
5408 * testsuite/two_file_test_2_v1.cc: Change initialization of
5409 v2 to keep it in .data.
5410
e6455dfb
CC
54112011-06-07 Cary Coutant <ccoutant@google.com>
5412
5413 * common.cc (Symbol_table::do_allocate_commons_list): Call
5414 gold_fallback.
5415 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5416 (Errors::fallback): New function.
5417 (gold_fallback): New function.
5418 * errors.h (Errors::fallback): New function.
5419 * gold.cc (gold_exit): Change status parameter to enum; adjust
5420 all callers.
5421 (queue_initial_tasks): Call gold_fallback.
5422 * gold.h: Include cstdlib.
5423 (Exit_status): New enum type.
5424 (gold_exit): Change status parameter to enum.
5425 (gold_fallback): New function.
5426 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5427 (Layout::create_symtab_sections): Likewise.
5428 (Layout::create_shdrs): Likewise.
5429 * main.cc (main): Adjust call to gold_exit.
5430 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5431 (Output_data_got::add_got_entry_pair): Likewise.
5432 (Output_section::add_input_section): Likewise.
5433 (Output_section::add_output_section_data): Likewise.
5434 (Output_segment::set_section_list_addresses): Likewise.
5435 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5436
fb0e076f
CC
54372011-06-07 Cary Coutant <ccoutant@google.com>
5438
5439 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5440 for incremental links.
5441 * output.cc (Output_segment::set_section_list_addresses): Remove
5442 FIXME and test for TLS or BSS.
5443
a5ee4d5d
CC
54442011-06-07 Cary Coutant <ccoutant@google.com>
5445
5446 * testsuite/Makefile.am: Add incremental_copy_test,
5447 incremental_common_test_1.
5448 * testsuite/Makefile.in: Regenerate.
5449 * testsuite/common_test_1_v1.c: New source file.
5450 * testsuite/common_test_1_v2.c: New source file.
5451 * testsuite/copy_test_v1.cc: New source file.
5452
5146f448
CC
54532011-06-07 Cary Coutant <ccoutant@google.com>
5454
5455 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5456 update, allocate common from bss section's free list.
5457 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5458 linker-defined symbols.
5459 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5460 Skip GOT and PLT entries that are no longer referenced.
5461 (Output_section_incremental_inputs::write_info_blocks): Mark
5462 linker-defined symbols.
5463 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5464 * output.cc (Output_section::allocate): New function.
5465 * output.h (Output_section::allocate): New function.
5466 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5467 linker-defined symbols.
5468 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5469 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5470 (Symbol::init_base_output_data): Likewise.
5471 (Symbol::init_base_output_segment): Likewise.
5472 (Symbol::init_base_constant): Likewise.
5473 (Sized_symbol::init_output_data): Likewise.
5474 (Sized_symbol::init_output_segment): Likewise.
5475 (Sized_symbol::init_constant): Likewise.
5476 (Symbol_table::do_define_in_output_data): Likewise.
5477 (Symbol_table::do_define_in_output_segment): Likewise.
5478 (Symbol_table::do_define_as_constant): Likewise.
5479 * symtab.h (Symbol::is_predefined): New function.
5480 (Symbol::init_base_output_data): Add is_predefined parameter.
5481 (Symbol::init_base_output_segment): Likewise.
5482 (Symbol::init_base_constant): Likewise.
5483 (Symbol::is_predefined_): New data member.
5484 (Sized_symbol::init_output_data): Add is_predefined parameter.
5485 (Sized_symbol::init_output_segment): Likewise.
5486 (Sized_symbol::init_constant): Likewise.
5487 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5488
26d3c67d
CC
54892011-06-07 Cary Coutant <ccoutant@google.com>
5490
5491 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5492 instead of emit_copy_reloc.
5493 (Copy_relocs::emit_copy_reloc): Refactor.
5494 (Copy_relocs::make_copy_reloc): New function.
5495 (Copy_relocs::add_copy_reloc): Remove.
5496 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5497 section.
5498 (Copy_relocs::make_copy_reloc): New function.
5499 (Copy_relocs::add_copy_reloc): Remove.
5500 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5501 unchanged input files.
5502 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5503 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5504 Reserve BSS space for COPY relocations.
5505 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5506 (Output_section_incremental_inputs::write_info_blocks): Record
5507 whether a symbol is copied from a shared object.
5508 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5509 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5510 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5511 (Incremental_input_entry_reader::get_output_symbol_index): Add
5512 is_copy parameter.
5513 (Incremental_binary::emit_copy_relocs): New function.
5514 (Incremental_binary::do_emit_copy_relocs): New function.
5515 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5516 new data member.
5517 (Sized_incremental_binary::add_copy_reloc): New function.
5518 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5519 (Sized_incremental_binary::Copy_reloc): New struct.
5520 (Sized_incremental_binary::Copy_relocs): New typedef.
5521 (Sized_incremental_binary::copy_relocs_): New data member.
5522 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5523 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5524 * target.h (Sized_target::emit_copy_reloc): New function.
5525 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5526
7cdb37d9
CC
55272011-06-02 Cary Coutant <ccoutant@google.com>
5528
5529 PR gold/12163
5530 * gold/archive.cc (Archive::Archive): Initialize new data member.
5531 (Archive::include_all_members): Return if archive has already been
5532 included.
5533 * gold/archive.h (Archive::include_all_members_): New data member.
5534
cc643b88
NC
55352011-06-02 Nick Clifton <nickc@redhat.com>
5536
5537 * dynobj.h: Fix spelling mistake in comment.
5538 * output.cc: Likewise.
5539
f62a3ca7 55402011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5541 Asier Llano
f62a3ca7
DK
5542
5543 PR gold/12826
cc643b88 5544 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5545 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5546 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5547 redundant arm_exidx_test.so.
5548 * testsuite/Makefile.in: Regenerate.
5549 (check_SCRIPTS): Add pr12826.sh
5550 (check_DATA): Add pr12826.stdout
5551 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5552 * testsuite/pr12826.sh: New file.
5553 * testsuite/pr12826_1.s: Ditto.
5554 * testsuite/pr12826_1.s: Ditto.
5555
8dbe1edc
ILT
55562011-05-30 Ian Lance Taylor <iant@google.com>
5557
5558 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5559 sections.
5560
c49875be
ILT
55612011-05-29 Ian Lance Taylor <iant@google.com>
5562
5563 PR gold/12804
5564 * testsuite/Makefile.am: Use different file name for two_file_test
5565 temporary file for each incremental test.
5566 * testsuite/Makefile.in: Rebuild.
5567
69d53f7a
ILT
55682011-05-29 Ian Lance Taylor <iant@google.com>
5569
5570 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5571 binary input file is empty.
5572
41d0ab5f
ILT
55732011-05-27 Ian Lance Taylor <iant@google.com>
5574
5575 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5576 (ver_test_9.so): Likewise.
5577 * testsuite/Makefile.in: Rebuild.
5578
89d8a36b
CC
55792011-05-26 Cary Coutant <ccoutant@google.com>
5580
5581 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5582 * incremental.cc (Incremental_inputs::report_input_section): Fix
5583 comment, indentation.
5584 (Incremental_inputs::report_comdat_group): New function.
5585 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5586 of data for incremental input file entry.
5587 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5588 group count, COMDAT group signatures.
5589 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5590 an unchanged input file.
5591 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5592 Initialize new data member.
5593 (Incremental_object_entry::add_comdat_group): New function.
5594 (Incremental_object_entry::get_comdat_group_count): New function.
5595 (Incremental_object_entry::get_comdat_signature_key): New function.
5596 (Incremental_object_entry::groups_): New data member.
5597 (Incremental_inputs::report_comdat_group): New function.
5598 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5599 data for incremental input file entry.
5600 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5601 (Incremental_input_entry_reader::get_input_section): Adjust size of
5602 data for incremental input file entry.
5603 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5604 (Incremental_input_entry_reader::get_comdat_group_signature): New
5605 function.
5606 * object.cc (Sized_relobj::include_section_group): Report kept
5607 COMDAT groups for incremental links.
5608
1706a06f
ILT
56092011-05-24 David Meyer <pdox@google.com>
5610
5611 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5612 with name parameter. Add found_name parameter.
5613 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5614 * dirsearch.h (class Dirsearch): Update declaration.
5615
a10ae760
ILT
56162011-05-24 Ian Lance Taylor <iant@google.com>
5617
5618 * archive.cc (Library_base::should_include_member): Pull in object
5619 from archive if it defines the entry symbol.
5620 * parameters.cc (Parameters::entry): New function.
5621 * parameters.h (class Parameters): Declare entry.
5622 * output.h (class Output_file_header): Remove entry_ field.
5623 * output.cc (Output_file_header::Output_file_header): Remove entry
5624 parameter. Change all callers.
5625 (Output_file_header::entry): Use parameters->entry.
5626 * gold.cc (queue_middle_tasks): Likewise.
5627 * plugin.cc (Plugin_hook::run): Likewise.
5628
aa92d6ed
CC
56292011-05-24 Cary Coutant <ccoutant@google.com>
5630
5631 * gold.cc (queue_initial_tasks): Pass incremental base filename
5632 to Output_file::open_base_file; don't print error message.
5633 * incremental-dump.cc (main): Adjust call to
5634 Output_file::open_for_modification.
5635 * incremental-dump.cc (main): Likewise.
5636 * incremental.cc (Incremental_inputs::report_command_line):
5637 Ignore --incremental-base option when comparing command lines.
5638 Ignore parameter when given as separate argument.
5639 * options.h (class General_options): Add --incremental-base.
5640 * output.cc (Output_file::Output_file):
5641 (Output_file::open_base_file): Add base_name and writable parameters;
5642 read base file into new file; print error message here.
5643 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5644 callers.
5645 * output.h (Output_file::open_for_modification): Rename to...
5646 (Output_file::open_base_file): ...this; add base_name and
5647 writable parameters; adjust all callers.
5648 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5649 callers.
5650 * testsuite/Makefile.am (incremental_test_4): Test
5651 --incremental-base.
5652 * testsuite/Makefile.in: Regenerate.
5653
2eedd706
CC
56542011-05-24 Cary Coutant <ccoutant@google.com>
5655
5656 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5657 incremental_test_4.
5658 * testsuite/Makefile.in: Regenerate.
5659 * testsuite/two_file_test_1_v1.cc: New test source file.
5660 * testsuite/two_file_test_1b_v1.cc: New test source file.
5661 * testsuite/two_file_test_2_v1.cc: New test source file.
5662
0f1c85a6
CC
56632011-05-24 Cary Coutant <ccoutant@google.com>
5664
5665 * dynobj.h (Dynobj::do_dynobj): New function.
5666 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5667 flag and soname for shared objects.
5668 * incremental.cc (Incremental_inputs::report_object): Make
5669 either Incremental_object_entry or Incremental_dynobj_entry; add
5670 soname to string table.
5671 (Incremental_inputs::report_input_section): Add assertion.
5672 (Output_section_incremental_inputs::set_final_data_size): Adjust
5673 type of input file entry for shared libraries; adjust size of
5674 shared library info entry.
5675 (Output_section_incremental_inputs::write_input_files): Write
5676 as_needed flag for shared libraries.
5677 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5678 of input file entry for shared libraries; write soname.
5679 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5680 soname from incremental info.
5681 * incremental.h (enum Incremental_input_flags): Add
5682 INCREMENTAL_INPUT_AS_NEEDED.
5683 (Incremental_input_entry::Incremental_input_entry): Initialize new
5684 data member.
5685 (Incremental_input_entry::set_as_needed): New function.
5686 (Incremental_input_entry::as_needed): New function.
5687 (Incremental_input_entry::do_dynobj_entry): New function.
5688 (Incremental_input_entry::as_needed_): New data member.
5689 (Incremental_object_entry::Incremental_object_entry): Don't check
5690 for shared library.
5691 (Incremental_object_entry::do_type): Likewise.
5692 (class Incremental_dynobj_entry): New class.
5693 (Incremental_input_entry_reader::as_needed): New function.
5694 (Incremental_input_entry_reader::get_soname): New function.
5695 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5696 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5697 size of shared library info entry.
58797674 5698 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5699 incremental link when adding DT_NEEDED entries.
5700 * object.h (Object::Object): Initialize new data member.
5701 (Object::dynobj): New function.
5702 (Object::set_as_needed): New function.
5703 (Object::as_needed): New function.
5704 (Object::do_dynobj): New function.
5705 (Object::as_needed_): New data member.
5706
6fa2a40b
CC
57072011-05-24 Cary Coutant <ccoutant@google.com>
5708
5709 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5710 info; adjust display of GOT entries.
5711 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5712 vector of input objects; remove file_status_.
5713 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5714 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5715 got_plt reader; call target hooks to reserve GOT entries.
5716 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5717 of input file info header and GOT info entry.
5718 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5719 relocation info.
5720 (Got_plt_view_info::got_descriptor): Remove.
5721 (Got_plt_view_info::sym_index): New data member.
5722 (Got_plt_view_info::input_index): New data member.
5723 (Local_got_offset_visitor::visit): Write input file index.
5724 (Global_got_offset_visitor::visit): Write 0 for input file index.
5725 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5726 with sym_index and input_index.
5727 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5728 incremental info GOT entry; replace got_descriptor with input_index.
5729 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5730 map from input file index to object.
5731 (Sized_relobj_incr::do_layout): Replace direct data member reference
5732 with accessor function.
5733 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5734 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5735 Adjust size of input file info header.
5736 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5737 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5738 (Incremental_input_entry_reader::get_input_section): Adjust size of
5739 input file info header.
5740 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5741 of incremental info GOT entry.
5742 (Incremental_got_plt_reader::get_got_desc): Remove.
5743 (Incremental_got_plt_reader::get_got_symndx): New function.
5744 (Incremental_got_plt_reader::get_got_input_index): New function.
5745 (Sized_incremental_binary::Sized_incremental_binary): Remove
5746 file_status_; add input_objects_.
5747 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5748 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5749 (Sized_incremental_binary::file_is_unchanged): Remove.
5750 (Sized_incremental_binary::set_input_object): New function.
5751 (Sized_incremental_binary::input_object): New function.
5752 (Sized_incremental_binary::file_status_): Remove.
5753 (Sized_incremental_binary::input_objects_): New data member.
5754 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5755 references.
5756 (Sized_relobj_incr::invalid_address): Move to base class.
5757 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5758 class.
5759 (Sized_relobj_incr::do_output_section_offset): Likewise.
5760 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5761 (Sized_relobj_incr::section_offsets_): Likewise.
5762 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5763 function.
5764 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5765 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5766 with accessor function.
5767 (Sized_relobj_file::do_layout): Likewise.
5768 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5769 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5770 (Sized_relobj_file::compute_final_local_value): Replace refs to
5771 section_offsets_ with accessor function.
5772 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5773 * object.h (Relobj::Relobj): Initialize new data members.
5774 (Relobj::add_dyn_reloc): New function.
5775 (Relobj::first_dyn_reloc): New function.
5776 (Relobj::dyn_reloc_count): New function.
5777 (Relobj::first_dyn_reloc_): New data member.
5778 (Relobj::dyn_reloc_count_): New data member.
5779 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5780 references.
5781 (Sized_relobj::Address): New typedef.
5782 (Sized_relobj::invalid_address): Move here from child class.
5783 (Sized_relobj::Sized_relobj): Initialize new data members.
5784 (Sized_relobj::sized_relobj): New function.
5785 (Sized_relobj::is_output_section_offset_invalid): Move here from
5786 child class.
5787 (Sized_relobj::get_output_section_offset): Likewise.
5788 (Sized_relobj::local_has_got_offset): Likewise.
5789 (Sized_relobj::local_got_offset): Likewise.
5790 (Sized_relobj::set_local_got_offset): Likewise.
5791 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5792 (Sized_relobj::clear_got_offsets): New function.
5793 (Sized_relobj::section_offsets): Move here from child class.
5794 (Sized_relobj::do_output_section_offset): Likewise.
5795 (Sized_relobj::do_set_section_offset): Likewise.
5796 (Sized_relobj::Local_got_offsets): Likewise.
5797 (Sized_relobj::local_got_offsets_): Likewise.
5798 (Sized_relobj::section_offsets_): Likewise.
5799 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5800 references.
5801 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5802 class.
5803 (Sized_relobj_file::sized_relobj): New function
5804 (Sized_relobj_file::local_has_got_offset): Move to base class.
5805 (Sized_relobj_file::local_got_offset): Likewise.
5806 (Sized_relobj_file::set_local_got_offset): Likewise.
5807 (Sized_relobj_file::get_output_section_offset): Likewise.
5808 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5809 (Sized_relobj_file::do_output_section_offset): Likewise.
5810 (Sized_relobj_file::do_set_section_offset): Likewise.
5811 (Sized_relobj_file::Local_got_offsets): Likewise.
5812 (Sized_relobj_file::local_got_offsets_): Likewise.
5813 (Sized_relobj_file::section_offsets_): Likewise.
5814 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5815 (all constructors).
5816 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5817 (Output_reloc::get_symbol_index): Likewise.
5818 (Output_reloc::local_section_offset): Likewise.
5819 (Output_reloc::get_address): Likewise.
5820 (Output_reloc::symbol_value): Likewise.
5821 (Output_data_got::reserve_slot): Move to class definition.
5822 (Output_data_got::reserve_local): New function.
5823 (Output_data_got::reserve_slot_for_global): Remove.
5824 (Output_data_got::reserve_global): New function.
5825 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5826 (all constructors, two instantiations).
5827 (Output_reloc::get_relobj): New function (two instantiations).
5828 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5829 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5830 (Output_data_reloc::add_global): Adjust type of relobj.
5831 (Output_data_reloc::add_global_relative): Likewise.
5832 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5833 (Output_data_reloc::add_local): Likewise.
5834 (Output_data_reloc::add_local_relative): Likewise.
5835 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5836 (Output_data_reloc::add_local_section): Likewise.
5837 (Output_data_reloc::add_output_section): Likewise.
5838 (Output_data_reloc::add_absolute): Likewise.
5839 (Output_data_reloc::add_target_specific): Likewise.
5840 (Output_data_got::reserve_slot): Move definition here.
5841 (Output_data_got::reserve_local): New function.
5842 (Output_data_got::reserve_global): New function.
5843 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5844 section_offsets_ with accessor function.
5845 (Sized_relobj_file::write_sections): Likewise.
5846 (Sized_relobj_file::do_relocate_sections): Likewise.
5847 * target.h (Sized_target::reserve_local_got_entry): New function.
5848 (Sized_target::reserve_global_got_entry): New function.
5849 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5850 (Target_x86_64::reserve_global_got_entry): New function.
5851 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5852
4829d394
CC
58532011-05-23 Cary Coutant <ccoutant@google.com>
5854
5855 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5856 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5857 bit when checking got_type.
5858 * incremental.cc (Sized_incremental_binary::setup_readers):
5859 Store symbol table and string table locations; initialize bit vector
5860 of file status flags.
5861 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5862 unchanged files.
5863 (Sized_incremental_binary::do_process_got_plt): New function.
5864 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5865 (Output_section_incremental_inputs::set_final_data_size): Record
5866 file index for each input file.
5867 (Output_section_incremental_inputs::write_got_plt): Store file index
5868 instead of input entry offset for each GOT entry.
5869 * incremental.h
5870 (Incremental_input_entry::Incremental_input_entry): Initialize new
5871 data member.
5872 (Incremental_input_entry::set_offset): Store file index.
5873 (Incremental_input_entry::get_file_index): New function.
5874 (Incremental_input_entry::file_index_): New data member.
5875 (Incremental_binary::process_got_plt): New function.
5876 (Incremental_binary::do_process_got_plt): New function.
5877 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5878 data members.
5879 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5880 (Sized_incremental_binary::set_file_is_unchanged): New function.
5881 (Sized_incremental_binary::file_is_unchanged): New function.
5882 (Sized_incremental_binary::do_process_got_plt): New function.
5883 (Sized_incremental_binary::file_status_): New data member.
5884 (Sized_incremental_binary::main_symtab_loc_): New data member.
5885 (Sized_incremental_binary::main_strtab_loc_): New data member.
5886 * output.cc (Output_data_got::Got_entry::write): Add case
5887 RESERVED_CODE.
5888 (Output_data_got::add_global): Call add_got_entry.
5889 (Output_data_got::add_global_plt): Likewise.
5890 (Output_data_got::add_global_with_rel): Likewise.
5891 (Output_data_got::add_global_with_rela): Likewise.
5892 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5893 (Output_data_got::add_global_pair_with_rela): Likewise.
5894 (Output_data_got::add_local): Call add_got_entry.
5895 (Output_data_got::add_local_plt): Likewise.
5896 (Output_data_got::add_local_with_rel): Likewise.
5897 (Output_data_got::add_local_with_rela): Likewise.
5898 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5899 (Output_data_got::add_local_pair_with_rela): Likewise.
5900 (Output_data_got::reserve_slot): New function.
5901 (Output_data_got::reserve_slot_for_global): New function.
5902 (Output_data_got::add_got_entry): New function.
5903 (Output_data_got::add_got_entry_pair): New function.
5904 (Output_section::add_output_section_data): Edit FIXME.
5905 * output.h
5906 (Output_section_data_build::Output_section_data_build): New
5907 constructor with size parameter.
5908 (Output_data_space::Output_data_space): Likewise.
5909 (Output_data_got::Output_data_got): Initialize new data member; new
5910 constructor with size parameter.
5911 (Output_data_got::add_constant): Call add_got_entry.
5912 (Output_data_got::reserve_slot): New function.
5913 (Output_data_got::reserve_slot_for_global): New function.
5914 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5915 (Output_data_got::add_got_entry): New function.
5916 (Output_data_got::add_got_entry_pair): New function.
5917 (Output_data_got::free_list_): New data member.
5918 * target.h (Sized_target::init_got_plt_for_update): New function.
5919 (Sized_target::register_global_plt_entry): New function.
5920 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5921 Initialize new data member; call init; add constructor with PLT count.
5922 (Output_data_plt_x86_64::init): New function.
5923 (Output_data_plt_x86_64::add_relocation): New function.
5924 (Output_data_plt_x86_64::reserve_slot): New function.
5925 (Output_data_plt_x86_64::free_list_): New data member.
5926 (Target_x86_64::init_got_plt_for_update): New function.
5927 (Target_x86_64::register_global_plt_entry): New function.
5928 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5929 incremental updates.
5930 (Output_data_plt_x86_64::add_relocation): New function.
5931 * testsuite/object_unittest.cc (Object_test): Set default options.
5932
ec69d6da
ILT
59332011-05-16 Ian Lance Taylor <iant@google.com>
5934
5935 * options.h (class General_options): Make -i a synonym for -r.
5936
732e31de
ILT
59372011-05-16 Ian Lance Taylor <iant@google.com>
5938
5939 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5940
403676b5
CC
59412011-05-10 Cary Coutant <ccoutant@google.com>
5942
5943 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5944 strip_all (-s).
5945
5b7b7d6e
ILT
59462011-05-06 Ian Lance Taylor <iant@google.com>
5947
5948 * layout.cc (Layout::layout): If the output section flags change,
5949 update the ordering.
5950
f0f9babf
CC
59512011-04-25 Cary Coutant <ccoutant@google.com>
5952
5953 * incremental-dump.cc (dump_incremental_inputs): Print local
5954 symbol info for each input file.
5955 * incremental.cc
5956 (Output_section_incremental_inputs::set_final_data_size): Add local
5957 symbol info to input file entries in incremental info.
5958 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5959 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5960 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5961 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5962 implementation.
5963 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5964 (Sized_incr_relobj::do_relocate): Write the local symbols.
5965 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5966 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5967 Adjust size of input file header.
5968 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5969 (Incremental_inputs_reader::get_local_symbol_count): New function.
5970 (Incremental_inputs_reader::get_input_section): Adjust size of input
5971 file header.
5972 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5973 (Sized_incr_relobj::This): New typedef.
5974 (Sized_incr_relobj::sym_size): New const data member.
5975 (Sized_incr_relobj::Local_symbol): New struct.
5976 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5977 (Sized_incr_relobj::do_local_symbol_offset): New function.
5978 (Sized_incr_relobj::local_symbol_count_): New data member.
5979 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5980 (Sized_incr_relobj::local_symbol_index_): New data member.
5981 (Sized_incr_relobj::local_symbol_offset_): New data member.
5982 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5983 (Sized_incr_relobj::local_symbols_): New data member.
5984 * object.h (Relobj::output_local_symbol_count): New function.
5985 (Relobj::local_symbol_offset): New function.
5986 (Relobj::do_output_local_symbol_count): New function.
5987 (Relobj::do_local_symbol_offset): New function.
5988 (Sized_relobj::do_output_local_symbol_count): New function.
5989 (Sized_relobj::do_local_symbol_offset): New function.
5990
d0a9ace3
ILT
59912011-04-22 Vladimir Simonov <sv@sw.ru>
5992
5993 * descriptors.cc (set_close_on_exec): New function.
5994 (Descriptors::open): Use set_close_on_exec.
5995 * output.cc (S_ISLNK): Define if not defined.
5996
94a3fc8b
CC
59972011-04-22 Cary Coutant <ccoutant@google.com>
5998
5999 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6000 global symbol map.
6001 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6002 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6003 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6004 relocations.
6005 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6006 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6007 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6008 * incremental.h
6009 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6010 function.
6011 (Incremental_binary::apply_incremental_relocs): New function.
6012 (Incremental_binary::do_apply_incremental_relocs): New function.
6013 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6014 data member.
6015 (Sized_incremental_binary::add_global_symbol): New function.
6016 (Sized_incremental_binary::global_symbol): New function.
6017 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6018 (Sized_incremental_binary::symbol_map_): New data member.
6019 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6020 * target.h (Sized_target::apply_relocation): New function.
6021 * target-reloc.h (apply_relocation): New function.
6022 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6023
c87e4302
DK
60242011-04-22 Doug Kwan <dougkwan@google.com>
6025
6026 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6027 flag of a SHT_ARM_EXIDX section.
2e702c99 6028 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6029 * testsuite/Makefile.in: Regenerate.
6030 * testsuite/arm_exidx_test.s: New file.
6031 * testsuite/arm_exidx_test.sh: Same.
6032
e7782cf6
CC
60332011-04-20 Cary Coutant <ccoutant@google.com>
6034
6035 PR gold/12689
6036 * archive.h (Incremental_archive_entry::Archive_member):
6037 Initialize arg_serial_ (second constructor).
6038
308ecdc7
ILT
60392011-04-17 Ian Lance Taylor <iant@google.com>
6040
6041 * object.cc (Relocate_info::location): Simplify location string.
6042 * errors.cc (Errors::error_at_location): Don't print program
6043 name.
6044 (Errors::warning_at_location): Likewise.
6045 (Errors::undefined_symbol): Likewise.
6046 * testsuite/debug_msg.sh: Update accordingly.
6047
bec5b579
CC
60482011-04-14 Cary Coutant <ccoutant@google.com>
6049
6050 * gold/layout.cc (Layout::symtab_section_offset): New function.
6051 * gold/layout.h (Layout::symtab_section_offset): New function.
6052 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6053
88597d34
ILT
60542011-04-12 Ian Lance Taylor <iant@google.com>
6055
6056 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6057 with MREMAP_MAYMOVE.
6058 * output.h (class Output_file): Add map_is_allocated_ field.
6059 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6060 not available, provide stubs. If mremap is not available, #define
6061 it to gold_mremap.
6062 (MREMAP_MAYMOVE): Define if not defined.
6063 (Output_file::Output_file): Initialize map_is_allocated_.
6064 (Output_file::resize): Check map_is_allocated_.
6065 (Output_file::map_anonymous): If mmap fails, use malloc.
6066 (Output_file::unmap): Don't do anything for an anonymous map.
6067 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6068 is not available, provide stubs.
6069 (File_read::View::~View): Use free rather than delete[].
6070 (File_read::make_view): Use malloc rather than new[]. If mmap
6071 fails, use malloc.
6072 (File_read::find_or_make_view): Use malloc rather than new[].
6073 * gold.h: Remove HAVE_REMAP code.
6074 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6075 exists. Rename mremap to gold_mremap. If mmap is not available
6076 don't do anything.
6077 * configure, config.in: Rebuild.
6078
11e361bc
ILT
60792011-04-11 Ian Lance Taylor <iant@google.com>
6080
6081 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6082 initialize local variable v.
6083
cdc29364
CC
60842011-04-11 Cary Coutant <ccoutant@google.com>
6085
6086 * archive.cc (Archive::include_member): Adjust call to
6087 report_object.
6088 (Add_archive_symbols::run): Track argument serial numbers.
6089 (Lib_group::include_member): Likewise.
6090 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6091 * archive.h (Incremental_archive_entry::Archive_member):
6092 Initialize arg_serial_.
6093 (Archive_member::arg_serial_): New data member.
6094 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6095 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6096 incremental link.
6097 (Sized_dynobj::do_for_all_local_got_entries): New function.
6098 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6099 function.
6100 * fileread.cc (get_mtime): New function.
6101 * fileread.h (get_mtime): New function.
6102 * gold.cc (queue_initial_tasks): Check for incremental update.
6103 (process_incremental_input): New function.
6104 (queue_middle_tasks): Don't force valid target for incremental
6105 update.
6106 * incremental-dump.cc (find_input_containing_global): Adjust
6107 size of symbol info entry.
6108 (dump_incremental_inputs): Dump argument serial number and
6109 in_system_directory flag; bias shndx by 1; print symbol names
6110 when dumping per-file symbol lists; use new symbol info readers.
6111 * incremental.cc
6112 (Output_section_incremental_inputs:update_data_size): New function.
6113 (Sized_incremental_binary::setup_readers): Setup input readers
6114 for each input file; build maps for files added from libraries
6115 and scripts.
6116 (Sized_incremental_binary::check_input_args): New function.
6117 (Sized_incremental_binary::do_check_inputs): Build map of argument
6118 serial numbers to input arguments.
6119 (Sized_incremental_binary::do_file_has_changed): Rename
6120 do_file_is_unchanged to this; compare file modification times.
6121 (Sized_incremental_binary::do_init_layout): New function.
6122 (Sized_incremental_binary::do_reserve_layout): New function.
6123 (Sized_incremental_binary::do_get_input_reader): Remove.
6124 (Sized_incremental_binary::get_symtab_view): New function.
6125 (Incremental_checker::can_incrementally_link_output_file): Remove.
6126 (Incremental_inputs::report_command_line): Exclude --debug options.
6127 (Incremental_inputs::report_archive_begin): Add parameter; track
6128 argument serial numbers; don't put input file entry for archive
6129 before archive members.
6130 (Incremental_inputs::report_archive_end): Put input file entry
6131 for archive after archive members.
6132 (Incremental_inputs::report_object): Add parameter; track argument
6133 serial numbers and in_system_directory flag.
6134 (Incremental_inputs::report_script): Add parameter; track argument
6135 serial numbers.
6136 (Output_section_incremental_inputs::set_final_data_size): Adjust
6137 size of symbol info entry; check for forwarding symbols.
6138 (Output_section_incremental_inputs::write_input_files): Write
6139 in_system_directory flag and argument serial number.
6140 (Output_section_incremental_inputs::write_info_blocks): Map section
6141 indices between incremental info and original input file; store
6142 input section index for each symbol.
6143 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6144 change operator() to visit().
6145 (class Global_got_offset_visitor): Likewise.
6146 (class Global_symbol_visitor_got_plt):
6147 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6148 classes.
6149 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6150 (Sized_incr_relobj::do_read_symbols): New function.
6151 (Sized_incr_relobj::do_layout): New function.
6152 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6153 (Sized_incr_relobj::do_add_symbols): New function.
6154 (Sized_incr_relobj::do_should_include_member): New function.
6155 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6156 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6157 (Sized_incr_relobj::do_section_size): New function.
6158 (Sized_incr_relobj::do_section_name): New function.
6159 (Sized_incr_relobj::do_section_contents): New function.
6160 (Sized_incr_relobj::do_section_flags): New function.
6161 (Sized_incr_relobj::do_section_entsize): New function.
6162 (Sized_incr_relobj::do_section_address): New function.
6163 (Sized_incr_relobj::do_section_type): New function.
6164 (Sized_incr_relobj::do_section_link): New function.
6165 (Sized_incr_relobj::do_section_info): New function.
6166 (Sized_incr_relobj::do_section_addralign): New function.
6167 (Sized_incr_relobj::do_initialize_xindex): New function.
6168 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6169 (Sized_incr_relobj::do_read_relocs): New function.
6170 (Sized_incr_relobj::do_gc_process_relocs): New function.
6171 (Sized_incr_relobj::do_scan_relocs): New function.
6172 (Sized_incr_relobj::do_count_local_symbols): New function.
6173 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6174 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6175 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6176 (Sized_incr_relobj::do_relocate): New function.
6177 (Sized_incr_relobj::do_set_section_offset): New function.
6178 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6179 (Sized_incr_dynobj::do_read_symbols): New function.
6180 (Sized_incr_dynobj::do_layout): New function.
6181 (Sized_incr_dynobj::do_add_symbols): New function.
6182 (Sized_incr_dynobj::do_should_include_member): New function.
6183 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6184 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6185 (Sized_incr_dynobj::do_section_size): New function.
6186 (Sized_incr_dynobj::do_section_name): New function.
6187 (Sized_incr_dynobj::do_section_contents): New function.
6188 (Sized_incr_dynobj::do_section_flags): New function.
6189 (Sized_incr_dynobj::do_section_entsize): New function.
6190 (Sized_incr_dynobj::do_section_address): New function.
6191 (Sized_incr_dynobj::do_section_type): New function.
6192 (Sized_incr_dynobj::do_section_link): New function.
6193 (Sized_incr_dynobj::do_section_info): New function.
6194 (Sized_incr_dynobj::do_section_addralign): New function.
6195 (Sized_incr_dynobj::do_initialize_xindex): New function.
6196 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6197 (make_sized_incremental_object): New function.
6198 (Incremental_library::copy_unused_symbols): New function.
6199 (Incremental_library::do_for_all_unused_symbols): New function.
6200 * incremental.h (enum Incremental_input_flags): New type.
6201 (class Incremental_checker): Remove.
6202 (Incremental_input_entry::Incremental_input_entry): Add argument
6203 serial number.
6204 (Incremental_input_entry::arg_serial): New function.
6205 (Incremental_input_entry::set_is_in_system_directory): New function.
6206 (Incremental_input_entry::is_in_system_directory): New function.
6207 (Incremental_input_entry::arg_serial_): New data member.
6208 (Incremental_input_entry::is_in_system_directory_): New data member.
6209 (class Script_info): Move here from script.h.
6210 (Script_info::Script_info): Add filename parameter.
6211 (Script_info::filename): New function.
6212 (Script_info::filename_): New data member.
6213 (Incremental_script_entry::Incremental_script_entry): Add argument
6214 serial number.
6215 (Incremental_object_entry::Incremental_object_entry): Likewise.
6216 (Incremental_object_entry::add_input_section): Build list of input
6217 sections with map to original shndx.
6218 (Incremental_object_entry::get_input_section_index): New function.
6219 (Incremental_object_entry::shndx_): New data member.
6220 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6221 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6222 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6223 serial number.
6224 (Incremental_inputs::report_archive_begin): Likewise.
6225 (Incremental_inputs::report_object): Likewise.
6226 (Incremental_inputs::report_script): Likewise.
6227 (class Incremental_global_symbol_reader): New class.
6228 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6229 and store flags and input file type.
6230 (Incremental_input_entry_reader::arg_serial): New function.
6231 (Incremental_input_entry_reader::type): Extract type from flags.
6232 (Incremental_input_entry_reader::is_in_system_directory): New function.
6233 (Incremental_input_entry_reader::get_input_section_count): Call
6234 accessor function for type.
6235 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6236 function for type; adjust size of global symbol entry.
6237 (Incremental_input_entry_reader::get_global_symbol_count): Call
6238 accessor function for type.
6239 (Incremental_input_entry_reader::get_object_count): Likewise.
6240 (Incremental_input_entry_reader::get_object_offset): Likewise.
6241 (Incremental_input_entry_reader::get_member_count): Likewise.
6242 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6243 (Incremental_input_entry_reader::get_member_offset): Likewise.
6244 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6245 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6246 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6247 (Incremental_input_entry_reader::get_global_symbol_reader): New
6248 function.
6249 (Incremental_input_entry_reader::get_output_symbol_index): New
6250 function.
6251 (Incremental_input_entry_reader::type_): Remove.
6252 (Incremental_input_entry_reader::flags_): New data member.
6253 (Incremental_inputs_reader::input_file_offset): New function.
6254 (Incremental_inputs_reader::input_file_index): New function.
6255 (Incremental_inputs_reader::input_file): Call input_file_offset.
6256 (Incremental_inputs_reader::input_file_at_offset): New function.
6257 (Incremental_relocs_reader::get_r_type): Reformat.
6258 (Incremental_relocs_reader::get_r_shndx): Reformat.
6259 (Incremental_relocs_reader::get_r_offset): Reformat.
6260 (Incremental_relocs_reader::data): New function.
6261 (Incremental_binary::Incremental_binary): Initialize new data members.
6262 (Incremental_binary::check_inputs): Add cmdline parameter.
6263 (Incremental_binary::file_is_unchanged): Remove.
6264 (Input_reader::arg_serial): New function.
6265 (Input_reader::get_unused_symbol_count): New function.
6266 (Input_reader::get_unused_symbol): New function.
6267 (Input_reader::do_arg_serial): New function.
6268 (Input_reader::do_get_unused_symbol_count): New function.
6269 (Input_reader::do_get_unused_symbol): New function.
6270 (Incremental_binary::input_file_count): New function.
6271 (Incremental_binary::get_input_reader): Change signature to use
6272 index instead of filename.
6273 (Incremental_binary::file_has_changed): New function.
6274 (Incremental_binary::get_input_argument): New function.
6275 (Incremental_binary::get_library): New function.
6276 (Incremental_binary::get_script_info): New function.
6277 (Incremental_binary::init_layout): New function.
6278 (Incremental_binary::reserve_layout): New function.
6279 (Incremental_binary::output_file): New function.
6280 (Incremental_binary::do_check_inputs): New function.
6281 (Incremental_binary::do_file_is_unchanged): Remove.
6282 (Incremental_binary::do_file_has_changed): New function.
6283 (Incremental_binary::do_init_layout): New function.
6284 (Incremental_binary::do_reserve_layout): New function.
6285 (Incremental_binary::do_input_file_count): New function.
6286 (Incremental_binary::do_get_input_reader): Change signature.
6287 (Incremental_binary::input_args_map_): New data member.
6288 (Incremental_binary::library_map_): New data member.
6289 (Incremental_binary::script_map_): New data member.
6290 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6291 new data members.
6292 (Sized_incremental_binary::output_section): New function.
6293 (Sized_incremental_binary::inputs_reader): Add const.
6294 (Sized_incremental_binary::symtab_reader): Add const.
6295 (Sized_incremental_binary::relocs_reader): Add const.
6296 (Sized_incremental_binary::got_plt_reader): Add const.
6297 (Sized_incremental_binary::get_symtab_view): New function.
6298 (Sized_incremental_binary::Inputs_reader): New typedef.
6299 (Sized_incremental_binary::Input_entry_reader): New typedef.
6300 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6301 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6302 (Sized_incremental_binary::do_file_has_changed): New function.
6303 (Sized_incremental_binary::do_init_layout): New function.
6304 (Sized_incremental_binary::do_reserve_layout): New function.
6305 (Sized_input_reader::Inputs_reader): Remove.
6306 (Sized_input_reader::Input_entry_reader): Remove.
6307 (Sized_input_reader::do_arg_serial): New function.
6308 (Sized_input_reader::do_get_unused_symbol_count): New function.
6309 (Sized_input_reader::do_get_unused_symbol): New function.
6310 (Sized_incremental_binary::do_input_file_count): New function.
6311 (Sized_incremental_binary::do_get_input_reader): Change signature;
6312 use index instead of filename.
6313 (Sized_incremental_binary::section_map_): New data member.
6314 (Sized_incremental_binary::input_entry_readers_): New data member.
6315 (class Sized_incr_relobj): New class.
6316 (class Sized_incr_dynobj): New class.
6317 (make_sized_incremental_object): New function.
6318 (class Incremental_library): New class.
6319 * layout.cc (Free_list::num_lists): New static data member.
6320 (Free_list::num_nodes): New static data member.
6321 (Free_list::num_removes): New static data member.
6322 (Free_list::num_remove_visits): New static data member.
6323 (Free_list::num_allocates): New static data member.
6324 (Free_list::num_allocate_visits): New static data member.
6325 (Free_list::init): New function.
6326 (Free_list::remove): New function.
6327 (Free_list::allocate): New function.
6328 (Free_list::dump): New function.
6329 (Free_list::print_stats): New function.
6330 (Layout_task_runner::run): Resize output file for incremental updates.
6331 (Layout::Layout): Initialize new data members.
6332 (Layout::set_incremental_base): New function.
6333 (Layout::init_fixed_output_section): New function.
6334 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6335 incremental updates.
6336 (Layout::create_gold_note): Do not create gold note section for
6337 incremental updates.
6338 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6339 for incremental updates.
6340 (Layout::set_section_offsets): For incremental updates, allocate space
6341 from free list.
6342 (Layout::create_symtab_sections): Layout with offsets relative to
6343 start of section; for incremental updates, allocate space from free
6344 list.
6345 (Layout::create_shdrs): For incremental updates, allocate space from
6346 free list.
6347 (Layout::finish_dynamic_section): For incremental updates, do not
6348 check --as-needed (fixed in subsequent patch).
6349 * layout.h (class Free_list): New class.
6350 (Layout::set_incremental_base): New function.
6351 (Layout::incremental_base): New function.
6352 (Layout::init_fixed_output_section): New function.
6353 (Layout::allocate): New function.
6354 (Layout::incremental_base_): New data member.
6355 (Layout::free_list_): New data member.
6356 * main.cc (main): Print Free_list statistics.
6357 * object.cc (Relobj::finalize_incremental_relocs): Add
6358 clear_counts parameter; clear counts only when clear_counts is set.
6359 (Sized_relobj::Sized_relobj): Initialize new base class.
6360 (Sized_relobj::do_layout): Don't report special sections.
6361 (Sized_relobj::do_for_all_local_got_entries): New function.
6362 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6363 symtab_off to all symbol table offsets.
6364 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6365 * object.h (class Got_offset_list): Move to top of file.
6366 (Object::Object): Allow case where input_file == NULL.
6367 (Object::~Object): Likewise.
6368 (Object::input_file): Assert that input_file != NULL.
6369 (Object::lock): Allow case where input_file == NULL.
6370 (Object::unlock): Likewise.
6371 (Object::is_locked): Likewise.
6372 (Object::token): Likewise.
6373 (Object::release): Likewise.
6374 (Object::is_incremental): New function.
6375 (Object::get_mtime): New function.
6376 (Object::for_all_local_got_entries): New function.
6377 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6378 (Object::set_is_in_system_directory): New function.
6379 (Object::is_in_system_directory): New function.
6380 (Object::do_is_incremental): New function.
6381 (Object::do_get_mtime): New function.
6382 (Object::do_for_all_local_got_entries): New function.
6383 (Object::is_in_system_directory_): New data member.
6384 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6385 (class Sized_relobj_base): New class.
6386 (class Sized_relobj): Derive from Sized_relobj_base.
6387 (class Sized_relobj::Symbols): Redeclare from base class.
6388 (class Sized_relobj::local_got_offset_list): Remove.
6389 (class Sized_relobj::Output_sections): Redeclare from base class.
6390 (class Sized_relobj::do_for_all_local_got_entries): New function.
6391 (class Sized_relobj::write_local_symbols): Add offset parameter.
6392 (class Sized_relobj::local_symbol_offset_): Update comment.
6393 (class Sized_relobj::local_dynsym_offset_): Update comment.
6394 * options.cc (Input_arguments::add_file): Remove const.
6395 * options.h (Input_file_argument::Input_file_argument):
6396 Initialize arg_serial_ (all constructors).
6397 (Input_file_argument::set_arg_serial): New function.
6398 (Input_file_argument::arg_serial): New function.
6399 (Input_file_argument::arg_serial_): New data member.
6400 (Input_arguments::Input_arguments): Initialize file_count_.
6401 (Input_arguments::add_file): Remove const.
6402 (Input_arguments::number_of_input_files): New function.
6403 (Input_arguments::file_count_): New data member.
6404 (Command_line::number_of_input_files): Call
6405 Input_arguments::number_of_input_files.
6406 * output.cc (Output_segment_headers::Output_segment_headers):
6407 Set current size.
6408 (Output_section::Input_section::current_data_size): New function.
6409 (Output_section::Output_section): Initialize new data members.
6410 (Output_section::add_input_section): Don't do merge sections for
6411 an incremental link; allocate space from free list for an
6412 incremental update.
6413 (Output_section::add_output_section_data): Allocate space from
6414 free list for an incremental update.
6415 (Output_section::update_data_size): New function.
6416 (Output_section::set_fixed_layout): New function.
6417 (Output_section::reserve): New function.
6418 (Output_segment::set_section_addresses): Remove const.
6419 (Output_segment::set_section_list_addresses): Remove const; allocate
6420 space from free list for an incremental update.
6421 (Output_segment::set_offset): Adjust size of RELRO segment for an
6422 incremental update.
6423 * output.h (Output_data::current_data_size): Move here from
6424 child classes.
6425 (Output_data::pre_finalize_data_size): New function.
6426 (Output_data::update_data_size): New function.
6427 (Output_section_headers::update_data_size): new function.
6428 (Output_section_data_build::current_data_size): Move to Output_data.
6429 (Output_data_strtab::update_data_size): New function.
6430 (Output_section::current_data_size): Move to Output_data.
6431 (Output_section::set_fixed_layout): New function.
6432 (Output_section::has_fixed_layout): New function.
6433 (Output_section::reserve): New function.
6434 (Output_section::update_data_size): New function.
6435 (Output_section::has_fixed_layout_): New data member.
6436 (Output_section::free_list_): New data member.
6437 (Output_segment::set_section_addresses): Remove const.
6438 (Output_segment::set_section_list_addresses): Remove const.
6439 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6440 New function.
6441 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6442 New function.
6443 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6444 parameter when calling Add_symbols constructor; store argument
6445 serial number for members of a lib group.
6446 (Add_symbols::locks): Allow case where token == NULL.
6447 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6448 (Read_member::~Read_member): New function.
6449 (Read_member::is_runnable): New function.
6450 (Read_member::locks): New function.
6451 (Read_member::run): New function.
6452 (Check_script::~Check_script): New function.
6453 (Check_script::is_runnable): New function.
6454 (Check_script::locks): New function.
6455 (Check_script::run): New function.
6456 (Check_library::~Check_library): New function.
6457 (Check_library::is_runnable): New function.
6458 (Check_library::locks): New function.
6459 (Check_library::run): New function.
6460 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6461 (Add_symbols::library_): New data member.
6462 (class Read_member): New class.
6463 (class Check_script): New class.
6464 (class Check_library): New class.
6465 * reloc.cc (Read_relocs::is_runnable): Allow case where
6466 token == NULL.
6467 (Read_relocs::locks): Likewise.
6468 (Scan_relocs::locks): Likewise.
6469 (Relocate_task::locks): Likewise.
6470 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6471 to clear counters.
6472 (Sized_relobj::incremental_relocs_scan): Fix comment.
6473 (Sized_relobj::do_relocate): Pass output file offset to
6474 write_local_symbols.
6475 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6476 from class declaration.
6477 * script.cc (read_input_script): Allocate Script_info; pass
6478 argument serial number to report_script.
6479 * script.h (class Script_info): Move to incremental.h.
6480 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6481 * symtab.h (Symbol_table::add_from_incrobj): New function.
6482 (Symbol_table::set_file_offset): New function.
6483
b961d0d7
CC
64842011-04-05 Cary Coutant <ccoutant@google.com>
6485
6486 * incremental-dump.cc (dump_incremental_inputs): Change signature
6487 to take a Sized_incremental_binary; change caller. Use readers
6488 in Sized_incremental_binary.
6489 * incremental.cc
6490 (Sized_incremental_binary::find_incremental_inputs_sections):
6491 Rename do_find_incremental_inputs_sections to this.
6492 (Sized_incremental_binary::setup_readers): New function.
6493 (Sized_incremental_binary::do_check_inputs): Check
6494 has_incremental_info_ flag; move setup code to setup_readers;
6495 use input readers.
6496 (Sized_incremental_binary::do_file_is_unchanged): New function.
6497 (Sized_incremental_binary::do_get_input_reader): New function.
6498 * incremental.h (class Incremental_binary): Move to end of file.
6499 (Incremental_binary::file_is_unchanged): New function.
6500 (Incremental_binary::do_file_is_unchanged): New function.
6501 (Incremental_binary::Input_reader): New class.
6502 (Incremental_binary::get_input_reader): New function.
6503 (class Sized_incremental_binary): Move to end of file.
6504 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6505 input section reader classes.
6506 (Sized_incremental_binary::has_incremental_info): New function.
6507 (Sized_incremental_binary::inputs_reader): New function.
6508 (Sized_incremental_binary::symtab_reader): New function.
6509 (Sized_incremental_binary::relocs_reader): New function.
6510 (Sized_incremental_binary::got_plt_reader): New function.
6511 (Sized_incremental_binary::do_file_is_unchanged): New function.
6512 (Sized_incremental_binary::Sized_input_reader): New class.
6513 (Sized_incremental_binary::get_input_reader): New function.
6514 (Sized_incremental_binary::find_incremental_inputs_sections):
6515 Rename do_find_incremental_inputs_sections to this.
6516 (Sized_incremental_binary::setup_readers): New function.
6517 (Sized_incremental_binary::has_incremental_info_): New data member.
6518 (Sized_incremental_binary::inputs_reader_): New data member.
6519 (Sized_incremental_binary::symtab_reader_): New data member.
6520 (Sized_incremental_binary::relocs_reader_): New data member.
6521 (Sized_incremental_binary::got_plt_reader_): New data member.
6522 (Sized_incremental_binary::current_input_file_): New data member.
6523
a869183f
PP
65242011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6525
6526 PR gold/12640
6527 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6528 violation.
6529
65302011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6531
6532 * archive.cc (Archive::include_member): Adjust call to report_object.
6533 (Add_archive_symbols::run): Add script_info to call to
6534 report_archive_begin.
6535 (Lib_group::include_member): Adjust call to report_object.
6536 (Add_lib_group_symbols::run): Adjust call to report_object.
6537 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6538 blocks. Add object count for script input files.
6539 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6540 script_info parameter; change all callers.
6541 (Incremental_inputs::report_object): Add script_info parameter;
6542 change all callers.
6543 (Incremental_inputs::report_script): Store backpointer to
6544 incremental info entry.
6545 (Output_section_incremental_inputs::set_final_data_size): Record
6546 additional information for scripts.
6547 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6548 * incremental.h (Incremental_script_entry::add_object): New function.
6549 (Incremental_script_entry::get_object_count): New function.
6550 (Incremental_script_entry::get_object): New function.
6551 (Incremental_script_entry::objects_): New data member; adjust
6552 constructor.
6553 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6554 (Incremental_inputs::report_object): Add script_info parameter.
6555 (Incremental_inputs_reader::get_object_count): New function.
6556 (Incremental_inputs_reader::get_object_offset): New function.
6557 * options.cc (Input_arguments::add_file): Return reference to
6558 new input argument.
6559 * options.h (Input_argument::set_script_info): New function.
6560 (Input_argument::script_info): New function.
6561 (Input_argument::script_info_): New data member; adjust all
6562 constructors.
6563 (Input_file_group::add_file): Return reference to new input argument.
6564 (Input_file_lib::add_file): Likewise.
6565 (Input_arguments::add_file): Likewise.
6566 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6567 * script.cc (Parser_closure::Parser_closure): Add script_info
6568 parameter; adjust all callers.
6569 (Parser_closure::script_info): New function.
6570 (Parser_closure::script_info_): New data member.
6571 (read_input_script): Report scripts earlier to incremental info.
6572 (script_add_file): Set script_info in Input_argument.
6573 (script_add_library): Likewise.
6574 * script.h (Script_options::Script_info): Rewrite class.
6575
a869183f 65762011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6577
6578 * archive.cc (Library_base::should_include_member): Move
6579 method here from class Archive.
6580 (Archive::Archive): Initialize base class.
6581 (Archive::should_include_member): Move to base class.
6582 (Archive::do_for_all_unused_symbols): New function.
6583 (Add_archive_symbols::run): Remove redundant access to
6584 incremental_inputs.
6585 (Lib_group::Lib_group): Initialize base class.
6586 (Lib_group::do_filename): New function.
6587 (Lib_group::include_member): Pass pointer to Lib_group to
6588 report_object.
6589 (Lib_group::do_for_all_unused_symbols): New function.
6590 (Add_lib_group_symbols::run): Report archive information for
6591 incremental links.
6592 * archive.h (class Library_base): New base class.
6593 (class Archive): Derive from Library_base.
6594 (Archive::filename): Move to base class.
6595 (Archive::set_incremental_info): Likewise.
6596 (Archive::incremental_info): Likewise.
6597 (Archive::Should_include): Likewise.
6598 (Archive::should_include_member): Likewise.
6599 (Archive::Armap_entry): Remove.
6600 (Archive::Unused_symbol_iterator): Remove.
6601 (Archive::unused_symbols_begin): Remove.
6602 (Archive::unused_symbols_end): Remove.
6603 (Archive::do_filename): New function.
6604 (Archive::do_get_mtime): New function.
6605 (Archive::do_for_all_unused_symbols): New function.
6606 (Archive::task_): Move to base class.
6607 (Archive::incremental_info_): Likewise.
6608 (class Lib_group): Derive from Library_base.
6609 (Lib_group::do_filename): New function.
6610 (Lib_group::do_get_mtime): New function.
6611 (Lib_group::do_for_all_unused_symbols): New function.
6612 (Lib_group::task_): Move to base class.
6613 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6614 function.
6615 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6616 function.
6617 * incremental.cc (Incremental_inputs::report_archive_begin):
6618 Use Library_base; call library's get_mtime; add incremental inputs
6619 entry before members.
6620 (class Unused_symbol_visitor): New class.
6621 (Incremental_inputs::report_archive_end): Use Library_base; use
6622 visitor class to record unused symbols; don't add incremental inputs
6623 entry after members.
6624 (Incremental_inputs::report_object): Use Library_base.
6625 * incremental.h
6626 (Incremental_archive_entry::Incremental_archive_entry): Remove
6627 unused Archive parameter.
6628 (Incremental_inputs::report_archive_begin): Use Library_base.
6629 (Incremental_inputs::report_archive_end): Likewise.
6630 (Incremental_inputs::report_object): Likewise.
6631 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6632 function.
6633 * object.h (Object::for_all_global_symbols): New function.
6634 (Object::do_for_all_global_symbols): New function.
6635 (Sized_relobj::do_for_all_global_symbols): New function.
6636 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6637 function.
6638 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6639 function.
6640
61ab3e40
ILT
66412011-03-27 Ian Lance Taylor <iant@google.com>
6642
6643 * archive.cc (Archive::interpret_header): Return -1 if something
6644 goes wrong. Change callers accordingly.
6645
30e1f9e6
CC
66462011-03-25 Cary Coutant <ccoutant@google.com>
6647
6648 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6649 * testsuite/Makefile.in: Regenerate.
6650
9370ce59 66512011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6652
6653 * plugin.cc (get_view): New.
6654 (Plugin::load): Pass get_view to the plugin.
6655 (Plugin_manager::get_view): New.
6656
9312bb0a
ILT
66572011-03-21 Ian Lance Taylor <iant@google.com>
6658
6659 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6660 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6661
7e12ba9e
ST
66622011-03-21 Sriraman Tallam <tmsriram@google.com>
6663
6664 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6665 Change == to -eq.
6666 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6667 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6668 Change == to -eq.
6669 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6670 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6671
fd7a005d
ILT
66722011-03-14 Ian Lance Taylor <iant@google.com>
6673
6674 * script-sections.cc (Sort_output_sections::script_compare):
6675 Rename from is_before, change return type.
6676 (Sort_output_sections::operator()): Adjust accordingly.
6677
ed16fd1b
ILT
66782011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6679
6680 PR gold/12572
6681 * testsuite/odr_violation2.cc: Add comment to make all error line
6682 numbers double digits.
6683 * testsuite/debug_msg.sh: Adjust expected errors.
6684
71ff8986
ILT
66852011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6686
6687 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6688 but mark earlier ones as non-canonical
6689 (offset_to_iterator): Update search target and example
6690 (do_addr2line): Return extra lines in a vector*
6691 (format_file_lineno): Extract from do_addr2line
6692 (one_addr2line): Add vector* out-param
6693 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6694 when a lineno entry appeared last for its instruction
6695 (Dwarf_line_info): Add vector* out-param
6696 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6697 * symtab.cc (Odr_violation_compare): Include the lineno in the
6698 comparison again.
6699 (linenos_from_loc): New. Combine the canonical line for an
6700 address with its other lines.
6701 (True_if_intersect): New. Helper functor to make
6702 std::set_intersection a query.
6703 (detect_odr_violations): Compare sets of lines instead of just
6704 one line for each function. This became less deterministic, but
6705 has fewer false positives.
6706 * symtab.h: Declarations.
6707 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6708 mix an optimized and non-optimized object in the same binary
6709 (odr_violation2.so): Same.
6710 * testsuite/Makefile.in: Regenerate from Makefile.am.
6711 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6712 * testsuite/debug_msg.sh: Update line numbers and add
6713 assertions.
6714 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6715 non-optimized context.
6716 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6717 isn't inlined, and use OdrDerived in an optimized context.
6718 * testsuite/odr_header1.h: Defines OdrDerived, where
6719 optimization will change the
6720 first-instruction-in-the-destructor's file and line number.
6721 * testsuite/odr_header2.h: Defines OdrBase.
6722
a19fefdc
ILT
67232011-03-09 Ian Lance Taylor <iant@google.com>
6724
6725 * fileread.cc (File_read::clear_views): Don't delete the whole
6726 file view.
6727
ecb351e9
ILT
67282011-03-08 Ian Lance Taylor <iant@google.com>
6729
6730 PR gold/12525
6731 * fileread.cc: #include <climits>.
6732 (GOLD_IOV_MAX): Define.
6733 (File_read::read_multiple): Limit number of entries by iov_max.
6734 * fileread.h (class File_read): Always set max_readv_entries to
6735 128.
6736
b821d13c
ILT
67372011-03-07 Ian Lance Taylor <iant@google.com>
6738
6739 PR gold/12525
6740 * options.h (class General_options): Add -dy and -dn.
6741
89243142
CC
67422011-03-02 Cary Coutant <ccoutant@google.com>
6743
6744 * testsuite/script_test_9.t: Add TLS segment.
6745
d0773f31
ILT
67462011-03-02 Simon Baldwin <simonb@google.com>
6747
6748 * configure.ac: Add check for gnu_indirect_function support in
6749 the toolchain building binutils.
6750 * configure: Rebuild.
6751
9370ce59 67522011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6753
6754 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6755 plugin only symbols.
6756 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6757 in plugin files as not needed in the symbol table.
6758
4cf7a849
ST
67592011-02-11 Sriraman Tallam <tmsriram@google.com>
6760
6761 * output.cc (Output_section::add_input_section): Delay fill
6762 generation for section ordering.
6763
b578bd7d
ILT
67642011-02-09 Ian Lance Taylor <iant@google.com>
6765
6766 PR gold/12316
6767 * object.h (class Sized_relobj): Remove clear_local_symbols.
6768 * reloc.cc (Sized_relobj::do_relocate): Don't call
6769 clear_local_symbols.
6770
9370ce59 67712011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6772
6773 * plugin.cc (is_visible_from_outside): Return true for symbols
6774 in the -u option.
6775
55382fb7
ILT
67762011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6777
6778 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6779 filename.
6780
4e271fff
ST
67812011-02-02 Sriraman Tallam <tmsriram@google.com>
6782
6783 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6784 to std::string.
4e271fff 6785 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6786 section_name to be std::string.
4e271fff
ST
6787 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6788
d433c3ac
ILT
67892011-01-25 Ian Lance Taylor <iant@google.com>
6790
6791 * script.cc (script_add_extern): Rewrite to use
6792 add_symbol_reference.
6793
880473a6
DK
67942011-01-25 Doug Kwan <dougkwan@google.com>
6795
d433c3ac 6796 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6797
f30f86fa
ILT
67982011-01-24 Ian Lance Taylor <iant@google.com>
6799
6800 * options.h (class General_options): Accept
6801 --no-detect-odr-violations.
6802
8e51a0b9
ILT
68032011-01-24 Ian Lance Taylor <iant@google.com>
6804
6805 * version.cc (version_string): Bump to 1.11.
6806
0f3b89d8
ILT
68072011-01-24 Ian Lance Taylor <iant@google.com>
6808
6809 * plugin.cc (class Plugin_rescan): Define new class.
6810 (Plugin_manager::claim_file): Set any_claimed_.
6811 (Plugin_manager::save_archive): New function.
6812 (Plugin_manager::save_input_group): New function.
6813 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6814 necessary.
6815 (Plugin_manager::new_undefined_symbol): New function.
6816 (Plugin_manager::rescan): New function.
6817 (Plugin_manager::rescannable_defines): New function.
6818 (Plugin_manager::add_input_file): Set any_added_.
6819 * plugin.h (class Plugin_manager): define new fields rescannable_,
6820 undefined_symbols_, any_claimed_, and any_added_. Declare
6821 Plugin_rescan as friend. Declare new functions.
6822 (Plugin_manager::Rescannable): Define type.
6823 (Plugin_manager::Rescannable_list): Define type.
6824 (Plugin_manager::Undefined_symbol_list): Define type.
6825 (Plugin_manager::Plugin_manager): Initialize new fields.
6826 * archive.cc (Archive::defines_symbol): New function.
6827 (Add_archive_symbols::run): Pass archive to plugins if any.
6828 * archive.h (class Archive): Declare defines_symbol.
6829 * readsyms.cc (Input_group::~Input_group): New function.
6830 (Finish_group::run): Pass input_group to plugins if any.
6831 * readsyms.h (class Input_group): Declare destructor.
6832 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6833 any.
6834
3bb951e5
ILT
68352011-01-10 Ian Lance Taylor <iant@google.com>
6836
6837 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6838 section as relro.
6839 (Layout::set_segment_offsets): Reset increase_relro before calling
6840 set_section_addresses a second time.
6841
0aa45fac
CC
68422011-01-04 Cary Coutant <ccoutant@google.com>
6843
6844 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6845 sections before NOBITS sections.
6846
0db46eb4
L
68472011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6848
6849 * version.cc (print_version): Update copyright to 2011.
6850
829c9745
CC
68512010-12-23 Cary Coutant <ccoutant@google.com>
6852
6853 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6854 of OS to this->add. Add OD parameter to second form of the function.
6855
7500420b
ILT
68562010-12-20 Ian Lance Taylor <iant@google.com>
6857
6858 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6859 second of two consecutive entries with same offset.
6860
f8e9a930
RW
68612010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6862
6863 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6864 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6865 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6866 to avoid unneeded links against $(LDADD).
6867 * testsuite/Makefile.in: Regenerate.
6868
2fbb4320
ILT
68692010-12-15 Ian Lance Taylor <iant@google.com>
6870
6871 PR gold/12324
6872 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6873 for R_X86_64_32 and R_X86_64_PC32.
6874 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6875 ver_matching_def_pic.o.
6876 (ver_matching_def_pic.o): New target.
6877
fedb228d
RW
68782010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6879
6880 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6881 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6882 Move definition before File_read::View member definitions.
6883 (File_read::View::~View): Initialize and hold lock before
6884 updating current_mapped_bytes.
6885
9b547ce6
RW
68862010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6887
6888 * dwarf_reader.cc: Remove outdated comment.
6889 * gold-threads.cc: Fix typo in error message.
6890 * archive.cc: Fix typos in comments.
6891 * archive.h: Likewise.
6892 * arm-reloc-property.cc: Likewise.
6893 * arm-reloc-property.h: Likewise.
6894 * arm-reloc.def: Likewise.
6895 * arm.cc: Likewise.
6896 * attributes.h: Likewise.
6897 * cref.cc: Likewise.
6898 * ehframe.cc: Likewise.
6899 * fileread.h: Likewise.
6900 * gold.h: Likewise.
6901 * i386.cc: Likewise.
6902 * icf.cc: Likewise.
6903 * incremental.h: Likewise.
6904 * int_encoding.cc: Likewise.
6905 * layout.h: Likewise.
6906 * main.cc: Likewise.
6907 * merge.h: Likewise.
6908 * object.cc: Likewise.
6909 * object.h: Likewise.
6910 * options.cc: Likewise.
6911 * readsyms.cc: Likewise.
6912 * reduced_debug_output.cc: Likewise.
6913 * reloc.cc: Likewise.
6914 * script-sections.cc: Likewise.
6915 * sparc.cc: Likewise.
6916 * symtab.h: Likewise.
6917 * target-reloc.h: Likewise.
6918 * target.cc: Likewise.
6919 * target.h: Likewise.
6920 * timer.cc: Likewise.
6921 * timer.h: Likewise.
6922 * x86_64.cc: Likewise.
6923
83e17bd5
CC
69242010-12-09 Cary Coutant <ccoutant@google.com>
6925
6926 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6927 stack.
6928 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6929 parameter; change all callers.
6930 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6931 * options.h (warn_execstack): New option.
6932
017257f8
DK
69332010-12-07 Doug Kwan <dougkwan@google.com>
6934
6935 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6936 like function call relocations.
6937
c20cbc06
ILT
69382010-12-07 Ian Lance Taylor <iant@google.com>
6939
6940 * archive.cc (Archive::get_elf_object_for_member): Permit
6941 punconfigured to be NULL.
6942 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6943 (Archive::include_member): Pass NULL to get_elf_object_for_member
6944 if we searched for the archive and this is the first included
6945 object.
6946
4dbfafcc
ILT
69472010-12-01 Ian Lance Taylor <iant@google.com>
6948
6949 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6950 track_relocs_type_ field.
6951 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6952 Set track_relocs_type_.
6953 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6954 contents when using RELA relocs.
6955 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6956 reloc_map_.
6957 * reloc.cc (Track_relocs::next_addend): New function.
6958 * reloc.h (class Track_relocs): Declare next_addend.
6959
e5e19edd
ILT
69602010-12-01 Ian Lance Taylor <iant@google.com>
6961
6962 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6963 virtual destructor.
6964
9a5ce24c
ILT
69652010-12-01 Ian Lance Taylor <iant@google.com>
6966
6967 * README: Update compilers known to work and fail.
6968
c7791212
NC
69692010-11-23 Matthias Klose <doko@ubuntu.com>
6970
6971 * configure.in: For --enable-gold, handle value `default' instead of
6972 `both*'. Always install ld as ld.bfd, install as ld if gold is
6973 not the default.
6974 * configure: Regenerate.
6975
0ad220c9
DK
69762010-11-18 Doug Kwan <dougkwan@google.com>
6977
6978 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6979 and right_alignment to be zero. Store result alignment only if it is
6980 greater than existing alignment.
6981
ab8056e0
CC
69822010-11-16 Cary Coutant <ccoutant@google.com>
6983
6984 PR gold/12220
6985 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6986 Check for ".zdebug_line".
6987
fd064a5b
CC
69882010-11-16 Doug Kwan <dougkwan@google.com>
6989 Cary Coutant <ccoutant@google.com>
6990
6991 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6992 by reference; adjust all callers.
6993 * output.cc (Output_segment::set_section_addresses): Adjust references
6994 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6995 list is empty.
6996 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6997 end at page boundary.
6998
6fc6ea19
CC
69992010-11-16 Cary Coutant <ccoutant@google.com>
7000
7001 PR gold/12220
7002 * layout.cc (Layout::choose_output_section): Transform names of
7003 compressed sections even when using a script with a SECTIONS clause.
7004 (Layout::output_section_name): Remove code to transform
7005 compressed debug section names.
7006 * output.cc (Output_section::add_input_section): Use uncompressed
7007 section size when tracking input sections.
7008
95a2c8d6
RS
70092010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7010
7011 * symtab.h (Symbol::NON_PIC_REF): Remove.
7012 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7013 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7014 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7015 (Symbol::use_plt_offset): Take a flags argument and pass it
7016 directly to needs_dynamic_reloc. Restrict check for undefined
7017 weak symbols to function calls.
7018 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7019 (Target_arm::Scan::global): Use it.
7020 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7021 (Target_arm::Relocate::relocate): Likewise.
7022 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7023 parameter with an r_type parameter. Use get_reference_flags
7024 to get the flags.
7025 (Target_arm::Relocate::relocate): Update accordingly.
7026 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7027 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7028 (Target_i386::Scan::global): Likewise.
7029 (Target_i386::Relocate::relocate): Likewise.
7030 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7031 parameter with an r_type parameter. Use get_reference_flags
7032 to get the flags.
7033 (Target_i386::Relocate::relocate): Update accordingly.
7034 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7035 (Target_powerpc::Scan::global): Use it.
7036 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7037 (Target_powerpc::Relocate::relocate): Likewise.
7038 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7039 (Target_sparc::Scan::global): Use it.
7040 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7041 (Target_sparc::Relocate::relocate): Likewise.
7042 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7043 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7044 (Target_x86_64::Scan::global): Likewise.
7045 (Target_x86_64::Relocate::relocate): Likewise.
7046
f625ae50
DK
70472010-11-08 Doug Kwan <dougkwan@google.com>
7048 Cary Coutant <ccoutant@google.com>
7049
7050 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7051 (Arm_exidx_merge_section::section_contents_): New data member.
7052 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7053 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7054 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7055 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7056 in parameters instead of calling Object::section_contents without
7057 locking.
7058 (Arm_output_section::group_section): New parameter TASK. Pass it
7059 to callees that need locking objects.
7060 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7061 to lock EXIDX input sections. Fix a formatting issue. Call
7062 Arm_exidx_merged_section::build_contents to create merged section
7063 contents.
7064 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7065 to lock object of stub table owner.
7066 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7067 TEXT_SIZE to initialize data member TEXT_SIZE_.
7068 (Arm_exidx_input_section::addralign): Fix typo in comment.
7069 (Arm_exidx_input_section::text_size): New method.
7070 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7071 that require locking objects. Lock objects before scanning for stubs
7072 and updating local symbols.
7073 (Arm_input_section<big_endian>::init): Copy contents of original
7074 input section.
2e702c99 7075 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7076 original input section instead of calling Object::section_contents
7077 without locking.
7078 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7079 size without calling Object::section_size().
7080 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7081 for size. Allocate a buffer for merged EXIDX entries.
7082 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7083 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7084 building code to Arm_exidx_merged_section::build_contetns. Write
7085 out contetns in buffer instead of building it on the fly.
7086 (Arm_relobj::make_exidx_input_section): Also pass text section size
7087 to Arm_exidx_input_section constructor.
7088 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7089 (Arm_dynobj::do_read_symbols): Fix memory leak.
7090 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7091 * target.h: (class Task): Add forward declaration.
7092 (Target::relax): Add new parameter TASK and pass it to
7093 Target::do_relax().
7094 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7095
5f9bcf58
CC
70962010-11-05 Cary Coutant <ccoutant@google.com>
7097
7098 PR gold/10708
7099 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7100 object when reading from the file.
7101 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7102 second layout pass.
7103 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7104 when reading section contents.
7105 (get_section_contents): Likewise.
7106 (icf::find_identical_sections): Likewise.
7107 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7108 object when reading from the file.
7109 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7110 the object when doing deferred section layout.
7111
e597fa08
NC
71122010-11-03 Nick Clifton <nickc@redhat.com>
7113
7114 PR gold/12001
7115 * script.h (class Symbol_assignment: name): New member. Returns
7116 the name of the symbol.
7117 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7118 Returns true if the given symbol name is on the list of
7119 assignments wating to be processed.
7120 * archive.cc (should_incldue_member): If the symbol is undefined,
7121 check to see if it is on the list of symbols pending assignment.
7122
3f9a3278
ILT
71232010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7124
7125 * script-sections.cc (Script_sections::find_memory_region): Check
7126 for a NULL output section pointer.
7127
d06fb4d1
DK
71282010-10-29 Doug Kwan <dougkwan@google.com>
7129
7130 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7131 Output_section::add_relaxed_input_section.
7132 * output.cc (Output_section::add_relaxed_input_section): Add new
7133 arguments LAYOUT and NAME. Set section order index.
7134 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7135 Copy section order index.
7136 * output.h (Output_section::add_relaxed_input_section): Add new
7137 arguments LAYOUT and NAME.
7138
90e24de5
ILT
71392010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7140
7141 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7142 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7143 * testsuite/Makefile.in: Regenerate.
7144
c9484ea5
DK
71452010-10-20 Doug Kwan <dougkwan@google.com>
7146
7147 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7148 without SHF_LINK_ORDER flags.
7149 * layout.cc (Layout::choose_output_section): Do not filter
7150 SHF_LINK_ORDER flag in a relocatable link.
7151
5bc2f5be
CC
71522010-10-17 Cary Coutant <ccoutant@google.com>
7153
7154 * output.h (Output_segment::set_section_addresses): Change function
7155 signature. Update all callers.
7156 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7157 sections.
7158 (Output_segment::set_section_addresses): Align after last TLS
7159 section. Add padding before last relro section instead of after.
7160
0c91cf04
DK
71612010-10-17 Doug Kwan <dougkwan@google.com>
7162
7163 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7164 GOT output section to be writable.
7165
8c21d9d3
CC
71662010-10-14 Cary Coutant <ccoutant@google.com>
7167
7168 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7169 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7170 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7171 mode.
7172 * incremental.cc (report_command_line): Ignore all forms of
7173 --incremental.
7174 * layout.cc (Layout::Layout): Check parameters for incremental link
7175 mode.
7176 * options.cc (General_options::parse_incremental): New function.
7177 (General_options::parse_no_incremental): New function.
7178 (General_options::parse_incremental_full): New function.
7179 (General_options::parse_incremental_update): New function.
7180 (General_options::incremental_mode_): New data member.
7181 (General_options::finalize): Check incremental_mode_.
7182 * options.h (General_options): Update help text for --incremental.
7183 Add --no-incremental, --incremental-full, --incremental-update.
7184 (General_options::Incremental_mode): New enum type.
7185 (General_options::incremental_mode): New function.
7186 (General_options::incremental_mode_): New data member.
7187 * parameters.cc (Parameters::incremental_mode_): New data member.
7188 (Parameters::set_options): Set incremental_mode_.
7189 (Parameters::set_incremental_full): New function.
7190 (Parameters::incremental): New function.
7191 (Parameters::incremental_update): New function.
7192 (set_parameters_incremental_full): New function.
7193 * parameters.h (Parameters::set_incremental_full): New function.
7194 (Parameters::incremental): New function.
7195 (Parameters::incremental_update): New function.
7196 (Parameters::incremental_mode_): New data member.
7197 (set_parameters_incremental_full): New function.
7198 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7199 incremental link mode.
7200 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7201 (Sized_relobj::do_relocate_sections): Likewise.
7202 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7203 option.
7204 * testsuite/Makefile.in: Regenerate.
7205 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7206
bb32aa18 72072010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7208
7209 * script-sections.h (class Script_sections): Make
7210 Sections_elements typedef public.
7211 * script-sections.cc (class Sort_output_sections): Add elements_
7212 field. Add constructor which sets it; change all callers.
7213 (Sort_output_sections::is_before): New function.
7214 (Sort_output_sections::operator()): Call is_before.
7215 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7216 conditional.
7217 * testsuite/script_test_10.sh: New test. Test script section
7218 order.
7219 * testsuite/script_test_10.t: Likewise.
7220 * testsuite/script_test_10.s: Likewise.
7221 * testsuite/Makefile.am: Wrap the cross linker tests and the
7222 common tests into NATIVE_OR_CROSS_LINKER.
7223 (check_SCRIPTS): Add script_test_10.sh.
7224 (check_DATA): Add script_test_10.stdout.
7225 (script_test_10.o, script_test_10): New targets.
7226 (script_test_10.stdout): New target.
7227 * configure, testsuite/Makefile.in: Regenerate.
7228
3cef7179
ILT
72292010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7230
7231 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7232 error for the deprecated relocations.
7233 (Target_arm::Scan::global): Likewise.
7234 (Target_arm::Relocate::relocate): Likewise.
7235
7411e9a8
RS
72362010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7237
7238 * fileread.cc (Input_file::find_file): Initialize *found_name
7239 and *namep when using the fallback search for case 4.
7240
6a9da32a
CC
72412010-10-11 Cary Coutant <ccoutant@google.com>
7242
7243 * options.h (class General_options): Redefine -z lazy as an alias for
7244 the negation of -z now.
7245
ac897c20
ILT
72462010-10-11 Ian Lance Taylor <iant@google.com>
7247
7248 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7249 binding.
7250
ea5cae92
NC
72512010-10-06 Nick Clifton <nickc@redhat.com>
7252
7253 * script-sections.cc(class Memory_region): Remove
7254 current_lma_offset_ field. Rename current_vma_offset_ to
7255 current_offset_. Add last_section_ field.
7256 (Memory_region::get_current_vma_address): Rename to
7257 get_current_address.
7258 (Memory_region::get_current_lma_address): Delete.
7259 (Memory_region::increment_vma_offset): Rename to
7260 increment_offset.
7261 (Memory_region::increment_lma_offset): Delete.
7262 (Memory_region::attributes_compatible): New method. Returns
7263 true if the provided section is compatible with the region.
7264 (Memory_region::get_last_section): New method. Returns the last
7265 section to use the region.
7266 (Memory_region::set_last_section): New method. Stores the last
7267 section to use the region.
7268 (Script_sections::block_in_region): New method. Returns true if
7269 a block of memory is contained within a region.
7270 (Script_sections::find_memory_region): New method. Locates a
7271 memory region to be used to set a VMA or LMA address.
7272 (Output_section_definition::set_section_addresses): Add code to
7273 check for addresses set by memory regions.
7274 (Output_segment::set_section_addresses): Remove memory region
7275 walking code.
7276 (Script_sections::create_segment): Add a warning if a header
7277 segment is created outside of any region.
7278 * script-sections.h (class Script_sections): Add prototypes for
7279 find_memory_region and block_in_region methods.
7280 * testsuite/memory_test.s: Use .long instead of .word.
7281 * testsuite/memory_test.t: Add some more output sections.
7282 * testsuite/memory_test.sh: Update expected output.
7283
a9bfd952
DK
72842010-10-02 Doug Kwan <dougkwan@google.com>
7285
7286 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7287 defintion to symtab.h
7288 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7289 declaration to defintion.
7290
bacff3ab
NC
72912010-10-01 Nick Clifton <nickc@redhat.com>
7292
7293 * expression.cc (eval): Replace dummy argument with NULL.
7294 (eval_maybe_dot): Check for a NULL result section pointer.
7295 (Symbol_expression::value): Likewise.
7296 (Dot_expression::value): Likewise.
7297 (BINARY_EXPRESSION): Likewise.
7298 (Max_expression::value): Likewise.
7299 (Min_expression::value): Likewise.
7300 (Absolute_expression::value): Likewise.
7301 (Addr_expression::value_from_output_section): Likewise.
7302 (Loaddddr_expression::value_from_output_section): Likewise.
7303 (Segment_start_expression::value): Likewise.
7304 * script-sections.cc
7305 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7306 argument with NULL.
7307 (Sections_elememt_dot_assignment::set_section_addresses):
7308 Likewise.
7309 (Output_data_expression::do_write_to_buffer): Likewise.
7310 (Output_section_definition::finalize_symbols): Likewise.
7311 (Output_section_definition::set_section_addresses): Likewise.
7312
f81bc8b5
DK
73132010-09-30 Doug Kwan <dougkwan@google.com>
7314
7315 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7316
c95e9f27
ST
73172010-09-28 Sriraman Tallam <tmsriram@google.com>
7318
7319 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7320 function.
c95e9f27
ST
7321 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7322 virtual function.
7323 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7324 virtual function.
7325 * icf.cc (get_section_contents): Inline merge sections only when
7326 target allows it.
7327
3cac54d2
RW
73282010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7329
7330 * configure: Regenerate.
7331
2904037a
ILT
73322010-09-17 Ian Lance Taylor <iant@google.com>
7333
7334 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7335 * testsuite/Makefile.am (memory_test.o): New target.
7336 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7337 memory_test.t.
7338 * testsuite/Makefile.in: Rebuild.
2904037a 7339
bca7fb63
DK
73402010-09-17 Doug Kwan <dougkwan@google.com>
7341
7342 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7343 defintion if relocation uses GOT entries of the symbol.
7344 * testsuite/icf_safe_test.sh: Fix test.
7345 * testsuite/icf_safe_so_test.sh: Fix test.
7346
4ef28648
CC
73472010-09-16 Cary Coutant <ccoutant@google.com>
7348
7349 * script_sections.cc (class Memory_region): Remove "NULL" from
7350 vector initializations.
7351
793990de
CC
73522010-09-15 Cary Coutant <ccoutant@google.com>
7353
7354 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7355 Resolve forwarding symbols.
7356
81e015e2
DK
73572010-09-15 Doug Kwan <dougkwan@google.com>
7358
7359 * gold/testsuite/script_test_3.t: Add ARM special sections.
7360 * gold/testsuite/script_test_4.t: Same.
7361 * gold/testsuite/script_test_5.t: Same.
7362 * gold/testsuite/script_test_6.t: Same.
7363 * gold/testsuite/script_test_7.t: Same.
7364 * gold/testsuite/script_test_7.t: Same.
7365 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7366
36171d64
CC
73672010-09-14 Cary Coutant <ccoutant@google.com>
7368
7369 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7370 (Target_x86_64::Relocate::relocate_tls): Replace check for
7371 saw_tls_block_reloc_ with test for executable section.
7372
d89051bd
CC
73732010-09-12 Cary Coutant <ccoutant@google.com>
7374
7375 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7376 position-independent executables to shared libraries need dynamic
7377 relocations.
7378 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7379 position-independent executables.
7380 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7381 * testsuite/Makefile.in: Regenerate.
7382
fca41f0f
NC
73832010-09-10 Nick Clifton <nickc@redhat.com>
7384
7385 PR gold/11997
7386 * testsuite/memory_test.t: Discard any sections that are not
7387 needed.
7388
6695e4b3
L
73892010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7390
7391 PR gold/11996
7392 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7393 "This::" to work around a bug in gcc 4.2.
7394
7395 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7396
0f72bf6f
RÁE
73972010-09-09 Rafael Espindola <espindola@google.com>
7398
7399 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7400 sections with different PF_X flags in the same segment.
7401 (Layout::find_first_load_seg): Search all segments to find the first
7402 one.
7403 * options.h (rosegment): New.
7404
74052010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7406
05a79166 7407 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7408
aa98ff75
DK
74092010-09-08 Doug Kwan <dougkwan@google.com>
7410
7411 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7412 (Arm_relobj::do_relocate_sections): Add new parameter for output
7413 file to match the parent.
7414 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7415 of local symbols instead of input values. Update code to track
7416 changes in gold::relocate_section.
7417 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7418 (Sized_relobj::compute_final_local_value_internal): New methods.
7419 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7420 body into private version of Sized_relobj::compute_final_local_value.
7421 Call the inline method.
7422 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7423 merged symbol value if there is one.
7424 (Symbol_value::has_output_value): New method defintiion.
7425 (Sized_relobj::Compute_final_local_value_status): New enum type.
7426 (Sized_relobj::compute_final_local_value): New methods.
7427 (Sized_relobj::compute_final_local_value_internal): New methods.
7428 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7429 and arm_cortex_a8.sh.
7430 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7431 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7432 New tests.
7433 * Makefile.in: Regenerate.
7434 * testsuite/arm_bl_out_of_range.s: Update test.
7435 * testsuite/thumb_bl_out_of_range.s: Ditto.
7436 * testsuite/thumb_blx_out_of_range.s: Ditto.
7437 * testsuite/arm_branch_out_of_range.sh: New file.
7438 * testsuite/arm_cortex_a8.sh: Ditto.
7439 * testsuite/arm_cortex_a8_b.s: Ditto.
7440 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7441 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7442 * testsuite/arm_cortex_a8_bl.s: Ditto.
7443 * testsuite/arm_cortex_a8_blx.s: Ditto.
7444 * testsuite/arm_cortex_a8_local.s: Ditto.
7445 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7446 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7447
05a79166
L
74482010-09-08 Rafael Espindola <espindola@google.com>
7449
7450 * Makefile.am (memory_test.stdout): Run readelf with -W.
7451 * Makefile.in: Regenerate.
7452 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7453 64 bit output.
7454
33dbc701
RÁE
74552010-09-08 Rafael Espindola <espindola@google.com>
7456
7457 * script-sections.cc (Script_sections::add_memory_region): Convert
7458 field precision to int.
7459 * script.cc (script_set_section_region, script_set_section_region):
7460 Convert field precision to int.
7461
731ca54a
RÁE
74622010-09-08 Rafael Espindola <espindola@google.com>
7463
7464 * arm.cc (do_finalize_sections): Create the __exidx_start and
7465 __exdix_end symbols even when the section is missing.
7466
7f8cd844
NC
74672010-09-08 Nick Clifton <nickc@redhat.com>
7468
7469 * README: Remove claim that MEMORY is not supported.
7470 * expression.cc (script_exp_function_origin)
7471 (script_exp_function_length): Move from here to ...
7472 * script.cc: ... here.
7473 (script_set_section_region, script_add_memory)
7474 (script_parse_memory_attr, script_include_directive): New
7475 functions.
7476 * script-sections.cc
7477 (class Memory_region): New class.
7478 (class Output_section_definition): Add set_memory_region,
7479 set_section_vma, set_section_lma and get_section_name methods.
7480 (class Script_Sections): Add add_memory_region,
7481 find_memory_region, find_memory_region_origin,
7482 find_memory_region_length and set_memory_region methods.
7483 Have set_section_addresses method walk the list of set memory
7484 regions.
7485 Extend the print methos to display memory regions.
7486 * script-sections.h: Add prototypes for new methods.
7487 Add enum for MEMORY region attributes.
7488 * yyscript.y: Add support for parsing MEMORY regions.
7489 * script-c.h: Add prototypes for new functions.
7490 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7491 * testsuite/Makefile.in: Regenerate.
7492 * testsuite/memory_test.sh: New script.
7493 * testsuite/memory_test.s: New assembler source file.
7494 * testsuite/memory_test.t: New linker script.
7495
a4649286
DK
74962010-08-27 Doug Kwan <dougkwan@google.com>
7497
7498 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7499 reference override an existing dynamic weak reference.
7500 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7501 * testsuite/Makefile.in: Regenerate.
7502 * testsuite/dyn_weak_ref.sh: New file.
7503 * testsuite/dyn_weak_ref_1.c: Ditto.
7504 * testsuite/dyn_weak_ref_2.c: Ditto.
7505
b56648ad
ILT
75062010-08-27 Ian Lance Taylor <iant@google.com>
7507
7508 * incremental.h (class Incremental_input_entry): Add virtual
7509 destructor.
7510
809313cb
ILT
75112010-08-27 Ian Lance Taylor <iant@google.com>
7512
7513 * testsuite/start_lib_test_3.c: Mark t3 as used.
7514
11e32464
NC
75152010-08-27 Nick Clifton <nickc@redhat.com>
7516
7517 * options.cc (version_script): Fix small typo in previous
7518 whitespace tidyup.
7519
ca09d69a
NC
75202010-08-25 Nick Clifton <nickc@redhat.com>
7521
7522 * archive.cc: Formatting fixes: Remove whitespace between
7523 typename and following asterisk. Remove whitespace between
7524 function name and opening parenthesis.
7525 * archive.h: Likewise.
7526 * arm.cc: Likewise.
7527 * attributes.cc: Likewise.
7528 * attributes.h: Likewise.
7529 * common.cc: Likewise.
7530 * copy-relocs.cc: Likewise.
7531 * dirsearch.h: Likewise.
7532 * dynobj.cc: Likewise.
7533 * ehframe.cc: Likewise.
7534 * ehframe.h: Likewise.
7535 * expression.cc: Likewise.
7536 * fileread.cc: Likewise.
7537 * fileread.h: Likewise.
7538 * gc.h: Likewise.
7539 * gold-threads.cc: Likewise.
7540 * gold.cc: Likewise.
7541 * i386.cc: Likewise.
7542 * icf.h: Likewise.
7543 * incremental-dump.cc: Likewise.
7544 * incremental.cc: Likewise.
7545 * layout.cc: Likewise.
7546 * layout.h: Likewise.
7547 * main.cc: Likewise.
7548 * merge.cc: Likewise.
7549 * merge.h: Likewise.
7550 * object.cc: Likewise.
7551 * object.h: Likewise.
7552 * options.cc: Likewise.
7553 * options.h: Likewise.
7554 * output.cc: Likewise.
7555 * output.h: Likewise.
7556 * plugin.cc: Likewise.
7557 * plugin.h: Likewise.
7558 * powerpc.cc: Likewise.
7559 * reloc.cc: Likewise.
7560 * script-c.h: Likewise.
7561 * script-sections.cc: Likewise.
7562 * script.cc: Likewise.
7563 * stringpool.cc: Likewise.
7564 * symtab.cc: Likewise.
7565 * symtab.h: Likewise.
7566 * target.cc: Likewise.
7567 * timer.cc: Likewise.
7568 * timer.h: Likewise.
7569 * version.cc: Likewise.
7570 * x86_64.cc: Likewise.
7571
b8fa8750
NC
75722010-08-24 Nick Clifton <nickc@redhat.com>
7573
7574 PR 11899
7575 * layout.cc (segment_precedes): Sort segments by their physical
7576 addresses, if they have been set.
7577
9919d93b
CC
75782010-08-23 Cary Coutant <ccoutant@google.com>
7579
7580 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7581 symbols data.
7582 (Lib_group::include_member): Unlock object after deleting its
7583 symbols data.
7584 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7585 the bug fixed here.
7586
97b4be1c
CC
75872010-08-19 Neil Vachharajani <nvachhar@google.com>
7588 Cary Coutant <ccoutant@google.com>
7589
7590 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7591 constructor, and set_blocker.
7592 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7593 readsyms_blocker_.
7594 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7595 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7596 * testsuite/Makefile.am (start_lib_test): New test case.
7597 * testsuite/Makefile.in: Regenerate.
7598 * testsuite/start_lib_test_main.c: New file.
7599 * testsuite/start_lib_test_1.c: New file.
7600 * testsuite/start_lib_test_2.c: New file.
7601 * testsuite/start_lib_test_3.c: New file.
7602
dd0b1884
ILT
76032010-08-19 Ian Lance Taylor <iant@google.com>
7604
7605 * Makefile.in: Rebuild with automake 1.11.1.
7606 * aclocal.m4: Likewise.
7607 * testsuite/Makefile.in: Likewise.
7608
7223e9ca
ILT
76092010-08-19 Ian Lance Taylor <iant@google.com>
7610
7611 PR 10893
7612 * i386.cc (class Output_data_plt_i386): Update declarations.
7613 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7614 local_ifuncs_ fields.
7615 (Target_i386::do_plt_section_for_global): New function.
7616 (Target_i386::do_plt_section_for_local): New function.
7617 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7618 parameter; change all callers. Initialize global_ifuncs_ and
7619 local_ifuncs_. If doing a static link define __rel_iplt_start and
7620 __rel_iplt_end.
7621 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7622 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7623 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7624 symbols.
7625 (Target_i386::make_plt_section): New function, broken out of
7626 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7627 (Target_i386::make_plt_entry): Call make_plt_section.
7628 (Target_i386::make_local_ifunc_plt_entry): New function.
7629 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7630 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7631 R_386_IRELATIVE to switch.
7632 (Target_i386::Scan::global): Likewise.
7633 (Target_i386::Relocate::relocate): Likewise.
7634 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7635 switch.
7636 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7637 (Target_x86_64::do_plt_section_for_global): New function.
7638 (Target_x86_64::do_plt_section_for_local): New function.
7639 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7640 parameter; change all callers. If doing a static link define
7641 __rela_iplt_start and __rela_iplt_end.
7642 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7643 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7644 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7645 to point to .plt.
7646 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7647 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7648 switch.
7649 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7650 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7651 R_X86_64_IRELATIVE to switch.
7652 (Target_x86_64::Scan::global): Likewise.
7653 (Target_x86_64::Relocate::relocate): Likewise.
7654 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7655 switch.
7656 * target.h (class Target): Add plt_section_for_global and
7657 plt_section_for_local functions. Add do_plt_section_for_global
7658 and do_plt_section_for_local virtual functions.
7659 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7660 clarifying comments.
7661 (Symbol::use_plt_offset): Handle IFUNC symbol.
7662 * object.cc (Sized_relobj::Sized_relobj): Initialize
7663 local_plt_offsets_.
7664 (Sized_relobj::local_has_plt_offset): New function.
7665 (Sized_relobj::local_plt_offset): New function.
7666 (Sized_relobj::set_local_plt_offset): New function.
7667 (Sized_relobj::do_count): Handle IFUNC symbol.
7668 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7669 a bit away from input_shndx_ field. Add set_is_func_symbol and
7670 is_ifunc_symbol functions.
7671 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7672 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7673 local_plt_offsets_ field.
7674 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7675 * output.h (class Output_section_data): Add non-const
7676 output_section function.
7677 (class Output_data_got): Update declarations.
7678 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7679 Add use_plt_offset parameter to global and local constructors.
7680 Change all callers. Change local_sym_index_ field to 31 bits.
7681 Change GSYM_CODE and CONSTANT_CODE accordingly.
7682 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7683 doing a static link don't set sh_link field.
7684 (Output_data_got::Got_entry::write): Use PLT offset if
7685 appropriate.
7686 (Output_data_got::add_global_plt): New function.
7687 (Output_data_got::add_local_plt): New function.
7688 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7689 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7690 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7691 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7692 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7693 IFUNC conditional.
7694 * testsuite/ifunc-sel.h: New file.
7695 * testsuite/ifuncmain1.c: New file.
7696 * testsuite/ifuncmain1vis.c: New file.
7697 * testsuite/ifuncmod1.c: New file.
7698 * testsuite/ifuncdep2.c: New file.
7699 * testsuite/ifuncmain2.c: New file.
7700 * testsuite/ifuncmain3.c: New file.
7701 * testsuite/ifuncmod3.c: New file.
7702 * testsuite/ifuncmain4.c: New file.
7703 * testsuite/ifuncmain5.c: New file.
7704 * testsuite/ifuncmod5.c: New file.
7705 * testsuite/ifuncmain6pie.c: New file.
7706 * testsuite/ifuncmod6.c: New file.
7707 * testsuite/ifuncmain7.c: New file.
7708 * configure, testsuite/Makefile.in: Rebuild.
7709
56f75c03
ILT
77102010-08-18 Ian Lance Taylor <iant@google.com>
7711
7712 * incremental.cc
7713 (Output_section_incremental_inputs::write_input_files): Add cast
7714 to avoid signed/unsigned comparison warning.
7715 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7716
55455f89
CC
77172010-08-12 Cary Coutant <ccoutant@google.com>
7718
7719 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7720
e2054bcb
ILT
77212010-08-13 Ian Lance Taylor <iant@google.com>
7722
7723 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7724
74f67560
DK
77252010-08-12 Cary Coutant <ccoutant@google.com>
7726 Doug Kwan <dougkwan@google.com>
7727
7728 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7729 defintion overrides non-weak undef, remember that the original undef
7730 is not weak.
7731 * symtab.cc (Symbol_table::sized_write_global): For undef without
7732 an original weak binding, set binding to global in output.
7733 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7734 * testsuite/Makefile.in: Regenerate.
7735 * testsuite/strong_ref_weak_def.sh: New file.
7736 * testsuite/strong_ref_weak_def_1.c: Ditto.
7737 * testsuite/strong_ref_weak_def_2.c: Ditto.
7738
d1238d12
CC
77392010-08-12 Cary Coutant <ccoutant@google.com>
7740
7741 * testsuite/incremental_test.sh: Rewrite.
7742 * testsuite/incremental_test_1.c: Rewrite.
7743 * testsuite/incremental_test_2.c: Rewrite.
7744
0e70b911
CC
77452010-08-12 Cary Coutant <ccoutant@google.com>
7746
7747 * arm.cc (Target_arm::got_size): Add const.
7748 (Target_arm::got_entry_count): New function.
7749 (Target_arm::plt_entry_count): New function.
7750 (Target_arm::first_plt_entry_offset): New function.
7751 (Target_arm::plt_entry_size): New function.
7752 (Output_data_plt_arm::entry_count): New function.
7753 (Output_data_plt_arm::first_plt_entry_offset): New function.
7754 (Output_data_plt_arm::get_plt_entry_size): New function.
7755 * i386.cc (Target_i386::got_size): Add const.
7756 (Target_i386::got_entry_count): New function.
7757 (Target_i386::plt_entry_count): New function.
7758 (Target_i386::first_plt_entry_offset): New function.
7759 (Target_i386::plt_entry_size): New function.
7760 (Output_data_plt_i386::entry_count): New function.
7761 (Output_data_plt_i386::first_plt_entry_offset): New function.
7762 (Output_data_plt_i386::get_plt_entry_size): New function.
7763 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7764 find_incremental_inputs_sections. Dump incremental_got_plt section.
7765 * incremental.cc: Include target.h.
7766 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7767 parameter. Adjust all callers. Find incremental_got_plt section.
7768 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7769 section.
7770 (Output_section_incremental_inputs::set_final_data_size): Calculate
7771 size of incremental_got_plt section.
7772 (Output_section_incremental_inputs::do_write): Write the
7773 incremental_got_plt section.
7774 (Got_plt_view_info): New struct.
7775 (Local_got_offset_visitor): New class.
7776 (Global_got_offset_visitor): New class.
7777 (Global_symbol_visitor_got_plt): New class.
7778 (Output_section_incremental_inputs::write_got_plt): New function.
7779 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7780 Add parameter. Adjust all callers.
7781 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7782 (Incremental_inputs::got_plt_section): New function.
7783 (Incremental_inputs::got_plt_section_): New data member.
7784 (Incremental_got_plt_reader): New class.
7785 * layout.cc (Layout::create_incremental_info_sections): Add the
7786 incremental_got_plt section.
7787 * object.h (Got_offset_list::get_list): New function.
7788 (Got offset_list::for_all_got_offsets): New function.
7789 (Sized_relobj::local_got_offset_list): New function.
7790 * powerpc.cc (Target_powerpc::got_size): Add const.
7791 (Target_powerpc::got_entry_count): New function.
7792 (Target_powerpc::plt_entry_count): New function.
7793 (Target_powerpc::first_plt_entry_offset): New function.
7794 (Target_powerpc::plt_entry_size): New function.
7795 (Output_data_plt_powerpc::entry_count): New function.
7796 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7797 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7798 * sparc.cc (Target_sparc::got_size): Add const.
7799 (Target_sparc::got_entry_count): New function.
7800 (Target_sparc::plt_entry_count): New function.
7801 (Target_sparc::first_plt_entry_offset): New function.
7802 (Target_sparc::plt_entry_size): New function.
7803 (Output_data_plt_sparc::entry_count): New function.
7804 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7805 (Output_data_plt_sparc::get_plt_entry_size): New function.
7806 * symtab.h (Symbol::got_offset_list): New function.
7807 (Symbol_table::for_all_symbols): New function.
7808 * target.h (Sized_target::got_entry_count): New function.
7809 (Sized_target::plt_entry_count): New function.
7810 (Sized_target::plt_entry_size): New function.
7811 * x86_64.cc (Target_x86_64::got_size): Add const.
7812 (Target_x86_64::got_entry_count): New function.
7813 (Target_x86_64::plt_entry_count): New function.
7814 (Target_x86_64::first_plt_entry_offset): New function.
7815 (Target_x86_64::plt_entry_size): New function.
7816 (Output_data_plt_x86_64::entry_count): New function.
7817 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7818 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7819
09ec0418
CC
78202010-08-12 Cary Coutant <ccoutant@google.com>
7821
7822 * archive.cc: Include incremental.h.
7823 (Archive::Archive): Initialize incremental_info_.
7824 (Archive::include_member): Record archive members in incremental info.
7825 (Add_archive_symbols::run): Record begin and end of an archive in
7826 incremental info.
7827 (Lib_group::include_member): Record objects in incremental info.
7828 * archive.h (Incremental_archive_entry): Forward declaration.
7829 (Archive::set_incremental_info): New member function.
7830 (Archive::incremental_info): New member function.
7831 (Archive::Unused_symbol_iterator): New class.
7832 (Archive::unused_symbols_begin): New member function.
7833 (Archive::unused_symbols_end): New member function.
7834 (Archive::incremental_info_): New data member.
7835 * incremental-dump.cc (find_input_containing_global): New function.
7836 (dump_incremental_inputs): Dump new incremental info sections.
7837 * incremental.cc: Include symtab.h.
7838 (Output_section_incremental_inputs): New class.
7839 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7840 new incremental info sections.
7841 (Sized_incremental_binary::do_check_inputs): Likewise.
7842 (Incremental_inputs::report_archive): Remove.
7843 (Incremental_inputs::report_archive_begin): New function.
7844 (Incremental_inputs::report_archive_end): New function.
7845 (Incremental_inputs::report_object): New function.
7846 (Incremental_inputs::finalize_inputs): Remove.
7847 (Incremental_inputs::report_input_section): New function.
7848 (Incremental_inputs::report_script): Rewrite.
7849 (Incremental_inputs::finalize): Do nothing but finalize string table.
7850 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7851 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7852 (Incremental_inputs::create_data_sections): New function.
7853 (Incremental_inputs::relocs_entsize): New function.
7854 (Output_section_incremental_inputs::set_final_data_size): New function.
7855 (Output_section_incremental_inputs::do_write): New function.
7856 (Output_section_incremental_inputs::write_header): New function.
7857 (Output_section_incremental_inputs::write_input_files): New function.
7858 (Output_section_incremental_inputs::write_info_blocks): New function.
7859 (Output_section_incremental_inputs::write_symtab): New function.
7860 * incremental.h (Incremental_script_entry): Forward declaration.
7861 (Incremental_object_entry): Forward declaration.
7862 (Incremental_archive_entry): Forward declaration.
7863 (Incremental_inputs): Forward declaration.
7864 (Incremental_inputs_header_data): Remove.
7865 (Incremental_inputs_header): Remove.
7866 (Incremental_inputs_header_write): Remove.
7867 (Incremental_inputs_entry_data): Remove.
7868 (Incremental_inputs_entry): Remove.
7869 (Incremental_inputs_entry_write): Remove.
7870 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7871 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7872 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7873 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7874 Likewise.
7875 (Incremental_input_entry): New class.
7876 (Incremental_script_entry): New class.
7877 (Incremental_object_entry): New class.
7878 (Incremental_archive_entry): New class.
7879 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7880 (Incremental_inputs::report_inputs): Remove.
7881 (Incremental_inputs::report_archive): Remove.
7882 (Incremental_inputs::report_archive_begin): New function.
7883 (Incremental_inputs::report_archive_end): New function.
7884 (Incremental_inputs::report_object): Change prototype.
7885 (Incremental_inputs::report_input_section): New function.
7886 (Incremental_inputs::report_script): Change prototype.
7887 (Incremental_inputs::get_reloc_count): New function.
7888 (Incremental_inputs::set_reloc_count): New function.
7889 (Incremental_inputs::create_data_sections): New function.
7890 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7891 (Incremental_inputs::inputs_section): New function.
7892 (Incremental_inputs::symtab_section): New function.
7893 (Incremental_inputs::relocs_section): New function.
7894 (Incremental_inputs::get_stringpool): Add const.
7895 (Incremental_inputs::command_line): Add const.
7896 (Incremental_inputs::inputs): Remove.
7897 (Incremental_inputs::command_line_key): New function.
7898 (Incremental_inputs::input_file_count): New function.
7899 (Incremental_inputs::input_files): New function.
7900 (Incremental_inputs::relocs_entsize): New function.
7901 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7902 (Incremental_inputs::finalize_inputs): Remove.
7903 (Incremental_inputs::Input_info): Remove.
7904 (Incremental_inputs::lock_): Remove.
7905 (Incremental_inputs::inputs_): Change type.
7906 (Incremental_inputs::inputs_map_): Remove.
7907 (Incremental_inputs::current_object_entry_): New data member.
7908 (Incremental_inputs::inputs_section_): New data member.
7909 (Incremental_inputs::symtab_section_): New data member.
7910 (Incremental_inputs::relocs_section_): New data member.
7911 (Incremental_inputs::reloc_count_): New data member.
7912 (Incremental_inputs_reader): New class.
7913 (Incremental_symtab_reader): New class.
7914 (Incremental_relocs_reader): New class.
7915 * layout.cc (Layout::finalize): Move finalization of incremental info
7916 and creation of incremental info sections to follow finalization of
7917 symbol table. Set offsets for postprocessing sections.
7918 (Layout::create_incremental_info_sections): Call
7919 Incremental_inputs::create_data_sections. Add incremental symtab
7920 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7921 sections to layout after input sections.
7922 * layout.h (struct Timespec): Forward declaration.
7923 (Layout::incremental_inputs): Add const.
7924 (Layout::create_incremental_info_sections): Add parameter.
7925 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7926 * object.cc: Include incremental.h.
7927 (Relobj::finalize_incremental_relocs): New function.
7928 (Sized_relobj::do_layout): Record input sections in incremental info.
7929 * object.h (Object::output_section): New function.
7930 (Object::output_section_offset): Moved from Relobj.
7931 (Object::get_incremental_reloc_base): New function.
7932 (Object::get_incremental_reloc_count): New function.
7933 (Object::do_output_section): New function.
7934 (Object::do_output_section_offset): Moved from Relobj.
7935 (Object::do_get_incremental_reloc_base): New function.
7936 (Object::do_get_incremental_reloc_count): New function.
7937 (Object::Object): Initialize new data members.
7938 (Relobj::output_section): Renamed do_output_section and moved to
7939 protected.
7940 (Relobj::output_section_offset): Moved to Object.
7941 (Relobj::do_get_incremental_reloc_base): New function.
7942 (Relobj::do_get_incremental_reloc_count): New function.
7943 (Relobj::allocate_incremental_reloc_counts): New function.
7944 (Relobj::count_incremental_reloc): New function.
7945 (Relobj::finalize_incremental_relocs): New function.
7946 (Relobj::next_incremental_reloc_index): New function.
7947 (Relobj::reloc_counts_): New data member.
7948 (Relobj::reloc_bases_): New data member.
7949 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7950 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7951 (Sized_relobj::incremental_relocs_scan): New function.
7952 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7953 (Sized_relobj::incremental_relocs_write): New function.
7954 (Sized_relobj::incremental_relocs_write_reltype): New function.
7955 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7956 incremental link.
7957 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7958 archives and object files elsewhere.
7959 (Add_symbols::run): Report object files here.
7960 (Finish_group::run): Report end of archive at end of group.
7961 * reloc.cc: Include layout.h, incremental.h.
7962 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7963 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7964 (Sized_relobj::incremental_relocs_scan): New function.
7965 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7966 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7967 (Sized_relobj::incremental_relocs_write): New function.
7968 (Sized_relobj::incremental_relocs_write_reltype): New function.
7969 * script.cc (read_input_script): Rewrite test for incremental link.
7970 Change call to Incremental_inputs::report_script.
7971 * symtab.h (Symbol_table::first_global_index): New function.
7972 (Symbol_table::output_count): New function.
7973
ce0d1972
DK
79742010-08-12 Doug Kwan <dougkwan@google.com>
7975
7976 * arm.cc (Target_arm::merge_object_attributes): Check command line
7977 options --no-wchar-size-warning and --no-enum-size-warning.
7978 * options.h (General_options): Add ld-compatible options
7979 --no-enum-size-warning and --no-wchar-size-warning.
7980
6e5710ce
ILT
79812010-08-04 Ian Lance Taylor <iant@google.com>
7982
7983 * x86_64.cc (Target_x86_64::Scan::local): Use
7984 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7985 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7986 (Target_x86_64::Scan::global): Likewise.
7987 (Target_x86_64::Relocate::relocate): Likewise.
7988 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7989 Likewise.
7990
fef830db
CC
79912010-08-03 Cary Coutant <ccoutant@google.com>
7992
7993 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7994 to reserve space in merged_strings vector. Keep total input size
7995 for stats.
7996 (Output_merge_string::do_print_merge_stats): Print total input size.
7997 * merge.h (Output_merge_string): Add input_size_ field.
7998 * stringpool.cc (Stringpool_template::string_length): Move
7999 implementations out of Stringpool_template class and place in
8000 stringpool.h.
8001 * stringpool.h (string_length): Move out of Stringpool_template.
8002
1e3811b0
ILT
80032010-08-03 Ian Lance Taylor <iant@google.com>
8004
8005 PR 11712
8006 * layout.cc (relaxation_loop_body): If address of load segment is
8007 set, adjust address to include headers if possible.
8008
7af0c620
ILT
80092010-08-03 Ian Lance Taylor <iant@google.com>
8010
8011 * version.cc (version_string): Bump to 1.10.
8012
22f0da72
ILT
80132010-08-03 Ian Lance Taylor <iant@google.com>
8014
8015 PR 11805
8016 * layout.h (enum Output_section_order): Define.
8017 (class Layout): Update declarations.
8018 * layout.cc (Layout::get_output_section): Add order parameter.
8019 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8020 is_first_non_relro parameters. Change all callers.
8021 (Layout::choose_output_section): Likewise.
8022 (Layout::add_output_section_data): Likewise.
8023 (Layout::make_output_section): Likewise. Set order.
8024 (Layout::default_section_order): New function.
8025 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8026 * output.cc (Output_section::Output_section): Initialize order_.
8027 Don't initialize deleted fields.
8028 (Output_segment::Output_segment): Don't initialize deleted
8029 fields.
8030 (Output_segment::add_output_section_to_load): New function
8031 replacing add_output_section. Change all callers to call this or
8032 add_output_section_to_nonload.
8033 (Output_segment::add_output_section_to_nonload): New function.
8034 (Output_segment::remove_output_section): Rewrite.
8035 (Output_segment::add_initial_output_data): Likewise.
8036 (Output_segment::has_any_data_sections): Likewise.
8037 (Output_segment::is_first_section_relro): Likewise.
8038 (Output_segment::maximum_alignment): Likewise.
8039 (Output_segment::has_dynamic_reloc): New function replacing
8040 dynamic_reloc_count. Change all callers.
8041 (Output_segment::has_dynamic_reloc_list): New function replacing
8042 dynamic_reloc_count_list. Change all callers.
8043 (Output_segment::set_section_addresses): Rewrite.
8044 (Output_segment::set_offset): Rewrite.
8045 (Output_segment::find_first_and_last_list): Remove.
8046 (Output_segment::set_tls_offsets): Rewrite.
8047 (Output_segment::first_section_load_address): Likewise.
8048 (Output_segment::output_section_count): Likewise.
8049 (Output_segment::section_with_lowest_load_address): Likewise.
8050 (Output_segment::write_section_headers): Likewise.
8051 (Output_segment::print_sections_to_map): Likewise.
8052 * output.h (class Output_data): Remove dynamic_reloc_count_
8053 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8054 (Output_data::add_dynamic_reloc): Rewrite.
8055 (Output_data::has_dynamic_reloc): New function.
8056 (Output_data::dynamic_reloc_count): Remove.
8057 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8058 is_last_relro_, is_first_non_relro_, is_interp_,
8059 is_dynamic_linker_section_ fields. Add order and set_order
8060 functions. Remove is_relro_local, set_is_relro_local,
8061 is_last_relro, set_is_last_relro, is_first_non_relro,
8062 set_is_first_non_relro functions, is_interp, set_is_interp,
8063 is_dynamic_linker_section, and set_is_dynamic_linker_section
8064 functions.
8065 (class Output_segment): Change Output_data_list from std::list to
8066 std:;vector. Add output_lists_ field. Remove output_data_ and
8067 output_bss_ fields. Update declarations.
8068
3ff2ccb0
ILT
80692010-08-02 Ian Lance Taylor <iant@google.com>
8070
8071 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8072 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8073 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8074
88a4108b
ILT
80752010-08-02 Ian Lance Taylor <iant@google.com>
8076
8077 PR 11855
8078 * script.cc (Script_options::Script_options): Initialize
8079 symbol_definitions_ and symbol_references_.
8080 (Script_options::add_symbol_assignment): Update
8081 symbol_definitions_ and symbol_references_.
8082 (Script_options::add_symbol_reference): New function.
8083 (script_symbol): New function.
8084 * script.h (class Script_options): Add symbol_definitions_ and
8085 symbol_references_ fields.
8086 (Script_options::referenced_const_iterator): New type.
8087 (Script_options::referenced_begin): New function.
8088 (Script_options::referenced_end): New function.
8089 (Script_options::is_referenced): New function.
8090 (Script_options::any_unreferenced): New function.
8091 * script-c.h (script_symbol): Declare.
8092 * yyscript.y (exp): Call script_symbol.
8093 * symtab.cc: Include "script.h".
8094 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8095 Change all callers. Check symbols referenced by scripts.
8096 (Symbol_table::add_undefined_symbols_from_command_line): Add
8097 layout parameter. Change all callers.
8098 (Symbol_table::do_add_undefined_symbols_from_command_line):
8099 Likewise. Break out loop body. Check symbols referenced by
8100 scripts.
8101 (Symbol_table::add_undefined_symbol_from_command_line): New
8102 function broken out of
8103 do_add_undefined_symbols_from_command_line.
8104 * symtab.h (class Symbol_table): Update declarations.
8105 * archive.cc: Include "layout.h".
8106 (Archive::should_include_member): Add layout parameter. Change
8107 all callers. Check for symbol mentioned in expression.
8108 * archive.h (class Archive): Update declaration.
8109 * object.cc (Sized_relobj::do_should_include_member): Add layout
8110 parameter.
8111 * object.h (Object::should_include_member): Add layout parameter.
8112 Change all callers.
8113 (Object::do_should_include_member): Add layout parameter.
8114 (class Sized_relobj): Update declaration.
8115 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8116 parameter.
8117 * dynobj.h (class Sized_dynobj): Update declaration.
8118 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8119 layout parameter.
8120 * plugin.h (class Sized_pluginobj): Update declaration.
8121
5f1ab67a
ILT
81222010-08-02 Ian Lance Taylor <iant@google.com>
8123
8124 PR 11866
8125 * output.cc (Output_segment::set_offset): Search for the first and
8126 last sections rather than assuming that the list is in order.
8127 (Output_segment::find_first_and_last_list): New function.
8128 * output.h (class Output_segment): Update declarations.
8129 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8130 (relro_strip_test_SOURCES): New variable.
8131 (relro_strip_test_DEPENDENCIES): New variable.
8132 (relro_strip_test_LDFLAGS): New variable.
8133 (relro_strip_test_LDADD): New variable.
8134 (relro_strip_test.so): New target.
8135
a8df5856
ILT
81362010-08-02 Ian Lance Taylor <iant@google.com>
8137
8138 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8139 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8140 (Target_i386::got_tlsdesc_section): New function.
8141 (Target_i386::got_section): Create space for GOT entries for
8142 TLSDESC relocations.
8143 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8144 R_386_TLS_GOTDESC.
8145 (Target_i386::Scan::global): Likewise.
8146 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8147 using TLSDESC GOT.
8148 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8149 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8150 (Target_x86_64::got_tlsdesc_section): New function.
8151 (Target_x86_64::got_section): Create space for GOT entries for
8152 TLSDESC relocations.
8153 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8154 R_386_TLS_GOTDESC.
8155 (Target_x86_64::Scan::global): Likewise.
8156 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8157 using TLSDESC GOT.
8158
0c10a0a6
ILT
81592010-08-02 Ian Lance Taylor <iant@google.com>
8160
8161 * testsuite/final_layout.sh: Use dc to convert from hex to
8162 decimal.
8163
41cbeecc
ST
81642010-07-29 Sriraman Tallam <tmsriram@google.com>
8165
8166 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8167 paramter to the call to gold::gc_process_relocs.
8168 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8169 paramter to the call to gold::gc_process_relocs.
8170 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8171 parameter to the call to gold::gc_process_relocs.
8172 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8173 template parameter to the call to gold::gc_process_relocs.
8174 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8175 paramter to the call to gold::gc_process_relocs.
8176 * gc.h (get_embedded_addend_size): New function.
8177 (gc_process_relocs): Save the size of the reloc for use by ICF.
8178 * icf.cc (get_section_contents): Get the addend from the text section
8179 for SHT_REL relocation sections.
8180 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8181 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8182 * int_encoding.h (read_from_pointer): New overloaded function.
8183 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8184 * testsuite/icf_sht_rel_addend_test.sh: New file.
8185 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8186 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8187
6ea55b82
RW
81882010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8189
8190 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8191 * Makefile.in: Regenerate.
8192 * testsuite/Makefile.in: Regenerate.
8193
9691462b
ILT
81942010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8195
8196 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8197 * gold/testsuite/debug_msg.cc: Likewise.
8198 * gold/testsuite/odr_violation1.cc
8199 * gold/testsuite/odr_violation2.cc
8200
76897331
CC
82012010-07-21 Cary Coutant <ccoutant@google.com>
8202
8203 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8204 string, and length fields.
8205 (Output_merge_string::Merged_strings_list): New type.
8206 (Output_merge_string::Merged_strings_lists): New typedef.
8207 (Output_merge_string): Replace merged_strings_ with
8208 merged_strings_lists_.
8209 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8210 Merged_strings_list per input object and section. Don't store pointer
8211 to the string. Don't store length with each merged string entry.
8212 (Output_merge_string::finalize_merged_data): Loop over list of merged
8213 strings lists. Recompute length of each merged string.
8214
78384e8f
CC
82152010-07-15 Cary Coutant <ccoutant@google.com>
8216
8217 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8218 here.
8219
783659f9
ILT
82202010-07-14 Ian Lance Taylor <iant@google.com>
8221
8222 * descriptors.cc (Descriptors::open): Report correct name in error
8223 message.
8224
131687b4
DK
82252010-07-13 Doug Kwan <dougkwan@google.com>
8226
8227 * arm.cc (Arm_input_section::Arm_input_section): For a
8228 SHT_ARM_EXIDX section, always keeps the input sections.
8229 (Arm_input_section::set_exidx_section_link): New method.
8230 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8231 has_errors_ to false.
8232 (Arm_exidx_input_section::has_errors,
8233 Arm_exidx_input_section::set_has_errors): New methods.
8234 (Arm_exidx_input_section::has_errors_): New data member.
8235 (Arm_relobj::get_exidx_shndx_list): New method.
8236 (Arm_output_section::append_text_sections_to_list): Do not skip
8237 section without SHF_EXECINSTR.
8238 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8239 errors.
2e702c99 8240 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8241 section header. Make error messages more verbose. Check for
8242 a non-executable section linked to an EXIDX section.
8243 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8244 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8245 check that there is no deferred EXIDX section if we exit early.
8246 Instead of not making an EXIDX section in case of an error, make one
8247 and set the has_errors flag of it.
8248 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8249 in a relocatable link.
8250 (Target_arm::do_relax): Look for the EXIDX output section instead of
8251 assuming that it is called .ARM.exidx.
2e702c99 8252 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8253 section list. Do not check for SHF_EXECINSTR section flags but
8254 skip any input section with errors.
8255 * output.cc (Output_section::Output_section): Initialize
8256 always_keeps_input_sections_ to false.
8257 (Output_section::add_input_section): Check for
8258 always_keeps_input_sections_.
8259 * output.h (Output_section::always_keeps_input_sections,
8260 Output_section::set_always_keeps_input_sections): New methods.
8261 (Output_section::always_keeps_input_sections): New data member.
8262
69517287
RÁE
82632010-07-13 Rafael Espindola <espindola@google.com>
8264
8265 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8266 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8267
82742395
ILT
82682010-07-13 Philip Herron <herron.philip@googlemail.com>
8269 Ian Lance Taylor <iant@google.com>
8270
8271 * output.h (Output_section_lookup_maps::add_merge_section):
8272 Correct check of whether value was inserted.
8273 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8274 (Output_section_lookup_maps::add_relaxed_input_section):
8275 Likewise.
8276 * arm.cc (Target_arm::got_section): Remove used local os.
8277 * i386.cc (Target_i386::got_section): Likewise.
8278 * x86_64.cc (Target_x86_64::got_section): Likewise.
8279 * sparc.cc (Target_sparc::got_section): Likewise.
8280 (Target_sparc::relocate): Remove unused local have_got_offset.
8281 * powerpc.cc (Target_powerpc::relocate): Likewise.
8282
f2d707b5
ILT
82832010-07-13 Ian Lance Taylor <iant@google.com>
8284
241531d6
ILT
8285 * compressed_output.cc (zlib_decompress): Fix signature in
8286 !HAVE_ZLIB_H case.
8287
f2d707b5
ILT
8288 * archive.cc (Archive::include_member): Unlock an external member
8289 of a thin archive. Don't bother to delete an object we know is
8290 NULL.
8291
a2e47362
CC
82922010-07-12 Cary Coutant <ccoutant@google.com>
8293
8294 * compressed_output.cc (zlib_decompress): New function.
8295 (get_uncompressed_size): New function.
8296 (decompress_input_section): New function.
8297 * compressed_output.h (get_uncompressed_size): New function.
8298 (decompress_input_section): New function.
8299 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8300 Handle compressed debug sections.
8301 * layout.cc (is_compressed_debug_section): New function.
8302 (Layout::output_section_name): Map compressed section names to
8303 canonical names.
8304 * layout.h (is_compressed_debug_section): New function.
8305 (is_debug_info_section): Recognize compressed debug sections.
8306 * merge.cc: Include compressed_output.h.
8307 (Output_merge_data::do_add_input_section): Handle compressed
8308 debug sections.
8309 (Output_merge_string::do_add_input_section): Handle compressed
8310 debug sections.
8311 * object.cc: Include compressed_output.h.
8312 (Sized_relobj::Sized_relobj): Initialize new data members.
8313 (build_compressed_section_map): New function.
8314 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8315 * object.h (Object::section_is_compressed): New method.
8316 (Object::do_section_is_compressed): New method.
8317 (Sized_relobj::Compressed_section_map): New type.
8318 (Sized_relobj::do_section_is_compressed): New method.
8319 (Sized_relobj::compressed_sections_): New data member.
8320 * output.cc (Output_section::add_input_section): Handle compressed
8321 debug sections.
8322 * reloc.cc: Include compressed_output.h.
8323 (Sized_relobj::write_sections): Handle compressed debug sections.
8324
ce279a62
CC
83252010-07-08 Cary Coutant <ccoutant@google.com>
8326
8327 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8328 weak when resolving to a dynamic def.
8329 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8330 for weak undef/dynamic def cases. Adjust callers.
8331 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8332 undef_binding_weak_.
8333 (Symbol_table::sized_write_globals): Adjust symbol binding.
8334 (Symbol_table::sized_write_symbol): Add binding parameter.
8335 * symtab.h (Symbol::set_undef_binding): New method.
8336 (Symbol::is_undef_binding_weak): New method.
8337 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8338 (Symbol_table::should_override): Add new parameter.
8339 (Symbol_table::sized_write_symbol): Add new parameter.
8340
8341 * testsuite/weak_undef_file1.cc: Add new test case.
8342 * testsuite/weak_undef_file2.cc: Fix header comment.
8343 * testsuite/weak_undef_test.cc: Add new test case.
8344
b2286c10
DK
83452010-06-29 Doug Kwan <dougkwan@google.com>
8346
8347 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8348 Initialize USE_SYMBOL_.
8349 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8350 definition.
8351 (Arm_reloc_property::uses_symbol_): New data member declaration.
8352 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8353 uses symbol value and symbol is undefined but not weakly undefined.
8354
4802450a
RÁE
83552010-06-28 Rafael Espindola <espindola@google.com>
8356
8357 * plugin.cc (Plugin::load): Use dlerror.
8358
e5ca47ba
ILT
83592010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8360
8361 * symtab.cc (detect_odr_violations): When reporting an ODR
8362 violation, report an object where the symbol is defined.
8363
8a75a161
DK
83642010-06-25 Doug Kwan <dougkwan@google.com>
8365
8366 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8367 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8368 definition.
8369 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8370 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8371 target hook to detect function points.
8372 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8373 * icf.h (Icf::check_section_for_function_pointers): Change type of
8374 parameter SECTION_NAME to const reference to std::string. Use
8375 target hook to determine if section may have unsafe pointers.
8376 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8377 method definition.
8378
42218b9f
RÁE
83792010-06-21 Rafael Espindola <espindola@google.com>
8380
8381 * fileread.cc (Input_file::find_fie): New
8382 (Input_file::open): Use Input_file::find_fie.
8383 * fileread.h (Input_file::find_fie): New
8384 * plugin.cc (set_extra_library_path): New.
8385 (Plugin::load): Add set_extra_library_path to the transfer vector.
8386 (Plugin_manager::set_extra_library_path): New.
8387 (Plugin_manager::add_input_file): Use the extra search path if set.
8388 (set_extra_library_path(): New.
8389 * plugin.h (Plugin_manager): Add set_extra_library_path and
8390 extra_search_path_.
8391
a0506cca
CC
83922010-06-19 Cary Coutant <ccoutant@google.com>
8393
8394 * layout.cc (gdb_sections): Add .debug_types.
8395 (lines_only_debug_sections): Likewise.
8396
6508b958
RÁE
83972010-06-18 Rafael Espindola <espindola@google.com>
8398
8399 * plugin.cc (add_input_file,add_input_library)
8400 (Plugin_manager::add_input_file): Make filename arguments const.
8401 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8402 const.
8403
3e235302
DK
84042010-06-16 Doug Kwan <dougkwan@google.com>
8405
8406 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8407 .ARM.attributes section if we have not merged any input
8408 attributes sections.
8409
106e8a6c
DK
84102010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8411
8412 * arm.cc: Allow combining objects with no EABI version
8413 information.
8414
91ff43fe
RÁE
84152010-06-15 Rafael Espindola <espindola@google.com>
8416
8417 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8418
68ed838c
ILT
84192010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8420
8421 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8422 (struct iovec): Correct !HAVE_READV definition.
8423
f3a2388f
CC
84242010-06-10 Cary Coutant <ccoutant@google.com>
8425
8426 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8427 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8428 reloc sections.
8429 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8430
8431 PR 11683
8432 * symtab.h (Symbol::is_placeholder): New member function.
8433 * target-reloc.h (relocate_section): Check for placeholder symbols.
8434
8435 * testsuite/Makefile.am (plugin_test_8): New test.
8436 (plugin_test_9): New test.
8437 * testsuite/Makefile.in: Regenerate.
8438
e1df38aa
NC
84392010-06-09 Nick Clifton <nickc@redhat.com>
8440
8441 * yyscript.y (input_list_element): Allow strings prefixed with
8442 the '-' character. Treat these as libraries.
8443 * script.cc (script_add_library): New function. Adds a library
8444 specified by "-l<name>" found in an input script.
8445 * script-c.h: Add prototype for script_add_library.
8446
25bbe950
DK
84472010-06-07 Doug Kwan <dougkwan@google.com>
8448
8449 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8450 Restrict stub-group size to be within long conditional branch
8451 range when working around cortex-A8 erratum.
8452
0f32ea4c
ILT
84532010-06-07 Damien Diederen <dd@crosstwine.com>
8454
8455 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8456 #ifdef typo.
8457
8fe2a369
ST
84582010-06-03 Sriraman Tallam <tmsriram@google.com>
8459
8460 PR gold/11658
8461 * output.cc
8462 (Output_section::Input_section_sort_entry::compare_section_ordering):
8463 Change to return non-zero correctly.
8464 (Output_section::Input_section_sort_section_order_index_compare
8465 ::operator()): Change to fix ambiguity in comparisons.
8466
6e9ba2ca
ST
84672010-06-01 Sriraman Tallam <tmsriram@google.com>
8468
8469 * gold.h (is_wildcard_string): New function.
8470 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8471 (Layout::layout_eh_frame): Ditto.
8472 (Layout::find_section_order_index): New method.
8473 (Layout::read_layout_from_file): New method.
8474 * layout.h (Layout::find_section_order_index): New method.
8475 (Layout::read_layout_from_file): New method.
8476 (Layout::input_section_position_): New private member.
8477 (Layout::input_section_glob_): New private member.
8478 * main.cc (main): Call read_layout_from_file here.
8479 * options.h (--section-ordering-file): New option.
8480 * output.cc (Output_section::input_section_order_specified_): New
8481 member.
8482 (Output_section::Output_section): Initialize new member.
8483 (Output_section::add_input_section): Add new parameter.
8484 Keep input sections when --section-ordering-file is used.
8485 (Output_section::set_final_data_size): Sort input sections when
8486 section ordering file is specified.
8487 (Output_section::Input_section_sort_entry): Add new parameter.
8488 Check sorting type.
8489 (Output_section::Input_section_sort_entry::compare_section_ordering):
8490 New method.
8491 (Output_section::Input_section_sort_compare::operator()): Change to
8492 consider section_order_index.
8493 (Output_section::Input_section_sort_init_fini_compare::operator()):
8494 Change to consider section_order_index.
8495 (Output_section::Input_section_sort_section_order_index_compare
8496 ::operator()): New method.
8497 (Output_section::sort_attached_input_sections): Change to sort
8498 according to section order when specified.
e1df38aa
NC
8499 (Output_section::add_input_section<32, true>): Add new parameter.
8500 (Output_section::add_input_section<64, true>): Add new parameter.
8501 (Output_section::add_input_section<32, false>): Add new parameter.
8502 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8503 * output.h (Output_section::add_input_section): Add new parameter.
8504 (Output_section::input_section_order_specified): New
8505 method.
8506 (Output_section::set_input_section_order_specified): New method.
8507 (Input_section::Input_section): Initialize section_order_index_.
8508 (Input_section::section_order_index): New method.
8509 (Input_section::set_section_order_index): New method.
8510 (Input_section::section_order_index_): New member.
8511 (Input_section::Input_section_sort_section_order_index_compare): New
8512 struct.
8513 (Output_section::input_section_order_specified_): New member.
8514 * script-sections.cc (is_wildcard_string): Delete and move modified
8515 method to gold.h.
8516 (Output_section_element_input::Output_section_element_input): Modify
8517 call to is_wildcard_string.
8518 (Output_section_element_input::Input_section_pattern
8519 ::Input_section_pattern): Ditto.
8520 (Output_section_element_input::Output_section_element_input): Ditto.
8521 * testsuite/Makefile.am (final_layout): New test case.
8522 * testsuite/Makefile.in: Regenerate.
8523 * testsuite/final_layout.cc: New file.
8524 * testsuite/final_layout.sh: New file.
8525
3537c84b
RÁE
85262010-06-01 Rafael Espindola <espindola@google.com>
8527
8528 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8529
105b6afd
RÁE
85302010-06-01 Rafael Espindola <espindola@google.com>
8531
8532 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8533 visibility of symbols.
8534
29e11421
DK
85352010-05-27 Doug Kwan <dougkwan@google.com>
8536
8537 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8538 from start of output section instead of address for a local symbol
8539 in a merged or relaxed section when doing a relocatable link.
8540
5e0f337e
RÁE
85412010-05-26 Rafael Espindola <espindola@google.com>
8542
703d02da 8543 PR 11604
5e0f337e
RÁE
8544 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8545 adding sections the garbage collector removed.
8546 * gold/testsuite/Makefile.am: Add test.
8547 * gold/testsuite/Makefile.in: Regenerate.
8548 * gold/testsuite/plugin_test_7.sh: New.
8549 * gold/testsuite/plugin_test_7_1.c: New.
8550 * gold/testsuite/plugin_test_7_2.c: New.
8551
f4187277
RÁE
85522010-05-26 Rafael Espindola <espindola@google.com>
8553
8554 * script-sections.cc (Output_section_definition::set_section_addresses):
8555 Check for --section-start.
8556
5c388529
DK
85572010-05-26 Doug Kwan <dougkwan@google.com>
8558
8559 * arm.cc (Arm_scan_relocatable_relocs): New class.
8560 (Target_arm::relocate_special_relocatable): New method.
8561 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8562 (Arm_relocate_functions::thumb_branch_common): Same.
8563 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8564 instead of Default_scan_relocatable_relocs.
8565 * target-reloc.h (relocate_for_relocatable): Let target handle
8566 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8567 * target.h (Sized_target::relocate_special_relocatable): New method.
8568
bca1c3ae
ILT
85692010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8570
8571 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8572
0439c796
DK
85732010-05-23 Doug Kwan <dougkwan@google.com>
8574
8575 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8576 instead of a cast.
8577 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8578 with a direct branch, not a conditional branch, to a stub.
8579 * merge.cc (Output_merge_base::record_input_section): New method
8580 defintion.
8581 (Output_merge_data::do_add_input_section): Record input section if
8582 keeps-input-sections flag is set.
8583 (Output_merge_string::do_add_input_section): Ditto.
8584 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8585 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8586 INPUT_SECTIONS_.
8587 (Output_merge_base::keeps_input_sections,
8588 Output_merge_base::set_keeps_input_sections,
8589 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8590 method definitions.
8591 (Output_merge_base::Input_sections): New type declaration.
8592 (Output_merge_base::input_sections_begin,
8593 Output_merge_base::input_sections_end,
8594 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8595 (Output_merge_base::bool keeps_input_sections_,
8596 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8597 Output_merge_base::input_sections_): New data members.
8598 (Output_merge_data::do_set_keeps_input_sections): New method
8599 defintion.
8600 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8601 * output.cc (Output_section::Input_section::relobj): Move method
8602 defintion from class declaration to here and handle merge sections.
8603 (Output_section::Input_section::shndx): Ditto.
8604 (Output_section::Output_section): Remove initializations of removed
8605 data members and initialize new data member LOOKUP_MAPS_.
8606 (Output_section::add_input_section): Set keeps-input-sections flag
8607 for a newly created merge output section as appropriate. Adjust code
8608 to use Output_section_lookup_maps class.
8609 (Output_section::add_relaxed_input_section): Adjst code for lookup
8610 maps code refactoring.
2e702c99 8611 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8612 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8613 class. If adding input section to a newly created merge output
8614 section fails, remove the new merge section.
8615 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8616 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8617 (Output_section::find_merge_section): Ditto.
0439c796 8618 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8619 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8620 Output_section_lookup_maps class.
8621 (Output_section::get_input_sections): Export merge sections. Adjust
8622 code to use Output_section_lookup_maps class.
8623 (Output_section:::add_script_input_section): Adjust code to use
8624 Output_section_lookup_maps class. Update lookup maps for merge
8625 sections also.
8626 (Output_section::discard_states): Use Output_section_lookup_maps.
8627 (Output_section::restore_states): Same.
8628 * output.h (Merge_section_properties): Move class defintion out of
8629 Output_section.
8630 (Output_section_lookup_maps): New class.
8631 (Output_section::Input_section::is_merge_section): New method
8632 defintion.
8633 (Output_section::Input_section::relobj): Move defintion out of class
8634 defintion. Declare method only.
8635 (Output_section::Input_section::shndx): Ditto.
8636 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8637 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8638 (Output_section::Merge_section_by_properties_map,
8639 Output_section::Output_section_data_by_input_section_map,
8640 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8641 Remove types.
2e702c99 8642 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8643 KEEPS_INPUT_SECTIONS.
8644 (Output_section::build_lookup_maps): New method declaration.
8645 (Output_section::merge_section_map_,
8646 Output_section::merge_section_by_properties_map_,
8647 Output_section::relaxed_input_section_map_,
8648 Output_section::is_relaxed_input_section_map_valid_): Remove data
8649 members.
8650 (Output_section::lookup_maps_): New data member.
8651
76295588
L
86522010-05-21 Doug Kwan <dougkwan@google.com>
8653
8654 PR gold/11619
8655 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8656 avoid a compilation error.
8657
d103a984
RÁE
86582010-05-19 Rafael Espindola <espindola@google.com>
8659
8660 * script-sections.cc (Output_section_definition::allocate_to_segment):
8661 Update the phdrs_list even when the output section is NULL.
8662 * testsuite/Makefile.am: Add test.
8663 * testsuite/Makefile.in: Regenerate.
8664 * testsuite/script_test_9.cc: New.
8665 * testsuite/script_test_9.sh: New.
8666 * testsuite/script_test_9.t: New.
8667
6625d24e
DK
86682010-05-19 Doug Kwan <dougkwan@google.com>
8669
8670 * arm.cc (Arm_input_section::original_size): New method.
8671 (Arm_input_section::do_addralign): Add a cast.
8672 (Arm_input_section::do_output_offset): Remove static cast.
8673 (Arm_input_section::original_addralign,
8674 Arm_input_section::original_size_): Change type to uint32_t.
8675 (Arm_input_section::init): Add safe casts for section alignment
8676 and size.
8677 (Arm_input_section::set_final_data_size): Do not set address and
8678 offset of stub table.
8679 (Arm_output_section::fix_exidx_coverage): Change use of of
8680 Output_section::Simple_input_section to that of
8681 Output_section::Input_section.
8682 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8683 except for the first pass.
8684 * output.cc (Output_section::get_input_sections): Change type of
8685 input_sections to std::list<Input_section>.
8686 (Output_section::add_script_input_section): Rename from
8687 Output_section::add_simple_input_section. Change type of SIS
8688 parameter from Simple_input_section to Input_section.
8689 * output.h (Output_section::Simple_input_section): Remove class.
8690 (Output_section::Input_section): Change class visibility to public.
8691 (Output_section::Input_section::addralign): Use stored alignments
8692 for special input sections if set.
8693 (Output_section::Input_section::set_addralign): New method.
8694 (Output_section::get_input_sections): Change parameter type from
8695 list of Simple_input_section to list of Input_section.
8696 (Output_section::add_script_input_section): Rename from
8697 Output_section::add_simple_input_section. Change first parameter's
8698 type from Simple_input_section to Input_section and remove the
8699 second and third parameters.
8700 * script-sections.cc (Input_section::Input_section_list): Change
8701 type to list of Output_section::Input_section/
8702 (Input_section_info::Input_section_info): Change parameter type of
8703 INPUT_SECTION to Output_section::Input_section.
8704 (Input_section_info::input_section): Change return type.
8705 (Input_section_info::input_section_): Change type to
8706 Output_section::Input_section.
8707 (Output_section_element_input::set_section_addresses): Adjust code
8708 to use Output_section::Input_section instead of
8709 Output_section::Simple_input_section. Adjust code for renaming
8710 of Output_section::add_simple_input_section.
8711 (Orphan_output_section::set_section_addresses): Ditto.
8712
e1e82ea4
RW
87132010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8714
8715 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8716 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8717
91e75c8a
RÁE
87182010-05-18 Rafael Espindola <espindola@google.com>
8719
8720 * options.cc (General_options::finalize): Handle -nostdlib.
8721 * options.h (nostdlib): New option.
8722 * script.cc (script_add_search_dir): Handle -nostdlib.
8723
da59ad79
DK
87242010-05-12 Doug Kwan <dougkwan@google.com>
8725
8726 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8727 attributes section only if there no attributes section after merging.
8728 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8729 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8730 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8731 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8732 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8733 and arm_attr_merge_7.stdout.
8734 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8735 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8736 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8737 arm_attr_merge_7b.o): New rules.
8738 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8739 arm_attr_merge_7
8740 * testsuite/Makefile.in: Regenerate.
8741 * testsuite/arm_attr_merge.sh: New file.
8742 * testsuite/arm_attr_merge_[67][ab].s: Same.
8743
3e01a7fd
NC
87442010-05-05 Nick Clifton <nickc@redhat.com>
8745
8746 * po/es.po: Updated Spanish translation.
8747
7ad2014a
L
87482010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8749
8750 * Makefile.am (install-exec-local): Properly install gold as
8751 default cross linker.
8752 * Makefile.in: Regenerated.
8753
4fda8867
NC
87542010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8755 Nick Clifton <nickc@redhat.com>
8756
8757 * configure.ac (install_as_default): Define and set to false
8758 unless --enable-gold or --enable-gold=both/gold has been
8759 specified.
8760 * configure: Regenerate.
8761
8762 * Makefile.am (install-exec-local): Install the executable as
8763 'ld.gold'. If install_as_default is true then also install it as
8764 'ld'.
8765 * Makefile.in: Regenerated.
8766
bd288ea2
ILT
87672010-04-24 Ian Lance Taylor <iant@google.com>
8768
8769 * layout.cc (Layout::layout_reloc): In relocatable link don't
8770 combine reloc sections for grouped sections.
8771
ef38fd8a
ST
87722010-04-23 Sriraman Tallam <tmsriram@google.com>
8773
8774 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8775 sections that are not ordinary to icf.
8776 * icf.cc (get_section_contents): Handle relocation pointing to section
8777 with no object or shndx information.
8778 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8779 * testsuite/Makefile.in: Regenerate.
8780 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8781 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8782
f6973bdc
ILT
87832010-04-22 Ian Lance Taylor <iant@google.com>
8784
8785 * expression.cc (Expression::Expression_eval_info): Add
8786 result_alignment_pointer field.
8787 (Expression::eval_with_dot): Add result_alignment_pointer
8788 parameter. Change all callers.
8789 (Expression::eval_maybe_dot): Likewise.
8790 (class Binary_expression): Add alignment_pointer parameter to
8791 left_value and right_value. Change all callers.
8792 (BINARY_EXPRESSION): Set result alignment.
8793 (class Trinary_expression): Add alignment_pointer parameter to
8794 arg2_value and arg3_value. Change all callers.
8795 (Trinary_cond::value): Set result alignment.
8796 (Max_expression::value, Min_expression::value): Likewise.
8797 (Align_expression::value): Likewise.
8798 * script-sections.cc (class Sections_element): Add dot_alignment
8799 parameter to set_section_addresses virtual function. Update
8800 instantiations.
8801 (class Output_section_element): Likewise.
8802 (Script_sections::create_segments): Add dot_alignment parameter.
8803 Change all callers.
8804 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8805 (Script_sections::set_phdrs_clause_addresses): Likewise.
8806 * script-sections.h: Update declarations.
8807 * script.h: Update declarations.
8808 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8809 min_p_align.
8810 * testsuite/script_test_3.t: Set large alignment.
8811 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8812 segment has expected alignment.
8813
9c9c98a5
NC
88142010-04-22 Nick Clifton <nickc@redhat.com>
8815
8816 * po/gold.pot: Updated by the Translation project.
8817 * po/vi.po: Updated Vietnamese translation.
8818
2253bfba
L
88192010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8820
8821 * testsuite/Makefile.am (check_PROGRAMS): Add
8822 icf_virtual_function_folding_test.
8823 * testsuite/Makefile.in: Regenerated.
8824
85fdf906
AH
88252010-04-15 Andrew Haley <aph@redhat.com>
8826
8827 * options.h (merge_exidx_entries): New option.
8828 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8829 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8830 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8831 (Target_arm::merge_exidx_entries): New function.
8832 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8833 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8834 to Arm_exidx_fixup constructor.
8835 Add new arg, merge_exidx_entries.
8836 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8837 Arm_output_section::fix_exidx_coverage.
8838
ce97fa81
ST
88392010-04-18 Sriraman Tallam <tmsriram@google.com>
8840
8841 * icf.cc (get_section_contents): Check for preemptible functions.
8842 Ignore addend when appropriate.
8843 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8844 section folded.
8845 (add_from_relobj): Check for section folded.
8846 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8847 * symtab.h (should_add_dynsym_entry): Add new parameter.
8848 * target-reloc.h (scan_relocs): Check for section folded.
8849 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8850 Check reloc types for function pointers in shared objects.
8851 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8852 case.
8853 (icf_preemptible_functions_test): New test case.
8854 (icf_string_merge_test): New test case.
8855 * testsuite.Makefile.in: Regenerate.
8856 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8857 bar_glob. Refactor code.
8858 * testsuite/icf_preemptible_functions_test.cc: New file.
8859 * testsuite/icf_preemptible_functions_test.sh: New file.
8860 * testsuite/icf_string_merge_test.cc: New file.
8861 * testsuite/icf_string_merge_test.sh: New file.
8862 * testsuite/icf_virtual_function_folding_test.cc: New file.
8863 * testsuite/icf_virtual_function_folding_test.sh: New file.
8864
04ceb17c
DK
88652010-04-14 Doug Kwan <dougkwan@google.com>
8866
8867 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8868 for local symbol recounting if we remove a section due to ICF.
8869 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8870 there are no regular objects in input.
8871
153e7da4
DK
88722010-04-13 Doug Kwan <dougkwan@google.com>
8873
8874 * arm.cc (Arm_input_section::set_final_data_size): Compute
8875 accurate final data size instead of using current data size.
8876
4dbd9faf
DK
88772010-04-09 Doug Kwan <dougkwan@google.com>
8878
8879 * layout.cc (Layout::choose_output_section): Handle script section
8880 types.
8881 (Layout::make_output_section_for_script): Add section type parameter.
8882 Handle script section types.
8883 * layout.h (Layout::make_output_section_for_script): Add section
8884 type parameter.
8885 * output.cc (Output_section::Output_section): Initialize data member
8886 is_noload_.
8887 (Output_section::do_reset_address_and_file_offset): Do not set address
8888 to 0 if section is a NOLOAD section.
8889 * output.h (Output_section::is_noload): New method.
8890 (Output_section::set_is_noload): Ditto.
8891 (Output_section::is_noload_): New data member.
8892 * script-c.h (Script_section_type): New enum type.
8893 (struct Parser_output_section_header): Add new file section_type.
8894 * script-sections.cc (Sections_element::output_section_name): Add
8895 parameter for returning script section type.
8896 (Output_section_definition::output_section_name): Ditto.
8897 (Output_section_definition::section_type)P; New method.
8898 (Output_section_definiton::script_section_type_name): Ditto.
8899 (Output_section_definition::script_section_type_): New data member.
8900 (Output_section_definition::Output_section_definition): Initialize
8901 data member Output_section_definition::script_section_type_.
8902 (Output_section_definition::create_sections): Pass script section type
8903 to Layout::make_output_section_for_script.
8904 (Output_section_definition::output_section_name): Return script
8905 section type to caller.
8906 (Output_section_definition::set_section_address): Do not advance
8907 dot value and load address if section type is NOLOAD. Set address
8908 of NOLOAD sections regardless of section flags.
8909 (Output_section_definition::print): Print section type if it is
8910 not SCRIPT_SECTION_TYPE_NONE.
8911 (Output_section_definition::section_type): New method.
8912 (Output_section_definition::script_section_type_name): Ditto.
8913 (Script_sections::output_section_name): Add new parameter
8914 PSECTION_TYPE for returning script section type. Pass it to
8915 section elements. Handle discard sections.
8916 (Sort_output_sections::operator()): Handle NOLOAD sections.
8917 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8918 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8919 returning script section type.
8920 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8921 INFO and NOLOAD.
8922 * yyscript.y (union): Add new field SECTION_TYPE.
8923 (COPY, DSECT, INFO, NOLOAD): New tokens.
8924 (opt_address_and_section_type): Change type to output_section_header.
8925 (section_type): New non-terminal
8926 (section_header): Handle section type.
2253bfba 8927 (opt_address_and_section_type): Return section type value.
4dbd9faf 8928
721ea635
L
89292010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8930
8931 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8932 * testsuite/plugin_common_test_2.c (foo): Likewise.
8933
6bf924b0
DK
89342010-04-08 Doug Kwan <dougkwan@google.com>
8935
8936 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8937 Output_merge_data.
8938 * output.cc (Output_section::add_merge_input_section): Simplify
8939 code and return status of Output_merge_base::add_input_section.
e1df38aa 8940 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8941 returns true.
8942
24af6f92
DK
89432010-04-07 Doug Kwan <dougkwan@google.com>
8944
8945 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8946 if section is marked as containing instructions but has no mapping
8947 symbols.
8948 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8949 correct section index.
8950 (Arm_relobj::find_linked_text_section): Ditto.
8951
00698fc5
CC
89522010-04-07 Cary Coutant <ccoutant@google.com>
8953
8954 * archive.cc (include_member): Destroy Read_symbols_data object before
8955 releasing file.
8956 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8957 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8958 (Read_symbols_data::~Read_symbols_data) New destructor.
8959 (Section_relocs::Section_relocs) New constructor.
8960 (Section_relocs::~Section_relocs) New destructor.
8961 (Read_relocs_data::Read_relocs_data) New constructor.
8962 (Read_relocs_data::~Read_relocs_data) New destructor.
8963 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8964 pointers to NULL after deleting.
8965
7296d933
DK
89662010-04-07 Doug Kwan <dougkwan@google.com>
8967
8968 * arm.cc: Replace "endianity" with "endianness" in comments.
8969 (Arm_exidx_cantunwind): Ditto.
8970 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8971 (Arm_relobj::merge_flags_and_attributes): New method.
8972 (Arm_relobj::merge_flags_and_attributes_): New data member.
8973 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8974 (Arm_relobj::scan_sections_for_stubs): Ditto.
8975 (Arm_relobj::do_read_symbols): Check to see if we really want to
8976 merge processor-specific flags and attributes. Exit early if
8977 an object is empty except for section names and the undefined symbol.
8978 (Target_arm::do_finalize_sections): Move check for ELF format to
8979 Arm_relobj::do_read_symbols. Merge processor specific flags and
8980 attributes from a regular object only when we have determined that
8981 it is aapropriate. Do not create an .ARM.attributes section in
8982 output if there is no regular input object.
8983 (Target_arm::merge_processor_specific_flags): Check
8984 --warn-mismatch before printing any error.
8985 (Target_arm::merge_object_attributes): Ditto.
8986 * gold.cc (queue_middle_tasks): Handle the case in which there is
8987 no regular object in input.
8988 * options.cc (General_options::parse_EB): New method.
8989 (General_options::parse_EL): Same.
8990 (General_options::General_options): Initialize endianness_.
8991 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8992 New options.
8993 (General_options::Endianness): New enum.
8994 (General_options::endianness): New method.
8995 (General_options::endianness_): New data member.
8996 * parameters.cc (Parameters::set_options): Check target endianness.
8997 (Parameters::set_target_once): Ditto.
8998 (Parameters::check_target_endianness): New method.
8999 (parameters_force_valid_target): If either -EL or -EB is specified,
9000 use it to define endianness of default target.
9001 * parameters.h (Parameters::check_target_endianness): New method
9002 declaration.
9003 * target.h (class Target): Change "endianity" to "endianness"
9004 in comments.
9005
efc8d4f2
RW
90062010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9007
9008 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9009 * configure: Regenerate.
9010 * Makefile.in: Regenerate.
9011 * testsuite/Makefile.in: Regenerate.
9012
be234d88
CC
90132010-04-06 Cary Coutant <ccoutant@google.com>
9014
9015 gcc PR lto/42757
9016 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9017 prevailing definitions of common symbols.
9018 * testsuite/plugin_test_6.sh: New test case.
9019 * testsuite/plugin_common_test_1.c: New test case.
9020 * testsuite/plugin_common_test_2.c: New test case.
9021 * testsuite/Makefile.am (plugin_test_6): New test case.
9022 * testsuite/Makefile.in: Regenerate.
9023
bd32c6bd
NC
90242010-04-06 Nick Clifton <nickc@redhat.com>
9025
9026 * po/vi.po: New Vietnamese translation.
9027
323c532f
DK
90282010-03-30 Doug Kwan <dougkwan@google.com>
9029
9030 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9031
4fcd97eb
DK
90322010-03-25 Doug Kwan <dougkwan@google.com>
9033
9034 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9035 to avoid a conversion warning on a 32-bit host.
9036
4ebf39db
ILT
90372010-03-24 Ian Lance Taylor <iant@google.com>
9038
9039 * testsuite/script_test_3.t: Add a TLS segment.
9040 * testsuite/Makefile.am (check_PROGRAMS): Add
9041 tls_phdrs_script_test.
9042 (tls_phdrs_script_test_SOURCES): Define.
9043 (tls_phdrs_script_test_DEPENDENCIES): Define.
9044 (tls_phdrs_script_test_LDFLAGS): Define.
9045 (tls_phdrs_script_test_LDADD): Define.
9046 * testsuite/Makefile.in: Rebuild.
9047
4a599bdd
CC
90482010-03-23 Cary Coutant <ccoutant@google.com>
9049
9050 * fileread.cc (find_or_make_view): Fix comment.
9051
6c93b22c
ILT
90522010-03-23 Ian Lance Taylor <iant@google.com>
9053
9054 * script-sections.cc (class Orphan_section_placement): Define
9055 PLACE_TLS and PLACE_TLS_BSS.
9056 (Orphan_section_placement::Orphan_section_placement): Initialize
9057 new places.
9058 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9059 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9060 (tls_script_test_SOURCES): Define.
9061 (tls_script_test_DEPENDENCIES): Define.
9062 (tls_script_test_LDFLAGS): Define.
9063 (tls_script_test_LDADD): Define.
9064 * testsuite/Makefile.in: Rebuild.
9065
a2c7281b
DK
90662010-03-22 Doug Kwan <dougkwan@google.com>
9067
9068 * arm.cc (Arm_relocate_functions::abs8,
9069 Arm_relocate_functions::abs16): Use correct check for overflow
9070 specified in the ARM ELF specs.
9071 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9072 target of a BLX instruction specially.
9073 (Reloc_stub::stub_type_for_reloc): Ditto.
9074 (Relocate::relocate): Use symbolic names instead of numeric relocation
9075 codes to report error.
9076 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9077 workaround.
9078 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9079 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9080 thumb2_blx_out_of_range.stdout
9081 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9082 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9083 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9084 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9085 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9086 thumb2_blx_in_range, thumb2_blx_in_range.o,
9087 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9088 thumb2_blx_out_of_range.o): New rules.
2e702c99 9089 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9090 thumb2_blx_in_range and thumb2_blx_out_of_range.
9091 * testsuite/Makefile.in: Regenerate.
9092 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9093 * testsuite/thumb_blx_in_range.s: New file.
9094 * testsuite/thumb_blx_out_of_range.s: New file.
9095
b0193076
RÁE
90962010-03-22 Rafael Espindola <espindola@google.com>
9097
9098 * archive.cc (Should_include): Move to archive.h.
9099 (should_include_member): Make it a member of Archive.
9100 (Lib_group): New.
9101 (Add_lib_group_symbols): New.
9102 * archive.h: Include options.h.
9103 (Archive_member): Moved from Archive.
9104 (Should_include): Moved from archive.cc.
9105 (Lib_group): New.
9106 (Add_lib_group_symbols): New.
9107 * dynobj.cc (do_should_include_member): New.
9108 * dynobj.h (do_should_include_member): New.
9109 * gold.cc (queue_initial_tasks): Update call to queue.
9110 * main.cc (main): Print lib group stats.
9111 * object.cc (do_should_include_member): New.
9112 * object.h: Include archive.h.
9113 (Object::should_include_member): New.
9114 (Object::do_should_include_member): New.
9115 (Sized_relobj::do_should_include_member): New.
9116 * options.cc (General_options::parse_start_lib): New.
9117 (General_options::parse_end_lib): New.
9118 (Input_arguments::add_file): Handle lib groups.
9119 (Input_arguments::start_group): Check we are not in a lib.
9120 (Input_arguments::start_lib): New.
9121 (Input_arguments::end_lib): New.
9122 * options.h (General_options): Add start_lib and end_lib.
9123 (Input_argument::lib_): New.
9124 (Input_argument::lib): New.
9125 (Input_argument::is_lib): New.
9126 (Input_file_lib): New.
9127 (Input_arguments::in_lib_): New.
9128 (Input_arguments::in_lib): New.
9129 (Input_arguments::start_lib): New.
9130 (Input_arguments::end_lib_): New.
9131 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9132 in unused members as preempted.
9133 (Sized_pluginobj::do_should_include_member): New.
9134 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9135 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9136 return the blocker.
9137 (Read_symbols::do_whole_lib_group): New.
9138 (Read_symbols::do_lib_group): New.
9139 (Read_symbols::do_read_symbols): Handle lib groups.
9140 (Read_symbols::get_name): Handle lib groups.
9141 * readsyms.h (Read_symbols): Add an archive member pointer.
9142 (Read_symbols::do_whole_lib_group): New.
9143 (Read_symbols::do_lib_group): New.
9144 (Read_symbols::member_): New.
9145 * script.cc (read_input_script): Update call to queue_soon.
9146
d099120c
DK
91472010-03-19 Doug Kwan <dougkwan@google.com>
9148
9149 * arm.cc (Stub_table::Stub_table): Initialize new data members
9150 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9151 (Stub_table::add_reloc_stub): Assign stub offset and update
9152 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9153 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9154 New data members.
2e702c99 9155 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9156 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9157 instead of going over all reloc stubs.
2e702c99 9158 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9159 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9160 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9161 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9162 Stringpool_template::offset_.
9163 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9164 Stringpool_template::offset_ to zero.
9165
1aa37384
DK
91662010-03-15 Doug Kwan <dougkwan@google.com>
9167
9168 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9169 offset_.
9170 (Stringpool_template::new_key_offset): New method.
9171 (Stringpool_template::add_string): Assign offsets when adding new
9172 strings.
9173 (Stringpool_template::set_string_offsets): Do not set string offsets
9174 when not optimizing.
9175 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9176 member size_.
2e702c99
RM
9177 (Chunked_vector::clear): Clear size_.
9178 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9179 (Chunked_vector::size): Return size_.
9180 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9181 (Chunked_vector::size_): New data member.
1aa37384
DK
9182 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9183 (Stringpool_template::new_key_offset): New method declaration.
9184 (Stringpool_template::offset_): New data member.
9185
b672b057
RÁE
91862010-03-15 Rafael Espindola <espindola@google.com>
9187
9188 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9189 Add_symbols' constructor.
9190 * readsyms.h (Add_symbols): Remove the input_group member.
9191
b6848d3c
ILT
91922010-03-10 Ian Lance Taylor <iant@google.com>
9193
9194 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9195 target to ask whether a reference to a symbol requires a stack
9196 split.
9197 * target.h (Target::is_call_to_non_split): New function.
9198 (Target::do_is_call_to_non_split): Declare virtual function.
9199 * target.cc: Include "symtab.h".
9200 (Target::do_is_call_to_non_split): New function.
9201 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9202
a2a5469e
CC
92032010-03-10 Cary Coutant <ccoutant@google.com>
9204
9205 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9206 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9207 (File_read::open[2]): Add whole_file_view_ to list of views.
9208 (File_read::make_view): Remove test of whole_file_view_.
9209 (File_read::find_or_make_view): Create whole_file_view_ if
9210 necessary.
9211 (File_read::clear_views): Replace bool parameter with enum;
9212 adjust all callers. Don't delete views with permanent data;
9213 do delete cached views and views from archives if
9214 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9215 if clearing the corresponding view.
9216 * fileread.h (File_read::Clear_views_mode): New enum.
9217 (File_read::View::is_permanent_view): New method.
9218 (File_read::clear_views): Replace bool parameter
9219 with enum; adjust all callers.
9220 * options.h (General_options): Change keep_files_mapped option;
9221 add map_whole_files.
9222 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9223 releasing the file.
9224 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9225 the file.
9226
8861f32b
DM
92272010-03-10 David S. Miller <davem@davemloft.net>
9228
9229 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9230
d62d0f5f
ST
92312010-03-09 Sriraman Tallam <tmsriram@google.com>
9232
9233 * icf.cc (get_section_contents): Add '@' marker after processing the
9234 merge reloc.
9235
9177756d
DK
92362010-03-08 Doug Kwan <dougkwan@google.com>
9237
9238 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9239 due to a conversion warning.
9240 (Arm_relobj::update_output_local_symbol_count): Check for local
9241 symbol with unset output index.
9242
9e9e071b
ILT
92432010-03-05 Ian Lance Taylor <iant@google.com>
9244
9245 * options.h (class General_options): Add --spare-dynamic-tags.
9246 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9247 --spare-dynamic-tags.
9248
a81ee015
ILT
92492010-03-05 Ian Lance Taylor <iant@google.com>
9250
9251 * incremental.cc: Include "libiberty.h".
9252
44ec90b9
RO
92532010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9254
9255 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9256 function, is_info_ member.
9257 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9258 (Versions::Versions): Update caller.
9259 (Versions::define_base_version): Likewise.
9260 (Versions::add_def): Likewise.
9261
0897ed3b
ST
92622010-03-03 Sriraman Tallam <tmsriram@google.com>
9263
9264 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9265 (Scan::possible_function_pointer_reloc): New function.
9266 (Scan::local_reloc_may_be_function_pointer): Change to call
9267 possible_function_pointer_reloc.
9268 (Scan::global_reloc_may_be_function_pointer): Ditto.
9269 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9270 relocations in ".data.rel.ro._ZTV" section.
9271 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9272 * testsuite/icf_safe_so_test.cc: Ditto.
9273 * testsuite/icf_safe_test.cc: Ditto.
9274 * testsuite/icf_safe_test.sh: Ditto.
9275
d3bbad62
ILT
92762010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9277 Ian Lance Taylor <iant@google.com>
9278
9279 * target-reloc.h (relocate_section): Check the symbol table index
9280 for -1U before setting the local symbol index.
9281 (scan_relocatable_relocs): If copying the relocation, record that
9282 the local symbol is required.
9283 * object.h (Symbol_value::is_output_symtab_index_set): New
9284 function.
9285 (Symbol_value::may_be_discarded_from_output_symtab): New
9286 function.
9287 (Symbol_value::has_output_symtab_entry): New function.
9288 (Symbol_value::needs_output_symtab_entry): Remove.
9289 (Symbol_value::output_symtab_index): Make sure the symbol index is
9290 set.
9291 (Symbol_value::set_output_symtab_index): Make sure the symbol
9292 index is not set. Make sure the new index is valid.
9293 (Symbol_value::set_must_have_output_symtab_entry): New function.
9294 (Symbol_value::has_output_dynsym_entry): New function.
9295 (Symbol_value::set_output_dynsym_index): Make sure the new index
9296 is valid.
9297 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9298 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9299 local symbol if permitted.
9300 (Sized_relobj::do_finalize_local_symbols): Call
9301 is_output_symtab_index_set rather than needs_output_symtab_entry.
9302 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9303 rather than needs_output_symtab_entry. Call
9304 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9305 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9306 is_output_symtab_index_set rather than needs_output_symtab_entry.
9307 * testsuite/discard_locals_relocatable_test.c: New file.
9308 * testsuite/discard_locals_test.sh: Test -r.
9309 * testsuite/Makefile.am (check_DATA): Add
9310 discard_locals_relocatable_test1.syms,
9311 discard_local_relocatable_test2.syms.
9312 (MOSTLYCLEANFILES): Likewise. Also add
9313 discard_locals_relocatable_test1.lout and
9314 discard_locals_relocatable_test2.out.
9315 (discard_locals_relocatable_test1.syms): New target.
9316 (discard_locals_relocatable_test.o): New target.
9317 (discard_locals_relocatable_test1.out): New target.
9318 (discard_locals_relocatable_test2.syms): New target.
9319 (discard_locals_relocatable_test2.out): New target.
9320 (various): Add missing ../ld-new dependencies.
9321 * testsuite/Makefile.in: Rebuild.
9322
7e8ccf26
NC
93232010-03-03 Nick Clifton <nickc@redhat.com>
9324
9325 * po/fi.po: New Finnish translation.
9326
2a0ff005
DK
93272010-03-01 Doug Kwan <dougkwan@google.com>
9328
9329 * layout.cc (Layout::Layout): Force section types of .init_array*,
9330 .preinit_array* and .fini_array* sections.
9331 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9332 Fix check of return value of std::string::find.().
9333 (Output_section::Input_section_sort_compare::operator()): Remove
9334 comment about .init_array.
9335 (Output_section::Input_section_sort_init_fini_compare::operator()):
9336 New method.
9337 (Output_section::sort_attached_input_sections): Handle .init_array
9338 and .fini_array specially.
9339 * output.h (Output_section::Inut_section_sort_compare): Update
9340 comment.
9341 (Output_section::Input_section_sort_init_fini_compare): New struct.
9342
c3e4ae29
DK
93432010-02-26 Doug Kwan <dougkwan@google.com>
9344
9345 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9346 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9347 * testsuite/debug_msg.sh: Avoid matching source line number for
9348 use of global variable undef_int.
9349
2fd9ae7a
DK
93502010-02-26 Doug Kwan <dougkwan@google.com>
9351
9352 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9353 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9354 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9355 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9356 * options.cc (General_options::General_options): Initialize member
9357 fix_v4bx_.
9358 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9359 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9360 and rm_no_fix_v4bx.stdout
9361 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9362 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9363 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9364 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9365 and arm_no_fix_v4bx.
9366 * Makefile.in: Regenerate.
9367 * testsuite/arm_fix_v4bx.s: New file.
9368 * testsuite/arm_fix_v4bx.sh: Ditto.
9369
67ec7d0b
DK
93702010-02-24 Doug Kwan <dougkwan@google.com>
9371
9372 * arm.cc (Target_arm::got_section): Make the .got section the first
9373 non RELRO section in the data segment.
9374 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9375 suffixes of section names.
9376
10165461
DK
93772010-02-24 Doug Kwan <dougkwan@google.com>
9378
9379 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9380 flags and attributes merging if an input file is a binary file.
9381 * fileread.cc (Input_file::open): Record format of original file.
9382 * fileread.h (Input_file::Format): New enum type.
2e702c99 9383 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9384 (Input_file::format): New method definition.
9385 (Input_file::format_):: New data member.
9386
4a54abbb
DK
93872010-02-24 Doug Kwan <dougkwan@google.com>
9388
9389 * arm.cc (Arm_output_data_got): New class.
9390 (ARM_TCB_SIZE): New constant
9391 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9392 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9393 If user uses a script with a SECTIONS clause, issue only a warning
9394 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9395 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9396 garbage collection.
9397 (Target_arm::got_mode_index_entry): Handle static linking.
9398 (Target_arm::Scan::local): Ditto.
9399 (Target_arm::Scan::global): Ditto.
9400 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9401 all incorrectly implemented relocations.
e1df38aa 9402 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9403 Arm_output_section::fix_exidx_coverage.
9404 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9405 from ".ARM.exidx." and ".ARM.extab.".
9406
ca419a6f
ILT
94072010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9408
9409 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9410 section if it does not already exist.
9411 * attributes.cc (Attributes_section_data::Attributes_section_data):
9412 Don't crash if size is zero.
9413
135b9c78
ILT
94142010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9415 Ian Lance Taylor <iant@google.com>
9416
9417 * gold.cc (queue_middle_tasks): If no input files were opened,
9418 exit.
9419 * workqueue.h (Task_function::Task_function): Assert that there is
9420 a blocker.
9421
bb0bfe4f
DK
94222010-02-22 Doug Kwan <dougkwan@google.com>
9423
9424 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9425 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9426 types to avoid warnings due to different uint64_t implementations
9427 on different hosts.
9428
2a2b6d42
DK
94292010-02-21 Doug Kwan <dougkwan@google.com>
9430
9431 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9432 handling of the maximum backward branch offset.
2e702c99 9433 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9434 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9435 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9436 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9437 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9438 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9439 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9440 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9441 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9442 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9443 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9444 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9445 thumb2_bl_out_of_range.o): New rules.
9446 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9447 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9448 thumb2_bl_out_of_range
9449 * testsuite/Makefile.in: Regenerate.
9450 * testsuite/arm_bl_in_range.s: New file.
9451 * testsuite/arm_bl_out_of_range.s: Ditto.
9452 * testsuite/arm_branch_in_range.sh: Ditto.
9453 * testsuite/arm_branch_range.t: Ditto.
9454 * testsuite/thumb2_branch_range.t: Ditto.
9455 * testsuite/thumb_bl_in_range.s: Ditto.
9456 * testsuite/thumb_bl_out_of_range.s: Ditto.
9457 * testsuite/thumb_branch_range.t: Ditto.
9458
b487ad64
ST
94592010-02-20 Sriraman Tallam <tmsriram@google.com>
9460
9461 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9462 Add reloc offset information.
9463 * icf.cc (get_section_contents): Change iterators to point to the new
9464 vectors. Add reloc offset information to the contents.
9465 * icf.h (Icf::Sections_reachable_info): New typedef.
9466 (Icf::Sections_reachable_list): New typedef.
9467 (Icf::Offset_info): New typedef.
9468 (Icf::Reloc_info): New struct typedef.
9469 (Icf::Reloc_info_list): New typedef.
9470 (Icf::symbol_reloc_list): Delete method.
9471 (Icf::addend_reloc_list): Delete method.
9472 (Icf::section_reloc_list): Delete method.
9473 (Icf::reloc_info_list): New method.
9474 (Icf::reloc_info_list_): New member.
9475
f96accdf
DK
94762010-02-19 Doug Kwan <dougkwan@google.com>
9477
9478 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9479 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9480 * arm.cc (Arm_relocation_functions): New forward declaration.
9481 (Target_arm::Target_arm): Initialize new data members
9482 got_mod_index_offset_ and tls_base_symbol_defined_.
9483 (Target_arm::Relocate::relocate_tls): New method.
9484 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9485 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9486 New methods.
2e702c99 9487 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9488 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9489 (Target_arm::got_mod_index_offset_,
9490 Target_arm::tls_base_symbol_defined_): New data members.
9491 (Target_arm::Scan::local, Target::Scan::global,
9492 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9493 relocations.
9494
c8761b9a
DK
94952010-02-18 Doug Kwan <dougkwan@google.com>
9496
9497 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9498 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9499 text section as a parameter becuase some broken tools may not set
9500 the link in section header.
9501 (Target_arm::has_got_section): New method.
9502 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9503 without any mapping symbol as data only. Remove warning.
9504 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9505 link in its section header, try to discover the link by inspecting the
9506 REL31 relocation at the beginning of the section.
9507 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9508 in error message.
9509 (Target_arm::Scan::global): Treat any reference to the symbol
9510 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9511
21bb3914
ST
95122010-02-12 Sriraman Tallam <tmsriram@google.com>
9513
9514 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9515 (Scan::global_reloc_may_be_function_pointer): New function.
9516 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9517 (Scan::global_reloc_may_be_function_pointer): New function.
9518 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9519 (Scan::global_reloc_may_be_function_pointer): New function.
9520 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9521 (Scan::global_reloc_may_be_function_pointer): New function.
9522 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9523 (Scan::global_reloc_may_be_function_pointer): New function.
9524 (Scan::possible_function_pointer_reloc): New function.
9525 (Target_x86_64::can_check_for_function_pointers): New function.
9526 * gc.h (gc_process_relocs): Scan relocation types to determine if
9527 function pointers were taken for targets that support it.
9528 * icf.cc (Icf::find_identical_sections): Include functions for
9529 folding in safe ICF whose pointer is not taken.
9530 * icf.h (Secn_fptr_taken_set): New typedef.
9531 (fptr_section_id_): New member.
9532 (section_has_function_pointers): New function.
9533 (set_section_has_function_pointers): New function.
9534 (check_section_for_function_pointers): New function.
9535 * options.h: Fix comment for safe ICF option.
9536 * target.h (can_check_for_function_pointers): New function.
9537 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9538 Modify icf_safe_test for X86-64.
9539 * testsuite/Makefile.in: Regenerate.
9540 * testsuite/icf_safe_so_test.cc: New file.
9541 * testsuite/icf_safe_so_test.sh: New file.
9542 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9543 (main): Change to take pointer to function kept_func_3.
9544 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9545 folding is done correctly for X86-64.
9546
0da6fa6c
DM
95472010-02-12 David S. Miller <davem@davemloft.net>
9548
9549 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9550 is_symbolless parameter.
9551 (Output_reloc<SHT_REL>::is_symbolless): New.
9552 (Output_reloc<SHT_REL>::is_symbolless_): New.
9553 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9554 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9555 (Output_reloc<SHT_RELA>::is_symbolless): New.
9556 (Output_data_reloc::add_global): Handle is_symbolless.
9557 (Output_data_reloc::add_global_relative): Likewise.
9558 (Output_data_reloc::add_local): Likewise.
9559 (Output_data_reloc::add_local_relative): Likewise.
9560 (Output_data_reloc::add_symbolless_global_addend): New.
9561 (Output_data_reloc::add_symbolless_local_addend): New.
9562 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9563 is_symbolless.
9564 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9565 instead of ->is_relative_
9566 (Output_reloc::write): Likewise.
9567 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9568 (Output_reloc::write_rel): Simplify.
9569
9570 * sparc.cc (Target_sparc::Scan::local): Use
9571 ->add_symbolless_local_addend as needed.
9572 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9573 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9574 based upon relocation offset.
9575
e4782e83
DK
95762010-02-11 Doug Kwan <dougkwan@google.com>
9577
9578 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9579 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9580 beginning of function.
9581 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9582 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9583 parameter is_32bit in calls to should_apply_static_reloc.
9584 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9585 (check_DATA): Add arm_abs_global.stdout.
9586 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9587 arm_abs_global.stdout): New rules.
9588 (MOSTLLYCLEANFILES): Add arm_abs_global
9589 * Makefile.in: Regenerate.
9590 * testsuite/arm_abs_global.s: New file.
9591 * testsuite/arm_abs_global.sh: Ditto.
9592 * testsuite/arm_abs_lib.s: Ditto.
9593
93ceb764
ILT
95942010-02-11 Ian Lance Taylor <iant@google.com>
9595
9596 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9597 Read_relocs task.
9598 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9599 Allocate_commons_task first.
9600 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9601 task, rather than symtab_lock_.
9602 (Gc_process_relocs::~Gc_process_relocs): New function.
9603 (Gc_process_relocs::is_runnable): Check this_blocker_.
9604 (Gc_process_relocs::locks): Use next_blocker_ rather than
9605 blocker_.
9606 (Scan_relocs::~Scan_relocs): New function.
9607 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9608 symtab_lock_.
9609 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9610 next_blocker_.
9611 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9612 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9613 constructor accordingly.
9614 (class Gc_process_relocs): Likewise.
9615 (class Scan_relocs): Likewise.
9616 * common.h (class Allocate_commons_task): Remove symtab_lock_
9617 field, and corresponding constructor parameter.
9618 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9619 symtab_lock_.
9620 (Allocate_commons_task::locks): Likewise.
9621
114dfbe1
ILT
96222010-02-11 Ian Lance Taylor <iant@google.com>
9623
9624 * gold-threads.h (class Once): Define.
9625 (class Initialize_lock): Rewrite as child of Once.
9626 * gold-threads.cc (class Once_initialize): Define.
9627 (once_pointer_control): New static variable.
9628 (once_pointer, once_arg): New static variables.
9629 (c_run_once): New static function.
9630 (Once::Once, Once::run_once, Once::internal_run): New functions.
9631 (class Initialize_lock_once): Remove.
9632 (initialize_lock_control): Remove.
9633 (initialize_lock_pointer): Remove.
9634 (initialize_lock_once): Remove.
9635 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9636 (Initialize_lock::initialize): Rewrite.
9637 (Initialize_lock::do_run_once): New function.
9638 * archive.cc (Archive::interpret_header): Only clear name if it is
9639 not already empty.
9640 * fileread.cc: Include "gold-threads.h"
9641 (file_counts_lock): New static variable.
9642 (file_counts_initialize_lock): Likewise.
9643 (File_read::release): Only increment counts when using --stats.
9644 Use a lock around the increment.
9645 * parameters.cc (class Set_parameters_target_once): Define.
9646 (set_parameters_target_once): New static variable.
9647 (Parameters::Parameters): Move here from parameters.h.
9648 (Parameters::set_target): Rewrite.
9649 (Parameters::set_target_once): New function.
9650 (Parameters::clear_target): Move here and rewrite.
9651 * parameters.h (class Parameters): Update declarations. Add
9652 set_parameters_target_once_ field.
9653 (Parameters::Parameters): Move to parameters.cc.
9654 (Parameters::clear_target): Likewise.
9655 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9656 task.
9657 (Start_group::~Start_group): New function.
9658 (Start_group::is_runnable): New function.
9659 (Start_group::locks, Start_group::run): New functions.
9660 (Finish_group::run): Change saw_undefined to size_t.
9661 * readsyms.h (class Start_group): Define.
9662 (class Finish_group): Change saw_undefined_ field to size_t.
9663 (Finish_group::Finish_group): Remove saw_undefined and
9664 this_blocker parameters. Change all callers.
9665 (Finish_group::set_saw_undefined): New function.
9666 (Finish_group::set_blocker): New function.
9667 * symtab.h (class Symbol_table): Change saw_undefined to return
9668 size_t. Change saw_undefined_ field to size_t.
9669 * target-select.cc (Set_target_once::do_run_once): New function.
9670 (Target_selector::Target_selector): Initialize set_target_once_
9671 field. Don't initialize lock_ and initialize_lock_ fields.
9672 (Target_selector::instantiate_target): Rewrite.
9673 (Target_selector::set_target): New function.
9674 * target-select.h (class Set_target_once): Define.
9675 (class Target_selector): Update declarations. Make
9676 Set_target_once a friend. Remove lock_ and initialize_lock_
9677 fields. Add set_target_once_ field.
9678
fa17a3f4
ILT
96792010-02-10 Ian Lance Taylor <iant@google.com>
9680
9681 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9682 queueing any tasks.
9683 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9684 (queue_middle_tasks): Add all blockers before queueing any tasks.
9685 (queue_final_tasks): Likewise.
9686 * token.h (Task_token::add_blockers): New function.
9687 * object.h (Input_objects::number_of_relobjs): New function.
9688
c7177d31
ILT
96892010-02-10 Ian Lance Taylor <iant@google.com>
9690
5de0e392
ILT
9691 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9692 shared, not if not position independent.
9693 * x86_64.cc (Relocate::relocate_tls): Likewise.
9694 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9695 (tls_pie_pic_test): New target.
9696 * testsuite/Makefile.in: Rebuild.
9697
c7177d31
ILT
9698 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9699 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9700 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9701 * testsuite/Makefile.in: Rebuild.
9702
684b268a
DM
97032010-02-09 David S. Miller <davem@davemloft.net>
9704
9705 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9706 R_SPARC_RELATIVE using ->add_local_relative().
9707 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9708
612a8d3d
DM
9709 * output.h (Output_data_dynamic::add_section_size): New method
9710 that takes two Output_data objects.
9711 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9712 entry param. Handle it in initializers.
9713 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9714 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9715 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9716 arg.
9717 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9718 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9719 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9720 for dynrel_includes_plt.
9721 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9722 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9723 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9724 before .rela.plt
9725 (Target_sparc::do_finalize_sections): Update to pass true for
9726 dynrel_includes_plt.
9727 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9728 output before .rela.plt
9729 (Target_powerpc::do_finalize_sections): Update to pass true for
9730 dynrel_includes_plt when 32-bit.
9731
cb1be87e
DK
97322010-02-08 Doug Kwan <dougkwan@google.com>
9733
9734 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9735 method.
9736 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9737 Arm_relobj::scan_section_for_cortex_a8_stubs,
9738 Arm_relobj::do_relocation_section): Instead of calling
9739 Output_section::output_address, use faster
9740 Arm_relobj::simple_input_section_output_address.
9741
705b5121
DM
97422010-02-08 David S. Miller <davem@davemloft.net>
9743
9744 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9745 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9746 relocation helper function.
9747
024c4466
DM
9748 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9749 just like R_SPARC_GOT{10,13,22}.
9750 (Target_sparc::Scan::local): Likewise.
9751 (Target_sparc::Relocate:relocate): Likewise.
9752
9109c078
ILT
97532010-02-06 Ian Lance Taylor <iant@google.com>
9754
9755 * configure.ac: Rewrite targetobjs duplicate removal code to use
9756 only shell constructs.
9757 * configure: Rebuild.
9758
cf846138
DK
97592010-02-05 Doug Kwan <dougkwan@google.com>
9760
9761 PR 11247
9762 * arm.cc (Arm_relobj::section_is_scannable): New method.
9763 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9764 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9765
6cfaf60b
DK
97662010-02-04 Doug Kwan <dougkwan@google.com>
9767
9768 PR 11247
9769 * arm-reloc-property.cc (cstdio): Include.
9770 * configure.ac (targetobjs): Remove duplicates.
9771 * configure: Regenerate.
9772 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9773 big and little endian version for a given address size.
9774
5c57f1be
DK
97752010-02-03 Doug Kwan <dougkwan@google.com>
9776
9777 * arm-reloc-property.cc
9778 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9779 definition.
9780 * arm-reloc-property.h
9781 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9782 New method definition.
9783 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9784 declaration.
9785 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9786 overflow to N.
9787 (GOT_PREL): Change implemented to Y.
9788 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9789 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9790 (Arm_relocate_functions::movw_abs_nc): Remove method.
9791 (Arm_relocate_functions::movt_abs): Ditto.
9792 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9793 (Arm_relocate_functions::thm_movt_abs): Ditto.
9794 (Arm_relocate_functions::movw_rel_nc): Ditto.
9795 (Arm_relocate_functions::movw_rel): Ditto.
9796 (Arm_relocate_functions::movt_rel): Ditto.
9797 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9798 (Arm_relocate_functions:thm_movw_rel): Ditto.
9799 (Arm_relocate_functions:thm_movt_rel): Ditto.
9800 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9801 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9802 New method definitions.
9803 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9804 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9805 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9806 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9807 (Target_arm::Relocate::relocate): Check for non-static or
9808 unimplemented relocation code and exit early. Change calls to
9809 Target_arm::reloc_uses_thumb_bit and
9810 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9811 instead. Refactor code to handle similar relocations to increase
9812 code sharing. Remove check for unsupported relocation code in switch
9813 statement.
9814 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9815 relocation property table to find out size. Change error message to
9816 print out the name of a relocation code instead of the numeric value.
9817 (Target_arm::scan_reloc_for_stub): Use relocation property table
9818 instead of calling Target_arm::reloc_uses_thumb_bit().
9819
218c5831
DK
98202010-02-02 Doug Kwan <dougkwan@google.com>
9821
9822 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9823 types of relaxed input section.
9824
0d31c79d
DK
98252010-02-02 Doug Kwan <dougkwan@google.com>
9826
9827 * Makefile.am (HFILES): Add arm-reloc-property.h.
9828 (DEFFILES): New.
2e702c99
RM
9829 (TARGETSOURCES): Add arm-reloc-property.cc
9830 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9831 (libgold_a_SOURCES): $(DEFFILES)
9832 * Makefile.in: Regenerate.
9833 * arm-reloc-property.cc: New file.
9834 * arm-reloc-property.h: New file.
9835 * arm-reloc.def: New file.
9836 * arm.cc: Update comments.
9837 (arm-reloc-property.h): New included header.
9838 (arm_reloc_property_table): New global variable.
9839 (Target_arm::do_select_as_default_target): New method definition.
9840 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9841 arm-reloc-property to targ_extra_obj.
9842 * parameters.cc (set_parameters_target): Call
9843 Target::select_as_default_target().
9844 * target.h (Target::select_as_default_target): New method definition.
9845 (Target::do_select_as_default_target): Same.
9846
546c7457
DK
98472010-02-01 Doug Kwan <dougkwan@google.com>
9848
9849 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9850 first_output_text_section_.
9851 (Arm_exidx_fixup::first_output_text_section): New method definition.
9852 (Arm_exidx_fixup::first_output_text_section_): New data member.
9853 (Arm_exidx_fixup::process_exidx_section): Record the first text
9854 output section seen.
9855 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9856 and entsize in output section header.
9857
11b861d5
DK
98582010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9859
9860 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9861 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9862 (Arm_relocate_functions::thm_alu11): New Method.
9863 (Arm_relocate_functions::thm_pc8): New Method.
9864 (Arm_relocate_functions::thm_pc12): New Method.
9865 (Target_arm::Scan::local): Handle the relocations.
9866 (Target_arm::Scan::global): Likewise.
9867 (Target_arm::Relocate::relocate): Likewise.
9868 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9869
c9a2c125
DK
98702010-01-29 Doug Kwan <dougkwan@google.com>
9871
9872 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9873 of relocation types as ld.
9874
1521477a
DK
98752010-01-29 Doug Kwan <dougkwan@google.com>
9876
9877 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9878 to public.
9879 (Arm_relocate_functions::thumb_branch_common): Ditto.
9880 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9881 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9882 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9883 Arm_relocate_functions::jump24): Remove.
9884 (Target_arm::Relocate::relocate): Adjust code to call
9885 Arm_relocation_functions::arm_branch_common and
9886 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9887 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9888
e7eca48c
DK
98892010-01-29 Doug Kwan <dougkwan@google.com>
9890
9891 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9892 output_local_symbol_count_needs_update_.
9893 (Arm_relobj::output_local_symbol_count_needs_update,
9894 Arm_relobj::set_output_local_symbol_count_needs_update,
9895 Arm_relobj::update_output_local_symbol_count): New methods.
9896 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9897 member.
9898 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9899 of pointed function as in a R_ARM_PREL31 relocation.
9900 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9901 for output local symbol count updating.
9902 (Target_arm::do_relax): Update output local symbol counts in objects
9903 if necessary.
9904 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9905
02961d7e
ILT
99062010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9907
9908 * arm.cc: Added support for the ARM relocations:
9909 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9910 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9911 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9912 movw_prel_nc).
9913 (Arm_relocate_functions::movw_rel): New method.
9914 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9915 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9916 thm_movw_prel_nc).
9917 (Arm_relocate_functions::thm_movw_rel): New method.
9918 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9919 thm_movt_prel).
9920 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9921 relocations.
9922 (Target_arm::Scan::global): Likewise.
9923 (Target_arm::Relocate::relocate): Likewise.
9924 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9925 Likewise.
9926
b10d2873
ILT
99272010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9928
9929 * arm.cc: Added support for ARM group relocations.
9930 (Target_arm::reloc_needs_sym_origin): New method.
9931 (Arm_relocate_functions::calc_grp_kn): New method.
9932 (Arm_relocate_functions::calc_grp_residual): New method.
9933 (Arm_relocate_functions::calc_grp_gn): New method.
9934 (Arm_relocate_functions::arm_grp_alu): New Method.
9935 (Arm_relocate_functions::arm_grp_ldr): New Method.
9936 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9937 (Arm_relocate_functions::arm_grp_ldc): New Method.
9938 (Target_arm::Scan::local): Handle the ARM group relocations.
9939 (Target_arm::Scan::global): Likewise.
9940 (Target_arm::Relocate::relocate): Likewise.
9941 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9942 Likewise.
9943
2b328d4e
DK
99442010-01-26 Doug Kwan <dougkwan@google.com>
9945
9946 * arm.cc (set): Include.
9947 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9948 pointer type.
2e702c99 9949 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9950 (Arm_output_section::append_text_sections_to_list): New method.
9951 (Arm_output_section::fix_exidx_coverage): Ditto.
9952 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9953 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9954 Relobj::set_section_offset() instead of
9955 Sized_relobj::invalidate_section_offset().
2e702c99 9956 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9957 parameter for section headers. Ignore relocation sections for
9958 unallocated sections and EXIDX sections.
9959 (Target_arm::fix_exidx_coverage): New method.
9960 (Target_arm::output_section_address_less_than): New type.
9961 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9962 linked text section instead of the EXIDX section.
9963 (Arm_output_section::create_stub_group): Add an assertion to check
9964 that this is not an EXIDX output section.
9965 (Arm_output_section::append_text_sections_to_list): New method.
9966 (Arm_output_section::fix_exidx_coverage): Ditto.
9967 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9968 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9969 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9970 first pass.
9971 (Target_arm::fix_exidx_coverage): New method.
9972 * object.h (Relobj::set_output_section): New method.
9973 (Sized_relobj::invalidate_section_offset): Remove method.
9974 (Sized_relobj::do_invalidate_section_offset): Remove method.
9975 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9976
c7f3c371
DK
99772010-01-25 Doug Kwan <dougkwan@google.com>
9978
9979 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9980 Fix warning due to signed and unsigned comparison on a 32-bit host.
9981
8923b24c
DK
99822010-01-22 Doug Kwan <dougkwan@google.com>
9983
9984 * arm.cc (Target_arm::do_relax): Record an output section for section
9985 offset adjustment it contains any stub table that has changed.
9986 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9987 offsets in an output section if necessary.
9988 * output.cc (Output_section::Output_section): Initialize
9989 section_offsets_need_adjustments_.
9990 (Output_section::add_input_section_for_script): Renamed to
9991 Output_section::add_simple_input_section.
9992 (Output_section::save_states): Add a comment.
9993 (Output_section::discard_states): New method defintion.
9994 (Output_section::adjust_section_offsets): Same.
9995 * output.h (Output_section::add_input_section_for_script): Renamed to
9996 Output_section::add_simple_input_section.
9997 (Output_section::discard_states): New method declaration.
9998 (Output_section::adjust_section_offsets): Same.
9999 (Output_section::section_offsets_need_adjustment,
10000 Output_section::set_section_offsets_need_adjustment): New method
10001 definitions.
10002 (Output_section::section_offsets_need_adjustment_): New data member.
10003 * script-sections.cc
10004 (Output_section_element_input::set_section_address): Adjust code for
10005 renaming of Output_section::add_input_section_for_script.
10006 (Orphan_output_section::set_section_address): Same.
10007
9b2fd367
DK
100082010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10009
10010 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10011 Fix_v4bx enum values .
10012 * gold/options.h (General_options): New option definitions.
10013 (General_options::fix_v4bx): New method.
10014 (General_options::Fix_v4bx): New enum.
10015 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10016 (General_options::parse_fix_v4bx_interworking): New method.
10017
80d0d023
DK
100182010-01-22 Doug Kwan <dougkwan@google.com>
10019
10020 * arm.cc (Arm_exidx_fixup): New class.
10021
af2cdeae
DK
100222010-01-21 Doug Kwan <dougkwan@google.com>
10023
10024 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10025 classes.
10026 (Arm_exidx_section_offset_map): New type.
10027
993d07c1
DK
100282010-01-21 Doug Kwan <dougkwan@google.com>
10029
10030 * arm.cc (Arm_exidx_input_section): New class.
10031 (Arm_relobj::exidx_input_section_by_link,
10032 Arm_relobj::exidx_input_section_by_shndx,
10033 Arm_relobj::make_exidx_input_section): New methods.
10034 (read_arm_attributes_section): Remove.
10035 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10036 information about them.
10037 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10038 to here.
10039
5ac169d4
DK
100402010-01-20 Doug Kwan <dougkwan@google.com>
10041
10042 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10043 Input_section_specifier to Section_id.
10044 (Target_arm::new_arm_input_section: Adjust code for change of key
10045 type.
10046 (Target_arm::find_arm_input_section): Ditto.
10047 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10048 (Section_id): Remove.
10049 (Garbage_collection::Section_id_hash): Remove.
10050 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10051 (Section_id): Remove.
10052 (Icf::Section_id_hash): Remove.
10053 * object.h (Section_id, Const_section_id, Section_id_hash,
10054 Const_section_id_hash): New type definitions.
10055 * output.cc (Output_section::add_relaxed_input_section): Change to
10056 use Const_section_id instead of Input_section_specifier as key type.
10057 (Output_section::add_merge_input_section): Ditto.
10058 (Output_section::build_relaxation_map): Change to use Section_id
10059 instead of Input_section_specifier as key type.
2e702c99 10060 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10061 Ditto.
10062 (Output_section::convert_input_sections_to_relaxed_sections): Change
10063 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10064 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10065 (Output_section::find_relaxed_input_section): Ditto.
10066 * output.h (Input_section_specifier): Remove class.
10067 (Output_section::Output_section_data_by_input_section_map): Change
10068 key type to Const_section_id.
10069 (Output_section::Output_relaxed_input_section_by_input_section_map):
10070 Ditto.
10071 (Output_section::Relaxation_map): Change key type to Section_id.
10072
a2162063
ILT
100732010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10074
10075 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10076 (class Arm_v4bx_stub): New class.
10077 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10078 (Stub_factory::make_arm_v4bx_stub): New method.
10079 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10080 (Stub_table::empty): Handle v4bx stubs.
10081 (Stub_table::add_arm_v4bx_stub): New method.
10082 (Stub_table::find_arm_v4bx_stub): New method.
10083 (Arm_relocate_functions::v4bx): New method.
10084 (Target_arm::fix_v4bx): New method.
10085 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10086 (Stub_table::relocate_stubs): Likewise.
10087 (Stub_table::do_write): Likewise.
10088 (Stub_table::update_data_size_and_addralign): Likewise.
10089 (Stub_table::finalize_stubs): Likewise.
10090 (Target_arm::Scan::local): Likewise.
10091 (Target_arm::Scan::global): Likewise.
10092 (Target_arm::do_finalize_sections): Likewise.
10093 (Target_arm::Relocate::relocate): Likewise.
10094 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10095 Likewise.
10096 (Target_arm::scan_reloc_for_stub): Likewise.
10097 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10098
5696ab0b
ILT
100992010-01-19 Ian Lance Taylor <iant@google.com>
10100
10101 * output.cc (Output_section_headers::do_sized_write): Write large
10102 segment count to sh_info field.
10103 (Output_file_header::do_sized_write): For large segment count,
10104 write PN_XNUM to e_phnum field.
10105
800d0f56
ILT
101062010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10107
10108 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10109 (Arm_relocate_functions::thm_jump8): New function.
10110 (Arm_relocate_functions::thm_jump11): New function.
10111 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10112 R_ARM_THM_JUMP11.
10113 (Target_arm::Scan::global): Likewise.
10114 (Target_arm::Relocate::relocate): Likewise.
10115 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10116 Likewise.
10117
41263c05
DK
101182010-01-14 Doug Kwan <dougkwan@google.com>
10119
10120 * arm.cc (map, utility): Include headers.
10121 (Target_arm::apply_cortex_a8_workaround): New method.
10122 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10123 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10124 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10125 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10126 the --[no-]fix-cortex-a8 command line options.
10127 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10128 (Target_arm::relocate_stub): Use addend in instruction template.
10129 * options.h (DEFINE_bool): Set the user-set flag.
10130 (General_options): Add --[no-]-fix-cortex options.
10131 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10132 : Update fast look-up map after conversion.
41263c05 10133
459e9b03
ST
101342010-01-14 Sriraman Tallam <tmsriram@google.com>
10135
10136 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10137 in the first pass of do_layout.
10138
b521dfe4
DK
101392010-01-13 Doug Kwan <dougkwan@google.com>
10140
10141 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10142 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10143 apparent compiler problem of not folding static constant integral
10144 data members of elfcpp::Elf_sizes<32>.
10145
44272192
DK
101462010-01-13 Doug Kwan <dougkwan@google.com>
10147
10148 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10149 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10150 Arm_relobj::scan_section_for_cortex_a8_erratum,
10151 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10152 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10153 sections to scan for relocation stubs into a new method
10154 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10155 relocation and Cortex-A8 stub scanning.
10156 (Target_arm::do_relax): Force stubs to be after stubbed sections
10157 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10158 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10159 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10160
44b71ece
ILT
101612010-01-12 Ian Lance Taylor <iant@google.com>
10162
10163 * target-reloc.h (visibility_error): New inline function.
10164 (relocate_section): Call visibility_error.
10165 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10166 (MOSTLYCLEANFILES): Likewise.
10167 (protected_4_pic.o, protected_3.err): New targets.
10168 * testsuite/protected_4.cc: New file.
10169
a120bc7f
DK
101702010-01-12 Doug Kwan <dougkwan@google.com>
10171
10172 * arm.cc (Cortex_a8_reloc): New class.
10173 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10174 and cortex_a8_relocs_info_.
10175 (Target_arm::fix_cortex_a8): New method definition.
10176 (Target_arm::Cortex_a8_relocs_info): New type.
10177 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10178 New data member declarations.
10179 (Target_arm::scan_reloc_for_stub): Record information about
10180 relocations for THUMB branches that might be exempted from the
10181 Cortex-A8 workaround.
10182 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10183 at the beginning of a relaxation pass.
10184
20138696
DK
101852010-01-12 Doug Kwan <dougkwan@google.com>
10186
10187 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10188 (Arm_relobj::Mapping_symbol_position,
10189 Arm_reloj::Mapping_symbol_position_less,
10190 Arm_relobj::Mapping_symbols_info): New types.
10191 (Target_arm::is_mapping_symbol_name): New method definition.
10192 (Arm_relobj::do_count_local_symbols): Save information about mapping
10193 symbols.
10194
089d69dc
DK
101952010-01-11 Doug Kwan <dougkwan@google.com>
10196
10197 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10198 Arm_relocate_functions::thumb32_branch_upper,
10199 Arm_relocate_functions::thumb32_branch_lower,
10200 Arm_relocate_functions::thumb32_cond_branch_offset,
10201 Arm_relocate_functions::thumb32_cond_branch_upper,
10202 Arm_relocate_functions::thumb32_cond_branch_lower,
10203 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10204 branch offset encoding.
10205 (Arm_relocate_functions::thumb_branch_common): Use new branch
10206 offset encoding methods to avoid code duplication.
10207 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10208 (Stub_addend_reader::operator()): Use new branch encoding method
10209 to avoid code duplication.
10210
99e5bff2
DK
102112010-01-11 Doug Kwan <dougkwan@google.com>
10212
10213 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10214 (Target_arm::do_finalize_sections): Define special EXIDX section
10215 symbols only if referenced.
10216 * gc.h (Garbage_collection::add_reference): New method.
10217 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10218 code duplication.
10219
98e090bd
ILT
102202010-01-11 Ian Lance Taylor <iant@google.com>
10221
d0a91bd8
ILT
10222 * script.cc (Version_script_info::build_expression_list_lookup):
10223 Change complaing about duplicate wildcard match from error to
10224 warning.
10225
98e090bd
ILT
10226 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10227 of 2009-12-30.
10228 (Version_script_info::Version_script_info): Initialize globs_,
10229 default_version_, default_is_global_, and exact_. Don't
10230 initialize globals_ or locals_.
10231 (Version_script_info::build_lookup_tables): Build local symbols
10232 first.
10233 (Version_script_info::unquote): New function.
10234 (Version_script_info::add_exact_match): New function.
10235 (Version_script_info::build_expression_list_lookup): Remove lookup
10236 parameter. Add is_global parameter. Change all callers. Handle
10237 wildcard pattern specially. Unquote pattern. Call
10238 add_exact_match.
10239 (Version_script_info::get_name_to_match): New function.
10240 (Version_script_info::get_symbol_version): New function.
10241 (Version_script_info::get_symbol_version_helper): Remove.
10242 (Version_script_info::check_unmatched_names): Call unquote.
10243 * script.h (class Version_script_info): Change get_symbol_version
10244 to be non-inline and add is_global parameter; change all callers.
10245 Rewrite symbol_is_local. Update declarations. Define struct
10246 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10247 Remove globals_ and locals_ members. Add exact_, globs_,
10248 default_version_, is_global_.
10249 (Version_script_info::Glob): Remove pattern, add expression and
10250 is_global. Update constructor. Change all callers.
10251 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10252 default version.
10253 (Versions::symbol_section_contents): If a symbol is undefined, or
10254 defined in a dynamic object, set the version index to
10255 VER_NDX_LOCAL.
10256 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10257 symbol_is_local.
10258 (Symbol_table::add_from_pluginobj): Likewise.
10259 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10260
d56962d3
DK
102612010-01-11 Doug Kwan <dougkwan@google.com>
10262
10263 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10264 (incremental_dump_LDADD): Add linking option for libintl.
10265 * Makefile.in: Regenerate.
10266
94e6ee91
L
102672010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10268
10269 PR gold/11144
10270 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10271 instead of -Ds.
10272 * testsuite/Makefile.in: Regenerated.
10273
e96c574b
DK
102742010-01-10 Doug Kwan <dougkwan@google.com>
10275
10276 * options.h (DEFINE_var): Use parentheses around argument varname__
10277 in macro body to avoid any unintended subsequent substitutions.
10278
7198066b
ILT
102792010-01-10 Ian Lance Taylor <iant@google.com>
10280
ba4d53bf
ILT
10281 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10282 candidates before doing symbol resolution.
10283
7198066b
ILT
10284 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10285 ODR candidates if only one is weak.
10286
a2beed37
ILT
102872010-01-08 Ian Lance Taylor <iant@google.com>
10288
10289 * script.cc (Version_script_info::build_expression_list_lookup):
10290 Don't warn about ambiguous version, just record the ambiguity.
10291 (Version_script_info::get_symbol_version_helper): Give error if
10292 version is ambiguous.
10293
2fb7225c
DK
102942010-01-08 Doug Kwan <dougkwan@google.com>
10295
10296 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10297 prev_data_size_ and prev_addralign_. Remove initializer for
10298 deleted data member has_been_changed_.
10299 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10300 to determine if the table is empty.
10301 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10302 Remove.
10303 (Stub_table::add_reloc_stub): Define method in class definition
10304 instead of just declaring it there.
10305 (Stub_table::add_cortex_a8_stub): New method definition.
10306 (Stub_table::update_data_size_and_addralign): Ditto.
10307 (Stub_table::finalize_stubs): Ditto.
10308 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10309 (Stub_table::do_addralign_): Return address alignment in the
10310 (Stub_table::do_reset_address_and_file_offset): Define method in
10311 class definition instead of declaring it there. Set current data
10312 size to be the data size of the previous pass.
10313 (Stub_table::set_final_data_size): Use current data size as the
10314 final data size.
10315 (Stub_table::relocate_stub): Change parameter type of stub from
10316 Reloc_stub pointer to Stub pointer.
10317 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10318 (Stub_table::Cortex_a8_stub_list): New typedef.
10319 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10320 Stub_table::prev_addralign_): New data member.
10321 (Arm_relobj::Arm_relobj): Initialize data member
10322 section_has_cortex_a8_workaround_.
10323 (Arm_relobj::section_has_cortex_a8_workaround,
10324 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10325 definitions.
10326 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10327 declarations.
10328 (Target_arm::relocate_stub): Change parameter type of stub from
10329 Reloc_stub pointer to Stub pointer.
10330 (Insn_template::size, Insn_template::alignment): Handle
10331 THUMB16_SPECIAL_TYPE.
10332 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10333 Stub_table::update_data_size_and_addralign,
10334 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10335 definitions.
10336 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10337 (Stub_table::do_write): Ditto.
10338 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10339
880cd20d
ILT
103402010-01-08 Ian Lance Taylor <iant@google.com>
10341
10342 PR 11108
10343 * symtab.h (class Symbol): Remove fields is_target_special_ and
10344 has_plt_offset_. Add field is_defined_in_discarded_section_.
10345 (Symbol::is_defined_in_discarded_section): New function.
10346 (Symbol::set_is_defined_in_discarded_section): New function.
10347 (Symbol::has_plt_offset): Rewrite.
10348 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10349 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10350 Don't initialize is_target_special_ or has_plt_offset_.
10351 Initialize is_defined_in_discarded_section_.
10352 (Symbol_table::add_from_relobj): If appropriate, set
10353 is_defined_in_discarded_section.
10354 * resolve.cc (Symbol::override_base_with_special): Don't test
10355 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10356 * target-reloc.h (relocate_section): Do special handling for
10357 symbols defined in discarded sections for global symbols as well
10358 as local symbols.
10359
2703e3eb
ILT
103602010-01-08 Ian Lance Taylor <iant@google.com>
10361
10362 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10363 the SHT_SYMTAB case.
10364
339d40a3
ILT
103652010-01-08 Ian Lance Taylor <iant@google.com>
10366
10367 * object.cc (Sized_relobj::do_layout): Don't get confused if
10368 layout_eh_frame returns NULL.
10369
abecea76
ILT
103702010-01-08 Ian Lance Taylor <iant@google.com>
10371
10372 PR 11084
10373 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10374 dynamic symbol table, use the normal symbol table.
10375 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10376 symbol table.
10377
6b7dd3f3
ILT
103782010-01-08 Ian Lance Taylor <iant@google.com>
10379
10380 PR 11072
10381 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10382 sections.
10383
36c50e63
L
103842010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10385
10386 * version.cc (print_version): Change to "Copyright 2010".
10387
e291e7b9
ILT
103882010-01-08 Ian Lance Taylor <iant@google.com>
10389
10390 PR 10287
10391 PR 11063
10392 * i386.cc (class Target_i386): Change return type of plt_section
10393 to be non-const.
10394 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10395 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10396 tls_desc_rel_ field.
10397 (Output_data_plt_i386::rel_tls_desc): New function.
10398 (Target_i386::rel_tls_desc_section): New function.
10399 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10400 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10401 R_386_TLS_DESC reloc in rel_tls_desc_section.
10402 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10403 Define struct Tlsdesc_info.
10404 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10405 (Target_x86_64::do_reloc_symbol_index): New function.
10406 (Target_x86_64::add_tlsdesc_info): New function.
10407 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10408 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10409 tlsdesc_rel_ field.
10410 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10411 all callers.
10412 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10413 (Target_x86_64::rela_tlsdesc_section): New function.
10414 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10415 handling.
10416 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10417 (Target_x86_64::do_reloc_addend): New function.
10418 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10419 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10420 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10421 (Output_reloc::type): New function.
10422 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10423 (Output_reloc::is_target_specific): New function.
10424 (Output_reloc::target_arg): New function.
10425 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10426 absolute relocs and target specific relocs.
10427 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10428 add_target_specific.
10429 (class Output_data_reloc) [SHT_RELA]: Likewise.
10430 * output.cc (Output_reloc::Output_reloc): Add four new versions
10431 for absolute relocs and target specific relocs.
10432 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10433 (Output_reloc::get_symbol_index): Likewise.
10434 (Output_reloc::local_section_offset): Check that local_sym_index_
10435 is not TARGET_CODE or 0.
10436 (Output_reloc::symbol_value): Likewise.
10437 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10438 reloc.
10439 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10440 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10441 functions.
10442 * layout.cc (add_target_dynamic_tags): Use output section for
10443 DT_PLTRELSZ and DT_JMPREL.
10444
3a44184e
ILT
104452010-01-07 Ian Lance Taylor <iant@google.com>
10446
10447 PR 11061
10448 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10449 function.
10450 (class Output_data_reloc_generic): Define.
10451 (class Output_data_reloc_base): Change base class to
10452 Output_data_reloc_generic. Change add() method to call
10453 bump_relative_reloc_count for a relative reloc. Remove
10454 sort_relocs_ field.
10455 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10456 to sort_relocs().
10457 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10458 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10459 appropriate.
10460 * layout.h (class Layout): Update declaration.
10461
ea715a34
ILT
104622010-01-07 Ian Lance Taylor <iant@google.com>
10463
10464 * output.h (class Output_data): Add const version of
10465 output_section and do_output_section.
10466 (class Output_section_data): Add const version of
10467 do_output_section.
10468 (class Output_section): Likewise.
10469 * layout.cc (Layout::add_target_dynamic_tags): New function.
10470 * layout.h (class Layout): Update declarations.
10471 * arm.cc (Target_arm::do_finalize_sections): Use
10472 add_target_dynamic_tags.
10473 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10474 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10475 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10476 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10477
659948a4
ILT
104782010-01-07 Ian Lance Taylor <iant@google.com>
10479
10480 PR 11042
10481 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10482 object as needed.
10483
9d3b86f6
ILT
104842010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10485 Ian Lance Taylor <iant@google.com>
10486
10487 PR 11019
10488 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10489 Xindex::read_symtab_xindex.
10490
bb0d3eb0
DK
104912010-01-07 Doug Kwan <dougkwan@google.com>
10492
10493 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10494 (Insn_template::thumb16_bcond_insn): New method declaration.
10495 (Insn_template): Fix spelling.
10496 (Stub::thumb16_special): New method declaration.
10497 (Stub::do_write): Define virtual method which was previously pure
10498 virtual.
10499 (Stub::do_thumb16_special): New method declaration.
10500 (Stub::do_fixed_endian_write): New template member.
10501 (Reloc_stub::do_write): Remove.
10502 (Reloc_stub::do_fixed_endian_write): Remove.
10503 (Cortex_a8_stub): New class definition.
10504 (Stub_factory::make_cortex_a8_stub): New method definition.
10505 (Stub_factory::Stub_factory): Add missing static storage class
10506 qualifier for elf32_arm_stub_a8_veneer_blx.
10507
ffeef7df
ILT
105082010-01-07 Ian Lance Taylor <iant@google.com>
10509
dc3f80fe
ILT
10510 PR 10980
10511 * options.h (class General_options): Add --warn-unresolved-symbols
10512 and --error-unresolved-symbols.
10513 * errors.cc (Errors::undefined_symbol): Implement
10514 --warn-unresolved-symbols.
10515
ffeef7df
ILT
10516 * options.h (class General_options): Add -z text and -z textoff.
10517 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10518
f1ec9ded
ST
105192010-01-06 Sriraman Tallam <tmsriram@google.com>
10520
10521 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10522 (Garbage_collection::cident_sections): New function.
10523 (Garbage_collection::add_cident_section): New function.
10524 (Garbage_collection::cident_sections_): New member.
10525 (gc_process_relocs): Add references to sections whose names are C
10526 identifiers.
10527 * gold.h (cident_section_start_prefix): New constant.
10528 (cident_section_stop_prefix): New constant.
10529 (is_cident): New function.
10530 * layout.cc (Layout::define_section_symbols): Replace string constants
10531 with the newly defined constants.
10532 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10533 C identifiers.
10534 * testsuite/Makefile.am: Add gc_orphan_section_test.
10535 * testsuite/Makefile.in: Regenerate.
10536 * testsuite/gc_orphan_section_test.cc: New file.
10537 * testsuite/gc_orphan_section_test.sh: New file.
10538
6eda8c29
ILT
105392010-01-06 Ian Lance Taylor <iant@google.com>
10540
b9674e17
ILT
10541 PR 10980
10542 * options.h (class General_options): Add --warn-shared-textrel.
10543 * layout.cc (Layout::finish_dynamic_section): Implement
10544 --warn-shared-textrel.
10545
6eda8c29
ILT
10546 PR 10980
10547 * options.h (class General_options): Add --warn-multiple-gp.
10548
32dcd44e
ILT
105492010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10550
10551 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10552 $(THREADSLIB) and $(LIBDL).
10553 * Makefile.in: Rebuild.
10554
a192ba05
ILT
105552010-01-06 Ian Lance Taylor <iant@google.com>
10556
10557 PR 10980
10558 * options.cc (General_options::parse_section_start): New function.
10559 (General_options::section_start): New function.
10560 (General_options::General_options): Initialize all members.
10561 * options.h: Include <map>
10562 (class General_options): Add --section-start. Add section_starts_
10563 member.
10564 * layout.cc (Layout::attach_allocated_section_to_segment): If
10565 --section-start was used, set the address of the segment. Remove
10566 local sort_sections.
10567 (Layout::relaxation_loop_body): If the address of the load segment
10568 has been set by --section-start, don't use it.
10569 * output.h (Output_segment::update_flags_for_output_section): New
10570 function.
10571 * output.cc (Output_segment::add_output_section): Call
10572 update_flags_for_output_section.
10573
dde3f402
ILT
105742010-01-05 Ian Lance Taylor <iant@google.com>
10575
62dfdd4d
ILT
10576 PR 10980
10577 * options.h (class General_options): Add --undefined-version.
10578 * script.cc (struct Version_expression): Add was_matched_by_symbol
10579 field.
10580 (Version_script_info::matched_symbol): New function.
10581 (Version_script_info::get_symbol_version_helper): Call
10582 matched_symbol.
10583 (Version_script_info::check_unmatched_names): New function.
10584 * script.h (class Version_script_info): Update declarations.
10585 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10586
9c4ae156
ILT
10587 * options.h (class General_options): Use DEFINE_bool_alias for
10588 allow_multiple_definition.
10589 * resolve.cc (Symbol_table::should_override): Don't test
10590 allow_multiple_definition.
10591
dde3f402
ILT
10592 PR 10980
10593 * options.h (class General_options): Add --cref.
10594 * main.cc (main): Print cref table if --cref. Don't close mapfile
10595 until after printing cref table.
10596 * cref.cc: Include "symtab.h".
10597 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10598 (Cref_table_compare::operator()): New function.
10599 (Cref_inputs::gather_cref): New function.
10600 (filecol): New static const.
10601 (Cref_inputs::print_cref): New function.
10602 (Cref::print_cref): New function.
10603 * cref.h: Include <cstdio>.
10604 (class Cref): Update declarations.
10605 * mapfile.h (Mapfile::file): New function.
10606 * object.h (class Object): Define Symbols. Declare virtual
10607 do_get_global_symbols.
10608 (Object::get_global_symbols): New function.
10609 * object.cc (Input_objects::add_object): Pass object to cref_ if
10610 --cref.
10611 (Input_objects::archive_start): Likewise.
10612 (Input_objects::archive_stop): Likewise.
10613 (Input_objects::print_cref): New function.
10614 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10615 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10616 --cref.
10617 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10618 function.
10619 * plugin.h (class Sized_pluginobj): Update declarations.
10620
8781f709
ILT
106212010-01-05 Ian Lance Taylor <iant@google.com>
10622
10623 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10624 to is_default_version. Rename insdef to insdefault.
10625 (Symbol_table::add_from_relobj): Rename def to is_default_version
10626 and local to is_forced_local.
10627 (Symbol_table::add_from_pluginobj): Likewise.
10628 (Symbol_table::add_from_dynobj): Likewise.
10629 (Symbol_table::define_special_symbol): Rename insdef to
10630 insdefault.
10631
fe35d28d
ILT
106322010-01-04 Ian Lance Taylor <iant@google.com>
10633
30bc8c46
ILT
10634 PR 10980
10635 * options.h (class General_options): Add
10636 --allow-multiple-definition and -z muldefs.
10637 * resolve.cc (Symbol_table::should_override): Don't warn about a
10638 multiple symbol definition if --allow-multiple-definition or -z
10639 muldefs.
10640
7eaea549
ILT
10641 PR 10980
10642 * options.h (class General_options): Add --add-needed and
10643 --copy-dt-needed-entries. Tweak --as-needed help entry.
10644 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10645 error if --copy-dt-needed-entries aka --add-needed is used and
10646 would cause a change in behaviour.
10647
fe35d28d
ILT
10648 PR 10980
10649 * options.h (class General_options): Add -G as a short version of
10650 --shared. Add no-op options -assert, -g, and -i.
10651
55a2bb35
ST
106522010-01-04 Sriraman Tallam <tmsriram@google.com>
10653
10654 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10655 check for .text or .gnu.linkonce.t sections.
10656 * icf.cc (Icf::find_identical_sections): Ditto.
10657 Change the detection for mangled function name within the section
10658 name.
10659 * icf.h (is_section_foldable_candidate): New function.
10660
719328e1
ILT
106612009-12-30 Ian Lance Taylor <iant@google.com>
10662
10663 PR 10980
10664 * options.h (class General_options): Permit two dashes with
10665 --retain-symbols-file.
10666
d7bb5745
ILT
106672009-12-30 Ian Lance Taylor <iant@google.com>
10668
403a15dd
ILT
10669 PR 10979
10670 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10671 don't put the file header and segment headers in the text
10672 segment.
10673
eda294df
ILT
10674 PR 10979
10675 * common.cc (Sort_commons::operator()): Stabilize sort when both
10676 entries are NULL.
10677 (Symbol_table::do_allocate_commons_list): When allocating common
10678 symbols, skip a symbol which is no longer common.
10679 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10680 an object before checking its type.
10681 * testsuite/common_test_2.c: New file.
10682 * testsuite/common_test_3.c: New file.
10683 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10684 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10685 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10686 (common_test_2_pic.o, common_test_2.so): New targets.
10687 (common_test_3_pic.o, common_test_3.so): New targets.
10688 * testsuite/Makefile.in: Rebuild.
10689
d7bb5745
ILT
10690 PR 10979
10691 * script.cc (read_input_script): If we see a new SECTIONS clause,
10692 and we have added an input section, give an error.
10693 * layout.h (class Layout): Add have_added_input_section function.
10694 Add have_added_input_section_ field.
10695 * layout.cc (Layout::Layout): Initialize
10696 have_added_input_section_.
10697 (Layout::layout): Set have_added_input_section_.
10698 (Layout::layout_eh_frame): Likewise.
10699
fc59c572
ILT
107002009-12-30 Ian Lance Taylor <iant@google.com>
10701
10702 PR 10931
10703 * options.h (class General_options): Add --sort-common option.
10704 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10705 * common.cc (Sort_common): Add sort_order parameter to
10706 constructor. Add sort_order_ field.
10707 (Sort_commons::operator): Check sort_order_.
10708 (Symbol_table::allocate_commons): Determine the sort order.
10709 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10710 Change all callers.
10711 (Symbol_table::do_allocate_commons_list): Likewise.
10712
1c74fab0
ILT
107132009-12-30 Ian Lance Taylor <iant@google.com>
10714
10715 PR 10916
10716 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10717 symbols from this object, don't change the visibility of an
10718 undefined symbol.
10719 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10720
6affe781
ILT
107212009-12-30 Ian Lance Taylor <iant@google.com>
10722
10723 PR 10861
10724 * script.h (class Version_script_info): Define Language enum.
10725 Update declarations. Define Glob, Exact, and Lookup types. Add
10726 new fields globals_, locals_, and is_finalized_.
10727 * script.cc: Various formatting fixes.
10728 (class Parser_closure): Change language_stack_ from a vector of
10729 std::string to one of Version_script_info::Language. Adjust all
10730 uses accordingly.
10731 (class Lazy_demangler): Remove.
10732 (struct Version_expression): Change language from std::string to
10733 Version_script_info::Language.
10734 (Version_script_info::Version_script_info): New function.
10735 (Version_script_info::~Version_script_info): Don't call clear.
10736 (Version_script_info::finalize): New function.
10737 (Version_script_info::build_lookup_tables): New function.
10738 (Version_script_info::build_expression_list_lookup): New
10739 function.
10740 (Version_script_info::get_symbol_version_helper): Rewrite to use
10741 lookup tables.
10742 (Version_script_info::print_expression_list): Adjust to use
10743 Version_script_info::Language.
10744 (script_push_lex_into_version_mode): Check that the version script
10745 has not been finalized.
10746 (version_script_push_lang): Change language string to
10747 Version_script_info::Language.
10748 * options.cc (Command_line::version_script): New function.
10749 * options.h (class General_options): Add finalize_dynamic_list
10750 function. Change version_script from declaration to definition.
10751 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10752 * testsuite/version_script.map: Remove duplicate def of foo.
10753 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10754 version_script.map.
10755 * testsuite/Makefile.in: Rebuild.
10756
818bf354
ILT
107572009-12-30 Ian Lance Taylor <iant@google.com>
10758
10759 PR 10843
10760 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10761 if the input symbol index is 0, make the output symbol index 0.
10762
ebcc8304
ILT
107632009-12-30 Ian Lance Taylor <iant@google.com>
10764
10765 PR 10670
10766 * options.h (class General_options): Add -x/--discard-all.
10767 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10768 --discard-all. If the local symbol needs a dynamic entry, check
10769 that before handling --discard-locals.
10770
176fe33f
ILT
107712009-12-30 Ian Lance Taylor <iant@google.com>
10772
bb321bb1
ILT
10773 PR 10450
10774 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10775 flags to PF_R.
10776 (Output_segment::add_output_section): Don't change the flags if
10777 the type is PT_TLS.
10778
176fe33f
ILT
10779 PR 10450
10780 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10781 GNU hash table if they need a dynamic value. Otherwise, don't add
10782 them if they are defined in a dynamic object or are forced local.
10783
e8cd95c7
ILT
107842009-12-29 Ian Lance Taylor <iant@google.com>
10785
1b81fb71
ILT
10786 PR 10450
10787 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10788 .gnu.hash table for a 32-bit target.
10789
8d6d383d
ILT
10790 PR 10450
10791 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10792 regular and a dynamic object only needs a dynamic symbol table
10793 entry if it is externally visible.
10794
e785ec03
ILT
10795 PR 10450
10796 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10797 constructor. Add global_offset_table_ field.
10798 (Target_i386::got_section): Set global_offset_table_.
10799 (Target_i386::do_finalize_sections): Set global_offset_table_
10800 size.
10801 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10802 in constructor. Add global_offset_table_ field.
10803 (Target_x86_64::got_section): Set global_offset_table_.
10804 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10805 size.
10806
1a2dff53
ILT
10807 * layout.cc (Layout::Layout): Initialize increase_relro_.
10808 (Layout::get_output_section): Add is_relro, is_last_relro, and
10809 is_first_non_relro parameters. Change all callers.
10810 (Layout::choose_output_section): Likewise.
10811 (Layout::add_output_section_data): Likewise.
10812 (Layout::make_output_section): Likewise.
10813 (Layout::set_segment_offsets): Clear increase_relro when using a
10814 linker script.
10815 * layout.h (class Layout): Add increase_relro method. Add
10816 increase_relro_ field. Update declarations.
10817 * output.cc (Output_section::Output_section): Initialize
10818 is_last_relro_ and is_first_non_relro_.
10819 (Output_segment::add_output_section): Group relro sections is
10820 do_sort is true. Handle is_last_relro and is_first_non_relro.
10821 (Output_segment::maximum_alignment): Remove relro handling.
10822 (Output_segment::set_section_addresses): Add increase_relro
10823 parameter. Change all callers. Add initial alignment to align
10824 relro sections on separate page. Remove old relro handling.
10825 (Output_segment::set_section_list_addresses): Remove in_relro
10826 parameter. Change all callers.
10827 (Output_segment::set_offset): Add increase parameter. Change all
10828 callers. Remove old relro handling.
10829 * output.h (class Output_section): Add new methods: is_last_relro,
10830 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10831 Add is_last_relro_ and is_first_non_relro_ fields.
10832 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10833 Create separate .got.plt section. Call increase_relro.
10834 * x86_64.cc (Target_x86_64::got_section): Likewise.
10835 * testsuite/relro_script_test.t: Add .got.plt.
10836
f0ba79e2
ILT
10837 PR 10450
10838 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10839 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10840 (Layout::finalize): Call set_dynamic_symbol_size.
10841 (Layout::set_dynamic_symbol_size): New function.
10842 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10843 set_dynamic_symbol_size.
10844
e8cd95c7
ILT
10845 PR 10450
10846 * output.h (class Output_section): Add is_entsize_zero_ field.
10847 * output.cc (Output_section::Output_section): Initialize
10848 is_entsize_zero_.
10849 (Output_section::set_entsize): If two different entsizes are
10850 requested, force it to zero.
10851 (Output_section::add_input_section): Set flags for .debug_str
10852 before updating section flags. Set entsize.
10853 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10854 and SHF_STRING if all input sections have those flags.
10855
3e1b9a8a
RÁE
108562009-12-29 Rafael Espindola <espindola@google.com>
10857
10858 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10859 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10860 reporting.
3e1b9a8a 10861
3dcad376
ST
108622009-12-29 Sriraman Tallam <tmsriram@google.com>
10863
10864 * options.cc (General_options::parse_version): Allow -v to exit
10865 without an error if there is nothing to link.
10866
084e2665
ILT
108672009-12-29 Ian Lance Taylor <iant@google.com>
10868
10869 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10870 using a version of gcc before 4.1.
10871 * configure: Rebuild.
10872
250acde3
CD
108732009-12-28 Chris Demetriou <cgd@google.com>
10874
10875 * attributes.cc (Output_attributes_section_data::do_write): Use
10876 std::vector::front rather than std::vector::data.
10877
99fff23b
ILT
108782009-12-28 Ian Lance Taylor <iant@google.com>
10879
10880 * symtab.h (class Symbol_table): Add enum Defined.
10881 * resolve.cc (Symbol_table::should_override): Add defined
10882 parameter. Change all callers. Test whether object is NULL
10883 before calling a method on it.
10884 (Symbol_table::report_resolve_problem): Add defined parameter.
10885 Change all callers.
10886 (Symbol_table::should_override_with_special): Likewise.
10887 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10888 parameter. Change all callers.
10889 (Symbol_table::do_define_in_output_data): Likewise.
10890 (Symbol_table::define_in_output_segment): Likewise.
10891 (Symbol_table::do_define_in_output_segment): Likewise.
10892 (Symbol_table::define_as_constant): Likewise.
10893 (Symbol_table::do_define_as_constant): Likewise.
10894 * script.h (class Symbol_assignment): Add is_defsym parameter to
10895 constructor; change all callers.
10896 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10897 parameter. Change all callers. Add is_defsym_ field.
10898 (class Parser_closure): Add parsing_defsym parameter to
10899 constructor; change all callers. Add parsing_defsym accessor
10900 function. Add parsing_defsym_ field.
10901
556bd683
ILT
109022009-12-28 Ian Lance Taylor <iant@google.com>
10903
10904 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10905 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10906
1782c879
ILT
109072009-12-23 Ian Lance Taylor <iant@google.com>
10908
10909 * i386.cc (Target_i386::do_calls_non_split): Recognize
10910 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10911 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10912 -fsplit-stack prologue when using %r11.
1782c879 10913
329ca2b1
ST
109142009-12-21 Sriraman Tallam <tmsriram@google.com>
10915
10916 * options.cc (General_options::parse_version): Make -v continue and do
10917 the link like GNU ld does.
10918
d675ff46
RÁE
109192009-12-17 Rafael Avila de Espindola <espindola@google.com>
10920
10921 * Makefile.am (CCFILES): Add timer.cc.
10922 (HFILES): Add timer.h.
10923 * configure.ac: Check for sysconf and times.
10924 * main.cc: include timer.h.
10925 (main): Use Timer instead of get_run_time.
10926 * timer.cc: New.
10927 * timer.h: New.
10928 * workqueue.cc: include timer.h.
10929 (Workqueue::find_and_run_task):
10930 Report user, sys and wall time.
10931 * Makefile.in: Regenerate.
10932 * config.in: Regenerate.
10933 * configure: Regenerate.
10934
d6344fb5
DK
109352009-12-16 Doug Kwan <dougkwan@google.com>
10936
10937 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10938 sections.
10939 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10940 relaxed input sections.
10941 * output.cc (Output_section::find_relaxed_input_section): Change
10942 return type to Output_relaxed_input_section pointer. Adjust code
10943 for new type of relaxed_input_section_map_.
10944 * output.h (Output_section::find_relaxed_input_section): Change
10945 return type to Output_relaxed_input_section pointer.
10946 (Output_section::Output_relaxed_input_section_by_input_section_map):
10947 New type.
10948 (Output_section::relaxed_input_section_map_): Change type to
10949 Output_section::Output_relaxed_input_section_by_input_section_map.
10950 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10951 input section.
10952
0e0d5469
ILT
109532009-12-15 Ian Lance Taylor <iant@google.com>
10954
10955 * layout.cc (Layout::create_shstrtab): Only write out after input
10956 sections if we are compressing debug sections.
10957
0649a889
ILT
109582009-12-15 Ian Lance Taylor <iant@google.com>
10959
10960 * archive.cc (Archive::add_symbols): Only look up a symbol without
10961 a version if there is, in fact, a version.
10962
2ea97941
ILT
109632009-12-14 Ian Lance Taylor <iant@google.com>
10964
10965 Revert -Wshadow changes, all changes from:
10966 2009-12-11 Doug Kwan <dougkwan@google.com>
10967 2009-12-11 Nick Clifton <nickc@redhat.com>
10968 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10969
b0eec2cc
DK
109702009-12-11 Doug Kwan <dougkwan@google.com>
10971
10972 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10973 due to -Wshadow.
10974 * attributes.cc (Object_attribute::size): Ditto.
10975 (Attributes_section_data::size): Ditto.
10976 (Attributes_section_data::Attributes_section_data): Ditto.
10977 (Output_attributes_section_data::do_write): Ditto.
10978 * attributes.h (Object_attribute::set_type): Ditto.
10979 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10980
91d6fa6a
NC
109812009-12-11 Nick Clifton <nickc@redhat.com>
10982
10983 * archive.cc: Fix shadowed variable warnings.
10984 * arm.cc: Likewise.
10985 * compressed_output.cc: Likewise.
10986 * compressed_output.h: Likewise.
10987 * configure: Likewise.
10988 * dwarf_reader.cc: Likewise.
10989 * dynobj.cc: Likewise.
10990 * dynobj.h: Likewise.
10991 * ehframe.cc: Likewise.
10992 * ehframe.h: Likewise.
10993 * errors.cc: Likewise.
10994 * expression.cc: Likewise.
10995 * fileread.cc: Likewise.
10996 * fileread.h: Likewise.
10997 * freebsd.h: Likewise.
10998 * i386.cc: Likewise.
10999 * icf.cc: Likewise.
11000 * incremental.h: Likewise.
11001 * layout.cc: Likewise.
11002 * layout.h: Likewise.
11003 * mapfile.cc: Likewise.
11004 * merge.cc: Likewise.
11005 * merge.h: Likewise.
11006 * object.cc: Likewise.
11007 * object.h: Likewise.
11008 * options.h: Likewise.
11009 * output.cc: Likewise.
11010 * output.h: Likewise.
11011 * parameters.cc: Likewise.
11012 * plugin.cc: Likewise.
11013 * powerpc.cc: Likewise.
11014 * reduced_debug_output.cc: Likewise.
11015 * reduced_debug_output.h: Likewise.
11016 * reloc.cc: Likewise.
11017 * reloc.h: Likewise.
11018 * resolve.cc: Likewise.
11019 * script-sections.cc: Likewise.
11020 * script.cc: Likewise.
11021 * script.h: Likewise.
11022 * sparc.cc: Likewise.
11023 * symtab.cc: Likewise.
11024 * symtab.h: Likewise.
11025 * target-select.cc: Likewise.
11026 * target-select.h: Likewise.
11027 * token.h: Likewise.
11028 * workqueue.cc: Likewise.
11029 * workqueue.h: Likewise.
11030 * x86_64.cc: Likewise.
11031
a0351a69
DK
110322009-12-10 Doug Kwan <dougkwan@google.com>
11033
11034 * arm.cc (attributes.h): New include.
11035 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11036 (Arm_relobj::~Arm_relobj): Delete object pointed by
11037 attributes_section_data_.
11038 (Arm_relobj::attributes_section_data): New method definition.
11039 (Arm_relobj::attributes_section_data_): New data member declaration.
11040 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11041 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11042 attributes_section_data_.
11043 (Arm_dynobj::attributes_section_data): New method definition.
11044 (Arm_dynobj::attributes_section_data_): New data member declaration.
11045 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11046 initialization value of may_use_blx_ to false.
2e702c99 11047 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11048 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11049 object attributes to compute results instead of hard-coding.
11050 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11051 Target_arm::get_secondary_compatible_arch,
11052 Target_arm::set_secondary_compatible_arch
11053 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11054 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11055 New method declarations.
11056 (Target_arm::get_aeabi_object_attribute): New method definition.
11057 (Target_arm::attributes_section_data_): New data member declaration.
11058 (read_arm_attributes_section): New template definition.
11059 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11060 (Arm_dynobj::do_read_symbols): Ditto.
11061 (Target_arm::do_finalize_sections): Merge attributes sections from
11062 input. Check for BLX use after attributes section merging.
11063 Fix __exidx_start and __exidx_end visibility. Create an
11064 .ARM.attributes section if necessary.
11065 (Target_arm::get_secondary_compatible_arch,
11066 Target_arm::set_secondary_compatible_arch,
11067 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11068 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11069 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11070 New method definitions.
11071
b59befec
ILT
110722009-12-09 Ian Lance Taylor <iant@google.com>
11073
11074 * plugin.cc (Plugin::load): Don't cast from void* to a function
11075 pointer.
11076
1276bc89
ILT
110772009-12-09 Ian Lance Taylor <iant@google.com>
11078
11079 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11080 information fields.
11081
2f2de248
L
110822009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11083
11084 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11085 Replace two_file_shared_1.so with two_file_shared_2.so.
11086 * testsuite/Makefile.in: Regenerated.
11087
4f787271
DK
110882009-12-08 Doug Kwan <dougkwan@google.com>
11089
11090 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11091 (HFILES): Add attributes.h and int_encoding.h.
11092 * Makefile.in: Regenerate.
11093 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11094 function definitions to int_encoding.cc
11095 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11096 prototypes to int_encoding.h
11097 * reduced_debug_output.cc (int_encoding.h): New include.
11098 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11099 function definitions to int_encoding.cc
11100 (insert_into_vector, read_from_pointer): Move template definitions to
11101 int_encoding.h
11102 * attributes.cc: New file.
11103 * attributes.h: New file.
11104 * int_encoding.cc: New file.
11105 * int_encoding.h: New file.
11106
20b52f1a
RÁE
111072009-12-07 Rafael Avila de Espindola <espindola@google.com>
11108
11109 PR gold/11055
11110 * incremental-dump.cc (dump_incremental_inputs): New.
11111 (main): Use dump_incremental_inputs.
11112
53d7974c
L
111132009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11114
11115 PR gold/10893
11116 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11117 checking elfcpp::STT_FUNC.
11118 (Target_i386::Relocate::relocate): Likewise.
11119 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11120
11121 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11122 symbols from shared libraries into normal FUNC symbols.
11123
11124 * symtab.h (Symbol): Add is_func and use it.
11125
05a352e6
DK
111262009-12-05 Doug Kwan <dougkwan@google.com>
11127
11128 * arm.cc (Target_arm::arm_info): Initialize new fields
11129 attributes_section and attributes_vendor.
11130 * i386.cc (Target_i386::i386_info): Same.
11131 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11132 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11133 fields attributes_section and attributes_vendor.
53d7974c 11134 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11135 * target.h (Target::attributes_section, Target::attributes_vendor,
11136 Target::is_attributes_section, Target::attribute_arg_type,
11137 Target::attributes_order): New method definitions.
11138 (Target::Target_info::attributes_section,
11139 Target::Target_info::attributes_vendor): New fields.
11140 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11141 virtual method definitions.
11142 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11143 attributes_section and attributes_vendor.
11144 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11145
f4e5969c
DK
111462009-12-05 Doug Kwan <dougkwan@google.com>
11147
11148 * arm.cc: Update comments about interworking and stub generation.
11149 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11150 considered as non-PIC.
11151 (Arm_relocate_functions::base_abs): Fix formatting.
11152 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11153 of function to use GOT entry address instead of offset.
11154 (Target_arm::Scan::global): Issue an error if a symbol would need a
11155 PLT does not get one because it is untyped. Remove code to create
11156 dynamic symbols for relative branches.
11157 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11158 takes unsigned integer instead of boolean.
11159
1abce4a6
L
111602009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11161
11162 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11163 (two_file_test_LDADD): Likewise.
11164 (common_test_1_LDADD): Likewise.
11165 (exception_test_LDADD) Likewise.
11166 (weak_test_LDADD): Likewise.
11167 (many_sections_test_LDADD): Likewise.
11168 (initpri1_LDADD): Likewise.
11169 (script_test_1_LDADD): Likewise.
11170 (script_test_2_LDADD): Likewise.
11171 (justsyms_LDADD): Likewise.
11172 (binary_test_LDADD): Likewise.
11173 (large_LDADD): Likewise.
11174 * testsuite/Makefile.in: Regenerated.
11175
adcf2816 111762009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11177
adcf2816
L
11178 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11179 (Symbol_table::override_with_special): Likewise.
11180 (Symbol_table::add_from_object): Likewise.
11181
28e67f5d
RÁE
111822009-12-04 Rafael Avila de Espindola <espindola@google.com>
11183
11184 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11185 Don't set the data_offset twice.
11186
ae10a101
RÁE
111872009-12-04 Rafael Avila de Espindola <espindola@google.com>
11188
11189 * testsuite/Makefile.in: Regenerate.
11190
f59f41f3
DK
111912009-12-03 Doug Kwan <dougkwan@google.com>
11192
11193 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11194 (Target_arm::do_finalize_sections): Add parameter for symbol table
11195 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11196 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11197 parameter for symbol table pointer.
11198 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11199 an additional parameter for a pointer to symbol table.
11200 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11201 parameter for a symbol table pointer.
11202 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11203 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11204 Ditto.
11205 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11206 parameter for a symbol table pointer.
11207
ca55d848
RÁE
112082009-12-03 Rafael Avila de Espindola <espindola@google.com>
11209
11210 * incremental.cc (Incremental_inputs_header)
11211 (Incremental_inputs_header_write, Incremental_inputs_entry)
11212 (Incremental_inputs_entry_write): Move ...
11213 * incremental.h (Incremental_inputs_header)
11214 (Incremental_inputs_header_write, Incremental_inputs_entry)
11215 (Incremental_inputs_entry_write): here.
11216
3aec4f9c
RÁE
112172009-12-02 Rafael Avila de Espindola <espindola@google.com>
11218
11219 * incremental.cc (make_sized_incremental_binary): Set the target.
11220 Error if it is incompatible.
11221 * output.h (Output_file): Add filename method.
11222
9c0ae74d
RÁE
112232009-12-02 Rafael Avila de Espindola <espindola@google.com>
11224
11225 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11226 from the get_* methods.
11227
a45500ae
RÁE
112282009-12-02 Rafael Avila de Espindola <espindola@google.com>
11229
11230 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11231 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11232 Write 0 for the data_offset of scripts.
11233
325e6408
RÁE
112342009-12-02 Rafael Avila de Espindola <espindola@google.com>
11235
11236 * testsuite/Makefile.am: Add the incremental_test.sh test.
11237 * testsuite/incremental_test.sh: New.
11238 * testsuite/incremental_test_1.c: New.
11239 * testsuite/incremental_test_2.c: New.
11240
954c3e2e
RÁE
112412009-12-01 Rafael Avila de Espindola <espindola@google.com>
11242
703d02da 11243 * incremental-dump.cc (main): Fix typos.
954c3e2e 11244
f8086623
RÁE
112452009-11-27 Rafael Avila de Espindola <espindola@google.com>
11246
11247 PR gold/11025
11248 * incremental-dump.cc (main): Use llu to print 64 bit values.
11249
3b0dd6ac
L
112502009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11251 H.J. Lu <hongjiu.lu@intel.com>
11252
11253 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11254 $(LIBDL).
11255 (incremental_dump_LDADD): Likewise.
11256 * Makefile.in: Regenerated.
11257
a6d1ef57 112582009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11259
a6d1ef57
DK
11260 Revert:
11261
11262 2009-11-25 Doug Kwan <dougkwan@google.com>
11263
11264 * arm.cc (Target_arm::Target_arm): Move method definition
11265 outside of class definition. Add code to handle
11266 --target1-rel, --target1-abs and --target2= options.
11267 (Target_arm::get_reloc_reloc_type): Change method to be
11268 non-static and const.
11269 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11270 New data member declaration.
11271 (Target_arm::Scan::local, Target_arm::Scan::global,
11272 Target_arm::Relocate::relocate,
11273 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11274 Adjust call to Target_arm::get_real_reloc_type.
11275 (Target_arm::get_real_reloc_type): Use command line options
11276 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11277 * options.h (--target1-rel, --target1-abs, --target2): New
11278 ARM-only options.
11279
50aeb7d4
DK
112802009-11-25 Doug Kwan <dougkwan@google.com>
11281
11282 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11283 class definition. Add code to handle --target1-rel, --target1-abs
11284 and --target2= options.
11285 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11286 and const.
11287 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11288 member declaration.
11289 (Target_arm::Scan::local, Target_arm::Scan::global,
11290 Target_arm::Relocate::relocate,
11291 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11292 call to Target_arm::get_real_reloc_type.
11293 (Target_arm::get_real_reloc_type): Use command line options to
11294 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11295 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11296 options.
11297
51938283
DK
112982009-11-25 Doug Kwan <dougkwan@google.com>
11299
11300 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11301 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11302 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11303 formatting.
11304 (Arm_relocate_functions::thm_call): Replace body with a call to
11305 Arm_relocate_functions::thumb_branch_common.
11306 (Arm_relocate_functions::thm_jump24,
11307 Arm_relocate_functions::thm_xpc22): New method definitions.
11308 (Arm_relocate_functions::thumb_branch_common): New method definition.
11309 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11310 operator.
11311 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11312 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11313
e2b8f3c4
RÁE
113142009-11-24 Rafael Avila de Espindola <espindola@google.com>
11315
11316 * Makefile.am: Build incremental-dump
11317 * Makefile.in: Regenerate.
11318 * incremental-dump.cc: New.
11319 * incremental.cc (Incremental_inputs_header_data,
11320 Incremental_inputs_entry_data): Move to incremental.h
11321 * incremental.h: (Incremental_inputs_header_data,
11322 Incremental_inputs_entry_data): Move from incremental.cc
11323
bcba9aec
RÁE
113242009-11-24 Rafael Avila de Espindola <espindola@google.com>
11325
11326 * incremental.cc (Incremental_inputs_header,
11327 Incremental_inputs_header_write, Incremental_inputs_entry,
11328 Incremental_inputs_entry_write): Add a typedef with the data type.
11329
7c3afe08
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): Update comment about which
11335 type has the filed descriptions.
11336
d204b6e9
DK
113372009-11-15 Doug Kwan <dougkwan@google.com>
11338
11339 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11340 (Arm_relocate_functions::arm_branch_common): Change method defintion
11341 in class definition to a method declaration and update list of formal
11342 parameters.
11343 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11344 Arm_relocation_functions::jump24): Adjust call to
11345 Arm_relocate_functions::arm_branch_common. Update list of formal
11346 parameters.
11347 (Arm_relocate_functions::xpc25): New method definition.
11348 (Arm_relocate_functions::arm_branch_common): Move method defintion
11349 out from class definition. Use stubs for mode-switching and extending
11350 branch ranges.
11351 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11352 specially. Change code to enable use of stubs in ARM branches.
11353
43d12afe
DK
113542009-11-10 Doug Kwan <dougkwan@google.com>
11355
11356 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11357 in method declaration.
11358 (Target_arm::relocate_stub): New method declaration.
11359 (Target_arm::default_target): Change to return a pointer instead of
11360 a const reference.
11361 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11362 Target_arm::default_target.
11363 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11364 method definition.
11365 (Target_arm::relocate_section): Adjust view.
11366 (Target_arm::relocate_stub): New method definition.
11367
ac33a407
DK
113682009-11-10 Doug Kwan <dougkwan@google.com>
11369
11370 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11371 a format warning.
11372 * incremental.cc (open_incremental_binary): Initialized local
11373 variables to avoid warnings.
11374 * object.cc (make_elf_object): Ditto.
11375 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11376 a format warning.
e1df38aa 11377
88ee28e9
L
11378009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11379
11380 PR gold/10930
11381 * testsuite/plugin_test.c: Include "config.h".
11382
2daedcd6
DK
113832009-11-09 Doug Kwan <dougkwan@google.com>
11384
11385 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11386 (arm_symbol_value): Remove.
11387 (Arm_relocate_functions::arm_branch_common,
11388 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11389 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11390 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11391 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11392 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11393 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11394 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11395 Arm_relocate_functions::thm_mobw_abs_nc,
11396 Arm_relocate_functions::thm_mov_abs,
11397 Arm_relocate_functions::movw_prel_nc,
11398 Arm_relocate_functions::thm_movt_abs,
11399 Arm_relocate_functions::movt_prel,
11400 Arm_relocate_functions::thm_movw_prel_nc,
11401 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11402 (Target_arm::Relocate::relocate): Only decompose address into two
11403 parts if relocation type uses the thumb-bit and pass the actual
11404 bit instead of a flag indicating that the thumb-bit is used. Adjust
11405 calls to methods in Arm_relocate_functions for this change.
11406
1276bc89 114072009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11408
11409 PR 10925
11410 * reloc.cc: Instantiate
11411 Sized_relobj::initialize_input_to_output_maps and
11412 Sized_relobj:free_input_to_output_maps.
11413
e53ad1b5
ILT
114142009-11-06 Ian Lance Taylor <iant@google.com>
11415
11416 PR 10876
11417 * defstd.cc (in_segment): Set only_if_ref true for "end".
11418
eb44217c
DK
114192009-11-06 Doug Kwan <dougkwan@google.com>
11420
11421 * arm.cc (class Reloc_stub): Correct a comment.
11422 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11423 (Target_arm::scan_section_for_stubs): New method declaration.
11424 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11425 Change methods from private to protected.
11426 (Target_arm::do_may_relax): New method definition.
11427 (Target_arm::do_relax, Target_arm::group_sections,
11428 Target_arm::scan_reloc_for_stub,
11429 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11430 (Target_arm::arm_input_section_map_): New data member declaration.
11431 (Target_arm::scan_reloc_for_stub,
11432 Target_arm::scan_reloc_section_for_stubs,
11433 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11434 Target_arm::do_relax): New method definitions.
11435
5d329b7d
ILT
114362009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11437
11438 * configure.ac: Check for (struct stat)::st_mtim
11439 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11440 * config.in: Regenerate.
11441 * configure: Regenerate.
11442
96a0d71b
ILT
114432009-11-05 Ian Lance Taylor <iant@google.com>
11444
11445 PR 10910
11446 * output.cc (Output_segment::add_output_section): Add missing
11447 return statement.
11448
594c8e5e
ILT
114492009-11-04 Ian Lance Taylor <iant@google.com>
11450
11451 PR 10880
11452 * object.h (class Object): Add is_needed and set_is_needed
11453 methods. Add is_needed_ field. Make bool fields into bitfields.
11454 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11455 defined in a dynamic object and referenced by a regular object,
11456 set is_needed for the dynamic object.
11457 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11458 if the file is marked with as_needed and it is not needed.
11459
22b127cc
ILT
114602009-11-04 Ian Lance Taylor <iant@google.com>
11461
11462 PR 10887
11463 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11464 tags if data is discarded by linker script.
11465 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11466 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11467 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11468 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11469
f5c870d2
ILT
114702009-11-04 Ian Lance Taylor <iant@google.com>
11471
11472 * layout.cc (Layout::get_output_section): Add is_interp and
11473 is_dynamic_linker_section parameters. Change all callers.
11474 (Layout::choose_output_section): Likewise.
11475 (Layout::make_output_section): Likewise.
11476 (Layout::add_output_section_data): Add is_dynamic_linker_section
11477 parameter. Change all callers.
11478 * layout.h (class Layout): Update declarations.
11479 * output.h (class Output_section): Add is_interp, set_is_interp,
11480 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11481 Add is_interp_, is_dynamic_linker_section_ fields. Change
11482 generate_code_fills_at_write_ to a bitfield.
11483 * output.cc (Output_section::Output_sections): Initialize new
11484 fields.
11485 (Output_segment::add_output_section): Add do_sort parameter.
11486 Change all callers.
11487
1ae4d23b
ILT
114882009-11-03 Ian Lance Taylor <iant@google.com>
11489
11490 PR 10860
11491 * options.h (class General_options): Add --warn-common.
11492 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11493 merging two common symbols.
11494 (Symbol_table::should_override): Handle --warn-common when merging
11495 a common symbol with a defined symbol. Use report_resolve_problem
11496 for multiple definitions.
11497 (Symbol_table::report_resolve_problem): New function.
11498 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11499
55da9579
DK
115002009-11-03 Doug Kwan <dougkwan@google.com>
11501
11502 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11503 stub_factory_.
11504 (Target_arm::stub_factory): New method definition.
11505 (Target_arm::new_arm_input_section,
11506 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11507 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11508 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11509 New type definitions.
11510 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11511 member declarations.
11512 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11513 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11514 New method definitions.
11515
37a9ac43
ILT
115162009-11-03 Ian Lance Taylor <iant@google.com>
11517
11518 * options.h (class General_options): Add --warn_constructors.
11519
b3d6a3d4
ILT
115202009-11-03 Ian Lance Taylor <iant@google.com>
11521
11522 PR 10893
11523 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11524 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11525
934b01dd
ILT
115262009-11-03 Ian Lance Taylor <iant@google.com>
11527
11528 PR 10895
11529 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11530 --msgid-bugs-address.
11531 (install-pdf): New target.
11532 (install-data_yes): Look up one directory to find mkinstalldirs.
11533
03c1939b
L
115342009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11535
11536 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11537 tree.
11538
ebd95253
DK
115392009-10-30 Doug Kwan <dougkwan@google.com>
11540
11541 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11542
e9bbb538
DK
115432009-10-30 Doug Kwan <dougkwan@google.com>
11544
11545 * arm.cc (Stub_addend_reader): New struct template definition
11546 and partial specializations.
11547 (Stub_addend_reader::operator()): New method definition for a
11548 partially specialized template.
11549
d5b40221
DK
115502009-10-30 Doug Kwan <dougkwan@google.com>
11551
11552 * arm.cc (Arm_relobj::processor_specific_flags): New method
11553 definition.
11554 (Arm_relobj::do_read_symbols): New method declaration.
11555 (Arm_relobj::processor_specific_flags_): New data member declaration.
11556 (Arm_dynobj): New class definition.
11557 (Target_arm::do_finalize_sections): Add input_objects parameter.
11558 (Target_arm::do_adjust_elf_header): New method declaration.
11559 (Target_arm::are_eabi_versions_compatible,
11560 (Target_arm::merge_processor_specific_flags): New method declaration.
11561 (Target_arm::do_make_elf_object): New overloaded method definitions
11562 and declaration.
11563 (Arm_relobj::do_read_symbols): New method definition.
11564 (Arm_dynobj::do_read_symbols): Ditto.
11565 (Target_arm::do_finalize_sections): Add input_objects parameters.
11566 Merge processor-specific flags from all input objects.
11567 (Target_arm::are_eabi_versions_compatible,
11568 Target_arm::merge_processor_specific_flags,
11569 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11570 New method definitions.
11571 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11572 Input_objects pointer type parameter.
11573 * layout.cc (Layout::finalize): Pass input objects to target's.
11574 finalize_sections function.
11575 * output.cc (Output_file_header::do_sized_write): Set ELF file
11576 header's processor-specific flags.
11577 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11578 Input_objects pointer type parameter.
11579 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11580 * target.h (Input_objects): New forward class declaration.
11581 (Target::processor_specific_flags,
11582 Target::are_processor_specific_flags_sect): New method definitions.
11583 (Target::finalize_sections): Add input_objects parameter.
11584 (Target::Target): Initialize processor_specific_flags_ and
11585 are_processor_specific_flags_set_.
11586 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11587 parameter.
11588 (Target::set_processor_specific_flags): New method definition.
11589 (Target::processor_specific_flags_,
11590 Target::are_processor_specific_flags_set_): New data member
11591 declarations.
11592 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11593 Input_objects pointer type parameter.
11594
ebabffbd
DK
115952009-10-30 Doug Kwan <dougkwan@google.com>
11596
11597 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11598
ad0f2072
ILT
115992009-10-28 Ian Lance Taylor <iant@google.com>
11600
11601 * object.h (class Relobj): Drop options parameter from
11602 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11603 do_scan_relocs, do_relocate. Change all callers.
11604 (class Sized_relobj): Drop options parameters from
11605 do_gc_process_relocs, do_scan_relocs, do_relocate,
11606 do_relocate_sections, relocate_sections, emit_relocs_scan,
11607 emit_relocs_scan_reltype. Change all callers.
11608 (struct Relocate_info): Remove options field and all references to
11609 it.
11610 * reloc.h (class Read_relocs): Remove options constructor
11611 parameter and options_ field. Change all callers.
11612 (class Gc_process_relocs, class Scan_relocs): Likewise.
11613 (class Relocate_task): Likewise.
11614 * target-reloc.h (scan_relocs): Remove options parameter. Change
11615 all callers.
11616 (scan_relocatable_relocs): Likewise.
11617 * target.h (class Sized_target): Remove options parameter from
11618 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11619 all callers.
11620 * gc.h (gc_process_relocs): Remove options parameter. Change all
11621 callers.
11622 * arm.cc: Update functions to remove options parameters.
11623 * i386.cc: Likewise.
11624 * powerpc.cc: Likewise.
11625 * sparc.cc: Likewise.
11626 * x86_64.cc: Likewise.
11627 * testsuite/testfile.cc: Likewise.
11628
8ffa3667
DK
116292009-10-28 Doug Kwan <dougkwan@google.com>
11630
11631 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11632 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11633 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11634 New method definitions.
11635
40f36857
CC
116362009-10-28 Cary Coutant <ccoutant@google.com>
11637
11638 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11639 (Plugin::cleanup_done_): New member.
11640 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11641 (Plugin_manager::cleanup_done_): Remove.
11642 (Plugin_manager::add_input_file): Edit error message.
11643 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11644 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11645
2c849493
ILT
116462009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11647
11648 * fileread.cc: (File_read::View::~View): Use the new
11649 data_ownership_ filed.
11650 (File_read::~File_read): Dispose the new whole_file_view_.
11651 (File_read::open): Mmap the whole file if needed.
11652 (File_read::open): Use whole_file_view_ instead of contents_.
11653 (File_read::find_view): Use whole_file_view_ if applicable.
11654 (File_read::do_read): Use whole_file_view_ instead of contents_.
11655 (File_read::make_view): Use whole_file_view_ instead of contents_,
11656 update File_read::View::View call.
11657 (File_read::find_or_make_view): Update File_read::View::View
11658 call.
11659 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11660 remove contents_
11661 (File_read::View::Data_ownership): New enum.
11662 (File_read::View::View): Replace bool mapped_ with Data_ownership
11663 argument.
11664 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11665 (File_read::View::data_ownership_): New field.
11666 (File_read::contents_): Remove (replaced by whole_file_view_).
11667 (File_read::whole_file_view_): New field.
11668 * options.h (class General_options): Add --keep-files-mapped.
11669
24998053
CC
116702009-10-27 Cary Coutant <ccoutant@google.com>
11671
11672 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11673 * testsuite/Makefile.am (plugin_test_5): New test case.
11674 * testsuite/Makefile.in: Regenerate.
11675
72adc4fa
DK
116762009-10-25 Doug Kwan <dougkwan@google.com>
11677
11678 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11679 from private to protected to allow access by child class.
11680 (Sized_relobj::do_relocate_sections): New method declaration.
11681 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11682 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11683 Sized_relobj::relocate_sections. Instantiate template explicitly
11684 for different target sizes and endianity.
11685
07f508a2
DK
116862009-10-24 Doug Kwan <dougkwan@google.com>
11687
11688 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11689 (Arm_input_section::as_arm_input_section): New method.
11690 (Arm_output_section): New class definition.
11691 (Arm_output_section::create_stub_group,
11692 Arm_output_section::group_sections): New method definitions.
11693
10ad9fe5
DK
116942009-10-22 Doug Kwan <dougkwan@google.com>
11695
11696 * arm.cc (Arm_input_section): New class definition.
11697 (Arm_input_section::init, Arm_input_section:do_write,
11698 Arm_input_section::set_final_data_size,
11699 Arm_input_section::do_reset_address_and_file_offset): New method
11700 definitions.
11701
56ee5e00
DK
117022009-10-21 Doug Kwan <dougkwan@google.com>
11703
11704 * arm.cc (Stub_table, Arm_input_section): New forward class
11705 declarations.
11706 (Stub_table): New class defintion.
11707 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11708 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11709 New method definition.
11710
b569affa
DK
117112009-10-21 Doug Kwan <dougkwan@google.com>
11712
11713 * arm.cc: Update copyright comments.
11714 (Target_arm): New forward class template declaration.
11715 (Arm_address): New type.
11716 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11717 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11718 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11719 constants.
11720 (Insn_template): Same.
11721 (DEF_STUBS): New macro.
11722 (Stub_type): New enum type.
11723 (Stub_template): New class definition.
11724 (Stub): Same.
11725 (Reloc_stub): Same.
11726 (Stub_factory): Same.
11727 (Target_arm::Target_arm): Initialize may_use_blx_ and
11728 should_force_pic_veneer_.
11729 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11730 Target_arm::should_force_pic_veneer,
11731 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11732 Target_arm::using_thumb_only, Target_arm:;default_target): New
11733 method defintions.
11734 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11735 New data member declarations.
11736 (Insn_template::size, Insn_template::alignment): New method defintions.
11737 (Stub_template::Stub_template): New method definition.
11738 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11739 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11740 (Stub_factory::Stub_factory): New method definition.
11741 * gold.h (string_hash): New template.
11742 * output.h (Input_section_specifier::hash_value): Use
11743 gold::string_hash.
11744 (Input_section_specifier::string_hash): Remove.
11745 * stringpool.cc (Stringpool_template::string_hash): Use
11746 gold::string_hash.
11747
6c172549
DK
117482009-10-20 Doug Kwan <dougkwan@google.com>
11749
11750 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11751 symbols of relaxed input sections.
11752 * output.h (Output_section::find_relaxed_input_section): Make
11753 method public.
11754
c5617f2f
DK
117552009-10-16 Doug Kwan <dougkwan@google.com>
11756
11757 * dynobj.cc (Versions::Versions): Initialize version_script_.
11758 Only insert base version symbol definition for a shared object
11759 if version script defines any version versions.
11760 (Versions::define_base_version): New method definition.
11761 (Versions::add_def): Check that base version is not needed.
11762 (Versions::add_need): Define base version lazily.
11763 * dynobj.h (Versions::define_base_version): New method declaration.
11764 (Versions::needs_base_version_): New data member declaration.
11765 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11766 (check_DATA): Add no_version_test.stdout.
11767 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11768 New make rules.
11769 * testsuite/Makefile.in: Regenerate.
11770 * testsuite/no_version_test.c: New file.
11771 * testsuite/no_version_test.sh: Ditto.
11772
3c12dcdb
DK
117732009-10-16 Doug Kwan <dougkwan@google.com>
11774
11775 * expression.cc (class Segment_start_expression): New class definition.
11776 (Segment_start_expression::value): New method definition.
11777 (script_exp_function_segment_start): Return a new
11778 Segment_start_expression.
11779 * gold/script-c.h (script_saw_segment_start_expression): New function
11780 prototype.
11781 * script-sections.cc (Script_sections::Script_sections): Initialize
11782 SAW_SEGMENT_START_EXPRESSION_ to false.
11783 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11784 and -Tbbs options to specify section addresses if given in
11785 command line and no SEGMENT_START expression is seen in a script.
11786 * script-sections.h (Script_sections::saw_segment_start_expression,
11787 Script_sections::set_saw_segment_start_expression): New method
11788 definition.
11789 (Script_sections::saw_segment_start_expression_): New data member
11790 declaration.
11791 * script.cc (script_saw_segment_start_expression): New function.
11792 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11793 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11794 script_test_7.sh and script_test_8.sh.
11795 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11796 script_test_8.stdout.
11797 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11798 (script_test_6, script_test_6.stdout, script_test_7,
11799 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11800 * Makefile.in: Regenerate.
11801 * testsuite/script_test_6.sh: New file.
11802 * testsuite/script_test_6.t: Same.
11803 * testsuite/script_test_7.sh: Same.
11804 * testsuite/script_test_7.t: Same.
11805 * testsuite/script_test_8.sh: Same.
11806
64b1ae37
DK
118072009-10-16 Doug Kwan <dougkwan@google.com>
11808
11809 * output.cc (Output_segment::set_section_list_address): Cast
11810 expressions to unsigned long long type to avoid format warnings.
11811
661be1e2
ILT
118122009-10-15 Ian Lance Taylor <iant@google.com>
11813
12edd763 11814 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11815 dot assignment to script_sections_.
12edd763
ILT
11816 * script-sections.cc (Script_sections::add_dot_assignment):
11817 Initialize if necessary.
11818
68b6574b
ILT
11819 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11820 program headers with no load segment if there is a linker script.
11821
661be1e2
ILT
11822 * layout.cc (Layout::set_segment_offsets): Align the file offset
11823 to the segment aligment for -N or -n with no load segment.
11824 * output.cc (Output_segment::add_output_section): Don't crash if
11825 the first section is a TLS section.
11826 (Output_segment::set_section_list_addresses): Print an error
11827 message if the address moves backward in a linker script.
11828 * script-sections.cc
11829 (Output_section_element_input::set_section_addresses): Don't
11830 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11831 (Orphan_output_section::set_section_addresses): Likewise.
11832
f15f61a7
DK
118332009-10-15 Doug Kwan <dougkwan@google.com>
11834
11835 * layout.cc (Layout::finish_dynamic_section): Generate tags
11836 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11837 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11838 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11839
82bb573a
ILT
118402009-10-14 Ian Lance Taylor <iant@google.com>
11841
11842 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11843 fields.
11844 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11845 data_shdr fields of relinfo.
11846 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11847 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11848 R_386_TLS_LDO_32, adjust based on section flags.
11849 (Target_i386::Relocate::fix_up_ldo): Remove.
11850
374ad285
ILT
118512009-10-13 Ian Lance Taylor <iant@google.com>
11852
11853 Add support for -pie.
11854 * options.h (class General_options): Add -pie and
11855 --pic-executable.
11856 (General_options::output_is_position_independent): Test -pie.
11857 (General_options::output_is_executable): Return true if not shared
11858 and not relocatable.
11859 (General_options::output_is_pie): Remove.
11860 * options.cc (General_options::finalize): Reject incompatible uses
11861 of -pie.
11862 * gold.cc (queue_middle_tasks): A -pie link is not static.
11863 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11864 * symtab.cc (Symbol::final_value_is_known): Return false if
11865 output_is_position_independent.
11866 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11867 output_is_position_independent.
11868 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11869 output_is_position_independent.
11870 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11871 output_is_position_independent.
11872 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11873 two_file_pie_test.
11874 (basic_pie_test.o, basic_pie_test): New targets.
11875 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11876 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11877 (two_file_pie_test): New target.
11878 * testsuite/Makefile.in: Rebuild.
11879 * README: Remove note saying that -pie is not supported.
11880
c6585162
ILT
118812009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11882
11883 * options.h (class General_options): Add -init and -fini.
11884 * layout.cc (Layout::finish_dynamic_section): Emit
11885 given init and fini functions.
11886
032ce4e9
ST
118872009-10-13 Sriraman Tallam <tmsriram@google.com>
11888
11889 * gc.h (gc_process_relocs): Check if icf is enabled using new
11890 function.
11891 * gold.cc (queue_initial_tasks): Likewise.
11892 (queue_middle_tasks): Likewise.
11893 * object.cc (do_layout): Likewise.
11894 * symtab.cc (is_section_folded): Likewise.
11895 * main.cc (main): Likewise.
11896 * reloc.cc (Read_relocs::run): Likewise.
11897 (Sized_relobj::do_scan_relocs): Likewise.
11898 * icf.cc (is_function_ctor_or_dtor): New function.
11899 (Icf::find_identical_sections): Check if function is ctor or dtor when
11900 safe icf is chosen.
11901 * options.h (General_options::icf): Change option to be an enum.
11902 (Icf_status): New enum.
11903 (icf_enabled): New method.
11904 (icf_safe_folding): New method.
11905 (set_icf_status): New method.
11906 (icf_status_): New variable.
11907 * (options.cc) (General_options::finalize): Set icf_status_.
11908 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11909 icf_test and icf_keep_unique_test to use the --icf enum flag.
11910 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11911 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11912
f345227a
ST
119132009-10-12 Sriraman Tallam <tmsriram@google.com>
11914
11915 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11916 includes to gc.h and icf.h.
11917 * arm.cc: Include gc.h.
11918 * gold.cc: Likewise.
11919 * i386.cc: Likewise.
11920 * powerpc.cc: Likewise.
11921 * sparc.cc: Likewise.
11922 * x86_64.cc: Likewise.
11923 * gc.h: Include icf.h.
11924
1c7814ed
ILT
119252009-10-11 Ian Lance Taylor <iant@google.com>
11926
11927 * plugin.cc: Include "gold.h" before other header files.
11928
ae3b5189
CD
119292009-10-10 Chris Demetriou <cgd@google.com>
11930
11931 * options.h (Input_file_argument::Input_file_type): New enum.
11932 (Input_file_argument::is_lib_): Replace with...
11933 (Input_file_argument::type_): New member.
11934 (Input_file_argument::Input_file_argument): Take Input_file_type
11935 'type' rather than boolean 'is_lib' as second argument.
11936 (Input_file_argument::is_lib): Use type_.
11937 (Input_file_argument::is_searched_file): New function.
11938 (Input_file_argument::may_need_search): Handle is_searched_file.
11939 * options.cc (General_options::parse_library): Support -l:filename.
11940 (General_options::parse_just_symbols): Update for Input_file_argument
11941 changes.
11942 (Command_line::process): Likewise.
11943 * archive.cc (Archive::get_file_and_offset): Likewise.
11944 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11945 * script.cc (read_script_file, script_add_file): Likewise.
11946 * fileread.cc (Input_file::Input_file): Likewise.
11947 (Input_file::will_search_for): Handle is_searched_file.
11948 (Input_file::open): Likewise.
11949 * readsyms.cc (Read_symbols::get_name): Likewise.
11950 * testsuite/Makefile.am (searched_file_test): New test.
11951 * testsuite/Makefile.in: Regenerate.
11952 * testsuite/searched_file_test.cc: New file.
11953 * testsuite/searched_file_test_lib.cc: New file.
11954
f3048a1d
ILT
119552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11956 Ian Lance Taylor <iant@google.com>
11957
11958 * descriptor.cc: Include <cstdio> and "binary-io.h".
11959 (Descriptors::open): Open the files in binary mode always.
11960 * script.cc (Lex::get_token): Treat \r as whitespace.
11961
d4780e57
ILT
119622009-10-09 Ian Lance Taylor <iant@google.com>
11963
11964 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11965
d9a893b8
ILT
119662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11967 Ian Lance Taylor <iant@google.com>
11968
11969 * configure.ac: Check for readv function also.
11970 * fileread.cc (readv): Define if not HAVE_READV.
11971 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11972 does not exist.
11973 * config.in: Regenerate.
11974 * configure: Regenerate.
11975
c0a62865
DK
119762009-10-09 Doug Kwan <dougkwan@google.com>
11977
11978 * layout.cc (Layout::make_output_section): Call target hook to make
11979 ordinary output section.
11980 (Layout::finalize): Adjust parameter list of call the
11981 Target::may_relax().
11982 * layout.h (class Layout::section_list): New method.
11983 * merge.h (Output_merge_base::entsize): Change visibility to public.
11984 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11985 New methods.
11986 (Output_merge_string::do_is_string): New method.
11987 * object.cc (Sized_relobj::do_setup): renamed from
11988 Sized_relobj::set_up.
11989 * object.h (Sized_relobj::adjust_shndx,
11990 Sized_relobj::initializ_input_to_output_maps,
11991 Sized_relobj::free_input_to_output_maps): Change visibilities to
11992 protected.
11993 (Sized_relobj::setup): Virtualize.
11994 (Sized_relobj::do_setup): New method declaration.
11995 (Sized_relobj::invalidate_section_offset,
11996 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11997 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11998 * options.cc (parse_int): New function.
11999 * options.h (parse_int): New declaration.
12000 (DEFINE_int): New macro.
12001 (stub_group_size): New option.
12002 * output.cc (Output_section::Output_section): Initialize memebers
12003 merge_section_map_, merge_section_by_properties_map_,
12004 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12005 (Output_section::add_input_section): Handled deferred code-fill
12006 generation and remove an old comment.
12007 (Output_section::add_relaxed_input_section): New method definition.
12008 (Output_section::add_merge_input_section): Use merge section by
12009 properties map to speed to search. Update merge section maps
12010 as appropriate.
12011 (Output_section::build_relaxation_map): New method definition.
12012 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12013 Same.
12014 (Output_section::relax_input_section): Renamed to
12015 Output_section::convert_input_sections_to_relaxed_sections and change
12016 interface to take a vector of pointers to relaxed sections.
12017 (Output_section::find_merge_section,
12018 Output_section::find_relaxed_input_section): New method definitions.
12019 (Output_section::is_input_address_mapped,
12020 Output_section::output_offset, Output_section::output_address):
12021 Use output section data maps to speed up searching.
12022 (Output_section::find_starting_output_address): Add comments.
12023 (Output_section::do_write,
12024 Output_section::write_to_postprocessing_buffer): Do code-fill
12025 generation as appropriate.
12026 (Output_section::get_input_sections): Invalidate relaxed input section
12027 map.
12028 (Output_section::restore_states): Adjust type of checkpoint .
12029 Invalidate relaxed input section map.
12030 * output.h (Output_merge_base): New class declaration.
12031 (Input_section_specifier): New class defintion.
12032 (class Output_relaxed_input_section) Change base class to
12033 Output_section_data_build.
12034 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12035 base class initializer.
12036 (Output_section::add_relaxed_input_section): New method declaration.
12037 (Output_section::Input_section): Change visibility to protected.
2e702c99 12038 (Output_section::Input_section::relobj,
c0a62865
DK
12039 Output_section::Input_section::shndx): Handle relaxed input sections.
12040 Output_section::input_sections) Change visibility to protected. Also
12041 define overload to return a non-const pointer.
12042 (Output_section::Merge_section_properties): New class defintion.
12043 (Output_section::Merge_section_by_properties_map,
12044 Output_section::Output_section_data_by_input_section_map,
12045 Output_section::Relaxation_map): New types.
12046 (Output_section::relax_input_section): Rename method to
12047 Output_section::convert_input_sections_to_relaxed_sections and change
12048 interface to take a vector of relaxed section pointers.
12049 (Output_section::find_merge_section,
12050 Output_section::find_relaxed_input_section,
12051 Output_section::build_relaxation_map,
12052 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12053 New method declarations.
12054 (Output_section::merge_section_map_
12055 Output_section::merge_section_by_properties_map_,
12056 Output_section::relaxed_input_section_map_,
12057 Output_section::is_relaxed_input_section_map_valid_,
12058 Output_section::generate_code_fills_at_write_): New data members.
12059 * script-sections.cc
12060 (Output_section_element_input::set_section_addresses): Call
12061 current_data_size and addralign methods of relaxed input sections.
12062 (Orphan_output_section::set_section_addresses): Call current_data_size
12063 and addralign methods of relaxed input sections.
12064 * symtab.cc (Symbol_table::compute_final_value): Extract template
12065 from the body of Symbol_table::sized_finalize_symbol.
12066 (Symbol_table::sized_finalized_symbol): Call
12067 Symbol_table::compute_final_value.
12068 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12069 (Symbol_table::compute_final_value): New templated method declaration.
12070 * target.cc (Target::do_make_output_section): New method defintion.
12071 * target.h (Target::make_output_section): New method declaration.
12072 (Target::relax): Add more parameters for input objects, symbol table
12073 and layout. Adjust call to do_relax.
12074 (Target::do_make_output_section): New method declaration.
12075 (Target::do_relax): Add parameters for input objects, symbol table
12076 and layout.
12077
d446d6c4
ILT
120782009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12079
12080 * pread.c: Include stdio.h.
12081
bc06c745
ILT
120822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12083
12084 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12085 defined.
12086
75aea3d0
ILT
120872009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12088
12089 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12090 Change read_shndx type to unsigned int.
12091 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12092 int.
12093 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12094 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12095 Change read_shndx type to unsigned int.
12096 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12097 int.
12098 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12099 * layout.cc (Layout::create_symtab_sections): Cast the result of
12100 local_symcount * symsize to off_t in the gold_assert.
12101
be8fcb75
ILT
121022009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12103
12104 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12105 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12106 R_ARM_BASE_ABS.
12107 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12108 (Arm_relocate_functions::thm_abs5): New function.
12109 (Arm_relocate_functions::abs12): New function.
12110 (Arm_relocate_functions::abs16): New function.
12111 (Arm_relocate_functions::base_abs): New function.
12112 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12113 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12114 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12115 R_ARM_BASE_ABS.
12116 (Scan::global): Likewise.
12117 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12118 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12119 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12120 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12121 R_ARM_BASE_ABS.
12122
c2a122b6
ILT
121232009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12124
12125 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12126 (Arm_relocate_functions::movt_prel): New function.
12127 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12128 (Arm_relocate_functions::thm_movt_prel): New function.
12129 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12130 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12131 (Scan::global, Relocate::relocate): Likewise.
12132 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12133
c4aa1e2d
ILT
121342009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12135
12136 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12137 Incremental_checker.
12138 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12139 unsigned int.
12140 (class Incremental_inputs_header): New class.
12141 (Incremental_inputs_header_writer): Edit comment.
12142 (Incremental_inputs_entry): New class.
12143 (Incremental_inputs_entry_writer): Edit comment.
12144 (Sized_incremental_binary::do_find_incremental_inputs_section):
12145 Add *strtab_shndx parameter, fill it.
12146 (Sized_incremental_binary::do_check_inputs): New method.
12147 (Incremental_checker::can_incrementally_link_output_file): Use
12148 Sized_incremental_binary::check_inputs.
12149 (Incremental_inputs::report_command_line): Save command line in
12150 command_line_.
12151 * incremental.h:
12152 (Incremental_binary::find_incremental_inputs_section): New
12153 method.
12154 (Incremental_binary::do_find_incremental_inputs_section): Add
12155 strtab_shndx parameter.
12156 (Incremental_binary::do_check_inputs): New pure virtual method.
12157 (Sized_incremental_binary::do_check_inputs): Declare.
12158 (Incremental_checker::Incremental_checker): Add incremental_inputs
12159 parameter, use it to initialize incremental_inputs_.
12160 (Incremental_checker::incremental_inputs_): New field.
12161 (Incremental_checker::command_line): New method.
12162 (Incremental_checker::inputs): New method.
12163 (Incremental_checker::command_line_): New field.
12164
c549a694
ILT
121652009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12166
12167 * incremental.cc: Include <cstdarg> and "target-select.h".
12168 (vexplain_no_incremental): New function.
12169 (explain_no_incremental): New function.
12170 (Incremental_binary::error): New method.
12171 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12172 method.
12173 (make_sized_incremental_binary): New function.
12174 (open_incremental_binary): New function.
12175 (can_incrementally_link_file): Add checks if output is ELF and has
12176 inputs section.
12177 * incremental.h: Include "elfcpp_file.h" and "output.h".
12178 (Incremental_binary): New class.
12179 (Sized_incremental_binary): New class.
12180 (open_incremental_binary): Declare.
12181 * object.cc (is_elf_object): Use
12182 elfcpp::Elf_recognizer::is_elf_file.
12183 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12184 * output.h (Output_file::filesize): New method.
12185
fd3c5f0b
ILT
121862009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12187
12188 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12189 New function.
12190 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12191 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12192 function.
12193 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12194 function.
12195 (Arm_relocate_functions::movw_abs_nc): New function.
12196 (Arm_relocate_functions::movt_abs): New function.
12197 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12198 (Arm_relocate_functions::thm_movt_abs): New function.
12199 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12200 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12201 (Scan::global): Likewise.
12202 (Relocate::relocate): Likewise.
12203 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12204
7f5309a5
ILT
122052009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12206
12207 * arm.cc (Arm_relocate_functions::got_prel) New function.
12208 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12209 (Relocate::relocate): Likewise.
12210 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12211
364c7fa5
ILT
122122009-10-06 Ian Lance Taylor <iant@google.com>
12213
12214 * options.h (class General_options): Define
12215 split_stack_adjust_size parameter.
12216 * object.h (class Object): Add uses_split_stack_ and
12217 has_no_split_stack_ fields. Add uses_split_stack and
12218 has_no_split_stack accessor functions. Declare
12219 handle_split_stack_section.
12220 (class Reloc_symbol_changes): Define.
12221 (class Sized_relobj): Define Function_offsets. Declare
12222 split_stack_adjust, split_stack_adjust_reltype, and
12223 find_functions.
12224 * object.cc (Object::handle_split_stack_section): New function.
12225 (Sized_relobj::do_layout): Call handle_split_stack_section.
12226 * dynobj.cc (Sized_dynobj::do_layout): Call
12227 handle_split_stack_section.
12228 * reloc.cc (Sized_relobj::relocate_sections): Call
12229 split_stack_adjust for executable sections in split_stack
12230 objects. Pass reloc_map to relocate_section.
12231 (Sized_relobj::split_stack_adjust): New function.
12232 (Sized_relobj::split_stack_adjust_reltype): New function.
12233 (Sized_relobj::find_functions): New function.
12234 * target-reloc.h: Include "object.h".
12235 (relocate_section): Add reloc_symbol_changes parameter. Change
12236 all callers.
12237 * target.h (class Target): Add calls_non_split method. Declare
12238 do_calls_non_split virtual method. Declare match_view and
12239 set_view_to_nop.
12240 * target.cc: Include "elfcpp.h".
12241 (Target::do_calls_non_split): New function.
12242 (Target::match_view): New function.
12243 (Target::set_view_to_nop): New function.
12244 * gold.cc (queue_middle_tasks): Give an error if mixing
12245 split-stack and non-split-stack objects with -r.
12246 * i386.cc (Target_i386::relocate_section): Add
12247 reloc_symbol_changes parameter.
12248 (Target_i386::do_calls_non_split): New function.
12249 * x86_64.cc (Target_x86_64::relocate_section): Add
12250 reloc_symbol_changes parameter.
12251 (Target_x86_64::do_calls_non_split): New function.
12252 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12253 parameter.
12254 * powerpc.cc (Target_powerpc::relocate_section): Add
12255 reloc_symbol_changes parameter.
12256 * sparc.cc (Target_sparc::relocate_section): Add
12257 reloc_symbol_changes parameter.
12258 * configure.ac: Call AM_CONDITIONAL for the default target.
12259 * configure: Rebuild.
12260 * testsuite/Makefile.am (TEST_AS): New variable.
12261 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12262 (check_DATA): Add split_i386 and split_x86_64 files.
12263 (SPLIT_DEFSYMS): Define.
12264 (split_i386_[1234n].o): New targets.
12265 (split_i386_[124]): New targets.
12266 (split_i386_[1234r].stdout): New targets.
12267 (split_x86_64_[1234n].o): New targets.
12268 (split_x86_64_[124]): New targets.
12269 (split_x86_64_[1234r].stdout): New targets.
12270 (MOSTLYCLEANFILES): Add new executables.
12271 * testsuite/split_i386.sh: New file.
12272 * testsuite/split_x86_64.sh: New file.
12273 * testsuite/split_i386_1.s: New file.
12274 * testsuite/split_i386_2.s: New file.
12275 * testsuite/split_i386_3.s: New file.
12276 * testsuite/split_i386_4.s: New file.
12277 * testsuite/split_i386_n.s: New file.
12278 * testsuite/split_x86_64_1.s: New file.
12279 * testsuite/split_x86_64_2.s: New file.
12280 * testsuite/split_x86_64_3.s: New file.
12281 * testsuite/split_x86_64_4.s: New file.
12282 * testsuite/split_x86_64_n.s: New file.
12283 * testsuite/testfile.cc (Target_test): Update relocation_section
12284 function.
12285 * testsuite/Makefile.in: Rebuild.
12286
e8a9fcda
ILT
122872009-10-06 Ian Lance Taylor <iant@google.com>
12288
12289 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12290 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12291 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12292 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12293 the address on ldo_addrs_.
12294 (Target_i386::Relocate::fix_up_ldo): New function.
12295
e99daf92
ILT
122962009-10-06 Rafael Espindola <espindola@google.com>
12297
12298 * plugin.cc (add_input_library): New.
12299 (Plugin::load): Add add_input_library to tv.
12300 (Plugin_manager::add_input_file): Add the is_lib argument.
12301 (add_input_file): Update call to Plugin_manager::add_input_file.
12302 (add_input_library): New.
12303 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12304
966d4097
DK
123052009-09-30 Doug Kwan <dougkwan@google.com>
12306
12307 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12308 symbol and call Symbol::may_need_copy_reloc to determine if
12309 a copy reloc is needed.
12310 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12311 nocopyreloc is given in command line.
12312 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12313 given in command line.
12314 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12315 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12316 of the removed Target_i386::may_need_copy_reloc.
12317 * options.h (copyreloc): New option with default value false.
12318 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12319 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12320 instead of the removed Target_powerpc::may_need_copy_reloc.
12321 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12322 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12323 instead of the removed Target_sparc::may_need_copy_reloc.
12324 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12325 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12326 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12327 instead of the removed Target_x86_64::may_need_copy_reloc.
12328
029ba973
ILT
123292009-09-30 Ian Lance Taylor <iant@google.com>
12330
12331 * object.h (class Object): Remove target_ field, and target,
12332 sized_target, and set_target methods.
12333 (Object::sized_target): Remove.
12334 (class Sized_relobj): Update declarations. Remove sized_target.
12335 * object.cc (Sized_relobj::setup): Remove target parameter.
12336 Change all callers.
12337 (Input_objects::add_object): Don't do anything with the target.
12338 (make_elf_sized_object): Add punconfigured parameter. Change all
12339 callers. Set or test parameter target.
12340 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12341 Change all callers.
12342 * parameters.cc (Parameters::set_target): Change parameter type to
12343 be non-const.
12344 (Parameters::default_target): Remove.
12345 (set_parameters_target): Change parameter type to be non-const.
12346 (parameters_force_valid_target): New function.
12347 (parameters_clear_target): New function.
12348 * parameters.h (class Parameters): Update declarations. Remove
12349 default_target method. Add sized_target and clear_target
12350 methods. Change target_ to be non-const.
12351 (set_parameters_target): Update declaration.
12352 (parameters_force_valid_target): Declare.
12353 (parameters_clear_target): Declare.
12354 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12355 as NULL if we aren't searching.
12356 (Add_symbols::run): Don't check for compatible target.
12357 * fileread.cc (Input_file::open_binary): Call
12358 parameters_force_valid_target.
12359 * gold.cc (queue_middle_tasks): Likewise.
12360 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12361 set_target on object.
12362 * dynobj.h (class Sized_dynobj): Update declarations.
12363 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12364 make_elf_object returns NULL.
12365 (Archive::include_member): Don't check whether object target is
12366 compatible.
12367 * output.cc (Output_section::add_input_section): Get target from
12368 parameters.
12369 (Output_section::relax_input_section): Likewise.
12370 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12371 parameters.
12372 (Sized_relobj::do_scan_relocs): Likewise.
12373 (Sized_relobj::relocate_sections): Likewise.
12374 * resolve.cc (Symbol_table::resolve): Likewise.
12375 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12376 parameter. Change all callers.
12377 (Symbol_table::add_from_object): Get target from parameters.
12378 (Symbol_table::add_from_relobj): Don't check object target.
12379 (Symbol_table::add_from_dynobj): Likewise.
12380 (Symbol_table::define_special_symbol): Get target from
12381 parameters.
12382 * symtab.h (class Symbol_table): Update declaration.
12383 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12384 parameter. Change all callers. Clear parameter target.
12385 (Binary_test): Test target here.
12386 * testsuite/object_unittest.cc (gold_testsuite): Remove
12387 target_test_pointer parameter. Change all callers.
12388 (Object_test): Test target here.
12389
a6a22b83
ILT
123902009-09-26 Ian Lance Taylor <iant@google.com>
12391
12392 * testsuite/initpri1.c: Don't try to use constructor priorities if
12393 compiling with gcc before 4.3.
12394
6a8f49fe
ILT
123952009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12396
12397 * testsuite/retain_symbols_file_test.sh (check_present): Change
12398 output file name to retain_symbols_file_test.stdout.
12399 (check_absent): Likewise.
12400
8c604651
CS
124012009-09-18 Craig Silverstein <csilvers@google.com>
12402
12403 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12404 * options.cc: Include <cerrno> and <fstream>.
12405 (General_options::finalize): Parse -retain-symbols-file tag.
12406 * options.h: New flag.
12407 (General_options): New method should_retain_symbol, new
12408 variable symbols_to_retain.
12409 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12410 should_retain_symbol map.
12411 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12412 * testsuite/Makefile.in: Regenerate.
12413 * testsuite/retain_symbols_file_test.sh: New file.
12414
ca58b19f
NC
124152009-09-18 Nick Clifton <nickc@redhat.com>
12416
12417 * po/es.po: Updated Spanish translation.
12418
20e6d0d6
DK
124192009-09-17 Doug Kwan <dougkwan@google.com>
12420
12421 * debug.h (DEBUG_RELAXATION): New constant.
12422 (DEBUG_ALL): Add DEBUG_RELAXATION.
12423 (debug_string_to_enum): Add relaxation debug option.
12424 * layout.cc
12425 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12426 Layout::Relaxation_debug_check::read_sections,
12427 Layout::Relaxation_debug_check::read_sections): New method definitions.
12428 (Layout::Layout): Initialize data members
12429 record_output_section_data_from_scrips_,
12430 script_output_section_data_list_ and relaxation_debug_check_.
12431 (Layout::save_segments, Layout::restore_segments,
12432 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12433 Layout::relaxation_loop_body): New method definitions.
12434 (Layout::finalize): Support relaxation. Move section layout code to
12435 Layout::relaxation_loop_body.
12436 (Layout::set_asection_address_from_script): Move code for orphan
12437 section placement out.
12438 (Layout::place_orphan_sections_in_script): New method definition.
12439 * layout.h (Output_segment_headers, Output_file_header):
12440 New forward class declarations.
12441 (Layout::~Layout): Define.
12442 (Layout::new_output_section_data_from_script): New method definition.
12443 (Layout::place_orphan_sections_in_script): New method declaration.
12444 (Layout::Segment_states): New type declaration.
12445 (Layout::save_segments, Layout::restore_segments,
12446 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12447 Layout::relaxation_loop_body): New method declarations.
12448 (Layout::Output_section_data_list): New type declaration.
12449 (Layout::Relaxation_debug_check): New class definition.
12450 (Layout::record_output_section_data_from_script_,
12451 Layout::script_output_section_data_list_, Layout::segment_states_,
12452 Layout::relaxation_debug_check_): New data members.
12453 * output.cc: (Output_section_headers::do_size): New method definition.
12454 (Output_section_headers::Output_section_headers): Move size
12455 computation to Output_section_headers::do_size.
12456 (Output_segment_headers::do_size): New method definition.
e1df38aa 12457 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12458 Output_file_header::do_size and call it.
12459 (Output_file_header::do_size): New method definition.
12460 (Output_data_group::Output_data_group): Adjust call to
12461 Output_section_data.
12462 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12463 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12464 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12465 RELAXED_INPUT_SECTION_CODE.
12466 (Output_section::Output_section): Initialize data member checkpoint_.
12467 (Output_section::~Output_section): Delete checkpoint object pointed
12468 by checkpoint_.
12469 (Output_section::add_input_section): Always add an Input_section if
12470 relaxing.
12471 (Output_section::add_merge_input_section): Add assert.
12472 (Output_section::relax_input_section): New method definition.
12473 (Output_section::set_final_data_size): Set load address to zero for
12474 an unallocated section.
12475 (Output_section::do_address_and_file_offset_have_reset_values):
12476 New method definition.
12477 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12478 Handle relaxed input section.
12479 (Output_section::sort_attached_input_sections): Checkpoint input
12480 section list lazily.
12481 (Output_section::get_input_sections): Change type of input_sections to
12482 list of Simple_input_section pointers. Checkpoint input section list
12483 lazily. Also handle relaxed input sections.
12484 (Output_section::add_input_section_for_script): Take a reference to
12485 a Simple_input_section object instead of Relobj pointer and section
12486 index as parameter. Handle relaxed input sections.
12487 (Output_section::save_states, Output_section::restore_states): New
12488 method definitions.
12489 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12490 (Output_data::is_data_size_fixed): New method definition.
12491 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12492 if it is fixed.
12493 (Output_data::address_and_file_offset_have_reset_values): New method
12494 definition.
12495 (Output_data::do_address_and_file_offset_have_reset_values): New method
12496 definition.
12497 (Output_data::set_data_size): Check that data size is not fixed.
12498 (Output_data::fix_data_size): New method definition.
12499 (Output_data::is_data_size_fixed_): New data member.
12500 (Output_section_headers::set_final_data_size): New method definition.
12501 (Output_section_headers::do_size): New method declaration.
12502 (Output_segment_headers::set_final_data_size): New method definition.
12503 (Output_segment_headers::do_size): New method declaration.
12504 (Output_file_header::set_final_data_size)::New method definition.
12505 (Output_file_header::do_size)::New method declaration.
12506 (Output_section_data::Output_section_data): Add new parameter
12507 is_data_size_fixed and use it to fix data size.
12508 (Output_data_const::Output_data_const): Adjust call to base class
12509 constructor and fix data size.
12510 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12511 base class constructor and fix data size.
12512 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12513 base class constructor and fix data size.
12514 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12515 class constructor and fix data size.
12516 (Output_data_group::set_final_data_size): New method definition.
12517 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12518 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12519 class constructor and fix data size.
12520 (Output_relaxed_input_section): New class definition.
12521 (Output_section::Simple_input_section): New class definition.
12522 (Output_section::get_input_sections): Adjust parameter list.
12523 (Output_section::add_input_section_for_script): Same.
12524 (Output_section::save_states, Output_section::restore_states,
12525 Output_section::do_address_and_file_offset_have_reset_values,
12526 (Output_section::Input_section::Input_section): Handle
12527 RELAXED_INPUT_SECTION_CODE. Add new overload for
12528 Output_relaxed_input_section.
12529 (Output_section::Input_section::is_input_section,
12530 Output_section::Input_section::set_output_section): Handle relaxed
12531 input section.
12532 (Output_section::Input_section::is_relaxed_input_section,
12533 Output_section::Input_section::output_section_data,
12534 Output_section::Input_section::relaxed_input_section): New method
12535 definitions.
12536 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12537 value.
12538 (Output_section::Input_section::u1_): Update comments.
12539 (Output_section::Input_section::u2_): Add new union member poris.
12540 (Output_section::Checkpoint_output_section): New classs definition.
12541 (Output_section::relax_input_section): New method declaration.
12542 (Output_section::checkpoint_): New data member.
12543 (Output_segment): Update comments.
12544 (Output_segment::Output_segment): Un-privatize copy constructor.
12545 (Output_segment::operator=): Un-privatize.
12546 * script-sections.cc (Output_section_element::Input_section_list):
12547 Change element type to Output_section::Simple_input_section.
12548 (Output_section_element_dot_assignment::set_section_addresses):
12549 Register output section data for relaxation clean up.
12550 (Output_data_exression::Output_data_expression): Adjust call to base
12551 constructor to fix data size.
12552 (Output_section_element_data::set_section_addresses): Register
12553 Output_data_expression object for relaxation clean up.
12554 (struct Input_section_info): Replace Relobj pointer and section index
12555 pair with Output_section::Simple_input_section and Convert struct to a
12556 class.
12557 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12558 Input_section_info data member to use accessors.
20e6d0d6
DK
12559 (Output_section_element_input::set_section_addresses): Use layout
12560 parameter. Adjust code to use Output_section::Simple_input_section
12561 and Input_secction_info classes. Register filler for relaxation
12562 clean up.
12563 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12564 and section index pair with Output_section::Simple_input_section
12565 class. Adjust code accordingly.
12566 (Phdrs_element::release_segment): New method definition.
12567 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12568 segment list.
12569 (Script_sections::release_segments): New method definition.
12570 * gold/script-sections.h (Script_sections::release_segments): New
12571 method declaration.
12572 * gold/target.h (Target::may_relax, Target::relax,
12573 Target::do_may_relax, Target::do_relax): New method definitions.
12574
5e445df6
ILT
125752009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12576
12577 * arm.cc (has_signed_unsigned_overflow): New function.
12578 (Arm_relocate_functions::abs8): New function.
12579 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12580 (Target_arm::Scan::global): Likewise.
12581 (Target_arm::relocate::relocate): Likewise.
12582 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12583 Likewise.
12584
8c604651 125852009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12586
12587 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12588 * testsuite/Makefile.in: Regenerate.
12589
1e9cc1c2
NC
125902009-09-11 Nick Clifton <nickc@redhat.com>
12591
12592 * po/gold.pot: Updated by the Translation project.
12593
6a89f575
CC
125942009-09-08 Cary Coutant <ccoutant@google.com>
12595
12596 * output.cc (Output_file::open): Add execute permission to empty file.
12597 * testsuite/Makefile.am (permission_test): New test.
12598 * testsuite/Makefile.in: Regenerate.
12599
fdcac5af
ILT
126002009-09-02 Ian Lance Taylor <iant@google.com>
12601
12602 * output.cc (Output_file::resize): Call map_no_anonymous rather
12603 than map.
12604
44453f85
ILT
126052009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12606
12607 * gold.cc: Include "incremental.h".
12608 (queue_initial_tasks): Call Incremental_checker methods.
12609 * incremental.cc: Include "output.h".
12610 (Incremental_checker::can_incrementally_link_output_file): New
12611 method.
12612 * incremental.h (Incremental_checker): New class.
12613
12614 * output.cc (Output_file::open_for_modification): New method.
12615 (Output_file::map_anonymous): Changed return type to bool. Record
12616 map in base_ field.
12617 (Output_file::map_no_anonymous): New method, broken out of map.
12618 (Output_file::map): Use map_no_anonymous and map_anonymous.
12619 * output.h (class Output_file): Update declarations.
12620
293c1386
CC
126212009-08-24 Cary Coutant <ccoutant@google.com>
12622
12623 * options.h (Command_line::Pre_options): New class.
12624 (Command_line::pre_options): New member.
12625 * options.cc (gold::options::ready_to_register): New variable.
12626 (One_option::register_option): Do nothing if not registering options.
12627 Assert if same short option registered twice.
12628 (General_options::General_options): Turn off option registration when
12629 done constructing.
12630 (Command_line::Pre_options::Pre_options): New constructor.
12631
f773f3d2
CC
126322009-08-24 Cary Coutant <ccoutant@google.com>
12633
06a73cfe
CC
12634 * options.h (General_options::no_keep_memory): Remove incorrect
12635 short option.
f773f3d2 12636
a15af8e2
RW
126372009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12638
12639 * Makefile.am (am__skiplex, am__skipyacc): New.
12640 * Makefile.in: Regenerate.
12641
c462b41b
RW
126422009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12643
14ec8efd
RW
12644 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12645 (INCLUDES): ... this.
12646 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12647 (AM_CPPFLAGS): Renamed from ...
12648 (INCLUDE): ... this.
12649 * Makefile.in, testsuite/Makefile.in: Regenerate.
12650
81ecdfbb
RW
12651 * Makefile.in: Regenerate.
12652 * aclocal.m4: Likewise.
12653 * config.in: Likewise.
12654 * configure: Likewise.
12655 * testsuite/Makefile.in: Likewise.
12656
c462b41b
RW
12657 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12658 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12659 * Makefile.in: Regenerate.
12660 * testsuite/Makefile.in: Regenerate.
12661
2da73f13
CC
126622009-08-19 Cary Coutant <ccoutant@google.com>
12663
12664 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12665 symbols in shared libraries overridden by hidden or internal symbols
12666 in the main program.
12667
2db70501
CD
126682009-08-19 Chris Demetriou <cgd@google.com>
12669
12670 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12671 checking source file names in error messages.
12672
f733487b
DK
126732009-08-18 Doug Kwan <dougkwan@google.com>
12674
12675 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12676 an elcpp::Ehdr as parameter. Adjust call to set_target.
12677 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12678 an elfcpp::Ehdr as parameter.
12679 * object.cc (Object::set_target): Remove the version that looks up
12680 a target and sets it.
12681 (Sized_relobj::setup): Take a Target object instead of
12682 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12683 (make_elf_sized_object): Find target and ask target to
12684 make an ELF object.
12685 * object.h: (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.
12689 * target.cc: Include dynobj.h.
12690 (Target::do_make_elf_object_implementation): New.
2e702c99 12691 (Target::do_make_elf_object): New.
f733487b
DK
12692 * target.h (Target::make_elf_object): New template declaration.
12693 (Target::do_make_elf_object): New method declarations.
12694 (Target::do_make_elf_object_implementation): New template declaration.
12695
cc70f101
ILT
126962009-08-14 Ian Lance Taylor <iant@google.com>
12697
12698 * gold.h (FUNCTION_NAME): Define.
12699 (gold_unreachable): Use FUNCTION_NAME.
12700
ef5e0cb1
ST
127012009-08-12 Sriraman Tallam <tmsriram@google.com>
12702
12703 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12704 symbol in the --keep-unique list is not found.
12705
48c187ce
ST
127062009-08-12 Sriraman Tallam <tmsriram@google.com>
12707
12708 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12709 been maked as --keep-unique.
12710 (Icf::unfold_section): New function.
12711 * icf.h (Icf::unfold_section): New function.
12712 * options.h (General_options::keep_unique): New option.
12713 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12714 * testsuite/Makefile.in: Regenerate.
12715 * testsuite/icf_keep_unique_test.sh: New file.
12716 * testsuite/icf_keep_unique_test.cc: New file.
12717
645afe0c
CC
127182009-08-12 Cary Coutant <ccoutant@google.com>
12719
12720 PR 10471
12721 * resolve.cc (Symbol_table::resolve): Check for references from
12722 dynamic objects to hidden and internal symbols.
12723 * testsuite/Makefile.am (hidden_test.sh): New test.
12724 * testsuite/Makefile.in: Regenerate.
12725 * testsuite/hidden_test.sh: New script.
12726 * testsuite/hidden_test_1.c: New test source.
12727 * testsuite/hidden_test_main.c: New test source.
12728
11af873f
DK
127292009-08-11 Doug Kwan <dougkwan@google.com>
12730
12731 * arm.cc: Update comments.
12732 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12733 segment to locate the .ARM.exidx section if present.
12734
b9f7d72d
DK
127352009-08-09 Doug Kwan <dougkwan@google.com>
12736
12737 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12738 patch.
12739
ddd3c53c
ST
127402009-08-07 Sriraman Tallam <tmsriram@google.com>
12741 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12742 compiler warnings.
12743
27721062
ST
127442009-08-06 Sriraman Tallam <tmsriram@google.com>
12745
12746 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12747 valid tls_segment only for non-debug-section relocations.
12748 * testsuite/Makefile.am: Add gc_tls_test.
12749 * testsuite/Makefile.in: Regenerate.
12750 * testsuite/gc_tls_test.cc: New file.
12751 * testsuite/gc_tls_test.sh: New file.
12752
ef15dade 127532009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12754
ef15dade
ST
12755 * icf.cc: New file.
12756 * icf.h: New file.
12757 * Makefile.am (CCFILES): Add icf.cc.
12758 (HFILES): Add icf.h
12759 * Makefile.in: Regenerate.
12760 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12761 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12762 section, symbol and addend information for the relocs.
12763 * gold.cc (queue_middle_tasks): Call identical code folding.
12764 * gold.h: Add defines for multimap.
12765 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12766 to the call of finalize_local_symbols.
12767 * main.cc (main): Create object of class Icf.
12768 * object.cc (Sized_relobj::do_layout): Allow this function to be
12769 called twice during icf.
12770 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12771 to sections marked as identical by icf.
12772 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12773 when available.
12774 (Sized_relobj::do_section_entsize): New function.
12775 * object.h (Object::section_entsize): New function.
12776 (Object::do_section_entsize): New pure virtual function.
12777 (Relobj::finalize_local_symbols): Add new parameter.
12778 (Relobj::do_section_entsize): New function.
12779 * options.h (General_options::icf): New option.
12780 (General_options::icf_iterations): New option.
12781 (General_options::print_icf_sections): New option.
12782 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12783 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12784 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12785 icf.
12786 * symtab.cc (Symbol_table::is_section_folded): New function.
12787 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12788 to sections marked as identical by icf.
12789 * symtab.h (Symbol_table::set_icf): New function.
12790 (Symbol_table::icf): New function.
12791 (Symbol_table::is_section_folded): New function.
12792 (Symbol_table::icf_): New data member.
12793 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12794 * testsuite/Makefile.am: Add commands to build icf_test.
12795 * testsuite/Makefile.in: Regenerate.
12796 * testsuite/icf_test.sh: New file.
12797 * testsuite/icf_test.cc: New file.
12798
c3b65ac4
CD
127992009-07-24 Chris Demetriou <cgd@google.com>
12800
12801 * layout.cc (is_compressible_debug_section): Fix incorrect
12802 comment about compressed section names.
12803
1caf2c51
ILT
128042009-07-20 Ian Lance Taylor <ian@airs.com>
12805
12806 PR 10419
12807 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12808
1ef4d87f
ILT
128092009-07-16 Ian Lance Taylor <iant@google.com>
12810
12811 PR 10400
12812 * layout.h: #include <map>.
12813 (class Kept_section): Change from struct to class. Add accessors
12814 and setters. Add section size to Comdat_group mapping. Change
12815 Comdat_group to std::map. Add is_comdat_ field. Add
12816 linkonce_size field in union.
12817 (class Layout): Update declaration of find_or_add_kept_section.
12818 Don't declare find_kept_object.
12819 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12820 parameter. Add object, shndx, is_comdat, and is_group_name
12821 parameters. Change all callers. Adjust for new Kept_section.
12822 (Layout::find_kept_object): Remove.
12823 * object.cc (Sized_relobj::include_section_group): Update use of
12824 Kept_section. Rename secnum to shndx. Only record
12825 Kept_comdat_section if sections are the same size.
12826 (Sized_relobj::include_linkonce_section): Update use of
12827 Kept_section. Only record Kept_comdat_section if sections are the
12828 same size. Set size of linkonce section.
12829 (Sized_relobj::map_to_kept_section): Update call to
12830 get_kept_comdat_section.
12831 * object.h (class Sized_relobj): Rename fields in
12832 Kept_comdat_section to drop trailing underscores; change object
12833 field to Relobj*. Change Kept_comdat_section_table to store
12834 struct rather than pointer.
12835 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12836 Add kept_object and kept_shndx parameters. Change all callers.
12837 (Sized_relobj::get_kept_comdat_section): Change return type to
12838 bool. Add kept_object and kept_shndx parameters. Change all
12839 callers.
12840 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12841 Layout::find_or_add_kept_section.
12842
37c3b7b0
ILT
128432009-07-09 Ian Lance Taylor <iant@google.com>
12844
12845 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12846 Reserve space in the hash table.
12847
98fa85cb
ILT
128482009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12849
12850 * fileread.cc (File_read::get_mtime): New method.
12851 * fileread.h (Timespec): New structure.
12852 (File_read::get_mtime): New method.
12853 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12854 Renamed from timestamp_nsec.
12855 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12856 Elf_Xword.
e1df38aa 12857 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12858 timestamp_nsec.
e1df38aa 12859 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12860 (Incremental_inputs::report_obejct): Save mtime; style fix.
12861 (Incremental_inputs::report_script): Save mtime; style fix.
12862 (Incremental_inputs::finalize_inputs): Style fix.
12863 (Incremental_inputs::finalize): Style fix.
12864 (Incremental_inputs::create_input_section_data): Store inputs
12865 mtime.
12866 * incremental.h (Incremental_inputs::report_script): Add mtime
12867 argument.
12868 (Incremental_inputs::Input_info::Input_info): Intialize only one
12869 union member.
12870 (Incremental_inputs::Input_info::archive): Move to nameless
12871 union.
12872 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12873 (Incremental_inputs::Input_info::script): Move to nameless union.
12874 (Incremental_inputs::mtime): New field.
12875 * script.cc (read_input_script): Pass file mtime to
12876 Incremental_input.
12877 * script.h (Script_info::inputs): Style fix.
12878
c9d70757
ILT
128792009-07-01 Ian Lance Taylor <ian@airs.com>
12880
12881 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12882 instead of 32.
12883
9c547ec3
ILT
128842009-06-24 Ian Lance Taylor <iant@google.com>
12885
12886 PR 10156
12887 * layout.cc (Layout::choose_output_section): If we find an
12888 existing section, update the flags.
12889 (Layout::create_notes): New function, broken out of
12890 Layout::finalize.
12891 (Layout::finalize): Don't create note sections.
12892 (Layout::create_note): Don't crash if linker script discards
12893 section.
12894 (Layout::create_gold_note): Likewise.
12895 (Layout::create_build_id): Likewise. Don't set
12896 after_input_sections on the section.
12897 (Layout::create_executable_stack_info): Remove target parameter.
12898 Change caller.
12899 * layout.h (class Layout): Declare create_notes. Update
12900 declaration of create_executable_stack_info.
12901 * gold.cc (queue_middle_tasks): Call create_notes.
12902 * output.cc (Output_section::update_flags_for_input_section): Move
12903 here from output.h. If SHF_ALLOC flag is newly set, mark address
12904 invalid.
12905 * output.h (Output_data::mark_address_invalid): New function.
12906 (class Output_section): Only declare, not define,
12907 update_flags_for_input_section. Remove set_flags.
12908
55458500
ILT
129092009-06-24 Ian Lance Taylor <iant@google.com>
12910
12911 * script-sections.cc (Output_section_definition::
12912 set_section_addresses): Rename shadowing local load_address to
12913 laddr.
12914
1307d6cd
ILT
129152009-06-24 Ian Lance Taylor <iant@google.com>
12916
12917 PR 10244
12918 * reloc.cc (relocate_sections): Skip empty relocation sections.
12919
ec3f783e
ILT
129202009-06-23 Ian Lance Taylor <iant@google.com>
12921
12922 PR 10156
12923 * layout.cc (Layout::create_note): Use choose_output_section
12924 rather than make_output_section.
12925
459c9f1c
ILT
129262009-06-23 Ian Lance Taylor <iant@google.com>
12927
12928 PR 10237
12929 * options.cc (General_options::parse_V): Set printed_version_.
12930 (General_options::General_options): Initialize printed_version_.
12931 * options.h (class General_options): Add printed_version_ field.
12932 * gold.cc (queue_initial_tasks): If there are no input files,
12933 don't give a fatal error if we printed the version information.
12934 (queue_middle_tasks): If using -r with a shared object, give a
12935 fatal error rather than an ordinary error.
12936
1518dc8f
ILT
129372009-06-23 Ian Lance Taylor <iant@google.com>
12938
12939 PR 10219
12940 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12941 (Layout::make_output_section): Set have_stabstr_section_ if we see
12942 a .stab*str section.
12943 (Layout::finalize): Call link_stabs_sections.
12944 (Layout::link_stabs_sections): New file.
12945 * layout.h (class Layout): Add have_stabstr_section_ field.
12946 Declare link_stabs_sections.
12947
3d857b98
DK
129482009-06-23 Doug Kwan <dougkwan@google.com>
12949
12950 * Makefile.am (libgold_a_LIBADD): New.
12951 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12952 * Makefile.in: Regenerate.
3d857b98
DK
12953 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12954 * configure: Regenerate.
12955 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12956 * fileread.cc: Include sys/state.h
12957 * gold.h: Declare memmem and strndup if found missing.
12958 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12959
0639a6f6
ILT
129602009-06-23 Ian Lance Taylor <iant@google.com>
12961
12962 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12963 * configure: Rebuild.
12964
8d63875c
ILT
129652009-06-23 Ian Lance Taylor <iant@google.com>
12966
12967 PR 10147
12968 * object.cc (Object::section_contents): Don't try to get a view if
12969 the section has length zero.
12970 (Object::handle_gnu_warning_section): If the section is empty, use
12971 the name of the section as the warning.
12972
f7c8a183
ILT
129732009-06-23 Ian Lance Taylor <iant@google.com>
12974
12975 PR 10133
12976 * stringpool.h (class Stringpool_template): Add optimize_ field.
12977 (Stringpool_template::set_optimize): New function.
12978 * stringpool.cc (Stringpool_template::Stringpool_template):
12979 Initialize optimize_ field.
12980 (Stringpool_template::set_string_offsets): Test local optimize
12981 fild rather than parameter.
12982 * layout.cc (Layout::Layout): Call set_optimize on the section
12983 name stringpool.
12984
e6a307ba
ILT
129852009-06-22 Ian Lance Taylor <iant@google.com>
12986
12987 PR 10030
12988 * yyscript.y: Parse TARGET.
12989 * script.cc (script_set_target): New function.
12990 * script-c.h (script_set_target): Declare.
12991 * options.cc (General_options::string_to_object_format): Rename
12992 from string_to_object_format in anonymous namespace. Change
12993 callers.
12994 * options.h (class General_options): Declare
12995 string_to_object_format.
12996
3ee173de
ILT
129972009-06-22 Ian Lance Taylor <iant@google.com>
12998
12999 * script-sections.cc (Script_sections::create_segments): Don't put
13000 program headers in a PT_LOAD segment if -n or -N.
13001
130022009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13003
13004 PR 10141
13005 * options.h (class General_options): Add -z lazy and -z now. Sort
13006 -z options into alphabetical order.
13007 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13008
cd6739a1 130092009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13010
13011 * layout.cc (Layout::make_output_section): Call
13012 Target::new_output_section.
13013 (Layout::attach_allocated_section_to_segment): Put large section
13014 sections in a separate load segment with the large segment flag
13015 set.
13016 (Layout::segment_precedes): Sort large data segments after other
13017 load segments.
13018 (align_file_offset): New static function.
13019 (Layout::set_segment_offsets): Use align_file_offset.
13020 * output.h (class Output_section): Add is_small_section_ and
13021 is_large_section_ fields.
13022 (Output_section::is_small_section): New function.
13023 (Output_section::set_is_small_section): New function.
13024 (Output_section::is_large_section): New function.
13025 (Output_section::set_is_large_section): New function.
13026 (Output_section::is_large_data_section): New function.
13027 (class Output_segment): Add is_large_data_segment_ field.
13028 (Output_segment::is_large_data_segment): New function.
13029 (Output_segment::set_is_large_data_segment): New function.
13030 * output.cc (Output_section::Output_section): Initialize new
13031 fields.
13032 (Output_segment::Output_segment): Likewise.
13033 (Output_segment::add_output_section): Add assertion that large
13034 data sections always go in large data segments. Force small data
13035 sections to the end of the list of data sections. Force small BSS
13036 sections to the start of the list of BSS sections. For large BSS
13037 sections to the end of the list of BSS sections.
13038 * symtab.h (class Symbol): Declare is_common_shndx.
13039 (Symbol::is_defined): Check Symbol::is_common_shndx.
13040 (Symbol::is_common): Likewise.
13041 (class Symbol_table): Define enum Commons_section_type. Update
13042 declarations. Add small_commons_ and large_commons_ fields.
13043 * symtab.cc (Symbol::is_common_shndx): New function.
13044 (Symbol_table::Symbol_table): Initialize new fields.
13045 (Symbol_table::add_from_object): Put small and large common
13046 symbols in the right list.
13047 (Symbol_table::sized_finalized_symbol): Check
13048 Symbol::is_common_shndx.
13049 (Symbol_table::sized_write_globals): Likewise.
13050 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13051 common symbol lists. Don't call do_allocate_commons_list if the
13052 list is empty.
13053 (Symbol_table::do_allocate_commons_list): Remove is_tls
13054 parameter. Add comons_section_type parameter. Change all
13055 callers. Handle small and large common symbols.
13056 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13057 Symbol::is_common_shndx.
13058 * resolve.cc (symbol_to_bits): Likewise.
13059 * target.h (Target::small_common_shndx): New function.
13060 (Target::small_common_section_flags): New function.
13061 (Target::large_common_shndx): New function.
13062 (Target::large_common_section_flags): New function.
13063 (Target::new_output_section): New function.
13064 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13065 small_common_section_flags, and large_common_section_flags
13066 fields.
13067 (Target::do_new_output_section): New virtual function.
13068 * arm.cc (Target_arm::arm_info): Initialize new fields.
13069 * i386.cc (Target_i386::i386_info): Likewise.
13070 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13071 Likewise.
13072 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13073 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13074 (Target_x86_64::do_new_output_section): New function.
13075 * configure.ac: Define conditional MCMODEL_MEDIUM.
13076 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13077 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13078 (large_LDFLAGS): Define.
13079 * testsuite/large.c: New file.
13080 * testsuite/testfile.cc (Target_test::test_target_info):
13081 Initialize new fields.
13082 * configure, testsuite/Makefile.in: Rebuild.
13083
bb04269c
DK
130842009-06-05 Doug Kwan <dougkwan@google.com>
13085
13086 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13087 * Makefile.in: Regenerate.
bb04269c
DK
13088 * i386.cc (class Target_i386): Define new virtual method to
13089 override do_is_local_label_name in parent.
13090 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13091 local symbols if --discard-locals or -X is given.
13092 * options.h (class General_options): Declare new options
13093 '--discard-locals' and '-X' for discarding locals.
13094 * target.h (class Target): Define new methods is_local_label_name.
13095 Declare new virtual method do_is_local_label_name.
13096 * target.cc: New file.
13097 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13098 (check_SCRIPTS): Add discard_locals_test.sh.
13099 (check_DATA): Add discard_local_tests.syms.
13100 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13101 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13102 * testsuite/Makefile.in: Regenerate.
13103 * testsuite/discard_locals_test.c: New file.
13104 * testsuite/discard_locals_test.sh: Same.
13105
805bb01c
DK
131062009-06-05 Doug Kwan <dougkwan@google.com>
13107
13108 * object.cc (Sized_relobj::Sized_relobj): Initialize
13109 discarded_eh_frame_shndx_ to -1U.
13110 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13111 section.
13112 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13113 a discarded .eh_frame section.
13114 (Sized_relobj::do_finalize_local_symbols): Ditto.
13115 * object.h (class Sized_relobj): Declare new member
13116 discarded_eh_frame_shndx_.
13117 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13118 (local_labels_test.o, local_labels_test): New rules.
13119 * testsuite/Makefile.in: Regenerate.
13120
1dcd334d
DK
131212009-06-04 Doug Kwan <dougkwan@google.com>
13122
13123 * layout.cc (Layout::section_name_mapping): Add mapping for
13124 special ARM sections.
13125
96d49306
DK
131262009-06-03 Doug Kwan <dougkwan@google.com>
13127
13128 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13129 (utils::has_overflow): Same.
13130
dff16297
ILT
131312009-06-03 Ian Lance Taylor <iant@google.com>
13132
13133 * layout.cc (Layout::section_name_mapping): New array, replacing
13134 Layout::linkonce_mapping.
13135 (Layout::section_name_mapping_count): New variable, replacing
13136 Layout::linkonce_mapping_count.
13137 (Layout::linkonce_output_name): Remove.
13138 (Layout::output_section_name): Rewrite.
13139 * layout.h (class Layout): Rename Linkonce_mapping to
13140 Section_name_mapping, linkonce_mapping to section_name_mapping,
13141 linkonce_mapping_count to section_name_mapping_count. Don't
13142 declare linkonce_output_name.
13143
c121c671
DK
131442009-06-03 Doug Kwan <dougkwan@google.com>
13145
13146 * gold/arm.cc (namespace utils): New.
13147 (Target_arm::reloc_is_non_pic): Define new method.
13148 (class Arm_relocate_functions): New.
13149 (Target_arm::Relocate::relocate): Handle relocation types used by
13150 Android.
13151
07800fab
ILT
131522009-06-03 Ian Lance Taylor <iant@google.com>
13153
13154 * arm.cc (Target_arm::scan::global): Use || instead of |.
13155
c121c671
DK
131562009-06-02 Doug Kwan <dougkwan@google.com>
13157
13158 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13159 issued_non_pic_error_.
13160 (class Target_arm::Scan): Declare new method check_non_pic.
13161 Define new method symbol_needs_plt_entry.
13162 Declare new data member issued_non_pic_error_.
13163 (class Target_arm::Relocate): Declare new method
13164 should_apply_static_reloc.
13165 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13166 (Target_arm::Scan::check_non_pic): Define new method.
13167 (Target_arm::Scan::local): Handle a small subset of reloc types used
13168 by Android.
13169 (Target_arm::Scan::local): Same.
13170 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13171
b19b0c6d
ILT
131722009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13173
13174 * incremental.cc (Incremental_inputs::report_command_line): Filter
13175 out --incremental-* options.
13176
94cdfcff
DK
131772009-05-29 Doug Kwan <dougkwan@google.com>
13178
13179 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13180 template class.
13181 (class Target_arm): Update comment.
13182 (Target_arm::Target_arm): Initialize new data members GOT_,
13183 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13184 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13185 and Target_arm::rel_dyn_section.
13186 Declare new_enum Target_arm::Got_type.
13187 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13188 and DYNBSS_.
13189 Update commments for member do_dynsym_value.
13190 (Target_arm::got_size, Target_arm::plt_section,
13191 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13192 new methods inside class defintion.
13193 (Target_arm::got_section): Define new method.
13194 (Target_arm::rel_dyn_section): Same.
13195 (Output_data_plt_arm): New template class.
13196 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13197 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13198 (Output_data_plt_arm::add_entry): Same.
13199 (Output_data_plt_arm::first_plt_entry): Define new
13200 static data member for PLT instruction template.
13201 (Output_data_plt_arm::plt_entry): Same.
13202 (Output_data_plt_arm::do_write): Define new method.
13203 (Target_arm::make_plt_entry): Same.
13204 (Target_arm::do_finalize_sections): Same.
13205 (Target_arm::do_dynsym_value): Same.
13206
4a657b0d
DK
132072009-05-28 Doug Kwan <dougkwan@google.com>
13208
13209 * Makefile.am (TARGETSOURCES): Add arm.cc.
13210 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13211 * Makefile.in: Regenerate.
13212 * arm.cc: New file.
13213 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13214
e7ae8c36
DK
132152009-05-26 Doug Kwan <dougkwan@google.com>
13216
13217 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13218 (General_options::check_excluded_libs): Strip off directories in
13219 archive name before matching like GNU ld does.
13220 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13221 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13222 (exclude_libs_test_LDFLAGS): Add linker option
13223 -Wl,--exclude-libs,libexclude_libs_test_3
13224 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13225 an explicit archive without using -l.
13226 (alt/libexclude_libs_test_3.a): New make rule.
13227 * testsuite/Makefile.in: Regenerate.
13228 * testsuite/exclude_libs_test.c : Declare lib3_default().
13229 (main): Call it.
13230 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13231 * exclude_libs_test_3.c: New file.
13232
f12e7348
NC
132332009-05-26 Nick Clifton <nickc@redhat.com>
13234
13235 * po/id.po: New Indonesian translation.
13236 * po/gold.pot: Updated template file.
13237
4daadc0d
ST
132382009-05-22 Sriraman Tallam <tmsriram@google.com>
13239
e1df38aa 13240 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13241 gc_comdat_test files. Add -Wl,--gc-sections to build
13242 gc_comdat_test.
13243 * testsuite/Makefile.in: Regenerate.
13244 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13245
531813ad
ST
132462009-05-21 Sriraman Tallam <tmsriram@google.com>
13247
13248 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13249 kept comdat section was garbage collected.
13250 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13251 * testsuite/Makefile.in: Regenerate.
13252 * testsuite/gc_comdat_test.sh: New file.
13253 * testsuite/gc_comdat_test_1.cc: New file.
13254 * testsuite/gc_comdat_test_2.cc: New file.
13255
65514900
CC
132562009-05-19 Doug Kwan <dougkwan@google.com>
13257
13258 * archive.cc (Archive::Archive): Move constructor from archive.h
13259 to here. Initialize no_export_.
13260 (Archive::get_elf_object_for_member): Set no_export flag of object.
13261 * archive.h (Archive::Archive): Move constructor body to
13262 archive.cc.
13263 (Archive::no_export): New method.
13264 (Archive::no_export_): New field.
13265 * object.h (Object::Object): Initialize no_export_ to false.
13266 (Object::no_export, Object::set_no_export): New methods.
13267 (Object::no_export_): New field.
13268 * options.cc (General_options::parse_exclude_libs): New method.
13269 (General_options::check_excluded_libs) Same.
13270 * options.h (exclude_libs): New option.
13271 (General_options::check_excluded_libs): New method declaration.
13272 (General_options::excluded_libs_): New field.
13273 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13274 default or protected visibility if an object has no-export flag set.
13275 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13276 (check_SCRIPTS): Add exclude_libs_test.sh.
13277 (check_DATA): Add exclude_libs_test.syms.
13278 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13279 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13280 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13281 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13282 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13283 libexclude_libs_test_2.a): New rules.
13284 * testsuite/Makefile.in: Regenerate.
13285 * testsuite/exclude_libs_test.c: New file.
13286 * testsuite/exclude_libs_test.sh: Ditto.
13287 * testsuite/exclude_libs_test_1.c: Ditto.
13288 * testsuite/exclude_libs_test_2.c: Ditto.
13289
1b77ea50
ILT
132902009-05-15 Ian Lance Taylor <iant@google.com>
13291
13292 * configure.ac: Check for declarations for cases where libiberty.h
13293 checks HAVE_DECL_xxx.
13294 * configure, config.in: Rebuild.
13295
072fe7ce
ILT
132962009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13297
13298 * gold.h (Incremental_argument_list): Remove (invalid) forward
13299 declaration.
13300 * incremental.cc (Incremental_inputs::report_achive): New method.
13301 (Incremental_inputs::report_object): New method.
13302 (Incremental_inputs::report_script): New method.
13303 (Incremental_inputs::finalize_inputs): New method.
13304 (Incremental_inputs::finalize): Call finalize_inputs().
13305 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13306 Create inputs entries.
13307 * incremental.h (Incremental_input_type): New enum.
13308 (Incremental_inputs::Incremental_input): Initialize new fields.
13309 (Incremental_inputs::report_inputs): New method.
13310 (Incremental_inputs::report_achive): New method.
13311 (Incremental_inputs::report_object): New method.
13312 (Incremental_inputs::report_script): New method.
13313 (Incremental_inputs::finalize_inputs): New method.
13314 (Incremental_inputs::Input_info): New struct.
13315 (Incremental_inputs::Input_info_map): New typedef.
13316 (Incremental_inputs::lock_): New field.
13317 (Incremental_inputs::Inputs_): New field.
13318 (Incremental_inputs::Inputs_map): New field.
13319 * main.cc (main): Call Incremental_input::report_inputs.
13320 * options.h (Input_argument_list): Typedef moved from
13321 Input_arguments.
13322 (Input_file_group::Files): Remove, use ::Input_argument_list.
13323 (Input_file_group::Input_argument_list): Remove, use
13324 ::Input_argument_list.
13325 * plugin.cc (Plugin_manager::add_input_file): Add error in
13326 incremental build.
13327 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13328 functions.
13329 * script.cc (read_input_script): Call
13330 Incremental_input::report_script.
13331 * script.h (Script_info): New class.
13332
b0481b0b
ILT
133332009-04-27 Ian Lance Taylor <iant@google.com>
13334
13335 * x86_64.cc (do_adjust_output_section): Set entsize to
13336 plt_entry_size.
13337
b22a5a41 133382009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13339
13340 * output.cc (Output_file::close): After short writes, continue
13341 writing from the correct offset in the buffer being written.
13342
40fde488
CD
133432009-04-23 Chris Demetriou <cgd@google.com>
13344
13345 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13346 * configure: Regenerate.
13347 * config.in: Regenerate.
13348 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13349 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13350
3ce2c28e
ILT
133512009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13352
13353 * incremental.cc (Incremental_inputs_header_data): Renamed from
13354 Incremental_input_header_data.
13355 (Incremental_inputs_header_data::data_size): New field.
13356 (Incremental_inputs_header_data::put_input_file_count): Renamed
13357 from input_file_count.
13358 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13359 from command_line_offset.
13360 (Incremental_inputs_header_data::put_reserved): Renamed from
13361 put_reserved.
13362 (Incremental_inputs_entry_data): Renamed from
13363 Incremental_input_entry_data.
13364 (Incremental_inputs_entry_data::data_size): New field.
13365 (Incremental_inputs::report_command_line): New method.
13366 (Incremental_inputs::finalize): New method.
13367 (Incremental_inputs::create_incremental_inputs_data): New method.
13368 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13369 * incremental.h: New file.
13370 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13371 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13372 incremental builds.
703d02da 13373 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13374 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13375 (Layout::create_incremental_info_sections): New method.
13376 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13377 * main.cc (main): Notify Incremental_input of the command line.
13378
e55bde5e
ILT
133792009-04-01 Ian Lance Taylor <iant@google.com>
13380 Mikolaj Zalewski <mikolajz@google.com>
13381
13382 * gold.h (reserve_unordered_map): Define, three versions, one for
13383 each version of Unordered_map.
13384 * layout.cc (Layout::Layout): Remove options parameter. Add
13385 number_of_input_files parameter. Don't initialize options_.
13386 Initialize number_of_input_files_ and resized_signatures_. Move
13387 sections_are_attached_.
13388 (Layout::layout_group): Reserve space for group_signatures_.
13389 (Layout::find_or_add_kept_section): Change name parameter to be a
13390 reference. Resize signatures_ map when it gets large enough.
13391 (Layout::layout_eh_frame): Use parameters->options() instead of
13392 this->options_.
13393 (Layout::make_output_section): Likewise.
13394 (Layout::attach_allocated_section_to_segment): Likewise.
13395 (Layout::finalize, Layout::create_executable_stack): Likewise.
13396 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13397 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13398 * layout.h (class Layout): Update declarations. Remove options_
13399 field. Add number_of_input_files_ and resized_signatures_
13400 fields. Move sections_are_attached_ field.
13401 * main.cc (main): Pass number of input files to Layout
13402 constructor. Don't pass options.
13403
154b857c
ILT
134042009-03-30 Ian Lance Taylor <iant@google.com>
13405
13406 * ffsll.c (ffsll): Correct implementation.
13407
2f35ab9b
ILT
134082009-03-27 Ian Lance Taylor <iant@google.com>
13409
fd03461a
ILT
13410 * ffsll.c: New file.
13411 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13412 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13413 * ftruncate.c (ftruncate): Declare before definition.
13414 * mremap.c (mremap): Likewise.
13415 * pread.c (pread): Likewise.
13416 * configure, Makefile.in, config.in: Rebuild.
13417
2f35ab9b
ILT
13418 * mremap.c: New file.
13419 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13420 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13421 (mremap): Declare if HAVE_MREMAP is not defined.
13422 * configure, Makefile.in, config.in: Rebuild.
13423
33aea2fd
CC
134242009-03-27 Cary Coutant <ccoutant@google.com>
13425
13426 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13427 position independent.
13428 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13429 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13430
6d479619
CC
134312009-03-24 Cary Coutant <ccoutant@google.com>
13432
13433 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13434 an executable.
13435 (needs_dynamic_reloc): Likewise.
13436
afc06bb8
ILT
134372009-03-24 Ian Lance Taylor <iant@google.com>
13438
13439 * yyscript.y (file_cmd): Recognize EXTERN.
13440 (extern_name_list, extern_name_list_body): New nonterminals.
13441 * script.cc (script_add_extern): Define.
13442 * script-c.h (script_add_extern): Declare.
13443
f6060a4d
ILT
134442009-03-24 Rafael Avila de Espindola <espindola@google.com>
13445
13446 * object.cc (is_elf_object): Define.
13447 * object.h (is_elf_object): Declare.
13448 * archive.cc (Archive::get_elf_object_for_member): Call
13449 is_elf_object.
33aea2fd 13450 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13451
26736d8e
ILT
134522009-03-24 Elliott Hughes <enh@google.com>
13453
13454 * output.cc (Output_file::map_anonymous): Define.
13455 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13456 try an anonymous one. Report the size if the mmap fails.
13457 * output.h (class Output_file): Declare map_anonymous.
13458
22fd9730
ILT
134592009-03-24 Ian Lance Taylor <iant@google.com>
13460
13461 * target-select.cc (instantiate_target): Don't acquire the lock if
13462 the instantiated_target_ field has already been set.
13463
cb010894
ILT
134642009-03-23 Ian Lance Taylor <iant@google.com>
13465
7f055c20
ILT
13466 * gold-threads.h (class Initialize_lock): Define.
13467 * gold-threads.cc (class Initialize_lock_once): Define.
13468 (initialize_lock_control): New static variable.
13469 (initialize_lock_pointer): New static variable.
13470 (initialize_lock_once): New static function.
13471 (Initialize_lock::Initialize_lock): Define.
13472 (Initialize_lock::initialize): Define.
13473 * target-select.h: Include "gold-threads.h".
13474 (class Target_selector): Add lock_ and initialize_lock_ fields.
13475 Don't define instantiate_target, just declare it.
13476 * target-select.cc (Target_selector::Target_selector): Initialize
13477 new fields.
13478 (Target_selector::instantiate_target): Define.
13479 * descriptors.h: Include "gold-threads.h".
13480 (class Descriptors): Add initialize_lock_ field.
13481 * descriptors.cc (Descriptors::Descriptors): Initialize new
13482 field.
13483 (Descriptors::open): Use initialize_lock_ field
13484 * errors.h (class Errors): Add initialize_lock_ field.
13485 * errors.cc (Errors::Errors): Initialize new field.
13486 (Errors::initialize_lock): Use initialize_lock_ field.
13487 * powerpc.cc (class Target_selector_powerpc): Remove
13488 instantiated_target_ field. In do_recognize call
13489 instantiate_target rather than do_instantiate_target. In
13490 do_instantiate_target just allocate a new target.
13491 * sparc.cc (class Target_selector_sparc): Likewise.
13492
36959681
ILT
13493 * freebsd.h: New file.
13494 * i386.cc: Include "freebsd.h".
13495 (Target_i386): Derive from Target_freebsd rather than
13496 Sized_target.
13497 (Target_selector_i386): Derive from Target_selector_freebsd rather
13498 than Target_selector.
13499 * x86_64.cc: Include "freebsd.h".
13500 (Target_x86_64): Derive from Target_freebsd rather than
13501 Sized_target.
13502 (Target_selector_x86_64): Derive from Target_selector_freebsd
13503 rather than Target_selector.
13504 * target.h (class Target): Add adjust_elf_header and
13505 do_adjust_elf_header.
13506 * output.cc (Output_file_header:: do_sized_write): Call target
13507 adjust_elf_header routine.
13508 * configure.tgt: Set targ_osabi.
13509 * configure.ac: Define GOLD_DEFAULT_OSABI.
13510 * parameters.cc (Parameters::default_target): Pass
13511 GOLD_DEFAULT_OSABI to select_target.
13512 * target-select.h (class Target_selector): Make instantiate_target
13513 protected rather than private.
13514 * Makefile.am (HFILES): Add freebsd.h.
13515 * configure, Makefile.in, config.in: Rebuild.
13516
cb010894
ILT
13517 * merge.cc (do_add_input_section): Correct pend value. Change
13518 message about last entry not being null terminated from error to
13519 warning.
13520
0e879927
ILT
135212009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13522
13523 * incremental.cc: New file.
13524 * Makefile.am (CCFILES): Add incremental.cc.
13525 * Makefile.in: Rebuild.
13526
41105937
PP
135272009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13528
13529 * layout.cc (Layout::output_section_name): Preserve names
13530 of '.note.' sections.
e1df38aa 13531
60439920
ILT
135322009-03-19 Ian Lance Taylor <iant@google.com>
13533
13534 * descriptors.cc (Descriptors::open): Check that the options are
13535 valid before using them.
13536
0d371ad3
ILT
135372009-03-18 Ian Lance Taylor <iant@google.com>
13538
13539 * script-sections.h: Include <list>.
13540 (class Script_sections): Change Sections_elements from std::vector
13541 to std::list. Typedef public Elements_iterator. Add
13542 orphan_section_placement_, data_segment_align_start_, and
13543 saw_data_segment_align_ fields. Remove data_segment_align_index_
13544 field.
13545 * script-sections.cc (class Orphan_section_placement): New class.
13546 (class Sections_element): Add virtual functions is_relro and
13547 orphan_section_init. Remove virtual function place_orphan_here.
13548 (class Output_section_definition): Add is_relro and
13549 orphan_section_init. Remove place_orphan_here.
13550 (class Orphan_output_section): Likewise.
13551 (Script_sections::Script_sections): Update for field changes.
13552 (Script_sections::data_segment_align): Set saw_data_segment_align_
13553 and data_segment_align_start_, not data_segment_align_index.
13554 (Script_sections::data_segment_relro_end): Check
13555 saw_data_segment_align_. Use data_segment_align_start_ rather
13556 than data_segment_align_index_.
13557 (Script_sections::place_orphan): Rewrite to use
13558 Orphan_section_placement.
13559
9201d894
ILT
135602009-03-17 Ian Lance Taylor <iant@google.com>
13561
9c5b8369
ILT
13562 * archive.cc (Archive::add_symbols): Check for a version attached
13563 to the symbol name in the archive map.
13564 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13565 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13566 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13567 (ver_test_11.a): New target.
13568 * testsuite/Makefile.in: Rebuild.
13569
9201d894
ILT
13570 * configure.ac: Check for chsize and posix_fallocate. Replace
13571 ftruncate.
13572 * ftruncate.c: New file, from gnulib.
13573 * output.cc (posix_fallocate): Define dummy version if not
13574 HAVE_POSIX_FALLOCATE.
13575 (Output_file::map): Call posix_fallocate rather than lseek and
13576 write.
13577 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13578 * configure, Makefile.in, config.in: Rebuild.
13579
ef4ab7a8 135802009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13581
ef4ab7a8
PP
13582 * layout.h (Layout::create_note): Add section_name parameter.
13583 * layout.cc (Layout::create_note): Likewise.
13584 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13585
8c500701
ILT
135862009-03-17 Ian Lance Taylor <iant@google.com>
13587
e85b18e1
ILT
13588 * descriptors.cc: Include "options.h".
13589 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13590 (Descriptors::open): Always use O_CLOEXEC when opening a new
13591 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13592 then set FD_CLOEXEC.
13593
9efe6174
ILT
13594 * sparc.cc (class Target_sparc): Add has_got_section.
13595 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13596 make sure we have a GOT section.
13597
13598 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13599 (Target_sparc::Scan::local): Likewise.
13600 (Target_sparc::Scan::global): Likewise.
13601 (Target_sparc::Relocate::relocate): Likewise.
13602 (Target_sparc::Relocate::relocate_tls): Likewise.
13603
8c500701
ILT
13604 * symtab.cc (Symbol_table::define_default_version): New function,
13605 broken out of add_from_object.
13606 (Symbol_table::add_from_object): Call define_default_version.
13607 (Symbol_table::define_special_symbol): Add resolve_oldsym
13608 parameter. Change all callers. If the version for a symbol comes
13609 from a version script, resolve it with the symbol with the same
13610 name with no version. Also add the symbol without a version if
13611 appropriate.
13612 (do_define_in_output_data): If resolving with oldsym, don't delete
13613 sym.
13614 (do_define_in_output_segment): Likewise.
13615 (do_define_as_constant): Likewise.
13616 * symtab.h (class Symbol_table): Update declarations.
13617
f1ed28fb
ILT
136182009-03-13 Ian Lance Taylor <iant@google.com>
13619
15f8229b
ILT
13620 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13621 (Read_symbols::requeue): New function.
13622 (Read_symbols::do_read_symbols): If make_elf_object fails because
13623 the target type is not configured, and the file was searched for,
13624 issue a warning and retry with the next directory.
13625 (Add_symbols::run): If the file has an incompatible format, and
13626 it was searched for, requeue the Read_symbols task. On error,
13627 release the object.
13628 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13629 dirindex parameter to constructor. Change all callers. Declare
13630 incompatible_warning and requeue.
13631 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13632 input_argument_ and input_group_ fields. Add them to
13633 constructor. Change all callers.
13634 (class Read_script): Add dirindex_ field. Add it to constructor.
13635 Change all callers.
13636 * archive.cc (Archive::setup): Remove input_objects parameter.
13637 Change all callers.
13638 (Archive::get_file_and_offset): Likewise.
13639 (Archive::read_all_symbols): Likewise.
13640 (Archive::read_symbols): Likewise.
13641 (Archive::get_elf_object_for_member): Remove input_objects
13642 parameter. Add punconfigured parameter. Change all callers.
13643 (Archive::add_symbols): Change return type to bool. Check return
13644 value of include_member.
13645 (Archive::include_all_members): Likewise.
13646 (Archive::include_member): Change return type to bool. Return
13647 false if first included object has incompatible target. Set
13648 included_member_ field.
13649 (Add_archive_symbols::run): If add_symbols returns false, requeue
13650 Read_symbols task.
13651 * archive.h (class Archive): Add included_member_ field.
13652 Initialize it in constructor. Add input_file and searched_for
13653 methods. Update declarations.
13654 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13655 input_argument_ fields. Add them to constructor. Change all
13656 callers.
13657 * script.cc: Include "target-select.h".
13658 (class Parser_closure): Add skip_on_incompatible_target_ and
13659 found_incompatible_target_ fields. Add
13660 skip_on_incompatible_target parameter to constructor. Change all
13661 callers. Add methods skip_on_incompatible_target,
13662 clear_skip_on_incompatible_target, found_incompatible_target, and
13663 set_found_incompatible_target.
13664 (read_input_script): Add dirindex parameter. Change all callers.
13665 If parser finds an incompatible target, requeue Read_symbols
13666 task.
13667 (script_set_symbol): Clear skip_on_incompatible_target in
13668 closure.
13669 (script_add_assertion, script_parse_option): Likewise.
13670 (script_start_sections, script_add_phdr): Likewise.
13671 (script_check_output_format): New function.
13672 * script.h (read_input_script): Update declaration.
13673 * script-c.h (script_check_output_format): Declare.
13674 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13675 (ignore_cmd): Remove OUTPUT_FORMAT.
13676 * fileread.cc (Input_file::Input_file): Add explicit this.
13677 (Input_file::will_search_for): New function.
13678 (Input_file::open): Add pindex parameter. Change all callers.
13679 * fileread.h (class Input_file): Add input_file_argument method.
13680 Declare will_search_for. Update declarations.
13681 * object.cc (make_elf_object): Add punconfigured parameter.
13682 Change all callers.
13683 * object.h (class Object): Make input_file public. Add
13684 searched_for method.
13685 (make_elf_object): Update declaration.
13686 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13687 restart search.
13688 * dirsearch.h (class Dirsearch): Update declaration.
13689 * options.h (class General_options): Add --warn-search-mismatch.
13690 * parameters.cc (Parameters::is_compatible_target): New function.
13691 * parameters.h (class Parameters): Declare is_compatible_target.
13692 * workqueue.cc (Workqueue::add_blocker): New function.
13693 * workqueue.h (class Workqueue): Declare add_blocker.
13694
f1ed28fb
ILT
13695 * fileread.cc (Input_file::open): Remove options parameter.
13696 Change all callers.
13697 (Input_file::open_binary): Likewise.
13698 * script.cc (read_input_script): Likewise.
13699 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13700 options parameter from constructor. Change all callers.
13701 (class Read_script): Likewise.
13702 * fileread.h (class Input_file): Update declarations.
13703 * script.h (read_input_script): Update declaration.
13704
34dd024a
NC
137052009-03-10 Nick Clifton <nickc@redhat.com>
13706
13707 * po/es.po: New Spanish translation.
13708
6d71b17c
CC
137092009-03-06 Cary Coutant <ccoutant@google.com>
13710
13711 * options.cc (parse_short_option): Keep dash_z from registering itself.
13712
031cdbed
ILT
137132009-03-03 Ian Lance Taylor <iant@google.com>
13714
13715 PR 9918
13716 * target-reloc.h (relocate_section): Pass output_section to
13717 relocate.
13718 * i386.cc (Target_i386::should_apply_static_reloc): Add
13719 output_section parameter. Change all callers.
13720 (Target_i386::Relocate::relocate): Add output_section parameter.
13721 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13722 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13723 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13724 * testsuite/two_file_shared.sh: New script.
13725 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13726 (check_DATA): Add two_file_shared.dbg.
13727 (two_file_shared.dbg): New target.
13728 * testsuite/Makefile.in: Rebuild.
13729
15d5fa16
ILT
137302009-03-01 Ian Lance Taylor <iant@google.com>
13731
13732 * configure.ac: Check for byteswap.h.
13733 * configure: Rebuild.
13734 * config.in: Rebuild.
13735
8a4c0b0d
ILT
137362009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13737
13738 * layout.cc (Layout::find_or_add_kept_section): New function.
13739 (Layout::add_comdat): Removed.
13740 * layout.h (struct Kept_section): Move out of class Layout.
13741 Remove trailing underscores from field names. Add group_sections
13742 field. Rename group_ field to is_group. Change all uses.
13743 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13744 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13745 comdat_groups_ field.
13746 (Sized_relobj::include_section_group): Use
13747 find_or_add_kept_section and Kept_section::group_sections.
13748 (Sized_relobj::include_linkonce_section): Likewise.
13749 * object.cc (class Sized_relobj): Don't define Comdat_group or
13750 Comdat_group_table. Remove find_comdat_group and
13751 add_comdat_group. Remove comdat_groups_ field.
13752 * plugin.cc (include_comdat_group): Use
13753 Layout::find_or_add_kept_section.
13754
b4ecf66b
ILT
137552009-02-28 Ian Lance Taylor <iant@google.com>
13756
14359ca0
ILT
13757 * README: --gc-sections and map files are now supported. Document
13758 some build requirements.
13759
b4ecf66b
ILT
13760 PR 6992
13761 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13762 relocatable link set the value of the section symbol to zero.
13763 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13764 relocatable link don't include the section address in the local
13765 symbol value.
13766
0602e05a
ILT
137672009-02-27 Ian Lance Taylor <iant@google.com>
13768
fd9d194f
ILT
13769 PR 6811
13770 * options.h (class Search_directory): Add is_system_directory.
13771 (class General_options): Declare is_in_system_directory.
13772 * options.cc (get_relative_sysroot): Make static.
13773 (get_default_sysroot): Make static.
13774 (General_optoins::is_in_system_directory): New function.
13775 * fileread.cc (Input_file::is_in_system_directory): New function.
13776 * fileread.h (class Input_file): Declare is_in_system_directory.
13777 * object.h (class Object): Add is_in_system_directory.
13778 (class Input_objects): Remove system_library_directory_ field.
13779 * object.cc (Input_objects::add_object): Don't set
13780 system_library_directory_.
13781 (input_objects::found_in_system_library_directory): Remove.
13782 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13783 parameter. Change all callers.
13784 (Symbol_table::sized_write_globals): Likewise.
13785 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13786 Call Object::is_in_system_directory.
13787 * symtab.h (class Symbol_table): Update declarations.
13788
61edd21f
ILT
13789 PR 5990
13790 * descriptors.h (Open_descriptor): Add is_on_stack field.
13791 * descriptors.cc (Descriptors::open): If the descriptor is on the
13792 top of the stack, remove it. Initialize is_on_stack field.
13793 (Descriptors::release): Only add pod to stack if it is not on the
13794 stack already.
13795 (Descriptors::close_some_descriptor): Clear stack_next and
13796 is_on_stack fields.
13797
e29e076a
ILT
13798 PR 7091
13799 * output.cc (Output_section::find_starting_output_address): Rename
13800 from starting_output_address; add PADDR parameter; change return
13801 type.
13802 * output.h (class Output_section): Declare
13803 find_starting_output_address instead of starting_output_address.
13804 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13805 section symbol for which we can't find a merge section.
13806
0602e05a
ILT
13807 PR 9836
13808 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13809 hidden or internal, force the symbol to be local.
13810 * resolve.cc (Symbol::override_visibility): Define.
13811 (Symbol::override_base): Use override_visibility.
13812 (Symbol_table::resolve): Likewise.
13813 (Symbol::override_base_with_special): Likewise.
13814 (Symbol_table::override_with_special): If the visibility is hidden
13815 or internal, force the symbol to be local.
13816 * symtab.h (class Symbol): Add set_visibility and
13817 override_visibility.
13818 * testsuite/ver_test_1.sh: New file.
13819 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13820 (check_DATA): Add ver_test_1.syms.
13821 (ver_test_1.syms): New target.
13822 * testsuite/Makefile.in: Rebuild.
13823
401a9a73
CC
138242009-02-25 Cary Coutant <ccoutant@google.com>
13825
13826 * layout.cc (Layout::choose_output_section): Don't rename sections
13827 when using a linker script that has a SECTIONS clause.
13828 * Makefile.in: Regenerate.
13829
13830 * testsuite/Makefile.am (script_test_5.sh): New test case.
13831 * testsuite/Makefile.in: Regenerate.
13832 * testsuite/script_test_5.cc: New file.
13833 * testsuite/script_test_5.sh: New file.
13834 * testsuite/script_test_5.t: New file.
13835
f488e4b0
CC
138362009-02-13 Rafael Avila de Espindola <espindola@google.com>
13837
13838 * archive.cc (Archive::include_member): Update calls to add_symbols.
13839 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13840 the Layout argument.
13841 * dynobj.h (do_add_symbols): Add the Layout argument.
13842 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13843 Layout argument.
13844 * object.h (Object::add_symbols): Add the Layout argument.
13845 (Object::do_add_symbols): Add the Layout argument.
13846 (Sized_relobj::do_add_symbols): Add the Layout argument.
13847 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13848 Unify the two versions.
13849 (Add_plugin_symbols): Remove.
13850 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13851 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13852 (Add_plugin_symbols): Remove.
13853 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13854 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13855 (Add_symbols::run): Make it work with Pulginobj.
13856
89dd1680
ILT
138572009-02-06 Ian Lance Taylor <iant@google.com>
13858
13859 * object.cc (Sized_relobj::do_layout): Make info message start
13860 with lower case letter.
13861
266d0a74
ILT
138622009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13863
602b464e
ILT
13864 * binary.cc: Fix file comment.
13865
266d0a74
ILT
13866 * options.h (enum Incremental_disposition): Define.
13867 (class General_options): Add new options: --incremental,
13868 --incremental_changed, --incremental_unchanged,
13869 --incremental_unknown. Add incremental_disposition_ and
13870 implicit_incremental_ fields.
13871 (General_options::incremental_disposition): New function.
13872 (class Position_dependent_options): Add incremental_disposition
13873 option.
13874 (Position_dependent_options::copy_from_options): Set incremental
13875 dispositions.
13876 * options.cc (General_options::parse_incremental_changed): New
13877 function.
2e702c99
RM
13878 (General_options::parse_incremental_unchanged): New function.
13879 (General_options::parse_incremental_unknown): New function.
13880 (General_options::General_options): Initialize new fields
266d0a74 13881 incremental_disposition_ and implicit_incremental_.
2e702c99 13882 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13883 without --incremental.
13884
f073bbf7
CD
138852009-02-06 Chris Demetriou <cgd@google.com>
13886
13887 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13888 pointer and to report location as the file name associated with
13889 the symbol.
13890 (gold_undefined_symbol_at_location): New function to replace the
13891 old gold_undefined_symbol functionality.
13892 * target-reloc.h (relocate_section): Update to use
13893 gold_undefined_symbol_at_location.
13894 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13895 Call gold_undefined_symbol function rather than gold_error.
13896 * errors.h (Errors::undefined_symbol): Take location as a
13897 string, rather than calculating it from a relocation.
13898 * errors.cc (Errors::fatal): Print "fatal error:" before the
13899 formatted message.
13900 (Errors::error, Errors::error_at_location): Print "error: "
13901 before the formatted message.
13902 (Errors::undefined_symbol): Take location as a string, rather
13903 than calculating it from a relocation.
13904 (gold_undefined_symbol_at_location): New function akin to
13905 old gold_undefined_symbol, calculates location from relocation.
13906 (gold_undefined_symbol): Change to take only a Symbol pointer
13907 and to report location as the file name associated with the symbol.
13908 * testsuite/debug_msg.sh: Update for changed error messages.
13909 * testsuite/undef_symbol.sh: Likewise.
13910
8e94a90c
ILT
139112009-02-04 Duncan Sands <baldrick@free.fr>
13912
13913 PR 9812
13914 * reduced_debug_output.h
13915 (Output_reduced_debug_abbrev_section::failed): Use format for
13916 gold_warning.
13917 (Output_reduced_debug_info_section::faild): Likewise.
13918
88a0e15b
ILT
139192009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13920
13921 * script.cc (Lazy_demangler): New class.
2e702c99 13922 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13923 symbol only once.
13924
5efc7cd2
CC
139252009-01-29 Cary Coutant <ccoutant@google.com>
13926
13927 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13928 to __tls_get_addr.
13929 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13930
e0ebcf42
ILT
139312009-01-28 Ian Lance Taylor <iant@google.com>
13932
5efc7cd2 13933 * version.cc (version_string): Bump to 1.9.
75fe7426 13934
e0ebcf42
ILT
13935 * gold.h: Include <cstring> and <stdint.h>.
13936 * version.cc: Include <cstdio>.
13937 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13938 warning.
13939 * reduced_debug_output.cc (insert_into_vector): Rename from
13940 Insert_into_vector; change all callers. Use Swap_unaligned to
13941 avoid aliasing issue; remove union since it is unnecessary.
13942
8e2813be 139432009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13944
13945 * Makefile.am (CCFILES): Add gc.cc.
13946 (HFILES): Add gc.h.
13947 * Makefile.in: Regenerate.
13948 * gold.cc (Gc_runner): New class.
13949 (queue_initial_tasks): Call garbage collection related tasks
13950 when corresponding options are invoked.
13951 (queue_middle_gc_tasks): New function.
13952 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13953 processed early before laying out sections during garbage collection.
13954 * gold.h (queue_middle_gc_tasks): New function.
13955 (is_prefix_of): Move from "layout.cc".
13956 * i386.cc (Target_i386::gc_process_relocs): New function.
13957 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13958 * main.cc (main): Create object of class "Garbage_collection".
13959 * object.cc (Relobj::copy_symbols_data): New function.
13960 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13961 (Sized_relobj::do_layout): Allow this function to be called twice
13962 during garbage collection and defer layout of section during the
6d03d481
ST
13963 first call.
13964 * object.h (Relobj::get_symbols_data): New function.
13965 (Relobj::is_section_name_included): New function.
13966 (Relobj::copy_symbols_data): New function.
13967 (Relobj::set_symbols_data): New function.
13968 (Relobj::get_relocs_data): New function.
13969 (Relobj::set_relocs_data): New function.
13970 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13971 (Relobj::gc_process_relocs): New function.
13972 (Relobj::do_gc_process_relocs): New pure virtual function.
13973 (Relobj::sd_): New data member.
13974 (Sized_relobj::is_output_section_offset_invalid): New function.
13975 (Sized_relobj::do_gc_process_relocs): New function.
13976 * options.h (General_options::gc_sections): Modify to not be a no-op.
13977 (General_options::print_gc_sections): New option.
13978 * plugin.cc (Plugin_finish::run): Remove function call to
13979 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13980 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13981 * reloc.cc (Read_relocs::run): Add task to process relocs and
13982 determine unreferenced sections when doing garbage collection.
13983 (Gc_process_relocs): New class.
13984 (Sized_relobj::do_gc_process_relocs): New function.
13985 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13986 sections that are garbage collected.
13987 * reloc.h (Gc_process_relocs): New class.
13988 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13989 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13990 symbols whose corresponding sections are garbage collected.
13991 (Symbol_table::Symbol_table): Add new parameter for the garbage
13992 collection object.
13993 (Symbol_table::gc_mark_undef_symbols): New function.
13994 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13995 (Symbol_table::gc_mark_dyn_syms): New function.
13996 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13997 as garbage.
13998 (Symbol_table::add_from_object): Likewise.
13999 (Symbol_table::add_from_relobj): When building shared objects, do not
14000 treat externally visible symbols as garbage.
14001 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14002 table information for static and relocatable links.
14003 * symtab.h (Symbol_table::set_gc): New function.
14004 (Symbol_table::gc): New function.
14005 (Symbol_table::gc_mark_undef_symbols): New function.
14006 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14007 (Symbol_table::gc_mark_dyn_syms): New function.
14008 (Symbol_table::gc_): New data member.
e1df38aa 14009 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14010 function.
14011 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14012 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14013
3b293544
CF
140142009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14015
14016 * options.h (General_options::gc_sections): Define as a no-op for now.
14017 (General_options::no_keep_memory): Ditto.
14018 (General_options::Bshareable): Define.
14019 * options.cc (General_options::finalize): Honor -Bshareable.
14020
83d22aa8
AS
140212009-01-20 Andreas Schwab <schwab@suse.de>
14022
14023 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14024 read the value in the contents, since we don't use it. Use the
14025 template endianness when writing.
14026 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14027
cd536b21
AS
140282009-01-19 Andreas Schwab <schwab@suse.de>
14029
14030 * configure.tgt (powerpc64-*): Fix targ_obj.
14031
99e9a495
ILT
140322009-01-15 Ian Lance Taylor <iant@google.com>
14033
14034 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14035 local symbols when stripping all symbols.
14036
bbbfea06
CC
140372009-01-14 Cary Coutant <ccoutant@google.com>
14038
99e9a495 14039 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14040
0f7c0701
CC
140412009-01-14 Cary Coutant <ccoutant@google.com>
14042
14043 * archive.cc (Archive::get_elf_object_for_member): Remove call
14044 to File_read::claim_for_plugin.
14045 * descriptors.cc (Descriptors::open): Remove reference to
14046 is_claimed.
14047 (Descriptors::claim_for_plugin): Remove.
14048 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14049 (Descriptors::is_claimed): Remove.
14050 (claim_descriptor_for_plugin): Remove.
14051 * fileread.cc (File_read::claim_for_plugin): Remove.
14052 * fileread.h (File_read::claim_for_plugin): Remove.
14053 (File_read::descriptor): Reopen descriptor if necessary.
14054 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14055 (Plugin_manager::all_symbols_read): Add task parameter. Change
14056 all callers.
14057 (Plugin_manager::get_input_file): New function.
14058 (Plugin_manager::release_input_file): New function.
14059 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14060 corresponding data member.
14061 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14062 and pass to base constructor. Change all callers.
14063 (get_input_file, release_input_file): New functions.
14064 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14065 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14066 (Plugin_manager::all_symbols_read): Add task parameter.
14067 (Plugin_manager::get_input_file): New function.
14068 (Plugin_manager::release_input_file): New function.
14069 (Plugin_manager::task_): New data member.
14070 (Pluginobj::Pluginobj): Add filesize parameter.
14071 (Pluginobj::filename): New function.
14072 (Pluginobj::descriptor): New function.
14073 (Pluginobj::filesize): New function.
14074 (Pluginobj::filesize_): New data member.
14075 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14076 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14077 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14078
14079 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14080 with archive libraries.
14081 * testsuite/Makefile.in: Regenerate.
14082 * testsuite/plugin_test.c (struct sym_info): New type.
14083 (get_input_file, release_input_file): New static variables.
14084 (onload): Capture new transfer vector entries.
14085 (claim_file_hook): Stop reading at end of file according to filesize.
14086 Factor out parsing of readelf output into separate function.
14087 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14088 APIs and get the source file name from the symbol table. Convert
14089 source file name to corresponding object file name. Print info
14090 message when adding new input files.
14091 (parse_readelf_line): New function.
14092 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14093 * testsuite/plugin_test_2.sh: Likewise.
14094 * testsuite/plugin_test_3.sh: Likewise.
14095 * testsuite/plugin_test_4.sh: New test case.
14096
62a6d109
ILT
140972009-01-07 Ian Lance Taylor <iant@google.com>
14098
14099 * version.cc (version_string): Bump to 1.8.
14100
483620e8
CC
141012008-12-23 Cary Coutant <ccoutant@google.com>
14102
14103 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14104 * plugin.cc (Plugin_manager::finish): Rename as
14105 layout_deferred_objects. Move cleanup to separate function.
14106 (Plugin_manager::cleanup): New function.
14107 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14108 separately.
14109 * plugin.h (Plugin_manager::finish): Rename as
14110 layout_deferred_objects.
14111 (Plugin_manager::cleanup): New function.
14112 (Plugin_manager::cleanup_done): New field.
14113
d66a9eb3
CC
141142008-12-23 Cary Coutant <ccoutant@google.com>
14115
14116 * plugin.cc (is_visible_from_outside): New function.
14117 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14118 so we don't return "IR only" status for exported symbols or -r links.
14119
14120 * testsuite/Makefile.am (plugin_test_3): New test case.
14121 * testsuite/Makefile.in: Regenerate.
14122 * testsuite/plugin_test_3.sh: New file.
14123
5995b570
CC
141242008-12-22 Cary Coutant <ccoutant@google.com>
14125
14126 * object.cc (Sized_relobj::layout_section): New function.
14127 (Sized_relobj::do_layout): Defer layout of input sections until after
14128 plugin has provided replacement files.
14129 (Sized_relobj::do_layout_deferred_sections): New function.
14130 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14131 (Relobj::layout_deferred_sections): New function.
14132 (Relobj::do_layout_deferred_sections): New function.
14133 (Sized_relobj::do_layout_deferred_sections): New function.
14134 (Sized_relobj::layout_section): New function.
14135 (Sized_relobj::Deferred_layout): New structure.
14136 (Sized_relobj::deferred_layout_): New field.
14137 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14138 Change all callers. Layout deferred sections.
14139 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14140 references.
14141 (Plugin_hook::run): Move code from do_plugin_hook inline.
14142 (Plugin_hook::do_plugin_hook): Remove.
14143 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14144 (Plugin_manager::finish): Renamed, was cleanup.
14145 (Plugin_manager::should_defer_layout): New function.
14146 (Plugin_manager::add_deferred_layout_object): New function.
14147 (Plugin_manager::Deferred_layout_list): New type.
14148 (Plugin_manager::deferred_layout_objects_): New field.
14149 (Plugin_hook::do_plugin_hook): Remove.
14150
ee769c88
ILT
141512008-12-17 Ian Lance Taylor <iant@google.com>
14152
14153 * options.h (class General_options): Add --no case for
14154 --export-dynamic.
14155
abc8dcba
CC
141562008-12-16 Cary Coutant <ccoutant@google.com>
14157
14158 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14159 vector.
14160 (Plugin_manager::claim_file): Create plugin object even if
14161 plugin did not call the add_symbols callback.
14162 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14163 asking for more symbols than were added.
14164 * testsuite/Makefile.am (plugin_test_1): Add test case with
14165 no global symbols.
14166 (empty.syms): New target.
14167 * testsuite/Makefile.in: Regenerate.
14168 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14169 message. Don't call add_symbols if no globals.
14170 (all_symbols_read_hook): Don't provide replacement for empty
14171 claimed file.
14172
b0074644
ILT
141732008-12-12 Ian Lance Taylor <iant@google.com>
14174
68943102
ILT
14175 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14176 r_type == 0 for a local symbol with r_sym == 0.
14177 (scan_relocatable_relocs): Pass r_sym to
14178 local_non_section_strategy.
14179 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14180 r_sym parameter.
14181
b0074644
ILT
14182 * configure.ac: Update test for TLS descriptors: they are
14183 supported as of glibc 2.9.
14184 * configure: Rebuild.
14185
c2508178
ILT
141862008-12-11 Ian Lance Taylor <iant@google.com>
14187
14188 PR 7091
14189 * target-reloc.h (Default_scan_relocatable_relocs): For each
14190 function, map r_type == 0 to RELOC_DISCARD.
14191
2756a258
CC
141922008-12-10 Cary Coutant <ccoutant@google.com>
14193
14194 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14195 object to override a kept COMDAT group from a plugin object.
14196
bb6f53d3
ILT
141972008-12-09 Ian Lance Taylor <iant@google.com>
14198
fbc558e1
ILT
14199 PR 7088
14200 * yyscript.y (file_cmd): Handle INPUT.
14201
bb6f53d3
ILT
14202 * testsuite/initpri1.c: Change all declarations to be full
14203 prototypes by adding void, to avoid compiler warnings.
14204
4674ecfc
CC
142052008-12-05 Rafael Avila de Espindola <espindola@google.com>
14206
14207 * options.cc (General_options::parse_plugin_opt): New.
14208 (General_options::add_plugin): The argument now is just the filename.
14209 (General_options::add_plugin_option): New.
14210 * options.h (plugin_opt): New.
14211 (add_plugin): Change argument name.
14212 (add_plugin_option): New.
14213 * plugin.cc (Plugin::load): Don't parse the plugin option.
14214 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14215 (Plugin::add_option): New.
14216 (Plugin::args_): Change type.
14217 (Plugin::filename_): New.
14218 (Plugin_manager::add_plugin_option): New.
14219 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14220 * testsuite/Makefile.in: Regenerate.
14221
fd06b4aa
CC
142222008-12-05 Cary Coutant <ccoutant@google.com>
14223
14224 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14225 Handle --strip-lto-sections option.
14226 * options.h (strip_lto_sections): New option.
14227
6c52134c
CC
142282008-12-01 Cary Coutant <ccoutant@google.com>
14229
14230 * plugin.cc (ld_plugin_message): Change format parameter to const.
14231 Fix mismatch between new[] and delete.
14232
a45248e0
CC
142332008-11-14 Cary Coutant <ccoutant@google.com>
14234
14235 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14236 instead of -1U.
14237
c82fbeee
CS
142382008-11-05 Craig Silverstein <csilvers@google.com>
14239
14240 * options.cc (General_options::parse_dynamic_list): New function.
14241 * options.h (General_options): New flags dynamic_list,
14242 dynamic_list_data, dynamic_list_cpp_new, and
14243 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14244 (General_options::in_dynamic_list): New function.
14245 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14246 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14247 (Lex::can_continue_name): Likewise.
14248 (yylex): Likewise.
14249 (read_script_file): New parameter script_options.
14250 (read_dynamic_list): New function.
14251 (Script_options::define_dynamic_list): New function.
14252 (dynamic_list_keyword_parsecodes): New variable.
14253 (dynamic_list_keywords): New variable.
14254 * script.h (Script_options::define_dynamic_list): New function
14255 prototype.
14256 (read_dynamic_list): New function prototype.
14257 * symtab.cc (strprefix): New macro.
14258 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14259 dynamic_list_data, dynamic_list_cpp_new, and
14260 dynamic_list_cpp_typeinfo.
14261 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14262 (dynamic_list_expr): New rule.
14263 (dynamic_list_nodes): Likewise.
14264 (dynamic_list_node): Likewise.
14265 * testsuite/Makefile.am (dynamic_list): New test.
14266 * testsuite/Makefile.in: Regenerated.
14267 * testsuite/dynamic_list.t: New file.
14268 * testsuite/dynamic_list.sh: New file.
14269
e0bb29a5
CS
142702008-11-05 Craig Silverstein <csilvers@google.com>
14271
14272 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14273 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14274 (t11_last): Likewise.
14275 * testsuite/ver_test_6.c (main): Likewise.
14276
4e1e25e0
CC
142772008-10-07 Cary Coutant <ccoutant@google.com>
14278
14279 * options.c (General_options::finalize): Add check for -static and
14280 -shared.
14281 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14282 is not empty.
14283
92f03fcb
CC
142842008-10-02 Cary Coutant <ccoutant@google.com>
14285
14286 * plugin.cc (make_sized_plugin_object): Fix conditional
14287 compilation to work when not all targets are enabled.
14288
fbd8a257
CC
142892008-09-29 Cary Coutant <ccoutant@google.com>
14290
14291 * archive.cc (Archive::get_file_and_offset): Use filename instead
14292 of name to get library path.
14293 (Archive::include_member): Unlock external member of a thin archive.
14294
14295 * testsuite/Makefile.am (TEST_AR): New variable.
14296 (thin_archive_test_1): New test.
14297 (thin_archive_test_2): New test.
81636b3f
CC
14298 * testsuite/Makefile.in: Regenerate.
14299 * testsuite/thin_archive_main.cc: New file.
14300 * testsuite/thin_archive_test_1.cc: New file.
14301 * testsuite/thin_archive_test_2.cc: New file.
14302 * testsuite/thin_archive_test_3.cc: New file.
14303 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14304
eff45813
CC
143052008-09-29 Cary Coutant <ccoutant@google.com>
14306
14307 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14308 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14309 instead of -1U.
14310 (Sized_relobj::do_finalize_local_symbols): Likewise.
14311 (Sized_relobj::map_to_kept_section): Likewise.
14312 * object.h (Sized_relobj::invalid_address): New constant.
14313 (Sized_relobj::do_output_section_offset): Check for invalid_address
14314 and return -1ULL.
14315 * output.cc (Output_reloc::local_section_offset): Use constant
14316 invalid_address instead of -1U.
14317 (Output_reloc::get_address): Likewise.
14318 (Output_section::output_address): Change -1U to -1ULL.
14319 * output.h (Output_reloc::invalid_address): New constant.
14320 * reloc.cc (Sized_relobj::write_sections): Use constant
14321 invalid_address instead of -1U.
14322 (Sized_relobj::relocate_sections): Likewise.
14323 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14324 values for merge sections.
14325 * target-reloc.h (relocate_for_relocatable): Use constant
14326 invalid_address instead of -1U.
14327
89fc3421
CC
143282008-09-19 Cary Coutant <ccoutant@google.com>
14329
14330 Add plugin functionality for link-time optimization (LTO).
14331 * configure.ac (plugins): Add --enable-plugins option.
14332 * configure: Regenerate.
14333 * config.in: Regenerate.
14334 * Makefile.am (LIBDL): New variable.
14335 (CCFILES): Add plugin.cc.
14336 (HFILES): Add plugin.h.
14337 (ldadd_var): Add LIBDL.
14338 * Makefile.in: Regenerate.
14339
14340 * archive.cc: Include "plugin.h".
14341 (Archive::setup): Don't preread archive symbols when using a plugin.
14342 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14343 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14344 files.
14345 (Archive::include_member): Add symbols from plugin objects.
14346 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14347 * descriptors.cc (Descriptors::open): Check for file descriptors
14348 abandoned by plugins.
14349 (Descriptors::claim_for_plugin): New function.
14350 * descriptors.h (Descriptors::claim_for_plugin): New function.
14351 (Open_descriptor::is_claimed): New field.
14352 (claim_descriptor_for_plugin): New function.
14353 * fileread.cc (File_read::claim_for_plugin): New function.
14354 * fileread.h (File_read::claim_for_plugin): New function.
14355 (File_read::descriptor): New function.
14356 * gold.cc: Include "plugin.h".
14357 (queue_initial_tasks): Add task to call plugin hooks for generating
14358 new object files.
14359 * main.cc: Include "plugin.h".
14360 (main): Load plugin libraries.
14361 * object.h (Pluginobj): Declare.
14362 (Object::pluginobj): New function.
14363 (Object::do_pluginobj): New function.
14364 (Object::set_target): New function.
14365 * options.cc: Include "plugin.h".
14366 (General_options::parse_plugin): New function.
14367 (General_options::General_options): Initialize plugins_ field.
14368 (General_options::add_plugin): New function.
14369 * options.h (Plugin_manager): Declare.
14370 (General_options): Add --plugin option.
14371 (General_options::has_plugins): New function.
14372 (General_options::plugins): New function.
14373 (General_options::add_plugin): New function.
14374 (General_options::plugins_): New field.
14375 * plugin.cc: New file.
14376 * plugin.h: New file.
14377 * readsyms.cc: Include "plugin.h".
14378 (Read_symbols::do_read_symbols): Check for archive before checking
14379 for ELF file. Call plugin hooks to claim files.
14380 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14381 from a real object file; force override when processing replacement
14382 files.
14383 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14384 (Symbol::init_base_object): Likewise.
14385 (Symbol::init_base_output_data): Likewise.
14386 (Symbol::init_base_output_segment): Likewise.
14387 (Symbol::init_base_constant): Likewise.
14388 (Symbol::init_base_undefined): Likewise.
14389 (Symbol::output_section): Assert that object is not a plugin.
14390 (Symbol_table::add_from_pluginobj): New function.
14391 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14392 undefined.
14393 (Symbol_table::sized_write_globals): Likewise.
14394 (Symbol_table::add_from_pluginobj): Instantiate template.
14395 * symtab.h (Sized_pluginobj): Declare.
14396 (Symbol::in_real_elf): New function.
14397 (Symbol::set_in_real_elf): New function.
14398 (Symbol::in_real_elf_): New field.
14399 (Symbol_table::add_from_pluginobj): New function.
14400
14401 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14402 (LIBDL): New variable.
14403 (LDADD): Add LIBDL.
14404 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14405 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14406 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14407 (MOSTLYCLEANFILES): Likewise.
14408 * testsuite/Makefile.in: Regenerate.
14409 * testsuite/plugin_test.c: New file.
14410 * testsuite/plugin_test_1.sh: New file.
14411 * testsuite/plugin_test_2.sh: New file.
14412
de31bda5
ILT
144132008-09-16 Ian Lance Taylor <iant@google.com>
14414
9c2d0ef9
ILT
14415 * target-reloc.h (relocate_section): Check whether a symbol is
14416 defined by the ABI before reporting an undefined symbol error.
14417 * target.h (Target::is_defined_by_abi): Make parameter const.
14418 (Target::do_is_defined_by_abi): Likewise.
14419 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14420 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14421 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14422 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14423 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14424 * testsuite/Makefile.in: Rebuild.
14425
de31bda5
ILT
14426 * fileread.cc (make_view): Add casts to avoid warning.
14427
9fa33bee
AO
144282008-09-16 Alexandre Oliva <aoliva@redhat.com>
14429
14430 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14431 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14432
183fd0e3
AO
144332008-09-16 Alexandre Oliva <aoliva@redhat.com>
14434
14435 * options.h (General_options::output_is_executable): New.
14436 (General_options::output_is_pie): New.
14437 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14438 for shared libraries.
14439 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14440
7be8330a
CD
144412008-09-11 Chris Demetriou <cgd@google.com>
14442
14443 * options.h (origin): New -z option.
14444 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14445 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14446 in DT_FLAGS_1.
14447
a9caad02
CC
144482008-09-05 Cary Coutant <ccoutant@google.com>
14449
14450 * fileread.cc (File_read::make_view): Add check for attempt to map
14451 beyond end of file.
14452
ae6dce4d
CC
144532008-09-05 Cary Coutant <ccoutant@google.com>
14454
14455 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14456 explicit instantiations.
14457
d7ab2a47
KVH
144582008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14459
14460 PR gold/6858
14461 * options.cc (General_options::finalize): Allow undefined symbols
14462 in shlibs if linking -shared.
14463
14464 PR gold/6859
14465 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14466 symbols as not needing a dynsym entry.
14467
1e52a9c1
CS
144682008-08-20 Craig Silverstein <csilvers@google.com>
14469
14470 * fileread.cc (File_read::open): Do not lock the file unless it
14471 was successfully opened.
14472
d85c80a3
CC
144732008-08-14 Cary Coutant <ccoutant@google.com>
14474
14475 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14476 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14477 * testsuite/tls_test.cc (struct int128): 128-bit struct
14478 for testing TLS relocs with non-zero addend.
14479 (v12): New TLS variable.
14480 (t12): New test.
14481 (t_last): Add check for v12.
14482 * testsuite/tls_test.h (t12): New function.
14483 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14484
2d924fd9
ILT
144852008-08-13 Ian Lance Taylor <iant@google.com>
14486
14487 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14488 set tls_segment_ or relro_segment_.
14489 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14490 when appropriate.
14491 * output.h (Output_section::clear_is_relro): New function.
14492 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14493 sections specially even when output_data_ is empty.
14494 (Output_segment::maximum_alignment): When first section is relro,
14495 only force alignment for PT_LOAD segments.
14496 * script.cc (script_data_segment_align): New function.
14497 (script_data_segment_relro_end): New function.
14498 * script-c.h (script_data_segment_align): Declare.
14499 (script_data_segment_relro_end): Declare.
14500 * script-sections.h (class Script_sections): Declare
14501 data_segment_align and data_segment_relro_end. Add fields
14502 segment_align_index_ and saw_relro_end_.
14503 * script-sections.cc (class Sections_element): Add set_is_relro
14504 virtual function. Add new bool* parameter to place_orphan_here.
14505 Add get_output_section virtual function.
14506 (class Output_section_definition): Add set_is_relro. Add new
14507 bool* parameter to place_orphan_here. Add get_output_section.
14508 Add is_relro_ field.
14509 (Output_section_definition::Output_section_definition): Initialize
14510 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14511 and is_relro_ fields.
14512 (Output_section_definition::place_orphan_here): Add is_relro
14513 parameter.
14514 (Output_section_definition::set_section_addresses): Set relro for
14515 output section.
14516 (Output_section_definition::alternate_constraint): Likewise.
14517 (class Orphan_output_section): Add new bool* parameter to
14518 place_orphan_here. Add get_output_section.
14519 (Orphan_output_section::place_orphan_here): Add is_relro
14520 parameter.
14521 (Script_sections::Script_sections): Initialize
14522 data_segment_align_index_ and saw_relro_end_.
14523 (Script_sections::data_segment_align): New function.
14524 (Script_sections::data_segment_relro_end): New function.
14525 (Script_sections::place_orphan): Set or clear is_relro.
14526 (Script_sections::set_section_addresses): Force alignment of first
14527 TLS section.
14528 * yyscript.y (exp): Call script_data_segment_align and
14529 script_data_segment_relro_end.
14530 * testsuite/relro_script_test.t: New file.
14531 * testsuite/relro_test.cc (using_script): Declare.
14532 (t1, t2): Test using_script.
14533 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14534 (relro_script_test_SOURCES): Define.
14535 (relro_script_test_DEPENDENCIES): Define.
14536 (relro_script_test_LDFLAGS): Define.
14537 (relro_script_test_LDADD): Define.
14538 (relro_script_test.so): New target.
14539 * testsuite/Makefile.in: Rebuild.
14540
f827c9a9
CC
145412008-08-06 Cary Coutant <ccoutant@google.com>
14542
14543 * archive.cc (Archive::total_archives, Archive::total_members)
14544 (Archive::total_members_loaded): New variables.
14545 (Archive::setup): Add parameter. Add option to preread
14546 archive symbols.
14547 (Archive::read_armap): Add counter.
14548 (Archive::get_file_and_offset): New function.
14549 (Archive::get_elf_object_for_member): New function.
14550 (Archive::read_all_symbols): New function.
14551 (Archive::read_symbols): New function.
14552 (Archive::add_symbols): Add counters.
14553 (Archive::include_all_members): Use armap to find members if it's
14554 already built.
14555 (Archive::include_member): Skip reading symbols if already read.
14556 Factored code into Archive::get_file_and_offset and
14557 Archive::get_elf_object_for_member. Changed call to
14558 Mapfile::report_include_archive_member.
14559 (Archive::print_stats): New function.
14560 * archive.h: Declare Object and Read_symbols_data classes.
14561 (Archive::Archive): Add initializers for new members.
14562 (Archive::setup): Add parameter.
14563 (Archive::print_stats): New function.
14564 (Archive::total_archives, Archive::total_members)
14565 (Archive::total_members_loaded): New variables.
14566 (Archive::get_file_and_offset): New function.
14567 (Archive::get_elf_object_for_member): New function.
14568 (Archive::read_all_symbols): New function.
14569 (Archive::read_symbols): New function.
14570 (Archive::Archive_member): New class.
14571 (Archive::members_): New member.
14572 (Archive::num_members_): New member.
14573 * main.cc: Include archive.h.
14574 (main): Call Archive::print_stats.
14575 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14576 archive parameter; member_name is now the fully-decorated name.
14577 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14578 * options.h: (General_options): Add --preread-archive-symbols option.
14579 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14580 Archive::setup.
14581
de4c45bd
ILT
145822008-08-04 Ian Lance Taylor <iant@google.com>
14583
14584 * symtab.h (Symbol::use_plt_offset): New function.
14585 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14586 * powerpc.cc (Relocate::relocate): Likewise.
14587 * sparc.cc (Relocate::relocate): Likewise.
14588 * x86_64.cc (Relocate::relocate): Likewise.
14589 * testsuite/weak_plt.sh: New test.
14590 * testsuite/weak_plt_main.cc: New test.
14591 * testsuite/weak_plt_shared.cc: New test.
14592 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14593 (check_PROGRAMS): Add weak_plt.
14594 (check_DATA): Add weak_plt_shared.so.
14595 (weak_plt_main_pic.o, weak_plt): New targets.
14596 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14597 * testsuite/Makefile.in: Rebuild.
14598
14599 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14600 gcctestdir/ld.
14601 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14602 * testsuite/Makefile.in: Rebuild.
14603
323ee3f4
AM
146042008-08-04 Alan Modra <amodra@bigpond.net.au>
14605
14606 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14607 * Makefile.in: Regenerate.
14608 * po/POTFILES.in: Regenerate.
14609
7c07ecec
ILT
146102008-07-29 Ian Lance Taylor <iant@google.com>
14611
14612 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14613 symbols before other symbols.
14614 * testsuite/script_test_2.cc (test_addr): Declare.
14615 (test_addr_alias): Declare.
14616 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14617 values.
7c07ecec
ILT
14618 * testsuite/script_test_2.t: Define test_addr_alias and
14619 test_addr.
14620
5778530e
ILT
146212008-07-24 Ian Lance Taylor <iant@google.com>
14622
2a00e4fb
ILT
14623 PR 5990
14624 * descriptors.cc: New file.
14625 * descriptors.h: New file.
14626 * gold-threads.h (class Hold_optional_lock): New class.
14627 * fileread.cc: Include "descriptors.h".
14628 (File_read::~File_read): Release descriptor rather than closing
14629 it.
14630 (File_read::open) [file]: Call open_descriptor rather than open.
14631 Set is_descriptor_opened_.
14632 (File_read::open) [memory]: Assert that descriptor is not open.
14633 (File_read::reopen_descriptor): New function.
14634 (File_read::release): Release descriptor.
14635 (File_read::do_read): Make non-const. Reopen descriptor.
14636 (File_read::read): Make non-const.
14637 (File_read::make_view): Reopen descriptor.
14638 (File_read::do_readv): Likewise.
14639 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14640 Update declarations.
14641 * layout.cc: Include "descriptors.h".
14642 (Layout::create_build_id): Use open_descriptor rather than open.
14643 * output.cc: Include "descriptors.h".
14644 (Output_file::open): Use open_descriptor rather than open.
14645 * archive.cc (Archive::const_iterator): Change Archive to be
14646 non-const.
14647 (Archive::begin, Archive::end): Make non-const.
14648 (Archive::count_members): Likewise.
14649 * archive.h (class Archive): Update declarations.
14650 * object.h (Object::read): Make non-const.
14651 * Makefile.am (CCFILES): Add descriptors.cc.
14652 (HFILES): Add descriptors.h.
14653 * Makefile.in: Rebuild.
14654
801647d1
ILT
14655 PR 6716
14656 * gold.h: Always include <clocale>. Add Solaris workarounds
14657 following code in binutils/sysdep.h.
14658
5edd166e
ILT
14659 PR 6048
14660 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14661 this->eh_frame_hdr_ is NULL before using it.
14662
c89ad728
ILT
14663 * dynobj.cc (Versions::Versions): Update comment.
14664
aa86f06b
ILT
14665 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14666 the base version name.
14667
5778530e
ILT
14668 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14669 array size plus one.
14670 (Stringpool_template::set_string_offsets): Subtract one from key
14671 before using it as an array index.
14672 (Stringpool_template::get_offset_with_length): Likewise.
14673 (Stringpool_template::write_to_buffer): Likewise.
14674 * stringpool.h (Stringpool_template::get_offset_from_key):
14675 Likewise.
14676
057ead22
ILT
146772008-07-23 Ian Lance Taylor <iant@google.com>
14678
7f649c59
ILT
14679 PR 6658
14680 * object.h (Merged_symbol_value::value): Do our best to handle a
14681 negative addend.
14682
057ead22
ILT
14683 PR 6647
14684 * script.cc (Version_script_info::get_versions): Don't add empty
14685 version tag to return value.
14686 (Version_script_info::get_symbol_version_helper): Change return
14687 type to bool. Add pversion parameter. Change all callers.
14688 (script_register_vers_node): Don't require a non-NULL tag.
14689 * script.h (class Version_script_info): Update declarations.
14690 (Version_script_info::get_symbol_version): Change return type to
14691 bool. Add version parameter. Change all callers.
14692 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14693 handling. Handle an empty version from a version script.
14694 (Symbol_table::define_special_symbol): Likewise.
14695 * testsuite/ver_test_10.script: New file.
14696 * testsuite/ver_test_10.sh: New file.
14697 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14698 (check_DATA): Add ver_test_10.syms.
14699 (ver_test_10.syms, ver_test_10.so): New target.
14700 * testsuite/Makefile.in: Rebuild.
14701
58e54ac2
CD
147022008-07-23 Simon Baldwin <simonb@google.com>
14703
14704 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14705 to zero for undefined symbols from dynamic libraries.
14706
95d14cd3
ILT
147072008-07-23 Ian Lance Taylor <iant@google.com>
14708
14709 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14710 Change all callers.
14711 * symtab.h (class Symbol_table): Update declaration.
14712 * testsuite/ver_test_9.cc: New file.
14713 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14714 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14715 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14716 (ver_test_9.so, ver_test_9.o): New targets.
14717 * testsuite/Makefile.in: Rebuild.
14718
92de84a6
ILT
147192008-07-22 Ian Lance Taylor <iant@google.com>
14720
34810851
ILT
14721 * options.h (class General_options): Define --check-sections.
14722 * layout.cc (Layout::set_segment_offsets): Handle
14723 --check-sections.
14724
af6156ef
ILT
14725 * options.h (class General_options): Define -n/--nmagic and
14726 -N/--omagic.
14727 * options.cc (General_options::finalize): For -n/--nmagic or
14728 -N/--omagic, set -static.
14729 * layout.cc (Layout::attach_allocated_section_to_segment): If
14730 -N/--omagic, don't put read-only and read-write sections in
14731 different segments.
14732 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14733 finding a read-only segment.
14734 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14735 don't set the minimum segment alignment to the common page size,
14736 and don't set the file offset to the address modulo the page size.
14737 * script-sections.cc (Script_sections::create_segments): If
14738 -n/--omagic, don't put read-only and read-write sections in
14739 different segments.
14740
92de84a6
ILT
14741 * cref.cc: New file.
14742 * cref.h: New file.
14743 * options.h (class General_options): Add --print-symbol-counts.
14744 * main.cc (main): Issue defined symbol report if requested.
14745 * archive.cc (Archive::interpret_header): Make into a const member
14746 function.
14747 (Archive::add_symbols): Call Input_objects::archive_start and
14748 archive_stop.
14749 (Archive::const_iterator): Define new class.
14750 (Archive::begin, Archive::end): New functions.
14751 (Archive::include_all_members): Rewrite to use iterator.
14752 (Archive::count_members): New function.
14753 * archive.h (class Archive): Update declarations.
14754 (Archive::filename): New function.
14755 * object.cc: Include "cref.h".
14756 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14757 (Sized_relobj::do_get_global_symbol_counts): New function.
14758 (Input_objects::add_object): Add object to cross-referencer.
14759 (Input_objects::archive_start): New function.
14760 (Input_objects::archive_stop): New function.
14761 (Input_objects::print_symbol_counts): New function.
14762 * object.h: Declare Cref and Archive.
14763 (Object::get_global_symbol_counts): New function.
14764 (Object::do_get_global_symbol_counts): New pure virtual function.
14765 (class Sized_relobj): Add defined_count_ field. Update
14766 declarations.
14767 (class Input_objects): Add cref_ field. Update constructor.
14768 Update declarations.
14769 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14770 defined_count_.
14771 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14772 symbol counts.
14773 (Sized_dynobj::do_get_global_symbol_counts): New function.
14774 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14775 defined_count_. Update declarations. Define Symbols typedef.
14776 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14777 parameter. Change all callers.
14778 (Symbol_table::add_from_dynobj): Add sympointers and defined
14779 parameters. Change all callers.
14780 * symtab.h (class Symbol_table): Update declarations.
14781 * Makefile.am (CCFILES): Add cref.cc.
14782 (HFILES): Add cref.h.
14783 * Makefile.in: Rebuild.
14784
3f7c5e1d
CD
147852008-07-22 Simon Baldwin <simonb@google.com>
14786
14787 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14788 to zero when writing undefined symbols.
14789
e0b64032
ILT
147902008-07-22 Ian Lance Taylor <iant@google.com>
14791
14792 * output.cc (Output_section::add_input_section): Don't try to
14793 merge empty merge sections.
14794
096b02cf
CS
147952008-07-21 Craig Silverstein <csilvers@google.com>
14796
14797 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14798 Include symbol version in error message.
cd536b21 14799
1d1f116d
CD
148002008-07-20 Chris Demetriou <cgd@google.com>
14801
cd536b21 14802 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14803 (RANDOM_SEED_CFLAGS): New substituted variable.
14804 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14805 * configure: Rebuild.
14806 * Makefile.in: Likewise.
14807 * testsuite/Makefile.in: Likewise.
14808
a18f591e
ILT
148092008-07-18 Ian Lance Taylor <iant@google.com>
14810
14811 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14812 where we see NAME/NULL and NAME/VERSION as separate symbols.
14813 * testsuite/ver_test_main.cc (main): Call t4.
14814 (t4, t4_2a): Define.
14815 * testsuite/ver_test_2.cc (t4_2): Define.
14816 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14817 * testsuite/ver_test_4.cc (t4_2a): Define.
14818 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14819 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14820
c6e3f6ed
ILT
148212008-07-17 Ian Lance Taylor <iant@google.com>
14822
14823 * dynobj.cc (Versions::add_def): If we give an error about a
14824 missing version, go ahead and create the version anyhow.
14825
ef9beddf
ILT
148262008-07-10 Ian Lance Taylor <iant@google.com>
14827
14828 Handle output sections with more than 0x7fffffff bytes.
14829 * object.h (class Relobj): Change map_to_output_ to
14830 output_sections_, and just keep a section pointer. Change all
14831 uses. Move comdat group support to Sized_relobj.
14832 (Relobj::is_section_specially_mapped): Remove.
14833 (Relobj::output_section): Remove poff parameter. Change all
14834 callers.
14835 (Relobj::output_section_offset): New function.
14836 (Relobj::set_section_offset): Rewrite.
14837 (Relobj::map_to_output): Remove.
14838 (Relobj::output_sections): New function.
14839 (Relobj::do_output_section_offset): New pure virtual function.
14840 (Relobj::do_set_section_offset): Likewise.
14841 (class Sized_relobj): Add section_offsets_ field. Add comdat
14842 group support from Relobj. Update declarations.
14843 (Sized_relobj::get_output_section_offset): New function.
14844 (Sized_relobj::do_output_section_offset): New function.
14845 (Sized_relobj::do_set_section_offset): New function.
14846 * object.cc (Relobj::output_section_address): Remove.
14847 (Sized_relobj::Sized_relobj): Initialize new fields.
14848 (Sized_relobj::include_section_group): Cast find_kept_object to
14849 Sized_relobj.
14850 (Sized_relobj::include_linkonce_section): Likewise.
14851 (Sized_relobj::do_layout): Use separate arrays for output section
14852 and output offset.
14853 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14854 output_sections.
14855 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14856 output_sections and section_offsets.
14857 (Sized_relobj::write_local_symbols): Likewise.
14858 (map_to_kept_section): Compute output address directly.
14859 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14860 output_sections and section_offsets.
14861 (Sized_relobj::write_sections): Likewise.
14862 (Sized_relobj::relocate_sections): Likewise.
14863 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14864 * output.h (class Output_reloc): Update declarations. Change
14865 u2_.relobj to Sized_relobj*.
14866 (class Output_data_reloc): Change add functions to use
14867 Sized_relobj*.
14868 * output.cc (Output_reloc::Output_reloc): Change relobj to
14869 Sized_relobj*.
14870 (Output_reloc::local_section_offset): Change return type to
14871 Elf_Addr. Use get_output_section_offset.
14872 (Output_reloc::get_address): Likewise.
14873 (Output_section::is_input_address_mapped): Don't call
14874 is_section_specially_mapped.
14875 (Output_section::output_offset): Likewise.
14876 (Output_section::output_address): Likewise.
14877 (Output_section::starting_output_address): Likewise.
14878 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14879 parameter to Sized_relobj*.
14880 (Copy_relocs::need_copy_reloc): Likewise.
14881 (Copy_relocs::save): Likewise.
14882 * copy-relocs.h (class Copy_relocs): Update declarations.
14883 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14884 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14885 * target-reloc.h (relocate_for_relocatable): Change
14886 offset_in_output_section type to Elf_Addr. Change code that uses
14887 it as well.
14888 * layout.cc (Layout::layout): Always set *off.
14889 * mapfile.cc (Mapfile::print_input_section): Use
14890 output_section_offset.
14891 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14892 Sized_relobj*.
14893 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14894 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14895 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14896
5cb66f97
ILT
148972008-07-03 Ian Lance Taylor <iant@google.com>
14898
14899 * layout.cc (Layout::include_section): Do not discard unrecognized
14900 SHT_STRTAB sections.
14901
afe47622
CS
149022008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14903
14904 * script.cc (Lex::can_continue_name): Make '?' allowable in
14905 version-script names.
14906 * testsuite/version_script.map: Change glob pattern to use '?'
14907
5adf9721
ILT
149082008-06-30 Manish Singh <yosh@gimp.org>
14909
14910 PR 6585
14911 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14912 Correct typo.
14913
e6fde208
ILT
149142008-06-30 Ian Lance Taylor <iant@google.com>
14915
14916 PR 6660
14917 PR 6682
14918 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14919 versions]: Don't try to read the value in the contents, since we
14920 don't use it. Use the template endianness when writing.
14921
3f2e6a2d
CC
149222008-06-25 Cary Coutant <ccoutant@google.com>
14923
14924 * fileread.cc (File_read::make_view): Assert on zero-length view.
14925 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14926 symbol table when there are no symbols to read.
14927
c43d3a48
CS
149282008-06-23 Craig Silverstein <csilvers@google.com>
14929
14930 * version.cc (version_string): Bump to 1.7
14931
5f494ea0
CS
149322008-06-18 Craig Silverstein <csilvers@google.com>
14933
14934 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14935 constant 0xFFFF to type Valtype.
14936 (Powerpc_relocate_functions::rel16_ha): Likewise.
14937
c42e122e
ILT
149382008-06-17 Ian Lance Taylor <iant@google.com>
14939
f34787f8
ILT
14940 * output.h (Output_section::Input_section): Initialize p2align_ to
14941 zero for Output_section_data constructors.
14942 (Output_section::Input_section::addralign): If not an input
14943 section, return the alignment of the Output_section_data.
14944 * testsuite/copy_test.cc: New file.
14945 * testsuite/copy_test_1.cc: New file.
14946 * testsuite/copy_test_2.cc: New file.
14947 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14948 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14949 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14950 (copy_test_1_pic.o, copy_test_1.so): New targets.
14951 (copy_test_2_pic.o, copy_test_2.so): New targets.
14952 * testsuite/Makefile.in: Rebuild.
14953
c42e122e
ILT
14954 * script-sections.cc (Script_sections::place_orphan): Initialize
14955 local variable exact.
14956
ce3ac18a
DE
149572008-06-13 David Edelsohn <edelsohn@gnu.org>
14958
14959 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14960
42cacb20
DE
149612008-06-12 David Edelsohn <edelsohn@gnu.org>
14962 David S. Miller <davem@davemloft.net>
14963
14964 * powerpc.cc: New file.
14965 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14966 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14967 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14968 * Makefile.in: Rebuild.
14969
7b308235
ILT
149702008-06-09 Ian Lance Taylor <iant@google.com>
14971
14972 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14973 <exception>.
14974 (throwing, orig_terminate): New static variables.
14975 (terminate_handler): New static function.
14976 (t2): Set terminate handler.
14977
f0b886e3
ILT
149782008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14979
14980 PR 6584
cd536b21 14981 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14982 alignment.
14983
3e90f135
CC
149842008-05-30 Cary Coutant <ccoutant@google.com>
14985
14986 * archive.cc (Archive::include_all_members) Correct to step
14987 over symbol table and extended name table in thin archives.
14988
e09ad04a
ILT
149892008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14990
14991 PR 6407
14992 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14993 calculation.
14994
62b01cb5
ILT
149952008-05-28 Caleb Howe <cshowe@google.com>
14996
14997 * reduced_debug_output.cc: New file.
14998 * reduced_debug_output.h: New file.
92de84a6 14999 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15000 * options.cc (General_options::finalize): Add strip_debug_non_line
15001 to the strip heirarchy.
15002 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15003 fields.
15004 * layout.cc: Include "reduced_debug_output.h".
15005 (Layout::Layout): Initialize new fields.
15006 (line_only_debug_sections): New static array.
15007 (is_lines_only_debug_sections): New static inline function.
15008 (Layout::include_section): Handle --strip-debug-non-line.
15009 (Layout::make_output_section): If --strip-debug-non-line, build
15010 new output sections for .debug_abbrev and .debug_info.
15011 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15012 gold. Warn about possible overflow.
15013 (read_signed_LEB_128): Likewise.
15014 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15015 (read_signed_LEB_128): Declare.
15016 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15017 (HFILES): Add reduced_debug_output.h.
15018 * Makefile.in: Rebuild.
15019
7d9e3d98
ILT
150202008-05-21 Ian Lance Taylor <iant@google.com>
15021
15022 * mapfile.cc: New file.
15023 * mapfile.h: New file.
15024 * options.h (class General_options): Add -M/--print-map and -Map.
15025 * options.cc (General_options::finalize): Make -M equivalent to
15026 -Map -.
15027 * main.cc: Include <cstdio> and "mapfile.h".
15028 (main): Open mapfile if requested.
15029 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15030 constructor. Change caller.
15031 (queue_initial_tasks): Add mapfile parameter. Change caller.
15032 (queue_middle_tasks): Likewise.
15033 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15034 declarations.
15035 * archive.cc: Include "mapfile.h".
15036 (Archive::add_symbols): Add mapfile parameter. Change all
15037 callers. Pass mapfile, symbol, and reason to include_member.
15038 (Archive::include_all_members): Add mapfile parameter. Change all
15039 callers.
15040 (Archive::include_member): Add mapfile, sym, and why parameters.
15041 Change all callers. Report inclusion to map file.
15042 * archive.h: Include "fileread.h".
15043 (class Archive): Update declarations.
15044 (Archive::file): New const method.
15045 (class Add_archive_symbols): Add mapfile_ field. Update
15046 constructor. Change all callers.
15047 * readsyms.h (class Read_symbols): Likewise.
15048 (class Finish_group): Likewise.
15049 (class Read_script): Likewise.
15050 * common.cc: Include "mapfile.h".
15051 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15052 all callers.
15053 (Symbol_table::do_allocate_commons): Likewise.
15054 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15055 symbol allocation to mapfile.
15056 * common.h (class Allocate_commons_task): Add mapfile_ field.
15057 Update constructor. Change all callers.
15058 * symtab.h (class Symbol_table): Update declarations.
15059 * layout.cc: Include "mapfile.h".
15060 (Layout_task_runner::run): Print information to mapfile.
15061 (Layout::create_gold_note): Change Output_data_fixed_space to
15062 Output_data_zero_fill.
15063 (Layout::create_build_id): Likewise.
15064 (Layout::print_to_mapfile): New function.
15065 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15066 constructor. Change caller.
15067 (class Layout): Declare print_to_mapfile.
15068 * output.cc (Output_section::Input_section::print_to_mapfile): New
15069 function.
15070 (Output_section::add_input_section): If producing a map, always
15071 add to input_sections_ list.
15072 (Output_section::do_print_to_mapfile): New function.
15073 (Output_segment::print_sections_to_mapfile): New function.
15074 (Output_segment::print_section_list_to_mapfile): New function.
15075 * output.h: Include "mapfile.h".
15076 (Output_data::print_to_mapfile): New function.
15077 (Output_data::do_print_to_mapfile): New virtual function.
15078 (Output_segment_headers::do_print_to_mapfile): New function.
15079 (Output_file_header::do_print_to_mapfile): New function.
15080 (Output_data_const::do_print_to_mapfile): New function.
15081 (class Output_data_const_buffer): Add map_name_ field. Update
15082 constructor. Change all callers. Add do_print_to_mapfile
15083 function.
15084 (class Output_data_fixed_space): Likewise.
15085 (class Output_data_space): Likewise.
15086 (class Output_data_zero_fill): New class.
15087 (Output_data_strtab::do_print_to_mapfile): New function.
15088 (Output_data_reloc_base::do_print_to_mapfile): New function.
15089 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15090 (Output_data_group::do_print_to_mapfile): New function.
15091 (Output_data_got::do_print_to_mapfile): New function.
15092 (Output_data_dynamic::do_print_to_mapfile): New function.
15093 (Output_symtab_xindex::do_print_to_mapfile): New function.
15094 (class Output_section): Declare do_print_to_mapflie. Declare
15095 print_to_mapfile in Input_section.
15096 (class Output_segment): Declare new functions.
15097 * object.h (Sized_relobj::symbol_count): New function.
15098 * script-sections.cc
15099 (Output_section_element_dot_assignment::set_section_addresses):
15100 Change Output_data_fixed_space to Output_data_zero_fill.
15101 (Output_data_expression::do_print_to_mapfile): New function.
15102 * script.cc (read_input_script): Add mapfile parameter. Change
15103 all callers.
15104 * script.h (read_input_script): Update declaration.
15105 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15106 (Eh_frame::do_print_to_mapfile): New function.
15107 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15108 (Output_merge_string::do_print_to_mapfile): New function.
15109 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15110 function.
15111 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15112 function.
15113 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15114 function.
15115 * Makefile.am (CCFILES): Add mapfile.cc.
15116 (HFILES): Add mapfile.h.
15117 * Makefile.in: Rebuild.
15118
9f1d377b
ILT
151192008-05-19 Ian Lance Taylor <iant@google.com>
15120
15121 * options.h (class General_options): Add -z relro.
15122 * layout.cc (Layout::Layout): Initialize relro_segment_.
15123 (Layout::add_output_section_data): Return the output section.
15124 (Layout::make_output_section): Rcognize relro sections and mark
15125 them appropriately.
15126 (Layout::attach_allocated_section_to_segment): Put relro sections
15127 in a PT_GNU_RELRO segment.
15128 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15129 section as relro.
15130 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15131 PT_TLS segments.
15132 (Layout::linkonce_mapping): Map d.rel.ro.local to
15133 .data.rel.ro.local.
15134 (Layout::output_section_name): Us .data.rel.ro.local for any
15135 section which begins with that.
15136 * layout.h (class Layout): Update add_output_section_data
15137 declaration. Add relro_segment_ field.
15138 * output.cc (Output_section::Output_section): Initialize is_relro_
15139 and is_relro_local_ fields.
15140 (Output_segment::add_output_section): Group relro sections.
15141 (Output_segment::is_first_section_relro): New function.
15142 (Output_segment::maximum_alignment): If there is a relro section,
15143 align the segment to the common page size.
15144 (Output_segment::set_section_addresses): Track whether we are
15145 looking at relro sections. If the last section is a relro
15146 section, align to the common page size.
15147 (Output_segment::set_section_list_addresses): Add in_relro
15148 parameter. Change all callers. Align to the page size when
15149 moving from relro to non-relro section.
15150 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15151 segment.
15152 * output.h (class Output_section): Add is_relro_ and
15153 is_relro_local_ fields.
15154 (Output_section::is_relro): New function.
15155 (Output_section::set_is_relro): New function.
15156 (Output_section::is_relro_local): New function.
15157 (Output_section::set_is_relro_local): New function.
15158 (class Output_segment): Update declarations.
15159 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15160 * sparc.cc (Target_sparc::got_section): Likewise.
15161 * x86_64.cc (Target_x86_64::got_section): Likewise.
15162 * testsuite/relro_test_main.cc: New file.
15163 * testsuite/relro_test.cc: New file.
15164 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15165 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15166 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15167 (relro_test.so, relro_test_pic.o): New targets.
15168 * testsuite/Makefile.in: Rebuild.
15169
a984ee1d
ILT
151702008-05-16 Ian Lance Taylor <iant@google.com>
15171
01676dcd
ILT
15172 * output.cc (Output_segment::add_output_section): Remove front
15173 parameter.
15174 * output.h (class Output_segment): Remove
15175 add_initial_output_section and overloaded add_output_section.
15176 Update declaration of remaining add_output_section.
15177 * layout.cc (Layout::create_interp): Call add_output_section
15178 rather than add_initial_output_section.
15179 (Layout::finish_dynamic_section): Likewise.
15180
497897f9
ILT
15181 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15182 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15183 know the dynamic type.
15184 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15185 field. Initialize it in constructor.
15186 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15187 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15188 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15189 reloc.
15190
a984ee1d
ILT
15191 * output.cc (Output_reloc::get_address): Change return type to
15192 Elf_Addr.
15193 * output.h (class Output_reloc): Update get_address declaration.
15194 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15195 for section addresses.
15196
55ba0940
ILT
151972008-05-09 Ian Lance Taylor <iant@google.com>
15198
15199 PR 6493
15200 * gold.cc (gold_nomem): Use return value of write.
15201
75517b77
ILT
152022008-05-08 Ian Lance Taylor <iant@google.com>
15203
15204 * symtab.c (Symbol::init_base_output_data): Add version
15205 parameter. Change all callers.
15206 (Symbol::init_base_output_segment): Likewise.
15207 (Symbol::init_base_constant): Likewise.
15208 (Symbol::init_base_undefined): Likewise.
15209 (Sized_symbol::init_output_data): Likewise.
15210 (Sized_symbol::init_output_segment): Likewise.
15211 (Sized_symbol::init_constant): Likewise.
15212 (Sized_symbol::init_undefined): Likewise.
15213 (Symbol_table::do_define_in_output_data): If the new symbol has a
15214 version, mark it as the default.
15215 (Symbol_table::do_define_in_output_segment): Likewise.
15216 (Symbol_table::do_define_as_constant): Likewise.
15217 * symtab.h (class Symbol): Update declarations.
15218 (class Sized_symbol): Likewise.
15219 * resolve.cc (Symbol::override_version): New function.
c42e122e 15220 (Symbol::override_base): Call override_version.
75517b77
ILT
15221 (Symbol::override_base_with_special): Likewise.
15222 * testsuite/ver_script_8.script: New file.
15223 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15224 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15225 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15226 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15227
f1f70eae
ILT
152282008-05-06 Ian Lance Taylor <iant@google.com>
15229
f3e9c5c5
ILT
15230 PR 6049
15231 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15232 functions.
15233 (class General_options): Remove existing --undefined, and add
15234 --no-undefined instead. Add new --undefined as synonym for -u.
15235 * archive.cc (Archive::add_symbols): Check whether symbol was
15236 named with -u.
15237 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15238 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15239 all uses. Add IS_UNDEFINED. Update declarations to split
15240 different versions of init_base. Declare init_base_undefined.
15241 (Symbol::is_defined): Handle IS_UNDEFINED.
15242 (Symbol::is_undefined): Likewise.
15243 (Symbol::is_weak_undefined): Call is_undefined.
15244 (Symbol::is_absolute): Handle IS_CONSTANT.
15245 (class Sized_symbol): Update declarations to split different
15246 versions of init. Declare init_undefined.
15247 (class Symbol_table): Declare new functions.
15248 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15249 Change all callers.
15250 (Symbol::init_base_output_data): Likewise.
15251 (Symbol::init_base_output_segment): Likewise.
15252 (Symbol::init_base_constant): Likewise.
15253 (Symbol::init_base_undefined): New function.
15254 (Sized_symbol::init_object): Rename from init. Change all
15255 callers.
15256 (Sized_symbol::init_output_data): Likewise.
15257 (Sized_symbol::init_output_segment): Likewise.
15258 (Sized_symbol::init_constant): Likewise.
15259 (Sized_symbol::init_undefined): New function.
15260 (Symbol_table::add_undefined_symbols_from_command_line): New
15261 function.
15262 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15263 function.
15264 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15265 (Symbol::output_section): Likewise.
15266 (Symbol::set_output_section): Likewise.
15267 (Symbol_table::sized_finalize_symbol): Likewise.
15268 (Symbol_table::sized_write_globals): Likewise.
15269 * resolve.cc (Symbol_table::should_override): Likewise.
15270 (Symbol::override_base_with_special): Likewise.
15271
8bdcdf2c
ILT
15272 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15273 symbol, change it to have default visibility.
15274 * testsuite/protected_1.cc: New file.
15275 * testsuite/protected_2.cc: New file.
15276 * testsuite/protected_3.cc: New file.
15277 * testsuite/protected_main_1.cc: New file.
15278 * testsuite/protected_main_2.cc: New file.
15279 * testsuite/protected_main_3.cc: New file.
15280 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15281 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15282 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15283 (protected_1.so): New target.
15284 (protected_1_pic.o, protected_2_pic.o): New targets.
15285 (protected_3_pic.o): New target.
15286 (check_PROGRAMS): Add protected_2.
15287 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15288 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15289 * testsuite/Makefile.in: Rebuild.
15290
2b706932
ILT
15291 * options.h (DEFINE_var): Add set_user_set_##varname__.
15292 (DEFINE_bool_alias): New macro.
15293 (class General_options): Define -Bstatic using DEFINE_bool_alias
15294 rather than DEFINE_special. Add --undefined as an alias for -z
15295 defs.
15296 * options.cc (General_options::parse_Bstatic): Remove.
15297
d82a5bcc
ILT
15298 * options.h (class General_options): Add --fatal-warnings.
15299 * main.cc (main): Implement --fatal-warnings.
15300 * errors.h (Errors::warning_count): New function.
15301
f1f70eae
ILT
15302 * options.h (class General_options): Add -Bsymbolic-functions.
15303 * symtab.h (Symbol::is_preemptible): Check for
15304 -Bsymbolic-functions.
15305
8825ac63
ILT
153062008-05-05 Ian Lance Taylor <iant@google.com>
15307
d98bc257
ILT
15308 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15309 as noVARNAME rather than no-VARNAME.
15310 (class General_options): Add option -z combreloc.
15311 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15312 get_address.
15313 (Output_reloc::sort_before) [SHT_REL]: New function.
15314 (Output_reloc::sort_before) [SHT_RELA]: New function.
15315 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15316 Sort_relocs_comparison.
15317 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15318 parameter. Change all callers.
15319 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15320 sort_relocs parameter. Change all callers.
15321 * output.cc (Output_reloc::get_address): New function, broken out
15322 of write_rel.
15323 (Output_reloc::write_rel): Call it.
15324 (Output_reloc::compare): New function.
15325 (Output_data_reloc_base::do_write): Optionally sort relocs.
15326
60b2b4e7
ILT
15327 * configure.ac: If targ_extra_obj is set, link it in.
15328 * configure.tgt: Initialize all variables.
15329 (x86_64*): Set targ_extra_obj and targ_extra_size.
15330 * configure: Rebuild.
15331
8825ac63
ILT
15332 * object.cc (Sized_relobj::include_section_group): Adjust section
15333 indexes read from group data. Build vector to pass to
15334 layout_group.
15335 * layout.cc (Layout::layout_group): Add flags and shndxes
15336 parameters. Remove contents parameter. Change caller. Update
15337 explicit instantiations.
15338 * layout.h (class Layout): Update layout_group declaration.
15339 * output.cc (Output_data_group::Output_data_group): Add flags and
15340 input_shndxes parameters. Remove contents parameter. Change
15341 caller.
15342 (Output_data_group::do_write): Change input_sections_ to
15343 input_shndxes_.
15344 * output.h (class Output_data_group): Update constructor
15345 declaration. Rename input_sections_ to input_shndxes_.
15346 * testsuite/many_sections_test.cc: Add template.
15347
e94cf127
CC
153482008-04-30 Cary Coutant <ccoutant@google.com>
15349
4418b2d5
CC
15350 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15351
e94cf127
CC
15352 * layout.cc (Layout::include_section): Refactored check for debug
15353 info section.
15354 (Layout::add_comdat): Add new parameters. Change type
15355 of signature parameter. Add object and shndx to signatures table.
15356 (Layout::find_kept_object): New function.
15357 * layout.h: Include <cstring>.
15358 (Layout::is_debug_info_section): New function.
15359 (Layout::add_comdat): Add new parameters.
15360 (Layout::find_kept_object): New function.
15361 (Layout::Kept_section): New struct.
15362 (Layout::Signatures): Change type of map range.
15363 * object.cc (Relobj::output_section_address): New function.
15364 (Sized_relobj::include_section_group): Add new parameters. Change
15365 calls to Layout::add_comdat. Change to build table of kept comdat
15366 groups and table mapping discarded sections to kept sections.
15367 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15368 (Sized_relobj::do_layout): Change calls to include_section_group and
15369 include_linkonce_section.
15370 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15371 value to zero when section is discarded.
15372 (Sized_relobj::map_to_kept_section): New function.
15373 * object.h (Relobj::output_section_address): New function.
15374 (Relobj::Comdat_group): New type.
15375 (Relobj::find_comdat_group): New function.
15376 (Relobj::Comdat_group_table): New type.
15377 (Relobj::Kept_comdat_section): New type.
15378 (Relobj::Kept_comdat_section_table): New type.
15379 (Relobj::add_comdat_group): New function.
15380 (Relobj::set_kept_comdat_section): New function.
15381 (Relobj::get_kept_comdat_section): New function.
15382 (Relobj::comdat_groups_): New field.
15383 (Relobj::kept_comdat_sections_): New field.
15384 (Symbol_value::input_value): Update comment.
15385 (Sized_relobj::map_to_kept_section) New function.
15386 (Sized_relobj::include_linkonce_section): Add new parameter.
15387 * target-reloc.h (Comdat_behavior): New type.
15388 (get_comdat_behavior): New function.
15389 (relocate_section): Add code to map a discarded section to the
15390 corresponding kept section when applying a relocation.
15391
e4e5049b
CS
153922008-04-30 Craig Silverstein <csilvers@google.com>
15393
15394 * dwarf_reader.cc (next_generation_count): New static var.
15395 (Addr2line_cache_entry): New struct.
15396 (addr2line_cache): New static var.
15397 (Dwarf_line_info::one_addr2line): Added caching.
15398 (Dwarf_line_info::clear_addr2line_cache): New function.
15399 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15400 cache-size parameter.
15401 (Dwarf_line_info::one_addr2line_cache): New function.
15402 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15403 new cache-size argument to one_addr2line(), and clear cache.
15404
d09e9154
CC
154052008-04-28 Cary Coutant <ccoutant@google.com>
15406
15407 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15408 R_386_PC8 relocations.
15409
7ef73768
ILT
154102008-04-23 Ian Lance Taylor <iant@google.com>
15411
55438702
ILT
15412 * object.cc (Sized_relobj::include_section_group): Check for
15413 invalid section group.
15414
c165fb93
ILT
15415 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15416 header size.
15417
7ef73768
ILT
15418 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15419 than read for file header.
15420 * archive.cc (Archive::include_member): Likewise.
15421
6194aaab
L
154222008-04-23 Paolo Bonzini <bonzini@gnu.org>
15423
15424 * aclocal.m4: Regenerate.
15425 * configure: Regenerate.
15426
d491d34e
ILT
154272008-04-19 Ian Lance Taylor <iant@google.com>
15428
5ea2bac6
ILT
15429 * version.cc (version_string): Bump to 1.6.
15430
7bc3e21a
ILT
15431 * testsuite/Makefile.am (many_sections_r_test): New target.
15432 (many_sections_r_test_SOURCES): Remove.
15433 (many_sections_r_test_DEPENDENCIES): Remove.
15434 (many_sections_r_test_LDFLAGS): Remove.
15435 (many_sections_r_test_LDADD): Remove.
15436
7fcd3aa9
ILT
15437 * object.cc (Sized_relobj::do_add_symbols): Always pass
15438 local_symbol_count_ to add_from_relobj.
15439
4c94d6ae
ILT
15440 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15441 every thousand variables.
15442 * testsuite/Makefile.in: Rebuild.
15443
d491d34e
ILT
15444 * object.cc (Xindex::initialize_symtab_xindex): New function.
15445 (Xindex::read_symtab_xindex): New function.
15446 (Xindex::sym_xindex_to_shndx): New function.
15447 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15448 available.
15449 (Sized_relobj::do_initialize_xindex): New function.
15450 (Sized_relobj::do_read_symbols): Adjust section links.
15451 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15452 parameter. Change all callers.
15453 (Sized_relobj::include_section_group): Adjust section links and
15454 symbol section indexes.
15455 (Sized_relobj::do_layout): Adjust section links.
15456 (Sized_relobj::do_count_local_symbols): Adjust section links and
15457 symbol section indexes.
15458 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15459 ordinary and special symbols.
15460 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15461 dynsym_xindex parameters. Change all callers. Adjust section
15462 links. Use SHN_XINDEX when needed.
15463 (Sized_relobj::get_symbol_location_info): Adjust section links.
15464 Don't get fooled by special symbols.
15465 * object.h (class Xindex): Define.
15466 (class Object): Add xindex_ parameter. Declare virtual functoin
15467 do_initialize_xindex.
15468 (Object::adjust_sym_shndx): New function.
15469 (Object::set_xindex): New protected function.
15470 (class Symbol_value): Add is_ordinary_shndx_ field.
15471 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15472 (Symbol_value::value): Assert ordinary section.
15473 (Symbol_value::initialize_input_to_output_map): Likewise.
15474 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15475 Change all callers.
15476 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15477 all callers.
15478 (class Sized_relobj): Update declarations.
15479 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15480 parameter. Change all callers.
15481 (Sized_relobj::adjust_shndx): New function.
15482 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15483 field.
15484 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15485 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15486 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15487 (Sized_dynobj::read_dynsym_section): Adjust section links.
15488 (Sized_dynobj::read_dynamic): Likewise.
15489 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15490 section links.
15491 (Sized_dynobj::do_initialize_xindex): New function.
15492 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15493 do_initialize_xindex.
15494 (Sized_dynobj::adjust_shndx): New function.
15495 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15496 dynsym_xindex_ fields.
15497 (Layout::finalize): Add a call to set_section_indexes before
15498 creating the symtab sections.
15499 (Layout::set_section_indexes): Don't do anything if the section
15500 already has a section index.
15501 (Layout::create_symtab_sections): Add shnum parameter. Change
15502 caller. Create .symtab_shndx section if needed.
15503 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15504 caller.
15505 (Layout::allocated_output_section_count): New function.
15506 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15507 needed.
15508 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15509 fields. Update declarations.
15510 (Layout::symtab_xindex): New function.
15511 (Layout::dynsym_xindex): New function.
15512 (class Write_symbols_task): Add layout_ field.
15513 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15514 Change caller.
15515 * output.cc (Output_section_headers::Output_section_headers): Add
15516 shstrtab_section parameter. Change all callers.
15517 (Output_section_headers::do_sized_write): Store overflow values
15518 for section count and section string table section index in
15519 section header zero.
15520 (Output_file_header::do_sized_write): Check for overflow of
15521 section count and section string table section index.
15522 (Output_symtab_xindex::do_write): New function.
15523 (Output_symtab_xindex::endian_do_write): New function.
15524 * output.h (class Output_section_headers): Add shstrtab_section_.
15525 Update declarations.
15526 (class Output_symtab_xindex): Define.
15527 (Output_section::has_out_shndx): New function.
15528 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15529 field.
15530 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15531 Change all callers.
15532 (Sized_symbol::init): Likewise.
15533 (Symbol::output_section): Check for ordinary symbol.
15534 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15535 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15536 callers.
15537 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15538 Change all callers. Simplify handling of symbols from sections
15539 not included in the link.
15540 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15541 distinction.
15542 (Weak_alias_sorter::operator()): Assert that symbols are
15543 ordinary.
15544 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15545 distinction.
15546 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15547 parameters. Change all callers.
15548 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15549 symbol distinction. Use SHN_XINDEX when needed.
15550 (Symbol_table::write_section_symbol): Add symtab_xindex
15551 parameter. Change all callers.
15552 (Symbol_table::sized_write_section_symbol): Likewise. Use
15553 SHN_XINDEX when needed.
15554 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15555 declarations.
15556 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15557 (Symbol::is_defined): Check is_ordinary.
15558 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15559 (Symbol::is_absolute, Symbol::is_common): Likewise.
15560 (class Sized_symbol): Update declarations.
15561 (class Symbol_table): Update declarations.
15562 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15563 parameters. Change all callers.
15564 (Sized_symbol::override): Likewise.
15565 (Symbol_table::override): Likewise.
15566 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15567 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15568 is_ordinary, and orig_st_shndx parameters. Change all callers.
15569 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15570 to be in an ordinary section.
15571 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15572 object and is_ordinary parameters. Change all callers.
15573 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15574 Change all callers. Don't add undefined or non-ordinary symbols
15575 to reloc_map_.
15576 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15577 Change all callers.
15578 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15579 declarations.
15580 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15581 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15582 (Sized_relobj::relocate_sections): Likewise.
15583 * target-reloc.h (scan_relocs): Adjust section symbol index.
15584 (scan_relocatable_relocs): Likewise.
15585 * i386.cc (Scan::local): Check for ordinary symbols.
15586 * sparc.cc (Scan::local): Likewise.
15587 * x86_64.cc (Scan::local): Likewise.
15588 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15589 to symbol_section_and_value.
15590 * testsuite/many_sections_test.cc: New file.
15591 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15592 (check_PROGRAMS): Add many_sections_test.
15593 (many_sections_test_SOURCES): Define.
15594 (many_sections_test_DEPENDENCIES): Define.
15595 (many_sections_test_LDFLAGS): Define.
15596 (BUILT_SOURCES): Add many_sections_define.h.
15597 (many_sections_define.h): New target.
15598 (BUILT_SOURCES): Add many_sections_check.h.
15599 (many_sections_check.h): New target.
15600 (check_PROGRAMS): Add many_sections_r_test.
15601 (many_sections_r_test_SOURCES): Define.
15602 (many_sections_r_test_DEPENDENCIES): Define.
15603 (many_sections_r_test_LDFLAGS): Define.
15604 (many_sections_r_test_LDADD): Define.
15605 (many_sections_r_test.o): New target.
15606 * testsuite/Makefile.in: Rebuild.
15607
c5818ff1
CC
156082008-04-17 Cary Coutant <ccoutant@google.com>
15609
15610 * errors.cc (Errors::info): New function.
15611 (gold_info): New function.
15612 * errors.h (Errors::info): New function.
15613 * gold.h (gold_info): New function.
15614 * object.cc (Input_objects::add_object): Print trace output.
15615 * options.cc (options::parse_set): New function.
15616 (General_options::parse_wrap): Deleted.
15617 (General_options::General_options): Deleted initializer.
15618 * options.h (options::String_set): New typedef.
15619 (options::parse_set): New function.
15620 (DEFINE_set): New macro.
15621 (General_options::wrap): Changed to use DEFINE_set. Changed
15622 callers of any_wrap_symbols and is_wrap_symbol.
15623 (General_options::trace, General_options::trace_symbol):
15624 New options.
15625 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15626 (General_options::wrap_symbols_): Deleted.
15627 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15628
b5be4a7c
DM
156292008-04-17 David S. Miller <davem@davemloft.net>
15630
15631 * options.cc (General_options::parse_V): New function.
15632 * options.h: Add entries for -V and -Qy.
15633
155a0dd7
ILT
156342008-04-17 Ian Lance Taylor <iant@google.com>
15635
15636 * common.cc (Symbol_table::allocate_commons): Remove options
15637 parameter. Change caller.
15638 (Symbol_table::do_allocate_commons): Remove options parameter.
15639 Change caller. Just call do_allocate_commons_list twice.
15640 (Symbol_table::do_allocate_commons_list): New function, broken out
15641 of do_allocate_commons.
15642 * common.h (class Allocate_commons_task): Remove options_ field.
15643 Update constructor.
15644 * symtab.cc (Symbol_table::Symbol_table): Initialize
15645 tls_commons_.
15646 (Symbol_table::add_from_object): Put TLS common symbols on
15647 tls_commons_ list.
15648 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15649 which are IN_OUTPUT_DATA.
15650 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15651 allocate_commons and do_allocate_commons declarations. Declare
15652 do_allocate_commons_list.
15653 * gold.cc (queue_middle_tasks): Update creation of
15654 Allocate_commons_task to not pass options.
15655 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15656 (TLS_TEST_C_FLAGS): New variable.
15657 (tls_test_c_pic.o): New target.
15658 (tls_test_shared.so): Link in tls_test_c_pic.o.
15659 (tls_test_c_pic_ie.o): New target.
15660 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15661 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15662 (tls_test_c.o): New target.
15663 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15664 (tls_pic_test_LDADD): Likewise.
15665 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15666 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15667 (tls_test_c_gnu2.o): New target.
15668 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15669 tls_test_c_gnu2.o.
15670 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15671 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15672 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15673 * testsuite/tls_test.cc: Include "config.h".
15674 (t_last): Call t11_last.
15675 * testsuite/tls_test.h (t11, t11_last): Declare.
15676 * testsuite/tls_test_c.c: New file.
15677 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15678 * configure.ac: Check for OpenMP support.
15679 * configure, config.in, Makefile.in: Rebuild.
15680 * testsuite/Makefile.in: Rebuild.
15681
edfbb029
CC
156822008-04-16 Cary Coutant <ccoutant@google.com>
15683
15684 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15685 (Target_i386::tls_base_symbol_defined_): New field.
15686 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15687 (Target_i386::Scan::global): Likewise.
15688 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15689 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15690 (Target_x86_64::tls_base_symbol_defined_): New field.
15691 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15692 (Target_x86_64::Scan::global): Likewise.
15693
f3c69fca
CC
156942008-04-16 Cary Coutant <ccoutant@google.com>
15695
15696 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15697 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15698 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15699 building shared libraries.
15700 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15701 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15702 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15703 * testsuite/Makefile.in: Rebuild.
15704 * testsuite/weak_undef.h: New file.
15705 * testsuite/weak_undef_file1.cc: Add extra test cases.
15706 * testsuite/weak_undef_file2.cc: Likewise.
15707 * testsuite/weak_undef_test.cc: Likewise.
15708
7c414435
DM
157092008-04-16 David S. Miller <davem@davemloft.net>
15710
32b769e1
DM
15711 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15712 Add issued_non_pic_error_ field. Declare check_non_pic.
15713 (Target_sparc::Scan::check_non_pic): New function.
15714 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15715 (Target_sparc::Scan::global): Likewise.
15716
11936fb1
DM
15717 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15718 * configure: Rebuild.
15719
7c414435
DM
15720 * options.h (DEFINE_enable): New macro.
15721 (new_dtags): New enable option.
15722 (initfirst, interpose, loadfltr, nodefaultlib,
15723 nodelete, nodlopen, nodump): New -z options.
15724 * layout.cc (Layout:finish_dynamic_section): If new
15725 dtags enabled, emit DT_RUNPATH. Also, emit a
15726 DT_FLAGS_1 containing any specified -z flags.
15727
85c7bf8b
ILT
157282008-04-16 Ian Lance Taylor <iant@google.com>
15729
12c0daef
ILT
15730 * copy-relocs.cc: New file.
15731 * copy-relocs.h: New file.
15732 * reloc.cc: Remove Copy_relocs code.
15733 * reloc.h: Likewise.
15734 * reloc-types.h (struct Reloc_types) [both versions]: Add
15735 get_reloc_addend_noerror.
15736 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15737 variants of add_global which take an addend which must be zero.
15738 * i386.cc: Include "copy-relocs.h".
15739 (class Target_i386): Change type of copy_relocs_ to variable,
15740 update initializer.
15741 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15742 Change all callers.
15743 (Target_i386::do_finalize_sections): Change handling of
15744 copy_relocs_.
15745 * sparc.cc: Include "copy-relocs.h".
15746 (class Target_sparc): Change type of copy_relocs_ to variable,
15747 update initializer.
15748 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15749 Change all callers.
15750 (Target_sparc::do_finalize_sections): Change handling of
15751 copy_relocs_.
15752 * x86_64.cc: Include "copy-relocs.h".
15753 (class Target_x86_64): Change type of copy_relocs_ to variable,
15754 update initializer.
15755 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15756 class. Change all callers.
15757 (Target_x86_64::do_finalize_sections): Change handling of
15758 copy_relocs_.
15759 * Makefile.am (CCFILES): Add copy-relocs.cc.
15760 (HFILES): Add copy-relocs.h.
15761
4f4995b6
ILT
15762 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15763
85c7bf8b
ILT
15764 * testsuite/script_test_4.sh: Permit leading zeroes.
15765
4f2a9edd
ILT
157662008-04-15 Ian Lance Taylor <iant@google.com>
15767
e6188289
ILT
15768 * script-sections.cc (Script_sections::create_segments): Use
15769 header_size_adjustment even when there is enough room for the
15770 headers.
15771 * testsuite/script_test_4.sh: New file.
15772 * testsuite/script_test_4.t: New file.
15773 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15774 (check_DATA): Add script_test_4.stdout.
15775 (MOSTLYCLEANFILES): Likewise.
15776 (script_test_4): New target.
15777 (script_test_4.stdout): New target.
15778 * testsuite/Makefile.in: Rebuild.
15779
4f2a9edd
ILT
15780 * sparc.cc: Add definitions for Output_data_plt_sparc class
15781 constants.
15782
f5314dd5
DM
157832008-04-14 David S. Miller <davem@davemloft.net>
15784
15785 * sparc.cc: New file.
15786 * Makefile.am (TARGETSOURCES): Add sparc.cc
15787 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15788 * configure.tgt: Document targ_extra_size and
15789 targ_extra_big_endian. Add entries for sparc-* and
15790 sparc64-*.
15791 * configure.ac: Handle targ_extra_size and
15792 targ_extra_big_endian.
15793 * Makefile.in: Rebuild.
15794 * configure: Likewise.
15795 * po/POTFILES.in: Likewise.
15796 * po/gold.pot: Likewise.
15797
154e0e9a
ILT
157982008-04-14 Ian Lance Taylor <iant@google.com>
15799
15800 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15801 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15802 in the name/type/flags to section mapping. Don't call
15803 allocate_output_section.
15804 (Layout::choose_output_section): Change parameter from adjust_name
15805 to is_input_section. Don't permit input sections after sections
15806 are attached to segments. Don't call allocate_output_section.
15807 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15808 not write_enable_output_section.
15809 (Layout::make_output_section): Don't push to
15810 unattached_section_list_ nor call attach_to_segment. Call
15811 attach_section_to_segment if sections are attached.
15812 (Layout::attach_sections_to_segments): New function.
15813 (Layout::attach_section_to_segment): New function.
15814 (Layout::attach_allocated_section_to_segment): Rename from
15815 attach_to_segment. Remove flags parameter.
15816 (Layout::allocate_output_section): Remove function.
15817 (Layout::write_enable_output_section): Remove function.
15818 * layout.h (class Layout): Update for above changes. Add new
15819 field sections_are_attached_.
15820 * output.h (Output_section::update_flags_for_input_section): New
15821 function.
15822 * output.cc (Output_section::add_input_section): Call
15823 update_flags_for_input_section.
15824 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15825
009a67a2
CC
158262008-04-11 Cary Coutant <ccoutant@google.com>
15827
15828 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15829 thought unnecessary.
15830 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15831
759b1a24
ILT
158322008-04-11 Ian Lance Taylor <iant@google.com>
15833
15834 * output.h (class Output_section_data): Remove inline definition
15835 of set_addralign.
15836 * output.cc (Output_section_data::set_addralign): New function.
15837
c2b45e22
CC
158382008-04-11 Cary Coutant <ccoutant@google.com>
15839
15840 Add support for TLS descriptors for i386 and x86_64.
15841 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15842 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15843 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15844 GOT_TYPE_TLS_DESC.
15845 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15846 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15847 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15848 relocations.
15849 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15850 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15851 Fix problem with initial-exec relocations.
15852 (Target_i386::Relocate::relocate_tls): Likewise.
15853 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15854 relaxation.
15855 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15856 support for section-plus-offset dynamic table entries.
15857 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15858 (Output_data_dynamic::Dynamic_entry): Add support for
15859 section-plus-offset dynamic table entries.
15860 (Output_data_dynamic::Classification): Likewise.
15861 (Output_data_dynamic::classification_): Renamed offset_.
15862 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15863 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15864 (Target_x86_64::make_plt_section): New function.
15865 (Target_x86_64::reserve_tlsdesc_entries): New function.
15866 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15867 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15868 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15869 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15870 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15871 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15872 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15873 add extra PLT entry for TLS descriptors.
15874 (Output_data_plt_x86_64::got_): New field.
15875 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15876 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15877 fields.
15878 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15879 descriptors.
15880 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15881 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15882 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15883 R_386_TLS_DESC_CALL relocations.
15884 (Target_x86_64::Scan::global): Likewise.
15885 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15886 for TLS descriptors.
15887 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15888 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15889 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15890 GD-to-IE relaxation.
15891 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15892 and TLS_DESCRIPTORS.
15893 * Makefile.in: Rebuild.
15894 * configure: Rebuild.
15895 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15896 (tls_test_shared2.so): New target.
15897 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15898 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15899 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15900 (tls_shared_gd_to_ie_test_LDADD): New variable.
15901 (tls_shared_gnu2_gd_to_ie_test): New target.
15902 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15903 New targets.
15904 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15905 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15906 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15907 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15908 (tls_shared_gnu2_test): New target.
15909 (tls_test_gnu2_shared.so): New target.
15910 (tls_shared_gnu2_test_SOURCES): New variable.
15911 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15912 (tls_shared_gnu2_test_LDFLAGS): New variable.
15913 (tls_shared_gnu2_test_LDADD): New variable.
15914 * testsuite/Makefile.in: Rebuild.
15915 * testsuite/Makefile.
15916
83bfb6b7
ILT
159172008-04-11 Ian Lance Taylor <iant@google.com>
15918
15919 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15920 justsyms.t.
15921 * testsuite/Makefile.in: Rebuild.
15922
15923 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15924 long.
15925 * testsuite/script_test_2.cc (main): Adjust test.
15926
706e1f5e
ILT
159272008-04-11 David S. Miller <davem@davemloft.net>
15928 Ian Lance Taylor <iant@google.com>
15929
15930 * options.h (General_options): Add entries for '-Y' and
15931 '-relax'.
15932 * options.cc (General_options:finalize): If -Y was used, add those
15933 entries to the library path instead of the default "/lib" and
15934 "/usr/lib".
15935
7c98e6bb
DM
159362008-04-11 David S. Miller <davem@davemloft.net>
15937
15938 * testsuite/justsyms.t: Start at 0x100.
15939 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15940 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15941 long.
15942 * testsuite/script_test_2.cc: Adjust string and section length
15943 checks.
7c98e6bb 15944
99a37bfd
ILT
159452008-04-09 Ian Lance Taylor <iant@google.com>
15946
2cefc357
ILT
15947 PR gold/5996
15948 * script-sections.cc (Sections_element::allocate_to_segment): Add
15949 orphan parameter.
15950 (Output_section_definition::allocate_to_segment): Likewise.
15951 (Orphan_output_section::allocate_to_segment): Likewise.
15952 (Script_sections::attach_sections_using_phdrs_clause): Don't
15953 propagate non-PT_LOAD segments to orphan sections.
15954 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15955 readelf rather than objdump.
15956 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15957 .interp section and PT_INTERP segment are the same size.
15958 * testsuite/Makefile.in: Rebuild.
15959
99a37bfd
ILT
15960 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15961 aliases for symbols defined in the same object.
15962 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15963 (weak_alias_test_SOURCES): New variable.
15964 (weak_alias_test_DEPENDENCIES): New variable.
15965 (weak_alias_test_LDFLAGS): New variable.
15966 (weak_alias_test_LDADD): New variable.
15967 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15968 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15969 (weak_alias_test_3.o): New target.
15970 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15971 * testsuite/weak_alias_test_main.cc: New file.
15972 * testsuite/weak_alias_test_1.cc: New file.
15973 * testsuite/weak_alias_test_2.cc: New file.
15974 * testsuite/weak_alias_test_3.cc: New file.
15975
780e49c5
ILT
159762008-04-08 Ian Lance Taylor <iant@google.com>
15977
cdb0b8f5
ILT
15978 * options.h (class General_options): Add --noinhibit-exec option.
15979 * main.cc (main): Check --noinhibit-exec.
15980
0864d551
ILT
15981 * options.h (class General_options): Define --wrap as a special
15982 option. Add wrap_symbols_ field.
15983 (General_options::any_wrap_symbols): New function.
15984 (General_options::is_wrap_symbol): New function.
15985 * options.cc (General_options::parse_wrap): New function.
15986 (General_options::General_options): Initialize wrap_symbols_.
15987 * symtab.cc (Symbol_table::wrap_symbol): New function.
15988 (Symbol_table::add_from_object): Handle --wrap.
15989 * symtab.h (class Symbol_table): Declare wrap_symbol.
15990 * target.h (Target::wrap_char): New function.
15991 (Target::Target_info): Add wrap_char field.
15992 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15993 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15994 * testsuite/testfile.cc (Target_test::test_target_info):
15995 Likewise.
15996
789aa6de
ILT
15997 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15998 there is one.
15999
2c38906f
ILT
16000 * layout.h (class Layout): Add added_eh_frame_data_ field.
16001 * layout.cc (Layout::Layout): Initialize new field.
16002 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16003 output section until we find a section we merged successfully.
16004 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16005 that the size be non-zero.
16006
780e49c5
ILT
16007 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16008 qualifier.
16009
7fcd0256
ILT
160102008-04-08 Craig Silverstein <csilvers@google.com>
16011
16012 * configure.ac: Export new conditional variable HAVE_ZLIB.
16013 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16014 on HAVE_ZLIB.
16015 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16016 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16017
6835af53
ILT
160182008-04-07 Ian Lance Taylor <iant@google.com>
16019
e24f324c
ILT
16020 * version.cc (version_string): Set to "1.5".
16021
a036edd8
ILT
16022 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16023 Add issued_non_pic_error_ field. Declare check_non_pic.
16024 (Target_x86_64::Scan::check_non_pic): New function.
16025 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16026 (Target_x86_64::Scan::global): Likewise.
16027
624f8810
ILT
16028 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16029 addend parameter. Change caller. Handle merge sections.
16030 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16031 Address to Addend. Don't add in the result of
16032 local_section_offset, pass down the addend and use the returned
16033 value.
16034 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16035 Update declarations of local_section_offset and symbol_value.
16036 * testsuite/two_file_test_1.cc (t18): New function.
16037 * testsuite/two_file_test_2.cc (f18): New function.
16038 * testsuite/two_file_test_main.cc (main): Call t18.
16039 * testsuite/two_file_test.h (t18, f18): Declare.
16040
6835af53
ILT
16041 * configure.ac: Don't test for objdump, c++filt, or readelf.
16042 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16043 conditionals.
16044 (TEST_READELF): New variable.
16045 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16046 (check_PROGRAMS): Add two_file_strip_test.
16047 (two_file_strip_test): New target.
16048 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16049 (two_file_same_shared_strip_test_SOURCES): New variable.
16050 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16051 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16052 (two_file_same_shared_strip_test_LDADD): New variable.
16053 (two_file_shared_strip.so): New target.
16054 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16055 (ver_test_5.syms, ver_test_7.syms): Likewise.
16056 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16057 (strip_test_3.stdout): Use TEST_OBJDUMP.
16058 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16059
86925eef
CC
160602008-04-04 Cary Coutant <ccoutant@google.com>
16061
16062 * symtab.h (Symbol::is_weak_undefined): New function.
16063 (Symbol::is_strong_undefined): New function.
16064 (Symbol::is_absolute): New function.
16065 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16066 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16067 absolute symbols.
16068 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16069 (weak_undef_test): New target.
16070 * testsuite/Makefile.in: Rebuild.
16071 * testsuite/weak_undef_file1.cc: New file.
16072 * testsuite/weak_undef_file2.cc: New file.
16073 * testsuite/weak_undef_test.cc: New file.
16074
126f3ece
ILT
160752008-04-03 Craig Silverstein <csilvers@google.com>
16076
16077 * compressed_output.h (class Output_compressed_section): Use
16078 unsigned buffer.
16079 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16080 add zlib header.
16081 (zlib_compressed_suffix): Removed.
16082 (Output_compressed_section::set_final_data_size): Use unsigned
16083 buffers.
16084 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16085 Fix linker invocation.
16086 (flagstest_o_specialfile_and_compress_debug_sections):
16087 Likewise.
16088 * testsuite/Makefile.in: Regenerated.
16089
deae2a14
DM
160902008-04-02 David S. Miller <davem@davemloft.net>
16091
16092 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16093 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16094
70752818
ILT
160952008-04-02 Craig Silverstein <csilvers@google.com>
16096
16097 * TODO: New file.
16098
39d0cb0e
ILT
160992008-04-02 Ian Lance Taylor <iant@google.com>
16100
16101 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16102 parameters. Update for new key type to views_. Change all
16103 callers.
16104 (File_read::read): Adjust for byteshift in returned view.
16105 (File_read::add_view): New function, broken out of
16106 find_and_make_view.
16107 (File_read::make_view): New function, broken out of
16108 find_and_make_view.
16109 (File_read::find_or_make_view): Add offset and aligned
16110 parameters. Rewrite accordingly. Change all callers.
16111 (File_read::get_view): Add offset and aligned parameters. Adjust
16112 for byteshift in return value.
16113 (File_read::get_lasting_view): Likewise.
16114 * fileread.h (class File_read): Update declarations.
16115 (class File_read::View): Add byteshift_ field. Add byteshift to
16116 constructor. Add byteshift method.
16117 * archive.h (Archive::clear_uncached_views): New function.
16118 (Archive::get_view): Add aligned parameter. Change all callers.
16119 * object.h (Object::get_view): Add aligned parameter. Change all
16120 callers.
16121 (Object::get_lasting_view): Likewise.
16122
16123 * fileread.cc (File_read::release): Don't call clear_views if
16124 there are multiple objects.
16125 * fileread.h (File_read::clear_uncached_views): New function.
16126 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16127 on the archive.
16128
a1207466
CC
161292008-03-31 Cary Coutant <ccoutant@google.com>
16130
16131 Add thin archive support.
16132 * archive.cc (Archive::armagt): New const.
16133 (Archive::setup): Remove task parameter and calls to unlock.
16134 (Archive::unlock_nested_archives): New function.
16135 (Archive::read_header): Add nested_off parameter. Change
16136 all callers.
16137 (Archive::interpret_header): Likewise.
16138 (Archive::include_all_members): Change to handle thin
16139 archives.
16140 (Archive::include_member): Likewise.
16141 * archive.h (Archive::Archive): Add new parameters and
16142 initializers.
16143 (Archive::armagt): New const.
16144 (Archive::setup): Remove task parameter.
16145 (Archive::unlock_nested_archives): New function.
16146 (Archive::read_header): Add nested_off parameter.
16147 (Archive::interpret_header): Likewise.
16148 (Archive::Nested_archive_table): New typedef.
16149 (Archive::is_thin_archive_): New field.
16150 (Archive::nested_archives_): New field.
16151 (Archive::options_): New field.
16152 (Archive::dirpath_): New field.
16153 (Archive::task_): New field.
16154 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16155 for thin archives. Pass additional parameters to
16156 Archive::Archive. Unlock the archive file after calling
16157 Archive::setup.
cd536b21 16158
479f6503
ILT
161592008-03-29 Ian Lance Taylor <iant@google.com>
16160
686c8caf
ILT
16161 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16162 version symbol to be local.
16163 * testsuite/ver_test_4.sh: New file.
16164 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16165 (check_DATA): Add ver_test_4.syms.
16166 (ver_test_4.syms): New target.
16167 * testsuite/Makefile.in: Rebuild.
16168
ab794b6b
ILT
16169 * output.cc
16170 (Output_section::Input_section_sort_entry::has_priority): New
16171 function.
16172 (Output_section::Input_section_sort_entry::match_file_name): New
16173 function.
16174 (Output_section::Input_section_sort_entry::match_section_name):
16175 Remove.
16176 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16177 Remove.
16178 (Output_section::Input_section_sort_entry::match_section_file):
16179 Remove.
16180 (Output_section::Input_section_sort_compare::operator()): Rewrite
16181 using new Input_section_sort_entry functions. Sort crtbegin and
16182 crtend first. Sort sections with no priority before sections with
16183 a priority.
16184 * testsuite/initpri1.c (d3): Check j != 4.
16185 (cd5): New constructor/destructor function.
16186 (main): Check j != 2.
16187
479f6503
ILT
16188 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16189 new symbol when resolving, don't call set_is_default.
16190 * testsuite/ver_test_7.cc: New file.
16191 * testsuite/ver_test_7.sh: New file.
16192 * testsuite/Makefile.am (ver_test_7.so): New target.
16193 (ver_test_7.o): New target.
16194 (check_SCRIPTS): Add ver_test_7.sh.
16195 (check_DATA): Add ver_test_7.syms.
16196 (ver_test_7.syms): New target.
16197
2fd32231
ILT
161982008-03-28 Ian Lance Taylor <iant@google.com>
16199
16200 * layout.cc (Layout::layout): If we see an input section with a
16201 name that needs sorting, set the must_sort flag for the output
16202 section.
16203 (Layout::make_output_section): If the name of the output section
16204 indicates that it might require sorting, set the may_sort flag.
16205 * output.h (Output_section::may_sort_attached_input_sections): New
16206 function.
16207 (Output_section::set_may_sort_attached_input_sections): New
16208 function.
16209 (Output_section::must_sort_attached_input_sections): New
16210 function.
16211 (Output_section::set_must_sort_attached_input_sections): New
16212 function.
16213 (class Output_section): Declare Input_section_sort_entry. Define
16214 Input_section_sort_compare. Declare
16215 sort_attached_input_sections. Add new fields:
16216 may_sort_attached_input_sections_,
16217 must_sort_attached_input_sections_,
16218 attached_input_sections_are_sorted_.
16219 * output.cc (Output_section::Output_section): Initialize new
16220 fields.
16221 (Output_section::add_input_section): Add an entry to
16222 input_sections_ if may_sort or must_sort are true.
16223 (Output_section::set_final_data_size): Call
16224 sort_attached_input_sections if necessary.
16225 (Output_section::Input_section_sort_entry): Define new class.
16226 (Output_section::Input_section_sort_compare::operator()): New
16227 function.
16228 (Output_section::sort_attached_input_sections): New function.
16229 * configure.ac: Check whether the compiler supports constructor
16230 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16231 * testsuite/initpri1.c: New file.
16232 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16233 CONSTRUCTOR_PRIORITY.
16234 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16235 (initpri1_LDFLAGS): New variable.
16236 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16237
18e6b24e
ILT
162382008-03-27 Ian Lance Taylor <iant@google.com>
16239
49bdd526
ILT
16240 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16241 * testsuite/common_test_1.c: New file.
16242 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16243 (common_test_1_SOURCES): New variable.
16244 (common_test_1_DEPENDENCIES): New variable.
16245 (common_test_1_LDFLAGS): New variable.
16246
18e6b24e
ILT
16247 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16248 and commons_ correctly when NAME/VERSION does not override
16249 NAME/NULL.
16250 * testsuite/ver_test_6.c: New file.
16251 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16252 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16253 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16254
04bf7072
ILT
162552008-03-26 Ian Lance Taylor <iant@google.com>
16256
5871526f
ILT
16257 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16258 of an undefined symbol from a version script.
16259 * testsuite/Makefile.am (ver_test_5.so): New target.
16260 (ver_test_5.o): New target.
16261 (check_SCRIPTS): Add ver_test_5.sh.
16262 (check_DATA): Add ver_test_5.syms.
16263 (ver_test_5.syms): New target.
16264 * testsuite/ver_test_5.cc: New file.
16265 * testsuite/ver_test_5.script: New file.
16266 * testsuite/ver_test_5.sh: New file.
16267 * Makefile.in, testsuite/Makefile.in: Rebuild.
16268
04bf7072
ILT
16269 PR gold/5986
16270 Fix problems building gold with gcc 4.3.0.
16271 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16272 (gold_error_at_location, gold_warning_at_location): Use it.
16273 * configure.ac: Check whether we can compile and use a template
16274 function with a printf attribute.
16275 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16276 when jumping over bytes.
16277 * object.cc: Instantiate Object::read_section_data.
16278 * debug.h: Include <cstring>
16279 * dwarf_reader.cc: Include <algorithm>
16280 * main.cc: Include <cstring>.
16281 * options.cc: Include <cstring>.
16282 * output.cc: Include <cstring>.
16283 * script.cc: Include <cstring>.
16284 * script.h: Include <string>.
16285 * symtab.cc: Include <cstring> and <algorithm>.
16286 * target-select.cc: Include <cstring>.
16287 * version.cc: Include <string>.
16288 * testsuite/testmain.cc: Include <cstdlib>.
16289 * configure, config.in: Rebuild.
16290
874c5b28
ILT
162912008-03-25 Ian Lance Taylor <iant@google.com>
16292
819d6c3a
ILT
16293 * options.cc: Include "../bfd/bfdver.h".
16294 (options::help): Print bug reporting address.
16295
f4b2c6f5
ILT
16296 * version.cc (print_version): Adjust output for current value of
16297 BFD_VERSION_STRING.
16298
16299 * NEWS: New file.
16300
e96caa79
ILT
16301 * options.cc (options::help): Print list of supported targets.
16302 * target-select.h: Include <vector>.
16303 (class Target_selector): Make machine_, size_, and is_big_endian_
16304 fields const. Add bfd_name_ and instantiated_target_ fields.
16305 (Target_selector::Target_selector): Add bfd_name parameter.
16306 (Target_selector::recognize): Make non-virtual, call
16307 do_recognize.
16308 (Target_selector::recognize_by_name): Make non-virtual, call
16309 do_recognize_by_name.
16310 (Target_selector::supported_names): New function.
16311 (Target_selector::bfd_name): New function.
16312 (Target_selector::do_instantiate_target): New pure virtual
16313 function.
16314 (Target_selector::do_recognize): New virtual function.
16315 (Target_selector::do_recognize_by_name): New virtual function.
16316 (Target_selector::instantiate_target): New private function.
16317 (supported_target_names): Declare.
16318 * target-select.cc (Target_selector::Target_selector): Update for
16319 new parameter and fields.
16320 (select_target_by_name): Check that the name matches before
16321 calling recognize_by_name.
16322 (supported_target_names): New function.
16323 * i386.cc (class Target_selector_i386): Update Target_selector
16324 constructor call. Remove recognize and recognize_by_name. Add
16325 do_instantiate_target.
16326 * x86_64.cc (class Target_selector_x86_64): Likewise.
16327 * testsuite/testfile.cc (class Target_selector_test): Update for
16328 changes to Target_selector.
16329
874c5b28
ILT
16330 * README: Rewrite, with some notes on unsupported features.
16331
0a65a3a7
CC
163322008-03-24 Cary Coutant <ccoutant@google.com>
16333
16334 * i386.cc (Target_i386::Got_type): New enum declaration.
16335 (Target_i386::Scan::local): Updated callers of Output_data_got
16336 member functions.
16337 (Target_i386::Scan::global): Likewise.
16338 (Target_i386::Relocate::relocate): Likewise.
16339 (Target_i386::Relocate::relocate_tls): Likewise.
16340 * object.h (Got_offset_list): New class.
16341 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16342 (Sized_relobj::local_got_offset): Likewise.
16343 (Sized_relobj::set_local_got_offset): Likewise.
16344 (Sized_relobj::local_has_tls_got_offset): Removed.
16345 (Sized_relobj::local_tls_got_offset): Removed.
16346 (Sized_relobj::set_local_tls_got_offset): Removed.
16347 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16348 * output.cc (Output_data_got::add_global): Added got_type parameter.
16349 (Output_data_got::add_global_with_rel): Likewise.
16350 (Output_data_got::add_global_with_rela): Likewise.
16351 (Output_data_got::add_global_pair_with_rel): New function.
16352 (Output_data_got::add_global_pair_with_rela): New function.
16353 (Output_data_got::add_local): Added got_type parameter.
16354 (Output_data_got::add_local_with_rel): Likewise.
16355 (Output_data_got::add_local_with_rela): Likewise.
16356 (Output_data_got::add_local_pair_with_rel): New function.
16357 (Output_data_got::add_local_pair_with_rela): New function.
16358 (Output_data_got::add_global_tls): Removed.
16359 (Output_data_got::add_global_tls_with_rel): Removed.
16360 (Output_data_got::add_global_tls_with_rela): Removed.
16361 (Output_data_got::add_local_tls): Removed.
16362 (Output_data_got::add_local_tls_with_rel): Removed.
16363 (Output_data_got::add_local_tls_with_rela): Removed.
16364 * output.h (Output_data_got::add_global): Added got_type parameter.
16365 (Output_data_got::add_global_with_rel): Likewise.
16366 (Output_data_got::add_global_with_rela): Likewise.
16367 (Output_data_got::add_global_pair_with_rel): New function.
16368 (Output_data_got::add_global_pair_with_rela): New function.
16369 (Output_data_got::add_local): Added got_type parameter.
16370 (Output_data_got::add_local_with_rel): Likewise.
16371 (Output_data_got::add_local_with_rela): Likewise.
16372 (Output_data_got::add_local_pair_with_rel): New function.
16373 (Output_data_got::add_local_pair_with_rela): New function.
16374 (Output_data_got::add_global_tls): Removed.
16375 (Output_data_got::add_global_tls_with_rel): Removed.
16376 (Output_data_got::add_global_tls_with_rela): Removed.
16377 (Output_data_got::add_local_tls): Removed.
16378 (Output_data_got::add_local_tls_with_rel): Removed.
16379 (Output_data_got::add_local_tls_with_rela): Removed.
16380 * resolve.cc (Symbol::override_base_with_special): Removed
16381 reference to has_got_offset_ field.
16382 * symtab.cc (Symbol::init_fields): Replaced initialization
16383 of got_offset_ with got_offsets_. Removed initialization
16384 of has_got_offset_
53fcba31 16385 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16386 (Symbol::got_offset): Likewise.
16387 (Symbol::set_got_offset): Likewise.
16388 (Symbol::has_tls_got_offset): Removed.
16389 (Symbol::tls_got_offset): Removed.
16390 (Symbol::set_tls_got_offset): Removed.
16391 (Symbol::got_offset_): Removed.
16392 (Symbol::tls_mod_got_offset_): Removed.
16393 (Symbol::tls_pair_got_offset_): Removed.
16394 (Symbol::got_offsets_): New field.
16395 (Symbol::has_got_offset): Removed.
16396 (Symbol::has_tls_mod_got_offset): Removed.
16397 (Symbol::has_tls_pair_got_offset): Removed.
16398 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16399 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16400 member functions.
16401 (Target_x86_64::Scan::global): Likewise.
16402 (Target_x86_64::Relocate::relocate): Likewise.
16403 (Target_x86_64::Relocate::relocate_tls): Likewise.
16404
bd52eafb
BE
164052008-03-25 Ben Elliston <bje@au.ibm.com>
16406
16407 * yyscript.y: Fix spelling error in comment.
16408
8b105e34
ILT
164092008-03-24 Ian Lance Taylor <iant@google.com>
16410
8ed814a9
ILT
16411 * options.h (class General_options): Define build_id option.
16412 * layout.h (class Layout): Declare write_build_id, create_note,
16413 create_build_id. Add build_id_note_ member.
16414 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16415 "libiberty.h", "md5.h", "sha1.h".
16416 (Layout::Layout): Initialize eh_frame_data_,
16417 eh_frame_hdr_section_, and build_id_note_.
16418 (Layout::finalize): Call create_build_id.
16419 (Layout::create_note): New function, broken out of
16420 Layout::create_gold_note.
16421 (Layout::create_gold_note): Call create_note.
16422 (Layout::create_build_id): New function.
16423 (Layout::write_build_id): New function.
16424 (Close_task_runner::run): Call write_build_id.
16425
8b105e34
ILT
16426 * x86_64.cc: Correct license to GPLv3.
16427
086a1841
ILT
164282008-03-23 Ian Lance Taylor <iant@google.com>
16429
16430 * options.cc: Include "demangle.h".
16431 (parse_optional_string): New function.
16432 (parse_long_option): Handle takes_optional_argument.
16433 (parse_short_option): Update dash_z initializer. Handle
16434 takes_optional_argument.
16435 (General_options::General_options): Initialize do_demangle_.
16436 (General_options::finalize): Set do_demangle_. Handle demangling
16437 style.
16438 * options.h (parse_optional_string): Declare.
16439 (struct One_option): Add optional_arg field. Update constructor.
16440 Update call constructor calls. Add takes_optional_argument
16441 function.
16442 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16443 (DEFINE_optional_string): Define.
16444 (General_options::demangle): Change from DEFINE_bool to
16445 DEFINE_optional_string.
16446 (General_options::no_demangle): New function.
16447 (General_options::do_demangle): New function.
16448 (General_options::set_do_demangle): New function.
16449 (General_options::execstack_status_): Move definition to end of
16450 class definition.
16451 (General_options::static_): Likewise.
16452 (General_options::do_demangle_): New field.
16453 * object.cc (big_endian>::get_symbol_location_info): Call
16454 Options::do_demangle, not Options::demangle.
16455 * symtab.cc (demangle): Likewise.
16456
cbb93e63
ILT
164572008-03-22 Ian Lance Taylor <iant@google.com>
16458
16459 * gold.h: Include <cstddef> and <sys/types.h>
16460 * options.h: Include <cstring>.
16461
ec531623
ILT
164622008-03-21 Ian Lance Taylor <iant@google.com>
16463
16464 * Added source code to GNU binutils.
752937aa 16465\f
b90efa5b 16466Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16467
16468Copying and distribution of this file, with or without modification,
16469are permitted in any medium without royalty provided the copyright
16470notice and this notice are preserved.
16471
16472Local Variables:
16473mode: change-log
16474left-margin: 8
16475fill-column: 74
16476version-control: never
16477End:
This page took 1.168695 seconds and 4 git commands to generate.