Fix Nios II prologue analyzer to handle multiple stack adjustments.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
a20605cf
AM
12014-11-26 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Stub_control::set_output_and_owner): New function.
4 (Target_powerpc::group_sections): Use it.
5
43b64deb
CC
62014-11-25 Cary Coutant <ccoutant@google.com>
7
8 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
9 (Binary_to_elf::write_symbol): Add st_size parameter.
10 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
11
c924eb67
CC
122014-11-25 Cary Coutant <ccoutant@google.com>
13
14 PR gold/17639
15 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
16 (Sized_relobj_file::do_layout): Handle deferred sections properly
17 during GC pass 1. Don't add reloc sections to deferred list twice.
18 * object.h (Sized_relobj_file::is_deferred_layout): New function.
19 (Sized_relobj_file::is_deferred_layout_): New data member.
20
9d585188
L
212014-11-21 H.J. Lu <hongjiu.lu@intel.com>
22
23 PR gold/17619
24 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
25 Check PC-relative offset overflow in PLT entry.
26
3ffaac20
AM
272014-11-21 Alan Modra <amodra@gmail.com>
28
29 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
30 for undefined weaks.
31
0cfb0717
AM
322014-11-20 Alan Modra <amodra@gmail.com>
33
34 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
35 from --stub-group-size parameter divided by 1024.
36 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
37 template parameter. Update all uses.
38 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
39 has_stub_value. Set for long branches. Don't report overflow for
40 branch to undefined weak symbols. Print info message on
41 overflowing branch to stub.
42
f9dffbf0
AM
432014-11-20 Alan Modra <amodra@gmail.com>
44
45 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
46
e88ba8d5
L
472014-11-13 H.J. Lu <hongjiu.lu@intel.com>
48
49 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
50 entry for R_X86_64_GOTPLT64.
51 (Target_x86_64<size>::Relocate::relocate): Update comments for
52 R_X86_64_GOTPLT64.
53
d37ffe25
ED
542014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
55
56 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
57 * plugin.h: add lock definition
58
9726c3c1
HS
592014-10-29 Han Shen <shenhan@google.com>
60 Jing Yu <jingyu@google.com>
61
62 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
63 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
64 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
65 Symbol::TLS_REF.
66 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
67 method.
68 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
69 (Target_aarch64::tls_ld_to_le): New method.
70 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
71 for 64bit targets.
72 (Output_data_plt_aarch64::irelative_rel_): New data member.
73 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
74 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
75 (Output_data_plt_aarch64::add_relocation): New method.
76 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
77 offset. Add got_irelative size to got size.
78 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
79 type string with the new typename.
80 (AArch64_relocate_functions::update_adr): Replace parameter x with
81 immed.
82 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
83 (AArch64_relocate_functions::reloc_common): New method.
84 (AArch64_relocate_funcsions::rela_general): Extract common part out
85 into reloc_common method.
86 (AArch64_relocate_functions::rela_general): Likewise.
87 (AArch64_relocate_functions::pcrela_general): Likewise.
88 (AArch64_relocate_functions::adr): New method.
89 (AArch64_relocate_functions::adrp): Calculate immed before calling
90 update_adr.
91 (AArch64_relocate_functions::adrp): Likewise.
92 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
93 comparing x to 0. Calculate immed from ~x when x < 0.
94 (Target_aarch64::optimize_tls_reloc): Add new cases for
95 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
96 TLSLD_MOVW_DTPREL_G0_NC.
97 (Target_aarch64::possible_function_pointer_reloc): Implement this
98 method.
99 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
100 comment.
101 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
102 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
103 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
104 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
105 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
106 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
107 (Target_aarch64::make_plt_entry): Call add_entry with two more
108 parameters.
109 (Target_aarch64::make_local_ifunc_plt_entry): New method.
110 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
111 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
112 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
113 (Target_aarch64::Relocate::relocate_tls): Add cases for
114 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
115 TLSLD_MOVW_DTPREL_G0_NC.
116 * testsuite/icf_safe_so_test.cc: Correct test comment.
117 * testsuite/icf_safe_test.sh: Add AArch64 arch.
118
80272b8c
AM
1192014-10-22 Alan Modra <amodra@gmail.com>
120
121 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
122 thread_starter.
123
998a69f4
AS
1242014-10-18 Andreas Schwab <schwab@linux-m68k.org>
125
126 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
127
aed56ec5
CC
1282014-10-17 Cary Coutant <ccoutant@google.com>
129
130 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
131 Add "typename" keyword.
132
83a01957
HS
1332014-09-22 Han Shen <shenhan@google.com>
134 Jing Yu <jingyu@google.com>
135
136 Patch for gold aarch64 backend to support relaxation.
137 * aarch64-reloc.def: Change format.
138 * aarch64.cc (class Reloc_stub): New class.
139 (class Stub_table): New class.
140 (class AArch64_relobj): New class.
141 (class AArch64_input_section): New class.
142 (class AArch64_output_section): New class.
143 (Target_aarch64::new_stub_table): New method.
144 (Target_aarch64::new_aarch64_input_section): New method.
145 (Target_aarch64::find_aarch64_input_section): New method.
146 (Target_aarch64::scan_section_for_stubs): New method.
147 (Target_aarch64::scan_reloc_section_for_stubs): New method.
148 (Target_aarch64::relocate_stub): New method.
149 (Target_aarch64::current_target): New method.
150 (Target_aarch64::do_make_elf_object): New method.
151 (Target_aarch64::do_may_relax): New method.
152 (Target_aarch64::do_relax): New method.
153 (Target_aarch64::group_sections): New method.
154 (Target_aarch64::scan_reloc_for_stub): New method.
155 (Target_aarch64::do_make_output_section): New method.
156 (Target_aarch64::stub_tables_): New data member.
157 (Target_aarch64::aarch64_input_section_map_): New data member.
158 (AArch64_relocate_functions::maybe_apply_stub): New method.
159
db4c9594
CC
1602014-09-30 Cary Coutant <ccoutant@google.com>
161
162 PR gold/17432
163 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
164
cd6da036
KC
1652014-09-30 Kito Cheng <kito@0xlab.org>
166
167 PR gold/13597
168 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
169 hash table before sysv-style hash table.
170
5f772412
ST
1712014-09-29 Sriraman Tallam <tmsriram@google.com>
172
173 * options.h (--pic-executable): Add negative to alias to -no-pie.
174
5efeedf6
CC
1752014-09-26 Cary Coutant <ccoutant@google.com>
176
177 PR gold/16773
178 * object.cc (Sized_relobj_file): Compute value of section symbols
179 for TLS sections the same as TLS symbols.
180
1707f183
CC
1812014-09-25 Cary Coutant <ccoutant@google.com>
182
183 PR gold/17432
184 * resolve.cc (Symbol_table::resolve): Override common placeholder
185 symbols, but adjust sizes.
186 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
187 symbols to common lists.
188
00cac886
AM
1892014-09-24 Alan Modra <amodra@gmail.com>
190
191 * po/POTFILES.in: Regenerate.
192
635aa30e
CC
1932014-09-23 Taiju Tsuiki <tzik@google.com>
194 Cary Coutant <ccoutant@google.com>
195
71b9b91b 196 PR gold/14860
635aa30e
CC
197 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
198 on input_sections_blocker.
199 * layout.cc (Write_sections_task::locks): Unblock
200 input_sections_blocker_.
201 * layout.h (Write_sections_task::Write_sections_task): Add
202 input_sections_blocker.
203 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
204 to DEPENDENCIES.
205 * testsuite/Makefile.in: Regenerate.
206
c0c71592
RÁE
2072014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
208
209 * testsuite/Makefile.am (plugin_test_10): New test.
210 * testsuite/Makefile.in: Regenerate
211 * testsuite/plugin_common_test_2.c (c1): Align to 8.
212 * testsuite/plugin_test_10.sh: New file.
213
6168c2a1
RÁE
2142014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
215
216 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
217 * resolve.cc (Symbol_table::resolve): Don't override common symbols
218 during the replacement phase.
219
3a531937
JY
2202014-09-17 Han Shen <shenhan@google.com>
221 Jing Yu <jingyu@google.com>
222
223 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
224 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
225 * aarch64.cc (Target_aarch64): Add data members
226 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
227 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
228 constructor.
229 (Target_aarch64::do_reloc_symbol_index): New method.
230 (Target_aarch64::do_reloc_addend): New method.
231 (Target_aarch64::add_tlsdesc_info): New method.
232 (Target_aarch64::do_dynsym_value): New method.
233 (Target_aarch64::do_make_data_plt): Add new parameters: got,
234 got_irelative. Pass them to Output_data_plt_aarch64_standard.
235 (Target_aarch64::make_data_plt): Add new parameters: got,
236 got_irelative. Pass them to do_make_data_plt.
237 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
238 (Target_aarch64::Relocate:tls_gd_to_le): New method.
239 (Target_aarch64::Relocate:tls_ie_to_le): New method.
240 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
241 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
242 (Target_aarch64::got_tlsdesc_section): New method.
243 (Target_aarch64::make_local_ifunc_plt_entry): New method.
244 (Target_aarch64::define_tls_base_symbol): New method.
245 (Target_aarch64::reserve_tlsdesc_entries): New method.
246 (Target_aarch64::got_mod_index_entry): New method.
247 (Target_aarch64::rela_tlsdesc_section): New method.
248 (Target_aarch64::rela_irelative_section): New method.
249 (Target_aarch64::Tlsdesc_info): New struct.
250 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
251 relocations and tlsdesc relocations.
252 (Target_aarch64::optimize_tls_reloc): Implement method.
253 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
254 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
255 in constructor.
256 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
257 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
258 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
259 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
260 (Output_data_plt_aarch64::rela_tlsdesc): New method.
261 (Output_data_plt_aarch64::rela_irelative): New method.
262 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
263 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
264 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
265 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
266 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
267 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
268 (Output_data_plt_aarch64_standard): New member variables:
269 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
270 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
271 New parameter: got, got_irelative.
272 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
273 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
274 (Output_data_plt_aarch64::do_write): Replace got_address with
275 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
276 (AArch64_relocate_functions::update_movnz): New method.
277 (AArch64_relocate_functions): Correct format.
278 (AArch64_relocate_functions::movnz): New method.
279 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
280 before the switch. Add new cases to switch.
00cac886 281 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
282 tlsgd tlsdesc cases.
283 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
284 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
285 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
286 Call reloc_name_in_error_message to print unsupported reloc.
287 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
288 make_data_plt.
289 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
290 relocs. Fill in some more dynamic tags.
291 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
292 Skip call tls_get_addr when tlsgd is relaxed.
293 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
294 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
295 tlsdesc->ie relaxation.
296
62661c93
SS
2972014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
298
299 * mips.cc (Target_mips_nacl): New class.
300 (Target_selector_mips_nacl): New class.
301 (target_selector_mips32): Rename from target_selector_mips32be and use
302 Target_selector_mips_nacl instead of Target_selector_mips.
303 (target_selector_mips32el): Rename from target_selector_mips32 and use
304 Target_selector_mips_nacl instead of Target_selector_mips.
305 (target_selector_mips64): Rename from target_selector_mips64be and use
306 Target_selector_mips_nacl instead of Target_selector_mips.
307 (target_selector_mips64el): Rename from target_selector_mips64 and use
308 Target_selector_mips_nacl instead of Target_selector_mips.
309 (Target_mips::mips_info): Add const attribute.
310
54674d38
CC
3112014-09-02 Cary Coutant <ccoutant@google.com>
312
313 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
314 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
315 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
316 (Sized_incr_dynobj::do_section_name): Likewise.
317 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
318 (Sized_incr_dynobj::do_section_name): Likewise.
319 * object.h (Object::section_name): Likewise.
320 (Object::do_section_name): Likewise.
321 (Sized_relobj_file::do_section_name): Likewise.
322 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
323 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
324
9860cbcf
CC
3252014-09-02 Cary Coutant <ccoutant@google.com>
326
327 PR gold/17005
328 * ehframe.cc (Fde::write): Add output_offset parameter.
329 (Cie::write): Likewise.
330 (Eh_frame::set_final_data_size): Account for offset within output
331 section.
332 (Eh_frame::do_sized_write): Likewise.
333 * ehframe.h (Fde::write): Add output_offset parameter.
334 (Cie::write): Likewise.
335 * output.cc (Output_section::Input_section_sort_entry): Remove
336 section_has_name_; add output_section_name parameter. Use
337 output section name for non-input sections.
338 (Output_section::Input_section_sort_entry::section_has_name): Remove.
339 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
340 (Output_section::Input_section_sort_compare): Remove logic for
341 sections without names.
342 (Output_section::Input_section_sort_init_fini_compare): Likewise.
343 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
344 Likewise.
345 (Output_section::Input_section_sort_section_name_compare): Likewise.
346
8e33481e
HS
3472014-08-29 Han Shen <shenhan@google.com>
348 Jing Yu <jingyu@google.com>
349
350 * aarch64-reloc-property.cc
351 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
352 reference reloc property in the table.
353 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
354 3 other entries.
355 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
356 2 new overloaded methods.
357 (Output_data_got_aarch64::do_write): Add code to write out
358 static relocs.
359 (class Output_data_got_aarch64::Static_reloc): New class to wrap
360 static relocs.
361 (Output_data_got_aarch64::static_relocs): New vector to
362 hold static relocs.
363 (Target_aarch64::TCB_SIZE): New const static memeber.
364 (Target_aarch64::tcb_size): New method.
365 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
366 (Target_aarch64::Relocate::relocate_tls): New method.
367 (Target_aarch64::Scan::local): Add code handling new reloc types.
368 (Target_aarch64::Scan::global): Add code handling new reloc types.
369
81233653
ST
3702014-08-13 Sriraman Tallam <tmsriram@google.com>
371
372 * options.h (-no-pie): Add option.
373
9363c7c3
JY
3742014-08-08 Jing Yu <jingyu@google.com>
375 Han Shen <shenhan@google.com>
376
377 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
378 (DEFFILES): add aarch64-reloc.def.
379 (TARGETSOURCES): Add aarch64-reloc-property.cc.
380 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
381 * Makefile.in: Regenerate.
382 * aarch64-reloc-property.cc: New file.
383 * aarch64-reloc-property.h: New file.
384 * aarch64-reloc.def: New file.
385 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
386 with tab to make the format consistent.
387 (Output_data_got_aarch64::symbol_table_): New method.
388 (Target_aarch64::do_plt_address_for_global): New method.
389 (Target_aarch64::do_plt_address_for_local): New method.
390 (Target_aarch64::do_select_as_default_target): New method.
391 (Target_aarch64::do_make_data_plt): New method.
392 (Target_aarch64::make_data_plt): New method.
393 (Output_data_plt_aarch64::has_irelative_section): New method.
394 (Output_data_plt_aarch64::address_for_global): New method.
395 (Output_data_plt_aarch64::address_for_local): New method.
396 (Output_data_plt_aarch64::irelative_rel_): New parameter.
397 (Output_data_plt_aarch64::add_entry): Implement contents.
398 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
399 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
400 the got_pov entry to plt0.
401 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
402 Implement contents.
403 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
404 (AArch64_howto): New struct.
405 (aarch64_howto[]): New static const array.
406 (AArch64_relocate_functions): New class.
407 (Target_aarch64::Scan::get_reference_flags): Remove method.
408 (Target_aarch64::Scan::local): Implement to support a few relocations.
409 (Target_aarch64::Scan::global): Implement to support a few relocations.
410 (Target_aarch64::make_plt_section): Implement contents.
411 (Target_aarch64::make_plt_entry): Implement contents.
412 (Target_aarch64::do_finalize_sections): Implement contents.
413 (Target_aarch64::Relocate::relocate): Implement a few relocations.
414 (Target_aarch64::relocate_section): Implement contents.
415
ad9fe6c1
AM
4162014-08-06 Alan Modra <amodra@gmail.com>
417
418 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
419
7cd4e5b7
AM
4202014-08-06 Alan Modra <amodra@gmail.com>
421
422 PR 13227
423 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
424
5ad9b0a7
ST
4252014-07-21 Sriraman Tallam <tmsriram@google.com>
426
427 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 428 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 429
e051745c
CC
4302014-07-08 Cary Coutant <ccoutant@google.com>
431
432 * expression.cc (struct Expression::Expression_eval_info): Add
433 new fields type_pointer, vis_pointer, and nonvis_pointer.
434 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
435 nonvis_pointer parameters. Adjust all calls.
436 (Symbol_expression::value): Update type, visibility, and nonvis bits
437 in caller.
438 * script.cc (Symbol_assignment::sized_finalize): Update type,
439 visibility, and remaining st_other bits for new symbol.
440 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
441 vis_pointer, and nonvis_pointer parameters.
442 * symtab.h (Symbol::set_type): New method.
443
444 * testsuite/Makefile.am (defsym_test): New test.
445 * testsuite/Makefile.in: Regenerate.
446 * testsuite/defsym_test.c: New file.
447 * testsuite/defsym_test.sh: New file.
448
f35c4853
CC
4492014-07-08 Cary Coutant <ccoutant@google.com>
450
451 PR gold/15639
452 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
453 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
454 (Sized_dynobj::base_read_symbols): ...new method.
455 * object.h (Sized_relobj_file::base_read_symbols): New method.
456 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
457 (Sized_relobj_file::base_read_symbols): ...new method.
458 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
459 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
460 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
461
2900af2d
AM
4622014-07-04 Alan Modra <amodra@gmail.com>
463
464 * po/POTFILES.in: Regenerate.
465
053a4d68
JY
4662014-07-02 Jing Yu <jingyu@google.com>
467
468 * aarch64.cc: New file
469 * Makefile.am (TARGETSOURCES): Add aarch64.cc
470 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
471 * Makefile.in: Regenerate.
472 * configure.tgt: Add entries for aarch64*.
473 * configure.ac: Likewise.
474 * configure: Likewise.
475
7b549045
AM
4762014-06-27 Alan Modra <amodra@gmail.com>
477
478 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
479
cb818dbf
CC
4802014-06-24 Cary Coutant <ccoutant@google.com>
481
482 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
483 sections.
484 (Dwo_file::sized_read_unit_index): Likewise.
485
9810d34d
SS
4862014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
487
488 * mips.cc: New file.
489 * Makefile.am (TARGETSOURCES): Add mips.cc
490 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
491 * configure.tgt: Add entries for mips*.
492 * configure.ac: Likewise.
493 * Makefile.in: Regenerate.
494 * configure: Likewise.
495
9baa787b
CC
4962014-06-09 Cary Coutant <ccoutant@google.com>
497
498 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
499 unit_length is within section bounds.
500
8f89af0a
CC
5012014-06-09 Cary Coutant <ccoutant@google.com>
502
503 PR gold/16980
504 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
505 map.
506
a47622ac
AM
5072014-06-07 Alan Modra <amodra@gmail.com>
508
509 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
510
4320c691
CC
5112014-06-06 Cary Coutant <ccoutant@google.com>
512
513 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
514 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
515 (Dwarf_pubnames_table::read_header): Likewise.
516 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
517 .debug_gnu_pubtypes.
518
270c9937
JB
5192014-06-05 Joel Brobecker <brobecker@adacore.com>
520
521 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
522 * Makefile.in, configure: Regenerate.
523
397998fc
AM
5242014-06-03 Alan Modra <amodra@gmail.com>
525
526 * powerpc.cc (addis_12_2): Define.
527 (Stub_table::do_write): Support fusion on ELFv2 stubs.
528
61f5c66f
AM
5292014-06-03 Alan Modra <amodra@gmail.com>
530
531 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
532 st_other output.
533
f6971787
AM
5342014-06-02 Alan Modra <amodra@gmail.com>
535
536 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
537 Only ignore relocs on ELFv1.
538 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
539
f6fb8322
CC
5402014-05-30 Cary Coutant <ccoutant@google.com>
541
542 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
543 * testsuite/Makefile.in: Regenerate.
544 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
545
c23dd342
L
5462014-05-27 H.J. Lu <hongjiu.lu@intel.com>
547
548 PR gold/16945
549 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
550 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
551
5fe7ffdc
AM
5522014-05-15 Alan Modra <amodra@gmail.com>
553
554 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
555 Compare FDE contents with DW_CFA_nop rather than 0.
556
a82bef93
ST
5572014-05-13 Sriraman Tallam <tmsriram@google.com>
558
559 * symtab.h (may_need_copy_reloc): Remove check for position independent
560 code.
561 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
562 position independence before pc absolute may_need_copy_reloc call.
563 Add check for executable output befor pc relative may_need_copy_reloc
564 call.
565 * i386.cc: Ditto.
566 * arm.cc: Ditto.
567 * sparc.cc: Ditto.
568 * tilegx.cc: Ditto.
569 * powerpc.cc: Add check for no position independence before
570 may_need_copy_reloc calls.
571 * testsuite/pie_copyrelocs_test.cc: New file.
572 * testsuite/pie_copyrelocs_shared_test.cc: New file.
573 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 574 * Makefile.in: Regenerate.
a82bef93 575
53c66605
ML
5762014-05-08 Martin Liška <mliska@suse.cz>
577
578 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
579
57b2284c
CC
5802014-05-06 Cary Coutant <ccoutant@google.com>
581
582 PR gold/16900
583 * i386.cc (Output_data_got_plt_i386): New class.
584 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
585 parameter. Change all callers.
586 (Output_data_plt_i386::layout_): Remove.
587 (Output_data_plt_i386::got_plt_): Change type.
588 (Target_i386::got_plt_): Change type. Change all references.
589 (Target_i386::got_section): Create instance of new class.
590 (Output_data_got_plt_i386::do_write): New function.
591 * x86_64.cc (Output_data_got_plt_x86_64): New class.
592 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
593 parameter. Change all callers.
594 (Output_data_plt_x86_64::layout_): Remove.
595 (Output_data_plt_x86_64::got_plt_): Change type.
596 (Target_x86_64::got_plt_): Change type. Change all references.
597 (Target_x86_64::got_section): Create instance of new class.
598 (Output_data_got_plt_x86_64::do_write): New function.
599 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
600 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
601 class.
602
6b97515d 6032014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 604
6b97515d
CC
605 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
606 if we have pubnames/pubtypes.
607
d1bddd3c
CC
6082014-05-02 Cary Coutant <ccoutant@google.com>
609
5fe7ffdc
AM
610 * defstd.cc (in_segment): Define __ehdr_start here...
611 * layout.cc (Layout::finalize): ...Instead of here. Set the
612 output segment when known.
613 * resolve.cc (Symbol::override_base_with_special): Remember
614 the original binding.
615 * symtab.cc (Symbol::set_output_segment): New function.
616 (Symbol::set_undefined): New function.
617 * symtab.h (Symbol::is_weak_undefined): Check original undef
618 binding.
619 (Symbol::is_strong_undefined): New function.
620 (Symbol::set_output_segment): New function.
621 (Symbol::set_undefined): New function.
622 * target-reloc.h (is_strong_undefined): Remove.
623 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
624 Check for hidden undefs.
625 (relocate_section): Call Symbol::is_strong_undefined.
626
627 * testsuite/Makefile.am (ehdr_start_test_1)
628 (ehdr_start_test_2, ehdr_start_test_3)
629 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
630 * testsuite/Makefile.in: Regenerate.
631 * testsuite/ehdr_start_def.cc: New source file.
632 * testsuite/ehdr_start_test.cc: New source file.
633 * testsuite/ehdr_start_test.t: New linker script.
634 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 635
7849f6d8
CC
6362014-04-23 Cary Coutant <ccoutant@google.com>
637
bf2cc635 638 PR gold/16870
7849f6d8
CC
639 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
640
99fd8cff
CC
6412014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
642
643 * layout.cc (Layout::include_section): Allow a target to decide
644 whether to include a section.
645 * target.h (Target::should_include_section): New function.
646 (Target::do_should_include_section): New function.
647
91f43acd
CC
6482014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
649
650 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
651 inline into ...
652 (Copy_relocs::emit): ... here.
653 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
654 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
655 (Copy_reloc_entry::entries_): Change from private to protected.
656
c4eb27e1
ST
6572014-04-02 Sriraman Tallam <tmsriram@google.com>
658
659 * icf.cc (get_section_contents): Replace copies of reloc
660 vectors with const references.
661
ae447ddd
CC
6622014-04-02 Cary Coutant <ccoutant@google.com>
663
664 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
665 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
666 * configure: Regenerate.
667 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
668 -fno-use-linker-plugin.
669 (LINK1, CXXLINK1): Add it to the link command.
670 * testsuite/Makefile.in: Regenerate.
671
fa47fa92
AM
6722014-03-12 Alan Modra <amodra@gmail.com>
673
674 * Makefile.in: Regenerate.
675
9b12c500
CC
6762014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
677
678 * symtab.h (Symbol::set_nonvis): New function.
679
beacaa96
CC
6802014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
681
682 * symtab.cc (Sized_symbol<32>::init_output_data):
683 Instantiate the template.
684 (Sized_symbol<64>::init_output_data): Likewise.
685
800d9823
CC
6862014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
687
688 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
689 adjust dynamic symbol value.
690 * target.h (Target::adjust_dyn_symbol): New function.
691 (Target::do_adjust_dyn_symbol): New function.
692
918fc1f8 6932014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 694
918fc1f8
CC
695 * output.cc (Output_data_dynamic::Dynamic_entry::write):
696 Get the value of DYNAMIC_CUSTOM dynamic entry.
697 * output.h (Output_data_dynamic::add_custom): New function.
698 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
699 dynamic entry.
700 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
701 * target.h (Target::dynamic_tag_custom_value): New function.
702 (Target::do_dynamic_tag_custom_value): New function.
703
98ff9231
CC
7042014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
705
706 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
707 dynsym indexes.
708 * target.h (Target::has_custom_set_dynsym_indexes): New function.
709 (Target::do_has_custom_set_dynsym_indexes): New function.
710 (Target::set_dynsym_indexes): New function.
711 (Target::do_set_dynsym_indexes): New function.
712
b80eed39
AM
7132014-03-07 Alan Modra <amodra@gmail.com>
714
715 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
716 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
717 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
718 (Powerpc_relocate_functions::has_overflow_bitfield,
719 overflowed): Use the above.
720 (Target_powerpc::Relocate::relocate): Correct overflow checking
721 for a number of relocations. Modify overflow test for 16-bit
722 fields in instructions to signed/unsigned according to whether
723 the field takes a signed or unsigned value.
724
4b95cf5c
AM
7252014-03-05 Alan Modra <amodra@gmail.com>
726
727 Update copyright years.
728
45965137
AM
7292014-03-05 Alan Modra <amodra@gmail.com>
730
731 * powerpc.cc (Target_powerpc::Scan::local, global): Support
732 R_PPC64_ADDR64_LOCAL.
733 (Target_powerpc::Relocate::relocate): Likewise.
734
2c80b753
AM
7352014-03-03 Alan Modra <amodra@gmail.com>
736
737 * dwp.cc (print_version): Update copyright year to current.
738
c1c69e83
AM
7392014-02-10 Alan Modra <amodra@gmail.com>
740
741 * po/gold.pot: Regenerate.
742
dd0c4e70
CC
7432014-02-06 Cary Coutant <ccoutant@google.com>
744
745 Fix problem where -u is ignored when a weak undef is seen.
746
747 * archive.cc (Library_base::should_include_member): Reorder
748 code to check for -u option if a weak undef has already been seen.
749 * testsuite/Makefile.am (weak_undef_test_2): New test case.
750 * testsuite/Makefile.in: Regenerate.
751 * testsuite/weak_undef_file3.cc: New file.
752 * testsuite/weak_undef_file4.cc: New file.
753 * testsuite/weak_undef_test_2.cc: New file.
754
1a221d3d
CC
7552014-02-05 Cary Coutant <ccoutant@google.com>
756
757 Fix issues with gold undefined symbol diagnostics.
758
759 PR binutils/15435
760 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
761 check to here.
762 * target-reloc.h (is_strong_undefined): New function.
763 (relocate_section): Move undef vtable symbol check from here.
764 Check for is_strong_undefined.
765
e889f0a4 7662014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 767
e889f0a4
CC
768 Fix problems with the --dynamic-list option.
769
770 PR gold/13577
771 * options.cc (General_options::parse_dynamic_list):
772 Set have_dynamic_list_.
773 (General_options::General_options): Initialize have_dynamic_list_.
774 (General_options::finalize): Turn off -Bsymbolic and
775 -Bsymbolic-functions if --dynamic-list provided.
776 * options.h (General_options::have_dynamic_list): New function.
777 (General_options::have_dynamic_list_): New data member.
778 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
779 correctly.
5fe7ffdc 780
e889f0a4
CC
781 PR gold/16530
782 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
783 in --dynamic-list, mark it.
5fe7ffdc 784
e889f0a4
CC
785 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
786 (dynamic_list_2): New test case.
787 * testsuite/Makefile.in: Regenerate.
788 * testsuite/dynamic_list_2.cc: New file.
789 * testsuite/dynamic_list_2.t: New file.
790 * testsuite/dynamic_list_lib1.cc: New file.
791 * testsuite/dynamic_list_lib2.cc: New file.
792 * testsuite/gc_dynamic_list_test.c: New file.
793 * testsuite/gc_dynamic_list_test.sh: New file.
794 * testsuite/gc_dynamic_list_test.t: New file.
795
ec673e64
CC
7962014-01-28 Cary Coutant <ccoutant@google.com>
797
798 Add .gdb_index version 7 support.
799
800 * gold/dwarf_reader.cc: include <utility> (for make_pair).
801 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
802 debug sections.
803 (Dwarf_ranges_table::read_ranges_table): Likewise.
804 (Dwarf_pubnames_table::read_section): Check for GNU-style
805 sections, and for compressed debug sections.
806 (Dwarf_pubnames_table::read_header): Compute end address of table.
807 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
808 for end of list by offset, not by offset == 0.
809 (Dwarf_info_reader::do_read_string_table): Check for compressed
810 debug sections.
811 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
812 Initialize new data members.
813 (Dwarf_pubnames_table::next_name): return flag_byte.
814 (Dwarf_pubnames_table::end_of_table_): New data member.
815 (Dwarf_pubnames_table::is_gnu_style_): New data member.
816 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
817 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
818 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
819 read skeleton type unit DIEs.
820 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
821 (Gdb_index::do_write): Write flag_byte.
822 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
823 (Gdb_index::Cu_vector): Store flags along with cu indexes.
824 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
825 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
826
221fd5d5
L
8272014-01-08 H.J. Lu <hongjiu.lu@intel.com>
828
829 * version.cc (print_version): Update copyright year to 2014.
830
6c09fb0b
ILT
8312013-12-19 Dimitry Andric <dimitry@andric.com>
832
833 * stringpool.cc (Stringpool_template::reserve): Add
834 HAVE_UNORDERED_MAP case.
835 * stringpool.cc (Stringpool_template::print_stats): Likewise.
836
8356f2d0
CC
8372013-12-18 Cary Coutant <ccoutant@google.com>
838
839 * configure.ac: Check for <unordered_set> and <unordered_map>.
840 * config.in: Regenerate.
841 * configure: Regenerate.
842 * system.h: Use <unordered_set> and <unordered_map> if available.
843
f2c7d7ee
RM
8442013-12-10 Roland McGrath <mcgrathr@google.com>
845
846 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
847 with $(INSTALL_PROGRAM_ENV).
848 * Makefile.in: Regenerate.
849
6632e8cc
CC
8502013-11-22 Cary Coutant <ccoutant@google.com>
851
852 * configure.ac: Add check for which library is needed for
853 dlopen.
854 * configure: Regenerate.
855
0c075858
CC
8562013-11-22 Cary Coutant <ccoutant@google.com>
857
858 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
859 assembler.
860 * testsuite/Makefile.in: Regenerate.
861
f49fe902
L
8622013-11-17 H.J. Lu <hongjiu.lu@intel.com>
863
864 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
865 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
866 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
867 (Target_x86_64<size>::Scan::local): Likewise.
868 (Target_x86_64<size>::Scan::global): Likewise.
869 (Target_x86_64<size>::Relocate::relocate): Likewise.
870 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
871 Likewise.
872 (Target_x86_64<size>::Scan::check_non_pic(): Handle
873 R_X86_64_PC32_BND.
874
875 * testsuite/Makefile.am (check_PROGRAMS): Add
876 exception_x86_64_bnd_test.
877 (exception_x86_64_bnd_test_SOURCES): New macro.
878 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
879 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
880 (exception_x86_64_bnd_test_LDADD): Likewise.
881 (exception_x86_64_bnd_1.o): New rule.
882 (exception_x86_64_bnd_2.o): Likewise.
883 * testsuite/Makefile.in: Regenerated.
884
9055360d
AM
8852013-11-15 Alan Modra <amodra@gmail.com>
886
887 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
888 accessor.
889 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
890 Only call ppc64_local_entry_offset for 64-bit. Restrict
891 symval_for_branch lookup to ELFv1.
892 (Stub_table::add_plt_call_entry): Use unsigned int off.
893 (Output_data_glink::Address, invalid_address): New.
894 (Output_data_glink::add_eh_frame): Move out of line. Add
895 support for ELFv2.
896 (Output_data_glink::add_global_entry, find_global_entry,
897 global_entry_address): New functions.
898 (Output_data_glink::global_entry_stubs_, end_branch_table_,
899 ge_size): New variables.
900 (Output_data_glink::set_final_data_size): Add global entry
901 stub sizing.
902 (Output_data_glink::do_write): Write global entry stubs.
903 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
904 parameter. Return true for ELFv2. Adjust callers.
905 (Target_powerpc::Scan::local, global): Restrict opd lookup to
906 ELFv1. Similarly for ifunc and dynamic relocation processing
907 specific to ELFv1. Recognize that symbols are defined on
908 their plt entries for ELFv2.
909 (Target_powerpc::symval_for_branch): Assert if called for
910 ELFv2 or ppc32.
911 (Target_powerpc::Relocate::relocate): Use global entry plt
912 stub for symbol value if such exists on ELFv2.
913 (Target_powerpc::Relocate::relocate): Don't call
914 symval_for_branch when ELFv2. Do adjust for local entry
915 offset when ELFv2.
916 (Target_powerpc::do_dynsym_value): Set symbols to global entry
917 plt stub for ELFv2.
918 (Target_powerpc::do_plt_address_for_global): Similarly.
919
cafdd569
CC
9202013-11-14 Cary Coutant <ccoutant@google.com>
921
922 Revert patch -- this did not fix the problem, and there is
923 no race there.
924
925 2013-11-14 Cary Coutant <ccoutant@google.com>
926
927 PR gold/14860
928 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
929 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
930 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
931 updating fde_offsets_.
932 (Eh_frame_hdr::lock_): New data member.
933
94e49e16
CC
9342013-11-14 Cary Coutant <ccoutant@google.com>
935
936 * dwp.cc (Dwo_file_entry): New type.
937 (File_list): Use Dwo_file_entry.
938 (Dwo_file::verify): New function.
939 (Dwo_file::verify_dwo_list): New function.
940 (Dwo_file::sized_verify_dwo_list): New function.
941 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
942 list.
943 (Dwp_options): New enum type.
944 (dwp_options): Add --verify-only.
945 (usage): Likewise.
946 (main): Likewise.
947 * dwp.h (gold_info): Add declaration.
948
7cdd7d57
CC
9492013-11-14 Cary Coutant <ccoutant@google.com>
950
951 PR gold/14860
952 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
953 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
954 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
955 updating fde_offsets_.
956 (Eh_frame_hdr::lock_): New data member.
957
1d946cb3
CC
9582013-11-06 Cary Coutant <ccoutant@google.com>
959
960 PR gold/15758
961 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
962 before reloc sections.
963
4f65b40e
AM
9642013-11-04 Alan Modra <amodra@gmail.com>
965
966 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
967 (Symbol::needs_dynamic_reloc): Test new flag.
968 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
969 (Target_powerpc::Scan::get_reference_flags): Add target param.
970 Return FUNC_DESC_ABI for 64-bit ELFv1.
971 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
972 call.
973 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
974 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
975
908794a9
CC
9762013-10-31 Cary Coutant <ccoutant@google.com>
977
978 Restore support for dwp v2 DWARF package file format.
979
980 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
981 tu_length parameter. Adjust all callers.
982 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
983 * dwp.cc: Include dwarf.h.
984 (Section_bounds): New struct type.
985 (Unit_set): New struct type.
986 (Dwo_file::Dwo_file): Initialize new data member.
987 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
988 Combine and rename to...
989 (Dwo_file::read_unit_index): ...this.
990 (Dwo_file::sized_read_compunit_index)
991 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
992 (Dwo_file::sized_read_unit_index): ...this.
993 (Dwo_file::copy_section): Remove section_name, is_str_offsets
994 parameters; add section_id parameter.
995 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
996 (Dwo_file::add_unit_set): ...this.
997 (Dwo_file::shndx_map_): Remove.
998 (Dwo_file::sect_offsets_): New data member.
999 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1000 (Dwp_output_file::add_section): Rename to...
1001 (Dwp_output_file::add_contribution): ...this.
1002 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1003 (Dwp_output_file::add_tu_set): Likewise.
1004 (Dwp_output_file::Contribution): New type.
1005 (Dwp_output_file::Section::contributions): New data member.
1006 (Dwp_output_file::Cu_or_tu_set): Remove.
1007 (Dwp_output_file::Section::Section): New ctor.
1008 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1009 (Dwp_output_file::Dwp_index::Section_table): New type.
1010 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1011 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1012 parameter.
1013 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1014 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1015 (Dwp_output_file::Dwp_index::section_table): New member function.
1016 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1017 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1018 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1019 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1020 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1021 (Dwp_output_file::Dwp_index::section_table_): New data member.
1022 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1023 (Dwp_output_file::add_output_section): New member function.
1024 (Dwp_output_file::write_new_section): New member function.
1025 (Dwp_output_file::write_contributions): New member function.
1026 (Dwp_output_file::section_id_map_): New data member.
1027 (class Dwo_id_info_reader): Remove.
1028 (class Unit_reader): New class.
1029 (get_dwarf_section_name): New function.
1030 (Dwo_file::read_executable): Adjust initializations of class data.
1031 (Dwo_file::read): Add support for v2 package file format.
1032 (Dwo_file::read_unit_index): Likewise.
1033 (Dwo_file::sized_read_unit_index): Likewise.
1034 (Dwo_file::copy_section): Likewise.
1035 (Dwo_file::add_unit_set): Likewise.
1036 (Dwp_output_file::add_output_section): Likewise.
1037 (Dwp_output_file::add_contribution): Likewise.
1038 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1039 for empty slot.
1040 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1041 file format.
1042 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1043 slot.
1044 (Dwp_output_file::initialize): Remove unused function.
1045 (Dwp_output_file::finalize): Add support for v2 package file format.
1046 (Dwp_output_file::write_index): Likewise.
1047 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1048 function prototype.
1049
2500c017
CC
10502013-10-31 Cary Coutant <ccoutant@google.com>
1051
1052 * configure.ac: Fix check for -fmerge-constants.
1053 * configure.ac: Regenerate.
1054
dd0845d7
RM
10552013-10-30 Roland McGrath <mcgrathr@google.com>
1056
1057 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1058 Correct 9-byte nop sequence to match what the assembler generates.
1059
b4f7960d
AM
10602013-10-30 Alan Modra <amodra@gmail.com>
1061
1062 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1063 ppc64_local_entry_offset, ppc64_local_entry_offset,
1064 do_read_symbols): New functions.
1065 (Powerpc_relobj::e_flags_, st_other_): New vars.
1066 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1067 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1068 (Powerpc_relobj::e_flags_): New var.
1069 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1070 and adjust for ELFv2.
1071 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1072 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1073 (Powerpc_dynobj::do_find_special_sections): Likewise.
1074 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1075 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1076 to ELFv2 local entry.
1077 (Target_powerpc::do_relax): No thread safe barriers needed for
1078 ELFv2.
1079 (Output_data_plt_powerpc::initial_plt_entry_size_,
1080 plt_entry_size): Delete. Replace all uses with
1081 first_plt_entry_offset() and plt_entry_size().
1082 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1083 reserved_size parm. Update callers.
1084 (Output_data_plt_powerpc::entry_count): Update.
1085 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1086 and use Target_powerpc::first_plt_entry_offset().
1087 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1088 rename to plt_entry_size.
1089 (Output_data_plt_powerpc::add_ifunc_entry,
1090 add_local_ifunc_entry): Adjust reloc for ELFv2.
1091 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1092 (glink_eh_frame_fde_64v2): New.
1093 (Stub_table::plt_call_size): Support ELFv2 sizing.
1094 (Output_data_glink::add_eh_frame): Use the new FDE.
1095 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1096 (Stub_table::do_write): Write ELFv2 stubs and glink.
1097 (Target_powerpc::Relocate::relocate): Replaces nop after call
1098 with ld 2,24(1) and adjust local offset destination for ELFv2.
1099
f9c6b907
AM
11002013-10-30 Alan Modra <amodra@gmail.com>
1101
1102 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1103 (Target_powerpc::Scan::global, local): Likewise.
1104 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1105 on all ppc64 @h and @ha relocs.
1106
e84fe78f
AM
11072013-10-14 Alan Modra <amodra@gmail.com>
1108
1109 * output.h (Output_data_got::add_constant): Tidy.
1110 (Output_data_got::add_constant_pair): New function.
1111 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1112 methods used so as to first call reserve_ent().
1113
679e4abf
RM
11142013-10-11 Roland McGrath <mcgrathr@google.com>
1115
44dcb735
RM
1116 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1117 add_got_entry and add_got_entry_pair.
1118
13323c49
RM
1119 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1120 (HAVE_PUBNAMES): Likewise.
1121 * configure: Regenerate.
1122
1496b446
RM
1123 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1124 * testsuite/Makefile.in: Regenerate.
1125
cc84c10b
RM
1126 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1127 Remove const from declaration.
1128 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1129 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1130 * output.h (Output_file_header): Remove const from member target_
1131 and corresponding constructor argument.
1132 * output.cc (Output_file_header::Output_file_header): Update prototype.
1133 (Output_file_header::do_sized_write): Use this->target_ in place
1134 of parameters()->target().
1135
52f66a2c
RM
1136 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1137
2b64b551
RM
1138 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1139 * configure: Regenerate.
1140 * Makefile.in: Regenerate.
1141 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1142 * testsuite/merge_string_literals_2.c: Likewise.
1143 * testsuite/Makefile.am
1144 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1145 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1146 literal -fmerge-constants.
1147 * testsuite/Makefile.in: Regenerate.
1148
43819297
RM
1149 * i386.cc (Target_i386): Remove unused member dynbss_.
1150 * arm.cc (Target_arm): Likewise.
1151 * powerpc.cc (Target_powerpc): Likewise.
1152 * sparc.cc (Target_sparc): Likewise.
1153 * tilegx.cc (Target_tilegx): Likewise.
1154 * x86_64.cc (Target_x86_64): Likewise.
1155 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1156 type_signature_, type_offset_.
1157 * plugin.h (Plugin_hook): Remove unused member layout_.
1158 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1159 mapfile_.
1160 (Read_member): Remove unused members input_objects_, symtab_,
1161 mapfile_, layout_.
1162 (Check_library): Remove unused member symtab_.
1163 * archive.h (Lib_group): Remove unused member lib_.
1164 * archive.cc (Lib_group::Lib_group): Update initializer.
1165 * incremental.h (Incremental_binary): Remove unused member target_.
1166 (Incremental_script_entry): Removed unused member script_.
1167 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1168 * icf.h (Icf): Remove unused member num_tracked_relocs.
1169
39d9ead7
RM
1170 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1171 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1172 its only use.
1173 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1174
679e4abf
RM
1175 * archive.h: Use struct rather than class for forward declaration
1176 of Read_symbols_data.
1177
54de2ea6
CC
11782013-10-07 Cary Coutant <ccoutant@google.com>
1179
1180 PR gold/16010
1181 * testsuite/Makefile.am (icf_test): Fix dependencies.
1182 (icf_safe_test): Likewise.
1183 (icf_safe_so_test): Likewise.
1184 (large_symbol_alignment): Add empty _LDADD rule.
1185 * testsuite/Makefile.in: Regenerate.
1186
b14016f0
L
11872013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1188
1189 PR gold/15927
1190 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1191 relocation for R_X86_64_32 on x32.
1192
eb426534
RM
11932013-08-27 Roland McGrath <mcgrathr@google.com>
1194
1195 * output.cc (Output_segment::set_section_addresses): Take new
1196 Target* argument. If target->isolate_execinstr() and the segment
1197 is executable and starts at a target->abi_pagesize() boundary,
1198 pad its end out to a target->abi_pagesize() boundary with code fill.
1199 * output.h (Output_segment::set_section_addresses): Update decl.
1200 * layout.h (Layout::check_output_data_for_reset_values): Take new
1201 argument RELAX_OUTPUTS.
1202 (Layout): New member relax_output_list_.
1203 (Layout::add_relax_output): New method.
1204 * layout.cc (Layout::Layout): Update constructor.
1205 (Layout::reset_relax_output): New method.
1206 (Layout::clean_up_after_relaxation): Call it.
1207 (Layout::prepare_for_relaxation): Update caller.
1208 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1209 Call reset_relax_output before re-processing segments for
1210 isolate_execinstr case.
1211 (Layout::write_data): Handle relax_output_list_.
1212 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1213 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1214
9aff4b7a
NC
12152013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1216
1217 PR binutils/15834
1218 * object.h: Fix typos.
1219
93f8221c
RM
12202013-08-16 Roland McGrath <mcgrathr@google.com>
1221
1222 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1223 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1224
e44c3715
CC
12252013-08-07 Cary Coutant <ccoutant@google.com>
1226
1227 Revert support for v2 DWP files:
1228
1229 2013-03-01 Cary Coutant <ccoutant@google.com>
1230
1231 Add dwp support for v2 DWARF package file format.
1232 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1233 tu_length parameter. Adjust all callers.
1234 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1235 * dwp.cc: Include dwarf.h.
1236 (Section_bounds): New struct type.
1237 (Unit_set): New struct type.
1238 (Dwo_file::Dwo_file): Initialize new data member.
1239 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1240 Combine and rename to...
1241 (Dwo_file::read_unit_index): ...this.
1242 (Dwo_file::sized_read_compunit_index)
1243 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1244 (Dwo_file::sized_read_unit_index): ...this.
1245 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1246 parameters; add section_id parameter.
1247 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1248 (Dwo_file::add_unit_set): ...this.
1249 (Dwo_file::shndx_map_): Remove.
1250 (Dwo_file::sect_offsets_): New data member.
1251 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1252 (Dwp_output_file::add_section): Rename to...
1253 (Dwp_output_file::add_contribution): ...this.
1254 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1255 (Dwp_output_file::add_tu_set): Likewise.
1256 (Dwp_output_file::Contribution): New type.
1257 (Dwp_output_file::Section::contributions): New data member.
1258 (Dwp_output_file::Cu_or_tu_set): Remove.
1259 (Dwp_output_file::Section::Section): New ctor.
1260 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1261 (Dwp_output_file::Dwp_index::Section_table): New type.
1262 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1263 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1264 parameter.
1265 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1266 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1267 (Dwp_output_file::Dwp_index::section_table): New member function.
1268 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1269 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1270 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1271 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1272 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1273 (Dwp_output_file::Dwp_index::section_table_): New data member.
1274 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1275 (Dwp_output_file::add_output_section): New member function.
1276 (Dwp_output_file::write_new_section): New member function.
1277 (Dwp_output_file::write_contributions): New member function.
1278 (Dwp_output_file::section_id_map_): New data member.
1279 (class Dwo_id_info_reader): Remove.
1280 (class Unit_reader): New class.
1281 (get_dwarf_section_name): New function.
1282 (Dwo_file::read_executable): Adjust initializations of class data.
1283 (Dwo_file::read): Add support for v2 package file format.
1284 (Dwo_file::read_unit_index): Likewise.
1285 (Dwo_file::sized_read_unit_index): Likewise.
1286 (Dwo_file::copy_section): Likewise.
1287 (Dwo_file::add_unit_set): Likewise.
1288 (Dwp_output_file::add_output_section): Likewise.
1289 (Dwp_output_file::add_contribution): Likewise.
1290 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1291 for empty slot.
1292 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1293 file format.
1294 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1295 slot.
1296 (Dwp_output_file::initialize): Remove unused function.
1297 (Dwp_output_file::finalize): Add support for v2 package file format.
1298 (Dwp_output_file::write_index): Likewise.
1299 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1300 function prototype.
1301
c6905c28
CC
13022013-07-31 Cary Coutant <ccoutant@google.com>
1303
1304 * object.cc (Sized_relobj::do_output_section_address): New function.
1305 (Sized_relobj): Instantiate explicitly.
1306 * object.h (Object::output_section_address): New function.
1307 (Object::do_output_section_address): New function.
1308 (Sized_relobj::do_output_section_address): New function.
1309 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1310
13112013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1312 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1313
1314 * parameters.cc (Parameters::entry): Return target-specific entry
1315 symbol name.
1316 * target.h (Target::entry_symbol_name): New function.
1317 (Target_info::entry_symbol_name): New data member.
1318
1319 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1320 * i386.cc (Target_i386::i386_info): Likewise.
1321 (Target_i386_nacl::i386_nacl_info): Likewise.
1322 * sparc.cc (Target_sparc::sparc_info): Likewise.
1323 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1324 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1325 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1326 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1327
234d4ab8
SA
13282013-07-22 Sterling Augustine <saugustine@google.com>
1329
1330 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1331 Convert parameter shndx to local variable. Add parameters symtab
1332 and symtab_size. Scan over section names. Find relocation
1333 section corresponding to current section. Create and initialize
1334 reloc_mapper_ and reloc_type_.
1335 (Dwarf_pubnames_table::read_header): Add assertion. Change
1336 unit_length to off_t. Initialize member unit_length_. Fill in field
1337 cu_offset_.
1338 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1339 Initialize new fields unit_length_ and cu_offset_.
1340 (Dwarf_pubnames_table::read_section): Update prototype.
1341 (Dwarf_pubnames_table::cu_offset): New member function.
1342 (Dwarf_pubnames_table::subsection_size): Likewise.
1343 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1344 New fields.
1345 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1346 member functions public.
1347 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1348 Update comment. Rework logic. Move repeated parts to...
1349 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1350 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1351 pubtypes_table_, and stmt_list_offset.
1352 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1353 Gdb_index::find_pubtype_offset,
1354 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1355 (Gdb_index::pubnames_read): Update prototype and rework logic.
1356 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1357 Forward declare.
1358 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1359 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1360 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1361 Gdb_index::map_pubtable_to_dies):
1362 Declare functions.
1363 (Gdb_index::pubnames_read): Update declaration.
1364 (Gdb_index::Pubname_offset_map): New type.
1365 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1366 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1367 Gdb_index::stmt_list_offset): Declare.
1368 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1369 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1370 Gdb_index::pubtypes_offset_): Remove.
1371
a3ed37d8
RM
13722013-07-19 Roland McGrath <mcgrathr@google.com>
1373
1374 * options.h (General_options): Add -Trodata-segment option.
1375 * parameters.cc (Parameters::check_rodata_segment): New function.
1376 (Parameters::set_target_once): Call it.
1377 * parameters.h (Parameters): Declare it (private member function).
1378 * layout.cc (load_seg_unusable_for_headers): New function, broken
1379 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1380 then validate rodata segment rather than text segment.
1381 (relaxation_loop_body): Call that.
1382 (is_text_segment): New function. Don't admit a non-executable
1383 segment if TARGET->isolate_execinstr().
1384 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1385
eb5b4ded
CC
13862013-07-15 Shawn Landden <shawnlandden@gmail.com>
1387
1388 PR gold/15070
1389 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1390 * nacl.h (Sniff_file::View::View): Request aligned view.
1391
4d5effb9
CC
13922013-07-11 Cary Coutant <ccoutant@google.com>
1393
1394 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1395 correct BRLT entry size.
1396
ba8ca3e7
AM
13972013-07-03 Alan Modra <amodra@gmail.com>
1398
1399 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1400 comment.
1401
267257d2
CC
14022013-07-01 Cary Coutant <ccoutant@google.com>
1403
1404 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1405 reloc_type_.
1406 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1407 (Dwarf_ranges_table::lookup_reloc): New function.
1408 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1409 reloc_type_.
1410 (Dwarf_ranges_table::lookup_reloc): New function.
1411 (Dwarf_ranges_table::reloc_type_): New data member.
1412
06f30c9d
CC
14132013-06-27 Jing Yu <jingyu@google.com>
1414
1415 PR gold/15662
1416 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1417 function.
1418 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1419 (Target_powerpc::do_relax): Call the above.
1420
a2d7bf59
AM
14212013-06-27 Cary Coutant <ccoutant@google.com>
1422
1423 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1424 on garbage collected .opd section.
1425
14262013-06-27 Alan Modra <amodra@gmail.com>
1427
1428 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1429 is non-zero.
1430 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1431 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1432
32364e50
CC
14332013-06-14 Cary Coutant <ccoutant@google.com>
1434
1435 * resolve.cc (Symbol::override_base): Don't override st_type
1436 from plugin placeholder symbols.
1437 (Symbol_table::resolve): Likewise.
1438 (Symbol_table::should_override): Don't complain about TLS mismatch
1439 if the TO symbol is a plugin placeholder.
1440 * testsuite/Makefile.am (plugin_test_tls): New test.
1441 * testsuite/Makefile.in: Regenerate.
1442 * testsuite/plugin_test_tls.sh: New test script.
1443 * testsuite/two_file_test_2_tls.cc: New test source.
1444 * testsuite/two_file_test_tls.cc: New test source.
1445
7fb47cc9
CC
14462013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1447
1448 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1449 the maximum segment alignment is larger than the page size.
1450 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1451 correctly aligns the symbols with large alignemnt.
1452 * testsuite/Makefile.in: Regenerate.
1453 * testsuite/large_symbol_alignment.cc: New file.
1454
6934001a
CC
14552013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1456 Sriraman Tallam <tmsriram@google.com>
1457
1458 * options.h (sort_section): New option.
1459 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1460 Rename from Input_section_sort_section_name_special_ordering_compare.
1461 (Input_section_sort_section_name_compare): New struct.
1462 * output.cc (Output_section::Input_section_sort_section_name_compare::
1463 operator()): New function.
1464 (Output_section::sort_attached_input_sections): Use new sort function
1465 for .text if --sort-section=name is specified.
1466 * layout.cc (Layout::make_output_section):
1467 Add sorting by name when --sort-section=name is specified.
1468 * testsuite/Makefile.am (text_section_grouping): Test option
1469 --sort-section=name.
1470 * testsuite/Makefile.in: Regenerate.
1471 * testsuite/section_sorting_name.cc: New file.
1472 * testsuite/section_sorting_name.sh: New file.
1473
93acabad
CC
14742013-05-21 Cary Coutant <ccoutant@google.com>
1475
1476 * symtab.h (Symbol::is_cxx_vtable): New function.
1477 * target-reloc.h (relocate_section): Check for vtable symbol.
1478 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1479 * testsuite/Makefile.in: Regenerate.
1480 * testsuite/missing_key_func.cc: New test source.
1481 * testsuite/missing_key_func.sh: New test script.
1482
60e8b3fc
CC
14832013-05-21 Cary Coutant <ccoutant@google.com>
1484
2b64b551
RM
1485 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1486 type of enclosing symbol.
1487 (Relocate_info::location): Check symbol type when describing symbol.
1488 * object.h (Symbol_location_info): Remove unused line_number;
1489 add enclosing_symbol_type.
1490 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1491
9df9de2c
CC
14922013-05-13 Cary Coutant <ccoutant@google.com>
1493
2b64b551
RM
1494 * configure.ac: Export DEFAULT_TARGET.
1495 * configure: Regenerate.
1496 * Makefile.in: Regenerate.
1497 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1498 * testsuite/Makefile.in: Regenerate.
1499 * testsuite/debug_msg.sh: Delete duplicate tests.
1500 Don't check undef_int error message match for powerpc where the
1501 source file and line number aren't available.
9df9de2c 1502
bbc5ae17
RM
15032013-05-10 Roland McGrath <mcgrathr@google.com>
1504
1505 * options.h (General_options): Add --rosegment-gap option.
1506 * options.cc (finalize): --rosegment-gap implies --rosegment.
1507 * layout.cc (set_segment_offsets): Let user option override
1508 target->rosegment_gap().
1509
0c6e6c39
RM
15102013-05-10 Roland McGrath <mcgrathr@google.com>
1511
1512 * options.h (General_options): Remove leading space from help
1513 messages for -nostdlib and --rosegment.
1514
cde7cb01
MR
15152013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1516
1517 PR ld/15365
1518 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1519
f31ae5b8
AM
15202013-05-03 Alan Modra <amodra@gmail.com>
1521
1522 * merge.cc (Output_merge_string::do_add_input_section): Correct
1523 scan for number of strings. Rename vars to avoid shadowing.
1524 Include missing terminator in input_size_.
1525
d3a7cd45
L
15262013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1527
1528 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1529 Restore empty string handling.
1530
6ad3daba
CC
15312013-05-01 Cary Coutant <ccoutant@google.com>
1532
1533 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1534 uninitialized warning.
1535
e31908b6
CC
15362013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1537
1538 * output.cc (Output_section::add_merge_input_section): Allow
1539 to merge sections if the alignment is more than character size.
1540 * merge.h (Output_merge_string::Output_merge_string): Remove
1541 assert.
1542 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1543 only not-null strings. Check the alignment of strings.
1544 * stringpool.h
1545 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1546 alignment as the argument.
1547 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1548 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1549 Align non-zero length strings according to the addralign_.
1550 (Stringpool_template<Stringpool_char>::set_string_offsets):
1551 Updating offsets according to the given alignment.
1552 * testsuite/Makefile.am (text_section_grouping): Test if string
1553 literals are getting merged.
1554 * testsuite/Makefile.in: Regenerate.
1555 * testsuite/merge_string_literals_1.c: New file.
1556 * testsuite/merge_string_literals_2.c: Ditto.
1557 * testsuite/merge_string_literals.sh: Ditto.
1558
0e804863
ILT
15592013-04-26 Ian Lance Taylor <iant@google.com>
1560
1561 * target-reloc.h (relocate_section): If the reloc offset is out of
1562 range, pass VIEW as NULL to relocate.relocate.
1563 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1564 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1565 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1566 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1567 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1568 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1569
e7c5ea40
CC
15702013-04-26 Geoff Pike <gpike@chromium.org>
1571
1572 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1573 * layout.cc (Hash_task): New class.
1574 (Layout::queue_build_id_tasks): New function.
1575 (Layout::write_build_id): Handle single-thread portion of build ID
1576 computation. (In some cases, all of it is single-threaded.) Replace
1577 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1578 functionality in fewer lines of code.
1579 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1580 * options.h (General_options): make "--build-id" default to tree
1581 rather than sha1. Add two new options related to --build-id=tree:
1582 --build-id-chunk-size-for-treehash and
1583 --build-id-min-file-size-for-treehash.
1584 * Makefile.am: add testing of --build-id=tree and related new options
1585 (these tests will be invoked by "make check").
1586 * Makefile.in: Regenerate.
1587
49926cd0
AM
15882013-04-25 Alan Modra <amodra@gmail.com>
1589
1590 * configure.tgt: Add powerpcle and powerpc64le.
1591
a4034750
AM
15922013-04-22 Alan Modra <amodra@gmail.com>
1593
1594 PR gold/15355
1595 * layout.cc (Layout::segment_precedes): Allow more than one
1596 segment with the same type and flags.
1597
e79c84aa
CC
15982013-04-15 Cary Coutant <ccoutant@google.com>
1599
1600 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1601 allocate space in file for BSS sections.
1602
2199fbe7
CC
16032013-04-15 Cary Coutant <ccoutant@google.com>
1604
1605 * script-sections.cc (Orphan_output_section): Reset address
1606 to zero after each orphaned section for relocatable links.
1607
502e8a84
CC
16082013-04-15 Cary Coutant <ccoutant@google.com>
1609
a4034750
AM
1610 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1611 section starting address for relocatable link.
1612 * testsuite/Makefile.am (script_test_11): New test.
1613 * testsuite/Makefile.in: Regenerate.
1614 * testsuite/script_test_11.c: New source file.
1615 * testsuite/script_test_11.t: New linker script.
502e8a84 1616
0cfdc767
AM
16172013-04-13 Alan Modra <amodra@gmail.com>
1618
1619 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1620 owner when sections are not adjacent and exceed group size.
1621 (Target_powerpc::group_sections): Handle corner case.
1622 (Target_powerpc::Branch_info::make_stub): Handle case where
1623 stub table doesn't exist due to branches in non-exec sections.
1624 (Target_powerpc::Relocate::relocate): Likewise.
1625
6830ee24
AM
16262013-04-11 Alan Modra <amodra@gmail.com>
1627
1628 PR gold/15354
1629 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1630 .branch_lt to match bfd ld. Adjust comments throughout file.
1631
54a3d865
ILT
16322013-04-04 Ian Lance Taylor <iant@google.com>
1633
1634 GCC PR c++/56840
1635 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1636 sections before checking whether they are included in the link.
1637
9993ba11
ST
16382013-03-29 Sriraman Tallam <tmsriram@google.com>
1639
1640 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1641 object before calling the plugin claim_file handler. Pass the elf
1642 object of the archive to the plugin. Delete the elf object if the
1643 plugin claims the file.
1644
ebacd51e
AM
16452013-03-21 Alan Modra <amodra@gmail.com>
1646
1647 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1648 segment when omagic.
1649
117be58f
AM
16502013-03-21 Alan Modra <amodra@gmail.com>
1651
1652 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1653 comparison warning.
1654 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1655 uninitialized" warning.
1656
32e2b61d
AM
16572013-03-20 Alan Modra <amodra@gmail.com>
1658
1659 * symtab.h (Symbol::clear_version): New function.
1660 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1661 is_needed by weak references. Clear version for symbols defined
1662 in as-needed objects that are not needed.
1663
b3ccdeb5
AM
16642013-03-15 Alan Modra <amodra@gmail.com>
1665
1666 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1667 static and public. Add report_err param. Return false for data refs.
1668 (Target_powerpc::rela_dyn_section): New overloaded function.
1669 (Target_powerpc::plt_, iplt_): Elucidate.
1670 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1671 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1672 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1673 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1674 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1675 push_branch and make_plt_entry for ifunc syms when
1676 reloc_needs_plt_for_ifunc.
1677 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1678 for ifunc unless reloc_needs_plt_for_ifunc.
1679
ad3d8a2f
AM
16802013-03-15 Alan Modra <amodra@gmail.com>
1681
1682 * gc.h (gc_process_relocs): Don't look through function descriptors.
1683 * icf.cc (get_section_contents): Do so here instead.
1684
4d9aa155
AM
16852013-03-13 Alan Modra <amodra@gmail.com>
1686
1687 * powerpc.cc (is_branch_reloc): Forward declare.
1688 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1689 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1690 false for 64-bit, true for 32-bit non-branch relocs.
1691 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1692 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1693 nm output.
1694 (icf_safe_test): Generate linker map file as well as nm output.
1695 (icf_safe_so_test): Likewise.
1696 * testsuite/Makefile.in: Regenerate.
1697 * testsuite/icf_test.sh: Parse linker map file to determine
1698 section folding.
1699 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1700 * testsuite/icf_safe_so_test.sh: Likewise.
1701 (X86_32_or_ARM_specific_safe_fold): Merge into..
1702 (arch_specific_safe_fold): ..this.
1703 (X86_64_specific_safe_fold): Delete unused function.
1704
57420c20
AM
17052013-03-12 Alan Modra <amodra@gmail.com>
1706
1707 * gc.h (gc_process_relocs): Look through function descriptors
1708 to determine shndx, symvalue and addend used by ICF. Tidy
1709 variable duplication.
1710
dc3714f3
AM
17112013-03-11 Alan Modra <amodra@gmail.com>
1712
1713 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1714 * layout.cc (Layout_task_runner::run): ..to here.
1715 * symtab.h (struct Symbol_location): Extract from..
1716 (class Symbol_table): ..here.
1717 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1718 * target.h (class Target): Add function_location and
1719 do_function_location functions.
1720 (class Sized_target): Add do_function_location.
1721 * object.h (class Sized_relobj_file): Move find_shdr..
1722 (class Object): ..to here.
1723 * object.cc: Likewise. Update to suit. Instantiate.
1724 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1725 * powerpc.cc (class Powerpc_dynobj): New.
1726 (Target_powerpc::do_function_location): New function.
1727 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1728 (Powerpc_dynobj::do_read_symbols): New function.
1729 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1730
956b03bb
ILT
17312013-03-08 Ian Lance Taylor <iant@google.com>
1732
1733 * options.cc (General_options::string_to_object_format): Accept
1734 "default".
1735
4bead2d5
AM
17362013-03-08 Alan Modra <amodra@gmail.com>
1737
1738 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1739 pointer to Post_fde.
1740 (struct Post_fde): Move definition to here..
1741 * ehframe.cc (struct Post_fde): ..from here.
1742 (Cie::write): Don't alloc Post_fde.
1743 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1744
02e60bf7
AM
17452013-03-07 Alan Modra <amodra@gmail.com>
1746
1747 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1748 relocation referencing .LC0.
1749 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1750
8343f03a
AM
17512013-03-07 Alan Modra <amodra@gmail.com>
1752
1753 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1754 always_inline. Add assembly for powerpc to avoid GOT.
1755
3366d57c
AM
17562013-03-07 Alan Modra <amodra@gmail.com>
1757
1758 * testsuite/script_test_10.sh: Don't test .bss section
1759 header number.
1760
6c77229c
AM
17612013-03-06 Alan Modra <amodra@gmail.com>
1762
1763 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1764 (Target_powerpc::symval_for_branch): Add symtab param. Update
1765 all callers. Handle folded sections.
1766 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1767 to Powerpc_relobj.
1768 (Global_symbol_visitor_opd::operator()): Likewise.
1769
a39e4af6
AM
17702013-03-04 Alan Modra <amodra@gmail.com>
1771
1772 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1773 * testsuite/Makefile.in: Regenerate.
1774
d5834edb
CC
17752013-03-01 Cary Coutant <ccoutant@google.com>
1776
1777 Add dwp support for v2 DWARF package file format.
1778 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1779 tu_length parameter. Adjust all callers.
1780 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1781 * dwp.cc: Include dwarf.h.
1782 (Section_bounds): New struct type.
1783 (Unit_set): New struct type.
1784 (Dwo_file::Dwo_file): Initialize new data member.
1785 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1786 Combine and rename to...
1787 (Dwo_file::read_unit_index): ...this.
1788 (Dwo_file::sized_read_compunit_index)
1789 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1790 (Dwo_file::sized_read_unit_index): ...this.
1791 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1792 parameters; add section_id parameter.
1793 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1794 (Dwo_file::add_unit_set): ...this.
1795 (Dwo_file::shndx_map_): Remove.
1796 (Dwo_file::sect_offsets_): New data member.
1797 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1798 (Dwp_output_file::add_section): Rename to...
1799 (Dwp_output_file::add_contribution): ...this.
1800 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1801 (Dwp_output_file::add_tu_set): Likewise.
1802 (Dwp_output_file::Contribution): New type.
1803 (Dwp_output_file::Section::contributions): New data member.
1804 (Dwp_output_file::Cu_or_tu_set): Remove.
1805 (Dwp_output_file::Section::Section): New ctor.
1806 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1807 (Dwp_output_file::Dwp_index::Section_table): New type.
1808 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1809 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1810 parameter.
1811 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1812 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1813 (Dwp_output_file::Dwp_index::section_table): New member function.
1814 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1815 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1816 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1817 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1818 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1819 (Dwp_output_file::Dwp_index::section_table_): New data member.
1820 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1821 (Dwp_output_file::add_output_section): New member function.
1822 (Dwp_output_file::write_new_section): New member function.
1823 (Dwp_output_file::write_contributions): New member function.
1824 (Dwp_output_file::section_id_map_): New data member.
1825 (class Dwo_id_info_reader): Remove.
1826 (class Unit_reader): New class.
1827 (get_dwarf_section_name): New function.
1828 (Dwo_file::read_executable): Adjust initializations of class data.
1829 (Dwo_file::read): Add support for v2 package file format.
1830 (Dwo_file::read_unit_index): Likewise.
1831 (Dwo_file::sized_read_unit_index): Likewise.
1832 (Dwo_file::copy_section): Likewise.
1833 (Dwo_file::add_unit_set): Likewise.
1834 (Dwp_output_file::add_output_section): Likewise.
1835 (Dwp_output_file::add_contribution): Likewise.
1836 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1837 for empty slot.
1838 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1839 file format.
1840 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1841 slot.
1842 (Dwp_output_file::initialize): Remove unused function.
1843 (Dwp_output_file::finalize): Add support for v2 package file format.
1844 (Dwp_output_file::write_index): Likewise.
1845 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1846 function prototype.
1847
a68a081d
CC
18482013-03-01 Cary Coutant <ccoutant@google.com>
1849
1850 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1851 function into class definition in header file.
1852 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1853 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1854 New function.
1855 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1856
9d5781f8
AM
18572013-02-28 Alan Modra <amodra@gmail.com>
1858
1859 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1860 * target.cc (Target::do_plt_fde_location): New function.
1861 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1862 accessor function, and constructor param.
1863 (struct Post_fde, Post_fdes): Declare.
1864 (Cie::write): Add post_fdes param.
1865 * ehframe.cc (Fde::write): Use plt_fde_location.
1866 (struct Post_fde): Define.
1867 (Cie::write): Stash FDEs added post merge mapping.
1868 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1869 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1870 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1871 other FDEs.
1872 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1873 (Target_powerpc::has_glink): New function.
1874 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1875 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1876 glink_eh_frame_fde_32, default_fde): New data.
1877 (Stub_table::eh_frame_added_): New var.
1878 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1879 Make const.
1880 (Stub_table::add_eh_frame): New function.
1881 (Output_data_glink::add_eh_frame): New function.
1882 (Target_powerpc::make_glink_section): Call add_eh_frame.
1883
214383dd
ILT
18842013-02-15 Ian Lance Taylor <iant@google.com>
1885
1886 * options.h (DEFINE_uint64_alias): Define.
1887 (class General_options): Add -Ttext-segment as an alias for
1888 -Ttext.
1889
91c2b899
AM
18902013-02-15 Alan Modra <amodra@gmail.com>
1891
1892 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1893 (Stub_table::do_write): ..here, two places.
1894 (Stub_table::plt_call_size): Use it here too.
1895
20e2a8aa
ILT
18962013-02-11 Ian Lance Taylor <iant@google.com>
1897
1898 * descriptors.cc (Descriptors::close_all): New function.
1899 * descriptors.h (class Descriptors): Declare close_all.
1900 (close_all_descriptors): New inline function.
1901 * plugin.cc: Include "descriptors.h".
1902 (Plugin_manager::cleanup): Call close_all_descriptors.
1903
8952bc69
AM
19042013-02-06 Alan Modra <amodra@gmail.com>
1905
1906 * README: Update coding style link.
1907
29bd8b6b
CC
19082013-01-28 Cary Coutant <ccoutant@google.com>
1909
a4034750
AM
1910 * dwp.cc (File_list): New typedef.
1911 (Dwo_name_info_reader): New class.
1912 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1913 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1914 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1915 (Dwo_file::read_executable): New function.
1916 (Dwo_file::read): Move common setup code to ...
1917 (Dwo_file::make_object): ... here.
1918 (dwp_options): Add --exec/-e.
1919 (usage): Likewise.
1920 (main): Likewise.
29bd8b6b 1921
c6ac678d
ST
19222013-01-24 Sriraman Tallam <tmsriram@google.com>
1923
1924 * layout.cc (Layout::layout): Check for option text_reorder.
1925 (Layout::make_output_section): Ditto.
1926 * options.h (text_reorder): New option.
1927 * output.cc (Input_section_sort_compare): Remove special ordering
1928 of section names.
1929 (Output_section::
1930 Input_section_sort_section_name_special_ordering_compare::
1931 operator()): New function.
1932 (Output_section::sort_attached_input_sections): Use new sort function
1933 for .text.
1934 * output.h (Input_section_sort_section_name_special_ordering_compare):
1935 New struct.
1936 * testsuite/Makefile.am (text_section_grouping): Test option
1937 --no-text-reorder
1938 * testsuite/Makefile.in: Regenerate.
1939 * testsuite/text_section_grouping.sh: Check order of functions without
1940 default text reordering.
1941
50701cc1
MF
19422013-01-18 Mike Frysinger <vapier@gentoo.org>
1943
1944 * options.h (General_options): Change default to true for new_dtags.
1945
b1b00fcc
MF
19462013-01-18 Mike Frysinger <vapier@gentoo.org>
1947
1948 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1949 when enable_new_dtags is false. Only add DT_RUNPATH when
1950 enable_new_dtags is true.
1951
ec5b8187
AM
19522013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1953
1954 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1955 used in declaration and definition consistent.
1956 (Target_powerpc::symval_for_branch): Ditto.
1957
a880d4c4
ST
19582013-01-16 Sriraman Tallam <tmsriram@google.com>
1959
1960 * testsuite/plugin_final_layout.cc: Fix comment.
1961
7c381248
ST
19622013-01-16 Sriraman Tallam <tmsriram@google.com>
1963
1964 * layout.cc (Layout::layout): Do not do default sorting for
1965 text sections when section ordering is specified.
1966 (make_output_section): Ditto.
1967 * testsuite/plugin_final_layout.cc: Name the function sections
1968 to catch reordering issues.
1969
e2458743
AM
19702013-01-15 Alan Modra <amodra@gmail.com>
1971
1972 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1973 plt-thread-safe.
1974
431ed302
AM
19752013-01-15 Alan Modra <amodra@gmail.com>
1976
1977 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1978 * testsuite/Makefile.in: Regenerate.
1979
0ec6429b
AM
19802013-01-14 Alan Modra <amodra@gmail.com>
1981
1982 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1983 * testsuite/Makefile.in: Regenerate.
1984
0bf402d5
ILT
19852013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1986
36af3926 1987 PR bfd/14430
0bf402d5
ILT
1988 Fix mingw gold build with plugins enabled
1989 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1990 * configure.ac: Export DLOPEN_LIBS and add headers check.
1991 * plugin.cc: Handle non-dlfcn case.
1992 * Makefile.in: Regenerate.
1993 * config.in: Regenerate.
1994 * configure: Regenerate.
1995 * testsuite/Makefile.in: Regenerate.
1996
9e9143bc
ST
19972013-01-09 Sriraman Tallam <tmsriram@google.com>
1998
1999 * output.h (sort_attached_input_sections): Change to be public.
2000 * script-sections.cc
2001 (Output_section_definition::set_section_addresses): Sort
2002 attached input sections according to section order before linker
2003 script assigns section addresses.
2004 (Orphan_output_section::set_section_addresses): Sort
2005 attached input sections according to section order before linker
2006 script assigns section addresses.
2007 * Makefile.am (final_layout.sh): Use a simple linker script to
2008 check if section ordering still works.
2009 * Makefile.in: Regenerate.
2010
679af368
ILT
20112013-01-09 Ben Cheng <bccheng@google.com>
2012
2013 * arm.cc (Target_arm::attributes_accept_div): New function.
2014 (Target_arm::attributes_forbid_div): New function.
2015 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2016 attribute using the same new functions as what bfd/elf32_arm.c
2017 does.
2018
3136a00e
CC
20192013-01-07 Cary Coutant <ccoutant@google.com>
2020
2021 PR gold/14993
2022 * output.cc (Output_section::add_input_section): For incremental
2023 updates, don't track input sections that are allocated from patch
2024 space.
2025
f2a6224b
L
20262013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2027 Ian Lance Taylor <iant@google.com>
2028
2029 PR gold/14897
2030 * configure.ac (--enable-ld): Removed.
2031 (install_as_default): Set to yes only for --enable-gold=default
2032 or --disable-ld.
2033 * configure: Regenerated.
2034
4f46f626
L
20352013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2036
2037 * options.h (General_options): Add -fuse-ld= for GCC linker
2038 option compatibility.
2039
26e4ef59
CC
20402013-01-04 Cary Coutant <ccoutant@google.com>
2041
2042 * configure.ac: Fix typo restoring CXXFLAGS.
2043 * configure: Regenerate.
2044
3d587466
CC
20452013-01-04 Cary Coutant <ccoutant@google.com>
2046
4f46f626
L
2047 * testsuite/Makefile.am (CXXLINK_S): New macro.
2048 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2049 * testsuite/Makefile.in: Regenerate.
3d587466 2050
44db6695
L
20512013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2052
2053 * version.cc (print_version): Update copyright year to 2013.
2054
edcac0c1
ILT
20552012-12-20 Ian Lance Taylor <iant@google.com>
2056
2057 * layout.cc (Layout::special_ordering_of_input_section): New
2058 function.
2059 (Layout::layout): If input section requires special ordering, must
2060 sort input sections.
2061 (Layout::make_output_section): May sort .text input sections.
2062 (Layout::is_section_name_prefix_grouped): Remove.
2063 * layout.h (class Layout): Declare
2064 special_ordering_of_input_section. Don't declare
2065 is_section_name_prefix_grouped.
2066 * output.cc (Output_section::add_input_section): Revert last
2067 change.
2068 (Output_section::Input_section_sort::match_file_name): Don't crash
2069 if called on output section data.
2070 (Output_section::Input_section_sort_compare): Sort based on
2071 special ordering.
2072 (Output_section::Input_section_sort_section_order_index_compare):
2073 Revert last patch.
2074 (Output_section::sort_attached_input_sections): Likewise.
2075
28f2a4ac
ST
20762012-12-18 Sriraman Tallam <tmsriram@google.com>
2077
edcac0c1 2078 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2079 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2080 * output.cc (Output_section::add_input_section): Check if section
2081 name contains special prefix. Keep input sections to sort such
2082 sections.
2083 (Output_section::Input_section_sort_section_order_index_compare
2084 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2085 (Output_section::sort_attached_input_sections): Add condition to
2086 Input_section_entry constructor call.
28f2a4ac
ST
2087 * testsuite/Makefile.am (text_section_grouping): New test.
2088 * testsuite/Makefile.in: Regenerate.
2089 * testsuite/text_section_grouping.cc: New file.
2090 * testsuite/text_section_grouping.sh: New file.
2091
5bf135a7
NC
20922012-12-17 Nick Clifton <nickc@redhat.com>
2093
2094 * Makefile.am: Add copyright notice.
2095 * NEWS: Likewise.
2096 * README: Likewise.
2097 * configure.ac: Likewise.
2098 * ftruncate.c: Likewise.
2099 * Makefile.in: Regenerate.
2100
59965708
CC
21012012-12-14 Cary Coutant <ccoutant@google.com>
2102
a4034750
AM
2103 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2104 --no-as-needed flag.
2105 (exception_separate_shared_12_test): Likewise.
2106 (incremental_copy_test): Likewise.
2107 * testsuite/Makefile.in: Regenerate.
59965708 2108
2a77e2ab
CC
21092012-12-14 Cary Coutant <ccoutant@google.com>
2110
2111 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2112 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2113
e3deeb9c
AM
21142012-12-12 Alan Modra <amodra@gmail.com>
2115
2116 * powerpc.cc (class Track_tls): New.
2117 (class Relocate, class Scan): Inherit Track_tls.
2118 (Target_powerpc::Scan::local, global): Track tls optimization
2119 and avoid creating plt entry for __tls_get_addr if all uses
2120 are optimized away.
2121 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2122
d8f5a274
AM
21232012-12-12 Alan Modra <amodra@gmail.com>
2124
2125 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2126 Replace no_toc_optimize with toc_optimize.
2127 * output.h (Output_section::input_sections): Provide non-const variant.
2128 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2129 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2130 accessors.
2131 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2132 (class Sort_toc_sections): New.
2133 (Target_powerpc::do_finalize_sections): Sort toc sections.
2134 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2135
4c8a1de1
RM
21362012-12-10 Roland McGrath <mcgrathr@google.com>
2137
2138 * testsuite/binary_unittest.cc (read_all): New function.
2139 (Sized_binary_test): Use it instead of ::read.
2140 * fileread.cc (do_read): Don't assume pread always reads the whole
2141 amount in a single call.
2142
edc27beb
AM
21432012-12-10 Alan Modra <amodra@gmail.com>
2144
2145 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2146 Set EM_PPC64 or EM_PPC here.
2147 (Target_selector_powerpc::do_recognize): Delete.
2148
906b9150
AM
21492012-12-10 Alan Modra <amodra@gmail.com>
2150
2151 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2152 stub_table_.
2153 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2154
418c15ae
RM
21552012-12-07 Roland McGrath <mcgrathr@google.com>
2156
2157 * testsuite/binary_unittest.cc (Sized_binary_test):
2158 Use open_descriptor rather than ::open.
2159
decdd3bc
AM
21602012-12-07 Alan Modra <amodra@gmail.com>
2161
2162 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2163 typedef and invalid_address constant.
2164 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2165 instantiate constants.
2166
db399005
ILT
21672012-12-06 Roland McGrath <mcgrathr@google.com>
2168
2169 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2170 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2171 * aclocal.m4: Regenerate.
2172 * configure: Regenerate.
2173 * Makefile.in: Regenerate.
2174 * testsuite/Makefile.in: Regenerate.
2175
aba6bc71
AM
21762012-12-07 Alan Modra <amodra@gmail.com>
2177
2178 * options.h (General_options): Add no_toc_optimize.
2179 * powerpc.cc (ok_lo_toc_insn): New function.
2180 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2181
9e69ed50
AM
21822012-12-06 Alan Modra <amodra@gmail.com>
2183
2184 * options.h (General_options): Add plt_align, plt_static_chain,
2185 plt_thread_safe. Update stub_group_size help text.
2186 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2187 for new plt_thread_safe_ var.
2188 (use_plt_offset): Correct comments.
2189 (Target_powerpc::do_relax): Look for thread creation symbols to
2190 determine default plt_thread_safe value. Clear plt call stubs
2191 as well as branch stubs each iteration.
2192 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2193 insn constants.
2194 (l, hi, ha, write_insn): Move earlier.
2195 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2196 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2197 plt stubs too.
2198 (Stub_table::update_size): Adjust.
2199 (Stub_table::prev_size, set_prev_size): Delete.
2200 (Stub_table::stub_align): Let --plt-align affect result.
2201 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2202 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2203 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2204 (Stub_table::do_write): Support more stub variants.
2205
f43ba157
AM
22062012-12-04 Alan Modra <amodra@gmail.com>
2207
2208 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2209 (Target_powerpc::do_define_standard_symbols): New function.
2210
34171bc5
AM
22112012-12-03 Alan Modra <amodra@gmail.com>
2212
2213 * output.h: Formatting, whitespace.
2214
dc9589e9 22152012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2216
2217 * layout.h (Layout::get_executable_sections): Declare.
2218 * layout.cc (Layout::get_executable_sections): New function.
2219 * arm.cc (Target_arm::group_sections): Use it.
2220 (Arm_output_section::group_sections): Delete now redundant test.
2221 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2222 param to handle relative relocs.
2223 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2224 (Output_data_reloc::add_absolute): Adjust.
2225 (Output_data_reloc::add_relative): New function.
2226 (Output_data::reset_data_size): New function.
2227 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2228 (Output_section::set_addralign): New function.
2229 (Output_section::checkpoint_set_addralign): New function.
2230 (Output_section::clear_section_offsets_need_adjustment): New function.
2231 (Output_section::input_sections): Make public.
2232 * powerpc.cc (class Output_data_brlt_powerpc): New.
2233 (class Stub_table, class Stub_control): New.
2234 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2235 stub_table_, set_stub_table, stub_table): New vectors and accessor
2236 functions.
2237 (Target_powerpc::do_may_relax, do_relax, push_branch,
2238 new_stub_table, stub_tables, brlt_section, group_sections,
2239 add_branch_lookup_table, find_branch_lookup_table,
2240 write_branch_lookup_table, make_brlt_section): New functions.
2241 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2242 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2243 branch_info_): New vars.
2244 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2245 make call stubs here.
2246 (Output_data_glink): Remove all call stub handling from this class.
2247 (Target_powerpc::Scan::local, global): Save interesting branch
2248 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2249 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2250 functions on final link.
2251 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2252 Handle long branch destinations too.
2253 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2254 do_plt_address_for_local): Adjust lookup of plt call stubs.
2255
627b30b7
AM
22562012-11-30 Alan Modra <amodra@gmail.com>
2257
2258 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2259 relocs against protected symbols when building 32-bit shared libs.
2260
40b469d7
AM
22612012-11-30 Alan Modra <amodra@gmail.com>
2262
2263 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2264 param. Call got_section() to make .got. Update all callers
2265 and their callers and so on.
2266
bb66a627
AM
22672012-11-30 Alan Modra <amodra@gmail.com>
2268
2269 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2270 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2271 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2272 value if it already exists.
2273
d2cf1c6c
L
22742012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2275
2276 PR gold/14858
2277 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2278
edccdf7c
RM
22792012-11-14 Roland McGrath <mcgrathr@google.com>
2280
2281 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2282 than bfc instruction for data sandboxing.
2283
6febeb74
AM
22842012-11-08 Alan Modra <amodra@gmail.com>
2285
2286 * po/POTFILES.in: Regenerate.
2287
0a6f1bf2
AM
22882012-11-05 Alan Modra <amodra@gmail.com>
2289
2290 * configure.ac: Apply 2012-09-10 change to config.in here.
2291 * configure: Regenerate.
2292
26a4e9cb
AM
22932012-11-05 Alan Modra <amodra@gmail.com>
2294
2295 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2296 (struct Opd_ent): Use "Address" rather than "Offset".
2297 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2298 (Target_powerpc::got_section): Make public.
2299 (Target_powerpc::scan_relocs): Move code setting symbols..
2300 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2301 Create _SDA_BASE_ only when referenced.
2302
cc928013
RM
23032012-11-02 Roland McGrath <mcgrathr@google.com>
2304
2305 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2306 from last change.
2307
50ed5eb1
RM
23082012-11-01 Roland McGrath <mcgrathr@google.com>
2309
62fe925a
RM
2310 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2311 for offset_in_output_section parameter.
2312 (Sized_target::relocate_special_relocatable): Likewise.
2313 * arm.cc (Target_arm::relocate_relocs): Likewise.
2314 (Target_arm::relocate_special_relocatable): Likewise.
2315 * i386.cc (Target_i386::relocate_relocs): Likewise.
2316 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2317 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2318 * target-reloc.h (relocate_relocs): Likewise.
2319 * testsuite/testfile.cc (Target_test): Likewise.
2320 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2321 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2322
2323 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2324 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2325
2326 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2327 parameter, which is unused in the [!F_SETFD] case.
2328
50ed5eb1
RM
2329 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2330 SYMNDX to off_t before comparing it to this->data_size().
2331 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2332 * incremental.cc (Output_section_incremental_inputs::do_write):
2333 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2334
2cadc0bf
RM
2335 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2336
3bfcb652
NC
23372012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2338
2339 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2340 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2341 in EABI_VER5.
2342
c1a8d56e
CC
23432012-10-29 Cary Coutant <ccoutant@google.com>
2344
2345 * dwp.cc (usage): Add file and exit status parameters;
2346 add --help and --version options.
2347 (print_version): New function.
2348 (main): Add --help and --version options.
2349
b2490a7b
L
23502012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2351
2352 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2353 final_layout_sequence.txt.
2354 * testsuite/Makefile.in: Regenerated.
2355
aa543512
L
23562012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2357
2358 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2359 COMPILE generated by automake.
2360 (LINK1): Likewise.
2361 (CXXCOMPILE1): Likewise.
2362 (CXXLINK1): Likewise.
2363 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2364 (LINK): Likewise.
2365 (CXXCOMPILE): Likewise.
2366 (CXXLINK): Likewise.
2367 * testsuite/Makefile.in: Regenerated.
2368
d361fafb
L
23692012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2370
2371 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2372 on bad fwrite return.
2373
598c7410
L
23742012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2375
2376 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2377 on val.
2378
35c813e2
CC
23792012-10-23 Cary Coutant <ccoutant@google.com>
2380
2381 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2382 * testsuite/Makefile.in: Regenerate.
2383 * testsuite/dwp_test.h: New source file.
2384 * testsuite/dwp_test_1.cc: New source file.
2385 * testsuite/dwp_test_1.s: New source file.
2386 * testsuite/dwp_test_1.sh: New source file.
2387 * testsuite/dwp_test_1b.cc: New source file.
2388 * testsuite/dwp_test_1b.s: New source file.
2389 * testsuite/dwp_test_2.cc: New source file.
2390 * testsuite/dwp_test_2.s: New source file.
2391 * testsuite/dwp_test_2.sh: New source file.
2392 * testsuite/dwp_test_main.cc: New source file.
2393 * testsuite/dwp_test_main.s: New source file.
2394
77429909
CC
23952012-10-23 Cary Coutant <ccoutant@google.com>
2396
2397 * dwp.h: New header file.
2398 * dwp.cc: New source file.
2399 * gold.h: Move shared declarations to system.h.
2400 * system.h: New header file.
2401 * Makefile.am: Add dwp.
2402 * Makefile.in: Regenerate.
2403
ed5d6712
CC
24042012-10-23 Cary Coutant <ccoutant@google.com>
2405
2406 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2407 Dwarf_info_reader::read_from_pointer.
2408 (Dwarf_pubnames_table::read_header): Likewise.
2409 (Dwarf_pubnames_table::next_name): Likewise.
2410 (Dwarf_die::read_attributes): Likewise.
2411 (Dwarf_die::skip_attributes): Likewise.
2412 (Dwarf_info_reader::read_from_pointer): New function template.
2413 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2414 (Dwarf_pubnames_table): Likewise.
2415 (Dwarf_info_reader::read_from_pointer): New function template.
2416 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2417 Dwarf_pubnames_table ctor.
2418
8787852d
CC
24192012-10-23 Cary Coutant <ccoutant@google.com>
2420
2421 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2422 abbrev_shndx.
2423 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2424 abbrev_shndx_.
2425 (Dwarf_info_reader::set_abbrev_shndx): New method.
2426 (Dwarf_info_reader::abbrev_shndx_): New data member.
2427
9fc236f3
CC
24282012-10-23 Cary Coutant <ccoutant@google.com>
2429
2430 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2431 from object, not parameters.
2432 (Dwarf_info_reader::parse): Likewise.
2433 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2434 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2435 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2436 methods.
2437
effe8365
CC
24382012-10-23 Cary Coutant <ccoutant@google.com>
2439
2440 * fileread.cc (Input_file::Input_file): New constructor.
2441 * fileread.h (class Input_file): Add new constructor.
2442
1698990d
AM
24432012-10-18 Alan Modra <amodra@gmail.com>
2444
2445 PR gold/14727
2446 * object.cc (Relobj::is_section_name_included): Also match
2447 .sdata personality section.
2448
168a4726
AM
24492012-10-18 Alan Modra <amodra@gmail.com>
2450
2451 * target-reloc.h (class Default_comdat_behavior): New, package up..
2452 (get_comdat_behaviour): ..this.
2453 (relocate_section): Add Relocate_comdat_behavior template arg,
2454 adjust code to suit.
2455 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2456 (Target_arm::scan_reloc_section): Likewise.
2457 * i386.cc (Target_i386::relocate_section): Likewise.
2458 * sparc.cc (Target_sparc::relocate_section): Likewise.
2459 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2460 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2461 * powerpc.cc (class Relocate_comdat_behavior): New.
2462 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2463 gold::relocate_section with new template arg.
2464
acc276d8
AM
24652012-10-18 Alan Modra <amodra@gmail.com>
2466
2467 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2468 dynamic relocs for GOT_TPREL got entries, without symbol if
2469 resolving locally.
2470 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2471 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2472 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2473
e10f9870
AM
24742012-10-17 Alan Modra <amodra@gmail.com>
2475
2476 PR gold/14726
2477 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2478
ae034989
ST
24792012-10-16 Sriraman Tallam <tmsriram@google.com>
2480
2481 * layout.cc (Layout::include_section): Keep sections marked
2482 SHF_EXCLUDE when doing relocatable links.
2483
f3a0ed29
AM
24842012-10-16 Alan Modra <amodra@gmail.com>
2485
2486 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2487 (Target_powerpc::do_finalize_sections): Call it.
2488 (Output_data_save_res): New class and supporting functions.
2489 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2490 normal symbols defined in object files.
2491
c6de8ed4
AM
24922012-10-12 Alan Modra <amodra@gmail.com>
2493
2494 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2495 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2496 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2497 section if scan_opd_relocs not yet called.
2498 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2499
03e25981
AM
25002012-10-12 Alan Modra <amodra@gmail.com>
2501
2502 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2503 add_local_ifunc_entry): Revert last change.
2504 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2505
c9824451
AM
25062012-10-05 Alan Modra <amodra@gmail.com>
2507
2508 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2509 do_plt_address_for_global): New functions.
2510 (Output_data_got_powerpc::do_write): Don't segfault when linking
2511 statically.
2512 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2513 add_local_ifunc_entry): Return true on adding entry..
2514 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2515 glink->add_entry call. Remove unused symtab param. Adjust calls.
2516 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2517 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2518 set up symbols here.
2519 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2520 syms here. Do so even when no .iplt. Don't segfault when linking
2521 statically.
2522 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2523 new variants without reloc param.
2524 (Glink_sym_ent::Glink_sym_ent): Likewise.
2525 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2526 reloc when refs will resolve to plt call stub.
2527 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2528 R_PPC_PLTREL24 to resolve locally.
2529 (Target_powerpc::Scan::global): Correct ifunc handling.
2530 (Target_powerpc::Relocate::relocate): Correct local sym glink
2531 lookup. Don't destroy "value" when we have a plt call stub,
2532 and when checking plt call validity.
2533 (Target_powerpc::do_dynsym_value): Simplify.
2534
19fec8c1
AM
25352012-10-05 Alan Modra <amodra@gmail.com>
2536
2537 * i386.cc (Output_data_plt_i386::address_for_global,
2538 address_for_local): Add plt offset to returned value. Adjust uses.
2539 * sparc.cc (Output_data_plt_sparc::address_for_global,
2540 address_for_local): Likewise.
2541 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2542 address_for_local): Likewise.
2543 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2544 address_for_local): Likewise.
2545 * target.h (Target::plt_address_for_global, plt_address_for_local):
2546 Update comment.
2547 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2548 (Output_data_got::Got_entry::write): Nor here.
2549 * output.h: Comment fix.
2550
e867b647
WL
25512012-10-02 Jiong Wang <jiwang@tilera.com>
2552
2553 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2554 global_offset_table_ value for larget got.
2555 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2556
e5d5f5ed
AM
25572012-09-29 Alan Modra <amodra@gmail.com>
2558
2559 * powerpc.cc (Target_powerpc::iplt_): New output section.
2560 (Target_powerpc::iplt_section, make_iplt_section,
2561 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2562 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2563 Target_powerpc::plt_entry_count): Count iplt entries too.
2564 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2565 reloc section in constructor. New params.
2566 (Target_powerpc::make_plt_section): Create reloc section here instead.
2567 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2568 functions.
2569 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2570 (Output_data_glink::add_entry, find_entry): New functions to
2571 deal with local syms.
2572 (Glink_sym_ent): Add support for local syms.
2573 (Output_data_glink::do_write): Handle ifunc plt entries.
2574 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2575 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2576 (Target_powerpc::Relocate::relocate): Likewise.
2577 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2578
ec4dbad3
AM
25792012-09-25 Alan Modra <amodra@gmail.com>
2580
2581 * object.h (Sized_relobj_file::adjust_local_symbol,
2582 do_adjust_local_symbol): New functions.
2583 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2584 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2585 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2586 and irregular opd entry spacing.
2587 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2588 (Global_symbol_visitor_opd): New functor.
2589 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2590 on deleted opd entries.
2591
5c0b3823
WL
25922012-09-15 Jiong Wang <jiwang@tilera.com>
2593
2594 * tilegx.cc: New file.
2595 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2596 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2597 * configure.tgt: Add entries for tilegx*.
2598 * configure.ac: Likewise.
2599 * Makefile.in: Rebuild.
2600 * configure: Likewise.
2601 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2602 tilegx.
2603
bfdfa4cd
AM
26042012-09-13 Alan Modra <amodra@gmail.com>
2605
2606 * target-reloc.h (scan_relocs): Call scan.local for relocs
2607 against symbols in discarded sections. Pass is_discarded
2608 param.
2609 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2610 Add is_discarded param.
2611 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2612 is_discarded to flag opd entry as discarded. Don't emit dyn
2613 relocs on such entries.
2614 (Target_powerpc::Scan::global): Similarly detect and handle
2615 such opd entries.
2616 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2617 opd_ent_. Update all uses.
2618 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2619 (Target_powerpc::relocate_section): Zero out discarded opd
2620 entry relocs.
2621
d77a0555
ILT
26222012-09-12 Ian Lance Taylor <iant@google.com>
2623
2624 PR gold/14570
2625 * output.cc: Rename Output_data_got template parameter from size
2626 to got_size for all functions. Compile all variants of
2627 Output_data_got.
2628 (Output_data_got::Got_entry::write): Correct use of size for
2629 symbol value. Use local_is_tls rather than casting to
2630 Sized_relobj_file.
2631 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2632 (class Sized_relobj_file): Add do_local_is_tls.
2633 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2634
815a1205
AM
26352012-09-11 Alan Modra <amodra@gmail.com>
2636
2637 PR gold/14566
2638 * layout.cc (Layout::set_segment_offsets): When using
2639 common-page-size alignment, ensure we are on a new max-page-size
2640 page.
2641 * output.cc (Output_segment::set_section_addresses): Use
2642 abi_pagesize, not common_pagesize for relro boundary.
2643 (Output_segment::set_offset): Likewise.
2644
bd73a62d
AM
26452012-09-11 Alan Modra <amodra@gmail.com>
2646
2647 * output.h (Output_data_got::add_global_tls, add_local_tls,
2648 add_local_tls_pair): New functions.
2649 (Output_data_got::add_local_pair_with_rel): Remove second
2650 reloc param. Expand comment.
2651 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2652 use_plt_or_tls_offset_, similarly for constructor param.
2653 (Output_data_got::Got_entry::write): Add got_index param.
2654 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2655 add_local_tls_pair): New functions.
2656 (Output_data_got::Got_entry::write): Handle tls symbols
2657 with use_plt_or_tls_offset_ set specially.
2658 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2659 (Output_data_got::do_write): Replace iterator with index, pass
2660 index to entry write function.
2661 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2662 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2663 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2664 call.
2665 * i386.cc (Target_i386::Scan::local): Likewise.
2666 * sparc.cc (Target_sparc::Scan::local): Likewise.
2667 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2668 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2669 do_tls_offset_for_global): New functions.
2670 (Target_powerpc::Scan::local): Correct TLS relocations and got
2671 entry values.
2672 (Target_powerpc::Scan::global): Don't emit unnecessary
2673 dynamic relocations on TLS GOT entries.
2674
00716ab1
AM
26752012-09-10 Matthias Klose <doko@ubuntu.com>
2676
2677 * config.in: Disable sanity check for kfreebsd.
2678
c891b3f9
SA
26792012-09-10 Sterling Augustine <saugustine@google.com>
2680
2681 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2682 (Gdb_index::pubtypes_read): New parameter.
2683 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2684 to calls.
2685 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2686 pubtypes_object_.
2687
e81fea4d
AM
26882012-09-09 Alan Modra <amodra@gmail.com>
2689
2690 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2691 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2692 * gc.h (gc_process_relocs): Call target gc_add_reference.
2693 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2694 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2695 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2696 unnecessary cast.
2697 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2698 to cater for when we don't need code offset. Update use.
2699 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2700 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2701 set_opd_valid): New functions.
2702 (Target_powerpc::do_gc_add_reference): New function.
2703 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2704 stashed refs.
2705 (Target_powerpc::do_gc_mark_symbol): New function.
2706
d2d60eef
CC
27072012-09-06 Cary Coutant <ccoutant@google.com>
2708
2709 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2710 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2711 (Dwarf_die::skip_attributes): Likewise.
2712 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2713 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2714 (main): Call it.
2715 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2716
32ed4573
L
27172012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2718
2719 * testsuite/script_test_3.t: Add .got.plt output section
2720 statement.
2721 * testsuite/script_test_4.t: Likewise.
2722
f4baf0d4
AM
27232012-09-05 Alan Modra <amodra@gmail.com>
2724
2725 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2726 update all uses and lose "enum" when using type.
2727
864a1b56
AM
27282012-09-05 Alan Modra <amodra@gmail.com>
2729
2730 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2731 * configure: Regenerate.
2732 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2733 (plugin_final_layout.stdout): Likewise.
2734 (memory_test): Set page sizes to 0x1000.
2735 * testsuite/Makefile.in: Regenerate.
2736 * testsuite/discard_locals_test.sh: Add FIXME comment.
2737 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2738 * testsuite/pr14265.t: Add .got output section statement.
2739 * testsuite/script_test_2.t: Likewise.
2740 * testsuite/script_test_3.t: Likewise.
2741 * testsuite/script_test_4.t: Likewise.
2742 * testsuite/script_test_5.t: Likewise.
2743 * testsuite/script_test_6.t: Likewise.
2744 * testsuite/script_test_7.t: Likewise.
2745 * testsuite/script_test_9.t: Likewise.
2746
3ea0a085
AM
27472012-09-05 Alan Modra <amodra@gmail.com>
2748
2749 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2750 (Powerpc_relocate_functions::Status): New typedef.
2751 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2752 (Target_powerpc::Scan::local): Handle REL64.
2753 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2754 for REL32 and REL64.
2755 (Target_powerpc::symval_for_branch): New function, extracted from..
2756 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2757 checks. Report overflow errors.
2758
7404fe1b
AM
27592012-09-05 Alan Modra <amodra@gmail.com>
2760
2761 * object.h (Sized_relobj_file::emit_relocs): Delete.
2762 (Sized_relobj_file::emit_relocs_reltype): Delete.
2763 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2764 relocate_relocs for --emit-relocs.
2765 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2766 * output.h: Update comment.
2767 (Output_segment::first_section): New function.
2768 (Output_segment::first_section_load_address): Use first_section.
2769 * output.cc (Output_segment::first_section): New function extracted..
2770 (Output_segment::first_section_load_address): ..from here. Delete.
2771 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2772 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2773 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2774 adjust call to target.h function.
2775 * i386.cc (Target_i386): Likewise.
2776 * sparc.cc (Target_sparc): Likewise.
2777 * x86_64.cc (Target_x86_64): Likewise.
2778 * powerpc.cc (Target_powerpc): Likewise.
2779 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2780 first tls section has section symbol for optimised local dynamic
2781 output relocs.
2782 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2783 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2784 optimised tls code.
2785 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2786 Rename to relocate_relocs. Update error message.
2787
957564c9
AS
27882012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2789
2790 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2791 --just-symbols.
2792
dd93cd0a
AM
27932012-08-31 Alan Modra <amodra@gmail.com>
2794
2795 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2796 (Powerpc_relobj::toc_base_offset): New stub function.
2797 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2798 got_mod_index_offset to tlsld_got_offset. Update all refs.
2799 (Target_powerpc::Relocate::enum skip_tls): New.
2800 (Target_powerpc::call_tls_get_addr_): New var.
2801 (Target_powerpc::is_branch_reloc): Move to file scope.
2802 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2803 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2804 New functions.
2805 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2806 (powerpc_info): Correct common_pagesize for ppc64.
2807 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2808 (Powerpc_relocate_functions): Add overflow check enums and functions.
2809 Add non-shift version of rela, rela_ua. Delete all rel public
2810 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2811 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2812 addr16_ha3, addr14 functions.
2813 (Output_data_got_powerpc::add_constant_pair): New function.
2814 (Output_data_got_powerpc::got_base_offset): Likewise.
2815 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2816 (instruction constants): Sort, add some more.
2817 (Output_data_glink::do_write): Add and use Address typedef. Use
2818 object->toc_base_offset() stub for 64-bit.
2819 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2820 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2821 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2822 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2823 Always treat .opd relocs as against locally defined symbol.
2824 Correct condition for RELATIVE relocs.
2825 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2826 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2827 for 32-bit syms with a plt entry. Correct ppc64 toc base
2828 calculations. Handle TLS relocs, and more. Add overflow
2829 checking and adjust for Powerpc_relocate_functions changes.
2830 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2831 Reinstate --emit-relocs code with FIXME.
2832
a1373b60
AM
28332012-08-30 Alan Modra <amodra@gmail.com>
2834
2835 * layout.cc (Layout::set_segment_offsets): Set p_align to
2836 abi_pagesize, not common_pagesize.
2837 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2838 to determine whether file header can go in segment.
2839
703d02da
AM
28402012-08-30 Alan Modra <amodra@gmail.com>
2841
2842 * output.h (Output_reloc::Output_reloc <output section>): Add
2843 is_relative param. Adjust calls.
2844 (Output_reloc::add_output_section_relative): New functions.
2845 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2846 is_relative.
2847 (Output_reloc::symbol_value): Handle SECTION_CODE.
2848
16164a6b
ST
28492012-08-24 Sriraman Tallam <tmsriram@google.com>
2850
2851 * gold.cc (queue_middle_tasks): Call layout again when unique
2852 segments for sections is desired.
2853 * layout.cc (Layout::Layout): Initialize new members.
2854 (Layout::get_output_section_flags): New function.
2855 (Layout::choose_output_section): Call get_output_section_flags.
2856 (Layout::layout): Make output section for mapping to a unique segment.
2857 (Layout::insert_section_segment_map): New function.
2858 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2859 output sections marked so.
16164a6b
ST
2860 (Layout::segment_precedes): Check for unique segments when sorting.
2861 * layout.h (Layout::Unique_segment_info): New struct.
2862 (Layout::Section_segment_map): New typedef.
2863 (Layout::insert_section_segment_map): New function.
2864 (Layout::get_output_section_flags): New function.
2865 (Layout::is_unique_segment_for_sections_specified): New function.
2866 (Layout::set_unique_segment_for_sections_specified): New function.
2867 (Layout::unique_segment_for_sections_specified_): New member.
2868 (Layout::section_segment_map_): New member.
2869 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2870 Rename is_gc_pass_one to is_pass_one.
2871 Rename is_gc_pass_two to is_pass_two.
2872 Rename is_gc_or_icf to is_two_pass.
2873 Check for which pass based on whether symbols data is present.
2874 Make it two pass when unique segments for sections is desired.
2875 * output.cc (Output_section::Output_section): Initialize new
2876 members.
2877 * output.h (Output_section::is_unique_segment): New function.
2878 (Output_section::set_is_unique_segment): New function.
2879 (Output_section::is_unique_segment_): New member.
2880 (Output_section::extra_segment_flags): New function.
2881 (Output_section::set_extra_segment_flags): New function.
2882 (Output_section::extra_segment_flags_): New member.
2883 (Output_section::segment_alignment): New function.
2884 (Output_section::set_segment_alignment): New function.
2885 (Output_section::segment_alignment_): New member.
2886 (Output_segment::Output_segment): Initialize is_unique_segment_.
2887 (Output_segment::is_unique_segment): New function.
2888 (Output_segment::set_is_unique_segment): New function.
2889 (Output_segment::is_unique_segment_): New member.
2890 * plugin.cc (allow_unique_segment_for_sections): New function.
2891 (unique_segment_for_sections): New function.
2892 (Plugin::load): Add new functions to transfer vector.
2893 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2894 * Makefile.in: Regenerate.
2895 * testsuite/plugin_final_layout.sh: Check if unique segment
2896 functionality works.
2897 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2898 are available.
2899 (allow_unique_segment_for_sections): New global.
2900 (unique_segment_for_sections): New global.
2901 (claim_file_hook): Call allow_unique_segment_for_sections.
2902 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2903
1e2bee4f
CC
29042012-08-22 Cary Coutant <ccoutant@google.com>
2905
2906 * layout.cc (Layout::include_section): Don't assert on GROUP
2907 sections with --emit-relocs.
2908
1d5dfe78
CC
29092012-08-21 Cary Coutant <ccoutant@google.com>
2910
2911 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2912 if --export-dynamic-symbol names an undef symbol.
2913
c9269dff
AM
29142012-08-18 Alan Modra <amodra@gmail.com>
2915
2916 * powerpc.cc: Formatting and white space.
2917 (Powerpc_relobj): Rename got2_section_ to special_.
2918 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2919 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2920 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2921 (Target_powerpc): Add Address typedef and invalid_address. Use
2922 throughout.
2923 (Target_powerpc::is_branch_reloc): New function.
2924 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2925 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2926 for dst_mask, value and addend.
2927 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2928 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2929 (Output_data_glink::do_write): Correct toc base. Don't try to use
2930 uint16_t for 24-bit offset. Use get_output_section_offset and
2931 check return.
2932 (Target_powerpc::Scan::local): Handle more relocs.
2933 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2934 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2935 Plug in toc restoring insn after plt calls. Translate branches
2936 to function descriptor symbols to corresponding entry point.
2937 (Target_powerpc::relocate_for_relocatable): Check return from
2938 get_output_section_offset.
2939 * symtab.h: Comment typo.
2940
b1759dce
ILT
29412012-08-14 Ian Lance Taylor <iant@google.com>
2942
2943 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2944 unsupported_relocal_local to call unsupported_reloc_global.
2945
b9b2ae8b
NC
29462012-08-14 Nick Clifton <nickc@redhat.com>
2947
2948 PR ld/14265
2949 * script-sections.cc (Sections_element::output_section_name): Add
2950 keep return parameter.
2951 (Output_section_element::match_name): Add keep return parameter.
2952 Return the value of the keep_ member.
2953 * script-sections.h (class Output_section): Update
2954 output_section_name prototype.
2955 * layout.cc (Layout::keep_input_section): New public member
2956 function.
2957 (Layout::choose_output_section): Pass keep parameter to
2958 output_section_name.
2959 * layout.h (class Layout): Add keep_input_section.
2960 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2961 sections.
2962 * testsuite/Makefile.am: Add a test.
2963 * testsuite/Makefile.in: Regenerate.
2964 * testsuite/pr14265.c: Source file for the test.
2965 * testsuite/pr14265.t: Linker script for the test.
2966 * testsuite/pr14265.sh: Shell script for the test.
2967
921b5322
AM
29682012-08-14 Alan Modra <amodra@gmail.com>
2969
2970 * target.h (Target::output_section_name): New function.
2971 (Target::do_output_section_name): New function.
2972 * layout.cc (Layout::choose_output_section): Call the above.
2973 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2974
6ce78956
AM
29752012-08-14 Alan Modra <amodra@gmail.com>
2976
2977 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2978 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2979 for replace_constant call.
2980 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2981 (Output_data_glink::do_print_to_mapfile): New function.
2982 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2983 (Target_powerpc::Relocate::relocate): Likewise.
2984
d1a8cabd
AM
29852012-08-14 Alan Modra <amodra@gmail.com>
2986
2987 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2988 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2989 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2990 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2991 all references to shndx_. Handle special case for R_PPC_PLTREL24
2992 here.
2993 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2994 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2995 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2996 here.
2997 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2998 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2999
d83ce4e3
AM
30002012-08-12 Alan Modra <amodra@gmail.com>
3001
3002 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3003 (glink insn constants): Use uint32_t.
3004 (Output_data_glink::add_entry): Use insert, not [] operator.
3005
cf43a2fe
AM
30062012-08-11 Alan Modra <amodra@gmail.com>
3007
3008 * object.h (Sized_relobj_file::find_shdr): New function.
3009 (Sized_relobj_file::find_special_sections): New function.
3010 * object.cc (Sized_relobj_file::find_shdr): New function.
3011 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3012 (Sized_relobj_file::find_special_sections): New function, split out..
3013 (Sized_relobj_file::do_read_symbols): ..from here.
3014 * output.h (Output_data_got::replace_constant): New function.
3015 (Output_data_got::num_entries): New function.
3016 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3017 (Output_data_got::got_offset): Protected rather than private.
3018 (Output_data_got::replace_got_entry): New function.
3019 * output.cc (Output_data_got::replace_got_entry): New function.
3020 * powerpc.cc (class Powerpc_relobj): New.
3021 (class Powerpc_relocate_functions): Delete all psymval variants or
3022 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3023 Implement _ha functions using corresponding _hi function.
3024 (Powerpc_relobj::find_special_sections): New function.
3025 (Target_powerpc::do_make_elf_object): New function.
3026 (class Output_data_got_powerpc): New.
3027 (class Output_data_glink): New.
3028 (class Powerpc_scan_relocatable_reloc): New.
3029 Many more changes througout file.
3030
3c892704
NC
30312012-08-09 Nick Clifton <nickc@redhat.com>
3032
3033 * po/vi.po: Updated Vietnamese translation.
3034
82435b3b
ILT
30352012-08-07 Ian Lance Taylor <iant@google.com>
3036
3037 * layout.cc (Layout::add_target_dynamic_tags): If
3038 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3039 plt_rel.
3040
a6dc81d2
NC
30412012-07-30 Nick Clifton <nickc@redhat.com>
3042
3043 * po/gold.pot: Updated template.
3044 * po/es.po: Updated Spanish translation.
3045
f1415016
CC
30462012-07-18 Cary Coutant <ccoutant@google.com>
3047
3048 PR gold/14344
3049 * configure.ac: Add check for -gpubnames support.
3050 * configure: Regenerate.
3051 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3052 support; force -gno-pubnames.
3053 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3054 support.
3055 (gdb_index_test_4): New test.
3056 * testsuite/Makefile.in: Regenerate.
3057 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3058 * testsuite/gdb_index_test_2.sh: Likewise.
3059 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3060 * testsuite/gdb_index_test_4.sh: New script.
3061 * testsuite/gdb_index_test_comm.sh: New script with common code;
3062 don't look for space after colon.
3063
b7fd7c37
ST
30642012-07-16 Sriraman Tallam <tmsriram@google.com>
3065
3066 * gold.cc (queue_middle_tasks): Update function order only after
3067 deferred objects due to plugins are processed.
3068
1f3212db
ILT
30692012-07-11 Ian Lance Taylor <iant@google.com>
3070
3071 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3072 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3073 (Target_arm::scan_reloc_for_stub): Likewise.
3074 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3075 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3076 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3077 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3078 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3079
81c82a68
ILT
30802012-07-10 Dodji Seketeli <dodji@redhat.com>
3081 Ian Lance Taylor <iant@google.com>
3082
3083 PR gold/14309
3084 * configure.ac: Test whether std::tr1::hash<off_t> works.
3085 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3086 needed.
3087 * output.h (class Output_fill): Add virtual destructor.
3088 * configure, config.in: Rebuild.
3089
eabc84f4
RM
30902012-06-22 Roland McGrath <mcgrathr@google.com>
3091
3092 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3093
370e30b6
RÁE
30942012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3095
3096 * plugin.cc (Plugin::load): Handle position independent executables.
3097
fb1b895d
CC
30982012-06-06 Cary Coutant <ccoutant@google.com>
3099
3100 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3101 add .debug_macro.
3102 (lines_only_debug_sections): Likewise.
3103 (gdb_fast_lookup_sections): New static array.
3104 (is_gdb_debug_section): Rename formal parameter.
3105 (is_lines_only_debug_section): Likewise.
3106 (is_gdb_fast_lookup_section): New function.
3107 (Layout::include_section): Check for ".zdebug_" prefix; pass
3108 section name suffix to is_gdb_debug_section, et al.; check for
3109 fast-lookup sections when building .gdb_index.
3110 * options.h (--strip-debug-gdb): Update GDB version number.
3111
7c0640fa
CC
31122012-06-06 Cary Coutant <ccoutant@google.com>
3113
3114 * configure.ac: Add check for fallocate.
3115 * configure: Regenerate.
3116 * config.in: Regenerate.
3117
3118 * options.h (class General_options): Add --mmap-output-file and
3119 --posix-fallocate options.
3120 * output.cc: (posix_fallocate): Remove; replace with...
3121 (gold_fallocate): New function.
3122 (Output_file::map_no_anonymous): Call gold_fallocate.
3123 (Output_file::map): Check --mmap-output-file option.
3124
2a49eb69
DK
31252012-06-05 Jing Yu <jingyu@google.com>
3126
3127 * gold.h (textdomain): Add do {} to empty while(0).
3128 (bindtextdomain): Likewise.
3129
fad072ac
CC
31302012-06-04 Cary Coutant <ccoutant@google.com>
3131
3132 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3133 has_dynsym_index.
3134
8cc69fb6
ST
31352012-05-25 Sriraman Tallam <tmsriram@google.com>
3136
3137 * symtab.cc (Symbol_table::define_special_symbol):
3138 Initialize *poldsym to prevent uninitialized variable errors.
3139
1be75daa
CC
31402012-05-23 Cary Coutant <ccoutant@google.com>
3141
3142 * layout.cc (Layout::section_name_mapping): Add rules to handle
3143 exact match on .data.rel.ro.local or .data.rel.ro.
3144 (Layout::output_section_name): Check for exact matches.
3145
9b689de0
CC
31462012-05-23 Cary Coutant <ccoutant@google.com>
3147
3148 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3149 more carefully.
3150
b24fdbf5
CC
31512012-05-22 Cary Coutant <ccoutant@google.com>
3152
3153 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3154 object before exporting symbol.
3155
e550e1a2
L
31562012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3157
3158 * testsuite/tls_test.cc: Include "config.h" first.
3159 * testsuite/tls_test_c.c: Likewise.
3160
df7b86aa
NC
31612012-05-17 Daniel Richard G. <skunk@iskunk.org>
3162 Nick Clifton <nickc@redhat.com>
3163
3164 PR 14072
3165 * configure.in: Add check that sysdep.h has been included before
3166 any system header files.
3167 * configure: Regenerate.
3168 * config.in: Regenerate.
3169
1007b503
CC
31702012-05-14 Cary Coutant <ccoutant@google.com>
3171
3172 * layout.cc (Layout::make_output_section): Mark .tdata section
3173 as RELRO.
3174 * testsuite/relro_test.cc: Add a TLS variable.
3175
fd885f3a
L
31762012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3177
3178 PR gold/14091
3179 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3180 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3181 R_X86_64_64.
3182
80f5885c
CC
31832012-05-08 Cary Coutant <ccoutant@google.com>
3184
3185 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3186 (lines_only_debug_sections): Likewise.
3187
2e702c99
RM
31882012-05-02 Roland McGrath <mcgrathr@google.com>
3189
3190 * nacl.cc: New file.
3191 * nacl.h: New file.
3192 * Makefile.am (CCFILES, HFILES): Add them.
3193 * Makefile.in: Regenerate.
3194 * i386.cc (Output_data_plt_i386_nacl): New class.
3195 (Output_data_plt_i386_nacl_exec): New class.
3196 (Output_data_plt_i386_nacl_dyn): New class.
3197 (Target_i386_nacl): New class.
3198 (Target_selector_i386_nacl): New class.
3199 (target_selector_i386): Use it instead of Target_selector_i386.
3200 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3201 (Target_x86_64_nacl): New class.
3202 (Target_selector_x86_64_nacl): New class.
3203 (target_selector_x86_64, target_selector_x32): Use it instead of
3204 Target_selector_x86_64.
3205 * arm.cc (Output_data_plt_arm_nacl): New class.
3206 (Target_arm_nacl): New class.
3207 (Target_selector_arm_nacl): New class.
3208 (target_selector_arm, target_selector_armbe): Use it instead of
3209 Target_selector_arm.
3210
3211 * target-select.cc (select_target): Take new Input_file* and off_t
3212 arguments, pass them on to recognize method of selector.
3213 * object.cc (make_elf_sized_object): Update caller.
3214 * parameters.cc (parameters_force_valid_target): Likewise.
3215 * incremental.cc (make_sized_incremental_binary): Likewise.
3216 * target-select.h: Update decl.
3217 (Target_selector::recognize): Take new Input_file* argument,
3218 pass it on to do_recognize.
3219 (Target_selector::do_recognize): Take new Input_file* argument.
3220 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3221 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3222 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3223 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3224
3225 * target.h (Target::Target_info): New members isolate_execinstr
3226 and rosegment_gap.
3227 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3228 * arm.cc (Target_arm::arm_info): Update initializer.
3229 * i386.cc (Target_i386::i386_info): Likewise.
3230 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3231 * sparc.cc (Target_sparc::sparc_info): Likewise.
3232 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3233 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3234 * layout.cc (Layout::attach_allocated_section_to_segment):
3235 Take new const Target* argument. If target->isolate_execinstr(), act
3236 like --rosegment.
3237 (Layout::find_first_load_seg): Take new const Target* argument;
3238 if target->isolate_execinstr(), reject PF_X segments.
3239 (Layout::relaxation_loop_body): Update caller.
3240 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3241 reset file offset to zero when we hit LOAD_SEG, and then do a second
3242 loop over the segments before LOAD_SEG to reassign offsets after
3243 addresses have been determined. Handle target->rosegment_gap().
3244 (Layout::attach_section_to_segment): Take new const Target* argument;
3245 pass it to attach_allocated_section_to_segment.
3246 (Layout::make_output_section): Update caller.
3247 (Layout::attach_sections_to_segments): Take new const Target* argument;
3248 pass it to attach_section_to_segment.
3249 * gold.cc (queue_middle_tasks): Update caller.
3250 * layout.h (Layout): Update method decls with new arguments.
3251
3252 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3253 Target_info pointer to use.
3254 (Target_arm::do_make_data_plt): New virtual method.
3255 (Target_arm::make_data_plt): New method that calls it.
3256 (Target_arm::make_plt_entry): Use it.
3257 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3258 for the section alignment.
3259 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3260 method.
3261 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3262 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3263 method.
3264 (Output_data_plt_arm::get_plt_entry_size): Call it.
3265 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3266 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3267 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3268 method.
3269 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3270 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3271 method instead of sizeof(plt_entry).
3272 (Output_data_plt_arm::add_entry): Likewise.
3273 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3274 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3275 than static method.
3276 (Target_arm::plt_entry_size): Likewise.
3277 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3278 Move to ...
3279 (Output_data_plt_arm_standard): ... here, new class.
3280 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3281 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3282 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3283
3284 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3285 Take additional argument for the PLT entry size.
3286 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3287 Use get_plt_entry_size method rather than plt_entry_size variable.
3288 (Output_data_plt_x86_64::reserve_slot): Likewise.
3289 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3290 (Output_data_plt_x86_64::add_entry): Likewise.
3291 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3292 (Output_data_plt_x86_64::address_for_global): Likewise.
3293 (Output_data_plt_x86_64::address_for_local): Likewise.
3294 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3295 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3296 Make method non-static.
3297 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3298 method.
3299 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3300 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3301 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3302 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3303 virtual method.
3304 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3305 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3306 virtual method.
3307 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3308 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3309 virtual method.
3310 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3311 (Output_data_plt_x86_64::plt_entry_size)
3312 (Output_data_plt_x86_64::first_plt_entry)
3313 (Output_data_plt_x86_64::plt_entry)
3314 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3315 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3316 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3317 (Output_data_plt_x86_64_standard): ... here, new class.
3318 (Target_x86_64::Target_x86_64): Take optional argument for the
3319 Target_info pointer to use.
3320 (Target_x86_64::do_make_data_plt): New virtual method.
3321 (Target_x86_64::make_data_plt): New method to call it.
3322 (Target_x86_64::init_got_plt_for_update): Use that.
3323 Call this->plt_->add_eh_frame method here.
3324 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3325 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3326 rather than static method.
3327 (Target_x86_64::plt_entry_size): Likewise.
3328 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3329 rather than plt_entry_size variable. Move guts of PLT filling to...
3330 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3331 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3332 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3333
3334 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3335 additional argument for the section alignment.
3336 Don't do add_eh_frame_for_plt here.
3337 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3338 non-static. Use get_plt_entry_size method rather than plt_entry_size
3339 variable.
3340 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3341 method.
3342 (Output_data_plt_i386::get_plt_entry_size): Call it.
3343 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3344 (Output_data_plt_i386::add_eh_frame): New method to call it.
3345 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3346 method.
3347 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3348 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3349 method.
3350 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3351 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3352 method instead of plt_entry_size.
3353 (Output_data_plt_i386::plt_entry_size)
3354 (Output_data_plt_i386::plt_eh_frame_fde_size)
3355 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3356 (Output_data_plt_i386_standard): ... here, new class.
3357 (Output_data_plt_i386_exec): New class.
3358 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3359 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3360 (Output_data_plt_i386::exec_plt_entry): Move to ...
3361 (Output_data_plt_i386_exec::plt_entry): ... here.
3362 (Output_data_plt_i386_dyn): New class.
3363 (Output_data_plt_i386::first_plt_entry): Move to ...
3364 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3365 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3366 (Output_data_plt_i386_dyn::plt_entry): ... here.
3367 (Target_i386::Target_i386): Take optional argument for the Target_info
3368 pointer to use.
3369 (Target_i386::do_make_data_plt): New virtual method.
3370 (Target_i386::make_data_plt): New method to call it.
3371 (Target_i386::make_plt_section): Use that.
3372 Call this->plt_->add_eh_frame method here.
3373 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3374 rather than plt_entry_size variable.
3375 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3376 (Output_data_plt_i386::address_for_local): Likewise.
3377 (Output_data_plt_i386::do_write): Likewise.
3378 Move guts of PLT filling to...
3379 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3380 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3381 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3382 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3383
b9b9f2ee
CC
33842012-05-01 Cary Coutant <ccoutant@google.com>
3385
3386 * dwarf_reader.cc (Dwarf_die::read_attributes)
3387 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3388 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3389 * reduced_debug_output.cc
3390 (Output_reduced_debug_info_section::get_die_end): Remove
3391 DW_FORM_GNU_ref_index. Add default case.
3392
57923f48
MW
33932012-04-26 Mark Wielaard <mjw@redhat.com>
3394
3395 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3396 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3397 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3398 DW_AT_high_pc as offset from DW_AT_low_pc.
3399
3400 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3401 * testsuite/Makefile.in: Regenerate.
3402 * testsuite/gdb_index_test_3.c: New test source file.
3403 * testsuite/gdb_index_test_3.sh: New test source file.
3404
2c54b4f4
ILT
34052012-04-25 Ian Lance Taylor <iant@google.com>
3406
3407 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3408 pointer.
3409 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3410 as a class, not a struct.
3411 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3412 (Target_arm::apply_cortex_a8_workaround): Likewise.
3413 * gc.h: Declare Reloc_types as a struct, not a class.
3414 * object.h: Declare Symbols_data as a struct.
3415 * reloc.h: Declare Read_relocs_data as a struct.
3416 * target.h: Declare Relocate_info as a struct.
3417
a5a5f7a3
DM
34182012-04-24 David S. Miller <davem@davemloft.net>
3419
3420 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3421 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3422 and R_SPARC_WPLT30.
3423
f038d496
CC
34242012-04-24 Cary Coutant <ccoutant@google.com>
3425
3426 * incremental-dump.cc (find_input_containing_global): Replace
3427 magic number with symbolic constant.
3428 (dump_incremental_inputs): Update version number.
3429 * incremental.cc (Output_section_incremental_inputs): Update version
3430 number; import symbolic constants from Incremental_inputs_reader.
3431 (Incremental_inputs::create_data_sections): Align relocations
3432 section correctly for 64-bit targets.
3433 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3434 constants; add padding.
3435 (Output_section_incremental_inputs::write_header): Add assert for
3436 header_size.
3437 (Output_section_incremental_inputs::write_input_files): Add assert
3438 for input_entry_size.
3439 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3440 add assert for object_info_size, input_section_entry_size,
3441 global_sym_entry_size.
3442 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3443 for data structure sizes; use them.
3444 (Incremental_input_entry_reader): Import symbolic constants from
3445 Incremental_inputs_reader; use them.
3446
a4d85145
DM
34472012-04-23 David S. Miller <davem@davemloft.net>
3448
3449 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3450 and elf_flags_set_.
3451 (Target_sparc::Target_sparc): Initialize new fields.
3452 (Target_sparc::do_make_elf_object): New function.
3453 (Target_sparc::do_adjust_elf_header): New function.
3454
1d509098
CC
34552012-04-23 Cary Coutant <ccoutant@google.com>
3456
3457 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3458 CU range table of gdb index.
3459
7ebeff7f
DM
34602012-04-20 David S. Miller <davem@davemloft.net>
3461
3462 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3463 instead of false.
3464
13cf9988
DM
34652012-04-16 David S. Miller <davem@davemloft.net>
3466
2a1079e8
DM
3467 * sparc.cc (Target_sparc::got_address): New function.
3468 (Sparc_relocate_functions::gdop_hix22): New function.
3469 (Sparc_relocate_functions::gdop_lox10): New function.
3470 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3471 relocs.
3472 (Target_sparc::Scan::local): Likewise if the global symbol is not
3473 preemptible and is not IFUNC.
3474 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3475 transformations for local and non-preemptible non-IFUNC global
3476 symbols.
3477
0bc964fc
DM
3478 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3479 writing out 64-bit part of ranges.
3480
661d7a80
DM
3481 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3482 -fpic and -fpie respectively.
3483 * Makefile.in: Regenerate.
3484
8c2bf391
DM
3485 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3486 (Target_sparc::Target_sparc): Initialize new field.
3487 (Target_sparc::do_plt_section_for_global): New function.
3488 (Target_sparc::do_plt_section_for_local): New function.
3489 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3490 (Target_sparc::make_plt_section): New function, broken out of
3491 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3492 (Target_sparc::make_plt_entry): Call make_plt_section.
3493 (Target_sparc::make_local_ifunc_plt_entry): New function.
3494 (Target_sparc::rela_ifunc_section): New function.
3495 (Target_sparc::plt_section): Remove const.
3496 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3497 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3498 and ifunc_count_ fields.
3499 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3500 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3501 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3502 (Output_data_plt_sparc::rela_ifunc): New function.
3503 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3504 (Output_data_plt_sparc::has_ifunc_section): New function.
3505 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3506 (Output_data_plt_sparc::address_for_global): New function.
3507 (Output_data_plt_sparc::address_for_local): New function.
3508 (Output_data_plt_sparc::plt_index_to_offset): New function.
3509 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3510 and entry_count.
3511 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3512 entry_count.
3513 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3514 R_SPARC_JMP_IREL to switch.
3515 (Target_sparc::Scan::check_non_pic): Likewise.
3516 (Target_sparc::Scan::local): Handle IFUNC symbols.
3517 (Target_sparc::Scan::local): Likewise.
3518 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3519 and plt_address_for_local.
3520 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3521 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3522
13cf9988
DM
3523 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3524 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3525 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3526 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3527 global relocs too.
3528 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3529 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3530 calls.
3531 * sparc.cc (Target_sparc::Scan::global): Likewise.
3532 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3533
31821be0
CC
35342012-04-16 Cary Coutant <ccoutant@google.com>
3535
3536 * archive.cc (Library_base::should_include_member): Check for
3537 --export-dynamic-symbol.
3538 * options.h (class General_options): Add --export-dynamic-symbol.
3539 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3540 --export-dynamic-symbol.
3541 (Symbol_table::gc_mark_undef_symbols): Likewise.
3542 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3543
2615994e
DM
35442012-04-12 David S. Miller <davem@davemloft.net>
3545
3546 * sparc.cc (Reloc::wdisp10): New relocation method.
3547 (Reloc::h34): Likewise.
3548 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3549 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3550 R_SPARC_WDISP10.
3551 (Target_sparc::Scan::local): Likewise.
3552 (Target_sparc::Scan::global): Likewise.
3553 (Target_sparc::Relocate::relocate): Likewise.
3554
6782735d
CC
35552012-04-09 Cary Coutant <ccoutant@google.com>
3556
3557 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3558 low_pc == 0.
3559
8c7a0b00
ILT
35602012-04-06 Ian Lance Taylor <iant@google.com>
3561
3562 * timer.cc: #include <unistd.h>.
3563
58797674
RM
35642012-04-06 Roland McGrath <mcgrathr@google.com>
3565
3566 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3567 * config.in: Regenerate.
3568 * configure: Regenerate.
3569
44350750
NC
35702012-04-05 Nick Clifton <nickc@redhat.com>
3571
3572 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3573 (AM_LC_MESSAGES): Add.
3574 * aclocal.m4: Regenerate.
3575 * config.in: Regenerate.
3576 * configure: Regenerate.
3577
c1027032
CC
35782012-03-21 Cary Coutant <ccoutant@google.com>
3579
3580 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3581 * Makefile.in: Regenerate.
3582 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3583 (Sized_elf_reloc_mapper::symbol_section): New function.
3584 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3585 (make_elf_reloc_mapper): New function.
3586 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3587 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3588 (Dwarf_abbrev_table::do_get_abbrev): New function.
3589 (Dwarf_ranges_table::read_ranges_table): New function.
3590 (Dwarf_ranges_table::read_range_list): New function.
3591 (Dwarf_pubnames_table::read_section): New function.
3592 (Dwarf_pubnames_table::read_header): New function.
3593 (Dwarf_pubnames_table::next_name): New function.
3594 (Dwarf_die::Dwarf_die): New function.
3595 (Dwarf_die::read_attributes): New function.
3596 (Dwarf_die::skip_attributes): New function.
3597 (Dwarf_die::set_name): New function.
3598 (Dwarf_die::set_linkage_name): New function.
3599 (Dwarf_die::attribute): New function.
3600 (Dwarf_die::string_attribute): New function.
3601 (Dwarf_die::int_attribute): New function.
3602 (Dwarf_die::uint_attribute): New function.
3603 (Dwarf_die::ref_attribute): New function.
3604 (Dwarf_die::child_offset): New function.
3605 (Dwarf_die::sibling_offset): New function.
3606 (Dwarf_info_reader::check_buffer): New function.
3607 (Dwarf_info_reader::parse): New function.
3608 (Dwarf_info_reader::do_parse): New function.
3609 (Dwarf_info_reader::do_read_string_table): New function.
3610 (Dwarf_info_reader::lookup_reloc): New function.
3611 (Dwarf_info_reader::get_string): New function.
3612 (Dwarf_info_reader::visit_compilation_unit): New function.
3613 (Dwarf_info_reader::visit_type_unit): New function.
3614 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3615 Sized_elf_reloc_mapper.
3616 (Sized_dwarf_line_info::symbol_section): Remove function.
3617 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3618 (Sized_dwarf_line_info::read_line_mappings): Remove object
3619 parameter, adjust callers.
3620 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3621 * dwarf_reader.h: Include <sys/types.h>.
3622 (class Track_relocs): Remove forward declaration.
3623 (class Elf_reloc_mapper): New class.
3624 (class Sized_elf_reloc_mapper): New class.
3625 (class Dwarf_abbrev_table): New class.
3626 (class Dwarf_range_list): New class.
3627 (class Dwarf_ranges_table): New class.
3628 (class Dwarf_pubnames_table): New class.
3629 (class Dwarf_die): New class.
3630 (class Dwarf_info_reader): New class.
3631 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3632 (Sized_dwarf_line_info::symbol_section): Remove member function.
3633 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3634 base class.
3635 * gdb-index.cc: New source file.
3636 * gdb-index.h: New source file.
3637 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3638 and .debug_types sections, call Layout::add_to_gdb_index.
3639 (Sized_relobj_incr::do_section_name): Implement.
3640 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3641 return type; Implement.
3642 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3643 return type.
3644 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3645 parameter list and return type.
3646 (Sized_incr_dynobj::do_section_contents): Likewise.
3647 * layout.cc: Include gdb-index.h.
3648 (Layout::Layout): Initialize gdb_index_data_.
3649 (Layout::init_fixed_output_section): Check for .gdb_index section.
3650 (Layout::add_to_gdb_index): New function. Instantiate.
3651 * layout.h: Add forward declaration for class Gdb_index.
3652 (Layout::add_to_gdb_index): New member function.
3653 (Layout::gdb_index_data_): New data member.
3654 * main.cc: Include gdb-index.h.
3655 (main): Print statistics for gdb index.
3656 * object.cc (Object::section_contents): Move code into
3657 do_section_contents.
3658 (need_decompressed_section): Check for sections needed when building
3659 gdb index.
3660 (build_compressed_section_map): Likewise.
3661 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3662 gdb index.
3663 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3664 sections; call Layout::add_to_gdb_index.
3665 (Sized_relobj_file::do_decompressed_section_contents): Call
3666 do_section_contents directly.
3667 * object.h (Object::do_section_contents): Adjust parameter list and
3668 return type.
3669 (Object::do_decompressed_section_contents): Call do_section_contents
3670 directly.
3671 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3672 return type.
3673 * options.h (class General_options): Add --gdb-index option.
3674 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3675 list and return type.
3676 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3677 * reloc.h (Track_relocs::checkpoint): New function.
3678 (Track_relocs::reset): New function.
3679
3680 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3681 New test cases.
3682 * testsuite/Makefile.in: Regenerate.
3683 * testsuite/gdb_index_test.cc: New test source file.
3684 * testsuite/gdb_index_test_1.sh: New test source file.
3685 * testsuite/gdb_index_test_2.sh: New test source file.
3686
647f1574
DK
36872012-03-19 Doug Kwan <dougkwan@google.com>
3688
3689 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3690 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3691 __exidx_start and __exidx_end. Make symbol table parameter
3692 anonymous as it is not used.
3693 * gold.cc (queue_middle_tasks): Call target hook to define any
3694 target-specific symbols.
3695 * target.h (Target::define_standard_symbols): New method.
3696 (Target::do_define_standard_symbols): Same.
3697 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3698 * testsuite/Makefile.in: Regenerate.
3699 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3700 and __exidx_end.
3701 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3702 relocations are generated for __exidx_start and __exidx_end.
3703
7c6109da
DK
37042012-03-16 Doug Kwan <dougkwan@google.com>
3705
3706 * testsuite/Makefile.am: Disable test initpri3b.
3707 * testsuite/Makefile.in: Regenerate.
3708
7b8957f8
DK
37092012-03-15 Doug Kwan <dougkwan@google.com>
3710
3711 * arm.cc (Target_arm::got_section): Make .got section read-only
3712 if -z now is given.
3713
14dc9ef7
ILT
37142012-03-15 Ian Lance Taylor <iant@google.com>
3715
3716 PR gold/13850
3717 * layout.cc (Layout::make_output_section): Correctly mark
3718 SHT_INIT_ARRAY, et. al., as relro.
3719
fa40b62a
DK
37202012-03-14 Doug Kwan <dougkwan@google.com>
3721
3722 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3723 dynamic relocations for protected symbols in shared objects.
3724
fd325007
ILT
37252012-03-13 Ian Lance Taylor <iant@google.com>
3726
3727 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3728 keep the larger alignment.
3729
e8dd54e1
CC
37302012-03-12 Cary Coutant <ccoutant@google.com>
3731
3732 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3733 handling of DW_LNE_define_file.
3734
feb5f3b0
CC
37352012-03-12 Cary Coutant <ccoutant@google.com>
3736
3737 * reduced_debug_output.cc
3738 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3739 codes to switch.
3740
a1fb4256
CC
37412012-02-29 Cary Coutant <ccoutant@google.com>
3742
3743 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3744
5dd8762a
CC
37452012-02-29 Cary Coutant <ccoutant@google.com>
3746
3747 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3748 Call Object::decompressed_section_contents.
3749 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3750 New dtor.
3751 (Sized_dwarf_line_info::buffer_start_): New data member.
3752 * merge.cc (Output_merge_data::do_add_input_section): Call
3753 Object::decompressed_section_contents.
3754 (Output_merge_string::do_add_input_section): Likewise.
3755 * object.cc (need_decompressed_section): New function.
3756 (build_compressed_section_map): Decompress sections needed later.
3757 (Sized_relobj_file::do_decompressed_section_contents): New function.
3758 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3759 * object.h (Object::decompressed_section_contents): New function.
3760 (Object::discard_decompressed_sections): New function.
3761 (Object::do_decompressed_section_contents): New function.
3762 (Object::do_discard_decompressed_sections): New function.
3763 (Compressed_section_info): New type.
3764 (Compressed_section_map): Include decompressed section contents.
3765 (Sized_relobj_file::do_decompressed_section_contents): New function.
3766 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3767
7b5de7ee
CC
37682012-02-16 Cary Coutant <ccoutant@google.com>
3769
3770 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3771 * testsuite/Makefile.in: Regenerate.
3772
f9fa4a63
CC
37732012-02-14 Cary Coutant <ccoutant@google.com>
3774
3775 * options.cc (General_options::finalize): Disallow -pie and -static.
3776
2c175ebc
DK
37772012-02-03 Doug Kwan <dougkwan@google.com>
3778
3779 * arm.cc (Arm_relocate_functions::abs8,
3780 Arm_relocate_functions::abs16): Use
3781 Bits::has_signed_unsigned_overflow32.
3782 (Arm_relocate_functions::thm_abs8): Correct range of
3783 overflow check.
3784 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3785 in assertions.
3786
90cff06f
DK
37872012-02-02 Doug Kwan <dougkwan@google.com>
3788
3789 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3790 position independent outputs, not just shared objects.
3791
63887f3d
L
37922012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3793
3794 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3795 * configure: Regenerated.
3796
bef2b434
ILT
37972012-01-27 Ian Lance Taylor <iant@google.com>
3798
3799 * reloc.h (Bits): New class with static functions, copied from
3800 namespace utils in arm.cc.
3801 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3802 instead.
3803
c335b55d
L
38042012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3805
3806 * incremental.cc (write_info_blocks): Correct relocation offset.
3807
41194d9f
L
38082012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3809
3810 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3811 (Relocate::tls_gd_to_le): Likewise.
3812
1bae613c
L
38132012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3814
3815 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3816
24482ca0
L
38172012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3818
3819 * configure.ac: Check if -mcmodel=medium works.
3820 * configure: Regenerated.
3821
c2c7840a
CC
38222012-01-24 Cary Coutant <ccoutant@google.com>
3823
3824 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3825 definition and ...
3826 (read_unsigned_LEB_128_x): ... this new function.
3827 (read_signed_LEB_128): Replaced with inline definition and ...
3828 (read_signed_LEB_128_x): ... this new function.
3829 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3830 (read_unsigned_LEB_128): Add inline definition.
3831 (read_signed_LEB_128_x): New function.
3832 (read_signed_LEB_128): Add inline definition.
3833 * testsuite/Makefile.am (leb128_unittest): New unit test.
3834 * testsuite/Makefile.in: Regenerate.
3835 * testsuite/leb128_unittest.cc: New unit test.
3836
833de760 38372012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3838
3839 PR gold/13617
3840 * i386.cc (Target_i386::do_code_fill): When using a jmp
3841 instruction, pad with nop instructions.
3842 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3843
618d6666
L
38442012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3845
3846 * x86_64.cc (gc_process_relocs): Add typename on types used in
3847 template.
3848 (scan_relocs): Likewise.
3849 (relocate_section): Likewise.
3850 (apply_relocation): Likewise.
3851
3660ff06
L
38522012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3853
3854 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3855 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3856 under x32.
3857
fc51264f
L
38582012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3859
3860 * x86_64.cc: Initial support for x32.
3861
dd74ae06
CC
38622012-01-03 Cary Coutant <ccoutant@google.com>
3863
3864 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3865 Use abstract base class for GOT.
3866 * gold/output.h (class Output_data_got_base): New abstract base class.
3867 (class Output_data_got): Derive from new base class, adjust ctors.
3868 (Output_data_got::reserve_slot): Make virtual; rename to
3869 do_reserve_slot; Adjust callers.
3870 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3871 pointer to abstract base class.
3872 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3873
83896202
ILT
38742011-12-18 Ian Lance Taylor <iant@google.com>
3875
3876 * object.h (Relobj::local_symbol_value): New function.
3877 (Relobj::local_plt_offset): New function.
3878 (Relobj::local_has_got_offset): New function.
3879 (Relobj::local_got_offset): New function.
3880 (Relobj::set_local_got_offset): New function.
3881 (Relobj::do_local_symbol_value): New pure virtual function.
3882 (Relobj::do_local_plt_offset): Likewise.
3883 (Relobj::do_local_has_got_offset): Likewise.
3884 (Relobj::do_local_got_offset): Likewise.
3885 (Relobj::do_set_local_got_offset): Likewise.
3886 (Sized_relobj::do_local_has_got_offset): Rename from
3887 local_has_got_offset.
3888 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3889 (Sized_relobj::do_set_local_got_offset): Rename from
3890 set_local_got_offset.
3891 (Sized_relobj_file::do_local_plt_offset): Rename from
3892 local_plt_offset.
3893 (Sized_relobj_file::do_local_symbol_value): New function.
3894 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3895 local_plt_offset.
3896 * output.cc (Output_data_got::Got_entry::write): Change object to
3897 Relobj. Use local_symbol_value.
3898 (Output_data_got::add_global_with_rel): Change rel_dyn to
3899 Output_data_reloc_generic*. Use add_global_generic.
3900 (Output_data_got::add_global_with_rela): Remove. Change all
3901 callers to use add_global_with_rel.
3902 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3903 Output_data_reloc_generic*. Use add_global_generic.
3904 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3905 callers to use add_global_pair_with_rel.
3906 (Output_data_got::add_local): Change object to Relobj*.
3907 (Output_data_got::add_local_plt): Likewise.
3908 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3909 change rel_dyn to Output_data_reloc_generic*. Use
3910 add_local_generic.
3911 (Output_data_got::add_local_with_rela): Remove. Change all
3912 callers to use all_local_with_rel.
3913 (Output_data_got::add_local_pair_with_rel): Change object to
3914 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3915 add_output_section_generic.
3916 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3917 callers to use add_local_pair_with_rel.
3918 (Output_data_got::reserve_local): Change object to Relobj*.
3919 * output.h: (class Output_data_reloc_generic): Add pure virtual
3920 declarations for add_global_generic, add_local_generic,
3921 add_output_section_generic.
3922 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3923 functions for Output_data_reloc_generic. Update declarations for
3924 changes listed in output.cc.
3925 (class Output_data_got): Change template parameter to got_size.
3926 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3927 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3928 function.
3929 (Sized_relobj_incr::do_local_plt_offset): New function.
3930 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3931 add_global_generic.
3932
76677ad0
CC
39332011-12-17 Cary Coutant <ccoutant@google.com>
3934
3935 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3936 * resolve.cc (Symbol_table::resolve): Likewise.
3937 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3938 arrays.
3939 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3940
8b8dd8d5
ILT
39412011-12-16 Ian Lance Taylor <iant@google.com>
3942
3943 * output.h (Output_data_reloc_generic::add): Only call
3944 add_dynamic_reloc if this is a dynamic reloc section.
3945
d55525b9
L
39462011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3947
3948 PR gold/13505
3949 * target-reloc.h (apply_relocation): Replace <64, false> with
3950 <size, big_endian>.
3951
ff81c7c1
NC
39522011-11-25 Nick Clifton <nickc@redhat.com>
3953
3954 * po/it.po: New Italian translation.
3955
628f39be
SA
39562011-11-17 Sterling Augustine <saugustine@google.com>
3957
3958 * script.cc (script_include_directive): Implement.
3959 (read_script_file): New local variables name and search_path. Update
3960 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3961 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3962 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3963
98ef3ea4
SA
39642011-11-11 Sterling Augustine <saugustine@google.com>
3965
3966 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3967 (file_or_sections_cmd): Likewise.
3968
f4a8b6d7
DK
39692011-11-11 Doug Kwan <dougkwan@google.com>
3970
3971 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3972 if --just-symbols is given.
3973
29ab395d
DK
39742011-11-10 Doug Kwan <dougkwan@google.com>
3975
3976 PR gold/13362
3977 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3978 when processing data relocs.
3979 * reloc.h (Relocate_functions::rel_unaligned): New method.
3980 (Relocate_functions::pcrel_unaligned): Ditto.
3981 (Relocate_functions::rel32_unaligned): Ditto.
3982 (Relocate_functions::pcrel32_unaligned): Ditto.
3983
2c339f71
DK
39842011-11-09 Doug Kwan <dougkwan@google.com>
3985
3986 PR gold/13362
3987 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3988 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3989 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3990 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3991 (Relocate_functions::rel_unaligned): New.
3992 (Relocate_functions::rel32_unaligned): New.
3993 * target-reloc.h (relocate_for_relocatable): Add code to handle
3994 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3995 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3996 arm_unaligned_reloc_r): New targets.
3997 * testsuite/Makefile.in: Regenerate.
3998 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3999 linking.
4000
3f3cddf1
ILT
40012011-11-02 Ian Lance Taylor <iant@google.com>
4002
4003 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4004 NATIVE_LINKER.
4005 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4006 * options.cc (General_options::finalize): Use library search path
4007 from configure script if specified. If not native and no sysroot,
4008 only search TOOLLIBDIR.
4009 * options.h (Search_directory::Search_directory): Change name to
4010 const std::string&.
4011 (General_options::add_to_library_path_with_sysroot): Change arg to
4012 const std::string&.
4013 * configure, Makefile.in, config.in: Rebuild.
4014
a8e2273b
ILT
40152011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4016
4017 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4018 we are working around the ARM1176 Erratum.
4019 * options.h (General_options::fix_arm1176): Add option.
4020 * testsuite/Makefile.am: Add testcases, and keep current ones
4021 working.
4022 * testsuite/Makefile.in: Regenerate.
4023 * testsuite/arm_fix_1176.s: New file.
4024 * testsuite/arm_fix_1176.sh: Likewise.
4025
cd6eab1c
ILT
40262011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4027
4028 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4029 may_use_blx_.
4030 (Target_arm::may_use_blx): Remove method.
4031 (Target_arm::set_may_use_blx): Likewise.
4032 (Target_arm::may_use_v4t_interworking): New method.
4033 (Target_arm::may_use_v5t_interworking): Likewise.
4034 (Target_arm::may_use_blx_): Remove member variable.
4035 (Arm_relocate_functions::arm_branch_common): Check for v5T
4036 interworking.
4037 (Arm_relocate_functions::thumb_branch_common): Likewise.
4038 (Reloc_stub::stub_type_for_reloc): Likewise.
4039 (Target_arm::do_finalize_sections): Correct interworking checks.
4040 * testsuite/Makefile.am: Add new tests.
4041 * testsuite/Makefile.in: Regenerate.
4042 * testsuite/arm_farcall_arm_arm.s: New test.
4043 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4044 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4045 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4046 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4047 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4048 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4049 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4050
286adcf4
CC
40512011-10-31 Cary Coutant <ccoutant@google.com>
4052
4053 PR gold/13023
4054 * expression.cc (Expression::eval_with_dot): Add
4055 is_section_dot_assignment parameter.
4056 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4057 absolute and assigning to dot within a section.
4058 * script-sections.cc
4059 (Output_section_element_assignment::set_section_addresses): Pass
4060 dot_section to set_if_absolute.
4061 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4062 as is_section_dot_assignment flag to eval_with_dot.
4063 (Output_section_element_dot_assignment::set_section_addresses):
4064 Likewise.
4065 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4066 parameter. Also set value if relative to dot_section; set the
4067 symbol's output_section.
4068 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4069 parameter. Adjust all callers.
4070 (Expression::eval_maybe_dot): Likewise.
4071 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4072 Adjust all callers.
4073 * testsuite/script_test_2.t: Test assignment of an absolute value
4074 to dot within an output section element.
4075
9634ed06
CC
40762011-10-31 Cary Coutant <ccoutant@google.com>
4077
4078 * options.h (class General_options): Add --[no-]gnu-unique options.
4079 * symtab.cc (Symbol_table::sized_write_globals): Convert
4080 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4081
de4101c7
CC
40822011-10-31 Cary Coutant <ccoutant@google.com>
4083
4084 PR gold/13359
4085 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4086 unnecessary assertion.
4087 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4088
7257cc92
ST
40892011-10-31 Sriraman Tallam <tmsriram@google.com>
4090
4091 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4092 gc_mark_symbol.
4093 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4094 gc_mark_symbol.
4095 Change to just keep the section associated with symbol.
4096 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4097 they are externally visible and --export-dynamic is turned on.
4098 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4099
bfc34b3f
ILT
41002011-10-19 Ian Lance Taylor <iant@google.com>
4101
4102 PR gold/13163
4103 * script-sections.cc
4104 (Output_section_element_dot_assignment::needs_output_section): New
4105 function.
4106
ea0d8c47
ILT
41072011-10-19 Ian Lance Taylor <iant@google.com>
4108
4109 PR gold/13204
4110 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4111 --section-start option was seen.
4112 * options.h (General_options::any_section_start): New function.
4113
abd242a9
DM
41142011-10-18 David S. Miller <davem@davemloft.net>
4115
4116 PR binutils/13301
4117 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4118 member to track relocation locations that have moved during TLS
4119 reloc optimizations.
4120 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4121 (Target_sparc::Relocate::relocate): Adjust view down by 4
4122 bytes if it matches reloc_adjust_addr_.
4123 (Target_sparc::Relocate::relocate_tls): Always move the
4124 __tls_get_addr call delay slot instruction forward 4 bytes when
4125 performing relaxation.
4126
bab9090f
CC
41272011-10-18 Cary Coutant <ccoutant@google.com>
4128
4129 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4130 (Output_file::map_no_anonymous): Check for non-zero
4131 return code from posix_fallocate.
4132
f7c5b166
CC
41332011-10-17 Cary Coutant <ccoutant@google.com>
4134
4135 PR gold/13245
4136 * plugin.cc (is_visible_from_outside): Check for symbols
4137 referenced from dynamic objects.
4138 * resolve.cc (Symbol_table::resolve): Don't count references
4139 from dynamic objects as references from real ELF files.
4140 * testsuite/plugin_test_2.sh: Adjust expected result.
4141
b490c0bb
CC
41422011-10-17 Cary Coutant <ccoutant@google.com>
4143
4144 * gold.cc: Include timer.h.
4145 (queue_middle_tasks): Stamp time.
4146 (queue_final_tasks): Likewise.
4147 * main.cc (main): Store timer in parameters. Print timers
4148 for each pass.
4149 * parameters.cc (Parameters::Parameters): Initialize timer_.
4150 (Parameters::set_timer): New function.
4151 (set_parameters_timer): New function.
4152 * parameters.h (Parameters::set_timer): New function.
4153 (Parameters::timer): New function.
4154 (Parameters::timer_): New data member.
4155 (set_parameters_timer): New function.
4156 * timer.cc (Timer::stamp): New function.
4157 (Timer::get_pass_time): New function.
4158 * timer.h (Timer::stamp): New function.
4159 (Timer::get_pass_time): New function.
4160 (Timer::pass_times_): New data member.
4161
f475cf7b
CC
41622011-10-17 Cary Coutant <ccoutant@google.com>
4163
4164 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4165 task for members of lib groups.
4166
cdd7e244
CC
41672011-10-17 Cary Coutant <ccoutant@google.com>
4168
4169 PR gold/13288
4f95c8b4 4170 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4171 (File_read::make_view): Move bounds check (replace with assert)...
4172 (File_read::find_or_make_view): ... to here.
4173
dfb45471
CC
41742011-10-12 Cary Coutant <ccoutant@google.com>
4175
4f95c8b4 4176 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4177 ::read returns less than requested size.
4178
53bbcc1b
CC
41792011-10-10 Cary Coutant <ccoutant@google.com>
4180
4f95c8b4 4181 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4182 Initialize defined_count_.
4183 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4184 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4185 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4186 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4187 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4188 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4189 member.
4190 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4191 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4192 Return zeroes instead of internal error.
4193
397b129b
CC
41942011-10-10 Cary Coutant <ccoutant@google.com>
4195
4196 PR gold/13249
4f95c8b4 4197 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4198 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4199 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4200 (Output_reloc::type_): Adjust size of bit field.
4201 (Output_reloc::use_plt_offset_): New bit field.
4202 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4203 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4204 flag. Adjust all callers.
4f95c8b4 4205 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4206 creating RELATIVE relocations.
4207
d5698657
NC
42082011-10-10 Nick Clifton <nickc@redhat.com>
4209
4210 * po/es.po: Updated Spanish translation.
4211 * po/fi.po: Updated Finnish translation.
4212
6a59a5c2
DN
42132011-10-03 Diego Novillo <dnovillo@google.com>
4214
4215 * options.cc (parse_uint): Fix dereference of RETVAL.
4216
f0558624
ST
42172011-09-29 Sriraman Tallam <tmsriram@google.com>
4218
4219 * layout.h (section_order_map_): New member.
4220 (get_section_order_map): New member function.
4221 * output.cc (Output_section::add_input_section): Check for patterns
4222 only when --section-ordering-file is specified.
4223 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4224 output_sections have been formed.
4225 * layout.cc (Layout_Layout): Initialize section_order_map_.
4226 * plugin.cc (update_section_order): Store order in order_map. Do not
4227 update the order.
4228 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4229 * testsuite/Makefile.in: Regenerate.
4230 * testsuite/plugin_section_order.c: New file.
4231 * testsuite/plugin_final_layout.cc: New file.
4232 * testsuite/plugin_final_layout.sh: New file.
4233
a7dac153
CC
42342011-09-29 Cary Coutant <ccoutant@google.com>
4235
4f95c8b4 4236 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4237 Check for NULL.
4f95c8b4 4238 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4239 symbols during incremental update.
4240 (Symbol_table::add_from_dynobj): Likewise.
4241
eebd87a5
ILT
42422011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4243 Ian Lance Taylor <iant@google.com>
4244
4245 * symtab.cc (Symbol_table::define_special_symbol): Always
4246 canonicalize version string.
4247
403a3331
CC
42482011-09-26 Cary Coutant <ccoutant@google.com>
4249
4f95c8b4
CC
4250 * gold.cc (queue_initial_tasks): Move option checks ...
4251 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4252 some options; make others fatal.
4253
235061c2
CC
42542011-09-26 Cary Coutant <ccoutant@google.com>
4255
4256 gcc PR lto/47247
4257 * plugin.cc (get_symbols_v2): New function.
4258 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4259 (is_referenced_from_outside): New function.
4260 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4261 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4262 (get_symbols): Pass version parameter.
4263 (get_symbols_v2): New function.
4264 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4265 parameter.
4266 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4267 (onload): Add LDPT_GET_SYMBOLS_V2.
4268 (all_symbols_read_hook): Use get_symbols_v2; check for
4269 LDPR_PREVAILING_DEF_IRONLY_EXP.
4270 * testsuite/plugin_test_3.sh: Update expected results.
4271
dc87f620
ILT
42722011-09-23 Simon Baldwin <simonb@google.com>
4273
4274 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4275 configuration options.
4276 * configure: Regenerate.
4277 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4278 * Makefile.in: Regenerate.
4279 * testsuite/Makefile.in: Regenerate.
4280
a8279f82
ST
42812011-09-19 Sriraman Tallam <tmsriram@google.com>
4282
4283 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4284
0c9350c8
CC
42852011-09-19 Cary Coutant <ccoutant@google.com>
4286
4287 * incremental.cc (can_incremental_update): Fix typo in comment.
4288 * incremental.h (can_incremental_update): Likewise.
4289
aa06ae28
CC
42902011-09-18 Cary Coutant <ccoutant@google.com>
4291
4292 * incremental.cc (can_incremental_update): New function.
4293 * incremental.h (can_incremental_update): New function.
4294 * layout.cc (Layout::init_fixed_output_section): Call it.
4295 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4296 * object.cc (Sized_relobj_file::do_layout): Call
4297 can_incremental_update.
4298
ebb300b2
CC
42992011-09-13 Cary Coutant <ccoutant@google.com>
4300
4301 * configure.ac: Check for glibc support for gnu_indirect_function
4302 support with static linking, setting automake conditional
4303 IFUNC_STATIC.
4304 * Makefile.in: Regenerate.
4305 * configure: Regenerate.
4306
4307 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4308 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4309 for IFUNC_STATIC.
4310 * testsuite/Makefile.in: Regenerate.
4311
1206d0d5
CC
43122011-09-13 Cary Coutant <ccoutant@google.com>
4313
4314 * incremental.cc (Sized_relobj_incr::do_layout): Call
4315 report_comdat_group for kept comdat sections.
4316 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4317 * testsuite/Makefile.in: Regenerate.
4318 * testsuite/incr_comdat_test_1.cc: New source file.
4319 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4320 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4321 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4322
40b29874
ILT
43232011-09-13 Ian Lance Taylor <iant@google.com>
4324
4325 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4326 variable external_symbols_offset.
4327
1b045aac
ILT
43282011-09-12 Ian Lance Taylor <iant@google.com>
4329
4330 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4331 triggered if object has no symbols.
4332
24c6c55a
DM
43332011-09-09 David S. Miller <davem@davemloft.net>
4334
4335 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4336 (Output_fill_debug_line::do_write): Likewise.
4337
66570254
CC
43382011-08-29 Cary Coutant <ccoutant@google.com>
4339
4340 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4341 casts to match formatting specs.
4342 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4343
8ea8cd50
CC
43442011-08-26 Cary Coutant <ccoutant@google.com>
4345
4346 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4347 remaining hole size when allocating.
4348 (Layout::make_output_section): Set fill methods for debug sections.
4349 * layout.h (Free_list::Free_list_node): Move from private to
4350 public.
4351 (Free_list::set_min_hole_size): New function.
4352 (Free_list::begin, Free_list::end): New functions.
4353 (Free_list::min_hole_): New data member.
4354 * output.cc: Include dwarf.h.
4355 (Output_fill_debug_info::do_minimum_hole_size): New function.
4356 (Output_fill_debug_info::do_write): New function.
4357 (Output_fill_debug_line::do_minimum_hole_size): New function.
4358 (Output_fill_debug_line::do_write): New function.
4359 (Output_section::Output_section): Initialize new data member.
4360 (Output_section::set_final_data_size): Ensure patch space is larger
4361 than minimum hole size.
4362 (Output_section::do_write): Fill holes in debug sections.
4363 * output.h (Output_fill): New class.
4364 (Output_fill_debug_info): New class.
4365 (Output_fill_debug_line): New class.
4366 (Output_section::set_free_space_fill): New function.
4367 (Output_section::free_space_fill_): New data member.
4368 * testsuite/Makefile.am (incremental_test_3): Add
4369 --incremental-patch option.
4370 (incremental_test_4): Likewise.
4371 (incremental_test_5): Likewise.
4372 (incremental_test_6): Likewise.
4373 (incremental_copy_test): Likewise.
4374 (incremental_common_test_1): Likewise.
4375 * testsuite/Makefile.in: Regenerate.
4376
7cf80422
NC
43772011-08-26 Nick Clifton <nickc@redhat.com>
4378
4379 * po/es.po: Updated Spanish translation.
4380
c3f7b0e5
CC
43812011-08-01 Cary Coutant <ccoutant@google.com>
4382
4383 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4384 * gold/testsuite/Makefile.in: Regenerate.
4385 * gold/testsuite/justsyms_exec.c: New source file.
4386 * gold/testsuite/justsyms_lib.c: New source file.
4387
9590bf25
CC
43882011-08-01 Cary Coutant <ccoutant@google.com>
4389
4390 * layout.cc (Layout::set_segment_offsets): Don't realign text
4391 segment if -Ttext was specified.
4392 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4393 file type.
4394 * object.h (Sized_relobj_file::e_type): New function.
4395 (Sized_relobj_file::e_type_): New data member.
4396 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4397 base address for ET_EXEC files.
4398 * target.cc (Target::do_make_elf_object_implementation): Allow
4399 ET_EXEC files with --just-symbols option.
4400
dcd8d12e
CC
44012011-07-28 Cary Coutant <ccoutant@google.com>
4402
4403 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4404 Add thread_number parameter.
4405 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4406 * workqueue-threads.cc
4407 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4408 current thread if its thread number is greater than desired thread
4409 count.
4410 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4411 Add thread_number parameter.
4412 (Workqueue::should_cancel_thread): Likewise.
4413 (Workqueue::find_runnable_or_wait): Pass thread_number to
4414 should_cancel_thread.
4415 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4416 parameter.
4417
804eb480
ST
44182011-07-22 Sriraman Tallam <tmsriram@google.com>
4419
4420 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4421 only after checking if it cannot be forced local.
4422 * symtab.h (is_externally_visible): Check if the symbol is not forced
4423 local.
4424
f1ddb600
ILT
44252011-07-15 Ian Lance Taylor <iant@google.com>
4426
4427 * options.h (class General_options): Add --print-output-format.
4428 Move -EL next to -EB, for better --help output.
4429 * target-select.cc: Include <cstdio>, "options.h", and
4430 "parameters.h".
4431 (Target_selector::do_target_bfd_name): New function.
4432 (print_output_format): New function.
4433 * target-select.h (class Target_selector): Update declarations.
4434 (Target_selector::target_bfd_name): New function.
4435 (print_output_format): Declare.
4436 * main.cc: Include "target-select.h".
4437 (main): Handle --print-output-format.
4438 * gold.cc: Include "target-select.h".
4439 (queue_initial_tasks): Handle --print-output-format when there are
4440 no input files.
4441 * parameters.cc (parameters_force_valid_target): Give a better
4442 error message if -EB/-EL does not match target.
4443 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4444 function.
4445
7d172687
ILT
44462011-07-15 Ian Lance Taylor <iant@google.com>
4447
4448 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4449 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4450 (Output_data_plt_i386::do_write): Write address of .dynamic
4451 section to first entry in .got.plt section.
4452 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4453 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4454 Initialize layout_.
4455 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4456 section to first entry in .got.plt section.
4457 * layout.h (Layout::dynamic_section): New function.
4458
e9552f7e
ST
44592011-07-13 Sriraman Tallam <tmsriram@google.com>
4460
4461 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4462 to claim_file call.
4463 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4464 input_section_position_, and input_section_glob_.
4465 (read_layout_from_file): Call function section_ordering_specified.
4466 * layout.h (is_section_ordering_specified): New function.
4467 (section_ordering_specified): New function.
4468 (section_ordering_specified_): New boolean member.
4469 * main.cc(main): Call load_plugins after layout object is defined.
4470 * output.cc (Output_section::add_input_section): Use
4471 function section_ordering_specified to check if section ordering is
4472 needed.
4473 * output.cc (Output_section::add_relaxed_input_section): Use
4474 function section_ordering_specified to check if section ordering is
4475 needed.
4476 (Output_section::update_section_layout): New function.
4477 (Output_section::sort_attached_input_sections): Check if input section
4478 must be reordered.
4479 * output.h (Output_section::update_section_layout): New function.
4480 * plugin.cc (get_section_count): New function.
4481 (get_section_type): New function.
4482 (get_section_name): New function.
4483 (get_section_contents): New function.
4484 (update_section_order): New function.
58797674 4485 (allow_section_ordering): New function.
e9552f7e
ST
4486 (Plugin::load): Add the new interfaces to the transfer vector.
4487 (Plugin_manager::load_plugins): New parameter.
4488 (Plugin_manager::all_symbols_read): New parameter.
4489 (Plugin_manager::claim_file): New parameter. Save the elf object for
4490 unclaimed objects.
4491 (Plugin_manager::get_elf_object): New function.
4492 (Plugin_manager::get_view): Change to directly use the bool to check
4493 if get_view is called from claim_file_hook.
4494 * plugin.h (input_objects): New function
4495 (Plugin__manager::load_plugins): New parameter.
4496 (Plugin_manager::claim_file): New parameter.
4497 (Plugin_manager::get_elf_object): New function.
4498 (Plugin_manager::in_claim_file_handler): New function.
4499 (Plugin_manager::in_claim_file_handler_): New member.
4500 (layout): New function.
4501 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4502 handler with an extra parameter. Make the elf object before calling
4503 claim_file handler.
4504 * testsuite/plugin_test.c (get_section_count): New function pointer.
4505 (get_section_type): New function pointer.
4506 (get_section_name): New function pointer.
4507 (get_section_contents): New function pointer.
4508 (update_section_order): New function pointer.
4509 (allow_section_ordering): New function pointer.
4510 (onload): Check if the new interfaces exist.
4511
9446efde
ILT
45122011-07-13 Ian Lance Taylor <iant@google.com>
4513
4514 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4515 relro section.
4516 * x86_64.cc (Target_x86_64::got_section): Likewise.
4517 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4518 (relro_now_test_SOURCES): New variable.
4519 (relro_now_test_DEPENDENCIES): New variable.
4520 (relro_now_test_LDFLAGS): New variable.
4521 (relro_now_test_LDADD): New variable.
4522 (relro_now_test.so): New target.
4523 * testsuite/Makefile.in: Rebuild.
4524
07aa62f2
ILT
45252011-07-12 Ian Lance Taylor <iant@google.com>
4526
4527 PR gold/12980
4528 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4529 GLOB_DAT relocation rather than a RELATIVE relocation for a
4530 protected symbol when creating a shared library.
4531 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4532 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4533 * testsuite/protected_main_1.cc (main): Test that protected
4534 function has same address.
4535
e2153196
ILT
45362011-07-11 Ian Lance Taylor <iant@google.com>
4537
4538 PR gold/12979
4539 * options.h (class General_options): Add -Bgroup.
4540 * options.cc (General_options::finalize): If -Bgroup is set,
4541 default to --unresolved-symbols=report-all.
4542 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4543 * target-reloc.h (issue_undefined_symbol_error): Handle
4544 --unresolved-symbols=report-all.
4545
6daf5215
ILT
45462011-07-08 Ian Lance Taylor <iant@google.com>
4547
4548 PR gold/11985
4549 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4550 if linker script discards key sections.
4551 (Layout::create_dynamic_symtab): Likewise.
4552 (Layout::assign_local_dynsym_offsets): Likewise.
4553 (Layout::sized_create_version_sections): Likewise.
4554 (Layout::create_interp): Likewise.
4555 (Layout::finish_dynamic_section): Likewise.
4556 (Layout::set_dynamic_symbol_size): Likewise.
4557
beabb2c6
ILT
45582011-07-08 Ian Lance Taylor <iant@google.com>
4559
4560 PR gold/12386
4561 * options.h (class General_options): Add --unresolved-symbols.
4562 * target-reloc.h (issue_undefined_symbol_error): Check
4563 --unresolved-symbols. Add comments.
4564
9c16daf1
ILT
45652011-07-08 Ian Lance Taylor <iant@google.com>
4566
4567 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4568 expression more complex.
4569
191f1a2d
ILT
45702011-07-08 Ian Lance Taylor <iant@google.com>
4571
4572 PR gold/11317
4573 * target-reloc.h (issue_undefined_symbol_error): New inline
4574 function, broken out of relocate_section.
4575 (relocate_section): Call issue_undefined_symbol_error.
4576 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4577 there is no TLS segment if we are about to issue an undefined
4578 symbol error.
4579 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4580
62855347
ILT
45812011-07-08 Ian Lance Taylor <iant@google.com>
4582
4583 PR gold/12279
4584 * resolve.cc (Symbol_table::should_override): Add fromtype
4585 parameter. Change all callers. Give error when linking together
4586 TLS and non-TLS symbol.
4587 (Symbol_table::should_override_with_special): Add fromtype
4588 parameter. Change all callers.
4589 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4590 there is no TLS segment if we have reported some errors.
4591 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4592
67181c72
ILT
45932011-07-08 Ian Lance Taylor <iant@google.com>
4594
4595 PR gold/12372
4596 * target.h (Target::plt_address_for_global): New function.
4597 (Target::plt_address_for_local): New function.
4598 (Target::plt_section_for_global): Remove.
4599 (Target::plt_section_for_local): Remove.
4600 (Target::do_plt_address_for_global): New virtual function.
4601 (Target::do_plt_address_for_local): New virtual function.
4602 (Target::do_plt_section_for_global): Remove.
4603 (Target::do_plt_section_for_local): Remove.
4604 (Target::register_global_plt_entry): Add Symbol_table and Layout
4605 parameters.
4606 * output.cc (Output_data_got::Got_entry::write): Use
4607 plt_address_for_global and plt_address_for_local.
4608 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4609 address of output section.
4610 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4611 got_irelative_, and irelative_count_ fields. Update
4612 declarations.
4613 (Output_data_plt_i386::has_irelative_section): New function.
4614 (Output_data_plt_i386::entry_count): Add irelative_count_.
4615 (Output_data_plt_i386::set_final_data_size): Likewise.
4616 (class Target_i386): Add got_irelative_ and rel_irelative_
4617 fields. Update declarations.
4618 (Target_i386::Target_i386): Initialize new fields.
4619 (Target_i386::do_plt_address_for_global): New function replacing
4620 do_plt_section_for_global.
4621 (Target_i386::do_plt_address_for_local): New function replacing
4622 do_plt_section_for_local.
4623 (Target_i386::got_section): Create got_irelative_.
4624 (Target_i386::rel_irelative_section): New function.
4625 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4626 fields. Don't define __rel_iplt_{start,end}.
4627 (Output_data_plt_i386::add_entry): Add symtab and layout
4628 parameters. Change all callers. Use different PLT and GOT for
4629 IFUNC symbols.
4630 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4631 layout parameters. Change all callers. Use different PLT and
4632 GOT.
4633 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4634 (Output_data_plt_i386::rel_irelative): New function.
4635 (Output_data_plt_i386::address_for_global): New function.
4636 (Output_data_plt_i386::address_for_local): New function.
4637 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4638 IRELATIVE GOT when changing IFUNC GOT entries.
4639 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4640 reloc.
4641 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4642 if we didn't create an IRELATIVE GOT.
4643 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4644 plt_address_for_local.
4645 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4646 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4647 got_irelative_, and irelative_count_ fields. Update
4648 declarations.
4649 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4650 Initialize new fields. Remove symtab parameter. Change all
4651 callers.
4652 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4653 irelative_count_.
4654 (Output_data_plt_x86_64::has_irelative_section): New function.
4655 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4656 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4657 fields. Update declarations.
4658 (Target_x86_64::Target_x86_64): Initialize new fields.
4659 (Target_x86_64::do_plt_address_for_global): New function replacing
4660 do_plt_section_for_global.
4661 (Target_x86_64::do_plt_address_for_local): New function replacing
4662 do_plt_section_for_local.
4663 (Target_x86_64::got_section): Create got_irelative_.
4664 (Target_x86_64::rela_irelative_section): New function.
4665 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4666 all callers. Don't create __rel_iplt_{start,end}.
4667 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4668 parameters. Change all callers. Use different PLT and GOT for
4669 IFUNC symbols.
4670 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4671 layout parameters. Change all callers. Use different PLT and
4672 GOT.
4673 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4674 parameters. Change all callers. Use different PLT and GOT for
4675 IFUNC symbols.
4676 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4677 (Output_data_plt_x86_64::rela_irelative): New function.
4678 (Output_data_plt_x86_64::address_for_global): New function.
4679 (Output_data_plt_x86_64::address_for_local): New function.
4680 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4681 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4682 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4683 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4684 parameters.
4685 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4686 reloc.
4687 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4688 symbols if we didn't create an IRELATIVE GOT.
4689 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4690 plt_address_for_local.
4691 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4692 * testsuite/ifuncvar1.c: New test file.
4693 * testsuite/ifuncvar2.c: New test file.
4694 * testsuite/ifuncvar3.c: New test file.
4695 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4696 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4697 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4698 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4699 * testsuite/Makefile.in: Rebuild.
4700
33c15b45
CC
47012011-07-07 Cary Coutant <ccoutant@google.com>
4702
4703 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4704 (two_file_test_1_ndebug.o): Likewise.
4705 (two_file_test_1b_ndebug.o): Likewise.
4706 (two_file_test_2_ndebug.o): Likewise.
4707 (two_file_test_main_ndebug.o): Likewise.
4708 (incremental_test_2): Link with no-debug versions.
4709
f48b5fb7
CC
47102011-07-06 Cary Coutant <ccoutant@google.com>
4711
4712 * gold/incremental.cc
4713 (Output_section_incremental_inputs::write_info_blocks): Check for
4714 hidden and internal symbols.
4715
221597a5
CC
47162011-07-06 Cary Coutant <ccoutant@google.com>
4717
4718 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4719 Check disposition for startup file.
4720 (Incremental_inputs::report_command_line): Ignore
4721 --incremental-startup-unchanged option.
4722 * options.cc (General_options::parse_incremental_startup_unchanged):
4723 New function.
4724 (General_options::General_options): Initialize new data member.
4725 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4726 (General_options): Add --incremental-startup-unchanged option.
4727 (General_options::incremental_startup_disposition): New function.
4728 (General_options::incremental_startup_disposition_): New data member.
4729
e24719f6
CC
47302011-07-06 Cary Coutant <ccoutant@google.com>
4731
4732 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4733 input file index to Script_info ctor.
4734 (Sized_incremental_binary::do_file_has_changed): Find the
4735 command-line argument for files named in scripts.
4736 * incremental.h (Script_info::Script_info): New ctor
4737 with input file index.
4738 (Script_info::input_file_index): New function.
4739 (Script_info::input_file_index_): New data member.
4740 (Incremental_binary::get_library): Add const.
4741 (Incremental_binary::get_script_info): Add const.
4742 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4743 * testsuite/Makefile.am (incremental_test_5): New test case.
4744 (incremental_test_6): New test case.
4745 * testsuite/Makefile.in: Regenerate.
4746
8f7c81e8
CC
47472011-07-06 Cary Coutant <ccoutant@google.com>
4748
4749 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4750 debug output when command lines differ.
4751
9fbd3822
CC
47522011-07-06 Cary Coutant <ccoutant@google.com>
4753
4754 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4755 --incremental-patch option.
4756 * layout.cc (Free_list::allocate): Extend allocation beyond original
4757 end if enabled.
4758 (Layout::make_output_section): Mark sections that should get
4759 patch space.
4760 * options.cc (parse_percent): New function.
4761 * options.h (parse_percent): New function.
4762 (DEFINE_percent): New macro.
4763 (General_options): Add --incremental-patch option.
4764 * output.cc (Output_section::Output_section): Initialize new data
4765 members.
4766 (Output_section::add_input_section): Print section name when out
4767 of patch space.
4768 (Output_section::add_output_section_data): Likewise.
4769 (Output_section::set_final_data_size): Add patch space when
4770 doing --incremental-full.
4771 (Output_section::do_reset_address_and_file_offset): Remove patch
4772 space.
4773 (Output_segment::set_section_list_addresses): Print debug output
4774 only if --incremental-update.
4775 * output.h (Output_section::set_is_patch_space_allowed): New function.
4776 (Output_section::is_patch_space_allowed_): New data member.
4777 (Output_section::patch_space_): New data member.
4778 * parameters.cc (Parameters::incremental_full): New function.
4779 * parameters.h (Parameters::incremental_full): New function
4780 * testsuite/Makefile.am (incremental_test_2): Add test for
4781 --incremental-patch option.
4782 * testsuite/Makefile.in: Regenerate.
4783 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4784 (t18): Remove function body.
4785
f6cccc2c
DK
47862011-07-05 Doug Kwan <dougkwan@google.com>
4787
4788 PR gold/12771
4789 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4790 Arm_Address type for relocation result.
4791 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4792 overflow check.
4793 (Arm_relocate_functions::abs32): Use unaligned access.
4794 (Arm_relocate_functions::rel32): Ditto.
4795 (Arm_relocate_functions::prel31): Ditto.
4796 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4797 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4798 static data relocations.
4799 * testsuite/Makefile.in: Regnerate.
4800 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4801
28a13fec
ILT
48022011-07-05 Ian Lance Taylor <iant@google.com>
4803
4804 PR gold/12392
4805 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4806 symbols if necessary.
4807 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4808
24d47b34
ILT
48092011-07-05 Ian Lance Taylor <iant@google.com>
4810
4811 PR gold/12952
4812 * resolve.cc (Symbol::override_base_with_special): Simply override
4813 version with special symbol version, ignoring previous version.
4814
41f9cbbe
ILT
48152011-07-05 Ian Lance Taylor <iant@google.com>
4816
4817 * object.cc (Sized_relobj_file::include_section_group): Add
4818 information to comment about signature location.
4819
886288f1
ILT
48202011-07-02 Ian Lance Taylor <iant@google.com>
4821
4822 PR gold/12957
4823 * options.h (class General_options): Add -f and -F.
4824 * options.cc (General_options::finalize): Fatal error if -f/-F
4825 are used without -shared.
4826 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4827
ae3a6d4f
ILT
48282011-07-02 Ian Lance Taylor <iant@google.com>
4829
4830 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4831
21131061
ILT
48322011-07-01 Ian Lance Taylor <iant@google.com>
4833
4834 PR gold/12525
4835 PR gold/12952
4836 * resolve.cc (Symbol::override_base_with_special): Don't override
4837 the version if the overriding symbol has a different name.
4838 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4839 all callers. If we give an error about an undefined version,
4840 define the base version if necessary.
4841 * dynobj.h (class Versions): Update declaration.
4842 * testsuite/weak_alias_test_5.cc: New file.
4843 * testsuite/weak_alias_test.script: New file.
4844 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4845 and versioned_alias have the right value, and call t2.
4846 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4847 weak_alias_test_5.so.
4848 (weak_alias_test_LDADD): Likewise.
4849 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4850 * testsuite/Makefile.in: Rebuild.
4851
611062c0
ILT
48522011-07-01 Ian Lance Taylor <iant@google.com>
4853
4854 PR gold/12525
4855 * options.h (class General_options): Support -z notext.
4856 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4857 -Wl,-z,notext.
4858 (two_file_shared_nonpic.so): Likewise.
4859 (two_file_shared_mixed.so): Likewise.
4860 (two_file_shared_mixed_1.so): Likewise.
4861 (weak_undef_lib_nonpic.so): Likewise.
4862 (alt/weak_undef_lib_nonpic.so): Likewise.
4863 (tls_test_shared_nonpic.so): Likewise.
4864 * testsuite/Makefile.in: Rebuild.
4865
328c7c2f
ILT
48662011-07-01 Ian Lance Taylor <iant@google.com>
4867
4868 PR gold/12525
4869 * configure.ac: Test whether static linking works, setting
4870 the automake conditional HAVE_STATIC.
4871 * testsuite/Makefile.am: Disable tests using -static if
4872 HAVE_STATIC is not true.
4873 * configure, testsuite/Makefile.in: Rebuild.
4874
02d7cd44
ILT
48752011-07-01 Ian Lance Taylor <iant@google.com>
4876
4877 PR gold/12525
4878 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4879 Assert if we see DW_EH_PE_indirect.
4880 * target.h (Target::ehframe_datarel_base): New function.
4881 (Target::do_ehframe_datarel_base): New target function.
4882 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4883 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4884 function.
4885
07a60597
ILT
48862011-07-01 Ian Lance Taylor <iant@google.com>
4887
4888 PR gold/12571
4889 * options.h (class General_options): Add
4890 --ld-generated-unwind-info.
4891 * ehframe.cc (Fde::write): Add address parameter. Change all
4892 callers. If associated with PLT, fill in address and size.
4893 (Cie::set_output_offset): Only add merge mapping if there is an
4894 object.
4895 (Cie::write): Add address parameter. Change all callers.
4896 (Eh_frame::add_ehframe_for_plt): New function.
4897 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4898 input_offset_ fields into union u_, with new plt field.
4899 (Fde::Fde): Adjust for new union field.
4900 (Fde::Fde) [Output_data version]: New constructor.
4901 (Fde::add_mapping): Only add merge mapping if there is an object.
4902 (class Cie): Update declarations.
4903 (class Eh_frame): Declare add_ehframe_for_plt.
4904 * layout.cc (Layout::layout_eh_frame): Break out code into
4905 make_eh_frame_section, and call it.
4906 (Layout::make_eh_frame_section): New function.
4907 (Layout::add_eh_frame_for_plt): New function.
4908 * layout.h (class Layout): Update declarations.
4909 * merge.cc (Merge_map::add_mapping): Add assertion.
4910 * i386.cc: Include "dwarf.h".
4911 (class Output_data_plt_i386): Make first_plt_entry,
4912 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4913 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4914 and plt_eh_frame_fde.
4915 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4916 boundary. Call add_eh_frame_for_plt if appropriate.
4917 * x86_64.cc: Include "dwarf.h".
4918 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4919 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4920 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4921 and plt_eh_frame_fde.
4922 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4923 appropriate.
4924
14788a3f
ILT
49252011-06-29 Ian Lance Taylor <iant@google.com>
4926
4927 PR gold/12629
4928 * object.cc (Sized_relobj_file::layout_section): Change shdr
4929 parameter to be const.
4930 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4931 out of do_layout.
4932 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4933 appropriate. Call layout_eh_frame_section.
4934 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4935 sections.
4936 * object.h (class Sized_relobj_file): Update declarations.
4937
6c21fce1
ILT
49382011-06-29 Ian Lance Taylor <iant@google.com>
4939
37e41b03 4940 PR gold/12652
6c21fce1
ILT
4941 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4942 modifier.
4943 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4944
4d5e4e62
ILT
49452011-06-29 Ian Lance Taylor <iant@google.com>
4946
4947 PR gold/12675
4948 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4949 SHT_X86_64_UNWIND.
4950 * layout.cc (Layout::layout_eh_frame): Likewise.
4951
886f533a
ILT
49522011-06-29 Ian Lance Taylor <iant@google.com>
4953
4954 PR gold/12695
4955 * layout.cc (Layout::symtab_section_shndx): New function.
4956 * layout.h (class Layout): Declare symtab_section_shndx.
4957 * output.cc (Output_section::write_header): Call it.
4958
f3ae1b28
ILT
49592011-06-29 Ian Lance Taylor <iant@google.com>
4960
4961 PR gold/12818
4962 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4963 symbols which are not used in a relocation.
4964
aecf301f
ILT
49652011-06-28 Ian Lance Taylor <iant@google.com>
4966
4967 PR gold/12898
4968 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4969 script create indistinguishable segments.
4970 (Layout::set_segment_offsets): Use stable_sort when sorting
4971 segments. Pass this to Compare_segments constructor.
4972 * layout.h (class Layout): Make segment_precedes non-static.
4973 (class Compare_segments): Change from struct to class. Add
4974 layout_ field. Add constructor.
4975 * script-sections.cc
4976 (Script_sections::attach_sections_using_phdrs_clause): Rename
4977 local orphan to is_orphan. Don't report failure to put empty
4978 section in segment. On attachment failure, report name of
4979 section, and attach to first PT_LOAD segment.
4980
03ef7571
ILT
49812011-06-28 Ian Lance Taylor <iant@google.com>
4982
4983 PR gold/12934
4984 * target-select.cc (Target_selector::Target_selector): Add
4985 emulation parameter. Change all callers.
4986 (select_target_by_bfd_name): Rename from select_target_by_name.
4987 Change all callers.
4988 (select_target_by_emulation): New function.
4989 (supported_emulation_names): New function.
4990 * target-select.h (class Target_selector): Add emulation_ field.
4991 Update declarations.
4992 (Target_selector::recognize_by_bfd_name): Rename from
4993 recognize_by_name. Change all callers.
4994 (Target_selector::supported_bfd_names): Rename from
4995 supported_names. Change all callers.
4996 (Target_selector::recognize_by_emulation): New function.
4997 (Target_selector::supported_emulations): New function.
4998 (Target_selector::emulation): New function.
4999 (Target_selector::do_recognize_by_bfd_name): Rename from
5000 do_recognize_by_name. Change all callers.
5001 (Target_selector::do_supported_bfd_names): Rename from
5002 do_supported_names. Change all callers.
5003 (Target_selector::do_recognize_by_emulation): New function.
5004 (Target_selector::do_supported_emulations): New function.
5005 (select_target_by_bfd_name): Change name in declaration.
5006 (select_target_by_emulation): Declare.
5007 (supported_emulation_names): Declare.
5008 * parameters.cc (parameters_force_valid_target): Try to find
5009 target based on emulation from -m option.
5010 * options.h (class General_options): Change doc string for -m.
5011 * options.cc (help): Print emulations.
5012 (General_options::parse_V): Likewise.
5013 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5014 Add emulation parameter. Change all callers.
5015
200b2bb9
ILT
50162011-06-28 Ian Lance Taylor <iant@google.com>
5017
5018 * target.h (class Target): Add osabi_ field.
5019 (Target::osabi): New function.
5020 (Target::set_osabi): New function.
5021 (Target::Target): Initialize osabi_.
5022 (Target::do_adjust_elf_header): Make pure virtual.
5023 (Sized_target::do_adjust_elf_header): Declare.
5024 * target.cc (Sized_target::do_adjust_elf_header): New function.
5025 (class Sized_target): Instantiate all versions.
5026 * freebsd.h (class Target_freebsd): Remove.
5027 (Target_selector_freebsd::do_recognize): Call set_osabi on
5028 Target.
5029 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5030 (Target_selector_freebsd::set_osabi): Remove.
5031 * i386.cc (class Target_i386): Inherit from Sized_target rather
5032 than Target_freebsd.
5033 * x86_64.cc (class Target_x86_64): Likewise.
5034
b3ce541e
ILT
50352011-06-28 Ian Lance Taylor <iant@google.com>
5036
5037 * target.h (Target::can_check_for_function_pointers): Rewrite.
5038 Make non-virtual.
5039 (Target::can_icf_inline_merge_sections): Likewise.
5040 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5041 (Target::Target_info): Add can_icf_inline_merge_sections field.
5042 (Target::do_can_check_for_function_pointers): New virtual
5043 function.
5044 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5045 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5046 from can_check_for_function_pointers, move in file.
5047 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5048 section_may_have_icf_unsafe_poineters, move in file.
5049 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5050 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5051 Rename from can_check_for_function_pointers, move in file.
5052 (Target_i386::can_icf_inline_merge_sections): Remove.
5053 (Target_i386::i386_info): Initialize
5054 can_icf_inline_merge_sections.
5055 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5056 Initialize can_icf_inline_merge_sections.
5057 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5058 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5059 Rename from can_check_for_function_pointers, move in file.
5060 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5061 (Target_x86_64::x86_64_info): Initialize
5062 can_icf_inline_merge_sections.
5063 * testsuite/testfile.cc (Target_test::test_target_info):
5064 Likewise.
5065 * icf.cc (get_section_contents): Correct formatting.
5066
6d1c4efb
ILT
50672011-06-27 Ian Lance Taylor <iant@google.com>
5068
5069 * symtab.cc (Symbol::versioned_name): New function.
5070 (Symbol_table::add_to_final_symtab): Use versioned_name when
5071 appropriate.
5072 (Symbol_table::sized_write_symbol): Likewise.
5073 * symtab.h (class Symbol): Declare versioned_name.
5074 * stringpool.h (class Stringpool_template): Add variant of add
5075 which takes a std::basic_string.
5076 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5077 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5078 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5079 (ver_test_12.o): New target.
5080 * testsuite/Makefile.in: Rebuild.
5081
57eb9b50
DK
50822011-06-27 Doug Kwan <dougkwan@google.com>
5083
5084 * arm.cc (Arm_relocate_functions::thm_jump8,
5085 Arm_relocate_functions::thm_jump11): Use a wider signed
5086 type to compute offset.
5087 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5088 arm_thm_jump8.
5089 * testsuite/Makefile.in: Regenerate.
5090 * testsuite/arm_branch_in_range.sh: Check test results of
5091 arm_thm_jump11 and arm_thm_jump8.
5092 * testsuite/arm_thm_jump11.s: New test source file.
5093 * testsuite/arm_thm_jump11.t: New linker script.
5094 * testsuite/arm_thm_jump8.s: New test source file.
5095 * testsuite/arm_thm_jump8.t: New linker script.
5096
487b39df
ILT
50972011-06-24 Ian Lance Taylor <iant@google.com>
5098
5099 * layout.cc: Include "object.h".
5100 (ctors_sections_in_init_array): New static variable.
5101 (Layout::is_ctors_in_init_array): New function.
5102 (Layout::layout): Add entry to ctors_sections_in_init_array if
5103 appropriate.
5104 * layout.h (class Layout): Declare is_ctors_in_init_array.
5105 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5106 is_ctors_reverse_view is set.
5107 (Sized_relobj_file::write_sections): Add layout parameter. Change
5108 all callers. Set is_ctors_reverse_view field of View_size.
5109 (Sized_relobj_file::reverse_words): New function.
5110 * object.h (Sized_relobj_file::View_size): Add
5111 is_ctors_reverse_view field.
5112 (class Sized_relobj_file): Update declarations.
5113 * testsuite/initpri3.c: New test.
5114 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5115 initpri3b.
5116 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5117 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5118 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5119 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5120 * testsuite/Makefile.in: Rebuild.
5121
472076e4
CC
51222011-06-24 Cary Coutant <ccoutant@google.com>
5123
5124 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5125 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5126 (debug_msg_cdebug.err): New targets.
5127 * testsuite/Makefile.in: Regenerate.
5128 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5129 Fix checks for link with shared library.
5130
a60af0db
DK
51312011-06-24 Doug Kwan <dougkwan@google.com>
5132
5133 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5134 skip empty text sections.
5135 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5136
5393d741
ILT
51372011-06-22 Ian Lance Taylor <iant@google.com>
5138
5139 PR gold/12910
5140 * options.h (class General_options): Add --ctors-in-init-array.
5141 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5142 friends as SHT_PROGBITS for merging sections.
5143 (Layout::layout): Remove special handling of .init_array and
5144 friends. Don't sort if doing relocatable link. Sort for .ctors
5145 and .dtors if ctors_in_init_array.
5146 (Layout::make_output_section): Force correct section types for
5147 .init_array and friends. Don't sort if doing relocatable link,
5148 Don't sort .ctors and .dtors if ctors_in_init_array.
5149 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5150 (Layout::output_section_name): Add relobj parameter. Change all
5151 callers. Handle .ctors. and .dtors. in code rather than table.
5152 Handle .ctors and .dtors if ctors_in_init_array.
5153 (Layout::match_file_name): New function, moved from output.cc.
5154 * layout.h (class Layout): Update declarations.
5155 * output.cc: Include "layout.h".
5156 (Input_section_sort_entry::get_priority): New function.
5157 (Input_section_sort_entry::match_file_name): Just call
5158 Layout::match_file_name.
5159 (Output_section::Input_section_sort_init_fini_compare::operator()):
5160 Handle .ctors and .dtors. Sort by explicit priority rather than
5161 by name.
5162 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5163 * testsuite/initpri2.c: New test.
5164 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5165 (check_PROGRAMS): Add initpri2.
5166 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5167 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5168 * configure, testsuite/Makefile.in: Rebuild.
5169
e1f74f98
ILT
51702011-06-19 Ian Lance Taylor <iant@google.com>
5171
5172 PR gold/12880
5173 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5174 .interp section to a PT_INTERP segment even if we have seen a
5175 --dynamic-linker option. Don't do it if we have seen a PHDRS
5176 clause in a linker script.
5177 (Layout::finalize): Don't create a .interp section if we've
5178 already create a PT_INTERP segment.
5179 (Layout::create_interp): Always call choose_output_section (revert
5180 patch of 2011-06-17). Don't create PT_INTERP segment.
5181 * script-sections.cc
5182 (Script_sections::create_note_and_tls_segments): Add a .interp
5183 section to a PT_INTERP segment even if we have seen a
5184 --dynamic-linker option.
5185
766f91bb
ILT
51862011-06-18 Ian Lance Taylor <iant@google.com>
5187
5188 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5189 merely because a non-PT_LOAD segment has a dynamic reloc.
5190
0d212c3a
ILT
51912011-06-18 Ian Lance Taylor <iant@google.com>
5192
5193 * layout.cc (Layout::finish_dynamic_section): Don't create
5194 DT_FLAGS entry if not needed.
5195
911a5072
ILT
51962011-06-18 Ian Lance Taylor <iant@google.com>
5197
5198 PR gold/12745
5199 * layout.cc (Layout::layout_eh_frame): Correct handling of
5200 writable .eh_frame section.
5201
534b4e5f
ILT
52022011-06-17 Ian Lance Taylor <iant@google.com>
5203
5204 PR gold/12893
5205 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5206 symbol is redefined with the exact same object and value.
5207
10b4f102
ILT
52082011-06-17 Ian Lance Taylor <iant@google.com>
5209
5210 PR gold/12880
5211 * layout.h (class Layout): Add interp_segment_ field.
5212 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5213 (Layout::attach_allocated_section_to_segment): If making shared
5214 library, put .interp section in PT_INTERP segment.
5215 (Layout::finalize): Also call create_interp if -dynamic-linker
5216 option was used.
5217 (Layout::create_interp): Assert that there is no PT_INTERP
5218 segment. If not using a SECTIONS clause, use make_output_section.
5219 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5220 * script-sections.cc
5221 (Script_sections::create_note_and_tls_segments): If making shared
5222 library, put .interp section in PT_INTERP segment.
5223
a29b0dad
ILT
52242011-06-17 Ian Lance Taylor <iant@google.com>
5225
e588ea8d
ILT
5226 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5227 when making a shared library.
5228
52292011-06-17 Ian Lance Taylor <iant@google.com>
5230
5231 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5232 parameter. Change all callers. Don't issue warning about PC32
5233 against locally defined symbol.
a29b0dad 5234
9d3b0698
ILT
52352011-06-16 Ian Lance Taylor <iant@google.com>
5236
5237 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5238 occurs in same object.
5239
85b0f90c
AM
52402011-06-14 Alan Modra <amodra@gmail.com>
5241
5242 * po/POTFILES.in: Regenerate.
5243
a94907d9
ILT
52442011-06-09 Ian Lance Taylor <iant@google.com>
5245
5246 * script-sections.cc
5247 (Orphan_output_section::set_section_addresses): For a relocatable
5248 link set address to 0.
5249
4fb3a1c3
CC
52502011-06-09 Cary Coutant <ccoutant@google.com>
5251
5252 PR gold/12804
5253 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5254 used with --compress-debug-sections.
5255 * gold/object.cc (Sized_relobj_file::do_layout): Report
5256 uncompressed size of compressed input sections.
5257
61220854
CC
52582011-06-08 Cary Coutant <ccoutant@google.com>
5259
5260 PR gold/12804
5261 * testsuite/two_file_test_2_v1.cc: Change initialization of
5262 v2 to keep it in .data.
5263
e6455dfb
CC
52642011-06-07 Cary Coutant <ccoutant@google.com>
5265
5266 * common.cc (Symbol_table::do_allocate_commons_list): Call
5267 gold_fallback.
5268 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5269 (Errors::fallback): New function.
5270 (gold_fallback): New function.
5271 * errors.h (Errors::fallback): New function.
5272 * gold.cc (gold_exit): Change status parameter to enum; adjust
5273 all callers.
5274 (queue_initial_tasks): Call gold_fallback.
5275 * gold.h: Include cstdlib.
5276 (Exit_status): New enum type.
5277 (gold_exit): Change status parameter to enum.
5278 (gold_fallback): New function.
5279 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5280 (Layout::create_symtab_sections): Likewise.
5281 (Layout::create_shdrs): Likewise.
5282 * main.cc (main): Adjust call to gold_exit.
5283 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5284 (Output_data_got::add_got_entry_pair): Likewise.
5285 (Output_section::add_input_section): Likewise.
5286 (Output_section::add_output_section_data): Likewise.
5287 (Output_segment::set_section_list_addresses): Likewise.
5288 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5289
fb0e076f
CC
52902011-06-07 Cary Coutant <ccoutant@google.com>
5291
5292 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5293 for incremental links.
5294 * output.cc (Output_segment::set_section_list_addresses): Remove
5295 FIXME and test for TLS or BSS.
5296
a5ee4d5d
CC
52972011-06-07 Cary Coutant <ccoutant@google.com>
5298
5299 * testsuite/Makefile.am: Add incremental_copy_test,
5300 incremental_common_test_1.
5301 * testsuite/Makefile.in: Regenerate.
5302 * testsuite/common_test_1_v1.c: New source file.
5303 * testsuite/common_test_1_v2.c: New source file.
5304 * testsuite/copy_test_v1.cc: New source file.
5305
5146f448
CC
53062011-06-07 Cary Coutant <ccoutant@google.com>
5307
5308 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5309 update, allocate common from bss section's free list.
5310 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5311 linker-defined symbols.
5312 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5313 Skip GOT and PLT entries that are no longer referenced.
5314 (Output_section_incremental_inputs::write_info_blocks): Mark
5315 linker-defined symbols.
5316 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5317 * output.cc (Output_section::allocate): New function.
5318 * output.h (Output_section::allocate): New function.
5319 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5320 linker-defined symbols.
5321 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5322 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5323 (Symbol::init_base_output_data): Likewise.
5324 (Symbol::init_base_output_segment): Likewise.
5325 (Symbol::init_base_constant): Likewise.
5326 (Sized_symbol::init_output_data): Likewise.
5327 (Sized_symbol::init_output_segment): Likewise.
5328 (Sized_symbol::init_constant): Likewise.
5329 (Symbol_table::do_define_in_output_data): Likewise.
5330 (Symbol_table::do_define_in_output_segment): Likewise.
5331 (Symbol_table::do_define_as_constant): Likewise.
5332 * symtab.h (Symbol::is_predefined): New function.
5333 (Symbol::init_base_output_data): Add is_predefined parameter.
5334 (Symbol::init_base_output_segment): Likewise.
5335 (Symbol::init_base_constant): Likewise.
5336 (Symbol::is_predefined_): New data member.
5337 (Sized_symbol::init_output_data): Add is_predefined parameter.
5338 (Sized_symbol::init_output_segment): Likewise.
5339 (Sized_symbol::init_constant): Likewise.
5340 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5341
26d3c67d
CC
53422011-06-07 Cary Coutant <ccoutant@google.com>
5343
5344 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5345 instead of emit_copy_reloc.
5346 (Copy_relocs::emit_copy_reloc): Refactor.
5347 (Copy_relocs::make_copy_reloc): New function.
5348 (Copy_relocs::add_copy_reloc): Remove.
5349 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5350 section.
5351 (Copy_relocs::make_copy_reloc): New function.
5352 (Copy_relocs::add_copy_reloc): Remove.
5353 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5354 unchanged input files.
5355 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5356 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5357 Reserve BSS space for COPY relocations.
5358 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5359 (Output_section_incremental_inputs::write_info_blocks): Record
5360 whether a symbol is copied from a shared object.
5361 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5362 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5363 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5364 (Incremental_input_entry_reader::get_output_symbol_index): Add
5365 is_copy parameter.
5366 (Incremental_binary::emit_copy_relocs): New function.
5367 (Incremental_binary::do_emit_copy_relocs): New function.
5368 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5369 new data member.
5370 (Sized_incremental_binary::add_copy_reloc): New function.
5371 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5372 (Sized_incremental_binary::Copy_reloc): New struct.
5373 (Sized_incremental_binary::Copy_relocs): New typedef.
5374 (Sized_incremental_binary::copy_relocs_): New data member.
5375 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5376 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5377 * target.h (Sized_target::emit_copy_reloc): New function.
5378 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5379
7cdb37d9
CC
53802011-06-02 Cary Coutant <ccoutant@google.com>
5381
5382 PR gold/12163
5383 * gold/archive.cc (Archive::Archive): Initialize new data member.
5384 (Archive::include_all_members): Return if archive has already been
5385 included.
5386 * gold/archive.h (Archive::include_all_members_): New data member.
5387
cc643b88
NC
53882011-06-02 Nick Clifton <nickc@redhat.com>
5389
5390 * dynobj.h: Fix spelling mistake in comment.
5391 * output.cc: Likewise.
5392
f62a3ca7 53932011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5394 Asier Llano
f62a3ca7
DK
5395
5396 PR gold/12826
cc643b88 5397 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5398 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5399 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5400 redundant arm_exidx_test.so.
5401 * testsuite/Makefile.in: Regenerate.
5402 (check_SCRIPTS): Add pr12826.sh
5403 (check_DATA): Add pr12826.stdout
5404 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5405 * testsuite/pr12826.sh: New file.
5406 * testsuite/pr12826_1.s: Ditto.
5407 * testsuite/pr12826_1.s: Ditto.
5408
8dbe1edc
ILT
54092011-05-30 Ian Lance Taylor <iant@google.com>
5410
5411 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5412 sections.
5413
c49875be
ILT
54142011-05-29 Ian Lance Taylor <iant@google.com>
5415
5416 PR gold/12804
5417 * testsuite/Makefile.am: Use different file name for two_file_test
5418 temporary file for each incremental test.
5419 * testsuite/Makefile.in: Rebuild.
5420
69d53f7a
ILT
54212011-05-29 Ian Lance Taylor <iant@google.com>
5422
5423 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5424 binary input file is empty.
5425
41d0ab5f
ILT
54262011-05-27 Ian Lance Taylor <iant@google.com>
5427
5428 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5429 (ver_test_9.so): Likewise.
5430 * testsuite/Makefile.in: Rebuild.
5431
89d8a36b
CC
54322011-05-26 Cary Coutant <ccoutant@google.com>
5433
5434 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5435 * incremental.cc (Incremental_inputs::report_input_section): Fix
5436 comment, indentation.
5437 (Incremental_inputs::report_comdat_group): New function.
5438 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5439 of data for incremental input file entry.
5440 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5441 group count, COMDAT group signatures.
5442 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5443 an unchanged input file.
5444 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5445 Initialize new data member.
5446 (Incremental_object_entry::add_comdat_group): New function.
5447 (Incremental_object_entry::get_comdat_group_count): New function.
5448 (Incremental_object_entry::get_comdat_signature_key): New function.
5449 (Incremental_object_entry::groups_): New data member.
5450 (Incremental_inputs::report_comdat_group): New function.
5451 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5452 data for incremental input file entry.
5453 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5454 (Incremental_input_entry_reader::get_input_section): Adjust size of
5455 data for incremental input file entry.
5456 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5457 (Incremental_input_entry_reader::get_comdat_group_signature): New
5458 function.
5459 * object.cc (Sized_relobj::include_section_group): Report kept
5460 COMDAT groups for incremental links.
5461
1706a06f
ILT
54622011-05-24 David Meyer <pdox@google.com>
5463
5464 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5465 with name parameter. Add found_name parameter.
5466 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5467 * dirsearch.h (class Dirsearch): Update declaration.
5468
a10ae760
ILT
54692011-05-24 Ian Lance Taylor <iant@google.com>
5470
5471 * archive.cc (Library_base::should_include_member): Pull in object
5472 from archive if it defines the entry symbol.
5473 * parameters.cc (Parameters::entry): New function.
5474 * parameters.h (class Parameters): Declare entry.
5475 * output.h (class Output_file_header): Remove entry_ field.
5476 * output.cc (Output_file_header::Output_file_header): Remove entry
5477 parameter. Change all callers.
5478 (Output_file_header::entry): Use parameters->entry.
5479 * gold.cc (queue_middle_tasks): Likewise.
5480 * plugin.cc (Plugin_hook::run): Likewise.
5481
aa92d6ed
CC
54822011-05-24 Cary Coutant <ccoutant@google.com>
5483
5484 * gold.cc (queue_initial_tasks): Pass incremental base filename
5485 to Output_file::open_base_file; don't print error message.
5486 * incremental-dump.cc (main): Adjust call to
5487 Output_file::open_for_modification.
5488 * incremental-dump.cc (main): Likewise.
5489 * incremental.cc (Incremental_inputs::report_command_line):
5490 Ignore --incremental-base option when comparing command lines.
5491 Ignore parameter when given as separate argument.
5492 * options.h (class General_options): Add --incremental-base.
5493 * output.cc (Output_file::Output_file):
5494 (Output_file::open_base_file): Add base_name and writable parameters;
5495 read base file into new file; print error message here.
5496 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5497 callers.
5498 * output.h (Output_file::open_for_modification): Rename to...
5499 (Output_file::open_base_file): ...this; add base_name and
5500 writable parameters; adjust all callers.
5501 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5502 callers.
5503 * testsuite/Makefile.am (incremental_test_4): Test
5504 --incremental-base.
5505 * testsuite/Makefile.in: Regenerate.
5506
2eedd706
CC
55072011-05-24 Cary Coutant <ccoutant@google.com>
5508
5509 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5510 incremental_test_4.
5511 * testsuite/Makefile.in: Regenerate.
5512 * testsuite/two_file_test_1_v1.cc: New test source file.
5513 * testsuite/two_file_test_1b_v1.cc: New test source file.
5514 * testsuite/two_file_test_2_v1.cc: New test source file.
5515
0f1c85a6
CC
55162011-05-24 Cary Coutant <ccoutant@google.com>
5517
5518 * dynobj.h (Dynobj::do_dynobj): New function.
5519 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5520 flag and soname for shared objects.
5521 * incremental.cc (Incremental_inputs::report_object): Make
5522 either Incremental_object_entry or Incremental_dynobj_entry; add
5523 soname to string table.
5524 (Incremental_inputs::report_input_section): Add assertion.
5525 (Output_section_incremental_inputs::set_final_data_size): Adjust
5526 type of input file entry for shared libraries; adjust size of
5527 shared library info entry.
5528 (Output_section_incremental_inputs::write_input_files): Write
5529 as_needed flag for shared libraries.
5530 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5531 of input file entry for shared libraries; write soname.
5532 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5533 soname from incremental info.
5534 * incremental.h (enum Incremental_input_flags): Add
5535 INCREMENTAL_INPUT_AS_NEEDED.
5536 (Incremental_input_entry::Incremental_input_entry): Initialize new
5537 data member.
5538 (Incremental_input_entry::set_as_needed): New function.
5539 (Incremental_input_entry::as_needed): New function.
5540 (Incremental_input_entry::do_dynobj_entry): New function.
5541 (Incremental_input_entry::as_needed_): New data member.
5542 (Incremental_object_entry::Incremental_object_entry): Don't check
5543 for shared library.
5544 (Incremental_object_entry::do_type): Likewise.
5545 (class Incremental_dynobj_entry): New class.
5546 (Incremental_input_entry_reader::as_needed): New function.
5547 (Incremental_input_entry_reader::get_soname): New function.
5548 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5549 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5550 size of shared library info entry.
58797674 5551 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5552 incremental link when adding DT_NEEDED entries.
5553 * object.h (Object::Object): Initialize new data member.
5554 (Object::dynobj): New function.
5555 (Object::set_as_needed): New function.
5556 (Object::as_needed): New function.
5557 (Object::do_dynobj): New function.
5558 (Object::as_needed_): New data member.
5559
6fa2a40b
CC
55602011-05-24 Cary Coutant <ccoutant@google.com>
5561
5562 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5563 info; adjust display of GOT entries.
5564 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5565 vector of input objects; remove file_status_.
5566 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5567 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5568 got_plt reader; call target hooks to reserve GOT entries.
5569 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5570 of input file info header and GOT info entry.
5571 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5572 relocation info.
5573 (Got_plt_view_info::got_descriptor): Remove.
5574 (Got_plt_view_info::sym_index): New data member.
5575 (Got_plt_view_info::input_index): New data member.
5576 (Local_got_offset_visitor::visit): Write input file index.
5577 (Global_got_offset_visitor::visit): Write 0 for input file index.
5578 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5579 with sym_index and input_index.
5580 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5581 incremental info GOT entry; replace got_descriptor with input_index.
5582 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5583 map from input file index to object.
5584 (Sized_relobj_incr::do_layout): Replace direct data member reference
5585 with accessor function.
5586 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5587 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5588 Adjust size of input file info header.
5589 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5590 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5591 (Incremental_input_entry_reader::get_input_section): Adjust size of
5592 input file info header.
5593 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5594 of incremental info GOT entry.
5595 (Incremental_got_plt_reader::get_got_desc): Remove.
5596 (Incremental_got_plt_reader::get_got_symndx): New function.
5597 (Incremental_got_plt_reader::get_got_input_index): New function.
5598 (Sized_incremental_binary::Sized_incremental_binary): Remove
5599 file_status_; add input_objects_.
5600 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5601 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5602 (Sized_incremental_binary::file_is_unchanged): Remove.
5603 (Sized_incremental_binary::set_input_object): New function.
5604 (Sized_incremental_binary::input_object): New function.
5605 (Sized_incremental_binary::file_status_): Remove.
5606 (Sized_incremental_binary::input_objects_): New data member.
5607 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5608 references.
5609 (Sized_relobj_incr::invalid_address): Move to base class.
5610 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5611 class.
5612 (Sized_relobj_incr::do_output_section_offset): Likewise.
5613 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5614 (Sized_relobj_incr::section_offsets_): Likewise.
5615 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5616 function.
5617 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5618 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5619 with accessor function.
5620 (Sized_relobj_file::do_layout): Likewise.
5621 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5622 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5623 (Sized_relobj_file::compute_final_local_value): Replace refs to
5624 section_offsets_ with accessor function.
5625 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5626 * object.h (Relobj::Relobj): Initialize new data members.
5627 (Relobj::add_dyn_reloc): New function.
5628 (Relobj::first_dyn_reloc): New function.
5629 (Relobj::dyn_reloc_count): New function.
5630 (Relobj::first_dyn_reloc_): New data member.
5631 (Relobj::dyn_reloc_count_): New data member.
5632 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5633 references.
5634 (Sized_relobj::Address): New typedef.
5635 (Sized_relobj::invalid_address): Move here from child class.
5636 (Sized_relobj::Sized_relobj): Initialize new data members.
5637 (Sized_relobj::sized_relobj): New function.
5638 (Sized_relobj::is_output_section_offset_invalid): Move here from
5639 child class.
5640 (Sized_relobj::get_output_section_offset): Likewise.
5641 (Sized_relobj::local_has_got_offset): Likewise.
5642 (Sized_relobj::local_got_offset): Likewise.
5643 (Sized_relobj::set_local_got_offset): Likewise.
5644 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5645 (Sized_relobj::clear_got_offsets): New function.
5646 (Sized_relobj::section_offsets): Move here from child class.
5647 (Sized_relobj::do_output_section_offset): Likewise.
5648 (Sized_relobj::do_set_section_offset): Likewise.
5649 (Sized_relobj::Local_got_offsets): Likewise.
5650 (Sized_relobj::local_got_offsets_): Likewise.
5651 (Sized_relobj::section_offsets_): Likewise.
5652 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5653 references.
5654 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5655 class.
5656 (Sized_relobj_file::sized_relobj): New function
5657 (Sized_relobj_file::local_has_got_offset): Move to base class.
5658 (Sized_relobj_file::local_got_offset): Likewise.
5659 (Sized_relobj_file::set_local_got_offset): Likewise.
5660 (Sized_relobj_file::get_output_section_offset): Likewise.
5661 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5662 (Sized_relobj_file::do_output_section_offset): Likewise.
5663 (Sized_relobj_file::do_set_section_offset): Likewise.
5664 (Sized_relobj_file::Local_got_offsets): Likewise.
5665 (Sized_relobj_file::local_got_offsets_): Likewise.
5666 (Sized_relobj_file::section_offsets_): Likewise.
5667 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5668 (all constructors).
5669 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5670 (Output_reloc::get_symbol_index): Likewise.
5671 (Output_reloc::local_section_offset): Likewise.
5672 (Output_reloc::get_address): Likewise.
5673 (Output_reloc::symbol_value): Likewise.
5674 (Output_data_got::reserve_slot): Move to class definition.
5675 (Output_data_got::reserve_local): New function.
5676 (Output_data_got::reserve_slot_for_global): Remove.
5677 (Output_data_got::reserve_global): New function.
5678 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5679 (all constructors, two instantiations).
5680 (Output_reloc::get_relobj): New function (two instantiations).
5681 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5682 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5683 (Output_data_reloc::add_global): Adjust type of relobj.
5684 (Output_data_reloc::add_global_relative): Likewise.
5685 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5686 (Output_data_reloc::add_local): Likewise.
5687 (Output_data_reloc::add_local_relative): Likewise.
5688 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5689 (Output_data_reloc::add_local_section): Likewise.
5690 (Output_data_reloc::add_output_section): Likewise.
5691 (Output_data_reloc::add_absolute): Likewise.
5692 (Output_data_reloc::add_target_specific): Likewise.
5693 (Output_data_got::reserve_slot): Move definition here.
5694 (Output_data_got::reserve_local): New function.
5695 (Output_data_got::reserve_global): New function.
5696 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5697 section_offsets_ with accessor function.
5698 (Sized_relobj_file::write_sections): Likewise.
5699 (Sized_relobj_file::do_relocate_sections): Likewise.
5700 * target.h (Sized_target::reserve_local_got_entry): New function.
5701 (Sized_target::reserve_global_got_entry): New function.
5702 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5703 (Target_x86_64::reserve_global_got_entry): New function.
5704 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5705
4829d394
CC
57062011-05-23 Cary Coutant <ccoutant@google.com>
5707
5708 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5709 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5710 bit when checking got_type.
5711 * incremental.cc (Sized_incremental_binary::setup_readers):
5712 Store symbol table and string table locations; initialize bit vector
5713 of file status flags.
5714 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5715 unchanged files.
5716 (Sized_incremental_binary::do_process_got_plt): New function.
5717 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5718 (Output_section_incremental_inputs::set_final_data_size): Record
5719 file index for each input file.
5720 (Output_section_incremental_inputs::write_got_plt): Store file index
5721 instead of input entry offset for each GOT entry.
5722 * incremental.h
5723 (Incremental_input_entry::Incremental_input_entry): Initialize new
5724 data member.
5725 (Incremental_input_entry::set_offset): Store file index.
5726 (Incremental_input_entry::get_file_index): New function.
5727 (Incremental_input_entry::file_index_): New data member.
5728 (Incremental_binary::process_got_plt): New function.
5729 (Incremental_binary::do_process_got_plt): New function.
5730 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5731 data members.
5732 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5733 (Sized_incremental_binary::set_file_is_unchanged): New function.
5734 (Sized_incremental_binary::file_is_unchanged): New function.
5735 (Sized_incremental_binary::do_process_got_plt): New function.
5736 (Sized_incremental_binary::file_status_): New data member.
5737 (Sized_incremental_binary::main_symtab_loc_): New data member.
5738 (Sized_incremental_binary::main_strtab_loc_): New data member.
5739 * output.cc (Output_data_got::Got_entry::write): Add case
5740 RESERVED_CODE.
5741 (Output_data_got::add_global): Call add_got_entry.
5742 (Output_data_got::add_global_plt): Likewise.
5743 (Output_data_got::add_global_with_rel): Likewise.
5744 (Output_data_got::add_global_with_rela): Likewise.
5745 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5746 (Output_data_got::add_global_pair_with_rela): Likewise.
5747 (Output_data_got::add_local): Call add_got_entry.
5748 (Output_data_got::add_local_plt): Likewise.
5749 (Output_data_got::add_local_with_rel): Likewise.
5750 (Output_data_got::add_local_with_rela): Likewise.
5751 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5752 (Output_data_got::add_local_pair_with_rela): Likewise.
5753 (Output_data_got::reserve_slot): New function.
5754 (Output_data_got::reserve_slot_for_global): New function.
5755 (Output_data_got::add_got_entry): New function.
5756 (Output_data_got::add_got_entry_pair): New function.
5757 (Output_section::add_output_section_data): Edit FIXME.
5758 * output.h
5759 (Output_section_data_build::Output_section_data_build): New
5760 constructor with size parameter.
5761 (Output_data_space::Output_data_space): Likewise.
5762 (Output_data_got::Output_data_got): Initialize new data member; new
5763 constructor with size parameter.
5764 (Output_data_got::add_constant): Call add_got_entry.
5765 (Output_data_got::reserve_slot): New function.
5766 (Output_data_got::reserve_slot_for_global): New function.
5767 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5768 (Output_data_got::add_got_entry): New function.
5769 (Output_data_got::add_got_entry_pair): New function.
5770 (Output_data_got::free_list_): New data member.
5771 * target.h (Sized_target::init_got_plt_for_update): New function.
5772 (Sized_target::register_global_plt_entry): New function.
5773 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5774 Initialize new data member; call init; add constructor with PLT count.
5775 (Output_data_plt_x86_64::init): New function.
5776 (Output_data_plt_x86_64::add_relocation): New function.
5777 (Output_data_plt_x86_64::reserve_slot): New function.
5778 (Output_data_plt_x86_64::free_list_): New data member.
5779 (Target_x86_64::init_got_plt_for_update): New function.
5780 (Target_x86_64::register_global_plt_entry): New function.
5781 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5782 incremental updates.
5783 (Output_data_plt_x86_64::add_relocation): New function.
5784 * testsuite/object_unittest.cc (Object_test): Set default options.
5785
ec69d6da
ILT
57862011-05-16 Ian Lance Taylor <iant@google.com>
5787
5788 * options.h (class General_options): Make -i a synonym for -r.
5789
732e31de
ILT
57902011-05-16 Ian Lance Taylor <iant@google.com>
5791
5792 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5793
403676b5
CC
57942011-05-10 Cary Coutant <ccoutant@google.com>
5795
5796 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5797 strip_all (-s).
5798
5b7b7d6e
ILT
57992011-05-06 Ian Lance Taylor <iant@google.com>
5800
5801 * layout.cc (Layout::layout): If the output section flags change,
5802 update the ordering.
5803
f0f9babf
CC
58042011-04-25 Cary Coutant <ccoutant@google.com>
5805
5806 * incremental-dump.cc (dump_incremental_inputs): Print local
5807 symbol info for each input file.
5808 * incremental.cc
5809 (Output_section_incremental_inputs::set_final_data_size): Add local
5810 symbol info to input file entries in incremental info.
5811 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5812 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5813 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5814 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5815 implementation.
5816 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5817 (Sized_incr_relobj::do_relocate): Write the local symbols.
5818 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5819 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5820 Adjust size of input file header.
5821 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5822 (Incremental_inputs_reader::get_local_symbol_count): New function.
5823 (Incremental_inputs_reader::get_input_section): Adjust size of input
5824 file header.
5825 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5826 (Sized_incr_relobj::This): New typedef.
5827 (Sized_incr_relobj::sym_size): New const data member.
5828 (Sized_incr_relobj::Local_symbol): New struct.
5829 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5830 (Sized_incr_relobj::do_local_symbol_offset): New function.
5831 (Sized_incr_relobj::local_symbol_count_): New data member.
5832 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5833 (Sized_incr_relobj::local_symbol_index_): New data member.
5834 (Sized_incr_relobj::local_symbol_offset_): New data member.
5835 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5836 (Sized_incr_relobj::local_symbols_): New data member.
5837 * object.h (Relobj::output_local_symbol_count): New function.
5838 (Relobj::local_symbol_offset): New function.
5839 (Relobj::do_output_local_symbol_count): New function.
5840 (Relobj::do_local_symbol_offset): New function.
5841 (Sized_relobj::do_output_local_symbol_count): New function.
5842 (Sized_relobj::do_local_symbol_offset): New function.
5843
d0a9ace3
ILT
58442011-04-22 Vladimir Simonov <sv@sw.ru>
5845
5846 * descriptors.cc (set_close_on_exec): New function.
5847 (Descriptors::open): Use set_close_on_exec.
5848 * output.cc (S_ISLNK): Define if not defined.
5849
94a3fc8b
CC
58502011-04-22 Cary Coutant <ccoutant@google.com>
5851
5852 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5853 global symbol map.
5854 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5855 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5856 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5857 relocations.
5858 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5859 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5860 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5861 * incremental.h
5862 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5863 function.
5864 (Incremental_binary::apply_incremental_relocs): New function.
5865 (Incremental_binary::do_apply_incremental_relocs): New function.
5866 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5867 data member.
5868 (Sized_incremental_binary::add_global_symbol): New function.
5869 (Sized_incremental_binary::global_symbol): New function.
5870 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5871 (Sized_incremental_binary::symbol_map_): New data member.
5872 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5873 * target.h (Sized_target::apply_relocation): New function.
5874 * target-reloc.h (apply_relocation): New function.
5875 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5876
c87e4302
DK
58772011-04-22 Doug Kwan <dougkwan@google.com>
5878
5879 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5880 flag of a SHT_ARM_EXIDX section.
2e702c99 5881 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5882 * testsuite/Makefile.in: Regenerate.
5883 * testsuite/arm_exidx_test.s: New file.
5884 * testsuite/arm_exidx_test.sh: Same.
5885
e7782cf6
CC
58862011-04-20 Cary Coutant <ccoutant@google.com>
5887
5888 PR gold/12689
5889 * archive.h (Incremental_archive_entry::Archive_member):
5890 Initialize arg_serial_ (second constructor).
5891
308ecdc7
ILT
58922011-04-17 Ian Lance Taylor <iant@google.com>
5893
5894 * object.cc (Relocate_info::location): Simplify location string.
5895 * errors.cc (Errors::error_at_location): Don't print program
5896 name.
5897 (Errors::warning_at_location): Likewise.
5898 (Errors::undefined_symbol): Likewise.
5899 * testsuite/debug_msg.sh: Update accordingly.
5900
bec5b579
CC
59012011-04-14 Cary Coutant <ccoutant@google.com>
5902
5903 * gold/layout.cc (Layout::symtab_section_offset): New function.
5904 * gold/layout.h (Layout::symtab_section_offset): New function.
5905 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5906
88597d34
ILT
59072011-04-12 Ian Lance Taylor <iant@google.com>
5908
5909 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5910 with MREMAP_MAYMOVE.
5911 * output.h (class Output_file): Add map_is_allocated_ field.
5912 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5913 not available, provide stubs. If mremap is not available, #define
5914 it to gold_mremap.
5915 (MREMAP_MAYMOVE): Define if not defined.
5916 (Output_file::Output_file): Initialize map_is_allocated_.
5917 (Output_file::resize): Check map_is_allocated_.
5918 (Output_file::map_anonymous): If mmap fails, use malloc.
5919 (Output_file::unmap): Don't do anything for an anonymous map.
5920 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5921 is not available, provide stubs.
5922 (File_read::View::~View): Use free rather than delete[].
5923 (File_read::make_view): Use malloc rather than new[]. If mmap
5924 fails, use malloc.
5925 (File_read::find_or_make_view): Use malloc rather than new[].
5926 * gold.h: Remove HAVE_REMAP code.
5927 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5928 exists. Rename mremap to gold_mremap. If mmap is not available
5929 don't do anything.
5930 * configure, config.in: Rebuild.
5931
11e361bc
ILT
59322011-04-11 Ian Lance Taylor <iant@google.com>
5933
5934 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5935 initialize local variable v.
5936
cdc29364
CC
59372011-04-11 Cary Coutant <ccoutant@google.com>
5938
5939 * archive.cc (Archive::include_member): Adjust call to
5940 report_object.
5941 (Add_archive_symbols::run): Track argument serial numbers.
5942 (Lib_group::include_member): Likewise.
5943 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5944 * archive.h (Incremental_archive_entry::Archive_member):
5945 Initialize arg_serial_.
5946 (Archive_member::arg_serial_): New data member.
5947 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5948 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5949 incremental link.
5950 (Sized_dynobj::do_for_all_local_got_entries): New function.
5951 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5952 function.
5953 * fileread.cc (get_mtime): New function.
5954 * fileread.h (get_mtime): New function.
5955 * gold.cc (queue_initial_tasks): Check for incremental update.
5956 (process_incremental_input): New function.
5957 (queue_middle_tasks): Don't force valid target for incremental
5958 update.
5959 * incremental-dump.cc (find_input_containing_global): Adjust
5960 size of symbol info entry.
5961 (dump_incremental_inputs): Dump argument serial number and
5962 in_system_directory flag; bias shndx by 1; print symbol names
5963 when dumping per-file symbol lists; use new symbol info readers.
5964 * incremental.cc
5965 (Output_section_incremental_inputs:update_data_size): New function.
5966 (Sized_incremental_binary::setup_readers): Setup input readers
5967 for each input file; build maps for files added from libraries
5968 and scripts.
5969 (Sized_incremental_binary::check_input_args): New function.
5970 (Sized_incremental_binary::do_check_inputs): Build map of argument
5971 serial numbers to input arguments.
5972 (Sized_incremental_binary::do_file_has_changed): Rename
5973 do_file_is_unchanged to this; compare file modification times.
5974 (Sized_incremental_binary::do_init_layout): New function.
5975 (Sized_incremental_binary::do_reserve_layout): New function.
5976 (Sized_incremental_binary::do_get_input_reader): Remove.
5977 (Sized_incremental_binary::get_symtab_view): New function.
5978 (Incremental_checker::can_incrementally_link_output_file): Remove.
5979 (Incremental_inputs::report_command_line): Exclude --debug options.
5980 (Incremental_inputs::report_archive_begin): Add parameter; track
5981 argument serial numbers; don't put input file entry for archive
5982 before archive members.
5983 (Incremental_inputs::report_archive_end): Put input file entry
5984 for archive after archive members.
5985 (Incremental_inputs::report_object): Add parameter; track argument
5986 serial numbers and in_system_directory flag.
5987 (Incremental_inputs::report_script): Add parameter; track argument
5988 serial numbers.
5989 (Output_section_incremental_inputs::set_final_data_size): Adjust
5990 size of symbol info entry; check for forwarding symbols.
5991 (Output_section_incremental_inputs::write_input_files): Write
5992 in_system_directory flag and argument serial number.
5993 (Output_section_incremental_inputs::write_info_blocks): Map section
5994 indices between incremental info and original input file; store
5995 input section index for each symbol.
5996 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5997 change operator() to visit().
5998 (class Global_got_offset_visitor): Likewise.
5999 (class Global_symbol_visitor_got_plt):
6000 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6001 classes.
6002 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6003 (Sized_incr_relobj::do_read_symbols): New function.
6004 (Sized_incr_relobj::do_layout): New function.
6005 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6006 (Sized_incr_relobj::do_add_symbols): New function.
6007 (Sized_incr_relobj::do_should_include_member): New function.
6008 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6009 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6010 (Sized_incr_relobj::do_section_size): New function.
6011 (Sized_incr_relobj::do_section_name): New function.
6012 (Sized_incr_relobj::do_section_contents): New function.
6013 (Sized_incr_relobj::do_section_flags): New function.
6014 (Sized_incr_relobj::do_section_entsize): New function.
6015 (Sized_incr_relobj::do_section_address): New function.
6016 (Sized_incr_relobj::do_section_type): New function.
6017 (Sized_incr_relobj::do_section_link): New function.
6018 (Sized_incr_relobj::do_section_info): New function.
6019 (Sized_incr_relobj::do_section_addralign): New function.
6020 (Sized_incr_relobj::do_initialize_xindex): New function.
6021 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6022 (Sized_incr_relobj::do_read_relocs): New function.
6023 (Sized_incr_relobj::do_gc_process_relocs): New function.
6024 (Sized_incr_relobj::do_scan_relocs): New function.
6025 (Sized_incr_relobj::do_count_local_symbols): New function.
6026 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6027 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6028 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6029 (Sized_incr_relobj::do_relocate): New function.
6030 (Sized_incr_relobj::do_set_section_offset): New function.
6031 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6032 (Sized_incr_dynobj::do_read_symbols): New function.
6033 (Sized_incr_dynobj::do_layout): New function.
6034 (Sized_incr_dynobj::do_add_symbols): New function.
6035 (Sized_incr_dynobj::do_should_include_member): New function.
6036 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6037 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6038 (Sized_incr_dynobj::do_section_size): New function.
6039 (Sized_incr_dynobj::do_section_name): New function.
6040 (Sized_incr_dynobj::do_section_contents): New function.
6041 (Sized_incr_dynobj::do_section_flags): New function.
6042 (Sized_incr_dynobj::do_section_entsize): New function.
6043 (Sized_incr_dynobj::do_section_address): New function.
6044 (Sized_incr_dynobj::do_section_type): New function.
6045 (Sized_incr_dynobj::do_section_link): New function.
6046 (Sized_incr_dynobj::do_section_info): New function.
6047 (Sized_incr_dynobj::do_section_addralign): New function.
6048 (Sized_incr_dynobj::do_initialize_xindex): New function.
6049 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6050 (make_sized_incremental_object): New function.
6051 (Incremental_library::copy_unused_symbols): New function.
6052 (Incremental_library::do_for_all_unused_symbols): New function.
6053 * incremental.h (enum Incremental_input_flags): New type.
6054 (class Incremental_checker): Remove.
6055 (Incremental_input_entry::Incremental_input_entry): Add argument
6056 serial number.
6057 (Incremental_input_entry::arg_serial): New function.
6058 (Incremental_input_entry::set_is_in_system_directory): New function.
6059 (Incremental_input_entry::is_in_system_directory): New function.
6060 (Incremental_input_entry::arg_serial_): New data member.
6061 (Incremental_input_entry::is_in_system_directory_): New data member.
6062 (class Script_info): Move here from script.h.
6063 (Script_info::Script_info): Add filename parameter.
6064 (Script_info::filename): New function.
6065 (Script_info::filename_): New data member.
6066 (Incremental_script_entry::Incremental_script_entry): Add argument
6067 serial number.
6068 (Incremental_object_entry::Incremental_object_entry): Likewise.
6069 (Incremental_object_entry::add_input_section): Build list of input
6070 sections with map to original shndx.
6071 (Incremental_object_entry::get_input_section_index): New function.
6072 (Incremental_object_entry::shndx_): New data member.
6073 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6074 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6075 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6076 serial number.
6077 (Incremental_inputs::report_archive_begin): Likewise.
6078 (Incremental_inputs::report_object): Likewise.
6079 (Incremental_inputs::report_script): Likewise.
6080 (class Incremental_global_symbol_reader): New class.
6081 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6082 and store flags and input file type.
6083 (Incremental_input_entry_reader::arg_serial): New function.
6084 (Incremental_input_entry_reader::type): Extract type from flags.
6085 (Incremental_input_entry_reader::is_in_system_directory): New function.
6086 (Incremental_input_entry_reader::get_input_section_count): Call
6087 accessor function for type.
6088 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6089 function for type; adjust size of global symbol entry.
6090 (Incremental_input_entry_reader::get_global_symbol_count): Call
6091 accessor function for type.
6092 (Incremental_input_entry_reader::get_object_count): Likewise.
6093 (Incremental_input_entry_reader::get_object_offset): Likewise.
6094 (Incremental_input_entry_reader::get_member_count): Likewise.
6095 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6096 (Incremental_input_entry_reader::get_member_offset): Likewise.
6097 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6098 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6099 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6100 (Incremental_input_entry_reader::get_global_symbol_reader): New
6101 function.
6102 (Incremental_input_entry_reader::get_output_symbol_index): New
6103 function.
6104 (Incremental_input_entry_reader::type_): Remove.
6105 (Incremental_input_entry_reader::flags_): New data member.
6106 (Incremental_inputs_reader::input_file_offset): New function.
6107 (Incremental_inputs_reader::input_file_index): New function.
6108 (Incremental_inputs_reader::input_file): Call input_file_offset.
6109 (Incremental_inputs_reader::input_file_at_offset): New function.
6110 (Incremental_relocs_reader::get_r_type): Reformat.
6111 (Incremental_relocs_reader::get_r_shndx): Reformat.
6112 (Incremental_relocs_reader::get_r_offset): Reformat.
6113 (Incremental_relocs_reader::data): New function.
6114 (Incremental_binary::Incremental_binary): Initialize new data members.
6115 (Incremental_binary::check_inputs): Add cmdline parameter.
6116 (Incremental_binary::file_is_unchanged): Remove.
6117 (Input_reader::arg_serial): New function.
6118 (Input_reader::get_unused_symbol_count): New function.
6119 (Input_reader::get_unused_symbol): New function.
6120 (Input_reader::do_arg_serial): New function.
6121 (Input_reader::do_get_unused_symbol_count): New function.
6122 (Input_reader::do_get_unused_symbol): New function.
6123 (Incremental_binary::input_file_count): New function.
6124 (Incremental_binary::get_input_reader): Change signature to use
6125 index instead of filename.
6126 (Incremental_binary::file_has_changed): New function.
6127 (Incremental_binary::get_input_argument): New function.
6128 (Incremental_binary::get_library): New function.
6129 (Incremental_binary::get_script_info): New function.
6130 (Incremental_binary::init_layout): New function.
6131 (Incremental_binary::reserve_layout): New function.
6132 (Incremental_binary::output_file): New function.
6133 (Incremental_binary::do_check_inputs): New function.
6134 (Incremental_binary::do_file_is_unchanged): Remove.
6135 (Incremental_binary::do_file_has_changed): New function.
6136 (Incremental_binary::do_init_layout): New function.
6137 (Incremental_binary::do_reserve_layout): New function.
6138 (Incremental_binary::do_input_file_count): New function.
6139 (Incremental_binary::do_get_input_reader): Change signature.
6140 (Incremental_binary::input_args_map_): New data member.
6141 (Incremental_binary::library_map_): New data member.
6142 (Incremental_binary::script_map_): New data member.
6143 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6144 new data members.
6145 (Sized_incremental_binary::output_section): New function.
6146 (Sized_incremental_binary::inputs_reader): Add const.
6147 (Sized_incremental_binary::symtab_reader): Add const.
6148 (Sized_incremental_binary::relocs_reader): Add const.
6149 (Sized_incremental_binary::got_plt_reader): Add const.
6150 (Sized_incremental_binary::get_symtab_view): New function.
6151 (Sized_incremental_binary::Inputs_reader): New typedef.
6152 (Sized_incremental_binary::Input_entry_reader): New typedef.
6153 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6154 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6155 (Sized_incremental_binary::do_file_has_changed): New function.
6156 (Sized_incremental_binary::do_init_layout): New function.
6157 (Sized_incremental_binary::do_reserve_layout): New function.
6158 (Sized_input_reader::Inputs_reader): Remove.
6159 (Sized_input_reader::Input_entry_reader): Remove.
6160 (Sized_input_reader::do_arg_serial): New function.
6161 (Sized_input_reader::do_get_unused_symbol_count): New function.
6162 (Sized_input_reader::do_get_unused_symbol): New function.
6163 (Sized_incremental_binary::do_input_file_count): New function.
6164 (Sized_incremental_binary::do_get_input_reader): Change signature;
6165 use index instead of filename.
6166 (Sized_incremental_binary::section_map_): New data member.
6167 (Sized_incremental_binary::input_entry_readers_): New data member.
6168 (class Sized_incr_relobj): New class.
6169 (class Sized_incr_dynobj): New class.
6170 (make_sized_incremental_object): New function.
6171 (class Incremental_library): New class.
6172 * layout.cc (Free_list::num_lists): New static data member.
6173 (Free_list::num_nodes): New static data member.
6174 (Free_list::num_removes): New static data member.
6175 (Free_list::num_remove_visits): New static data member.
6176 (Free_list::num_allocates): New static data member.
6177 (Free_list::num_allocate_visits): New static data member.
6178 (Free_list::init): New function.
6179 (Free_list::remove): New function.
6180 (Free_list::allocate): New function.
6181 (Free_list::dump): New function.
6182 (Free_list::print_stats): New function.
6183 (Layout_task_runner::run): Resize output file for incremental updates.
6184 (Layout::Layout): Initialize new data members.
6185 (Layout::set_incremental_base): New function.
6186 (Layout::init_fixed_output_section): New function.
6187 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6188 incremental updates.
6189 (Layout::create_gold_note): Do not create gold note section for
6190 incremental updates.
6191 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6192 for incremental updates.
6193 (Layout::set_section_offsets): For incremental updates, allocate space
6194 from free list.
6195 (Layout::create_symtab_sections): Layout with offsets relative to
6196 start of section; for incremental updates, allocate space from free
6197 list.
6198 (Layout::create_shdrs): For incremental updates, allocate space from
6199 free list.
6200 (Layout::finish_dynamic_section): For incremental updates, do not
6201 check --as-needed (fixed in subsequent patch).
6202 * layout.h (class Free_list): New class.
6203 (Layout::set_incremental_base): New function.
6204 (Layout::incremental_base): New function.
6205 (Layout::init_fixed_output_section): New function.
6206 (Layout::allocate): New function.
6207 (Layout::incremental_base_): New data member.
6208 (Layout::free_list_): New data member.
6209 * main.cc (main): Print Free_list statistics.
6210 * object.cc (Relobj::finalize_incremental_relocs): Add
6211 clear_counts parameter; clear counts only when clear_counts is set.
6212 (Sized_relobj::Sized_relobj): Initialize new base class.
6213 (Sized_relobj::do_layout): Don't report special sections.
6214 (Sized_relobj::do_for_all_local_got_entries): New function.
6215 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6216 symtab_off to all symbol table offsets.
6217 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6218 * object.h (class Got_offset_list): Move to top of file.
6219 (Object::Object): Allow case where input_file == NULL.
6220 (Object::~Object): Likewise.
6221 (Object::input_file): Assert that input_file != NULL.
6222 (Object::lock): Allow case where input_file == NULL.
6223 (Object::unlock): Likewise.
6224 (Object::is_locked): Likewise.
6225 (Object::token): Likewise.
6226 (Object::release): Likewise.
6227 (Object::is_incremental): New function.
6228 (Object::get_mtime): New function.
6229 (Object::for_all_local_got_entries): New function.
6230 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6231 (Object::set_is_in_system_directory): New function.
6232 (Object::is_in_system_directory): New function.
6233 (Object::do_is_incremental): New function.
6234 (Object::do_get_mtime): New function.
6235 (Object::do_for_all_local_got_entries): New function.
6236 (Object::is_in_system_directory_): New data member.
6237 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6238 (class Sized_relobj_base): New class.
6239 (class Sized_relobj): Derive from Sized_relobj_base.
6240 (class Sized_relobj::Symbols): Redeclare from base class.
6241 (class Sized_relobj::local_got_offset_list): Remove.
6242 (class Sized_relobj::Output_sections): Redeclare from base class.
6243 (class Sized_relobj::do_for_all_local_got_entries): New function.
6244 (class Sized_relobj::write_local_symbols): Add offset parameter.
6245 (class Sized_relobj::local_symbol_offset_): Update comment.
6246 (class Sized_relobj::local_dynsym_offset_): Update comment.
6247 * options.cc (Input_arguments::add_file): Remove const.
6248 * options.h (Input_file_argument::Input_file_argument):
6249 Initialize arg_serial_ (all constructors).
6250 (Input_file_argument::set_arg_serial): New function.
6251 (Input_file_argument::arg_serial): New function.
6252 (Input_file_argument::arg_serial_): New data member.
6253 (Input_arguments::Input_arguments): Initialize file_count_.
6254 (Input_arguments::add_file): Remove const.
6255 (Input_arguments::number_of_input_files): New function.
6256 (Input_arguments::file_count_): New data member.
6257 (Command_line::number_of_input_files): Call
6258 Input_arguments::number_of_input_files.
6259 * output.cc (Output_segment_headers::Output_segment_headers):
6260 Set current size.
6261 (Output_section::Input_section::current_data_size): New function.
6262 (Output_section::Output_section): Initialize new data members.
6263 (Output_section::add_input_section): Don't do merge sections for
6264 an incremental link; allocate space from free list for an
6265 incremental update.
6266 (Output_section::add_output_section_data): Allocate space from
6267 free list for an incremental update.
6268 (Output_section::update_data_size): New function.
6269 (Output_section::set_fixed_layout): New function.
6270 (Output_section::reserve): New function.
6271 (Output_segment::set_section_addresses): Remove const.
6272 (Output_segment::set_section_list_addresses): Remove const; allocate
6273 space from free list for an incremental update.
6274 (Output_segment::set_offset): Adjust size of RELRO segment for an
6275 incremental update.
6276 * output.h (Output_data::current_data_size): Move here from
6277 child classes.
6278 (Output_data::pre_finalize_data_size): New function.
6279 (Output_data::update_data_size): New function.
6280 (Output_section_headers::update_data_size): new function.
6281 (Output_section_data_build::current_data_size): Move to Output_data.
6282 (Output_data_strtab::update_data_size): New function.
6283 (Output_section::current_data_size): Move to Output_data.
6284 (Output_section::set_fixed_layout): New function.
6285 (Output_section::has_fixed_layout): New function.
6286 (Output_section::reserve): New function.
6287 (Output_section::update_data_size): New function.
6288 (Output_section::has_fixed_layout_): New data member.
6289 (Output_section::free_list_): New data member.
6290 (Output_segment::set_section_addresses): Remove const.
6291 (Output_segment::set_section_list_addresses): Remove const.
6292 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6293 New function.
6294 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6295 New function.
6296 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6297 parameter when calling Add_symbols constructor; store argument
6298 serial number for members of a lib group.
6299 (Add_symbols::locks): Allow case where token == NULL.
6300 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6301 (Read_member::~Read_member): New function.
6302 (Read_member::is_runnable): New function.
6303 (Read_member::locks): New function.
6304 (Read_member::run): New function.
6305 (Check_script::~Check_script): New function.
6306 (Check_script::is_runnable): New function.
6307 (Check_script::locks): New function.
6308 (Check_script::run): New function.
6309 (Check_library::~Check_library): New function.
6310 (Check_library::is_runnable): New function.
6311 (Check_library::locks): New function.
6312 (Check_library::run): New function.
6313 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6314 (Add_symbols::library_): New data member.
6315 (class Read_member): New class.
6316 (class Check_script): New class.
6317 (class Check_library): New class.
6318 * reloc.cc (Read_relocs::is_runnable): Allow case where
6319 token == NULL.
6320 (Read_relocs::locks): Likewise.
6321 (Scan_relocs::locks): Likewise.
6322 (Relocate_task::locks): Likewise.
6323 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6324 to clear counters.
6325 (Sized_relobj::incremental_relocs_scan): Fix comment.
6326 (Sized_relobj::do_relocate): Pass output file offset to
6327 write_local_symbols.
6328 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6329 from class declaration.
6330 * script.cc (read_input_script): Allocate Script_info; pass
6331 argument serial number to report_script.
6332 * script.h (class Script_info): Move to incremental.h.
6333 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6334 * symtab.h (Symbol_table::add_from_incrobj): New function.
6335 (Symbol_table::set_file_offset): New function.
6336
b961d0d7
CC
63372011-04-05 Cary Coutant <ccoutant@google.com>
6338
6339 * incremental-dump.cc (dump_incremental_inputs): Change signature
6340 to take a Sized_incremental_binary; change caller. Use readers
6341 in Sized_incremental_binary.
6342 * incremental.cc
6343 (Sized_incremental_binary::find_incremental_inputs_sections):
6344 Rename do_find_incremental_inputs_sections to this.
6345 (Sized_incremental_binary::setup_readers): New function.
6346 (Sized_incremental_binary::do_check_inputs): Check
6347 has_incremental_info_ flag; move setup code to setup_readers;
6348 use input readers.
6349 (Sized_incremental_binary::do_file_is_unchanged): New function.
6350 (Sized_incremental_binary::do_get_input_reader): New function.
6351 * incremental.h (class Incremental_binary): Move to end of file.
6352 (Incremental_binary::file_is_unchanged): New function.
6353 (Incremental_binary::do_file_is_unchanged): New function.
6354 (Incremental_binary::Input_reader): New class.
6355 (Incremental_binary::get_input_reader): New function.
6356 (class Sized_incremental_binary): Move to end of file.
6357 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6358 input section reader classes.
6359 (Sized_incremental_binary::has_incremental_info): New function.
6360 (Sized_incremental_binary::inputs_reader): New function.
6361 (Sized_incremental_binary::symtab_reader): New function.
6362 (Sized_incremental_binary::relocs_reader): New function.
6363 (Sized_incremental_binary::got_plt_reader): New function.
6364 (Sized_incremental_binary::do_file_is_unchanged): New function.
6365 (Sized_incremental_binary::Sized_input_reader): New class.
6366 (Sized_incremental_binary::get_input_reader): New function.
6367 (Sized_incremental_binary::find_incremental_inputs_sections):
6368 Rename do_find_incremental_inputs_sections to this.
6369 (Sized_incremental_binary::setup_readers): New function.
6370 (Sized_incremental_binary::has_incremental_info_): New data member.
6371 (Sized_incremental_binary::inputs_reader_): New data member.
6372 (Sized_incremental_binary::symtab_reader_): New data member.
6373 (Sized_incremental_binary::relocs_reader_): New data member.
6374 (Sized_incremental_binary::got_plt_reader_): New data member.
6375 (Sized_incremental_binary::current_input_file_): New data member.
6376
a869183f
PP
63772011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6378
6379 PR gold/12640
6380 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6381 violation.
6382
63832011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6384
6385 * archive.cc (Archive::include_member): Adjust call to report_object.
6386 (Add_archive_symbols::run): Add script_info to call to
6387 report_archive_begin.
6388 (Lib_group::include_member): Adjust call to report_object.
6389 (Add_lib_group_symbols::run): Adjust call to report_object.
6390 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6391 blocks. Add object count for script input files.
6392 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6393 script_info parameter; change all callers.
6394 (Incremental_inputs::report_object): Add script_info parameter;
6395 change all callers.
6396 (Incremental_inputs::report_script): Store backpointer to
6397 incremental info entry.
6398 (Output_section_incremental_inputs::set_final_data_size): Record
6399 additional information for scripts.
6400 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6401 * incremental.h (Incremental_script_entry::add_object): New function.
6402 (Incremental_script_entry::get_object_count): New function.
6403 (Incremental_script_entry::get_object): New function.
6404 (Incremental_script_entry::objects_): New data member; adjust
6405 constructor.
6406 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6407 (Incremental_inputs::report_object): Add script_info parameter.
6408 (Incremental_inputs_reader::get_object_count): New function.
6409 (Incremental_inputs_reader::get_object_offset): New function.
6410 * options.cc (Input_arguments::add_file): Return reference to
6411 new input argument.
6412 * options.h (Input_argument::set_script_info): New function.
6413 (Input_argument::script_info): New function.
6414 (Input_argument::script_info_): New data member; adjust all
6415 constructors.
6416 (Input_file_group::add_file): Return reference to new input argument.
6417 (Input_file_lib::add_file): Likewise.
6418 (Input_arguments::add_file): Likewise.
6419 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6420 * script.cc (Parser_closure::Parser_closure): Add script_info
6421 parameter; adjust all callers.
6422 (Parser_closure::script_info): New function.
6423 (Parser_closure::script_info_): New data member.
6424 (read_input_script): Report scripts earlier to incremental info.
6425 (script_add_file): Set script_info in Input_argument.
6426 (script_add_library): Likewise.
6427 * script.h (Script_options::Script_info): Rewrite class.
6428
a869183f 64292011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6430
6431 * archive.cc (Library_base::should_include_member): Move
6432 method here from class Archive.
6433 (Archive::Archive): Initialize base class.
6434 (Archive::should_include_member): Move to base class.
6435 (Archive::do_for_all_unused_symbols): New function.
6436 (Add_archive_symbols::run): Remove redundant access to
6437 incremental_inputs.
6438 (Lib_group::Lib_group): Initialize base class.
6439 (Lib_group::do_filename): New function.
6440 (Lib_group::include_member): Pass pointer to Lib_group to
6441 report_object.
6442 (Lib_group::do_for_all_unused_symbols): New function.
6443 (Add_lib_group_symbols::run): Report archive information for
6444 incremental links.
6445 * archive.h (class Library_base): New base class.
6446 (class Archive): Derive from Library_base.
6447 (Archive::filename): Move to base class.
6448 (Archive::set_incremental_info): Likewise.
6449 (Archive::incremental_info): Likewise.
6450 (Archive::Should_include): Likewise.
6451 (Archive::should_include_member): Likewise.
6452 (Archive::Armap_entry): Remove.
6453 (Archive::Unused_symbol_iterator): Remove.
6454 (Archive::unused_symbols_begin): Remove.
6455 (Archive::unused_symbols_end): Remove.
6456 (Archive::do_filename): New function.
6457 (Archive::do_get_mtime): New function.
6458 (Archive::do_for_all_unused_symbols): New function.
6459 (Archive::task_): Move to base class.
6460 (Archive::incremental_info_): Likewise.
6461 (class Lib_group): Derive from Library_base.
6462 (Lib_group::do_filename): New function.
6463 (Lib_group::do_get_mtime): New function.
6464 (Lib_group::do_for_all_unused_symbols): New function.
6465 (Lib_group::task_): Move to base class.
6466 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6467 function.
6468 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6469 function.
6470 * incremental.cc (Incremental_inputs::report_archive_begin):
6471 Use Library_base; call library's get_mtime; add incremental inputs
6472 entry before members.
6473 (class Unused_symbol_visitor): New class.
6474 (Incremental_inputs::report_archive_end): Use Library_base; use
6475 visitor class to record unused symbols; don't add incremental inputs
6476 entry after members.
6477 (Incremental_inputs::report_object): Use Library_base.
6478 * incremental.h
6479 (Incremental_archive_entry::Incremental_archive_entry): Remove
6480 unused Archive parameter.
6481 (Incremental_inputs::report_archive_begin): Use Library_base.
6482 (Incremental_inputs::report_archive_end): Likewise.
6483 (Incremental_inputs::report_object): Likewise.
6484 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6485 function.
6486 * object.h (Object::for_all_global_symbols): New function.
6487 (Object::do_for_all_global_symbols): New function.
6488 (Sized_relobj::do_for_all_global_symbols): New function.
6489 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6490 function.
6491 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6492 function.
6493
61ab3e40
ILT
64942011-03-27 Ian Lance Taylor <iant@google.com>
6495
6496 * archive.cc (Archive::interpret_header): Return -1 if something
6497 goes wrong. Change callers accordingly.
6498
30e1f9e6
CC
64992011-03-25 Cary Coutant <ccoutant@google.com>
6500
6501 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6502 * testsuite/Makefile.in: Regenerate.
6503
9370ce59 65042011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6505
6506 * plugin.cc (get_view): New.
6507 (Plugin::load): Pass get_view to the plugin.
6508 (Plugin_manager::get_view): New.
6509
9312bb0a
ILT
65102011-03-21 Ian Lance Taylor <iant@google.com>
6511
6512 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6513 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6514
7e12ba9e
ST
65152011-03-21 Sriraman Tallam <tmsriram@google.com>
6516
6517 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6518 Change == to -eq.
6519 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6520 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6521 Change == to -eq.
6522 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6523 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6524
fd7a005d
ILT
65252011-03-14 Ian Lance Taylor <iant@google.com>
6526
6527 * script-sections.cc (Sort_output_sections::script_compare):
6528 Rename from is_before, change return type.
6529 (Sort_output_sections::operator()): Adjust accordingly.
6530
ed16fd1b
ILT
65312011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6532
6533 PR gold/12572
6534 * testsuite/odr_violation2.cc: Add comment to make all error line
6535 numbers double digits.
6536 * testsuite/debug_msg.sh: Adjust expected errors.
6537
71ff8986
ILT
65382011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6539
6540 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6541 but mark earlier ones as non-canonical
6542 (offset_to_iterator): Update search target and example
6543 (do_addr2line): Return extra lines in a vector*
6544 (format_file_lineno): Extract from do_addr2line
6545 (one_addr2line): Add vector* out-param
6546 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6547 when a lineno entry appeared last for its instruction
6548 (Dwarf_line_info): Add vector* out-param
6549 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6550 * symtab.cc (Odr_violation_compare): Include the lineno in the
6551 comparison again.
6552 (linenos_from_loc): New. Combine the canonical line for an
6553 address with its other lines.
6554 (True_if_intersect): New. Helper functor to make
6555 std::set_intersection a query.
6556 (detect_odr_violations): Compare sets of lines instead of just
6557 one line for each function. This became less deterministic, but
6558 has fewer false positives.
6559 * symtab.h: Declarations.
6560 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6561 mix an optimized and non-optimized object in the same binary
6562 (odr_violation2.so): Same.
6563 * testsuite/Makefile.in: Regenerate from Makefile.am.
6564 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6565 * testsuite/debug_msg.sh: Update line numbers and add
6566 assertions.
6567 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6568 non-optimized context.
6569 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6570 isn't inlined, and use OdrDerived in an optimized context.
6571 * testsuite/odr_header1.h: Defines OdrDerived, where
6572 optimization will change the
6573 first-instruction-in-the-destructor's file and line number.
6574 * testsuite/odr_header2.h: Defines OdrBase.
6575
a19fefdc
ILT
65762011-03-09 Ian Lance Taylor <iant@google.com>
6577
6578 * fileread.cc (File_read::clear_views): Don't delete the whole
6579 file view.
6580
ecb351e9
ILT
65812011-03-08 Ian Lance Taylor <iant@google.com>
6582
6583 PR gold/12525
6584 * fileread.cc: #include <climits>.
6585 (GOLD_IOV_MAX): Define.
6586 (File_read::read_multiple): Limit number of entries by iov_max.
6587 * fileread.h (class File_read): Always set max_readv_entries to
6588 128.
6589
b821d13c
ILT
65902011-03-07 Ian Lance Taylor <iant@google.com>
6591
6592 PR gold/12525
6593 * options.h (class General_options): Add -dy and -dn.
6594
89243142
CC
65952011-03-02 Cary Coutant <ccoutant@google.com>
6596
6597 * testsuite/script_test_9.t: Add TLS segment.
6598
d0773f31
ILT
65992011-03-02 Simon Baldwin <simonb@google.com>
6600
6601 * configure.ac: Add check for gnu_indirect_function support in
6602 the toolchain building binutils.
6603 * configure: Rebuild.
6604
9370ce59 66052011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6606
6607 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6608 plugin only symbols.
6609 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6610 in plugin files as not needed in the symbol table.
6611
4cf7a849
ST
66122011-02-11 Sriraman Tallam <tmsriram@google.com>
6613
6614 * output.cc (Output_section::add_input_section): Delay fill
6615 generation for section ordering.
6616
b578bd7d
ILT
66172011-02-09 Ian Lance Taylor <iant@google.com>
6618
6619 PR gold/12316
6620 * object.h (class Sized_relobj): Remove clear_local_symbols.
6621 * reloc.cc (Sized_relobj::do_relocate): Don't call
6622 clear_local_symbols.
6623
9370ce59 66242011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6625
6626 * plugin.cc (is_visible_from_outside): Return true for symbols
6627 in the -u option.
6628
55382fb7
ILT
66292011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6630
6631 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6632 filename.
6633
4e271fff
ST
66342011-02-02 Sriraman Tallam <tmsriram@google.com>
6635
6636 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6637 to std::string.
4e271fff 6638 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6639 section_name to be std::string.
4e271fff
ST
6640 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6641
d433c3ac
ILT
66422011-01-25 Ian Lance Taylor <iant@google.com>
6643
6644 * script.cc (script_add_extern): Rewrite to use
6645 add_symbol_reference.
6646
880473a6
DK
66472011-01-25 Doug Kwan <dougkwan@google.com>
6648
d433c3ac 6649 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6650
f30f86fa
ILT
66512011-01-24 Ian Lance Taylor <iant@google.com>
6652
6653 * options.h (class General_options): Accept
6654 --no-detect-odr-violations.
6655
8e51a0b9
ILT
66562011-01-24 Ian Lance Taylor <iant@google.com>
6657
6658 * version.cc (version_string): Bump to 1.11.
6659
0f3b89d8
ILT
66602011-01-24 Ian Lance Taylor <iant@google.com>
6661
6662 * plugin.cc (class Plugin_rescan): Define new class.
6663 (Plugin_manager::claim_file): Set any_claimed_.
6664 (Plugin_manager::save_archive): New function.
6665 (Plugin_manager::save_input_group): New function.
6666 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6667 necessary.
6668 (Plugin_manager::new_undefined_symbol): New function.
6669 (Plugin_manager::rescan): New function.
6670 (Plugin_manager::rescannable_defines): New function.
6671 (Plugin_manager::add_input_file): Set any_added_.
6672 * plugin.h (class Plugin_manager): define new fields rescannable_,
6673 undefined_symbols_, any_claimed_, and any_added_. Declare
6674 Plugin_rescan as friend. Declare new functions.
6675 (Plugin_manager::Rescannable): Define type.
6676 (Plugin_manager::Rescannable_list): Define type.
6677 (Plugin_manager::Undefined_symbol_list): Define type.
6678 (Plugin_manager::Plugin_manager): Initialize new fields.
6679 * archive.cc (Archive::defines_symbol): New function.
6680 (Add_archive_symbols::run): Pass archive to plugins if any.
6681 * archive.h (class Archive): Declare defines_symbol.
6682 * readsyms.cc (Input_group::~Input_group): New function.
6683 (Finish_group::run): Pass input_group to plugins if any.
6684 * readsyms.h (class Input_group): Declare destructor.
6685 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6686 any.
6687
3bb951e5
ILT
66882011-01-10 Ian Lance Taylor <iant@google.com>
6689
6690 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6691 section as relro.
6692 (Layout::set_segment_offsets): Reset increase_relro before calling
6693 set_section_addresses a second time.
6694
0aa45fac
CC
66952011-01-04 Cary Coutant <ccoutant@google.com>
6696
6697 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6698 sections before NOBITS sections.
6699
0db46eb4
L
67002011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6701
6702 * version.cc (print_version): Update copyright to 2011.
6703
829c9745
CC
67042010-12-23 Cary Coutant <ccoutant@google.com>
6705
6706 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6707 of OS to this->add. Add OD parameter to second form of the function.
6708
7500420b
ILT
67092010-12-20 Ian Lance Taylor <iant@google.com>
6710
6711 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6712 second of two consecutive entries with same offset.
6713
f8e9a930
RW
67142010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6715
6716 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6717 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6718 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6719 to avoid unneeded links against $(LDADD).
6720 * testsuite/Makefile.in: Regenerate.
6721
2fbb4320
ILT
67222010-12-15 Ian Lance Taylor <iant@google.com>
6723
6724 PR gold/12324
6725 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6726 for R_X86_64_32 and R_X86_64_PC32.
6727 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6728 ver_matching_def_pic.o.
6729 (ver_matching_def_pic.o): New target.
6730
fedb228d
RW
67312010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6732
6733 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6734 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6735 Move definition before File_read::View member definitions.
6736 (File_read::View::~View): Initialize and hold lock before
6737 updating current_mapped_bytes.
6738
9b547ce6
RW
67392010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6740
6741 * dwarf_reader.cc: Remove outdated comment.
6742 * gold-threads.cc: Fix typo in error message.
6743 * archive.cc: Fix typos in comments.
6744 * archive.h: Likewise.
6745 * arm-reloc-property.cc: Likewise.
6746 * arm-reloc-property.h: Likewise.
6747 * arm-reloc.def: Likewise.
6748 * arm.cc: Likewise.
6749 * attributes.h: Likewise.
6750 * cref.cc: Likewise.
6751 * ehframe.cc: Likewise.
6752 * fileread.h: Likewise.
6753 * gold.h: Likewise.
6754 * i386.cc: Likewise.
6755 * icf.cc: Likewise.
6756 * incremental.h: Likewise.
6757 * int_encoding.cc: Likewise.
6758 * layout.h: Likewise.
6759 * main.cc: Likewise.
6760 * merge.h: Likewise.
6761 * object.cc: Likewise.
6762 * object.h: Likewise.
6763 * options.cc: Likewise.
6764 * readsyms.cc: Likewise.
6765 * reduced_debug_output.cc: Likewise.
6766 * reloc.cc: Likewise.
6767 * script-sections.cc: Likewise.
6768 * sparc.cc: Likewise.
6769 * symtab.h: Likewise.
6770 * target-reloc.h: Likewise.
6771 * target.cc: Likewise.
6772 * target.h: Likewise.
6773 * timer.cc: Likewise.
6774 * timer.h: Likewise.
6775 * x86_64.cc: Likewise.
6776
83e17bd5
CC
67772010-12-09 Cary Coutant <ccoutant@google.com>
6778
6779 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6780 stack.
6781 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6782 parameter; change all callers.
6783 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6784 * options.h (warn_execstack): New option.
6785
017257f8
DK
67862010-12-07 Doug Kwan <dougkwan@google.com>
6787
6788 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6789 like function call relocations.
6790
c20cbc06
ILT
67912010-12-07 Ian Lance Taylor <iant@google.com>
6792
6793 * archive.cc (Archive::get_elf_object_for_member): Permit
6794 punconfigured to be NULL.
6795 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6796 (Archive::include_member): Pass NULL to get_elf_object_for_member
6797 if we searched for the archive and this is the first included
6798 object.
6799
4dbfafcc
ILT
68002010-12-01 Ian Lance Taylor <iant@google.com>
6801
6802 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6803 track_relocs_type_ field.
6804 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6805 Set track_relocs_type_.
6806 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6807 contents when using RELA relocs.
6808 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6809 reloc_map_.
6810 * reloc.cc (Track_relocs::next_addend): New function.
6811 * reloc.h (class Track_relocs): Declare next_addend.
6812
e5e19edd
ILT
68132010-12-01 Ian Lance Taylor <iant@google.com>
6814
6815 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6816 virtual destructor.
6817
9a5ce24c
ILT
68182010-12-01 Ian Lance Taylor <iant@google.com>
6819
6820 * README: Update compilers known to work and fail.
6821
c7791212
NC
68222010-11-23 Matthias Klose <doko@ubuntu.com>
6823
6824 * configure.in: For --enable-gold, handle value `default' instead of
6825 `both*'. Always install ld as ld.bfd, install as ld if gold is
6826 not the default.
6827 * configure: Regenerate.
6828
0ad220c9
DK
68292010-11-18 Doug Kwan <dougkwan@google.com>
6830
6831 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6832 and right_alignment to be zero. Store result alignment only if it is
6833 greater than existing alignment.
6834
ab8056e0
CC
68352010-11-16 Cary Coutant <ccoutant@google.com>
6836
6837 PR gold/12220
6838 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6839 Check for ".zdebug_line".
6840
fd064a5b
CC
68412010-11-16 Doug Kwan <dougkwan@google.com>
6842 Cary Coutant <ccoutant@google.com>
6843
6844 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6845 by reference; adjust all callers.
6846 * output.cc (Output_segment::set_section_addresses): Adjust references
6847 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6848 list is empty.
6849 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6850 end at page boundary.
6851
6fc6ea19
CC
68522010-11-16 Cary Coutant <ccoutant@google.com>
6853
6854 PR gold/12220
6855 * layout.cc (Layout::choose_output_section): Transform names of
6856 compressed sections even when using a script with a SECTIONS clause.
6857 (Layout::output_section_name): Remove code to transform
6858 compressed debug section names.
6859 * output.cc (Output_section::add_input_section): Use uncompressed
6860 section size when tracking input sections.
6861
95a2c8d6
RS
68622010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6863
6864 * symtab.h (Symbol::NON_PIC_REF): Remove.
6865 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6866 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6867 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6868 (Symbol::use_plt_offset): Take a flags argument and pass it
6869 directly to needs_dynamic_reloc. Restrict check for undefined
6870 weak symbols to function calls.
6871 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6872 (Target_arm::Scan::global): Use it.
6873 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6874 (Target_arm::Relocate::relocate): Likewise.
6875 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6876 parameter with an r_type parameter. Use get_reference_flags
6877 to get the flags.
6878 (Target_arm::Relocate::relocate): Update accordingly.
6879 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6880 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6881 (Target_i386::Scan::global): Likewise.
6882 (Target_i386::Relocate::relocate): Likewise.
6883 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6884 parameter with an r_type parameter. Use get_reference_flags
6885 to get the flags.
6886 (Target_i386::Relocate::relocate): Update accordingly.
6887 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6888 (Target_powerpc::Scan::global): Use it.
6889 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6890 (Target_powerpc::Relocate::relocate): Likewise.
6891 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6892 (Target_sparc::Scan::global): Use it.
6893 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6894 (Target_sparc::Relocate::relocate): Likewise.
6895 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6896 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6897 (Target_x86_64::Scan::global): Likewise.
6898 (Target_x86_64::Relocate::relocate): Likewise.
6899
f625ae50
DK
69002010-11-08 Doug Kwan <dougkwan@google.com>
6901 Cary Coutant <ccoutant@google.com>
6902
6903 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6904 (Arm_exidx_merge_section::section_contents_): New data member.
6905 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6906 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6907 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6908 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6909 in parameters instead of calling Object::section_contents without
6910 locking.
6911 (Arm_output_section::group_section): New parameter TASK. Pass it
6912 to callees that need locking objects.
6913 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6914 to lock EXIDX input sections. Fix a formatting issue. Call
6915 Arm_exidx_merged_section::build_contents to create merged section
6916 contents.
6917 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6918 to lock object of stub table owner.
6919 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6920 TEXT_SIZE to initialize data member TEXT_SIZE_.
6921 (Arm_exidx_input_section::addralign): Fix typo in comment.
6922 (Arm_exidx_input_section::text_size): New method.
6923 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6924 that require locking objects. Lock objects before scanning for stubs
6925 and updating local symbols.
6926 (Arm_input_section<big_endian>::init): Copy contents of original
6927 input section.
2e702c99 6928 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6929 original input section instead of calling Object::section_contents
6930 without locking.
6931 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6932 size without calling Object::section_size().
6933 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6934 for size. Allocate a buffer for merged EXIDX entries.
6935 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6936 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6937 building code to Arm_exidx_merged_section::build_contetns. Write
6938 out contetns in buffer instead of building it on the fly.
6939 (Arm_relobj::make_exidx_input_section): Also pass text section size
6940 to Arm_exidx_input_section constructor.
6941 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6942 (Arm_dynobj::do_read_symbols): Fix memory leak.
6943 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6944 * target.h: (class Task): Add forward declaration.
6945 (Target::relax): Add new parameter TASK and pass it to
6946 Target::do_relax().
6947 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6948
5f9bcf58
CC
69492010-11-05 Cary Coutant <ccoutant@google.com>
6950
6951 PR gold/10708
6952 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6953 object when reading from the file.
6954 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6955 second layout pass.
6956 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6957 when reading section contents.
6958 (get_section_contents): Likewise.
6959 (icf::find_identical_sections): Likewise.
6960 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6961 object when reading from the file.
6962 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6963 the object when doing deferred section layout.
6964
e597fa08
NC
69652010-11-03 Nick Clifton <nickc@redhat.com>
6966
6967 PR gold/12001
6968 * script.h (class Symbol_assignment: name): New member. Returns
6969 the name of the symbol.
6970 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6971 Returns true if the given symbol name is on the list of
6972 assignments wating to be processed.
6973 * archive.cc (should_incldue_member): If the symbol is undefined,
6974 check to see if it is on the list of symbols pending assignment.
6975
3f9a3278
ILT
69762010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6977
6978 * script-sections.cc (Script_sections::find_memory_region): Check
6979 for a NULL output section pointer.
6980
d06fb4d1
DK
69812010-10-29 Doug Kwan <dougkwan@google.com>
6982
6983 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6984 Output_section::add_relaxed_input_section.
6985 * output.cc (Output_section::add_relaxed_input_section): Add new
6986 arguments LAYOUT and NAME. Set section order index.
6987 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6988 Copy section order index.
6989 * output.h (Output_section::add_relaxed_input_section): Add new
6990 arguments LAYOUT and NAME.
6991
90e24de5
ILT
69922010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6993
6994 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6995 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6996 * testsuite/Makefile.in: Regenerate.
6997
c9484ea5
DK
69982010-10-20 Doug Kwan <dougkwan@google.com>
6999
7000 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7001 without SHF_LINK_ORDER flags.
7002 * layout.cc (Layout::choose_output_section): Do not filter
7003 SHF_LINK_ORDER flag in a relocatable link.
7004
5bc2f5be
CC
70052010-10-17 Cary Coutant <ccoutant@google.com>
7006
7007 * output.h (Output_segment::set_section_addresses): Change function
7008 signature. Update all callers.
7009 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7010 sections.
7011 (Output_segment::set_section_addresses): Align after last TLS
7012 section. Add padding before last relro section instead of after.
7013
0c91cf04
DK
70142010-10-17 Doug Kwan <dougkwan@google.com>
7015
7016 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7017 GOT output section to be writable.
7018
8c21d9d3
CC
70192010-10-14 Cary Coutant <ccoutant@google.com>
7020
7021 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7022 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7023 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7024 mode.
7025 * incremental.cc (report_command_line): Ignore all forms of
7026 --incremental.
7027 * layout.cc (Layout::Layout): Check parameters for incremental link
7028 mode.
7029 * options.cc (General_options::parse_incremental): New function.
7030 (General_options::parse_no_incremental): New function.
7031 (General_options::parse_incremental_full): New function.
7032 (General_options::parse_incremental_update): New function.
7033 (General_options::incremental_mode_): New data member.
7034 (General_options::finalize): Check incremental_mode_.
7035 * options.h (General_options): Update help text for --incremental.
7036 Add --no-incremental, --incremental-full, --incremental-update.
7037 (General_options::Incremental_mode): New enum type.
7038 (General_options::incremental_mode): New function.
7039 (General_options::incremental_mode_): New data member.
7040 * parameters.cc (Parameters::incremental_mode_): New data member.
7041 (Parameters::set_options): Set incremental_mode_.
7042 (Parameters::set_incremental_full): New function.
7043 (Parameters::incremental): New function.
7044 (Parameters::incremental_update): New function.
7045 (set_parameters_incremental_full): New function.
7046 * parameters.h (Parameters::set_incremental_full): New function.
7047 (Parameters::incremental): New function.
7048 (Parameters::incremental_update): New function.
7049 (Parameters::incremental_mode_): New data member.
7050 (set_parameters_incremental_full): New function.
7051 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7052 incremental link mode.
7053 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7054 (Sized_relobj::do_relocate_sections): Likewise.
7055 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7056 option.
7057 * testsuite/Makefile.in: Regenerate.
7058 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7059
bb32aa18 70602010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7061
7062 * script-sections.h (class Script_sections): Make
7063 Sections_elements typedef public.
7064 * script-sections.cc (class Sort_output_sections): Add elements_
7065 field. Add constructor which sets it; change all callers.
7066 (Sort_output_sections::is_before): New function.
7067 (Sort_output_sections::operator()): Call is_before.
7068 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7069 conditional.
7070 * testsuite/script_test_10.sh: New test. Test script section
7071 order.
7072 * testsuite/script_test_10.t: Likewise.
7073 * testsuite/script_test_10.s: Likewise.
7074 * testsuite/Makefile.am: Wrap the cross linker tests and the
7075 common tests into NATIVE_OR_CROSS_LINKER.
7076 (check_SCRIPTS): Add script_test_10.sh.
7077 (check_DATA): Add script_test_10.stdout.
7078 (script_test_10.o, script_test_10): New targets.
7079 (script_test_10.stdout): New target.
7080 * configure, testsuite/Makefile.in: Regenerate.
7081
3cef7179
ILT
70822010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7083
7084 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7085 error for the deprecated relocations.
7086 (Target_arm::Scan::global): Likewise.
7087 (Target_arm::Relocate::relocate): Likewise.
7088
7411e9a8
RS
70892010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7090
7091 * fileread.cc (Input_file::find_file): Initialize *found_name
7092 and *namep when using the fallback search for case 4.
7093
6a9da32a
CC
70942010-10-11 Cary Coutant <ccoutant@google.com>
7095
7096 * options.h (class General_options): Redefine -z lazy as an alias for
7097 the negation of -z now.
7098
ac897c20
ILT
70992010-10-11 Ian Lance Taylor <iant@google.com>
7100
7101 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7102 binding.
7103
ea5cae92
NC
71042010-10-06 Nick Clifton <nickc@redhat.com>
7105
7106 * script-sections.cc(class Memory_region): Remove
7107 current_lma_offset_ field. Rename current_vma_offset_ to
7108 current_offset_. Add last_section_ field.
7109 (Memory_region::get_current_vma_address): Rename to
7110 get_current_address.
7111 (Memory_region::get_current_lma_address): Delete.
7112 (Memory_region::increment_vma_offset): Rename to
7113 increment_offset.
7114 (Memory_region::increment_lma_offset): Delete.
7115 (Memory_region::attributes_compatible): New method. Returns
7116 true if the provided section is compatible with the region.
7117 (Memory_region::get_last_section): New method. Returns the last
7118 section to use the region.
7119 (Memory_region::set_last_section): New method. Stores the last
7120 section to use the region.
7121 (Script_sections::block_in_region): New method. Returns true if
7122 a block of memory is contained within a region.
7123 (Script_sections::find_memory_region): New method. Locates a
7124 memory region to be used to set a VMA or LMA address.
7125 (Output_section_definition::set_section_addresses): Add code to
7126 check for addresses set by memory regions.
7127 (Output_segment::set_section_addresses): Remove memory region
7128 walking code.
7129 (Script_sections::create_segment): Add a warning if a header
7130 segment is created outside of any region.
7131 * script-sections.h (class Script_sections): Add prototypes for
7132 find_memory_region and block_in_region methods.
7133 * testsuite/memory_test.s: Use .long instead of .word.
7134 * testsuite/memory_test.t: Add some more output sections.
7135 * testsuite/memory_test.sh: Update expected output.
7136
a9bfd952
DK
71372010-10-02 Doug Kwan <dougkwan@google.com>
7138
7139 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7140 defintion to symtab.h
7141 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7142 declaration to defintion.
7143
bacff3ab
NC
71442010-10-01 Nick Clifton <nickc@redhat.com>
7145
7146 * expression.cc (eval): Replace dummy argument with NULL.
7147 (eval_maybe_dot): Check for a NULL result section pointer.
7148 (Symbol_expression::value): Likewise.
7149 (Dot_expression::value): Likewise.
7150 (BINARY_EXPRESSION): Likewise.
7151 (Max_expression::value): Likewise.
7152 (Min_expression::value): Likewise.
7153 (Absolute_expression::value): Likewise.
7154 (Addr_expression::value_from_output_section): Likewise.
7155 (Loaddddr_expression::value_from_output_section): Likewise.
7156 (Segment_start_expression::value): Likewise.
7157 * script-sections.cc
7158 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7159 argument with NULL.
7160 (Sections_elememt_dot_assignment::set_section_addresses):
7161 Likewise.
7162 (Output_data_expression::do_write_to_buffer): Likewise.
7163 (Output_section_definition::finalize_symbols): Likewise.
7164 (Output_section_definition::set_section_addresses): Likewise.
7165
f81bc8b5
DK
71662010-09-30 Doug Kwan <dougkwan@google.com>
7167
7168 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7169
c95e9f27
ST
71702010-09-28 Sriraman Tallam <tmsriram@google.com>
7171
7172 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7173 function.
c95e9f27
ST
7174 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7175 virtual function.
7176 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7177 virtual function.
7178 * icf.cc (get_section_contents): Inline merge sections only when
7179 target allows it.
7180
3cac54d2
RW
71812010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7182
7183 * configure: Regenerate.
7184
2904037a
ILT
71852010-09-17 Ian Lance Taylor <iant@google.com>
7186
7187 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7188 * testsuite/Makefile.am (memory_test.o): New target.
7189 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7190 memory_test.t.
7191 * testsuite/Makefile.in: Rebuild.
2904037a 7192
bca7fb63
DK
71932010-09-17 Doug Kwan <dougkwan@google.com>
7194
7195 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7196 defintion if relocation uses GOT entries of the symbol.
7197 * testsuite/icf_safe_test.sh: Fix test.
7198 * testsuite/icf_safe_so_test.sh: Fix test.
7199
4ef28648
CC
72002010-09-16 Cary Coutant <ccoutant@google.com>
7201
7202 * script_sections.cc (class Memory_region): Remove "NULL" from
7203 vector initializations.
7204
793990de
CC
72052010-09-15 Cary Coutant <ccoutant@google.com>
7206
7207 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7208 Resolve forwarding symbols.
7209
81e015e2
DK
72102010-09-15 Doug Kwan <dougkwan@google.com>
7211
7212 * gold/testsuite/script_test_3.t: Add ARM special sections.
7213 * gold/testsuite/script_test_4.t: Same.
7214 * gold/testsuite/script_test_5.t: Same.
7215 * gold/testsuite/script_test_6.t: Same.
7216 * gold/testsuite/script_test_7.t: Same.
7217 * gold/testsuite/script_test_7.t: Same.
7218 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7219
36171d64
CC
72202010-09-14 Cary Coutant <ccoutant@google.com>
7221
7222 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7223 (Target_x86_64::Relocate::relocate_tls): Replace check for
7224 saw_tls_block_reloc_ with test for executable section.
7225
d89051bd
CC
72262010-09-12 Cary Coutant <ccoutant@google.com>
7227
7228 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7229 position-independent executables to shared libraries need dynamic
7230 relocations.
7231 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7232 position-independent executables.
7233 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7234 * testsuite/Makefile.in: Regenerate.
7235
fca41f0f
NC
72362010-09-10 Nick Clifton <nickc@redhat.com>
7237
7238 PR gold/11997
7239 * testsuite/memory_test.t: Discard any sections that are not
7240 needed.
7241
6695e4b3
L
72422010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7243
7244 PR gold/11996
7245 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7246 "This::" to work around a bug in gcc 4.2.
7247
7248 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7249
0f72bf6f
RÁE
72502010-09-09 Rafael Espindola <espindola@google.com>
7251
7252 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7253 sections with different PF_X flags in the same segment.
7254 (Layout::find_first_load_seg): Search all segments to find the first
7255 one.
7256 * options.h (rosegment): New.
7257
72582010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7259
05a79166 7260 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7261
aa98ff75
DK
72622010-09-08 Doug Kwan <dougkwan@google.com>
7263
7264 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7265 (Arm_relobj::do_relocate_sections): Add new parameter for output
7266 file to match the parent.
7267 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7268 of local symbols instead of input values. Update code to track
7269 changes in gold::relocate_section.
7270 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7271 (Sized_relobj::compute_final_local_value_internal): New methods.
7272 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7273 body into private version of Sized_relobj::compute_final_local_value.
7274 Call the inline method.
7275 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7276 merged symbol value if there is one.
7277 (Symbol_value::has_output_value): New method defintiion.
7278 (Sized_relobj::Compute_final_local_value_status): New enum type.
7279 (Sized_relobj::compute_final_local_value): New methods.
7280 (Sized_relobj::compute_final_local_value_internal): New methods.
7281 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7282 and arm_cortex_a8.sh.
7283 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7284 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7285 New tests.
7286 * Makefile.in: Regenerate.
7287 * testsuite/arm_bl_out_of_range.s: Update test.
7288 * testsuite/thumb_bl_out_of_range.s: Ditto.
7289 * testsuite/thumb_blx_out_of_range.s: Ditto.
7290 * testsuite/arm_branch_out_of_range.sh: New file.
7291 * testsuite/arm_cortex_a8.sh: Ditto.
7292 * testsuite/arm_cortex_a8_b.s: Ditto.
7293 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7294 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7295 * testsuite/arm_cortex_a8_bl.s: Ditto.
7296 * testsuite/arm_cortex_a8_blx.s: Ditto.
7297 * testsuite/arm_cortex_a8_local.s: Ditto.
7298 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7299 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7300
05a79166
L
73012010-09-08 Rafael Espindola <espindola@google.com>
7302
7303 * Makefile.am (memory_test.stdout): Run readelf with -W.
7304 * Makefile.in: Regenerate.
7305 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7306 64 bit output.
7307
33dbc701
RÁE
73082010-09-08 Rafael Espindola <espindola@google.com>
7309
7310 * script-sections.cc (Script_sections::add_memory_region): Convert
7311 field precision to int.
7312 * script.cc (script_set_section_region, script_set_section_region):
7313 Convert field precision to int.
7314
731ca54a
RÁE
73152010-09-08 Rafael Espindola <espindola@google.com>
7316
7317 * arm.cc (do_finalize_sections): Create the __exidx_start and
7318 __exdix_end symbols even when the section is missing.
7319
7f8cd844
NC
73202010-09-08 Nick Clifton <nickc@redhat.com>
7321
7322 * README: Remove claim that MEMORY is not supported.
7323 * expression.cc (script_exp_function_origin)
7324 (script_exp_function_length): Move from here to ...
7325 * script.cc: ... here.
7326 (script_set_section_region, script_add_memory)
7327 (script_parse_memory_attr, script_include_directive): New
7328 functions.
7329 * script-sections.cc
7330 (class Memory_region): New class.
7331 (class Output_section_definition): Add set_memory_region,
7332 set_section_vma, set_section_lma and get_section_name methods.
7333 (class Script_Sections): Add add_memory_region,
7334 find_memory_region, find_memory_region_origin,
7335 find_memory_region_length and set_memory_region methods.
7336 Have set_section_addresses method walk the list of set memory
7337 regions.
7338 Extend the print methos to display memory regions.
7339 * script-sections.h: Add prototypes for new methods.
7340 Add enum for MEMORY region attributes.
7341 * yyscript.y: Add support for parsing MEMORY regions.
7342 * script-c.h: Add prototypes for new functions.
7343 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7344 * testsuite/Makefile.in: Regenerate.
7345 * testsuite/memory_test.sh: New script.
7346 * testsuite/memory_test.s: New assembler source file.
7347 * testsuite/memory_test.t: New linker script.
7348
a4649286
DK
73492010-08-27 Doug Kwan <dougkwan@google.com>
7350
7351 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7352 reference override an existing dynamic weak reference.
7353 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7354 * testsuite/Makefile.in: Regenerate.
7355 * testsuite/dyn_weak_ref.sh: New file.
7356 * testsuite/dyn_weak_ref_1.c: Ditto.
7357 * testsuite/dyn_weak_ref_2.c: Ditto.
7358
b56648ad
ILT
73592010-08-27 Ian Lance Taylor <iant@google.com>
7360
7361 * incremental.h (class Incremental_input_entry): Add virtual
7362 destructor.
7363
809313cb
ILT
73642010-08-27 Ian Lance Taylor <iant@google.com>
7365
7366 * testsuite/start_lib_test_3.c: Mark t3 as used.
7367
11e32464
NC
73682010-08-27 Nick Clifton <nickc@redhat.com>
7369
7370 * options.cc (version_script): Fix small typo in previous
7371 whitespace tidyup.
7372
ca09d69a
NC
73732010-08-25 Nick Clifton <nickc@redhat.com>
7374
7375 * archive.cc: Formatting fixes: Remove whitespace between
7376 typename and following asterisk. Remove whitespace between
7377 function name and opening parenthesis.
7378 * archive.h: Likewise.
7379 * arm.cc: Likewise.
7380 * attributes.cc: Likewise.
7381 * attributes.h: Likewise.
7382 * common.cc: Likewise.
7383 * copy-relocs.cc: Likewise.
7384 * dirsearch.h: Likewise.
7385 * dynobj.cc: Likewise.
7386 * ehframe.cc: Likewise.
7387 * ehframe.h: Likewise.
7388 * expression.cc: Likewise.
7389 * fileread.cc: Likewise.
7390 * fileread.h: Likewise.
7391 * gc.h: Likewise.
7392 * gold-threads.cc: Likewise.
7393 * gold.cc: Likewise.
7394 * i386.cc: Likewise.
7395 * icf.h: Likewise.
7396 * incremental-dump.cc: Likewise.
7397 * incremental.cc: Likewise.
7398 * layout.cc: Likewise.
7399 * layout.h: Likewise.
7400 * main.cc: Likewise.
7401 * merge.cc: Likewise.
7402 * merge.h: Likewise.
7403 * object.cc: Likewise.
7404 * object.h: Likewise.
7405 * options.cc: Likewise.
7406 * options.h: Likewise.
7407 * output.cc: Likewise.
7408 * output.h: Likewise.
7409 * plugin.cc: Likewise.
7410 * plugin.h: Likewise.
7411 * powerpc.cc: Likewise.
7412 * reloc.cc: Likewise.
7413 * script-c.h: Likewise.
7414 * script-sections.cc: Likewise.
7415 * script.cc: Likewise.
7416 * stringpool.cc: Likewise.
7417 * symtab.cc: Likewise.
7418 * symtab.h: Likewise.
7419 * target.cc: Likewise.
7420 * timer.cc: Likewise.
7421 * timer.h: Likewise.
7422 * version.cc: Likewise.
7423 * x86_64.cc: Likewise.
7424
b8fa8750
NC
74252010-08-24 Nick Clifton <nickc@redhat.com>
7426
7427 PR 11899
7428 * layout.cc (segment_precedes): Sort segments by their physical
7429 addresses, if they have been set.
7430
9919d93b
CC
74312010-08-23 Cary Coutant <ccoutant@google.com>
7432
7433 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7434 symbols data.
7435 (Lib_group::include_member): Unlock object after deleting its
7436 symbols data.
7437 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7438 the bug fixed here.
7439
97b4be1c
CC
74402010-08-19 Neil Vachharajani <nvachhar@google.com>
7441 Cary Coutant <ccoutant@google.com>
7442
7443 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7444 constructor, and set_blocker.
7445 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7446 readsyms_blocker_.
7447 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7448 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7449 * testsuite/Makefile.am (start_lib_test): New test case.
7450 * testsuite/Makefile.in: Regenerate.
7451 * testsuite/start_lib_test_main.c: New file.
7452 * testsuite/start_lib_test_1.c: New file.
7453 * testsuite/start_lib_test_2.c: New file.
7454 * testsuite/start_lib_test_3.c: New file.
7455
dd0b1884
ILT
74562010-08-19 Ian Lance Taylor <iant@google.com>
7457
7458 * Makefile.in: Rebuild with automake 1.11.1.
7459 * aclocal.m4: Likewise.
7460 * testsuite/Makefile.in: Likewise.
7461
7223e9ca
ILT
74622010-08-19 Ian Lance Taylor <iant@google.com>
7463
7464 PR 10893
7465 * i386.cc (class Output_data_plt_i386): Update declarations.
7466 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7467 local_ifuncs_ fields.
7468 (Target_i386::do_plt_section_for_global): New function.
7469 (Target_i386::do_plt_section_for_local): New function.
7470 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7471 parameter; change all callers. Initialize global_ifuncs_ and
7472 local_ifuncs_. If doing a static link define __rel_iplt_start and
7473 __rel_iplt_end.
7474 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7475 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7476 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7477 symbols.
7478 (Target_i386::make_plt_section): New function, broken out of
7479 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7480 (Target_i386::make_plt_entry): Call make_plt_section.
7481 (Target_i386::make_local_ifunc_plt_entry): New function.
7482 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7483 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7484 R_386_IRELATIVE to switch.
7485 (Target_i386::Scan::global): Likewise.
7486 (Target_i386::Relocate::relocate): Likewise.
7487 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7488 switch.
7489 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7490 (Target_x86_64::do_plt_section_for_global): New function.
7491 (Target_x86_64::do_plt_section_for_local): New function.
7492 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7493 parameter; change all callers. If doing a static link define
7494 __rela_iplt_start and __rela_iplt_end.
7495 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7496 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7497 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7498 to point to .plt.
7499 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7500 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7501 switch.
7502 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7503 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7504 R_X86_64_IRELATIVE to switch.
7505 (Target_x86_64::Scan::global): Likewise.
7506 (Target_x86_64::Relocate::relocate): Likewise.
7507 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7508 switch.
7509 * target.h (class Target): Add plt_section_for_global and
7510 plt_section_for_local functions. Add do_plt_section_for_global
7511 and do_plt_section_for_local virtual functions.
7512 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7513 clarifying comments.
7514 (Symbol::use_plt_offset): Handle IFUNC symbol.
7515 * object.cc (Sized_relobj::Sized_relobj): Initialize
7516 local_plt_offsets_.
7517 (Sized_relobj::local_has_plt_offset): New function.
7518 (Sized_relobj::local_plt_offset): New function.
7519 (Sized_relobj::set_local_plt_offset): New function.
7520 (Sized_relobj::do_count): Handle IFUNC symbol.
7521 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7522 a bit away from input_shndx_ field. Add set_is_func_symbol and
7523 is_ifunc_symbol functions.
7524 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7525 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7526 local_plt_offsets_ field.
7527 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7528 * output.h (class Output_section_data): Add non-const
7529 output_section function.
7530 (class Output_data_got): Update declarations.
7531 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7532 Add use_plt_offset parameter to global and local constructors.
7533 Change all callers. Change local_sym_index_ field to 31 bits.
7534 Change GSYM_CODE and CONSTANT_CODE accordingly.
7535 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7536 doing a static link don't set sh_link field.
7537 (Output_data_got::Got_entry::write): Use PLT offset if
7538 appropriate.
7539 (Output_data_got::add_global_plt): New function.
7540 (Output_data_got::add_local_plt): New function.
7541 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7542 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7543 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7544 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7545 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7546 IFUNC conditional.
7547 * testsuite/ifunc-sel.h: New file.
7548 * testsuite/ifuncmain1.c: New file.
7549 * testsuite/ifuncmain1vis.c: New file.
7550 * testsuite/ifuncmod1.c: New file.
7551 * testsuite/ifuncdep2.c: New file.
7552 * testsuite/ifuncmain2.c: New file.
7553 * testsuite/ifuncmain3.c: New file.
7554 * testsuite/ifuncmod3.c: New file.
7555 * testsuite/ifuncmain4.c: New file.
7556 * testsuite/ifuncmain5.c: New file.
7557 * testsuite/ifuncmod5.c: New file.
7558 * testsuite/ifuncmain6pie.c: New file.
7559 * testsuite/ifuncmod6.c: New file.
7560 * testsuite/ifuncmain7.c: New file.
7561 * configure, testsuite/Makefile.in: Rebuild.
7562
56f75c03
ILT
75632010-08-18 Ian Lance Taylor <iant@google.com>
7564
7565 * incremental.cc
7566 (Output_section_incremental_inputs::write_input_files): Add cast
7567 to avoid signed/unsigned comparison warning.
7568 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7569
55455f89
CC
75702010-08-12 Cary Coutant <ccoutant@google.com>
7571
7572 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7573
e2054bcb
ILT
75742010-08-13 Ian Lance Taylor <iant@google.com>
7575
7576 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7577
74f67560
DK
75782010-08-12 Cary Coutant <ccoutant@google.com>
7579 Doug Kwan <dougkwan@google.com>
7580
7581 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7582 defintion overrides non-weak undef, remember that the original undef
7583 is not weak.
7584 * symtab.cc (Symbol_table::sized_write_global): For undef without
7585 an original weak binding, set binding to global in output.
7586 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7587 * testsuite/Makefile.in: Regenerate.
7588 * testsuite/strong_ref_weak_def.sh: New file.
7589 * testsuite/strong_ref_weak_def_1.c: Ditto.
7590 * testsuite/strong_ref_weak_def_2.c: Ditto.
7591
d1238d12
CC
75922010-08-12 Cary Coutant <ccoutant@google.com>
7593
7594 * testsuite/incremental_test.sh: Rewrite.
7595 * testsuite/incremental_test_1.c: Rewrite.
7596 * testsuite/incremental_test_2.c: Rewrite.
7597
0e70b911
CC
75982010-08-12 Cary Coutant <ccoutant@google.com>
7599
7600 * arm.cc (Target_arm::got_size): Add const.
7601 (Target_arm::got_entry_count): New function.
7602 (Target_arm::plt_entry_count): New function.
7603 (Target_arm::first_plt_entry_offset): New function.
7604 (Target_arm::plt_entry_size): New function.
7605 (Output_data_plt_arm::entry_count): New function.
7606 (Output_data_plt_arm::first_plt_entry_offset): New function.
7607 (Output_data_plt_arm::get_plt_entry_size): New function.
7608 * i386.cc (Target_i386::got_size): Add const.
7609 (Target_i386::got_entry_count): New function.
7610 (Target_i386::plt_entry_count): New function.
7611 (Target_i386::first_plt_entry_offset): New function.
7612 (Target_i386::plt_entry_size): New function.
7613 (Output_data_plt_i386::entry_count): New function.
7614 (Output_data_plt_i386::first_plt_entry_offset): New function.
7615 (Output_data_plt_i386::get_plt_entry_size): New function.
7616 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7617 find_incremental_inputs_sections. Dump incremental_got_plt section.
7618 * incremental.cc: Include target.h.
7619 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7620 parameter. Adjust all callers. Find incremental_got_plt section.
7621 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7622 section.
7623 (Output_section_incremental_inputs::set_final_data_size): Calculate
7624 size of incremental_got_plt section.
7625 (Output_section_incremental_inputs::do_write): Write the
7626 incremental_got_plt section.
7627 (Got_plt_view_info): New struct.
7628 (Local_got_offset_visitor): New class.
7629 (Global_got_offset_visitor): New class.
7630 (Global_symbol_visitor_got_plt): New class.
7631 (Output_section_incremental_inputs::write_got_plt): New function.
7632 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7633 Add parameter. Adjust all callers.
7634 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7635 (Incremental_inputs::got_plt_section): New function.
7636 (Incremental_inputs::got_plt_section_): New data member.
7637 (Incremental_got_plt_reader): New class.
7638 * layout.cc (Layout::create_incremental_info_sections): Add the
7639 incremental_got_plt section.
7640 * object.h (Got_offset_list::get_list): New function.
7641 (Got offset_list::for_all_got_offsets): New function.
7642 (Sized_relobj::local_got_offset_list): New function.
7643 * powerpc.cc (Target_powerpc::got_size): Add const.
7644 (Target_powerpc::got_entry_count): New function.
7645 (Target_powerpc::plt_entry_count): New function.
7646 (Target_powerpc::first_plt_entry_offset): New function.
7647 (Target_powerpc::plt_entry_size): New function.
7648 (Output_data_plt_powerpc::entry_count): New function.
7649 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7650 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7651 * sparc.cc (Target_sparc::got_size): Add const.
7652 (Target_sparc::got_entry_count): New function.
7653 (Target_sparc::plt_entry_count): New function.
7654 (Target_sparc::first_plt_entry_offset): New function.
7655 (Target_sparc::plt_entry_size): New function.
7656 (Output_data_plt_sparc::entry_count): New function.
7657 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7658 (Output_data_plt_sparc::get_plt_entry_size): New function.
7659 * symtab.h (Symbol::got_offset_list): New function.
7660 (Symbol_table::for_all_symbols): New function.
7661 * target.h (Sized_target::got_entry_count): New function.
7662 (Sized_target::plt_entry_count): New function.
7663 (Sized_target::plt_entry_size): New function.
7664 * x86_64.cc (Target_x86_64::got_size): Add const.
7665 (Target_x86_64::got_entry_count): New function.
7666 (Target_x86_64::plt_entry_count): New function.
7667 (Target_x86_64::first_plt_entry_offset): New function.
7668 (Target_x86_64::plt_entry_size): New function.
7669 (Output_data_plt_x86_64::entry_count): New function.
7670 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7671 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7672
09ec0418
CC
76732010-08-12 Cary Coutant <ccoutant@google.com>
7674
7675 * archive.cc: Include incremental.h.
7676 (Archive::Archive): Initialize incremental_info_.
7677 (Archive::include_member): Record archive members in incremental info.
7678 (Add_archive_symbols::run): Record begin and end of an archive in
7679 incremental info.
7680 (Lib_group::include_member): Record objects in incremental info.
7681 * archive.h (Incremental_archive_entry): Forward declaration.
7682 (Archive::set_incremental_info): New member function.
7683 (Archive::incremental_info): New member function.
7684 (Archive::Unused_symbol_iterator): New class.
7685 (Archive::unused_symbols_begin): New member function.
7686 (Archive::unused_symbols_end): New member function.
7687 (Archive::incremental_info_): New data member.
7688 * incremental-dump.cc (find_input_containing_global): New function.
7689 (dump_incremental_inputs): Dump new incremental info sections.
7690 * incremental.cc: Include symtab.h.
7691 (Output_section_incremental_inputs): New class.
7692 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7693 new incremental info sections.
7694 (Sized_incremental_binary::do_check_inputs): Likewise.
7695 (Incremental_inputs::report_archive): Remove.
7696 (Incremental_inputs::report_archive_begin): New function.
7697 (Incremental_inputs::report_archive_end): New function.
7698 (Incremental_inputs::report_object): New function.
7699 (Incremental_inputs::finalize_inputs): Remove.
7700 (Incremental_inputs::report_input_section): New function.
7701 (Incremental_inputs::report_script): Rewrite.
7702 (Incremental_inputs::finalize): Do nothing but finalize string table.
7703 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7704 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7705 (Incremental_inputs::create_data_sections): New function.
7706 (Incremental_inputs::relocs_entsize): New function.
7707 (Output_section_incremental_inputs::set_final_data_size): New function.
7708 (Output_section_incremental_inputs::do_write): New function.
7709 (Output_section_incremental_inputs::write_header): New function.
7710 (Output_section_incremental_inputs::write_input_files): New function.
7711 (Output_section_incremental_inputs::write_info_blocks): New function.
7712 (Output_section_incremental_inputs::write_symtab): New function.
7713 * incremental.h (Incremental_script_entry): Forward declaration.
7714 (Incremental_object_entry): Forward declaration.
7715 (Incremental_archive_entry): Forward declaration.
7716 (Incremental_inputs): Forward declaration.
7717 (Incremental_inputs_header_data): Remove.
7718 (Incremental_inputs_header): Remove.
7719 (Incremental_inputs_header_write): Remove.
7720 (Incremental_inputs_entry_data): Remove.
7721 (Incremental_inputs_entry): Remove.
7722 (Incremental_inputs_entry_write): Remove.
7723 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7724 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7725 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7726 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7727 Likewise.
7728 (Incremental_input_entry): New class.
7729 (Incremental_script_entry): New class.
7730 (Incremental_object_entry): New class.
7731 (Incremental_archive_entry): New class.
7732 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7733 (Incremental_inputs::report_inputs): Remove.
7734 (Incremental_inputs::report_archive): Remove.
7735 (Incremental_inputs::report_archive_begin): New function.
7736 (Incremental_inputs::report_archive_end): New function.
7737 (Incremental_inputs::report_object): Change prototype.
7738 (Incremental_inputs::report_input_section): New function.
7739 (Incremental_inputs::report_script): Change prototype.
7740 (Incremental_inputs::get_reloc_count): New function.
7741 (Incremental_inputs::set_reloc_count): New function.
7742 (Incremental_inputs::create_data_sections): New function.
7743 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7744 (Incremental_inputs::inputs_section): New function.
7745 (Incremental_inputs::symtab_section): New function.
7746 (Incremental_inputs::relocs_section): New function.
7747 (Incremental_inputs::get_stringpool): Add const.
7748 (Incremental_inputs::command_line): Add const.
7749 (Incremental_inputs::inputs): Remove.
7750 (Incremental_inputs::command_line_key): New function.
7751 (Incremental_inputs::input_file_count): New function.
7752 (Incremental_inputs::input_files): New function.
7753 (Incremental_inputs::relocs_entsize): New function.
7754 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7755 (Incremental_inputs::finalize_inputs): Remove.
7756 (Incremental_inputs::Input_info): Remove.
7757 (Incremental_inputs::lock_): Remove.
7758 (Incremental_inputs::inputs_): Change type.
7759 (Incremental_inputs::inputs_map_): Remove.
7760 (Incremental_inputs::current_object_entry_): New data member.
7761 (Incremental_inputs::inputs_section_): New data member.
7762 (Incremental_inputs::symtab_section_): New data member.
7763 (Incremental_inputs::relocs_section_): New data member.
7764 (Incremental_inputs::reloc_count_): New data member.
7765 (Incremental_inputs_reader): New class.
7766 (Incremental_symtab_reader): New class.
7767 (Incremental_relocs_reader): New class.
7768 * layout.cc (Layout::finalize): Move finalization of incremental info
7769 and creation of incremental info sections to follow finalization of
7770 symbol table. Set offsets for postprocessing sections.
7771 (Layout::create_incremental_info_sections): Call
7772 Incremental_inputs::create_data_sections. Add incremental symtab
7773 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7774 sections to layout after input sections.
7775 * layout.h (struct Timespec): Forward declaration.
7776 (Layout::incremental_inputs): Add const.
7777 (Layout::create_incremental_info_sections): Add parameter.
7778 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7779 * object.cc: Include incremental.h.
7780 (Relobj::finalize_incremental_relocs): New function.
7781 (Sized_relobj::do_layout): Record input sections in incremental info.
7782 * object.h (Object::output_section): New function.
7783 (Object::output_section_offset): Moved from Relobj.
7784 (Object::get_incremental_reloc_base): New function.
7785 (Object::get_incremental_reloc_count): New function.
7786 (Object::do_output_section): New function.
7787 (Object::do_output_section_offset): Moved from Relobj.
7788 (Object::do_get_incremental_reloc_base): New function.
7789 (Object::do_get_incremental_reloc_count): New function.
7790 (Object::Object): Initialize new data members.
7791 (Relobj::output_section): Renamed do_output_section and moved to
7792 protected.
7793 (Relobj::output_section_offset): Moved to Object.
7794 (Relobj::do_get_incremental_reloc_base): New function.
7795 (Relobj::do_get_incremental_reloc_count): New function.
7796 (Relobj::allocate_incremental_reloc_counts): New function.
7797 (Relobj::count_incremental_reloc): New function.
7798 (Relobj::finalize_incremental_relocs): New function.
7799 (Relobj::next_incremental_reloc_index): New function.
7800 (Relobj::reloc_counts_): New data member.
7801 (Relobj::reloc_bases_): New data member.
7802 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7803 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7804 (Sized_relobj::incremental_relocs_scan): New function.
7805 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7806 (Sized_relobj::incremental_relocs_write): New function.
7807 (Sized_relobj::incremental_relocs_write_reltype): New function.
7808 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7809 incremental link.
7810 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7811 archives and object files elsewhere.
7812 (Add_symbols::run): Report object files here.
7813 (Finish_group::run): Report end of archive at end of group.
7814 * reloc.cc: Include layout.h, incremental.h.
7815 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7816 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7817 (Sized_relobj::incremental_relocs_scan): New function.
7818 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7819 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7820 (Sized_relobj::incremental_relocs_write): New function.
7821 (Sized_relobj::incremental_relocs_write_reltype): New function.
7822 * script.cc (read_input_script): Rewrite test for incremental link.
7823 Change call to Incremental_inputs::report_script.
7824 * symtab.h (Symbol_table::first_global_index): New function.
7825 (Symbol_table::output_count): New function.
7826
ce0d1972
DK
78272010-08-12 Doug Kwan <dougkwan@google.com>
7828
7829 * arm.cc (Target_arm::merge_object_attributes): Check command line
7830 options --no-wchar-size-warning and --no-enum-size-warning.
7831 * options.h (General_options): Add ld-compatible options
7832 --no-enum-size-warning and --no-wchar-size-warning.
7833
6e5710ce
ILT
78342010-08-04 Ian Lance Taylor <iant@google.com>
7835
7836 * x86_64.cc (Target_x86_64::Scan::local): Use
7837 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7838 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7839 (Target_x86_64::Scan::global): Likewise.
7840 (Target_x86_64::Relocate::relocate): Likewise.
7841 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7842 Likewise.
7843
fef830db
CC
78442010-08-03 Cary Coutant <ccoutant@google.com>
7845
7846 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7847 to reserve space in merged_strings vector. Keep total input size
7848 for stats.
7849 (Output_merge_string::do_print_merge_stats): Print total input size.
7850 * merge.h (Output_merge_string): Add input_size_ field.
7851 * stringpool.cc (Stringpool_template::string_length): Move
7852 implementations out of Stringpool_template class and place in
7853 stringpool.h.
7854 * stringpool.h (string_length): Move out of Stringpool_template.
7855
1e3811b0
ILT
78562010-08-03 Ian Lance Taylor <iant@google.com>
7857
7858 PR 11712
7859 * layout.cc (relaxation_loop_body): If address of load segment is
7860 set, adjust address to include headers if possible.
7861
7af0c620
ILT
78622010-08-03 Ian Lance Taylor <iant@google.com>
7863
7864 * version.cc (version_string): Bump to 1.10.
7865
22f0da72
ILT
78662010-08-03 Ian Lance Taylor <iant@google.com>
7867
7868 PR 11805
7869 * layout.h (enum Output_section_order): Define.
7870 (class Layout): Update declarations.
7871 * layout.cc (Layout::get_output_section): Add order parameter.
7872 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7873 is_first_non_relro parameters. Change all callers.
7874 (Layout::choose_output_section): Likewise.
7875 (Layout::add_output_section_data): Likewise.
7876 (Layout::make_output_section): Likewise. Set order.
7877 (Layout::default_section_order): New function.
7878 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7879 * output.cc (Output_section::Output_section): Initialize order_.
7880 Don't initialize deleted fields.
7881 (Output_segment::Output_segment): Don't initialize deleted
7882 fields.
7883 (Output_segment::add_output_section_to_load): New function
7884 replacing add_output_section. Change all callers to call this or
7885 add_output_section_to_nonload.
7886 (Output_segment::add_output_section_to_nonload): New function.
7887 (Output_segment::remove_output_section): Rewrite.
7888 (Output_segment::add_initial_output_data): Likewise.
7889 (Output_segment::has_any_data_sections): Likewise.
7890 (Output_segment::is_first_section_relro): Likewise.
7891 (Output_segment::maximum_alignment): Likewise.
7892 (Output_segment::has_dynamic_reloc): New function replacing
7893 dynamic_reloc_count. Change all callers.
7894 (Output_segment::has_dynamic_reloc_list): New function replacing
7895 dynamic_reloc_count_list. Change all callers.
7896 (Output_segment::set_section_addresses): Rewrite.
7897 (Output_segment::set_offset): Rewrite.
7898 (Output_segment::find_first_and_last_list): Remove.
7899 (Output_segment::set_tls_offsets): Rewrite.
7900 (Output_segment::first_section_load_address): Likewise.
7901 (Output_segment::output_section_count): Likewise.
7902 (Output_segment::section_with_lowest_load_address): Likewise.
7903 (Output_segment::write_section_headers): Likewise.
7904 (Output_segment::print_sections_to_map): Likewise.
7905 * output.h (class Output_data): Remove dynamic_reloc_count_
7906 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7907 (Output_data::add_dynamic_reloc): Rewrite.
7908 (Output_data::has_dynamic_reloc): New function.
7909 (Output_data::dynamic_reloc_count): Remove.
7910 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7911 is_last_relro_, is_first_non_relro_, is_interp_,
7912 is_dynamic_linker_section_ fields. Add order and set_order
7913 functions. Remove is_relro_local, set_is_relro_local,
7914 is_last_relro, set_is_last_relro, is_first_non_relro,
7915 set_is_first_non_relro functions, is_interp, set_is_interp,
7916 is_dynamic_linker_section, and set_is_dynamic_linker_section
7917 functions.
7918 (class Output_segment): Change Output_data_list from std::list to
7919 std:;vector. Add output_lists_ field. Remove output_data_ and
7920 output_bss_ fields. Update declarations.
7921
3ff2ccb0
ILT
79222010-08-02 Ian Lance Taylor <iant@google.com>
7923
7924 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7925 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7926 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7927
88a4108b
ILT
79282010-08-02 Ian Lance Taylor <iant@google.com>
7929
7930 PR 11855
7931 * script.cc (Script_options::Script_options): Initialize
7932 symbol_definitions_ and symbol_references_.
7933 (Script_options::add_symbol_assignment): Update
7934 symbol_definitions_ and symbol_references_.
7935 (Script_options::add_symbol_reference): New function.
7936 (script_symbol): New function.
7937 * script.h (class Script_options): Add symbol_definitions_ and
7938 symbol_references_ fields.
7939 (Script_options::referenced_const_iterator): New type.
7940 (Script_options::referenced_begin): New function.
7941 (Script_options::referenced_end): New function.
7942 (Script_options::is_referenced): New function.
7943 (Script_options::any_unreferenced): New function.
7944 * script-c.h (script_symbol): Declare.
7945 * yyscript.y (exp): Call script_symbol.
7946 * symtab.cc: Include "script.h".
7947 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7948 Change all callers. Check symbols referenced by scripts.
7949 (Symbol_table::add_undefined_symbols_from_command_line): Add
7950 layout parameter. Change all callers.
7951 (Symbol_table::do_add_undefined_symbols_from_command_line):
7952 Likewise. Break out loop body. Check symbols referenced by
7953 scripts.
7954 (Symbol_table::add_undefined_symbol_from_command_line): New
7955 function broken out of
7956 do_add_undefined_symbols_from_command_line.
7957 * symtab.h (class Symbol_table): Update declarations.
7958 * archive.cc: Include "layout.h".
7959 (Archive::should_include_member): Add layout parameter. Change
7960 all callers. Check for symbol mentioned in expression.
7961 * archive.h (class Archive): Update declaration.
7962 * object.cc (Sized_relobj::do_should_include_member): Add layout
7963 parameter.
7964 * object.h (Object::should_include_member): Add layout parameter.
7965 Change all callers.
7966 (Object::do_should_include_member): Add layout parameter.
7967 (class Sized_relobj): Update declaration.
7968 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7969 parameter.
7970 * dynobj.h (class Sized_dynobj): Update declaration.
7971 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7972 layout parameter.
7973 * plugin.h (class Sized_pluginobj): Update declaration.
7974
5f1ab67a
ILT
79752010-08-02 Ian Lance Taylor <iant@google.com>
7976
7977 PR 11866
7978 * output.cc (Output_segment::set_offset): Search for the first and
7979 last sections rather than assuming that the list is in order.
7980 (Output_segment::find_first_and_last_list): New function.
7981 * output.h (class Output_segment): Update declarations.
7982 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7983 (relro_strip_test_SOURCES): New variable.
7984 (relro_strip_test_DEPENDENCIES): New variable.
7985 (relro_strip_test_LDFLAGS): New variable.
7986 (relro_strip_test_LDADD): New variable.
7987 (relro_strip_test.so): New target.
7988
a8df5856
ILT
79892010-08-02 Ian Lance Taylor <iant@google.com>
7990
7991 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7992 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7993 (Target_i386::got_tlsdesc_section): New function.
7994 (Target_i386::got_section): Create space for GOT entries for
7995 TLSDESC relocations.
7996 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7997 R_386_TLS_GOTDESC.
7998 (Target_i386::Scan::global): Likewise.
7999 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8000 using TLSDESC GOT.
8001 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8002 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8003 (Target_x86_64::got_tlsdesc_section): New function.
8004 (Target_x86_64::got_section): Create space for GOT entries for
8005 TLSDESC relocations.
8006 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8007 R_386_TLS_GOTDESC.
8008 (Target_x86_64::Scan::global): Likewise.
8009 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8010 using TLSDESC GOT.
8011
0c10a0a6
ILT
80122010-08-02 Ian Lance Taylor <iant@google.com>
8013
8014 * testsuite/final_layout.sh: Use dc to convert from hex to
8015 decimal.
8016
41cbeecc
ST
80172010-07-29 Sriraman Tallam <tmsriram@google.com>
8018
8019 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8020 paramter to the call to gold::gc_process_relocs.
8021 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8022 paramter to the call to gold::gc_process_relocs.
8023 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8024 parameter to the call to gold::gc_process_relocs.
8025 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8026 template parameter to the call to gold::gc_process_relocs.
8027 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8028 paramter to the call to gold::gc_process_relocs.
8029 * gc.h (get_embedded_addend_size): New function.
8030 (gc_process_relocs): Save the size of the reloc for use by ICF.
8031 * icf.cc (get_section_contents): Get the addend from the text section
8032 for SHT_REL relocation sections.
8033 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8034 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8035 * int_encoding.h (read_from_pointer): New overloaded function.
8036 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8037 * testsuite/icf_sht_rel_addend_test.sh: New file.
8038 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8039 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8040
6ea55b82
RW
80412010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8042
8043 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8044 * Makefile.in: Regenerate.
8045 * testsuite/Makefile.in: Regenerate.
8046
9691462b
ILT
80472010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8048
8049 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8050 * gold/testsuite/debug_msg.cc: Likewise.
8051 * gold/testsuite/odr_violation1.cc
8052 * gold/testsuite/odr_violation2.cc
8053
76897331
CC
80542010-07-21 Cary Coutant <ccoutant@google.com>
8055
8056 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8057 string, and length fields.
8058 (Output_merge_string::Merged_strings_list): New type.
8059 (Output_merge_string::Merged_strings_lists): New typedef.
8060 (Output_merge_string): Replace merged_strings_ with
8061 merged_strings_lists_.
8062 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8063 Merged_strings_list per input object and section. Don't store pointer
8064 to the string. Don't store length with each merged string entry.
8065 (Output_merge_string::finalize_merged_data): Loop over list of merged
8066 strings lists. Recompute length of each merged string.
8067
78384e8f
CC
80682010-07-15 Cary Coutant <ccoutant@google.com>
8069
8070 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8071 here.
8072
783659f9
ILT
80732010-07-14 Ian Lance Taylor <iant@google.com>
8074
8075 * descriptors.cc (Descriptors::open): Report correct name in error
8076 message.
8077
131687b4
DK
80782010-07-13 Doug Kwan <dougkwan@google.com>
8079
8080 * arm.cc (Arm_input_section::Arm_input_section): For a
8081 SHT_ARM_EXIDX section, always keeps the input sections.
8082 (Arm_input_section::set_exidx_section_link): New method.
8083 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8084 has_errors_ to false.
8085 (Arm_exidx_input_section::has_errors,
8086 Arm_exidx_input_section::set_has_errors): New methods.
8087 (Arm_exidx_input_section::has_errors_): New data member.
8088 (Arm_relobj::get_exidx_shndx_list): New method.
8089 (Arm_output_section::append_text_sections_to_list): Do not skip
8090 section without SHF_EXECINSTR.
8091 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8092 errors.
2e702c99 8093 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8094 section header. Make error messages more verbose. Check for
8095 a non-executable section linked to an EXIDX section.
8096 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8097 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8098 check that there is no deferred EXIDX section if we exit early.
8099 Instead of not making an EXIDX section in case of an error, make one
8100 and set the has_errors flag of it.
8101 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8102 in a relocatable link.
8103 (Target_arm::do_relax): Look for the EXIDX output section instead of
8104 assuming that it is called .ARM.exidx.
2e702c99 8105 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8106 section list. Do not check for SHF_EXECINSTR section flags but
8107 skip any input section with errors.
8108 * output.cc (Output_section::Output_section): Initialize
8109 always_keeps_input_sections_ to false.
8110 (Output_section::add_input_section): Check for
8111 always_keeps_input_sections_.
8112 * output.h (Output_section::always_keeps_input_sections,
8113 Output_section::set_always_keeps_input_sections): New methods.
8114 (Output_section::always_keeps_input_sections): New data member.
8115
69517287
RÁE
81162010-07-13 Rafael Espindola <espindola@google.com>
8117
8118 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8119 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8120
82742395
ILT
81212010-07-13 Philip Herron <herron.philip@googlemail.com>
8122 Ian Lance Taylor <iant@google.com>
8123
8124 * output.h (Output_section_lookup_maps::add_merge_section):
8125 Correct check of whether value was inserted.
8126 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8127 (Output_section_lookup_maps::add_relaxed_input_section):
8128 Likewise.
8129 * arm.cc (Target_arm::got_section): Remove used local os.
8130 * i386.cc (Target_i386::got_section): Likewise.
8131 * x86_64.cc (Target_x86_64::got_section): Likewise.
8132 * sparc.cc (Target_sparc::got_section): Likewise.
8133 (Target_sparc::relocate): Remove unused local have_got_offset.
8134 * powerpc.cc (Target_powerpc::relocate): Likewise.
8135
f2d707b5
ILT
81362010-07-13 Ian Lance Taylor <iant@google.com>
8137
241531d6
ILT
8138 * compressed_output.cc (zlib_decompress): Fix signature in
8139 !HAVE_ZLIB_H case.
8140
f2d707b5
ILT
8141 * archive.cc (Archive::include_member): Unlock an external member
8142 of a thin archive. Don't bother to delete an object we know is
8143 NULL.
8144
a2e47362
CC
81452010-07-12 Cary Coutant <ccoutant@google.com>
8146
8147 * compressed_output.cc (zlib_decompress): New function.
8148 (get_uncompressed_size): New function.
8149 (decompress_input_section): New function.
8150 * compressed_output.h (get_uncompressed_size): New function.
8151 (decompress_input_section): New function.
8152 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8153 Handle compressed debug sections.
8154 * layout.cc (is_compressed_debug_section): New function.
8155 (Layout::output_section_name): Map compressed section names to
8156 canonical names.
8157 * layout.h (is_compressed_debug_section): New function.
8158 (is_debug_info_section): Recognize compressed debug sections.
8159 * merge.cc: Include compressed_output.h.
8160 (Output_merge_data::do_add_input_section): Handle compressed
8161 debug sections.
8162 (Output_merge_string::do_add_input_section): Handle compressed
8163 debug sections.
8164 * object.cc: Include compressed_output.h.
8165 (Sized_relobj::Sized_relobj): Initialize new data members.
8166 (build_compressed_section_map): New function.
8167 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8168 * object.h (Object::section_is_compressed): New method.
8169 (Object::do_section_is_compressed): New method.
8170 (Sized_relobj::Compressed_section_map): New type.
8171 (Sized_relobj::do_section_is_compressed): New method.
8172 (Sized_relobj::compressed_sections_): New data member.
8173 * output.cc (Output_section::add_input_section): Handle compressed
8174 debug sections.
8175 * reloc.cc: Include compressed_output.h.
8176 (Sized_relobj::write_sections): Handle compressed debug sections.
8177
ce279a62
CC
81782010-07-08 Cary Coutant <ccoutant@google.com>
8179
8180 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8181 weak when resolving to a dynamic def.
8182 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8183 for weak undef/dynamic def cases. Adjust callers.
8184 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8185 undef_binding_weak_.
8186 (Symbol_table::sized_write_globals): Adjust symbol binding.
8187 (Symbol_table::sized_write_symbol): Add binding parameter.
8188 * symtab.h (Symbol::set_undef_binding): New method.
8189 (Symbol::is_undef_binding_weak): New method.
8190 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8191 (Symbol_table::should_override): Add new parameter.
8192 (Symbol_table::sized_write_symbol): Add new parameter.
8193
8194 * testsuite/weak_undef_file1.cc: Add new test case.
8195 * testsuite/weak_undef_file2.cc: Fix header comment.
8196 * testsuite/weak_undef_test.cc: Add new test case.
8197
b2286c10
DK
81982010-06-29 Doug Kwan <dougkwan@google.com>
8199
8200 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8201 Initialize USE_SYMBOL_.
8202 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8203 definition.
8204 (Arm_reloc_property::uses_symbol_): New data member declaration.
8205 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8206 uses symbol value and symbol is undefined but not weakly undefined.
8207
4802450a
RÁE
82082010-06-28 Rafael Espindola <espindola@google.com>
8209
8210 * plugin.cc (Plugin::load): Use dlerror.
8211
e5ca47ba
ILT
82122010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8213
8214 * symtab.cc (detect_odr_violations): When reporting an ODR
8215 violation, report an object where the symbol is defined.
8216
8a75a161
DK
82172010-06-25 Doug Kwan <dougkwan@google.com>
8218
8219 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8220 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8221 definition.
8222 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8223 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8224 target hook to detect function points.
8225 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8226 * icf.h (Icf::check_section_for_function_pointers): Change type of
8227 parameter SECTION_NAME to const reference to std::string. Use
8228 target hook to determine if section may have unsafe pointers.
8229 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8230 method definition.
8231
42218b9f
RÁE
82322010-06-21 Rafael Espindola <espindola@google.com>
8233
8234 * fileread.cc (Input_file::find_fie): New
8235 (Input_file::open): Use Input_file::find_fie.
8236 * fileread.h (Input_file::find_fie): New
8237 * plugin.cc (set_extra_library_path): New.
8238 (Plugin::load): Add set_extra_library_path to the transfer vector.
8239 (Plugin_manager::set_extra_library_path): New.
8240 (Plugin_manager::add_input_file): Use the extra search path if set.
8241 (set_extra_library_path(): New.
8242 * plugin.h (Plugin_manager): Add set_extra_library_path and
8243 extra_search_path_.
8244
a0506cca
CC
82452010-06-19 Cary Coutant <ccoutant@google.com>
8246
8247 * layout.cc (gdb_sections): Add .debug_types.
8248 (lines_only_debug_sections): Likewise.
8249
6508b958
RÁE
82502010-06-18 Rafael Espindola <espindola@google.com>
8251
8252 * plugin.cc (add_input_file,add_input_library)
8253 (Plugin_manager::add_input_file): Make filename arguments const.
8254 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8255 const.
8256
3e235302
DK
82572010-06-16 Doug Kwan <dougkwan@google.com>
8258
8259 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8260 .ARM.attributes section if we have not merged any input
8261 attributes sections.
8262
106e8a6c
DK
82632010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8264
8265 * arm.cc: Allow combining objects with no EABI version
8266 information.
8267
91ff43fe
RÁE
82682010-06-15 Rafael Espindola <espindola@google.com>
8269
8270 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8271
68ed838c
ILT
82722010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8273
8274 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8275 (struct iovec): Correct !HAVE_READV definition.
8276
f3a2388f
CC
82772010-06-10 Cary Coutant <ccoutant@google.com>
8278
8279 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8280 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8281 reloc sections.
8282 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8283
8284 PR 11683
8285 * symtab.h (Symbol::is_placeholder): New member function.
8286 * target-reloc.h (relocate_section): Check for placeholder symbols.
8287
8288 * testsuite/Makefile.am (plugin_test_8): New test.
8289 (plugin_test_9): New test.
8290 * testsuite/Makefile.in: Regenerate.
8291
e1df38aa
NC
82922010-06-09 Nick Clifton <nickc@redhat.com>
8293
8294 * yyscript.y (input_list_element): Allow strings prefixed with
8295 the '-' character. Treat these as libraries.
8296 * script.cc (script_add_library): New function. Adds a library
8297 specified by "-l<name>" found in an input script.
8298 * script-c.h: Add prototype for script_add_library.
8299
25bbe950
DK
83002010-06-07 Doug Kwan <dougkwan@google.com>
8301
8302 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8303 Restrict stub-group size to be within long conditional branch
8304 range when working around cortex-A8 erratum.
8305
0f32ea4c
ILT
83062010-06-07 Damien Diederen <dd@crosstwine.com>
8307
8308 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8309 #ifdef typo.
8310
8fe2a369
ST
83112010-06-03 Sriraman Tallam <tmsriram@google.com>
8312
8313 PR gold/11658
8314 * output.cc
8315 (Output_section::Input_section_sort_entry::compare_section_ordering):
8316 Change to return non-zero correctly.
8317 (Output_section::Input_section_sort_section_order_index_compare
8318 ::operator()): Change to fix ambiguity in comparisons.
8319
6e9ba2ca
ST
83202010-06-01 Sriraman Tallam <tmsriram@google.com>
8321
8322 * gold.h (is_wildcard_string): New function.
8323 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8324 (Layout::layout_eh_frame): Ditto.
8325 (Layout::find_section_order_index): New method.
8326 (Layout::read_layout_from_file): New method.
8327 * layout.h (Layout::find_section_order_index): New method.
8328 (Layout::read_layout_from_file): New method.
8329 (Layout::input_section_position_): New private member.
8330 (Layout::input_section_glob_): New private member.
8331 * main.cc (main): Call read_layout_from_file here.
8332 * options.h (--section-ordering-file): New option.
8333 * output.cc (Output_section::input_section_order_specified_): New
8334 member.
8335 (Output_section::Output_section): Initialize new member.
8336 (Output_section::add_input_section): Add new parameter.
8337 Keep input sections when --section-ordering-file is used.
8338 (Output_section::set_final_data_size): Sort input sections when
8339 section ordering file is specified.
8340 (Output_section::Input_section_sort_entry): Add new parameter.
8341 Check sorting type.
8342 (Output_section::Input_section_sort_entry::compare_section_ordering):
8343 New method.
8344 (Output_section::Input_section_sort_compare::operator()): Change to
8345 consider section_order_index.
8346 (Output_section::Input_section_sort_init_fini_compare::operator()):
8347 Change to consider section_order_index.
8348 (Output_section::Input_section_sort_section_order_index_compare
8349 ::operator()): New method.
8350 (Output_section::sort_attached_input_sections): Change to sort
8351 according to section order when specified.
e1df38aa
NC
8352 (Output_section::add_input_section<32, true>): Add new parameter.
8353 (Output_section::add_input_section<64, true>): Add new parameter.
8354 (Output_section::add_input_section<32, false>): Add new parameter.
8355 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8356 * output.h (Output_section::add_input_section): Add new parameter.
8357 (Output_section::input_section_order_specified): New
8358 method.
8359 (Output_section::set_input_section_order_specified): New method.
8360 (Input_section::Input_section): Initialize section_order_index_.
8361 (Input_section::section_order_index): New method.
8362 (Input_section::set_section_order_index): New method.
8363 (Input_section::section_order_index_): New member.
8364 (Input_section::Input_section_sort_section_order_index_compare): New
8365 struct.
8366 (Output_section::input_section_order_specified_): New member.
8367 * script-sections.cc (is_wildcard_string): Delete and move modified
8368 method to gold.h.
8369 (Output_section_element_input::Output_section_element_input): Modify
8370 call to is_wildcard_string.
8371 (Output_section_element_input::Input_section_pattern
8372 ::Input_section_pattern): Ditto.
8373 (Output_section_element_input::Output_section_element_input): Ditto.
8374 * testsuite/Makefile.am (final_layout): New test case.
8375 * testsuite/Makefile.in: Regenerate.
8376 * testsuite/final_layout.cc: New file.
8377 * testsuite/final_layout.sh: New file.
8378
3537c84b
RÁE
83792010-06-01 Rafael Espindola <espindola@google.com>
8380
8381 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8382
105b6afd
RÁE
83832010-06-01 Rafael Espindola <espindola@google.com>
8384
8385 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8386 visibility of symbols.
8387
29e11421
DK
83882010-05-27 Doug Kwan <dougkwan@google.com>
8389
8390 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8391 from start of output section instead of address for a local symbol
8392 in a merged or relaxed section when doing a relocatable link.
8393
5e0f337e
RÁE
83942010-05-26 Rafael Espindola <espindola@google.com>
8395
703d02da 8396 PR 11604
5e0f337e
RÁE
8397 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8398 adding sections the garbage collector removed.
8399 * gold/testsuite/Makefile.am: Add test.
8400 * gold/testsuite/Makefile.in: Regenerate.
8401 * gold/testsuite/plugin_test_7.sh: New.
8402 * gold/testsuite/plugin_test_7_1.c: New.
8403 * gold/testsuite/plugin_test_7_2.c: New.
8404
f4187277
RÁE
84052010-05-26 Rafael Espindola <espindola@google.com>
8406
8407 * script-sections.cc (Output_section_definition::set_section_addresses):
8408 Check for --section-start.
8409
5c388529
DK
84102010-05-26 Doug Kwan <dougkwan@google.com>
8411
8412 * arm.cc (Arm_scan_relocatable_relocs): New class.
8413 (Target_arm::relocate_special_relocatable): New method.
8414 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8415 (Arm_relocate_functions::thumb_branch_common): Same.
8416 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8417 instead of Default_scan_relocatable_relocs.
8418 * target-reloc.h (relocate_for_relocatable): Let target handle
8419 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8420 * target.h (Sized_target::relocate_special_relocatable): New method.
8421
bca1c3ae
ILT
84222010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8423
8424 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8425
0439c796
DK
84262010-05-23 Doug Kwan <dougkwan@google.com>
8427
8428 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8429 instead of a cast.
8430 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8431 with a direct branch, not a conditional branch, to a stub.
8432 * merge.cc (Output_merge_base::record_input_section): New method
8433 defintion.
8434 (Output_merge_data::do_add_input_section): Record input section if
8435 keeps-input-sections flag is set.
8436 (Output_merge_string::do_add_input_section): Ditto.
8437 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8438 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8439 INPUT_SECTIONS_.
8440 (Output_merge_base::keeps_input_sections,
8441 Output_merge_base::set_keeps_input_sections,
8442 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8443 method definitions.
8444 (Output_merge_base::Input_sections): New type declaration.
8445 (Output_merge_base::input_sections_begin,
8446 Output_merge_base::input_sections_end,
8447 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8448 (Output_merge_base::bool keeps_input_sections_,
8449 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8450 Output_merge_base::input_sections_): New data members.
8451 (Output_merge_data::do_set_keeps_input_sections): New method
8452 defintion.
8453 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8454 * output.cc (Output_section::Input_section::relobj): Move method
8455 defintion from class declaration to here and handle merge sections.
8456 (Output_section::Input_section::shndx): Ditto.
8457 (Output_section::Output_section): Remove initializations of removed
8458 data members and initialize new data member LOOKUP_MAPS_.
8459 (Output_section::add_input_section): Set keeps-input-sections flag
8460 for a newly created merge output section as appropriate. Adjust code
8461 to use Output_section_lookup_maps class.
8462 (Output_section::add_relaxed_input_section): Adjst code for lookup
8463 maps code refactoring.
2e702c99 8464 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8465 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8466 class. If adding input section to a newly created merge output
8467 section fails, remove the new merge section.
8468 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8469 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8470 (Output_section::find_merge_section): Ditto.
0439c796 8471 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8472 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8473 Output_section_lookup_maps class.
8474 (Output_section::get_input_sections): Export merge sections. Adjust
8475 code to use Output_section_lookup_maps class.
8476 (Output_section:::add_script_input_section): Adjust code to use
8477 Output_section_lookup_maps class. Update lookup maps for merge
8478 sections also.
8479 (Output_section::discard_states): Use Output_section_lookup_maps.
8480 (Output_section::restore_states): Same.
8481 * output.h (Merge_section_properties): Move class defintion out of
8482 Output_section.
8483 (Output_section_lookup_maps): New class.
8484 (Output_section::Input_section::is_merge_section): New method
8485 defintion.
8486 (Output_section::Input_section::relobj): Move defintion out of class
8487 defintion. Declare method only.
8488 (Output_section::Input_section::shndx): Ditto.
8489 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8490 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8491 (Output_section::Merge_section_by_properties_map,
8492 Output_section::Output_section_data_by_input_section_map,
8493 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8494 Remove types.
2e702c99 8495 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8496 KEEPS_INPUT_SECTIONS.
8497 (Output_section::build_lookup_maps): New method declaration.
8498 (Output_section::merge_section_map_,
8499 Output_section::merge_section_by_properties_map_,
8500 Output_section::relaxed_input_section_map_,
8501 Output_section::is_relaxed_input_section_map_valid_): Remove data
8502 members.
8503 (Output_section::lookup_maps_): New data member.
8504
76295588
L
85052010-05-21 Doug Kwan <dougkwan@google.com>
8506
8507 PR gold/11619
8508 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8509 avoid a compilation error.
8510
d103a984
RÁE
85112010-05-19 Rafael Espindola <espindola@google.com>
8512
8513 * script-sections.cc (Output_section_definition::allocate_to_segment):
8514 Update the phdrs_list even when the output section is NULL.
8515 * testsuite/Makefile.am: Add test.
8516 * testsuite/Makefile.in: Regenerate.
8517 * testsuite/script_test_9.cc: New.
8518 * testsuite/script_test_9.sh: New.
8519 * testsuite/script_test_9.t: New.
8520
6625d24e
DK
85212010-05-19 Doug Kwan <dougkwan@google.com>
8522
8523 * arm.cc (Arm_input_section::original_size): New method.
8524 (Arm_input_section::do_addralign): Add a cast.
8525 (Arm_input_section::do_output_offset): Remove static cast.
8526 (Arm_input_section::original_addralign,
8527 Arm_input_section::original_size_): Change type to uint32_t.
8528 (Arm_input_section::init): Add safe casts for section alignment
8529 and size.
8530 (Arm_input_section::set_final_data_size): Do not set address and
8531 offset of stub table.
8532 (Arm_output_section::fix_exidx_coverage): Change use of of
8533 Output_section::Simple_input_section to that of
8534 Output_section::Input_section.
8535 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8536 except for the first pass.
8537 * output.cc (Output_section::get_input_sections): Change type of
8538 input_sections to std::list<Input_section>.
8539 (Output_section::add_script_input_section): Rename from
8540 Output_section::add_simple_input_section. Change type of SIS
8541 parameter from Simple_input_section to Input_section.
8542 * output.h (Output_section::Simple_input_section): Remove class.
8543 (Output_section::Input_section): Change class visibility to public.
8544 (Output_section::Input_section::addralign): Use stored alignments
8545 for special input sections if set.
8546 (Output_section::Input_section::set_addralign): New method.
8547 (Output_section::get_input_sections): Change parameter type from
8548 list of Simple_input_section to list of Input_section.
8549 (Output_section::add_script_input_section): Rename from
8550 Output_section::add_simple_input_section. Change first parameter's
8551 type from Simple_input_section to Input_section and remove the
8552 second and third parameters.
8553 * script-sections.cc (Input_section::Input_section_list): Change
8554 type to list of Output_section::Input_section/
8555 (Input_section_info::Input_section_info): Change parameter type of
8556 INPUT_SECTION to Output_section::Input_section.
8557 (Input_section_info::input_section): Change return type.
8558 (Input_section_info::input_section_): Change type to
8559 Output_section::Input_section.
8560 (Output_section_element_input::set_section_addresses): Adjust code
8561 to use Output_section::Input_section instead of
8562 Output_section::Simple_input_section. Adjust code for renaming
8563 of Output_section::add_simple_input_section.
8564 (Orphan_output_section::set_section_addresses): Ditto.
8565
e1e82ea4
RW
85662010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8567
8568 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8569 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8570
91e75c8a
RÁE
85712010-05-18 Rafael Espindola <espindola@google.com>
8572
8573 * options.cc (General_options::finalize): Handle -nostdlib.
8574 * options.h (nostdlib): New option.
8575 * script.cc (script_add_search_dir): Handle -nostdlib.
8576
da59ad79
DK
85772010-05-12 Doug Kwan <dougkwan@google.com>
8578
8579 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8580 attributes section only if there no attributes section after merging.
8581 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8582 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8583 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8584 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8585 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8586 and arm_attr_merge_7.stdout.
8587 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8588 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8589 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8590 arm_attr_merge_7b.o): New rules.
8591 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8592 arm_attr_merge_7
8593 * testsuite/Makefile.in: Regenerate.
8594 * testsuite/arm_attr_merge.sh: New file.
8595 * testsuite/arm_attr_merge_[67][ab].s: Same.
8596
3e01a7fd
NC
85972010-05-05 Nick Clifton <nickc@redhat.com>
8598
8599 * po/es.po: Updated Spanish translation.
8600
7ad2014a
L
86012010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8602
8603 * Makefile.am (install-exec-local): Properly install gold as
8604 default cross linker.
8605 * Makefile.in: Regenerated.
8606
4fda8867
NC
86072010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8608 Nick Clifton <nickc@redhat.com>
8609
8610 * configure.ac (install_as_default): Define and set to false
8611 unless --enable-gold or --enable-gold=both/gold has been
8612 specified.
8613 * configure: Regenerate.
8614
8615 * Makefile.am (install-exec-local): Install the executable as
8616 'ld.gold'. If install_as_default is true then also install it as
8617 'ld'.
8618 * Makefile.in: Regenerated.
8619
bd288ea2
ILT
86202010-04-24 Ian Lance Taylor <iant@google.com>
8621
8622 * layout.cc (Layout::layout_reloc): In relocatable link don't
8623 combine reloc sections for grouped sections.
8624
ef38fd8a
ST
86252010-04-23 Sriraman Tallam <tmsriram@google.com>
8626
8627 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8628 sections that are not ordinary to icf.
8629 * icf.cc (get_section_contents): Handle relocation pointing to section
8630 with no object or shndx information.
8631 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8632 * testsuite/Makefile.in: Regenerate.
8633 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8634 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8635
f6973bdc
ILT
86362010-04-22 Ian Lance Taylor <iant@google.com>
8637
8638 * expression.cc (Expression::Expression_eval_info): Add
8639 result_alignment_pointer field.
8640 (Expression::eval_with_dot): Add result_alignment_pointer
8641 parameter. Change all callers.
8642 (Expression::eval_maybe_dot): Likewise.
8643 (class Binary_expression): Add alignment_pointer parameter to
8644 left_value and right_value. Change all callers.
8645 (BINARY_EXPRESSION): Set result alignment.
8646 (class Trinary_expression): Add alignment_pointer parameter to
8647 arg2_value and arg3_value. Change all callers.
8648 (Trinary_cond::value): Set result alignment.
8649 (Max_expression::value, Min_expression::value): Likewise.
8650 (Align_expression::value): Likewise.
8651 * script-sections.cc (class Sections_element): Add dot_alignment
8652 parameter to set_section_addresses virtual function. Update
8653 instantiations.
8654 (class Output_section_element): Likewise.
8655 (Script_sections::create_segments): Add dot_alignment parameter.
8656 Change all callers.
8657 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8658 (Script_sections::set_phdrs_clause_addresses): Likewise.
8659 * script-sections.h: Update declarations.
8660 * script.h: Update declarations.
8661 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8662 min_p_align.
8663 * testsuite/script_test_3.t: Set large alignment.
8664 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8665 segment has expected alignment.
8666
9c9c98a5
NC
86672010-04-22 Nick Clifton <nickc@redhat.com>
8668
8669 * po/gold.pot: Updated by the Translation project.
8670 * po/vi.po: Updated Vietnamese translation.
8671
2253bfba
L
86722010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8673
8674 * testsuite/Makefile.am (check_PROGRAMS): Add
8675 icf_virtual_function_folding_test.
8676 * testsuite/Makefile.in: Regenerated.
8677
85fdf906
AH
86782010-04-15 Andrew Haley <aph@redhat.com>
8679
8680 * options.h (merge_exidx_entries): New option.
8681 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8682 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8683 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8684 (Target_arm::merge_exidx_entries): New function.
8685 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8686 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8687 to Arm_exidx_fixup constructor.
8688 Add new arg, merge_exidx_entries.
8689 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8690 Arm_output_section::fix_exidx_coverage.
8691
ce97fa81
ST
86922010-04-18 Sriraman Tallam <tmsriram@google.com>
8693
8694 * icf.cc (get_section_contents): Check for preemptible functions.
8695 Ignore addend when appropriate.
8696 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8697 section folded.
8698 (add_from_relobj): Check for section folded.
8699 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8700 * symtab.h (should_add_dynsym_entry): Add new parameter.
8701 * target-reloc.h (scan_relocs): Check for section folded.
8702 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8703 Check reloc types for function pointers in shared objects.
8704 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8705 case.
8706 (icf_preemptible_functions_test): New test case.
8707 (icf_string_merge_test): New test case.
8708 * testsuite.Makefile.in: Regenerate.
8709 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8710 bar_glob. Refactor code.
8711 * testsuite/icf_preemptible_functions_test.cc: New file.
8712 * testsuite/icf_preemptible_functions_test.sh: New file.
8713 * testsuite/icf_string_merge_test.cc: New file.
8714 * testsuite/icf_string_merge_test.sh: New file.
8715 * testsuite/icf_virtual_function_folding_test.cc: New file.
8716 * testsuite/icf_virtual_function_folding_test.sh: New file.
8717
04ceb17c
DK
87182010-04-14 Doug Kwan <dougkwan@google.com>
8719
8720 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8721 for local symbol recounting if we remove a section due to ICF.
8722 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8723 there are no regular objects in input.
8724
153e7da4
DK
87252010-04-13 Doug Kwan <dougkwan@google.com>
8726
8727 * arm.cc (Arm_input_section::set_final_data_size): Compute
8728 accurate final data size instead of using current data size.
8729
4dbd9faf
DK
87302010-04-09 Doug Kwan <dougkwan@google.com>
8731
8732 * layout.cc (Layout::choose_output_section): Handle script section
8733 types.
8734 (Layout::make_output_section_for_script): Add section type parameter.
8735 Handle script section types.
8736 * layout.h (Layout::make_output_section_for_script): Add section
8737 type parameter.
8738 * output.cc (Output_section::Output_section): Initialize data member
8739 is_noload_.
8740 (Output_section::do_reset_address_and_file_offset): Do not set address
8741 to 0 if section is a NOLOAD section.
8742 * output.h (Output_section::is_noload): New method.
8743 (Output_section::set_is_noload): Ditto.
8744 (Output_section::is_noload_): New data member.
8745 * script-c.h (Script_section_type): New enum type.
8746 (struct Parser_output_section_header): Add new file section_type.
8747 * script-sections.cc (Sections_element::output_section_name): Add
8748 parameter for returning script section type.
8749 (Output_section_definition::output_section_name): Ditto.
8750 (Output_section_definition::section_type)P; New method.
8751 (Output_section_definiton::script_section_type_name): Ditto.
8752 (Output_section_definition::script_section_type_): New data member.
8753 (Output_section_definition::Output_section_definition): Initialize
8754 data member Output_section_definition::script_section_type_.
8755 (Output_section_definition::create_sections): Pass script section type
8756 to Layout::make_output_section_for_script.
8757 (Output_section_definition::output_section_name): Return script
8758 section type to caller.
8759 (Output_section_definition::set_section_address): Do not advance
8760 dot value and load address if section type is NOLOAD. Set address
8761 of NOLOAD sections regardless of section flags.
8762 (Output_section_definition::print): Print section type if it is
8763 not SCRIPT_SECTION_TYPE_NONE.
8764 (Output_section_definition::section_type): New method.
8765 (Output_section_definition::script_section_type_name): Ditto.
8766 (Script_sections::output_section_name): Add new parameter
8767 PSECTION_TYPE for returning script section type. Pass it to
8768 section elements. Handle discard sections.
8769 (Sort_output_sections::operator()): Handle NOLOAD sections.
8770 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8771 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8772 returning script section type.
8773 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8774 INFO and NOLOAD.
8775 * yyscript.y (union): Add new field SECTION_TYPE.
8776 (COPY, DSECT, INFO, NOLOAD): New tokens.
8777 (opt_address_and_section_type): Change type to output_section_header.
8778 (section_type): New non-terminal
8779 (section_header): Handle section type.
2253bfba 8780 (opt_address_and_section_type): Return section type value.
4dbd9faf 8781
721ea635
L
87822010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8783
8784 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8785 * testsuite/plugin_common_test_2.c (foo): Likewise.
8786
6bf924b0
DK
87872010-04-08 Doug Kwan <dougkwan@google.com>
8788
8789 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8790 Output_merge_data.
8791 * output.cc (Output_section::add_merge_input_section): Simplify
8792 code and return status of Output_merge_base::add_input_section.
e1df38aa 8793 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8794 returns true.
8795
24af6f92
DK
87962010-04-07 Doug Kwan <dougkwan@google.com>
8797
8798 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8799 if section is marked as containing instructions but has no mapping
8800 symbols.
8801 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8802 correct section index.
8803 (Arm_relobj::find_linked_text_section): Ditto.
8804
00698fc5
CC
88052010-04-07 Cary Coutant <ccoutant@google.com>
8806
8807 * archive.cc (include_member): Destroy Read_symbols_data object before
8808 releasing file.
8809 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8810 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8811 (Read_symbols_data::~Read_symbols_data) New destructor.
8812 (Section_relocs::Section_relocs) New constructor.
8813 (Section_relocs::~Section_relocs) New destructor.
8814 (Read_relocs_data::Read_relocs_data) New constructor.
8815 (Read_relocs_data::~Read_relocs_data) New destructor.
8816 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8817 pointers to NULL after deleting.
8818
7296d933
DK
88192010-04-07 Doug Kwan <dougkwan@google.com>
8820
8821 * arm.cc: Replace "endianity" with "endianness" in comments.
8822 (Arm_exidx_cantunwind): Ditto.
8823 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8824 (Arm_relobj::merge_flags_and_attributes): New method.
8825 (Arm_relobj::merge_flags_and_attributes_): New data member.
8826 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8827 (Arm_relobj::scan_sections_for_stubs): Ditto.
8828 (Arm_relobj::do_read_symbols): Check to see if we really want to
8829 merge processor-specific flags and attributes. Exit early if
8830 an object is empty except for section names and the undefined symbol.
8831 (Target_arm::do_finalize_sections): Move check for ELF format to
8832 Arm_relobj::do_read_symbols. Merge processor specific flags and
8833 attributes from a regular object only when we have determined that
8834 it is aapropriate. Do not create an .ARM.attributes section in
8835 output if there is no regular input object.
8836 (Target_arm::merge_processor_specific_flags): Check
8837 --warn-mismatch before printing any error.
8838 (Target_arm::merge_object_attributes): Ditto.
8839 * gold.cc (queue_middle_tasks): Handle the case in which there is
8840 no regular object in input.
8841 * options.cc (General_options::parse_EB): New method.
8842 (General_options::parse_EL): Same.
8843 (General_options::General_options): Initialize endianness_.
8844 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8845 New options.
8846 (General_options::Endianness): New enum.
8847 (General_options::endianness): New method.
8848 (General_options::endianness_): New data member.
8849 * parameters.cc (Parameters::set_options): Check target endianness.
8850 (Parameters::set_target_once): Ditto.
8851 (Parameters::check_target_endianness): New method.
8852 (parameters_force_valid_target): If either -EL or -EB is specified,
8853 use it to define endianness of default target.
8854 * parameters.h (Parameters::check_target_endianness): New method
8855 declaration.
8856 * target.h (class Target): Change "endianity" to "endianness"
8857 in comments.
8858
efc8d4f2
RW
88592010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8860
8861 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8862 * configure: Regenerate.
8863 * Makefile.in: Regenerate.
8864 * testsuite/Makefile.in: Regenerate.
8865
be234d88
CC
88662010-04-06 Cary Coutant <ccoutant@google.com>
8867
8868 gcc PR lto/42757
8869 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8870 prevailing definitions of common symbols.
8871 * testsuite/plugin_test_6.sh: New test case.
8872 * testsuite/plugin_common_test_1.c: New test case.
8873 * testsuite/plugin_common_test_2.c: New test case.
8874 * testsuite/Makefile.am (plugin_test_6): New test case.
8875 * testsuite/Makefile.in: Regenerate.
8876
bd32c6bd
NC
88772010-04-06 Nick Clifton <nickc@redhat.com>
8878
8879 * po/vi.po: New Vietnamese translation.
8880
323c532f
DK
88812010-03-30 Doug Kwan <dougkwan@google.com>
8882
8883 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8884
4fcd97eb
DK
88852010-03-25 Doug Kwan <dougkwan@google.com>
8886
8887 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8888 to avoid a conversion warning on a 32-bit host.
8889
4ebf39db
ILT
88902010-03-24 Ian Lance Taylor <iant@google.com>
8891
8892 * testsuite/script_test_3.t: Add a TLS segment.
8893 * testsuite/Makefile.am (check_PROGRAMS): Add
8894 tls_phdrs_script_test.
8895 (tls_phdrs_script_test_SOURCES): Define.
8896 (tls_phdrs_script_test_DEPENDENCIES): Define.
8897 (tls_phdrs_script_test_LDFLAGS): Define.
8898 (tls_phdrs_script_test_LDADD): Define.
8899 * testsuite/Makefile.in: Rebuild.
8900
4a599bdd
CC
89012010-03-23 Cary Coutant <ccoutant@google.com>
8902
8903 * fileread.cc (find_or_make_view): Fix comment.
8904
6c93b22c
ILT
89052010-03-23 Ian Lance Taylor <iant@google.com>
8906
8907 * script-sections.cc (class Orphan_section_placement): Define
8908 PLACE_TLS and PLACE_TLS_BSS.
8909 (Orphan_section_placement::Orphan_section_placement): Initialize
8910 new places.
8911 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8912 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8913 (tls_script_test_SOURCES): Define.
8914 (tls_script_test_DEPENDENCIES): Define.
8915 (tls_script_test_LDFLAGS): Define.
8916 (tls_script_test_LDADD): Define.
8917 * testsuite/Makefile.in: Rebuild.
8918
a2c7281b
DK
89192010-03-22 Doug Kwan <dougkwan@google.com>
8920
8921 * arm.cc (Arm_relocate_functions::abs8,
8922 Arm_relocate_functions::abs16): Use correct check for overflow
8923 specified in the ARM ELF specs.
8924 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8925 target of a BLX instruction specially.
8926 (Reloc_stub::stub_type_for_reloc): Ditto.
8927 (Relocate::relocate): Use symbolic names instead of numeric relocation
8928 codes to report error.
8929 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8930 workaround.
8931 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8932 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8933 thumb2_blx_out_of_range.stdout
8934 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8935 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8936 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8937 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8938 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8939 thumb2_blx_in_range, thumb2_blx_in_range.o,
8940 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8941 thumb2_blx_out_of_range.o): New rules.
2e702c99 8942 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8943 thumb2_blx_in_range and thumb2_blx_out_of_range.
8944 * testsuite/Makefile.in: Regenerate.
8945 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8946 * testsuite/thumb_blx_in_range.s: New file.
8947 * testsuite/thumb_blx_out_of_range.s: New file.
8948
b0193076
RÁE
89492010-03-22 Rafael Espindola <espindola@google.com>
8950
8951 * archive.cc (Should_include): Move to archive.h.
8952 (should_include_member): Make it a member of Archive.
8953 (Lib_group): New.
8954 (Add_lib_group_symbols): New.
8955 * archive.h: Include options.h.
8956 (Archive_member): Moved from Archive.
8957 (Should_include): Moved from archive.cc.
8958 (Lib_group): New.
8959 (Add_lib_group_symbols): New.
8960 * dynobj.cc (do_should_include_member): New.
8961 * dynobj.h (do_should_include_member): New.
8962 * gold.cc (queue_initial_tasks): Update call to queue.
8963 * main.cc (main): Print lib group stats.
8964 * object.cc (do_should_include_member): New.
8965 * object.h: Include archive.h.
8966 (Object::should_include_member): New.
8967 (Object::do_should_include_member): New.
8968 (Sized_relobj::do_should_include_member): New.
8969 * options.cc (General_options::parse_start_lib): New.
8970 (General_options::parse_end_lib): New.
8971 (Input_arguments::add_file): Handle lib groups.
8972 (Input_arguments::start_group): Check we are not in a lib.
8973 (Input_arguments::start_lib): New.
8974 (Input_arguments::end_lib): New.
8975 * options.h (General_options): Add start_lib and end_lib.
8976 (Input_argument::lib_): New.
8977 (Input_argument::lib): New.
8978 (Input_argument::is_lib): New.
8979 (Input_file_lib): New.
8980 (Input_arguments::in_lib_): New.
8981 (Input_arguments::in_lib): New.
8982 (Input_arguments::start_lib): New.
8983 (Input_arguments::end_lib_): New.
8984 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8985 in unused members as preempted.
8986 (Sized_pluginobj::do_should_include_member): New.
8987 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8988 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8989 return the blocker.
8990 (Read_symbols::do_whole_lib_group): New.
8991 (Read_symbols::do_lib_group): New.
8992 (Read_symbols::do_read_symbols): Handle lib groups.
8993 (Read_symbols::get_name): Handle lib groups.
8994 * readsyms.h (Read_symbols): Add an archive member pointer.
8995 (Read_symbols::do_whole_lib_group): New.
8996 (Read_symbols::do_lib_group): New.
8997 (Read_symbols::member_): New.
8998 * script.cc (read_input_script): Update call to queue_soon.
8999
d099120c
DK
90002010-03-19 Doug Kwan <dougkwan@google.com>
9001
9002 * arm.cc (Stub_table::Stub_table): Initialize new data members
9003 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9004 (Stub_table::add_reloc_stub): Assign stub offset and update
9005 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9006 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9007 New data members.
2e702c99 9008 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9009 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9010 instead of going over all reloc stubs.
2e702c99 9011 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9012 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9013 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9014 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9015 Stringpool_template::offset_.
9016 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9017 Stringpool_template::offset_ to zero.
9018
1aa37384
DK
90192010-03-15 Doug Kwan <dougkwan@google.com>
9020
9021 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9022 offset_.
9023 (Stringpool_template::new_key_offset): New method.
9024 (Stringpool_template::add_string): Assign offsets when adding new
9025 strings.
9026 (Stringpool_template::set_string_offsets): Do not set string offsets
9027 when not optimizing.
9028 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9029 member size_.
2e702c99
RM
9030 (Chunked_vector::clear): Clear size_.
9031 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9032 (Chunked_vector::size): Return size_.
9033 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9034 (Chunked_vector::size_): New data member.
1aa37384
DK
9035 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9036 (Stringpool_template::new_key_offset): New method declaration.
9037 (Stringpool_template::offset_): New data member.
9038
b672b057
RÁE
90392010-03-15 Rafael Espindola <espindola@google.com>
9040
9041 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9042 Add_symbols' constructor.
9043 * readsyms.h (Add_symbols): Remove the input_group member.
9044
b6848d3c
ILT
90452010-03-10 Ian Lance Taylor <iant@google.com>
9046
9047 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9048 target to ask whether a reference to a symbol requires a stack
9049 split.
9050 * target.h (Target::is_call_to_non_split): New function.
9051 (Target::do_is_call_to_non_split): Declare virtual function.
9052 * target.cc: Include "symtab.h".
9053 (Target::do_is_call_to_non_split): New function.
9054 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9055
a2a5469e
CC
90562010-03-10 Cary Coutant <ccoutant@google.com>
9057
9058 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9059 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9060 (File_read::open[2]): Add whole_file_view_ to list of views.
9061 (File_read::make_view): Remove test of whole_file_view_.
9062 (File_read::find_or_make_view): Create whole_file_view_ if
9063 necessary.
9064 (File_read::clear_views): Replace bool parameter with enum;
9065 adjust all callers. Don't delete views with permanent data;
9066 do delete cached views and views from archives if
9067 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9068 if clearing the corresponding view.
9069 * fileread.h (File_read::Clear_views_mode): New enum.
9070 (File_read::View::is_permanent_view): New method.
9071 (File_read::clear_views): Replace bool parameter
9072 with enum; adjust all callers.
9073 * options.h (General_options): Change keep_files_mapped option;
9074 add map_whole_files.
9075 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9076 releasing the file.
9077 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9078 the file.
9079
8861f32b
DM
90802010-03-10 David S. Miller <davem@davemloft.net>
9081
9082 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9083
d62d0f5f
ST
90842010-03-09 Sriraman Tallam <tmsriram@google.com>
9085
9086 * icf.cc (get_section_contents): Add '@' marker after processing the
9087 merge reloc.
9088
9177756d
DK
90892010-03-08 Doug Kwan <dougkwan@google.com>
9090
9091 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9092 due to a conversion warning.
9093 (Arm_relobj::update_output_local_symbol_count): Check for local
9094 symbol with unset output index.
9095
9e9e071b
ILT
90962010-03-05 Ian Lance Taylor <iant@google.com>
9097
9098 * options.h (class General_options): Add --spare-dynamic-tags.
9099 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9100 --spare-dynamic-tags.
9101
a81ee015
ILT
91022010-03-05 Ian Lance Taylor <iant@google.com>
9103
9104 * incremental.cc: Include "libiberty.h".
9105
44ec90b9
RO
91062010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9107
9108 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9109 function, is_info_ member.
9110 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9111 (Versions::Versions): Update caller.
9112 (Versions::define_base_version): Likewise.
9113 (Versions::add_def): Likewise.
9114
0897ed3b
ST
91152010-03-03 Sriraman Tallam <tmsriram@google.com>
9116
9117 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9118 (Scan::possible_function_pointer_reloc): New function.
9119 (Scan::local_reloc_may_be_function_pointer): Change to call
9120 possible_function_pointer_reloc.
9121 (Scan::global_reloc_may_be_function_pointer): Ditto.
9122 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9123 relocations in ".data.rel.ro._ZTV" section.
9124 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9125 * testsuite/icf_safe_so_test.cc: Ditto.
9126 * testsuite/icf_safe_test.cc: Ditto.
9127 * testsuite/icf_safe_test.sh: Ditto.
9128
d3bbad62
ILT
91292010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9130 Ian Lance Taylor <iant@google.com>
9131
9132 * target-reloc.h (relocate_section): Check the symbol table index
9133 for -1U before setting the local symbol index.
9134 (scan_relocatable_relocs): If copying the relocation, record that
9135 the local symbol is required.
9136 * object.h (Symbol_value::is_output_symtab_index_set): New
9137 function.
9138 (Symbol_value::may_be_discarded_from_output_symtab): New
9139 function.
9140 (Symbol_value::has_output_symtab_entry): New function.
9141 (Symbol_value::needs_output_symtab_entry): Remove.
9142 (Symbol_value::output_symtab_index): Make sure the symbol index is
9143 set.
9144 (Symbol_value::set_output_symtab_index): Make sure the symbol
9145 index is not set. Make sure the new index is valid.
9146 (Symbol_value::set_must_have_output_symtab_entry): New function.
9147 (Symbol_value::has_output_dynsym_entry): New function.
9148 (Symbol_value::set_output_dynsym_index): Make sure the new index
9149 is valid.
9150 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9151 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9152 local symbol if permitted.
9153 (Sized_relobj::do_finalize_local_symbols): Call
9154 is_output_symtab_index_set rather than needs_output_symtab_entry.
9155 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9156 rather than needs_output_symtab_entry. Call
9157 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9158 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9159 is_output_symtab_index_set rather than needs_output_symtab_entry.
9160 * testsuite/discard_locals_relocatable_test.c: New file.
9161 * testsuite/discard_locals_test.sh: Test -r.
9162 * testsuite/Makefile.am (check_DATA): Add
9163 discard_locals_relocatable_test1.syms,
9164 discard_local_relocatable_test2.syms.
9165 (MOSTLYCLEANFILES): Likewise. Also add
9166 discard_locals_relocatable_test1.lout and
9167 discard_locals_relocatable_test2.out.
9168 (discard_locals_relocatable_test1.syms): New target.
9169 (discard_locals_relocatable_test.o): New target.
9170 (discard_locals_relocatable_test1.out): New target.
9171 (discard_locals_relocatable_test2.syms): New target.
9172 (discard_locals_relocatable_test2.out): New target.
9173 (various): Add missing ../ld-new dependencies.
9174 * testsuite/Makefile.in: Rebuild.
9175
7e8ccf26
NC
91762010-03-03 Nick Clifton <nickc@redhat.com>
9177
9178 * po/fi.po: New Finnish translation.
9179
2a0ff005
DK
91802010-03-01 Doug Kwan <dougkwan@google.com>
9181
9182 * layout.cc (Layout::Layout): Force section types of .init_array*,
9183 .preinit_array* and .fini_array* sections.
9184 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9185 Fix check of return value of std::string::find.().
9186 (Output_section::Input_section_sort_compare::operator()): Remove
9187 comment about .init_array.
9188 (Output_section::Input_section_sort_init_fini_compare::operator()):
9189 New method.
9190 (Output_section::sort_attached_input_sections): Handle .init_array
9191 and .fini_array specially.
9192 * output.h (Output_section::Inut_section_sort_compare): Update
9193 comment.
9194 (Output_section::Input_section_sort_init_fini_compare): New struct.
9195
c3e4ae29
DK
91962010-02-26 Doug Kwan <dougkwan@google.com>
9197
9198 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9199 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9200 * testsuite/debug_msg.sh: Avoid matching source line number for
9201 use of global variable undef_int.
9202
2fd9ae7a
DK
92032010-02-26 Doug Kwan <dougkwan@google.com>
9204
9205 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9206 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9207 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9208 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9209 * options.cc (General_options::General_options): Initialize member
9210 fix_v4bx_.
9211 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9212 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9213 and rm_no_fix_v4bx.stdout
9214 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9215 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9216 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9217 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9218 and arm_no_fix_v4bx.
9219 * Makefile.in: Regenerate.
9220 * testsuite/arm_fix_v4bx.s: New file.
9221 * testsuite/arm_fix_v4bx.sh: Ditto.
9222
67ec7d0b
DK
92232010-02-24 Doug Kwan <dougkwan@google.com>
9224
9225 * arm.cc (Target_arm::got_section): Make the .got section the first
9226 non RELRO section in the data segment.
9227 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9228 suffixes of section names.
9229
10165461
DK
92302010-02-24 Doug Kwan <dougkwan@google.com>
9231
9232 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9233 flags and attributes merging if an input file is a binary file.
9234 * fileread.cc (Input_file::open): Record format of original file.
9235 * fileread.h (Input_file::Format): New enum type.
2e702c99 9236 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9237 (Input_file::format): New method definition.
9238 (Input_file::format_):: New data member.
9239
4a54abbb
DK
92402010-02-24 Doug Kwan <dougkwan@google.com>
9241
9242 * arm.cc (Arm_output_data_got): New class.
9243 (ARM_TCB_SIZE): New constant
9244 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9245 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9246 If user uses a script with a SECTIONS clause, issue only a warning
9247 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9248 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9249 garbage collection.
9250 (Target_arm::got_mode_index_entry): Handle static linking.
9251 (Target_arm::Scan::local): Ditto.
9252 (Target_arm::Scan::global): Ditto.
9253 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9254 all incorrectly implemented relocations.
e1df38aa 9255 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9256 Arm_output_section::fix_exidx_coverage.
9257 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9258 from ".ARM.exidx." and ".ARM.extab.".
9259
ca419a6f
ILT
92602010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9261
9262 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9263 section if it does not already exist.
9264 * attributes.cc (Attributes_section_data::Attributes_section_data):
9265 Don't crash if size is zero.
9266
135b9c78
ILT
92672010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9268 Ian Lance Taylor <iant@google.com>
9269
9270 * gold.cc (queue_middle_tasks): If no input files were opened,
9271 exit.
9272 * workqueue.h (Task_function::Task_function): Assert that there is
9273 a blocker.
9274
bb0bfe4f
DK
92752010-02-22 Doug Kwan <dougkwan@google.com>
9276
9277 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9278 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9279 types to avoid warnings due to different uint64_t implementations
9280 on different hosts.
9281
2a2b6d42
DK
92822010-02-21 Doug Kwan <dougkwan@google.com>
9283
9284 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9285 handling of the maximum backward branch offset.
2e702c99 9286 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9287 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9288 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9289 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9290 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9291 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9292 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9293 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9294 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9295 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9296 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9297 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9298 thumb2_bl_out_of_range.o): New rules.
9299 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9300 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9301 thumb2_bl_out_of_range
9302 * testsuite/Makefile.in: Regenerate.
9303 * testsuite/arm_bl_in_range.s: New file.
9304 * testsuite/arm_bl_out_of_range.s: Ditto.
9305 * testsuite/arm_branch_in_range.sh: Ditto.
9306 * testsuite/arm_branch_range.t: Ditto.
9307 * testsuite/thumb2_branch_range.t: Ditto.
9308 * testsuite/thumb_bl_in_range.s: Ditto.
9309 * testsuite/thumb_bl_out_of_range.s: Ditto.
9310 * testsuite/thumb_branch_range.t: Ditto.
9311
b487ad64
ST
93122010-02-20 Sriraman Tallam <tmsriram@google.com>
9313
9314 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9315 Add reloc offset information.
9316 * icf.cc (get_section_contents): Change iterators to point to the new
9317 vectors. Add reloc offset information to the contents.
9318 * icf.h (Icf::Sections_reachable_info): New typedef.
9319 (Icf::Sections_reachable_list): New typedef.
9320 (Icf::Offset_info): New typedef.
9321 (Icf::Reloc_info): New struct typedef.
9322 (Icf::Reloc_info_list): New typedef.
9323 (Icf::symbol_reloc_list): Delete method.
9324 (Icf::addend_reloc_list): Delete method.
9325 (Icf::section_reloc_list): Delete method.
9326 (Icf::reloc_info_list): New method.
9327 (Icf::reloc_info_list_): New member.
9328
f96accdf
DK
93292010-02-19 Doug Kwan <dougkwan@google.com>
9330
9331 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9332 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9333 * arm.cc (Arm_relocation_functions): New forward declaration.
9334 (Target_arm::Target_arm): Initialize new data members
9335 got_mod_index_offset_ and tls_base_symbol_defined_.
9336 (Target_arm::Relocate::relocate_tls): New method.
9337 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9338 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9339 New methods.
2e702c99 9340 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9341 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9342 (Target_arm::got_mod_index_offset_,
9343 Target_arm::tls_base_symbol_defined_): New data members.
9344 (Target_arm::Scan::local, Target::Scan::global,
9345 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9346 relocations.
9347
c8761b9a
DK
93482010-02-18 Doug Kwan <dougkwan@google.com>
9349
9350 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9351 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9352 text section as a parameter becuase some broken tools may not set
9353 the link in section header.
9354 (Target_arm::has_got_section): New method.
9355 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9356 without any mapping symbol as data only. Remove warning.
9357 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9358 link in its section header, try to discover the link by inspecting the
9359 REL31 relocation at the beginning of the section.
9360 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9361 in error message.
9362 (Target_arm::Scan::global): Treat any reference to the symbol
9363 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9364
21bb3914
ST
93652010-02-12 Sriraman Tallam <tmsriram@google.com>
9366
9367 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9368 (Scan::global_reloc_may_be_function_pointer): New function.
9369 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9370 (Scan::global_reloc_may_be_function_pointer): New function.
9371 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9372 (Scan::global_reloc_may_be_function_pointer): New function.
9373 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9374 (Scan::global_reloc_may_be_function_pointer): New function.
9375 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9376 (Scan::global_reloc_may_be_function_pointer): New function.
9377 (Scan::possible_function_pointer_reloc): New function.
9378 (Target_x86_64::can_check_for_function_pointers): New function.
9379 * gc.h (gc_process_relocs): Scan relocation types to determine if
9380 function pointers were taken for targets that support it.
9381 * icf.cc (Icf::find_identical_sections): Include functions for
9382 folding in safe ICF whose pointer is not taken.
9383 * icf.h (Secn_fptr_taken_set): New typedef.
9384 (fptr_section_id_): New member.
9385 (section_has_function_pointers): New function.
9386 (set_section_has_function_pointers): New function.
9387 (check_section_for_function_pointers): New function.
9388 * options.h: Fix comment for safe ICF option.
9389 * target.h (can_check_for_function_pointers): New function.
9390 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9391 Modify icf_safe_test for X86-64.
9392 * testsuite/Makefile.in: Regenerate.
9393 * testsuite/icf_safe_so_test.cc: New file.
9394 * testsuite/icf_safe_so_test.sh: New file.
9395 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9396 (main): Change to take pointer to function kept_func_3.
9397 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9398 folding is done correctly for X86-64.
9399
0da6fa6c
DM
94002010-02-12 David S. Miller <davem@davemloft.net>
9401
9402 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9403 is_symbolless parameter.
9404 (Output_reloc<SHT_REL>::is_symbolless): New.
9405 (Output_reloc<SHT_REL>::is_symbolless_): New.
9406 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9407 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9408 (Output_reloc<SHT_RELA>::is_symbolless): New.
9409 (Output_data_reloc::add_global): Handle is_symbolless.
9410 (Output_data_reloc::add_global_relative): Likewise.
9411 (Output_data_reloc::add_local): Likewise.
9412 (Output_data_reloc::add_local_relative): Likewise.
9413 (Output_data_reloc::add_symbolless_global_addend): New.
9414 (Output_data_reloc::add_symbolless_local_addend): New.
9415 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9416 is_symbolless.
9417 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9418 instead of ->is_relative_
9419 (Output_reloc::write): Likewise.
9420 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9421 (Output_reloc::write_rel): Simplify.
9422
9423 * sparc.cc (Target_sparc::Scan::local): Use
9424 ->add_symbolless_local_addend as needed.
9425 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9426 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9427 based upon relocation offset.
9428
e4782e83
DK
94292010-02-11 Doug Kwan <dougkwan@google.com>
9430
9431 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9432 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9433 beginning of function.
9434 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9435 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9436 parameter is_32bit in calls to should_apply_static_reloc.
9437 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9438 (check_DATA): Add arm_abs_global.stdout.
9439 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9440 arm_abs_global.stdout): New rules.
9441 (MOSTLLYCLEANFILES): Add arm_abs_global
9442 * Makefile.in: Regenerate.
9443 * testsuite/arm_abs_global.s: New file.
9444 * testsuite/arm_abs_global.sh: Ditto.
9445 * testsuite/arm_abs_lib.s: Ditto.
9446
93ceb764
ILT
94472010-02-11 Ian Lance Taylor <iant@google.com>
9448
9449 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9450 Read_relocs task.
9451 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9452 Allocate_commons_task first.
9453 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9454 task, rather than symtab_lock_.
9455 (Gc_process_relocs::~Gc_process_relocs): New function.
9456 (Gc_process_relocs::is_runnable): Check this_blocker_.
9457 (Gc_process_relocs::locks): Use next_blocker_ rather than
9458 blocker_.
9459 (Scan_relocs::~Scan_relocs): New function.
9460 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9461 symtab_lock_.
9462 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9463 next_blocker_.
9464 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9465 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9466 constructor accordingly.
9467 (class Gc_process_relocs): Likewise.
9468 (class Scan_relocs): Likewise.
9469 * common.h (class Allocate_commons_task): Remove symtab_lock_
9470 field, and corresponding constructor parameter.
9471 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9472 symtab_lock_.
9473 (Allocate_commons_task::locks): Likewise.
9474
114dfbe1
ILT
94752010-02-11 Ian Lance Taylor <iant@google.com>
9476
9477 * gold-threads.h (class Once): Define.
9478 (class Initialize_lock): Rewrite as child of Once.
9479 * gold-threads.cc (class Once_initialize): Define.
9480 (once_pointer_control): New static variable.
9481 (once_pointer, once_arg): New static variables.
9482 (c_run_once): New static function.
9483 (Once::Once, Once::run_once, Once::internal_run): New functions.
9484 (class Initialize_lock_once): Remove.
9485 (initialize_lock_control): Remove.
9486 (initialize_lock_pointer): Remove.
9487 (initialize_lock_once): Remove.
9488 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9489 (Initialize_lock::initialize): Rewrite.
9490 (Initialize_lock::do_run_once): New function.
9491 * archive.cc (Archive::interpret_header): Only clear name if it is
9492 not already empty.
9493 * fileread.cc: Include "gold-threads.h"
9494 (file_counts_lock): New static variable.
9495 (file_counts_initialize_lock): Likewise.
9496 (File_read::release): Only increment counts when using --stats.
9497 Use a lock around the increment.
9498 * parameters.cc (class Set_parameters_target_once): Define.
9499 (set_parameters_target_once): New static variable.
9500 (Parameters::Parameters): Move here from parameters.h.
9501 (Parameters::set_target): Rewrite.
9502 (Parameters::set_target_once): New function.
9503 (Parameters::clear_target): Move here and rewrite.
9504 * parameters.h (class Parameters): Update declarations. Add
9505 set_parameters_target_once_ field.
9506 (Parameters::Parameters): Move to parameters.cc.
9507 (Parameters::clear_target): Likewise.
9508 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9509 task.
9510 (Start_group::~Start_group): New function.
9511 (Start_group::is_runnable): New function.
9512 (Start_group::locks, Start_group::run): New functions.
9513 (Finish_group::run): Change saw_undefined to size_t.
9514 * readsyms.h (class Start_group): Define.
9515 (class Finish_group): Change saw_undefined_ field to size_t.
9516 (Finish_group::Finish_group): Remove saw_undefined and
9517 this_blocker parameters. Change all callers.
9518 (Finish_group::set_saw_undefined): New function.
9519 (Finish_group::set_blocker): New function.
9520 * symtab.h (class Symbol_table): Change saw_undefined to return
9521 size_t. Change saw_undefined_ field to size_t.
9522 * target-select.cc (Set_target_once::do_run_once): New function.
9523 (Target_selector::Target_selector): Initialize set_target_once_
9524 field. Don't initialize lock_ and initialize_lock_ fields.
9525 (Target_selector::instantiate_target): Rewrite.
9526 (Target_selector::set_target): New function.
9527 * target-select.h (class Set_target_once): Define.
9528 (class Target_selector): Update declarations. Make
9529 Set_target_once a friend. Remove lock_ and initialize_lock_
9530 fields. Add set_target_once_ field.
9531
fa17a3f4
ILT
95322010-02-10 Ian Lance Taylor <iant@google.com>
9533
9534 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9535 queueing any tasks.
9536 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9537 (queue_middle_tasks): Add all blockers before queueing any tasks.
9538 (queue_final_tasks): Likewise.
9539 * token.h (Task_token::add_blockers): New function.
9540 * object.h (Input_objects::number_of_relobjs): New function.
9541
c7177d31
ILT
95422010-02-10 Ian Lance Taylor <iant@google.com>
9543
5de0e392
ILT
9544 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9545 shared, not if not position independent.
9546 * x86_64.cc (Relocate::relocate_tls): Likewise.
9547 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9548 (tls_pie_pic_test): New target.
9549 * testsuite/Makefile.in: Rebuild.
9550
c7177d31
ILT
9551 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9552 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9553 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9554 * testsuite/Makefile.in: Rebuild.
9555
684b268a
DM
95562010-02-09 David S. Miller <davem@davemloft.net>
9557
9558 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9559 R_SPARC_RELATIVE using ->add_local_relative().
9560 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9561
612a8d3d
DM
9562 * output.h (Output_data_dynamic::add_section_size): New method
9563 that takes two Output_data objects.
9564 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9565 entry param. Handle it in initializers.
9566 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9567 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9568 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9569 arg.
9570 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9571 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9572 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9573 for dynrel_includes_plt.
9574 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9575 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9576 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9577 before .rela.plt
9578 (Target_sparc::do_finalize_sections): Update to pass true for
9579 dynrel_includes_plt.
9580 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9581 output before .rela.plt
9582 (Target_powerpc::do_finalize_sections): Update to pass true for
9583 dynrel_includes_plt when 32-bit.
9584
cb1be87e
DK
95852010-02-08 Doug Kwan <dougkwan@google.com>
9586
9587 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9588 method.
9589 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9590 Arm_relobj::scan_section_for_cortex_a8_stubs,
9591 Arm_relobj::do_relocation_section): Instead of calling
9592 Output_section::output_address, use faster
9593 Arm_relobj::simple_input_section_output_address.
9594
705b5121
DM
95952010-02-08 David S. Miller <davem@davemloft.net>
9596
9597 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9598 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9599 relocation helper function.
9600
024c4466
DM
9601 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9602 just like R_SPARC_GOT{10,13,22}.
9603 (Target_sparc::Scan::local): Likewise.
9604 (Target_sparc::Relocate:relocate): Likewise.
9605
9109c078
ILT
96062010-02-06 Ian Lance Taylor <iant@google.com>
9607
9608 * configure.ac: Rewrite targetobjs duplicate removal code to use
9609 only shell constructs.
9610 * configure: Rebuild.
9611
cf846138
DK
96122010-02-05 Doug Kwan <dougkwan@google.com>
9613
9614 PR 11247
9615 * arm.cc (Arm_relobj::section_is_scannable): New method.
9616 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9617 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9618
6cfaf60b
DK
96192010-02-04 Doug Kwan <dougkwan@google.com>
9620
9621 PR 11247
9622 * arm-reloc-property.cc (cstdio): Include.
9623 * configure.ac (targetobjs): Remove duplicates.
9624 * configure: Regenerate.
9625 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9626 big and little endian version for a given address size.
9627
5c57f1be
DK
96282010-02-03 Doug Kwan <dougkwan@google.com>
9629
9630 * arm-reloc-property.cc
9631 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9632 definition.
9633 * arm-reloc-property.h
9634 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9635 New method definition.
9636 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9637 declaration.
9638 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9639 overflow to N.
9640 (GOT_PREL): Change implemented to Y.
9641 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9642 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9643 (Arm_relocate_functions::movw_abs_nc): Remove method.
9644 (Arm_relocate_functions::movt_abs): Ditto.
9645 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9646 (Arm_relocate_functions::thm_movt_abs): Ditto.
9647 (Arm_relocate_functions::movw_rel_nc): Ditto.
9648 (Arm_relocate_functions::movw_rel): Ditto.
9649 (Arm_relocate_functions::movt_rel): Ditto.
9650 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9651 (Arm_relocate_functions:thm_movw_rel): Ditto.
9652 (Arm_relocate_functions:thm_movt_rel): Ditto.
9653 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9654 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9655 New method definitions.
9656 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9657 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9658 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9659 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9660 (Target_arm::Relocate::relocate): Check for non-static or
9661 unimplemented relocation code and exit early. Change calls to
9662 Target_arm::reloc_uses_thumb_bit and
9663 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9664 instead. Refactor code to handle similar relocations to increase
9665 code sharing. Remove check for unsupported relocation code in switch
9666 statement.
9667 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9668 relocation property table to find out size. Change error message to
9669 print out the name of a relocation code instead of the numeric value.
9670 (Target_arm::scan_reloc_for_stub): Use relocation property table
9671 instead of calling Target_arm::reloc_uses_thumb_bit().
9672
218c5831
DK
96732010-02-02 Doug Kwan <dougkwan@google.com>
9674
9675 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9676 types of relaxed input section.
9677
0d31c79d
DK
96782010-02-02 Doug Kwan <dougkwan@google.com>
9679
9680 * Makefile.am (HFILES): Add arm-reloc-property.h.
9681 (DEFFILES): New.
2e702c99
RM
9682 (TARGETSOURCES): Add arm-reloc-property.cc
9683 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9684 (libgold_a_SOURCES): $(DEFFILES)
9685 * Makefile.in: Regenerate.
9686 * arm-reloc-property.cc: New file.
9687 * arm-reloc-property.h: New file.
9688 * arm-reloc.def: New file.
9689 * arm.cc: Update comments.
9690 (arm-reloc-property.h): New included header.
9691 (arm_reloc_property_table): New global variable.
9692 (Target_arm::do_select_as_default_target): New method definition.
9693 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9694 arm-reloc-property to targ_extra_obj.
9695 * parameters.cc (set_parameters_target): Call
9696 Target::select_as_default_target().
9697 * target.h (Target::select_as_default_target): New method definition.
9698 (Target::do_select_as_default_target): Same.
9699
546c7457
DK
97002010-02-01 Doug Kwan <dougkwan@google.com>
9701
9702 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9703 first_output_text_section_.
9704 (Arm_exidx_fixup::first_output_text_section): New method definition.
9705 (Arm_exidx_fixup::first_output_text_section_): New data member.
9706 (Arm_exidx_fixup::process_exidx_section): Record the first text
9707 output section seen.
9708 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9709 and entsize in output section header.
9710
11b861d5
DK
97112010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9712
9713 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9714 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9715 (Arm_relocate_functions::thm_alu11): New Method.
9716 (Arm_relocate_functions::thm_pc8): New Method.
9717 (Arm_relocate_functions::thm_pc12): New Method.
9718 (Target_arm::Scan::local): Handle the relocations.
9719 (Target_arm::Scan::global): Likewise.
9720 (Target_arm::Relocate::relocate): Likewise.
9721 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9722
c9a2c125
DK
97232010-01-29 Doug Kwan <dougkwan@google.com>
9724
9725 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9726 of relocation types as ld.
9727
1521477a
DK
97282010-01-29 Doug Kwan <dougkwan@google.com>
9729
9730 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9731 to public.
9732 (Arm_relocate_functions::thumb_branch_common): Ditto.
9733 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9734 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9735 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9736 Arm_relocate_functions::jump24): Remove.
9737 (Target_arm::Relocate::relocate): Adjust code to call
9738 Arm_relocation_functions::arm_branch_common and
9739 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9740 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9741
e7eca48c
DK
97422010-01-29 Doug Kwan <dougkwan@google.com>
9743
9744 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9745 output_local_symbol_count_needs_update_.
9746 (Arm_relobj::output_local_symbol_count_needs_update,
9747 Arm_relobj::set_output_local_symbol_count_needs_update,
9748 Arm_relobj::update_output_local_symbol_count): New methods.
9749 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9750 member.
9751 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9752 of pointed function as in a R_ARM_PREL31 relocation.
9753 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9754 for output local symbol count updating.
9755 (Target_arm::do_relax): Update output local symbol counts in objects
9756 if necessary.
9757 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9758
02961d7e
ILT
97592010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9760
9761 * arm.cc: Added support for the ARM relocations:
9762 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9763 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9764 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9765 movw_prel_nc).
9766 (Arm_relocate_functions::movw_rel): New method.
9767 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9768 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9769 thm_movw_prel_nc).
9770 (Arm_relocate_functions::thm_movw_rel): New method.
9771 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9772 thm_movt_prel).
9773 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9774 relocations.
9775 (Target_arm::Scan::global): Likewise.
9776 (Target_arm::Relocate::relocate): Likewise.
9777 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9778 Likewise.
9779
b10d2873
ILT
97802010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9781
9782 * arm.cc: Added support for ARM group relocations.
9783 (Target_arm::reloc_needs_sym_origin): New method.
9784 (Arm_relocate_functions::calc_grp_kn): New method.
9785 (Arm_relocate_functions::calc_grp_residual): New method.
9786 (Arm_relocate_functions::calc_grp_gn): New method.
9787 (Arm_relocate_functions::arm_grp_alu): New Method.
9788 (Arm_relocate_functions::arm_grp_ldr): New Method.
9789 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9790 (Arm_relocate_functions::arm_grp_ldc): New Method.
9791 (Target_arm::Scan::local): Handle the ARM group relocations.
9792 (Target_arm::Scan::global): Likewise.
9793 (Target_arm::Relocate::relocate): Likewise.
9794 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9795 Likewise.
9796
2b328d4e
DK
97972010-01-26 Doug Kwan <dougkwan@google.com>
9798
9799 * arm.cc (set): Include.
9800 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9801 pointer type.
2e702c99 9802 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9803 (Arm_output_section::append_text_sections_to_list): New method.
9804 (Arm_output_section::fix_exidx_coverage): Ditto.
9805 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9806 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9807 Relobj::set_section_offset() instead of
9808 Sized_relobj::invalidate_section_offset().
2e702c99 9809 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9810 parameter for section headers. Ignore relocation sections for
9811 unallocated sections and EXIDX sections.
9812 (Target_arm::fix_exidx_coverage): New method.
9813 (Target_arm::output_section_address_less_than): New type.
9814 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9815 linked text section instead of the EXIDX section.
9816 (Arm_output_section::create_stub_group): Add an assertion to check
9817 that this is not an EXIDX output section.
9818 (Arm_output_section::append_text_sections_to_list): New method.
9819 (Arm_output_section::fix_exidx_coverage): Ditto.
9820 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9821 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9822 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9823 first pass.
9824 (Target_arm::fix_exidx_coverage): New method.
9825 * object.h (Relobj::set_output_section): New method.
9826 (Sized_relobj::invalidate_section_offset): Remove method.
9827 (Sized_relobj::do_invalidate_section_offset): Remove method.
9828 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9829
c7f3c371
DK
98302010-01-25 Doug Kwan <dougkwan@google.com>
9831
9832 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9833 Fix warning due to signed and unsigned comparison on a 32-bit host.
9834
8923b24c
DK
98352010-01-22 Doug Kwan <dougkwan@google.com>
9836
9837 * arm.cc (Target_arm::do_relax): Record an output section for section
9838 offset adjustment it contains any stub table that has changed.
9839 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9840 offsets in an output section if necessary.
9841 * output.cc (Output_section::Output_section): Initialize
9842 section_offsets_need_adjustments_.
9843 (Output_section::add_input_section_for_script): Renamed to
9844 Output_section::add_simple_input_section.
9845 (Output_section::save_states): Add a comment.
9846 (Output_section::discard_states): New method defintion.
9847 (Output_section::adjust_section_offsets): Same.
9848 * output.h (Output_section::add_input_section_for_script): Renamed to
9849 Output_section::add_simple_input_section.
9850 (Output_section::discard_states): New method declaration.
9851 (Output_section::adjust_section_offsets): Same.
9852 (Output_section::section_offsets_need_adjustment,
9853 Output_section::set_section_offsets_need_adjustment): New method
9854 definitions.
9855 (Output_section::section_offsets_need_adjustment_): New data member.
9856 * script-sections.cc
9857 (Output_section_element_input::set_section_address): Adjust code for
9858 renaming of Output_section::add_input_section_for_script.
9859 (Orphan_output_section::set_section_address): Same.
9860
9b2fd367
DK
98612010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9862
9863 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9864 Fix_v4bx enum values .
9865 * gold/options.h (General_options): New option definitions.
9866 (General_options::fix_v4bx): New method.
9867 (General_options::Fix_v4bx): New enum.
9868 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9869 (General_options::parse_fix_v4bx_interworking): New method.
9870
80d0d023
DK
98712010-01-22 Doug Kwan <dougkwan@google.com>
9872
9873 * arm.cc (Arm_exidx_fixup): New class.
9874
af2cdeae
DK
98752010-01-21 Doug Kwan <dougkwan@google.com>
9876
9877 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9878 classes.
9879 (Arm_exidx_section_offset_map): New type.
9880
993d07c1
DK
98812010-01-21 Doug Kwan <dougkwan@google.com>
9882
9883 * arm.cc (Arm_exidx_input_section): New class.
9884 (Arm_relobj::exidx_input_section_by_link,
9885 Arm_relobj::exidx_input_section_by_shndx,
9886 Arm_relobj::make_exidx_input_section): New methods.
9887 (read_arm_attributes_section): Remove.
9888 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9889 information about them.
9890 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9891 to here.
9892
5ac169d4
DK
98932010-01-20 Doug Kwan <dougkwan@google.com>
9894
9895 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9896 Input_section_specifier to Section_id.
9897 (Target_arm::new_arm_input_section: Adjust code for change of key
9898 type.
9899 (Target_arm::find_arm_input_section): Ditto.
9900 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9901 (Section_id): Remove.
9902 (Garbage_collection::Section_id_hash): Remove.
9903 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9904 (Section_id): Remove.
9905 (Icf::Section_id_hash): Remove.
9906 * object.h (Section_id, Const_section_id, Section_id_hash,
9907 Const_section_id_hash): New type definitions.
9908 * output.cc (Output_section::add_relaxed_input_section): Change to
9909 use Const_section_id instead of Input_section_specifier as key type.
9910 (Output_section::add_merge_input_section): Ditto.
9911 (Output_section::build_relaxation_map): Change to use Section_id
9912 instead of Input_section_specifier as key type.
2e702c99 9913 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9914 Ditto.
9915 (Output_section::convert_input_sections_to_relaxed_sections): Change
9916 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9917 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9918 (Output_section::find_relaxed_input_section): Ditto.
9919 * output.h (Input_section_specifier): Remove class.
9920 (Output_section::Output_section_data_by_input_section_map): Change
9921 key type to Const_section_id.
9922 (Output_section::Output_relaxed_input_section_by_input_section_map):
9923 Ditto.
9924 (Output_section::Relaxation_map): Change key type to Section_id.
9925
a2162063
ILT
99262010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9927
9928 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9929 (class Arm_v4bx_stub): New class.
9930 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9931 (Stub_factory::make_arm_v4bx_stub): New method.
9932 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9933 (Stub_table::empty): Handle v4bx stubs.
9934 (Stub_table::add_arm_v4bx_stub): New method.
9935 (Stub_table::find_arm_v4bx_stub): New method.
9936 (Arm_relocate_functions::v4bx): New method.
9937 (Target_arm::fix_v4bx): New method.
9938 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9939 (Stub_table::relocate_stubs): Likewise.
9940 (Stub_table::do_write): Likewise.
9941 (Stub_table::update_data_size_and_addralign): Likewise.
9942 (Stub_table::finalize_stubs): Likewise.
9943 (Target_arm::Scan::local): Likewise.
9944 (Target_arm::Scan::global): Likewise.
9945 (Target_arm::do_finalize_sections): Likewise.
9946 (Target_arm::Relocate::relocate): Likewise.
9947 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9948 Likewise.
9949 (Target_arm::scan_reloc_for_stub): Likewise.
9950 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9951
5696ab0b
ILT
99522010-01-19 Ian Lance Taylor <iant@google.com>
9953
9954 * output.cc (Output_section_headers::do_sized_write): Write large
9955 segment count to sh_info field.
9956 (Output_file_header::do_sized_write): For large segment count,
9957 write PN_XNUM to e_phnum field.
9958
800d0f56
ILT
99592010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9960
9961 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9962 (Arm_relocate_functions::thm_jump8): New function.
9963 (Arm_relocate_functions::thm_jump11): New function.
9964 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9965 R_ARM_THM_JUMP11.
9966 (Target_arm::Scan::global): Likewise.
9967 (Target_arm::Relocate::relocate): Likewise.
9968 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9969 Likewise.
9970
41263c05
DK
99712010-01-14 Doug Kwan <dougkwan@google.com>
9972
9973 * arm.cc (map, utility): Include headers.
9974 (Target_arm::apply_cortex_a8_workaround): New method.
9975 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9976 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9977 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9978 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9979 the --[no-]fix-cortex-a8 command line options.
9980 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9981 (Target_arm::relocate_stub): Use addend in instruction template.
9982 * options.h (DEFINE_bool): Set the user-set flag.
9983 (General_options): Add --[no-]-fix-cortex options.
9984 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9985 : Update fast look-up map after conversion.
41263c05 9986
459e9b03
ST
99872010-01-14 Sriraman Tallam <tmsriram@google.com>
9988
9989 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9990 in the first pass of do_layout.
9991
b521dfe4
DK
99922010-01-13 Doug Kwan <dougkwan@google.com>
9993
9994 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9995 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9996 apparent compiler problem of not folding static constant integral
9997 data members of elfcpp::Elf_sizes<32>.
9998
44272192
DK
99992010-01-13 Doug Kwan <dougkwan@google.com>
10000
10001 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10002 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10003 Arm_relobj::scan_section_for_cortex_a8_erratum,
10004 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10005 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10006 sections to scan for relocation stubs into a new method
10007 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10008 relocation and Cortex-A8 stub scanning.
10009 (Target_arm::do_relax): Force stubs to be after stubbed sections
10010 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10011 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10012 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10013
44b71ece
ILT
100142010-01-12 Ian Lance Taylor <iant@google.com>
10015
10016 * target-reloc.h (visibility_error): New inline function.
10017 (relocate_section): Call visibility_error.
10018 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10019 (MOSTLYCLEANFILES): Likewise.
10020 (protected_4_pic.o, protected_3.err): New targets.
10021 * testsuite/protected_4.cc: New file.
10022
a120bc7f
DK
100232010-01-12 Doug Kwan <dougkwan@google.com>
10024
10025 * arm.cc (Cortex_a8_reloc): New class.
10026 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10027 and cortex_a8_relocs_info_.
10028 (Target_arm::fix_cortex_a8): New method definition.
10029 (Target_arm::Cortex_a8_relocs_info): New type.
10030 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10031 New data member declarations.
10032 (Target_arm::scan_reloc_for_stub): Record information about
10033 relocations for THUMB branches that might be exempted from the
10034 Cortex-A8 workaround.
10035 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10036 at the beginning of a relaxation pass.
10037
20138696
DK
100382010-01-12 Doug Kwan <dougkwan@google.com>
10039
10040 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10041 (Arm_relobj::Mapping_symbol_position,
10042 Arm_reloj::Mapping_symbol_position_less,
10043 Arm_relobj::Mapping_symbols_info): New types.
10044 (Target_arm::is_mapping_symbol_name): New method definition.
10045 (Arm_relobj::do_count_local_symbols): Save information about mapping
10046 symbols.
10047
089d69dc
DK
100482010-01-11 Doug Kwan <dougkwan@google.com>
10049
10050 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10051 Arm_relocate_functions::thumb32_branch_upper,
10052 Arm_relocate_functions::thumb32_branch_lower,
10053 Arm_relocate_functions::thumb32_cond_branch_offset,
10054 Arm_relocate_functions::thumb32_cond_branch_upper,
10055 Arm_relocate_functions::thumb32_cond_branch_lower,
10056 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10057 branch offset encoding.
10058 (Arm_relocate_functions::thumb_branch_common): Use new branch
10059 offset encoding methods to avoid code duplication.
10060 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10061 (Stub_addend_reader::operator()): Use new branch encoding method
10062 to avoid code duplication.
10063
99e5bff2
DK
100642010-01-11 Doug Kwan <dougkwan@google.com>
10065
10066 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10067 (Target_arm::do_finalize_sections): Define special EXIDX section
10068 symbols only if referenced.
10069 * gc.h (Garbage_collection::add_reference): New method.
10070 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10071 code duplication.
10072
98e090bd
ILT
100732010-01-11 Ian Lance Taylor <iant@google.com>
10074
d0a91bd8
ILT
10075 * script.cc (Version_script_info::build_expression_list_lookup):
10076 Change complaing about duplicate wildcard match from error to
10077 warning.
10078
98e090bd
ILT
10079 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10080 of 2009-12-30.
10081 (Version_script_info::Version_script_info): Initialize globs_,
10082 default_version_, default_is_global_, and exact_. Don't
10083 initialize globals_ or locals_.
10084 (Version_script_info::build_lookup_tables): Build local symbols
10085 first.
10086 (Version_script_info::unquote): New function.
10087 (Version_script_info::add_exact_match): New function.
10088 (Version_script_info::build_expression_list_lookup): Remove lookup
10089 parameter. Add is_global parameter. Change all callers. Handle
10090 wildcard pattern specially. Unquote pattern. Call
10091 add_exact_match.
10092 (Version_script_info::get_name_to_match): New function.
10093 (Version_script_info::get_symbol_version): New function.
10094 (Version_script_info::get_symbol_version_helper): Remove.
10095 (Version_script_info::check_unmatched_names): Call unquote.
10096 * script.h (class Version_script_info): Change get_symbol_version
10097 to be non-inline and add is_global parameter; change all callers.
10098 Rewrite symbol_is_local. Update declarations. Define struct
10099 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10100 Remove globals_ and locals_ members. Add exact_, globs_,
10101 default_version_, is_global_.
10102 (Version_script_info::Glob): Remove pattern, add expression and
10103 is_global. Update constructor. Change all callers.
10104 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10105 default version.
10106 (Versions::symbol_section_contents): If a symbol is undefined, or
10107 defined in a dynamic object, set the version index to
10108 VER_NDX_LOCAL.
10109 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10110 symbol_is_local.
10111 (Symbol_table::add_from_pluginobj): Likewise.
10112 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10113
d56962d3
DK
101142010-01-11 Doug Kwan <dougkwan@google.com>
10115
10116 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10117 (incremental_dump_LDADD): Add linking option for libintl.
10118 * Makefile.in: Regenerate.
10119
94e6ee91
L
101202010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10121
10122 PR gold/11144
10123 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10124 instead of -Ds.
10125 * testsuite/Makefile.in: Regenerated.
10126
e96c574b
DK
101272010-01-10 Doug Kwan <dougkwan@google.com>
10128
10129 * options.h (DEFINE_var): Use parentheses around argument varname__
10130 in macro body to avoid any unintended subsequent substitutions.
10131
7198066b
ILT
101322010-01-10 Ian Lance Taylor <iant@google.com>
10133
ba4d53bf
ILT
10134 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10135 candidates before doing symbol resolution.
10136
7198066b
ILT
10137 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10138 ODR candidates if only one is weak.
10139
a2beed37
ILT
101402010-01-08 Ian Lance Taylor <iant@google.com>
10141
10142 * script.cc (Version_script_info::build_expression_list_lookup):
10143 Don't warn about ambiguous version, just record the ambiguity.
10144 (Version_script_info::get_symbol_version_helper): Give error if
10145 version is ambiguous.
10146
2fb7225c
DK
101472010-01-08 Doug Kwan <dougkwan@google.com>
10148
10149 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10150 prev_data_size_ and prev_addralign_. Remove initializer for
10151 deleted data member has_been_changed_.
10152 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10153 to determine if the table is empty.
10154 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10155 Remove.
10156 (Stub_table::add_reloc_stub): Define method in class definition
10157 instead of just declaring it there.
10158 (Stub_table::add_cortex_a8_stub): New method definition.
10159 (Stub_table::update_data_size_and_addralign): Ditto.
10160 (Stub_table::finalize_stubs): Ditto.
10161 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10162 (Stub_table::do_addralign_): Return address alignment in the
10163 (Stub_table::do_reset_address_and_file_offset): Define method in
10164 class definition instead of declaring it there. Set current data
10165 size to be the data size of the previous pass.
10166 (Stub_table::set_final_data_size): Use current data size as the
10167 final data size.
10168 (Stub_table::relocate_stub): Change parameter type of stub from
10169 Reloc_stub pointer to Stub pointer.
10170 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10171 (Stub_table::Cortex_a8_stub_list): New typedef.
10172 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10173 Stub_table::prev_addralign_): New data member.
10174 (Arm_relobj::Arm_relobj): Initialize data member
10175 section_has_cortex_a8_workaround_.
10176 (Arm_relobj::section_has_cortex_a8_workaround,
10177 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10178 definitions.
10179 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10180 declarations.
10181 (Target_arm::relocate_stub): Change parameter type of stub from
10182 Reloc_stub pointer to Stub pointer.
10183 (Insn_template::size, Insn_template::alignment): Handle
10184 THUMB16_SPECIAL_TYPE.
10185 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10186 Stub_table::update_data_size_and_addralign,
10187 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10188 definitions.
10189 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10190 (Stub_table::do_write): Ditto.
10191 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10192
880cd20d
ILT
101932010-01-08 Ian Lance Taylor <iant@google.com>
10194
10195 PR 11108
10196 * symtab.h (class Symbol): Remove fields is_target_special_ and
10197 has_plt_offset_. Add field is_defined_in_discarded_section_.
10198 (Symbol::is_defined_in_discarded_section): New function.
10199 (Symbol::set_is_defined_in_discarded_section): New function.
10200 (Symbol::has_plt_offset): Rewrite.
10201 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10202 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10203 Don't initialize is_target_special_ or has_plt_offset_.
10204 Initialize is_defined_in_discarded_section_.
10205 (Symbol_table::add_from_relobj): If appropriate, set
10206 is_defined_in_discarded_section.
10207 * resolve.cc (Symbol::override_base_with_special): Don't test
10208 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10209 * target-reloc.h (relocate_section): Do special handling for
10210 symbols defined in discarded sections for global symbols as well
10211 as local symbols.
10212
2703e3eb
ILT
102132010-01-08 Ian Lance Taylor <iant@google.com>
10214
10215 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10216 the SHT_SYMTAB case.
10217
339d40a3
ILT
102182010-01-08 Ian Lance Taylor <iant@google.com>
10219
10220 * object.cc (Sized_relobj::do_layout): Don't get confused if
10221 layout_eh_frame returns NULL.
10222
abecea76
ILT
102232010-01-08 Ian Lance Taylor <iant@google.com>
10224
10225 PR 11084
10226 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10227 dynamic symbol table, use the normal symbol table.
10228 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10229 symbol table.
10230
6b7dd3f3
ILT
102312010-01-08 Ian Lance Taylor <iant@google.com>
10232
10233 PR 11072
10234 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10235 sections.
10236
36c50e63
L
102372010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10238
10239 * version.cc (print_version): Change to "Copyright 2010".
10240
e291e7b9
ILT
102412010-01-08 Ian Lance Taylor <iant@google.com>
10242
10243 PR 10287
10244 PR 11063
10245 * i386.cc (class Target_i386): Change return type of plt_section
10246 to be non-const.
10247 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10248 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10249 tls_desc_rel_ field.
10250 (Output_data_plt_i386::rel_tls_desc): New function.
10251 (Target_i386::rel_tls_desc_section): New function.
10252 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10253 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10254 R_386_TLS_DESC reloc in rel_tls_desc_section.
10255 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10256 Define struct Tlsdesc_info.
10257 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10258 (Target_x86_64::do_reloc_symbol_index): New function.
10259 (Target_x86_64::add_tlsdesc_info): New function.
10260 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10261 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10262 tlsdesc_rel_ field.
10263 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10264 all callers.
10265 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10266 (Target_x86_64::rela_tlsdesc_section): New function.
10267 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10268 handling.
10269 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10270 (Target_x86_64::do_reloc_addend): New function.
10271 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10272 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10273 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10274 (Output_reloc::type): New function.
10275 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10276 (Output_reloc::is_target_specific): New function.
10277 (Output_reloc::target_arg): New function.
10278 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10279 absolute relocs and target specific relocs.
10280 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10281 add_target_specific.
10282 (class Output_data_reloc) [SHT_RELA]: Likewise.
10283 * output.cc (Output_reloc::Output_reloc): Add four new versions
10284 for absolute relocs and target specific relocs.
10285 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10286 (Output_reloc::get_symbol_index): Likewise.
10287 (Output_reloc::local_section_offset): Check that local_sym_index_
10288 is not TARGET_CODE or 0.
10289 (Output_reloc::symbol_value): Likewise.
10290 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10291 reloc.
10292 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10293 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10294 functions.
10295 * layout.cc (add_target_dynamic_tags): Use output section for
10296 DT_PLTRELSZ and DT_JMPREL.
10297
3a44184e
ILT
102982010-01-07 Ian Lance Taylor <iant@google.com>
10299
10300 PR 11061
10301 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10302 function.
10303 (class Output_data_reloc_generic): Define.
10304 (class Output_data_reloc_base): Change base class to
10305 Output_data_reloc_generic. Change add() method to call
10306 bump_relative_reloc_count for a relative reloc. Remove
10307 sort_relocs_ field.
10308 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10309 to sort_relocs().
10310 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10311 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10312 appropriate.
10313 * layout.h (class Layout): Update declaration.
10314
ea715a34
ILT
103152010-01-07 Ian Lance Taylor <iant@google.com>
10316
10317 * output.h (class Output_data): Add const version of
10318 output_section and do_output_section.
10319 (class Output_section_data): Add const version of
10320 do_output_section.
10321 (class Output_section): Likewise.
10322 * layout.cc (Layout::add_target_dynamic_tags): New function.
10323 * layout.h (class Layout): Update declarations.
10324 * arm.cc (Target_arm::do_finalize_sections): Use
10325 add_target_dynamic_tags.
10326 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10327 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10328 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10329 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10330
659948a4
ILT
103312010-01-07 Ian Lance Taylor <iant@google.com>
10332
10333 PR 11042
10334 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10335 object as needed.
10336
9d3b86f6
ILT
103372010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10338 Ian Lance Taylor <iant@google.com>
10339
10340 PR 11019
10341 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10342 Xindex::read_symtab_xindex.
10343
bb0d3eb0
DK
103442010-01-07 Doug Kwan <dougkwan@google.com>
10345
10346 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10347 (Insn_template::thumb16_bcond_insn): New method declaration.
10348 (Insn_template): Fix spelling.
10349 (Stub::thumb16_special): New method declaration.
10350 (Stub::do_write): Define virtual method which was previously pure
10351 virtual.
10352 (Stub::do_thumb16_special): New method declaration.
10353 (Stub::do_fixed_endian_write): New template member.
10354 (Reloc_stub::do_write): Remove.
10355 (Reloc_stub::do_fixed_endian_write): Remove.
10356 (Cortex_a8_stub): New class definition.
10357 (Stub_factory::make_cortex_a8_stub): New method definition.
10358 (Stub_factory::Stub_factory): Add missing static storage class
10359 qualifier for elf32_arm_stub_a8_veneer_blx.
10360
ffeef7df
ILT
103612010-01-07 Ian Lance Taylor <iant@google.com>
10362
dc3f80fe
ILT
10363 PR 10980
10364 * options.h (class General_options): Add --warn-unresolved-symbols
10365 and --error-unresolved-symbols.
10366 * errors.cc (Errors::undefined_symbol): Implement
10367 --warn-unresolved-symbols.
10368
ffeef7df
ILT
10369 * options.h (class General_options): Add -z text and -z textoff.
10370 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10371
f1ec9ded
ST
103722010-01-06 Sriraman Tallam <tmsriram@google.com>
10373
10374 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10375 (Garbage_collection::cident_sections): New function.
10376 (Garbage_collection::add_cident_section): New function.
10377 (Garbage_collection::cident_sections_): New member.
10378 (gc_process_relocs): Add references to sections whose names are C
10379 identifiers.
10380 * gold.h (cident_section_start_prefix): New constant.
10381 (cident_section_stop_prefix): New constant.
10382 (is_cident): New function.
10383 * layout.cc (Layout::define_section_symbols): Replace string constants
10384 with the newly defined constants.
10385 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10386 C identifiers.
10387 * testsuite/Makefile.am: Add gc_orphan_section_test.
10388 * testsuite/Makefile.in: Regenerate.
10389 * testsuite/gc_orphan_section_test.cc: New file.
10390 * testsuite/gc_orphan_section_test.sh: New file.
10391
6eda8c29
ILT
103922010-01-06 Ian Lance Taylor <iant@google.com>
10393
b9674e17
ILT
10394 PR 10980
10395 * options.h (class General_options): Add --warn-shared-textrel.
10396 * layout.cc (Layout::finish_dynamic_section): Implement
10397 --warn-shared-textrel.
10398
6eda8c29
ILT
10399 PR 10980
10400 * options.h (class General_options): Add --warn-multiple-gp.
10401
32dcd44e
ILT
104022010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10403
10404 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10405 $(THREADSLIB) and $(LIBDL).
10406 * Makefile.in: Rebuild.
10407
a192ba05
ILT
104082010-01-06 Ian Lance Taylor <iant@google.com>
10409
10410 PR 10980
10411 * options.cc (General_options::parse_section_start): New function.
10412 (General_options::section_start): New function.
10413 (General_options::General_options): Initialize all members.
10414 * options.h: Include <map>
10415 (class General_options): Add --section-start. Add section_starts_
10416 member.
10417 * layout.cc (Layout::attach_allocated_section_to_segment): If
10418 --section-start was used, set the address of the segment. Remove
10419 local sort_sections.
10420 (Layout::relaxation_loop_body): If the address of the load segment
10421 has been set by --section-start, don't use it.
10422 * output.h (Output_segment::update_flags_for_output_section): New
10423 function.
10424 * output.cc (Output_segment::add_output_section): Call
10425 update_flags_for_output_section.
10426
dde3f402
ILT
104272010-01-05 Ian Lance Taylor <iant@google.com>
10428
62dfdd4d
ILT
10429 PR 10980
10430 * options.h (class General_options): Add --undefined-version.
10431 * script.cc (struct Version_expression): Add was_matched_by_symbol
10432 field.
10433 (Version_script_info::matched_symbol): New function.
10434 (Version_script_info::get_symbol_version_helper): Call
10435 matched_symbol.
10436 (Version_script_info::check_unmatched_names): New function.
10437 * script.h (class Version_script_info): Update declarations.
10438 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10439
9c4ae156
ILT
10440 * options.h (class General_options): Use DEFINE_bool_alias for
10441 allow_multiple_definition.
10442 * resolve.cc (Symbol_table::should_override): Don't test
10443 allow_multiple_definition.
10444
dde3f402
ILT
10445 PR 10980
10446 * options.h (class General_options): Add --cref.
10447 * main.cc (main): Print cref table if --cref. Don't close mapfile
10448 until after printing cref table.
10449 * cref.cc: Include "symtab.h".
10450 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10451 (Cref_table_compare::operator()): New function.
10452 (Cref_inputs::gather_cref): New function.
10453 (filecol): New static const.
10454 (Cref_inputs::print_cref): New function.
10455 (Cref::print_cref): New function.
10456 * cref.h: Include <cstdio>.
10457 (class Cref): Update declarations.
10458 * mapfile.h (Mapfile::file): New function.
10459 * object.h (class Object): Define Symbols. Declare virtual
10460 do_get_global_symbols.
10461 (Object::get_global_symbols): New function.
10462 * object.cc (Input_objects::add_object): Pass object to cref_ if
10463 --cref.
10464 (Input_objects::archive_start): Likewise.
10465 (Input_objects::archive_stop): Likewise.
10466 (Input_objects::print_cref): New function.
10467 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10468 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10469 --cref.
10470 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10471 function.
10472 * plugin.h (class Sized_pluginobj): Update declarations.
10473
8781f709
ILT
104742010-01-05 Ian Lance Taylor <iant@google.com>
10475
10476 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10477 to is_default_version. Rename insdef to insdefault.
10478 (Symbol_table::add_from_relobj): Rename def to is_default_version
10479 and local to is_forced_local.
10480 (Symbol_table::add_from_pluginobj): Likewise.
10481 (Symbol_table::add_from_dynobj): Likewise.
10482 (Symbol_table::define_special_symbol): Rename insdef to
10483 insdefault.
10484
fe35d28d
ILT
104852010-01-04 Ian Lance Taylor <iant@google.com>
10486
30bc8c46
ILT
10487 PR 10980
10488 * options.h (class General_options): Add
10489 --allow-multiple-definition and -z muldefs.
10490 * resolve.cc (Symbol_table::should_override): Don't warn about a
10491 multiple symbol definition if --allow-multiple-definition or -z
10492 muldefs.
10493
7eaea549
ILT
10494 PR 10980
10495 * options.h (class General_options): Add --add-needed and
10496 --copy-dt-needed-entries. Tweak --as-needed help entry.
10497 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10498 error if --copy-dt-needed-entries aka --add-needed is used and
10499 would cause a change in behaviour.
10500
fe35d28d
ILT
10501 PR 10980
10502 * options.h (class General_options): Add -G as a short version of
10503 --shared. Add no-op options -assert, -g, and -i.
10504
55a2bb35
ST
105052010-01-04 Sriraman Tallam <tmsriram@google.com>
10506
10507 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10508 check for .text or .gnu.linkonce.t sections.
10509 * icf.cc (Icf::find_identical_sections): Ditto.
10510 Change the detection for mangled function name within the section
10511 name.
10512 * icf.h (is_section_foldable_candidate): New function.
10513
719328e1
ILT
105142009-12-30 Ian Lance Taylor <iant@google.com>
10515
10516 PR 10980
10517 * options.h (class General_options): Permit two dashes with
10518 --retain-symbols-file.
10519
d7bb5745
ILT
105202009-12-30 Ian Lance Taylor <iant@google.com>
10521
403a15dd
ILT
10522 PR 10979
10523 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10524 don't put the file header and segment headers in the text
10525 segment.
10526
eda294df
ILT
10527 PR 10979
10528 * common.cc (Sort_commons::operator()): Stabilize sort when both
10529 entries are NULL.
10530 (Symbol_table::do_allocate_commons_list): When allocating common
10531 symbols, skip a symbol which is no longer common.
10532 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10533 an object before checking its type.
10534 * testsuite/common_test_2.c: New file.
10535 * testsuite/common_test_3.c: New file.
10536 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10537 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10538 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10539 (common_test_2_pic.o, common_test_2.so): New targets.
10540 (common_test_3_pic.o, common_test_3.so): New targets.
10541 * testsuite/Makefile.in: Rebuild.
10542
d7bb5745
ILT
10543 PR 10979
10544 * script.cc (read_input_script): If we see a new SECTIONS clause,
10545 and we have added an input section, give an error.
10546 * layout.h (class Layout): Add have_added_input_section function.
10547 Add have_added_input_section_ field.
10548 * layout.cc (Layout::Layout): Initialize
10549 have_added_input_section_.
10550 (Layout::layout): Set have_added_input_section_.
10551 (Layout::layout_eh_frame): Likewise.
10552
fc59c572
ILT
105532009-12-30 Ian Lance Taylor <iant@google.com>
10554
10555 PR 10931
10556 * options.h (class General_options): Add --sort-common option.
10557 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10558 * common.cc (Sort_common): Add sort_order parameter to
10559 constructor. Add sort_order_ field.
10560 (Sort_commons::operator): Check sort_order_.
10561 (Symbol_table::allocate_commons): Determine the sort order.
10562 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10563 Change all callers.
10564 (Symbol_table::do_allocate_commons_list): Likewise.
10565
1c74fab0
ILT
105662009-12-30 Ian Lance Taylor <iant@google.com>
10567
10568 PR 10916
10569 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10570 symbols from this object, don't change the visibility of an
10571 undefined symbol.
10572 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10573
6affe781
ILT
105742009-12-30 Ian Lance Taylor <iant@google.com>
10575
10576 PR 10861
10577 * script.h (class Version_script_info): Define Language enum.
10578 Update declarations. Define Glob, Exact, and Lookup types. Add
10579 new fields globals_, locals_, and is_finalized_.
10580 * script.cc: Various formatting fixes.
10581 (class Parser_closure): Change language_stack_ from a vector of
10582 std::string to one of Version_script_info::Language. Adjust all
10583 uses accordingly.
10584 (class Lazy_demangler): Remove.
10585 (struct Version_expression): Change language from std::string to
10586 Version_script_info::Language.
10587 (Version_script_info::Version_script_info): New function.
10588 (Version_script_info::~Version_script_info): Don't call clear.
10589 (Version_script_info::finalize): New function.
10590 (Version_script_info::build_lookup_tables): New function.
10591 (Version_script_info::build_expression_list_lookup): New
10592 function.
10593 (Version_script_info::get_symbol_version_helper): Rewrite to use
10594 lookup tables.
10595 (Version_script_info::print_expression_list): Adjust to use
10596 Version_script_info::Language.
10597 (script_push_lex_into_version_mode): Check that the version script
10598 has not been finalized.
10599 (version_script_push_lang): Change language string to
10600 Version_script_info::Language.
10601 * options.cc (Command_line::version_script): New function.
10602 * options.h (class General_options): Add finalize_dynamic_list
10603 function. Change version_script from declaration to definition.
10604 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10605 * testsuite/version_script.map: Remove duplicate def of foo.
10606 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10607 version_script.map.
10608 * testsuite/Makefile.in: Rebuild.
10609
818bf354
ILT
106102009-12-30 Ian Lance Taylor <iant@google.com>
10611
10612 PR 10843
10613 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10614 if the input symbol index is 0, make the output symbol index 0.
10615
ebcc8304
ILT
106162009-12-30 Ian Lance Taylor <iant@google.com>
10617
10618 PR 10670
10619 * options.h (class General_options): Add -x/--discard-all.
10620 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10621 --discard-all. If the local symbol needs a dynamic entry, check
10622 that before handling --discard-locals.
10623
176fe33f
ILT
106242009-12-30 Ian Lance Taylor <iant@google.com>
10625
bb321bb1
ILT
10626 PR 10450
10627 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10628 flags to PF_R.
10629 (Output_segment::add_output_section): Don't change the flags if
10630 the type is PT_TLS.
10631
176fe33f
ILT
10632 PR 10450
10633 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10634 GNU hash table if they need a dynamic value. Otherwise, don't add
10635 them if they are defined in a dynamic object or are forced local.
10636
e8cd95c7
ILT
106372009-12-29 Ian Lance Taylor <iant@google.com>
10638
1b81fb71
ILT
10639 PR 10450
10640 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10641 .gnu.hash table for a 32-bit target.
10642
8d6d383d
ILT
10643 PR 10450
10644 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10645 regular and a dynamic object only needs a dynamic symbol table
10646 entry if it is externally visible.
10647
e785ec03
ILT
10648 PR 10450
10649 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10650 constructor. Add global_offset_table_ field.
10651 (Target_i386::got_section): Set global_offset_table_.
10652 (Target_i386::do_finalize_sections): Set global_offset_table_
10653 size.
10654 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10655 in constructor. Add global_offset_table_ field.
10656 (Target_x86_64::got_section): Set global_offset_table_.
10657 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10658 size.
10659
1a2dff53
ILT
10660 * layout.cc (Layout::Layout): Initialize increase_relro_.
10661 (Layout::get_output_section): Add is_relro, is_last_relro, and
10662 is_first_non_relro parameters. Change all callers.
10663 (Layout::choose_output_section): Likewise.
10664 (Layout::add_output_section_data): Likewise.
10665 (Layout::make_output_section): Likewise.
10666 (Layout::set_segment_offsets): Clear increase_relro when using a
10667 linker script.
10668 * layout.h (class Layout): Add increase_relro method. Add
10669 increase_relro_ field. Update declarations.
10670 * output.cc (Output_section::Output_section): Initialize
10671 is_last_relro_ and is_first_non_relro_.
10672 (Output_segment::add_output_section): Group relro sections is
10673 do_sort is true. Handle is_last_relro and is_first_non_relro.
10674 (Output_segment::maximum_alignment): Remove relro handling.
10675 (Output_segment::set_section_addresses): Add increase_relro
10676 parameter. Change all callers. Add initial alignment to align
10677 relro sections on separate page. Remove old relro handling.
10678 (Output_segment::set_section_list_addresses): Remove in_relro
10679 parameter. Change all callers.
10680 (Output_segment::set_offset): Add increase parameter. Change all
10681 callers. Remove old relro handling.
10682 * output.h (class Output_section): Add new methods: is_last_relro,
10683 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10684 Add is_last_relro_ and is_first_non_relro_ fields.
10685 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10686 Create separate .got.plt section. Call increase_relro.
10687 * x86_64.cc (Target_x86_64::got_section): Likewise.
10688 * testsuite/relro_script_test.t: Add .got.plt.
10689
f0ba79e2
ILT
10690 PR 10450
10691 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10692 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10693 (Layout::finalize): Call set_dynamic_symbol_size.
10694 (Layout::set_dynamic_symbol_size): New function.
10695 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10696 set_dynamic_symbol_size.
10697
e8cd95c7
ILT
10698 PR 10450
10699 * output.h (class Output_section): Add is_entsize_zero_ field.
10700 * output.cc (Output_section::Output_section): Initialize
10701 is_entsize_zero_.
10702 (Output_section::set_entsize): If two different entsizes are
10703 requested, force it to zero.
10704 (Output_section::add_input_section): Set flags for .debug_str
10705 before updating section flags. Set entsize.
10706 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10707 and SHF_STRING if all input sections have those flags.
10708
3e1b9a8a
RÁE
107092009-12-29 Rafael Espindola <espindola@google.com>
10710
10711 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10712 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10713 reporting.
3e1b9a8a 10714
3dcad376
ST
107152009-12-29 Sriraman Tallam <tmsriram@google.com>
10716
10717 * options.cc (General_options::parse_version): Allow -v to exit
10718 without an error if there is nothing to link.
10719
084e2665
ILT
107202009-12-29 Ian Lance Taylor <iant@google.com>
10721
10722 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10723 using a version of gcc before 4.1.
10724 * configure: Rebuild.
10725
250acde3
CD
107262009-12-28 Chris Demetriou <cgd@google.com>
10727
10728 * attributes.cc (Output_attributes_section_data::do_write): Use
10729 std::vector::front rather than std::vector::data.
10730
99fff23b
ILT
107312009-12-28 Ian Lance Taylor <iant@google.com>
10732
10733 * symtab.h (class Symbol_table): Add enum Defined.
10734 * resolve.cc (Symbol_table::should_override): Add defined
10735 parameter. Change all callers. Test whether object is NULL
10736 before calling a method on it.
10737 (Symbol_table::report_resolve_problem): Add defined parameter.
10738 Change all callers.
10739 (Symbol_table::should_override_with_special): Likewise.
10740 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10741 parameter. Change all callers.
10742 (Symbol_table::do_define_in_output_data): Likewise.
10743 (Symbol_table::define_in_output_segment): Likewise.
10744 (Symbol_table::do_define_in_output_segment): Likewise.
10745 (Symbol_table::define_as_constant): Likewise.
10746 (Symbol_table::do_define_as_constant): Likewise.
10747 * script.h (class Symbol_assignment): Add is_defsym parameter to
10748 constructor; change all callers.
10749 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10750 parameter. Change all callers. Add is_defsym_ field.
10751 (class Parser_closure): Add parsing_defsym parameter to
10752 constructor; change all callers. Add parsing_defsym accessor
10753 function. Add parsing_defsym_ field.
10754
556bd683
ILT
107552009-12-28 Ian Lance Taylor <iant@google.com>
10756
10757 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10758 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10759
1782c879
ILT
107602009-12-23 Ian Lance Taylor <iant@google.com>
10761
10762 * i386.cc (Target_i386::do_calls_non_split): Recognize
10763 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10764 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10765 -fsplit-stack prologue when using %r11.
1782c879 10766
329ca2b1
ST
107672009-12-21 Sriraman Tallam <tmsriram@google.com>
10768
10769 * options.cc (General_options::parse_version): Make -v continue and do
10770 the link like GNU ld does.
10771
d675ff46
RÁE
107722009-12-17 Rafael Avila de Espindola <espindola@google.com>
10773
10774 * Makefile.am (CCFILES): Add timer.cc.
10775 (HFILES): Add timer.h.
10776 * configure.ac: Check for sysconf and times.
10777 * main.cc: include timer.h.
10778 (main): Use Timer instead of get_run_time.
10779 * timer.cc: New.
10780 * timer.h: New.
10781 * workqueue.cc: include timer.h.
10782 (Workqueue::find_and_run_task):
10783 Report user, sys and wall time.
10784 * Makefile.in: Regenerate.
10785 * config.in: Regenerate.
10786 * configure: Regenerate.
10787
d6344fb5
DK
107882009-12-16 Doug Kwan <dougkwan@google.com>
10789
10790 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10791 sections.
10792 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10793 relaxed input sections.
10794 * output.cc (Output_section::find_relaxed_input_section): Change
10795 return type to Output_relaxed_input_section pointer. Adjust code
10796 for new type of relaxed_input_section_map_.
10797 * output.h (Output_section::find_relaxed_input_section): Change
10798 return type to Output_relaxed_input_section pointer.
10799 (Output_section::Output_relaxed_input_section_by_input_section_map):
10800 New type.
10801 (Output_section::relaxed_input_section_map_): Change type to
10802 Output_section::Output_relaxed_input_section_by_input_section_map.
10803 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10804 input section.
10805
0e0d5469
ILT
108062009-12-15 Ian Lance Taylor <iant@google.com>
10807
10808 * layout.cc (Layout::create_shstrtab): Only write out after input
10809 sections if we are compressing debug sections.
10810
0649a889
ILT
108112009-12-15 Ian Lance Taylor <iant@google.com>
10812
10813 * archive.cc (Archive::add_symbols): Only look up a symbol without
10814 a version if there is, in fact, a version.
10815
2ea97941
ILT
108162009-12-14 Ian Lance Taylor <iant@google.com>
10817
10818 Revert -Wshadow changes, all changes from:
10819 2009-12-11 Doug Kwan <dougkwan@google.com>
10820 2009-12-11 Nick Clifton <nickc@redhat.com>
10821 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10822
b0eec2cc
DK
108232009-12-11 Doug Kwan <dougkwan@google.com>
10824
10825 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10826 due to -Wshadow.
10827 * attributes.cc (Object_attribute::size): Ditto.
10828 (Attributes_section_data::size): Ditto.
10829 (Attributes_section_data::Attributes_section_data): Ditto.
10830 (Output_attributes_section_data::do_write): Ditto.
10831 * attributes.h (Object_attribute::set_type): Ditto.
10832 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10833
91d6fa6a
NC
108342009-12-11 Nick Clifton <nickc@redhat.com>
10835
10836 * archive.cc: Fix shadowed variable warnings.
10837 * arm.cc: Likewise.
10838 * compressed_output.cc: Likewise.
10839 * compressed_output.h: Likewise.
10840 * configure: Likewise.
10841 * dwarf_reader.cc: Likewise.
10842 * dynobj.cc: Likewise.
10843 * dynobj.h: Likewise.
10844 * ehframe.cc: Likewise.
10845 * ehframe.h: Likewise.
10846 * errors.cc: Likewise.
10847 * expression.cc: Likewise.
10848 * fileread.cc: Likewise.
10849 * fileread.h: Likewise.
10850 * freebsd.h: Likewise.
10851 * i386.cc: Likewise.
10852 * icf.cc: Likewise.
10853 * incremental.h: Likewise.
10854 * layout.cc: Likewise.
10855 * layout.h: Likewise.
10856 * mapfile.cc: Likewise.
10857 * merge.cc: Likewise.
10858 * merge.h: Likewise.
10859 * object.cc: Likewise.
10860 * object.h: Likewise.
10861 * options.h: Likewise.
10862 * output.cc: Likewise.
10863 * output.h: Likewise.
10864 * parameters.cc: Likewise.
10865 * plugin.cc: Likewise.
10866 * powerpc.cc: Likewise.
10867 * reduced_debug_output.cc: Likewise.
10868 * reduced_debug_output.h: Likewise.
10869 * reloc.cc: Likewise.
10870 * reloc.h: Likewise.
10871 * resolve.cc: Likewise.
10872 * script-sections.cc: Likewise.
10873 * script.cc: Likewise.
10874 * script.h: Likewise.
10875 * sparc.cc: Likewise.
10876 * symtab.cc: Likewise.
10877 * symtab.h: Likewise.
10878 * target-select.cc: Likewise.
10879 * target-select.h: Likewise.
10880 * token.h: Likewise.
10881 * workqueue.cc: Likewise.
10882 * workqueue.h: Likewise.
10883 * x86_64.cc: Likewise.
10884
a0351a69
DK
108852009-12-10 Doug Kwan <dougkwan@google.com>
10886
10887 * arm.cc (attributes.h): New include.
10888 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10889 (Arm_relobj::~Arm_relobj): Delete object pointed by
10890 attributes_section_data_.
10891 (Arm_relobj::attributes_section_data): New method definition.
10892 (Arm_relobj::attributes_section_data_): New data member declaration.
10893 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10894 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10895 attributes_section_data_.
10896 (Arm_dynobj::attributes_section_data): New method definition.
10897 (Arm_dynobj::attributes_section_data_): New data member declaration.
10898 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10899 initialization value of may_use_blx_ to false.
2e702c99 10900 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10901 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10902 object attributes to compute results instead of hard-coding.
10903 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10904 Target_arm::get_secondary_compatible_arch,
10905 Target_arm::set_secondary_compatible_arch
10906 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10907 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10908 New method declarations.
10909 (Target_arm::get_aeabi_object_attribute): New method definition.
10910 (Target_arm::attributes_section_data_): New data member declaration.
10911 (read_arm_attributes_section): New template definition.
10912 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10913 (Arm_dynobj::do_read_symbols): Ditto.
10914 (Target_arm::do_finalize_sections): Merge attributes sections from
10915 input. Check for BLX use after attributes section merging.
10916 Fix __exidx_start and __exidx_end visibility. Create an
10917 .ARM.attributes section if necessary.
10918 (Target_arm::get_secondary_compatible_arch,
10919 Target_arm::set_secondary_compatible_arch,
10920 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10921 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10922 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10923 New method definitions.
10924
b59befec
ILT
109252009-12-09 Ian Lance Taylor <iant@google.com>
10926
10927 * plugin.cc (Plugin::load): Don't cast from void* to a function
10928 pointer.
10929
1276bc89
ILT
109302009-12-09 Ian Lance Taylor <iant@google.com>
10931
10932 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10933 information fields.
10934
2f2de248
L
109352009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10936
10937 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10938 Replace two_file_shared_1.so with two_file_shared_2.so.
10939 * testsuite/Makefile.in: Regenerated.
10940
4f787271
DK
109412009-12-08 Doug Kwan <dougkwan@google.com>
10942
10943 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10944 (HFILES): Add attributes.h and int_encoding.h.
10945 * Makefile.in: Regenerate.
10946 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10947 function definitions to int_encoding.cc
10948 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10949 prototypes to int_encoding.h
10950 * reduced_debug_output.cc (int_encoding.h): New include.
10951 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10952 function definitions to int_encoding.cc
10953 (insert_into_vector, read_from_pointer): Move template definitions to
10954 int_encoding.h
10955 * attributes.cc: New file.
10956 * attributes.h: New file.
10957 * int_encoding.cc: New file.
10958 * int_encoding.h: New file.
10959
20b52f1a
RÁE
109602009-12-07 Rafael Avila de Espindola <espindola@google.com>
10961
10962 PR gold/11055
10963 * incremental-dump.cc (dump_incremental_inputs): New.
10964 (main): Use dump_incremental_inputs.
10965
53d7974c
L
109662009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10967
10968 PR gold/10893
10969 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10970 checking elfcpp::STT_FUNC.
10971 (Target_i386::Relocate::relocate): Likewise.
10972 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10973
10974 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10975 symbols from shared libraries into normal FUNC symbols.
10976
10977 * symtab.h (Symbol): Add is_func and use it.
10978
05a352e6
DK
109792009-12-05 Doug Kwan <dougkwan@google.com>
10980
10981 * arm.cc (Target_arm::arm_info): Initialize new fields
10982 attributes_section and attributes_vendor.
10983 * i386.cc (Target_i386::i386_info): Same.
10984 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10985 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10986 fields attributes_section and attributes_vendor.
53d7974c 10987 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10988 * target.h (Target::attributes_section, Target::attributes_vendor,
10989 Target::is_attributes_section, Target::attribute_arg_type,
10990 Target::attributes_order): New method definitions.
10991 (Target::Target_info::attributes_section,
10992 Target::Target_info::attributes_vendor): New fields.
10993 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10994 virtual method definitions.
10995 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10996 attributes_section and attributes_vendor.
10997 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10998
f4e5969c
DK
109992009-12-05 Doug Kwan <dougkwan@google.com>
11000
11001 * arm.cc: Update comments about interworking and stub generation.
11002 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11003 considered as non-PIC.
11004 (Arm_relocate_functions::base_abs): Fix formatting.
11005 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11006 of function to use GOT entry address instead of offset.
11007 (Target_arm::Scan::global): Issue an error if a symbol would need a
11008 PLT does not get one because it is untyped. Remove code to create
11009 dynamic symbols for relative branches.
11010 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11011 takes unsigned integer instead of boolean.
11012
1abce4a6
L
110132009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11014
11015 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11016 (two_file_test_LDADD): Likewise.
11017 (common_test_1_LDADD): Likewise.
11018 (exception_test_LDADD) Likewise.
11019 (weak_test_LDADD): Likewise.
11020 (many_sections_test_LDADD): Likewise.
11021 (initpri1_LDADD): Likewise.
11022 (script_test_1_LDADD): Likewise.
11023 (script_test_2_LDADD): Likewise.
11024 (justsyms_LDADD): Likewise.
11025 (binary_test_LDADD): Likewise.
11026 (large_LDADD): Likewise.
11027 * testsuite/Makefile.in: Regenerated.
11028
adcf2816 110292009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11030
adcf2816
L
11031 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11032 (Symbol_table::override_with_special): Likewise.
11033 (Symbol_table::add_from_object): Likewise.
11034
28e67f5d
RÁE
110352009-12-04 Rafael Avila de Espindola <espindola@google.com>
11036
11037 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11038 Don't set the data_offset twice.
11039
ae10a101
RÁE
110402009-12-04 Rafael Avila de Espindola <espindola@google.com>
11041
11042 * testsuite/Makefile.in: Regenerate.
11043
f59f41f3
DK
110442009-12-03 Doug Kwan <dougkwan@google.com>
11045
11046 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11047 (Target_arm::do_finalize_sections): Add parameter for symbol table
11048 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11049 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11050 parameter for symbol table pointer.
11051 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11052 an additional parameter for a pointer to symbol table.
11053 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11054 parameter for a symbol table pointer.
11055 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11056 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11057 Ditto.
11058 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11059 parameter for a symbol table pointer.
11060
ca55d848
RÁE
110612009-12-03 Rafael Avila de Espindola <espindola@google.com>
11062
11063 * incremental.cc (Incremental_inputs_header)
11064 (Incremental_inputs_header_write, Incremental_inputs_entry)
11065 (Incremental_inputs_entry_write): Move ...
11066 * incremental.h (Incremental_inputs_header)
11067 (Incremental_inputs_header_write, Incremental_inputs_entry)
11068 (Incremental_inputs_entry_write): here.
11069
3aec4f9c
RÁE
110702009-12-02 Rafael Avila de Espindola <espindola@google.com>
11071
11072 * incremental.cc (make_sized_incremental_binary): Set the target.
11073 Error if it is incompatible.
11074 * output.h (Output_file): Add filename method.
11075
9c0ae74d
RÁE
110762009-12-02 Rafael Avila de Espindola <espindola@google.com>
11077
11078 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11079 from the get_* methods.
11080
a45500ae
RÁE
110812009-12-02 Rafael Avila de Espindola <espindola@google.com>
11082
11083 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11084 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11085 Write 0 for the data_offset of scripts.
11086
325e6408
RÁE
110872009-12-02 Rafael Avila de Espindola <espindola@google.com>
11088
11089 * testsuite/Makefile.am: Add the incremental_test.sh test.
11090 * testsuite/incremental_test.sh: New.
11091 * testsuite/incremental_test_1.c: New.
11092 * testsuite/incremental_test_2.c: New.
11093
954c3e2e
RÁE
110942009-12-01 Rafael Avila de Espindola <espindola@google.com>
11095
703d02da 11096 * incremental-dump.cc (main): Fix typos.
954c3e2e 11097
f8086623
RÁE
110982009-11-27 Rafael Avila de Espindola <espindola@google.com>
11099
11100 PR gold/11025
11101 * incremental-dump.cc (main): Use llu to print 64 bit values.
11102
3b0dd6ac
L
111032009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11104 H.J. Lu <hongjiu.lu@intel.com>
11105
11106 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11107 $(LIBDL).
11108 (incremental_dump_LDADD): Likewise.
11109 * Makefile.in: Regenerated.
11110
a6d1ef57 111112009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11112
a6d1ef57
DK
11113 Revert:
11114
11115 2009-11-25 Doug Kwan <dougkwan@google.com>
11116
11117 * arm.cc (Target_arm::Target_arm): Move method definition
11118 outside of class definition. Add code to handle
11119 --target1-rel, --target1-abs and --target2= options.
11120 (Target_arm::get_reloc_reloc_type): Change method to be
11121 non-static and const.
11122 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11123 New data member declaration.
11124 (Target_arm::Scan::local, Target_arm::Scan::global,
11125 Target_arm::Relocate::relocate,
11126 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11127 Adjust call to Target_arm::get_real_reloc_type.
11128 (Target_arm::get_real_reloc_type): Use command line options
11129 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11130 * options.h (--target1-rel, --target1-abs, --target2): New
11131 ARM-only options.
11132
50aeb7d4
DK
111332009-11-25 Doug Kwan <dougkwan@google.com>
11134
11135 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11136 class definition. Add code to handle --target1-rel, --target1-abs
11137 and --target2= options.
11138 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11139 and const.
11140 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11141 member declaration.
11142 (Target_arm::Scan::local, Target_arm::Scan::global,
11143 Target_arm::Relocate::relocate,
11144 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11145 call to Target_arm::get_real_reloc_type.
11146 (Target_arm::get_real_reloc_type): Use command line options to
11147 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11148 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11149 options.
11150
51938283
DK
111512009-11-25 Doug Kwan <dougkwan@google.com>
11152
11153 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11154 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11155 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11156 formatting.
11157 (Arm_relocate_functions::thm_call): Replace body with a call to
11158 Arm_relocate_functions::thumb_branch_common.
11159 (Arm_relocate_functions::thm_jump24,
11160 Arm_relocate_functions::thm_xpc22): New method definitions.
11161 (Arm_relocate_functions::thumb_branch_common): New method definition.
11162 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11163 operator.
11164 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11165 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11166
e2b8f3c4
RÁE
111672009-11-24 Rafael Avila de Espindola <espindola@google.com>
11168
11169 * Makefile.am: Build incremental-dump
11170 * Makefile.in: Regenerate.
11171 * incremental-dump.cc: New.
11172 * incremental.cc (Incremental_inputs_header_data,
11173 Incremental_inputs_entry_data): Move to incremental.h
11174 * incremental.h: (Incremental_inputs_header_data,
11175 Incremental_inputs_entry_data): Move from incremental.cc
11176
bcba9aec
RÁE
111772009-11-24 Rafael Avila de Espindola <espindola@google.com>
11178
11179 * incremental.cc (Incremental_inputs_header,
11180 Incremental_inputs_header_write, Incremental_inputs_entry,
11181 Incremental_inputs_entry_write): Add a typedef with the data type.
11182
7c3afe08
RÁE
111832009-11-24 Rafael Avila de Espindola <espindola@google.com>
11184
11185 * incremental.cc (Incremental_inputs_header,
11186 Incremental_inputs_header_write, Incremental_inputs_entry,
11187 Incremental_inputs_entry_write): Update comment about which
11188 type has the filed descriptions.
11189
d204b6e9
DK
111902009-11-15 Doug Kwan <dougkwan@google.com>
11191
11192 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11193 (Arm_relocate_functions::arm_branch_common): Change method defintion
11194 in class definition to a method declaration and update list of formal
11195 parameters.
11196 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11197 Arm_relocation_functions::jump24): Adjust call to
11198 Arm_relocate_functions::arm_branch_common. Update list of formal
11199 parameters.
11200 (Arm_relocate_functions::xpc25): New method definition.
11201 (Arm_relocate_functions::arm_branch_common): Move method defintion
11202 out from class definition. Use stubs for mode-switching and extending
11203 branch ranges.
11204 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11205 specially. Change code to enable use of stubs in ARM branches.
11206
43d12afe
DK
112072009-11-10 Doug Kwan <dougkwan@google.com>
11208
11209 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11210 in method declaration.
11211 (Target_arm::relocate_stub): New method declaration.
11212 (Target_arm::default_target): Change to return a pointer instead of
11213 a const reference.
11214 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11215 Target_arm::default_target.
11216 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11217 method definition.
11218 (Target_arm::relocate_section): Adjust view.
11219 (Target_arm::relocate_stub): New method definition.
11220
ac33a407
DK
112212009-11-10 Doug Kwan <dougkwan@google.com>
11222
11223 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11224 a format warning.
11225 * incremental.cc (open_incremental_binary): Initialized local
11226 variables to avoid warnings.
11227 * object.cc (make_elf_object): Ditto.
11228 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11229 a format warning.
e1df38aa 11230
88ee28e9
L
11231009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11232
11233 PR gold/10930
11234 * testsuite/plugin_test.c: Include "config.h".
11235
2daedcd6
DK
112362009-11-09 Doug Kwan <dougkwan@google.com>
11237
11238 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11239 (arm_symbol_value): Remove.
11240 (Arm_relocate_functions::arm_branch_common,
11241 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11242 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11243 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11244 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11245 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11246 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11247 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11248 Arm_relocate_functions::thm_mobw_abs_nc,
11249 Arm_relocate_functions::thm_mov_abs,
11250 Arm_relocate_functions::movw_prel_nc,
11251 Arm_relocate_functions::thm_movt_abs,
11252 Arm_relocate_functions::movt_prel,
11253 Arm_relocate_functions::thm_movw_prel_nc,
11254 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11255 (Target_arm::Relocate::relocate): Only decompose address into two
11256 parts if relocation type uses the thumb-bit and pass the actual
11257 bit instead of a flag indicating that the thumb-bit is used. Adjust
11258 calls to methods in Arm_relocate_functions for this change.
11259
1276bc89 112602009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11261
11262 PR 10925
11263 * reloc.cc: Instantiate
11264 Sized_relobj::initialize_input_to_output_maps and
11265 Sized_relobj:free_input_to_output_maps.
11266
e53ad1b5
ILT
112672009-11-06 Ian Lance Taylor <iant@google.com>
11268
11269 PR 10876
11270 * defstd.cc (in_segment): Set only_if_ref true for "end".
11271
eb44217c
DK
112722009-11-06 Doug Kwan <dougkwan@google.com>
11273
11274 * arm.cc (class Reloc_stub): Correct a comment.
11275 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11276 (Target_arm::scan_section_for_stubs): New method declaration.
11277 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11278 Change methods from private to protected.
11279 (Target_arm::do_may_relax): New method definition.
11280 (Target_arm::do_relax, Target_arm::group_sections,
11281 Target_arm::scan_reloc_for_stub,
11282 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11283 (Target_arm::arm_input_section_map_): New data member declaration.
11284 (Target_arm::scan_reloc_for_stub,
11285 Target_arm::scan_reloc_section_for_stubs,
11286 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11287 Target_arm::do_relax): New method definitions.
11288
5d329b7d
ILT
112892009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11290
11291 * configure.ac: Check for (struct stat)::st_mtim
11292 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11293 * config.in: Regenerate.
11294 * configure: Regenerate.
11295
96a0d71b
ILT
112962009-11-05 Ian Lance Taylor <iant@google.com>
11297
11298 PR 10910
11299 * output.cc (Output_segment::add_output_section): Add missing
11300 return statement.
11301
594c8e5e
ILT
113022009-11-04 Ian Lance Taylor <iant@google.com>
11303
11304 PR 10880
11305 * object.h (class Object): Add is_needed and set_is_needed
11306 methods. Add is_needed_ field. Make bool fields into bitfields.
11307 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11308 defined in a dynamic object and referenced by a regular object,
11309 set is_needed for the dynamic object.
11310 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11311 if the file is marked with as_needed and it is not needed.
11312
22b127cc
ILT
113132009-11-04 Ian Lance Taylor <iant@google.com>
11314
11315 PR 10887
11316 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11317 tags if data is discarded by linker script.
11318 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11319 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11320 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11321 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11322
f5c870d2
ILT
113232009-11-04 Ian Lance Taylor <iant@google.com>
11324
11325 * layout.cc (Layout::get_output_section): Add is_interp and
11326 is_dynamic_linker_section parameters. Change all callers.
11327 (Layout::choose_output_section): Likewise.
11328 (Layout::make_output_section): Likewise.
11329 (Layout::add_output_section_data): Add is_dynamic_linker_section
11330 parameter. Change all callers.
11331 * layout.h (class Layout): Update declarations.
11332 * output.h (class Output_section): Add is_interp, set_is_interp,
11333 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11334 Add is_interp_, is_dynamic_linker_section_ fields. Change
11335 generate_code_fills_at_write_ to a bitfield.
11336 * output.cc (Output_section::Output_sections): Initialize new
11337 fields.
11338 (Output_segment::add_output_section): Add do_sort parameter.
11339 Change all callers.
11340
1ae4d23b
ILT
113412009-11-03 Ian Lance Taylor <iant@google.com>
11342
11343 PR 10860
11344 * options.h (class General_options): Add --warn-common.
11345 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11346 merging two common symbols.
11347 (Symbol_table::should_override): Handle --warn-common when merging
11348 a common symbol with a defined symbol. Use report_resolve_problem
11349 for multiple definitions.
11350 (Symbol_table::report_resolve_problem): New function.
11351 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11352
55da9579
DK
113532009-11-03 Doug Kwan <dougkwan@google.com>
11354
11355 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11356 stub_factory_.
11357 (Target_arm::stub_factory): New method definition.
11358 (Target_arm::new_arm_input_section,
11359 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11360 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11361 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11362 New type definitions.
11363 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11364 member declarations.
11365 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11366 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11367 New method definitions.
11368
37a9ac43
ILT
113692009-11-03 Ian Lance Taylor <iant@google.com>
11370
11371 * options.h (class General_options): Add --warn_constructors.
11372
b3d6a3d4
ILT
113732009-11-03 Ian Lance Taylor <iant@google.com>
11374
11375 PR 10893
11376 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11377 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11378
934b01dd
ILT
113792009-11-03 Ian Lance Taylor <iant@google.com>
11380
11381 PR 10895
11382 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11383 --msgid-bugs-address.
11384 (install-pdf): New target.
11385 (install-data_yes): Look up one directory to find mkinstalldirs.
11386
03c1939b
L
113872009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11388
11389 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11390 tree.
11391
ebd95253
DK
113922009-10-30 Doug Kwan <dougkwan@google.com>
11393
11394 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11395
e9bbb538
DK
113962009-10-30 Doug Kwan <dougkwan@google.com>
11397
11398 * arm.cc (Stub_addend_reader): New struct template definition
11399 and partial specializations.
11400 (Stub_addend_reader::operator()): New method definition for a
11401 partially specialized template.
11402
d5b40221
DK
114032009-10-30 Doug Kwan <dougkwan@google.com>
11404
11405 * arm.cc (Arm_relobj::processor_specific_flags): New method
11406 definition.
11407 (Arm_relobj::do_read_symbols): New method declaration.
11408 (Arm_relobj::processor_specific_flags_): New data member declaration.
11409 (Arm_dynobj): New class definition.
11410 (Target_arm::do_finalize_sections): Add input_objects parameter.
11411 (Target_arm::do_adjust_elf_header): New method declaration.
11412 (Target_arm::are_eabi_versions_compatible,
11413 (Target_arm::merge_processor_specific_flags): New method declaration.
11414 (Target_arm::do_make_elf_object): New overloaded method definitions
11415 and declaration.
11416 (Arm_relobj::do_read_symbols): New method definition.
11417 (Arm_dynobj::do_read_symbols): Ditto.
11418 (Target_arm::do_finalize_sections): Add input_objects parameters.
11419 Merge processor-specific flags from all input objects.
11420 (Target_arm::are_eabi_versions_compatible,
11421 Target_arm::merge_processor_specific_flags,
11422 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11423 New method definitions.
11424 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11425 Input_objects pointer type parameter.
11426 * layout.cc (Layout::finalize): Pass input objects to target's.
11427 finalize_sections function.
11428 * output.cc (Output_file_header::do_sized_write): Set ELF file
11429 header's processor-specific flags.
11430 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11431 Input_objects pointer type parameter.
11432 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11433 * target.h (Input_objects): New forward class declaration.
11434 (Target::processor_specific_flags,
11435 Target::are_processor_specific_flags_sect): New method definitions.
11436 (Target::finalize_sections): Add input_objects parameter.
11437 (Target::Target): Initialize processor_specific_flags_ and
11438 are_processor_specific_flags_set_.
11439 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11440 parameter.
11441 (Target::set_processor_specific_flags): New method definition.
11442 (Target::processor_specific_flags_,
11443 Target::are_processor_specific_flags_set_): New data member
11444 declarations.
11445 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11446 Input_objects pointer type parameter.
11447
ebabffbd
DK
114482009-10-30 Doug Kwan <dougkwan@google.com>
11449
11450 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11451
ad0f2072
ILT
114522009-10-28 Ian Lance Taylor <iant@google.com>
11453
11454 * object.h (class Relobj): Drop options parameter from
11455 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11456 do_scan_relocs, do_relocate. Change all callers.
11457 (class Sized_relobj): Drop options parameters from
11458 do_gc_process_relocs, do_scan_relocs, do_relocate,
11459 do_relocate_sections, relocate_sections, emit_relocs_scan,
11460 emit_relocs_scan_reltype. Change all callers.
11461 (struct Relocate_info): Remove options field and all references to
11462 it.
11463 * reloc.h (class Read_relocs): Remove options constructor
11464 parameter and options_ field. Change all callers.
11465 (class Gc_process_relocs, class Scan_relocs): Likewise.
11466 (class Relocate_task): Likewise.
11467 * target-reloc.h (scan_relocs): Remove options parameter. Change
11468 all callers.
11469 (scan_relocatable_relocs): Likewise.
11470 * target.h (class Sized_target): Remove options parameter from
11471 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11472 all callers.
11473 * gc.h (gc_process_relocs): Remove options parameter. Change all
11474 callers.
11475 * arm.cc: Update functions to remove options parameters.
11476 * i386.cc: Likewise.
11477 * powerpc.cc: Likewise.
11478 * sparc.cc: Likewise.
11479 * x86_64.cc: Likewise.
11480 * testsuite/testfile.cc: Likewise.
11481
8ffa3667
DK
114822009-10-28 Doug Kwan <dougkwan@google.com>
11483
11484 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11485 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11486 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11487 New method definitions.
11488
40f36857
CC
114892009-10-28 Cary Coutant <ccoutant@google.com>
11490
11491 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11492 (Plugin::cleanup_done_): New member.
11493 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11494 (Plugin_manager::cleanup_done_): Remove.
11495 (Plugin_manager::add_input_file): Edit error message.
11496 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11497 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11498
2c849493
ILT
114992009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11500
11501 * fileread.cc: (File_read::View::~View): Use the new
11502 data_ownership_ filed.
11503 (File_read::~File_read): Dispose the new whole_file_view_.
11504 (File_read::open): Mmap the whole file if needed.
11505 (File_read::open): Use whole_file_view_ instead of contents_.
11506 (File_read::find_view): Use whole_file_view_ if applicable.
11507 (File_read::do_read): Use whole_file_view_ instead of contents_.
11508 (File_read::make_view): Use whole_file_view_ instead of contents_,
11509 update File_read::View::View call.
11510 (File_read::find_or_make_view): Update File_read::View::View
11511 call.
11512 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11513 remove contents_
11514 (File_read::View::Data_ownership): New enum.
11515 (File_read::View::View): Replace bool mapped_ with Data_ownership
11516 argument.
11517 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11518 (File_read::View::data_ownership_): New field.
11519 (File_read::contents_): Remove (replaced by whole_file_view_).
11520 (File_read::whole_file_view_): New field.
11521 * options.h (class General_options): Add --keep-files-mapped.
11522
24998053
CC
115232009-10-27 Cary Coutant <ccoutant@google.com>
11524
11525 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11526 * testsuite/Makefile.am (plugin_test_5): New test case.
11527 * testsuite/Makefile.in: Regenerate.
11528
72adc4fa
DK
115292009-10-25 Doug Kwan <dougkwan@google.com>
11530
11531 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11532 from private to protected to allow access by child class.
11533 (Sized_relobj::do_relocate_sections): New method declaration.
11534 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11535 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11536 Sized_relobj::relocate_sections. Instantiate template explicitly
11537 for different target sizes and endianity.
11538
07f508a2
DK
115392009-10-24 Doug Kwan <dougkwan@google.com>
11540
11541 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11542 (Arm_input_section::as_arm_input_section): New method.
11543 (Arm_output_section): New class definition.
11544 (Arm_output_section::create_stub_group,
11545 Arm_output_section::group_sections): New method definitions.
11546
10ad9fe5
DK
115472009-10-22 Doug Kwan <dougkwan@google.com>
11548
11549 * arm.cc (Arm_input_section): New class definition.
11550 (Arm_input_section::init, Arm_input_section:do_write,
11551 Arm_input_section::set_final_data_size,
11552 Arm_input_section::do_reset_address_and_file_offset): New method
11553 definitions.
11554
56ee5e00
DK
115552009-10-21 Doug Kwan <dougkwan@google.com>
11556
11557 * arm.cc (Stub_table, Arm_input_section): New forward class
11558 declarations.
11559 (Stub_table): New class defintion.
11560 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11561 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11562 New method definition.
11563
b569affa
DK
115642009-10-21 Doug Kwan <dougkwan@google.com>
11565
11566 * arm.cc: Update copyright comments.
11567 (Target_arm): New forward class template declaration.
11568 (Arm_address): New type.
11569 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11570 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11571 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11572 constants.
11573 (Insn_template): Same.
11574 (DEF_STUBS): New macro.
11575 (Stub_type): New enum type.
11576 (Stub_template): New class definition.
11577 (Stub): Same.
11578 (Reloc_stub): Same.
11579 (Stub_factory): Same.
11580 (Target_arm::Target_arm): Initialize may_use_blx_ and
11581 should_force_pic_veneer_.
11582 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11583 Target_arm::should_force_pic_veneer,
11584 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11585 Target_arm::using_thumb_only, Target_arm:;default_target): New
11586 method defintions.
11587 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11588 New data member declarations.
11589 (Insn_template::size, Insn_template::alignment): New method defintions.
11590 (Stub_template::Stub_template): New method definition.
11591 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11592 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11593 (Stub_factory::Stub_factory): New method definition.
11594 * gold.h (string_hash): New template.
11595 * output.h (Input_section_specifier::hash_value): Use
11596 gold::string_hash.
11597 (Input_section_specifier::string_hash): Remove.
11598 * stringpool.cc (Stringpool_template::string_hash): Use
11599 gold::string_hash.
11600
6c172549
DK
116012009-10-20 Doug Kwan <dougkwan@google.com>
11602
11603 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11604 symbols of relaxed input sections.
11605 * output.h (Output_section::find_relaxed_input_section): Make
11606 method public.
11607
c5617f2f
DK
116082009-10-16 Doug Kwan <dougkwan@google.com>
11609
11610 * dynobj.cc (Versions::Versions): Initialize version_script_.
11611 Only insert base version symbol definition for a shared object
11612 if version script defines any version versions.
11613 (Versions::define_base_version): New method definition.
11614 (Versions::add_def): Check that base version is not needed.
11615 (Versions::add_need): Define base version lazily.
11616 * dynobj.h (Versions::define_base_version): New method declaration.
11617 (Versions::needs_base_version_): New data member declaration.
11618 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11619 (check_DATA): Add no_version_test.stdout.
11620 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11621 New make rules.
11622 * testsuite/Makefile.in: Regenerate.
11623 * testsuite/no_version_test.c: New file.
11624 * testsuite/no_version_test.sh: Ditto.
11625
3c12dcdb
DK
116262009-10-16 Doug Kwan <dougkwan@google.com>
11627
11628 * expression.cc (class Segment_start_expression): New class definition.
11629 (Segment_start_expression::value): New method definition.
11630 (script_exp_function_segment_start): Return a new
11631 Segment_start_expression.
11632 * gold/script-c.h (script_saw_segment_start_expression): New function
11633 prototype.
11634 * script-sections.cc (Script_sections::Script_sections): Initialize
11635 SAW_SEGMENT_START_EXPRESSION_ to false.
11636 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11637 and -Tbbs options to specify section addresses if given in
11638 command line and no SEGMENT_START expression is seen in a script.
11639 * script-sections.h (Script_sections::saw_segment_start_expression,
11640 Script_sections::set_saw_segment_start_expression): New method
11641 definition.
11642 (Script_sections::saw_segment_start_expression_): New data member
11643 declaration.
11644 * script.cc (script_saw_segment_start_expression): New function.
11645 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11646 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11647 script_test_7.sh and script_test_8.sh.
11648 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11649 script_test_8.stdout.
11650 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11651 (script_test_6, script_test_6.stdout, script_test_7,
11652 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11653 * Makefile.in: Regenerate.
11654 * testsuite/script_test_6.sh: New file.
11655 * testsuite/script_test_6.t: Same.
11656 * testsuite/script_test_7.sh: Same.
11657 * testsuite/script_test_7.t: Same.
11658 * testsuite/script_test_8.sh: Same.
11659
64b1ae37
DK
116602009-10-16 Doug Kwan <dougkwan@google.com>
11661
11662 * output.cc (Output_segment::set_section_list_address): Cast
11663 expressions to unsigned long long type to avoid format warnings.
11664
661be1e2
ILT
116652009-10-15 Ian Lance Taylor <iant@google.com>
11666
12edd763 11667 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11668 dot assignment to script_sections_.
12edd763
ILT
11669 * script-sections.cc (Script_sections::add_dot_assignment):
11670 Initialize if necessary.
11671
68b6574b
ILT
11672 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11673 program headers with no load segment if there is a linker script.
11674
661be1e2
ILT
11675 * layout.cc (Layout::set_segment_offsets): Align the file offset
11676 to the segment aligment for -N or -n with no load segment.
11677 * output.cc (Output_segment::add_output_section): Don't crash if
11678 the first section is a TLS section.
11679 (Output_segment::set_section_list_addresses): Print an error
11680 message if the address moves backward in a linker script.
11681 * script-sections.cc
11682 (Output_section_element_input::set_section_addresses): Don't
11683 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11684 (Orphan_output_section::set_section_addresses): Likewise.
11685
f15f61a7
DK
116862009-10-15 Doug Kwan <dougkwan@google.com>
11687
11688 * layout.cc (Layout::finish_dynamic_section): Generate tags
11689 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11690 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11691 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11692
82bb573a
ILT
116932009-10-14 Ian Lance Taylor <iant@google.com>
11694
11695 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11696 fields.
11697 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11698 data_shdr fields of relinfo.
11699 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11700 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11701 R_386_TLS_LDO_32, adjust based on section flags.
11702 (Target_i386::Relocate::fix_up_ldo): Remove.
11703
374ad285
ILT
117042009-10-13 Ian Lance Taylor <iant@google.com>
11705
11706 Add support for -pie.
11707 * options.h (class General_options): Add -pie and
11708 --pic-executable.
11709 (General_options::output_is_position_independent): Test -pie.
11710 (General_options::output_is_executable): Return true if not shared
11711 and not relocatable.
11712 (General_options::output_is_pie): Remove.
11713 * options.cc (General_options::finalize): Reject incompatible uses
11714 of -pie.
11715 * gold.cc (queue_middle_tasks): A -pie link is not static.
11716 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11717 * symtab.cc (Symbol::final_value_is_known): Return false if
11718 output_is_position_independent.
11719 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11720 output_is_position_independent.
11721 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11722 output_is_position_independent.
11723 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11724 output_is_position_independent.
11725 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11726 two_file_pie_test.
11727 (basic_pie_test.o, basic_pie_test): New targets.
11728 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11729 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11730 (two_file_pie_test): New target.
11731 * testsuite/Makefile.in: Rebuild.
11732 * README: Remove note saying that -pie is not supported.
11733
c6585162
ILT
117342009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11735
11736 * options.h (class General_options): Add -init and -fini.
11737 * layout.cc (Layout::finish_dynamic_section): Emit
11738 given init and fini functions.
11739
032ce4e9
ST
117402009-10-13 Sriraman Tallam <tmsriram@google.com>
11741
11742 * gc.h (gc_process_relocs): Check if icf is enabled using new
11743 function.
11744 * gold.cc (queue_initial_tasks): Likewise.
11745 (queue_middle_tasks): Likewise.
11746 * object.cc (do_layout): Likewise.
11747 * symtab.cc (is_section_folded): Likewise.
11748 * main.cc (main): Likewise.
11749 * reloc.cc (Read_relocs::run): Likewise.
11750 (Sized_relobj::do_scan_relocs): Likewise.
11751 * icf.cc (is_function_ctor_or_dtor): New function.
11752 (Icf::find_identical_sections): Check if function is ctor or dtor when
11753 safe icf is chosen.
11754 * options.h (General_options::icf): Change option to be an enum.
11755 (Icf_status): New enum.
11756 (icf_enabled): New method.
11757 (icf_safe_folding): New method.
11758 (set_icf_status): New method.
11759 (icf_status_): New variable.
11760 * (options.cc) (General_options::finalize): Set icf_status_.
11761 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11762 icf_test and icf_keep_unique_test to use the --icf enum flag.
11763 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11764 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11765
f345227a
ST
117662009-10-12 Sriraman Tallam <tmsriram@google.com>
11767
11768 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11769 includes to gc.h and icf.h.
11770 * arm.cc: Include gc.h.
11771 * gold.cc: Likewise.
11772 * i386.cc: Likewise.
11773 * powerpc.cc: Likewise.
11774 * sparc.cc: Likewise.
11775 * x86_64.cc: Likewise.
11776 * gc.h: Include icf.h.
11777
1c7814ed
ILT
117782009-10-11 Ian Lance Taylor <iant@google.com>
11779
11780 * plugin.cc: Include "gold.h" before other header files.
11781
ae3b5189
CD
117822009-10-10 Chris Demetriou <cgd@google.com>
11783
11784 * options.h (Input_file_argument::Input_file_type): New enum.
11785 (Input_file_argument::is_lib_): Replace with...
11786 (Input_file_argument::type_): New member.
11787 (Input_file_argument::Input_file_argument): Take Input_file_type
11788 'type' rather than boolean 'is_lib' as second argument.
11789 (Input_file_argument::is_lib): Use type_.
11790 (Input_file_argument::is_searched_file): New function.
11791 (Input_file_argument::may_need_search): Handle is_searched_file.
11792 * options.cc (General_options::parse_library): Support -l:filename.
11793 (General_options::parse_just_symbols): Update for Input_file_argument
11794 changes.
11795 (Command_line::process): Likewise.
11796 * archive.cc (Archive::get_file_and_offset): Likewise.
11797 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11798 * script.cc (read_script_file, script_add_file): Likewise.
11799 * fileread.cc (Input_file::Input_file): Likewise.
11800 (Input_file::will_search_for): Handle is_searched_file.
11801 (Input_file::open): Likewise.
11802 * readsyms.cc (Read_symbols::get_name): Likewise.
11803 * testsuite/Makefile.am (searched_file_test): New test.
11804 * testsuite/Makefile.in: Regenerate.
11805 * testsuite/searched_file_test.cc: New file.
11806 * testsuite/searched_file_test_lib.cc: New file.
11807
f3048a1d
ILT
118082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11809 Ian Lance Taylor <iant@google.com>
11810
11811 * descriptor.cc: Include <cstdio> and "binary-io.h".
11812 (Descriptors::open): Open the files in binary mode always.
11813 * script.cc (Lex::get_token): Treat \r as whitespace.
11814
d4780e57
ILT
118152009-10-09 Ian Lance Taylor <iant@google.com>
11816
11817 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11818
d9a893b8
ILT
118192009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11820 Ian Lance Taylor <iant@google.com>
11821
11822 * configure.ac: Check for readv function also.
11823 * fileread.cc (readv): Define if not HAVE_READV.
11824 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11825 does not exist.
11826 * config.in: Regenerate.
11827 * configure: Regenerate.
11828
c0a62865
DK
118292009-10-09 Doug Kwan <dougkwan@google.com>
11830
11831 * layout.cc (Layout::make_output_section): Call target hook to make
11832 ordinary output section.
11833 (Layout::finalize): Adjust parameter list of call the
11834 Target::may_relax().
11835 * layout.h (class Layout::section_list): New method.
11836 * merge.h (Output_merge_base::entsize): Change visibility to public.
11837 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11838 New methods.
11839 (Output_merge_string::do_is_string): New method.
11840 * object.cc (Sized_relobj::do_setup): renamed from
11841 Sized_relobj::set_up.
11842 * object.h (Sized_relobj::adjust_shndx,
11843 Sized_relobj::initializ_input_to_output_maps,
11844 Sized_relobj::free_input_to_output_maps): Change visibilities to
11845 protected.
11846 (Sized_relobj::setup): Virtualize.
11847 (Sized_relobj::do_setup): New method declaration.
11848 (Sized_relobj::invalidate_section_offset,
11849 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11850 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11851 * options.cc (parse_int): New function.
11852 * options.h (parse_int): New declaration.
11853 (DEFINE_int): New macro.
11854 (stub_group_size): New option.
11855 * output.cc (Output_section::Output_section): Initialize memebers
11856 merge_section_map_, merge_section_by_properties_map_,
11857 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11858 (Output_section::add_input_section): Handled deferred code-fill
11859 generation and remove an old comment.
11860 (Output_section::add_relaxed_input_section): New method definition.
11861 (Output_section::add_merge_input_section): Use merge section by
11862 properties map to speed to search. Update merge section maps
11863 as appropriate.
11864 (Output_section::build_relaxation_map): New method definition.
11865 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11866 Same.
11867 (Output_section::relax_input_section): Renamed to
11868 Output_section::convert_input_sections_to_relaxed_sections and change
11869 interface to take a vector of pointers to relaxed sections.
11870 (Output_section::find_merge_section,
11871 Output_section::find_relaxed_input_section): New method definitions.
11872 (Output_section::is_input_address_mapped,
11873 Output_section::output_offset, Output_section::output_address):
11874 Use output section data maps to speed up searching.
11875 (Output_section::find_starting_output_address): Add comments.
11876 (Output_section::do_write,
11877 Output_section::write_to_postprocessing_buffer): Do code-fill
11878 generation as appropriate.
11879 (Output_section::get_input_sections): Invalidate relaxed input section
11880 map.
11881 (Output_section::restore_states): Adjust type of checkpoint .
11882 Invalidate relaxed input section map.
11883 * output.h (Output_merge_base): New class declaration.
11884 (Input_section_specifier): New class defintion.
11885 (class Output_relaxed_input_section) Change base class to
11886 Output_section_data_build.
11887 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11888 base class initializer.
11889 (Output_section::add_relaxed_input_section): New method declaration.
11890 (Output_section::Input_section): Change visibility to protected.
2e702c99 11891 (Output_section::Input_section::relobj,
c0a62865
DK
11892 Output_section::Input_section::shndx): Handle relaxed input sections.
11893 Output_section::input_sections) Change visibility to protected. Also
11894 define overload to return a non-const pointer.
11895 (Output_section::Merge_section_properties): New class defintion.
11896 (Output_section::Merge_section_by_properties_map,
11897 Output_section::Output_section_data_by_input_section_map,
11898 Output_section::Relaxation_map): New types.
11899 (Output_section::relax_input_section): Rename method to
11900 Output_section::convert_input_sections_to_relaxed_sections and change
11901 interface to take a vector of relaxed section pointers.
11902 (Output_section::find_merge_section,
11903 Output_section::find_relaxed_input_section,
11904 Output_section::build_relaxation_map,
11905 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11906 New method declarations.
11907 (Output_section::merge_section_map_
11908 Output_section::merge_section_by_properties_map_,
11909 Output_section::relaxed_input_section_map_,
11910 Output_section::is_relaxed_input_section_map_valid_,
11911 Output_section::generate_code_fills_at_write_): New data members.
11912 * script-sections.cc
11913 (Output_section_element_input::set_section_addresses): Call
11914 current_data_size and addralign methods of relaxed input sections.
11915 (Orphan_output_section::set_section_addresses): Call current_data_size
11916 and addralign methods of relaxed input sections.
11917 * symtab.cc (Symbol_table::compute_final_value): Extract template
11918 from the body of Symbol_table::sized_finalize_symbol.
11919 (Symbol_table::sized_finalized_symbol): Call
11920 Symbol_table::compute_final_value.
11921 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11922 (Symbol_table::compute_final_value): New templated method declaration.
11923 * target.cc (Target::do_make_output_section): New method defintion.
11924 * target.h (Target::make_output_section): New method declaration.
11925 (Target::relax): Add more parameters for input objects, symbol table
11926 and layout. Adjust call to do_relax.
11927 (Target::do_make_output_section): New method declaration.
11928 (Target::do_relax): Add parameters for input objects, symbol table
11929 and layout.
11930
d446d6c4
ILT
119312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11932
11933 * pread.c: Include stdio.h.
11934
bc06c745
ILT
119352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11936
11937 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11938 defined.
11939
75aea3d0
ILT
119402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11941
11942 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11943 Change read_shndx type to unsigned int.
11944 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11945 int.
11946 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11947 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11948 Change read_shndx type to unsigned int.
11949 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11950 int.
11951 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11952 * layout.cc (Layout::create_symtab_sections): Cast the result of
11953 local_symcount * symsize to off_t in the gold_assert.
11954
be8fcb75
ILT
119552009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11956
11957 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11958 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11959 R_ARM_BASE_ABS.
11960 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11961 (Arm_relocate_functions::thm_abs5): New function.
11962 (Arm_relocate_functions::abs12): New function.
11963 (Arm_relocate_functions::abs16): New function.
11964 (Arm_relocate_functions::base_abs): New function.
11965 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11966 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11967 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11968 R_ARM_BASE_ABS.
11969 (Scan::global): Likewise.
11970 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11971 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11972 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11973 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11974 R_ARM_BASE_ABS.
11975
c2a122b6
ILT
119762009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11977
11978 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11979 (Arm_relocate_functions::movt_prel): New function.
11980 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11981 (Arm_relocate_functions::thm_movt_prel): New function.
11982 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11983 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11984 (Scan::global, Relocate::relocate): Likewise.
11985 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11986
c4aa1e2d
ILT
119872009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11988
11989 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11990 Incremental_checker.
11991 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11992 unsigned int.
11993 (class Incremental_inputs_header): New class.
11994 (Incremental_inputs_header_writer): Edit comment.
11995 (Incremental_inputs_entry): New class.
11996 (Incremental_inputs_entry_writer): Edit comment.
11997 (Sized_incremental_binary::do_find_incremental_inputs_section):
11998 Add *strtab_shndx parameter, fill it.
11999 (Sized_incremental_binary::do_check_inputs): New method.
12000 (Incremental_checker::can_incrementally_link_output_file): Use
12001 Sized_incremental_binary::check_inputs.
12002 (Incremental_inputs::report_command_line): Save command line in
12003 command_line_.
12004 * incremental.h:
12005 (Incremental_binary::find_incremental_inputs_section): New
12006 method.
12007 (Incremental_binary::do_find_incremental_inputs_section): Add
12008 strtab_shndx parameter.
12009 (Incremental_binary::do_check_inputs): New pure virtual method.
12010 (Sized_incremental_binary::do_check_inputs): Declare.
12011 (Incremental_checker::Incremental_checker): Add incremental_inputs
12012 parameter, use it to initialize incremental_inputs_.
12013 (Incremental_checker::incremental_inputs_): New field.
12014 (Incremental_checker::command_line): New method.
12015 (Incremental_checker::inputs): New method.
12016 (Incremental_checker::command_line_): New field.
12017
c549a694
ILT
120182009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12019
12020 * incremental.cc: Include <cstdarg> and "target-select.h".
12021 (vexplain_no_incremental): New function.
12022 (explain_no_incremental): New function.
12023 (Incremental_binary::error): New method.
12024 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12025 method.
12026 (make_sized_incremental_binary): New function.
12027 (open_incremental_binary): New function.
12028 (can_incrementally_link_file): Add checks if output is ELF and has
12029 inputs section.
12030 * incremental.h: Include "elfcpp_file.h" and "output.h".
12031 (Incremental_binary): New class.
12032 (Sized_incremental_binary): New class.
12033 (open_incremental_binary): Declare.
12034 * object.cc (is_elf_object): Use
12035 elfcpp::Elf_recognizer::is_elf_file.
12036 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12037 * output.h (Output_file::filesize): New method.
12038
fd3c5f0b
ILT
120392009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12040
12041 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12042 New function.
12043 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12044 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12045 function.
12046 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12047 function.
12048 (Arm_relocate_functions::movw_abs_nc): New function.
12049 (Arm_relocate_functions::movt_abs): New function.
12050 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12051 (Arm_relocate_functions::thm_movt_abs): New function.
12052 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12053 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12054 (Scan::global): Likewise.
12055 (Relocate::relocate): Likewise.
12056 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12057
7f5309a5
ILT
120582009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12059
12060 * arm.cc (Arm_relocate_functions::got_prel) New function.
12061 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12062 (Relocate::relocate): Likewise.
12063 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12064
364c7fa5
ILT
120652009-10-06 Ian Lance Taylor <iant@google.com>
12066
12067 * options.h (class General_options): Define
12068 split_stack_adjust_size parameter.
12069 * object.h (class Object): Add uses_split_stack_ and
12070 has_no_split_stack_ fields. Add uses_split_stack and
12071 has_no_split_stack accessor functions. Declare
12072 handle_split_stack_section.
12073 (class Reloc_symbol_changes): Define.
12074 (class Sized_relobj): Define Function_offsets. Declare
12075 split_stack_adjust, split_stack_adjust_reltype, and
12076 find_functions.
12077 * object.cc (Object::handle_split_stack_section): New function.
12078 (Sized_relobj::do_layout): Call handle_split_stack_section.
12079 * dynobj.cc (Sized_dynobj::do_layout): Call
12080 handle_split_stack_section.
12081 * reloc.cc (Sized_relobj::relocate_sections): Call
12082 split_stack_adjust for executable sections in split_stack
12083 objects. Pass reloc_map to relocate_section.
12084 (Sized_relobj::split_stack_adjust): New function.
12085 (Sized_relobj::split_stack_adjust_reltype): New function.
12086 (Sized_relobj::find_functions): New function.
12087 * target-reloc.h: Include "object.h".
12088 (relocate_section): Add reloc_symbol_changes parameter. Change
12089 all callers.
12090 * target.h (class Target): Add calls_non_split method. Declare
12091 do_calls_non_split virtual method. Declare match_view and
12092 set_view_to_nop.
12093 * target.cc: Include "elfcpp.h".
12094 (Target::do_calls_non_split): New function.
12095 (Target::match_view): New function.
12096 (Target::set_view_to_nop): New function.
12097 * gold.cc (queue_middle_tasks): Give an error if mixing
12098 split-stack and non-split-stack objects with -r.
12099 * i386.cc (Target_i386::relocate_section): Add
12100 reloc_symbol_changes parameter.
12101 (Target_i386::do_calls_non_split): New function.
12102 * x86_64.cc (Target_x86_64::relocate_section): Add
12103 reloc_symbol_changes parameter.
12104 (Target_x86_64::do_calls_non_split): New function.
12105 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12106 parameter.
12107 * powerpc.cc (Target_powerpc::relocate_section): Add
12108 reloc_symbol_changes parameter.
12109 * sparc.cc (Target_sparc::relocate_section): Add
12110 reloc_symbol_changes parameter.
12111 * configure.ac: Call AM_CONDITIONAL for the default target.
12112 * configure: Rebuild.
12113 * testsuite/Makefile.am (TEST_AS): New variable.
12114 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12115 (check_DATA): Add split_i386 and split_x86_64 files.
12116 (SPLIT_DEFSYMS): Define.
12117 (split_i386_[1234n].o): New targets.
12118 (split_i386_[124]): New targets.
12119 (split_i386_[1234r].stdout): New targets.
12120 (split_x86_64_[1234n].o): New targets.
12121 (split_x86_64_[124]): New targets.
12122 (split_x86_64_[1234r].stdout): New targets.
12123 (MOSTLYCLEANFILES): Add new executables.
12124 * testsuite/split_i386.sh: New file.
12125 * testsuite/split_x86_64.sh: New file.
12126 * testsuite/split_i386_1.s: New file.
12127 * testsuite/split_i386_2.s: New file.
12128 * testsuite/split_i386_3.s: New file.
12129 * testsuite/split_i386_4.s: New file.
12130 * testsuite/split_i386_n.s: New file.
12131 * testsuite/split_x86_64_1.s: New file.
12132 * testsuite/split_x86_64_2.s: New file.
12133 * testsuite/split_x86_64_3.s: New file.
12134 * testsuite/split_x86_64_4.s: New file.
12135 * testsuite/split_x86_64_n.s: New file.
12136 * testsuite/testfile.cc (Target_test): Update relocation_section
12137 function.
12138 * testsuite/Makefile.in: Rebuild.
12139
e8a9fcda
ILT
121402009-10-06 Ian Lance Taylor <iant@google.com>
12141
12142 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12143 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12144 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12145 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12146 the address on ldo_addrs_.
12147 (Target_i386::Relocate::fix_up_ldo): New function.
12148
e99daf92
ILT
121492009-10-06 Rafael Espindola <espindola@google.com>
12150
12151 * plugin.cc (add_input_library): New.
12152 (Plugin::load): Add add_input_library to tv.
12153 (Plugin_manager::add_input_file): Add the is_lib argument.
12154 (add_input_file): Update call to Plugin_manager::add_input_file.
12155 (add_input_library): New.
12156 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12157
966d4097
DK
121582009-09-30 Doug Kwan <dougkwan@google.com>
12159
12160 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12161 symbol and call Symbol::may_need_copy_reloc to determine if
12162 a copy reloc is needed.
12163 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12164 nocopyreloc is given in command line.
12165 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12166 given in command line.
12167 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12168 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12169 of the removed Target_i386::may_need_copy_reloc.
12170 * options.h (copyreloc): New option with default value false.
12171 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12172 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12173 instead of the removed Target_powerpc::may_need_copy_reloc.
12174 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12175 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12176 instead of the removed Target_sparc::may_need_copy_reloc.
12177 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12178 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12179 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12180 instead of the removed Target_x86_64::may_need_copy_reloc.
12181
029ba973
ILT
121822009-09-30 Ian Lance Taylor <iant@google.com>
12183
12184 * object.h (class Object): Remove target_ field, and target,
12185 sized_target, and set_target methods.
12186 (Object::sized_target): Remove.
12187 (class Sized_relobj): Update declarations. Remove sized_target.
12188 * object.cc (Sized_relobj::setup): Remove target parameter.
12189 Change all callers.
12190 (Input_objects::add_object): Don't do anything with the target.
12191 (make_elf_sized_object): Add punconfigured parameter. Change all
12192 callers. Set or test parameter target.
12193 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12194 Change all callers.
12195 * parameters.cc (Parameters::set_target): Change parameter type to
12196 be non-const.
12197 (Parameters::default_target): Remove.
12198 (set_parameters_target): Change parameter type to be non-const.
12199 (parameters_force_valid_target): New function.
12200 (parameters_clear_target): New function.
12201 * parameters.h (class Parameters): Update declarations. Remove
12202 default_target method. Add sized_target and clear_target
12203 methods. Change target_ to be non-const.
12204 (set_parameters_target): Update declaration.
12205 (parameters_force_valid_target): Declare.
12206 (parameters_clear_target): Declare.
12207 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12208 as NULL if we aren't searching.
12209 (Add_symbols::run): Don't check for compatible target.
12210 * fileread.cc (Input_file::open_binary): Call
12211 parameters_force_valid_target.
12212 * gold.cc (queue_middle_tasks): Likewise.
12213 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12214 set_target on object.
12215 * dynobj.h (class Sized_dynobj): Update declarations.
12216 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12217 make_elf_object returns NULL.
12218 (Archive::include_member): Don't check whether object target is
12219 compatible.
12220 * output.cc (Output_section::add_input_section): Get target from
12221 parameters.
12222 (Output_section::relax_input_section): Likewise.
12223 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12224 parameters.
12225 (Sized_relobj::do_scan_relocs): Likewise.
12226 (Sized_relobj::relocate_sections): Likewise.
12227 * resolve.cc (Symbol_table::resolve): Likewise.
12228 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12229 parameter. Change all callers.
12230 (Symbol_table::add_from_object): Get target from parameters.
12231 (Symbol_table::add_from_relobj): Don't check object target.
12232 (Symbol_table::add_from_dynobj): Likewise.
12233 (Symbol_table::define_special_symbol): Get target from
12234 parameters.
12235 * symtab.h (class Symbol_table): Update declaration.
12236 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12237 parameter. Change all callers. Clear parameter target.
12238 (Binary_test): Test target here.
12239 * testsuite/object_unittest.cc (gold_testsuite): Remove
12240 target_test_pointer parameter. Change all callers.
12241 (Object_test): Test target here.
12242
a6a22b83
ILT
122432009-09-26 Ian Lance Taylor <iant@google.com>
12244
12245 * testsuite/initpri1.c: Don't try to use constructor priorities if
12246 compiling with gcc before 4.3.
12247
6a8f49fe
ILT
122482009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12249
12250 * testsuite/retain_symbols_file_test.sh (check_present): Change
12251 output file name to retain_symbols_file_test.stdout.
12252 (check_absent): Likewise.
12253
8c604651
CS
122542009-09-18 Craig Silverstein <csilvers@google.com>
12255
12256 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12257 * options.cc: Include <cerrno> and <fstream>.
12258 (General_options::finalize): Parse -retain-symbols-file tag.
12259 * options.h: New flag.
12260 (General_options): New method should_retain_symbol, new
12261 variable symbols_to_retain.
12262 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12263 should_retain_symbol map.
12264 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12265 * testsuite/Makefile.in: Regenerate.
12266 * testsuite/retain_symbols_file_test.sh: New file.
12267
ca58b19f
NC
122682009-09-18 Nick Clifton <nickc@redhat.com>
12269
12270 * po/es.po: Updated Spanish translation.
12271
20e6d0d6
DK
122722009-09-17 Doug Kwan <dougkwan@google.com>
12273
12274 * debug.h (DEBUG_RELAXATION): New constant.
12275 (DEBUG_ALL): Add DEBUG_RELAXATION.
12276 (debug_string_to_enum): Add relaxation debug option.
12277 * layout.cc
12278 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12279 Layout::Relaxation_debug_check::read_sections,
12280 Layout::Relaxation_debug_check::read_sections): New method definitions.
12281 (Layout::Layout): Initialize data members
12282 record_output_section_data_from_scrips_,
12283 script_output_section_data_list_ and relaxation_debug_check_.
12284 (Layout::save_segments, Layout::restore_segments,
12285 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12286 Layout::relaxation_loop_body): New method definitions.
12287 (Layout::finalize): Support relaxation. Move section layout code to
12288 Layout::relaxation_loop_body.
12289 (Layout::set_asection_address_from_script): Move code for orphan
12290 section placement out.
12291 (Layout::place_orphan_sections_in_script): New method definition.
12292 * layout.h (Output_segment_headers, Output_file_header):
12293 New forward class declarations.
12294 (Layout::~Layout): Define.
12295 (Layout::new_output_section_data_from_script): New method definition.
12296 (Layout::place_orphan_sections_in_script): New method declaration.
12297 (Layout::Segment_states): New type declaration.
12298 (Layout::save_segments, Layout::restore_segments,
12299 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12300 Layout::relaxation_loop_body): New method declarations.
12301 (Layout::Output_section_data_list): New type declaration.
12302 (Layout::Relaxation_debug_check): New class definition.
12303 (Layout::record_output_section_data_from_script_,
12304 Layout::script_output_section_data_list_, Layout::segment_states_,
12305 Layout::relaxation_debug_check_): New data members.
12306 * output.cc: (Output_section_headers::do_size): New method definition.
12307 (Output_section_headers::Output_section_headers): Move size
12308 computation to Output_section_headers::do_size.
12309 (Output_segment_headers::do_size): New method definition.
e1df38aa 12310 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12311 Output_file_header::do_size and call it.
12312 (Output_file_header::do_size): New method definition.
12313 (Output_data_group::Output_data_group): Adjust call to
12314 Output_section_data.
12315 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12316 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12317 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12318 RELAXED_INPUT_SECTION_CODE.
12319 (Output_section::Output_section): Initialize data member checkpoint_.
12320 (Output_section::~Output_section): Delete checkpoint object pointed
12321 by checkpoint_.
12322 (Output_section::add_input_section): Always add an Input_section if
12323 relaxing.
12324 (Output_section::add_merge_input_section): Add assert.
12325 (Output_section::relax_input_section): New method definition.
12326 (Output_section::set_final_data_size): Set load address to zero for
12327 an unallocated section.
12328 (Output_section::do_address_and_file_offset_have_reset_values):
12329 New method definition.
12330 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12331 Handle relaxed input section.
12332 (Output_section::sort_attached_input_sections): Checkpoint input
12333 section list lazily.
12334 (Output_section::get_input_sections): Change type of input_sections to
12335 list of Simple_input_section pointers. Checkpoint input section list
12336 lazily. Also handle relaxed input sections.
12337 (Output_section::add_input_section_for_script): Take a reference to
12338 a Simple_input_section object instead of Relobj pointer and section
12339 index as parameter. Handle relaxed input sections.
12340 (Output_section::save_states, Output_section::restore_states): New
12341 method definitions.
12342 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12343 (Output_data::is_data_size_fixed): New method definition.
12344 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12345 if it is fixed.
12346 (Output_data::address_and_file_offset_have_reset_values): New method
12347 definition.
12348 (Output_data::do_address_and_file_offset_have_reset_values): New method
12349 definition.
12350 (Output_data::set_data_size): Check that data size is not fixed.
12351 (Output_data::fix_data_size): New method definition.
12352 (Output_data::is_data_size_fixed_): New data member.
12353 (Output_section_headers::set_final_data_size): New method definition.
12354 (Output_section_headers::do_size): New method declaration.
12355 (Output_segment_headers::set_final_data_size): New method definition.
12356 (Output_segment_headers::do_size): New method declaration.
12357 (Output_file_header::set_final_data_size)::New method definition.
12358 (Output_file_header::do_size)::New method declaration.
12359 (Output_section_data::Output_section_data): Add new parameter
12360 is_data_size_fixed and use it to fix data size.
12361 (Output_data_const::Output_data_const): Adjust call to base class
12362 constructor and fix data size.
12363 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12364 base class constructor and fix data size.
12365 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12366 base class constructor and fix data size.
12367 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12368 class constructor and fix data size.
12369 (Output_data_group::set_final_data_size): New method definition.
12370 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12371 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12372 class constructor and fix data size.
12373 (Output_relaxed_input_section): New class definition.
12374 (Output_section::Simple_input_section): New class definition.
12375 (Output_section::get_input_sections): Adjust parameter list.
12376 (Output_section::add_input_section_for_script): Same.
12377 (Output_section::save_states, Output_section::restore_states,
12378 Output_section::do_address_and_file_offset_have_reset_values,
12379 (Output_section::Input_section::Input_section): Handle
12380 RELAXED_INPUT_SECTION_CODE. Add new overload for
12381 Output_relaxed_input_section.
12382 (Output_section::Input_section::is_input_section,
12383 Output_section::Input_section::set_output_section): Handle relaxed
12384 input section.
12385 (Output_section::Input_section::is_relaxed_input_section,
12386 Output_section::Input_section::output_section_data,
12387 Output_section::Input_section::relaxed_input_section): New method
12388 definitions.
12389 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12390 value.
12391 (Output_section::Input_section::u1_): Update comments.
12392 (Output_section::Input_section::u2_): Add new union member poris.
12393 (Output_section::Checkpoint_output_section): New classs definition.
12394 (Output_section::relax_input_section): New method declaration.
12395 (Output_section::checkpoint_): New data member.
12396 (Output_segment): Update comments.
12397 (Output_segment::Output_segment): Un-privatize copy constructor.
12398 (Output_segment::operator=): Un-privatize.
12399 * script-sections.cc (Output_section_element::Input_section_list):
12400 Change element type to Output_section::Simple_input_section.
12401 (Output_section_element_dot_assignment::set_section_addresses):
12402 Register output section data for relaxation clean up.
12403 (Output_data_exression::Output_data_expression): Adjust call to base
12404 constructor to fix data size.
12405 (Output_section_element_data::set_section_addresses): Register
12406 Output_data_expression object for relaxation clean up.
12407 (struct Input_section_info): Replace Relobj pointer and section index
12408 pair with Output_section::Simple_input_section and Convert struct to a
12409 class.
12410 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12411 Input_section_info data member to use accessors.
20e6d0d6
DK
12412 (Output_section_element_input::set_section_addresses): Use layout
12413 parameter. Adjust code to use Output_section::Simple_input_section
12414 and Input_secction_info classes. Register filler for relaxation
12415 clean up.
12416 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12417 and section index pair with Output_section::Simple_input_section
12418 class. Adjust code accordingly.
12419 (Phdrs_element::release_segment): New method definition.
12420 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12421 segment list.
12422 (Script_sections::release_segments): New method definition.
12423 * gold/script-sections.h (Script_sections::release_segments): New
12424 method declaration.
12425 * gold/target.h (Target::may_relax, Target::relax,
12426 Target::do_may_relax, Target::do_relax): New method definitions.
12427
5e445df6
ILT
124282009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12429
12430 * arm.cc (has_signed_unsigned_overflow): New function.
12431 (Arm_relocate_functions::abs8): New function.
12432 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12433 (Target_arm::Scan::global): Likewise.
12434 (Target_arm::relocate::relocate): Likewise.
12435 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12436 Likewise.
12437
8c604651 124382009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12439
12440 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12441 * testsuite/Makefile.in: Regenerate.
12442
1e9cc1c2
NC
124432009-09-11 Nick Clifton <nickc@redhat.com>
12444
12445 * po/gold.pot: Updated by the Translation project.
12446
6a89f575
CC
124472009-09-08 Cary Coutant <ccoutant@google.com>
12448
12449 * output.cc (Output_file::open): Add execute permission to empty file.
12450 * testsuite/Makefile.am (permission_test): New test.
12451 * testsuite/Makefile.in: Regenerate.
12452
fdcac5af
ILT
124532009-09-02 Ian Lance Taylor <iant@google.com>
12454
12455 * output.cc (Output_file::resize): Call map_no_anonymous rather
12456 than map.
12457
44453f85
ILT
124582009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12459
12460 * gold.cc: Include "incremental.h".
12461 (queue_initial_tasks): Call Incremental_checker methods.
12462 * incremental.cc: Include "output.h".
12463 (Incremental_checker::can_incrementally_link_output_file): New
12464 method.
12465 * incremental.h (Incremental_checker): New class.
12466
12467 * output.cc (Output_file::open_for_modification): New method.
12468 (Output_file::map_anonymous): Changed return type to bool. Record
12469 map in base_ field.
12470 (Output_file::map_no_anonymous): New method, broken out of map.
12471 (Output_file::map): Use map_no_anonymous and map_anonymous.
12472 * output.h (class Output_file): Update declarations.
12473
293c1386
CC
124742009-08-24 Cary Coutant <ccoutant@google.com>
12475
12476 * options.h (Command_line::Pre_options): New class.
12477 (Command_line::pre_options): New member.
12478 * options.cc (gold::options::ready_to_register): New variable.
12479 (One_option::register_option): Do nothing if not registering options.
12480 Assert if same short option registered twice.
12481 (General_options::General_options): Turn off option registration when
12482 done constructing.
12483 (Command_line::Pre_options::Pre_options): New constructor.
12484
f773f3d2
CC
124852009-08-24 Cary Coutant <ccoutant@google.com>
12486
06a73cfe
CC
12487 * options.h (General_options::no_keep_memory): Remove incorrect
12488 short option.
f773f3d2 12489
a15af8e2
RW
124902009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12491
12492 * Makefile.am (am__skiplex, am__skipyacc): New.
12493 * Makefile.in: Regenerate.
12494
c462b41b
RW
124952009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12496
14ec8efd
RW
12497 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12498 (INCLUDES): ... this.
12499 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12500 (AM_CPPFLAGS): Renamed from ...
12501 (INCLUDE): ... this.
12502 * Makefile.in, testsuite/Makefile.in: Regenerate.
12503
81ecdfbb
RW
12504 * Makefile.in: Regenerate.
12505 * aclocal.m4: Likewise.
12506 * config.in: Likewise.
12507 * configure: Likewise.
12508 * testsuite/Makefile.in: Likewise.
12509
c462b41b
RW
12510 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12511 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12512 * Makefile.in: Regenerate.
12513 * testsuite/Makefile.in: Regenerate.
12514
2da73f13
CC
125152009-08-19 Cary Coutant <ccoutant@google.com>
12516
12517 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12518 symbols in shared libraries overridden by hidden or internal symbols
12519 in the main program.
12520
2db70501
CD
125212009-08-19 Chris Demetriou <cgd@google.com>
12522
12523 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12524 checking source file names in error messages.
12525
f733487b
DK
125262009-08-18 Doug Kwan <dougkwan@google.com>
12527
12528 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12529 an elcpp::Ehdr as parameter. Adjust call to set_target.
12530 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12531 an elfcpp::Ehdr as parameter.
12532 * object.cc (Object::set_target): Remove the version that looks up
12533 a target and sets it.
12534 (Sized_relobj::setup): Take a Target object instead of
12535 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12536 (make_elf_sized_object): Find target and ask target to
12537 make an ELF object.
12538 * object.h: (Object::set_target): Remove the version that looks up
12539 a target and sets it.
12540 (Sized_relobj::setup): Take a Target object instead of
12541 an elfcpp:Ehdr as parameter.
12542 * target.cc: Include dynobj.h.
12543 (Target::do_make_elf_object_implementation): New.
2e702c99 12544 (Target::do_make_elf_object): New.
f733487b
DK
12545 * target.h (Target::make_elf_object): New template declaration.
12546 (Target::do_make_elf_object): New method declarations.
12547 (Target::do_make_elf_object_implementation): New template declaration.
12548
cc70f101
ILT
125492009-08-14 Ian Lance Taylor <iant@google.com>
12550
12551 * gold.h (FUNCTION_NAME): Define.
12552 (gold_unreachable): Use FUNCTION_NAME.
12553
ef5e0cb1
ST
125542009-08-12 Sriraman Tallam <tmsriram@google.com>
12555
12556 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12557 symbol in the --keep-unique list is not found.
12558
48c187ce
ST
125592009-08-12 Sriraman Tallam <tmsriram@google.com>
12560
12561 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12562 been maked as --keep-unique.
12563 (Icf::unfold_section): New function.
12564 * icf.h (Icf::unfold_section): New function.
12565 * options.h (General_options::keep_unique): New option.
12566 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12567 * testsuite/Makefile.in: Regenerate.
12568 * testsuite/icf_keep_unique_test.sh: New file.
12569 * testsuite/icf_keep_unique_test.cc: New file.
12570
645afe0c
CC
125712009-08-12 Cary Coutant <ccoutant@google.com>
12572
12573 PR 10471
12574 * resolve.cc (Symbol_table::resolve): Check for references from
12575 dynamic objects to hidden and internal symbols.
12576 * testsuite/Makefile.am (hidden_test.sh): New test.
12577 * testsuite/Makefile.in: Regenerate.
12578 * testsuite/hidden_test.sh: New script.
12579 * testsuite/hidden_test_1.c: New test source.
12580 * testsuite/hidden_test_main.c: New test source.
12581
11af873f
DK
125822009-08-11 Doug Kwan <dougkwan@google.com>
12583
12584 * arm.cc: Update comments.
12585 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12586 segment to locate the .ARM.exidx section if present.
12587
b9f7d72d
DK
125882009-08-09 Doug Kwan <dougkwan@google.com>
12589
12590 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12591 patch.
12592
ddd3c53c
ST
125932009-08-07 Sriraman Tallam <tmsriram@google.com>
12594 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12595 compiler warnings.
12596
27721062
ST
125972009-08-06 Sriraman Tallam <tmsriram@google.com>
12598
12599 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12600 valid tls_segment only for non-debug-section relocations.
12601 * testsuite/Makefile.am: Add gc_tls_test.
12602 * testsuite/Makefile.in: Regenerate.
12603 * testsuite/gc_tls_test.cc: New file.
12604 * testsuite/gc_tls_test.sh: New file.
12605
ef15dade 126062009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12607
ef15dade
ST
12608 * icf.cc: New file.
12609 * icf.h: New file.
12610 * Makefile.am (CCFILES): Add icf.cc.
12611 (HFILES): Add icf.h
12612 * Makefile.in: Regenerate.
12613 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12614 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12615 section, symbol and addend information for the relocs.
12616 * gold.cc (queue_middle_tasks): Call identical code folding.
12617 * gold.h: Add defines for multimap.
12618 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12619 to the call of finalize_local_symbols.
12620 * main.cc (main): Create object of class Icf.
12621 * object.cc (Sized_relobj::do_layout): Allow this function to be
12622 called twice during icf.
12623 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12624 to sections marked as identical by icf.
12625 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12626 when available.
12627 (Sized_relobj::do_section_entsize): New function.
12628 * object.h (Object::section_entsize): New function.
12629 (Object::do_section_entsize): New pure virtual function.
12630 (Relobj::finalize_local_symbols): Add new parameter.
12631 (Relobj::do_section_entsize): New function.
12632 * options.h (General_options::icf): New option.
12633 (General_options::icf_iterations): New option.
12634 (General_options::print_icf_sections): New option.
12635 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12636 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12637 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12638 icf.
12639 * symtab.cc (Symbol_table::is_section_folded): New function.
12640 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12641 to sections marked as identical by icf.
12642 * symtab.h (Symbol_table::set_icf): New function.
12643 (Symbol_table::icf): New function.
12644 (Symbol_table::is_section_folded): New function.
12645 (Symbol_table::icf_): New data member.
12646 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12647 * testsuite/Makefile.am: Add commands to build icf_test.
12648 * testsuite/Makefile.in: Regenerate.
12649 * testsuite/icf_test.sh: New file.
12650 * testsuite/icf_test.cc: New file.
12651
c3b65ac4
CD
126522009-07-24 Chris Demetriou <cgd@google.com>
12653
12654 * layout.cc (is_compressible_debug_section): Fix incorrect
12655 comment about compressed section names.
12656
1caf2c51
ILT
126572009-07-20 Ian Lance Taylor <ian@airs.com>
12658
12659 PR 10419
12660 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12661
1ef4d87f
ILT
126622009-07-16 Ian Lance Taylor <iant@google.com>
12663
12664 PR 10400
12665 * layout.h: #include <map>.
12666 (class Kept_section): Change from struct to class. Add accessors
12667 and setters. Add section size to Comdat_group mapping. Change
12668 Comdat_group to std::map. Add is_comdat_ field. Add
12669 linkonce_size field in union.
12670 (class Layout): Update declaration of find_or_add_kept_section.
12671 Don't declare find_kept_object.
12672 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12673 parameter. Add object, shndx, is_comdat, and is_group_name
12674 parameters. Change all callers. Adjust for new Kept_section.
12675 (Layout::find_kept_object): Remove.
12676 * object.cc (Sized_relobj::include_section_group): Update use of
12677 Kept_section. Rename secnum to shndx. Only record
12678 Kept_comdat_section if sections are the same size.
12679 (Sized_relobj::include_linkonce_section): Update use of
12680 Kept_section. Only record Kept_comdat_section if sections are the
12681 same size. Set size of linkonce section.
12682 (Sized_relobj::map_to_kept_section): Update call to
12683 get_kept_comdat_section.
12684 * object.h (class Sized_relobj): Rename fields in
12685 Kept_comdat_section to drop trailing underscores; change object
12686 field to Relobj*. Change Kept_comdat_section_table to store
12687 struct rather than pointer.
12688 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12689 Add kept_object and kept_shndx parameters. Change all callers.
12690 (Sized_relobj::get_kept_comdat_section): Change return type to
12691 bool. Add kept_object and kept_shndx parameters. Change all
12692 callers.
12693 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12694 Layout::find_or_add_kept_section.
12695
37c3b7b0
ILT
126962009-07-09 Ian Lance Taylor <iant@google.com>
12697
12698 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12699 Reserve space in the hash table.
12700
98fa85cb
ILT
127012009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12702
12703 * fileread.cc (File_read::get_mtime): New method.
12704 * fileread.h (Timespec): New structure.
12705 (File_read::get_mtime): New method.
12706 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12707 Renamed from timestamp_nsec.
12708 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12709 Elf_Xword.
e1df38aa 12710 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12711 timestamp_nsec.
e1df38aa 12712 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12713 (Incremental_inputs::report_obejct): Save mtime; style fix.
12714 (Incremental_inputs::report_script): Save mtime; style fix.
12715 (Incremental_inputs::finalize_inputs): Style fix.
12716 (Incremental_inputs::finalize): Style fix.
12717 (Incremental_inputs::create_input_section_data): Store inputs
12718 mtime.
12719 * incremental.h (Incremental_inputs::report_script): Add mtime
12720 argument.
12721 (Incremental_inputs::Input_info::Input_info): Intialize only one
12722 union member.
12723 (Incremental_inputs::Input_info::archive): Move to nameless
12724 union.
12725 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12726 (Incremental_inputs::Input_info::script): Move to nameless union.
12727 (Incremental_inputs::mtime): New field.
12728 * script.cc (read_input_script): Pass file mtime to
12729 Incremental_input.
12730 * script.h (Script_info::inputs): Style fix.
12731
c9d70757
ILT
127322009-07-01 Ian Lance Taylor <ian@airs.com>
12733
12734 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12735 instead of 32.
12736
9c547ec3
ILT
127372009-06-24 Ian Lance Taylor <iant@google.com>
12738
12739 PR 10156
12740 * layout.cc (Layout::choose_output_section): If we find an
12741 existing section, update the flags.
12742 (Layout::create_notes): New function, broken out of
12743 Layout::finalize.
12744 (Layout::finalize): Don't create note sections.
12745 (Layout::create_note): Don't crash if linker script discards
12746 section.
12747 (Layout::create_gold_note): Likewise.
12748 (Layout::create_build_id): Likewise. Don't set
12749 after_input_sections on the section.
12750 (Layout::create_executable_stack_info): Remove target parameter.
12751 Change caller.
12752 * layout.h (class Layout): Declare create_notes. Update
12753 declaration of create_executable_stack_info.
12754 * gold.cc (queue_middle_tasks): Call create_notes.
12755 * output.cc (Output_section::update_flags_for_input_section): Move
12756 here from output.h. If SHF_ALLOC flag is newly set, mark address
12757 invalid.
12758 * output.h (Output_data::mark_address_invalid): New function.
12759 (class Output_section): Only declare, not define,
12760 update_flags_for_input_section. Remove set_flags.
12761
55458500
ILT
127622009-06-24 Ian Lance Taylor <iant@google.com>
12763
12764 * script-sections.cc (Output_section_definition::
12765 set_section_addresses): Rename shadowing local load_address to
12766 laddr.
12767
1307d6cd
ILT
127682009-06-24 Ian Lance Taylor <iant@google.com>
12769
12770 PR 10244
12771 * reloc.cc (relocate_sections): Skip empty relocation sections.
12772
ec3f783e
ILT
127732009-06-23 Ian Lance Taylor <iant@google.com>
12774
12775 PR 10156
12776 * layout.cc (Layout::create_note): Use choose_output_section
12777 rather than make_output_section.
12778
459c9f1c
ILT
127792009-06-23 Ian Lance Taylor <iant@google.com>
12780
12781 PR 10237
12782 * options.cc (General_options::parse_V): Set printed_version_.
12783 (General_options::General_options): Initialize printed_version_.
12784 * options.h (class General_options): Add printed_version_ field.
12785 * gold.cc (queue_initial_tasks): If there are no input files,
12786 don't give a fatal error if we printed the version information.
12787 (queue_middle_tasks): If using -r with a shared object, give a
12788 fatal error rather than an ordinary error.
12789
1518dc8f
ILT
127902009-06-23 Ian Lance Taylor <iant@google.com>
12791
12792 PR 10219
12793 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12794 (Layout::make_output_section): Set have_stabstr_section_ if we see
12795 a .stab*str section.
12796 (Layout::finalize): Call link_stabs_sections.
12797 (Layout::link_stabs_sections): New file.
12798 * layout.h (class Layout): Add have_stabstr_section_ field.
12799 Declare link_stabs_sections.
12800
3d857b98
DK
128012009-06-23 Doug Kwan <dougkwan@google.com>
12802
12803 * Makefile.am (libgold_a_LIBADD): New.
12804 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12805 * Makefile.in: Regenerate.
3d857b98
DK
12806 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12807 * configure: Regenerate.
12808 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12809 * fileread.cc: Include sys/state.h
12810 * gold.h: Declare memmem and strndup if found missing.
12811 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12812
0639a6f6
ILT
128132009-06-23 Ian Lance Taylor <iant@google.com>
12814
12815 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12816 * configure: Rebuild.
12817
8d63875c
ILT
128182009-06-23 Ian Lance Taylor <iant@google.com>
12819
12820 PR 10147
12821 * object.cc (Object::section_contents): Don't try to get a view if
12822 the section has length zero.
12823 (Object::handle_gnu_warning_section): If the section is empty, use
12824 the name of the section as the warning.
12825
f7c8a183
ILT
128262009-06-23 Ian Lance Taylor <iant@google.com>
12827
12828 PR 10133
12829 * stringpool.h (class Stringpool_template): Add optimize_ field.
12830 (Stringpool_template::set_optimize): New function.
12831 * stringpool.cc (Stringpool_template::Stringpool_template):
12832 Initialize optimize_ field.
12833 (Stringpool_template::set_string_offsets): Test local optimize
12834 fild rather than parameter.
12835 * layout.cc (Layout::Layout): Call set_optimize on the section
12836 name stringpool.
12837
e6a307ba
ILT
128382009-06-22 Ian Lance Taylor <iant@google.com>
12839
12840 PR 10030
12841 * yyscript.y: Parse TARGET.
12842 * script.cc (script_set_target): New function.
12843 * script-c.h (script_set_target): Declare.
12844 * options.cc (General_options::string_to_object_format): Rename
12845 from string_to_object_format in anonymous namespace. Change
12846 callers.
12847 * options.h (class General_options): Declare
12848 string_to_object_format.
12849
3ee173de
ILT
128502009-06-22 Ian Lance Taylor <iant@google.com>
12851
12852 * script-sections.cc (Script_sections::create_segments): Don't put
12853 program headers in a PT_LOAD segment if -n or -N.
12854
128552009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12856
12857 PR 10141
12858 * options.h (class General_options): Add -z lazy and -z now. Sort
12859 -z options into alphabetical order.
12860 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12861
cd6739a1 128622009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12863
12864 * layout.cc (Layout::make_output_section): Call
12865 Target::new_output_section.
12866 (Layout::attach_allocated_section_to_segment): Put large section
12867 sections in a separate load segment with the large segment flag
12868 set.
12869 (Layout::segment_precedes): Sort large data segments after other
12870 load segments.
12871 (align_file_offset): New static function.
12872 (Layout::set_segment_offsets): Use align_file_offset.
12873 * output.h (class Output_section): Add is_small_section_ and
12874 is_large_section_ fields.
12875 (Output_section::is_small_section): New function.
12876 (Output_section::set_is_small_section): New function.
12877 (Output_section::is_large_section): New function.
12878 (Output_section::set_is_large_section): New function.
12879 (Output_section::is_large_data_section): New function.
12880 (class Output_segment): Add is_large_data_segment_ field.
12881 (Output_segment::is_large_data_segment): New function.
12882 (Output_segment::set_is_large_data_segment): New function.
12883 * output.cc (Output_section::Output_section): Initialize new
12884 fields.
12885 (Output_segment::Output_segment): Likewise.
12886 (Output_segment::add_output_section): Add assertion that large
12887 data sections always go in large data segments. Force small data
12888 sections to the end of the list of data sections. Force small BSS
12889 sections to the start of the list of BSS sections. For large BSS
12890 sections to the end of the list of BSS sections.
12891 * symtab.h (class Symbol): Declare is_common_shndx.
12892 (Symbol::is_defined): Check Symbol::is_common_shndx.
12893 (Symbol::is_common): Likewise.
12894 (class Symbol_table): Define enum Commons_section_type. Update
12895 declarations. Add small_commons_ and large_commons_ fields.
12896 * symtab.cc (Symbol::is_common_shndx): New function.
12897 (Symbol_table::Symbol_table): Initialize new fields.
12898 (Symbol_table::add_from_object): Put small and large common
12899 symbols in the right list.
12900 (Symbol_table::sized_finalized_symbol): Check
12901 Symbol::is_common_shndx.
12902 (Symbol_table::sized_write_globals): Likewise.
12903 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12904 common symbol lists. Don't call do_allocate_commons_list if the
12905 list is empty.
12906 (Symbol_table::do_allocate_commons_list): Remove is_tls
12907 parameter. Add comons_section_type parameter. Change all
12908 callers. Handle small and large common symbols.
12909 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12910 Symbol::is_common_shndx.
12911 * resolve.cc (symbol_to_bits): Likewise.
12912 * target.h (Target::small_common_shndx): New function.
12913 (Target::small_common_section_flags): New function.
12914 (Target::large_common_shndx): New function.
12915 (Target::large_common_section_flags): New function.
12916 (Target::new_output_section): New function.
12917 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12918 small_common_section_flags, and large_common_section_flags
12919 fields.
12920 (Target::do_new_output_section): New virtual function.
12921 * arm.cc (Target_arm::arm_info): Initialize new fields.
12922 * i386.cc (Target_i386::i386_info): Likewise.
12923 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12924 Likewise.
12925 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12926 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12927 (Target_x86_64::do_new_output_section): New function.
12928 * configure.ac: Define conditional MCMODEL_MEDIUM.
12929 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12930 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12931 (large_LDFLAGS): Define.
12932 * testsuite/large.c: New file.
12933 * testsuite/testfile.cc (Target_test::test_target_info):
12934 Initialize new fields.
12935 * configure, testsuite/Makefile.in: Rebuild.
12936
bb04269c
DK
129372009-06-05 Doug Kwan <dougkwan@google.com>
12938
12939 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12940 * Makefile.in: Regenerate.
bb04269c
DK
12941 * i386.cc (class Target_i386): Define new virtual method to
12942 override do_is_local_label_name in parent.
12943 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12944 local symbols if --discard-locals or -X is given.
12945 * options.h (class General_options): Declare new options
12946 '--discard-locals' and '-X' for discarding locals.
12947 * target.h (class Target): Define new methods is_local_label_name.
12948 Declare new virtual method do_is_local_label_name.
12949 * target.cc: New file.
12950 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12951 (check_SCRIPTS): Add discard_locals_test.sh.
12952 (check_DATA): Add discard_local_tests.syms.
12953 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12954 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12955 * testsuite/Makefile.in: Regenerate.
12956 * testsuite/discard_locals_test.c: New file.
12957 * testsuite/discard_locals_test.sh: Same.
12958
805bb01c
DK
129592009-06-05 Doug Kwan <dougkwan@google.com>
12960
12961 * object.cc (Sized_relobj::Sized_relobj): Initialize
12962 discarded_eh_frame_shndx_ to -1U.
12963 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12964 section.
12965 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12966 a discarded .eh_frame section.
12967 (Sized_relobj::do_finalize_local_symbols): Ditto.
12968 * object.h (class Sized_relobj): Declare new member
12969 discarded_eh_frame_shndx_.
12970 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12971 (local_labels_test.o, local_labels_test): New rules.
12972 * testsuite/Makefile.in: Regenerate.
12973
1dcd334d
DK
129742009-06-04 Doug Kwan <dougkwan@google.com>
12975
12976 * layout.cc (Layout::section_name_mapping): Add mapping for
12977 special ARM sections.
12978
96d49306
DK
129792009-06-03 Doug Kwan <dougkwan@google.com>
12980
12981 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12982 (utils::has_overflow): Same.
12983
dff16297
ILT
129842009-06-03 Ian Lance Taylor <iant@google.com>
12985
12986 * layout.cc (Layout::section_name_mapping): New array, replacing
12987 Layout::linkonce_mapping.
12988 (Layout::section_name_mapping_count): New variable, replacing
12989 Layout::linkonce_mapping_count.
12990 (Layout::linkonce_output_name): Remove.
12991 (Layout::output_section_name): Rewrite.
12992 * layout.h (class Layout): Rename Linkonce_mapping to
12993 Section_name_mapping, linkonce_mapping to section_name_mapping,
12994 linkonce_mapping_count to section_name_mapping_count. Don't
12995 declare linkonce_output_name.
12996
c121c671
DK
129972009-06-03 Doug Kwan <dougkwan@google.com>
12998
12999 * gold/arm.cc (namespace utils): New.
13000 (Target_arm::reloc_is_non_pic): Define new method.
13001 (class Arm_relocate_functions): New.
13002 (Target_arm::Relocate::relocate): Handle relocation types used by
13003 Android.
13004
07800fab
ILT
130052009-06-03 Ian Lance Taylor <iant@google.com>
13006
13007 * arm.cc (Target_arm::scan::global): Use || instead of |.
13008
c121c671
DK
130092009-06-02 Doug Kwan <dougkwan@google.com>
13010
13011 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13012 issued_non_pic_error_.
13013 (class Target_arm::Scan): Declare new method check_non_pic.
13014 Define new method symbol_needs_plt_entry.
13015 Declare new data member issued_non_pic_error_.
13016 (class Target_arm::Relocate): Declare new method
13017 should_apply_static_reloc.
13018 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13019 (Target_arm::Scan::check_non_pic): Define new method.
13020 (Target_arm::Scan::local): Handle a small subset of reloc types used
13021 by Android.
13022 (Target_arm::Scan::local): Same.
13023 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13024
b19b0c6d
ILT
130252009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13026
13027 * incremental.cc (Incremental_inputs::report_command_line): Filter
13028 out --incremental-* options.
13029
94cdfcff
DK
130302009-05-29 Doug Kwan <dougkwan@google.com>
13031
13032 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13033 template class.
13034 (class Target_arm): Update comment.
13035 (Target_arm::Target_arm): Initialize new data members GOT_,
13036 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13037 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13038 and Target_arm::rel_dyn_section.
13039 Declare new_enum Target_arm::Got_type.
13040 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13041 and DYNBSS_.
13042 Update commments for member do_dynsym_value.
13043 (Target_arm::got_size, Target_arm::plt_section,
13044 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13045 new methods inside class defintion.
13046 (Target_arm::got_section): Define new method.
13047 (Target_arm::rel_dyn_section): Same.
13048 (Output_data_plt_arm): New template class.
13049 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13050 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13051 (Output_data_plt_arm::add_entry): Same.
13052 (Output_data_plt_arm::first_plt_entry): Define new
13053 static data member for PLT instruction template.
13054 (Output_data_plt_arm::plt_entry): Same.
13055 (Output_data_plt_arm::do_write): Define new method.
13056 (Target_arm::make_plt_entry): Same.
13057 (Target_arm::do_finalize_sections): Same.
13058 (Target_arm::do_dynsym_value): Same.
13059
4a657b0d
DK
130602009-05-28 Doug Kwan <dougkwan@google.com>
13061
13062 * Makefile.am (TARGETSOURCES): Add arm.cc.
13063 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13064 * Makefile.in: Regenerate.
13065 * arm.cc: New file.
13066 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13067
e7ae8c36
DK
130682009-05-26 Doug Kwan <dougkwan@google.com>
13069
13070 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13071 (General_options::check_excluded_libs): Strip off directories in
13072 archive name before matching like GNU ld does.
13073 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13074 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13075 (exclude_libs_test_LDFLAGS): Add linker option
13076 -Wl,--exclude-libs,libexclude_libs_test_3
13077 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13078 an explicit archive without using -l.
13079 (alt/libexclude_libs_test_3.a): New make rule.
13080 * testsuite/Makefile.in: Regenerate.
13081 * testsuite/exclude_libs_test.c : Declare lib3_default().
13082 (main): Call it.
13083 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13084 * exclude_libs_test_3.c: New file.
13085
f12e7348
NC
130862009-05-26 Nick Clifton <nickc@redhat.com>
13087
13088 * po/id.po: New Indonesian translation.
13089 * po/gold.pot: Updated template file.
13090
4daadc0d
ST
130912009-05-22 Sriraman Tallam <tmsriram@google.com>
13092
e1df38aa 13093 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13094 gc_comdat_test files. Add -Wl,--gc-sections to build
13095 gc_comdat_test.
13096 * testsuite/Makefile.in: Regenerate.
13097 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13098
531813ad
ST
130992009-05-21 Sriraman Tallam <tmsriram@google.com>
13100
13101 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13102 kept comdat section was garbage collected.
13103 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13104 * testsuite/Makefile.in: Regenerate.
13105 * testsuite/gc_comdat_test.sh: New file.
13106 * testsuite/gc_comdat_test_1.cc: New file.
13107 * testsuite/gc_comdat_test_2.cc: New file.
13108
65514900
CC
131092009-05-19 Doug Kwan <dougkwan@google.com>
13110
13111 * archive.cc (Archive::Archive): Move constructor from archive.h
13112 to here. Initialize no_export_.
13113 (Archive::get_elf_object_for_member): Set no_export flag of object.
13114 * archive.h (Archive::Archive): Move constructor body to
13115 archive.cc.
13116 (Archive::no_export): New method.
13117 (Archive::no_export_): New field.
13118 * object.h (Object::Object): Initialize no_export_ to false.
13119 (Object::no_export, Object::set_no_export): New methods.
13120 (Object::no_export_): New field.
13121 * options.cc (General_options::parse_exclude_libs): New method.
13122 (General_options::check_excluded_libs) Same.
13123 * options.h (exclude_libs): New option.
13124 (General_options::check_excluded_libs): New method declaration.
13125 (General_options::excluded_libs_): New field.
13126 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13127 default or protected visibility if an object has no-export flag set.
13128 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13129 (check_SCRIPTS): Add exclude_libs_test.sh.
13130 (check_DATA): Add exclude_libs_test.syms.
13131 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13132 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13133 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13134 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13135 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13136 libexclude_libs_test_2.a): New rules.
13137 * testsuite/Makefile.in: Regenerate.
13138 * testsuite/exclude_libs_test.c: New file.
13139 * testsuite/exclude_libs_test.sh: Ditto.
13140 * testsuite/exclude_libs_test_1.c: Ditto.
13141 * testsuite/exclude_libs_test_2.c: Ditto.
13142
1b77ea50
ILT
131432009-05-15 Ian Lance Taylor <iant@google.com>
13144
13145 * configure.ac: Check for declarations for cases where libiberty.h
13146 checks HAVE_DECL_xxx.
13147 * configure, config.in: Rebuild.
13148
072fe7ce
ILT
131492009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13150
13151 * gold.h (Incremental_argument_list): Remove (invalid) forward
13152 declaration.
13153 * incremental.cc (Incremental_inputs::report_achive): New method.
13154 (Incremental_inputs::report_object): New method.
13155 (Incremental_inputs::report_script): New method.
13156 (Incremental_inputs::finalize_inputs): New method.
13157 (Incremental_inputs::finalize): Call finalize_inputs().
13158 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13159 Create inputs entries.
13160 * incremental.h (Incremental_input_type): New enum.
13161 (Incremental_inputs::Incremental_input): Initialize new fields.
13162 (Incremental_inputs::report_inputs): New method.
13163 (Incremental_inputs::report_achive): New method.
13164 (Incremental_inputs::report_object): New method.
13165 (Incremental_inputs::report_script): New method.
13166 (Incremental_inputs::finalize_inputs): New method.
13167 (Incremental_inputs::Input_info): New struct.
13168 (Incremental_inputs::Input_info_map): New typedef.
13169 (Incremental_inputs::lock_): New field.
13170 (Incremental_inputs::Inputs_): New field.
13171 (Incremental_inputs::Inputs_map): New field.
13172 * main.cc (main): Call Incremental_input::report_inputs.
13173 * options.h (Input_argument_list): Typedef moved from
13174 Input_arguments.
13175 (Input_file_group::Files): Remove, use ::Input_argument_list.
13176 (Input_file_group::Input_argument_list): Remove, use
13177 ::Input_argument_list.
13178 * plugin.cc (Plugin_manager::add_input_file): Add error in
13179 incremental build.
13180 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13181 functions.
13182 * script.cc (read_input_script): Call
13183 Incremental_input::report_script.
13184 * script.h (Script_info): New class.
13185
b0481b0b
ILT
131862009-04-27 Ian Lance Taylor <iant@google.com>
13187
13188 * x86_64.cc (do_adjust_output_section): Set entsize to
13189 plt_entry_size.
13190
b22a5a41 131912009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13192
13193 * output.cc (Output_file::close): After short writes, continue
13194 writing from the correct offset in the buffer being written.
13195
40fde488
CD
131962009-04-23 Chris Demetriou <cgd@google.com>
13197
13198 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13199 * configure: Regenerate.
13200 * config.in: Regenerate.
13201 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13202 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13203
3ce2c28e
ILT
132042009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13205
13206 * incremental.cc (Incremental_inputs_header_data): Renamed from
13207 Incremental_input_header_data.
13208 (Incremental_inputs_header_data::data_size): New field.
13209 (Incremental_inputs_header_data::put_input_file_count): Renamed
13210 from input_file_count.
13211 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13212 from command_line_offset.
13213 (Incremental_inputs_header_data::put_reserved): Renamed from
13214 put_reserved.
13215 (Incremental_inputs_entry_data): Renamed from
13216 Incremental_input_entry_data.
13217 (Incremental_inputs_entry_data::data_size): New field.
13218 (Incremental_inputs::report_command_line): New method.
13219 (Incremental_inputs::finalize): New method.
13220 (Incremental_inputs::create_incremental_inputs_data): New method.
13221 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13222 * incremental.h: New file.
13223 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13224 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13225 incremental builds.
703d02da 13226 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13227 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13228 (Layout::create_incremental_info_sections): New method.
13229 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13230 * main.cc (main): Notify Incremental_input of the command line.
13231
e55bde5e
ILT
132322009-04-01 Ian Lance Taylor <iant@google.com>
13233 Mikolaj Zalewski <mikolajz@google.com>
13234
13235 * gold.h (reserve_unordered_map): Define, three versions, one for
13236 each version of Unordered_map.
13237 * layout.cc (Layout::Layout): Remove options parameter. Add
13238 number_of_input_files parameter. Don't initialize options_.
13239 Initialize number_of_input_files_ and resized_signatures_. Move
13240 sections_are_attached_.
13241 (Layout::layout_group): Reserve space for group_signatures_.
13242 (Layout::find_or_add_kept_section): Change name parameter to be a
13243 reference. Resize signatures_ map when it gets large enough.
13244 (Layout::layout_eh_frame): Use parameters->options() instead of
13245 this->options_.
13246 (Layout::make_output_section): Likewise.
13247 (Layout::attach_allocated_section_to_segment): Likewise.
13248 (Layout::finalize, Layout::create_executable_stack): Likewise.
13249 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13250 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13251 * layout.h (class Layout): Update declarations. Remove options_
13252 field. Add number_of_input_files_ and resized_signatures_
13253 fields. Move sections_are_attached_ field.
13254 * main.cc (main): Pass number of input files to Layout
13255 constructor. Don't pass options.
13256
154b857c
ILT
132572009-03-30 Ian Lance Taylor <iant@google.com>
13258
13259 * ffsll.c (ffsll): Correct implementation.
13260
2f35ab9b
ILT
132612009-03-27 Ian Lance Taylor <iant@google.com>
13262
fd03461a
ILT
13263 * ffsll.c: New file.
13264 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13265 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13266 * ftruncate.c (ftruncate): Declare before definition.
13267 * mremap.c (mremap): Likewise.
13268 * pread.c (pread): Likewise.
13269 * configure, Makefile.in, config.in: Rebuild.
13270
2f35ab9b
ILT
13271 * mremap.c: New file.
13272 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13273 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13274 (mremap): Declare if HAVE_MREMAP is not defined.
13275 * configure, Makefile.in, config.in: Rebuild.
13276
33aea2fd
CC
132772009-03-27 Cary Coutant <ccoutant@google.com>
13278
13279 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13280 position independent.
13281 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13282 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13283
6d479619
CC
132842009-03-24 Cary Coutant <ccoutant@google.com>
13285
13286 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13287 an executable.
13288 (needs_dynamic_reloc): Likewise.
13289
afc06bb8
ILT
132902009-03-24 Ian Lance Taylor <iant@google.com>
13291
13292 * yyscript.y (file_cmd): Recognize EXTERN.
13293 (extern_name_list, extern_name_list_body): New nonterminals.
13294 * script.cc (script_add_extern): Define.
13295 * script-c.h (script_add_extern): Declare.
13296
f6060a4d
ILT
132972009-03-24 Rafael Avila de Espindola <espindola@google.com>
13298
13299 * object.cc (is_elf_object): Define.
13300 * object.h (is_elf_object): Declare.
13301 * archive.cc (Archive::get_elf_object_for_member): Call
13302 is_elf_object.
33aea2fd 13303 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13304
26736d8e
ILT
133052009-03-24 Elliott Hughes <enh@google.com>
13306
13307 * output.cc (Output_file::map_anonymous): Define.
13308 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13309 try an anonymous one. Report the size if the mmap fails.
13310 * output.h (class Output_file): Declare map_anonymous.
13311
22fd9730
ILT
133122009-03-24 Ian Lance Taylor <iant@google.com>
13313
13314 * target-select.cc (instantiate_target): Don't acquire the lock if
13315 the instantiated_target_ field has already been set.
13316
cb010894
ILT
133172009-03-23 Ian Lance Taylor <iant@google.com>
13318
7f055c20
ILT
13319 * gold-threads.h (class Initialize_lock): Define.
13320 * gold-threads.cc (class Initialize_lock_once): Define.
13321 (initialize_lock_control): New static variable.
13322 (initialize_lock_pointer): New static variable.
13323 (initialize_lock_once): New static function.
13324 (Initialize_lock::Initialize_lock): Define.
13325 (Initialize_lock::initialize): Define.
13326 * target-select.h: Include "gold-threads.h".
13327 (class Target_selector): Add lock_ and initialize_lock_ fields.
13328 Don't define instantiate_target, just declare it.
13329 * target-select.cc (Target_selector::Target_selector): Initialize
13330 new fields.
13331 (Target_selector::instantiate_target): Define.
13332 * descriptors.h: Include "gold-threads.h".
13333 (class Descriptors): Add initialize_lock_ field.
13334 * descriptors.cc (Descriptors::Descriptors): Initialize new
13335 field.
13336 (Descriptors::open): Use initialize_lock_ field
13337 * errors.h (class Errors): Add initialize_lock_ field.
13338 * errors.cc (Errors::Errors): Initialize new field.
13339 (Errors::initialize_lock): Use initialize_lock_ field.
13340 * powerpc.cc (class Target_selector_powerpc): Remove
13341 instantiated_target_ field. In do_recognize call
13342 instantiate_target rather than do_instantiate_target. In
13343 do_instantiate_target just allocate a new target.
13344 * sparc.cc (class Target_selector_sparc): Likewise.
13345
36959681
ILT
13346 * freebsd.h: New file.
13347 * i386.cc: Include "freebsd.h".
13348 (Target_i386): Derive from Target_freebsd rather than
13349 Sized_target.
13350 (Target_selector_i386): Derive from Target_selector_freebsd rather
13351 than Target_selector.
13352 * x86_64.cc: Include "freebsd.h".
13353 (Target_x86_64): Derive from Target_freebsd rather than
13354 Sized_target.
13355 (Target_selector_x86_64): Derive from Target_selector_freebsd
13356 rather than Target_selector.
13357 * target.h (class Target): Add adjust_elf_header and
13358 do_adjust_elf_header.
13359 * output.cc (Output_file_header:: do_sized_write): Call target
13360 adjust_elf_header routine.
13361 * configure.tgt: Set targ_osabi.
13362 * configure.ac: Define GOLD_DEFAULT_OSABI.
13363 * parameters.cc (Parameters::default_target): Pass
13364 GOLD_DEFAULT_OSABI to select_target.
13365 * target-select.h (class Target_selector): Make instantiate_target
13366 protected rather than private.
13367 * Makefile.am (HFILES): Add freebsd.h.
13368 * configure, Makefile.in, config.in: Rebuild.
13369
cb010894
ILT
13370 * merge.cc (do_add_input_section): Correct pend value. Change
13371 message about last entry not being null terminated from error to
13372 warning.
13373
0e879927
ILT
133742009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13375
13376 * incremental.cc: New file.
13377 * Makefile.am (CCFILES): Add incremental.cc.
13378 * Makefile.in: Rebuild.
13379
41105937
PP
133802009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13381
13382 * layout.cc (Layout::output_section_name): Preserve names
13383 of '.note.' sections.
e1df38aa 13384
60439920
ILT
133852009-03-19 Ian Lance Taylor <iant@google.com>
13386
13387 * descriptors.cc (Descriptors::open): Check that the options are
13388 valid before using them.
13389
0d371ad3
ILT
133902009-03-18 Ian Lance Taylor <iant@google.com>
13391
13392 * script-sections.h: Include <list>.
13393 (class Script_sections): Change Sections_elements from std::vector
13394 to std::list. Typedef public Elements_iterator. Add
13395 orphan_section_placement_, data_segment_align_start_, and
13396 saw_data_segment_align_ fields. Remove data_segment_align_index_
13397 field.
13398 * script-sections.cc (class Orphan_section_placement): New class.
13399 (class Sections_element): Add virtual functions is_relro and
13400 orphan_section_init. Remove virtual function place_orphan_here.
13401 (class Output_section_definition): Add is_relro and
13402 orphan_section_init. Remove place_orphan_here.
13403 (class Orphan_output_section): Likewise.
13404 (Script_sections::Script_sections): Update for field changes.
13405 (Script_sections::data_segment_align): Set saw_data_segment_align_
13406 and data_segment_align_start_, not data_segment_align_index.
13407 (Script_sections::data_segment_relro_end): Check
13408 saw_data_segment_align_. Use data_segment_align_start_ rather
13409 than data_segment_align_index_.
13410 (Script_sections::place_orphan): Rewrite to use
13411 Orphan_section_placement.
13412
9201d894
ILT
134132009-03-17 Ian Lance Taylor <iant@google.com>
13414
9c5b8369
ILT
13415 * archive.cc (Archive::add_symbols): Check for a version attached
13416 to the symbol name in the archive map.
13417 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13418 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13419 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13420 (ver_test_11.a): New target.
13421 * testsuite/Makefile.in: Rebuild.
13422
9201d894
ILT
13423 * configure.ac: Check for chsize and posix_fallocate. Replace
13424 ftruncate.
13425 * ftruncate.c: New file, from gnulib.
13426 * output.cc (posix_fallocate): Define dummy version if not
13427 HAVE_POSIX_FALLOCATE.
13428 (Output_file::map): Call posix_fallocate rather than lseek and
13429 write.
13430 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13431 * configure, Makefile.in, config.in: Rebuild.
13432
ef4ab7a8 134332009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13434
ef4ab7a8
PP
13435 * layout.h (Layout::create_note): Add section_name parameter.
13436 * layout.cc (Layout::create_note): Likewise.
13437 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13438
8c500701
ILT
134392009-03-17 Ian Lance Taylor <iant@google.com>
13440
e85b18e1
ILT
13441 * descriptors.cc: Include "options.h".
13442 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13443 (Descriptors::open): Always use O_CLOEXEC when opening a new
13444 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13445 then set FD_CLOEXEC.
13446
9efe6174
ILT
13447 * sparc.cc (class Target_sparc): Add has_got_section.
13448 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13449 make sure we have a GOT section.
13450
13451 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13452 (Target_sparc::Scan::local): Likewise.
13453 (Target_sparc::Scan::global): Likewise.
13454 (Target_sparc::Relocate::relocate): Likewise.
13455 (Target_sparc::Relocate::relocate_tls): Likewise.
13456
8c500701
ILT
13457 * symtab.cc (Symbol_table::define_default_version): New function,
13458 broken out of add_from_object.
13459 (Symbol_table::add_from_object): Call define_default_version.
13460 (Symbol_table::define_special_symbol): Add resolve_oldsym
13461 parameter. Change all callers. If the version for a symbol comes
13462 from a version script, resolve it with the symbol with the same
13463 name with no version. Also add the symbol without a version if
13464 appropriate.
13465 (do_define_in_output_data): If resolving with oldsym, don't delete
13466 sym.
13467 (do_define_in_output_segment): Likewise.
13468 (do_define_as_constant): Likewise.
13469 * symtab.h (class Symbol_table): Update declarations.
13470
f1ed28fb
ILT
134712009-03-13 Ian Lance Taylor <iant@google.com>
13472
15f8229b
ILT
13473 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13474 (Read_symbols::requeue): New function.
13475 (Read_symbols::do_read_symbols): If make_elf_object fails because
13476 the target type is not configured, and the file was searched for,
13477 issue a warning and retry with the next directory.
13478 (Add_symbols::run): If the file has an incompatible format, and
13479 it was searched for, requeue the Read_symbols task. On error,
13480 release the object.
13481 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13482 dirindex parameter to constructor. Change all callers. Declare
13483 incompatible_warning and requeue.
13484 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13485 input_argument_ and input_group_ fields. Add them to
13486 constructor. Change all callers.
13487 (class Read_script): Add dirindex_ field. Add it to constructor.
13488 Change all callers.
13489 * archive.cc (Archive::setup): Remove input_objects parameter.
13490 Change all callers.
13491 (Archive::get_file_and_offset): Likewise.
13492 (Archive::read_all_symbols): Likewise.
13493 (Archive::read_symbols): Likewise.
13494 (Archive::get_elf_object_for_member): Remove input_objects
13495 parameter. Add punconfigured parameter. Change all callers.
13496 (Archive::add_symbols): Change return type to bool. Check return
13497 value of include_member.
13498 (Archive::include_all_members): Likewise.
13499 (Archive::include_member): Change return type to bool. Return
13500 false if first included object has incompatible target. Set
13501 included_member_ field.
13502 (Add_archive_symbols::run): If add_symbols returns false, requeue
13503 Read_symbols task.
13504 * archive.h (class Archive): Add included_member_ field.
13505 Initialize it in constructor. Add input_file and searched_for
13506 methods. Update declarations.
13507 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13508 input_argument_ fields. Add them to constructor. Change all
13509 callers.
13510 * script.cc: Include "target-select.h".
13511 (class Parser_closure): Add skip_on_incompatible_target_ and
13512 found_incompatible_target_ fields. Add
13513 skip_on_incompatible_target parameter to constructor. Change all
13514 callers. Add methods skip_on_incompatible_target,
13515 clear_skip_on_incompatible_target, found_incompatible_target, and
13516 set_found_incompatible_target.
13517 (read_input_script): Add dirindex parameter. Change all callers.
13518 If parser finds an incompatible target, requeue Read_symbols
13519 task.
13520 (script_set_symbol): Clear skip_on_incompatible_target in
13521 closure.
13522 (script_add_assertion, script_parse_option): Likewise.
13523 (script_start_sections, script_add_phdr): Likewise.
13524 (script_check_output_format): New function.
13525 * script.h (read_input_script): Update declaration.
13526 * script-c.h (script_check_output_format): Declare.
13527 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13528 (ignore_cmd): Remove OUTPUT_FORMAT.
13529 * fileread.cc (Input_file::Input_file): Add explicit this.
13530 (Input_file::will_search_for): New function.
13531 (Input_file::open): Add pindex parameter. Change all callers.
13532 * fileread.h (class Input_file): Add input_file_argument method.
13533 Declare will_search_for. Update declarations.
13534 * object.cc (make_elf_object): Add punconfigured parameter.
13535 Change all callers.
13536 * object.h (class Object): Make input_file public. Add
13537 searched_for method.
13538 (make_elf_object): Update declaration.
13539 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13540 restart search.
13541 * dirsearch.h (class Dirsearch): Update declaration.
13542 * options.h (class General_options): Add --warn-search-mismatch.
13543 * parameters.cc (Parameters::is_compatible_target): New function.
13544 * parameters.h (class Parameters): Declare is_compatible_target.
13545 * workqueue.cc (Workqueue::add_blocker): New function.
13546 * workqueue.h (class Workqueue): Declare add_blocker.
13547
f1ed28fb
ILT
13548 * fileread.cc (Input_file::open): Remove options parameter.
13549 Change all callers.
13550 (Input_file::open_binary): Likewise.
13551 * script.cc (read_input_script): Likewise.
13552 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13553 options parameter from constructor. Change all callers.
13554 (class Read_script): Likewise.
13555 * fileread.h (class Input_file): Update declarations.
13556 * script.h (read_input_script): Update declaration.
13557
34dd024a
NC
135582009-03-10 Nick Clifton <nickc@redhat.com>
13559
13560 * po/es.po: New Spanish translation.
13561
6d71b17c
CC
135622009-03-06 Cary Coutant <ccoutant@google.com>
13563
13564 * options.cc (parse_short_option): Keep dash_z from registering itself.
13565
031cdbed
ILT
135662009-03-03 Ian Lance Taylor <iant@google.com>
13567
13568 PR 9918
13569 * target-reloc.h (relocate_section): Pass output_section to
13570 relocate.
13571 * i386.cc (Target_i386::should_apply_static_reloc): Add
13572 output_section parameter. Change all callers.
13573 (Target_i386::Relocate::relocate): Add output_section parameter.
13574 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13575 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13576 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13577 * testsuite/two_file_shared.sh: New script.
13578 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13579 (check_DATA): Add two_file_shared.dbg.
13580 (two_file_shared.dbg): New target.
13581 * testsuite/Makefile.in: Rebuild.
13582
15d5fa16
ILT
135832009-03-01 Ian Lance Taylor <iant@google.com>
13584
13585 * configure.ac: Check for byteswap.h.
13586 * configure: Rebuild.
13587 * config.in: Rebuild.
13588
8a4c0b0d
ILT
135892009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13590
13591 * layout.cc (Layout::find_or_add_kept_section): New function.
13592 (Layout::add_comdat): Removed.
13593 * layout.h (struct Kept_section): Move out of class Layout.
13594 Remove trailing underscores from field names. Add group_sections
13595 field. Rename group_ field to is_group. Change all uses.
13596 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13597 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13598 comdat_groups_ field.
13599 (Sized_relobj::include_section_group): Use
13600 find_or_add_kept_section and Kept_section::group_sections.
13601 (Sized_relobj::include_linkonce_section): Likewise.
13602 * object.cc (class Sized_relobj): Don't define Comdat_group or
13603 Comdat_group_table. Remove find_comdat_group and
13604 add_comdat_group. Remove comdat_groups_ field.
13605 * plugin.cc (include_comdat_group): Use
13606 Layout::find_or_add_kept_section.
13607
b4ecf66b
ILT
136082009-02-28 Ian Lance Taylor <iant@google.com>
13609
14359ca0
ILT
13610 * README: --gc-sections and map files are now supported. Document
13611 some build requirements.
13612
b4ecf66b
ILT
13613 PR 6992
13614 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13615 relocatable link set the value of the section symbol to zero.
13616 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13617 relocatable link don't include the section address in the local
13618 symbol value.
13619
0602e05a
ILT
136202009-02-27 Ian Lance Taylor <iant@google.com>
13621
fd9d194f
ILT
13622 PR 6811
13623 * options.h (class Search_directory): Add is_system_directory.
13624 (class General_options): Declare is_in_system_directory.
13625 * options.cc (get_relative_sysroot): Make static.
13626 (get_default_sysroot): Make static.
13627 (General_optoins::is_in_system_directory): New function.
13628 * fileread.cc (Input_file::is_in_system_directory): New function.
13629 * fileread.h (class Input_file): Declare is_in_system_directory.
13630 * object.h (class Object): Add is_in_system_directory.
13631 (class Input_objects): Remove system_library_directory_ field.
13632 * object.cc (Input_objects::add_object): Don't set
13633 system_library_directory_.
13634 (input_objects::found_in_system_library_directory): Remove.
13635 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13636 parameter. Change all callers.
13637 (Symbol_table::sized_write_globals): Likewise.
13638 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13639 Call Object::is_in_system_directory.
13640 * symtab.h (class Symbol_table): Update declarations.
13641
61edd21f
ILT
13642 PR 5990
13643 * descriptors.h (Open_descriptor): Add is_on_stack field.
13644 * descriptors.cc (Descriptors::open): If the descriptor is on the
13645 top of the stack, remove it. Initialize is_on_stack field.
13646 (Descriptors::release): Only add pod to stack if it is not on the
13647 stack already.
13648 (Descriptors::close_some_descriptor): Clear stack_next and
13649 is_on_stack fields.
13650
e29e076a
ILT
13651 PR 7091
13652 * output.cc (Output_section::find_starting_output_address): Rename
13653 from starting_output_address; add PADDR parameter; change return
13654 type.
13655 * output.h (class Output_section): Declare
13656 find_starting_output_address instead of starting_output_address.
13657 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13658 section symbol for which we can't find a merge section.
13659
0602e05a
ILT
13660 PR 9836
13661 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13662 hidden or internal, force the symbol to be local.
13663 * resolve.cc (Symbol::override_visibility): Define.
13664 (Symbol::override_base): Use override_visibility.
13665 (Symbol_table::resolve): Likewise.
13666 (Symbol::override_base_with_special): Likewise.
13667 (Symbol_table::override_with_special): If the visibility is hidden
13668 or internal, force the symbol to be local.
13669 * symtab.h (class Symbol): Add set_visibility and
13670 override_visibility.
13671 * testsuite/ver_test_1.sh: New file.
13672 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13673 (check_DATA): Add ver_test_1.syms.
13674 (ver_test_1.syms): New target.
13675 * testsuite/Makefile.in: Rebuild.
13676
401a9a73
CC
136772009-02-25 Cary Coutant <ccoutant@google.com>
13678
13679 * layout.cc (Layout::choose_output_section): Don't rename sections
13680 when using a linker script that has a SECTIONS clause.
13681 * Makefile.in: Regenerate.
13682
13683 * testsuite/Makefile.am (script_test_5.sh): New test case.
13684 * testsuite/Makefile.in: Regenerate.
13685 * testsuite/script_test_5.cc: New file.
13686 * testsuite/script_test_5.sh: New file.
13687 * testsuite/script_test_5.t: New file.
13688
f488e4b0
CC
136892009-02-13 Rafael Avila de Espindola <espindola@google.com>
13690
13691 * archive.cc (Archive::include_member): Update calls to add_symbols.
13692 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13693 the Layout argument.
13694 * dynobj.h (do_add_symbols): Add the Layout argument.
13695 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13696 Layout argument.
13697 * object.h (Object::add_symbols): Add the Layout argument.
13698 (Object::do_add_symbols): Add the Layout argument.
13699 (Sized_relobj::do_add_symbols): Add the Layout argument.
13700 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13701 Unify the two versions.
13702 (Add_plugin_symbols): Remove.
13703 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13704 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13705 (Add_plugin_symbols): Remove.
13706 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13707 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13708 (Add_symbols::run): Make it work with Pulginobj.
13709
89dd1680
ILT
137102009-02-06 Ian Lance Taylor <iant@google.com>
13711
13712 * object.cc (Sized_relobj::do_layout): Make info message start
13713 with lower case letter.
13714
266d0a74
ILT
137152009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13716
602b464e
ILT
13717 * binary.cc: Fix file comment.
13718
266d0a74
ILT
13719 * options.h (enum Incremental_disposition): Define.
13720 (class General_options): Add new options: --incremental,
13721 --incremental_changed, --incremental_unchanged,
13722 --incremental_unknown. Add incremental_disposition_ and
13723 implicit_incremental_ fields.
13724 (General_options::incremental_disposition): New function.
13725 (class Position_dependent_options): Add incremental_disposition
13726 option.
13727 (Position_dependent_options::copy_from_options): Set incremental
13728 dispositions.
13729 * options.cc (General_options::parse_incremental_changed): New
13730 function.
2e702c99
RM
13731 (General_options::parse_incremental_unchanged): New function.
13732 (General_options::parse_incremental_unknown): New function.
13733 (General_options::General_options): Initialize new fields
266d0a74 13734 incremental_disposition_ and implicit_incremental_.
2e702c99 13735 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13736 without --incremental.
13737
f073bbf7
CD
137382009-02-06 Chris Demetriou <cgd@google.com>
13739
13740 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13741 pointer and to report location as the file name associated with
13742 the symbol.
13743 (gold_undefined_symbol_at_location): New function to replace the
13744 old gold_undefined_symbol functionality.
13745 * target-reloc.h (relocate_section): Update to use
13746 gold_undefined_symbol_at_location.
13747 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13748 Call gold_undefined_symbol function rather than gold_error.
13749 * errors.h (Errors::undefined_symbol): Take location as a
13750 string, rather than calculating it from a relocation.
13751 * errors.cc (Errors::fatal): Print "fatal error:" before the
13752 formatted message.
13753 (Errors::error, Errors::error_at_location): Print "error: "
13754 before the formatted message.
13755 (Errors::undefined_symbol): Take location as a string, rather
13756 than calculating it from a relocation.
13757 (gold_undefined_symbol_at_location): New function akin to
13758 old gold_undefined_symbol, calculates location from relocation.
13759 (gold_undefined_symbol): Change to take only a Symbol pointer
13760 and to report location as the file name associated with the symbol.
13761 * testsuite/debug_msg.sh: Update for changed error messages.
13762 * testsuite/undef_symbol.sh: Likewise.
13763
8e94a90c
ILT
137642009-02-04 Duncan Sands <baldrick@free.fr>
13765
13766 PR 9812
13767 * reduced_debug_output.h
13768 (Output_reduced_debug_abbrev_section::failed): Use format for
13769 gold_warning.
13770 (Output_reduced_debug_info_section::faild): Likewise.
13771
88a0e15b
ILT
137722009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13773
13774 * script.cc (Lazy_demangler): New class.
2e702c99 13775 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13776 symbol only once.
13777
5efc7cd2
CC
137782009-01-29 Cary Coutant <ccoutant@google.com>
13779
13780 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13781 to __tls_get_addr.
13782 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13783
e0ebcf42
ILT
137842009-01-28 Ian Lance Taylor <iant@google.com>
13785
5efc7cd2 13786 * version.cc (version_string): Bump to 1.9.
75fe7426 13787
e0ebcf42
ILT
13788 * gold.h: Include <cstring> and <stdint.h>.
13789 * version.cc: Include <cstdio>.
13790 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13791 warning.
13792 * reduced_debug_output.cc (insert_into_vector): Rename from
13793 Insert_into_vector; change all callers. Use Swap_unaligned to
13794 avoid aliasing issue; remove union since it is unnecessary.
13795
8e2813be 137962009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13797
13798 * Makefile.am (CCFILES): Add gc.cc.
13799 (HFILES): Add gc.h.
13800 * Makefile.in: Regenerate.
13801 * gold.cc (Gc_runner): New class.
13802 (queue_initial_tasks): Call garbage collection related tasks
13803 when corresponding options are invoked.
13804 (queue_middle_gc_tasks): New function.
13805 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13806 processed early before laying out sections during garbage collection.
13807 * gold.h (queue_middle_gc_tasks): New function.
13808 (is_prefix_of): Move from "layout.cc".
13809 * i386.cc (Target_i386::gc_process_relocs): New function.
13810 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13811 * main.cc (main): Create object of class "Garbage_collection".
13812 * object.cc (Relobj::copy_symbols_data): New function.
13813 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13814 (Sized_relobj::do_layout): Allow this function to be called twice
13815 during garbage collection and defer layout of section during the
6d03d481
ST
13816 first call.
13817 * object.h (Relobj::get_symbols_data): New function.
13818 (Relobj::is_section_name_included): New function.
13819 (Relobj::copy_symbols_data): New function.
13820 (Relobj::set_symbols_data): New function.
13821 (Relobj::get_relocs_data): New function.
13822 (Relobj::set_relocs_data): New function.
13823 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13824 (Relobj::gc_process_relocs): New function.
13825 (Relobj::do_gc_process_relocs): New pure virtual function.
13826 (Relobj::sd_): New data member.
13827 (Sized_relobj::is_output_section_offset_invalid): New function.
13828 (Sized_relobj::do_gc_process_relocs): New function.
13829 * options.h (General_options::gc_sections): Modify to not be a no-op.
13830 (General_options::print_gc_sections): New option.
13831 * plugin.cc (Plugin_finish::run): Remove function call to
13832 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13833 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13834 * reloc.cc (Read_relocs::run): Add task to process relocs and
13835 determine unreferenced sections when doing garbage collection.
13836 (Gc_process_relocs): New class.
13837 (Sized_relobj::do_gc_process_relocs): New function.
13838 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13839 sections that are garbage collected.
13840 * reloc.h (Gc_process_relocs): New class.
13841 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13842 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13843 symbols whose corresponding sections are garbage collected.
13844 (Symbol_table::Symbol_table): Add new parameter for the garbage
13845 collection object.
13846 (Symbol_table::gc_mark_undef_symbols): New function.
13847 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13848 (Symbol_table::gc_mark_dyn_syms): New function.
13849 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13850 as garbage.
13851 (Symbol_table::add_from_object): Likewise.
13852 (Symbol_table::add_from_relobj): When building shared objects, do not
13853 treat externally visible symbols as garbage.
13854 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13855 table information for static and relocatable links.
13856 * symtab.h (Symbol_table::set_gc): New function.
13857 (Symbol_table::gc): New function.
13858 (Symbol_table::gc_mark_undef_symbols): New function.
13859 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13860 (Symbol_table::gc_mark_dyn_syms): New function.
13861 (Symbol_table::gc_): New data member.
e1df38aa 13862 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13863 function.
13864 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13865 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13866
3b293544
CF
138672009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13868
13869 * options.h (General_options::gc_sections): Define as a no-op for now.
13870 (General_options::no_keep_memory): Ditto.
13871 (General_options::Bshareable): Define.
13872 * options.cc (General_options::finalize): Honor -Bshareable.
13873
83d22aa8
AS
138742009-01-20 Andreas Schwab <schwab@suse.de>
13875
13876 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13877 read the value in the contents, since we don't use it. Use the
13878 template endianness when writing.
13879 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13880
cd536b21
AS
138812009-01-19 Andreas Schwab <schwab@suse.de>
13882
13883 * configure.tgt (powerpc64-*): Fix targ_obj.
13884
99e9a495
ILT
138852009-01-15 Ian Lance Taylor <iant@google.com>
13886
13887 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13888 local symbols when stripping all symbols.
13889
bbbfea06
CC
138902009-01-14 Cary Coutant <ccoutant@google.com>
13891
99e9a495 13892 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13893
0f7c0701
CC
138942009-01-14 Cary Coutant <ccoutant@google.com>
13895
13896 * archive.cc (Archive::get_elf_object_for_member): Remove call
13897 to File_read::claim_for_plugin.
13898 * descriptors.cc (Descriptors::open): Remove reference to
13899 is_claimed.
13900 (Descriptors::claim_for_plugin): Remove.
13901 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13902 (Descriptors::is_claimed): Remove.
13903 (claim_descriptor_for_plugin): Remove.
13904 * fileread.cc (File_read::claim_for_plugin): Remove.
13905 * fileread.h (File_read::claim_for_plugin): Remove.
13906 (File_read::descriptor): Reopen descriptor if necessary.
13907 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13908 (Plugin_manager::all_symbols_read): Add task parameter. Change
13909 all callers.
13910 (Plugin_manager::get_input_file): New function.
13911 (Plugin_manager::release_input_file): New function.
13912 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13913 corresponding data member.
13914 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13915 and pass to base constructor. Change all callers.
13916 (get_input_file, release_input_file): New functions.
13917 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13918 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13919 (Plugin_manager::all_symbols_read): Add task parameter.
13920 (Plugin_manager::get_input_file): New function.
13921 (Plugin_manager::release_input_file): New function.
13922 (Plugin_manager::task_): New data member.
13923 (Pluginobj::Pluginobj): Add filesize parameter.
13924 (Pluginobj::filename): New function.
13925 (Pluginobj::descriptor): New function.
13926 (Pluginobj::filesize): New function.
13927 (Pluginobj::filesize_): New data member.
13928 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13929 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13930 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13931
13932 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13933 with archive libraries.
13934 * testsuite/Makefile.in: Regenerate.
13935 * testsuite/plugin_test.c (struct sym_info): New type.
13936 (get_input_file, release_input_file): New static variables.
13937 (onload): Capture new transfer vector entries.
13938 (claim_file_hook): Stop reading at end of file according to filesize.
13939 Factor out parsing of readelf output into separate function.
13940 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13941 APIs and get the source file name from the symbol table. Convert
13942 source file name to corresponding object file name. Print info
13943 message when adding new input files.
13944 (parse_readelf_line): New function.
13945 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13946 * testsuite/plugin_test_2.sh: Likewise.
13947 * testsuite/plugin_test_3.sh: Likewise.
13948 * testsuite/plugin_test_4.sh: New test case.
13949
62a6d109
ILT
139502009-01-07 Ian Lance Taylor <iant@google.com>
13951
13952 * version.cc (version_string): Bump to 1.8.
13953
483620e8
CC
139542008-12-23 Cary Coutant <ccoutant@google.com>
13955
13956 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13957 * plugin.cc (Plugin_manager::finish): Rename as
13958 layout_deferred_objects. Move cleanup to separate function.
13959 (Plugin_manager::cleanup): New function.
13960 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13961 separately.
13962 * plugin.h (Plugin_manager::finish): Rename as
13963 layout_deferred_objects.
13964 (Plugin_manager::cleanup): New function.
13965 (Plugin_manager::cleanup_done): New field.
13966
d66a9eb3
CC
139672008-12-23 Cary Coutant <ccoutant@google.com>
13968
13969 * plugin.cc (is_visible_from_outside): New function.
13970 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13971 so we don't return "IR only" status for exported symbols or -r links.
13972
13973 * testsuite/Makefile.am (plugin_test_3): New test case.
13974 * testsuite/Makefile.in: Regenerate.
13975 * testsuite/plugin_test_3.sh: New file.
13976
5995b570
CC
139772008-12-22 Cary Coutant <ccoutant@google.com>
13978
13979 * object.cc (Sized_relobj::layout_section): New function.
13980 (Sized_relobj::do_layout): Defer layout of input sections until after
13981 plugin has provided replacement files.
13982 (Sized_relobj::do_layout_deferred_sections): New function.
13983 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13984 (Relobj::layout_deferred_sections): New function.
13985 (Relobj::do_layout_deferred_sections): New function.
13986 (Sized_relobj::do_layout_deferred_sections): New function.
13987 (Sized_relobj::layout_section): New function.
13988 (Sized_relobj::Deferred_layout): New structure.
13989 (Sized_relobj::deferred_layout_): New field.
13990 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13991 Change all callers. Layout deferred sections.
13992 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13993 references.
13994 (Plugin_hook::run): Move code from do_plugin_hook inline.
13995 (Plugin_hook::do_plugin_hook): Remove.
13996 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13997 (Plugin_manager::finish): Renamed, was cleanup.
13998 (Plugin_manager::should_defer_layout): New function.
13999 (Plugin_manager::add_deferred_layout_object): New function.
14000 (Plugin_manager::Deferred_layout_list): New type.
14001 (Plugin_manager::deferred_layout_objects_): New field.
14002 (Plugin_hook::do_plugin_hook): Remove.
14003
ee769c88
ILT
140042008-12-17 Ian Lance Taylor <iant@google.com>
14005
14006 * options.h (class General_options): Add --no case for
14007 --export-dynamic.
14008
abc8dcba
CC
140092008-12-16 Cary Coutant <ccoutant@google.com>
14010
14011 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14012 vector.
14013 (Plugin_manager::claim_file): Create plugin object even if
14014 plugin did not call the add_symbols callback.
14015 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14016 asking for more symbols than were added.
14017 * testsuite/Makefile.am (plugin_test_1): Add test case with
14018 no global symbols.
14019 (empty.syms): New target.
14020 * testsuite/Makefile.in: Regenerate.
14021 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14022 message. Don't call add_symbols if no globals.
14023 (all_symbols_read_hook): Don't provide replacement for empty
14024 claimed file.
14025
b0074644
ILT
140262008-12-12 Ian Lance Taylor <iant@google.com>
14027
68943102
ILT
14028 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14029 r_type == 0 for a local symbol with r_sym == 0.
14030 (scan_relocatable_relocs): Pass r_sym to
14031 local_non_section_strategy.
14032 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14033 r_sym parameter.
14034
b0074644
ILT
14035 * configure.ac: Update test for TLS descriptors: they are
14036 supported as of glibc 2.9.
14037 * configure: Rebuild.
14038
c2508178
ILT
140392008-12-11 Ian Lance Taylor <iant@google.com>
14040
14041 PR 7091
14042 * target-reloc.h (Default_scan_relocatable_relocs): For each
14043 function, map r_type == 0 to RELOC_DISCARD.
14044
2756a258
CC
140452008-12-10 Cary Coutant <ccoutant@google.com>
14046
14047 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14048 object to override a kept COMDAT group from a plugin object.
14049
bb6f53d3
ILT
140502008-12-09 Ian Lance Taylor <iant@google.com>
14051
fbc558e1
ILT
14052 PR 7088
14053 * yyscript.y (file_cmd): Handle INPUT.
14054
bb6f53d3
ILT
14055 * testsuite/initpri1.c: Change all declarations to be full
14056 prototypes by adding void, to avoid compiler warnings.
14057
4674ecfc
CC
140582008-12-05 Rafael Avila de Espindola <espindola@google.com>
14059
14060 * options.cc (General_options::parse_plugin_opt): New.
14061 (General_options::add_plugin): The argument now is just the filename.
14062 (General_options::add_plugin_option): New.
14063 * options.h (plugin_opt): New.
14064 (add_plugin): Change argument name.
14065 (add_plugin_option): New.
14066 * plugin.cc (Plugin::load): Don't parse the plugin option.
14067 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14068 (Plugin::add_option): New.
14069 (Plugin::args_): Change type.
14070 (Plugin::filename_): New.
14071 (Plugin_manager::add_plugin_option): New.
14072 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14073 * testsuite/Makefile.in: Regenerate.
14074
fd06b4aa
CC
140752008-12-05 Cary Coutant <ccoutant@google.com>
14076
14077 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14078 Handle --strip-lto-sections option.
14079 * options.h (strip_lto_sections): New option.
14080
6c52134c
CC
140812008-12-01 Cary Coutant <ccoutant@google.com>
14082
14083 * plugin.cc (ld_plugin_message): Change format parameter to const.
14084 Fix mismatch between new[] and delete.
14085
a45248e0
CC
140862008-11-14 Cary Coutant <ccoutant@google.com>
14087
14088 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14089 instead of -1U.
14090
c82fbeee
CS
140912008-11-05 Craig Silverstein <csilvers@google.com>
14092
14093 * options.cc (General_options::parse_dynamic_list): New function.
14094 * options.h (General_options): New flags dynamic_list,
14095 dynamic_list_data, dynamic_list_cpp_new, and
14096 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14097 (General_options::in_dynamic_list): New function.
14098 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14099 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14100 (Lex::can_continue_name): Likewise.
14101 (yylex): Likewise.
14102 (read_script_file): New parameter script_options.
14103 (read_dynamic_list): New function.
14104 (Script_options::define_dynamic_list): New function.
14105 (dynamic_list_keyword_parsecodes): New variable.
14106 (dynamic_list_keywords): New variable.
14107 * script.h (Script_options::define_dynamic_list): New function
14108 prototype.
14109 (read_dynamic_list): New function prototype.
14110 * symtab.cc (strprefix): New macro.
14111 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14112 dynamic_list_data, dynamic_list_cpp_new, and
14113 dynamic_list_cpp_typeinfo.
14114 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14115 (dynamic_list_expr): New rule.
14116 (dynamic_list_nodes): Likewise.
14117 (dynamic_list_node): Likewise.
14118 * testsuite/Makefile.am (dynamic_list): New test.
14119 * testsuite/Makefile.in: Regenerated.
14120 * testsuite/dynamic_list.t: New file.
14121 * testsuite/dynamic_list.sh: New file.
14122
e0bb29a5
CS
141232008-11-05 Craig Silverstein <csilvers@google.com>
14124
14125 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14126 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14127 (t11_last): Likewise.
14128 * testsuite/ver_test_6.c (main): Likewise.
14129
4e1e25e0
CC
141302008-10-07 Cary Coutant <ccoutant@google.com>
14131
14132 * options.c (General_options::finalize): Add check for -static and
14133 -shared.
14134 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14135 is not empty.
14136
92f03fcb
CC
141372008-10-02 Cary Coutant <ccoutant@google.com>
14138
14139 * plugin.cc (make_sized_plugin_object): Fix conditional
14140 compilation to work when not all targets are enabled.
14141
fbd8a257
CC
141422008-09-29 Cary Coutant <ccoutant@google.com>
14143
14144 * archive.cc (Archive::get_file_and_offset): Use filename instead
14145 of name to get library path.
14146 (Archive::include_member): Unlock external member of a thin archive.
14147
14148 * testsuite/Makefile.am (TEST_AR): New variable.
14149 (thin_archive_test_1): New test.
14150 (thin_archive_test_2): New test.
81636b3f
CC
14151 * testsuite/Makefile.in: Regenerate.
14152 * testsuite/thin_archive_main.cc: New file.
14153 * testsuite/thin_archive_test_1.cc: New file.
14154 * testsuite/thin_archive_test_2.cc: New file.
14155 * testsuite/thin_archive_test_3.cc: New file.
14156 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14157
eff45813
CC
141582008-09-29 Cary Coutant <ccoutant@google.com>
14159
14160 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14161 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14162 instead of -1U.
14163 (Sized_relobj::do_finalize_local_symbols): Likewise.
14164 (Sized_relobj::map_to_kept_section): Likewise.
14165 * object.h (Sized_relobj::invalid_address): New constant.
14166 (Sized_relobj::do_output_section_offset): Check for invalid_address
14167 and return -1ULL.
14168 * output.cc (Output_reloc::local_section_offset): Use constant
14169 invalid_address instead of -1U.
14170 (Output_reloc::get_address): Likewise.
14171 (Output_section::output_address): Change -1U to -1ULL.
14172 * output.h (Output_reloc::invalid_address): New constant.
14173 * reloc.cc (Sized_relobj::write_sections): Use constant
14174 invalid_address instead of -1U.
14175 (Sized_relobj::relocate_sections): Likewise.
14176 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14177 values for merge sections.
14178 * target-reloc.h (relocate_for_relocatable): Use constant
14179 invalid_address instead of -1U.
14180
89fc3421
CC
141812008-09-19 Cary Coutant <ccoutant@google.com>
14182
14183 Add plugin functionality for link-time optimization (LTO).
14184 * configure.ac (plugins): Add --enable-plugins option.
14185 * configure: Regenerate.
14186 * config.in: Regenerate.
14187 * Makefile.am (LIBDL): New variable.
14188 (CCFILES): Add plugin.cc.
14189 (HFILES): Add plugin.h.
14190 (ldadd_var): Add LIBDL.
14191 * Makefile.in: Regenerate.
14192
14193 * archive.cc: Include "plugin.h".
14194 (Archive::setup): Don't preread archive symbols when using a plugin.
14195 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14196 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14197 files.
14198 (Archive::include_member): Add symbols from plugin objects.
14199 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14200 * descriptors.cc (Descriptors::open): Check for file descriptors
14201 abandoned by plugins.
14202 (Descriptors::claim_for_plugin): New function.
14203 * descriptors.h (Descriptors::claim_for_plugin): New function.
14204 (Open_descriptor::is_claimed): New field.
14205 (claim_descriptor_for_plugin): New function.
14206 * fileread.cc (File_read::claim_for_plugin): New function.
14207 * fileread.h (File_read::claim_for_plugin): New function.
14208 (File_read::descriptor): New function.
14209 * gold.cc: Include "plugin.h".
14210 (queue_initial_tasks): Add task to call plugin hooks for generating
14211 new object files.
14212 * main.cc: Include "plugin.h".
14213 (main): Load plugin libraries.
14214 * object.h (Pluginobj): Declare.
14215 (Object::pluginobj): New function.
14216 (Object::do_pluginobj): New function.
14217 (Object::set_target): New function.
14218 * options.cc: Include "plugin.h".
14219 (General_options::parse_plugin): New function.
14220 (General_options::General_options): Initialize plugins_ field.
14221 (General_options::add_plugin): New function.
14222 * options.h (Plugin_manager): Declare.
14223 (General_options): Add --plugin option.
14224 (General_options::has_plugins): New function.
14225 (General_options::plugins): New function.
14226 (General_options::add_plugin): New function.
14227 (General_options::plugins_): New field.
14228 * plugin.cc: New file.
14229 * plugin.h: New file.
14230 * readsyms.cc: Include "plugin.h".
14231 (Read_symbols::do_read_symbols): Check for archive before checking
14232 for ELF file. Call plugin hooks to claim files.
14233 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14234 from a real object file; force override when processing replacement
14235 files.
14236 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14237 (Symbol::init_base_object): Likewise.
14238 (Symbol::init_base_output_data): Likewise.
14239 (Symbol::init_base_output_segment): Likewise.
14240 (Symbol::init_base_constant): Likewise.
14241 (Symbol::init_base_undefined): Likewise.
14242 (Symbol::output_section): Assert that object is not a plugin.
14243 (Symbol_table::add_from_pluginobj): New function.
14244 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14245 undefined.
14246 (Symbol_table::sized_write_globals): Likewise.
14247 (Symbol_table::add_from_pluginobj): Instantiate template.
14248 * symtab.h (Sized_pluginobj): Declare.
14249 (Symbol::in_real_elf): New function.
14250 (Symbol::set_in_real_elf): New function.
14251 (Symbol::in_real_elf_): New field.
14252 (Symbol_table::add_from_pluginobj): New function.
14253
14254 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14255 (LIBDL): New variable.
14256 (LDADD): Add LIBDL.
14257 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14258 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14259 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14260 (MOSTLYCLEANFILES): Likewise.
14261 * testsuite/Makefile.in: Regenerate.
14262 * testsuite/plugin_test.c: New file.
14263 * testsuite/plugin_test_1.sh: New file.
14264 * testsuite/plugin_test_2.sh: New file.
14265
de31bda5
ILT
142662008-09-16 Ian Lance Taylor <iant@google.com>
14267
9c2d0ef9
ILT
14268 * target-reloc.h (relocate_section): Check whether a symbol is
14269 defined by the ABI before reporting an undefined symbol error.
14270 * target.h (Target::is_defined_by_abi): Make parameter const.
14271 (Target::do_is_defined_by_abi): Likewise.
14272 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14273 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14274 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14275 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14276 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14277 * testsuite/Makefile.in: Rebuild.
14278
de31bda5
ILT
14279 * fileread.cc (make_view): Add casts to avoid warning.
14280
9fa33bee
AO
142812008-09-16 Alexandre Oliva <aoliva@redhat.com>
14282
14283 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14284 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14285
183fd0e3
AO
142862008-09-16 Alexandre Oliva <aoliva@redhat.com>
14287
14288 * options.h (General_options::output_is_executable): New.
14289 (General_options::output_is_pie): New.
14290 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14291 for shared libraries.
14292 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14293
7be8330a
CD
142942008-09-11 Chris Demetriou <cgd@google.com>
14295
14296 * options.h (origin): New -z option.
14297 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14298 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14299 in DT_FLAGS_1.
14300
a9caad02
CC
143012008-09-05 Cary Coutant <ccoutant@google.com>
14302
14303 * fileread.cc (File_read::make_view): Add check for attempt to map
14304 beyond end of file.
14305
ae6dce4d
CC
143062008-09-05 Cary Coutant <ccoutant@google.com>
14307
14308 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14309 explicit instantiations.
14310
d7ab2a47
KVH
143112008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14312
14313 PR gold/6858
14314 * options.cc (General_options::finalize): Allow undefined symbols
14315 in shlibs if linking -shared.
14316
14317 PR gold/6859
14318 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14319 symbols as not needing a dynsym entry.
14320
1e52a9c1
CS
143212008-08-20 Craig Silverstein <csilvers@google.com>
14322
14323 * fileread.cc (File_read::open): Do not lock the file unless it
14324 was successfully opened.
14325
d85c80a3
CC
143262008-08-14 Cary Coutant <ccoutant@google.com>
14327
14328 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14329 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14330 * testsuite/tls_test.cc (struct int128): 128-bit struct
14331 for testing TLS relocs with non-zero addend.
14332 (v12): New TLS variable.
14333 (t12): New test.
14334 (t_last): Add check for v12.
14335 * testsuite/tls_test.h (t12): New function.
14336 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14337
2d924fd9
ILT
143382008-08-13 Ian Lance Taylor <iant@google.com>
14339
14340 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14341 set tls_segment_ or relro_segment_.
14342 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14343 when appropriate.
14344 * output.h (Output_section::clear_is_relro): New function.
14345 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14346 sections specially even when output_data_ is empty.
14347 (Output_segment::maximum_alignment): When first section is relro,
14348 only force alignment for PT_LOAD segments.
14349 * script.cc (script_data_segment_align): New function.
14350 (script_data_segment_relro_end): New function.
14351 * script-c.h (script_data_segment_align): Declare.
14352 (script_data_segment_relro_end): Declare.
14353 * script-sections.h (class Script_sections): Declare
14354 data_segment_align and data_segment_relro_end. Add fields
14355 segment_align_index_ and saw_relro_end_.
14356 * script-sections.cc (class Sections_element): Add set_is_relro
14357 virtual function. Add new bool* parameter to place_orphan_here.
14358 Add get_output_section virtual function.
14359 (class Output_section_definition): Add set_is_relro. Add new
14360 bool* parameter to place_orphan_here. Add get_output_section.
14361 Add is_relro_ field.
14362 (Output_section_definition::Output_section_definition): Initialize
14363 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14364 and is_relro_ fields.
14365 (Output_section_definition::place_orphan_here): Add is_relro
14366 parameter.
14367 (Output_section_definition::set_section_addresses): Set relro for
14368 output section.
14369 (Output_section_definition::alternate_constraint): Likewise.
14370 (class Orphan_output_section): Add new bool* parameter to
14371 place_orphan_here. Add get_output_section.
14372 (Orphan_output_section::place_orphan_here): Add is_relro
14373 parameter.
14374 (Script_sections::Script_sections): Initialize
14375 data_segment_align_index_ and saw_relro_end_.
14376 (Script_sections::data_segment_align): New function.
14377 (Script_sections::data_segment_relro_end): New function.
14378 (Script_sections::place_orphan): Set or clear is_relro.
14379 (Script_sections::set_section_addresses): Force alignment of first
14380 TLS section.
14381 * yyscript.y (exp): Call script_data_segment_align and
14382 script_data_segment_relro_end.
14383 * testsuite/relro_script_test.t: New file.
14384 * testsuite/relro_test.cc (using_script): Declare.
14385 (t1, t2): Test using_script.
14386 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14387 (relro_script_test_SOURCES): Define.
14388 (relro_script_test_DEPENDENCIES): Define.
14389 (relro_script_test_LDFLAGS): Define.
14390 (relro_script_test_LDADD): Define.
14391 (relro_script_test.so): New target.
14392 * testsuite/Makefile.in: Rebuild.
14393
f827c9a9
CC
143942008-08-06 Cary Coutant <ccoutant@google.com>
14395
14396 * archive.cc (Archive::total_archives, Archive::total_members)
14397 (Archive::total_members_loaded): New variables.
14398 (Archive::setup): Add parameter. Add option to preread
14399 archive symbols.
14400 (Archive::read_armap): Add counter.
14401 (Archive::get_file_and_offset): New function.
14402 (Archive::get_elf_object_for_member): New function.
14403 (Archive::read_all_symbols): New function.
14404 (Archive::read_symbols): New function.
14405 (Archive::add_symbols): Add counters.
14406 (Archive::include_all_members): Use armap to find members if it's
14407 already built.
14408 (Archive::include_member): Skip reading symbols if already read.
14409 Factored code into Archive::get_file_and_offset and
14410 Archive::get_elf_object_for_member. Changed call to
14411 Mapfile::report_include_archive_member.
14412 (Archive::print_stats): New function.
14413 * archive.h: Declare Object and Read_symbols_data classes.
14414 (Archive::Archive): Add initializers for new members.
14415 (Archive::setup): Add parameter.
14416 (Archive::print_stats): New function.
14417 (Archive::total_archives, Archive::total_members)
14418 (Archive::total_members_loaded): New variables.
14419 (Archive::get_file_and_offset): New function.
14420 (Archive::get_elf_object_for_member): New function.
14421 (Archive::read_all_symbols): New function.
14422 (Archive::read_symbols): New function.
14423 (Archive::Archive_member): New class.
14424 (Archive::members_): New member.
14425 (Archive::num_members_): New member.
14426 * main.cc: Include archive.h.
14427 (main): Call Archive::print_stats.
14428 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14429 archive parameter; member_name is now the fully-decorated name.
14430 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14431 * options.h: (General_options): Add --preread-archive-symbols option.
14432 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14433 Archive::setup.
14434
de4c45bd
ILT
144352008-08-04 Ian Lance Taylor <iant@google.com>
14436
14437 * symtab.h (Symbol::use_plt_offset): New function.
14438 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14439 * powerpc.cc (Relocate::relocate): Likewise.
14440 * sparc.cc (Relocate::relocate): Likewise.
14441 * x86_64.cc (Relocate::relocate): Likewise.
14442 * testsuite/weak_plt.sh: New test.
14443 * testsuite/weak_plt_main.cc: New test.
14444 * testsuite/weak_plt_shared.cc: New test.
14445 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14446 (check_PROGRAMS): Add weak_plt.
14447 (check_DATA): Add weak_plt_shared.so.
14448 (weak_plt_main_pic.o, weak_plt): New targets.
14449 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14450 * testsuite/Makefile.in: Rebuild.
14451
14452 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14453 gcctestdir/ld.
14454 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14455 * testsuite/Makefile.in: Rebuild.
14456
323ee3f4
AM
144572008-08-04 Alan Modra <amodra@bigpond.net.au>
14458
14459 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14460 * Makefile.in: Regenerate.
14461 * po/POTFILES.in: Regenerate.
14462
7c07ecec
ILT
144632008-07-29 Ian Lance Taylor <iant@google.com>
14464
14465 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14466 symbols before other symbols.
14467 * testsuite/script_test_2.cc (test_addr): Declare.
14468 (test_addr_alias): Declare.
14469 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14470 values.
7c07ecec
ILT
14471 * testsuite/script_test_2.t: Define test_addr_alias and
14472 test_addr.
14473
5778530e
ILT
144742008-07-24 Ian Lance Taylor <iant@google.com>
14475
2a00e4fb
ILT
14476 PR 5990
14477 * descriptors.cc: New file.
14478 * descriptors.h: New file.
14479 * gold-threads.h (class Hold_optional_lock): New class.
14480 * fileread.cc: Include "descriptors.h".
14481 (File_read::~File_read): Release descriptor rather than closing
14482 it.
14483 (File_read::open) [file]: Call open_descriptor rather than open.
14484 Set is_descriptor_opened_.
14485 (File_read::open) [memory]: Assert that descriptor is not open.
14486 (File_read::reopen_descriptor): New function.
14487 (File_read::release): Release descriptor.
14488 (File_read::do_read): Make non-const. Reopen descriptor.
14489 (File_read::read): Make non-const.
14490 (File_read::make_view): Reopen descriptor.
14491 (File_read::do_readv): Likewise.
14492 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14493 Update declarations.
14494 * layout.cc: Include "descriptors.h".
14495 (Layout::create_build_id): Use open_descriptor rather than open.
14496 * output.cc: Include "descriptors.h".
14497 (Output_file::open): Use open_descriptor rather than open.
14498 * archive.cc (Archive::const_iterator): Change Archive to be
14499 non-const.
14500 (Archive::begin, Archive::end): Make non-const.
14501 (Archive::count_members): Likewise.
14502 * archive.h (class Archive): Update declarations.
14503 * object.h (Object::read): Make non-const.
14504 * Makefile.am (CCFILES): Add descriptors.cc.
14505 (HFILES): Add descriptors.h.
14506 * Makefile.in: Rebuild.
14507
801647d1
ILT
14508 PR 6716
14509 * gold.h: Always include <clocale>. Add Solaris workarounds
14510 following code in binutils/sysdep.h.
14511
5edd166e
ILT
14512 PR 6048
14513 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14514 this->eh_frame_hdr_ is NULL before using it.
14515
c89ad728
ILT
14516 * dynobj.cc (Versions::Versions): Update comment.
14517
aa86f06b
ILT
14518 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14519 the base version name.
14520
5778530e
ILT
14521 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14522 array size plus one.
14523 (Stringpool_template::set_string_offsets): Subtract one from key
14524 before using it as an array index.
14525 (Stringpool_template::get_offset_with_length): Likewise.
14526 (Stringpool_template::write_to_buffer): Likewise.
14527 * stringpool.h (Stringpool_template::get_offset_from_key):
14528 Likewise.
14529
057ead22
ILT
145302008-07-23 Ian Lance Taylor <iant@google.com>
14531
7f649c59
ILT
14532 PR 6658
14533 * object.h (Merged_symbol_value::value): Do our best to handle a
14534 negative addend.
14535
057ead22
ILT
14536 PR 6647
14537 * script.cc (Version_script_info::get_versions): Don't add empty
14538 version tag to return value.
14539 (Version_script_info::get_symbol_version_helper): Change return
14540 type to bool. Add pversion parameter. Change all callers.
14541 (script_register_vers_node): Don't require a non-NULL tag.
14542 * script.h (class Version_script_info): Update declarations.
14543 (Version_script_info::get_symbol_version): Change return type to
14544 bool. Add version parameter. Change all callers.
14545 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14546 handling. Handle an empty version from a version script.
14547 (Symbol_table::define_special_symbol): Likewise.
14548 * testsuite/ver_test_10.script: New file.
14549 * testsuite/ver_test_10.sh: New file.
14550 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14551 (check_DATA): Add ver_test_10.syms.
14552 (ver_test_10.syms, ver_test_10.so): New target.
14553 * testsuite/Makefile.in: Rebuild.
14554
58e54ac2
CD
145552008-07-23 Simon Baldwin <simonb@google.com>
14556
14557 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14558 to zero for undefined symbols from dynamic libraries.
14559
95d14cd3
ILT
145602008-07-23 Ian Lance Taylor <iant@google.com>
14561
14562 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14563 Change all callers.
14564 * symtab.h (class Symbol_table): Update declaration.
14565 * testsuite/ver_test_9.cc: New file.
14566 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14567 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14568 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14569 (ver_test_9.so, ver_test_9.o): New targets.
14570 * testsuite/Makefile.in: Rebuild.
14571
92de84a6
ILT
145722008-07-22 Ian Lance Taylor <iant@google.com>
14573
34810851
ILT
14574 * options.h (class General_options): Define --check-sections.
14575 * layout.cc (Layout::set_segment_offsets): Handle
14576 --check-sections.
14577
af6156ef
ILT
14578 * options.h (class General_options): Define -n/--nmagic and
14579 -N/--omagic.
14580 * options.cc (General_options::finalize): For -n/--nmagic or
14581 -N/--omagic, set -static.
14582 * layout.cc (Layout::attach_allocated_section_to_segment): If
14583 -N/--omagic, don't put read-only and read-write sections in
14584 different segments.
14585 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14586 finding a read-only segment.
14587 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14588 don't set the minimum segment alignment to the common page size,
14589 and don't set the file offset to the address modulo the page size.
14590 * script-sections.cc (Script_sections::create_segments): If
14591 -n/--omagic, don't put read-only and read-write sections in
14592 different segments.
14593
92de84a6
ILT
14594 * cref.cc: New file.
14595 * cref.h: New file.
14596 * options.h (class General_options): Add --print-symbol-counts.
14597 * main.cc (main): Issue defined symbol report if requested.
14598 * archive.cc (Archive::interpret_header): Make into a const member
14599 function.
14600 (Archive::add_symbols): Call Input_objects::archive_start and
14601 archive_stop.
14602 (Archive::const_iterator): Define new class.
14603 (Archive::begin, Archive::end): New functions.
14604 (Archive::include_all_members): Rewrite to use iterator.
14605 (Archive::count_members): New function.
14606 * archive.h (class Archive): Update declarations.
14607 (Archive::filename): New function.
14608 * object.cc: Include "cref.h".
14609 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14610 (Sized_relobj::do_get_global_symbol_counts): New function.
14611 (Input_objects::add_object): Add object to cross-referencer.
14612 (Input_objects::archive_start): New function.
14613 (Input_objects::archive_stop): New function.
14614 (Input_objects::print_symbol_counts): New function.
14615 * object.h: Declare Cref and Archive.
14616 (Object::get_global_symbol_counts): New function.
14617 (Object::do_get_global_symbol_counts): New pure virtual function.
14618 (class Sized_relobj): Add defined_count_ field. Update
14619 declarations.
14620 (class Input_objects): Add cref_ field. Update constructor.
14621 Update declarations.
14622 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14623 defined_count_.
14624 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14625 symbol counts.
14626 (Sized_dynobj::do_get_global_symbol_counts): New function.
14627 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14628 defined_count_. Update declarations. Define Symbols typedef.
14629 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14630 parameter. Change all callers.
14631 (Symbol_table::add_from_dynobj): Add sympointers and defined
14632 parameters. Change all callers.
14633 * symtab.h (class Symbol_table): Update declarations.
14634 * Makefile.am (CCFILES): Add cref.cc.
14635 (HFILES): Add cref.h.
14636 * Makefile.in: Rebuild.
14637
3f7c5e1d
CD
146382008-07-22 Simon Baldwin <simonb@google.com>
14639
14640 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14641 to zero when writing undefined symbols.
14642
e0b64032
ILT
146432008-07-22 Ian Lance Taylor <iant@google.com>
14644
14645 * output.cc (Output_section::add_input_section): Don't try to
14646 merge empty merge sections.
14647
096b02cf
CS
146482008-07-21 Craig Silverstein <csilvers@google.com>
14649
14650 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14651 Include symbol version in error message.
cd536b21 14652
1d1f116d
CD
146532008-07-20 Chris Demetriou <cgd@google.com>
14654
cd536b21 14655 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14656 (RANDOM_SEED_CFLAGS): New substituted variable.
14657 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14658 * configure: Rebuild.
14659 * Makefile.in: Likewise.
14660 * testsuite/Makefile.in: Likewise.
14661
a18f591e
ILT
146622008-07-18 Ian Lance Taylor <iant@google.com>
14663
14664 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14665 where we see NAME/NULL and NAME/VERSION as separate symbols.
14666 * testsuite/ver_test_main.cc (main): Call t4.
14667 (t4, t4_2a): Define.
14668 * testsuite/ver_test_2.cc (t4_2): Define.
14669 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14670 * testsuite/ver_test_4.cc (t4_2a): Define.
14671 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14672 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14673
c6e3f6ed
ILT
146742008-07-17 Ian Lance Taylor <iant@google.com>
14675
14676 * dynobj.cc (Versions::add_def): If we give an error about a
14677 missing version, go ahead and create the version anyhow.
14678
ef9beddf
ILT
146792008-07-10 Ian Lance Taylor <iant@google.com>
14680
14681 Handle output sections with more than 0x7fffffff bytes.
14682 * object.h (class Relobj): Change map_to_output_ to
14683 output_sections_, and just keep a section pointer. Change all
14684 uses. Move comdat group support to Sized_relobj.
14685 (Relobj::is_section_specially_mapped): Remove.
14686 (Relobj::output_section): Remove poff parameter. Change all
14687 callers.
14688 (Relobj::output_section_offset): New function.
14689 (Relobj::set_section_offset): Rewrite.
14690 (Relobj::map_to_output): Remove.
14691 (Relobj::output_sections): New function.
14692 (Relobj::do_output_section_offset): New pure virtual function.
14693 (Relobj::do_set_section_offset): Likewise.
14694 (class Sized_relobj): Add section_offsets_ field. Add comdat
14695 group support from Relobj. Update declarations.
14696 (Sized_relobj::get_output_section_offset): New function.
14697 (Sized_relobj::do_output_section_offset): New function.
14698 (Sized_relobj::do_set_section_offset): New function.
14699 * object.cc (Relobj::output_section_address): Remove.
14700 (Sized_relobj::Sized_relobj): Initialize new fields.
14701 (Sized_relobj::include_section_group): Cast find_kept_object to
14702 Sized_relobj.
14703 (Sized_relobj::include_linkonce_section): Likewise.
14704 (Sized_relobj::do_layout): Use separate arrays for output section
14705 and output offset.
14706 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14707 output_sections.
14708 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14709 output_sections and section_offsets.
14710 (Sized_relobj::write_local_symbols): Likewise.
14711 (map_to_kept_section): Compute output address directly.
14712 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14713 output_sections and section_offsets.
14714 (Sized_relobj::write_sections): Likewise.
14715 (Sized_relobj::relocate_sections): Likewise.
14716 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14717 * output.h (class Output_reloc): Update declarations. Change
14718 u2_.relobj to Sized_relobj*.
14719 (class Output_data_reloc): Change add functions to use
14720 Sized_relobj*.
14721 * output.cc (Output_reloc::Output_reloc): Change relobj to
14722 Sized_relobj*.
14723 (Output_reloc::local_section_offset): Change return type to
14724 Elf_Addr. Use get_output_section_offset.
14725 (Output_reloc::get_address): Likewise.
14726 (Output_section::is_input_address_mapped): Don't call
14727 is_section_specially_mapped.
14728 (Output_section::output_offset): Likewise.
14729 (Output_section::output_address): Likewise.
14730 (Output_section::starting_output_address): Likewise.
14731 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14732 parameter to Sized_relobj*.
14733 (Copy_relocs::need_copy_reloc): Likewise.
14734 (Copy_relocs::save): Likewise.
14735 * copy-relocs.h (class Copy_relocs): Update declarations.
14736 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14737 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14738 * target-reloc.h (relocate_for_relocatable): Change
14739 offset_in_output_section type to Elf_Addr. Change code that uses
14740 it as well.
14741 * layout.cc (Layout::layout): Always set *off.
14742 * mapfile.cc (Mapfile::print_input_section): Use
14743 output_section_offset.
14744 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14745 Sized_relobj*.
14746 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14747 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14748 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14749
5cb66f97
ILT
147502008-07-03 Ian Lance Taylor <iant@google.com>
14751
14752 * layout.cc (Layout::include_section): Do not discard unrecognized
14753 SHT_STRTAB sections.
14754
afe47622
CS
147552008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14756
14757 * script.cc (Lex::can_continue_name): Make '?' allowable in
14758 version-script names.
14759 * testsuite/version_script.map: Change glob pattern to use '?'
14760
5adf9721
ILT
147612008-06-30 Manish Singh <yosh@gimp.org>
14762
14763 PR 6585
14764 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14765 Correct typo.
14766
e6fde208
ILT
147672008-06-30 Ian Lance Taylor <iant@google.com>
14768
14769 PR 6660
14770 PR 6682
14771 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14772 versions]: Don't try to read the value in the contents, since we
14773 don't use it. Use the template endianness when writing.
14774
3f2e6a2d
CC
147752008-06-25 Cary Coutant <ccoutant@google.com>
14776
14777 * fileread.cc (File_read::make_view): Assert on zero-length view.
14778 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14779 symbol table when there are no symbols to read.
14780
c43d3a48
CS
147812008-06-23 Craig Silverstein <csilvers@google.com>
14782
14783 * version.cc (version_string): Bump to 1.7
14784
5f494ea0
CS
147852008-06-18 Craig Silverstein <csilvers@google.com>
14786
14787 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14788 constant 0xFFFF to type Valtype.
14789 (Powerpc_relocate_functions::rel16_ha): Likewise.
14790
c42e122e
ILT
147912008-06-17 Ian Lance Taylor <iant@google.com>
14792
f34787f8
ILT
14793 * output.h (Output_section::Input_section): Initialize p2align_ to
14794 zero for Output_section_data constructors.
14795 (Output_section::Input_section::addralign): If not an input
14796 section, return the alignment of the Output_section_data.
14797 * testsuite/copy_test.cc: New file.
14798 * testsuite/copy_test_1.cc: New file.
14799 * testsuite/copy_test_2.cc: New file.
14800 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14801 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14802 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14803 (copy_test_1_pic.o, copy_test_1.so): New targets.
14804 (copy_test_2_pic.o, copy_test_2.so): New targets.
14805 * testsuite/Makefile.in: Rebuild.
14806
c42e122e
ILT
14807 * script-sections.cc (Script_sections::place_orphan): Initialize
14808 local variable exact.
14809
ce3ac18a
DE
148102008-06-13 David Edelsohn <edelsohn@gnu.org>
14811
14812 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14813
42cacb20
DE
148142008-06-12 David Edelsohn <edelsohn@gnu.org>
14815 David S. Miller <davem@davemloft.net>
14816
14817 * powerpc.cc: New file.
14818 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14819 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14820 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14821 * Makefile.in: Rebuild.
14822
7b308235
ILT
148232008-06-09 Ian Lance Taylor <iant@google.com>
14824
14825 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14826 <exception>.
14827 (throwing, orig_terminate): New static variables.
14828 (terminate_handler): New static function.
14829 (t2): Set terminate handler.
14830
f0b886e3
ILT
148312008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14832
14833 PR 6584
cd536b21 14834 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14835 alignment.
14836
3e90f135
CC
148372008-05-30 Cary Coutant <ccoutant@google.com>
14838
14839 * archive.cc (Archive::include_all_members) Correct to step
14840 over symbol table and extended name table in thin archives.
14841
e09ad04a
ILT
148422008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14843
14844 PR 6407
14845 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14846 calculation.
14847
62b01cb5
ILT
148482008-05-28 Caleb Howe <cshowe@google.com>
14849
14850 * reduced_debug_output.cc: New file.
14851 * reduced_debug_output.h: New file.
92de84a6 14852 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14853 * options.cc (General_options::finalize): Add strip_debug_non_line
14854 to the strip heirarchy.
14855 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14856 fields.
14857 * layout.cc: Include "reduced_debug_output.h".
14858 (Layout::Layout): Initialize new fields.
14859 (line_only_debug_sections): New static array.
14860 (is_lines_only_debug_sections): New static inline function.
14861 (Layout::include_section): Handle --strip-debug-non-line.
14862 (Layout::make_output_section): If --strip-debug-non-line, build
14863 new output sections for .debug_abbrev and .debug_info.
14864 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14865 gold. Warn about possible overflow.
14866 (read_signed_LEB_128): Likewise.
14867 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14868 (read_signed_LEB_128): Declare.
14869 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14870 (HFILES): Add reduced_debug_output.h.
14871 * Makefile.in: Rebuild.
14872
7d9e3d98
ILT
148732008-05-21 Ian Lance Taylor <iant@google.com>
14874
14875 * mapfile.cc: New file.
14876 * mapfile.h: New file.
14877 * options.h (class General_options): Add -M/--print-map and -Map.
14878 * options.cc (General_options::finalize): Make -M equivalent to
14879 -Map -.
14880 * main.cc: Include <cstdio> and "mapfile.h".
14881 (main): Open mapfile if requested.
14882 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14883 constructor. Change caller.
14884 (queue_initial_tasks): Add mapfile parameter. Change caller.
14885 (queue_middle_tasks): Likewise.
14886 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14887 declarations.
14888 * archive.cc: Include "mapfile.h".
14889 (Archive::add_symbols): Add mapfile parameter. Change all
14890 callers. Pass mapfile, symbol, and reason to include_member.
14891 (Archive::include_all_members): Add mapfile parameter. Change all
14892 callers.
14893 (Archive::include_member): Add mapfile, sym, and why parameters.
14894 Change all callers. Report inclusion to map file.
14895 * archive.h: Include "fileread.h".
14896 (class Archive): Update declarations.
14897 (Archive::file): New const method.
14898 (class Add_archive_symbols): Add mapfile_ field. Update
14899 constructor. Change all callers.
14900 * readsyms.h (class Read_symbols): Likewise.
14901 (class Finish_group): Likewise.
14902 (class Read_script): Likewise.
14903 * common.cc: Include "mapfile.h".
14904 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14905 all callers.
14906 (Symbol_table::do_allocate_commons): Likewise.
14907 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14908 symbol allocation to mapfile.
14909 * common.h (class Allocate_commons_task): Add mapfile_ field.
14910 Update constructor. Change all callers.
14911 * symtab.h (class Symbol_table): Update declarations.
14912 * layout.cc: Include "mapfile.h".
14913 (Layout_task_runner::run): Print information to mapfile.
14914 (Layout::create_gold_note): Change Output_data_fixed_space to
14915 Output_data_zero_fill.
14916 (Layout::create_build_id): Likewise.
14917 (Layout::print_to_mapfile): New function.
14918 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14919 constructor. Change caller.
14920 (class Layout): Declare print_to_mapfile.
14921 * output.cc (Output_section::Input_section::print_to_mapfile): New
14922 function.
14923 (Output_section::add_input_section): If producing a map, always
14924 add to input_sections_ list.
14925 (Output_section::do_print_to_mapfile): New function.
14926 (Output_segment::print_sections_to_mapfile): New function.
14927 (Output_segment::print_section_list_to_mapfile): New function.
14928 * output.h: Include "mapfile.h".
14929 (Output_data::print_to_mapfile): New function.
14930 (Output_data::do_print_to_mapfile): New virtual function.
14931 (Output_segment_headers::do_print_to_mapfile): New function.
14932 (Output_file_header::do_print_to_mapfile): New function.
14933 (Output_data_const::do_print_to_mapfile): New function.
14934 (class Output_data_const_buffer): Add map_name_ field. Update
14935 constructor. Change all callers. Add do_print_to_mapfile
14936 function.
14937 (class Output_data_fixed_space): Likewise.
14938 (class Output_data_space): Likewise.
14939 (class Output_data_zero_fill): New class.
14940 (Output_data_strtab::do_print_to_mapfile): New function.
14941 (Output_data_reloc_base::do_print_to_mapfile): New function.
14942 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14943 (Output_data_group::do_print_to_mapfile): New function.
14944 (Output_data_got::do_print_to_mapfile): New function.
14945 (Output_data_dynamic::do_print_to_mapfile): New function.
14946 (Output_symtab_xindex::do_print_to_mapfile): New function.
14947 (class Output_section): Declare do_print_to_mapflie. Declare
14948 print_to_mapfile in Input_section.
14949 (class Output_segment): Declare new functions.
14950 * object.h (Sized_relobj::symbol_count): New function.
14951 * script-sections.cc
14952 (Output_section_element_dot_assignment::set_section_addresses):
14953 Change Output_data_fixed_space to Output_data_zero_fill.
14954 (Output_data_expression::do_print_to_mapfile): New function.
14955 * script.cc (read_input_script): Add mapfile parameter. Change
14956 all callers.
14957 * script.h (read_input_script): Update declaration.
14958 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14959 (Eh_frame::do_print_to_mapfile): New function.
14960 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14961 (Output_merge_string::do_print_to_mapfile): New function.
14962 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14963 function.
14964 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14965 function.
14966 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14967 function.
14968 * Makefile.am (CCFILES): Add mapfile.cc.
14969 (HFILES): Add mapfile.h.
14970 * Makefile.in: Rebuild.
14971
9f1d377b
ILT
149722008-05-19 Ian Lance Taylor <iant@google.com>
14973
14974 * options.h (class General_options): Add -z relro.
14975 * layout.cc (Layout::Layout): Initialize relro_segment_.
14976 (Layout::add_output_section_data): Return the output section.
14977 (Layout::make_output_section): Rcognize relro sections and mark
14978 them appropriately.
14979 (Layout::attach_allocated_section_to_segment): Put relro sections
14980 in a PT_GNU_RELRO segment.
14981 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14982 section as relro.
14983 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14984 PT_TLS segments.
14985 (Layout::linkonce_mapping): Map d.rel.ro.local to
14986 .data.rel.ro.local.
14987 (Layout::output_section_name): Us .data.rel.ro.local for any
14988 section which begins with that.
14989 * layout.h (class Layout): Update add_output_section_data
14990 declaration. Add relro_segment_ field.
14991 * output.cc (Output_section::Output_section): Initialize is_relro_
14992 and is_relro_local_ fields.
14993 (Output_segment::add_output_section): Group relro sections.
14994 (Output_segment::is_first_section_relro): New function.
14995 (Output_segment::maximum_alignment): If there is a relro section,
14996 align the segment to the common page size.
14997 (Output_segment::set_section_addresses): Track whether we are
14998 looking at relro sections. If the last section is a relro
14999 section, align to the common page size.
15000 (Output_segment::set_section_list_addresses): Add in_relro
15001 parameter. Change all callers. Align to the page size when
15002 moving from relro to non-relro section.
15003 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15004 segment.
15005 * output.h (class Output_section): Add is_relro_ and
15006 is_relro_local_ fields.
15007 (Output_section::is_relro): New function.
15008 (Output_section::set_is_relro): New function.
15009 (Output_section::is_relro_local): New function.
15010 (Output_section::set_is_relro_local): New function.
15011 (class Output_segment): Update declarations.
15012 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15013 * sparc.cc (Target_sparc::got_section): Likewise.
15014 * x86_64.cc (Target_x86_64::got_section): Likewise.
15015 * testsuite/relro_test_main.cc: New file.
15016 * testsuite/relro_test.cc: New file.
15017 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15018 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15019 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15020 (relro_test.so, relro_test_pic.o): New targets.
15021 * testsuite/Makefile.in: Rebuild.
15022
a984ee1d
ILT
150232008-05-16 Ian Lance Taylor <iant@google.com>
15024
01676dcd
ILT
15025 * output.cc (Output_segment::add_output_section): Remove front
15026 parameter.
15027 * output.h (class Output_segment): Remove
15028 add_initial_output_section and overloaded add_output_section.
15029 Update declaration of remaining add_output_section.
15030 * layout.cc (Layout::create_interp): Call add_output_section
15031 rather than add_initial_output_section.
15032 (Layout::finish_dynamic_section): Likewise.
15033
497897f9
ILT
15034 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15035 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15036 know the dynamic type.
15037 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15038 field. Initialize it in constructor.
15039 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15040 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15041 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15042 reloc.
15043
a984ee1d
ILT
15044 * output.cc (Output_reloc::get_address): Change return type to
15045 Elf_Addr.
15046 * output.h (class Output_reloc): Update get_address declaration.
15047 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15048 for section addresses.
15049
55ba0940
ILT
150502008-05-09 Ian Lance Taylor <iant@google.com>
15051
15052 PR 6493
15053 * gold.cc (gold_nomem): Use return value of write.
15054
75517b77
ILT
150552008-05-08 Ian Lance Taylor <iant@google.com>
15056
15057 * symtab.c (Symbol::init_base_output_data): Add version
15058 parameter. Change all callers.
15059 (Symbol::init_base_output_segment): Likewise.
15060 (Symbol::init_base_constant): Likewise.
15061 (Symbol::init_base_undefined): Likewise.
15062 (Sized_symbol::init_output_data): Likewise.
15063 (Sized_symbol::init_output_segment): Likewise.
15064 (Sized_symbol::init_constant): Likewise.
15065 (Sized_symbol::init_undefined): Likewise.
15066 (Symbol_table::do_define_in_output_data): If the new symbol has a
15067 version, mark it as the default.
15068 (Symbol_table::do_define_in_output_segment): Likewise.
15069 (Symbol_table::do_define_as_constant): Likewise.
15070 * symtab.h (class Symbol): Update declarations.
15071 (class Sized_symbol): Likewise.
15072 * resolve.cc (Symbol::override_version): New function.
c42e122e 15073 (Symbol::override_base): Call override_version.
75517b77
ILT
15074 (Symbol::override_base_with_special): Likewise.
15075 * testsuite/ver_script_8.script: New file.
15076 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15077 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15078 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15079 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15080
f1f70eae
ILT
150812008-05-06 Ian Lance Taylor <iant@google.com>
15082
f3e9c5c5
ILT
15083 PR 6049
15084 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15085 functions.
15086 (class General_options): Remove existing --undefined, and add
15087 --no-undefined instead. Add new --undefined as synonym for -u.
15088 * archive.cc (Archive::add_symbols): Check whether symbol was
15089 named with -u.
15090 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15091 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15092 all uses. Add IS_UNDEFINED. Update declarations to split
15093 different versions of init_base. Declare init_base_undefined.
15094 (Symbol::is_defined): Handle IS_UNDEFINED.
15095 (Symbol::is_undefined): Likewise.
15096 (Symbol::is_weak_undefined): Call is_undefined.
15097 (Symbol::is_absolute): Handle IS_CONSTANT.
15098 (class Sized_symbol): Update declarations to split different
15099 versions of init. Declare init_undefined.
15100 (class Symbol_table): Declare new functions.
15101 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15102 Change all callers.
15103 (Symbol::init_base_output_data): Likewise.
15104 (Symbol::init_base_output_segment): Likewise.
15105 (Symbol::init_base_constant): Likewise.
15106 (Symbol::init_base_undefined): New function.
15107 (Sized_symbol::init_object): Rename from init. Change all
15108 callers.
15109 (Sized_symbol::init_output_data): Likewise.
15110 (Sized_symbol::init_output_segment): Likewise.
15111 (Sized_symbol::init_constant): Likewise.
15112 (Sized_symbol::init_undefined): New function.
15113 (Symbol_table::add_undefined_symbols_from_command_line): New
15114 function.
15115 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15116 function.
15117 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15118 (Symbol::output_section): Likewise.
15119 (Symbol::set_output_section): Likewise.
15120 (Symbol_table::sized_finalize_symbol): Likewise.
15121 (Symbol_table::sized_write_globals): Likewise.
15122 * resolve.cc (Symbol_table::should_override): Likewise.
15123 (Symbol::override_base_with_special): Likewise.
15124
8bdcdf2c
ILT
15125 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15126 symbol, change it to have default visibility.
15127 * testsuite/protected_1.cc: New file.
15128 * testsuite/protected_2.cc: New file.
15129 * testsuite/protected_3.cc: New file.
15130 * testsuite/protected_main_1.cc: New file.
15131 * testsuite/protected_main_2.cc: New file.
15132 * testsuite/protected_main_3.cc: New file.
15133 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15134 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15135 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15136 (protected_1.so): New target.
15137 (protected_1_pic.o, protected_2_pic.o): New targets.
15138 (protected_3_pic.o): New target.
15139 (check_PROGRAMS): Add protected_2.
15140 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15141 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15142 * testsuite/Makefile.in: Rebuild.
15143
2b706932
ILT
15144 * options.h (DEFINE_var): Add set_user_set_##varname__.
15145 (DEFINE_bool_alias): New macro.
15146 (class General_options): Define -Bstatic using DEFINE_bool_alias
15147 rather than DEFINE_special. Add --undefined as an alias for -z
15148 defs.
15149 * options.cc (General_options::parse_Bstatic): Remove.
15150
d82a5bcc
ILT
15151 * options.h (class General_options): Add --fatal-warnings.
15152 * main.cc (main): Implement --fatal-warnings.
15153 * errors.h (Errors::warning_count): New function.
15154
f1f70eae
ILT
15155 * options.h (class General_options): Add -Bsymbolic-functions.
15156 * symtab.h (Symbol::is_preemptible): Check for
15157 -Bsymbolic-functions.
15158
8825ac63
ILT
151592008-05-05 Ian Lance Taylor <iant@google.com>
15160
d98bc257
ILT
15161 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15162 as noVARNAME rather than no-VARNAME.
15163 (class General_options): Add option -z combreloc.
15164 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15165 get_address.
15166 (Output_reloc::sort_before) [SHT_REL]: New function.
15167 (Output_reloc::sort_before) [SHT_RELA]: New function.
15168 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15169 Sort_relocs_comparison.
15170 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15171 parameter. Change all callers.
15172 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15173 sort_relocs parameter. Change all callers.
15174 * output.cc (Output_reloc::get_address): New function, broken out
15175 of write_rel.
15176 (Output_reloc::write_rel): Call it.
15177 (Output_reloc::compare): New function.
15178 (Output_data_reloc_base::do_write): Optionally sort relocs.
15179
60b2b4e7
ILT
15180 * configure.ac: If targ_extra_obj is set, link it in.
15181 * configure.tgt: Initialize all variables.
15182 (x86_64*): Set targ_extra_obj and targ_extra_size.
15183 * configure: Rebuild.
15184
8825ac63
ILT
15185 * object.cc (Sized_relobj::include_section_group): Adjust section
15186 indexes read from group data. Build vector to pass to
15187 layout_group.
15188 * layout.cc (Layout::layout_group): Add flags and shndxes
15189 parameters. Remove contents parameter. Change caller. Update
15190 explicit instantiations.
15191 * layout.h (class Layout): Update layout_group declaration.
15192 * output.cc (Output_data_group::Output_data_group): Add flags and
15193 input_shndxes parameters. Remove contents parameter. Change
15194 caller.
15195 (Output_data_group::do_write): Change input_sections_ to
15196 input_shndxes_.
15197 * output.h (class Output_data_group): Update constructor
15198 declaration. Rename input_sections_ to input_shndxes_.
15199 * testsuite/many_sections_test.cc: Add template.
15200
e94cf127
CC
152012008-04-30 Cary Coutant <ccoutant@google.com>
15202
4418b2d5
CC
15203 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15204
e94cf127
CC
15205 * layout.cc (Layout::include_section): Refactored check for debug
15206 info section.
15207 (Layout::add_comdat): Add new parameters. Change type
15208 of signature parameter. Add object and shndx to signatures table.
15209 (Layout::find_kept_object): New function.
15210 * layout.h: Include <cstring>.
15211 (Layout::is_debug_info_section): New function.
15212 (Layout::add_comdat): Add new parameters.
15213 (Layout::find_kept_object): New function.
15214 (Layout::Kept_section): New struct.
15215 (Layout::Signatures): Change type of map range.
15216 * object.cc (Relobj::output_section_address): New function.
15217 (Sized_relobj::include_section_group): Add new parameters. Change
15218 calls to Layout::add_comdat. Change to build table of kept comdat
15219 groups and table mapping discarded sections to kept sections.
15220 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15221 (Sized_relobj::do_layout): Change calls to include_section_group and
15222 include_linkonce_section.
15223 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15224 value to zero when section is discarded.
15225 (Sized_relobj::map_to_kept_section): New function.
15226 * object.h (Relobj::output_section_address): New function.
15227 (Relobj::Comdat_group): New type.
15228 (Relobj::find_comdat_group): New function.
15229 (Relobj::Comdat_group_table): New type.
15230 (Relobj::Kept_comdat_section): New type.
15231 (Relobj::Kept_comdat_section_table): New type.
15232 (Relobj::add_comdat_group): New function.
15233 (Relobj::set_kept_comdat_section): New function.
15234 (Relobj::get_kept_comdat_section): New function.
15235 (Relobj::comdat_groups_): New field.
15236 (Relobj::kept_comdat_sections_): New field.
15237 (Symbol_value::input_value): Update comment.
15238 (Sized_relobj::map_to_kept_section) New function.
15239 (Sized_relobj::include_linkonce_section): Add new parameter.
15240 * target-reloc.h (Comdat_behavior): New type.
15241 (get_comdat_behavior): New function.
15242 (relocate_section): Add code to map a discarded section to the
15243 corresponding kept section when applying a relocation.
15244
e4e5049b
CS
152452008-04-30 Craig Silverstein <csilvers@google.com>
15246
15247 * dwarf_reader.cc (next_generation_count): New static var.
15248 (Addr2line_cache_entry): New struct.
15249 (addr2line_cache): New static var.
15250 (Dwarf_line_info::one_addr2line): Added caching.
15251 (Dwarf_line_info::clear_addr2line_cache): New function.
15252 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15253 cache-size parameter.
15254 (Dwarf_line_info::one_addr2line_cache): New function.
15255 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15256 new cache-size argument to one_addr2line(), and clear cache.
15257
d09e9154
CC
152582008-04-28 Cary Coutant <ccoutant@google.com>
15259
15260 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15261 R_386_PC8 relocations.
15262
7ef73768
ILT
152632008-04-23 Ian Lance Taylor <iant@google.com>
15264
55438702
ILT
15265 * object.cc (Sized_relobj::include_section_group): Check for
15266 invalid section group.
15267
c165fb93
ILT
15268 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15269 header size.
15270
7ef73768
ILT
15271 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15272 than read for file header.
15273 * archive.cc (Archive::include_member): Likewise.
15274
6194aaab
L
152752008-04-23 Paolo Bonzini <bonzini@gnu.org>
15276
15277 * aclocal.m4: Regenerate.
15278 * configure: Regenerate.
15279
d491d34e
ILT
152802008-04-19 Ian Lance Taylor <iant@google.com>
15281
5ea2bac6
ILT
15282 * version.cc (version_string): Bump to 1.6.
15283
7bc3e21a
ILT
15284 * testsuite/Makefile.am (many_sections_r_test): New target.
15285 (many_sections_r_test_SOURCES): Remove.
15286 (many_sections_r_test_DEPENDENCIES): Remove.
15287 (many_sections_r_test_LDFLAGS): Remove.
15288 (many_sections_r_test_LDADD): Remove.
15289
7fcd3aa9
ILT
15290 * object.cc (Sized_relobj::do_add_symbols): Always pass
15291 local_symbol_count_ to add_from_relobj.
15292
4c94d6ae
ILT
15293 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15294 every thousand variables.
15295 * testsuite/Makefile.in: Rebuild.
15296
d491d34e
ILT
15297 * object.cc (Xindex::initialize_symtab_xindex): New function.
15298 (Xindex::read_symtab_xindex): New function.
15299 (Xindex::sym_xindex_to_shndx): New function.
15300 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15301 available.
15302 (Sized_relobj::do_initialize_xindex): New function.
15303 (Sized_relobj::do_read_symbols): Adjust section links.
15304 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15305 parameter. Change all callers.
15306 (Sized_relobj::include_section_group): Adjust section links and
15307 symbol section indexes.
15308 (Sized_relobj::do_layout): Adjust section links.
15309 (Sized_relobj::do_count_local_symbols): Adjust section links and
15310 symbol section indexes.
15311 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15312 ordinary and special symbols.
15313 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15314 dynsym_xindex parameters. Change all callers. Adjust section
15315 links. Use SHN_XINDEX when needed.
15316 (Sized_relobj::get_symbol_location_info): Adjust section links.
15317 Don't get fooled by special symbols.
15318 * object.h (class Xindex): Define.
15319 (class Object): Add xindex_ parameter. Declare virtual functoin
15320 do_initialize_xindex.
15321 (Object::adjust_sym_shndx): New function.
15322 (Object::set_xindex): New protected function.
15323 (class Symbol_value): Add is_ordinary_shndx_ field.
15324 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15325 (Symbol_value::value): Assert ordinary section.
15326 (Symbol_value::initialize_input_to_output_map): Likewise.
15327 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15328 Change all callers.
15329 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15330 all callers.
15331 (class Sized_relobj): Update declarations.
15332 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15333 parameter. Change all callers.
15334 (Sized_relobj::adjust_shndx): New function.
15335 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15336 field.
15337 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15338 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15339 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15340 (Sized_dynobj::read_dynsym_section): Adjust section links.
15341 (Sized_dynobj::read_dynamic): Likewise.
15342 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15343 section links.
15344 (Sized_dynobj::do_initialize_xindex): New function.
15345 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15346 do_initialize_xindex.
15347 (Sized_dynobj::adjust_shndx): New function.
15348 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15349 dynsym_xindex_ fields.
15350 (Layout::finalize): Add a call to set_section_indexes before
15351 creating the symtab sections.
15352 (Layout::set_section_indexes): Don't do anything if the section
15353 already has a section index.
15354 (Layout::create_symtab_sections): Add shnum parameter. Change
15355 caller. Create .symtab_shndx section if needed.
15356 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15357 caller.
15358 (Layout::allocated_output_section_count): New function.
15359 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15360 needed.
15361 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15362 fields. Update declarations.
15363 (Layout::symtab_xindex): New function.
15364 (Layout::dynsym_xindex): New function.
15365 (class Write_symbols_task): Add layout_ field.
15366 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15367 Change caller.
15368 * output.cc (Output_section_headers::Output_section_headers): Add
15369 shstrtab_section parameter. Change all callers.
15370 (Output_section_headers::do_sized_write): Store overflow values
15371 for section count and section string table section index in
15372 section header zero.
15373 (Output_file_header::do_sized_write): Check for overflow of
15374 section count and section string table section index.
15375 (Output_symtab_xindex::do_write): New function.
15376 (Output_symtab_xindex::endian_do_write): New function.
15377 * output.h (class Output_section_headers): Add shstrtab_section_.
15378 Update declarations.
15379 (class Output_symtab_xindex): Define.
15380 (Output_section::has_out_shndx): New function.
15381 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15382 field.
15383 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15384 Change all callers.
15385 (Sized_symbol::init): Likewise.
15386 (Symbol::output_section): Check for ordinary symbol.
15387 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15388 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15389 callers.
15390 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15391 Change all callers. Simplify handling of symbols from sections
15392 not included in the link.
15393 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15394 distinction.
15395 (Weak_alias_sorter::operator()): Assert that symbols are
15396 ordinary.
15397 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15398 distinction.
15399 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15400 parameters. Change all callers.
15401 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15402 symbol distinction. Use SHN_XINDEX when needed.
15403 (Symbol_table::write_section_symbol): Add symtab_xindex
15404 parameter. Change all callers.
15405 (Symbol_table::sized_write_section_symbol): Likewise. Use
15406 SHN_XINDEX when needed.
15407 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15408 declarations.
15409 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15410 (Symbol::is_defined): Check is_ordinary.
15411 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15412 (Symbol::is_absolute, Symbol::is_common): Likewise.
15413 (class Sized_symbol): Update declarations.
15414 (class Symbol_table): Update declarations.
15415 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15416 parameters. Change all callers.
15417 (Sized_symbol::override): Likewise.
15418 (Symbol_table::override): Likewise.
15419 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15420 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15421 is_ordinary, and orig_st_shndx parameters. Change all callers.
15422 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15423 to be in an ordinary section.
15424 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15425 object and is_ordinary parameters. Change all callers.
15426 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15427 Change all callers. Don't add undefined or non-ordinary symbols
15428 to reloc_map_.
15429 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15430 Change all callers.
15431 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15432 declarations.
15433 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15434 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15435 (Sized_relobj::relocate_sections): Likewise.
15436 * target-reloc.h (scan_relocs): Adjust section symbol index.
15437 (scan_relocatable_relocs): Likewise.
15438 * i386.cc (Scan::local): Check for ordinary symbols.
15439 * sparc.cc (Scan::local): Likewise.
15440 * x86_64.cc (Scan::local): Likewise.
15441 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15442 to symbol_section_and_value.
15443 * testsuite/many_sections_test.cc: New file.
15444 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15445 (check_PROGRAMS): Add many_sections_test.
15446 (many_sections_test_SOURCES): Define.
15447 (many_sections_test_DEPENDENCIES): Define.
15448 (many_sections_test_LDFLAGS): Define.
15449 (BUILT_SOURCES): Add many_sections_define.h.
15450 (many_sections_define.h): New target.
15451 (BUILT_SOURCES): Add many_sections_check.h.
15452 (many_sections_check.h): New target.
15453 (check_PROGRAMS): Add many_sections_r_test.
15454 (many_sections_r_test_SOURCES): Define.
15455 (many_sections_r_test_DEPENDENCIES): Define.
15456 (many_sections_r_test_LDFLAGS): Define.
15457 (many_sections_r_test_LDADD): Define.
15458 (many_sections_r_test.o): New target.
15459 * testsuite/Makefile.in: Rebuild.
15460
c5818ff1
CC
154612008-04-17 Cary Coutant <ccoutant@google.com>
15462
15463 * errors.cc (Errors::info): New function.
15464 (gold_info): New function.
15465 * errors.h (Errors::info): New function.
15466 * gold.h (gold_info): New function.
15467 * object.cc (Input_objects::add_object): Print trace output.
15468 * options.cc (options::parse_set): New function.
15469 (General_options::parse_wrap): Deleted.
15470 (General_options::General_options): Deleted initializer.
15471 * options.h (options::String_set): New typedef.
15472 (options::parse_set): New function.
15473 (DEFINE_set): New macro.
15474 (General_options::wrap): Changed to use DEFINE_set. Changed
15475 callers of any_wrap_symbols and is_wrap_symbol.
15476 (General_options::trace, General_options::trace_symbol):
15477 New options.
15478 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15479 (General_options::wrap_symbols_): Deleted.
15480 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15481
b5be4a7c
DM
154822008-04-17 David S. Miller <davem@davemloft.net>
15483
15484 * options.cc (General_options::parse_V): New function.
15485 * options.h: Add entries for -V and -Qy.
15486
155a0dd7
ILT
154872008-04-17 Ian Lance Taylor <iant@google.com>
15488
15489 * common.cc (Symbol_table::allocate_commons): Remove options
15490 parameter. Change caller.
15491 (Symbol_table::do_allocate_commons): Remove options parameter.
15492 Change caller. Just call do_allocate_commons_list twice.
15493 (Symbol_table::do_allocate_commons_list): New function, broken out
15494 of do_allocate_commons.
15495 * common.h (class Allocate_commons_task): Remove options_ field.
15496 Update constructor.
15497 * symtab.cc (Symbol_table::Symbol_table): Initialize
15498 tls_commons_.
15499 (Symbol_table::add_from_object): Put TLS common symbols on
15500 tls_commons_ list.
15501 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15502 which are IN_OUTPUT_DATA.
15503 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15504 allocate_commons and do_allocate_commons declarations. Declare
15505 do_allocate_commons_list.
15506 * gold.cc (queue_middle_tasks): Update creation of
15507 Allocate_commons_task to not pass options.
15508 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15509 (TLS_TEST_C_FLAGS): New variable.
15510 (tls_test_c_pic.o): New target.
15511 (tls_test_shared.so): Link in tls_test_c_pic.o.
15512 (tls_test_c_pic_ie.o): New target.
15513 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15514 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15515 (tls_test_c.o): New target.
15516 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15517 (tls_pic_test_LDADD): Likewise.
15518 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15519 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15520 (tls_test_c_gnu2.o): New target.
15521 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15522 tls_test_c_gnu2.o.
15523 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15524 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15525 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15526 * testsuite/tls_test.cc: Include "config.h".
15527 (t_last): Call t11_last.
15528 * testsuite/tls_test.h (t11, t11_last): Declare.
15529 * testsuite/tls_test_c.c: New file.
15530 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15531 * configure.ac: Check for OpenMP support.
15532 * configure, config.in, Makefile.in: Rebuild.
15533 * testsuite/Makefile.in: Rebuild.
15534
edfbb029
CC
155352008-04-16 Cary Coutant <ccoutant@google.com>
15536
15537 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15538 (Target_i386::tls_base_symbol_defined_): New field.
15539 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15540 (Target_i386::Scan::global): Likewise.
15541 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15542 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15543 (Target_x86_64::tls_base_symbol_defined_): New field.
15544 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15545 (Target_x86_64::Scan::global): Likewise.
15546
f3c69fca
CC
155472008-04-16 Cary Coutant <ccoutant@google.com>
15548
15549 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15550 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15551 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15552 building shared libraries.
15553 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15554 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15555 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15556 * testsuite/Makefile.in: Rebuild.
15557 * testsuite/weak_undef.h: New file.
15558 * testsuite/weak_undef_file1.cc: Add extra test cases.
15559 * testsuite/weak_undef_file2.cc: Likewise.
15560 * testsuite/weak_undef_test.cc: Likewise.
15561
7c414435
DM
155622008-04-16 David S. Miller <davem@davemloft.net>
15563
32b769e1
DM
15564 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15565 Add issued_non_pic_error_ field. Declare check_non_pic.
15566 (Target_sparc::Scan::check_non_pic): New function.
15567 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15568 (Target_sparc::Scan::global): Likewise.
15569
11936fb1
DM
15570 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15571 * configure: Rebuild.
15572
7c414435
DM
15573 * options.h (DEFINE_enable): New macro.
15574 (new_dtags): New enable option.
15575 (initfirst, interpose, loadfltr, nodefaultlib,
15576 nodelete, nodlopen, nodump): New -z options.
15577 * layout.cc (Layout:finish_dynamic_section): If new
15578 dtags enabled, emit DT_RUNPATH. Also, emit a
15579 DT_FLAGS_1 containing any specified -z flags.
15580
85c7bf8b
ILT
155812008-04-16 Ian Lance Taylor <iant@google.com>
15582
12c0daef
ILT
15583 * copy-relocs.cc: New file.
15584 * copy-relocs.h: New file.
15585 * reloc.cc: Remove Copy_relocs code.
15586 * reloc.h: Likewise.
15587 * reloc-types.h (struct Reloc_types) [both versions]: Add
15588 get_reloc_addend_noerror.
15589 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15590 variants of add_global which take an addend which must be zero.
15591 * i386.cc: Include "copy-relocs.h".
15592 (class Target_i386): Change type of copy_relocs_ to variable,
15593 update initializer.
15594 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15595 Change all callers.
15596 (Target_i386::do_finalize_sections): Change handling of
15597 copy_relocs_.
15598 * sparc.cc: Include "copy-relocs.h".
15599 (class Target_sparc): Change type of copy_relocs_ to variable,
15600 update initializer.
15601 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15602 Change all callers.
15603 (Target_sparc::do_finalize_sections): Change handling of
15604 copy_relocs_.
15605 * x86_64.cc: Include "copy-relocs.h".
15606 (class Target_x86_64): Change type of copy_relocs_ to variable,
15607 update initializer.
15608 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15609 class. Change all callers.
15610 (Target_x86_64::do_finalize_sections): Change handling of
15611 copy_relocs_.
15612 * Makefile.am (CCFILES): Add copy-relocs.cc.
15613 (HFILES): Add copy-relocs.h.
15614
4f4995b6
ILT
15615 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15616
85c7bf8b
ILT
15617 * testsuite/script_test_4.sh: Permit leading zeroes.
15618
4f2a9edd
ILT
156192008-04-15 Ian Lance Taylor <iant@google.com>
15620
e6188289
ILT
15621 * script-sections.cc (Script_sections::create_segments): Use
15622 header_size_adjustment even when there is enough room for the
15623 headers.
15624 * testsuite/script_test_4.sh: New file.
15625 * testsuite/script_test_4.t: New file.
15626 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15627 (check_DATA): Add script_test_4.stdout.
15628 (MOSTLYCLEANFILES): Likewise.
15629 (script_test_4): New target.
15630 (script_test_4.stdout): New target.
15631 * testsuite/Makefile.in: Rebuild.
15632
4f2a9edd
ILT
15633 * sparc.cc: Add definitions for Output_data_plt_sparc class
15634 constants.
15635
f5314dd5
DM
156362008-04-14 David S. Miller <davem@davemloft.net>
15637
15638 * sparc.cc: New file.
15639 * Makefile.am (TARGETSOURCES): Add sparc.cc
15640 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15641 * configure.tgt: Document targ_extra_size and
15642 targ_extra_big_endian. Add entries for sparc-* and
15643 sparc64-*.
15644 * configure.ac: Handle targ_extra_size and
15645 targ_extra_big_endian.
15646 * Makefile.in: Rebuild.
15647 * configure: Likewise.
15648 * po/POTFILES.in: Likewise.
15649 * po/gold.pot: Likewise.
15650
154e0e9a
ILT
156512008-04-14 Ian Lance Taylor <iant@google.com>
15652
15653 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15654 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15655 in the name/type/flags to section mapping. Don't call
15656 allocate_output_section.
15657 (Layout::choose_output_section): Change parameter from adjust_name
15658 to is_input_section. Don't permit input sections after sections
15659 are attached to segments. Don't call allocate_output_section.
15660 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15661 not write_enable_output_section.
15662 (Layout::make_output_section): Don't push to
15663 unattached_section_list_ nor call attach_to_segment. Call
15664 attach_section_to_segment if sections are attached.
15665 (Layout::attach_sections_to_segments): New function.
15666 (Layout::attach_section_to_segment): New function.
15667 (Layout::attach_allocated_section_to_segment): Rename from
15668 attach_to_segment. Remove flags parameter.
15669 (Layout::allocate_output_section): Remove function.
15670 (Layout::write_enable_output_section): Remove function.
15671 * layout.h (class Layout): Update for above changes. Add new
15672 field sections_are_attached_.
15673 * output.h (Output_section::update_flags_for_input_section): New
15674 function.
15675 * output.cc (Output_section::add_input_section): Call
15676 update_flags_for_input_section.
15677 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15678
009a67a2
CC
156792008-04-11 Cary Coutant <ccoutant@google.com>
15680
15681 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15682 thought unnecessary.
15683 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15684
759b1a24
ILT
156852008-04-11 Ian Lance Taylor <iant@google.com>
15686
15687 * output.h (class Output_section_data): Remove inline definition
15688 of set_addralign.
15689 * output.cc (Output_section_data::set_addralign): New function.
15690
c2b45e22
CC
156912008-04-11 Cary Coutant <ccoutant@google.com>
15692
15693 Add support for TLS descriptors for i386 and x86_64.
15694 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15695 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15696 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15697 GOT_TYPE_TLS_DESC.
15698 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15699 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15700 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15701 relocations.
15702 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15703 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15704 Fix problem with initial-exec relocations.
15705 (Target_i386::Relocate::relocate_tls): Likewise.
15706 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15707 relaxation.
15708 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15709 support for section-plus-offset dynamic table entries.
15710 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15711 (Output_data_dynamic::Dynamic_entry): Add support for
15712 section-plus-offset dynamic table entries.
15713 (Output_data_dynamic::Classification): Likewise.
15714 (Output_data_dynamic::classification_): Renamed offset_.
15715 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15716 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15717 (Target_x86_64::make_plt_section): New function.
15718 (Target_x86_64::reserve_tlsdesc_entries): New function.
15719 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15720 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15721 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15722 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15723 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15724 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15725 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15726 add extra PLT entry for TLS descriptors.
15727 (Output_data_plt_x86_64::got_): New field.
15728 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15729 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15730 fields.
15731 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15732 descriptors.
15733 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15734 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15735 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15736 R_386_TLS_DESC_CALL relocations.
15737 (Target_x86_64::Scan::global): Likewise.
15738 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15739 for TLS descriptors.
15740 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15741 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15742 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15743 GD-to-IE relaxation.
15744 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15745 and TLS_DESCRIPTORS.
15746 * Makefile.in: Rebuild.
15747 * configure: Rebuild.
15748 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15749 (tls_test_shared2.so): New target.
15750 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15751 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15752 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15753 (tls_shared_gd_to_ie_test_LDADD): New variable.
15754 (tls_shared_gnu2_gd_to_ie_test): New target.
15755 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15756 New targets.
15757 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15758 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15759 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15760 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15761 (tls_shared_gnu2_test): New target.
15762 (tls_test_gnu2_shared.so): New target.
15763 (tls_shared_gnu2_test_SOURCES): New variable.
15764 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15765 (tls_shared_gnu2_test_LDFLAGS): New variable.
15766 (tls_shared_gnu2_test_LDADD): New variable.
15767 * testsuite/Makefile.in: Rebuild.
15768 * testsuite/Makefile.
15769
83bfb6b7
ILT
157702008-04-11 Ian Lance Taylor <iant@google.com>
15771
15772 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15773 justsyms.t.
15774 * testsuite/Makefile.in: Rebuild.
15775
15776 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15777 long.
15778 * testsuite/script_test_2.cc (main): Adjust test.
15779
706e1f5e
ILT
157802008-04-11 David S. Miller <davem@davemloft.net>
15781 Ian Lance Taylor <iant@google.com>
15782
15783 * options.h (General_options): Add entries for '-Y' and
15784 '-relax'.
15785 * options.cc (General_options:finalize): If -Y was used, add those
15786 entries to the library path instead of the default "/lib" and
15787 "/usr/lib".
15788
7c98e6bb
DM
157892008-04-11 David S. Miller <davem@davemloft.net>
15790
15791 * testsuite/justsyms.t: Start at 0x100.
15792 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15793 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15794 long.
15795 * testsuite/script_test_2.cc: Adjust string and section length
15796 checks.
7c98e6bb 15797
99a37bfd
ILT
157982008-04-09 Ian Lance Taylor <iant@google.com>
15799
2cefc357
ILT
15800 PR gold/5996
15801 * script-sections.cc (Sections_element::allocate_to_segment): Add
15802 orphan parameter.
15803 (Output_section_definition::allocate_to_segment): Likewise.
15804 (Orphan_output_section::allocate_to_segment): Likewise.
15805 (Script_sections::attach_sections_using_phdrs_clause): Don't
15806 propagate non-PT_LOAD segments to orphan sections.
15807 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15808 readelf rather than objdump.
15809 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15810 .interp section and PT_INTERP segment are the same size.
15811 * testsuite/Makefile.in: Rebuild.
15812
99a37bfd
ILT
15813 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15814 aliases for symbols defined in the same object.
15815 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15816 (weak_alias_test_SOURCES): New variable.
15817 (weak_alias_test_DEPENDENCIES): New variable.
15818 (weak_alias_test_LDFLAGS): New variable.
15819 (weak_alias_test_LDADD): New variable.
15820 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15821 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15822 (weak_alias_test_3.o): New target.
15823 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15824 * testsuite/weak_alias_test_main.cc: New file.
15825 * testsuite/weak_alias_test_1.cc: New file.
15826 * testsuite/weak_alias_test_2.cc: New file.
15827 * testsuite/weak_alias_test_3.cc: New file.
15828
780e49c5
ILT
158292008-04-08 Ian Lance Taylor <iant@google.com>
15830
cdb0b8f5
ILT
15831 * options.h (class General_options): Add --noinhibit-exec option.
15832 * main.cc (main): Check --noinhibit-exec.
15833
0864d551
ILT
15834 * options.h (class General_options): Define --wrap as a special
15835 option. Add wrap_symbols_ field.
15836 (General_options::any_wrap_symbols): New function.
15837 (General_options::is_wrap_symbol): New function.
15838 * options.cc (General_options::parse_wrap): New function.
15839 (General_options::General_options): Initialize wrap_symbols_.
15840 * symtab.cc (Symbol_table::wrap_symbol): New function.
15841 (Symbol_table::add_from_object): Handle --wrap.
15842 * symtab.h (class Symbol_table): Declare wrap_symbol.
15843 * target.h (Target::wrap_char): New function.
15844 (Target::Target_info): Add wrap_char field.
15845 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15846 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15847 * testsuite/testfile.cc (Target_test::test_target_info):
15848 Likewise.
15849
789aa6de
ILT
15850 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15851 there is one.
15852
2c38906f
ILT
15853 * layout.h (class Layout): Add added_eh_frame_data_ field.
15854 * layout.cc (Layout::Layout): Initialize new field.
15855 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15856 output section until we find a section we merged successfully.
15857 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15858 that the size be non-zero.
15859
780e49c5
ILT
15860 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15861 qualifier.
15862
7fcd0256
ILT
158632008-04-08 Craig Silverstein <csilvers@google.com>
15864
15865 * configure.ac: Export new conditional variable HAVE_ZLIB.
15866 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15867 on HAVE_ZLIB.
15868 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15869 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15870
6835af53
ILT
158712008-04-07 Ian Lance Taylor <iant@google.com>
15872
e24f324c
ILT
15873 * version.cc (version_string): Set to "1.5".
15874
a036edd8
ILT
15875 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15876 Add issued_non_pic_error_ field. Declare check_non_pic.
15877 (Target_x86_64::Scan::check_non_pic): New function.
15878 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15879 (Target_x86_64::Scan::global): Likewise.
15880
624f8810
ILT
15881 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15882 addend parameter. Change caller. Handle merge sections.
15883 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15884 Address to Addend. Don't add in the result of
15885 local_section_offset, pass down the addend and use the returned
15886 value.
15887 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15888 Update declarations of local_section_offset and symbol_value.
15889 * testsuite/two_file_test_1.cc (t18): New function.
15890 * testsuite/two_file_test_2.cc (f18): New function.
15891 * testsuite/two_file_test_main.cc (main): Call t18.
15892 * testsuite/two_file_test.h (t18, f18): Declare.
15893
6835af53
ILT
15894 * configure.ac: Don't test for objdump, c++filt, or readelf.
15895 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15896 conditionals.
15897 (TEST_READELF): New variable.
15898 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15899 (check_PROGRAMS): Add two_file_strip_test.
15900 (two_file_strip_test): New target.
15901 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15902 (two_file_same_shared_strip_test_SOURCES): New variable.
15903 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15904 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15905 (two_file_same_shared_strip_test_LDADD): New variable.
15906 (two_file_shared_strip.so): New target.
15907 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15908 (ver_test_5.syms, ver_test_7.syms): Likewise.
15909 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15910 (strip_test_3.stdout): Use TEST_OBJDUMP.
15911 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15912
86925eef
CC
159132008-04-04 Cary Coutant <ccoutant@google.com>
15914
15915 * symtab.h (Symbol::is_weak_undefined): New function.
15916 (Symbol::is_strong_undefined): New function.
15917 (Symbol::is_absolute): New function.
15918 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15919 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15920 absolute symbols.
15921 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15922 (weak_undef_test): New target.
15923 * testsuite/Makefile.in: Rebuild.
15924 * testsuite/weak_undef_file1.cc: New file.
15925 * testsuite/weak_undef_file2.cc: New file.
15926 * testsuite/weak_undef_test.cc: New file.
15927
126f3ece
ILT
159282008-04-03 Craig Silverstein <csilvers@google.com>
15929
15930 * compressed_output.h (class Output_compressed_section): Use
15931 unsigned buffer.
15932 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15933 add zlib header.
15934 (zlib_compressed_suffix): Removed.
15935 (Output_compressed_section::set_final_data_size): Use unsigned
15936 buffers.
15937 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15938 Fix linker invocation.
15939 (flagstest_o_specialfile_and_compress_debug_sections):
15940 Likewise.
15941 * testsuite/Makefile.in: Regenerated.
15942
deae2a14
DM
159432008-04-02 David S. Miller <davem@davemloft.net>
15944
15945 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15946 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15947
70752818
ILT
159482008-04-02 Craig Silverstein <csilvers@google.com>
15949
15950 * TODO: New file.
15951
39d0cb0e
ILT
159522008-04-02 Ian Lance Taylor <iant@google.com>
15953
15954 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15955 parameters. Update for new key type to views_. Change all
15956 callers.
15957 (File_read::read): Adjust for byteshift in returned view.
15958 (File_read::add_view): New function, broken out of
15959 find_and_make_view.
15960 (File_read::make_view): New function, broken out of
15961 find_and_make_view.
15962 (File_read::find_or_make_view): Add offset and aligned
15963 parameters. Rewrite accordingly. Change all callers.
15964 (File_read::get_view): Add offset and aligned parameters. Adjust
15965 for byteshift in return value.
15966 (File_read::get_lasting_view): Likewise.
15967 * fileread.h (class File_read): Update declarations.
15968 (class File_read::View): Add byteshift_ field. Add byteshift to
15969 constructor. Add byteshift method.
15970 * archive.h (Archive::clear_uncached_views): New function.
15971 (Archive::get_view): Add aligned parameter. Change all callers.
15972 * object.h (Object::get_view): Add aligned parameter. Change all
15973 callers.
15974 (Object::get_lasting_view): Likewise.
15975
15976 * fileread.cc (File_read::release): Don't call clear_views if
15977 there are multiple objects.
15978 * fileread.h (File_read::clear_uncached_views): New function.
15979 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15980 on the archive.
15981
a1207466
CC
159822008-03-31 Cary Coutant <ccoutant@google.com>
15983
15984 Add thin archive support.
15985 * archive.cc (Archive::armagt): New const.
15986 (Archive::setup): Remove task parameter and calls to unlock.
15987 (Archive::unlock_nested_archives): New function.
15988 (Archive::read_header): Add nested_off parameter. Change
15989 all callers.
15990 (Archive::interpret_header): Likewise.
15991 (Archive::include_all_members): Change to handle thin
15992 archives.
15993 (Archive::include_member): Likewise.
15994 * archive.h (Archive::Archive): Add new parameters and
15995 initializers.
15996 (Archive::armagt): New const.
15997 (Archive::setup): Remove task parameter.
15998 (Archive::unlock_nested_archives): New function.
15999 (Archive::read_header): Add nested_off parameter.
16000 (Archive::interpret_header): Likewise.
16001 (Archive::Nested_archive_table): New typedef.
16002 (Archive::is_thin_archive_): New field.
16003 (Archive::nested_archives_): New field.
16004 (Archive::options_): New field.
16005 (Archive::dirpath_): New field.
16006 (Archive::task_): New field.
16007 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16008 for thin archives. Pass additional parameters to
16009 Archive::Archive. Unlock the archive file after calling
16010 Archive::setup.
cd536b21 16011
479f6503
ILT
160122008-03-29 Ian Lance Taylor <iant@google.com>
16013
686c8caf
ILT
16014 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16015 version symbol to be local.
16016 * testsuite/ver_test_4.sh: New file.
16017 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16018 (check_DATA): Add ver_test_4.syms.
16019 (ver_test_4.syms): New target.
16020 * testsuite/Makefile.in: Rebuild.
16021
ab794b6b
ILT
16022 * output.cc
16023 (Output_section::Input_section_sort_entry::has_priority): New
16024 function.
16025 (Output_section::Input_section_sort_entry::match_file_name): New
16026 function.
16027 (Output_section::Input_section_sort_entry::match_section_name):
16028 Remove.
16029 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16030 Remove.
16031 (Output_section::Input_section_sort_entry::match_section_file):
16032 Remove.
16033 (Output_section::Input_section_sort_compare::operator()): Rewrite
16034 using new Input_section_sort_entry functions. Sort crtbegin and
16035 crtend first. Sort sections with no priority before sections with
16036 a priority.
16037 * testsuite/initpri1.c (d3): Check j != 4.
16038 (cd5): New constructor/destructor function.
16039 (main): Check j != 2.
16040
479f6503
ILT
16041 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16042 new symbol when resolving, don't call set_is_default.
16043 * testsuite/ver_test_7.cc: New file.
16044 * testsuite/ver_test_7.sh: New file.
16045 * testsuite/Makefile.am (ver_test_7.so): New target.
16046 (ver_test_7.o): New target.
16047 (check_SCRIPTS): Add ver_test_7.sh.
16048 (check_DATA): Add ver_test_7.syms.
16049 (ver_test_7.syms): New target.
16050
2fd32231
ILT
160512008-03-28 Ian Lance Taylor <iant@google.com>
16052
16053 * layout.cc (Layout::layout): If we see an input section with a
16054 name that needs sorting, set the must_sort flag for the output
16055 section.
16056 (Layout::make_output_section): If the name of the output section
16057 indicates that it might require sorting, set the may_sort flag.
16058 * output.h (Output_section::may_sort_attached_input_sections): New
16059 function.
16060 (Output_section::set_may_sort_attached_input_sections): New
16061 function.
16062 (Output_section::must_sort_attached_input_sections): New
16063 function.
16064 (Output_section::set_must_sort_attached_input_sections): New
16065 function.
16066 (class Output_section): Declare Input_section_sort_entry. Define
16067 Input_section_sort_compare. Declare
16068 sort_attached_input_sections. Add new fields:
16069 may_sort_attached_input_sections_,
16070 must_sort_attached_input_sections_,
16071 attached_input_sections_are_sorted_.
16072 * output.cc (Output_section::Output_section): Initialize new
16073 fields.
16074 (Output_section::add_input_section): Add an entry to
16075 input_sections_ if may_sort or must_sort are true.
16076 (Output_section::set_final_data_size): Call
16077 sort_attached_input_sections if necessary.
16078 (Output_section::Input_section_sort_entry): Define new class.
16079 (Output_section::Input_section_sort_compare::operator()): New
16080 function.
16081 (Output_section::sort_attached_input_sections): New function.
16082 * configure.ac: Check whether the compiler supports constructor
16083 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16084 * testsuite/initpri1.c: New file.
16085 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16086 CONSTRUCTOR_PRIORITY.
16087 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16088 (initpri1_LDFLAGS): New variable.
16089 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16090
18e6b24e
ILT
160912008-03-27 Ian Lance Taylor <iant@google.com>
16092
49bdd526
ILT
16093 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16094 * testsuite/common_test_1.c: New file.
16095 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16096 (common_test_1_SOURCES): New variable.
16097 (common_test_1_DEPENDENCIES): New variable.
16098 (common_test_1_LDFLAGS): New variable.
16099
18e6b24e
ILT
16100 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16101 and commons_ correctly when NAME/VERSION does not override
16102 NAME/NULL.
16103 * testsuite/ver_test_6.c: New file.
16104 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16105 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16106 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16107
04bf7072
ILT
161082008-03-26 Ian Lance Taylor <iant@google.com>
16109
5871526f
ILT
16110 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16111 of an undefined symbol from a version script.
16112 * testsuite/Makefile.am (ver_test_5.so): New target.
16113 (ver_test_5.o): New target.
16114 (check_SCRIPTS): Add ver_test_5.sh.
16115 (check_DATA): Add ver_test_5.syms.
16116 (ver_test_5.syms): New target.
16117 * testsuite/ver_test_5.cc: New file.
16118 * testsuite/ver_test_5.script: New file.
16119 * testsuite/ver_test_5.sh: New file.
16120 * Makefile.in, testsuite/Makefile.in: Rebuild.
16121
04bf7072
ILT
16122 PR gold/5986
16123 Fix problems building gold with gcc 4.3.0.
16124 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16125 (gold_error_at_location, gold_warning_at_location): Use it.
16126 * configure.ac: Check whether we can compile and use a template
16127 function with a printf attribute.
16128 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16129 when jumping over bytes.
16130 * object.cc: Instantiate Object::read_section_data.
16131 * debug.h: Include <cstring>
16132 * dwarf_reader.cc: Include <algorithm>
16133 * main.cc: Include <cstring>.
16134 * options.cc: Include <cstring>.
16135 * output.cc: Include <cstring>.
16136 * script.cc: Include <cstring>.
16137 * script.h: Include <string>.
16138 * symtab.cc: Include <cstring> and <algorithm>.
16139 * target-select.cc: Include <cstring>.
16140 * version.cc: Include <string>.
16141 * testsuite/testmain.cc: Include <cstdlib>.
16142 * configure, config.in: Rebuild.
16143
874c5b28
ILT
161442008-03-25 Ian Lance Taylor <iant@google.com>
16145
819d6c3a
ILT
16146 * options.cc: Include "../bfd/bfdver.h".
16147 (options::help): Print bug reporting address.
16148
f4b2c6f5
ILT
16149 * version.cc (print_version): Adjust output for current value of
16150 BFD_VERSION_STRING.
16151
16152 * NEWS: New file.
16153
e96caa79
ILT
16154 * options.cc (options::help): Print list of supported targets.
16155 * target-select.h: Include <vector>.
16156 (class Target_selector): Make machine_, size_, and is_big_endian_
16157 fields const. Add bfd_name_ and instantiated_target_ fields.
16158 (Target_selector::Target_selector): Add bfd_name parameter.
16159 (Target_selector::recognize): Make non-virtual, call
16160 do_recognize.
16161 (Target_selector::recognize_by_name): Make non-virtual, call
16162 do_recognize_by_name.
16163 (Target_selector::supported_names): New function.
16164 (Target_selector::bfd_name): New function.
16165 (Target_selector::do_instantiate_target): New pure virtual
16166 function.
16167 (Target_selector::do_recognize): New virtual function.
16168 (Target_selector::do_recognize_by_name): New virtual function.
16169 (Target_selector::instantiate_target): New private function.
16170 (supported_target_names): Declare.
16171 * target-select.cc (Target_selector::Target_selector): Update for
16172 new parameter and fields.
16173 (select_target_by_name): Check that the name matches before
16174 calling recognize_by_name.
16175 (supported_target_names): New function.
16176 * i386.cc (class Target_selector_i386): Update Target_selector
16177 constructor call. Remove recognize and recognize_by_name. Add
16178 do_instantiate_target.
16179 * x86_64.cc (class Target_selector_x86_64): Likewise.
16180 * testsuite/testfile.cc (class Target_selector_test): Update for
16181 changes to Target_selector.
16182
874c5b28
ILT
16183 * README: Rewrite, with some notes on unsupported features.
16184
0a65a3a7
CC
161852008-03-24 Cary Coutant <ccoutant@google.com>
16186
16187 * i386.cc (Target_i386::Got_type): New enum declaration.
16188 (Target_i386::Scan::local): Updated callers of Output_data_got
16189 member functions.
16190 (Target_i386::Scan::global): Likewise.
16191 (Target_i386::Relocate::relocate): Likewise.
16192 (Target_i386::Relocate::relocate_tls): Likewise.
16193 * object.h (Got_offset_list): New class.
16194 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16195 (Sized_relobj::local_got_offset): Likewise.
16196 (Sized_relobj::set_local_got_offset): Likewise.
16197 (Sized_relobj::local_has_tls_got_offset): Removed.
16198 (Sized_relobj::local_tls_got_offset): Removed.
16199 (Sized_relobj::set_local_tls_got_offset): Removed.
16200 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16201 * output.cc (Output_data_got::add_global): Added got_type parameter.
16202 (Output_data_got::add_global_with_rel): Likewise.
16203 (Output_data_got::add_global_with_rela): Likewise.
16204 (Output_data_got::add_global_pair_with_rel): New function.
16205 (Output_data_got::add_global_pair_with_rela): New function.
16206 (Output_data_got::add_local): Added got_type parameter.
16207 (Output_data_got::add_local_with_rel): Likewise.
16208 (Output_data_got::add_local_with_rela): Likewise.
16209 (Output_data_got::add_local_pair_with_rel): New function.
16210 (Output_data_got::add_local_pair_with_rela): New function.
16211 (Output_data_got::add_global_tls): Removed.
16212 (Output_data_got::add_global_tls_with_rel): Removed.
16213 (Output_data_got::add_global_tls_with_rela): Removed.
16214 (Output_data_got::add_local_tls): Removed.
16215 (Output_data_got::add_local_tls_with_rel): Removed.
16216 (Output_data_got::add_local_tls_with_rela): Removed.
16217 * output.h (Output_data_got::add_global): Added got_type parameter.
16218 (Output_data_got::add_global_with_rel): Likewise.
16219 (Output_data_got::add_global_with_rela): Likewise.
16220 (Output_data_got::add_global_pair_with_rel): New function.
16221 (Output_data_got::add_global_pair_with_rela): New function.
16222 (Output_data_got::add_local): Added got_type parameter.
16223 (Output_data_got::add_local_with_rel): Likewise.
16224 (Output_data_got::add_local_with_rela): Likewise.
16225 (Output_data_got::add_local_pair_with_rel): New function.
16226 (Output_data_got::add_local_pair_with_rela): New function.
16227 (Output_data_got::add_global_tls): Removed.
16228 (Output_data_got::add_global_tls_with_rel): Removed.
16229 (Output_data_got::add_global_tls_with_rela): Removed.
16230 (Output_data_got::add_local_tls): Removed.
16231 (Output_data_got::add_local_tls_with_rel): Removed.
16232 (Output_data_got::add_local_tls_with_rela): Removed.
16233 * resolve.cc (Symbol::override_base_with_special): Removed
16234 reference to has_got_offset_ field.
16235 * symtab.cc (Symbol::init_fields): Replaced initialization
16236 of got_offset_ with got_offsets_. Removed initialization
16237 of has_got_offset_
53fcba31 16238 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16239 (Symbol::got_offset): Likewise.
16240 (Symbol::set_got_offset): Likewise.
16241 (Symbol::has_tls_got_offset): Removed.
16242 (Symbol::tls_got_offset): Removed.
16243 (Symbol::set_tls_got_offset): Removed.
16244 (Symbol::got_offset_): Removed.
16245 (Symbol::tls_mod_got_offset_): Removed.
16246 (Symbol::tls_pair_got_offset_): Removed.
16247 (Symbol::got_offsets_): New field.
16248 (Symbol::has_got_offset): Removed.
16249 (Symbol::has_tls_mod_got_offset): Removed.
16250 (Symbol::has_tls_pair_got_offset): Removed.
16251 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16252 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16253 member functions.
16254 (Target_x86_64::Scan::global): Likewise.
16255 (Target_x86_64::Relocate::relocate): Likewise.
16256 (Target_x86_64::Relocate::relocate_tls): Likewise.
16257
bd52eafb
BE
162582008-03-25 Ben Elliston <bje@au.ibm.com>
16259
16260 * yyscript.y: Fix spelling error in comment.
16261
8b105e34
ILT
162622008-03-24 Ian Lance Taylor <iant@google.com>
16263
8ed814a9
ILT
16264 * options.h (class General_options): Define build_id option.
16265 * layout.h (class Layout): Declare write_build_id, create_note,
16266 create_build_id. Add build_id_note_ member.
16267 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16268 "libiberty.h", "md5.h", "sha1.h".
16269 (Layout::Layout): Initialize eh_frame_data_,
16270 eh_frame_hdr_section_, and build_id_note_.
16271 (Layout::finalize): Call create_build_id.
16272 (Layout::create_note): New function, broken out of
16273 Layout::create_gold_note.
16274 (Layout::create_gold_note): Call create_note.
16275 (Layout::create_build_id): New function.
16276 (Layout::write_build_id): New function.
16277 (Close_task_runner::run): Call write_build_id.
16278
8b105e34
ILT
16279 * x86_64.cc: Correct license to GPLv3.
16280
086a1841
ILT
162812008-03-23 Ian Lance Taylor <iant@google.com>
16282
16283 * options.cc: Include "demangle.h".
16284 (parse_optional_string): New function.
16285 (parse_long_option): Handle takes_optional_argument.
16286 (parse_short_option): Update dash_z initializer. Handle
16287 takes_optional_argument.
16288 (General_options::General_options): Initialize do_demangle_.
16289 (General_options::finalize): Set do_demangle_. Handle demangling
16290 style.
16291 * options.h (parse_optional_string): Declare.
16292 (struct One_option): Add optional_arg field. Update constructor.
16293 Update call constructor calls. Add takes_optional_argument
16294 function.
16295 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16296 (DEFINE_optional_string): Define.
16297 (General_options::demangle): Change from DEFINE_bool to
16298 DEFINE_optional_string.
16299 (General_options::no_demangle): New function.
16300 (General_options::do_demangle): New function.
16301 (General_options::set_do_demangle): New function.
16302 (General_options::execstack_status_): Move definition to end of
16303 class definition.
16304 (General_options::static_): Likewise.
16305 (General_options::do_demangle_): New field.
16306 * object.cc (big_endian>::get_symbol_location_info): Call
16307 Options::do_demangle, not Options::demangle.
16308 * symtab.cc (demangle): Likewise.
16309
cbb93e63
ILT
163102008-03-22 Ian Lance Taylor <iant@google.com>
16311
16312 * gold.h: Include <cstddef> and <sys/types.h>
16313 * options.h: Include <cstring>.
16314
ec531623
ILT
163152008-03-21 Ian Lance Taylor <iant@google.com>
16316
16317 * Added source code to GNU binutils.
752937aa 16318\f
4b95cf5c 16319Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16320
16321Copying and distribution of this file, with or without modification,
16322are permitted in any medium without royalty provided the copyright
16323notice and this notice are preserved.
16324
16325Local Variables:
16326mode: change-log
16327left-margin: 8
16328fill-column: 74
16329version-control: never
16330End:
This page took 1.174613 seconds and 4 git commands to generate.