psymtab.c (psymtab_search_name): Fix whitespace.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
3ffaac20
AM
12014-11-21 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
4 for undefined weaks.
5
0cfb0717
AM
62014-11-20 Alan Modra <amodra@gmail.com>
7
8 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
9 from --stub-group-size parameter divided by 1024.
10 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
11 template parameter. Update all uses.
12 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
13 has_stub_value. Set for long branches. Don't report overflow for
14 branch to undefined weak symbols. Print info message on
15 overflowing branch to stub.
16
f9dffbf0
AM
172014-11-20 Alan Modra <amodra@gmail.com>
18
19 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
20
e88ba8d5
L
212014-11-13 H.J. Lu <hongjiu.lu@intel.com>
22
23 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
24 entry for R_X86_64_GOTPLT64.
25 (Target_x86_64<size>::Relocate::relocate): Update comments for
26 R_X86_64_GOTPLT64.
27
d37ffe25
ED
282014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
29
30 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
31 * plugin.h: add lock definition
32
9726c3c1
HS
332014-10-29 Han Shen <shenhan@google.com>
34 Jing Yu <jingyu@google.com>
35
36 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
37 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
38 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
39 Symbol::TLS_REF.
40 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
41 method.
42 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
43 (Target_aarch64::tls_ld_to_le): New method.
44 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
45 for 64bit targets.
46 (Output_data_plt_aarch64::irelative_rel_): New data member.
47 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
48 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
49 (Output_data_plt_aarch64::add_relocation): New method.
50 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
51 offset. Add got_irelative size to got size.
52 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
53 type string with the new typename.
54 (AArch64_relocate_functions::update_adr): Replace parameter x with
55 immed.
56 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
57 (AArch64_relocate_functions::reloc_common): New method.
58 (AArch64_relocate_funcsions::rela_general): Extract common part out
59 into reloc_common method.
60 (AArch64_relocate_functions::rela_general): Likewise.
61 (AArch64_relocate_functions::pcrela_general): Likewise.
62 (AArch64_relocate_functions::adr): New method.
63 (AArch64_relocate_functions::adrp): Calculate immed before calling
64 update_adr.
65 (AArch64_relocate_functions::adrp): Likewise.
66 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
67 comparing x to 0. Calculate immed from ~x when x < 0.
68 (Target_aarch64::optimize_tls_reloc): Add new cases for
69 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
70 TLSLD_MOVW_DTPREL_G0_NC.
71 (Target_aarch64::possible_function_pointer_reloc): Implement this
72 method.
73 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
74 comment.
75 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
76 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
77 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
78 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
79 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
80 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
81 (Target_aarch64::make_plt_entry): Call add_entry with two more
82 parameters.
83 (Target_aarch64::make_local_ifunc_plt_entry): New method.
84 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
85 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
86 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
87 (Target_aarch64::Relocate::relocate_tls): Add cases for
88 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
89 TLSLD_MOVW_DTPREL_G0_NC.
90 * testsuite/icf_safe_so_test.cc: Correct test comment.
91 * testsuite/icf_safe_test.sh: Add AArch64 arch.
92
80272b8c
AM
932014-10-22 Alan Modra <amodra@gmail.com>
94
95 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
96 thread_starter.
97
998a69f4
AS
982014-10-18 Andreas Schwab <schwab@linux-m68k.org>
99
100 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
101
aed56ec5
CC
1022014-10-17 Cary Coutant <ccoutant@google.com>
103
104 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
105 Add "typename" keyword.
106
83a01957
HS
1072014-09-22 Han Shen <shenhan@google.com>
108 Jing Yu <jingyu@google.com>
109
110 Patch for gold aarch64 backend to support relaxation.
111 * aarch64-reloc.def: Change format.
112 * aarch64.cc (class Reloc_stub): New class.
113 (class Stub_table): New class.
114 (class AArch64_relobj): New class.
115 (class AArch64_input_section): New class.
116 (class AArch64_output_section): New class.
117 (Target_aarch64::new_stub_table): New method.
118 (Target_aarch64::new_aarch64_input_section): New method.
119 (Target_aarch64::find_aarch64_input_section): New method.
120 (Target_aarch64::scan_section_for_stubs): New method.
121 (Target_aarch64::scan_reloc_section_for_stubs): New method.
122 (Target_aarch64::relocate_stub): New method.
123 (Target_aarch64::current_target): New method.
124 (Target_aarch64::do_make_elf_object): New method.
125 (Target_aarch64::do_may_relax): New method.
126 (Target_aarch64::do_relax): New method.
127 (Target_aarch64::group_sections): New method.
128 (Target_aarch64::scan_reloc_for_stub): New method.
129 (Target_aarch64::do_make_output_section): New method.
130 (Target_aarch64::stub_tables_): New data member.
131 (Target_aarch64::aarch64_input_section_map_): New data member.
132 (AArch64_relocate_functions::maybe_apply_stub): New method.
133
db4c9594
CC
1342014-09-30 Cary Coutant <ccoutant@google.com>
135
136 PR gold/17432
137 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
138
cd6da036
KC
1392014-09-30 Kito Cheng <kito@0xlab.org>
140
141 PR gold/13597
142 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
143 hash table before sysv-style hash table.
144
5f772412
ST
1452014-09-29 Sriraman Tallam <tmsriram@google.com>
146
147 * options.h (--pic-executable): Add negative to alias to -no-pie.
148
5efeedf6
CC
1492014-09-26 Cary Coutant <ccoutant@google.com>
150
151 PR gold/16773
152 * object.cc (Sized_relobj_file): Compute value of section symbols
153 for TLS sections the same as TLS symbols.
154
1707f183
CC
1552014-09-25 Cary Coutant <ccoutant@google.com>
156
157 PR gold/17432
158 * resolve.cc (Symbol_table::resolve): Override common placeholder
159 symbols, but adjust sizes.
160 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
161 symbols to common lists.
162
00cac886
AM
1632014-09-24 Alan Modra <amodra@gmail.com>
164
165 * po/POTFILES.in: Regenerate.
166
635aa30e
CC
1672014-09-23 Taiju Tsuiki <tzik@google.com>
168 Cary Coutant <ccoutant@google.com>
169
71b9b91b 170 PR gold/14860
635aa30e
CC
171 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
172 on input_sections_blocker.
173 * layout.cc (Write_sections_task::locks): Unblock
174 input_sections_blocker_.
175 * layout.h (Write_sections_task::Write_sections_task): Add
176 input_sections_blocker.
177 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
178 to DEPENDENCIES.
179 * testsuite/Makefile.in: Regenerate.
180
c0c71592
RÁE
1812014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
182
183 * testsuite/Makefile.am (plugin_test_10): New test.
184 * testsuite/Makefile.in: Regenerate
185 * testsuite/plugin_common_test_2.c (c1): Align to 8.
186 * testsuite/plugin_test_10.sh: New file.
187
6168c2a1
RÁE
1882014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
189
190 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
191 * resolve.cc (Symbol_table::resolve): Don't override common symbols
192 during the replacement phase.
193
3a531937
JY
1942014-09-17 Han Shen <shenhan@google.com>
195 Jing Yu <jingyu@google.com>
196
197 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
198 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
199 * aarch64.cc (Target_aarch64): Add data members
200 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
201 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
202 constructor.
203 (Target_aarch64::do_reloc_symbol_index): New method.
204 (Target_aarch64::do_reloc_addend): New method.
205 (Target_aarch64::add_tlsdesc_info): New method.
206 (Target_aarch64::do_dynsym_value): New method.
207 (Target_aarch64::do_make_data_plt): Add new parameters: got,
208 got_irelative. Pass them to Output_data_plt_aarch64_standard.
209 (Target_aarch64::make_data_plt): Add new parameters: got,
210 got_irelative. Pass them to do_make_data_plt.
211 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
212 (Target_aarch64::Relocate:tls_gd_to_le): New method.
213 (Target_aarch64::Relocate:tls_ie_to_le): New method.
214 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
215 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
216 (Target_aarch64::got_tlsdesc_section): New method.
217 (Target_aarch64::make_local_ifunc_plt_entry): New method.
218 (Target_aarch64::define_tls_base_symbol): New method.
219 (Target_aarch64::reserve_tlsdesc_entries): New method.
220 (Target_aarch64::got_mod_index_entry): New method.
221 (Target_aarch64::rela_tlsdesc_section): New method.
222 (Target_aarch64::rela_irelative_section): New method.
223 (Target_aarch64::Tlsdesc_info): New struct.
224 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
225 relocations and tlsdesc relocations.
226 (Target_aarch64::optimize_tls_reloc): Implement method.
227 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
228 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
229 in constructor.
230 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
231 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
232 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
233 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
234 (Output_data_plt_aarch64::rela_tlsdesc): New method.
235 (Output_data_plt_aarch64::rela_irelative): New method.
236 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
237 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
238 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
239 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
240 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
241 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
242 (Output_data_plt_aarch64_standard): New member variables:
243 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
244 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
245 New parameter: got, got_irelative.
246 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
247 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
248 (Output_data_plt_aarch64::do_write): Replace got_address with
249 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
250 (AArch64_relocate_functions::update_movnz): New method.
251 (AArch64_relocate_functions): Correct format.
252 (AArch64_relocate_functions::movnz): New method.
253 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
254 before the switch. Add new cases to switch.
00cac886 255 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
256 tlsgd tlsdesc cases.
257 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
258 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
259 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
260 Call reloc_name_in_error_message to print unsupported reloc.
261 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
262 make_data_plt.
263 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
264 relocs. Fill in some more dynamic tags.
265 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
266 Skip call tls_get_addr when tlsgd is relaxed.
267 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
268 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
269 tlsdesc->ie relaxation.
270
62661c93
SS
2712014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
272
273 * mips.cc (Target_mips_nacl): New class.
274 (Target_selector_mips_nacl): New class.
275 (target_selector_mips32): Rename from target_selector_mips32be and use
276 Target_selector_mips_nacl instead of Target_selector_mips.
277 (target_selector_mips32el): Rename from target_selector_mips32 and use
278 Target_selector_mips_nacl instead of Target_selector_mips.
279 (target_selector_mips64): Rename from target_selector_mips64be and use
280 Target_selector_mips_nacl instead of Target_selector_mips.
281 (target_selector_mips64el): Rename from target_selector_mips64 and use
282 Target_selector_mips_nacl instead of Target_selector_mips.
283 (Target_mips::mips_info): Add const attribute.
284
54674d38
CC
2852014-09-02 Cary Coutant <ccoutant@google.com>
286
287 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
288 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
289 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
290 (Sized_incr_dynobj::do_section_name): Likewise.
291 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
292 (Sized_incr_dynobj::do_section_name): Likewise.
293 * object.h (Object::section_name): Likewise.
294 (Object::do_section_name): Likewise.
295 (Sized_relobj_file::do_section_name): Likewise.
296 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
297 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
298
9860cbcf
CC
2992014-09-02 Cary Coutant <ccoutant@google.com>
300
301 PR gold/17005
302 * ehframe.cc (Fde::write): Add output_offset parameter.
303 (Cie::write): Likewise.
304 (Eh_frame::set_final_data_size): Account for offset within output
305 section.
306 (Eh_frame::do_sized_write): Likewise.
307 * ehframe.h (Fde::write): Add output_offset parameter.
308 (Cie::write): Likewise.
309 * output.cc (Output_section::Input_section_sort_entry): Remove
310 section_has_name_; add output_section_name parameter. Use
311 output section name for non-input sections.
312 (Output_section::Input_section_sort_entry::section_has_name): Remove.
313 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
314 (Output_section::Input_section_sort_compare): Remove logic for
315 sections without names.
316 (Output_section::Input_section_sort_init_fini_compare): Likewise.
317 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
318 Likewise.
319 (Output_section::Input_section_sort_section_name_compare): Likewise.
320
8e33481e
HS
3212014-08-29 Han Shen <shenhan@google.com>
322 Jing Yu <jingyu@google.com>
323
324 * aarch64-reloc-property.cc
325 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
326 reference reloc property in the table.
327 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
328 3 other entries.
329 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
330 2 new overloaded methods.
331 (Output_data_got_aarch64::do_write): Add code to write out
332 static relocs.
333 (class Output_data_got_aarch64::Static_reloc): New class to wrap
334 static relocs.
335 (Output_data_got_aarch64::static_relocs): New vector to
336 hold static relocs.
337 (Target_aarch64::TCB_SIZE): New const static memeber.
338 (Target_aarch64::tcb_size): New method.
339 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
340 (Target_aarch64::Relocate::relocate_tls): New method.
341 (Target_aarch64::Scan::local): Add code handling new reloc types.
342 (Target_aarch64::Scan::global): Add code handling new reloc types.
343
81233653
ST
3442014-08-13 Sriraman Tallam <tmsriram@google.com>
345
346 * options.h (-no-pie): Add option.
347
9363c7c3
JY
3482014-08-08 Jing Yu <jingyu@google.com>
349 Han Shen <shenhan@google.com>
350
351 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
352 (DEFFILES): add aarch64-reloc.def.
353 (TARGETSOURCES): Add aarch64-reloc-property.cc.
354 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
355 * Makefile.in: Regenerate.
356 * aarch64-reloc-property.cc: New file.
357 * aarch64-reloc-property.h: New file.
358 * aarch64-reloc.def: New file.
359 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
360 with tab to make the format consistent.
361 (Output_data_got_aarch64::symbol_table_): New method.
362 (Target_aarch64::do_plt_address_for_global): New method.
363 (Target_aarch64::do_plt_address_for_local): New method.
364 (Target_aarch64::do_select_as_default_target): New method.
365 (Target_aarch64::do_make_data_plt): New method.
366 (Target_aarch64::make_data_plt): New method.
367 (Output_data_plt_aarch64::has_irelative_section): New method.
368 (Output_data_plt_aarch64::address_for_global): New method.
369 (Output_data_plt_aarch64::address_for_local): New method.
370 (Output_data_plt_aarch64::irelative_rel_): New parameter.
371 (Output_data_plt_aarch64::add_entry): Implement contents.
372 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
373 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
374 the got_pov entry to plt0.
375 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
376 Implement contents.
377 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
378 (AArch64_howto): New struct.
379 (aarch64_howto[]): New static const array.
380 (AArch64_relocate_functions): New class.
381 (Target_aarch64::Scan::get_reference_flags): Remove method.
382 (Target_aarch64::Scan::local): Implement to support a few relocations.
383 (Target_aarch64::Scan::global): Implement to support a few relocations.
384 (Target_aarch64::make_plt_section): Implement contents.
385 (Target_aarch64::make_plt_entry): Implement contents.
386 (Target_aarch64::do_finalize_sections): Implement contents.
387 (Target_aarch64::Relocate::relocate): Implement a few relocations.
388 (Target_aarch64::relocate_section): Implement contents.
389
ad9fe6c1
AM
3902014-08-06 Alan Modra <amodra@gmail.com>
391
392 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
393
7cd4e5b7
AM
3942014-08-06 Alan Modra <amodra@gmail.com>
395
396 PR 13227
397 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
398
5ad9b0a7
ST
3992014-07-21 Sriraman Tallam <tmsriram@google.com>
400
401 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 402 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 403
e051745c
CC
4042014-07-08 Cary Coutant <ccoutant@google.com>
405
406 * expression.cc (struct Expression::Expression_eval_info): Add
407 new fields type_pointer, vis_pointer, and nonvis_pointer.
408 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
409 nonvis_pointer parameters. Adjust all calls.
410 (Symbol_expression::value): Update type, visibility, and nonvis bits
411 in caller.
412 * script.cc (Symbol_assignment::sized_finalize): Update type,
413 visibility, and remaining st_other bits for new symbol.
414 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
415 vis_pointer, and nonvis_pointer parameters.
416 * symtab.h (Symbol::set_type): New method.
417
418 * testsuite/Makefile.am (defsym_test): New test.
419 * testsuite/Makefile.in: Regenerate.
420 * testsuite/defsym_test.c: New file.
421 * testsuite/defsym_test.sh: New file.
422
f35c4853
CC
4232014-07-08 Cary Coutant <ccoutant@google.com>
424
425 PR gold/15639
426 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
427 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
428 (Sized_dynobj::base_read_symbols): ...new method.
429 * object.h (Sized_relobj_file::base_read_symbols): New method.
430 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
431 (Sized_relobj_file::base_read_symbols): ...new method.
432 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
433 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
434 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
435
2900af2d
AM
4362014-07-04 Alan Modra <amodra@gmail.com>
437
438 * po/POTFILES.in: Regenerate.
439
053a4d68
JY
4402014-07-02 Jing Yu <jingyu@google.com>
441
442 * aarch64.cc: New file
443 * Makefile.am (TARGETSOURCES): Add aarch64.cc
444 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
445 * Makefile.in: Regenerate.
446 * configure.tgt: Add entries for aarch64*.
447 * configure.ac: Likewise.
448 * configure: Likewise.
449
7b549045
AM
4502014-06-27 Alan Modra <amodra@gmail.com>
451
452 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
453
cb818dbf
CC
4542014-06-24 Cary Coutant <ccoutant@google.com>
455
456 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
457 sections.
458 (Dwo_file::sized_read_unit_index): Likewise.
459
9810d34d
SS
4602014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
461
462 * mips.cc: New file.
463 * Makefile.am (TARGETSOURCES): Add mips.cc
464 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
465 * configure.tgt: Add entries for mips*.
466 * configure.ac: Likewise.
467 * Makefile.in: Regenerate.
468 * configure: Likewise.
469
9baa787b
CC
4702014-06-09 Cary Coutant <ccoutant@google.com>
471
472 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
473 unit_length is within section bounds.
474
8f89af0a
CC
4752014-06-09 Cary Coutant <ccoutant@google.com>
476
477 PR gold/16980
478 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
479 map.
480
a47622ac
AM
4812014-06-07 Alan Modra <amodra@gmail.com>
482
483 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
484
4320c691
CC
4852014-06-06 Cary Coutant <ccoutant@google.com>
486
487 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
488 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
489 (Dwarf_pubnames_table::read_header): Likewise.
490 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
491 .debug_gnu_pubtypes.
492
270c9937
JB
4932014-06-05 Joel Brobecker <brobecker@adacore.com>
494
495 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
496 * Makefile.in, configure: Regenerate.
497
397998fc
AM
4982014-06-03 Alan Modra <amodra@gmail.com>
499
500 * powerpc.cc (addis_12_2): Define.
501 (Stub_table::do_write): Support fusion on ELFv2 stubs.
502
61f5c66f
AM
5032014-06-03 Alan Modra <amodra@gmail.com>
504
505 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
506 st_other output.
507
f6971787
AM
5082014-06-02 Alan Modra <amodra@gmail.com>
509
510 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
511 Only ignore relocs on ELFv1.
512 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
513
f6fb8322
CC
5142014-05-30 Cary Coutant <ccoutant@google.com>
515
516 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
517 * testsuite/Makefile.in: Regenerate.
518 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
519
c23dd342
L
5202014-05-27 H.J. Lu <hongjiu.lu@intel.com>
521
522 PR gold/16945
523 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
524 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
525
5fe7ffdc
AM
5262014-05-15 Alan Modra <amodra@gmail.com>
527
528 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
529 Compare FDE contents with DW_CFA_nop rather than 0.
530
a82bef93
ST
5312014-05-13 Sriraman Tallam <tmsriram@google.com>
532
533 * symtab.h (may_need_copy_reloc): Remove check for position independent
534 code.
535 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
536 position independence before pc absolute may_need_copy_reloc call.
537 Add check for executable output befor pc relative may_need_copy_reloc
538 call.
539 * i386.cc: Ditto.
540 * arm.cc: Ditto.
541 * sparc.cc: Ditto.
542 * tilegx.cc: Ditto.
543 * powerpc.cc: Add check for no position independence before
544 may_need_copy_reloc calls.
545 * testsuite/pie_copyrelocs_test.cc: New file.
546 * testsuite/pie_copyrelocs_shared_test.cc: New file.
547 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 548 * Makefile.in: Regenerate.
a82bef93 549
53c66605
ML
5502014-05-08 Martin Liška <mliska@suse.cz>
551
552 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
553
57b2284c
CC
5542014-05-06 Cary Coutant <ccoutant@google.com>
555
556 PR gold/16900
557 * i386.cc (Output_data_got_plt_i386): New class.
558 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
559 parameter. Change all callers.
560 (Output_data_plt_i386::layout_): Remove.
561 (Output_data_plt_i386::got_plt_): Change type.
562 (Target_i386::got_plt_): Change type. Change all references.
563 (Target_i386::got_section): Create instance of new class.
564 (Output_data_got_plt_i386::do_write): New function.
565 * x86_64.cc (Output_data_got_plt_x86_64): New class.
566 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
567 parameter. Change all callers.
568 (Output_data_plt_x86_64::layout_): Remove.
569 (Output_data_plt_x86_64::got_plt_): Change type.
570 (Target_x86_64::got_plt_): Change type. Change all references.
571 (Target_x86_64::got_section): Create instance of new class.
572 (Output_data_got_plt_x86_64::do_write): New function.
573 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
574 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
575 class.
576
6b97515d 5772014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 578
6b97515d
CC
579 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
580 if we have pubnames/pubtypes.
581
d1bddd3c
CC
5822014-05-02 Cary Coutant <ccoutant@google.com>
583
5fe7ffdc
AM
584 * defstd.cc (in_segment): Define __ehdr_start here...
585 * layout.cc (Layout::finalize): ...Instead of here. Set the
586 output segment when known.
587 * resolve.cc (Symbol::override_base_with_special): Remember
588 the original binding.
589 * symtab.cc (Symbol::set_output_segment): New function.
590 (Symbol::set_undefined): New function.
591 * symtab.h (Symbol::is_weak_undefined): Check original undef
592 binding.
593 (Symbol::is_strong_undefined): New function.
594 (Symbol::set_output_segment): New function.
595 (Symbol::set_undefined): New function.
596 * target-reloc.h (is_strong_undefined): Remove.
597 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
598 Check for hidden undefs.
599 (relocate_section): Call Symbol::is_strong_undefined.
600
601 * testsuite/Makefile.am (ehdr_start_test_1)
602 (ehdr_start_test_2, ehdr_start_test_3)
603 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
604 * testsuite/Makefile.in: Regenerate.
605 * testsuite/ehdr_start_def.cc: New source file.
606 * testsuite/ehdr_start_test.cc: New source file.
607 * testsuite/ehdr_start_test.t: New linker script.
608 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 609
7849f6d8
CC
6102014-04-23 Cary Coutant <ccoutant@google.com>
611
bf2cc635 612 PR gold/16870
7849f6d8
CC
613 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
614
99fd8cff
CC
6152014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
616
617 * layout.cc (Layout::include_section): Allow a target to decide
618 whether to include a section.
619 * target.h (Target::should_include_section): New function.
620 (Target::do_should_include_section): New function.
621
91f43acd
CC
6222014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
623
624 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
625 inline into ...
626 (Copy_relocs::emit): ... here.
627 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
628 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
629 (Copy_reloc_entry::entries_): Change from private to protected.
630
c4eb27e1
ST
6312014-04-02 Sriraman Tallam <tmsriram@google.com>
632
633 * icf.cc (get_section_contents): Replace copies of reloc
634 vectors with const references.
635
ae447ddd
CC
6362014-04-02 Cary Coutant <ccoutant@google.com>
637
638 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
639 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
640 * configure: Regenerate.
641 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
642 -fno-use-linker-plugin.
643 (LINK1, CXXLINK1): Add it to the link command.
644 * testsuite/Makefile.in: Regenerate.
645
fa47fa92
AM
6462014-03-12 Alan Modra <amodra@gmail.com>
647
648 * Makefile.in: Regenerate.
649
9b12c500
CC
6502014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
651
652 * symtab.h (Symbol::set_nonvis): New function.
653
beacaa96
CC
6542014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
655
656 * symtab.cc (Sized_symbol<32>::init_output_data):
657 Instantiate the template.
658 (Sized_symbol<64>::init_output_data): Likewise.
659
800d9823
CC
6602014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
661
662 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
663 adjust dynamic symbol value.
664 * target.h (Target::adjust_dyn_symbol): New function.
665 (Target::do_adjust_dyn_symbol): New function.
666
918fc1f8 6672014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 668
918fc1f8
CC
669 * output.cc (Output_data_dynamic::Dynamic_entry::write):
670 Get the value of DYNAMIC_CUSTOM dynamic entry.
671 * output.h (Output_data_dynamic::add_custom): New function.
672 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
673 dynamic entry.
674 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
675 * target.h (Target::dynamic_tag_custom_value): New function.
676 (Target::do_dynamic_tag_custom_value): New function.
677
98ff9231
CC
6782014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
679
680 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
681 dynsym indexes.
682 * target.h (Target::has_custom_set_dynsym_indexes): New function.
683 (Target::do_has_custom_set_dynsym_indexes): New function.
684 (Target::set_dynsym_indexes): New function.
685 (Target::do_set_dynsym_indexes): New function.
686
b80eed39
AM
6872014-03-07 Alan Modra <amodra@gmail.com>
688
689 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
690 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
691 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
692 (Powerpc_relocate_functions::has_overflow_bitfield,
693 overflowed): Use the above.
694 (Target_powerpc::Relocate::relocate): Correct overflow checking
695 for a number of relocations. Modify overflow test for 16-bit
696 fields in instructions to signed/unsigned according to whether
697 the field takes a signed or unsigned value.
698
4b95cf5c
AM
6992014-03-05 Alan Modra <amodra@gmail.com>
700
701 Update copyright years.
702
45965137
AM
7032014-03-05 Alan Modra <amodra@gmail.com>
704
705 * powerpc.cc (Target_powerpc::Scan::local, global): Support
706 R_PPC64_ADDR64_LOCAL.
707 (Target_powerpc::Relocate::relocate): Likewise.
708
2c80b753
AM
7092014-03-03 Alan Modra <amodra@gmail.com>
710
711 * dwp.cc (print_version): Update copyright year to current.
712
c1c69e83
AM
7132014-02-10 Alan Modra <amodra@gmail.com>
714
715 * po/gold.pot: Regenerate.
716
dd0c4e70
CC
7172014-02-06 Cary Coutant <ccoutant@google.com>
718
719 Fix problem where -u is ignored when a weak undef is seen.
720
721 * archive.cc (Library_base::should_include_member): Reorder
722 code to check for -u option if a weak undef has already been seen.
723 * testsuite/Makefile.am (weak_undef_test_2): New test case.
724 * testsuite/Makefile.in: Regenerate.
725 * testsuite/weak_undef_file3.cc: New file.
726 * testsuite/weak_undef_file4.cc: New file.
727 * testsuite/weak_undef_test_2.cc: New file.
728
1a221d3d
CC
7292014-02-05 Cary Coutant <ccoutant@google.com>
730
731 Fix issues with gold undefined symbol diagnostics.
732
733 PR binutils/15435
734 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
735 check to here.
736 * target-reloc.h (is_strong_undefined): New function.
737 (relocate_section): Move undef vtable symbol check from here.
738 Check for is_strong_undefined.
739
e889f0a4 7402014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 741
e889f0a4
CC
742 Fix problems with the --dynamic-list option.
743
744 PR gold/13577
745 * options.cc (General_options::parse_dynamic_list):
746 Set have_dynamic_list_.
747 (General_options::General_options): Initialize have_dynamic_list_.
748 (General_options::finalize): Turn off -Bsymbolic and
749 -Bsymbolic-functions if --dynamic-list provided.
750 * options.h (General_options::have_dynamic_list): New function.
751 (General_options::have_dynamic_list_): New data member.
752 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
753 correctly.
5fe7ffdc 754
e889f0a4
CC
755 PR gold/16530
756 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
757 in --dynamic-list, mark it.
5fe7ffdc 758
e889f0a4
CC
759 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
760 (dynamic_list_2): New test case.
761 * testsuite/Makefile.in: Regenerate.
762 * testsuite/dynamic_list_2.cc: New file.
763 * testsuite/dynamic_list_2.t: New file.
764 * testsuite/dynamic_list_lib1.cc: New file.
765 * testsuite/dynamic_list_lib2.cc: New file.
766 * testsuite/gc_dynamic_list_test.c: New file.
767 * testsuite/gc_dynamic_list_test.sh: New file.
768 * testsuite/gc_dynamic_list_test.t: New file.
769
ec673e64
CC
7702014-01-28 Cary Coutant <ccoutant@google.com>
771
772 Add .gdb_index version 7 support.
773
774 * gold/dwarf_reader.cc: include <utility> (for make_pair).
775 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
776 debug sections.
777 (Dwarf_ranges_table::read_ranges_table): Likewise.
778 (Dwarf_pubnames_table::read_section): Check for GNU-style
779 sections, and for compressed debug sections.
780 (Dwarf_pubnames_table::read_header): Compute end address of table.
781 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
782 for end of list by offset, not by offset == 0.
783 (Dwarf_info_reader::do_read_string_table): Check for compressed
784 debug sections.
785 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
786 Initialize new data members.
787 (Dwarf_pubnames_table::next_name): return flag_byte.
788 (Dwarf_pubnames_table::end_of_table_): New data member.
789 (Dwarf_pubnames_table::is_gnu_style_): New data member.
790 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
791 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
792 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
793 read skeleton type unit DIEs.
794 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
795 (Gdb_index::do_write): Write flag_byte.
796 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
797 (Gdb_index::Cu_vector): Store flags along with cu indexes.
798 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
799 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
800
221fd5d5
L
8012014-01-08 H.J. Lu <hongjiu.lu@intel.com>
802
803 * version.cc (print_version): Update copyright year to 2014.
804
6c09fb0b
ILT
8052013-12-19 Dimitry Andric <dimitry@andric.com>
806
807 * stringpool.cc (Stringpool_template::reserve): Add
808 HAVE_UNORDERED_MAP case.
809 * stringpool.cc (Stringpool_template::print_stats): Likewise.
810
8356f2d0
CC
8112013-12-18 Cary Coutant <ccoutant@google.com>
812
813 * configure.ac: Check for <unordered_set> and <unordered_map>.
814 * config.in: Regenerate.
815 * configure: Regenerate.
816 * system.h: Use <unordered_set> and <unordered_map> if available.
817
f2c7d7ee
RM
8182013-12-10 Roland McGrath <mcgrathr@google.com>
819
820 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
821 with $(INSTALL_PROGRAM_ENV).
822 * Makefile.in: Regenerate.
823
6632e8cc
CC
8242013-11-22 Cary Coutant <ccoutant@google.com>
825
826 * configure.ac: Add check for which library is needed for
827 dlopen.
828 * configure: Regenerate.
829
0c075858
CC
8302013-11-22 Cary Coutant <ccoutant@google.com>
831
832 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
833 assembler.
834 * testsuite/Makefile.in: Regenerate.
835
f49fe902
L
8362013-11-17 H.J. Lu <hongjiu.lu@intel.com>
837
838 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
839 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
840 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
841 (Target_x86_64<size>::Scan::local): Likewise.
842 (Target_x86_64<size>::Scan::global): Likewise.
843 (Target_x86_64<size>::Relocate::relocate): Likewise.
844 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
845 Likewise.
846 (Target_x86_64<size>::Scan::check_non_pic(): Handle
847 R_X86_64_PC32_BND.
848
849 * testsuite/Makefile.am (check_PROGRAMS): Add
850 exception_x86_64_bnd_test.
851 (exception_x86_64_bnd_test_SOURCES): New macro.
852 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
853 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
854 (exception_x86_64_bnd_test_LDADD): Likewise.
855 (exception_x86_64_bnd_1.o): New rule.
856 (exception_x86_64_bnd_2.o): Likewise.
857 * testsuite/Makefile.in: Regenerated.
858
9055360d
AM
8592013-11-15 Alan Modra <amodra@gmail.com>
860
861 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
862 accessor.
863 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
864 Only call ppc64_local_entry_offset for 64-bit. Restrict
865 symval_for_branch lookup to ELFv1.
866 (Stub_table::add_plt_call_entry): Use unsigned int off.
867 (Output_data_glink::Address, invalid_address): New.
868 (Output_data_glink::add_eh_frame): Move out of line. Add
869 support for ELFv2.
870 (Output_data_glink::add_global_entry, find_global_entry,
871 global_entry_address): New functions.
872 (Output_data_glink::global_entry_stubs_, end_branch_table_,
873 ge_size): New variables.
874 (Output_data_glink::set_final_data_size): Add global entry
875 stub sizing.
876 (Output_data_glink::do_write): Write global entry stubs.
877 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
878 parameter. Return true for ELFv2. Adjust callers.
879 (Target_powerpc::Scan::local, global): Restrict opd lookup to
880 ELFv1. Similarly for ifunc and dynamic relocation processing
881 specific to ELFv1. Recognize that symbols are defined on
882 their plt entries for ELFv2.
883 (Target_powerpc::symval_for_branch): Assert if called for
884 ELFv2 or ppc32.
885 (Target_powerpc::Relocate::relocate): Use global entry plt
886 stub for symbol value if such exists on ELFv2.
887 (Target_powerpc::Relocate::relocate): Don't call
888 symval_for_branch when ELFv2. Do adjust for local entry
889 offset when ELFv2.
890 (Target_powerpc::do_dynsym_value): Set symbols to global entry
891 plt stub for ELFv2.
892 (Target_powerpc::do_plt_address_for_global): Similarly.
893
cafdd569
CC
8942013-11-14 Cary Coutant <ccoutant@google.com>
895
896 Revert patch -- this did not fix the problem, and there is
897 no race there.
898
899 2013-11-14 Cary Coutant <ccoutant@google.com>
900
901 PR gold/14860
902 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
903 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
904 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
905 updating fde_offsets_.
906 (Eh_frame_hdr::lock_): New data member.
907
94e49e16
CC
9082013-11-14 Cary Coutant <ccoutant@google.com>
909
910 * dwp.cc (Dwo_file_entry): New type.
911 (File_list): Use Dwo_file_entry.
912 (Dwo_file::verify): New function.
913 (Dwo_file::verify_dwo_list): New function.
914 (Dwo_file::sized_verify_dwo_list): New function.
915 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
916 list.
917 (Dwp_options): New enum type.
918 (dwp_options): Add --verify-only.
919 (usage): Likewise.
920 (main): Likewise.
921 * dwp.h (gold_info): Add declaration.
922
7cdd7d57
CC
9232013-11-14 Cary Coutant <ccoutant@google.com>
924
925 PR gold/14860
926 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
927 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
928 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
929 updating fde_offsets_.
930 (Eh_frame_hdr::lock_): New data member.
931
1d946cb3
CC
9322013-11-06 Cary Coutant <ccoutant@google.com>
933
934 PR gold/15758
935 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
936 before reloc sections.
937
4f65b40e
AM
9382013-11-04 Alan Modra <amodra@gmail.com>
939
940 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
941 (Symbol::needs_dynamic_reloc): Test new flag.
942 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
943 (Target_powerpc::Scan::get_reference_flags): Add target param.
944 Return FUNC_DESC_ABI for 64-bit ELFv1.
945 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
946 call.
947 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
948 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
949
908794a9
CC
9502013-10-31 Cary Coutant <ccoutant@google.com>
951
952 Restore support for dwp v2 DWARF package file format.
953
954 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
955 tu_length parameter. Adjust all callers.
956 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
957 * dwp.cc: Include dwarf.h.
958 (Section_bounds): New struct type.
959 (Unit_set): New struct type.
960 (Dwo_file::Dwo_file): Initialize new data member.
961 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
962 Combine and rename to...
963 (Dwo_file::read_unit_index): ...this.
964 (Dwo_file::sized_read_compunit_index)
965 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
966 (Dwo_file::sized_read_unit_index): ...this.
967 (Dwo_file::copy_section): Remove section_name, is_str_offsets
968 parameters; add section_id parameter.
969 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
970 (Dwo_file::add_unit_set): ...this.
971 (Dwo_file::shndx_map_): Remove.
972 (Dwo_file::sect_offsets_): New data member.
973 (Dwp_output_file::Dwp_output_file): Initialize new data members.
974 (Dwp_output_file::add_section): Rename to...
975 (Dwp_output_file::add_contribution): ...this.
976 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
977 (Dwp_output_file::add_tu_set): Likewise.
978 (Dwp_output_file::Contribution): New type.
979 (Dwp_output_file::Section::contributions): New data member.
980 (Dwp_output_file::Cu_or_tu_set): Remove.
981 (Dwp_output_file::Section::Section): New ctor.
982 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
983 (Dwp_output_file::Dwp_index::Section_table): New type.
984 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
985 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
986 parameter.
987 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
988 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
989 (Dwp_output_file::Dwp_index::section_table): New member function.
990 (Dwp_output_file::Dwp_index::section_table_end): New member function.
991 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
992 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
993 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
994 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
995 (Dwp_output_file::Dwp_index::section_table_): New data member.
996 (Dwp_output_file::Dwp_index::section_mask_): New data member.
997 (Dwp_output_file::add_output_section): New member function.
998 (Dwp_output_file::write_new_section): New member function.
999 (Dwp_output_file::write_contributions): New member function.
1000 (Dwp_output_file::section_id_map_): New data member.
1001 (class Dwo_id_info_reader): Remove.
1002 (class Unit_reader): New class.
1003 (get_dwarf_section_name): New function.
1004 (Dwo_file::read_executable): Adjust initializations of class data.
1005 (Dwo_file::read): Add support for v2 package file format.
1006 (Dwo_file::read_unit_index): Likewise.
1007 (Dwo_file::sized_read_unit_index): Likewise.
1008 (Dwo_file::copy_section): Likewise.
1009 (Dwo_file::add_unit_set): Likewise.
1010 (Dwp_output_file::add_output_section): Likewise.
1011 (Dwp_output_file::add_contribution): Likewise.
1012 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1013 for empty slot.
1014 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1015 file format.
1016 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1017 slot.
1018 (Dwp_output_file::initialize): Remove unused function.
1019 (Dwp_output_file::finalize): Add support for v2 package file format.
1020 (Dwp_output_file::write_index): Likewise.
1021 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1022 function prototype.
1023
2500c017
CC
10242013-10-31 Cary Coutant <ccoutant@google.com>
1025
1026 * configure.ac: Fix check for -fmerge-constants.
1027 * configure.ac: Regenerate.
1028
dd0845d7
RM
10292013-10-30 Roland McGrath <mcgrathr@google.com>
1030
1031 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1032 Correct 9-byte nop sequence to match what the assembler generates.
1033
b4f7960d
AM
10342013-10-30 Alan Modra <amodra@gmail.com>
1035
1036 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1037 ppc64_local_entry_offset, ppc64_local_entry_offset,
1038 do_read_symbols): New functions.
1039 (Powerpc_relobj::e_flags_, st_other_): New vars.
1040 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1041 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1042 (Powerpc_relobj::e_flags_): New var.
1043 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1044 and adjust for ELFv2.
1045 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1046 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1047 (Powerpc_dynobj::do_find_special_sections): Likewise.
1048 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1049 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1050 to ELFv2 local entry.
1051 (Target_powerpc::do_relax): No thread safe barriers needed for
1052 ELFv2.
1053 (Output_data_plt_powerpc::initial_plt_entry_size_,
1054 plt_entry_size): Delete. Replace all uses with
1055 first_plt_entry_offset() and plt_entry_size().
1056 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1057 reserved_size parm. Update callers.
1058 (Output_data_plt_powerpc::entry_count): Update.
1059 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1060 and use Target_powerpc::first_plt_entry_offset().
1061 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1062 rename to plt_entry_size.
1063 (Output_data_plt_powerpc::add_ifunc_entry,
1064 add_local_ifunc_entry): Adjust reloc for ELFv2.
1065 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1066 (glink_eh_frame_fde_64v2): New.
1067 (Stub_table::plt_call_size): Support ELFv2 sizing.
1068 (Output_data_glink::add_eh_frame): Use the new FDE.
1069 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1070 (Stub_table::do_write): Write ELFv2 stubs and glink.
1071 (Target_powerpc::Relocate::relocate): Replaces nop after call
1072 with ld 2,24(1) and adjust local offset destination for ELFv2.
1073
f9c6b907
AM
10742013-10-30 Alan Modra <amodra@gmail.com>
1075
1076 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1077 (Target_powerpc::Scan::global, local): Likewise.
1078 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1079 on all ppc64 @h and @ha relocs.
1080
e84fe78f
AM
10812013-10-14 Alan Modra <amodra@gmail.com>
1082
1083 * output.h (Output_data_got::add_constant): Tidy.
1084 (Output_data_got::add_constant_pair): New function.
1085 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1086 methods used so as to first call reserve_ent().
1087
679e4abf
RM
10882013-10-11 Roland McGrath <mcgrathr@google.com>
1089
44dcb735
RM
1090 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1091 add_got_entry and add_got_entry_pair.
1092
13323c49
RM
1093 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1094 (HAVE_PUBNAMES): Likewise.
1095 * configure: Regenerate.
1096
1496b446
RM
1097 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1098 * testsuite/Makefile.in: Regenerate.
1099
cc84c10b
RM
1100 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1101 Remove const from declaration.
1102 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1103 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1104 * output.h (Output_file_header): Remove const from member target_
1105 and corresponding constructor argument.
1106 * output.cc (Output_file_header::Output_file_header): Update prototype.
1107 (Output_file_header::do_sized_write): Use this->target_ in place
1108 of parameters()->target().
1109
52f66a2c
RM
1110 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1111
2b64b551
RM
1112 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1113 * configure: Regenerate.
1114 * Makefile.in: Regenerate.
1115 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1116 * testsuite/merge_string_literals_2.c: Likewise.
1117 * testsuite/Makefile.am
1118 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1119 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1120 literal -fmerge-constants.
1121 * testsuite/Makefile.in: Regenerate.
1122
43819297
RM
1123 * i386.cc (Target_i386): Remove unused member dynbss_.
1124 * arm.cc (Target_arm): Likewise.
1125 * powerpc.cc (Target_powerpc): Likewise.
1126 * sparc.cc (Target_sparc): Likewise.
1127 * tilegx.cc (Target_tilegx): Likewise.
1128 * x86_64.cc (Target_x86_64): Likewise.
1129 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1130 type_signature_, type_offset_.
1131 * plugin.h (Plugin_hook): Remove unused member layout_.
1132 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1133 mapfile_.
1134 (Read_member): Remove unused members input_objects_, symtab_,
1135 mapfile_, layout_.
1136 (Check_library): Remove unused member symtab_.
1137 * archive.h (Lib_group): Remove unused member lib_.
1138 * archive.cc (Lib_group::Lib_group): Update initializer.
1139 * incremental.h (Incremental_binary): Remove unused member target_.
1140 (Incremental_script_entry): Removed unused member script_.
1141 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1142 * icf.h (Icf): Remove unused member num_tracked_relocs.
1143
39d9ead7
RM
1144 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1145 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1146 its only use.
1147 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1148
679e4abf
RM
1149 * archive.h: Use struct rather than class for forward declaration
1150 of Read_symbols_data.
1151
54de2ea6
CC
11522013-10-07 Cary Coutant <ccoutant@google.com>
1153
1154 PR gold/16010
1155 * testsuite/Makefile.am (icf_test): Fix dependencies.
1156 (icf_safe_test): Likewise.
1157 (icf_safe_so_test): Likewise.
1158 (large_symbol_alignment): Add empty _LDADD rule.
1159 * testsuite/Makefile.in: Regenerate.
1160
b14016f0
L
11612013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1162
1163 PR gold/15927
1164 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1165 relocation for R_X86_64_32 on x32.
1166
eb426534
RM
11672013-08-27 Roland McGrath <mcgrathr@google.com>
1168
1169 * output.cc (Output_segment::set_section_addresses): Take new
1170 Target* argument. If target->isolate_execinstr() and the segment
1171 is executable and starts at a target->abi_pagesize() boundary,
1172 pad its end out to a target->abi_pagesize() boundary with code fill.
1173 * output.h (Output_segment::set_section_addresses): Update decl.
1174 * layout.h (Layout::check_output_data_for_reset_values): Take new
1175 argument RELAX_OUTPUTS.
1176 (Layout): New member relax_output_list_.
1177 (Layout::add_relax_output): New method.
1178 * layout.cc (Layout::Layout): Update constructor.
1179 (Layout::reset_relax_output): New method.
1180 (Layout::clean_up_after_relaxation): Call it.
1181 (Layout::prepare_for_relaxation): Update caller.
1182 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1183 Call reset_relax_output before re-processing segments for
1184 isolate_execinstr case.
1185 (Layout::write_data): Handle relax_output_list_.
1186 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1187 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1188
9aff4b7a
NC
11892013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1190
1191 PR binutils/15834
1192 * object.h: Fix typos.
1193
93f8221c
RM
11942013-08-16 Roland McGrath <mcgrathr@google.com>
1195
1196 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1197 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1198
e44c3715
CC
11992013-08-07 Cary Coutant <ccoutant@google.com>
1200
1201 Revert support for v2 DWP files:
1202
1203 2013-03-01 Cary Coutant <ccoutant@google.com>
1204
1205 Add dwp support for v2 DWARF package file format.
1206 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1207 tu_length parameter. Adjust all callers.
1208 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1209 * dwp.cc: Include dwarf.h.
1210 (Section_bounds): New struct type.
1211 (Unit_set): New struct type.
1212 (Dwo_file::Dwo_file): Initialize new data member.
1213 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1214 Combine and rename to...
1215 (Dwo_file::read_unit_index): ...this.
1216 (Dwo_file::sized_read_compunit_index)
1217 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1218 (Dwo_file::sized_read_unit_index): ...this.
1219 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1220 parameters; add section_id parameter.
1221 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1222 (Dwo_file::add_unit_set): ...this.
1223 (Dwo_file::shndx_map_): Remove.
1224 (Dwo_file::sect_offsets_): New data member.
1225 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1226 (Dwp_output_file::add_section): Rename to...
1227 (Dwp_output_file::add_contribution): ...this.
1228 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1229 (Dwp_output_file::add_tu_set): Likewise.
1230 (Dwp_output_file::Contribution): New type.
1231 (Dwp_output_file::Section::contributions): New data member.
1232 (Dwp_output_file::Cu_or_tu_set): Remove.
1233 (Dwp_output_file::Section::Section): New ctor.
1234 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1235 (Dwp_output_file::Dwp_index::Section_table): New type.
1236 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1237 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1238 parameter.
1239 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1240 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1241 (Dwp_output_file::Dwp_index::section_table): New member function.
1242 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1243 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1244 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1245 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1246 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1247 (Dwp_output_file::Dwp_index::section_table_): New data member.
1248 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1249 (Dwp_output_file::add_output_section): New member function.
1250 (Dwp_output_file::write_new_section): New member function.
1251 (Dwp_output_file::write_contributions): New member function.
1252 (Dwp_output_file::section_id_map_): New data member.
1253 (class Dwo_id_info_reader): Remove.
1254 (class Unit_reader): New class.
1255 (get_dwarf_section_name): New function.
1256 (Dwo_file::read_executable): Adjust initializations of class data.
1257 (Dwo_file::read): Add support for v2 package file format.
1258 (Dwo_file::read_unit_index): Likewise.
1259 (Dwo_file::sized_read_unit_index): Likewise.
1260 (Dwo_file::copy_section): Likewise.
1261 (Dwo_file::add_unit_set): Likewise.
1262 (Dwp_output_file::add_output_section): Likewise.
1263 (Dwp_output_file::add_contribution): Likewise.
1264 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1265 for empty slot.
1266 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1267 file format.
1268 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1269 slot.
1270 (Dwp_output_file::initialize): Remove unused function.
1271 (Dwp_output_file::finalize): Add support for v2 package file format.
1272 (Dwp_output_file::write_index): Likewise.
1273 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1274 function prototype.
1275
c6905c28
CC
12762013-07-31 Cary Coutant <ccoutant@google.com>
1277
1278 * object.cc (Sized_relobj::do_output_section_address): New function.
1279 (Sized_relobj): Instantiate explicitly.
1280 * object.h (Object::output_section_address): New function.
1281 (Object::do_output_section_address): New function.
1282 (Sized_relobj::do_output_section_address): New function.
1283 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1284
12852013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1286 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1287
1288 * parameters.cc (Parameters::entry): Return target-specific entry
1289 symbol name.
1290 * target.h (Target::entry_symbol_name): New function.
1291 (Target_info::entry_symbol_name): New data member.
1292
1293 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1294 * i386.cc (Target_i386::i386_info): Likewise.
1295 (Target_i386_nacl::i386_nacl_info): Likewise.
1296 * sparc.cc (Target_sparc::sparc_info): Likewise.
1297 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1298 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1299 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1300 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1301
234d4ab8
SA
13022013-07-22 Sterling Augustine <saugustine@google.com>
1303
1304 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1305 Convert parameter shndx to local variable. Add parameters symtab
1306 and symtab_size. Scan over section names. Find relocation
1307 section corresponding to current section. Create and initialize
1308 reloc_mapper_ and reloc_type_.
1309 (Dwarf_pubnames_table::read_header): Add assertion. Change
1310 unit_length to off_t. Initialize member unit_length_. Fill in field
1311 cu_offset_.
1312 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1313 Initialize new fields unit_length_ and cu_offset_.
1314 (Dwarf_pubnames_table::read_section): Update prototype.
1315 (Dwarf_pubnames_table::cu_offset): New member function.
1316 (Dwarf_pubnames_table::subsection_size): Likewise.
1317 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1318 New fields.
1319 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1320 member functions public.
1321 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1322 Update comment. Rework logic. Move repeated parts to...
1323 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1324 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1325 pubtypes_table_, and stmt_list_offset.
1326 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1327 Gdb_index::find_pubtype_offset,
1328 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1329 (Gdb_index::pubnames_read): Update prototype and rework logic.
1330 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1331 Forward declare.
1332 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1333 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1334 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1335 Gdb_index::map_pubtable_to_dies):
1336 Declare functions.
1337 (Gdb_index::pubnames_read): Update declaration.
1338 (Gdb_index::Pubname_offset_map): New type.
1339 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1340 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1341 Gdb_index::stmt_list_offset): Declare.
1342 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1343 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1344 Gdb_index::pubtypes_offset_): Remove.
1345
a3ed37d8
RM
13462013-07-19 Roland McGrath <mcgrathr@google.com>
1347
1348 * options.h (General_options): Add -Trodata-segment option.
1349 * parameters.cc (Parameters::check_rodata_segment): New function.
1350 (Parameters::set_target_once): Call it.
1351 * parameters.h (Parameters): Declare it (private member function).
1352 * layout.cc (load_seg_unusable_for_headers): New function, broken
1353 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1354 then validate rodata segment rather than text segment.
1355 (relaxation_loop_body): Call that.
1356 (is_text_segment): New function. Don't admit a non-executable
1357 segment if TARGET->isolate_execinstr().
1358 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1359
eb5b4ded
CC
13602013-07-15 Shawn Landden <shawnlandden@gmail.com>
1361
1362 PR gold/15070
1363 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1364 * nacl.h (Sniff_file::View::View): Request aligned view.
1365
4d5effb9
CC
13662013-07-11 Cary Coutant <ccoutant@google.com>
1367
1368 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1369 correct BRLT entry size.
1370
ba8ca3e7
AM
13712013-07-03 Alan Modra <amodra@gmail.com>
1372
1373 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1374 comment.
1375
267257d2
CC
13762013-07-01 Cary Coutant <ccoutant@google.com>
1377
1378 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1379 reloc_type_.
1380 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1381 (Dwarf_ranges_table::lookup_reloc): New function.
1382 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1383 reloc_type_.
1384 (Dwarf_ranges_table::lookup_reloc): New function.
1385 (Dwarf_ranges_table::reloc_type_): New data member.
1386
06f30c9d
CC
13872013-06-27 Jing Yu <jingyu@google.com>
1388
1389 PR gold/15662
1390 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1391 function.
1392 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1393 (Target_powerpc::do_relax): Call the above.
1394
a2d7bf59
AM
13952013-06-27 Cary Coutant <ccoutant@google.com>
1396
1397 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1398 on garbage collected .opd section.
1399
14002013-06-27 Alan Modra <amodra@gmail.com>
1401
1402 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1403 is non-zero.
1404 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1405 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1406
32364e50
CC
14072013-06-14 Cary Coutant <ccoutant@google.com>
1408
1409 * resolve.cc (Symbol::override_base): Don't override st_type
1410 from plugin placeholder symbols.
1411 (Symbol_table::resolve): Likewise.
1412 (Symbol_table::should_override): Don't complain about TLS mismatch
1413 if the TO symbol is a plugin placeholder.
1414 * testsuite/Makefile.am (plugin_test_tls): New test.
1415 * testsuite/Makefile.in: Regenerate.
1416 * testsuite/plugin_test_tls.sh: New test script.
1417 * testsuite/two_file_test_2_tls.cc: New test source.
1418 * testsuite/two_file_test_tls.cc: New test source.
1419
7fb47cc9
CC
14202013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1421
1422 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1423 the maximum segment alignment is larger than the page size.
1424 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1425 correctly aligns the symbols with large alignemnt.
1426 * testsuite/Makefile.in: Regenerate.
1427 * testsuite/large_symbol_alignment.cc: New file.
1428
6934001a
CC
14292013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1430 Sriraman Tallam <tmsriram@google.com>
1431
1432 * options.h (sort_section): New option.
1433 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1434 Rename from Input_section_sort_section_name_special_ordering_compare.
1435 (Input_section_sort_section_name_compare): New struct.
1436 * output.cc (Output_section::Input_section_sort_section_name_compare::
1437 operator()): New function.
1438 (Output_section::sort_attached_input_sections): Use new sort function
1439 for .text if --sort-section=name is specified.
1440 * layout.cc (Layout::make_output_section):
1441 Add sorting by name when --sort-section=name is specified.
1442 * testsuite/Makefile.am (text_section_grouping): Test option
1443 --sort-section=name.
1444 * testsuite/Makefile.in: Regenerate.
1445 * testsuite/section_sorting_name.cc: New file.
1446 * testsuite/section_sorting_name.sh: New file.
1447
93acabad
CC
14482013-05-21 Cary Coutant <ccoutant@google.com>
1449
1450 * symtab.h (Symbol::is_cxx_vtable): New function.
1451 * target-reloc.h (relocate_section): Check for vtable symbol.
1452 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1453 * testsuite/Makefile.in: Regenerate.
1454 * testsuite/missing_key_func.cc: New test source.
1455 * testsuite/missing_key_func.sh: New test script.
1456
60e8b3fc
CC
14572013-05-21 Cary Coutant <ccoutant@google.com>
1458
2b64b551
RM
1459 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1460 type of enclosing symbol.
1461 (Relocate_info::location): Check symbol type when describing symbol.
1462 * object.h (Symbol_location_info): Remove unused line_number;
1463 add enclosing_symbol_type.
1464 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1465
9df9de2c
CC
14662013-05-13 Cary Coutant <ccoutant@google.com>
1467
2b64b551
RM
1468 * configure.ac: Export DEFAULT_TARGET.
1469 * configure: Regenerate.
1470 * Makefile.in: Regenerate.
1471 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1472 * testsuite/Makefile.in: Regenerate.
1473 * testsuite/debug_msg.sh: Delete duplicate tests.
1474 Don't check undef_int error message match for powerpc where the
1475 source file and line number aren't available.
9df9de2c 1476
bbc5ae17
RM
14772013-05-10 Roland McGrath <mcgrathr@google.com>
1478
1479 * options.h (General_options): Add --rosegment-gap option.
1480 * options.cc (finalize): --rosegment-gap implies --rosegment.
1481 * layout.cc (set_segment_offsets): Let user option override
1482 target->rosegment_gap().
1483
0c6e6c39
RM
14842013-05-10 Roland McGrath <mcgrathr@google.com>
1485
1486 * options.h (General_options): Remove leading space from help
1487 messages for -nostdlib and --rosegment.
1488
cde7cb01
MR
14892013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1490
1491 PR ld/15365
1492 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1493
f31ae5b8
AM
14942013-05-03 Alan Modra <amodra@gmail.com>
1495
1496 * merge.cc (Output_merge_string::do_add_input_section): Correct
1497 scan for number of strings. Rename vars to avoid shadowing.
1498 Include missing terminator in input_size_.
1499
d3a7cd45
L
15002013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1501
1502 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1503 Restore empty string handling.
1504
6ad3daba
CC
15052013-05-01 Cary Coutant <ccoutant@google.com>
1506
1507 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1508 uninitialized warning.
1509
e31908b6
CC
15102013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1511
1512 * output.cc (Output_section::add_merge_input_section): Allow
1513 to merge sections if the alignment is more than character size.
1514 * merge.h (Output_merge_string::Output_merge_string): Remove
1515 assert.
1516 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1517 only not-null strings. Check the alignment of strings.
1518 * stringpool.h
1519 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1520 alignment as the argument.
1521 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1522 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1523 Align non-zero length strings according to the addralign_.
1524 (Stringpool_template<Stringpool_char>::set_string_offsets):
1525 Updating offsets according to the given alignment.
1526 * testsuite/Makefile.am (text_section_grouping): Test if string
1527 literals are getting merged.
1528 * testsuite/Makefile.in: Regenerate.
1529 * testsuite/merge_string_literals_1.c: New file.
1530 * testsuite/merge_string_literals_2.c: Ditto.
1531 * testsuite/merge_string_literals.sh: Ditto.
1532
0e804863
ILT
15332013-04-26 Ian Lance Taylor <iant@google.com>
1534
1535 * target-reloc.h (relocate_section): If the reloc offset is out of
1536 range, pass VIEW as NULL to relocate.relocate.
1537 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1538 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1539 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1540 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1541 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1542 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1543
e7c5ea40
CC
15442013-04-26 Geoff Pike <gpike@chromium.org>
1545
1546 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1547 * layout.cc (Hash_task): New class.
1548 (Layout::queue_build_id_tasks): New function.
1549 (Layout::write_build_id): Handle single-thread portion of build ID
1550 computation. (In some cases, all of it is single-threaded.) Replace
1551 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1552 functionality in fewer lines of code.
1553 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1554 * options.h (General_options): make "--build-id" default to tree
1555 rather than sha1. Add two new options related to --build-id=tree:
1556 --build-id-chunk-size-for-treehash and
1557 --build-id-min-file-size-for-treehash.
1558 * Makefile.am: add testing of --build-id=tree and related new options
1559 (these tests will be invoked by "make check").
1560 * Makefile.in: Regenerate.
1561
49926cd0
AM
15622013-04-25 Alan Modra <amodra@gmail.com>
1563
1564 * configure.tgt: Add powerpcle and powerpc64le.
1565
a4034750
AM
15662013-04-22 Alan Modra <amodra@gmail.com>
1567
1568 PR gold/15355
1569 * layout.cc (Layout::segment_precedes): Allow more than one
1570 segment with the same type and flags.
1571
e79c84aa
CC
15722013-04-15 Cary Coutant <ccoutant@google.com>
1573
1574 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1575 allocate space in file for BSS sections.
1576
2199fbe7
CC
15772013-04-15 Cary Coutant <ccoutant@google.com>
1578
1579 * script-sections.cc (Orphan_output_section): Reset address
1580 to zero after each orphaned section for relocatable links.
1581
502e8a84
CC
15822013-04-15 Cary Coutant <ccoutant@google.com>
1583
a4034750
AM
1584 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1585 section starting address for relocatable link.
1586 * testsuite/Makefile.am (script_test_11): New test.
1587 * testsuite/Makefile.in: Regenerate.
1588 * testsuite/script_test_11.c: New source file.
1589 * testsuite/script_test_11.t: New linker script.
502e8a84 1590
0cfdc767
AM
15912013-04-13 Alan Modra <amodra@gmail.com>
1592
1593 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1594 owner when sections are not adjacent and exceed group size.
1595 (Target_powerpc::group_sections): Handle corner case.
1596 (Target_powerpc::Branch_info::make_stub): Handle case where
1597 stub table doesn't exist due to branches in non-exec sections.
1598 (Target_powerpc::Relocate::relocate): Likewise.
1599
6830ee24
AM
16002013-04-11 Alan Modra <amodra@gmail.com>
1601
1602 PR gold/15354
1603 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1604 .branch_lt to match bfd ld. Adjust comments throughout file.
1605
54a3d865
ILT
16062013-04-04 Ian Lance Taylor <iant@google.com>
1607
1608 GCC PR c++/56840
1609 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1610 sections before checking whether they are included in the link.
1611
9993ba11
ST
16122013-03-29 Sriraman Tallam <tmsriram@google.com>
1613
1614 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1615 object before calling the plugin claim_file handler. Pass the elf
1616 object of the archive to the plugin. Delete the elf object if the
1617 plugin claims the file.
1618
ebacd51e
AM
16192013-03-21 Alan Modra <amodra@gmail.com>
1620
1621 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1622 segment when omagic.
1623
117be58f
AM
16242013-03-21 Alan Modra <amodra@gmail.com>
1625
1626 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1627 comparison warning.
1628 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1629 uninitialized" warning.
1630
32e2b61d
AM
16312013-03-20 Alan Modra <amodra@gmail.com>
1632
1633 * symtab.h (Symbol::clear_version): New function.
1634 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1635 is_needed by weak references. Clear version for symbols defined
1636 in as-needed objects that are not needed.
1637
b3ccdeb5
AM
16382013-03-15 Alan Modra <amodra@gmail.com>
1639
1640 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1641 static and public. Add report_err param. Return false for data refs.
1642 (Target_powerpc::rela_dyn_section): New overloaded function.
1643 (Target_powerpc::plt_, iplt_): Elucidate.
1644 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1645 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1646 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1647 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1648 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1649 push_branch and make_plt_entry for ifunc syms when
1650 reloc_needs_plt_for_ifunc.
1651 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1652 for ifunc unless reloc_needs_plt_for_ifunc.
1653
ad3d8a2f
AM
16542013-03-15 Alan Modra <amodra@gmail.com>
1655
1656 * gc.h (gc_process_relocs): Don't look through function descriptors.
1657 * icf.cc (get_section_contents): Do so here instead.
1658
4d9aa155
AM
16592013-03-13 Alan Modra <amodra@gmail.com>
1660
1661 * powerpc.cc (is_branch_reloc): Forward declare.
1662 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1663 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1664 false for 64-bit, true for 32-bit non-branch relocs.
1665 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1666 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1667 nm output.
1668 (icf_safe_test): Generate linker map file as well as nm output.
1669 (icf_safe_so_test): Likewise.
1670 * testsuite/Makefile.in: Regenerate.
1671 * testsuite/icf_test.sh: Parse linker map file to determine
1672 section folding.
1673 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1674 * testsuite/icf_safe_so_test.sh: Likewise.
1675 (X86_32_or_ARM_specific_safe_fold): Merge into..
1676 (arch_specific_safe_fold): ..this.
1677 (X86_64_specific_safe_fold): Delete unused function.
1678
57420c20
AM
16792013-03-12 Alan Modra <amodra@gmail.com>
1680
1681 * gc.h (gc_process_relocs): Look through function descriptors
1682 to determine shndx, symvalue and addend used by ICF. Tidy
1683 variable duplication.
1684
dc3714f3
AM
16852013-03-11 Alan Modra <amodra@gmail.com>
1686
1687 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1688 * layout.cc (Layout_task_runner::run): ..to here.
1689 * symtab.h (struct Symbol_location): Extract from..
1690 (class Symbol_table): ..here.
1691 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1692 * target.h (class Target): Add function_location and
1693 do_function_location functions.
1694 (class Sized_target): Add do_function_location.
1695 * object.h (class Sized_relobj_file): Move find_shdr..
1696 (class Object): ..to here.
1697 * object.cc: Likewise. Update to suit. Instantiate.
1698 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1699 * powerpc.cc (class Powerpc_dynobj): New.
1700 (Target_powerpc::do_function_location): New function.
1701 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1702 (Powerpc_dynobj::do_read_symbols): New function.
1703 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1704
956b03bb
ILT
17052013-03-08 Ian Lance Taylor <iant@google.com>
1706
1707 * options.cc (General_options::string_to_object_format): Accept
1708 "default".
1709
4bead2d5
AM
17102013-03-08 Alan Modra <amodra@gmail.com>
1711
1712 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1713 pointer to Post_fde.
1714 (struct Post_fde): Move definition to here..
1715 * ehframe.cc (struct Post_fde): ..from here.
1716 (Cie::write): Don't alloc Post_fde.
1717 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1718
02e60bf7
AM
17192013-03-07 Alan Modra <amodra@gmail.com>
1720
1721 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1722 relocation referencing .LC0.
1723 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1724
8343f03a
AM
17252013-03-07 Alan Modra <amodra@gmail.com>
1726
1727 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1728 always_inline. Add assembly for powerpc to avoid GOT.
1729
3366d57c
AM
17302013-03-07 Alan Modra <amodra@gmail.com>
1731
1732 * testsuite/script_test_10.sh: Don't test .bss section
1733 header number.
1734
6c77229c
AM
17352013-03-06 Alan Modra <amodra@gmail.com>
1736
1737 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1738 (Target_powerpc::symval_for_branch): Add symtab param. Update
1739 all callers. Handle folded sections.
1740 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1741 to Powerpc_relobj.
1742 (Global_symbol_visitor_opd::operator()): Likewise.
1743
a39e4af6
AM
17442013-03-04 Alan Modra <amodra@gmail.com>
1745
1746 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1747 * testsuite/Makefile.in: Regenerate.
1748
d5834edb
CC
17492013-03-01 Cary Coutant <ccoutant@google.com>
1750
1751 Add dwp support for v2 DWARF package file format.
1752 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1753 tu_length parameter. Adjust all callers.
1754 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1755 * dwp.cc: Include dwarf.h.
1756 (Section_bounds): New struct type.
1757 (Unit_set): New struct type.
1758 (Dwo_file::Dwo_file): Initialize new data member.
1759 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1760 Combine and rename to...
1761 (Dwo_file::read_unit_index): ...this.
1762 (Dwo_file::sized_read_compunit_index)
1763 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1764 (Dwo_file::sized_read_unit_index): ...this.
1765 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1766 parameters; add section_id parameter.
1767 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1768 (Dwo_file::add_unit_set): ...this.
1769 (Dwo_file::shndx_map_): Remove.
1770 (Dwo_file::sect_offsets_): New data member.
1771 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1772 (Dwp_output_file::add_section): Rename to...
1773 (Dwp_output_file::add_contribution): ...this.
1774 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1775 (Dwp_output_file::add_tu_set): Likewise.
1776 (Dwp_output_file::Contribution): New type.
1777 (Dwp_output_file::Section::contributions): New data member.
1778 (Dwp_output_file::Cu_or_tu_set): Remove.
1779 (Dwp_output_file::Section::Section): New ctor.
1780 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1781 (Dwp_output_file::Dwp_index::Section_table): New type.
1782 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1783 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1784 parameter.
1785 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1786 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1787 (Dwp_output_file::Dwp_index::section_table): New member function.
1788 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1789 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1790 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1791 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1792 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1793 (Dwp_output_file::Dwp_index::section_table_): New data member.
1794 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1795 (Dwp_output_file::add_output_section): New member function.
1796 (Dwp_output_file::write_new_section): New member function.
1797 (Dwp_output_file::write_contributions): New member function.
1798 (Dwp_output_file::section_id_map_): New data member.
1799 (class Dwo_id_info_reader): Remove.
1800 (class Unit_reader): New class.
1801 (get_dwarf_section_name): New function.
1802 (Dwo_file::read_executable): Adjust initializations of class data.
1803 (Dwo_file::read): Add support for v2 package file format.
1804 (Dwo_file::read_unit_index): Likewise.
1805 (Dwo_file::sized_read_unit_index): Likewise.
1806 (Dwo_file::copy_section): Likewise.
1807 (Dwo_file::add_unit_set): Likewise.
1808 (Dwp_output_file::add_output_section): Likewise.
1809 (Dwp_output_file::add_contribution): Likewise.
1810 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1811 for empty slot.
1812 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1813 file format.
1814 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1815 slot.
1816 (Dwp_output_file::initialize): Remove unused function.
1817 (Dwp_output_file::finalize): Add support for v2 package file format.
1818 (Dwp_output_file::write_index): Likewise.
1819 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1820 function prototype.
1821
a68a081d
CC
18222013-03-01 Cary Coutant <ccoutant@google.com>
1823
1824 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1825 function into class definition in header file.
1826 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1827 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1828 New function.
1829 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1830
9d5781f8
AM
18312013-02-28 Alan Modra <amodra@gmail.com>
1832
1833 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1834 * target.cc (Target::do_plt_fde_location): New function.
1835 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1836 accessor function, and constructor param.
1837 (struct Post_fde, Post_fdes): Declare.
1838 (Cie::write): Add post_fdes param.
1839 * ehframe.cc (Fde::write): Use plt_fde_location.
1840 (struct Post_fde): Define.
1841 (Cie::write): Stash FDEs added post merge mapping.
1842 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1843 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1844 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1845 other FDEs.
1846 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1847 (Target_powerpc::has_glink): New function.
1848 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1849 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1850 glink_eh_frame_fde_32, default_fde): New data.
1851 (Stub_table::eh_frame_added_): New var.
1852 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1853 Make const.
1854 (Stub_table::add_eh_frame): New function.
1855 (Output_data_glink::add_eh_frame): New function.
1856 (Target_powerpc::make_glink_section): Call add_eh_frame.
1857
214383dd
ILT
18582013-02-15 Ian Lance Taylor <iant@google.com>
1859
1860 * options.h (DEFINE_uint64_alias): Define.
1861 (class General_options): Add -Ttext-segment as an alias for
1862 -Ttext.
1863
91c2b899
AM
18642013-02-15 Alan Modra <amodra@gmail.com>
1865
1866 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1867 (Stub_table::do_write): ..here, two places.
1868 (Stub_table::plt_call_size): Use it here too.
1869
20e2a8aa
ILT
18702013-02-11 Ian Lance Taylor <iant@google.com>
1871
1872 * descriptors.cc (Descriptors::close_all): New function.
1873 * descriptors.h (class Descriptors): Declare close_all.
1874 (close_all_descriptors): New inline function.
1875 * plugin.cc: Include "descriptors.h".
1876 (Plugin_manager::cleanup): Call close_all_descriptors.
1877
8952bc69
AM
18782013-02-06 Alan Modra <amodra@gmail.com>
1879
1880 * README: Update coding style link.
1881
29bd8b6b
CC
18822013-01-28 Cary Coutant <ccoutant@google.com>
1883
a4034750
AM
1884 * dwp.cc (File_list): New typedef.
1885 (Dwo_name_info_reader): New class.
1886 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1887 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1888 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1889 (Dwo_file::read_executable): New function.
1890 (Dwo_file::read): Move common setup code to ...
1891 (Dwo_file::make_object): ... here.
1892 (dwp_options): Add --exec/-e.
1893 (usage): Likewise.
1894 (main): Likewise.
29bd8b6b 1895
c6ac678d
ST
18962013-01-24 Sriraman Tallam <tmsriram@google.com>
1897
1898 * layout.cc (Layout::layout): Check for option text_reorder.
1899 (Layout::make_output_section): Ditto.
1900 * options.h (text_reorder): New option.
1901 * output.cc (Input_section_sort_compare): Remove special ordering
1902 of section names.
1903 (Output_section::
1904 Input_section_sort_section_name_special_ordering_compare::
1905 operator()): New function.
1906 (Output_section::sort_attached_input_sections): Use new sort function
1907 for .text.
1908 * output.h (Input_section_sort_section_name_special_ordering_compare):
1909 New struct.
1910 * testsuite/Makefile.am (text_section_grouping): Test option
1911 --no-text-reorder
1912 * testsuite/Makefile.in: Regenerate.
1913 * testsuite/text_section_grouping.sh: Check order of functions without
1914 default text reordering.
1915
50701cc1
MF
19162013-01-18 Mike Frysinger <vapier@gentoo.org>
1917
1918 * options.h (General_options): Change default to true for new_dtags.
1919
b1b00fcc
MF
19202013-01-18 Mike Frysinger <vapier@gentoo.org>
1921
1922 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1923 when enable_new_dtags is false. Only add DT_RUNPATH when
1924 enable_new_dtags is true.
1925
ec5b8187
AM
19262013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1927
1928 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1929 used in declaration and definition consistent.
1930 (Target_powerpc::symval_for_branch): Ditto.
1931
a880d4c4
ST
19322013-01-16 Sriraman Tallam <tmsriram@google.com>
1933
1934 * testsuite/plugin_final_layout.cc: Fix comment.
1935
7c381248
ST
19362013-01-16 Sriraman Tallam <tmsriram@google.com>
1937
1938 * layout.cc (Layout::layout): Do not do default sorting for
1939 text sections when section ordering is specified.
1940 (make_output_section): Ditto.
1941 * testsuite/plugin_final_layout.cc: Name the function sections
1942 to catch reordering issues.
1943
e2458743
AM
19442013-01-15 Alan Modra <amodra@gmail.com>
1945
1946 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1947 plt-thread-safe.
1948
431ed302
AM
19492013-01-15 Alan Modra <amodra@gmail.com>
1950
1951 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1952 * testsuite/Makefile.in: Regenerate.
1953
0ec6429b
AM
19542013-01-14 Alan Modra <amodra@gmail.com>
1955
1956 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1957 * testsuite/Makefile.in: Regenerate.
1958
0bf402d5
ILT
19592013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1960
36af3926 1961 PR bfd/14430
0bf402d5
ILT
1962 Fix mingw gold build with plugins enabled
1963 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1964 * configure.ac: Export DLOPEN_LIBS and add headers check.
1965 * plugin.cc: Handle non-dlfcn case.
1966 * Makefile.in: Regenerate.
1967 * config.in: Regenerate.
1968 * configure: Regenerate.
1969 * testsuite/Makefile.in: Regenerate.
1970
9e9143bc
ST
19712013-01-09 Sriraman Tallam <tmsriram@google.com>
1972
1973 * output.h (sort_attached_input_sections): Change to be public.
1974 * script-sections.cc
1975 (Output_section_definition::set_section_addresses): Sort
1976 attached input sections according to section order before linker
1977 script assigns section addresses.
1978 (Orphan_output_section::set_section_addresses): Sort
1979 attached input sections according to section order before linker
1980 script assigns section addresses.
1981 * Makefile.am (final_layout.sh): Use a simple linker script to
1982 check if section ordering still works.
1983 * Makefile.in: Regenerate.
1984
679af368
ILT
19852013-01-09 Ben Cheng <bccheng@google.com>
1986
1987 * arm.cc (Target_arm::attributes_accept_div): New function.
1988 (Target_arm::attributes_forbid_div): New function.
1989 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1990 attribute using the same new functions as what bfd/elf32_arm.c
1991 does.
1992
3136a00e
CC
19932013-01-07 Cary Coutant <ccoutant@google.com>
1994
1995 PR gold/14993
1996 * output.cc (Output_section::add_input_section): For incremental
1997 updates, don't track input sections that are allocated from patch
1998 space.
1999
f2a6224b
L
20002013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2001 Ian Lance Taylor <iant@google.com>
2002
2003 PR gold/14897
2004 * configure.ac (--enable-ld): Removed.
2005 (install_as_default): Set to yes only for --enable-gold=default
2006 or --disable-ld.
2007 * configure: Regenerated.
2008
4f46f626
L
20092013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2010
2011 * options.h (General_options): Add -fuse-ld= for GCC linker
2012 option compatibility.
2013
26e4ef59
CC
20142013-01-04 Cary Coutant <ccoutant@google.com>
2015
2016 * configure.ac: Fix typo restoring CXXFLAGS.
2017 * configure: Regenerate.
2018
3d587466
CC
20192013-01-04 Cary Coutant <ccoutant@google.com>
2020
4f46f626
L
2021 * testsuite/Makefile.am (CXXLINK_S): New macro.
2022 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2023 * testsuite/Makefile.in: Regenerate.
3d587466 2024
44db6695
L
20252013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2026
2027 * version.cc (print_version): Update copyright year to 2013.
2028
edcac0c1
ILT
20292012-12-20 Ian Lance Taylor <iant@google.com>
2030
2031 * layout.cc (Layout::special_ordering_of_input_section): New
2032 function.
2033 (Layout::layout): If input section requires special ordering, must
2034 sort input sections.
2035 (Layout::make_output_section): May sort .text input sections.
2036 (Layout::is_section_name_prefix_grouped): Remove.
2037 * layout.h (class Layout): Declare
2038 special_ordering_of_input_section. Don't declare
2039 is_section_name_prefix_grouped.
2040 * output.cc (Output_section::add_input_section): Revert last
2041 change.
2042 (Output_section::Input_section_sort::match_file_name): Don't crash
2043 if called on output section data.
2044 (Output_section::Input_section_sort_compare): Sort based on
2045 special ordering.
2046 (Output_section::Input_section_sort_section_order_index_compare):
2047 Revert last patch.
2048 (Output_section::sort_attached_input_sections): Likewise.
2049
28f2a4ac
ST
20502012-12-18 Sriraman Tallam <tmsriram@google.com>
2051
edcac0c1 2052 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2053 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2054 * output.cc (Output_section::add_input_section): Check if section
2055 name contains special prefix. Keep input sections to sort such
2056 sections.
2057 (Output_section::Input_section_sort_section_order_index_compare
2058 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2059 (Output_section::sort_attached_input_sections): Add condition to
2060 Input_section_entry constructor call.
28f2a4ac
ST
2061 * testsuite/Makefile.am (text_section_grouping): New test.
2062 * testsuite/Makefile.in: Regenerate.
2063 * testsuite/text_section_grouping.cc: New file.
2064 * testsuite/text_section_grouping.sh: New file.
2065
5bf135a7
NC
20662012-12-17 Nick Clifton <nickc@redhat.com>
2067
2068 * Makefile.am: Add copyright notice.
2069 * NEWS: Likewise.
2070 * README: Likewise.
2071 * configure.ac: Likewise.
2072 * ftruncate.c: Likewise.
2073 * Makefile.in: Regenerate.
2074
59965708
CC
20752012-12-14 Cary Coutant <ccoutant@google.com>
2076
a4034750
AM
2077 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2078 --no-as-needed flag.
2079 (exception_separate_shared_12_test): Likewise.
2080 (incremental_copy_test): Likewise.
2081 * testsuite/Makefile.in: Regenerate.
59965708 2082
2a77e2ab
CC
20832012-12-14 Cary Coutant <ccoutant@google.com>
2084
2085 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2086 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2087
e3deeb9c
AM
20882012-12-12 Alan Modra <amodra@gmail.com>
2089
2090 * powerpc.cc (class Track_tls): New.
2091 (class Relocate, class Scan): Inherit Track_tls.
2092 (Target_powerpc::Scan::local, global): Track tls optimization
2093 and avoid creating plt entry for __tls_get_addr if all uses
2094 are optimized away.
2095 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2096
d8f5a274
AM
20972012-12-12 Alan Modra <amodra@gmail.com>
2098
2099 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2100 Replace no_toc_optimize with toc_optimize.
2101 * output.h (Output_section::input_sections): Provide non-const variant.
2102 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2103 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2104 accessors.
2105 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2106 (class Sort_toc_sections): New.
2107 (Target_powerpc::do_finalize_sections): Sort toc sections.
2108 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2109
4c8a1de1
RM
21102012-12-10 Roland McGrath <mcgrathr@google.com>
2111
2112 * testsuite/binary_unittest.cc (read_all): New function.
2113 (Sized_binary_test): Use it instead of ::read.
2114 * fileread.cc (do_read): Don't assume pread always reads the whole
2115 amount in a single call.
2116
edc27beb
AM
21172012-12-10 Alan Modra <amodra@gmail.com>
2118
2119 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2120 Set EM_PPC64 or EM_PPC here.
2121 (Target_selector_powerpc::do_recognize): Delete.
2122
906b9150
AM
21232012-12-10 Alan Modra <amodra@gmail.com>
2124
2125 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2126 stub_table_.
2127 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2128
418c15ae
RM
21292012-12-07 Roland McGrath <mcgrathr@google.com>
2130
2131 * testsuite/binary_unittest.cc (Sized_binary_test):
2132 Use open_descriptor rather than ::open.
2133
decdd3bc
AM
21342012-12-07 Alan Modra <amodra@gmail.com>
2135
2136 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2137 typedef and invalid_address constant.
2138 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2139 instantiate constants.
2140
db399005
ILT
21412012-12-06 Roland McGrath <mcgrathr@google.com>
2142
2143 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2144 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2145 * aclocal.m4: Regenerate.
2146 * configure: Regenerate.
2147 * Makefile.in: Regenerate.
2148 * testsuite/Makefile.in: Regenerate.
2149
aba6bc71
AM
21502012-12-07 Alan Modra <amodra@gmail.com>
2151
2152 * options.h (General_options): Add no_toc_optimize.
2153 * powerpc.cc (ok_lo_toc_insn): New function.
2154 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2155
9e69ed50
AM
21562012-12-06 Alan Modra <amodra@gmail.com>
2157
2158 * options.h (General_options): Add plt_align, plt_static_chain,
2159 plt_thread_safe. Update stub_group_size help text.
2160 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2161 for new plt_thread_safe_ var.
2162 (use_plt_offset): Correct comments.
2163 (Target_powerpc::do_relax): Look for thread creation symbols to
2164 determine default plt_thread_safe value. Clear plt call stubs
2165 as well as branch stubs each iteration.
2166 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2167 insn constants.
2168 (l, hi, ha, write_insn): Move earlier.
2169 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2170 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2171 plt stubs too.
2172 (Stub_table::update_size): Adjust.
2173 (Stub_table::prev_size, set_prev_size): Delete.
2174 (Stub_table::stub_align): Let --plt-align affect result.
2175 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2176 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2177 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2178 (Stub_table::do_write): Support more stub variants.
2179
f43ba157
AM
21802012-12-04 Alan Modra <amodra@gmail.com>
2181
2182 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2183 (Target_powerpc::do_define_standard_symbols): New function.
2184
34171bc5
AM
21852012-12-03 Alan Modra <amodra@gmail.com>
2186
2187 * output.h: Formatting, whitespace.
2188
dc9589e9 21892012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2190
2191 * layout.h (Layout::get_executable_sections): Declare.
2192 * layout.cc (Layout::get_executable_sections): New function.
2193 * arm.cc (Target_arm::group_sections): Use it.
2194 (Arm_output_section::group_sections): Delete now redundant test.
2195 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2196 param to handle relative relocs.
2197 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2198 (Output_data_reloc::add_absolute): Adjust.
2199 (Output_data_reloc::add_relative): New function.
2200 (Output_data::reset_data_size): New function.
2201 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2202 (Output_section::set_addralign): New function.
2203 (Output_section::checkpoint_set_addralign): New function.
2204 (Output_section::clear_section_offsets_need_adjustment): New function.
2205 (Output_section::input_sections): Make public.
2206 * powerpc.cc (class Output_data_brlt_powerpc): New.
2207 (class Stub_table, class Stub_control): New.
2208 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2209 stub_table_, set_stub_table, stub_table): New vectors and accessor
2210 functions.
2211 (Target_powerpc::do_may_relax, do_relax, push_branch,
2212 new_stub_table, stub_tables, brlt_section, group_sections,
2213 add_branch_lookup_table, find_branch_lookup_table,
2214 write_branch_lookup_table, make_brlt_section): New functions.
2215 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2216 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2217 branch_info_): New vars.
2218 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2219 make call stubs here.
2220 (Output_data_glink): Remove all call stub handling from this class.
2221 (Target_powerpc::Scan::local, global): Save interesting branch
2222 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2223 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2224 functions on final link.
2225 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2226 Handle long branch destinations too.
2227 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2228 do_plt_address_for_local): Adjust lookup of plt call stubs.
2229
627b30b7
AM
22302012-11-30 Alan Modra <amodra@gmail.com>
2231
2232 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2233 relocs against protected symbols when building 32-bit shared libs.
2234
40b469d7
AM
22352012-11-30 Alan Modra <amodra@gmail.com>
2236
2237 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2238 param. Call got_section() to make .got. Update all callers
2239 and their callers and so on.
2240
bb66a627
AM
22412012-11-30 Alan Modra <amodra@gmail.com>
2242
2243 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2244 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2245 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2246 value if it already exists.
2247
d2cf1c6c
L
22482012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2249
2250 PR gold/14858
2251 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2252
edccdf7c
RM
22532012-11-14 Roland McGrath <mcgrathr@google.com>
2254
2255 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2256 than bfc instruction for data sandboxing.
2257
6febeb74
AM
22582012-11-08 Alan Modra <amodra@gmail.com>
2259
2260 * po/POTFILES.in: Regenerate.
2261
0a6f1bf2
AM
22622012-11-05 Alan Modra <amodra@gmail.com>
2263
2264 * configure.ac: Apply 2012-09-10 change to config.in here.
2265 * configure: Regenerate.
2266
26a4e9cb
AM
22672012-11-05 Alan Modra <amodra@gmail.com>
2268
2269 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2270 (struct Opd_ent): Use "Address" rather than "Offset".
2271 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2272 (Target_powerpc::got_section): Make public.
2273 (Target_powerpc::scan_relocs): Move code setting symbols..
2274 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2275 Create _SDA_BASE_ only when referenced.
2276
cc928013
RM
22772012-11-02 Roland McGrath <mcgrathr@google.com>
2278
2279 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2280 from last change.
2281
50ed5eb1
RM
22822012-11-01 Roland McGrath <mcgrathr@google.com>
2283
62fe925a
RM
2284 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2285 for offset_in_output_section parameter.
2286 (Sized_target::relocate_special_relocatable): Likewise.
2287 * arm.cc (Target_arm::relocate_relocs): Likewise.
2288 (Target_arm::relocate_special_relocatable): Likewise.
2289 * i386.cc (Target_i386::relocate_relocs): Likewise.
2290 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2291 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2292 * target-reloc.h (relocate_relocs): Likewise.
2293 * testsuite/testfile.cc (Target_test): Likewise.
2294 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2295 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2296
2297 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2298 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2299
2300 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2301 parameter, which is unused in the [!F_SETFD] case.
2302
50ed5eb1
RM
2303 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2304 SYMNDX to off_t before comparing it to this->data_size().
2305 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2306 * incremental.cc (Output_section_incremental_inputs::do_write):
2307 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2308
2cadc0bf
RM
2309 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2310
3bfcb652
NC
23112012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2312
2313 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2314 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2315 in EABI_VER5.
2316
c1a8d56e
CC
23172012-10-29 Cary Coutant <ccoutant@google.com>
2318
2319 * dwp.cc (usage): Add file and exit status parameters;
2320 add --help and --version options.
2321 (print_version): New function.
2322 (main): Add --help and --version options.
2323
b2490a7b
L
23242012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2325
2326 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2327 final_layout_sequence.txt.
2328 * testsuite/Makefile.in: Regenerated.
2329
aa543512
L
23302012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2331
2332 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2333 COMPILE generated by automake.
2334 (LINK1): Likewise.
2335 (CXXCOMPILE1): Likewise.
2336 (CXXLINK1): Likewise.
2337 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2338 (LINK): Likewise.
2339 (CXXCOMPILE): Likewise.
2340 (CXXLINK): Likewise.
2341 * testsuite/Makefile.in: Regenerated.
2342
d361fafb
L
23432012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2344
2345 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2346 on bad fwrite return.
2347
598c7410
L
23482012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2349
2350 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2351 on val.
2352
35c813e2
CC
23532012-10-23 Cary Coutant <ccoutant@google.com>
2354
2355 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2356 * testsuite/Makefile.in: Regenerate.
2357 * testsuite/dwp_test.h: New source file.
2358 * testsuite/dwp_test_1.cc: New source file.
2359 * testsuite/dwp_test_1.s: New source file.
2360 * testsuite/dwp_test_1.sh: New source file.
2361 * testsuite/dwp_test_1b.cc: New source file.
2362 * testsuite/dwp_test_1b.s: New source file.
2363 * testsuite/dwp_test_2.cc: New source file.
2364 * testsuite/dwp_test_2.s: New source file.
2365 * testsuite/dwp_test_2.sh: New source file.
2366 * testsuite/dwp_test_main.cc: New source file.
2367 * testsuite/dwp_test_main.s: New source file.
2368
77429909
CC
23692012-10-23 Cary Coutant <ccoutant@google.com>
2370
2371 * dwp.h: New header file.
2372 * dwp.cc: New source file.
2373 * gold.h: Move shared declarations to system.h.
2374 * system.h: New header file.
2375 * Makefile.am: Add dwp.
2376 * Makefile.in: Regenerate.
2377
ed5d6712
CC
23782012-10-23 Cary Coutant <ccoutant@google.com>
2379
2380 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2381 Dwarf_info_reader::read_from_pointer.
2382 (Dwarf_pubnames_table::read_header): Likewise.
2383 (Dwarf_pubnames_table::next_name): Likewise.
2384 (Dwarf_die::read_attributes): Likewise.
2385 (Dwarf_die::skip_attributes): Likewise.
2386 (Dwarf_info_reader::read_from_pointer): New function template.
2387 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2388 (Dwarf_pubnames_table): Likewise.
2389 (Dwarf_info_reader::read_from_pointer): New function template.
2390 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2391 Dwarf_pubnames_table ctor.
2392
8787852d
CC
23932012-10-23 Cary Coutant <ccoutant@google.com>
2394
2395 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2396 abbrev_shndx.
2397 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2398 abbrev_shndx_.
2399 (Dwarf_info_reader::set_abbrev_shndx): New method.
2400 (Dwarf_info_reader::abbrev_shndx_): New data member.
2401
9fc236f3
CC
24022012-10-23 Cary Coutant <ccoutant@google.com>
2403
2404 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2405 from object, not parameters.
2406 (Dwarf_info_reader::parse): Likewise.
2407 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2408 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2409 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2410 methods.
2411
effe8365
CC
24122012-10-23 Cary Coutant <ccoutant@google.com>
2413
2414 * fileread.cc (Input_file::Input_file): New constructor.
2415 * fileread.h (class Input_file): Add new constructor.
2416
1698990d
AM
24172012-10-18 Alan Modra <amodra@gmail.com>
2418
2419 PR gold/14727
2420 * object.cc (Relobj::is_section_name_included): Also match
2421 .sdata personality section.
2422
168a4726
AM
24232012-10-18 Alan Modra <amodra@gmail.com>
2424
2425 * target-reloc.h (class Default_comdat_behavior): New, package up..
2426 (get_comdat_behaviour): ..this.
2427 (relocate_section): Add Relocate_comdat_behavior template arg,
2428 adjust code to suit.
2429 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2430 (Target_arm::scan_reloc_section): Likewise.
2431 * i386.cc (Target_i386::relocate_section): Likewise.
2432 * sparc.cc (Target_sparc::relocate_section): Likewise.
2433 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2434 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2435 * powerpc.cc (class Relocate_comdat_behavior): New.
2436 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2437 gold::relocate_section with new template arg.
2438
acc276d8
AM
24392012-10-18 Alan Modra <amodra@gmail.com>
2440
2441 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2442 dynamic relocs for GOT_TPREL got entries, without symbol if
2443 resolving locally.
2444 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2445 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2446 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2447
e10f9870
AM
24482012-10-17 Alan Modra <amodra@gmail.com>
2449
2450 PR gold/14726
2451 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2452
ae034989
ST
24532012-10-16 Sriraman Tallam <tmsriram@google.com>
2454
2455 * layout.cc (Layout::include_section): Keep sections marked
2456 SHF_EXCLUDE when doing relocatable links.
2457
f3a0ed29
AM
24582012-10-16 Alan Modra <amodra@gmail.com>
2459
2460 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2461 (Target_powerpc::do_finalize_sections): Call it.
2462 (Output_data_save_res): New class and supporting functions.
2463 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2464 normal symbols defined in object files.
2465
c6de8ed4
AM
24662012-10-12 Alan Modra <amodra@gmail.com>
2467
2468 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2469 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2470 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2471 section if scan_opd_relocs not yet called.
2472 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2473
03e25981
AM
24742012-10-12 Alan Modra <amodra@gmail.com>
2475
2476 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2477 add_local_ifunc_entry): Revert last change.
2478 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2479
c9824451
AM
24802012-10-05 Alan Modra <amodra@gmail.com>
2481
2482 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2483 do_plt_address_for_global): New functions.
2484 (Output_data_got_powerpc::do_write): Don't segfault when linking
2485 statically.
2486 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2487 add_local_ifunc_entry): Return true on adding entry..
2488 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2489 glink->add_entry call. Remove unused symtab param. Adjust calls.
2490 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2491 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2492 set up symbols here.
2493 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2494 syms here. Do so even when no .iplt. Don't segfault when linking
2495 statically.
2496 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2497 new variants without reloc param.
2498 (Glink_sym_ent::Glink_sym_ent): Likewise.
2499 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2500 reloc when refs will resolve to plt call stub.
2501 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2502 R_PPC_PLTREL24 to resolve locally.
2503 (Target_powerpc::Scan::global): Correct ifunc handling.
2504 (Target_powerpc::Relocate::relocate): Correct local sym glink
2505 lookup. Don't destroy "value" when we have a plt call stub,
2506 and when checking plt call validity.
2507 (Target_powerpc::do_dynsym_value): Simplify.
2508
19fec8c1
AM
25092012-10-05 Alan Modra <amodra@gmail.com>
2510
2511 * i386.cc (Output_data_plt_i386::address_for_global,
2512 address_for_local): Add plt offset to returned value. Adjust uses.
2513 * sparc.cc (Output_data_plt_sparc::address_for_global,
2514 address_for_local): Likewise.
2515 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2516 address_for_local): Likewise.
2517 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2518 address_for_local): Likewise.
2519 * target.h (Target::plt_address_for_global, plt_address_for_local):
2520 Update comment.
2521 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2522 (Output_data_got::Got_entry::write): Nor here.
2523 * output.h: Comment fix.
2524
e867b647
WL
25252012-10-02 Jiong Wang <jiwang@tilera.com>
2526
2527 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2528 global_offset_table_ value for larget got.
2529 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2530
e5d5f5ed
AM
25312012-09-29 Alan Modra <amodra@gmail.com>
2532
2533 * powerpc.cc (Target_powerpc::iplt_): New output section.
2534 (Target_powerpc::iplt_section, make_iplt_section,
2535 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2536 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2537 Target_powerpc::plt_entry_count): Count iplt entries too.
2538 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2539 reloc section in constructor. New params.
2540 (Target_powerpc::make_plt_section): Create reloc section here instead.
2541 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2542 functions.
2543 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2544 (Output_data_glink::add_entry, find_entry): New functions to
2545 deal with local syms.
2546 (Glink_sym_ent): Add support for local syms.
2547 (Output_data_glink::do_write): Handle ifunc plt entries.
2548 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2549 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2550 (Target_powerpc::Relocate::relocate): Likewise.
2551 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2552
ec4dbad3
AM
25532012-09-25 Alan Modra <amodra@gmail.com>
2554
2555 * object.h (Sized_relobj_file::adjust_local_symbol,
2556 do_adjust_local_symbol): New functions.
2557 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2558 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2559 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2560 and irregular opd entry spacing.
2561 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2562 (Global_symbol_visitor_opd): New functor.
2563 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2564 on deleted opd entries.
2565
5c0b3823
WL
25662012-09-15 Jiong Wang <jiwang@tilera.com>
2567
2568 * tilegx.cc: New file.
2569 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2570 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2571 * configure.tgt: Add entries for tilegx*.
2572 * configure.ac: Likewise.
2573 * Makefile.in: Rebuild.
2574 * configure: Likewise.
2575 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2576 tilegx.
2577
bfdfa4cd
AM
25782012-09-13 Alan Modra <amodra@gmail.com>
2579
2580 * target-reloc.h (scan_relocs): Call scan.local for relocs
2581 against symbols in discarded sections. Pass is_discarded
2582 param.
2583 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2584 Add is_discarded param.
2585 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2586 is_discarded to flag opd entry as discarded. Don't emit dyn
2587 relocs on such entries.
2588 (Target_powerpc::Scan::global): Similarly detect and handle
2589 such opd entries.
2590 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2591 opd_ent_. Update all uses.
2592 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2593 (Target_powerpc::relocate_section): Zero out discarded opd
2594 entry relocs.
2595
d77a0555
ILT
25962012-09-12 Ian Lance Taylor <iant@google.com>
2597
2598 PR gold/14570
2599 * output.cc: Rename Output_data_got template parameter from size
2600 to got_size for all functions. Compile all variants of
2601 Output_data_got.
2602 (Output_data_got::Got_entry::write): Correct use of size for
2603 symbol value. Use local_is_tls rather than casting to
2604 Sized_relobj_file.
2605 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2606 (class Sized_relobj_file): Add do_local_is_tls.
2607 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2608
815a1205
AM
26092012-09-11 Alan Modra <amodra@gmail.com>
2610
2611 PR gold/14566
2612 * layout.cc (Layout::set_segment_offsets): When using
2613 common-page-size alignment, ensure we are on a new max-page-size
2614 page.
2615 * output.cc (Output_segment::set_section_addresses): Use
2616 abi_pagesize, not common_pagesize for relro boundary.
2617 (Output_segment::set_offset): Likewise.
2618
bd73a62d
AM
26192012-09-11 Alan Modra <amodra@gmail.com>
2620
2621 * output.h (Output_data_got::add_global_tls, add_local_tls,
2622 add_local_tls_pair): New functions.
2623 (Output_data_got::add_local_pair_with_rel): Remove second
2624 reloc param. Expand comment.
2625 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2626 use_plt_or_tls_offset_, similarly for constructor param.
2627 (Output_data_got::Got_entry::write): Add got_index param.
2628 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2629 add_local_tls_pair): New functions.
2630 (Output_data_got::Got_entry::write): Handle tls symbols
2631 with use_plt_or_tls_offset_ set specially.
2632 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2633 (Output_data_got::do_write): Replace iterator with index, pass
2634 index to entry write function.
2635 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2636 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2637 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2638 call.
2639 * i386.cc (Target_i386::Scan::local): Likewise.
2640 * sparc.cc (Target_sparc::Scan::local): Likewise.
2641 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2642 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2643 do_tls_offset_for_global): New functions.
2644 (Target_powerpc::Scan::local): Correct TLS relocations and got
2645 entry values.
2646 (Target_powerpc::Scan::global): Don't emit unnecessary
2647 dynamic relocations on TLS GOT entries.
2648
00716ab1
AM
26492012-09-10 Matthias Klose <doko@ubuntu.com>
2650
2651 * config.in: Disable sanity check for kfreebsd.
2652
c891b3f9
SA
26532012-09-10 Sterling Augustine <saugustine@google.com>
2654
2655 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2656 (Gdb_index::pubtypes_read): New parameter.
2657 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2658 to calls.
2659 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2660 pubtypes_object_.
2661
e81fea4d
AM
26622012-09-09 Alan Modra <amodra@gmail.com>
2663
2664 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2665 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2666 * gc.h (gc_process_relocs): Call target gc_add_reference.
2667 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2668 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2669 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2670 unnecessary cast.
2671 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2672 to cater for when we don't need code offset. Update use.
2673 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2674 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2675 set_opd_valid): New functions.
2676 (Target_powerpc::do_gc_add_reference): New function.
2677 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2678 stashed refs.
2679 (Target_powerpc::do_gc_mark_symbol): New function.
2680
d2d60eef
CC
26812012-09-06 Cary Coutant <ccoutant@google.com>
2682
2683 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2684 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2685 (Dwarf_die::skip_attributes): Likewise.
2686 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2687 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2688 (main): Call it.
2689 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2690
32ed4573
L
26912012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2692
2693 * testsuite/script_test_3.t: Add .got.plt output section
2694 statement.
2695 * testsuite/script_test_4.t: Likewise.
2696
f4baf0d4
AM
26972012-09-05 Alan Modra <amodra@gmail.com>
2698
2699 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2700 update all uses and lose "enum" when using type.
2701
864a1b56
AM
27022012-09-05 Alan Modra <amodra@gmail.com>
2703
2704 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2705 * configure: Regenerate.
2706 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2707 (plugin_final_layout.stdout): Likewise.
2708 (memory_test): Set page sizes to 0x1000.
2709 * testsuite/Makefile.in: Regenerate.
2710 * testsuite/discard_locals_test.sh: Add FIXME comment.
2711 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2712 * testsuite/pr14265.t: Add .got output section statement.
2713 * testsuite/script_test_2.t: Likewise.
2714 * testsuite/script_test_3.t: Likewise.
2715 * testsuite/script_test_4.t: Likewise.
2716 * testsuite/script_test_5.t: Likewise.
2717 * testsuite/script_test_6.t: Likewise.
2718 * testsuite/script_test_7.t: Likewise.
2719 * testsuite/script_test_9.t: Likewise.
2720
3ea0a085
AM
27212012-09-05 Alan Modra <amodra@gmail.com>
2722
2723 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2724 (Powerpc_relocate_functions::Status): New typedef.
2725 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2726 (Target_powerpc::Scan::local): Handle REL64.
2727 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2728 for REL32 and REL64.
2729 (Target_powerpc::symval_for_branch): New function, extracted from..
2730 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2731 checks. Report overflow errors.
2732
7404fe1b
AM
27332012-09-05 Alan Modra <amodra@gmail.com>
2734
2735 * object.h (Sized_relobj_file::emit_relocs): Delete.
2736 (Sized_relobj_file::emit_relocs_reltype): Delete.
2737 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2738 relocate_relocs for --emit-relocs.
2739 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2740 * output.h: Update comment.
2741 (Output_segment::first_section): New function.
2742 (Output_segment::first_section_load_address): Use first_section.
2743 * output.cc (Output_segment::first_section): New function extracted..
2744 (Output_segment::first_section_load_address): ..from here. Delete.
2745 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2746 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2747 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2748 adjust call to target.h function.
2749 * i386.cc (Target_i386): Likewise.
2750 * sparc.cc (Target_sparc): Likewise.
2751 * x86_64.cc (Target_x86_64): Likewise.
2752 * powerpc.cc (Target_powerpc): Likewise.
2753 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2754 first tls section has section symbol for optimised local dynamic
2755 output relocs.
2756 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2757 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2758 optimised tls code.
2759 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2760 Rename to relocate_relocs. Update error message.
2761
957564c9
AS
27622012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2763
2764 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2765 --just-symbols.
2766
dd93cd0a
AM
27672012-08-31 Alan Modra <amodra@gmail.com>
2768
2769 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2770 (Powerpc_relobj::toc_base_offset): New stub function.
2771 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2772 got_mod_index_offset to tlsld_got_offset. Update all refs.
2773 (Target_powerpc::Relocate::enum skip_tls): New.
2774 (Target_powerpc::call_tls_get_addr_): New var.
2775 (Target_powerpc::is_branch_reloc): Move to file scope.
2776 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2777 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2778 New functions.
2779 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2780 (powerpc_info): Correct common_pagesize for ppc64.
2781 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2782 (Powerpc_relocate_functions): Add overflow check enums and functions.
2783 Add non-shift version of rela, rela_ua. Delete all rel public
2784 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2785 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2786 addr16_ha3, addr14 functions.
2787 (Output_data_got_powerpc::add_constant_pair): New function.
2788 (Output_data_got_powerpc::got_base_offset): Likewise.
2789 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2790 (instruction constants): Sort, add some more.
2791 (Output_data_glink::do_write): Add and use Address typedef. Use
2792 object->toc_base_offset() stub for 64-bit.
2793 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2794 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2795 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2796 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2797 Always treat .opd relocs as against locally defined symbol.
2798 Correct condition for RELATIVE relocs.
2799 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2800 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2801 for 32-bit syms with a plt entry. Correct ppc64 toc base
2802 calculations. Handle TLS relocs, and more. Add overflow
2803 checking and adjust for Powerpc_relocate_functions changes.
2804 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2805 Reinstate --emit-relocs code with FIXME.
2806
a1373b60
AM
28072012-08-30 Alan Modra <amodra@gmail.com>
2808
2809 * layout.cc (Layout::set_segment_offsets): Set p_align to
2810 abi_pagesize, not common_pagesize.
2811 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2812 to determine whether file header can go in segment.
2813
703d02da
AM
28142012-08-30 Alan Modra <amodra@gmail.com>
2815
2816 * output.h (Output_reloc::Output_reloc <output section>): Add
2817 is_relative param. Adjust calls.
2818 (Output_reloc::add_output_section_relative): New functions.
2819 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2820 is_relative.
2821 (Output_reloc::symbol_value): Handle SECTION_CODE.
2822
16164a6b
ST
28232012-08-24 Sriraman Tallam <tmsriram@google.com>
2824
2825 * gold.cc (queue_middle_tasks): Call layout again when unique
2826 segments for sections is desired.
2827 * layout.cc (Layout::Layout): Initialize new members.
2828 (Layout::get_output_section_flags): New function.
2829 (Layout::choose_output_section): Call get_output_section_flags.
2830 (Layout::layout): Make output section for mapping to a unique segment.
2831 (Layout::insert_section_segment_map): New function.
2832 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2833 output sections marked so.
16164a6b
ST
2834 (Layout::segment_precedes): Check for unique segments when sorting.
2835 * layout.h (Layout::Unique_segment_info): New struct.
2836 (Layout::Section_segment_map): New typedef.
2837 (Layout::insert_section_segment_map): New function.
2838 (Layout::get_output_section_flags): New function.
2839 (Layout::is_unique_segment_for_sections_specified): New function.
2840 (Layout::set_unique_segment_for_sections_specified): New function.
2841 (Layout::unique_segment_for_sections_specified_): New member.
2842 (Layout::section_segment_map_): New member.
2843 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2844 Rename is_gc_pass_one to is_pass_one.
2845 Rename is_gc_pass_two to is_pass_two.
2846 Rename is_gc_or_icf to is_two_pass.
2847 Check for which pass based on whether symbols data is present.
2848 Make it two pass when unique segments for sections is desired.
2849 * output.cc (Output_section::Output_section): Initialize new
2850 members.
2851 * output.h (Output_section::is_unique_segment): New function.
2852 (Output_section::set_is_unique_segment): New function.
2853 (Output_section::is_unique_segment_): New member.
2854 (Output_section::extra_segment_flags): New function.
2855 (Output_section::set_extra_segment_flags): New function.
2856 (Output_section::extra_segment_flags_): New member.
2857 (Output_section::segment_alignment): New function.
2858 (Output_section::set_segment_alignment): New function.
2859 (Output_section::segment_alignment_): New member.
2860 (Output_segment::Output_segment): Initialize is_unique_segment_.
2861 (Output_segment::is_unique_segment): New function.
2862 (Output_segment::set_is_unique_segment): New function.
2863 (Output_segment::is_unique_segment_): New member.
2864 * plugin.cc (allow_unique_segment_for_sections): New function.
2865 (unique_segment_for_sections): New function.
2866 (Plugin::load): Add new functions to transfer vector.
2867 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2868 * Makefile.in: Regenerate.
2869 * testsuite/plugin_final_layout.sh: Check if unique segment
2870 functionality works.
2871 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2872 are available.
2873 (allow_unique_segment_for_sections): New global.
2874 (unique_segment_for_sections): New global.
2875 (claim_file_hook): Call allow_unique_segment_for_sections.
2876 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2877
1e2bee4f
CC
28782012-08-22 Cary Coutant <ccoutant@google.com>
2879
2880 * layout.cc (Layout::include_section): Don't assert on GROUP
2881 sections with --emit-relocs.
2882
1d5dfe78
CC
28832012-08-21 Cary Coutant <ccoutant@google.com>
2884
2885 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2886 if --export-dynamic-symbol names an undef symbol.
2887
c9269dff
AM
28882012-08-18 Alan Modra <amodra@gmail.com>
2889
2890 * powerpc.cc: Formatting and white space.
2891 (Powerpc_relobj): Rename got2_section_ to special_.
2892 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2893 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2894 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2895 (Target_powerpc): Add Address typedef and invalid_address. Use
2896 throughout.
2897 (Target_powerpc::is_branch_reloc): New function.
2898 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2899 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2900 for dst_mask, value and addend.
2901 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2902 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2903 (Output_data_glink::do_write): Correct toc base. Don't try to use
2904 uint16_t for 24-bit offset. Use get_output_section_offset and
2905 check return.
2906 (Target_powerpc::Scan::local): Handle more relocs.
2907 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2908 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2909 Plug in toc restoring insn after plt calls. Translate branches
2910 to function descriptor symbols to corresponding entry point.
2911 (Target_powerpc::relocate_for_relocatable): Check return from
2912 get_output_section_offset.
2913 * symtab.h: Comment typo.
2914
b1759dce
ILT
29152012-08-14 Ian Lance Taylor <iant@google.com>
2916
2917 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2918 unsupported_relocal_local to call unsupported_reloc_global.
2919
b9b2ae8b
NC
29202012-08-14 Nick Clifton <nickc@redhat.com>
2921
2922 PR ld/14265
2923 * script-sections.cc (Sections_element::output_section_name): Add
2924 keep return parameter.
2925 (Output_section_element::match_name): Add keep return parameter.
2926 Return the value of the keep_ member.
2927 * script-sections.h (class Output_section): Update
2928 output_section_name prototype.
2929 * layout.cc (Layout::keep_input_section): New public member
2930 function.
2931 (Layout::choose_output_section): Pass keep parameter to
2932 output_section_name.
2933 * layout.h (class Layout): Add keep_input_section.
2934 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2935 sections.
2936 * testsuite/Makefile.am: Add a test.
2937 * testsuite/Makefile.in: Regenerate.
2938 * testsuite/pr14265.c: Source file for the test.
2939 * testsuite/pr14265.t: Linker script for the test.
2940 * testsuite/pr14265.sh: Shell script for the test.
2941
921b5322
AM
29422012-08-14 Alan Modra <amodra@gmail.com>
2943
2944 * target.h (Target::output_section_name): New function.
2945 (Target::do_output_section_name): New function.
2946 * layout.cc (Layout::choose_output_section): Call the above.
2947 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2948
6ce78956
AM
29492012-08-14 Alan Modra <amodra@gmail.com>
2950
2951 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2952 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2953 for replace_constant call.
2954 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2955 (Output_data_glink::do_print_to_mapfile): New function.
2956 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2957 (Target_powerpc::Relocate::relocate): Likewise.
2958
d1a8cabd
AM
29592012-08-14 Alan Modra <amodra@gmail.com>
2960
2961 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2962 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2963 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2964 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2965 all references to shndx_. Handle special case for R_PPC_PLTREL24
2966 here.
2967 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2968 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2969 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2970 here.
2971 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2972 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2973
d83ce4e3
AM
29742012-08-12 Alan Modra <amodra@gmail.com>
2975
2976 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2977 (glink insn constants): Use uint32_t.
2978 (Output_data_glink::add_entry): Use insert, not [] operator.
2979
cf43a2fe
AM
29802012-08-11 Alan Modra <amodra@gmail.com>
2981
2982 * object.h (Sized_relobj_file::find_shdr): New function.
2983 (Sized_relobj_file::find_special_sections): New function.
2984 * object.cc (Sized_relobj_file::find_shdr): New function.
2985 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2986 (Sized_relobj_file::find_special_sections): New function, split out..
2987 (Sized_relobj_file::do_read_symbols): ..from here.
2988 * output.h (Output_data_got::replace_constant): New function.
2989 (Output_data_got::num_entries): New function.
2990 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2991 (Output_data_got::got_offset): Protected rather than private.
2992 (Output_data_got::replace_got_entry): New function.
2993 * output.cc (Output_data_got::replace_got_entry): New function.
2994 * powerpc.cc (class Powerpc_relobj): New.
2995 (class Powerpc_relocate_functions): Delete all psymval variants or
2996 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2997 Implement _ha functions using corresponding _hi function.
2998 (Powerpc_relobj::find_special_sections): New function.
2999 (Target_powerpc::do_make_elf_object): New function.
3000 (class Output_data_got_powerpc): New.
3001 (class Output_data_glink): New.
3002 (class Powerpc_scan_relocatable_reloc): New.
3003 Many more changes througout file.
3004
3c892704
NC
30052012-08-09 Nick Clifton <nickc@redhat.com>
3006
3007 * po/vi.po: Updated Vietnamese translation.
3008
82435b3b
ILT
30092012-08-07 Ian Lance Taylor <iant@google.com>
3010
3011 * layout.cc (Layout::add_target_dynamic_tags): If
3012 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3013 plt_rel.
3014
a6dc81d2
NC
30152012-07-30 Nick Clifton <nickc@redhat.com>
3016
3017 * po/gold.pot: Updated template.
3018 * po/es.po: Updated Spanish translation.
3019
f1415016
CC
30202012-07-18 Cary Coutant <ccoutant@google.com>
3021
3022 PR gold/14344
3023 * configure.ac: Add check for -gpubnames support.
3024 * configure: Regenerate.
3025 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3026 support; force -gno-pubnames.
3027 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3028 support.
3029 (gdb_index_test_4): New test.
3030 * testsuite/Makefile.in: Regenerate.
3031 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3032 * testsuite/gdb_index_test_2.sh: Likewise.
3033 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3034 * testsuite/gdb_index_test_4.sh: New script.
3035 * testsuite/gdb_index_test_comm.sh: New script with common code;
3036 don't look for space after colon.
3037
b7fd7c37
ST
30382012-07-16 Sriraman Tallam <tmsriram@google.com>
3039
3040 * gold.cc (queue_middle_tasks): Update function order only after
3041 deferred objects due to plugins are processed.
3042
1f3212db
ILT
30432012-07-11 Ian Lance Taylor <iant@google.com>
3044
3045 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3046 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3047 (Target_arm::scan_reloc_for_stub): Likewise.
3048 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3049 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3050 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3051 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3052 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3053
81c82a68
ILT
30542012-07-10 Dodji Seketeli <dodji@redhat.com>
3055 Ian Lance Taylor <iant@google.com>
3056
3057 PR gold/14309
3058 * configure.ac: Test whether std::tr1::hash<off_t> works.
3059 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3060 needed.
3061 * output.h (class Output_fill): Add virtual destructor.
3062 * configure, config.in: Rebuild.
3063
eabc84f4
RM
30642012-06-22 Roland McGrath <mcgrathr@google.com>
3065
3066 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3067
370e30b6
RÁE
30682012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3069
3070 * plugin.cc (Plugin::load): Handle position independent executables.
3071
fb1b895d
CC
30722012-06-06 Cary Coutant <ccoutant@google.com>
3073
3074 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3075 add .debug_macro.
3076 (lines_only_debug_sections): Likewise.
3077 (gdb_fast_lookup_sections): New static array.
3078 (is_gdb_debug_section): Rename formal parameter.
3079 (is_lines_only_debug_section): Likewise.
3080 (is_gdb_fast_lookup_section): New function.
3081 (Layout::include_section): Check for ".zdebug_" prefix; pass
3082 section name suffix to is_gdb_debug_section, et al.; check for
3083 fast-lookup sections when building .gdb_index.
3084 * options.h (--strip-debug-gdb): Update GDB version number.
3085
7c0640fa
CC
30862012-06-06 Cary Coutant <ccoutant@google.com>
3087
3088 * configure.ac: Add check for fallocate.
3089 * configure: Regenerate.
3090 * config.in: Regenerate.
3091
3092 * options.h (class General_options): Add --mmap-output-file and
3093 --posix-fallocate options.
3094 * output.cc: (posix_fallocate): Remove; replace with...
3095 (gold_fallocate): New function.
3096 (Output_file::map_no_anonymous): Call gold_fallocate.
3097 (Output_file::map): Check --mmap-output-file option.
3098
2a49eb69
DK
30992012-06-05 Jing Yu <jingyu@google.com>
3100
3101 * gold.h (textdomain): Add do {} to empty while(0).
3102 (bindtextdomain): Likewise.
3103
fad072ac
CC
31042012-06-04 Cary Coutant <ccoutant@google.com>
3105
3106 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3107 has_dynsym_index.
3108
8cc69fb6
ST
31092012-05-25 Sriraman Tallam <tmsriram@google.com>
3110
3111 * symtab.cc (Symbol_table::define_special_symbol):
3112 Initialize *poldsym to prevent uninitialized variable errors.
3113
1be75daa
CC
31142012-05-23 Cary Coutant <ccoutant@google.com>
3115
3116 * layout.cc (Layout::section_name_mapping): Add rules to handle
3117 exact match on .data.rel.ro.local or .data.rel.ro.
3118 (Layout::output_section_name): Check for exact matches.
3119
9b689de0
CC
31202012-05-23 Cary Coutant <ccoutant@google.com>
3121
3122 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3123 more carefully.
3124
b24fdbf5
CC
31252012-05-22 Cary Coutant <ccoutant@google.com>
3126
3127 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3128 object before exporting symbol.
3129
e550e1a2
L
31302012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3131
3132 * testsuite/tls_test.cc: Include "config.h" first.
3133 * testsuite/tls_test_c.c: Likewise.
3134
df7b86aa
NC
31352012-05-17 Daniel Richard G. <skunk@iskunk.org>
3136 Nick Clifton <nickc@redhat.com>
3137
3138 PR 14072
3139 * configure.in: Add check that sysdep.h has been included before
3140 any system header files.
3141 * configure: Regenerate.
3142 * config.in: Regenerate.
3143
1007b503
CC
31442012-05-14 Cary Coutant <ccoutant@google.com>
3145
3146 * layout.cc (Layout::make_output_section): Mark .tdata section
3147 as RELRO.
3148 * testsuite/relro_test.cc: Add a TLS variable.
3149
fd885f3a
L
31502012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3151
3152 PR gold/14091
3153 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3154 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3155 R_X86_64_64.
3156
80f5885c
CC
31572012-05-08 Cary Coutant <ccoutant@google.com>
3158
3159 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3160 (lines_only_debug_sections): Likewise.
3161
2e702c99
RM
31622012-05-02 Roland McGrath <mcgrathr@google.com>
3163
3164 * nacl.cc: New file.
3165 * nacl.h: New file.
3166 * Makefile.am (CCFILES, HFILES): Add them.
3167 * Makefile.in: Regenerate.
3168 * i386.cc (Output_data_plt_i386_nacl): New class.
3169 (Output_data_plt_i386_nacl_exec): New class.
3170 (Output_data_plt_i386_nacl_dyn): New class.
3171 (Target_i386_nacl): New class.
3172 (Target_selector_i386_nacl): New class.
3173 (target_selector_i386): Use it instead of Target_selector_i386.
3174 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3175 (Target_x86_64_nacl): New class.
3176 (Target_selector_x86_64_nacl): New class.
3177 (target_selector_x86_64, target_selector_x32): Use it instead of
3178 Target_selector_x86_64.
3179 * arm.cc (Output_data_plt_arm_nacl): New class.
3180 (Target_arm_nacl): New class.
3181 (Target_selector_arm_nacl): New class.
3182 (target_selector_arm, target_selector_armbe): Use it instead of
3183 Target_selector_arm.
3184
3185 * target-select.cc (select_target): Take new Input_file* and off_t
3186 arguments, pass them on to recognize method of selector.
3187 * object.cc (make_elf_sized_object): Update caller.
3188 * parameters.cc (parameters_force_valid_target): Likewise.
3189 * incremental.cc (make_sized_incremental_binary): Likewise.
3190 * target-select.h: Update decl.
3191 (Target_selector::recognize): Take new Input_file* argument,
3192 pass it on to do_recognize.
3193 (Target_selector::do_recognize): Take new Input_file* argument.
3194 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3195 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3196 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3197 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3198
3199 * target.h (Target::Target_info): New members isolate_execinstr
3200 and rosegment_gap.
3201 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3202 * arm.cc (Target_arm::arm_info): Update initializer.
3203 * i386.cc (Target_i386::i386_info): Likewise.
3204 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3205 * sparc.cc (Target_sparc::sparc_info): Likewise.
3206 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3207 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3208 * layout.cc (Layout::attach_allocated_section_to_segment):
3209 Take new const Target* argument. If target->isolate_execinstr(), act
3210 like --rosegment.
3211 (Layout::find_first_load_seg): Take new const Target* argument;
3212 if target->isolate_execinstr(), reject PF_X segments.
3213 (Layout::relaxation_loop_body): Update caller.
3214 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3215 reset file offset to zero when we hit LOAD_SEG, and then do a second
3216 loop over the segments before LOAD_SEG to reassign offsets after
3217 addresses have been determined. Handle target->rosegment_gap().
3218 (Layout::attach_section_to_segment): Take new const Target* argument;
3219 pass it to attach_allocated_section_to_segment.
3220 (Layout::make_output_section): Update caller.
3221 (Layout::attach_sections_to_segments): Take new const Target* argument;
3222 pass it to attach_section_to_segment.
3223 * gold.cc (queue_middle_tasks): Update caller.
3224 * layout.h (Layout): Update method decls with new arguments.
3225
3226 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3227 Target_info pointer to use.
3228 (Target_arm::do_make_data_plt): New virtual method.
3229 (Target_arm::make_data_plt): New method that calls it.
3230 (Target_arm::make_plt_entry): Use it.
3231 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3232 for the section alignment.
3233 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3234 method.
3235 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3236 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3237 method.
3238 (Output_data_plt_arm::get_plt_entry_size): Call it.
3239 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3240 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3241 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3242 method.
3243 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3244 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3245 method instead of sizeof(plt_entry).
3246 (Output_data_plt_arm::add_entry): Likewise.
3247 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3248 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3249 than static method.
3250 (Target_arm::plt_entry_size): Likewise.
3251 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3252 Move to ...
3253 (Output_data_plt_arm_standard): ... here, new class.
3254 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3255 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3256 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3257
3258 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3259 Take additional argument for the PLT entry size.
3260 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3261 Use get_plt_entry_size method rather than plt_entry_size variable.
3262 (Output_data_plt_x86_64::reserve_slot): Likewise.
3263 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3264 (Output_data_plt_x86_64::add_entry): Likewise.
3265 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3266 (Output_data_plt_x86_64::address_for_global): Likewise.
3267 (Output_data_plt_x86_64::address_for_local): Likewise.
3268 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3269 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3270 Make method non-static.
3271 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3272 method.
3273 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3274 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3275 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3276 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3277 virtual method.
3278 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3279 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3280 virtual method.
3281 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3282 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3283 virtual method.
3284 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3285 (Output_data_plt_x86_64::plt_entry_size)
3286 (Output_data_plt_x86_64::first_plt_entry)
3287 (Output_data_plt_x86_64::plt_entry)
3288 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3289 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3290 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3291 (Output_data_plt_x86_64_standard): ... here, new class.
3292 (Target_x86_64::Target_x86_64): Take optional argument for the
3293 Target_info pointer to use.
3294 (Target_x86_64::do_make_data_plt): New virtual method.
3295 (Target_x86_64::make_data_plt): New method to call it.
3296 (Target_x86_64::init_got_plt_for_update): Use that.
3297 Call this->plt_->add_eh_frame method here.
3298 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3299 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3300 rather than static method.
3301 (Target_x86_64::plt_entry_size): Likewise.
3302 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3303 rather than plt_entry_size variable. Move guts of PLT filling to...
3304 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3305 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3306 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3307
3308 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3309 additional argument for the section alignment.
3310 Don't do add_eh_frame_for_plt here.
3311 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3312 non-static. Use get_plt_entry_size method rather than plt_entry_size
3313 variable.
3314 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3315 method.
3316 (Output_data_plt_i386::get_plt_entry_size): Call it.
3317 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3318 (Output_data_plt_i386::add_eh_frame): New method to call it.
3319 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3320 method.
3321 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3322 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3323 method.
3324 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3325 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3326 method instead of plt_entry_size.
3327 (Output_data_plt_i386::plt_entry_size)
3328 (Output_data_plt_i386::plt_eh_frame_fde_size)
3329 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3330 (Output_data_plt_i386_standard): ... here, new class.
3331 (Output_data_plt_i386_exec): New class.
3332 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3333 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3334 (Output_data_plt_i386::exec_plt_entry): Move to ...
3335 (Output_data_plt_i386_exec::plt_entry): ... here.
3336 (Output_data_plt_i386_dyn): New class.
3337 (Output_data_plt_i386::first_plt_entry): Move to ...
3338 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3339 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3340 (Output_data_plt_i386_dyn::plt_entry): ... here.
3341 (Target_i386::Target_i386): Take optional argument for the Target_info
3342 pointer to use.
3343 (Target_i386::do_make_data_plt): New virtual method.
3344 (Target_i386::make_data_plt): New method to call it.
3345 (Target_i386::make_plt_section): Use that.
3346 Call this->plt_->add_eh_frame method here.
3347 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3348 rather than plt_entry_size variable.
3349 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3350 (Output_data_plt_i386::address_for_local): Likewise.
3351 (Output_data_plt_i386::do_write): Likewise.
3352 Move guts of PLT filling to...
3353 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3354 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3355 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3356 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3357
b9b9f2ee
CC
33582012-05-01 Cary Coutant <ccoutant@google.com>
3359
3360 * dwarf_reader.cc (Dwarf_die::read_attributes)
3361 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3362 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3363 * reduced_debug_output.cc
3364 (Output_reduced_debug_info_section::get_die_end): Remove
3365 DW_FORM_GNU_ref_index. Add default case.
3366
57923f48
MW
33672012-04-26 Mark Wielaard <mjw@redhat.com>
3368
3369 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3370 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3371 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3372 DW_AT_high_pc as offset from DW_AT_low_pc.
3373
3374 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3375 * testsuite/Makefile.in: Regenerate.
3376 * testsuite/gdb_index_test_3.c: New test source file.
3377 * testsuite/gdb_index_test_3.sh: New test source file.
3378
2c54b4f4
ILT
33792012-04-25 Ian Lance Taylor <iant@google.com>
3380
3381 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3382 pointer.
3383 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3384 as a class, not a struct.
3385 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3386 (Target_arm::apply_cortex_a8_workaround): Likewise.
3387 * gc.h: Declare Reloc_types as a struct, not a class.
3388 * object.h: Declare Symbols_data as a struct.
3389 * reloc.h: Declare Read_relocs_data as a struct.
3390 * target.h: Declare Relocate_info as a struct.
3391
a5a5f7a3
DM
33922012-04-24 David S. Miller <davem@davemloft.net>
3393
3394 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3395 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3396 and R_SPARC_WPLT30.
3397
f038d496
CC
33982012-04-24 Cary Coutant <ccoutant@google.com>
3399
3400 * incremental-dump.cc (find_input_containing_global): Replace
3401 magic number with symbolic constant.
3402 (dump_incremental_inputs): Update version number.
3403 * incremental.cc (Output_section_incremental_inputs): Update version
3404 number; import symbolic constants from Incremental_inputs_reader.
3405 (Incremental_inputs::create_data_sections): Align relocations
3406 section correctly for 64-bit targets.
3407 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3408 constants; add padding.
3409 (Output_section_incremental_inputs::write_header): Add assert for
3410 header_size.
3411 (Output_section_incremental_inputs::write_input_files): Add assert
3412 for input_entry_size.
3413 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3414 add assert for object_info_size, input_section_entry_size,
3415 global_sym_entry_size.
3416 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3417 for data structure sizes; use them.
3418 (Incremental_input_entry_reader): Import symbolic constants from
3419 Incremental_inputs_reader; use them.
3420
a4d85145
DM
34212012-04-23 David S. Miller <davem@davemloft.net>
3422
3423 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3424 and elf_flags_set_.
3425 (Target_sparc::Target_sparc): Initialize new fields.
3426 (Target_sparc::do_make_elf_object): New function.
3427 (Target_sparc::do_adjust_elf_header): New function.
3428
1d509098
CC
34292012-04-23 Cary Coutant <ccoutant@google.com>
3430
3431 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3432 CU range table of gdb index.
3433
7ebeff7f
DM
34342012-04-20 David S. Miller <davem@davemloft.net>
3435
3436 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3437 instead of false.
3438
13cf9988
DM
34392012-04-16 David S. Miller <davem@davemloft.net>
3440
2a1079e8
DM
3441 * sparc.cc (Target_sparc::got_address): New function.
3442 (Sparc_relocate_functions::gdop_hix22): New function.
3443 (Sparc_relocate_functions::gdop_lox10): New function.
3444 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3445 relocs.
3446 (Target_sparc::Scan::local): Likewise if the global symbol is not
3447 preemptible and is not IFUNC.
3448 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3449 transformations for local and non-preemptible non-IFUNC global
3450 symbols.
3451
0bc964fc
DM
3452 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3453 writing out 64-bit part of ranges.
3454
661d7a80
DM
3455 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3456 -fpic and -fpie respectively.
3457 * Makefile.in: Regenerate.
3458
8c2bf391
DM
3459 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3460 (Target_sparc::Target_sparc): Initialize new field.
3461 (Target_sparc::do_plt_section_for_global): New function.
3462 (Target_sparc::do_plt_section_for_local): New function.
3463 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3464 (Target_sparc::make_plt_section): New function, broken out of
3465 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3466 (Target_sparc::make_plt_entry): Call make_plt_section.
3467 (Target_sparc::make_local_ifunc_plt_entry): New function.
3468 (Target_sparc::rela_ifunc_section): New function.
3469 (Target_sparc::plt_section): Remove const.
3470 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3471 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3472 and ifunc_count_ fields.
3473 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3474 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3475 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3476 (Output_data_plt_sparc::rela_ifunc): New function.
3477 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3478 (Output_data_plt_sparc::has_ifunc_section): New function.
3479 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3480 (Output_data_plt_sparc::address_for_global): New function.
3481 (Output_data_plt_sparc::address_for_local): New function.
3482 (Output_data_plt_sparc::plt_index_to_offset): New function.
3483 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3484 and entry_count.
3485 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3486 entry_count.
3487 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3488 R_SPARC_JMP_IREL to switch.
3489 (Target_sparc::Scan::check_non_pic): Likewise.
3490 (Target_sparc::Scan::local): Handle IFUNC symbols.
3491 (Target_sparc::Scan::local): Likewise.
3492 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3493 and plt_address_for_local.
3494 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3495 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3496
13cf9988
DM
3497 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3498 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3499 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3500 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3501 global relocs too.
3502 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3503 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3504 calls.
3505 * sparc.cc (Target_sparc::Scan::global): Likewise.
3506 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3507
31821be0
CC
35082012-04-16 Cary Coutant <ccoutant@google.com>
3509
3510 * archive.cc (Library_base::should_include_member): Check for
3511 --export-dynamic-symbol.
3512 * options.h (class General_options): Add --export-dynamic-symbol.
3513 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3514 --export-dynamic-symbol.
3515 (Symbol_table::gc_mark_undef_symbols): Likewise.
3516 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3517
2615994e
DM
35182012-04-12 David S. Miller <davem@davemloft.net>
3519
3520 * sparc.cc (Reloc::wdisp10): New relocation method.
3521 (Reloc::h34): Likewise.
3522 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3523 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3524 R_SPARC_WDISP10.
3525 (Target_sparc::Scan::local): Likewise.
3526 (Target_sparc::Scan::global): Likewise.
3527 (Target_sparc::Relocate::relocate): Likewise.
3528
6782735d
CC
35292012-04-09 Cary Coutant <ccoutant@google.com>
3530
3531 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3532 low_pc == 0.
3533
8c7a0b00
ILT
35342012-04-06 Ian Lance Taylor <iant@google.com>
3535
3536 * timer.cc: #include <unistd.h>.
3537
58797674
RM
35382012-04-06 Roland McGrath <mcgrathr@google.com>
3539
3540 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3541 * config.in: Regenerate.
3542 * configure: Regenerate.
3543
44350750
NC
35442012-04-05 Nick Clifton <nickc@redhat.com>
3545
3546 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3547 (AM_LC_MESSAGES): Add.
3548 * aclocal.m4: Regenerate.
3549 * config.in: Regenerate.
3550 * configure: Regenerate.
3551
c1027032
CC
35522012-03-21 Cary Coutant <ccoutant@google.com>
3553
3554 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3555 * Makefile.in: Regenerate.
3556 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3557 (Sized_elf_reloc_mapper::symbol_section): New function.
3558 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3559 (make_elf_reloc_mapper): New function.
3560 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3561 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3562 (Dwarf_abbrev_table::do_get_abbrev): New function.
3563 (Dwarf_ranges_table::read_ranges_table): New function.
3564 (Dwarf_ranges_table::read_range_list): New function.
3565 (Dwarf_pubnames_table::read_section): New function.
3566 (Dwarf_pubnames_table::read_header): New function.
3567 (Dwarf_pubnames_table::next_name): New function.
3568 (Dwarf_die::Dwarf_die): New function.
3569 (Dwarf_die::read_attributes): New function.
3570 (Dwarf_die::skip_attributes): New function.
3571 (Dwarf_die::set_name): New function.
3572 (Dwarf_die::set_linkage_name): New function.
3573 (Dwarf_die::attribute): New function.
3574 (Dwarf_die::string_attribute): New function.
3575 (Dwarf_die::int_attribute): New function.
3576 (Dwarf_die::uint_attribute): New function.
3577 (Dwarf_die::ref_attribute): New function.
3578 (Dwarf_die::child_offset): New function.
3579 (Dwarf_die::sibling_offset): New function.
3580 (Dwarf_info_reader::check_buffer): New function.
3581 (Dwarf_info_reader::parse): New function.
3582 (Dwarf_info_reader::do_parse): New function.
3583 (Dwarf_info_reader::do_read_string_table): New function.
3584 (Dwarf_info_reader::lookup_reloc): New function.
3585 (Dwarf_info_reader::get_string): New function.
3586 (Dwarf_info_reader::visit_compilation_unit): New function.
3587 (Dwarf_info_reader::visit_type_unit): New function.
3588 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3589 Sized_elf_reloc_mapper.
3590 (Sized_dwarf_line_info::symbol_section): Remove function.
3591 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3592 (Sized_dwarf_line_info::read_line_mappings): Remove object
3593 parameter, adjust callers.
3594 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3595 * dwarf_reader.h: Include <sys/types.h>.
3596 (class Track_relocs): Remove forward declaration.
3597 (class Elf_reloc_mapper): New class.
3598 (class Sized_elf_reloc_mapper): New class.
3599 (class Dwarf_abbrev_table): New class.
3600 (class Dwarf_range_list): New class.
3601 (class Dwarf_ranges_table): New class.
3602 (class Dwarf_pubnames_table): New class.
3603 (class Dwarf_die): New class.
3604 (class Dwarf_info_reader): New class.
3605 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3606 (Sized_dwarf_line_info::symbol_section): Remove member function.
3607 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3608 base class.
3609 * gdb-index.cc: New source file.
3610 * gdb-index.h: New source file.
3611 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3612 and .debug_types sections, call Layout::add_to_gdb_index.
3613 (Sized_relobj_incr::do_section_name): Implement.
3614 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3615 return type; Implement.
3616 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3617 return type.
3618 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3619 parameter list and return type.
3620 (Sized_incr_dynobj::do_section_contents): Likewise.
3621 * layout.cc: Include gdb-index.h.
3622 (Layout::Layout): Initialize gdb_index_data_.
3623 (Layout::init_fixed_output_section): Check for .gdb_index section.
3624 (Layout::add_to_gdb_index): New function. Instantiate.
3625 * layout.h: Add forward declaration for class Gdb_index.
3626 (Layout::add_to_gdb_index): New member function.
3627 (Layout::gdb_index_data_): New data member.
3628 * main.cc: Include gdb-index.h.
3629 (main): Print statistics for gdb index.
3630 * object.cc (Object::section_contents): Move code into
3631 do_section_contents.
3632 (need_decompressed_section): Check for sections needed when building
3633 gdb index.
3634 (build_compressed_section_map): Likewise.
3635 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3636 gdb index.
3637 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3638 sections; call Layout::add_to_gdb_index.
3639 (Sized_relobj_file::do_decompressed_section_contents): Call
3640 do_section_contents directly.
3641 * object.h (Object::do_section_contents): Adjust parameter list and
3642 return type.
3643 (Object::do_decompressed_section_contents): Call do_section_contents
3644 directly.
3645 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3646 return type.
3647 * options.h (class General_options): Add --gdb-index option.
3648 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3649 list and return type.
3650 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3651 * reloc.h (Track_relocs::checkpoint): New function.
3652 (Track_relocs::reset): New function.
3653
3654 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3655 New test cases.
3656 * testsuite/Makefile.in: Regenerate.
3657 * testsuite/gdb_index_test.cc: New test source file.
3658 * testsuite/gdb_index_test_1.sh: New test source file.
3659 * testsuite/gdb_index_test_2.sh: New test source file.
3660
647f1574
DK
36612012-03-19 Doug Kwan <dougkwan@google.com>
3662
3663 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3664 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3665 __exidx_start and __exidx_end. Make symbol table parameter
3666 anonymous as it is not used.
3667 * gold.cc (queue_middle_tasks): Call target hook to define any
3668 target-specific symbols.
3669 * target.h (Target::define_standard_symbols): New method.
3670 (Target::do_define_standard_symbols): Same.
3671 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3672 * testsuite/Makefile.in: Regenerate.
3673 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3674 and __exidx_end.
3675 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3676 relocations are generated for __exidx_start and __exidx_end.
3677
7c6109da
DK
36782012-03-16 Doug Kwan <dougkwan@google.com>
3679
3680 * testsuite/Makefile.am: Disable test initpri3b.
3681 * testsuite/Makefile.in: Regenerate.
3682
7b8957f8
DK
36832012-03-15 Doug Kwan <dougkwan@google.com>
3684
3685 * arm.cc (Target_arm::got_section): Make .got section read-only
3686 if -z now is given.
3687
14dc9ef7
ILT
36882012-03-15 Ian Lance Taylor <iant@google.com>
3689
3690 PR gold/13850
3691 * layout.cc (Layout::make_output_section): Correctly mark
3692 SHT_INIT_ARRAY, et. al., as relro.
3693
fa40b62a
DK
36942012-03-14 Doug Kwan <dougkwan@google.com>
3695
3696 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3697 dynamic relocations for protected symbols in shared objects.
3698
fd325007
ILT
36992012-03-13 Ian Lance Taylor <iant@google.com>
3700
3701 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3702 keep the larger alignment.
3703
e8dd54e1
CC
37042012-03-12 Cary Coutant <ccoutant@google.com>
3705
3706 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3707 handling of DW_LNE_define_file.
3708
feb5f3b0
CC
37092012-03-12 Cary Coutant <ccoutant@google.com>
3710
3711 * reduced_debug_output.cc
3712 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3713 codes to switch.
3714
a1fb4256
CC
37152012-02-29 Cary Coutant <ccoutant@google.com>
3716
3717 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3718
5dd8762a
CC
37192012-02-29 Cary Coutant <ccoutant@google.com>
3720
3721 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3722 Call Object::decompressed_section_contents.
3723 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3724 New dtor.
3725 (Sized_dwarf_line_info::buffer_start_): New data member.
3726 * merge.cc (Output_merge_data::do_add_input_section): Call
3727 Object::decompressed_section_contents.
3728 (Output_merge_string::do_add_input_section): Likewise.
3729 * object.cc (need_decompressed_section): New function.
3730 (build_compressed_section_map): Decompress sections needed later.
3731 (Sized_relobj_file::do_decompressed_section_contents): New function.
3732 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3733 * object.h (Object::decompressed_section_contents): New function.
3734 (Object::discard_decompressed_sections): New function.
3735 (Object::do_decompressed_section_contents): New function.
3736 (Object::do_discard_decompressed_sections): New function.
3737 (Compressed_section_info): New type.
3738 (Compressed_section_map): Include decompressed section contents.
3739 (Sized_relobj_file::do_decompressed_section_contents): New function.
3740 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3741
7b5de7ee
CC
37422012-02-16 Cary Coutant <ccoutant@google.com>
3743
3744 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3745 * testsuite/Makefile.in: Regenerate.
3746
f9fa4a63
CC
37472012-02-14 Cary Coutant <ccoutant@google.com>
3748
3749 * options.cc (General_options::finalize): Disallow -pie and -static.
3750
2c175ebc
DK
37512012-02-03 Doug Kwan <dougkwan@google.com>
3752
3753 * arm.cc (Arm_relocate_functions::abs8,
3754 Arm_relocate_functions::abs16): Use
3755 Bits::has_signed_unsigned_overflow32.
3756 (Arm_relocate_functions::thm_abs8): Correct range of
3757 overflow check.
3758 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3759 in assertions.
3760
90cff06f
DK
37612012-02-02 Doug Kwan <dougkwan@google.com>
3762
3763 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3764 position independent outputs, not just shared objects.
3765
63887f3d
L
37662012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3767
3768 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3769 * configure: Regenerated.
3770
bef2b434
ILT
37712012-01-27 Ian Lance Taylor <iant@google.com>
3772
3773 * reloc.h (Bits): New class with static functions, copied from
3774 namespace utils in arm.cc.
3775 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3776 instead.
3777
c335b55d
L
37782012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3779
3780 * incremental.cc (write_info_blocks): Correct relocation offset.
3781
41194d9f
L
37822012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3783
3784 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3785 (Relocate::tls_gd_to_le): Likewise.
3786
1bae613c
L
37872012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3788
3789 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3790
24482ca0
L
37912012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3792
3793 * configure.ac: Check if -mcmodel=medium works.
3794 * configure: Regenerated.
3795
c2c7840a
CC
37962012-01-24 Cary Coutant <ccoutant@google.com>
3797
3798 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3799 definition and ...
3800 (read_unsigned_LEB_128_x): ... this new function.
3801 (read_signed_LEB_128): Replaced with inline definition and ...
3802 (read_signed_LEB_128_x): ... this new function.
3803 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3804 (read_unsigned_LEB_128): Add inline definition.
3805 (read_signed_LEB_128_x): New function.
3806 (read_signed_LEB_128): Add inline definition.
3807 * testsuite/Makefile.am (leb128_unittest): New unit test.
3808 * testsuite/Makefile.in: Regenerate.
3809 * testsuite/leb128_unittest.cc: New unit test.
3810
833de760 38112012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3812
3813 PR gold/13617
3814 * i386.cc (Target_i386::do_code_fill): When using a jmp
3815 instruction, pad with nop instructions.
3816 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3817
618d6666
L
38182012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3819
3820 * x86_64.cc (gc_process_relocs): Add typename on types used in
3821 template.
3822 (scan_relocs): Likewise.
3823 (relocate_section): Likewise.
3824 (apply_relocation): Likewise.
3825
3660ff06
L
38262012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3827
3828 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3829 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3830 under x32.
3831
fc51264f
L
38322012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3833
3834 * x86_64.cc: Initial support for x32.
3835
dd74ae06
CC
38362012-01-03 Cary Coutant <ccoutant@google.com>
3837
3838 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3839 Use abstract base class for GOT.
3840 * gold/output.h (class Output_data_got_base): New abstract base class.
3841 (class Output_data_got): Derive from new base class, adjust ctors.
3842 (Output_data_got::reserve_slot): Make virtual; rename to
3843 do_reserve_slot; Adjust callers.
3844 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3845 pointer to abstract base class.
3846 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3847
83896202
ILT
38482011-12-18 Ian Lance Taylor <iant@google.com>
3849
3850 * object.h (Relobj::local_symbol_value): New function.
3851 (Relobj::local_plt_offset): New function.
3852 (Relobj::local_has_got_offset): New function.
3853 (Relobj::local_got_offset): New function.
3854 (Relobj::set_local_got_offset): New function.
3855 (Relobj::do_local_symbol_value): New pure virtual function.
3856 (Relobj::do_local_plt_offset): Likewise.
3857 (Relobj::do_local_has_got_offset): Likewise.
3858 (Relobj::do_local_got_offset): Likewise.
3859 (Relobj::do_set_local_got_offset): Likewise.
3860 (Sized_relobj::do_local_has_got_offset): Rename from
3861 local_has_got_offset.
3862 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3863 (Sized_relobj::do_set_local_got_offset): Rename from
3864 set_local_got_offset.
3865 (Sized_relobj_file::do_local_plt_offset): Rename from
3866 local_plt_offset.
3867 (Sized_relobj_file::do_local_symbol_value): New function.
3868 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3869 local_plt_offset.
3870 * output.cc (Output_data_got::Got_entry::write): Change object to
3871 Relobj. Use local_symbol_value.
3872 (Output_data_got::add_global_with_rel): Change rel_dyn to
3873 Output_data_reloc_generic*. Use add_global_generic.
3874 (Output_data_got::add_global_with_rela): Remove. Change all
3875 callers to use add_global_with_rel.
3876 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3877 Output_data_reloc_generic*. Use add_global_generic.
3878 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3879 callers to use add_global_pair_with_rel.
3880 (Output_data_got::add_local): Change object to Relobj*.
3881 (Output_data_got::add_local_plt): Likewise.
3882 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3883 change rel_dyn to Output_data_reloc_generic*. Use
3884 add_local_generic.
3885 (Output_data_got::add_local_with_rela): Remove. Change all
3886 callers to use all_local_with_rel.
3887 (Output_data_got::add_local_pair_with_rel): Change object to
3888 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3889 add_output_section_generic.
3890 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3891 callers to use add_local_pair_with_rel.
3892 (Output_data_got::reserve_local): Change object to Relobj*.
3893 * output.h: (class Output_data_reloc_generic): Add pure virtual
3894 declarations for add_global_generic, add_local_generic,
3895 add_output_section_generic.
3896 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3897 functions for Output_data_reloc_generic. Update declarations for
3898 changes listed in output.cc.
3899 (class Output_data_got): Change template parameter to got_size.
3900 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3901 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3902 function.
3903 (Sized_relobj_incr::do_local_plt_offset): New function.
3904 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3905 add_global_generic.
3906
76677ad0
CC
39072011-12-17 Cary Coutant <ccoutant@google.com>
3908
3909 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3910 * resolve.cc (Symbol_table::resolve): Likewise.
3911 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3912 arrays.
3913 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3914
8b8dd8d5
ILT
39152011-12-16 Ian Lance Taylor <iant@google.com>
3916
3917 * output.h (Output_data_reloc_generic::add): Only call
3918 add_dynamic_reloc if this is a dynamic reloc section.
3919
d55525b9
L
39202011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3921
3922 PR gold/13505
3923 * target-reloc.h (apply_relocation): Replace <64, false> with
3924 <size, big_endian>.
3925
ff81c7c1
NC
39262011-11-25 Nick Clifton <nickc@redhat.com>
3927
3928 * po/it.po: New Italian translation.
3929
628f39be
SA
39302011-11-17 Sterling Augustine <saugustine@google.com>
3931
3932 * script.cc (script_include_directive): Implement.
3933 (read_script_file): New local variables name and search_path. Update
3934 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3935 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3936 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3937
98ef3ea4
SA
39382011-11-11 Sterling Augustine <saugustine@google.com>
3939
3940 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3941 (file_or_sections_cmd): Likewise.
3942
f4a8b6d7
DK
39432011-11-11 Doug Kwan <dougkwan@google.com>
3944
3945 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3946 if --just-symbols is given.
3947
29ab395d
DK
39482011-11-10 Doug Kwan <dougkwan@google.com>
3949
3950 PR gold/13362
3951 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3952 when processing data relocs.
3953 * reloc.h (Relocate_functions::rel_unaligned): New method.
3954 (Relocate_functions::pcrel_unaligned): Ditto.
3955 (Relocate_functions::rel32_unaligned): Ditto.
3956 (Relocate_functions::pcrel32_unaligned): Ditto.
3957
2c339f71
DK
39582011-11-09 Doug Kwan <dougkwan@google.com>
3959
3960 PR gold/13362
3961 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3962 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3963 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3964 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3965 (Relocate_functions::rel_unaligned): New.
3966 (Relocate_functions::rel32_unaligned): New.
3967 * target-reloc.h (relocate_for_relocatable): Add code to handle
3968 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3969 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3970 arm_unaligned_reloc_r): New targets.
3971 * testsuite/Makefile.in: Regenerate.
3972 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3973 linking.
3974
3f3cddf1
ILT
39752011-11-02 Ian Lance Taylor <iant@google.com>
3976
3977 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3978 NATIVE_LINKER.
3979 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3980 * options.cc (General_options::finalize): Use library search path
3981 from configure script if specified. If not native and no sysroot,
3982 only search TOOLLIBDIR.
3983 * options.h (Search_directory::Search_directory): Change name to
3984 const std::string&.
3985 (General_options::add_to_library_path_with_sysroot): Change arg to
3986 const std::string&.
3987 * configure, Makefile.in, config.in: Rebuild.
3988
a8e2273b
ILT
39892011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3990
3991 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3992 we are working around the ARM1176 Erratum.
3993 * options.h (General_options::fix_arm1176): Add option.
3994 * testsuite/Makefile.am: Add testcases, and keep current ones
3995 working.
3996 * testsuite/Makefile.in: Regenerate.
3997 * testsuite/arm_fix_1176.s: New file.
3998 * testsuite/arm_fix_1176.sh: Likewise.
3999
cd6eab1c
ILT
40002011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4001
4002 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4003 may_use_blx_.
4004 (Target_arm::may_use_blx): Remove method.
4005 (Target_arm::set_may_use_blx): Likewise.
4006 (Target_arm::may_use_v4t_interworking): New method.
4007 (Target_arm::may_use_v5t_interworking): Likewise.
4008 (Target_arm::may_use_blx_): Remove member variable.
4009 (Arm_relocate_functions::arm_branch_common): Check for v5T
4010 interworking.
4011 (Arm_relocate_functions::thumb_branch_common): Likewise.
4012 (Reloc_stub::stub_type_for_reloc): Likewise.
4013 (Target_arm::do_finalize_sections): Correct interworking checks.
4014 * testsuite/Makefile.am: Add new tests.
4015 * testsuite/Makefile.in: Regenerate.
4016 * testsuite/arm_farcall_arm_arm.s: New test.
4017 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4018 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4019 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4020 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4021 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4022 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4023 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4024
286adcf4
CC
40252011-10-31 Cary Coutant <ccoutant@google.com>
4026
4027 PR gold/13023
4028 * expression.cc (Expression::eval_with_dot): Add
4029 is_section_dot_assignment parameter.
4030 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4031 absolute and assigning to dot within a section.
4032 * script-sections.cc
4033 (Output_section_element_assignment::set_section_addresses): Pass
4034 dot_section to set_if_absolute.
4035 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4036 as is_section_dot_assignment flag to eval_with_dot.
4037 (Output_section_element_dot_assignment::set_section_addresses):
4038 Likewise.
4039 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4040 parameter. Also set value if relative to dot_section; set the
4041 symbol's output_section.
4042 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4043 parameter. Adjust all callers.
4044 (Expression::eval_maybe_dot): Likewise.
4045 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4046 Adjust all callers.
4047 * testsuite/script_test_2.t: Test assignment of an absolute value
4048 to dot within an output section element.
4049
9634ed06
CC
40502011-10-31 Cary Coutant <ccoutant@google.com>
4051
4052 * options.h (class General_options): Add --[no-]gnu-unique options.
4053 * symtab.cc (Symbol_table::sized_write_globals): Convert
4054 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4055
de4101c7
CC
40562011-10-31 Cary Coutant <ccoutant@google.com>
4057
4058 PR gold/13359
4059 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4060 unnecessary assertion.
4061 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4062
7257cc92
ST
40632011-10-31 Sriraman Tallam <tmsriram@google.com>
4064
4065 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4066 gc_mark_symbol.
4067 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4068 gc_mark_symbol.
4069 Change to just keep the section associated with symbol.
4070 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4071 they are externally visible and --export-dynamic is turned on.
4072 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4073
bfc34b3f
ILT
40742011-10-19 Ian Lance Taylor <iant@google.com>
4075
4076 PR gold/13163
4077 * script-sections.cc
4078 (Output_section_element_dot_assignment::needs_output_section): New
4079 function.
4080
ea0d8c47
ILT
40812011-10-19 Ian Lance Taylor <iant@google.com>
4082
4083 PR gold/13204
4084 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4085 --section-start option was seen.
4086 * options.h (General_options::any_section_start): New function.
4087
abd242a9
DM
40882011-10-18 David S. Miller <davem@davemloft.net>
4089
4090 PR binutils/13301
4091 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4092 member to track relocation locations that have moved during TLS
4093 reloc optimizations.
4094 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4095 (Target_sparc::Relocate::relocate): Adjust view down by 4
4096 bytes if it matches reloc_adjust_addr_.
4097 (Target_sparc::Relocate::relocate_tls): Always move the
4098 __tls_get_addr call delay slot instruction forward 4 bytes when
4099 performing relaxation.
4100
bab9090f
CC
41012011-10-18 Cary Coutant <ccoutant@google.com>
4102
4103 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4104 (Output_file::map_no_anonymous): Check for non-zero
4105 return code from posix_fallocate.
4106
f7c5b166
CC
41072011-10-17 Cary Coutant <ccoutant@google.com>
4108
4109 PR gold/13245
4110 * plugin.cc (is_visible_from_outside): Check for symbols
4111 referenced from dynamic objects.
4112 * resolve.cc (Symbol_table::resolve): Don't count references
4113 from dynamic objects as references from real ELF files.
4114 * testsuite/plugin_test_2.sh: Adjust expected result.
4115
b490c0bb
CC
41162011-10-17 Cary Coutant <ccoutant@google.com>
4117
4118 * gold.cc: Include timer.h.
4119 (queue_middle_tasks): Stamp time.
4120 (queue_final_tasks): Likewise.
4121 * main.cc (main): Store timer in parameters. Print timers
4122 for each pass.
4123 * parameters.cc (Parameters::Parameters): Initialize timer_.
4124 (Parameters::set_timer): New function.
4125 (set_parameters_timer): New function.
4126 * parameters.h (Parameters::set_timer): New function.
4127 (Parameters::timer): New function.
4128 (Parameters::timer_): New data member.
4129 (set_parameters_timer): New function.
4130 * timer.cc (Timer::stamp): New function.
4131 (Timer::get_pass_time): New function.
4132 * timer.h (Timer::stamp): New function.
4133 (Timer::get_pass_time): New function.
4134 (Timer::pass_times_): New data member.
4135
f475cf7b
CC
41362011-10-17 Cary Coutant <ccoutant@google.com>
4137
4138 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4139 task for members of lib groups.
4140
cdd7e244
CC
41412011-10-17 Cary Coutant <ccoutant@google.com>
4142
4143 PR gold/13288
4f95c8b4 4144 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4145 (File_read::make_view): Move bounds check (replace with assert)...
4146 (File_read::find_or_make_view): ... to here.
4147
dfb45471
CC
41482011-10-12 Cary Coutant <ccoutant@google.com>
4149
4f95c8b4 4150 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4151 ::read returns less than requested size.
4152
53bbcc1b
CC
41532011-10-10 Cary Coutant <ccoutant@google.com>
4154
4f95c8b4 4155 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4156 Initialize defined_count_.
4157 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4158 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4159 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4160 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4161 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4162 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4163 member.
4164 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4165 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4166 Return zeroes instead of internal error.
4167
397b129b
CC
41682011-10-10 Cary Coutant <ccoutant@google.com>
4169
4170 PR gold/13249
4f95c8b4 4171 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4172 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4173 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4174 (Output_reloc::type_): Adjust size of bit field.
4175 (Output_reloc::use_plt_offset_): New bit field.
4176 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4177 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4178 flag. Adjust all callers.
4f95c8b4 4179 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4180 creating RELATIVE relocations.
4181
d5698657
NC
41822011-10-10 Nick Clifton <nickc@redhat.com>
4183
4184 * po/es.po: Updated Spanish translation.
4185 * po/fi.po: Updated Finnish translation.
4186
6a59a5c2
DN
41872011-10-03 Diego Novillo <dnovillo@google.com>
4188
4189 * options.cc (parse_uint): Fix dereference of RETVAL.
4190
f0558624
ST
41912011-09-29 Sriraman Tallam <tmsriram@google.com>
4192
4193 * layout.h (section_order_map_): New member.
4194 (get_section_order_map): New member function.
4195 * output.cc (Output_section::add_input_section): Check for patterns
4196 only when --section-ordering-file is specified.
4197 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4198 output_sections have been formed.
4199 * layout.cc (Layout_Layout): Initialize section_order_map_.
4200 * plugin.cc (update_section_order): Store order in order_map. Do not
4201 update the order.
4202 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4203 * testsuite/Makefile.in: Regenerate.
4204 * testsuite/plugin_section_order.c: New file.
4205 * testsuite/plugin_final_layout.cc: New file.
4206 * testsuite/plugin_final_layout.sh: New file.
4207
a7dac153
CC
42082011-09-29 Cary Coutant <ccoutant@google.com>
4209
4f95c8b4 4210 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4211 Check for NULL.
4f95c8b4 4212 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4213 symbols during incremental update.
4214 (Symbol_table::add_from_dynobj): Likewise.
4215
eebd87a5
ILT
42162011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4217 Ian Lance Taylor <iant@google.com>
4218
4219 * symtab.cc (Symbol_table::define_special_symbol): Always
4220 canonicalize version string.
4221
403a3331
CC
42222011-09-26 Cary Coutant <ccoutant@google.com>
4223
4f95c8b4
CC
4224 * gold.cc (queue_initial_tasks): Move option checks ...
4225 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4226 some options; make others fatal.
4227
235061c2
CC
42282011-09-26 Cary Coutant <ccoutant@google.com>
4229
4230 gcc PR lto/47247
4231 * plugin.cc (get_symbols_v2): New function.
4232 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4233 (is_referenced_from_outside): New function.
4234 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4235 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4236 (get_symbols): Pass version parameter.
4237 (get_symbols_v2): New function.
4238 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4239 parameter.
4240 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4241 (onload): Add LDPT_GET_SYMBOLS_V2.
4242 (all_symbols_read_hook): Use get_symbols_v2; check for
4243 LDPR_PREVAILING_DEF_IRONLY_EXP.
4244 * testsuite/plugin_test_3.sh: Update expected results.
4245
dc87f620
ILT
42462011-09-23 Simon Baldwin <simonb@google.com>
4247
4248 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4249 configuration options.
4250 * configure: Regenerate.
4251 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4252 * Makefile.in: Regenerate.
4253 * testsuite/Makefile.in: Regenerate.
4254
a8279f82
ST
42552011-09-19 Sriraman Tallam <tmsriram@google.com>
4256
4257 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4258
0c9350c8
CC
42592011-09-19 Cary Coutant <ccoutant@google.com>
4260
4261 * incremental.cc (can_incremental_update): Fix typo in comment.
4262 * incremental.h (can_incremental_update): Likewise.
4263
aa06ae28
CC
42642011-09-18 Cary Coutant <ccoutant@google.com>
4265
4266 * incremental.cc (can_incremental_update): New function.
4267 * incremental.h (can_incremental_update): New function.
4268 * layout.cc (Layout::init_fixed_output_section): Call it.
4269 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4270 * object.cc (Sized_relobj_file::do_layout): Call
4271 can_incremental_update.
4272
ebb300b2
CC
42732011-09-13 Cary Coutant <ccoutant@google.com>
4274
4275 * configure.ac: Check for glibc support for gnu_indirect_function
4276 support with static linking, setting automake conditional
4277 IFUNC_STATIC.
4278 * Makefile.in: Regenerate.
4279 * configure: Regenerate.
4280
4281 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4282 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4283 for IFUNC_STATIC.
4284 * testsuite/Makefile.in: Regenerate.
4285
1206d0d5
CC
42862011-09-13 Cary Coutant <ccoutant@google.com>
4287
4288 * incremental.cc (Sized_relobj_incr::do_layout): Call
4289 report_comdat_group for kept comdat sections.
4290 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4291 * testsuite/Makefile.in: Regenerate.
4292 * testsuite/incr_comdat_test_1.cc: New source file.
4293 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4294 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4295 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4296
40b29874
ILT
42972011-09-13 Ian Lance Taylor <iant@google.com>
4298
4299 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4300 variable external_symbols_offset.
4301
1b045aac
ILT
43022011-09-12 Ian Lance Taylor <iant@google.com>
4303
4304 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4305 triggered if object has no symbols.
4306
24c6c55a
DM
43072011-09-09 David S. Miller <davem@davemloft.net>
4308
4309 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4310 (Output_fill_debug_line::do_write): Likewise.
4311
66570254
CC
43122011-08-29 Cary Coutant <ccoutant@google.com>
4313
4314 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4315 casts to match formatting specs.
4316 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4317
8ea8cd50
CC
43182011-08-26 Cary Coutant <ccoutant@google.com>
4319
4320 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4321 remaining hole size when allocating.
4322 (Layout::make_output_section): Set fill methods for debug sections.
4323 * layout.h (Free_list::Free_list_node): Move from private to
4324 public.
4325 (Free_list::set_min_hole_size): New function.
4326 (Free_list::begin, Free_list::end): New functions.
4327 (Free_list::min_hole_): New data member.
4328 * output.cc: Include dwarf.h.
4329 (Output_fill_debug_info::do_minimum_hole_size): New function.
4330 (Output_fill_debug_info::do_write): New function.
4331 (Output_fill_debug_line::do_minimum_hole_size): New function.
4332 (Output_fill_debug_line::do_write): New function.
4333 (Output_section::Output_section): Initialize new data member.
4334 (Output_section::set_final_data_size): Ensure patch space is larger
4335 than minimum hole size.
4336 (Output_section::do_write): Fill holes in debug sections.
4337 * output.h (Output_fill): New class.
4338 (Output_fill_debug_info): New class.
4339 (Output_fill_debug_line): New class.
4340 (Output_section::set_free_space_fill): New function.
4341 (Output_section::free_space_fill_): New data member.
4342 * testsuite/Makefile.am (incremental_test_3): Add
4343 --incremental-patch option.
4344 (incremental_test_4): Likewise.
4345 (incremental_test_5): Likewise.
4346 (incremental_test_6): Likewise.
4347 (incremental_copy_test): Likewise.
4348 (incremental_common_test_1): Likewise.
4349 * testsuite/Makefile.in: Regenerate.
4350
7cf80422
NC
43512011-08-26 Nick Clifton <nickc@redhat.com>
4352
4353 * po/es.po: Updated Spanish translation.
4354
c3f7b0e5
CC
43552011-08-01 Cary Coutant <ccoutant@google.com>
4356
4357 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4358 * gold/testsuite/Makefile.in: Regenerate.
4359 * gold/testsuite/justsyms_exec.c: New source file.
4360 * gold/testsuite/justsyms_lib.c: New source file.
4361
9590bf25
CC
43622011-08-01 Cary Coutant <ccoutant@google.com>
4363
4364 * layout.cc (Layout::set_segment_offsets): Don't realign text
4365 segment if -Ttext was specified.
4366 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4367 file type.
4368 * object.h (Sized_relobj_file::e_type): New function.
4369 (Sized_relobj_file::e_type_): New data member.
4370 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4371 base address for ET_EXEC files.
4372 * target.cc (Target::do_make_elf_object_implementation): Allow
4373 ET_EXEC files with --just-symbols option.
4374
dcd8d12e
CC
43752011-07-28 Cary Coutant <ccoutant@google.com>
4376
4377 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4378 Add thread_number parameter.
4379 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4380 * workqueue-threads.cc
4381 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4382 current thread if its thread number is greater than desired thread
4383 count.
4384 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4385 Add thread_number parameter.
4386 (Workqueue::should_cancel_thread): Likewise.
4387 (Workqueue::find_runnable_or_wait): Pass thread_number to
4388 should_cancel_thread.
4389 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4390 parameter.
4391
804eb480
ST
43922011-07-22 Sriraman Tallam <tmsriram@google.com>
4393
4394 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4395 only after checking if it cannot be forced local.
4396 * symtab.h (is_externally_visible): Check if the symbol is not forced
4397 local.
4398
f1ddb600
ILT
43992011-07-15 Ian Lance Taylor <iant@google.com>
4400
4401 * options.h (class General_options): Add --print-output-format.
4402 Move -EL next to -EB, for better --help output.
4403 * target-select.cc: Include <cstdio>, "options.h", and
4404 "parameters.h".
4405 (Target_selector::do_target_bfd_name): New function.
4406 (print_output_format): New function.
4407 * target-select.h (class Target_selector): Update declarations.
4408 (Target_selector::target_bfd_name): New function.
4409 (print_output_format): Declare.
4410 * main.cc: Include "target-select.h".
4411 (main): Handle --print-output-format.
4412 * gold.cc: Include "target-select.h".
4413 (queue_initial_tasks): Handle --print-output-format when there are
4414 no input files.
4415 * parameters.cc (parameters_force_valid_target): Give a better
4416 error message if -EB/-EL does not match target.
4417 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4418 function.
4419
7d172687
ILT
44202011-07-15 Ian Lance Taylor <iant@google.com>
4421
4422 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4423 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4424 (Output_data_plt_i386::do_write): Write address of .dynamic
4425 section to first entry in .got.plt section.
4426 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4427 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4428 Initialize layout_.
4429 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4430 section to first entry in .got.plt section.
4431 * layout.h (Layout::dynamic_section): New function.
4432
e9552f7e
ST
44332011-07-13 Sriraman Tallam <tmsriram@google.com>
4434
4435 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4436 to claim_file call.
4437 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4438 input_section_position_, and input_section_glob_.
4439 (read_layout_from_file): Call function section_ordering_specified.
4440 * layout.h (is_section_ordering_specified): New function.
4441 (section_ordering_specified): New function.
4442 (section_ordering_specified_): New boolean member.
4443 * main.cc(main): Call load_plugins after layout object is defined.
4444 * output.cc (Output_section::add_input_section): Use
4445 function section_ordering_specified to check if section ordering is
4446 needed.
4447 * output.cc (Output_section::add_relaxed_input_section): Use
4448 function section_ordering_specified to check if section ordering is
4449 needed.
4450 (Output_section::update_section_layout): New function.
4451 (Output_section::sort_attached_input_sections): Check if input section
4452 must be reordered.
4453 * output.h (Output_section::update_section_layout): New function.
4454 * plugin.cc (get_section_count): New function.
4455 (get_section_type): New function.
4456 (get_section_name): New function.
4457 (get_section_contents): New function.
4458 (update_section_order): New function.
58797674 4459 (allow_section_ordering): New function.
e9552f7e
ST
4460 (Plugin::load): Add the new interfaces to the transfer vector.
4461 (Plugin_manager::load_plugins): New parameter.
4462 (Plugin_manager::all_symbols_read): New parameter.
4463 (Plugin_manager::claim_file): New parameter. Save the elf object for
4464 unclaimed objects.
4465 (Plugin_manager::get_elf_object): New function.
4466 (Plugin_manager::get_view): Change to directly use the bool to check
4467 if get_view is called from claim_file_hook.
4468 * plugin.h (input_objects): New function
4469 (Plugin__manager::load_plugins): New parameter.
4470 (Plugin_manager::claim_file): New parameter.
4471 (Plugin_manager::get_elf_object): New function.
4472 (Plugin_manager::in_claim_file_handler): New function.
4473 (Plugin_manager::in_claim_file_handler_): New member.
4474 (layout): New function.
4475 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4476 handler with an extra parameter. Make the elf object before calling
4477 claim_file handler.
4478 * testsuite/plugin_test.c (get_section_count): New function pointer.
4479 (get_section_type): New function pointer.
4480 (get_section_name): New function pointer.
4481 (get_section_contents): New function pointer.
4482 (update_section_order): New function pointer.
4483 (allow_section_ordering): New function pointer.
4484 (onload): Check if the new interfaces exist.
4485
9446efde
ILT
44862011-07-13 Ian Lance Taylor <iant@google.com>
4487
4488 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4489 relro section.
4490 * x86_64.cc (Target_x86_64::got_section): Likewise.
4491 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4492 (relro_now_test_SOURCES): New variable.
4493 (relro_now_test_DEPENDENCIES): New variable.
4494 (relro_now_test_LDFLAGS): New variable.
4495 (relro_now_test_LDADD): New variable.
4496 (relro_now_test.so): New target.
4497 * testsuite/Makefile.in: Rebuild.
4498
07aa62f2
ILT
44992011-07-12 Ian Lance Taylor <iant@google.com>
4500
4501 PR gold/12980
4502 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4503 GLOB_DAT relocation rather than a RELATIVE relocation for a
4504 protected symbol when creating a shared library.
4505 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4506 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4507 * testsuite/protected_main_1.cc (main): Test that protected
4508 function has same address.
4509
e2153196
ILT
45102011-07-11 Ian Lance Taylor <iant@google.com>
4511
4512 PR gold/12979
4513 * options.h (class General_options): Add -Bgroup.
4514 * options.cc (General_options::finalize): If -Bgroup is set,
4515 default to --unresolved-symbols=report-all.
4516 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4517 * target-reloc.h (issue_undefined_symbol_error): Handle
4518 --unresolved-symbols=report-all.
4519
6daf5215
ILT
45202011-07-08 Ian Lance Taylor <iant@google.com>
4521
4522 PR gold/11985
4523 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4524 if linker script discards key sections.
4525 (Layout::create_dynamic_symtab): Likewise.
4526 (Layout::assign_local_dynsym_offsets): Likewise.
4527 (Layout::sized_create_version_sections): Likewise.
4528 (Layout::create_interp): Likewise.
4529 (Layout::finish_dynamic_section): Likewise.
4530 (Layout::set_dynamic_symbol_size): Likewise.
4531
beabb2c6
ILT
45322011-07-08 Ian Lance Taylor <iant@google.com>
4533
4534 PR gold/12386
4535 * options.h (class General_options): Add --unresolved-symbols.
4536 * target-reloc.h (issue_undefined_symbol_error): Check
4537 --unresolved-symbols. Add comments.
4538
9c16daf1
ILT
45392011-07-08 Ian Lance Taylor <iant@google.com>
4540
4541 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4542 expression more complex.
4543
191f1a2d
ILT
45442011-07-08 Ian Lance Taylor <iant@google.com>
4545
4546 PR gold/11317
4547 * target-reloc.h (issue_undefined_symbol_error): New inline
4548 function, broken out of relocate_section.
4549 (relocate_section): Call issue_undefined_symbol_error.
4550 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4551 there is no TLS segment if we are about to issue an undefined
4552 symbol error.
4553 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4554
62855347
ILT
45552011-07-08 Ian Lance Taylor <iant@google.com>
4556
4557 PR gold/12279
4558 * resolve.cc (Symbol_table::should_override): Add fromtype
4559 parameter. Change all callers. Give error when linking together
4560 TLS and non-TLS symbol.
4561 (Symbol_table::should_override_with_special): Add fromtype
4562 parameter. Change all callers.
4563 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4564 there is no TLS segment if we have reported some errors.
4565 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4566
67181c72
ILT
45672011-07-08 Ian Lance Taylor <iant@google.com>
4568
4569 PR gold/12372
4570 * target.h (Target::plt_address_for_global): New function.
4571 (Target::plt_address_for_local): New function.
4572 (Target::plt_section_for_global): Remove.
4573 (Target::plt_section_for_local): Remove.
4574 (Target::do_plt_address_for_global): New virtual function.
4575 (Target::do_plt_address_for_local): New virtual function.
4576 (Target::do_plt_section_for_global): Remove.
4577 (Target::do_plt_section_for_local): Remove.
4578 (Target::register_global_plt_entry): Add Symbol_table and Layout
4579 parameters.
4580 * output.cc (Output_data_got::Got_entry::write): Use
4581 plt_address_for_global and plt_address_for_local.
4582 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4583 address of output section.
4584 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4585 got_irelative_, and irelative_count_ fields. Update
4586 declarations.
4587 (Output_data_plt_i386::has_irelative_section): New function.
4588 (Output_data_plt_i386::entry_count): Add irelative_count_.
4589 (Output_data_plt_i386::set_final_data_size): Likewise.
4590 (class Target_i386): Add got_irelative_ and rel_irelative_
4591 fields. Update declarations.
4592 (Target_i386::Target_i386): Initialize new fields.
4593 (Target_i386::do_plt_address_for_global): New function replacing
4594 do_plt_section_for_global.
4595 (Target_i386::do_plt_address_for_local): New function replacing
4596 do_plt_section_for_local.
4597 (Target_i386::got_section): Create got_irelative_.
4598 (Target_i386::rel_irelative_section): New function.
4599 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4600 fields. Don't define __rel_iplt_{start,end}.
4601 (Output_data_plt_i386::add_entry): Add symtab and layout
4602 parameters. Change all callers. Use different PLT and GOT for
4603 IFUNC symbols.
4604 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4605 layout parameters. Change all callers. Use different PLT and
4606 GOT.
4607 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4608 (Output_data_plt_i386::rel_irelative): New function.
4609 (Output_data_plt_i386::address_for_global): New function.
4610 (Output_data_plt_i386::address_for_local): New function.
4611 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4612 IRELATIVE GOT when changing IFUNC GOT entries.
4613 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4614 reloc.
4615 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4616 if we didn't create an IRELATIVE GOT.
4617 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4618 plt_address_for_local.
4619 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4620 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4621 got_irelative_, and irelative_count_ fields. Update
4622 declarations.
4623 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4624 Initialize new fields. Remove symtab parameter. Change all
4625 callers.
4626 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4627 irelative_count_.
4628 (Output_data_plt_x86_64::has_irelative_section): New function.
4629 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4630 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4631 fields. Update declarations.
4632 (Target_x86_64::Target_x86_64): Initialize new fields.
4633 (Target_x86_64::do_plt_address_for_global): New function replacing
4634 do_plt_section_for_global.
4635 (Target_x86_64::do_plt_address_for_local): New function replacing
4636 do_plt_section_for_local.
4637 (Target_x86_64::got_section): Create got_irelative_.
4638 (Target_x86_64::rela_irelative_section): New function.
4639 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4640 all callers. Don't create __rel_iplt_{start,end}.
4641 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4642 parameters. Change all callers. Use different PLT and GOT for
4643 IFUNC symbols.
4644 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4645 layout parameters. Change all callers. Use different PLT and
4646 GOT.
4647 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4648 parameters. Change all callers. Use different PLT and GOT for
4649 IFUNC symbols.
4650 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4651 (Output_data_plt_x86_64::rela_irelative): New function.
4652 (Output_data_plt_x86_64::address_for_global): New function.
4653 (Output_data_plt_x86_64::address_for_local): New function.
4654 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4655 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4656 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4657 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4658 parameters.
4659 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4660 reloc.
4661 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4662 symbols if we didn't create an IRELATIVE GOT.
4663 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4664 plt_address_for_local.
4665 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4666 * testsuite/ifuncvar1.c: New test file.
4667 * testsuite/ifuncvar2.c: New test file.
4668 * testsuite/ifuncvar3.c: New test file.
4669 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4670 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4671 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4672 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4673 * testsuite/Makefile.in: Rebuild.
4674
33c15b45
CC
46752011-07-07 Cary Coutant <ccoutant@google.com>
4676
4677 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4678 (two_file_test_1_ndebug.o): Likewise.
4679 (two_file_test_1b_ndebug.o): Likewise.
4680 (two_file_test_2_ndebug.o): Likewise.
4681 (two_file_test_main_ndebug.o): Likewise.
4682 (incremental_test_2): Link with no-debug versions.
4683
f48b5fb7
CC
46842011-07-06 Cary Coutant <ccoutant@google.com>
4685
4686 * gold/incremental.cc
4687 (Output_section_incremental_inputs::write_info_blocks): Check for
4688 hidden and internal symbols.
4689
221597a5
CC
46902011-07-06 Cary Coutant <ccoutant@google.com>
4691
4692 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4693 Check disposition for startup file.
4694 (Incremental_inputs::report_command_line): Ignore
4695 --incremental-startup-unchanged option.
4696 * options.cc (General_options::parse_incremental_startup_unchanged):
4697 New function.
4698 (General_options::General_options): Initialize new data member.
4699 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4700 (General_options): Add --incremental-startup-unchanged option.
4701 (General_options::incremental_startup_disposition): New function.
4702 (General_options::incremental_startup_disposition_): New data member.
4703
e24719f6
CC
47042011-07-06 Cary Coutant <ccoutant@google.com>
4705
4706 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4707 input file index to Script_info ctor.
4708 (Sized_incremental_binary::do_file_has_changed): Find the
4709 command-line argument for files named in scripts.
4710 * incremental.h (Script_info::Script_info): New ctor
4711 with input file index.
4712 (Script_info::input_file_index): New function.
4713 (Script_info::input_file_index_): New data member.
4714 (Incremental_binary::get_library): Add const.
4715 (Incremental_binary::get_script_info): Add const.
4716 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4717 * testsuite/Makefile.am (incremental_test_5): New test case.
4718 (incremental_test_6): New test case.
4719 * testsuite/Makefile.in: Regenerate.
4720
8f7c81e8
CC
47212011-07-06 Cary Coutant <ccoutant@google.com>
4722
4723 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4724 debug output when command lines differ.
4725
9fbd3822
CC
47262011-07-06 Cary Coutant <ccoutant@google.com>
4727
4728 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4729 --incremental-patch option.
4730 * layout.cc (Free_list::allocate): Extend allocation beyond original
4731 end if enabled.
4732 (Layout::make_output_section): Mark sections that should get
4733 patch space.
4734 * options.cc (parse_percent): New function.
4735 * options.h (parse_percent): New function.
4736 (DEFINE_percent): New macro.
4737 (General_options): Add --incremental-patch option.
4738 * output.cc (Output_section::Output_section): Initialize new data
4739 members.
4740 (Output_section::add_input_section): Print section name when out
4741 of patch space.
4742 (Output_section::add_output_section_data): Likewise.
4743 (Output_section::set_final_data_size): Add patch space when
4744 doing --incremental-full.
4745 (Output_section::do_reset_address_and_file_offset): Remove patch
4746 space.
4747 (Output_segment::set_section_list_addresses): Print debug output
4748 only if --incremental-update.
4749 * output.h (Output_section::set_is_patch_space_allowed): New function.
4750 (Output_section::is_patch_space_allowed_): New data member.
4751 (Output_section::patch_space_): New data member.
4752 * parameters.cc (Parameters::incremental_full): New function.
4753 * parameters.h (Parameters::incremental_full): New function
4754 * testsuite/Makefile.am (incremental_test_2): Add test for
4755 --incremental-patch option.
4756 * testsuite/Makefile.in: Regenerate.
4757 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4758 (t18): Remove function body.
4759
f6cccc2c
DK
47602011-07-05 Doug Kwan <dougkwan@google.com>
4761
4762 PR gold/12771
4763 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4764 Arm_Address type for relocation result.
4765 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4766 overflow check.
4767 (Arm_relocate_functions::abs32): Use unaligned access.
4768 (Arm_relocate_functions::rel32): Ditto.
4769 (Arm_relocate_functions::prel31): Ditto.
4770 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4771 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4772 static data relocations.
4773 * testsuite/Makefile.in: Regnerate.
4774 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4775
28a13fec
ILT
47762011-07-05 Ian Lance Taylor <iant@google.com>
4777
4778 PR gold/12392
4779 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4780 symbols if necessary.
4781 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4782
24d47b34
ILT
47832011-07-05 Ian Lance Taylor <iant@google.com>
4784
4785 PR gold/12952
4786 * resolve.cc (Symbol::override_base_with_special): Simply override
4787 version with special symbol version, ignoring previous version.
4788
41f9cbbe
ILT
47892011-07-05 Ian Lance Taylor <iant@google.com>
4790
4791 * object.cc (Sized_relobj_file::include_section_group): Add
4792 information to comment about signature location.
4793
886288f1
ILT
47942011-07-02 Ian Lance Taylor <iant@google.com>
4795
4796 PR gold/12957
4797 * options.h (class General_options): Add -f and -F.
4798 * options.cc (General_options::finalize): Fatal error if -f/-F
4799 are used without -shared.
4800 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4801
ae3a6d4f
ILT
48022011-07-02 Ian Lance Taylor <iant@google.com>
4803
4804 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4805
21131061
ILT
48062011-07-01 Ian Lance Taylor <iant@google.com>
4807
4808 PR gold/12525
4809 PR gold/12952
4810 * resolve.cc (Symbol::override_base_with_special): Don't override
4811 the version if the overriding symbol has a different name.
4812 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4813 all callers. If we give an error about an undefined version,
4814 define the base version if necessary.
4815 * dynobj.h (class Versions): Update declaration.
4816 * testsuite/weak_alias_test_5.cc: New file.
4817 * testsuite/weak_alias_test.script: New file.
4818 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4819 and versioned_alias have the right value, and call t2.
4820 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4821 weak_alias_test_5.so.
4822 (weak_alias_test_LDADD): Likewise.
4823 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4824 * testsuite/Makefile.in: Rebuild.
4825
611062c0
ILT
48262011-07-01 Ian Lance Taylor <iant@google.com>
4827
4828 PR gold/12525
4829 * options.h (class General_options): Support -z notext.
4830 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4831 -Wl,-z,notext.
4832 (two_file_shared_nonpic.so): Likewise.
4833 (two_file_shared_mixed.so): Likewise.
4834 (two_file_shared_mixed_1.so): Likewise.
4835 (weak_undef_lib_nonpic.so): Likewise.
4836 (alt/weak_undef_lib_nonpic.so): Likewise.
4837 (tls_test_shared_nonpic.so): Likewise.
4838 * testsuite/Makefile.in: Rebuild.
4839
328c7c2f
ILT
48402011-07-01 Ian Lance Taylor <iant@google.com>
4841
4842 PR gold/12525
4843 * configure.ac: Test whether static linking works, setting
4844 the automake conditional HAVE_STATIC.
4845 * testsuite/Makefile.am: Disable tests using -static if
4846 HAVE_STATIC is not true.
4847 * configure, testsuite/Makefile.in: Rebuild.
4848
02d7cd44
ILT
48492011-07-01 Ian Lance Taylor <iant@google.com>
4850
4851 PR gold/12525
4852 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4853 Assert if we see DW_EH_PE_indirect.
4854 * target.h (Target::ehframe_datarel_base): New function.
4855 (Target::do_ehframe_datarel_base): New target function.
4856 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4857 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4858 function.
4859
07a60597
ILT
48602011-07-01 Ian Lance Taylor <iant@google.com>
4861
4862 PR gold/12571
4863 * options.h (class General_options): Add
4864 --ld-generated-unwind-info.
4865 * ehframe.cc (Fde::write): Add address parameter. Change all
4866 callers. If associated with PLT, fill in address and size.
4867 (Cie::set_output_offset): Only add merge mapping if there is an
4868 object.
4869 (Cie::write): Add address parameter. Change all callers.
4870 (Eh_frame::add_ehframe_for_plt): New function.
4871 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4872 input_offset_ fields into union u_, with new plt field.
4873 (Fde::Fde): Adjust for new union field.
4874 (Fde::Fde) [Output_data version]: New constructor.
4875 (Fde::add_mapping): Only add merge mapping if there is an object.
4876 (class Cie): Update declarations.
4877 (class Eh_frame): Declare add_ehframe_for_plt.
4878 * layout.cc (Layout::layout_eh_frame): Break out code into
4879 make_eh_frame_section, and call it.
4880 (Layout::make_eh_frame_section): New function.
4881 (Layout::add_eh_frame_for_plt): New function.
4882 * layout.h (class Layout): Update declarations.
4883 * merge.cc (Merge_map::add_mapping): Add assertion.
4884 * i386.cc: Include "dwarf.h".
4885 (class Output_data_plt_i386): Make first_plt_entry,
4886 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4887 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4888 and plt_eh_frame_fde.
4889 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4890 boundary. Call add_eh_frame_for_plt if appropriate.
4891 * x86_64.cc: Include "dwarf.h".
4892 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4893 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4894 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4895 and plt_eh_frame_fde.
4896 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4897 appropriate.
4898
14788a3f
ILT
48992011-06-29 Ian Lance Taylor <iant@google.com>
4900
4901 PR gold/12629
4902 * object.cc (Sized_relobj_file::layout_section): Change shdr
4903 parameter to be const.
4904 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4905 out of do_layout.
4906 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4907 appropriate. Call layout_eh_frame_section.
4908 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4909 sections.
4910 * object.h (class Sized_relobj_file): Update declarations.
4911
6c21fce1
ILT
49122011-06-29 Ian Lance Taylor <iant@google.com>
4913
37e41b03 4914 PR gold/12652
6c21fce1
ILT
4915 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4916 modifier.
4917 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4918
4d5e4e62
ILT
49192011-06-29 Ian Lance Taylor <iant@google.com>
4920
4921 PR gold/12675
4922 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4923 SHT_X86_64_UNWIND.
4924 * layout.cc (Layout::layout_eh_frame): Likewise.
4925
886f533a
ILT
49262011-06-29 Ian Lance Taylor <iant@google.com>
4927
4928 PR gold/12695
4929 * layout.cc (Layout::symtab_section_shndx): New function.
4930 * layout.h (class Layout): Declare symtab_section_shndx.
4931 * output.cc (Output_section::write_header): Call it.
4932
f3ae1b28
ILT
49332011-06-29 Ian Lance Taylor <iant@google.com>
4934
4935 PR gold/12818
4936 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4937 symbols which are not used in a relocation.
4938
aecf301f
ILT
49392011-06-28 Ian Lance Taylor <iant@google.com>
4940
4941 PR gold/12898
4942 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4943 script create indistinguishable segments.
4944 (Layout::set_segment_offsets): Use stable_sort when sorting
4945 segments. Pass this to Compare_segments constructor.
4946 * layout.h (class Layout): Make segment_precedes non-static.
4947 (class Compare_segments): Change from struct to class. Add
4948 layout_ field. Add constructor.
4949 * script-sections.cc
4950 (Script_sections::attach_sections_using_phdrs_clause): Rename
4951 local orphan to is_orphan. Don't report failure to put empty
4952 section in segment. On attachment failure, report name of
4953 section, and attach to first PT_LOAD segment.
4954
03ef7571
ILT
49552011-06-28 Ian Lance Taylor <iant@google.com>
4956
4957 PR gold/12934
4958 * target-select.cc (Target_selector::Target_selector): Add
4959 emulation parameter. Change all callers.
4960 (select_target_by_bfd_name): Rename from select_target_by_name.
4961 Change all callers.
4962 (select_target_by_emulation): New function.
4963 (supported_emulation_names): New function.
4964 * target-select.h (class Target_selector): Add emulation_ field.
4965 Update declarations.
4966 (Target_selector::recognize_by_bfd_name): Rename from
4967 recognize_by_name. Change all callers.
4968 (Target_selector::supported_bfd_names): Rename from
4969 supported_names. Change all callers.
4970 (Target_selector::recognize_by_emulation): New function.
4971 (Target_selector::supported_emulations): New function.
4972 (Target_selector::emulation): New function.
4973 (Target_selector::do_recognize_by_bfd_name): Rename from
4974 do_recognize_by_name. Change all callers.
4975 (Target_selector::do_supported_bfd_names): Rename from
4976 do_supported_names. Change all callers.
4977 (Target_selector::do_recognize_by_emulation): New function.
4978 (Target_selector::do_supported_emulations): New function.
4979 (select_target_by_bfd_name): Change name in declaration.
4980 (select_target_by_emulation): Declare.
4981 (supported_emulation_names): Declare.
4982 * parameters.cc (parameters_force_valid_target): Try to find
4983 target based on emulation from -m option.
4984 * options.h (class General_options): Change doc string for -m.
4985 * options.cc (help): Print emulations.
4986 (General_options::parse_V): Likewise.
4987 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4988 Add emulation parameter. Change all callers.
4989
200b2bb9
ILT
49902011-06-28 Ian Lance Taylor <iant@google.com>
4991
4992 * target.h (class Target): Add osabi_ field.
4993 (Target::osabi): New function.
4994 (Target::set_osabi): New function.
4995 (Target::Target): Initialize osabi_.
4996 (Target::do_adjust_elf_header): Make pure virtual.
4997 (Sized_target::do_adjust_elf_header): Declare.
4998 * target.cc (Sized_target::do_adjust_elf_header): New function.
4999 (class Sized_target): Instantiate all versions.
5000 * freebsd.h (class Target_freebsd): Remove.
5001 (Target_selector_freebsd::do_recognize): Call set_osabi on
5002 Target.
5003 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5004 (Target_selector_freebsd::set_osabi): Remove.
5005 * i386.cc (class Target_i386): Inherit from Sized_target rather
5006 than Target_freebsd.
5007 * x86_64.cc (class Target_x86_64): Likewise.
5008
b3ce541e
ILT
50092011-06-28 Ian Lance Taylor <iant@google.com>
5010
5011 * target.h (Target::can_check_for_function_pointers): Rewrite.
5012 Make non-virtual.
5013 (Target::can_icf_inline_merge_sections): Likewise.
5014 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5015 (Target::Target_info): Add can_icf_inline_merge_sections field.
5016 (Target::do_can_check_for_function_pointers): New virtual
5017 function.
5018 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5019 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5020 from can_check_for_function_pointers, move in file.
5021 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5022 section_may_have_icf_unsafe_poineters, move in file.
5023 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5024 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5025 Rename from can_check_for_function_pointers, move in file.
5026 (Target_i386::can_icf_inline_merge_sections): Remove.
5027 (Target_i386::i386_info): Initialize
5028 can_icf_inline_merge_sections.
5029 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5030 Initialize can_icf_inline_merge_sections.
5031 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5032 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5033 Rename from can_check_for_function_pointers, move in file.
5034 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5035 (Target_x86_64::x86_64_info): Initialize
5036 can_icf_inline_merge_sections.
5037 * testsuite/testfile.cc (Target_test::test_target_info):
5038 Likewise.
5039 * icf.cc (get_section_contents): Correct formatting.
5040
6d1c4efb
ILT
50412011-06-27 Ian Lance Taylor <iant@google.com>
5042
5043 * symtab.cc (Symbol::versioned_name): New function.
5044 (Symbol_table::add_to_final_symtab): Use versioned_name when
5045 appropriate.
5046 (Symbol_table::sized_write_symbol): Likewise.
5047 * symtab.h (class Symbol): Declare versioned_name.
5048 * stringpool.h (class Stringpool_template): Add variant of add
5049 which takes a std::basic_string.
5050 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5051 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5052 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5053 (ver_test_12.o): New target.
5054 * testsuite/Makefile.in: Rebuild.
5055
57eb9b50
DK
50562011-06-27 Doug Kwan <dougkwan@google.com>
5057
5058 * arm.cc (Arm_relocate_functions::thm_jump8,
5059 Arm_relocate_functions::thm_jump11): Use a wider signed
5060 type to compute offset.
5061 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5062 arm_thm_jump8.
5063 * testsuite/Makefile.in: Regenerate.
5064 * testsuite/arm_branch_in_range.sh: Check test results of
5065 arm_thm_jump11 and arm_thm_jump8.
5066 * testsuite/arm_thm_jump11.s: New test source file.
5067 * testsuite/arm_thm_jump11.t: New linker script.
5068 * testsuite/arm_thm_jump8.s: New test source file.
5069 * testsuite/arm_thm_jump8.t: New linker script.
5070
487b39df
ILT
50712011-06-24 Ian Lance Taylor <iant@google.com>
5072
5073 * layout.cc: Include "object.h".
5074 (ctors_sections_in_init_array): New static variable.
5075 (Layout::is_ctors_in_init_array): New function.
5076 (Layout::layout): Add entry to ctors_sections_in_init_array if
5077 appropriate.
5078 * layout.h (class Layout): Declare is_ctors_in_init_array.
5079 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5080 is_ctors_reverse_view is set.
5081 (Sized_relobj_file::write_sections): Add layout parameter. Change
5082 all callers. Set is_ctors_reverse_view field of View_size.
5083 (Sized_relobj_file::reverse_words): New function.
5084 * object.h (Sized_relobj_file::View_size): Add
5085 is_ctors_reverse_view field.
5086 (class Sized_relobj_file): Update declarations.
5087 * testsuite/initpri3.c: New test.
5088 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5089 initpri3b.
5090 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5091 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5092 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5093 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5094 * testsuite/Makefile.in: Rebuild.
5095
472076e4
CC
50962011-06-24 Cary Coutant <ccoutant@google.com>
5097
5098 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5099 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5100 (debug_msg_cdebug.err): New targets.
5101 * testsuite/Makefile.in: Regenerate.
5102 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5103 Fix checks for link with shared library.
5104
a60af0db
DK
51052011-06-24 Doug Kwan <dougkwan@google.com>
5106
5107 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5108 skip empty text sections.
5109 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5110
5393d741
ILT
51112011-06-22 Ian Lance Taylor <iant@google.com>
5112
5113 PR gold/12910
5114 * options.h (class General_options): Add --ctors-in-init-array.
5115 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5116 friends as SHT_PROGBITS for merging sections.
5117 (Layout::layout): Remove special handling of .init_array and
5118 friends. Don't sort if doing relocatable link. Sort for .ctors
5119 and .dtors if ctors_in_init_array.
5120 (Layout::make_output_section): Force correct section types for
5121 .init_array and friends. Don't sort if doing relocatable link,
5122 Don't sort .ctors and .dtors if ctors_in_init_array.
5123 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5124 (Layout::output_section_name): Add relobj parameter. Change all
5125 callers. Handle .ctors. and .dtors. in code rather than table.
5126 Handle .ctors and .dtors if ctors_in_init_array.
5127 (Layout::match_file_name): New function, moved from output.cc.
5128 * layout.h (class Layout): Update declarations.
5129 * output.cc: Include "layout.h".
5130 (Input_section_sort_entry::get_priority): New function.
5131 (Input_section_sort_entry::match_file_name): Just call
5132 Layout::match_file_name.
5133 (Output_section::Input_section_sort_init_fini_compare::operator()):
5134 Handle .ctors and .dtors. Sort by explicit priority rather than
5135 by name.
5136 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5137 * testsuite/initpri2.c: New test.
5138 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5139 (check_PROGRAMS): Add initpri2.
5140 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5141 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5142 * configure, testsuite/Makefile.in: Rebuild.
5143
e1f74f98
ILT
51442011-06-19 Ian Lance Taylor <iant@google.com>
5145
5146 PR gold/12880
5147 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5148 .interp section to a PT_INTERP segment even if we have seen a
5149 --dynamic-linker option. Don't do it if we have seen a PHDRS
5150 clause in a linker script.
5151 (Layout::finalize): Don't create a .interp section if we've
5152 already create a PT_INTERP segment.
5153 (Layout::create_interp): Always call choose_output_section (revert
5154 patch of 2011-06-17). Don't create PT_INTERP segment.
5155 * script-sections.cc
5156 (Script_sections::create_note_and_tls_segments): Add a .interp
5157 section to a PT_INTERP segment even if we have seen a
5158 --dynamic-linker option.
5159
766f91bb
ILT
51602011-06-18 Ian Lance Taylor <iant@google.com>
5161
5162 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5163 merely because a non-PT_LOAD segment has a dynamic reloc.
5164
0d212c3a
ILT
51652011-06-18 Ian Lance Taylor <iant@google.com>
5166
5167 * layout.cc (Layout::finish_dynamic_section): Don't create
5168 DT_FLAGS entry if not needed.
5169
911a5072
ILT
51702011-06-18 Ian Lance Taylor <iant@google.com>
5171
5172 PR gold/12745
5173 * layout.cc (Layout::layout_eh_frame): Correct handling of
5174 writable .eh_frame section.
5175
534b4e5f
ILT
51762011-06-17 Ian Lance Taylor <iant@google.com>
5177
5178 PR gold/12893
5179 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5180 symbol is redefined with the exact same object and value.
5181
10b4f102
ILT
51822011-06-17 Ian Lance Taylor <iant@google.com>
5183
5184 PR gold/12880
5185 * layout.h (class Layout): Add interp_segment_ field.
5186 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5187 (Layout::attach_allocated_section_to_segment): If making shared
5188 library, put .interp section in PT_INTERP segment.
5189 (Layout::finalize): Also call create_interp if -dynamic-linker
5190 option was used.
5191 (Layout::create_interp): Assert that there is no PT_INTERP
5192 segment. If not using a SECTIONS clause, use make_output_section.
5193 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5194 * script-sections.cc
5195 (Script_sections::create_note_and_tls_segments): If making shared
5196 library, put .interp section in PT_INTERP segment.
5197
a29b0dad
ILT
51982011-06-17 Ian Lance Taylor <iant@google.com>
5199
e588ea8d
ILT
5200 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5201 when making a shared library.
5202
52032011-06-17 Ian Lance Taylor <iant@google.com>
5204
5205 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5206 parameter. Change all callers. Don't issue warning about PC32
5207 against locally defined symbol.
a29b0dad 5208
9d3b0698
ILT
52092011-06-16 Ian Lance Taylor <iant@google.com>
5210
5211 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5212 occurs in same object.
5213
85b0f90c
AM
52142011-06-14 Alan Modra <amodra@gmail.com>
5215
5216 * po/POTFILES.in: Regenerate.
5217
a94907d9
ILT
52182011-06-09 Ian Lance Taylor <iant@google.com>
5219
5220 * script-sections.cc
5221 (Orphan_output_section::set_section_addresses): For a relocatable
5222 link set address to 0.
5223
4fb3a1c3
CC
52242011-06-09 Cary Coutant <ccoutant@google.com>
5225
5226 PR gold/12804
5227 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5228 used with --compress-debug-sections.
5229 * gold/object.cc (Sized_relobj_file::do_layout): Report
5230 uncompressed size of compressed input sections.
5231
61220854
CC
52322011-06-08 Cary Coutant <ccoutant@google.com>
5233
5234 PR gold/12804
5235 * testsuite/two_file_test_2_v1.cc: Change initialization of
5236 v2 to keep it in .data.
5237
e6455dfb
CC
52382011-06-07 Cary Coutant <ccoutant@google.com>
5239
5240 * common.cc (Symbol_table::do_allocate_commons_list): Call
5241 gold_fallback.
5242 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5243 (Errors::fallback): New function.
5244 (gold_fallback): New function.
5245 * errors.h (Errors::fallback): New function.
5246 * gold.cc (gold_exit): Change status parameter to enum; adjust
5247 all callers.
5248 (queue_initial_tasks): Call gold_fallback.
5249 * gold.h: Include cstdlib.
5250 (Exit_status): New enum type.
5251 (gold_exit): Change status parameter to enum.
5252 (gold_fallback): New function.
5253 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5254 (Layout::create_symtab_sections): Likewise.
5255 (Layout::create_shdrs): Likewise.
5256 * main.cc (main): Adjust call to gold_exit.
5257 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5258 (Output_data_got::add_got_entry_pair): Likewise.
5259 (Output_section::add_input_section): Likewise.
5260 (Output_section::add_output_section_data): Likewise.
5261 (Output_segment::set_section_list_addresses): Likewise.
5262 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5263
fb0e076f
CC
52642011-06-07 Cary Coutant <ccoutant@google.com>
5265
5266 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5267 for incremental links.
5268 * output.cc (Output_segment::set_section_list_addresses): Remove
5269 FIXME and test for TLS or BSS.
5270
a5ee4d5d
CC
52712011-06-07 Cary Coutant <ccoutant@google.com>
5272
5273 * testsuite/Makefile.am: Add incremental_copy_test,
5274 incremental_common_test_1.
5275 * testsuite/Makefile.in: Regenerate.
5276 * testsuite/common_test_1_v1.c: New source file.
5277 * testsuite/common_test_1_v2.c: New source file.
5278 * testsuite/copy_test_v1.cc: New source file.
5279
5146f448
CC
52802011-06-07 Cary Coutant <ccoutant@google.com>
5281
5282 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5283 update, allocate common from bss section's free list.
5284 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5285 linker-defined symbols.
5286 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5287 Skip GOT and PLT entries that are no longer referenced.
5288 (Output_section_incremental_inputs::write_info_blocks): Mark
5289 linker-defined symbols.
5290 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5291 * output.cc (Output_section::allocate): New function.
5292 * output.h (Output_section::allocate): New function.
5293 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5294 linker-defined symbols.
5295 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5296 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5297 (Symbol::init_base_output_data): Likewise.
5298 (Symbol::init_base_output_segment): Likewise.
5299 (Symbol::init_base_constant): Likewise.
5300 (Sized_symbol::init_output_data): Likewise.
5301 (Sized_symbol::init_output_segment): Likewise.
5302 (Sized_symbol::init_constant): Likewise.
5303 (Symbol_table::do_define_in_output_data): Likewise.
5304 (Symbol_table::do_define_in_output_segment): Likewise.
5305 (Symbol_table::do_define_as_constant): Likewise.
5306 * symtab.h (Symbol::is_predefined): New function.
5307 (Symbol::init_base_output_data): Add is_predefined parameter.
5308 (Symbol::init_base_output_segment): Likewise.
5309 (Symbol::init_base_constant): Likewise.
5310 (Symbol::is_predefined_): New data member.
5311 (Sized_symbol::init_output_data): Add is_predefined parameter.
5312 (Sized_symbol::init_output_segment): Likewise.
5313 (Sized_symbol::init_constant): Likewise.
5314 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5315
26d3c67d
CC
53162011-06-07 Cary Coutant <ccoutant@google.com>
5317
5318 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5319 instead of emit_copy_reloc.
5320 (Copy_relocs::emit_copy_reloc): Refactor.
5321 (Copy_relocs::make_copy_reloc): New function.
5322 (Copy_relocs::add_copy_reloc): Remove.
5323 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5324 section.
5325 (Copy_relocs::make_copy_reloc): New function.
5326 (Copy_relocs::add_copy_reloc): Remove.
5327 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5328 unchanged input files.
5329 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5330 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5331 Reserve BSS space for COPY relocations.
5332 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5333 (Output_section_incremental_inputs::write_info_blocks): Record
5334 whether a symbol is copied from a shared object.
5335 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5336 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5337 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5338 (Incremental_input_entry_reader::get_output_symbol_index): Add
5339 is_copy parameter.
5340 (Incremental_binary::emit_copy_relocs): New function.
5341 (Incremental_binary::do_emit_copy_relocs): New function.
5342 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5343 new data member.
5344 (Sized_incremental_binary::add_copy_reloc): New function.
5345 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5346 (Sized_incremental_binary::Copy_reloc): New struct.
5347 (Sized_incremental_binary::Copy_relocs): New typedef.
5348 (Sized_incremental_binary::copy_relocs_): New data member.
5349 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5350 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5351 * target.h (Sized_target::emit_copy_reloc): New function.
5352 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5353
7cdb37d9
CC
53542011-06-02 Cary Coutant <ccoutant@google.com>
5355
5356 PR gold/12163
5357 * gold/archive.cc (Archive::Archive): Initialize new data member.
5358 (Archive::include_all_members): Return if archive has already been
5359 included.
5360 * gold/archive.h (Archive::include_all_members_): New data member.
5361
cc643b88
NC
53622011-06-02 Nick Clifton <nickc@redhat.com>
5363
5364 * dynobj.h: Fix spelling mistake in comment.
5365 * output.cc: Likewise.
5366
f62a3ca7 53672011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5368 Asier Llano
f62a3ca7
DK
5369
5370 PR gold/12826
cc643b88 5371 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5372 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5373 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5374 redundant arm_exidx_test.so.
5375 * testsuite/Makefile.in: Regenerate.
5376 (check_SCRIPTS): Add pr12826.sh
5377 (check_DATA): Add pr12826.stdout
5378 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5379 * testsuite/pr12826.sh: New file.
5380 * testsuite/pr12826_1.s: Ditto.
5381 * testsuite/pr12826_1.s: Ditto.
5382
8dbe1edc
ILT
53832011-05-30 Ian Lance Taylor <iant@google.com>
5384
5385 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5386 sections.
5387
c49875be
ILT
53882011-05-29 Ian Lance Taylor <iant@google.com>
5389
5390 PR gold/12804
5391 * testsuite/Makefile.am: Use different file name for two_file_test
5392 temporary file for each incremental test.
5393 * testsuite/Makefile.in: Rebuild.
5394
69d53f7a
ILT
53952011-05-29 Ian Lance Taylor <iant@google.com>
5396
5397 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5398 binary input file is empty.
5399
41d0ab5f
ILT
54002011-05-27 Ian Lance Taylor <iant@google.com>
5401
5402 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5403 (ver_test_9.so): Likewise.
5404 * testsuite/Makefile.in: Rebuild.
5405
89d8a36b
CC
54062011-05-26 Cary Coutant <ccoutant@google.com>
5407
5408 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5409 * incremental.cc (Incremental_inputs::report_input_section): Fix
5410 comment, indentation.
5411 (Incremental_inputs::report_comdat_group): New function.
5412 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5413 of data for incremental input file entry.
5414 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5415 group count, COMDAT group signatures.
5416 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5417 an unchanged input file.
5418 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5419 Initialize new data member.
5420 (Incremental_object_entry::add_comdat_group): New function.
5421 (Incremental_object_entry::get_comdat_group_count): New function.
5422 (Incremental_object_entry::get_comdat_signature_key): New function.
5423 (Incremental_object_entry::groups_): New data member.
5424 (Incremental_inputs::report_comdat_group): New function.
5425 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5426 data for incremental input file entry.
5427 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5428 (Incremental_input_entry_reader::get_input_section): Adjust size of
5429 data for incremental input file entry.
5430 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5431 (Incremental_input_entry_reader::get_comdat_group_signature): New
5432 function.
5433 * object.cc (Sized_relobj::include_section_group): Report kept
5434 COMDAT groups for incremental links.
5435
1706a06f
ILT
54362011-05-24 David Meyer <pdox@google.com>
5437
5438 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5439 with name parameter. Add found_name parameter.
5440 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5441 * dirsearch.h (class Dirsearch): Update declaration.
5442
a10ae760
ILT
54432011-05-24 Ian Lance Taylor <iant@google.com>
5444
5445 * archive.cc (Library_base::should_include_member): Pull in object
5446 from archive if it defines the entry symbol.
5447 * parameters.cc (Parameters::entry): New function.
5448 * parameters.h (class Parameters): Declare entry.
5449 * output.h (class Output_file_header): Remove entry_ field.
5450 * output.cc (Output_file_header::Output_file_header): Remove entry
5451 parameter. Change all callers.
5452 (Output_file_header::entry): Use parameters->entry.
5453 * gold.cc (queue_middle_tasks): Likewise.
5454 * plugin.cc (Plugin_hook::run): Likewise.
5455
aa92d6ed
CC
54562011-05-24 Cary Coutant <ccoutant@google.com>
5457
5458 * gold.cc (queue_initial_tasks): Pass incremental base filename
5459 to Output_file::open_base_file; don't print error message.
5460 * incremental-dump.cc (main): Adjust call to
5461 Output_file::open_for_modification.
5462 * incremental-dump.cc (main): Likewise.
5463 * incremental.cc (Incremental_inputs::report_command_line):
5464 Ignore --incremental-base option when comparing command lines.
5465 Ignore parameter when given as separate argument.
5466 * options.h (class General_options): Add --incremental-base.
5467 * output.cc (Output_file::Output_file):
5468 (Output_file::open_base_file): Add base_name and writable parameters;
5469 read base file into new file; print error message here.
5470 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5471 callers.
5472 * output.h (Output_file::open_for_modification): Rename to...
5473 (Output_file::open_base_file): ...this; add base_name and
5474 writable parameters; adjust all callers.
5475 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5476 callers.
5477 * testsuite/Makefile.am (incremental_test_4): Test
5478 --incremental-base.
5479 * testsuite/Makefile.in: Regenerate.
5480
2eedd706
CC
54812011-05-24 Cary Coutant <ccoutant@google.com>
5482
5483 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5484 incremental_test_4.
5485 * testsuite/Makefile.in: Regenerate.
5486 * testsuite/two_file_test_1_v1.cc: New test source file.
5487 * testsuite/two_file_test_1b_v1.cc: New test source file.
5488 * testsuite/two_file_test_2_v1.cc: New test source file.
5489
0f1c85a6
CC
54902011-05-24 Cary Coutant <ccoutant@google.com>
5491
5492 * dynobj.h (Dynobj::do_dynobj): New function.
5493 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5494 flag and soname for shared objects.
5495 * incremental.cc (Incremental_inputs::report_object): Make
5496 either Incremental_object_entry or Incremental_dynobj_entry; add
5497 soname to string table.
5498 (Incremental_inputs::report_input_section): Add assertion.
5499 (Output_section_incremental_inputs::set_final_data_size): Adjust
5500 type of input file entry for shared libraries; adjust size of
5501 shared library info entry.
5502 (Output_section_incremental_inputs::write_input_files): Write
5503 as_needed flag for shared libraries.
5504 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5505 of input file entry for shared libraries; write soname.
5506 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5507 soname from incremental info.
5508 * incremental.h (enum Incremental_input_flags): Add
5509 INCREMENTAL_INPUT_AS_NEEDED.
5510 (Incremental_input_entry::Incremental_input_entry): Initialize new
5511 data member.
5512 (Incremental_input_entry::set_as_needed): New function.
5513 (Incremental_input_entry::as_needed): New function.
5514 (Incremental_input_entry::do_dynobj_entry): New function.
5515 (Incremental_input_entry::as_needed_): New data member.
5516 (Incremental_object_entry::Incremental_object_entry): Don't check
5517 for shared library.
5518 (Incremental_object_entry::do_type): Likewise.
5519 (class Incremental_dynobj_entry): New class.
5520 (Incremental_input_entry_reader::as_needed): New function.
5521 (Incremental_input_entry_reader::get_soname): New function.
5522 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5523 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5524 size of shared library info entry.
58797674 5525 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5526 incremental link when adding DT_NEEDED entries.
5527 * object.h (Object::Object): Initialize new data member.
5528 (Object::dynobj): New function.
5529 (Object::set_as_needed): New function.
5530 (Object::as_needed): New function.
5531 (Object::do_dynobj): New function.
5532 (Object::as_needed_): New data member.
5533
6fa2a40b
CC
55342011-05-24 Cary Coutant <ccoutant@google.com>
5535
5536 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5537 info; adjust display of GOT entries.
5538 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5539 vector of input objects; remove file_status_.
5540 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5541 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5542 got_plt reader; call target hooks to reserve GOT entries.
5543 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5544 of input file info header and GOT info entry.
5545 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5546 relocation info.
5547 (Got_plt_view_info::got_descriptor): Remove.
5548 (Got_plt_view_info::sym_index): New data member.
5549 (Got_plt_view_info::input_index): New data member.
5550 (Local_got_offset_visitor::visit): Write input file index.
5551 (Global_got_offset_visitor::visit): Write 0 for input file index.
5552 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5553 with sym_index and input_index.
5554 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5555 incremental info GOT entry; replace got_descriptor with input_index.
5556 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5557 map from input file index to object.
5558 (Sized_relobj_incr::do_layout): Replace direct data member reference
5559 with accessor function.
5560 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5561 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5562 Adjust size of input file info header.
5563 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5564 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5565 (Incremental_input_entry_reader::get_input_section): Adjust size of
5566 input file info header.
5567 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5568 of incremental info GOT entry.
5569 (Incremental_got_plt_reader::get_got_desc): Remove.
5570 (Incremental_got_plt_reader::get_got_symndx): New function.
5571 (Incremental_got_plt_reader::get_got_input_index): New function.
5572 (Sized_incremental_binary::Sized_incremental_binary): Remove
5573 file_status_; add input_objects_.
5574 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5575 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5576 (Sized_incremental_binary::file_is_unchanged): Remove.
5577 (Sized_incremental_binary::set_input_object): New function.
5578 (Sized_incremental_binary::input_object): New function.
5579 (Sized_incremental_binary::file_status_): Remove.
5580 (Sized_incremental_binary::input_objects_): New data member.
5581 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5582 references.
5583 (Sized_relobj_incr::invalid_address): Move to base class.
5584 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5585 class.
5586 (Sized_relobj_incr::do_output_section_offset): Likewise.
5587 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5588 (Sized_relobj_incr::section_offsets_): Likewise.
5589 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5590 function.
5591 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5592 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5593 with accessor function.
5594 (Sized_relobj_file::do_layout): Likewise.
5595 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5596 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5597 (Sized_relobj_file::compute_final_local_value): Replace refs to
5598 section_offsets_ with accessor function.
5599 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5600 * object.h (Relobj::Relobj): Initialize new data members.
5601 (Relobj::add_dyn_reloc): New function.
5602 (Relobj::first_dyn_reloc): New function.
5603 (Relobj::dyn_reloc_count): New function.
5604 (Relobj::first_dyn_reloc_): New data member.
5605 (Relobj::dyn_reloc_count_): New data member.
5606 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5607 references.
5608 (Sized_relobj::Address): New typedef.
5609 (Sized_relobj::invalid_address): Move here from child class.
5610 (Sized_relobj::Sized_relobj): Initialize new data members.
5611 (Sized_relobj::sized_relobj): New function.
5612 (Sized_relobj::is_output_section_offset_invalid): Move here from
5613 child class.
5614 (Sized_relobj::get_output_section_offset): Likewise.
5615 (Sized_relobj::local_has_got_offset): Likewise.
5616 (Sized_relobj::local_got_offset): Likewise.
5617 (Sized_relobj::set_local_got_offset): Likewise.
5618 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5619 (Sized_relobj::clear_got_offsets): New function.
5620 (Sized_relobj::section_offsets): Move here from child class.
5621 (Sized_relobj::do_output_section_offset): Likewise.
5622 (Sized_relobj::do_set_section_offset): Likewise.
5623 (Sized_relobj::Local_got_offsets): Likewise.
5624 (Sized_relobj::local_got_offsets_): Likewise.
5625 (Sized_relobj::section_offsets_): Likewise.
5626 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5627 references.
5628 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5629 class.
5630 (Sized_relobj_file::sized_relobj): New function
5631 (Sized_relobj_file::local_has_got_offset): Move to base class.
5632 (Sized_relobj_file::local_got_offset): Likewise.
5633 (Sized_relobj_file::set_local_got_offset): Likewise.
5634 (Sized_relobj_file::get_output_section_offset): Likewise.
5635 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5636 (Sized_relobj_file::do_output_section_offset): Likewise.
5637 (Sized_relobj_file::do_set_section_offset): Likewise.
5638 (Sized_relobj_file::Local_got_offsets): Likewise.
5639 (Sized_relobj_file::local_got_offsets_): Likewise.
5640 (Sized_relobj_file::section_offsets_): Likewise.
5641 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5642 (all constructors).
5643 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5644 (Output_reloc::get_symbol_index): Likewise.
5645 (Output_reloc::local_section_offset): Likewise.
5646 (Output_reloc::get_address): Likewise.
5647 (Output_reloc::symbol_value): Likewise.
5648 (Output_data_got::reserve_slot): Move to class definition.
5649 (Output_data_got::reserve_local): New function.
5650 (Output_data_got::reserve_slot_for_global): Remove.
5651 (Output_data_got::reserve_global): New function.
5652 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5653 (all constructors, two instantiations).
5654 (Output_reloc::get_relobj): New function (two instantiations).
5655 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5656 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5657 (Output_data_reloc::add_global): Adjust type of relobj.
5658 (Output_data_reloc::add_global_relative): Likewise.
5659 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5660 (Output_data_reloc::add_local): Likewise.
5661 (Output_data_reloc::add_local_relative): Likewise.
5662 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5663 (Output_data_reloc::add_local_section): Likewise.
5664 (Output_data_reloc::add_output_section): Likewise.
5665 (Output_data_reloc::add_absolute): Likewise.
5666 (Output_data_reloc::add_target_specific): Likewise.
5667 (Output_data_got::reserve_slot): Move definition here.
5668 (Output_data_got::reserve_local): New function.
5669 (Output_data_got::reserve_global): New function.
5670 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5671 section_offsets_ with accessor function.
5672 (Sized_relobj_file::write_sections): Likewise.
5673 (Sized_relobj_file::do_relocate_sections): Likewise.
5674 * target.h (Sized_target::reserve_local_got_entry): New function.
5675 (Sized_target::reserve_global_got_entry): New function.
5676 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5677 (Target_x86_64::reserve_global_got_entry): New function.
5678 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5679
4829d394
CC
56802011-05-23 Cary Coutant <ccoutant@google.com>
5681
5682 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5683 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5684 bit when checking got_type.
5685 * incremental.cc (Sized_incremental_binary::setup_readers):
5686 Store symbol table and string table locations; initialize bit vector
5687 of file status flags.
5688 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5689 unchanged files.
5690 (Sized_incremental_binary::do_process_got_plt): New function.
5691 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5692 (Output_section_incremental_inputs::set_final_data_size): Record
5693 file index for each input file.
5694 (Output_section_incremental_inputs::write_got_plt): Store file index
5695 instead of input entry offset for each GOT entry.
5696 * incremental.h
5697 (Incremental_input_entry::Incremental_input_entry): Initialize new
5698 data member.
5699 (Incremental_input_entry::set_offset): Store file index.
5700 (Incremental_input_entry::get_file_index): New function.
5701 (Incremental_input_entry::file_index_): New data member.
5702 (Incremental_binary::process_got_plt): New function.
5703 (Incremental_binary::do_process_got_plt): New function.
5704 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5705 data members.
5706 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5707 (Sized_incremental_binary::set_file_is_unchanged): New function.
5708 (Sized_incremental_binary::file_is_unchanged): New function.
5709 (Sized_incremental_binary::do_process_got_plt): New function.
5710 (Sized_incremental_binary::file_status_): New data member.
5711 (Sized_incremental_binary::main_symtab_loc_): New data member.
5712 (Sized_incremental_binary::main_strtab_loc_): New data member.
5713 * output.cc (Output_data_got::Got_entry::write): Add case
5714 RESERVED_CODE.
5715 (Output_data_got::add_global): Call add_got_entry.
5716 (Output_data_got::add_global_plt): Likewise.
5717 (Output_data_got::add_global_with_rel): Likewise.
5718 (Output_data_got::add_global_with_rela): Likewise.
5719 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5720 (Output_data_got::add_global_pair_with_rela): Likewise.
5721 (Output_data_got::add_local): Call add_got_entry.
5722 (Output_data_got::add_local_plt): Likewise.
5723 (Output_data_got::add_local_with_rel): Likewise.
5724 (Output_data_got::add_local_with_rela): Likewise.
5725 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5726 (Output_data_got::add_local_pair_with_rela): Likewise.
5727 (Output_data_got::reserve_slot): New function.
5728 (Output_data_got::reserve_slot_for_global): New function.
5729 (Output_data_got::add_got_entry): New function.
5730 (Output_data_got::add_got_entry_pair): New function.
5731 (Output_section::add_output_section_data): Edit FIXME.
5732 * output.h
5733 (Output_section_data_build::Output_section_data_build): New
5734 constructor with size parameter.
5735 (Output_data_space::Output_data_space): Likewise.
5736 (Output_data_got::Output_data_got): Initialize new data member; new
5737 constructor with size parameter.
5738 (Output_data_got::add_constant): Call add_got_entry.
5739 (Output_data_got::reserve_slot): New function.
5740 (Output_data_got::reserve_slot_for_global): New function.
5741 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5742 (Output_data_got::add_got_entry): New function.
5743 (Output_data_got::add_got_entry_pair): New function.
5744 (Output_data_got::free_list_): New data member.
5745 * target.h (Sized_target::init_got_plt_for_update): New function.
5746 (Sized_target::register_global_plt_entry): New function.
5747 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5748 Initialize new data member; call init; add constructor with PLT count.
5749 (Output_data_plt_x86_64::init): New function.
5750 (Output_data_plt_x86_64::add_relocation): New function.
5751 (Output_data_plt_x86_64::reserve_slot): New function.
5752 (Output_data_plt_x86_64::free_list_): New data member.
5753 (Target_x86_64::init_got_plt_for_update): New function.
5754 (Target_x86_64::register_global_plt_entry): New function.
5755 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5756 incremental updates.
5757 (Output_data_plt_x86_64::add_relocation): New function.
5758 * testsuite/object_unittest.cc (Object_test): Set default options.
5759
ec69d6da
ILT
57602011-05-16 Ian Lance Taylor <iant@google.com>
5761
5762 * options.h (class General_options): Make -i a synonym for -r.
5763
732e31de
ILT
57642011-05-16 Ian Lance Taylor <iant@google.com>
5765
5766 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5767
403676b5
CC
57682011-05-10 Cary Coutant <ccoutant@google.com>
5769
5770 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5771 strip_all (-s).
5772
5b7b7d6e
ILT
57732011-05-06 Ian Lance Taylor <iant@google.com>
5774
5775 * layout.cc (Layout::layout): If the output section flags change,
5776 update the ordering.
5777
f0f9babf
CC
57782011-04-25 Cary Coutant <ccoutant@google.com>
5779
5780 * incremental-dump.cc (dump_incremental_inputs): Print local
5781 symbol info for each input file.
5782 * incremental.cc
5783 (Output_section_incremental_inputs::set_final_data_size): Add local
5784 symbol info to input file entries in incremental info.
5785 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5786 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5787 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5788 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5789 implementation.
5790 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5791 (Sized_incr_relobj::do_relocate): Write the local symbols.
5792 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5793 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5794 Adjust size of input file header.
5795 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5796 (Incremental_inputs_reader::get_local_symbol_count): New function.
5797 (Incremental_inputs_reader::get_input_section): Adjust size of input
5798 file header.
5799 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5800 (Sized_incr_relobj::This): New typedef.
5801 (Sized_incr_relobj::sym_size): New const data member.
5802 (Sized_incr_relobj::Local_symbol): New struct.
5803 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5804 (Sized_incr_relobj::do_local_symbol_offset): New function.
5805 (Sized_incr_relobj::local_symbol_count_): New data member.
5806 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5807 (Sized_incr_relobj::local_symbol_index_): New data member.
5808 (Sized_incr_relobj::local_symbol_offset_): New data member.
5809 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5810 (Sized_incr_relobj::local_symbols_): New data member.
5811 * object.h (Relobj::output_local_symbol_count): New function.
5812 (Relobj::local_symbol_offset): New function.
5813 (Relobj::do_output_local_symbol_count): New function.
5814 (Relobj::do_local_symbol_offset): New function.
5815 (Sized_relobj::do_output_local_symbol_count): New function.
5816 (Sized_relobj::do_local_symbol_offset): New function.
5817
d0a9ace3
ILT
58182011-04-22 Vladimir Simonov <sv@sw.ru>
5819
5820 * descriptors.cc (set_close_on_exec): New function.
5821 (Descriptors::open): Use set_close_on_exec.
5822 * output.cc (S_ISLNK): Define if not defined.
5823
94a3fc8b
CC
58242011-04-22 Cary Coutant <ccoutant@google.com>
5825
5826 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5827 global symbol map.
5828 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5829 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5830 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5831 relocations.
5832 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5833 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5834 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5835 * incremental.h
5836 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5837 function.
5838 (Incremental_binary::apply_incremental_relocs): New function.
5839 (Incremental_binary::do_apply_incremental_relocs): New function.
5840 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5841 data member.
5842 (Sized_incremental_binary::add_global_symbol): New function.
5843 (Sized_incremental_binary::global_symbol): New function.
5844 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5845 (Sized_incremental_binary::symbol_map_): New data member.
5846 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5847 * target.h (Sized_target::apply_relocation): New function.
5848 * target-reloc.h (apply_relocation): New function.
5849 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5850
c87e4302
DK
58512011-04-22 Doug Kwan <dougkwan@google.com>
5852
5853 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5854 flag of a SHT_ARM_EXIDX section.
2e702c99 5855 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5856 * testsuite/Makefile.in: Regenerate.
5857 * testsuite/arm_exidx_test.s: New file.
5858 * testsuite/arm_exidx_test.sh: Same.
5859
e7782cf6
CC
58602011-04-20 Cary Coutant <ccoutant@google.com>
5861
5862 PR gold/12689
5863 * archive.h (Incremental_archive_entry::Archive_member):
5864 Initialize arg_serial_ (second constructor).
5865
308ecdc7
ILT
58662011-04-17 Ian Lance Taylor <iant@google.com>
5867
5868 * object.cc (Relocate_info::location): Simplify location string.
5869 * errors.cc (Errors::error_at_location): Don't print program
5870 name.
5871 (Errors::warning_at_location): Likewise.
5872 (Errors::undefined_symbol): Likewise.
5873 * testsuite/debug_msg.sh: Update accordingly.
5874
bec5b579
CC
58752011-04-14 Cary Coutant <ccoutant@google.com>
5876
5877 * gold/layout.cc (Layout::symtab_section_offset): New function.
5878 * gold/layout.h (Layout::symtab_section_offset): New function.
5879 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5880
88597d34
ILT
58812011-04-12 Ian Lance Taylor <iant@google.com>
5882
5883 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5884 with MREMAP_MAYMOVE.
5885 * output.h (class Output_file): Add map_is_allocated_ field.
5886 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5887 not available, provide stubs. If mremap is not available, #define
5888 it to gold_mremap.
5889 (MREMAP_MAYMOVE): Define if not defined.
5890 (Output_file::Output_file): Initialize map_is_allocated_.
5891 (Output_file::resize): Check map_is_allocated_.
5892 (Output_file::map_anonymous): If mmap fails, use malloc.
5893 (Output_file::unmap): Don't do anything for an anonymous map.
5894 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5895 is not available, provide stubs.
5896 (File_read::View::~View): Use free rather than delete[].
5897 (File_read::make_view): Use malloc rather than new[]. If mmap
5898 fails, use malloc.
5899 (File_read::find_or_make_view): Use malloc rather than new[].
5900 * gold.h: Remove HAVE_REMAP code.
5901 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5902 exists. Rename mremap to gold_mremap. If mmap is not available
5903 don't do anything.
5904 * configure, config.in: Rebuild.
5905
11e361bc
ILT
59062011-04-11 Ian Lance Taylor <iant@google.com>
5907
5908 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5909 initialize local variable v.
5910
cdc29364
CC
59112011-04-11 Cary Coutant <ccoutant@google.com>
5912
5913 * archive.cc (Archive::include_member): Adjust call to
5914 report_object.
5915 (Add_archive_symbols::run): Track argument serial numbers.
5916 (Lib_group::include_member): Likewise.
5917 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5918 * archive.h (Incremental_archive_entry::Archive_member):
5919 Initialize arg_serial_.
5920 (Archive_member::arg_serial_): New data member.
5921 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5922 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5923 incremental link.
5924 (Sized_dynobj::do_for_all_local_got_entries): New function.
5925 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5926 function.
5927 * fileread.cc (get_mtime): New function.
5928 * fileread.h (get_mtime): New function.
5929 * gold.cc (queue_initial_tasks): Check for incremental update.
5930 (process_incremental_input): New function.
5931 (queue_middle_tasks): Don't force valid target for incremental
5932 update.
5933 * incremental-dump.cc (find_input_containing_global): Adjust
5934 size of symbol info entry.
5935 (dump_incremental_inputs): Dump argument serial number and
5936 in_system_directory flag; bias shndx by 1; print symbol names
5937 when dumping per-file symbol lists; use new symbol info readers.
5938 * incremental.cc
5939 (Output_section_incremental_inputs:update_data_size): New function.
5940 (Sized_incremental_binary::setup_readers): Setup input readers
5941 for each input file; build maps for files added from libraries
5942 and scripts.
5943 (Sized_incremental_binary::check_input_args): New function.
5944 (Sized_incremental_binary::do_check_inputs): Build map of argument
5945 serial numbers to input arguments.
5946 (Sized_incremental_binary::do_file_has_changed): Rename
5947 do_file_is_unchanged to this; compare file modification times.
5948 (Sized_incremental_binary::do_init_layout): New function.
5949 (Sized_incremental_binary::do_reserve_layout): New function.
5950 (Sized_incremental_binary::do_get_input_reader): Remove.
5951 (Sized_incremental_binary::get_symtab_view): New function.
5952 (Incremental_checker::can_incrementally_link_output_file): Remove.
5953 (Incremental_inputs::report_command_line): Exclude --debug options.
5954 (Incremental_inputs::report_archive_begin): Add parameter; track
5955 argument serial numbers; don't put input file entry for archive
5956 before archive members.
5957 (Incremental_inputs::report_archive_end): Put input file entry
5958 for archive after archive members.
5959 (Incremental_inputs::report_object): Add parameter; track argument
5960 serial numbers and in_system_directory flag.
5961 (Incremental_inputs::report_script): Add parameter; track argument
5962 serial numbers.
5963 (Output_section_incremental_inputs::set_final_data_size): Adjust
5964 size of symbol info entry; check for forwarding symbols.
5965 (Output_section_incremental_inputs::write_input_files): Write
5966 in_system_directory flag and argument serial number.
5967 (Output_section_incremental_inputs::write_info_blocks): Map section
5968 indices between incremental info and original input file; store
5969 input section index for each symbol.
5970 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5971 change operator() to visit().
5972 (class Global_got_offset_visitor): Likewise.
5973 (class Global_symbol_visitor_got_plt):
5974 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5975 classes.
5976 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5977 (Sized_incr_relobj::do_read_symbols): New function.
5978 (Sized_incr_relobj::do_layout): New function.
5979 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5980 (Sized_incr_relobj::do_add_symbols): New function.
5981 (Sized_incr_relobj::do_should_include_member): New function.
5982 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5983 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5984 (Sized_incr_relobj::do_section_size): New function.
5985 (Sized_incr_relobj::do_section_name): New function.
5986 (Sized_incr_relobj::do_section_contents): New function.
5987 (Sized_incr_relobj::do_section_flags): New function.
5988 (Sized_incr_relobj::do_section_entsize): New function.
5989 (Sized_incr_relobj::do_section_address): New function.
5990 (Sized_incr_relobj::do_section_type): New function.
5991 (Sized_incr_relobj::do_section_link): New function.
5992 (Sized_incr_relobj::do_section_info): New function.
5993 (Sized_incr_relobj::do_section_addralign): New function.
5994 (Sized_incr_relobj::do_initialize_xindex): New function.
5995 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5996 (Sized_incr_relobj::do_read_relocs): New function.
5997 (Sized_incr_relobj::do_gc_process_relocs): New function.
5998 (Sized_incr_relobj::do_scan_relocs): New function.
5999 (Sized_incr_relobj::do_count_local_symbols): New function.
6000 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6001 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6002 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6003 (Sized_incr_relobj::do_relocate): New function.
6004 (Sized_incr_relobj::do_set_section_offset): New function.
6005 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6006 (Sized_incr_dynobj::do_read_symbols): New function.
6007 (Sized_incr_dynobj::do_layout): New function.
6008 (Sized_incr_dynobj::do_add_symbols): New function.
6009 (Sized_incr_dynobj::do_should_include_member): New function.
6010 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6011 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6012 (Sized_incr_dynobj::do_section_size): New function.
6013 (Sized_incr_dynobj::do_section_name): New function.
6014 (Sized_incr_dynobj::do_section_contents): New function.
6015 (Sized_incr_dynobj::do_section_flags): New function.
6016 (Sized_incr_dynobj::do_section_entsize): New function.
6017 (Sized_incr_dynobj::do_section_address): New function.
6018 (Sized_incr_dynobj::do_section_type): New function.
6019 (Sized_incr_dynobj::do_section_link): New function.
6020 (Sized_incr_dynobj::do_section_info): New function.
6021 (Sized_incr_dynobj::do_section_addralign): New function.
6022 (Sized_incr_dynobj::do_initialize_xindex): New function.
6023 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6024 (make_sized_incremental_object): New function.
6025 (Incremental_library::copy_unused_symbols): New function.
6026 (Incremental_library::do_for_all_unused_symbols): New function.
6027 * incremental.h (enum Incremental_input_flags): New type.
6028 (class Incremental_checker): Remove.
6029 (Incremental_input_entry::Incremental_input_entry): Add argument
6030 serial number.
6031 (Incremental_input_entry::arg_serial): New function.
6032 (Incremental_input_entry::set_is_in_system_directory): New function.
6033 (Incremental_input_entry::is_in_system_directory): New function.
6034 (Incremental_input_entry::arg_serial_): New data member.
6035 (Incremental_input_entry::is_in_system_directory_): New data member.
6036 (class Script_info): Move here from script.h.
6037 (Script_info::Script_info): Add filename parameter.
6038 (Script_info::filename): New function.
6039 (Script_info::filename_): New data member.
6040 (Incremental_script_entry::Incremental_script_entry): Add argument
6041 serial number.
6042 (Incremental_object_entry::Incremental_object_entry): Likewise.
6043 (Incremental_object_entry::add_input_section): Build list of input
6044 sections with map to original shndx.
6045 (Incremental_object_entry::get_input_section_index): New function.
6046 (Incremental_object_entry::shndx_): New data member.
6047 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6048 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6049 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6050 serial number.
6051 (Incremental_inputs::report_archive_begin): Likewise.
6052 (Incremental_inputs::report_object): Likewise.
6053 (Incremental_inputs::report_script): Likewise.
6054 (class Incremental_global_symbol_reader): New class.
6055 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6056 and store flags and input file type.
6057 (Incremental_input_entry_reader::arg_serial): New function.
6058 (Incremental_input_entry_reader::type): Extract type from flags.
6059 (Incremental_input_entry_reader::is_in_system_directory): New function.
6060 (Incremental_input_entry_reader::get_input_section_count): Call
6061 accessor function for type.
6062 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6063 function for type; adjust size of global symbol entry.
6064 (Incremental_input_entry_reader::get_global_symbol_count): Call
6065 accessor function for type.
6066 (Incremental_input_entry_reader::get_object_count): Likewise.
6067 (Incremental_input_entry_reader::get_object_offset): Likewise.
6068 (Incremental_input_entry_reader::get_member_count): Likewise.
6069 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6070 (Incremental_input_entry_reader::get_member_offset): Likewise.
6071 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6072 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6073 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6074 (Incremental_input_entry_reader::get_global_symbol_reader): New
6075 function.
6076 (Incremental_input_entry_reader::get_output_symbol_index): New
6077 function.
6078 (Incremental_input_entry_reader::type_): Remove.
6079 (Incremental_input_entry_reader::flags_): New data member.
6080 (Incremental_inputs_reader::input_file_offset): New function.
6081 (Incremental_inputs_reader::input_file_index): New function.
6082 (Incremental_inputs_reader::input_file): Call input_file_offset.
6083 (Incremental_inputs_reader::input_file_at_offset): New function.
6084 (Incremental_relocs_reader::get_r_type): Reformat.
6085 (Incremental_relocs_reader::get_r_shndx): Reformat.
6086 (Incremental_relocs_reader::get_r_offset): Reformat.
6087 (Incremental_relocs_reader::data): New function.
6088 (Incremental_binary::Incremental_binary): Initialize new data members.
6089 (Incremental_binary::check_inputs): Add cmdline parameter.
6090 (Incremental_binary::file_is_unchanged): Remove.
6091 (Input_reader::arg_serial): New function.
6092 (Input_reader::get_unused_symbol_count): New function.
6093 (Input_reader::get_unused_symbol): New function.
6094 (Input_reader::do_arg_serial): New function.
6095 (Input_reader::do_get_unused_symbol_count): New function.
6096 (Input_reader::do_get_unused_symbol): New function.
6097 (Incremental_binary::input_file_count): New function.
6098 (Incremental_binary::get_input_reader): Change signature to use
6099 index instead of filename.
6100 (Incremental_binary::file_has_changed): New function.
6101 (Incremental_binary::get_input_argument): New function.
6102 (Incremental_binary::get_library): New function.
6103 (Incremental_binary::get_script_info): New function.
6104 (Incremental_binary::init_layout): New function.
6105 (Incremental_binary::reserve_layout): New function.
6106 (Incremental_binary::output_file): New function.
6107 (Incremental_binary::do_check_inputs): New function.
6108 (Incremental_binary::do_file_is_unchanged): Remove.
6109 (Incremental_binary::do_file_has_changed): New function.
6110 (Incremental_binary::do_init_layout): New function.
6111 (Incremental_binary::do_reserve_layout): New function.
6112 (Incremental_binary::do_input_file_count): New function.
6113 (Incremental_binary::do_get_input_reader): Change signature.
6114 (Incremental_binary::input_args_map_): New data member.
6115 (Incremental_binary::library_map_): New data member.
6116 (Incremental_binary::script_map_): New data member.
6117 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6118 new data members.
6119 (Sized_incremental_binary::output_section): New function.
6120 (Sized_incremental_binary::inputs_reader): Add const.
6121 (Sized_incremental_binary::symtab_reader): Add const.
6122 (Sized_incremental_binary::relocs_reader): Add const.
6123 (Sized_incremental_binary::got_plt_reader): Add const.
6124 (Sized_incremental_binary::get_symtab_view): New function.
6125 (Sized_incremental_binary::Inputs_reader): New typedef.
6126 (Sized_incremental_binary::Input_entry_reader): New typedef.
6127 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6128 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6129 (Sized_incremental_binary::do_file_has_changed): New function.
6130 (Sized_incremental_binary::do_init_layout): New function.
6131 (Sized_incremental_binary::do_reserve_layout): New function.
6132 (Sized_input_reader::Inputs_reader): Remove.
6133 (Sized_input_reader::Input_entry_reader): Remove.
6134 (Sized_input_reader::do_arg_serial): New function.
6135 (Sized_input_reader::do_get_unused_symbol_count): New function.
6136 (Sized_input_reader::do_get_unused_symbol): New function.
6137 (Sized_incremental_binary::do_input_file_count): New function.
6138 (Sized_incremental_binary::do_get_input_reader): Change signature;
6139 use index instead of filename.
6140 (Sized_incremental_binary::section_map_): New data member.
6141 (Sized_incremental_binary::input_entry_readers_): New data member.
6142 (class Sized_incr_relobj): New class.
6143 (class Sized_incr_dynobj): New class.
6144 (make_sized_incremental_object): New function.
6145 (class Incremental_library): New class.
6146 * layout.cc (Free_list::num_lists): New static data member.
6147 (Free_list::num_nodes): New static data member.
6148 (Free_list::num_removes): New static data member.
6149 (Free_list::num_remove_visits): New static data member.
6150 (Free_list::num_allocates): New static data member.
6151 (Free_list::num_allocate_visits): New static data member.
6152 (Free_list::init): New function.
6153 (Free_list::remove): New function.
6154 (Free_list::allocate): New function.
6155 (Free_list::dump): New function.
6156 (Free_list::print_stats): New function.
6157 (Layout_task_runner::run): Resize output file for incremental updates.
6158 (Layout::Layout): Initialize new data members.
6159 (Layout::set_incremental_base): New function.
6160 (Layout::init_fixed_output_section): New function.
6161 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6162 incremental updates.
6163 (Layout::create_gold_note): Do not create gold note section for
6164 incremental updates.
6165 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6166 for incremental updates.
6167 (Layout::set_section_offsets): For incremental updates, allocate space
6168 from free list.
6169 (Layout::create_symtab_sections): Layout with offsets relative to
6170 start of section; for incremental updates, allocate space from free
6171 list.
6172 (Layout::create_shdrs): For incremental updates, allocate space from
6173 free list.
6174 (Layout::finish_dynamic_section): For incremental updates, do not
6175 check --as-needed (fixed in subsequent patch).
6176 * layout.h (class Free_list): New class.
6177 (Layout::set_incremental_base): New function.
6178 (Layout::incremental_base): New function.
6179 (Layout::init_fixed_output_section): New function.
6180 (Layout::allocate): New function.
6181 (Layout::incremental_base_): New data member.
6182 (Layout::free_list_): New data member.
6183 * main.cc (main): Print Free_list statistics.
6184 * object.cc (Relobj::finalize_incremental_relocs): Add
6185 clear_counts parameter; clear counts only when clear_counts is set.
6186 (Sized_relobj::Sized_relobj): Initialize new base class.
6187 (Sized_relobj::do_layout): Don't report special sections.
6188 (Sized_relobj::do_for_all_local_got_entries): New function.
6189 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6190 symtab_off to all symbol table offsets.
6191 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6192 * object.h (class Got_offset_list): Move to top of file.
6193 (Object::Object): Allow case where input_file == NULL.
6194 (Object::~Object): Likewise.
6195 (Object::input_file): Assert that input_file != NULL.
6196 (Object::lock): Allow case where input_file == NULL.
6197 (Object::unlock): Likewise.
6198 (Object::is_locked): Likewise.
6199 (Object::token): Likewise.
6200 (Object::release): Likewise.
6201 (Object::is_incremental): New function.
6202 (Object::get_mtime): New function.
6203 (Object::for_all_local_got_entries): New function.
6204 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6205 (Object::set_is_in_system_directory): New function.
6206 (Object::is_in_system_directory): New function.
6207 (Object::do_is_incremental): New function.
6208 (Object::do_get_mtime): New function.
6209 (Object::do_for_all_local_got_entries): New function.
6210 (Object::is_in_system_directory_): New data member.
6211 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6212 (class Sized_relobj_base): New class.
6213 (class Sized_relobj): Derive from Sized_relobj_base.
6214 (class Sized_relobj::Symbols): Redeclare from base class.
6215 (class Sized_relobj::local_got_offset_list): Remove.
6216 (class Sized_relobj::Output_sections): Redeclare from base class.
6217 (class Sized_relobj::do_for_all_local_got_entries): New function.
6218 (class Sized_relobj::write_local_symbols): Add offset parameter.
6219 (class Sized_relobj::local_symbol_offset_): Update comment.
6220 (class Sized_relobj::local_dynsym_offset_): Update comment.
6221 * options.cc (Input_arguments::add_file): Remove const.
6222 * options.h (Input_file_argument::Input_file_argument):
6223 Initialize arg_serial_ (all constructors).
6224 (Input_file_argument::set_arg_serial): New function.
6225 (Input_file_argument::arg_serial): New function.
6226 (Input_file_argument::arg_serial_): New data member.
6227 (Input_arguments::Input_arguments): Initialize file_count_.
6228 (Input_arguments::add_file): Remove const.
6229 (Input_arguments::number_of_input_files): New function.
6230 (Input_arguments::file_count_): New data member.
6231 (Command_line::number_of_input_files): Call
6232 Input_arguments::number_of_input_files.
6233 * output.cc (Output_segment_headers::Output_segment_headers):
6234 Set current size.
6235 (Output_section::Input_section::current_data_size): New function.
6236 (Output_section::Output_section): Initialize new data members.
6237 (Output_section::add_input_section): Don't do merge sections for
6238 an incremental link; allocate space from free list for an
6239 incremental update.
6240 (Output_section::add_output_section_data): Allocate space from
6241 free list for an incremental update.
6242 (Output_section::update_data_size): New function.
6243 (Output_section::set_fixed_layout): New function.
6244 (Output_section::reserve): New function.
6245 (Output_segment::set_section_addresses): Remove const.
6246 (Output_segment::set_section_list_addresses): Remove const; allocate
6247 space from free list for an incremental update.
6248 (Output_segment::set_offset): Adjust size of RELRO segment for an
6249 incremental update.
6250 * output.h (Output_data::current_data_size): Move here from
6251 child classes.
6252 (Output_data::pre_finalize_data_size): New function.
6253 (Output_data::update_data_size): New function.
6254 (Output_section_headers::update_data_size): new function.
6255 (Output_section_data_build::current_data_size): Move to Output_data.
6256 (Output_data_strtab::update_data_size): New function.
6257 (Output_section::current_data_size): Move to Output_data.
6258 (Output_section::set_fixed_layout): New function.
6259 (Output_section::has_fixed_layout): New function.
6260 (Output_section::reserve): New function.
6261 (Output_section::update_data_size): New function.
6262 (Output_section::has_fixed_layout_): New data member.
6263 (Output_section::free_list_): New data member.
6264 (Output_segment::set_section_addresses): Remove const.
6265 (Output_segment::set_section_list_addresses): Remove const.
6266 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6267 New function.
6268 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6269 New function.
6270 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6271 parameter when calling Add_symbols constructor; store argument
6272 serial number for members of a lib group.
6273 (Add_symbols::locks): Allow case where token == NULL.
6274 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6275 (Read_member::~Read_member): New function.
6276 (Read_member::is_runnable): New function.
6277 (Read_member::locks): New function.
6278 (Read_member::run): New function.
6279 (Check_script::~Check_script): New function.
6280 (Check_script::is_runnable): New function.
6281 (Check_script::locks): New function.
6282 (Check_script::run): New function.
6283 (Check_library::~Check_library): New function.
6284 (Check_library::is_runnable): New function.
6285 (Check_library::locks): New function.
6286 (Check_library::run): New function.
6287 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6288 (Add_symbols::library_): New data member.
6289 (class Read_member): New class.
6290 (class Check_script): New class.
6291 (class Check_library): New class.
6292 * reloc.cc (Read_relocs::is_runnable): Allow case where
6293 token == NULL.
6294 (Read_relocs::locks): Likewise.
6295 (Scan_relocs::locks): Likewise.
6296 (Relocate_task::locks): Likewise.
6297 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6298 to clear counters.
6299 (Sized_relobj::incremental_relocs_scan): Fix comment.
6300 (Sized_relobj::do_relocate): Pass output file offset to
6301 write_local_symbols.
6302 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6303 from class declaration.
6304 * script.cc (read_input_script): Allocate Script_info; pass
6305 argument serial number to report_script.
6306 * script.h (class Script_info): Move to incremental.h.
6307 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6308 * symtab.h (Symbol_table::add_from_incrobj): New function.
6309 (Symbol_table::set_file_offset): New function.
6310
b961d0d7
CC
63112011-04-05 Cary Coutant <ccoutant@google.com>
6312
6313 * incremental-dump.cc (dump_incremental_inputs): Change signature
6314 to take a Sized_incremental_binary; change caller. Use readers
6315 in Sized_incremental_binary.
6316 * incremental.cc
6317 (Sized_incremental_binary::find_incremental_inputs_sections):
6318 Rename do_find_incremental_inputs_sections to this.
6319 (Sized_incremental_binary::setup_readers): New function.
6320 (Sized_incremental_binary::do_check_inputs): Check
6321 has_incremental_info_ flag; move setup code to setup_readers;
6322 use input readers.
6323 (Sized_incremental_binary::do_file_is_unchanged): New function.
6324 (Sized_incremental_binary::do_get_input_reader): New function.
6325 * incremental.h (class Incremental_binary): Move to end of file.
6326 (Incremental_binary::file_is_unchanged): New function.
6327 (Incremental_binary::do_file_is_unchanged): New function.
6328 (Incremental_binary::Input_reader): New class.
6329 (Incremental_binary::get_input_reader): New function.
6330 (class Sized_incremental_binary): Move to end of file.
6331 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6332 input section reader classes.
6333 (Sized_incremental_binary::has_incremental_info): New function.
6334 (Sized_incremental_binary::inputs_reader): New function.
6335 (Sized_incremental_binary::symtab_reader): New function.
6336 (Sized_incremental_binary::relocs_reader): New function.
6337 (Sized_incremental_binary::got_plt_reader): New function.
6338 (Sized_incremental_binary::do_file_is_unchanged): New function.
6339 (Sized_incremental_binary::Sized_input_reader): New class.
6340 (Sized_incremental_binary::get_input_reader): New function.
6341 (Sized_incremental_binary::find_incremental_inputs_sections):
6342 Rename do_find_incremental_inputs_sections to this.
6343 (Sized_incremental_binary::setup_readers): New function.
6344 (Sized_incremental_binary::has_incremental_info_): New data member.
6345 (Sized_incremental_binary::inputs_reader_): New data member.
6346 (Sized_incremental_binary::symtab_reader_): New data member.
6347 (Sized_incremental_binary::relocs_reader_): New data member.
6348 (Sized_incremental_binary::got_plt_reader_): New data member.
6349 (Sized_incremental_binary::current_input_file_): New data member.
6350
a869183f
PP
63512011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6352
6353 PR gold/12640
6354 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6355 violation.
6356
63572011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6358
6359 * archive.cc (Archive::include_member): Adjust call to report_object.
6360 (Add_archive_symbols::run): Add script_info to call to
6361 report_archive_begin.
6362 (Lib_group::include_member): Adjust call to report_object.
6363 (Add_lib_group_symbols::run): Adjust call to report_object.
6364 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6365 blocks. Add object count for script input files.
6366 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6367 script_info parameter; change all callers.
6368 (Incremental_inputs::report_object): Add script_info parameter;
6369 change all callers.
6370 (Incremental_inputs::report_script): Store backpointer to
6371 incremental info entry.
6372 (Output_section_incremental_inputs::set_final_data_size): Record
6373 additional information for scripts.
6374 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6375 * incremental.h (Incremental_script_entry::add_object): New function.
6376 (Incremental_script_entry::get_object_count): New function.
6377 (Incremental_script_entry::get_object): New function.
6378 (Incremental_script_entry::objects_): New data member; adjust
6379 constructor.
6380 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6381 (Incremental_inputs::report_object): Add script_info parameter.
6382 (Incremental_inputs_reader::get_object_count): New function.
6383 (Incremental_inputs_reader::get_object_offset): New function.
6384 * options.cc (Input_arguments::add_file): Return reference to
6385 new input argument.
6386 * options.h (Input_argument::set_script_info): New function.
6387 (Input_argument::script_info): New function.
6388 (Input_argument::script_info_): New data member; adjust all
6389 constructors.
6390 (Input_file_group::add_file): Return reference to new input argument.
6391 (Input_file_lib::add_file): Likewise.
6392 (Input_arguments::add_file): Likewise.
6393 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6394 * script.cc (Parser_closure::Parser_closure): Add script_info
6395 parameter; adjust all callers.
6396 (Parser_closure::script_info): New function.
6397 (Parser_closure::script_info_): New data member.
6398 (read_input_script): Report scripts earlier to incremental info.
6399 (script_add_file): Set script_info in Input_argument.
6400 (script_add_library): Likewise.
6401 * script.h (Script_options::Script_info): Rewrite class.
6402
a869183f 64032011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6404
6405 * archive.cc (Library_base::should_include_member): Move
6406 method here from class Archive.
6407 (Archive::Archive): Initialize base class.
6408 (Archive::should_include_member): Move to base class.
6409 (Archive::do_for_all_unused_symbols): New function.
6410 (Add_archive_symbols::run): Remove redundant access to
6411 incremental_inputs.
6412 (Lib_group::Lib_group): Initialize base class.
6413 (Lib_group::do_filename): New function.
6414 (Lib_group::include_member): Pass pointer to Lib_group to
6415 report_object.
6416 (Lib_group::do_for_all_unused_symbols): New function.
6417 (Add_lib_group_symbols::run): Report archive information for
6418 incremental links.
6419 * archive.h (class Library_base): New base class.
6420 (class Archive): Derive from Library_base.
6421 (Archive::filename): Move to base class.
6422 (Archive::set_incremental_info): Likewise.
6423 (Archive::incremental_info): Likewise.
6424 (Archive::Should_include): Likewise.
6425 (Archive::should_include_member): Likewise.
6426 (Archive::Armap_entry): Remove.
6427 (Archive::Unused_symbol_iterator): Remove.
6428 (Archive::unused_symbols_begin): Remove.
6429 (Archive::unused_symbols_end): Remove.
6430 (Archive::do_filename): New function.
6431 (Archive::do_get_mtime): New function.
6432 (Archive::do_for_all_unused_symbols): New function.
6433 (Archive::task_): Move to base class.
6434 (Archive::incremental_info_): Likewise.
6435 (class Lib_group): Derive from Library_base.
6436 (Lib_group::do_filename): New function.
6437 (Lib_group::do_get_mtime): New function.
6438 (Lib_group::do_for_all_unused_symbols): New function.
6439 (Lib_group::task_): Move to base class.
6440 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6441 function.
6442 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6443 function.
6444 * incremental.cc (Incremental_inputs::report_archive_begin):
6445 Use Library_base; call library's get_mtime; add incremental inputs
6446 entry before members.
6447 (class Unused_symbol_visitor): New class.
6448 (Incremental_inputs::report_archive_end): Use Library_base; use
6449 visitor class to record unused symbols; don't add incremental inputs
6450 entry after members.
6451 (Incremental_inputs::report_object): Use Library_base.
6452 * incremental.h
6453 (Incremental_archive_entry::Incremental_archive_entry): Remove
6454 unused Archive parameter.
6455 (Incremental_inputs::report_archive_begin): Use Library_base.
6456 (Incremental_inputs::report_archive_end): Likewise.
6457 (Incremental_inputs::report_object): Likewise.
6458 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6459 function.
6460 * object.h (Object::for_all_global_symbols): New function.
6461 (Object::do_for_all_global_symbols): New function.
6462 (Sized_relobj::do_for_all_global_symbols): New function.
6463 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6464 function.
6465 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6466 function.
6467
61ab3e40
ILT
64682011-03-27 Ian Lance Taylor <iant@google.com>
6469
6470 * archive.cc (Archive::interpret_header): Return -1 if something
6471 goes wrong. Change callers accordingly.
6472
30e1f9e6
CC
64732011-03-25 Cary Coutant <ccoutant@google.com>
6474
6475 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6476 * testsuite/Makefile.in: Regenerate.
6477
9370ce59 64782011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6479
6480 * plugin.cc (get_view): New.
6481 (Plugin::load): Pass get_view to the plugin.
6482 (Plugin_manager::get_view): New.
6483
9312bb0a
ILT
64842011-03-21 Ian Lance Taylor <iant@google.com>
6485
6486 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6487 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6488
7e12ba9e
ST
64892011-03-21 Sriraman Tallam <tmsriram@google.com>
6490
6491 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6492 Change == to -eq.
6493 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6494 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6495 Change == to -eq.
6496 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6497 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6498
fd7a005d
ILT
64992011-03-14 Ian Lance Taylor <iant@google.com>
6500
6501 * script-sections.cc (Sort_output_sections::script_compare):
6502 Rename from is_before, change return type.
6503 (Sort_output_sections::operator()): Adjust accordingly.
6504
ed16fd1b
ILT
65052011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6506
6507 PR gold/12572
6508 * testsuite/odr_violation2.cc: Add comment to make all error line
6509 numbers double digits.
6510 * testsuite/debug_msg.sh: Adjust expected errors.
6511
71ff8986
ILT
65122011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6513
6514 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6515 but mark earlier ones as non-canonical
6516 (offset_to_iterator): Update search target and example
6517 (do_addr2line): Return extra lines in a vector*
6518 (format_file_lineno): Extract from do_addr2line
6519 (one_addr2line): Add vector* out-param
6520 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6521 when a lineno entry appeared last for its instruction
6522 (Dwarf_line_info): Add vector* out-param
6523 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6524 * symtab.cc (Odr_violation_compare): Include the lineno in the
6525 comparison again.
6526 (linenos_from_loc): New. Combine the canonical line for an
6527 address with its other lines.
6528 (True_if_intersect): New. Helper functor to make
6529 std::set_intersection a query.
6530 (detect_odr_violations): Compare sets of lines instead of just
6531 one line for each function. This became less deterministic, but
6532 has fewer false positives.
6533 * symtab.h: Declarations.
6534 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6535 mix an optimized and non-optimized object in the same binary
6536 (odr_violation2.so): Same.
6537 * testsuite/Makefile.in: Regenerate from Makefile.am.
6538 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6539 * testsuite/debug_msg.sh: Update line numbers and add
6540 assertions.
6541 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6542 non-optimized context.
6543 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6544 isn't inlined, and use OdrDerived in an optimized context.
6545 * testsuite/odr_header1.h: Defines OdrDerived, where
6546 optimization will change the
6547 first-instruction-in-the-destructor's file and line number.
6548 * testsuite/odr_header2.h: Defines OdrBase.
6549
a19fefdc
ILT
65502011-03-09 Ian Lance Taylor <iant@google.com>
6551
6552 * fileread.cc (File_read::clear_views): Don't delete the whole
6553 file view.
6554
ecb351e9
ILT
65552011-03-08 Ian Lance Taylor <iant@google.com>
6556
6557 PR gold/12525
6558 * fileread.cc: #include <climits>.
6559 (GOLD_IOV_MAX): Define.
6560 (File_read::read_multiple): Limit number of entries by iov_max.
6561 * fileread.h (class File_read): Always set max_readv_entries to
6562 128.
6563
b821d13c
ILT
65642011-03-07 Ian Lance Taylor <iant@google.com>
6565
6566 PR gold/12525
6567 * options.h (class General_options): Add -dy and -dn.
6568
89243142
CC
65692011-03-02 Cary Coutant <ccoutant@google.com>
6570
6571 * testsuite/script_test_9.t: Add TLS segment.
6572
d0773f31
ILT
65732011-03-02 Simon Baldwin <simonb@google.com>
6574
6575 * configure.ac: Add check for gnu_indirect_function support in
6576 the toolchain building binutils.
6577 * configure: Rebuild.
6578
9370ce59 65792011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6580
6581 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6582 plugin only symbols.
6583 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6584 in plugin files as not needed in the symbol table.
6585
4cf7a849
ST
65862011-02-11 Sriraman Tallam <tmsriram@google.com>
6587
6588 * output.cc (Output_section::add_input_section): Delay fill
6589 generation for section ordering.
6590
b578bd7d
ILT
65912011-02-09 Ian Lance Taylor <iant@google.com>
6592
6593 PR gold/12316
6594 * object.h (class Sized_relobj): Remove clear_local_symbols.
6595 * reloc.cc (Sized_relobj::do_relocate): Don't call
6596 clear_local_symbols.
6597
9370ce59 65982011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6599
6600 * plugin.cc (is_visible_from_outside): Return true for symbols
6601 in the -u option.
6602
55382fb7
ILT
66032011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6604
6605 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6606 filename.
6607
4e271fff
ST
66082011-02-02 Sriraman Tallam <tmsriram@google.com>
6609
6610 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6611 to std::string.
4e271fff 6612 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6613 section_name to be std::string.
4e271fff
ST
6614 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6615
d433c3ac
ILT
66162011-01-25 Ian Lance Taylor <iant@google.com>
6617
6618 * script.cc (script_add_extern): Rewrite to use
6619 add_symbol_reference.
6620
880473a6
DK
66212011-01-25 Doug Kwan <dougkwan@google.com>
6622
d433c3ac 6623 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6624
f30f86fa
ILT
66252011-01-24 Ian Lance Taylor <iant@google.com>
6626
6627 * options.h (class General_options): Accept
6628 --no-detect-odr-violations.
6629
8e51a0b9
ILT
66302011-01-24 Ian Lance Taylor <iant@google.com>
6631
6632 * version.cc (version_string): Bump to 1.11.
6633
0f3b89d8
ILT
66342011-01-24 Ian Lance Taylor <iant@google.com>
6635
6636 * plugin.cc (class Plugin_rescan): Define new class.
6637 (Plugin_manager::claim_file): Set any_claimed_.
6638 (Plugin_manager::save_archive): New function.
6639 (Plugin_manager::save_input_group): New function.
6640 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6641 necessary.
6642 (Plugin_manager::new_undefined_symbol): New function.
6643 (Plugin_manager::rescan): New function.
6644 (Plugin_manager::rescannable_defines): New function.
6645 (Plugin_manager::add_input_file): Set any_added_.
6646 * plugin.h (class Plugin_manager): define new fields rescannable_,
6647 undefined_symbols_, any_claimed_, and any_added_. Declare
6648 Plugin_rescan as friend. Declare new functions.
6649 (Plugin_manager::Rescannable): Define type.
6650 (Plugin_manager::Rescannable_list): Define type.
6651 (Plugin_manager::Undefined_symbol_list): Define type.
6652 (Plugin_manager::Plugin_manager): Initialize new fields.
6653 * archive.cc (Archive::defines_symbol): New function.
6654 (Add_archive_symbols::run): Pass archive to plugins if any.
6655 * archive.h (class Archive): Declare defines_symbol.
6656 * readsyms.cc (Input_group::~Input_group): New function.
6657 (Finish_group::run): Pass input_group to plugins if any.
6658 * readsyms.h (class Input_group): Declare destructor.
6659 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6660 any.
6661
3bb951e5
ILT
66622011-01-10 Ian Lance Taylor <iant@google.com>
6663
6664 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6665 section as relro.
6666 (Layout::set_segment_offsets): Reset increase_relro before calling
6667 set_section_addresses a second time.
6668
0aa45fac
CC
66692011-01-04 Cary Coutant <ccoutant@google.com>
6670
6671 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6672 sections before NOBITS sections.
6673
0db46eb4
L
66742011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6675
6676 * version.cc (print_version): Update copyright to 2011.
6677
829c9745
CC
66782010-12-23 Cary Coutant <ccoutant@google.com>
6679
6680 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6681 of OS to this->add. Add OD parameter to second form of the function.
6682
7500420b
ILT
66832010-12-20 Ian Lance Taylor <iant@google.com>
6684
6685 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6686 second of two consecutive entries with same offset.
6687
f8e9a930
RW
66882010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6689
6690 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6691 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6692 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6693 to avoid unneeded links against $(LDADD).
6694 * testsuite/Makefile.in: Regenerate.
6695
2fbb4320
ILT
66962010-12-15 Ian Lance Taylor <iant@google.com>
6697
6698 PR gold/12324
6699 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6700 for R_X86_64_32 and R_X86_64_PC32.
6701 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6702 ver_matching_def_pic.o.
6703 (ver_matching_def_pic.o): New target.
6704
fedb228d
RW
67052010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6706
6707 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6708 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6709 Move definition before File_read::View member definitions.
6710 (File_read::View::~View): Initialize and hold lock before
6711 updating current_mapped_bytes.
6712
9b547ce6
RW
67132010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6714
6715 * dwarf_reader.cc: Remove outdated comment.
6716 * gold-threads.cc: Fix typo in error message.
6717 * archive.cc: Fix typos in comments.
6718 * archive.h: Likewise.
6719 * arm-reloc-property.cc: Likewise.
6720 * arm-reloc-property.h: Likewise.
6721 * arm-reloc.def: Likewise.
6722 * arm.cc: Likewise.
6723 * attributes.h: Likewise.
6724 * cref.cc: Likewise.
6725 * ehframe.cc: Likewise.
6726 * fileread.h: Likewise.
6727 * gold.h: Likewise.
6728 * i386.cc: Likewise.
6729 * icf.cc: Likewise.
6730 * incremental.h: Likewise.
6731 * int_encoding.cc: Likewise.
6732 * layout.h: Likewise.
6733 * main.cc: Likewise.
6734 * merge.h: Likewise.
6735 * object.cc: Likewise.
6736 * object.h: Likewise.
6737 * options.cc: Likewise.
6738 * readsyms.cc: Likewise.
6739 * reduced_debug_output.cc: Likewise.
6740 * reloc.cc: Likewise.
6741 * script-sections.cc: Likewise.
6742 * sparc.cc: Likewise.
6743 * symtab.h: Likewise.
6744 * target-reloc.h: Likewise.
6745 * target.cc: Likewise.
6746 * target.h: Likewise.
6747 * timer.cc: Likewise.
6748 * timer.h: Likewise.
6749 * x86_64.cc: Likewise.
6750
83e17bd5
CC
67512010-12-09 Cary Coutant <ccoutant@google.com>
6752
6753 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6754 stack.
6755 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6756 parameter; change all callers.
6757 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6758 * options.h (warn_execstack): New option.
6759
017257f8
DK
67602010-12-07 Doug Kwan <dougkwan@google.com>
6761
6762 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6763 like function call relocations.
6764
c20cbc06
ILT
67652010-12-07 Ian Lance Taylor <iant@google.com>
6766
6767 * archive.cc (Archive::get_elf_object_for_member): Permit
6768 punconfigured to be NULL.
6769 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6770 (Archive::include_member): Pass NULL to get_elf_object_for_member
6771 if we searched for the archive and this is the first included
6772 object.
6773
4dbfafcc
ILT
67742010-12-01 Ian Lance Taylor <iant@google.com>
6775
6776 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6777 track_relocs_type_ field.
6778 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6779 Set track_relocs_type_.
6780 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6781 contents when using RELA relocs.
6782 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6783 reloc_map_.
6784 * reloc.cc (Track_relocs::next_addend): New function.
6785 * reloc.h (class Track_relocs): Declare next_addend.
6786
e5e19edd
ILT
67872010-12-01 Ian Lance Taylor <iant@google.com>
6788
6789 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6790 virtual destructor.
6791
9a5ce24c
ILT
67922010-12-01 Ian Lance Taylor <iant@google.com>
6793
6794 * README: Update compilers known to work and fail.
6795
c7791212
NC
67962010-11-23 Matthias Klose <doko@ubuntu.com>
6797
6798 * configure.in: For --enable-gold, handle value `default' instead of
6799 `both*'. Always install ld as ld.bfd, install as ld if gold is
6800 not the default.
6801 * configure: Regenerate.
6802
0ad220c9
DK
68032010-11-18 Doug Kwan <dougkwan@google.com>
6804
6805 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6806 and right_alignment to be zero. Store result alignment only if it is
6807 greater than existing alignment.
6808
ab8056e0
CC
68092010-11-16 Cary Coutant <ccoutant@google.com>
6810
6811 PR gold/12220
6812 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6813 Check for ".zdebug_line".
6814
fd064a5b
CC
68152010-11-16 Doug Kwan <dougkwan@google.com>
6816 Cary Coutant <ccoutant@google.com>
6817
6818 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6819 by reference; adjust all callers.
6820 * output.cc (Output_segment::set_section_addresses): Adjust references
6821 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6822 list is empty.
6823 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6824 end at page boundary.
6825
6fc6ea19
CC
68262010-11-16 Cary Coutant <ccoutant@google.com>
6827
6828 PR gold/12220
6829 * layout.cc (Layout::choose_output_section): Transform names of
6830 compressed sections even when using a script with a SECTIONS clause.
6831 (Layout::output_section_name): Remove code to transform
6832 compressed debug section names.
6833 * output.cc (Output_section::add_input_section): Use uncompressed
6834 section size when tracking input sections.
6835
95a2c8d6
RS
68362010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6837
6838 * symtab.h (Symbol::NON_PIC_REF): Remove.
6839 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6840 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6841 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6842 (Symbol::use_plt_offset): Take a flags argument and pass it
6843 directly to needs_dynamic_reloc. Restrict check for undefined
6844 weak symbols to function calls.
6845 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6846 (Target_arm::Scan::global): Use it.
6847 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6848 (Target_arm::Relocate::relocate): Likewise.
6849 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6850 parameter with an r_type parameter. Use get_reference_flags
6851 to get the flags.
6852 (Target_arm::Relocate::relocate): Update accordingly.
6853 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6854 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6855 (Target_i386::Scan::global): Likewise.
6856 (Target_i386::Relocate::relocate): Likewise.
6857 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6858 parameter with an r_type parameter. Use get_reference_flags
6859 to get the flags.
6860 (Target_i386::Relocate::relocate): Update accordingly.
6861 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6862 (Target_powerpc::Scan::global): Use it.
6863 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6864 (Target_powerpc::Relocate::relocate): Likewise.
6865 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6866 (Target_sparc::Scan::global): Use it.
6867 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6868 (Target_sparc::Relocate::relocate): Likewise.
6869 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6870 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6871 (Target_x86_64::Scan::global): Likewise.
6872 (Target_x86_64::Relocate::relocate): Likewise.
6873
f625ae50
DK
68742010-11-08 Doug Kwan <dougkwan@google.com>
6875 Cary Coutant <ccoutant@google.com>
6876
6877 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6878 (Arm_exidx_merge_section::section_contents_): New data member.
6879 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6880 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6881 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6882 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6883 in parameters instead of calling Object::section_contents without
6884 locking.
6885 (Arm_output_section::group_section): New parameter TASK. Pass it
6886 to callees that need locking objects.
6887 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6888 to lock EXIDX input sections. Fix a formatting issue. Call
6889 Arm_exidx_merged_section::build_contents to create merged section
6890 contents.
6891 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6892 to lock object of stub table owner.
6893 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6894 TEXT_SIZE to initialize data member TEXT_SIZE_.
6895 (Arm_exidx_input_section::addralign): Fix typo in comment.
6896 (Arm_exidx_input_section::text_size): New method.
6897 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6898 that require locking objects. Lock objects before scanning for stubs
6899 and updating local symbols.
6900 (Arm_input_section<big_endian>::init): Copy contents of original
6901 input section.
2e702c99 6902 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6903 original input section instead of calling Object::section_contents
6904 without locking.
6905 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6906 size without calling Object::section_size().
6907 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6908 for size. Allocate a buffer for merged EXIDX entries.
6909 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6910 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6911 building code to Arm_exidx_merged_section::build_contetns. Write
6912 out contetns in buffer instead of building it on the fly.
6913 (Arm_relobj::make_exidx_input_section): Also pass text section size
6914 to Arm_exidx_input_section constructor.
6915 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6916 (Arm_dynobj::do_read_symbols): Fix memory leak.
6917 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6918 * target.h: (class Task): Add forward declaration.
6919 (Target::relax): Add new parameter TASK and pass it to
6920 Target::do_relax().
6921 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6922
5f9bcf58
CC
69232010-11-05 Cary Coutant <ccoutant@google.com>
6924
6925 PR gold/10708
6926 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6927 object when reading from the file.
6928 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6929 second layout pass.
6930 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6931 when reading section contents.
6932 (get_section_contents): Likewise.
6933 (icf::find_identical_sections): Likewise.
6934 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6935 object when reading from the file.
6936 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6937 the object when doing deferred section layout.
6938
e597fa08
NC
69392010-11-03 Nick Clifton <nickc@redhat.com>
6940
6941 PR gold/12001
6942 * script.h (class Symbol_assignment: name): New member. Returns
6943 the name of the symbol.
6944 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6945 Returns true if the given symbol name is on the list of
6946 assignments wating to be processed.
6947 * archive.cc (should_incldue_member): If the symbol is undefined,
6948 check to see if it is on the list of symbols pending assignment.
6949
3f9a3278
ILT
69502010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6951
6952 * script-sections.cc (Script_sections::find_memory_region): Check
6953 for a NULL output section pointer.
6954
d06fb4d1
DK
69552010-10-29 Doug Kwan <dougkwan@google.com>
6956
6957 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6958 Output_section::add_relaxed_input_section.
6959 * output.cc (Output_section::add_relaxed_input_section): Add new
6960 arguments LAYOUT and NAME. Set section order index.
6961 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6962 Copy section order index.
6963 * output.h (Output_section::add_relaxed_input_section): Add new
6964 arguments LAYOUT and NAME.
6965
90e24de5
ILT
69662010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6967
6968 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6969 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6970 * testsuite/Makefile.in: Regenerate.
6971
c9484ea5
DK
69722010-10-20 Doug Kwan <dougkwan@google.com>
6973
6974 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6975 without SHF_LINK_ORDER flags.
6976 * layout.cc (Layout::choose_output_section): Do not filter
6977 SHF_LINK_ORDER flag in a relocatable link.
6978
5bc2f5be
CC
69792010-10-17 Cary Coutant <ccoutant@google.com>
6980
6981 * output.h (Output_segment::set_section_addresses): Change function
6982 signature. Update all callers.
6983 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6984 sections.
6985 (Output_segment::set_section_addresses): Align after last TLS
6986 section. Add padding before last relro section instead of after.
6987
0c91cf04
DK
69882010-10-17 Doug Kwan <dougkwan@google.com>
6989
6990 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6991 GOT output section to be writable.
6992
8c21d9d3
CC
69932010-10-14 Cary Coutant <ccoutant@google.com>
6994
6995 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6996 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6997 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6998 mode.
6999 * incremental.cc (report_command_line): Ignore all forms of
7000 --incremental.
7001 * layout.cc (Layout::Layout): Check parameters for incremental link
7002 mode.
7003 * options.cc (General_options::parse_incremental): New function.
7004 (General_options::parse_no_incremental): New function.
7005 (General_options::parse_incremental_full): New function.
7006 (General_options::parse_incremental_update): New function.
7007 (General_options::incremental_mode_): New data member.
7008 (General_options::finalize): Check incremental_mode_.
7009 * options.h (General_options): Update help text for --incremental.
7010 Add --no-incremental, --incremental-full, --incremental-update.
7011 (General_options::Incremental_mode): New enum type.
7012 (General_options::incremental_mode): New function.
7013 (General_options::incremental_mode_): New data member.
7014 * parameters.cc (Parameters::incremental_mode_): New data member.
7015 (Parameters::set_options): Set incremental_mode_.
7016 (Parameters::set_incremental_full): New function.
7017 (Parameters::incremental): New function.
7018 (Parameters::incremental_update): New function.
7019 (set_parameters_incremental_full): New function.
7020 * parameters.h (Parameters::set_incremental_full): New function.
7021 (Parameters::incremental): New function.
7022 (Parameters::incremental_update): New function.
7023 (Parameters::incremental_mode_): New data member.
7024 (set_parameters_incremental_full): New function.
7025 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7026 incremental link mode.
7027 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7028 (Sized_relobj::do_relocate_sections): Likewise.
7029 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7030 option.
7031 * testsuite/Makefile.in: Regenerate.
7032 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7033
bb32aa18 70342010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7035
7036 * script-sections.h (class Script_sections): Make
7037 Sections_elements typedef public.
7038 * script-sections.cc (class Sort_output_sections): Add elements_
7039 field. Add constructor which sets it; change all callers.
7040 (Sort_output_sections::is_before): New function.
7041 (Sort_output_sections::operator()): Call is_before.
7042 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7043 conditional.
7044 * testsuite/script_test_10.sh: New test. Test script section
7045 order.
7046 * testsuite/script_test_10.t: Likewise.
7047 * testsuite/script_test_10.s: Likewise.
7048 * testsuite/Makefile.am: Wrap the cross linker tests and the
7049 common tests into NATIVE_OR_CROSS_LINKER.
7050 (check_SCRIPTS): Add script_test_10.sh.
7051 (check_DATA): Add script_test_10.stdout.
7052 (script_test_10.o, script_test_10): New targets.
7053 (script_test_10.stdout): New target.
7054 * configure, testsuite/Makefile.in: Regenerate.
7055
3cef7179
ILT
70562010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7057
7058 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7059 error for the deprecated relocations.
7060 (Target_arm::Scan::global): Likewise.
7061 (Target_arm::Relocate::relocate): Likewise.
7062
7411e9a8
RS
70632010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7064
7065 * fileread.cc (Input_file::find_file): Initialize *found_name
7066 and *namep when using the fallback search for case 4.
7067
6a9da32a
CC
70682010-10-11 Cary Coutant <ccoutant@google.com>
7069
7070 * options.h (class General_options): Redefine -z lazy as an alias for
7071 the negation of -z now.
7072
ac897c20
ILT
70732010-10-11 Ian Lance Taylor <iant@google.com>
7074
7075 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7076 binding.
7077
ea5cae92
NC
70782010-10-06 Nick Clifton <nickc@redhat.com>
7079
7080 * script-sections.cc(class Memory_region): Remove
7081 current_lma_offset_ field. Rename current_vma_offset_ to
7082 current_offset_. Add last_section_ field.
7083 (Memory_region::get_current_vma_address): Rename to
7084 get_current_address.
7085 (Memory_region::get_current_lma_address): Delete.
7086 (Memory_region::increment_vma_offset): Rename to
7087 increment_offset.
7088 (Memory_region::increment_lma_offset): Delete.
7089 (Memory_region::attributes_compatible): New method. Returns
7090 true if the provided section is compatible with the region.
7091 (Memory_region::get_last_section): New method. Returns the last
7092 section to use the region.
7093 (Memory_region::set_last_section): New method. Stores the last
7094 section to use the region.
7095 (Script_sections::block_in_region): New method. Returns true if
7096 a block of memory is contained within a region.
7097 (Script_sections::find_memory_region): New method. Locates a
7098 memory region to be used to set a VMA or LMA address.
7099 (Output_section_definition::set_section_addresses): Add code to
7100 check for addresses set by memory regions.
7101 (Output_segment::set_section_addresses): Remove memory region
7102 walking code.
7103 (Script_sections::create_segment): Add a warning if a header
7104 segment is created outside of any region.
7105 * script-sections.h (class Script_sections): Add prototypes for
7106 find_memory_region and block_in_region methods.
7107 * testsuite/memory_test.s: Use .long instead of .word.
7108 * testsuite/memory_test.t: Add some more output sections.
7109 * testsuite/memory_test.sh: Update expected output.
7110
a9bfd952
DK
71112010-10-02 Doug Kwan <dougkwan@google.com>
7112
7113 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7114 defintion to symtab.h
7115 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7116 declaration to defintion.
7117
bacff3ab
NC
71182010-10-01 Nick Clifton <nickc@redhat.com>
7119
7120 * expression.cc (eval): Replace dummy argument with NULL.
7121 (eval_maybe_dot): Check for a NULL result section pointer.
7122 (Symbol_expression::value): Likewise.
7123 (Dot_expression::value): Likewise.
7124 (BINARY_EXPRESSION): Likewise.
7125 (Max_expression::value): Likewise.
7126 (Min_expression::value): Likewise.
7127 (Absolute_expression::value): Likewise.
7128 (Addr_expression::value_from_output_section): Likewise.
7129 (Loaddddr_expression::value_from_output_section): Likewise.
7130 (Segment_start_expression::value): Likewise.
7131 * script-sections.cc
7132 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7133 argument with NULL.
7134 (Sections_elememt_dot_assignment::set_section_addresses):
7135 Likewise.
7136 (Output_data_expression::do_write_to_buffer): Likewise.
7137 (Output_section_definition::finalize_symbols): Likewise.
7138 (Output_section_definition::set_section_addresses): Likewise.
7139
f81bc8b5
DK
71402010-09-30 Doug Kwan <dougkwan@google.com>
7141
7142 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7143
c95e9f27
ST
71442010-09-28 Sriraman Tallam <tmsriram@google.com>
7145
7146 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7147 function.
c95e9f27
ST
7148 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7149 virtual function.
7150 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7151 virtual function.
7152 * icf.cc (get_section_contents): Inline merge sections only when
7153 target allows it.
7154
3cac54d2
RW
71552010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7156
7157 * configure: Regenerate.
7158
2904037a
ILT
71592010-09-17 Ian Lance Taylor <iant@google.com>
7160
7161 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7162 * testsuite/Makefile.am (memory_test.o): New target.
7163 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7164 memory_test.t.
7165 * testsuite/Makefile.in: Rebuild.
2904037a 7166
bca7fb63
DK
71672010-09-17 Doug Kwan <dougkwan@google.com>
7168
7169 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7170 defintion if relocation uses GOT entries of the symbol.
7171 * testsuite/icf_safe_test.sh: Fix test.
7172 * testsuite/icf_safe_so_test.sh: Fix test.
7173
4ef28648
CC
71742010-09-16 Cary Coutant <ccoutant@google.com>
7175
7176 * script_sections.cc (class Memory_region): Remove "NULL" from
7177 vector initializations.
7178
793990de
CC
71792010-09-15 Cary Coutant <ccoutant@google.com>
7180
7181 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7182 Resolve forwarding symbols.
7183
81e015e2
DK
71842010-09-15 Doug Kwan <dougkwan@google.com>
7185
7186 * gold/testsuite/script_test_3.t: Add ARM special sections.
7187 * gold/testsuite/script_test_4.t: Same.
7188 * gold/testsuite/script_test_5.t: Same.
7189 * gold/testsuite/script_test_6.t: Same.
7190 * gold/testsuite/script_test_7.t: Same.
7191 * gold/testsuite/script_test_7.t: Same.
7192 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7193
36171d64
CC
71942010-09-14 Cary Coutant <ccoutant@google.com>
7195
7196 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7197 (Target_x86_64::Relocate::relocate_tls): Replace check for
7198 saw_tls_block_reloc_ with test for executable section.
7199
d89051bd
CC
72002010-09-12 Cary Coutant <ccoutant@google.com>
7201
7202 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7203 position-independent executables to shared libraries need dynamic
7204 relocations.
7205 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7206 position-independent executables.
7207 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7208 * testsuite/Makefile.in: Regenerate.
7209
fca41f0f
NC
72102010-09-10 Nick Clifton <nickc@redhat.com>
7211
7212 PR gold/11997
7213 * testsuite/memory_test.t: Discard any sections that are not
7214 needed.
7215
6695e4b3
L
72162010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7217
7218 PR gold/11996
7219 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7220 "This::" to work around a bug in gcc 4.2.
7221
7222 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7223
0f72bf6f
RÁE
72242010-09-09 Rafael Espindola <espindola@google.com>
7225
7226 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7227 sections with different PF_X flags in the same segment.
7228 (Layout::find_first_load_seg): Search all segments to find the first
7229 one.
7230 * options.h (rosegment): New.
7231
72322010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7233
05a79166 7234 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7235
aa98ff75
DK
72362010-09-08 Doug Kwan <dougkwan@google.com>
7237
7238 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7239 (Arm_relobj::do_relocate_sections): Add new parameter for output
7240 file to match the parent.
7241 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7242 of local symbols instead of input values. Update code to track
7243 changes in gold::relocate_section.
7244 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7245 (Sized_relobj::compute_final_local_value_internal): New methods.
7246 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7247 body into private version of Sized_relobj::compute_final_local_value.
7248 Call the inline method.
7249 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7250 merged symbol value if there is one.
7251 (Symbol_value::has_output_value): New method defintiion.
7252 (Sized_relobj::Compute_final_local_value_status): New enum type.
7253 (Sized_relobj::compute_final_local_value): New methods.
7254 (Sized_relobj::compute_final_local_value_internal): New methods.
7255 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7256 and arm_cortex_a8.sh.
7257 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7258 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7259 New tests.
7260 * Makefile.in: Regenerate.
7261 * testsuite/arm_bl_out_of_range.s: Update test.
7262 * testsuite/thumb_bl_out_of_range.s: Ditto.
7263 * testsuite/thumb_blx_out_of_range.s: Ditto.
7264 * testsuite/arm_branch_out_of_range.sh: New file.
7265 * testsuite/arm_cortex_a8.sh: Ditto.
7266 * testsuite/arm_cortex_a8_b.s: Ditto.
7267 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7268 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7269 * testsuite/arm_cortex_a8_bl.s: Ditto.
7270 * testsuite/arm_cortex_a8_blx.s: Ditto.
7271 * testsuite/arm_cortex_a8_local.s: Ditto.
7272 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7273 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7274
05a79166
L
72752010-09-08 Rafael Espindola <espindola@google.com>
7276
7277 * Makefile.am (memory_test.stdout): Run readelf with -W.
7278 * Makefile.in: Regenerate.
7279 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7280 64 bit output.
7281
33dbc701
RÁE
72822010-09-08 Rafael Espindola <espindola@google.com>
7283
7284 * script-sections.cc (Script_sections::add_memory_region): Convert
7285 field precision to int.
7286 * script.cc (script_set_section_region, script_set_section_region):
7287 Convert field precision to int.
7288
731ca54a
RÁE
72892010-09-08 Rafael Espindola <espindola@google.com>
7290
7291 * arm.cc (do_finalize_sections): Create the __exidx_start and
7292 __exdix_end symbols even when the section is missing.
7293
7f8cd844
NC
72942010-09-08 Nick Clifton <nickc@redhat.com>
7295
7296 * README: Remove claim that MEMORY is not supported.
7297 * expression.cc (script_exp_function_origin)
7298 (script_exp_function_length): Move from here to ...
7299 * script.cc: ... here.
7300 (script_set_section_region, script_add_memory)
7301 (script_parse_memory_attr, script_include_directive): New
7302 functions.
7303 * script-sections.cc
7304 (class Memory_region): New class.
7305 (class Output_section_definition): Add set_memory_region,
7306 set_section_vma, set_section_lma and get_section_name methods.
7307 (class Script_Sections): Add add_memory_region,
7308 find_memory_region, find_memory_region_origin,
7309 find_memory_region_length and set_memory_region methods.
7310 Have set_section_addresses method walk the list of set memory
7311 regions.
7312 Extend the print methos to display memory regions.
7313 * script-sections.h: Add prototypes for new methods.
7314 Add enum for MEMORY region attributes.
7315 * yyscript.y: Add support for parsing MEMORY regions.
7316 * script-c.h: Add prototypes for new functions.
7317 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7318 * testsuite/Makefile.in: Regenerate.
7319 * testsuite/memory_test.sh: New script.
7320 * testsuite/memory_test.s: New assembler source file.
7321 * testsuite/memory_test.t: New linker script.
7322
a4649286
DK
73232010-08-27 Doug Kwan <dougkwan@google.com>
7324
7325 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7326 reference override an existing dynamic weak reference.
7327 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7328 * testsuite/Makefile.in: Regenerate.
7329 * testsuite/dyn_weak_ref.sh: New file.
7330 * testsuite/dyn_weak_ref_1.c: Ditto.
7331 * testsuite/dyn_weak_ref_2.c: Ditto.
7332
b56648ad
ILT
73332010-08-27 Ian Lance Taylor <iant@google.com>
7334
7335 * incremental.h (class Incremental_input_entry): Add virtual
7336 destructor.
7337
809313cb
ILT
73382010-08-27 Ian Lance Taylor <iant@google.com>
7339
7340 * testsuite/start_lib_test_3.c: Mark t3 as used.
7341
11e32464
NC
73422010-08-27 Nick Clifton <nickc@redhat.com>
7343
7344 * options.cc (version_script): Fix small typo in previous
7345 whitespace tidyup.
7346
ca09d69a
NC
73472010-08-25 Nick Clifton <nickc@redhat.com>
7348
7349 * archive.cc: Formatting fixes: Remove whitespace between
7350 typename and following asterisk. Remove whitespace between
7351 function name and opening parenthesis.
7352 * archive.h: Likewise.
7353 * arm.cc: Likewise.
7354 * attributes.cc: Likewise.
7355 * attributes.h: Likewise.
7356 * common.cc: Likewise.
7357 * copy-relocs.cc: Likewise.
7358 * dirsearch.h: Likewise.
7359 * dynobj.cc: Likewise.
7360 * ehframe.cc: Likewise.
7361 * ehframe.h: Likewise.
7362 * expression.cc: Likewise.
7363 * fileread.cc: Likewise.
7364 * fileread.h: Likewise.
7365 * gc.h: Likewise.
7366 * gold-threads.cc: Likewise.
7367 * gold.cc: Likewise.
7368 * i386.cc: Likewise.
7369 * icf.h: Likewise.
7370 * incremental-dump.cc: Likewise.
7371 * incremental.cc: Likewise.
7372 * layout.cc: Likewise.
7373 * layout.h: Likewise.
7374 * main.cc: Likewise.
7375 * merge.cc: Likewise.
7376 * merge.h: Likewise.
7377 * object.cc: Likewise.
7378 * object.h: Likewise.
7379 * options.cc: Likewise.
7380 * options.h: Likewise.
7381 * output.cc: Likewise.
7382 * output.h: Likewise.
7383 * plugin.cc: Likewise.
7384 * plugin.h: Likewise.
7385 * powerpc.cc: Likewise.
7386 * reloc.cc: Likewise.
7387 * script-c.h: Likewise.
7388 * script-sections.cc: Likewise.
7389 * script.cc: Likewise.
7390 * stringpool.cc: Likewise.
7391 * symtab.cc: Likewise.
7392 * symtab.h: Likewise.
7393 * target.cc: Likewise.
7394 * timer.cc: Likewise.
7395 * timer.h: Likewise.
7396 * version.cc: Likewise.
7397 * x86_64.cc: Likewise.
7398
b8fa8750
NC
73992010-08-24 Nick Clifton <nickc@redhat.com>
7400
7401 PR 11899
7402 * layout.cc (segment_precedes): Sort segments by their physical
7403 addresses, if they have been set.
7404
9919d93b
CC
74052010-08-23 Cary Coutant <ccoutant@google.com>
7406
7407 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7408 symbols data.
7409 (Lib_group::include_member): Unlock object after deleting its
7410 symbols data.
7411 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7412 the bug fixed here.
7413
97b4be1c
CC
74142010-08-19 Neil Vachharajani <nvachhar@google.com>
7415 Cary Coutant <ccoutant@google.com>
7416
7417 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7418 constructor, and set_blocker.
7419 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7420 readsyms_blocker_.
7421 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7422 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7423 * testsuite/Makefile.am (start_lib_test): New test case.
7424 * testsuite/Makefile.in: Regenerate.
7425 * testsuite/start_lib_test_main.c: New file.
7426 * testsuite/start_lib_test_1.c: New file.
7427 * testsuite/start_lib_test_2.c: New file.
7428 * testsuite/start_lib_test_3.c: New file.
7429
dd0b1884
ILT
74302010-08-19 Ian Lance Taylor <iant@google.com>
7431
7432 * Makefile.in: Rebuild with automake 1.11.1.
7433 * aclocal.m4: Likewise.
7434 * testsuite/Makefile.in: Likewise.
7435
7223e9ca
ILT
74362010-08-19 Ian Lance Taylor <iant@google.com>
7437
7438 PR 10893
7439 * i386.cc (class Output_data_plt_i386): Update declarations.
7440 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7441 local_ifuncs_ fields.
7442 (Target_i386::do_plt_section_for_global): New function.
7443 (Target_i386::do_plt_section_for_local): New function.
7444 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7445 parameter; change all callers. Initialize global_ifuncs_ and
7446 local_ifuncs_. If doing a static link define __rel_iplt_start and
7447 __rel_iplt_end.
7448 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7449 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7450 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7451 symbols.
7452 (Target_i386::make_plt_section): New function, broken out of
7453 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7454 (Target_i386::make_plt_entry): Call make_plt_section.
7455 (Target_i386::make_local_ifunc_plt_entry): New function.
7456 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7457 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7458 R_386_IRELATIVE to switch.
7459 (Target_i386::Scan::global): Likewise.
7460 (Target_i386::Relocate::relocate): Likewise.
7461 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7462 switch.
7463 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7464 (Target_x86_64::do_plt_section_for_global): New function.
7465 (Target_x86_64::do_plt_section_for_local): New function.
7466 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7467 parameter; change all callers. If doing a static link define
7468 __rela_iplt_start and __rela_iplt_end.
7469 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7470 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7471 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7472 to point to .plt.
7473 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7474 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7475 switch.
7476 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7477 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7478 R_X86_64_IRELATIVE to switch.
7479 (Target_x86_64::Scan::global): Likewise.
7480 (Target_x86_64::Relocate::relocate): Likewise.
7481 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7482 switch.
7483 * target.h (class Target): Add plt_section_for_global and
7484 plt_section_for_local functions. Add do_plt_section_for_global
7485 and do_plt_section_for_local virtual functions.
7486 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7487 clarifying comments.
7488 (Symbol::use_plt_offset): Handle IFUNC symbol.
7489 * object.cc (Sized_relobj::Sized_relobj): Initialize
7490 local_plt_offsets_.
7491 (Sized_relobj::local_has_plt_offset): New function.
7492 (Sized_relobj::local_plt_offset): New function.
7493 (Sized_relobj::set_local_plt_offset): New function.
7494 (Sized_relobj::do_count): Handle IFUNC symbol.
7495 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7496 a bit away from input_shndx_ field. Add set_is_func_symbol and
7497 is_ifunc_symbol functions.
7498 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7499 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7500 local_plt_offsets_ field.
7501 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7502 * output.h (class Output_section_data): Add non-const
7503 output_section function.
7504 (class Output_data_got): Update declarations.
7505 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7506 Add use_plt_offset parameter to global and local constructors.
7507 Change all callers. Change local_sym_index_ field to 31 bits.
7508 Change GSYM_CODE and CONSTANT_CODE accordingly.
7509 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7510 doing a static link don't set sh_link field.
7511 (Output_data_got::Got_entry::write): Use PLT offset if
7512 appropriate.
7513 (Output_data_got::add_global_plt): New function.
7514 (Output_data_got::add_local_plt): New function.
7515 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7516 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7517 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7518 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7519 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7520 IFUNC conditional.
7521 * testsuite/ifunc-sel.h: New file.
7522 * testsuite/ifuncmain1.c: New file.
7523 * testsuite/ifuncmain1vis.c: New file.
7524 * testsuite/ifuncmod1.c: New file.
7525 * testsuite/ifuncdep2.c: New file.
7526 * testsuite/ifuncmain2.c: New file.
7527 * testsuite/ifuncmain3.c: New file.
7528 * testsuite/ifuncmod3.c: New file.
7529 * testsuite/ifuncmain4.c: New file.
7530 * testsuite/ifuncmain5.c: New file.
7531 * testsuite/ifuncmod5.c: New file.
7532 * testsuite/ifuncmain6pie.c: New file.
7533 * testsuite/ifuncmod6.c: New file.
7534 * testsuite/ifuncmain7.c: New file.
7535 * configure, testsuite/Makefile.in: Rebuild.
7536
56f75c03
ILT
75372010-08-18 Ian Lance Taylor <iant@google.com>
7538
7539 * incremental.cc
7540 (Output_section_incremental_inputs::write_input_files): Add cast
7541 to avoid signed/unsigned comparison warning.
7542 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7543
55455f89
CC
75442010-08-12 Cary Coutant <ccoutant@google.com>
7545
7546 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7547
e2054bcb
ILT
75482010-08-13 Ian Lance Taylor <iant@google.com>
7549
7550 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7551
74f67560
DK
75522010-08-12 Cary Coutant <ccoutant@google.com>
7553 Doug Kwan <dougkwan@google.com>
7554
7555 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7556 defintion overrides non-weak undef, remember that the original undef
7557 is not weak.
7558 * symtab.cc (Symbol_table::sized_write_global): For undef without
7559 an original weak binding, set binding to global in output.
7560 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7561 * testsuite/Makefile.in: Regenerate.
7562 * testsuite/strong_ref_weak_def.sh: New file.
7563 * testsuite/strong_ref_weak_def_1.c: Ditto.
7564 * testsuite/strong_ref_weak_def_2.c: Ditto.
7565
d1238d12
CC
75662010-08-12 Cary Coutant <ccoutant@google.com>
7567
7568 * testsuite/incremental_test.sh: Rewrite.
7569 * testsuite/incremental_test_1.c: Rewrite.
7570 * testsuite/incremental_test_2.c: Rewrite.
7571
0e70b911
CC
75722010-08-12 Cary Coutant <ccoutant@google.com>
7573
7574 * arm.cc (Target_arm::got_size): Add const.
7575 (Target_arm::got_entry_count): New function.
7576 (Target_arm::plt_entry_count): New function.
7577 (Target_arm::first_plt_entry_offset): New function.
7578 (Target_arm::plt_entry_size): New function.
7579 (Output_data_plt_arm::entry_count): New function.
7580 (Output_data_plt_arm::first_plt_entry_offset): New function.
7581 (Output_data_plt_arm::get_plt_entry_size): New function.
7582 * i386.cc (Target_i386::got_size): Add const.
7583 (Target_i386::got_entry_count): New function.
7584 (Target_i386::plt_entry_count): New function.
7585 (Target_i386::first_plt_entry_offset): New function.
7586 (Target_i386::plt_entry_size): New function.
7587 (Output_data_plt_i386::entry_count): New function.
7588 (Output_data_plt_i386::first_plt_entry_offset): New function.
7589 (Output_data_plt_i386::get_plt_entry_size): New function.
7590 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7591 find_incremental_inputs_sections. Dump incremental_got_plt section.
7592 * incremental.cc: Include target.h.
7593 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7594 parameter. Adjust all callers. Find incremental_got_plt section.
7595 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7596 section.
7597 (Output_section_incremental_inputs::set_final_data_size): Calculate
7598 size of incremental_got_plt section.
7599 (Output_section_incremental_inputs::do_write): Write the
7600 incremental_got_plt section.
7601 (Got_plt_view_info): New struct.
7602 (Local_got_offset_visitor): New class.
7603 (Global_got_offset_visitor): New class.
7604 (Global_symbol_visitor_got_plt): New class.
7605 (Output_section_incremental_inputs::write_got_plt): New function.
7606 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7607 Add parameter. Adjust all callers.
7608 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7609 (Incremental_inputs::got_plt_section): New function.
7610 (Incremental_inputs::got_plt_section_): New data member.
7611 (Incremental_got_plt_reader): New class.
7612 * layout.cc (Layout::create_incremental_info_sections): Add the
7613 incremental_got_plt section.
7614 * object.h (Got_offset_list::get_list): New function.
7615 (Got offset_list::for_all_got_offsets): New function.
7616 (Sized_relobj::local_got_offset_list): New function.
7617 * powerpc.cc (Target_powerpc::got_size): Add const.
7618 (Target_powerpc::got_entry_count): New function.
7619 (Target_powerpc::plt_entry_count): New function.
7620 (Target_powerpc::first_plt_entry_offset): New function.
7621 (Target_powerpc::plt_entry_size): New function.
7622 (Output_data_plt_powerpc::entry_count): New function.
7623 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7624 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7625 * sparc.cc (Target_sparc::got_size): Add const.
7626 (Target_sparc::got_entry_count): New function.
7627 (Target_sparc::plt_entry_count): New function.
7628 (Target_sparc::first_plt_entry_offset): New function.
7629 (Target_sparc::plt_entry_size): New function.
7630 (Output_data_plt_sparc::entry_count): New function.
7631 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7632 (Output_data_plt_sparc::get_plt_entry_size): New function.
7633 * symtab.h (Symbol::got_offset_list): New function.
7634 (Symbol_table::for_all_symbols): New function.
7635 * target.h (Sized_target::got_entry_count): New function.
7636 (Sized_target::plt_entry_count): New function.
7637 (Sized_target::plt_entry_size): New function.
7638 * x86_64.cc (Target_x86_64::got_size): Add const.
7639 (Target_x86_64::got_entry_count): New function.
7640 (Target_x86_64::plt_entry_count): New function.
7641 (Target_x86_64::first_plt_entry_offset): New function.
7642 (Target_x86_64::plt_entry_size): New function.
7643 (Output_data_plt_x86_64::entry_count): New function.
7644 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7645 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7646
09ec0418
CC
76472010-08-12 Cary Coutant <ccoutant@google.com>
7648
7649 * archive.cc: Include incremental.h.
7650 (Archive::Archive): Initialize incremental_info_.
7651 (Archive::include_member): Record archive members in incremental info.
7652 (Add_archive_symbols::run): Record begin and end of an archive in
7653 incremental info.
7654 (Lib_group::include_member): Record objects in incremental info.
7655 * archive.h (Incremental_archive_entry): Forward declaration.
7656 (Archive::set_incremental_info): New member function.
7657 (Archive::incremental_info): New member function.
7658 (Archive::Unused_symbol_iterator): New class.
7659 (Archive::unused_symbols_begin): New member function.
7660 (Archive::unused_symbols_end): New member function.
7661 (Archive::incremental_info_): New data member.
7662 * incremental-dump.cc (find_input_containing_global): New function.
7663 (dump_incremental_inputs): Dump new incremental info sections.
7664 * incremental.cc: Include symtab.h.
7665 (Output_section_incremental_inputs): New class.
7666 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7667 new incremental info sections.
7668 (Sized_incremental_binary::do_check_inputs): Likewise.
7669 (Incremental_inputs::report_archive): Remove.
7670 (Incremental_inputs::report_archive_begin): New function.
7671 (Incremental_inputs::report_archive_end): New function.
7672 (Incremental_inputs::report_object): New function.
7673 (Incremental_inputs::finalize_inputs): Remove.
7674 (Incremental_inputs::report_input_section): New function.
7675 (Incremental_inputs::report_script): Rewrite.
7676 (Incremental_inputs::finalize): Do nothing but finalize string table.
7677 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7678 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7679 (Incremental_inputs::create_data_sections): New function.
7680 (Incremental_inputs::relocs_entsize): New function.
7681 (Output_section_incremental_inputs::set_final_data_size): New function.
7682 (Output_section_incremental_inputs::do_write): New function.
7683 (Output_section_incremental_inputs::write_header): New function.
7684 (Output_section_incremental_inputs::write_input_files): New function.
7685 (Output_section_incremental_inputs::write_info_blocks): New function.
7686 (Output_section_incremental_inputs::write_symtab): New function.
7687 * incremental.h (Incremental_script_entry): Forward declaration.
7688 (Incremental_object_entry): Forward declaration.
7689 (Incremental_archive_entry): Forward declaration.
7690 (Incremental_inputs): Forward declaration.
7691 (Incremental_inputs_header_data): Remove.
7692 (Incremental_inputs_header): Remove.
7693 (Incremental_inputs_header_write): Remove.
7694 (Incremental_inputs_entry_data): Remove.
7695 (Incremental_inputs_entry): Remove.
7696 (Incremental_inputs_entry_write): Remove.
7697 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7698 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7699 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7700 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7701 Likewise.
7702 (Incremental_input_entry): New class.
7703 (Incremental_script_entry): New class.
7704 (Incremental_object_entry): New class.
7705 (Incremental_archive_entry): New class.
7706 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7707 (Incremental_inputs::report_inputs): Remove.
7708 (Incremental_inputs::report_archive): Remove.
7709 (Incremental_inputs::report_archive_begin): New function.
7710 (Incremental_inputs::report_archive_end): New function.
7711 (Incremental_inputs::report_object): Change prototype.
7712 (Incremental_inputs::report_input_section): New function.
7713 (Incremental_inputs::report_script): Change prototype.
7714 (Incremental_inputs::get_reloc_count): New function.
7715 (Incremental_inputs::set_reloc_count): New function.
7716 (Incremental_inputs::create_data_sections): New function.
7717 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7718 (Incremental_inputs::inputs_section): New function.
7719 (Incremental_inputs::symtab_section): New function.
7720 (Incremental_inputs::relocs_section): New function.
7721 (Incremental_inputs::get_stringpool): Add const.
7722 (Incremental_inputs::command_line): Add const.
7723 (Incremental_inputs::inputs): Remove.
7724 (Incremental_inputs::command_line_key): New function.
7725 (Incremental_inputs::input_file_count): New function.
7726 (Incremental_inputs::input_files): New function.
7727 (Incremental_inputs::relocs_entsize): New function.
7728 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7729 (Incremental_inputs::finalize_inputs): Remove.
7730 (Incremental_inputs::Input_info): Remove.
7731 (Incremental_inputs::lock_): Remove.
7732 (Incremental_inputs::inputs_): Change type.
7733 (Incremental_inputs::inputs_map_): Remove.
7734 (Incremental_inputs::current_object_entry_): New data member.
7735 (Incremental_inputs::inputs_section_): New data member.
7736 (Incremental_inputs::symtab_section_): New data member.
7737 (Incremental_inputs::relocs_section_): New data member.
7738 (Incremental_inputs::reloc_count_): New data member.
7739 (Incremental_inputs_reader): New class.
7740 (Incremental_symtab_reader): New class.
7741 (Incremental_relocs_reader): New class.
7742 * layout.cc (Layout::finalize): Move finalization of incremental info
7743 and creation of incremental info sections to follow finalization of
7744 symbol table. Set offsets for postprocessing sections.
7745 (Layout::create_incremental_info_sections): Call
7746 Incremental_inputs::create_data_sections. Add incremental symtab
7747 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7748 sections to layout after input sections.
7749 * layout.h (struct Timespec): Forward declaration.
7750 (Layout::incremental_inputs): Add const.
7751 (Layout::create_incremental_info_sections): Add parameter.
7752 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7753 * object.cc: Include incremental.h.
7754 (Relobj::finalize_incremental_relocs): New function.
7755 (Sized_relobj::do_layout): Record input sections in incremental info.
7756 * object.h (Object::output_section): New function.
7757 (Object::output_section_offset): Moved from Relobj.
7758 (Object::get_incremental_reloc_base): New function.
7759 (Object::get_incremental_reloc_count): New function.
7760 (Object::do_output_section): New function.
7761 (Object::do_output_section_offset): Moved from Relobj.
7762 (Object::do_get_incremental_reloc_base): New function.
7763 (Object::do_get_incremental_reloc_count): New function.
7764 (Object::Object): Initialize new data members.
7765 (Relobj::output_section): Renamed do_output_section and moved to
7766 protected.
7767 (Relobj::output_section_offset): Moved to Object.
7768 (Relobj::do_get_incremental_reloc_base): New function.
7769 (Relobj::do_get_incremental_reloc_count): New function.
7770 (Relobj::allocate_incremental_reloc_counts): New function.
7771 (Relobj::count_incremental_reloc): New function.
7772 (Relobj::finalize_incremental_relocs): New function.
7773 (Relobj::next_incremental_reloc_index): New function.
7774 (Relobj::reloc_counts_): New data member.
7775 (Relobj::reloc_bases_): New data member.
7776 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7777 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7778 (Sized_relobj::incremental_relocs_scan): New function.
7779 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7780 (Sized_relobj::incremental_relocs_write): New function.
7781 (Sized_relobj::incremental_relocs_write_reltype): New function.
7782 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7783 incremental link.
7784 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7785 archives and object files elsewhere.
7786 (Add_symbols::run): Report object files here.
7787 (Finish_group::run): Report end of archive at end of group.
7788 * reloc.cc: Include layout.h, incremental.h.
7789 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7790 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7791 (Sized_relobj::incremental_relocs_scan): New function.
7792 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7793 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7794 (Sized_relobj::incremental_relocs_write): New function.
7795 (Sized_relobj::incremental_relocs_write_reltype): New function.
7796 * script.cc (read_input_script): Rewrite test for incremental link.
7797 Change call to Incremental_inputs::report_script.
7798 * symtab.h (Symbol_table::first_global_index): New function.
7799 (Symbol_table::output_count): New function.
7800
ce0d1972
DK
78012010-08-12 Doug Kwan <dougkwan@google.com>
7802
7803 * arm.cc (Target_arm::merge_object_attributes): Check command line
7804 options --no-wchar-size-warning and --no-enum-size-warning.
7805 * options.h (General_options): Add ld-compatible options
7806 --no-enum-size-warning and --no-wchar-size-warning.
7807
6e5710ce
ILT
78082010-08-04 Ian Lance Taylor <iant@google.com>
7809
7810 * x86_64.cc (Target_x86_64::Scan::local): Use
7811 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7812 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7813 (Target_x86_64::Scan::global): Likewise.
7814 (Target_x86_64::Relocate::relocate): Likewise.
7815 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7816 Likewise.
7817
fef830db
CC
78182010-08-03 Cary Coutant <ccoutant@google.com>
7819
7820 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7821 to reserve space in merged_strings vector. Keep total input size
7822 for stats.
7823 (Output_merge_string::do_print_merge_stats): Print total input size.
7824 * merge.h (Output_merge_string): Add input_size_ field.
7825 * stringpool.cc (Stringpool_template::string_length): Move
7826 implementations out of Stringpool_template class and place in
7827 stringpool.h.
7828 * stringpool.h (string_length): Move out of Stringpool_template.
7829
1e3811b0
ILT
78302010-08-03 Ian Lance Taylor <iant@google.com>
7831
7832 PR 11712
7833 * layout.cc (relaxation_loop_body): If address of load segment is
7834 set, adjust address to include headers if possible.
7835
7af0c620
ILT
78362010-08-03 Ian Lance Taylor <iant@google.com>
7837
7838 * version.cc (version_string): Bump to 1.10.
7839
22f0da72
ILT
78402010-08-03 Ian Lance Taylor <iant@google.com>
7841
7842 PR 11805
7843 * layout.h (enum Output_section_order): Define.
7844 (class Layout): Update declarations.
7845 * layout.cc (Layout::get_output_section): Add order parameter.
7846 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7847 is_first_non_relro parameters. Change all callers.
7848 (Layout::choose_output_section): Likewise.
7849 (Layout::add_output_section_data): Likewise.
7850 (Layout::make_output_section): Likewise. Set order.
7851 (Layout::default_section_order): New function.
7852 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7853 * output.cc (Output_section::Output_section): Initialize order_.
7854 Don't initialize deleted fields.
7855 (Output_segment::Output_segment): Don't initialize deleted
7856 fields.
7857 (Output_segment::add_output_section_to_load): New function
7858 replacing add_output_section. Change all callers to call this or
7859 add_output_section_to_nonload.
7860 (Output_segment::add_output_section_to_nonload): New function.
7861 (Output_segment::remove_output_section): Rewrite.
7862 (Output_segment::add_initial_output_data): Likewise.
7863 (Output_segment::has_any_data_sections): Likewise.
7864 (Output_segment::is_first_section_relro): Likewise.
7865 (Output_segment::maximum_alignment): Likewise.
7866 (Output_segment::has_dynamic_reloc): New function replacing
7867 dynamic_reloc_count. Change all callers.
7868 (Output_segment::has_dynamic_reloc_list): New function replacing
7869 dynamic_reloc_count_list. Change all callers.
7870 (Output_segment::set_section_addresses): Rewrite.
7871 (Output_segment::set_offset): Rewrite.
7872 (Output_segment::find_first_and_last_list): Remove.
7873 (Output_segment::set_tls_offsets): Rewrite.
7874 (Output_segment::first_section_load_address): Likewise.
7875 (Output_segment::output_section_count): Likewise.
7876 (Output_segment::section_with_lowest_load_address): Likewise.
7877 (Output_segment::write_section_headers): Likewise.
7878 (Output_segment::print_sections_to_map): Likewise.
7879 * output.h (class Output_data): Remove dynamic_reloc_count_
7880 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7881 (Output_data::add_dynamic_reloc): Rewrite.
7882 (Output_data::has_dynamic_reloc): New function.
7883 (Output_data::dynamic_reloc_count): Remove.
7884 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7885 is_last_relro_, is_first_non_relro_, is_interp_,
7886 is_dynamic_linker_section_ fields. Add order and set_order
7887 functions. Remove is_relro_local, set_is_relro_local,
7888 is_last_relro, set_is_last_relro, is_first_non_relro,
7889 set_is_first_non_relro functions, is_interp, set_is_interp,
7890 is_dynamic_linker_section, and set_is_dynamic_linker_section
7891 functions.
7892 (class Output_segment): Change Output_data_list from std::list to
7893 std:;vector. Add output_lists_ field. Remove output_data_ and
7894 output_bss_ fields. Update declarations.
7895
3ff2ccb0
ILT
78962010-08-02 Ian Lance Taylor <iant@google.com>
7897
7898 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7899 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7900 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7901
88a4108b
ILT
79022010-08-02 Ian Lance Taylor <iant@google.com>
7903
7904 PR 11855
7905 * script.cc (Script_options::Script_options): Initialize
7906 symbol_definitions_ and symbol_references_.
7907 (Script_options::add_symbol_assignment): Update
7908 symbol_definitions_ and symbol_references_.
7909 (Script_options::add_symbol_reference): New function.
7910 (script_symbol): New function.
7911 * script.h (class Script_options): Add symbol_definitions_ and
7912 symbol_references_ fields.
7913 (Script_options::referenced_const_iterator): New type.
7914 (Script_options::referenced_begin): New function.
7915 (Script_options::referenced_end): New function.
7916 (Script_options::is_referenced): New function.
7917 (Script_options::any_unreferenced): New function.
7918 * script-c.h (script_symbol): Declare.
7919 * yyscript.y (exp): Call script_symbol.
7920 * symtab.cc: Include "script.h".
7921 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7922 Change all callers. Check symbols referenced by scripts.
7923 (Symbol_table::add_undefined_symbols_from_command_line): Add
7924 layout parameter. Change all callers.
7925 (Symbol_table::do_add_undefined_symbols_from_command_line):
7926 Likewise. Break out loop body. Check symbols referenced by
7927 scripts.
7928 (Symbol_table::add_undefined_symbol_from_command_line): New
7929 function broken out of
7930 do_add_undefined_symbols_from_command_line.
7931 * symtab.h (class Symbol_table): Update declarations.
7932 * archive.cc: Include "layout.h".
7933 (Archive::should_include_member): Add layout parameter. Change
7934 all callers. Check for symbol mentioned in expression.
7935 * archive.h (class Archive): Update declaration.
7936 * object.cc (Sized_relobj::do_should_include_member): Add layout
7937 parameter.
7938 * object.h (Object::should_include_member): Add layout parameter.
7939 Change all callers.
7940 (Object::do_should_include_member): Add layout parameter.
7941 (class Sized_relobj): Update declaration.
7942 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7943 parameter.
7944 * dynobj.h (class Sized_dynobj): Update declaration.
7945 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7946 layout parameter.
7947 * plugin.h (class Sized_pluginobj): Update declaration.
7948
5f1ab67a
ILT
79492010-08-02 Ian Lance Taylor <iant@google.com>
7950
7951 PR 11866
7952 * output.cc (Output_segment::set_offset): Search for the first and
7953 last sections rather than assuming that the list is in order.
7954 (Output_segment::find_first_and_last_list): New function.
7955 * output.h (class Output_segment): Update declarations.
7956 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7957 (relro_strip_test_SOURCES): New variable.
7958 (relro_strip_test_DEPENDENCIES): New variable.
7959 (relro_strip_test_LDFLAGS): New variable.
7960 (relro_strip_test_LDADD): New variable.
7961 (relro_strip_test.so): New target.
7962
a8df5856
ILT
79632010-08-02 Ian Lance Taylor <iant@google.com>
7964
7965 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7966 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7967 (Target_i386::got_tlsdesc_section): New function.
7968 (Target_i386::got_section): Create space for GOT entries for
7969 TLSDESC relocations.
7970 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7971 R_386_TLS_GOTDESC.
7972 (Target_i386::Scan::global): Likewise.
7973 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7974 using TLSDESC GOT.
7975 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7976 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7977 (Target_x86_64::got_tlsdesc_section): New function.
7978 (Target_x86_64::got_section): Create space for GOT entries for
7979 TLSDESC relocations.
7980 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7981 R_386_TLS_GOTDESC.
7982 (Target_x86_64::Scan::global): Likewise.
7983 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7984 using TLSDESC GOT.
7985
0c10a0a6
ILT
79862010-08-02 Ian Lance Taylor <iant@google.com>
7987
7988 * testsuite/final_layout.sh: Use dc to convert from hex to
7989 decimal.
7990
41cbeecc
ST
79912010-07-29 Sriraman Tallam <tmsriram@google.com>
7992
7993 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7994 paramter to the call to gold::gc_process_relocs.
7995 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7996 paramter to the call to gold::gc_process_relocs.
7997 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7998 parameter to the call to gold::gc_process_relocs.
7999 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8000 template parameter to the call to gold::gc_process_relocs.
8001 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8002 paramter to the call to gold::gc_process_relocs.
8003 * gc.h (get_embedded_addend_size): New function.
8004 (gc_process_relocs): Save the size of the reloc for use by ICF.
8005 * icf.cc (get_section_contents): Get the addend from the text section
8006 for SHT_REL relocation sections.
8007 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8008 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8009 * int_encoding.h (read_from_pointer): New overloaded function.
8010 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8011 * testsuite/icf_sht_rel_addend_test.sh: New file.
8012 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8013 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8014
6ea55b82
RW
80152010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8016
8017 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8018 * Makefile.in: Regenerate.
8019 * testsuite/Makefile.in: Regenerate.
8020
9691462b
ILT
80212010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8022
8023 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8024 * gold/testsuite/debug_msg.cc: Likewise.
8025 * gold/testsuite/odr_violation1.cc
8026 * gold/testsuite/odr_violation2.cc
8027
76897331
CC
80282010-07-21 Cary Coutant <ccoutant@google.com>
8029
8030 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8031 string, and length fields.
8032 (Output_merge_string::Merged_strings_list): New type.
8033 (Output_merge_string::Merged_strings_lists): New typedef.
8034 (Output_merge_string): Replace merged_strings_ with
8035 merged_strings_lists_.
8036 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8037 Merged_strings_list per input object and section. Don't store pointer
8038 to the string. Don't store length with each merged string entry.
8039 (Output_merge_string::finalize_merged_data): Loop over list of merged
8040 strings lists. Recompute length of each merged string.
8041
78384e8f
CC
80422010-07-15 Cary Coutant <ccoutant@google.com>
8043
8044 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8045 here.
8046
783659f9
ILT
80472010-07-14 Ian Lance Taylor <iant@google.com>
8048
8049 * descriptors.cc (Descriptors::open): Report correct name in error
8050 message.
8051
131687b4
DK
80522010-07-13 Doug Kwan <dougkwan@google.com>
8053
8054 * arm.cc (Arm_input_section::Arm_input_section): For a
8055 SHT_ARM_EXIDX section, always keeps the input sections.
8056 (Arm_input_section::set_exidx_section_link): New method.
8057 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8058 has_errors_ to false.
8059 (Arm_exidx_input_section::has_errors,
8060 Arm_exidx_input_section::set_has_errors): New methods.
8061 (Arm_exidx_input_section::has_errors_): New data member.
8062 (Arm_relobj::get_exidx_shndx_list): New method.
8063 (Arm_output_section::append_text_sections_to_list): Do not skip
8064 section without SHF_EXECINSTR.
8065 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8066 errors.
2e702c99 8067 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8068 section header. Make error messages more verbose. Check for
8069 a non-executable section linked to an EXIDX section.
8070 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8071 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8072 check that there is no deferred EXIDX section if we exit early.
8073 Instead of not making an EXIDX section in case of an error, make one
8074 and set the has_errors flag of it.
8075 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8076 in a relocatable link.
8077 (Target_arm::do_relax): Look for the EXIDX output section instead of
8078 assuming that it is called .ARM.exidx.
2e702c99 8079 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8080 section list. Do not check for SHF_EXECINSTR section flags but
8081 skip any input section with errors.
8082 * output.cc (Output_section::Output_section): Initialize
8083 always_keeps_input_sections_ to false.
8084 (Output_section::add_input_section): Check for
8085 always_keeps_input_sections_.
8086 * output.h (Output_section::always_keeps_input_sections,
8087 Output_section::set_always_keeps_input_sections): New methods.
8088 (Output_section::always_keeps_input_sections): New data member.
8089
69517287
RÁE
80902010-07-13 Rafael Espindola <espindola@google.com>
8091
8092 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8093 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8094
82742395
ILT
80952010-07-13 Philip Herron <herron.philip@googlemail.com>
8096 Ian Lance Taylor <iant@google.com>
8097
8098 * output.h (Output_section_lookup_maps::add_merge_section):
8099 Correct check of whether value was inserted.
8100 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8101 (Output_section_lookup_maps::add_relaxed_input_section):
8102 Likewise.
8103 * arm.cc (Target_arm::got_section): Remove used local os.
8104 * i386.cc (Target_i386::got_section): Likewise.
8105 * x86_64.cc (Target_x86_64::got_section): Likewise.
8106 * sparc.cc (Target_sparc::got_section): Likewise.
8107 (Target_sparc::relocate): Remove unused local have_got_offset.
8108 * powerpc.cc (Target_powerpc::relocate): Likewise.
8109
f2d707b5
ILT
81102010-07-13 Ian Lance Taylor <iant@google.com>
8111
241531d6
ILT
8112 * compressed_output.cc (zlib_decompress): Fix signature in
8113 !HAVE_ZLIB_H case.
8114
f2d707b5
ILT
8115 * archive.cc (Archive::include_member): Unlock an external member
8116 of a thin archive. Don't bother to delete an object we know is
8117 NULL.
8118
a2e47362
CC
81192010-07-12 Cary Coutant <ccoutant@google.com>
8120
8121 * compressed_output.cc (zlib_decompress): New function.
8122 (get_uncompressed_size): New function.
8123 (decompress_input_section): New function.
8124 * compressed_output.h (get_uncompressed_size): New function.
8125 (decompress_input_section): New function.
8126 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8127 Handle compressed debug sections.
8128 * layout.cc (is_compressed_debug_section): New function.
8129 (Layout::output_section_name): Map compressed section names to
8130 canonical names.
8131 * layout.h (is_compressed_debug_section): New function.
8132 (is_debug_info_section): Recognize compressed debug sections.
8133 * merge.cc: Include compressed_output.h.
8134 (Output_merge_data::do_add_input_section): Handle compressed
8135 debug sections.
8136 (Output_merge_string::do_add_input_section): Handle compressed
8137 debug sections.
8138 * object.cc: Include compressed_output.h.
8139 (Sized_relobj::Sized_relobj): Initialize new data members.
8140 (build_compressed_section_map): New function.
8141 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8142 * object.h (Object::section_is_compressed): New method.
8143 (Object::do_section_is_compressed): New method.
8144 (Sized_relobj::Compressed_section_map): New type.
8145 (Sized_relobj::do_section_is_compressed): New method.
8146 (Sized_relobj::compressed_sections_): New data member.
8147 * output.cc (Output_section::add_input_section): Handle compressed
8148 debug sections.
8149 * reloc.cc: Include compressed_output.h.
8150 (Sized_relobj::write_sections): Handle compressed debug sections.
8151
ce279a62
CC
81522010-07-08 Cary Coutant <ccoutant@google.com>
8153
8154 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8155 weak when resolving to a dynamic def.
8156 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8157 for weak undef/dynamic def cases. Adjust callers.
8158 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8159 undef_binding_weak_.
8160 (Symbol_table::sized_write_globals): Adjust symbol binding.
8161 (Symbol_table::sized_write_symbol): Add binding parameter.
8162 * symtab.h (Symbol::set_undef_binding): New method.
8163 (Symbol::is_undef_binding_weak): New method.
8164 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8165 (Symbol_table::should_override): Add new parameter.
8166 (Symbol_table::sized_write_symbol): Add new parameter.
8167
8168 * testsuite/weak_undef_file1.cc: Add new test case.
8169 * testsuite/weak_undef_file2.cc: Fix header comment.
8170 * testsuite/weak_undef_test.cc: Add new test case.
8171
b2286c10
DK
81722010-06-29 Doug Kwan <dougkwan@google.com>
8173
8174 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8175 Initialize USE_SYMBOL_.
8176 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8177 definition.
8178 (Arm_reloc_property::uses_symbol_): New data member declaration.
8179 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8180 uses symbol value and symbol is undefined but not weakly undefined.
8181
4802450a
RÁE
81822010-06-28 Rafael Espindola <espindola@google.com>
8183
8184 * plugin.cc (Plugin::load): Use dlerror.
8185
e5ca47ba
ILT
81862010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8187
8188 * symtab.cc (detect_odr_violations): When reporting an ODR
8189 violation, report an object where the symbol is defined.
8190
8a75a161
DK
81912010-06-25 Doug Kwan <dougkwan@google.com>
8192
8193 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8194 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8195 definition.
8196 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8197 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8198 target hook to detect function points.
8199 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8200 * icf.h (Icf::check_section_for_function_pointers): Change type of
8201 parameter SECTION_NAME to const reference to std::string. Use
8202 target hook to determine if section may have unsafe pointers.
8203 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8204 method definition.
8205
42218b9f
RÁE
82062010-06-21 Rafael Espindola <espindola@google.com>
8207
8208 * fileread.cc (Input_file::find_fie): New
8209 (Input_file::open): Use Input_file::find_fie.
8210 * fileread.h (Input_file::find_fie): New
8211 * plugin.cc (set_extra_library_path): New.
8212 (Plugin::load): Add set_extra_library_path to the transfer vector.
8213 (Plugin_manager::set_extra_library_path): New.
8214 (Plugin_manager::add_input_file): Use the extra search path if set.
8215 (set_extra_library_path(): New.
8216 * plugin.h (Plugin_manager): Add set_extra_library_path and
8217 extra_search_path_.
8218
a0506cca
CC
82192010-06-19 Cary Coutant <ccoutant@google.com>
8220
8221 * layout.cc (gdb_sections): Add .debug_types.
8222 (lines_only_debug_sections): Likewise.
8223
6508b958
RÁE
82242010-06-18 Rafael Espindola <espindola@google.com>
8225
8226 * plugin.cc (add_input_file,add_input_library)
8227 (Plugin_manager::add_input_file): Make filename arguments const.
8228 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8229 const.
8230
3e235302
DK
82312010-06-16 Doug Kwan <dougkwan@google.com>
8232
8233 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8234 .ARM.attributes section if we have not merged any input
8235 attributes sections.
8236
106e8a6c
DK
82372010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8238
8239 * arm.cc: Allow combining objects with no EABI version
8240 information.
8241
91ff43fe
RÁE
82422010-06-15 Rafael Espindola <espindola@google.com>
8243
8244 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8245
68ed838c
ILT
82462010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8247
8248 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8249 (struct iovec): Correct !HAVE_READV definition.
8250
f3a2388f
CC
82512010-06-10 Cary Coutant <ccoutant@google.com>
8252
8253 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8254 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8255 reloc sections.
8256 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8257
8258 PR 11683
8259 * symtab.h (Symbol::is_placeholder): New member function.
8260 * target-reloc.h (relocate_section): Check for placeholder symbols.
8261
8262 * testsuite/Makefile.am (plugin_test_8): New test.
8263 (plugin_test_9): New test.
8264 * testsuite/Makefile.in: Regenerate.
8265
e1df38aa
NC
82662010-06-09 Nick Clifton <nickc@redhat.com>
8267
8268 * yyscript.y (input_list_element): Allow strings prefixed with
8269 the '-' character. Treat these as libraries.
8270 * script.cc (script_add_library): New function. Adds a library
8271 specified by "-l<name>" found in an input script.
8272 * script-c.h: Add prototype for script_add_library.
8273
25bbe950
DK
82742010-06-07 Doug Kwan <dougkwan@google.com>
8275
8276 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8277 Restrict stub-group size to be within long conditional branch
8278 range when working around cortex-A8 erratum.
8279
0f32ea4c
ILT
82802010-06-07 Damien Diederen <dd@crosstwine.com>
8281
8282 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8283 #ifdef typo.
8284
8fe2a369
ST
82852010-06-03 Sriraman Tallam <tmsriram@google.com>
8286
8287 PR gold/11658
8288 * output.cc
8289 (Output_section::Input_section_sort_entry::compare_section_ordering):
8290 Change to return non-zero correctly.
8291 (Output_section::Input_section_sort_section_order_index_compare
8292 ::operator()): Change to fix ambiguity in comparisons.
8293
6e9ba2ca
ST
82942010-06-01 Sriraman Tallam <tmsriram@google.com>
8295
8296 * gold.h (is_wildcard_string): New function.
8297 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8298 (Layout::layout_eh_frame): Ditto.
8299 (Layout::find_section_order_index): New method.
8300 (Layout::read_layout_from_file): New method.
8301 * layout.h (Layout::find_section_order_index): New method.
8302 (Layout::read_layout_from_file): New method.
8303 (Layout::input_section_position_): New private member.
8304 (Layout::input_section_glob_): New private member.
8305 * main.cc (main): Call read_layout_from_file here.
8306 * options.h (--section-ordering-file): New option.
8307 * output.cc (Output_section::input_section_order_specified_): New
8308 member.
8309 (Output_section::Output_section): Initialize new member.
8310 (Output_section::add_input_section): Add new parameter.
8311 Keep input sections when --section-ordering-file is used.
8312 (Output_section::set_final_data_size): Sort input sections when
8313 section ordering file is specified.
8314 (Output_section::Input_section_sort_entry): Add new parameter.
8315 Check sorting type.
8316 (Output_section::Input_section_sort_entry::compare_section_ordering):
8317 New method.
8318 (Output_section::Input_section_sort_compare::operator()): Change to
8319 consider section_order_index.
8320 (Output_section::Input_section_sort_init_fini_compare::operator()):
8321 Change to consider section_order_index.
8322 (Output_section::Input_section_sort_section_order_index_compare
8323 ::operator()): New method.
8324 (Output_section::sort_attached_input_sections): Change to sort
8325 according to section order when specified.
e1df38aa
NC
8326 (Output_section::add_input_section<32, true>): Add new parameter.
8327 (Output_section::add_input_section<64, true>): Add new parameter.
8328 (Output_section::add_input_section<32, false>): Add new parameter.
8329 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8330 * output.h (Output_section::add_input_section): Add new parameter.
8331 (Output_section::input_section_order_specified): New
8332 method.
8333 (Output_section::set_input_section_order_specified): New method.
8334 (Input_section::Input_section): Initialize section_order_index_.
8335 (Input_section::section_order_index): New method.
8336 (Input_section::set_section_order_index): New method.
8337 (Input_section::section_order_index_): New member.
8338 (Input_section::Input_section_sort_section_order_index_compare): New
8339 struct.
8340 (Output_section::input_section_order_specified_): New member.
8341 * script-sections.cc (is_wildcard_string): Delete and move modified
8342 method to gold.h.
8343 (Output_section_element_input::Output_section_element_input): Modify
8344 call to is_wildcard_string.
8345 (Output_section_element_input::Input_section_pattern
8346 ::Input_section_pattern): Ditto.
8347 (Output_section_element_input::Output_section_element_input): Ditto.
8348 * testsuite/Makefile.am (final_layout): New test case.
8349 * testsuite/Makefile.in: Regenerate.
8350 * testsuite/final_layout.cc: New file.
8351 * testsuite/final_layout.sh: New file.
8352
3537c84b
RÁE
83532010-06-01 Rafael Espindola <espindola@google.com>
8354
8355 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8356
105b6afd
RÁE
83572010-06-01 Rafael Espindola <espindola@google.com>
8358
8359 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8360 visibility of symbols.
8361
29e11421
DK
83622010-05-27 Doug Kwan <dougkwan@google.com>
8363
8364 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8365 from start of output section instead of address for a local symbol
8366 in a merged or relaxed section when doing a relocatable link.
8367
5e0f337e
RÁE
83682010-05-26 Rafael Espindola <espindola@google.com>
8369
703d02da 8370 PR 11604
5e0f337e
RÁE
8371 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8372 adding sections the garbage collector removed.
8373 * gold/testsuite/Makefile.am: Add test.
8374 * gold/testsuite/Makefile.in: Regenerate.
8375 * gold/testsuite/plugin_test_7.sh: New.
8376 * gold/testsuite/plugin_test_7_1.c: New.
8377 * gold/testsuite/plugin_test_7_2.c: New.
8378
f4187277
RÁE
83792010-05-26 Rafael Espindola <espindola@google.com>
8380
8381 * script-sections.cc (Output_section_definition::set_section_addresses):
8382 Check for --section-start.
8383
5c388529
DK
83842010-05-26 Doug Kwan <dougkwan@google.com>
8385
8386 * arm.cc (Arm_scan_relocatable_relocs): New class.
8387 (Target_arm::relocate_special_relocatable): New method.
8388 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8389 (Arm_relocate_functions::thumb_branch_common): Same.
8390 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8391 instead of Default_scan_relocatable_relocs.
8392 * target-reloc.h (relocate_for_relocatable): Let target handle
8393 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8394 * target.h (Sized_target::relocate_special_relocatable): New method.
8395
bca1c3ae
ILT
83962010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8397
8398 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8399
0439c796
DK
84002010-05-23 Doug Kwan <dougkwan@google.com>
8401
8402 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8403 instead of a cast.
8404 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8405 with a direct branch, not a conditional branch, to a stub.
8406 * merge.cc (Output_merge_base::record_input_section): New method
8407 defintion.
8408 (Output_merge_data::do_add_input_section): Record input section if
8409 keeps-input-sections flag is set.
8410 (Output_merge_string::do_add_input_section): Ditto.
8411 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8412 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8413 INPUT_SECTIONS_.
8414 (Output_merge_base::keeps_input_sections,
8415 Output_merge_base::set_keeps_input_sections,
8416 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8417 method definitions.
8418 (Output_merge_base::Input_sections): New type declaration.
8419 (Output_merge_base::input_sections_begin,
8420 Output_merge_base::input_sections_end,
8421 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8422 (Output_merge_base::bool keeps_input_sections_,
8423 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8424 Output_merge_base::input_sections_): New data members.
8425 (Output_merge_data::do_set_keeps_input_sections): New method
8426 defintion.
8427 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8428 * output.cc (Output_section::Input_section::relobj): Move method
8429 defintion from class declaration to here and handle merge sections.
8430 (Output_section::Input_section::shndx): Ditto.
8431 (Output_section::Output_section): Remove initializations of removed
8432 data members and initialize new data member LOOKUP_MAPS_.
8433 (Output_section::add_input_section): Set keeps-input-sections flag
8434 for a newly created merge output section as appropriate. Adjust code
8435 to use Output_section_lookup_maps class.
8436 (Output_section::add_relaxed_input_section): Adjst code for lookup
8437 maps code refactoring.
2e702c99 8438 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8439 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8440 class. If adding input section to a newly created merge output
8441 section fails, remove the new merge section.
8442 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8443 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8444 (Output_section::find_merge_section): Ditto.
0439c796 8445 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8446 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8447 Output_section_lookup_maps class.
8448 (Output_section::get_input_sections): Export merge sections. Adjust
8449 code to use Output_section_lookup_maps class.
8450 (Output_section:::add_script_input_section): Adjust code to use
8451 Output_section_lookup_maps class. Update lookup maps for merge
8452 sections also.
8453 (Output_section::discard_states): Use Output_section_lookup_maps.
8454 (Output_section::restore_states): Same.
8455 * output.h (Merge_section_properties): Move class defintion out of
8456 Output_section.
8457 (Output_section_lookup_maps): New class.
8458 (Output_section::Input_section::is_merge_section): New method
8459 defintion.
8460 (Output_section::Input_section::relobj): Move defintion out of class
8461 defintion. Declare method only.
8462 (Output_section::Input_section::shndx): Ditto.
8463 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8464 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8465 (Output_section::Merge_section_by_properties_map,
8466 Output_section::Output_section_data_by_input_section_map,
8467 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8468 Remove types.
2e702c99 8469 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8470 KEEPS_INPUT_SECTIONS.
8471 (Output_section::build_lookup_maps): New method declaration.
8472 (Output_section::merge_section_map_,
8473 Output_section::merge_section_by_properties_map_,
8474 Output_section::relaxed_input_section_map_,
8475 Output_section::is_relaxed_input_section_map_valid_): Remove data
8476 members.
8477 (Output_section::lookup_maps_): New data member.
8478
76295588
L
84792010-05-21 Doug Kwan <dougkwan@google.com>
8480
8481 PR gold/11619
8482 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8483 avoid a compilation error.
8484
d103a984
RÁE
84852010-05-19 Rafael Espindola <espindola@google.com>
8486
8487 * script-sections.cc (Output_section_definition::allocate_to_segment):
8488 Update the phdrs_list even when the output section is NULL.
8489 * testsuite/Makefile.am: Add test.
8490 * testsuite/Makefile.in: Regenerate.
8491 * testsuite/script_test_9.cc: New.
8492 * testsuite/script_test_9.sh: New.
8493 * testsuite/script_test_9.t: New.
8494
6625d24e
DK
84952010-05-19 Doug Kwan <dougkwan@google.com>
8496
8497 * arm.cc (Arm_input_section::original_size): New method.
8498 (Arm_input_section::do_addralign): Add a cast.
8499 (Arm_input_section::do_output_offset): Remove static cast.
8500 (Arm_input_section::original_addralign,
8501 Arm_input_section::original_size_): Change type to uint32_t.
8502 (Arm_input_section::init): Add safe casts for section alignment
8503 and size.
8504 (Arm_input_section::set_final_data_size): Do not set address and
8505 offset of stub table.
8506 (Arm_output_section::fix_exidx_coverage): Change use of of
8507 Output_section::Simple_input_section to that of
8508 Output_section::Input_section.
8509 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8510 except for the first pass.
8511 * output.cc (Output_section::get_input_sections): Change type of
8512 input_sections to std::list<Input_section>.
8513 (Output_section::add_script_input_section): Rename from
8514 Output_section::add_simple_input_section. Change type of SIS
8515 parameter from Simple_input_section to Input_section.
8516 * output.h (Output_section::Simple_input_section): Remove class.
8517 (Output_section::Input_section): Change class visibility to public.
8518 (Output_section::Input_section::addralign): Use stored alignments
8519 for special input sections if set.
8520 (Output_section::Input_section::set_addralign): New method.
8521 (Output_section::get_input_sections): Change parameter type from
8522 list of Simple_input_section to list of Input_section.
8523 (Output_section::add_script_input_section): Rename from
8524 Output_section::add_simple_input_section. Change first parameter's
8525 type from Simple_input_section to Input_section and remove the
8526 second and third parameters.
8527 * script-sections.cc (Input_section::Input_section_list): Change
8528 type to list of Output_section::Input_section/
8529 (Input_section_info::Input_section_info): Change parameter type of
8530 INPUT_SECTION to Output_section::Input_section.
8531 (Input_section_info::input_section): Change return type.
8532 (Input_section_info::input_section_): Change type to
8533 Output_section::Input_section.
8534 (Output_section_element_input::set_section_addresses): Adjust code
8535 to use Output_section::Input_section instead of
8536 Output_section::Simple_input_section. Adjust code for renaming
8537 of Output_section::add_simple_input_section.
8538 (Orphan_output_section::set_section_addresses): Ditto.
8539
e1e82ea4
RW
85402010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8541
8542 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8543 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8544
91e75c8a
RÁE
85452010-05-18 Rafael Espindola <espindola@google.com>
8546
8547 * options.cc (General_options::finalize): Handle -nostdlib.
8548 * options.h (nostdlib): New option.
8549 * script.cc (script_add_search_dir): Handle -nostdlib.
8550
da59ad79
DK
85512010-05-12 Doug Kwan <dougkwan@google.com>
8552
8553 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8554 attributes section only if there no attributes section after merging.
8555 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8556 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8557 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8558 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8559 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8560 and arm_attr_merge_7.stdout.
8561 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8562 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8563 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8564 arm_attr_merge_7b.o): New rules.
8565 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8566 arm_attr_merge_7
8567 * testsuite/Makefile.in: Regenerate.
8568 * testsuite/arm_attr_merge.sh: New file.
8569 * testsuite/arm_attr_merge_[67][ab].s: Same.
8570
3e01a7fd
NC
85712010-05-05 Nick Clifton <nickc@redhat.com>
8572
8573 * po/es.po: Updated Spanish translation.
8574
7ad2014a
L
85752010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8576
8577 * Makefile.am (install-exec-local): Properly install gold as
8578 default cross linker.
8579 * Makefile.in: Regenerated.
8580
4fda8867
NC
85812010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8582 Nick Clifton <nickc@redhat.com>
8583
8584 * configure.ac (install_as_default): Define and set to false
8585 unless --enable-gold or --enable-gold=both/gold has been
8586 specified.
8587 * configure: Regenerate.
8588
8589 * Makefile.am (install-exec-local): Install the executable as
8590 'ld.gold'. If install_as_default is true then also install it as
8591 'ld'.
8592 * Makefile.in: Regenerated.
8593
bd288ea2
ILT
85942010-04-24 Ian Lance Taylor <iant@google.com>
8595
8596 * layout.cc (Layout::layout_reloc): In relocatable link don't
8597 combine reloc sections for grouped sections.
8598
ef38fd8a
ST
85992010-04-23 Sriraman Tallam <tmsriram@google.com>
8600
8601 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8602 sections that are not ordinary to icf.
8603 * icf.cc (get_section_contents): Handle relocation pointing to section
8604 with no object or shndx information.
8605 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8606 * testsuite/Makefile.in: Regenerate.
8607 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8608 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8609
f6973bdc
ILT
86102010-04-22 Ian Lance Taylor <iant@google.com>
8611
8612 * expression.cc (Expression::Expression_eval_info): Add
8613 result_alignment_pointer field.
8614 (Expression::eval_with_dot): Add result_alignment_pointer
8615 parameter. Change all callers.
8616 (Expression::eval_maybe_dot): Likewise.
8617 (class Binary_expression): Add alignment_pointer parameter to
8618 left_value and right_value. Change all callers.
8619 (BINARY_EXPRESSION): Set result alignment.
8620 (class Trinary_expression): Add alignment_pointer parameter to
8621 arg2_value and arg3_value. Change all callers.
8622 (Trinary_cond::value): Set result alignment.
8623 (Max_expression::value, Min_expression::value): Likewise.
8624 (Align_expression::value): Likewise.
8625 * script-sections.cc (class Sections_element): Add dot_alignment
8626 parameter to set_section_addresses virtual function. Update
8627 instantiations.
8628 (class Output_section_element): Likewise.
8629 (Script_sections::create_segments): Add dot_alignment parameter.
8630 Change all callers.
8631 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8632 (Script_sections::set_phdrs_clause_addresses): Likewise.
8633 * script-sections.h: Update declarations.
8634 * script.h: Update declarations.
8635 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8636 min_p_align.
8637 * testsuite/script_test_3.t: Set large alignment.
8638 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8639 segment has expected alignment.
8640
9c9c98a5
NC
86412010-04-22 Nick Clifton <nickc@redhat.com>
8642
8643 * po/gold.pot: Updated by the Translation project.
8644 * po/vi.po: Updated Vietnamese translation.
8645
2253bfba
L
86462010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8647
8648 * testsuite/Makefile.am (check_PROGRAMS): Add
8649 icf_virtual_function_folding_test.
8650 * testsuite/Makefile.in: Regenerated.
8651
85fdf906
AH
86522010-04-15 Andrew Haley <aph@redhat.com>
8653
8654 * options.h (merge_exidx_entries): New option.
8655 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8656 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8657 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8658 (Target_arm::merge_exidx_entries): New function.
8659 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8660 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8661 to Arm_exidx_fixup constructor.
8662 Add new arg, merge_exidx_entries.
8663 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8664 Arm_output_section::fix_exidx_coverage.
8665
ce97fa81
ST
86662010-04-18 Sriraman Tallam <tmsriram@google.com>
8667
8668 * icf.cc (get_section_contents): Check for preemptible functions.
8669 Ignore addend when appropriate.
8670 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8671 section folded.
8672 (add_from_relobj): Check for section folded.
8673 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8674 * symtab.h (should_add_dynsym_entry): Add new parameter.
8675 * target-reloc.h (scan_relocs): Check for section folded.
8676 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8677 Check reloc types for function pointers in shared objects.
8678 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8679 case.
8680 (icf_preemptible_functions_test): New test case.
8681 (icf_string_merge_test): New test case.
8682 * testsuite.Makefile.in: Regenerate.
8683 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8684 bar_glob. Refactor code.
8685 * testsuite/icf_preemptible_functions_test.cc: New file.
8686 * testsuite/icf_preemptible_functions_test.sh: New file.
8687 * testsuite/icf_string_merge_test.cc: New file.
8688 * testsuite/icf_string_merge_test.sh: New file.
8689 * testsuite/icf_virtual_function_folding_test.cc: New file.
8690 * testsuite/icf_virtual_function_folding_test.sh: New file.
8691
04ceb17c
DK
86922010-04-14 Doug Kwan <dougkwan@google.com>
8693
8694 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8695 for local symbol recounting if we remove a section due to ICF.
8696 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8697 there are no regular objects in input.
8698
153e7da4
DK
86992010-04-13 Doug Kwan <dougkwan@google.com>
8700
8701 * arm.cc (Arm_input_section::set_final_data_size): Compute
8702 accurate final data size instead of using current data size.
8703
4dbd9faf
DK
87042010-04-09 Doug Kwan <dougkwan@google.com>
8705
8706 * layout.cc (Layout::choose_output_section): Handle script section
8707 types.
8708 (Layout::make_output_section_for_script): Add section type parameter.
8709 Handle script section types.
8710 * layout.h (Layout::make_output_section_for_script): Add section
8711 type parameter.
8712 * output.cc (Output_section::Output_section): Initialize data member
8713 is_noload_.
8714 (Output_section::do_reset_address_and_file_offset): Do not set address
8715 to 0 if section is a NOLOAD section.
8716 * output.h (Output_section::is_noload): New method.
8717 (Output_section::set_is_noload): Ditto.
8718 (Output_section::is_noload_): New data member.
8719 * script-c.h (Script_section_type): New enum type.
8720 (struct Parser_output_section_header): Add new file section_type.
8721 * script-sections.cc (Sections_element::output_section_name): Add
8722 parameter for returning script section type.
8723 (Output_section_definition::output_section_name): Ditto.
8724 (Output_section_definition::section_type)P; New method.
8725 (Output_section_definiton::script_section_type_name): Ditto.
8726 (Output_section_definition::script_section_type_): New data member.
8727 (Output_section_definition::Output_section_definition): Initialize
8728 data member Output_section_definition::script_section_type_.
8729 (Output_section_definition::create_sections): Pass script section type
8730 to Layout::make_output_section_for_script.
8731 (Output_section_definition::output_section_name): Return script
8732 section type to caller.
8733 (Output_section_definition::set_section_address): Do not advance
8734 dot value and load address if section type is NOLOAD. Set address
8735 of NOLOAD sections regardless of section flags.
8736 (Output_section_definition::print): Print section type if it is
8737 not SCRIPT_SECTION_TYPE_NONE.
8738 (Output_section_definition::section_type): New method.
8739 (Output_section_definition::script_section_type_name): Ditto.
8740 (Script_sections::output_section_name): Add new parameter
8741 PSECTION_TYPE for returning script section type. Pass it to
8742 section elements. Handle discard sections.
8743 (Sort_output_sections::operator()): Handle NOLOAD sections.
8744 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8745 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8746 returning script section type.
8747 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8748 INFO and NOLOAD.
8749 * yyscript.y (union): Add new field SECTION_TYPE.
8750 (COPY, DSECT, INFO, NOLOAD): New tokens.
8751 (opt_address_and_section_type): Change type to output_section_header.
8752 (section_type): New non-terminal
8753 (section_header): Handle section type.
2253bfba 8754 (opt_address_and_section_type): Return section type value.
4dbd9faf 8755
721ea635
L
87562010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8757
8758 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8759 * testsuite/plugin_common_test_2.c (foo): Likewise.
8760
6bf924b0
DK
87612010-04-08 Doug Kwan <dougkwan@google.com>
8762
8763 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8764 Output_merge_data.
8765 * output.cc (Output_section::add_merge_input_section): Simplify
8766 code and return status of Output_merge_base::add_input_section.
e1df38aa 8767 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8768 returns true.
8769
24af6f92
DK
87702010-04-07 Doug Kwan <dougkwan@google.com>
8771
8772 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8773 if section is marked as containing instructions but has no mapping
8774 symbols.
8775 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8776 correct section index.
8777 (Arm_relobj::find_linked_text_section): Ditto.
8778
00698fc5
CC
87792010-04-07 Cary Coutant <ccoutant@google.com>
8780
8781 * archive.cc (include_member): Destroy Read_symbols_data object before
8782 releasing file.
8783 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8784 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8785 (Read_symbols_data::~Read_symbols_data) New destructor.
8786 (Section_relocs::Section_relocs) New constructor.
8787 (Section_relocs::~Section_relocs) New destructor.
8788 (Read_relocs_data::Read_relocs_data) New constructor.
8789 (Read_relocs_data::~Read_relocs_data) New destructor.
8790 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8791 pointers to NULL after deleting.
8792
7296d933
DK
87932010-04-07 Doug Kwan <dougkwan@google.com>
8794
8795 * arm.cc: Replace "endianity" with "endianness" in comments.
8796 (Arm_exidx_cantunwind): Ditto.
8797 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8798 (Arm_relobj::merge_flags_and_attributes): New method.
8799 (Arm_relobj::merge_flags_and_attributes_): New data member.
8800 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8801 (Arm_relobj::scan_sections_for_stubs): Ditto.
8802 (Arm_relobj::do_read_symbols): Check to see if we really want to
8803 merge processor-specific flags and attributes. Exit early if
8804 an object is empty except for section names and the undefined symbol.
8805 (Target_arm::do_finalize_sections): Move check for ELF format to
8806 Arm_relobj::do_read_symbols. Merge processor specific flags and
8807 attributes from a regular object only when we have determined that
8808 it is aapropriate. Do not create an .ARM.attributes section in
8809 output if there is no regular input object.
8810 (Target_arm::merge_processor_specific_flags): Check
8811 --warn-mismatch before printing any error.
8812 (Target_arm::merge_object_attributes): Ditto.
8813 * gold.cc (queue_middle_tasks): Handle the case in which there is
8814 no regular object in input.
8815 * options.cc (General_options::parse_EB): New method.
8816 (General_options::parse_EL): Same.
8817 (General_options::General_options): Initialize endianness_.
8818 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8819 New options.
8820 (General_options::Endianness): New enum.
8821 (General_options::endianness): New method.
8822 (General_options::endianness_): New data member.
8823 * parameters.cc (Parameters::set_options): Check target endianness.
8824 (Parameters::set_target_once): Ditto.
8825 (Parameters::check_target_endianness): New method.
8826 (parameters_force_valid_target): If either -EL or -EB is specified,
8827 use it to define endianness of default target.
8828 * parameters.h (Parameters::check_target_endianness): New method
8829 declaration.
8830 * target.h (class Target): Change "endianity" to "endianness"
8831 in comments.
8832
efc8d4f2
RW
88332010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8834
8835 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8836 * configure: Regenerate.
8837 * Makefile.in: Regenerate.
8838 * testsuite/Makefile.in: Regenerate.
8839
be234d88
CC
88402010-04-06 Cary Coutant <ccoutant@google.com>
8841
8842 gcc PR lto/42757
8843 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8844 prevailing definitions of common symbols.
8845 * testsuite/plugin_test_6.sh: New test case.
8846 * testsuite/plugin_common_test_1.c: New test case.
8847 * testsuite/plugin_common_test_2.c: New test case.
8848 * testsuite/Makefile.am (plugin_test_6): New test case.
8849 * testsuite/Makefile.in: Regenerate.
8850
bd32c6bd
NC
88512010-04-06 Nick Clifton <nickc@redhat.com>
8852
8853 * po/vi.po: New Vietnamese translation.
8854
323c532f
DK
88552010-03-30 Doug Kwan <dougkwan@google.com>
8856
8857 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8858
4fcd97eb
DK
88592010-03-25 Doug Kwan <dougkwan@google.com>
8860
8861 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8862 to avoid a conversion warning on a 32-bit host.
8863
4ebf39db
ILT
88642010-03-24 Ian Lance Taylor <iant@google.com>
8865
8866 * testsuite/script_test_3.t: Add a TLS segment.
8867 * testsuite/Makefile.am (check_PROGRAMS): Add
8868 tls_phdrs_script_test.
8869 (tls_phdrs_script_test_SOURCES): Define.
8870 (tls_phdrs_script_test_DEPENDENCIES): Define.
8871 (tls_phdrs_script_test_LDFLAGS): Define.
8872 (tls_phdrs_script_test_LDADD): Define.
8873 * testsuite/Makefile.in: Rebuild.
8874
4a599bdd
CC
88752010-03-23 Cary Coutant <ccoutant@google.com>
8876
8877 * fileread.cc (find_or_make_view): Fix comment.
8878
6c93b22c
ILT
88792010-03-23 Ian Lance Taylor <iant@google.com>
8880
8881 * script-sections.cc (class Orphan_section_placement): Define
8882 PLACE_TLS and PLACE_TLS_BSS.
8883 (Orphan_section_placement::Orphan_section_placement): Initialize
8884 new places.
8885 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8886 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8887 (tls_script_test_SOURCES): Define.
8888 (tls_script_test_DEPENDENCIES): Define.
8889 (tls_script_test_LDFLAGS): Define.
8890 (tls_script_test_LDADD): Define.
8891 * testsuite/Makefile.in: Rebuild.
8892
a2c7281b
DK
88932010-03-22 Doug Kwan <dougkwan@google.com>
8894
8895 * arm.cc (Arm_relocate_functions::abs8,
8896 Arm_relocate_functions::abs16): Use correct check for overflow
8897 specified in the ARM ELF specs.
8898 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8899 target of a BLX instruction specially.
8900 (Reloc_stub::stub_type_for_reloc): Ditto.
8901 (Relocate::relocate): Use symbolic names instead of numeric relocation
8902 codes to report error.
8903 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8904 workaround.
8905 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8906 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8907 thumb2_blx_out_of_range.stdout
8908 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8909 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8910 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8911 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8912 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8913 thumb2_blx_in_range, thumb2_blx_in_range.o,
8914 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8915 thumb2_blx_out_of_range.o): New rules.
2e702c99 8916 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8917 thumb2_blx_in_range and thumb2_blx_out_of_range.
8918 * testsuite/Makefile.in: Regenerate.
8919 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8920 * testsuite/thumb_blx_in_range.s: New file.
8921 * testsuite/thumb_blx_out_of_range.s: New file.
8922
b0193076
RÁE
89232010-03-22 Rafael Espindola <espindola@google.com>
8924
8925 * archive.cc (Should_include): Move to archive.h.
8926 (should_include_member): Make it a member of Archive.
8927 (Lib_group): New.
8928 (Add_lib_group_symbols): New.
8929 * archive.h: Include options.h.
8930 (Archive_member): Moved from Archive.
8931 (Should_include): Moved from archive.cc.
8932 (Lib_group): New.
8933 (Add_lib_group_symbols): New.
8934 * dynobj.cc (do_should_include_member): New.
8935 * dynobj.h (do_should_include_member): New.
8936 * gold.cc (queue_initial_tasks): Update call to queue.
8937 * main.cc (main): Print lib group stats.
8938 * object.cc (do_should_include_member): New.
8939 * object.h: Include archive.h.
8940 (Object::should_include_member): New.
8941 (Object::do_should_include_member): New.
8942 (Sized_relobj::do_should_include_member): New.
8943 * options.cc (General_options::parse_start_lib): New.
8944 (General_options::parse_end_lib): New.
8945 (Input_arguments::add_file): Handle lib groups.
8946 (Input_arguments::start_group): Check we are not in a lib.
8947 (Input_arguments::start_lib): New.
8948 (Input_arguments::end_lib): New.
8949 * options.h (General_options): Add start_lib and end_lib.
8950 (Input_argument::lib_): New.
8951 (Input_argument::lib): New.
8952 (Input_argument::is_lib): New.
8953 (Input_file_lib): New.
8954 (Input_arguments::in_lib_): New.
8955 (Input_arguments::in_lib): New.
8956 (Input_arguments::start_lib): New.
8957 (Input_arguments::end_lib_): New.
8958 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8959 in unused members as preempted.
8960 (Sized_pluginobj::do_should_include_member): New.
8961 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8962 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8963 return the blocker.
8964 (Read_symbols::do_whole_lib_group): New.
8965 (Read_symbols::do_lib_group): New.
8966 (Read_symbols::do_read_symbols): Handle lib groups.
8967 (Read_symbols::get_name): Handle lib groups.
8968 * readsyms.h (Read_symbols): Add an archive member pointer.
8969 (Read_symbols::do_whole_lib_group): New.
8970 (Read_symbols::do_lib_group): New.
8971 (Read_symbols::member_): New.
8972 * script.cc (read_input_script): Update call to queue_soon.
8973
d099120c
DK
89742010-03-19 Doug Kwan <dougkwan@google.com>
8975
8976 * arm.cc (Stub_table::Stub_table): Initialize new data members
8977 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8978 (Stub_table::add_reloc_stub): Assign stub offset and update
8979 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8980 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8981 New data members.
2e702c99 8982 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8983 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8984 instead of going over all reloc stubs.
2e702c99 8985 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8986 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8987 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8988 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8989 Stringpool_template::offset_.
8990 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8991 Stringpool_template::offset_ to zero.
8992
1aa37384
DK
89932010-03-15 Doug Kwan <dougkwan@google.com>
8994
8995 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8996 offset_.
8997 (Stringpool_template::new_key_offset): New method.
8998 (Stringpool_template::add_string): Assign offsets when adding new
8999 strings.
9000 (Stringpool_template::set_string_offsets): Do not set string offsets
9001 when not optimizing.
9002 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9003 member size_.
2e702c99
RM
9004 (Chunked_vector::clear): Clear size_.
9005 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9006 (Chunked_vector::size): Return size_.
9007 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9008 (Chunked_vector::size_): New data member.
1aa37384
DK
9009 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9010 (Stringpool_template::new_key_offset): New method declaration.
9011 (Stringpool_template::offset_): New data member.
9012
b672b057
RÁE
90132010-03-15 Rafael Espindola <espindola@google.com>
9014
9015 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9016 Add_symbols' constructor.
9017 * readsyms.h (Add_symbols): Remove the input_group member.
9018
b6848d3c
ILT
90192010-03-10 Ian Lance Taylor <iant@google.com>
9020
9021 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9022 target to ask whether a reference to a symbol requires a stack
9023 split.
9024 * target.h (Target::is_call_to_non_split): New function.
9025 (Target::do_is_call_to_non_split): Declare virtual function.
9026 * target.cc: Include "symtab.h".
9027 (Target::do_is_call_to_non_split): New function.
9028 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9029
a2a5469e
CC
90302010-03-10 Cary Coutant <ccoutant@google.com>
9031
9032 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9033 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9034 (File_read::open[2]): Add whole_file_view_ to list of views.
9035 (File_read::make_view): Remove test of whole_file_view_.
9036 (File_read::find_or_make_view): Create whole_file_view_ if
9037 necessary.
9038 (File_read::clear_views): Replace bool parameter with enum;
9039 adjust all callers. Don't delete views with permanent data;
9040 do delete cached views and views from archives if
9041 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9042 if clearing the corresponding view.
9043 * fileread.h (File_read::Clear_views_mode): New enum.
9044 (File_read::View::is_permanent_view): New method.
9045 (File_read::clear_views): Replace bool parameter
9046 with enum; adjust all callers.
9047 * options.h (General_options): Change keep_files_mapped option;
9048 add map_whole_files.
9049 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9050 releasing the file.
9051 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9052 the file.
9053
8861f32b
DM
90542010-03-10 David S. Miller <davem@davemloft.net>
9055
9056 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9057
d62d0f5f
ST
90582010-03-09 Sriraman Tallam <tmsriram@google.com>
9059
9060 * icf.cc (get_section_contents): Add '@' marker after processing the
9061 merge reloc.
9062
9177756d
DK
90632010-03-08 Doug Kwan <dougkwan@google.com>
9064
9065 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9066 due to a conversion warning.
9067 (Arm_relobj::update_output_local_symbol_count): Check for local
9068 symbol with unset output index.
9069
9e9e071b
ILT
90702010-03-05 Ian Lance Taylor <iant@google.com>
9071
9072 * options.h (class General_options): Add --spare-dynamic-tags.
9073 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9074 --spare-dynamic-tags.
9075
a81ee015
ILT
90762010-03-05 Ian Lance Taylor <iant@google.com>
9077
9078 * incremental.cc: Include "libiberty.h".
9079
44ec90b9
RO
90802010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9081
9082 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9083 function, is_info_ member.
9084 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9085 (Versions::Versions): Update caller.
9086 (Versions::define_base_version): Likewise.
9087 (Versions::add_def): Likewise.
9088
0897ed3b
ST
90892010-03-03 Sriraman Tallam <tmsriram@google.com>
9090
9091 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9092 (Scan::possible_function_pointer_reloc): New function.
9093 (Scan::local_reloc_may_be_function_pointer): Change to call
9094 possible_function_pointer_reloc.
9095 (Scan::global_reloc_may_be_function_pointer): Ditto.
9096 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9097 relocations in ".data.rel.ro._ZTV" section.
9098 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9099 * testsuite/icf_safe_so_test.cc: Ditto.
9100 * testsuite/icf_safe_test.cc: Ditto.
9101 * testsuite/icf_safe_test.sh: Ditto.
9102
d3bbad62
ILT
91032010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9104 Ian Lance Taylor <iant@google.com>
9105
9106 * target-reloc.h (relocate_section): Check the symbol table index
9107 for -1U before setting the local symbol index.
9108 (scan_relocatable_relocs): If copying the relocation, record that
9109 the local symbol is required.
9110 * object.h (Symbol_value::is_output_symtab_index_set): New
9111 function.
9112 (Symbol_value::may_be_discarded_from_output_symtab): New
9113 function.
9114 (Symbol_value::has_output_symtab_entry): New function.
9115 (Symbol_value::needs_output_symtab_entry): Remove.
9116 (Symbol_value::output_symtab_index): Make sure the symbol index is
9117 set.
9118 (Symbol_value::set_output_symtab_index): Make sure the symbol
9119 index is not set. Make sure the new index is valid.
9120 (Symbol_value::set_must_have_output_symtab_entry): New function.
9121 (Symbol_value::has_output_dynsym_entry): New function.
9122 (Symbol_value::set_output_dynsym_index): Make sure the new index
9123 is valid.
9124 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9125 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9126 local symbol if permitted.
9127 (Sized_relobj::do_finalize_local_symbols): Call
9128 is_output_symtab_index_set rather than needs_output_symtab_entry.
9129 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9130 rather than needs_output_symtab_entry. Call
9131 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9132 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9133 is_output_symtab_index_set rather than needs_output_symtab_entry.
9134 * testsuite/discard_locals_relocatable_test.c: New file.
9135 * testsuite/discard_locals_test.sh: Test -r.
9136 * testsuite/Makefile.am (check_DATA): Add
9137 discard_locals_relocatable_test1.syms,
9138 discard_local_relocatable_test2.syms.
9139 (MOSTLYCLEANFILES): Likewise. Also add
9140 discard_locals_relocatable_test1.lout and
9141 discard_locals_relocatable_test2.out.
9142 (discard_locals_relocatable_test1.syms): New target.
9143 (discard_locals_relocatable_test.o): New target.
9144 (discard_locals_relocatable_test1.out): New target.
9145 (discard_locals_relocatable_test2.syms): New target.
9146 (discard_locals_relocatable_test2.out): New target.
9147 (various): Add missing ../ld-new dependencies.
9148 * testsuite/Makefile.in: Rebuild.
9149
7e8ccf26
NC
91502010-03-03 Nick Clifton <nickc@redhat.com>
9151
9152 * po/fi.po: New Finnish translation.
9153
2a0ff005
DK
91542010-03-01 Doug Kwan <dougkwan@google.com>
9155
9156 * layout.cc (Layout::Layout): Force section types of .init_array*,
9157 .preinit_array* and .fini_array* sections.
9158 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9159 Fix check of return value of std::string::find.().
9160 (Output_section::Input_section_sort_compare::operator()): Remove
9161 comment about .init_array.
9162 (Output_section::Input_section_sort_init_fini_compare::operator()):
9163 New method.
9164 (Output_section::sort_attached_input_sections): Handle .init_array
9165 and .fini_array specially.
9166 * output.h (Output_section::Inut_section_sort_compare): Update
9167 comment.
9168 (Output_section::Input_section_sort_init_fini_compare): New struct.
9169
c3e4ae29
DK
91702010-02-26 Doug Kwan <dougkwan@google.com>
9171
9172 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9173 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9174 * testsuite/debug_msg.sh: Avoid matching source line number for
9175 use of global variable undef_int.
9176
2fd9ae7a
DK
91772010-02-26 Doug Kwan <dougkwan@google.com>
9178
9179 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9180 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9181 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9182 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9183 * options.cc (General_options::General_options): Initialize member
9184 fix_v4bx_.
9185 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9186 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9187 and rm_no_fix_v4bx.stdout
9188 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9189 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9190 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9191 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9192 and arm_no_fix_v4bx.
9193 * Makefile.in: Regenerate.
9194 * testsuite/arm_fix_v4bx.s: New file.
9195 * testsuite/arm_fix_v4bx.sh: Ditto.
9196
67ec7d0b
DK
91972010-02-24 Doug Kwan <dougkwan@google.com>
9198
9199 * arm.cc (Target_arm::got_section): Make the .got section the first
9200 non RELRO section in the data segment.
9201 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9202 suffixes of section names.
9203
10165461
DK
92042010-02-24 Doug Kwan <dougkwan@google.com>
9205
9206 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9207 flags and attributes merging if an input file is a binary file.
9208 * fileread.cc (Input_file::open): Record format of original file.
9209 * fileread.h (Input_file::Format): New enum type.
2e702c99 9210 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9211 (Input_file::format): New method definition.
9212 (Input_file::format_):: New data member.
9213
4a54abbb
DK
92142010-02-24 Doug Kwan <dougkwan@google.com>
9215
9216 * arm.cc (Arm_output_data_got): New class.
9217 (ARM_TCB_SIZE): New constant
9218 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9219 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9220 If user uses a script with a SECTIONS clause, issue only a warning
9221 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9222 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9223 garbage collection.
9224 (Target_arm::got_mode_index_entry): Handle static linking.
9225 (Target_arm::Scan::local): Ditto.
9226 (Target_arm::Scan::global): Ditto.
9227 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9228 all incorrectly implemented relocations.
e1df38aa 9229 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9230 Arm_output_section::fix_exidx_coverage.
9231 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9232 from ".ARM.exidx." and ".ARM.extab.".
9233
ca419a6f
ILT
92342010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9235
9236 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9237 section if it does not already exist.
9238 * attributes.cc (Attributes_section_data::Attributes_section_data):
9239 Don't crash if size is zero.
9240
135b9c78
ILT
92412010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9242 Ian Lance Taylor <iant@google.com>
9243
9244 * gold.cc (queue_middle_tasks): If no input files were opened,
9245 exit.
9246 * workqueue.h (Task_function::Task_function): Assert that there is
9247 a blocker.
9248
bb0bfe4f
DK
92492010-02-22 Doug Kwan <dougkwan@google.com>
9250
9251 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9252 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9253 types to avoid warnings due to different uint64_t implementations
9254 on different hosts.
9255
2a2b6d42
DK
92562010-02-21 Doug Kwan <dougkwan@google.com>
9257
9258 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9259 handling of the maximum backward branch offset.
2e702c99 9260 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9261 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9262 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9263 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9264 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9265 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9266 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9267 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9268 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9269 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9270 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9271 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9272 thumb2_bl_out_of_range.o): New rules.
9273 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9274 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9275 thumb2_bl_out_of_range
9276 * testsuite/Makefile.in: Regenerate.
9277 * testsuite/arm_bl_in_range.s: New file.
9278 * testsuite/arm_bl_out_of_range.s: Ditto.
9279 * testsuite/arm_branch_in_range.sh: Ditto.
9280 * testsuite/arm_branch_range.t: Ditto.
9281 * testsuite/thumb2_branch_range.t: Ditto.
9282 * testsuite/thumb_bl_in_range.s: Ditto.
9283 * testsuite/thumb_bl_out_of_range.s: Ditto.
9284 * testsuite/thumb_branch_range.t: Ditto.
9285
b487ad64
ST
92862010-02-20 Sriraman Tallam <tmsriram@google.com>
9287
9288 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9289 Add reloc offset information.
9290 * icf.cc (get_section_contents): Change iterators to point to the new
9291 vectors. Add reloc offset information to the contents.
9292 * icf.h (Icf::Sections_reachable_info): New typedef.
9293 (Icf::Sections_reachable_list): New typedef.
9294 (Icf::Offset_info): New typedef.
9295 (Icf::Reloc_info): New struct typedef.
9296 (Icf::Reloc_info_list): New typedef.
9297 (Icf::symbol_reloc_list): Delete method.
9298 (Icf::addend_reloc_list): Delete method.
9299 (Icf::section_reloc_list): Delete method.
9300 (Icf::reloc_info_list): New method.
9301 (Icf::reloc_info_list_): New member.
9302
f96accdf
DK
93032010-02-19 Doug Kwan <dougkwan@google.com>
9304
9305 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9306 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9307 * arm.cc (Arm_relocation_functions): New forward declaration.
9308 (Target_arm::Target_arm): Initialize new data members
9309 got_mod_index_offset_ and tls_base_symbol_defined_.
9310 (Target_arm::Relocate::relocate_tls): New method.
9311 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9312 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9313 New methods.
2e702c99 9314 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9315 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9316 (Target_arm::got_mod_index_offset_,
9317 Target_arm::tls_base_symbol_defined_): New data members.
9318 (Target_arm::Scan::local, Target::Scan::global,
9319 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9320 relocations.
9321
c8761b9a
DK
93222010-02-18 Doug Kwan <dougkwan@google.com>
9323
9324 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9325 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9326 text section as a parameter becuase some broken tools may not set
9327 the link in section header.
9328 (Target_arm::has_got_section): New method.
9329 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9330 without any mapping symbol as data only. Remove warning.
9331 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9332 link in its section header, try to discover the link by inspecting the
9333 REL31 relocation at the beginning of the section.
9334 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9335 in error message.
9336 (Target_arm::Scan::global): Treat any reference to the symbol
9337 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9338
21bb3914
ST
93392010-02-12 Sriraman Tallam <tmsriram@google.com>
9340
9341 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9342 (Scan::global_reloc_may_be_function_pointer): New function.
9343 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9344 (Scan::global_reloc_may_be_function_pointer): New function.
9345 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9346 (Scan::global_reloc_may_be_function_pointer): New function.
9347 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9348 (Scan::global_reloc_may_be_function_pointer): New function.
9349 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9350 (Scan::global_reloc_may_be_function_pointer): New function.
9351 (Scan::possible_function_pointer_reloc): New function.
9352 (Target_x86_64::can_check_for_function_pointers): New function.
9353 * gc.h (gc_process_relocs): Scan relocation types to determine if
9354 function pointers were taken for targets that support it.
9355 * icf.cc (Icf::find_identical_sections): Include functions for
9356 folding in safe ICF whose pointer is not taken.
9357 * icf.h (Secn_fptr_taken_set): New typedef.
9358 (fptr_section_id_): New member.
9359 (section_has_function_pointers): New function.
9360 (set_section_has_function_pointers): New function.
9361 (check_section_for_function_pointers): New function.
9362 * options.h: Fix comment for safe ICF option.
9363 * target.h (can_check_for_function_pointers): New function.
9364 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9365 Modify icf_safe_test for X86-64.
9366 * testsuite/Makefile.in: Regenerate.
9367 * testsuite/icf_safe_so_test.cc: New file.
9368 * testsuite/icf_safe_so_test.sh: New file.
9369 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9370 (main): Change to take pointer to function kept_func_3.
9371 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9372 folding is done correctly for X86-64.
9373
0da6fa6c
DM
93742010-02-12 David S. Miller <davem@davemloft.net>
9375
9376 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9377 is_symbolless parameter.
9378 (Output_reloc<SHT_REL>::is_symbolless): New.
9379 (Output_reloc<SHT_REL>::is_symbolless_): New.
9380 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9381 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9382 (Output_reloc<SHT_RELA>::is_symbolless): New.
9383 (Output_data_reloc::add_global): Handle is_symbolless.
9384 (Output_data_reloc::add_global_relative): Likewise.
9385 (Output_data_reloc::add_local): Likewise.
9386 (Output_data_reloc::add_local_relative): Likewise.
9387 (Output_data_reloc::add_symbolless_global_addend): New.
9388 (Output_data_reloc::add_symbolless_local_addend): New.
9389 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9390 is_symbolless.
9391 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9392 instead of ->is_relative_
9393 (Output_reloc::write): Likewise.
9394 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9395 (Output_reloc::write_rel): Simplify.
9396
9397 * sparc.cc (Target_sparc::Scan::local): Use
9398 ->add_symbolless_local_addend as needed.
9399 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9400 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9401 based upon relocation offset.
9402
e4782e83
DK
94032010-02-11 Doug Kwan <dougkwan@google.com>
9404
9405 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9406 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9407 beginning of function.
9408 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9409 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9410 parameter is_32bit in calls to should_apply_static_reloc.
9411 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9412 (check_DATA): Add arm_abs_global.stdout.
9413 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9414 arm_abs_global.stdout): New rules.
9415 (MOSTLLYCLEANFILES): Add arm_abs_global
9416 * Makefile.in: Regenerate.
9417 * testsuite/arm_abs_global.s: New file.
9418 * testsuite/arm_abs_global.sh: Ditto.
9419 * testsuite/arm_abs_lib.s: Ditto.
9420
93ceb764
ILT
94212010-02-11 Ian Lance Taylor <iant@google.com>
9422
9423 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9424 Read_relocs task.
9425 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9426 Allocate_commons_task first.
9427 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9428 task, rather than symtab_lock_.
9429 (Gc_process_relocs::~Gc_process_relocs): New function.
9430 (Gc_process_relocs::is_runnable): Check this_blocker_.
9431 (Gc_process_relocs::locks): Use next_blocker_ rather than
9432 blocker_.
9433 (Scan_relocs::~Scan_relocs): New function.
9434 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9435 symtab_lock_.
9436 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9437 next_blocker_.
9438 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9439 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9440 constructor accordingly.
9441 (class Gc_process_relocs): Likewise.
9442 (class Scan_relocs): Likewise.
9443 * common.h (class Allocate_commons_task): Remove symtab_lock_
9444 field, and corresponding constructor parameter.
9445 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9446 symtab_lock_.
9447 (Allocate_commons_task::locks): Likewise.
9448
114dfbe1
ILT
94492010-02-11 Ian Lance Taylor <iant@google.com>
9450
9451 * gold-threads.h (class Once): Define.
9452 (class Initialize_lock): Rewrite as child of Once.
9453 * gold-threads.cc (class Once_initialize): Define.
9454 (once_pointer_control): New static variable.
9455 (once_pointer, once_arg): New static variables.
9456 (c_run_once): New static function.
9457 (Once::Once, Once::run_once, Once::internal_run): New functions.
9458 (class Initialize_lock_once): Remove.
9459 (initialize_lock_control): Remove.
9460 (initialize_lock_pointer): Remove.
9461 (initialize_lock_once): Remove.
9462 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9463 (Initialize_lock::initialize): Rewrite.
9464 (Initialize_lock::do_run_once): New function.
9465 * archive.cc (Archive::interpret_header): Only clear name if it is
9466 not already empty.
9467 * fileread.cc: Include "gold-threads.h"
9468 (file_counts_lock): New static variable.
9469 (file_counts_initialize_lock): Likewise.
9470 (File_read::release): Only increment counts when using --stats.
9471 Use a lock around the increment.
9472 * parameters.cc (class Set_parameters_target_once): Define.
9473 (set_parameters_target_once): New static variable.
9474 (Parameters::Parameters): Move here from parameters.h.
9475 (Parameters::set_target): Rewrite.
9476 (Parameters::set_target_once): New function.
9477 (Parameters::clear_target): Move here and rewrite.
9478 * parameters.h (class Parameters): Update declarations. Add
9479 set_parameters_target_once_ field.
9480 (Parameters::Parameters): Move to parameters.cc.
9481 (Parameters::clear_target): Likewise.
9482 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9483 task.
9484 (Start_group::~Start_group): New function.
9485 (Start_group::is_runnable): New function.
9486 (Start_group::locks, Start_group::run): New functions.
9487 (Finish_group::run): Change saw_undefined to size_t.
9488 * readsyms.h (class Start_group): Define.
9489 (class Finish_group): Change saw_undefined_ field to size_t.
9490 (Finish_group::Finish_group): Remove saw_undefined and
9491 this_blocker parameters. Change all callers.
9492 (Finish_group::set_saw_undefined): New function.
9493 (Finish_group::set_blocker): New function.
9494 * symtab.h (class Symbol_table): Change saw_undefined to return
9495 size_t. Change saw_undefined_ field to size_t.
9496 * target-select.cc (Set_target_once::do_run_once): New function.
9497 (Target_selector::Target_selector): Initialize set_target_once_
9498 field. Don't initialize lock_ and initialize_lock_ fields.
9499 (Target_selector::instantiate_target): Rewrite.
9500 (Target_selector::set_target): New function.
9501 * target-select.h (class Set_target_once): Define.
9502 (class Target_selector): Update declarations. Make
9503 Set_target_once a friend. Remove lock_ and initialize_lock_
9504 fields. Add set_target_once_ field.
9505
fa17a3f4
ILT
95062010-02-10 Ian Lance Taylor <iant@google.com>
9507
9508 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9509 queueing any tasks.
9510 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9511 (queue_middle_tasks): Add all blockers before queueing any tasks.
9512 (queue_final_tasks): Likewise.
9513 * token.h (Task_token::add_blockers): New function.
9514 * object.h (Input_objects::number_of_relobjs): New function.
9515
c7177d31
ILT
95162010-02-10 Ian Lance Taylor <iant@google.com>
9517
5de0e392
ILT
9518 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9519 shared, not if not position independent.
9520 * x86_64.cc (Relocate::relocate_tls): Likewise.
9521 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9522 (tls_pie_pic_test): New target.
9523 * testsuite/Makefile.in: Rebuild.
9524
c7177d31
ILT
9525 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9526 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9527 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9528 * testsuite/Makefile.in: Rebuild.
9529
684b268a
DM
95302010-02-09 David S. Miller <davem@davemloft.net>
9531
9532 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9533 R_SPARC_RELATIVE using ->add_local_relative().
9534 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9535
612a8d3d
DM
9536 * output.h (Output_data_dynamic::add_section_size): New method
9537 that takes two Output_data objects.
9538 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9539 entry param. Handle it in initializers.
9540 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9541 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9542 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9543 arg.
9544 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9545 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9546 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9547 for dynrel_includes_plt.
9548 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9549 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9550 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9551 before .rela.plt
9552 (Target_sparc::do_finalize_sections): Update to pass true for
9553 dynrel_includes_plt.
9554 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9555 output before .rela.plt
9556 (Target_powerpc::do_finalize_sections): Update to pass true for
9557 dynrel_includes_plt when 32-bit.
9558
cb1be87e
DK
95592010-02-08 Doug Kwan <dougkwan@google.com>
9560
9561 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9562 method.
9563 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9564 Arm_relobj::scan_section_for_cortex_a8_stubs,
9565 Arm_relobj::do_relocation_section): Instead of calling
9566 Output_section::output_address, use faster
9567 Arm_relobj::simple_input_section_output_address.
9568
705b5121
DM
95692010-02-08 David S. Miller <davem@davemloft.net>
9570
9571 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9572 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9573 relocation helper function.
9574
024c4466
DM
9575 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9576 just like R_SPARC_GOT{10,13,22}.
9577 (Target_sparc::Scan::local): Likewise.
9578 (Target_sparc::Relocate:relocate): Likewise.
9579
9109c078
ILT
95802010-02-06 Ian Lance Taylor <iant@google.com>
9581
9582 * configure.ac: Rewrite targetobjs duplicate removal code to use
9583 only shell constructs.
9584 * configure: Rebuild.
9585
cf846138
DK
95862010-02-05 Doug Kwan <dougkwan@google.com>
9587
9588 PR 11247
9589 * arm.cc (Arm_relobj::section_is_scannable): New method.
9590 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9591 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9592
6cfaf60b
DK
95932010-02-04 Doug Kwan <dougkwan@google.com>
9594
9595 PR 11247
9596 * arm-reloc-property.cc (cstdio): Include.
9597 * configure.ac (targetobjs): Remove duplicates.
9598 * configure: Regenerate.
9599 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9600 big and little endian version for a given address size.
9601
5c57f1be
DK
96022010-02-03 Doug Kwan <dougkwan@google.com>
9603
9604 * arm-reloc-property.cc
9605 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9606 definition.
9607 * arm-reloc-property.h
9608 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9609 New method definition.
9610 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9611 declaration.
9612 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9613 overflow to N.
9614 (GOT_PREL): Change implemented to Y.
9615 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9616 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9617 (Arm_relocate_functions::movw_abs_nc): Remove method.
9618 (Arm_relocate_functions::movt_abs): Ditto.
9619 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9620 (Arm_relocate_functions::thm_movt_abs): Ditto.
9621 (Arm_relocate_functions::movw_rel_nc): Ditto.
9622 (Arm_relocate_functions::movw_rel): Ditto.
9623 (Arm_relocate_functions::movt_rel): Ditto.
9624 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9625 (Arm_relocate_functions:thm_movw_rel): Ditto.
9626 (Arm_relocate_functions:thm_movt_rel): Ditto.
9627 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9628 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9629 New method definitions.
9630 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9631 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9632 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9633 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9634 (Target_arm::Relocate::relocate): Check for non-static or
9635 unimplemented relocation code and exit early. Change calls to
9636 Target_arm::reloc_uses_thumb_bit and
9637 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9638 instead. Refactor code to handle similar relocations to increase
9639 code sharing. Remove check for unsupported relocation code in switch
9640 statement.
9641 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9642 relocation property table to find out size. Change error message to
9643 print out the name of a relocation code instead of the numeric value.
9644 (Target_arm::scan_reloc_for_stub): Use relocation property table
9645 instead of calling Target_arm::reloc_uses_thumb_bit().
9646
218c5831
DK
96472010-02-02 Doug Kwan <dougkwan@google.com>
9648
9649 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9650 types of relaxed input section.
9651
0d31c79d
DK
96522010-02-02 Doug Kwan <dougkwan@google.com>
9653
9654 * Makefile.am (HFILES): Add arm-reloc-property.h.
9655 (DEFFILES): New.
2e702c99
RM
9656 (TARGETSOURCES): Add arm-reloc-property.cc
9657 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9658 (libgold_a_SOURCES): $(DEFFILES)
9659 * Makefile.in: Regenerate.
9660 * arm-reloc-property.cc: New file.
9661 * arm-reloc-property.h: New file.
9662 * arm-reloc.def: New file.
9663 * arm.cc: Update comments.
9664 (arm-reloc-property.h): New included header.
9665 (arm_reloc_property_table): New global variable.
9666 (Target_arm::do_select_as_default_target): New method definition.
9667 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9668 arm-reloc-property to targ_extra_obj.
9669 * parameters.cc (set_parameters_target): Call
9670 Target::select_as_default_target().
9671 * target.h (Target::select_as_default_target): New method definition.
9672 (Target::do_select_as_default_target): Same.
9673
546c7457
DK
96742010-02-01 Doug Kwan <dougkwan@google.com>
9675
9676 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9677 first_output_text_section_.
9678 (Arm_exidx_fixup::first_output_text_section): New method definition.
9679 (Arm_exidx_fixup::first_output_text_section_): New data member.
9680 (Arm_exidx_fixup::process_exidx_section): Record the first text
9681 output section seen.
9682 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9683 and entsize in output section header.
9684
11b861d5
DK
96852010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9686
9687 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9688 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9689 (Arm_relocate_functions::thm_alu11): New Method.
9690 (Arm_relocate_functions::thm_pc8): New Method.
9691 (Arm_relocate_functions::thm_pc12): New Method.
9692 (Target_arm::Scan::local): Handle the relocations.
9693 (Target_arm::Scan::global): Likewise.
9694 (Target_arm::Relocate::relocate): Likewise.
9695 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9696
c9a2c125
DK
96972010-01-29 Doug Kwan <dougkwan@google.com>
9698
9699 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9700 of relocation types as ld.
9701
1521477a
DK
97022010-01-29 Doug Kwan <dougkwan@google.com>
9703
9704 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9705 to public.
9706 (Arm_relocate_functions::thumb_branch_common): Ditto.
9707 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9708 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9709 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9710 Arm_relocate_functions::jump24): Remove.
9711 (Target_arm::Relocate::relocate): Adjust code to call
9712 Arm_relocation_functions::arm_branch_common and
9713 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9714 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9715
e7eca48c
DK
97162010-01-29 Doug Kwan <dougkwan@google.com>
9717
9718 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9719 output_local_symbol_count_needs_update_.
9720 (Arm_relobj::output_local_symbol_count_needs_update,
9721 Arm_relobj::set_output_local_symbol_count_needs_update,
9722 Arm_relobj::update_output_local_symbol_count): New methods.
9723 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9724 member.
9725 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9726 of pointed function as in a R_ARM_PREL31 relocation.
9727 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9728 for output local symbol count updating.
9729 (Target_arm::do_relax): Update output local symbol counts in objects
9730 if necessary.
9731 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9732
02961d7e
ILT
97332010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9734
9735 * arm.cc: Added support for the ARM relocations:
9736 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9737 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9738 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9739 movw_prel_nc).
9740 (Arm_relocate_functions::movw_rel): New method.
9741 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9742 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9743 thm_movw_prel_nc).
9744 (Arm_relocate_functions::thm_movw_rel): New method.
9745 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9746 thm_movt_prel).
9747 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9748 relocations.
9749 (Target_arm::Scan::global): Likewise.
9750 (Target_arm::Relocate::relocate): Likewise.
9751 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9752 Likewise.
9753
b10d2873
ILT
97542010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9755
9756 * arm.cc: Added support for ARM group relocations.
9757 (Target_arm::reloc_needs_sym_origin): New method.
9758 (Arm_relocate_functions::calc_grp_kn): New method.
9759 (Arm_relocate_functions::calc_grp_residual): New method.
9760 (Arm_relocate_functions::calc_grp_gn): New method.
9761 (Arm_relocate_functions::arm_grp_alu): New Method.
9762 (Arm_relocate_functions::arm_grp_ldr): New Method.
9763 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9764 (Arm_relocate_functions::arm_grp_ldc): New Method.
9765 (Target_arm::Scan::local): Handle the ARM group relocations.
9766 (Target_arm::Scan::global): Likewise.
9767 (Target_arm::Relocate::relocate): Likewise.
9768 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9769 Likewise.
9770
2b328d4e
DK
97712010-01-26 Doug Kwan <dougkwan@google.com>
9772
9773 * arm.cc (set): Include.
9774 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9775 pointer type.
2e702c99 9776 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9777 (Arm_output_section::append_text_sections_to_list): New method.
9778 (Arm_output_section::fix_exidx_coverage): Ditto.
9779 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9780 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9781 Relobj::set_section_offset() instead of
9782 Sized_relobj::invalidate_section_offset().
2e702c99 9783 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9784 parameter for section headers. Ignore relocation sections for
9785 unallocated sections and EXIDX sections.
9786 (Target_arm::fix_exidx_coverage): New method.
9787 (Target_arm::output_section_address_less_than): New type.
9788 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9789 linked text section instead of the EXIDX section.
9790 (Arm_output_section::create_stub_group): Add an assertion to check
9791 that this is not an EXIDX output section.
9792 (Arm_output_section::append_text_sections_to_list): New method.
9793 (Arm_output_section::fix_exidx_coverage): Ditto.
9794 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9795 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9796 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9797 first pass.
9798 (Target_arm::fix_exidx_coverage): New method.
9799 * object.h (Relobj::set_output_section): New method.
9800 (Sized_relobj::invalidate_section_offset): Remove method.
9801 (Sized_relobj::do_invalidate_section_offset): Remove method.
9802 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9803
c7f3c371
DK
98042010-01-25 Doug Kwan <dougkwan@google.com>
9805
9806 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9807 Fix warning due to signed and unsigned comparison on a 32-bit host.
9808
8923b24c
DK
98092010-01-22 Doug Kwan <dougkwan@google.com>
9810
9811 * arm.cc (Target_arm::do_relax): Record an output section for section
9812 offset adjustment it contains any stub table that has changed.
9813 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9814 offsets in an output section if necessary.
9815 * output.cc (Output_section::Output_section): Initialize
9816 section_offsets_need_adjustments_.
9817 (Output_section::add_input_section_for_script): Renamed to
9818 Output_section::add_simple_input_section.
9819 (Output_section::save_states): Add a comment.
9820 (Output_section::discard_states): New method defintion.
9821 (Output_section::adjust_section_offsets): Same.
9822 * output.h (Output_section::add_input_section_for_script): Renamed to
9823 Output_section::add_simple_input_section.
9824 (Output_section::discard_states): New method declaration.
9825 (Output_section::adjust_section_offsets): Same.
9826 (Output_section::section_offsets_need_adjustment,
9827 Output_section::set_section_offsets_need_adjustment): New method
9828 definitions.
9829 (Output_section::section_offsets_need_adjustment_): New data member.
9830 * script-sections.cc
9831 (Output_section_element_input::set_section_address): Adjust code for
9832 renaming of Output_section::add_input_section_for_script.
9833 (Orphan_output_section::set_section_address): Same.
9834
9b2fd367
DK
98352010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9836
9837 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9838 Fix_v4bx enum values .
9839 * gold/options.h (General_options): New option definitions.
9840 (General_options::fix_v4bx): New method.
9841 (General_options::Fix_v4bx): New enum.
9842 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9843 (General_options::parse_fix_v4bx_interworking): New method.
9844
80d0d023
DK
98452010-01-22 Doug Kwan <dougkwan@google.com>
9846
9847 * arm.cc (Arm_exidx_fixup): New class.
9848
af2cdeae
DK
98492010-01-21 Doug Kwan <dougkwan@google.com>
9850
9851 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9852 classes.
9853 (Arm_exidx_section_offset_map): New type.
9854
993d07c1
DK
98552010-01-21 Doug Kwan <dougkwan@google.com>
9856
9857 * arm.cc (Arm_exidx_input_section): New class.
9858 (Arm_relobj::exidx_input_section_by_link,
9859 Arm_relobj::exidx_input_section_by_shndx,
9860 Arm_relobj::make_exidx_input_section): New methods.
9861 (read_arm_attributes_section): Remove.
9862 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9863 information about them.
9864 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9865 to here.
9866
5ac169d4
DK
98672010-01-20 Doug Kwan <dougkwan@google.com>
9868
9869 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9870 Input_section_specifier to Section_id.
9871 (Target_arm::new_arm_input_section: Adjust code for change of key
9872 type.
9873 (Target_arm::find_arm_input_section): Ditto.
9874 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9875 (Section_id): Remove.
9876 (Garbage_collection::Section_id_hash): Remove.
9877 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9878 (Section_id): Remove.
9879 (Icf::Section_id_hash): Remove.
9880 * object.h (Section_id, Const_section_id, Section_id_hash,
9881 Const_section_id_hash): New type definitions.
9882 * output.cc (Output_section::add_relaxed_input_section): Change to
9883 use Const_section_id instead of Input_section_specifier as key type.
9884 (Output_section::add_merge_input_section): Ditto.
9885 (Output_section::build_relaxation_map): Change to use Section_id
9886 instead of Input_section_specifier as key type.
2e702c99 9887 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9888 Ditto.
9889 (Output_section::convert_input_sections_to_relaxed_sections): Change
9890 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9891 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9892 (Output_section::find_relaxed_input_section): Ditto.
9893 * output.h (Input_section_specifier): Remove class.
9894 (Output_section::Output_section_data_by_input_section_map): Change
9895 key type to Const_section_id.
9896 (Output_section::Output_relaxed_input_section_by_input_section_map):
9897 Ditto.
9898 (Output_section::Relaxation_map): Change key type to Section_id.
9899
a2162063
ILT
99002010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9901
9902 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9903 (class Arm_v4bx_stub): New class.
9904 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9905 (Stub_factory::make_arm_v4bx_stub): New method.
9906 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9907 (Stub_table::empty): Handle v4bx stubs.
9908 (Stub_table::add_arm_v4bx_stub): New method.
9909 (Stub_table::find_arm_v4bx_stub): New method.
9910 (Arm_relocate_functions::v4bx): New method.
9911 (Target_arm::fix_v4bx): New method.
9912 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9913 (Stub_table::relocate_stubs): Likewise.
9914 (Stub_table::do_write): Likewise.
9915 (Stub_table::update_data_size_and_addralign): Likewise.
9916 (Stub_table::finalize_stubs): Likewise.
9917 (Target_arm::Scan::local): Likewise.
9918 (Target_arm::Scan::global): Likewise.
9919 (Target_arm::do_finalize_sections): Likewise.
9920 (Target_arm::Relocate::relocate): Likewise.
9921 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9922 Likewise.
9923 (Target_arm::scan_reloc_for_stub): Likewise.
9924 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9925
5696ab0b
ILT
99262010-01-19 Ian Lance Taylor <iant@google.com>
9927
9928 * output.cc (Output_section_headers::do_sized_write): Write large
9929 segment count to sh_info field.
9930 (Output_file_header::do_sized_write): For large segment count,
9931 write PN_XNUM to e_phnum field.
9932
800d0f56
ILT
99332010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9934
9935 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9936 (Arm_relocate_functions::thm_jump8): New function.
9937 (Arm_relocate_functions::thm_jump11): New function.
9938 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9939 R_ARM_THM_JUMP11.
9940 (Target_arm::Scan::global): Likewise.
9941 (Target_arm::Relocate::relocate): Likewise.
9942 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9943 Likewise.
9944
41263c05
DK
99452010-01-14 Doug Kwan <dougkwan@google.com>
9946
9947 * arm.cc (map, utility): Include headers.
9948 (Target_arm::apply_cortex_a8_workaround): New method.
9949 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9950 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9951 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9952 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9953 the --[no-]fix-cortex-a8 command line options.
9954 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9955 (Target_arm::relocate_stub): Use addend in instruction template.
9956 * options.h (DEFINE_bool): Set the user-set flag.
9957 (General_options): Add --[no-]-fix-cortex options.
9958 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9959 : Update fast look-up map after conversion.
41263c05 9960
459e9b03
ST
99612010-01-14 Sriraman Tallam <tmsriram@google.com>
9962
9963 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9964 in the first pass of do_layout.
9965
b521dfe4
DK
99662010-01-13 Doug Kwan <dougkwan@google.com>
9967
9968 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9969 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9970 apparent compiler problem of not folding static constant integral
9971 data members of elfcpp::Elf_sizes<32>.
9972
44272192
DK
99732010-01-13 Doug Kwan <dougkwan@google.com>
9974
9975 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9976 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9977 Arm_relobj::scan_section_for_cortex_a8_erratum,
9978 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9979 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9980 sections to scan for relocation stubs into a new method
9981 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9982 relocation and Cortex-A8 stub scanning.
9983 (Target_arm::do_relax): Force stubs to be after stubbed sections
9984 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9985 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9986 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9987
44b71ece
ILT
99882010-01-12 Ian Lance Taylor <iant@google.com>
9989
9990 * target-reloc.h (visibility_error): New inline function.
9991 (relocate_section): Call visibility_error.
9992 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9993 (MOSTLYCLEANFILES): Likewise.
9994 (protected_4_pic.o, protected_3.err): New targets.
9995 * testsuite/protected_4.cc: New file.
9996
a120bc7f
DK
99972010-01-12 Doug Kwan <dougkwan@google.com>
9998
9999 * arm.cc (Cortex_a8_reloc): New class.
10000 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10001 and cortex_a8_relocs_info_.
10002 (Target_arm::fix_cortex_a8): New method definition.
10003 (Target_arm::Cortex_a8_relocs_info): New type.
10004 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10005 New data member declarations.
10006 (Target_arm::scan_reloc_for_stub): Record information about
10007 relocations for THUMB branches that might be exempted from the
10008 Cortex-A8 workaround.
10009 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10010 at the beginning of a relaxation pass.
10011
20138696
DK
100122010-01-12 Doug Kwan <dougkwan@google.com>
10013
10014 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10015 (Arm_relobj::Mapping_symbol_position,
10016 Arm_reloj::Mapping_symbol_position_less,
10017 Arm_relobj::Mapping_symbols_info): New types.
10018 (Target_arm::is_mapping_symbol_name): New method definition.
10019 (Arm_relobj::do_count_local_symbols): Save information about mapping
10020 symbols.
10021
089d69dc
DK
100222010-01-11 Doug Kwan <dougkwan@google.com>
10023
10024 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10025 Arm_relocate_functions::thumb32_branch_upper,
10026 Arm_relocate_functions::thumb32_branch_lower,
10027 Arm_relocate_functions::thumb32_cond_branch_offset,
10028 Arm_relocate_functions::thumb32_cond_branch_upper,
10029 Arm_relocate_functions::thumb32_cond_branch_lower,
10030 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10031 branch offset encoding.
10032 (Arm_relocate_functions::thumb_branch_common): Use new branch
10033 offset encoding methods to avoid code duplication.
10034 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10035 (Stub_addend_reader::operator()): Use new branch encoding method
10036 to avoid code duplication.
10037
99e5bff2
DK
100382010-01-11 Doug Kwan <dougkwan@google.com>
10039
10040 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10041 (Target_arm::do_finalize_sections): Define special EXIDX section
10042 symbols only if referenced.
10043 * gc.h (Garbage_collection::add_reference): New method.
10044 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10045 code duplication.
10046
98e090bd
ILT
100472010-01-11 Ian Lance Taylor <iant@google.com>
10048
d0a91bd8
ILT
10049 * script.cc (Version_script_info::build_expression_list_lookup):
10050 Change complaing about duplicate wildcard match from error to
10051 warning.
10052
98e090bd
ILT
10053 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10054 of 2009-12-30.
10055 (Version_script_info::Version_script_info): Initialize globs_,
10056 default_version_, default_is_global_, and exact_. Don't
10057 initialize globals_ or locals_.
10058 (Version_script_info::build_lookup_tables): Build local symbols
10059 first.
10060 (Version_script_info::unquote): New function.
10061 (Version_script_info::add_exact_match): New function.
10062 (Version_script_info::build_expression_list_lookup): Remove lookup
10063 parameter. Add is_global parameter. Change all callers. Handle
10064 wildcard pattern specially. Unquote pattern. Call
10065 add_exact_match.
10066 (Version_script_info::get_name_to_match): New function.
10067 (Version_script_info::get_symbol_version): New function.
10068 (Version_script_info::get_symbol_version_helper): Remove.
10069 (Version_script_info::check_unmatched_names): Call unquote.
10070 * script.h (class Version_script_info): Change get_symbol_version
10071 to be non-inline and add is_global parameter; change all callers.
10072 Rewrite symbol_is_local. Update declarations. Define struct
10073 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10074 Remove globals_ and locals_ members. Add exact_, globs_,
10075 default_version_, is_global_.
10076 (Version_script_info::Glob): Remove pattern, add expression and
10077 is_global. Update constructor. Change all callers.
10078 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10079 default version.
10080 (Versions::symbol_section_contents): If a symbol is undefined, or
10081 defined in a dynamic object, set the version index to
10082 VER_NDX_LOCAL.
10083 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10084 symbol_is_local.
10085 (Symbol_table::add_from_pluginobj): Likewise.
10086 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10087
d56962d3
DK
100882010-01-11 Doug Kwan <dougkwan@google.com>
10089
10090 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10091 (incremental_dump_LDADD): Add linking option for libintl.
10092 * Makefile.in: Regenerate.
10093
94e6ee91
L
100942010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10095
10096 PR gold/11144
10097 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10098 instead of -Ds.
10099 * testsuite/Makefile.in: Regenerated.
10100
e96c574b
DK
101012010-01-10 Doug Kwan <dougkwan@google.com>
10102
10103 * options.h (DEFINE_var): Use parentheses around argument varname__
10104 in macro body to avoid any unintended subsequent substitutions.
10105
7198066b
ILT
101062010-01-10 Ian Lance Taylor <iant@google.com>
10107
ba4d53bf
ILT
10108 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10109 candidates before doing symbol resolution.
10110
7198066b
ILT
10111 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10112 ODR candidates if only one is weak.
10113
a2beed37
ILT
101142010-01-08 Ian Lance Taylor <iant@google.com>
10115
10116 * script.cc (Version_script_info::build_expression_list_lookup):
10117 Don't warn about ambiguous version, just record the ambiguity.
10118 (Version_script_info::get_symbol_version_helper): Give error if
10119 version is ambiguous.
10120
2fb7225c
DK
101212010-01-08 Doug Kwan <dougkwan@google.com>
10122
10123 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10124 prev_data_size_ and prev_addralign_. Remove initializer for
10125 deleted data member has_been_changed_.
10126 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10127 to determine if the table is empty.
10128 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10129 Remove.
10130 (Stub_table::add_reloc_stub): Define method in class definition
10131 instead of just declaring it there.
10132 (Stub_table::add_cortex_a8_stub): New method definition.
10133 (Stub_table::update_data_size_and_addralign): Ditto.
10134 (Stub_table::finalize_stubs): Ditto.
10135 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10136 (Stub_table::do_addralign_): Return address alignment in the
10137 (Stub_table::do_reset_address_and_file_offset): Define method in
10138 class definition instead of declaring it there. Set current data
10139 size to be the data size of the previous pass.
10140 (Stub_table::set_final_data_size): Use current data size as the
10141 final data size.
10142 (Stub_table::relocate_stub): Change parameter type of stub from
10143 Reloc_stub pointer to Stub pointer.
10144 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10145 (Stub_table::Cortex_a8_stub_list): New typedef.
10146 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10147 Stub_table::prev_addralign_): New data member.
10148 (Arm_relobj::Arm_relobj): Initialize data member
10149 section_has_cortex_a8_workaround_.
10150 (Arm_relobj::section_has_cortex_a8_workaround,
10151 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10152 definitions.
10153 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10154 declarations.
10155 (Target_arm::relocate_stub): Change parameter type of stub from
10156 Reloc_stub pointer to Stub pointer.
10157 (Insn_template::size, Insn_template::alignment): Handle
10158 THUMB16_SPECIAL_TYPE.
10159 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10160 Stub_table::update_data_size_and_addralign,
10161 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10162 definitions.
10163 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10164 (Stub_table::do_write): Ditto.
10165 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10166
880cd20d
ILT
101672010-01-08 Ian Lance Taylor <iant@google.com>
10168
10169 PR 11108
10170 * symtab.h (class Symbol): Remove fields is_target_special_ and
10171 has_plt_offset_. Add field is_defined_in_discarded_section_.
10172 (Symbol::is_defined_in_discarded_section): New function.
10173 (Symbol::set_is_defined_in_discarded_section): New function.
10174 (Symbol::has_plt_offset): Rewrite.
10175 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10176 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10177 Don't initialize is_target_special_ or has_plt_offset_.
10178 Initialize is_defined_in_discarded_section_.
10179 (Symbol_table::add_from_relobj): If appropriate, set
10180 is_defined_in_discarded_section.
10181 * resolve.cc (Symbol::override_base_with_special): Don't test
10182 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10183 * target-reloc.h (relocate_section): Do special handling for
10184 symbols defined in discarded sections for global symbols as well
10185 as local symbols.
10186
2703e3eb
ILT
101872010-01-08 Ian Lance Taylor <iant@google.com>
10188
10189 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10190 the SHT_SYMTAB case.
10191
339d40a3
ILT
101922010-01-08 Ian Lance Taylor <iant@google.com>
10193
10194 * object.cc (Sized_relobj::do_layout): Don't get confused if
10195 layout_eh_frame returns NULL.
10196
abecea76
ILT
101972010-01-08 Ian Lance Taylor <iant@google.com>
10198
10199 PR 11084
10200 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10201 dynamic symbol table, use the normal symbol table.
10202 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10203 symbol table.
10204
6b7dd3f3
ILT
102052010-01-08 Ian Lance Taylor <iant@google.com>
10206
10207 PR 11072
10208 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10209 sections.
10210
36c50e63
L
102112010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10212
10213 * version.cc (print_version): Change to "Copyright 2010".
10214
e291e7b9
ILT
102152010-01-08 Ian Lance Taylor <iant@google.com>
10216
10217 PR 10287
10218 PR 11063
10219 * i386.cc (class Target_i386): Change return type of plt_section
10220 to be non-const.
10221 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10222 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10223 tls_desc_rel_ field.
10224 (Output_data_plt_i386::rel_tls_desc): New function.
10225 (Target_i386::rel_tls_desc_section): New function.
10226 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10227 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10228 R_386_TLS_DESC reloc in rel_tls_desc_section.
10229 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10230 Define struct Tlsdesc_info.
10231 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10232 (Target_x86_64::do_reloc_symbol_index): New function.
10233 (Target_x86_64::add_tlsdesc_info): New function.
10234 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10235 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10236 tlsdesc_rel_ field.
10237 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10238 all callers.
10239 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10240 (Target_x86_64::rela_tlsdesc_section): New function.
10241 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10242 handling.
10243 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10244 (Target_x86_64::do_reloc_addend): New function.
10245 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10246 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10247 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10248 (Output_reloc::type): New function.
10249 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10250 (Output_reloc::is_target_specific): New function.
10251 (Output_reloc::target_arg): New function.
10252 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10253 absolute relocs and target specific relocs.
10254 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10255 add_target_specific.
10256 (class Output_data_reloc) [SHT_RELA]: Likewise.
10257 * output.cc (Output_reloc::Output_reloc): Add four new versions
10258 for absolute relocs and target specific relocs.
10259 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10260 (Output_reloc::get_symbol_index): Likewise.
10261 (Output_reloc::local_section_offset): Check that local_sym_index_
10262 is not TARGET_CODE or 0.
10263 (Output_reloc::symbol_value): Likewise.
10264 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10265 reloc.
10266 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10267 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10268 functions.
10269 * layout.cc (add_target_dynamic_tags): Use output section for
10270 DT_PLTRELSZ and DT_JMPREL.
10271
3a44184e
ILT
102722010-01-07 Ian Lance Taylor <iant@google.com>
10273
10274 PR 11061
10275 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10276 function.
10277 (class Output_data_reloc_generic): Define.
10278 (class Output_data_reloc_base): Change base class to
10279 Output_data_reloc_generic. Change add() method to call
10280 bump_relative_reloc_count for a relative reloc. Remove
10281 sort_relocs_ field.
10282 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10283 to sort_relocs().
10284 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10285 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10286 appropriate.
10287 * layout.h (class Layout): Update declaration.
10288
ea715a34
ILT
102892010-01-07 Ian Lance Taylor <iant@google.com>
10290
10291 * output.h (class Output_data): Add const version of
10292 output_section and do_output_section.
10293 (class Output_section_data): Add const version of
10294 do_output_section.
10295 (class Output_section): Likewise.
10296 * layout.cc (Layout::add_target_dynamic_tags): New function.
10297 * layout.h (class Layout): Update declarations.
10298 * arm.cc (Target_arm::do_finalize_sections): Use
10299 add_target_dynamic_tags.
10300 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10301 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10302 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10303 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10304
659948a4
ILT
103052010-01-07 Ian Lance Taylor <iant@google.com>
10306
10307 PR 11042
10308 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10309 object as needed.
10310
9d3b86f6
ILT
103112010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10312 Ian Lance Taylor <iant@google.com>
10313
10314 PR 11019
10315 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10316 Xindex::read_symtab_xindex.
10317
bb0d3eb0
DK
103182010-01-07 Doug Kwan <dougkwan@google.com>
10319
10320 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10321 (Insn_template::thumb16_bcond_insn): New method declaration.
10322 (Insn_template): Fix spelling.
10323 (Stub::thumb16_special): New method declaration.
10324 (Stub::do_write): Define virtual method which was previously pure
10325 virtual.
10326 (Stub::do_thumb16_special): New method declaration.
10327 (Stub::do_fixed_endian_write): New template member.
10328 (Reloc_stub::do_write): Remove.
10329 (Reloc_stub::do_fixed_endian_write): Remove.
10330 (Cortex_a8_stub): New class definition.
10331 (Stub_factory::make_cortex_a8_stub): New method definition.
10332 (Stub_factory::Stub_factory): Add missing static storage class
10333 qualifier for elf32_arm_stub_a8_veneer_blx.
10334
ffeef7df
ILT
103352010-01-07 Ian Lance Taylor <iant@google.com>
10336
dc3f80fe
ILT
10337 PR 10980
10338 * options.h (class General_options): Add --warn-unresolved-symbols
10339 and --error-unresolved-symbols.
10340 * errors.cc (Errors::undefined_symbol): Implement
10341 --warn-unresolved-symbols.
10342
ffeef7df
ILT
10343 * options.h (class General_options): Add -z text and -z textoff.
10344 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10345
f1ec9ded
ST
103462010-01-06 Sriraman Tallam <tmsriram@google.com>
10347
10348 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10349 (Garbage_collection::cident_sections): New function.
10350 (Garbage_collection::add_cident_section): New function.
10351 (Garbage_collection::cident_sections_): New member.
10352 (gc_process_relocs): Add references to sections whose names are C
10353 identifiers.
10354 * gold.h (cident_section_start_prefix): New constant.
10355 (cident_section_stop_prefix): New constant.
10356 (is_cident): New function.
10357 * layout.cc (Layout::define_section_symbols): Replace string constants
10358 with the newly defined constants.
10359 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10360 C identifiers.
10361 * testsuite/Makefile.am: Add gc_orphan_section_test.
10362 * testsuite/Makefile.in: Regenerate.
10363 * testsuite/gc_orphan_section_test.cc: New file.
10364 * testsuite/gc_orphan_section_test.sh: New file.
10365
6eda8c29
ILT
103662010-01-06 Ian Lance Taylor <iant@google.com>
10367
b9674e17
ILT
10368 PR 10980
10369 * options.h (class General_options): Add --warn-shared-textrel.
10370 * layout.cc (Layout::finish_dynamic_section): Implement
10371 --warn-shared-textrel.
10372
6eda8c29
ILT
10373 PR 10980
10374 * options.h (class General_options): Add --warn-multiple-gp.
10375
32dcd44e
ILT
103762010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10377
10378 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10379 $(THREADSLIB) and $(LIBDL).
10380 * Makefile.in: Rebuild.
10381
a192ba05
ILT
103822010-01-06 Ian Lance Taylor <iant@google.com>
10383
10384 PR 10980
10385 * options.cc (General_options::parse_section_start): New function.
10386 (General_options::section_start): New function.
10387 (General_options::General_options): Initialize all members.
10388 * options.h: Include <map>
10389 (class General_options): Add --section-start. Add section_starts_
10390 member.
10391 * layout.cc (Layout::attach_allocated_section_to_segment): If
10392 --section-start was used, set the address of the segment. Remove
10393 local sort_sections.
10394 (Layout::relaxation_loop_body): If the address of the load segment
10395 has been set by --section-start, don't use it.
10396 * output.h (Output_segment::update_flags_for_output_section): New
10397 function.
10398 * output.cc (Output_segment::add_output_section): Call
10399 update_flags_for_output_section.
10400
dde3f402
ILT
104012010-01-05 Ian Lance Taylor <iant@google.com>
10402
62dfdd4d
ILT
10403 PR 10980
10404 * options.h (class General_options): Add --undefined-version.
10405 * script.cc (struct Version_expression): Add was_matched_by_symbol
10406 field.
10407 (Version_script_info::matched_symbol): New function.
10408 (Version_script_info::get_symbol_version_helper): Call
10409 matched_symbol.
10410 (Version_script_info::check_unmatched_names): New function.
10411 * script.h (class Version_script_info): Update declarations.
10412 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10413
9c4ae156
ILT
10414 * options.h (class General_options): Use DEFINE_bool_alias for
10415 allow_multiple_definition.
10416 * resolve.cc (Symbol_table::should_override): Don't test
10417 allow_multiple_definition.
10418
dde3f402
ILT
10419 PR 10980
10420 * options.h (class General_options): Add --cref.
10421 * main.cc (main): Print cref table if --cref. Don't close mapfile
10422 until after printing cref table.
10423 * cref.cc: Include "symtab.h".
10424 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10425 (Cref_table_compare::operator()): New function.
10426 (Cref_inputs::gather_cref): New function.
10427 (filecol): New static const.
10428 (Cref_inputs::print_cref): New function.
10429 (Cref::print_cref): New function.
10430 * cref.h: Include <cstdio>.
10431 (class Cref): Update declarations.
10432 * mapfile.h (Mapfile::file): New function.
10433 * object.h (class Object): Define Symbols. Declare virtual
10434 do_get_global_symbols.
10435 (Object::get_global_symbols): New function.
10436 * object.cc (Input_objects::add_object): Pass object to cref_ if
10437 --cref.
10438 (Input_objects::archive_start): Likewise.
10439 (Input_objects::archive_stop): Likewise.
10440 (Input_objects::print_cref): New function.
10441 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10442 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10443 --cref.
10444 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10445 function.
10446 * plugin.h (class Sized_pluginobj): Update declarations.
10447
8781f709
ILT
104482010-01-05 Ian Lance Taylor <iant@google.com>
10449
10450 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10451 to is_default_version. Rename insdef to insdefault.
10452 (Symbol_table::add_from_relobj): Rename def to is_default_version
10453 and local to is_forced_local.
10454 (Symbol_table::add_from_pluginobj): Likewise.
10455 (Symbol_table::add_from_dynobj): Likewise.
10456 (Symbol_table::define_special_symbol): Rename insdef to
10457 insdefault.
10458
fe35d28d
ILT
104592010-01-04 Ian Lance Taylor <iant@google.com>
10460
30bc8c46
ILT
10461 PR 10980
10462 * options.h (class General_options): Add
10463 --allow-multiple-definition and -z muldefs.
10464 * resolve.cc (Symbol_table::should_override): Don't warn about a
10465 multiple symbol definition if --allow-multiple-definition or -z
10466 muldefs.
10467
7eaea549
ILT
10468 PR 10980
10469 * options.h (class General_options): Add --add-needed and
10470 --copy-dt-needed-entries. Tweak --as-needed help entry.
10471 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10472 error if --copy-dt-needed-entries aka --add-needed is used and
10473 would cause a change in behaviour.
10474
fe35d28d
ILT
10475 PR 10980
10476 * options.h (class General_options): Add -G as a short version of
10477 --shared. Add no-op options -assert, -g, and -i.
10478
55a2bb35
ST
104792010-01-04 Sriraman Tallam <tmsriram@google.com>
10480
10481 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10482 check for .text or .gnu.linkonce.t sections.
10483 * icf.cc (Icf::find_identical_sections): Ditto.
10484 Change the detection for mangled function name within the section
10485 name.
10486 * icf.h (is_section_foldable_candidate): New function.
10487
719328e1
ILT
104882009-12-30 Ian Lance Taylor <iant@google.com>
10489
10490 PR 10980
10491 * options.h (class General_options): Permit two dashes with
10492 --retain-symbols-file.
10493
d7bb5745
ILT
104942009-12-30 Ian Lance Taylor <iant@google.com>
10495
403a15dd
ILT
10496 PR 10979
10497 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10498 don't put the file header and segment headers in the text
10499 segment.
10500
eda294df
ILT
10501 PR 10979
10502 * common.cc (Sort_commons::operator()): Stabilize sort when both
10503 entries are NULL.
10504 (Symbol_table::do_allocate_commons_list): When allocating common
10505 symbols, skip a symbol which is no longer common.
10506 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10507 an object before checking its type.
10508 * testsuite/common_test_2.c: New file.
10509 * testsuite/common_test_3.c: New file.
10510 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10511 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10512 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10513 (common_test_2_pic.o, common_test_2.so): New targets.
10514 (common_test_3_pic.o, common_test_3.so): New targets.
10515 * testsuite/Makefile.in: Rebuild.
10516
d7bb5745
ILT
10517 PR 10979
10518 * script.cc (read_input_script): If we see a new SECTIONS clause,
10519 and we have added an input section, give an error.
10520 * layout.h (class Layout): Add have_added_input_section function.
10521 Add have_added_input_section_ field.
10522 * layout.cc (Layout::Layout): Initialize
10523 have_added_input_section_.
10524 (Layout::layout): Set have_added_input_section_.
10525 (Layout::layout_eh_frame): Likewise.
10526
fc59c572
ILT
105272009-12-30 Ian Lance Taylor <iant@google.com>
10528
10529 PR 10931
10530 * options.h (class General_options): Add --sort-common option.
10531 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10532 * common.cc (Sort_common): Add sort_order parameter to
10533 constructor. Add sort_order_ field.
10534 (Sort_commons::operator): Check sort_order_.
10535 (Symbol_table::allocate_commons): Determine the sort order.
10536 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10537 Change all callers.
10538 (Symbol_table::do_allocate_commons_list): Likewise.
10539
1c74fab0
ILT
105402009-12-30 Ian Lance Taylor <iant@google.com>
10541
10542 PR 10916
10543 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10544 symbols from this object, don't change the visibility of an
10545 undefined symbol.
10546 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10547
6affe781
ILT
105482009-12-30 Ian Lance Taylor <iant@google.com>
10549
10550 PR 10861
10551 * script.h (class Version_script_info): Define Language enum.
10552 Update declarations. Define Glob, Exact, and Lookup types. Add
10553 new fields globals_, locals_, and is_finalized_.
10554 * script.cc: Various formatting fixes.
10555 (class Parser_closure): Change language_stack_ from a vector of
10556 std::string to one of Version_script_info::Language. Adjust all
10557 uses accordingly.
10558 (class Lazy_demangler): Remove.
10559 (struct Version_expression): Change language from std::string to
10560 Version_script_info::Language.
10561 (Version_script_info::Version_script_info): New function.
10562 (Version_script_info::~Version_script_info): Don't call clear.
10563 (Version_script_info::finalize): New function.
10564 (Version_script_info::build_lookup_tables): New function.
10565 (Version_script_info::build_expression_list_lookup): New
10566 function.
10567 (Version_script_info::get_symbol_version_helper): Rewrite to use
10568 lookup tables.
10569 (Version_script_info::print_expression_list): Adjust to use
10570 Version_script_info::Language.
10571 (script_push_lex_into_version_mode): Check that the version script
10572 has not been finalized.
10573 (version_script_push_lang): Change language string to
10574 Version_script_info::Language.
10575 * options.cc (Command_line::version_script): New function.
10576 * options.h (class General_options): Add finalize_dynamic_list
10577 function. Change version_script from declaration to definition.
10578 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10579 * testsuite/version_script.map: Remove duplicate def of foo.
10580 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10581 version_script.map.
10582 * testsuite/Makefile.in: Rebuild.
10583
818bf354
ILT
105842009-12-30 Ian Lance Taylor <iant@google.com>
10585
10586 PR 10843
10587 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10588 if the input symbol index is 0, make the output symbol index 0.
10589
ebcc8304
ILT
105902009-12-30 Ian Lance Taylor <iant@google.com>
10591
10592 PR 10670
10593 * options.h (class General_options): Add -x/--discard-all.
10594 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10595 --discard-all. If the local symbol needs a dynamic entry, check
10596 that before handling --discard-locals.
10597
176fe33f
ILT
105982009-12-30 Ian Lance Taylor <iant@google.com>
10599
bb321bb1
ILT
10600 PR 10450
10601 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10602 flags to PF_R.
10603 (Output_segment::add_output_section): Don't change the flags if
10604 the type is PT_TLS.
10605
176fe33f
ILT
10606 PR 10450
10607 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10608 GNU hash table if they need a dynamic value. Otherwise, don't add
10609 them if they are defined in a dynamic object or are forced local.
10610
e8cd95c7
ILT
106112009-12-29 Ian Lance Taylor <iant@google.com>
10612
1b81fb71
ILT
10613 PR 10450
10614 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10615 .gnu.hash table for a 32-bit target.
10616
8d6d383d
ILT
10617 PR 10450
10618 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10619 regular and a dynamic object only needs a dynamic symbol table
10620 entry if it is externally visible.
10621
e785ec03
ILT
10622 PR 10450
10623 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10624 constructor. Add global_offset_table_ field.
10625 (Target_i386::got_section): Set global_offset_table_.
10626 (Target_i386::do_finalize_sections): Set global_offset_table_
10627 size.
10628 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10629 in constructor. Add global_offset_table_ field.
10630 (Target_x86_64::got_section): Set global_offset_table_.
10631 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10632 size.
10633
1a2dff53
ILT
10634 * layout.cc (Layout::Layout): Initialize increase_relro_.
10635 (Layout::get_output_section): Add is_relro, is_last_relro, and
10636 is_first_non_relro parameters. Change all callers.
10637 (Layout::choose_output_section): Likewise.
10638 (Layout::add_output_section_data): Likewise.
10639 (Layout::make_output_section): Likewise.
10640 (Layout::set_segment_offsets): Clear increase_relro when using a
10641 linker script.
10642 * layout.h (class Layout): Add increase_relro method. Add
10643 increase_relro_ field. Update declarations.
10644 * output.cc (Output_section::Output_section): Initialize
10645 is_last_relro_ and is_first_non_relro_.
10646 (Output_segment::add_output_section): Group relro sections is
10647 do_sort is true. Handle is_last_relro and is_first_non_relro.
10648 (Output_segment::maximum_alignment): Remove relro handling.
10649 (Output_segment::set_section_addresses): Add increase_relro
10650 parameter. Change all callers. Add initial alignment to align
10651 relro sections on separate page. Remove old relro handling.
10652 (Output_segment::set_section_list_addresses): Remove in_relro
10653 parameter. Change all callers.
10654 (Output_segment::set_offset): Add increase parameter. Change all
10655 callers. Remove old relro handling.
10656 * output.h (class Output_section): Add new methods: is_last_relro,
10657 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10658 Add is_last_relro_ and is_first_non_relro_ fields.
10659 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10660 Create separate .got.plt section. Call increase_relro.
10661 * x86_64.cc (Target_x86_64::got_section): Likewise.
10662 * testsuite/relro_script_test.t: Add .got.plt.
10663
f0ba79e2
ILT
10664 PR 10450
10665 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10666 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10667 (Layout::finalize): Call set_dynamic_symbol_size.
10668 (Layout::set_dynamic_symbol_size): New function.
10669 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10670 set_dynamic_symbol_size.
10671
e8cd95c7
ILT
10672 PR 10450
10673 * output.h (class Output_section): Add is_entsize_zero_ field.
10674 * output.cc (Output_section::Output_section): Initialize
10675 is_entsize_zero_.
10676 (Output_section::set_entsize): If two different entsizes are
10677 requested, force it to zero.
10678 (Output_section::add_input_section): Set flags for .debug_str
10679 before updating section flags. Set entsize.
10680 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10681 and SHF_STRING if all input sections have those flags.
10682
3e1b9a8a
RÁE
106832009-12-29 Rafael Espindola <espindola@google.com>
10684
10685 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10686 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10687 reporting.
3e1b9a8a 10688
3dcad376
ST
106892009-12-29 Sriraman Tallam <tmsriram@google.com>
10690
10691 * options.cc (General_options::parse_version): Allow -v to exit
10692 without an error if there is nothing to link.
10693
084e2665
ILT
106942009-12-29 Ian Lance Taylor <iant@google.com>
10695
10696 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10697 using a version of gcc before 4.1.
10698 * configure: Rebuild.
10699
250acde3
CD
107002009-12-28 Chris Demetriou <cgd@google.com>
10701
10702 * attributes.cc (Output_attributes_section_data::do_write): Use
10703 std::vector::front rather than std::vector::data.
10704
99fff23b
ILT
107052009-12-28 Ian Lance Taylor <iant@google.com>
10706
10707 * symtab.h (class Symbol_table): Add enum Defined.
10708 * resolve.cc (Symbol_table::should_override): Add defined
10709 parameter. Change all callers. Test whether object is NULL
10710 before calling a method on it.
10711 (Symbol_table::report_resolve_problem): Add defined parameter.
10712 Change all callers.
10713 (Symbol_table::should_override_with_special): Likewise.
10714 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10715 parameter. Change all callers.
10716 (Symbol_table::do_define_in_output_data): Likewise.
10717 (Symbol_table::define_in_output_segment): Likewise.
10718 (Symbol_table::do_define_in_output_segment): Likewise.
10719 (Symbol_table::define_as_constant): Likewise.
10720 (Symbol_table::do_define_as_constant): Likewise.
10721 * script.h (class Symbol_assignment): Add is_defsym parameter to
10722 constructor; change all callers.
10723 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10724 parameter. Change all callers. Add is_defsym_ field.
10725 (class Parser_closure): Add parsing_defsym parameter to
10726 constructor; change all callers. Add parsing_defsym accessor
10727 function. Add parsing_defsym_ field.
10728
556bd683
ILT
107292009-12-28 Ian Lance Taylor <iant@google.com>
10730
10731 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10732 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10733
1782c879
ILT
107342009-12-23 Ian Lance Taylor <iant@google.com>
10735
10736 * i386.cc (Target_i386::do_calls_non_split): Recognize
10737 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10738 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10739 -fsplit-stack prologue when using %r11.
1782c879 10740
329ca2b1
ST
107412009-12-21 Sriraman Tallam <tmsriram@google.com>
10742
10743 * options.cc (General_options::parse_version): Make -v continue and do
10744 the link like GNU ld does.
10745
d675ff46
RÁE
107462009-12-17 Rafael Avila de Espindola <espindola@google.com>
10747
10748 * Makefile.am (CCFILES): Add timer.cc.
10749 (HFILES): Add timer.h.
10750 * configure.ac: Check for sysconf and times.
10751 * main.cc: include timer.h.
10752 (main): Use Timer instead of get_run_time.
10753 * timer.cc: New.
10754 * timer.h: New.
10755 * workqueue.cc: include timer.h.
10756 (Workqueue::find_and_run_task):
10757 Report user, sys and wall time.
10758 * Makefile.in: Regenerate.
10759 * config.in: Regenerate.
10760 * configure: Regenerate.
10761
d6344fb5
DK
107622009-12-16 Doug Kwan <dougkwan@google.com>
10763
10764 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10765 sections.
10766 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10767 relaxed input sections.
10768 * output.cc (Output_section::find_relaxed_input_section): Change
10769 return type to Output_relaxed_input_section pointer. Adjust code
10770 for new type of relaxed_input_section_map_.
10771 * output.h (Output_section::find_relaxed_input_section): Change
10772 return type to Output_relaxed_input_section pointer.
10773 (Output_section::Output_relaxed_input_section_by_input_section_map):
10774 New type.
10775 (Output_section::relaxed_input_section_map_): Change type to
10776 Output_section::Output_relaxed_input_section_by_input_section_map.
10777 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10778 input section.
10779
0e0d5469
ILT
107802009-12-15 Ian Lance Taylor <iant@google.com>
10781
10782 * layout.cc (Layout::create_shstrtab): Only write out after input
10783 sections if we are compressing debug sections.
10784
0649a889
ILT
107852009-12-15 Ian Lance Taylor <iant@google.com>
10786
10787 * archive.cc (Archive::add_symbols): Only look up a symbol without
10788 a version if there is, in fact, a version.
10789
2ea97941
ILT
107902009-12-14 Ian Lance Taylor <iant@google.com>
10791
10792 Revert -Wshadow changes, all changes from:
10793 2009-12-11 Doug Kwan <dougkwan@google.com>
10794 2009-12-11 Nick Clifton <nickc@redhat.com>
10795 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10796
b0eec2cc
DK
107972009-12-11 Doug Kwan <dougkwan@google.com>
10798
10799 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10800 due to -Wshadow.
10801 * attributes.cc (Object_attribute::size): Ditto.
10802 (Attributes_section_data::size): Ditto.
10803 (Attributes_section_data::Attributes_section_data): Ditto.
10804 (Output_attributes_section_data::do_write): Ditto.
10805 * attributes.h (Object_attribute::set_type): Ditto.
10806 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10807
91d6fa6a
NC
108082009-12-11 Nick Clifton <nickc@redhat.com>
10809
10810 * archive.cc: Fix shadowed variable warnings.
10811 * arm.cc: Likewise.
10812 * compressed_output.cc: Likewise.
10813 * compressed_output.h: Likewise.
10814 * configure: Likewise.
10815 * dwarf_reader.cc: Likewise.
10816 * dynobj.cc: Likewise.
10817 * dynobj.h: Likewise.
10818 * ehframe.cc: Likewise.
10819 * ehframe.h: Likewise.
10820 * errors.cc: Likewise.
10821 * expression.cc: Likewise.
10822 * fileread.cc: Likewise.
10823 * fileread.h: Likewise.
10824 * freebsd.h: Likewise.
10825 * i386.cc: Likewise.
10826 * icf.cc: Likewise.
10827 * incremental.h: Likewise.
10828 * layout.cc: Likewise.
10829 * layout.h: Likewise.
10830 * mapfile.cc: Likewise.
10831 * merge.cc: Likewise.
10832 * merge.h: Likewise.
10833 * object.cc: Likewise.
10834 * object.h: Likewise.
10835 * options.h: Likewise.
10836 * output.cc: Likewise.
10837 * output.h: Likewise.
10838 * parameters.cc: Likewise.
10839 * plugin.cc: Likewise.
10840 * powerpc.cc: Likewise.
10841 * reduced_debug_output.cc: Likewise.
10842 * reduced_debug_output.h: Likewise.
10843 * reloc.cc: Likewise.
10844 * reloc.h: Likewise.
10845 * resolve.cc: Likewise.
10846 * script-sections.cc: Likewise.
10847 * script.cc: Likewise.
10848 * script.h: Likewise.
10849 * sparc.cc: Likewise.
10850 * symtab.cc: Likewise.
10851 * symtab.h: Likewise.
10852 * target-select.cc: Likewise.
10853 * target-select.h: Likewise.
10854 * token.h: Likewise.
10855 * workqueue.cc: Likewise.
10856 * workqueue.h: Likewise.
10857 * x86_64.cc: Likewise.
10858
a0351a69
DK
108592009-12-10 Doug Kwan <dougkwan@google.com>
10860
10861 * arm.cc (attributes.h): New include.
10862 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10863 (Arm_relobj::~Arm_relobj): Delete object pointed by
10864 attributes_section_data_.
10865 (Arm_relobj::attributes_section_data): New method definition.
10866 (Arm_relobj::attributes_section_data_): New data member declaration.
10867 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10868 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10869 attributes_section_data_.
10870 (Arm_dynobj::attributes_section_data): New method definition.
10871 (Arm_dynobj::attributes_section_data_): New data member declaration.
10872 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10873 initialization value of may_use_blx_ to false.
2e702c99 10874 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10875 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10876 object attributes to compute results instead of hard-coding.
10877 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10878 Target_arm::get_secondary_compatible_arch,
10879 Target_arm::set_secondary_compatible_arch
10880 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10881 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10882 New method declarations.
10883 (Target_arm::get_aeabi_object_attribute): New method definition.
10884 (Target_arm::attributes_section_data_): New data member declaration.
10885 (read_arm_attributes_section): New template definition.
10886 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10887 (Arm_dynobj::do_read_symbols): Ditto.
10888 (Target_arm::do_finalize_sections): Merge attributes sections from
10889 input. Check for BLX use after attributes section merging.
10890 Fix __exidx_start and __exidx_end visibility. Create an
10891 .ARM.attributes section if necessary.
10892 (Target_arm::get_secondary_compatible_arch,
10893 Target_arm::set_secondary_compatible_arch,
10894 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10895 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10896 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10897 New method definitions.
10898
b59befec
ILT
108992009-12-09 Ian Lance Taylor <iant@google.com>
10900
10901 * plugin.cc (Plugin::load): Don't cast from void* to a function
10902 pointer.
10903
1276bc89
ILT
109042009-12-09 Ian Lance Taylor <iant@google.com>
10905
10906 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10907 information fields.
10908
2f2de248
L
109092009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10910
10911 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10912 Replace two_file_shared_1.so with two_file_shared_2.so.
10913 * testsuite/Makefile.in: Regenerated.
10914
4f787271
DK
109152009-12-08 Doug Kwan <dougkwan@google.com>
10916
10917 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10918 (HFILES): Add attributes.h and int_encoding.h.
10919 * Makefile.in: Regenerate.
10920 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10921 function definitions to int_encoding.cc
10922 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10923 prototypes to int_encoding.h
10924 * reduced_debug_output.cc (int_encoding.h): New include.
10925 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10926 function definitions to int_encoding.cc
10927 (insert_into_vector, read_from_pointer): Move template definitions to
10928 int_encoding.h
10929 * attributes.cc: New file.
10930 * attributes.h: New file.
10931 * int_encoding.cc: New file.
10932 * int_encoding.h: New file.
10933
20b52f1a
RÁE
109342009-12-07 Rafael Avila de Espindola <espindola@google.com>
10935
10936 PR gold/11055
10937 * incremental-dump.cc (dump_incremental_inputs): New.
10938 (main): Use dump_incremental_inputs.
10939
53d7974c
L
109402009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10941
10942 PR gold/10893
10943 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10944 checking elfcpp::STT_FUNC.
10945 (Target_i386::Relocate::relocate): Likewise.
10946 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10947
10948 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10949 symbols from shared libraries into normal FUNC symbols.
10950
10951 * symtab.h (Symbol): Add is_func and use it.
10952
05a352e6
DK
109532009-12-05 Doug Kwan <dougkwan@google.com>
10954
10955 * arm.cc (Target_arm::arm_info): Initialize new fields
10956 attributes_section and attributes_vendor.
10957 * i386.cc (Target_i386::i386_info): Same.
10958 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10959 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10960 fields attributes_section and attributes_vendor.
53d7974c 10961 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10962 * target.h (Target::attributes_section, Target::attributes_vendor,
10963 Target::is_attributes_section, Target::attribute_arg_type,
10964 Target::attributes_order): New method definitions.
10965 (Target::Target_info::attributes_section,
10966 Target::Target_info::attributes_vendor): New fields.
10967 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10968 virtual method definitions.
10969 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10970 attributes_section and attributes_vendor.
10971 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10972
f4e5969c
DK
109732009-12-05 Doug Kwan <dougkwan@google.com>
10974
10975 * arm.cc: Update comments about interworking and stub generation.
10976 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10977 considered as non-PIC.
10978 (Arm_relocate_functions::base_abs): Fix formatting.
10979 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10980 of function to use GOT entry address instead of offset.
10981 (Target_arm::Scan::global): Issue an error if a symbol would need a
10982 PLT does not get one because it is untyped. Remove code to create
10983 dynamic symbols for relative branches.
10984 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10985 takes unsigned integer instead of boolean.
10986
1abce4a6
L
109872009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10988
10989 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10990 (two_file_test_LDADD): Likewise.
10991 (common_test_1_LDADD): Likewise.
10992 (exception_test_LDADD) Likewise.
10993 (weak_test_LDADD): Likewise.
10994 (many_sections_test_LDADD): Likewise.
10995 (initpri1_LDADD): Likewise.
10996 (script_test_1_LDADD): Likewise.
10997 (script_test_2_LDADD): Likewise.
10998 (justsyms_LDADD): Likewise.
10999 (binary_test_LDADD): Likewise.
11000 (large_LDADD): Likewise.
11001 * testsuite/Makefile.in: Regenerated.
11002
adcf2816 110032009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11004
adcf2816
L
11005 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11006 (Symbol_table::override_with_special): Likewise.
11007 (Symbol_table::add_from_object): Likewise.
11008
28e67f5d
RÁE
110092009-12-04 Rafael Avila de Espindola <espindola@google.com>
11010
11011 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11012 Don't set the data_offset twice.
11013
ae10a101
RÁE
110142009-12-04 Rafael Avila de Espindola <espindola@google.com>
11015
11016 * testsuite/Makefile.in: Regenerate.
11017
f59f41f3
DK
110182009-12-03 Doug Kwan <dougkwan@google.com>
11019
11020 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11021 (Target_arm::do_finalize_sections): Add parameter for symbol table
11022 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11023 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11024 parameter for symbol table pointer.
11025 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11026 an additional parameter for a pointer to symbol table.
11027 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11028 parameter for a symbol table pointer.
11029 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11030 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11031 Ditto.
11032 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11033 parameter for a symbol table pointer.
11034
ca55d848
RÁE
110352009-12-03 Rafael Avila de Espindola <espindola@google.com>
11036
11037 * incremental.cc (Incremental_inputs_header)
11038 (Incremental_inputs_header_write, Incremental_inputs_entry)
11039 (Incremental_inputs_entry_write): Move ...
11040 * incremental.h (Incremental_inputs_header)
11041 (Incremental_inputs_header_write, Incremental_inputs_entry)
11042 (Incremental_inputs_entry_write): here.
11043
3aec4f9c
RÁE
110442009-12-02 Rafael Avila de Espindola <espindola@google.com>
11045
11046 * incremental.cc (make_sized_incremental_binary): Set the target.
11047 Error if it is incompatible.
11048 * output.h (Output_file): Add filename method.
11049
9c0ae74d
RÁE
110502009-12-02 Rafael Avila de Espindola <espindola@google.com>
11051
11052 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11053 from the get_* methods.
11054
a45500ae
RÁE
110552009-12-02 Rafael Avila de Espindola <espindola@google.com>
11056
11057 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11058 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11059 Write 0 for the data_offset of scripts.
11060
325e6408
RÁE
110612009-12-02 Rafael Avila de Espindola <espindola@google.com>
11062
11063 * testsuite/Makefile.am: Add the incremental_test.sh test.
11064 * testsuite/incremental_test.sh: New.
11065 * testsuite/incremental_test_1.c: New.
11066 * testsuite/incremental_test_2.c: New.
11067
954c3e2e
RÁE
110682009-12-01 Rafael Avila de Espindola <espindola@google.com>
11069
703d02da 11070 * incremental-dump.cc (main): Fix typos.
954c3e2e 11071
f8086623
RÁE
110722009-11-27 Rafael Avila de Espindola <espindola@google.com>
11073
11074 PR gold/11025
11075 * incremental-dump.cc (main): Use llu to print 64 bit values.
11076
3b0dd6ac
L
110772009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11078 H.J. Lu <hongjiu.lu@intel.com>
11079
11080 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11081 $(LIBDL).
11082 (incremental_dump_LDADD): Likewise.
11083 * Makefile.in: Regenerated.
11084
a6d1ef57 110852009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11086
a6d1ef57
DK
11087 Revert:
11088
11089 2009-11-25 Doug Kwan <dougkwan@google.com>
11090
11091 * arm.cc (Target_arm::Target_arm): Move method definition
11092 outside of class definition. Add code to handle
11093 --target1-rel, --target1-abs and --target2= options.
11094 (Target_arm::get_reloc_reloc_type): Change method to be
11095 non-static and const.
11096 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11097 New data member declaration.
11098 (Target_arm::Scan::local, Target_arm::Scan::global,
11099 Target_arm::Relocate::relocate,
11100 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11101 Adjust call to Target_arm::get_real_reloc_type.
11102 (Target_arm::get_real_reloc_type): Use command line options
11103 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11104 * options.h (--target1-rel, --target1-abs, --target2): New
11105 ARM-only options.
11106
50aeb7d4
DK
111072009-11-25 Doug Kwan <dougkwan@google.com>
11108
11109 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11110 class definition. Add code to handle --target1-rel, --target1-abs
11111 and --target2= options.
11112 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11113 and const.
11114 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11115 member declaration.
11116 (Target_arm::Scan::local, Target_arm::Scan::global,
11117 Target_arm::Relocate::relocate,
11118 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11119 call to Target_arm::get_real_reloc_type.
11120 (Target_arm::get_real_reloc_type): Use command line options to
11121 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11122 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11123 options.
11124
51938283
DK
111252009-11-25 Doug Kwan <dougkwan@google.com>
11126
11127 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11128 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11129 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11130 formatting.
11131 (Arm_relocate_functions::thm_call): Replace body with a call to
11132 Arm_relocate_functions::thumb_branch_common.
11133 (Arm_relocate_functions::thm_jump24,
11134 Arm_relocate_functions::thm_xpc22): New method definitions.
11135 (Arm_relocate_functions::thumb_branch_common): New method definition.
11136 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11137 operator.
11138 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11139 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11140
e2b8f3c4
RÁE
111412009-11-24 Rafael Avila de Espindola <espindola@google.com>
11142
11143 * Makefile.am: Build incremental-dump
11144 * Makefile.in: Regenerate.
11145 * incremental-dump.cc: New.
11146 * incremental.cc (Incremental_inputs_header_data,
11147 Incremental_inputs_entry_data): Move to incremental.h
11148 * incremental.h: (Incremental_inputs_header_data,
11149 Incremental_inputs_entry_data): Move from incremental.cc
11150
bcba9aec
RÁE
111512009-11-24 Rafael Avila de Espindola <espindola@google.com>
11152
11153 * incremental.cc (Incremental_inputs_header,
11154 Incremental_inputs_header_write, Incremental_inputs_entry,
11155 Incremental_inputs_entry_write): Add a typedef with the data type.
11156
7c3afe08
RÁE
111572009-11-24 Rafael Avila de Espindola <espindola@google.com>
11158
11159 * incremental.cc (Incremental_inputs_header,
11160 Incremental_inputs_header_write, Incremental_inputs_entry,
11161 Incremental_inputs_entry_write): Update comment about which
11162 type has the filed descriptions.
11163
d204b6e9
DK
111642009-11-15 Doug Kwan <dougkwan@google.com>
11165
11166 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11167 (Arm_relocate_functions::arm_branch_common): Change method defintion
11168 in class definition to a method declaration and update list of formal
11169 parameters.
11170 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11171 Arm_relocation_functions::jump24): Adjust call to
11172 Arm_relocate_functions::arm_branch_common. Update list of formal
11173 parameters.
11174 (Arm_relocate_functions::xpc25): New method definition.
11175 (Arm_relocate_functions::arm_branch_common): Move method defintion
11176 out from class definition. Use stubs for mode-switching and extending
11177 branch ranges.
11178 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11179 specially. Change code to enable use of stubs in ARM branches.
11180
43d12afe
DK
111812009-11-10 Doug Kwan <dougkwan@google.com>
11182
11183 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11184 in method declaration.
11185 (Target_arm::relocate_stub): New method declaration.
11186 (Target_arm::default_target): Change to return a pointer instead of
11187 a const reference.
11188 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11189 Target_arm::default_target.
11190 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11191 method definition.
11192 (Target_arm::relocate_section): Adjust view.
11193 (Target_arm::relocate_stub): New method definition.
11194
ac33a407
DK
111952009-11-10 Doug Kwan <dougkwan@google.com>
11196
11197 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11198 a format warning.
11199 * incremental.cc (open_incremental_binary): Initialized local
11200 variables to avoid warnings.
11201 * object.cc (make_elf_object): Ditto.
11202 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11203 a format warning.
e1df38aa 11204
88ee28e9
L
11205009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11206
11207 PR gold/10930
11208 * testsuite/plugin_test.c: Include "config.h".
11209
2daedcd6
DK
112102009-11-09 Doug Kwan <dougkwan@google.com>
11211
11212 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11213 (arm_symbol_value): Remove.
11214 (Arm_relocate_functions::arm_branch_common,
11215 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11216 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11217 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11218 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11219 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11220 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11221 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11222 Arm_relocate_functions::thm_mobw_abs_nc,
11223 Arm_relocate_functions::thm_mov_abs,
11224 Arm_relocate_functions::movw_prel_nc,
11225 Arm_relocate_functions::thm_movt_abs,
11226 Arm_relocate_functions::movt_prel,
11227 Arm_relocate_functions::thm_movw_prel_nc,
11228 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11229 (Target_arm::Relocate::relocate): Only decompose address into two
11230 parts if relocation type uses the thumb-bit and pass the actual
11231 bit instead of a flag indicating that the thumb-bit is used. Adjust
11232 calls to methods in Arm_relocate_functions for this change.
11233
1276bc89 112342009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11235
11236 PR 10925
11237 * reloc.cc: Instantiate
11238 Sized_relobj::initialize_input_to_output_maps and
11239 Sized_relobj:free_input_to_output_maps.
11240
e53ad1b5
ILT
112412009-11-06 Ian Lance Taylor <iant@google.com>
11242
11243 PR 10876
11244 * defstd.cc (in_segment): Set only_if_ref true for "end".
11245
eb44217c
DK
112462009-11-06 Doug Kwan <dougkwan@google.com>
11247
11248 * arm.cc (class Reloc_stub): Correct a comment.
11249 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11250 (Target_arm::scan_section_for_stubs): New method declaration.
11251 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11252 Change methods from private to protected.
11253 (Target_arm::do_may_relax): New method definition.
11254 (Target_arm::do_relax, Target_arm::group_sections,
11255 Target_arm::scan_reloc_for_stub,
11256 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11257 (Target_arm::arm_input_section_map_): New data member declaration.
11258 (Target_arm::scan_reloc_for_stub,
11259 Target_arm::scan_reloc_section_for_stubs,
11260 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11261 Target_arm::do_relax): New method definitions.
11262
5d329b7d
ILT
112632009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11264
11265 * configure.ac: Check for (struct stat)::st_mtim
11266 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11267 * config.in: Regenerate.
11268 * configure: Regenerate.
11269
96a0d71b
ILT
112702009-11-05 Ian Lance Taylor <iant@google.com>
11271
11272 PR 10910
11273 * output.cc (Output_segment::add_output_section): Add missing
11274 return statement.
11275
594c8e5e
ILT
112762009-11-04 Ian Lance Taylor <iant@google.com>
11277
11278 PR 10880
11279 * object.h (class Object): Add is_needed and set_is_needed
11280 methods. Add is_needed_ field. Make bool fields into bitfields.
11281 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11282 defined in a dynamic object and referenced by a regular object,
11283 set is_needed for the dynamic object.
11284 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11285 if the file is marked with as_needed and it is not needed.
11286
22b127cc
ILT
112872009-11-04 Ian Lance Taylor <iant@google.com>
11288
11289 PR 10887
11290 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11291 tags if data is discarded by linker script.
11292 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11293 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11294 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11295 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11296
f5c870d2
ILT
112972009-11-04 Ian Lance Taylor <iant@google.com>
11298
11299 * layout.cc (Layout::get_output_section): Add is_interp and
11300 is_dynamic_linker_section parameters. Change all callers.
11301 (Layout::choose_output_section): Likewise.
11302 (Layout::make_output_section): Likewise.
11303 (Layout::add_output_section_data): Add is_dynamic_linker_section
11304 parameter. Change all callers.
11305 * layout.h (class Layout): Update declarations.
11306 * output.h (class Output_section): Add is_interp, set_is_interp,
11307 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11308 Add is_interp_, is_dynamic_linker_section_ fields. Change
11309 generate_code_fills_at_write_ to a bitfield.
11310 * output.cc (Output_section::Output_sections): Initialize new
11311 fields.
11312 (Output_segment::add_output_section): Add do_sort parameter.
11313 Change all callers.
11314
1ae4d23b
ILT
113152009-11-03 Ian Lance Taylor <iant@google.com>
11316
11317 PR 10860
11318 * options.h (class General_options): Add --warn-common.
11319 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11320 merging two common symbols.
11321 (Symbol_table::should_override): Handle --warn-common when merging
11322 a common symbol with a defined symbol. Use report_resolve_problem
11323 for multiple definitions.
11324 (Symbol_table::report_resolve_problem): New function.
11325 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11326
55da9579
DK
113272009-11-03 Doug Kwan <dougkwan@google.com>
11328
11329 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11330 stub_factory_.
11331 (Target_arm::stub_factory): New method definition.
11332 (Target_arm::new_arm_input_section,
11333 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11334 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11335 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11336 New type definitions.
11337 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11338 member declarations.
11339 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11340 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11341 New method definitions.
11342
37a9ac43
ILT
113432009-11-03 Ian Lance Taylor <iant@google.com>
11344
11345 * options.h (class General_options): Add --warn_constructors.
11346
b3d6a3d4
ILT
113472009-11-03 Ian Lance Taylor <iant@google.com>
11348
11349 PR 10893
11350 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11351 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11352
934b01dd
ILT
113532009-11-03 Ian Lance Taylor <iant@google.com>
11354
11355 PR 10895
11356 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11357 --msgid-bugs-address.
11358 (install-pdf): New target.
11359 (install-data_yes): Look up one directory to find mkinstalldirs.
11360
03c1939b
L
113612009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11362
11363 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11364 tree.
11365
ebd95253
DK
113662009-10-30 Doug Kwan <dougkwan@google.com>
11367
11368 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11369
e9bbb538
DK
113702009-10-30 Doug Kwan <dougkwan@google.com>
11371
11372 * arm.cc (Stub_addend_reader): New struct template definition
11373 and partial specializations.
11374 (Stub_addend_reader::operator()): New method definition for a
11375 partially specialized template.
11376
d5b40221
DK
113772009-10-30 Doug Kwan <dougkwan@google.com>
11378
11379 * arm.cc (Arm_relobj::processor_specific_flags): New method
11380 definition.
11381 (Arm_relobj::do_read_symbols): New method declaration.
11382 (Arm_relobj::processor_specific_flags_): New data member declaration.
11383 (Arm_dynobj): New class definition.
11384 (Target_arm::do_finalize_sections): Add input_objects parameter.
11385 (Target_arm::do_adjust_elf_header): New method declaration.
11386 (Target_arm::are_eabi_versions_compatible,
11387 (Target_arm::merge_processor_specific_flags): New method declaration.
11388 (Target_arm::do_make_elf_object): New overloaded method definitions
11389 and declaration.
11390 (Arm_relobj::do_read_symbols): New method definition.
11391 (Arm_dynobj::do_read_symbols): Ditto.
11392 (Target_arm::do_finalize_sections): Add input_objects parameters.
11393 Merge processor-specific flags from all input objects.
11394 (Target_arm::are_eabi_versions_compatible,
11395 Target_arm::merge_processor_specific_flags,
11396 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11397 New method definitions.
11398 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11399 Input_objects pointer type parameter.
11400 * layout.cc (Layout::finalize): Pass input objects to target's.
11401 finalize_sections function.
11402 * output.cc (Output_file_header::do_sized_write): Set ELF file
11403 header's processor-specific flags.
11404 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11405 Input_objects pointer type parameter.
11406 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11407 * target.h (Input_objects): New forward class declaration.
11408 (Target::processor_specific_flags,
11409 Target::are_processor_specific_flags_sect): New method definitions.
11410 (Target::finalize_sections): Add input_objects parameter.
11411 (Target::Target): Initialize processor_specific_flags_ and
11412 are_processor_specific_flags_set_.
11413 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11414 parameter.
11415 (Target::set_processor_specific_flags): New method definition.
11416 (Target::processor_specific_flags_,
11417 Target::are_processor_specific_flags_set_): New data member
11418 declarations.
11419 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11420 Input_objects pointer type parameter.
11421
ebabffbd
DK
114222009-10-30 Doug Kwan <dougkwan@google.com>
11423
11424 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11425
ad0f2072
ILT
114262009-10-28 Ian Lance Taylor <iant@google.com>
11427
11428 * object.h (class Relobj): Drop options parameter from
11429 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11430 do_scan_relocs, do_relocate. Change all callers.
11431 (class Sized_relobj): Drop options parameters from
11432 do_gc_process_relocs, do_scan_relocs, do_relocate,
11433 do_relocate_sections, relocate_sections, emit_relocs_scan,
11434 emit_relocs_scan_reltype. Change all callers.
11435 (struct Relocate_info): Remove options field and all references to
11436 it.
11437 * reloc.h (class Read_relocs): Remove options constructor
11438 parameter and options_ field. Change all callers.
11439 (class Gc_process_relocs, class Scan_relocs): Likewise.
11440 (class Relocate_task): Likewise.
11441 * target-reloc.h (scan_relocs): Remove options parameter. Change
11442 all callers.
11443 (scan_relocatable_relocs): Likewise.
11444 * target.h (class Sized_target): Remove options parameter from
11445 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11446 all callers.
11447 * gc.h (gc_process_relocs): Remove options parameter. Change all
11448 callers.
11449 * arm.cc: Update functions to remove options parameters.
11450 * i386.cc: Likewise.
11451 * powerpc.cc: Likewise.
11452 * sparc.cc: Likewise.
11453 * x86_64.cc: Likewise.
11454 * testsuite/testfile.cc: Likewise.
11455
8ffa3667
DK
114562009-10-28 Doug Kwan <dougkwan@google.com>
11457
11458 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11459 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11460 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11461 New method definitions.
11462
40f36857
CC
114632009-10-28 Cary Coutant <ccoutant@google.com>
11464
11465 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11466 (Plugin::cleanup_done_): New member.
11467 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11468 (Plugin_manager::cleanup_done_): Remove.
11469 (Plugin_manager::add_input_file): Edit error message.
11470 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11471 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11472
2c849493
ILT
114732009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11474
11475 * fileread.cc: (File_read::View::~View): Use the new
11476 data_ownership_ filed.
11477 (File_read::~File_read): Dispose the new whole_file_view_.
11478 (File_read::open): Mmap the whole file if needed.
11479 (File_read::open): Use whole_file_view_ instead of contents_.
11480 (File_read::find_view): Use whole_file_view_ if applicable.
11481 (File_read::do_read): Use whole_file_view_ instead of contents_.
11482 (File_read::make_view): Use whole_file_view_ instead of contents_,
11483 update File_read::View::View call.
11484 (File_read::find_or_make_view): Update File_read::View::View
11485 call.
11486 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11487 remove contents_
11488 (File_read::View::Data_ownership): New enum.
11489 (File_read::View::View): Replace bool mapped_ with Data_ownership
11490 argument.
11491 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11492 (File_read::View::data_ownership_): New field.
11493 (File_read::contents_): Remove (replaced by whole_file_view_).
11494 (File_read::whole_file_view_): New field.
11495 * options.h (class General_options): Add --keep-files-mapped.
11496
24998053
CC
114972009-10-27 Cary Coutant <ccoutant@google.com>
11498
11499 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11500 * testsuite/Makefile.am (plugin_test_5): New test case.
11501 * testsuite/Makefile.in: Regenerate.
11502
72adc4fa
DK
115032009-10-25 Doug Kwan <dougkwan@google.com>
11504
11505 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11506 from private to protected to allow access by child class.
11507 (Sized_relobj::do_relocate_sections): New method declaration.
11508 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11509 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11510 Sized_relobj::relocate_sections. Instantiate template explicitly
11511 for different target sizes and endianity.
11512
07f508a2
DK
115132009-10-24 Doug Kwan <dougkwan@google.com>
11514
11515 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11516 (Arm_input_section::as_arm_input_section): New method.
11517 (Arm_output_section): New class definition.
11518 (Arm_output_section::create_stub_group,
11519 Arm_output_section::group_sections): New method definitions.
11520
10ad9fe5
DK
115212009-10-22 Doug Kwan <dougkwan@google.com>
11522
11523 * arm.cc (Arm_input_section): New class definition.
11524 (Arm_input_section::init, Arm_input_section:do_write,
11525 Arm_input_section::set_final_data_size,
11526 Arm_input_section::do_reset_address_and_file_offset): New method
11527 definitions.
11528
56ee5e00
DK
115292009-10-21 Doug Kwan <dougkwan@google.com>
11530
11531 * arm.cc (Stub_table, Arm_input_section): New forward class
11532 declarations.
11533 (Stub_table): New class defintion.
11534 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11535 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11536 New method definition.
11537
b569affa
DK
115382009-10-21 Doug Kwan <dougkwan@google.com>
11539
11540 * arm.cc: Update copyright comments.
11541 (Target_arm): New forward class template declaration.
11542 (Arm_address): New type.
11543 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11544 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11545 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11546 constants.
11547 (Insn_template): Same.
11548 (DEF_STUBS): New macro.
11549 (Stub_type): New enum type.
11550 (Stub_template): New class definition.
11551 (Stub): Same.
11552 (Reloc_stub): Same.
11553 (Stub_factory): Same.
11554 (Target_arm::Target_arm): Initialize may_use_blx_ and
11555 should_force_pic_veneer_.
11556 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11557 Target_arm::should_force_pic_veneer,
11558 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11559 Target_arm::using_thumb_only, Target_arm:;default_target): New
11560 method defintions.
11561 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11562 New data member declarations.
11563 (Insn_template::size, Insn_template::alignment): New method defintions.
11564 (Stub_template::Stub_template): New method definition.
11565 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11566 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11567 (Stub_factory::Stub_factory): New method definition.
11568 * gold.h (string_hash): New template.
11569 * output.h (Input_section_specifier::hash_value): Use
11570 gold::string_hash.
11571 (Input_section_specifier::string_hash): Remove.
11572 * stringpool.cc (Stringpool_template::string_hash): Use
11573 gold::string_hash.
11574
6c172549
DK
115752009-10-20 Doug Kwan <dougkwan@google.com>
11576
11577 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11578 symbols of relaxed input sections.
11579 * output.h (Output_section::find_relaxed_input_section): Make
11580 method public.
11581
c5617f2f
DK
115822009-10-16 Doug Kwan <dougkwan@google.com>
11583
11584 * dynobj.cc (Versions::Versions): Initialize version_script_.
11585 Only insert base version symbol definition for a shared object
11586 if version script defines any version versions.
11587 (Versions::define_base_version): New method definition.
11588 (Versions::add_def): Check that base version is not needed.
11589 (Versions::add_need): Define base version lazily.
11590 * dynobj.h (Versions::define_base_version): New method declaration.
11591 (Versions::needs_base_version_): New data member declaration.
11592 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11593 (check_DATA): Add no_version_test.stdout.
11594 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11595 New make rules.
11596 * testsuite/Makefile.in: Regenerate.
11597 * testsuite/no_version_test.c: New file.
11598 * testsuite/no_version_test.sh: Ditto.
11599
3c12dcdb
DK
116002009-10-16 Doug Kwan <dougkwan@google.com>
11601
11602 * expression.cc (class Segment_start_expression): New class definition.
11603 (Segment_start_expression::value): New method definition.
11604 (script_exp_function_segment_start): Return a new
11605 Segment_start_expression.
11606 * gold/script-c.h (script_saw_segment_start_expression): New function
11607 prototype.
11608 * script-sections.cc (Script_sections::Script_sections): Initialize
11609 SAW_SEGMENT_START_EXPRESSION_ to false.
11610 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11611 and -Tbbs options to specify section addresses if given in
11612 command line and no SEGMENT_START expression is seen in a script.
11613 * script-sections.h (Script_sections::saw_segment_start_expression,
11614 Script_sections::set_saw_segment_start_expression): New method
11615 definition.
11616 (Script_sections::saw_segment_start_expression_): New data member
11617 declaration.
11618 * script.cc (script_saw_segment_start_expression): New function.
11619 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11620 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11621 script_test_7.sh and script_test_8.sh.
11622 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11623 script_test_8.stdout.
11624 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11625 (script_test_6, script_test_6.stdout, script_test_7,
11626 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11627 * Makefile.in: Regenerate.
11628 * testsuite/script_test_6.sh: New file.
11629 * testsuite/script_test_6.t: Same.
11630 * testsuite/script_test_7.sh: Same.
11631 * testsuite/script_test_7.t: Same.
11632 * testsuite/script_test_8.sh: Same.
11633
64b1ae37
DK
116342009-10-16 Doug Kwan <dougkwan@google.com>
11635
11636 * output.cc (Output_segment::set_section_list_address): Cast
11637 expressions to unsigned long long type to avoid format warnings.
11638
661be1e2
ILT
116392009-10-15 Ian Lance Taylor <iant@google.com>
11640
12edd763 11641 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11642 dot assignment to script_sections_.
12edd763
ILT
11643 * script-sections.cc (Script_sections::add_dot_assignment):
11644 Initialize if necessary.
11645
68b6574b
ILT
11646 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11647 program headers with no load segment if there is a linker script.
11648
661be1e2
ILT
11649 * layout.cc (Layout::set_segment_offsets): Align the file offset
11650 to the segment aligment for -N or -n with no load segment.
11651 * output.cc (Output_segment::add_output_section): Don't crash if
11652 the first section is a TLS section.
11653 (Output_segment::set_section_list_addresses): Print an error
11654 message if the address moves backward in a linker script.
11655 * script-sections.cc
11656 (Output_section_element_input::set_section_addresses): Don't
11657 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11658 (Orphan_output_section::set_section_addresses): Likewise.
11659
f15f61a7
DK
116602009-10-15 Doug Kwan <dougkwan@google.com>
11661
11662 * layout.cc (Layout::finish_dynamic_section): Generate tags
11663 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11664 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11665 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11666
82bb573a
ILT
116672009-10-14 Ian Lance Taylor <iant@google.com>
11668
11669 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11670 fields.
11671 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11672 data_shdr fields of relinfo.
11673 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11674 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11675 R_386_TLS_LDO_32, adjust based on section flags.
11676 (Target_i386::Relocate::fix_up_ldo): Remove.
11677
374ad285
ILT
116782009-10-13 Ian Lance Taylor <iant@google.com>
11679
11680 Add support for -pie.
11681 * options.h (class General_options): Add -pie and
11682 --pic-executable.
11683 (General_options::output_is_position_independent): Test -pie.
11684 (General_options::output_is_executable): Return true if not shared
11685 and not relocatable.
11686 (General_options::output_is_pie): Remove.
11687 * options.cc (General_options::finalize): Reject incompatible uses
11688 of -pie.
11689 * gold.cc (queue_middle_tasks): A -pie link is not static.
11690 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11691 * symtab.cc (Symbol::final_value_is_known): Return false if
11692 output_is_position_independent.
11693 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11694 output_is_position_independent.
11695 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11696 output_is_position_independent.
11697 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11698 output_is_position_independent.
11699 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11700 two_file_pie_test.
11701 (basic_pie_test.o, basic_pie_test): New targets.
11702 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11703 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11704 (two_file_pie_test): New target.
11705 * testsuite/Makefile.in: Rebuild.
11706 * README: Remove note saying that -pie is not supported.
11707
c6585162
ILT
117082009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11709
11710 * options.h (class General_options): Add -init and -fini.
11711 * layout.cc (Layout::finish_dynamic_section): Emit
11712 given init and fini functions.
11713
032ce4e9
ST
117142009-10-13 Sriraman Tallam <tmsriram@google.com>
11715
11716 * gc.h (gc_process_relocs): Check if icf is enabled using new
11717 function.
11718 * gold.cc (queue_initial_tasks): Likewise.
11719 (queue_middle_tasks): Likewise.
11720 * object.cc (do_layout): Likewise.
11721 * symtab.cc (is_section_folded): Likewise.
11722 * main.cc (main): Likewise.
11723 * reloc.cc (Read_relocs::run): Likewise.
11724 (Sized_relobj::do_scan_relocs): Likewise.
11725 * icf.cc (is_function_ctor_or_dtor): New function.
11726 (Icf::find_identical_sections): Check if function is ctor or dtor when
11727 safe icf is chosen.
11728 * options.h (General_options::icf): Change option to be an enum.
11729 (Icf_status): New enum.
11730 (icf_enabled): New method.
11731 (icf_safe_folding): New method.
11732 (set_icf_status): New method.
11733 (icf_status_): New variable.
11734 * (options.cc) (General_options::finalize): Set icf_status_.
11735 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11736 icf_test and icf_keep_unique_test to use the --icf enum flag.
11737 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11738 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11739
f345227a
ST
117402009-10-12 Sriraman Tallam <tmsriram@google.com>
11741
11742 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11743 includes to gc.h and icf.h.
11744 * arm.cc: Include gc.h.
11745 * gold.cc: Likewise.
11746 * i386.cc: Likewise.
11747 * powerpc.cc: Likewise.
11748 * sparc.cc: Likewise.
11749 * x86_64.cc: Likewise.
11750 * gc.h: Include icf.h.
11751
1c7814ed
ILT
117522009-10-11 Ian Lance Taylor <iant@google.com>
11753
11754 * plugin.cc: Include "gold.h" before other header files.
11755
ae3b5189
CD
117562009-10-10 Chris Demetriou <cgd@google.com>
11757
11758 * options.h (Input_file_argument::Input_file_type): New enum.
11759 (Input_file_argument::is_lib_): Replace with...
11760 (Input_file_argument::type_): New member.
11761 (Input_file_argument::Input_file_argument): Take Input_file_type
11762 'type' rather than boolean 'is_lib' as second argument.
11763 (Input_file_argument::is_lib): Use type_.
11764 (Input_file_argument::is_searched_file): New function.
11765 (Input_file_argument::may_need_search): Handle is_searched_file.
11766 * options.cc (General_options::parse_library): Support -l:filename.
11767 (General_options::parse_just_symbols): Update for Input_file_argument
11768 changes.
11769 (Command_line::process): Likewise.
11770 * archive.cc (Archive::get_file_and_offset): Likewise.
11771 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11772 * script.cc (read_script_file, script_add_file): Likewise.
11773 * fileread.cc (Input_file::Input_file): Likewise.
11774 (Input_file::will_search_for): Handle is_searched_file.
11775 (Input_file::open): Likewise.
11776 * readsyms.cc (Read_symbols::get_name): Likewise.
11777 * testsuite/Makefile.am (searched_file_test): New test.
11778 * testsuite/Makefile.in: Regenerate.
11779 * testsuite/searched_file_test.cc: New file.
11780 * testsuite/searched_file_test_lib.cc: New file.
11781
f3048a1d
ILT
117822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11783 Ian Lance Taylor <iant@google.com>
11784
11785 * descriptor.cc: Include <cstdio> and "binary-io.h".
11786 (Descriptors::open): Open the files in binary mode always.
11787 * script.cc (Lex::get_token): Treat \r as whitespace.
11788
d4780e57
ILT
117892009-10-09 Ian Lance Taylor <iant@google.com>
11790
11791 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11792
d9a893b8
ILT
117932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11794 Ian Lance Taylor <iant@google.com>
11795
11796 * configure.ac: Check for readv function also.
11797 * fileread.cc (readv): Define if not HAVE_READV.
11798 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11799 does not exist.
11800 * config.in: Regenerate.
11801 * configure: Regenerate.
11802
c0a62865
DK
118032009-10-09 Doug Kwan <dougkwan@google.com>
11804
11805 * layout.cc (Layout::make_output_section): Call target hook to make
11806 ordinary output section.
11807 (Layout::finalize): Adjust parameter list of call the
11808 Target::may_relax().
11809 * layout.h (class Layout::section_list): New method.
11810 * merge.h (Output_merge_base::entsize): Change visibility to public.
11811 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11812 New methods.
11813 (Output_merge_string::do_is_string): New method.
11814 * object.cc (Sized_relobj::do_setup): renamed from
11815 Sized_relobj::set_up.
11816 * object.h (Sized_relobj::adjust_shndx,
11817 Sized_relobj::initializ_input_to_output_maps,
11818 Sized_relobj::free_input_to_output_maps): Change visibilities to
11819 protected.
11820 (Sized_relobj::setup): Virtualize.
11821 (Sized_relobj::do_setup): New method declaration.
11822 (Sized_relobj::invalidate_section_offset,
11823 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11824 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11825 * options.cc (parse_int): New function.
11826 * options.h (parse_int): New declaration.
11827 (DEFINE_int): New macro.
11828 (stub_group_size): New option.
11829 * output.cc (Output_section::Output_section): Initialize memebers
11830 merge_section_map_, merge_section_by_properties_map_,
11831 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11832 (Output_section::add_input_section): Handled deferred code-fill
11833 generation and remove an old comment.
11834 (Output_section::add_relaxed_input_section): New method definition.
11835 (Output_section::add_merge_input_section): Use merge section by
11836 properties map to speed to search. Update merge section maps
11837 as appropriate.
11838 (Output_section::build_relaxation_map): New method definition.
11839 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11840 Same.
11841 (Output_section::relax_input_section): Renamed to
11842 Output_section::convert_input_sections_to_relaxed_sections and change
11843 interface to take a vector of pointers to relaxed sections.
11844 (Output_section::find_merge_section,
11845 Output_section::find_relaxed_input_section): New method definitions.
11846 (Output_section::is_input_address_mapped,
11847 Output_section::output_offset, Output_section::output_address):
11848 Use output section data maps to speed up searching.
11849 (Output_section::find_starting_output_address): Add comments.
11850 (Output_section::do_write,
11851 Output_section::write_to_postprocessing_buffer): Do code-fill
11852 generation as appropriate.
11853 (Output_section::get_input_sections): Invalidate relaxed input section
11854 map.
11855 (Output_section::restore_states): Adjust type of checkpoint .
11856 Invalidate relaxed input section map.
11857 * output.h (Output_merge_base): New class declaration.
11858 (Input_section_specifier): New class defintion.
11859 (class Output_relaxed_input_section) Change base class to
11860 Output_section_data_build.
11861 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11862 base class initializer.
11863 (Output_section::add_relaxed_input_section): New method declaration.
11864 (Output_section::Input_section): Change visibility to protected.
2e702c99 11865 (Output_section::Input_section::relobj,
c0a62865
DK
11866 Output_section::Input_section::shndx): Handle relaxed input sections.
11867 Output_section::input_sections) Change visibility to protected. Also
11868 define overload to return a non-const pointer.
11869 (Output_section::Merge_section_properties): New class defintion.
11870 (Output_section::Merge_section_by_properties_map,
11871 Output_section::Output_section_data_by_input_section_map,
11872 Output_section::Relaxation_map): New types.
11873 (Output_section::relax_input_section): Rename method to
11874 Output_section::convert_input_sections_to_relaxed_sections and change
11875 interface to take a vector of relaxed section pointers.
11876 (Output_section::find_merge_section,
11877 Output_section::find_relaxed_input_section,
11878 Output_section::build_relaxation_map,
11879 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11880 New method declarations.
11881 (Output_section::merge_section_map_
11882 Output_section::merge_section_by_properties_map_,
11883 Output_section::relaxed_input_section_map_,
11884 Output_section::is_relaxed_input_section_map_valid_,
11885 Output_section::generate_code_fills_at_write_): New data members.
11886 * script-sections.cc
11887 (Output_section_element_input::set_section_addresses): Call
11888 current_data_size and addralign methods of relaxed input sections.
11889 (Orphan_output_section::set_section_addresses): Call current_data_size
11890 and addralign methods of relaxed input sections.
11891 * symtab.cc (Symbol_table::compute_final_value): Extract template
11892 from the body of Symbol_table::sized_finalize_symbol.
11893 (Symbol_table::sized_finalized_symbol): Call
11894 Symbol_table::compute_final_value.
11895 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11896 (Symbol_table::compute_final_value): New templated method declaration.
11897 * target.cc (Target::do_make_output_section): New method defintion.
11898 * target.h (Target::make_output_section): New method declaration.
11899 (Target::relax): Add more parameters for input objects, symbol table
11900 and layout. Adjust call to do_relax.
11901 (Target::do_make_output_section): New method declaration.
11902 (Target::do_relax): Add parameters for input objects, symbol table
11903 and layout.
11904
d446d6c4
ILT
119052009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11906
11907 * pread.c: Include stdio.h.
11908
bc06c745
ILT
119092009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11910
11911 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11912 defined.
11913
75aea3d0
ILT
119142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11915
11916 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11917 Change read_shndx type to unsigned int.
11918 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11919 int.
11920 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11921 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11922 Change read_shndx type to unsigned int.
11923 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11924 int.
11925 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11926 * layout.cc (Layout::create_symtab_sections): Cast the result of
11927 local_symcount * symsize to off_t in the gold_assert.
11928
be8fcb75
ILT
119292009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11930
11931 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11932 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11933 R_ARM_BASE_ABS.
11934 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11935 (Arm_relocate_functions::thm_abs5): New function.
11936 (Arm_relocate_functions::abs12): New function.
11937 (Arm_relocate_functions::abs16): New function.
11938 (Arm_relocate_functions::base_abs): New function.
11939 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11940 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11941 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11942 R_ARM_BASE_ABS.
11943 (Scan::global): Likewise.
11944 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11945 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11946 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11947 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11948 R_ARM_BASE_ABS.
11949
c2a122b6
ILT
119502009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11951
11952 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11953 (Arm_relocate_functions::movt_prel): New function.
11954 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11955 (Arm_relocate_functions::thm_movt_prel): New function.
11956 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11957 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11958 (Scan::global, Relocate::relocate): Likewise.
11959 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11960
c4aa1e2d
ILT
119612009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11962
11963 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11964 Incremental_checker.
11965 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11966 unsigned int.
11967 (class Incremental_inputs_header): New class.
11968 (Incremental_inputs_header_writer): Edit comment.
11969 (Incremental_inputs_entry): New class.
11970 (Incremental_inputs_entry_writer): Edit comment.
11971 (Sized_incremental_binary::do_find_incremental_inputs_section):
11972 Add *strtab_shndx parameter, fill it.
11973 (Sized_incremental_binary::do_check_inputs): New method.
11974 (Incremental_checker::can_incrementally_link_output_file): Use
11975 Sized_incremental_binary::check_inputs.
11976 (Incremental_inputs::report_command_line): Save command line in
11977 command_line_.
11978 * incremental.h:
11979 (Incremental_binary::find_incremental_inputs_section): New
11980 method.
11981 (Incremental_binary::do_find_incremental_inputs_section): Add
11982 strtab_shndx parameter.
11983 (Incremental_binary::do_check_inputs): New pure virtual method.
11984 (Sized_incremental_binary::do_check_inputs): Declare.
11985 (Incremental_checker::Incremental_checker): Add incremental_inputs
11986 parameter, use it to initialize incremental_inputs_.
11987 (Incremental_checker::incremental_inputs_): New field.
11988 (Incremental_checker::command_line): New method.
11989 (Incremental_checker::inputs): New method.
11990 (Incremental_checker::command_line_): New field.
11991
c549a694
ILT
119922009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11993
11994 * incremental.cc: Include <cstdarg> and "target-select.h".
11995 (vexplain_no_incremental): New function.
11996 (explain_no_incremental): New function.
11997 (Incremental_binary::error): New method.
11998 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11999 method.
12000 (make_sized_incremental_binary): New function.
12001 (open_incremental_binary): New function.
12002 (can_incrementally_link_file): Add checks if output is ELF and has
12003 inputs section.
12004 * incremental.h: Include "elfcpp_file.h" and "output.h".
12005 (Incremental_binary): New class.
12006 (Sized_incremental_binary): New class.
12007 (open_incremental_binary): Declare.
12008 * object.cc (is_elf_object): Use
12009 elfcpp::Elf_recognizer::is_elf_file.
12010 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12011 * output.h (Output_file::filesize): New method.
12012
fd3c5f0b
ILT
120132009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12014
12015 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12016 New function.
12017 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12018 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12019 function.
12020 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12021 function.
12022 (Arm_relocate_functions::movw_abs_nc): New function.
12023 (Arm_relocate_functions::movt_abs): New function.
12024 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12025 (Arm_relocate_functions::thm_movt_abs): New function.
12026 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12027 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12028 (Scan::global): Likewise.
12029 (Relocate::relocate): Likewise.
12030 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12031
7f5309a5
ILT
120322009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12033
12034 * arm.cc (Arm_relocate_functions::got_prel) New function.
12035 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12036 (Relocate::relocate): Likewise.
12037 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12038
364c7fa5
ILT
120392009-10-06 Ian Lance Taylor <iant@google.com>
12040
12041 * options.h (class General_options): Define
12042 split_stack_adjust_size parameter.
12043 * object.h (class Object): Add uses_split_stack_ and
12044 has_no_split_stack_ fields. Add uses_split_stack and
12045 has_no_split_stack accessor functions. Declare
12046 handle_split_stack_section.
12047 (class Reloc_symbol_changes): Define.
12048 (class Sized_relobj): Define Function_offsets. Declare
12049 split_stack_adjust, split_stack_adjust_reltype, and
12050 find_functions.
12051 * object.cc (Object::handle_split_stack_section): New function.
12052 (Sized_relobj::do_layout): Call handle_split_stack_section.
12053 * dynobj.cc (Sized_dynobj::do_layout): Call
12054 handle_split_stack_section.
12055 * reloc.cc (Sized_relobj::relocate_sections): Call
12056 split_stack_adjust for executable sections in split_stack
12057 objects. Pass reloc_map to relocate_section.
12058 (Sized_relobj::split_stack_adjust): New function.
12059 (Sized_relobj::split_stack_adjust_reltype): New function.
12060 (Sized_relobj::find_functions): New function.
12061 * target-reloc.h: Include "object.h".
12062 (relocate_section): Add reloc_symbol_changes parameter. Change
12063 all callers.
12064 * target.h (class Target): Add calls_non_split method. Declare
12065 do_calls_non_split virtual method. Declare match_view and
12066 set_view_to_nop.
12067 * target.cc: Include "elfcpp.h".
12068 (Target::do_calls_non_split): New function.
12069 (Target::match_view): New function.
12070 (Target::set_view_to_nop): New function.
12071 * gold.cc (queue_middle_tasks): Give an error if mixing
12072 split-stack and non-split-stack objects with -r.
12073 * i386.cc (Target_i386::relocate_section): Add
12074 reloc_symbol_changes parameter.
12075 (Target_i386::do_calls_non_split): New function.
12076 * x86_64.cc (Target_x86_64::relocate_section): Add
12077 reloc_symbol_changes parameter.
12078 (Target_x86_64::do_calls_non_split): New function.
12079 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12080 parameter.
12081 * powerpc.cc (Target_powerpc::relocate_section): Add
12082 reloc_symbol_changes parameter.
12083 * sparc.cc (Target_sparc::relocate_section): Add
12084 reloc_symbol_changes parameter.
12085 * configure.ac: Call AM_CONDITIONAL for the default target.
12086 * configure: Rebuild.
12087 * testsuite/Makefile.am (TEST_AS): New variable.
12088 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12089 (check_DATA): Add split_i386 and split_x86_64 files.
12090 (SPLIT_DEFSYMS): Define.
12091 (split_i386_[1234n].o): New targets.
12092 (split_i386_[124]): New targets.
12093 (split_i386_[1234r].stdout): New targets.
12094 (split_x86_64_[1234n].o): New targets.
12095 (split_x86_64_[124]): New targets.
12096 (split_x86_64_[1234r].stdout): New targets.
12097 (MOSTLYCLEANFILES): Add new executables.
12098 * testsuite/split_i386.sh: New file.
12099 * testsuite/split_x86_64.sh: New file.
12100 * testsuite/split_i386_1.s: New file.
12101 * testsuite/split_i386_2.s: New file.
12102 * testsuite/split_i386_3.s: New file.
12103 * testsuite/split_i386_4.s: New file.
12104 * testsuite/split_i386_n.s: New file.
12105 * testsuite/split_x86_64_1.s: New file.
12106 * testsuite/split_x86_64_2.s: New file.
12107 * testsuite/split_x86_64_3.s: New file.
12108 * testsuite/split_x86_64_4.s: New file.
12109 * testsuite/split_x86_64_n.s: New file.
12110 * testsuite/testfile.cc (Target_test): Update relocation_section
12111 function.
12112 * testsuite/Makefile.in: Rebuild.
12113
e8a9fcda
ILT
121142009-10-06 Ian Lance Taylor <iant@google.com>
12115
12116 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12117 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12118 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12119 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12120 the address on ldo_addrs_.
12121 (Target_i386::Relocate::fix_up_ldo): New function.
12122
e99daf92
ILT
121232009-10-06 Rafael Espindola <espindola@google.com>
12124
12125 * plugin.cc (add_input_library): New.
12126 (Plugin::load): Add add_input_library to tv.
12127 (Plugin_manager::add_input_file): Add the is_lib argument.
12128 (add_input_file): Update call to Plugin_manager::add_input_file.
12129 (add_input_library): New.
12130 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12131
966d4097
DK
121322009-09-30 Doug Kwan <dougkwan@google.com>
12133
12134 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12135 symbol and call Symbol::may_need_copy_reloc to determine if
12136 a copy reloc is needed.
12137 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12138 nocopyreloc is given in command line.
12139 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12140 given in command line.
12141 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12142 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12143 of the removed Target_i386::may_need_copy_reloc.
12144 * options.h (copyreloc): New option with default value false.
12145 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12146 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12147 instead of the removed Target_powerpc::may_need_copy_reloc.
12148 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12149 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12150 instead of the removed Target_sparc::may_need_copy_reloc.
12151 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12152 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12153 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12154 instead of the removed Target_x86_64::may_need_copy_reloc.
12155
029ba973
ILT
121562009-09-30 Ian Lance Taylor <iant@google.com>
12157
12158 * object.h (class Object): Remove target_ field, and target,
12159 sized_target, and set_target methods.
12160 (Object::sized_target): Remove.
12161 (class Sized_relobj): Update declarations. Remove sized_target.
12162 * object.cc (Sized_relobj::setup): Remove target parameter.
12163 Change all callers.
12164 (Input_objects::add_object): Don't do anything with the target.
12165 (make_elf_sized_object): Add punconfigured parameter. Change all
12166 callers. Set or test parameter target.
12167 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12168 Change all callers.
12169 * parameters.cc (Parameters::set_target): Change parameter type to
12170 be non-const.
12171 (Parameters::default_target): Remove.
12172 (set_parameters_target): Change parameter type to be non-const.
12173 (parameters_force_valid_target): New function.
12174 (parameters_clear_target): New function.
12175 * parameters.h (class Parameters): Update declarations. Remove
12176 default_target method. Add sized_target and clear_target
12177 methods. Change target_ to be non-const.
12178 (set_parameters_target): Update declaration.
12179 (parameters_force_valid_target): Declare.
12180 (parameters_clear_target): Declare.
12181 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12182 as NULL if we aren't searching.
12183 (Add_symbols::run): Don't check for compatible target.
12184 * fileread.cc (Input_file::open_binary): Call
12185 parameters_force_valid_target.
12186 * gold.cc (queue_middle_tasks): Likewise.
12187 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12188 set_target on object.
12189 * dynobj.h (class Sized_dynobj): Update declarations.
12190 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12191 make_elf_object returns NULL.
12192 (Archive::include_member): Don't check whether object target is
12193 compatible.
12194 * output.cc (Output_section::add_input_section): Get target from
12195 parameters.
12196 (Output_section::relax_input_section): Likewise.
12197 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12198 parameters.
12199 (Sized_relobj::do_scan_relocs): Likewise.
12200 (Sized_relobj::relocate_sections): Likewise.
12201 * resolve.cc (Symbol_table::resolve): Likewise.
12202 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12203 parameter. Change all callers.
12204 (Symbol_table::add_from_object): Get target from parameters.
12205 (Symbol_table::add_from_relobj): Don't check object target.
12206 (Symbol_table::add_from_dynobj): Likewise.
12207 (Symbol_table::define_special_symbol): Get target from
12208 parameters.
12209 * symtab.h (class Symbol_table): Update declaration.
12210 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12211 parameter. Change all callers. Clear parameter target.
12212 (Binary_test): Test target here.
12213 * testsuite/object_unittest.cc (gold_testsuite): Remove
12214 target_test_pointer parameter. Change all callers.
12215 (Object_test): Test target here.
12216
a6a22b83
ILT
122172009-09-26 Ian Lance Taylor <iant@google.com>
12218
12219 * testsuite/initpri1.c: Don't try to use constructor priorities if
12220 compiling with gcc before 4.3.
12221
6a8f49fe
ILT
122222009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12223
12224 * testsuite/retain_symbols_file_test.sh (check_present): Change
12225 output file name to retain_symbols_file_test.stdout.
12226 (check_absent): Likewise.
12227
8c604651
CS
122282009-09-18 Craig Silverstein <csilvers@google.com>
12229
12230 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12231 * options.cc: Include <cerrno> and <fstream>.
12232 (General_options::finalize): Parse -retain-symbols-file tag.
12233 * options.h: New flag.
12234 (General_options): New method should_retain_symbol, new
12235 variable symbols_to_retain.
12236 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12237 should_retain_symbol map.
12238 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12239 * testsuite/Makefile.in: Regenerate.
12240 * testsuite/retain_symbols_file_test.sh: New file.
12241
ca58b19f
NC
122422009-09-18 Nick Clifton <nickc@redhat.com>
12243
12244 * po/es.po: Updated Spanish translation.
12245
20e6d0d6
DK
122462009-09-17 Doug Kwan <dougkwan@google.com>
12247
12248 * debug.h (DEBUG_RELAXATION): New constant.
12249 (DEBUG_ALL): Add DEBUG_RELAXATION.
12250 (debug_string_to_enum): Add relaxation debug option.
12251 * layout.cc
12252 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12253 Layout::Relaxation_debug_check::read_sections,
12254 Layout::Relaxation_debug_check::read_sections): New method definitions.
12255 (Layout::Layout): Initialize data members
12256 record_output_section_data_from_scrips_,
12257 script_output_section_data_list_ and relaxation_debug_check_.
12258 (Layout::save_segments, Layout::restore_segments,
12259 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12260 Layout::relaxation_loop_body): New method definitions.
12261 (Layout::finalize): Support relaxation. Move section layout code to
12262 Layout::relaxation_loop_body.
12263 (Layout::set_asection_address_from_script): Move code for orphan
12264 section placement out.
12265 (Layout::place_orphan_sections_in_script): New method definition.
12266 * layout.h (Output_segment_headers, Output_file_header):
12267 New forward class declarations.
12268 (Layout::~Layout): Define.
12269 (Layout::new_output_section_data_from_script): New method definition.
12270 (Layout::place_orphan_sections_in_script): New method declaration.
12271 (Layout::Segment_states): New type declaration.
12272 (Layout::save_segments, Layout::restore_segments,
12273 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12274 Layout::relaxation_loop_body): New method declarations.
12275 (Layout::Output_section_data_list): New type declaration.
12276 (Layout::Relaxation_debug_check): New class definition.
12277 (Layout::record_output_section_data_from_script_,
12278 Layout::script_output_section_data_list_, Layout::segment_states_,
12279 Layout::relaxation_debug_check_): New data members.
12280 * output.cc: (Output_section_headers::do_size): New method definition.
12281 (Output_section_headers::Output_section_headers): Move size
12282 computation to Output_section_headers::do_size.
12283 (Output_segment_headers::do_size): New method definition.
e1df38aa 12284 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12285 Output_file_header::do_size and call it.
12286 (Output_file_header::do_size): New method definition.
12287 (Output_data_group::Output_data_group): Adjust call to
12288 Output_section_data.
12289 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12290 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12291 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12292 RELAXED_INPUT_SECTION_CODE.
12293 (Output_section::Output_section): Initialize data member checkpoint_.
12294 (Output_section::~Output_section): Delete checkpoint object pointed
12295 by checkpoint_.
12296 (Output_section::add_input_section): Always add an Input_section if
12297 relaxing.
12298 (Output_section::add_merge_input_section): Add assert.
12299 (Output_section::relax_input_section): New method definition.
12300 (Output_section::set_final_data_size): Set load address to zero for
12301 an unallocated section.
12302 (Output_section::do_address_and_file_offset_have_reset_values):
12303 New method definition.
12304 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12305 Handle relaxed input section.
12306 (Output_section::sort_attached_input_sections): Checkpoint input
12307 section list lazily.
12308 (Output_section::get_input_sections): Change type of input_sections to
12309 list of Simple_input_section pointers. Checkpoint input section list
12310 lazily. Also handle relaxed input sections.
12311 (Output_section::add_input_section_for_script): Take a reference to
12312 a Simple_input_section object instead of Relobj pointer and section
12313 index as parameter. Handle relaxed input sections.
12314 (Output_section::save_states, Output_section::restore_states): New
12315 method definitions.
12316 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12317 (Output_data::is_data_size_fixed): New method definition.
12318 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12319 if it is fixed.
12320 (Output_data::address_and_file_offset_have_reset_values): New method
12321 definition.
12322 (Output_data::do_address_and_file_offset_have_reset_values): New method
12323 definition.
12324 (Output_data::set_data_size): Check that data size is not fixed.
12325 (Output_data::fix_data_size): New method definition.
12326 (Output_data::is_data_size_fixed_): New data member.
12327 (Output_section_headers::set_final_data_size): New method definition.
12328 (Output_section_headers::do_size): New method declaration.
12329 (Output_segment_headers::set_final_data_size): New method definition.
12330 (Output_segment_headers::do_size): New method declaration.
12331 (Output_file_header::set_final_data_size)::New method definition.
12332 (Output_file_header::do_size)::New method declaration.
12333 (Output_section_data::Output_section_data): Add new parameter
12334 is_data_size_fixed and use it to fix data size.
12335 (Output_data_const::Output_data_const): Adjust call to base class
12336 constructor and fix data size.
12337 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12338 base class constructor and fix data size.
12339 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12340 base class constructor and fix data size.
12341 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12342 class constructor and fix data size.
12343 (Output_data_group::set_final_data_size): New method definition.
12344 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12345 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12346 class constructor and fix data size.
12347 (Output_relaxed_input_section): New class definition.
12348 (Output_section::Simple_input_section): New class definition.
12349 (Output_section::get_input_sections): Adjust parameter list.
12350 (Output_section::add_input_section_for_script): Same.
12351 (Output_section::save_states, Output_section::restore_states,
12352 Output_section::do_address_and_file_offset_have_reset_values,
12353 (Output_section::Input_section::Input_section): Handle
12354 RELAXED_INPUT_SECTION_CODE. Add new overload for
12355 Output_relaxed_input_section.
12356 (Output_section::Input_section::is_input_section,
12357 Output_section::Input_section::set_output_section): Handle relaxed
12358 input section.
12359 (Output_section::Input_section::is_relaxed_input_section,
12360 Output_section::Input_section::output_section_data,
12361 Output_section::Input_section::relaxed_input_section): New method
12362 definitions.
12363 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12364 value.
12365 (Output_section::Input_section::u1_): Update comments.
12366 (Output_section::Input_section::u2_): Add new union member poris.
12367 (Output_section::Checkpoint_output_section): New classs definition.
12368 (Output_section::relax_input_section): New method declaration.
12369 (Output_section::checkpoint_): New data member.
12370 (Output_segment): Update comments.
12371 (Output_segment::Output_segment): Un-privatize copy constructor.
12372 (Output_segment::operator=): Un-privatize.
12373 * script-sections.cc (Output_section_element::Input_section_list):
12374 Change element type to Output_section::Simple_input_section.
12375 (Output_section_element_dot_assignment::set_section_addresses):
12376 Register output section data for relaxation clean up.
12377 (Output_data_exression::Output_data_expression): Adjust call to base
12378 constructor to fix data size.
12379 (Output_section_element_data::set_section_addresses): Register
12380 Output_data_expression object for relaxation clean up.
12381 (struct Input_section_info): Replace Relobj pointer and section index
12382 pair with Output_section::Simple_input_section and Convert struct to a
12383 class.
12384 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12385 Input_section_info data member to use accessors.
20e6d0d6
DK
12386 (Output_section_element_input::set_section_addresses): Use layout
12387 parameter. Adjust code to use Output_section::Simple_input_section
12388 and Input_secction_info classes. Register filler for relaxation
12389 clean up.
12390 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12391 and section index pair with Output_section::Simple_input_section
12392 class. Adjust code accordingly.
12393 (Phdrs_element::release_segment): New method definition.
12394 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12395 segment list.
12396 (Script_sections::release_segments): New method definition.
12397 * gold/script-sections.h (Script_sections::release_segments): New
12398 method declaration.
12399 * gold/target.h (Target::may_relax, Target::relax,
12400 Target::do_may_relax, Target::do_relax): New method definitions.
12401
5e445df6
ILT
124022009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12403
12404 * arm.cc (has_signed_unsigned_overflow): New function.
12405 (Arm_relocate_functions::abs8): New function.
12406 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12407 (Target_arm::Scan::global): Likewise.
12408 (Target_arm::relocate::relocate): Likewise.
12409 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12410 Likewise.
12411
8c604651 124122009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12413
12414 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12415 * testsuite/Makefile.in: Regenerate.
12416
1e9cc1c2
NC
124172009-09-11 Nick Clifton <nickc@redhat.com>
12418
12419 * po/gold.pot: Updated by the Translation project.
12420
6a89f575
CC
124212009-09-08 Cary Coutant <ccoutant@google.com>
12422
12423 * output.cc (Output_file::open): Add execute permission to empty file.
12424 * testsuite/Makefile.am (permission_test): New test.
12425 * testsuite/Makefile.in: Regenerate.
12426
fdcac5af
ILT
124272009-09-02 Ian Lance Taylor <iant@google.com>
12428
12429 * output.cc (Output_file::resize): Call map_no_anonymous rather
12430 than map.
12431
44453f85
ILT
124322009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12433
12434 * gold.cc: Include "incremental.h".
12435 (queue_initial_tasks): Call Incremental_checker methods.
12436 * incremental.cc: Include "output.h".
12437 (Incremental_checker::can_incrementally_link_output_file): New
12438 method.
12439 * incremental.h (Incremental_checker): New class.
12440
12441 * output.cc (Output_file::open_for_modification): New method.
12442 (Output_file::map_anonymous): Changed return type to bool. Record
12443 map in base_ field.
12444 (Output_file::map_no_anonymous): New method, broken out of map.
12445 (Output_file::map): Use map_no_anonymous and map_anonymous.
12446 * output.h (class Output_file): Update declarations.
12447
293c1386
CC
124482009-08-24 Cary Coutant <ccoutant@google.com>
12449
12450 * options.h (Command_line::Pre_options): New class.
12451 (Command_line::pre_options): New member.
12452 * options.cc (gold::options::ready_to_register): New variable.
12453 (One_option::register_option): Do nothing if not registering options.
12454 Assert if same short option registered twice.
12455 (General_options::General_options): Turn off option registration when
12456 done constructing.
12457 (Command_line::Pre_options::Pre_options): New constructor.
12458
f773f3d2
CC
124592009-08-24 Cary Coutant <ccoutant@google.com>
12460
06a73cfe
CC
12461 * options.h (General_options::no_keep_memory): Remove incorrect
12462 short option.
f773f3d2 12463
a15af8e2
RW
124642009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12465
12466 * Makefile.am (am__skiplex, am__skipyacc): New.
12467 * Makefile.in: Regenerate.
12468
c462b41b
RW
124692009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12470
14ec8efd
RW
12471 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12472 (INCLUDES): ... this.
12473 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12474 (AM_CPPFLAGS): Renamed from ...
12475 (INCLUDE): ... this.
12476 * Makefile.in, testsuite/Makefile.in: Regenerate.
12477
81ecdfbb
RW
12478 * Makefile.in: Regenerate.
12479 * aclocal.m4: Likewise.
12480 * config.in: Likewise.
12481 * configure: Likewise.
12482 * testsuite/Makefile.in: Likewise.
12483
c462b41b
RW
12484 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12485 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12486 * Makefile.in: Regenerate.
12487 * testsuite/Makefile.in: Regenerate.
12488
2da73f13
CC
124892009-08-19 Cary Coutant <ccoutant@google.com>
12490
12491 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12492 symbols in shared libraries overridden by hidden or internal symbols
12493 in the main program.
12494
2db70501
CD
124952009-08-19 Chris Demetriou <cgd@google.com>
12496
12497 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12498 checking source file names in error messages.
12499
f733487b
DK
125002009-08-18 Doug Kwan <dougkwan@google.com>
12501
12502 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12503 an elcpp::Ehdr as parameter. Adjust call to set_target.
12504 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12505 an elfcpp::Ehdr as parameter.
12506 * object.cc (Object::set_target): Remove the version that looks up
12507 a target and sets it.
12508 (Sized_relobj::setup): Take a Target object instead of
12509 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12510 (make_elf_sized_object): Find target and ask target to
12511 make an ELF object.
12512 * object.h: (Object::set_target): Remove the version that looks up
12513 a target and sets it.
12514 (Sized_relobj::setup): Take a Target object instead of
12515 an elfcpp:Ehdr as parameter.
12516 * target.cc: Include dynobj.h.
12517 (Target::do_make_elf_object_implementation): New.
2e702c99 12518 (Target::do_make_elf_object): New.
f733487b
DK
12519 * target.h (Target::make_elf_object): New template declaration.
12520 (Target::do_make_elf_object): New method declarations.
12521 (Target::do_make_elf_object_implementation): New template declaration.
12522
cc70f101
ILT
125232009-08-14 Ian Lance Taylor <iant@google.com>
12524
12525 * gold.h (FUNCTION_NAME): Define.
12526 (gold_unreachable): Use FUNCTION_NAME.
12527
ef5e0cb1
ST
125282009-08-12 Sriraman Tallam <tmsriram@google.com>
12529
12530 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12531 symbol in the --keep-unique list is not found.
12532
48c187ce
ST
125332009-08-12 Sriraman Tallam <tmsriram@google.com>
12534
12535 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12536 been maked as --keep-unique.
12537 (Icf::unfold_section): New function.
12538 * icf.h (Icf::unfold_section): New function.
12539 * options.h (General_options::keep_unique): New option.
12540 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12541 * testsuite/Makefile.in: Regenerate.
12542 * testsuite/icf_keep_unique_test.sh: New file.
12543 * testsuite/icf_keep_unique_test.cc: New file.
12544
645afe0c
CC
125452009-08-12 Cary Coutant <ccoutant@google.com>
12546
12547 PR 10471
12548 * resolve.cc (Symbol_table::resolve): Check for references from
12549 dynamic objects to hidden and internal symbols.
12550 * testsuite/Makefile.am (hidden_test.sh): New test.
12551 * testsuite/Makefile.in: Regenerate.
12552 * testsuite/hidden_test.sh: New script.
12553 * testsuite/hidden_test_1.c: New test source.
12554 * testsuite/hidden_test_main.c: New test source.
12555
11af873f
DK
125562009-08-11 Doug Kwan <dougkwan@google.com>
12557
12558 * arm.cc: Update comments.
12559 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12560 segment to locate the .ARM.exidx section if present.
12561
b9f7d72d
DK
125622009-08-09 Doug Kwan <dougkwan@google.com>
12563
12564 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12565 patch.
12566
ddd3c53c
ST
125672009-08-07 Sriraman Tallam <tmsriram@google.com>
12568 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12569 compiler warnings.
12570
27721062
ST
125712009-08-06 Sriraman Tallam <tmsriram@google.com>
12572
12573 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12574 valid tls_segment only for non-debug-section relocations.
12575 * testsuite/Makefile.am: Add gc_tls_test.
12576 * testsuite/Makefile.in: Regenerate.
12577 * testsuite/gc_tls_test.cc: New file.
12578 * testsuite/gc_tls_test.sh: New file.
12579
ef15dade 125802009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12581
ef15dade
ST
12582 * icf.cc: New file.
12583 * icf.h: New file.
12584 * Makefile.am (CCFILES): Add icf.cc.
12585 (HFILES): Add icf.h
12586 * Makefile.in: Regenerate.
12587 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12588 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12589 section, symbol and addend information for the relocs.
12590 * gold.cc (queue_middle_tasks): Call identical code folding.
12591 * gold.h: Add defines for multimap.
12592 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12593 to the call of finalize_local_symbols.
12594 * main.cc (main): Create object of class Icf.
12595 * object.cc (Sized_relobj::do_layout): Allow this function to be
12596 called twice during icf.
12597 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12598 to sections marked as identical by icf.
12599 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12600 when available.
12601 (Sized_relobj::do_section_entsize): New function.
12602 * object.h (Object::section_entsize): New function.
12603 (Object::do_section_entsize): New pure virtual function.
12604 (Relobj::finalize_local_symbols): Add new parameter.
12605 (Relobj::do_section_entsize): New function.
12606 * options.h (General_options::icf): New option.
12607 (General_options::icf_iterations): New option.
12608 (General_options::print_icf_sections): New option.
12609 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12610 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12611 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12612 icf.
12613 * symtab.cc (Symbol_table::is_section_folded): New function.
12614 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12615 to sections marked as identical by icf.
12616 * symtab.h (Symbol_table::set_icf): New function.
12617 (Symbol_table::icf): New function.
12618 (Symbol_table::is_section_folded): New function.
12619 (Symbol_table::icf_): New data member.
12620 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12621 * testsuite/Makefile.am: Add commands to build icf_test.
12622 * testsuite/Makefile.in: Regenerate.
12623 * testsuite/icf_test.sh: New file.
12624 * testsuite/icf_test.cc: New file.
12625
c3b65ac4
CD
126262009-07-24 Chris Demetriou <cgd@google.com>
12627
12628 * layout.cc (is_compressible_debug_section): Fix incorrect
12629 comment about compressed section names.
12630
1caf2c51
ILT
126312009-07-20 Ian Lance Taylor <ian@airs.com>
12632
12633 PR 10419
12634 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12635
1ef4d87f
ILT
126362009-07-16 Ian Lance Taylor <iant@google.com>
12637
12638 PR 10400
12639 * layout.h: #include <map>.
12640 (class Kept_section): Change from struct to class. Add accessors
12641 and setters. Add section size to Comdat_group mapping. Change
12642 Comdat_group to std::map. Add is_comdat_ field. Add
12643 linkonce_size field in union.
12644 (class Layout): Update declaration of find_or_add_kept_section.
12645 Don't declare find_kept_object.
12646 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12647 parameter. Add object, shndx, is_comdat, and is_group_name
12648 parameters. Change all callers. Adjust for new Kept_section.
12649 (Layout::find_kept_object): Remove.
12650 * object.cc (Sized_relobj::include_section_group): Update use of
12651 Kept_section. Rename secnum to shndx. Only record
12652 Kept_comdat_section if sections are the same size.
12653 (Sized_relobj::include_linkonce_section): Update use of
12654 Kept_section. Only record Kept_comdat_section if sections are the
12655 same size. Set size of linkonce section.
12656 (Sized_relobj::map_to_kept_section): Update call to
12657 get_kept_comdat_section.
12658 * object.h (class Sized_relobj): Rename fields in
12659 Kept_comdat_section to drop trailing underscores; change object
12660 field to Relobj*. Change Kept_comdat_section_table to store
12661 struct rather than pointer.
12662 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12663 Add kept_object and kept_shndx parameters. Change all callers.
12664 (Sized_relobj::get_kept_comdat_section): Change return type to
12665 bool. Add kept_object and kept_shndx parameters. Change all
12666 callers.
12667 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12668 Layout::find_or_add_kept_section.
12669
37c3b7b0
ILT
126702009-07-09 Ian Lance Taylor <iant@google.com>
12671
12672 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12673 Reserve space in the hash table.
12674
98fa85cb
ILT
126752009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12676
12677 * fileread.cc (File_read::get_mtime): New method.
12678 * fileread.h (Timespec): New structure.
12679 (File_read::get_mtime): New method.
12680 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12681 Renamed from timestamp_nsec.
12682 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12683 Elf_Xword.
e1df38aa 12684 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12685 timestamp_nsec.
e1df38aa 12686 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12687 (Incremental_inputs::report_obejct): Save mtime; style fix.
12688 (Incremental_inputs::report_script): Save mtime; style fix.
12689 (Incremental_inputs::finalize_inputs): Style fix.
12690 (Incremental_inputs::finalize): Style fix.
12691 (Incremental_inputs::create_input_section_data): Store inputs
12692 mtime.
12693 * incremental.h (Incremental_inputs::report_script): Add mtime
12694 argument.
12695 (Incremental_inputs::Input_info::Input_info): Intialize only one
12696 union member.
12697 (Incremental_inputs::Input_info::archive): Move to nameless
12698 union.
12699 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12700 (Incremental_inputs::Input_info::script): Move to nameless union.
12701 (Incremental_inputs::mtime): New field.
12702 * script.cc (read_input_script): Pass file mtime to
12703 Incremental_input.
12704 * script.h (Script_info::inputs): Style fix.
12705
c9d70757
ILT
127062009-07-01 Ian Lance Taylor <ian@airs.com>
12707
12708 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12709 instead of 32.
12710
9c547ec3
ILT
127112009-06-24 Ian Lance Taylor <iant@google.com>
12712
12713 PR 10156
12714 * layout.cc (Layout::choose_output_section): If we find an
12715 existing section, update the flags.
12716 (Layout::create_notes): New function, broken out of
12717 Layout::finalize.
12718 (Layout::finalize): Don't create note sections.
12719 (Layout::create_note): Don't crash if linker script discards
12720 section.
12721 (Layout::create_gold_note): Likewise.
12722 (Layout::create_build_id): Likewise. Don't set
12723 after_input_sections on the section.
12724 (Layout::create_executable_stack_info): Remove target parameter.
12725 Change caller.
12726 * layout.h (class Layout): Declare create_notes. Update
12727 declaration of create_executable_stack_info.
12728 * gold.cc (queue_middle_tasks): Call create_notes.
12729 * output.cc (Output_section::update_flags_for_input_section): Move
12730 here from output.h. If SHF_ALLOC flag is newly set, mark address
12731 invalid.
12732 * output.h (Output_data::mark_address_invalid): New function.
12733 (class Output_section): Only declare, not define,
12734 update_flags_for_input_section. Remove set_flags.
12735
55458500
ILT
127362009-06-24 Ian Lance Taylor <iant@google.com>
12737
12738 * script-sections.cc (Output_section_definition::
12739 set_section_addresses): Rename shadowing local load_address to
12740 laddr.
12741
1307d6cd
ILT
127422009-06-24 Ian Lance Taylor <iant@google.com>
12743
12744 PR 10244
12745 * reloc.cc (relocate_sections): Skip empty relocation sections.
12746
ec3f783e
ILT
127472009-06-23 Ian Lance Taylor <iant@google.com>
12748
12749 PR 10156
12750 * layout.cc (Layout::create_note): Use choose_output_section
12751 rather than make_output_section.
12752
459c9f1c
ILT
127532009-06-23 Ian Lance Taylor <iant@google.com>
12754
12755 PR 10237
12756 * options.cc (General_options::parse_V): Set printed_version_.
12757 (General_options::General_options): Initialize printed_version_.
12758 * options.h (class General_options): Add printed_version_ field.
12759 * gold.cc (queue_initial_tasks): If there are no input files,
12760 don't give a fatal error if we printed the version information.
12761 (queue_middle_tasks): If using -r with a shared object, give a
12762 fatal error rather than an ordinary error.
12763
1518dc8f
ILT
127642009-06-23 Ian Lance Taylor <iant@google.com>
12765
12766 PR 10219
12767 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12768 (Layout::make_output_section): Set have_stabstr_section_ if we see
12769 a .stab*str section.
12770 (Layout::finalize): Call link_stabs_sections.
12771 (Layout::link_stabs_sections): New file.
12772 * layout.h (class Layout): Add have_stabstr_section_ field.
12773 Declare link_stabs_sections.
12774
3d857b98
DK
127752009-06-23 Doug Kwan <dougkwan@google.com>
12776
12777 * Makefile.am (libgold_a_LIBADD): New.
12778 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12779 * Makefile.in: Regenerate.
3d857b98
DK
12780 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12781 * configure: Regenerate.
12782 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12783 * fileread.cc: Include sys/state.h
12784 * gold.h: Declare memmem and strndup if found missing.
12785 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12786
0639a6f6
ILT
127872009-06-23 Ian Lance Taylor <iant@google.com>
12788
12789 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12790 * configure: Rebuild.
12791
8d63875c
ILT
127922009-06-23 Ian Lance Taylor <iant@google.com>
12793
12794 PR 10147
12795 * object.cc (Object::section_contents): Don't try to get a view if
12796 the section has length zero.
12797 (Object::handle_gnu_warning_section): If the section is empty, use
12798 the name of the section as the warning.
12799
f7c8a183
ILT
128002009-06-23 Ian Lance Taylor <iant@google.com>
12801
12802 PR 10133
12803 * stringpool.h (class Stringpool_template): Add optimize_ field.
12804 (Stringpool_template::set_optimize): New function.
12805 * stringpool.cc (Stringpool_template::Stringpool_template):
12806 Initialize optimize_ field.
12807 (Stringpool_template::set_string_offsets): Test local optimize
12808 fild rather than parameter.
12809 * layout.cc (Layout::Layout): Call set_optimize on the section
12810 name stringpool.
12811
e6a307ba
ILT
128122009-06-22 Ian Lance Taylor <iant@google.com>
12813
12814 PR 10030
12815 * yyscript.y: Parse TARGET.
12816 * script.cc (script_set_target): New function.
12817 * script-c.h (script_set_target): Declare.
12818 * options.cc (General_options::string_to_object_format): Rename
12819 from string_to_object_format in anonymous namespace. Change
12820 callers.
12821 * options.h (class General_options): Declare
12822 string_to_object_format.
12823
3ee173de
ILT
128242009-06-22 Ian Lance Taylor <iant@google.com>
12825
12826 * script-sections.cc (Script_sections::create_segments): Don't put
12827 program headers in a PT_LOAD segment if -n or -N.
12828
128292009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12830
12831 PR 10141
12832 * options.h (class General_options): Add -z lazy and -z now. Sort
12833 -z options into alphabetical order.
12834 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12835
cd6739a1 128362009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12837
12838 * layout.cc (Layout::make_output_section): Call
12839 Target::new_output_section.
12840 (Layout::attach_allocated_section_to_segment): Put large section
12841 sections in a separate load segment with the large segment flag
12842 set.
12843 (Layout::segment_precedes): Sort large data segments after other
12844 load segments.
12845 (align_file_offset): New static function.
12846 (Layout::set_segment_offsets): Use align_file_offset.
12847 * output.h (class Output_section): Add is_small_section_ and
12848 is_large_section_ fields.
12849 (Output_section::is_small_section): New function.
12850 (Output_section::set_is_small_section): New function.
12851 (Output_section::is_large_section): New function.
12852 (Output_section::set_is_large_section): New function.
12853 (Output_section::is_large_data_section): New function.
12854 (class Output_segment): Add is_large_data_segment_ field.
12855 (Output_segment::is_large_data_segment): New function.
12856 (Output_segment::set_is_large_data_segment): New function.
12857 * output.cc (Output_section::Output_section): Initialize new
12858 fields.
12859 (Output_segment::Output_segment): Likewise.
12860 (Output_segment::add_output_section): Add assertion that large
12861 data sections always go in large data segments. Force small data
12862 sections to the end of the list of data sections. Force small BSS
12863 sections to the start of the list of BSS sections. For large BSS
12864 sections to the end of the list of BSS sections.
12865 * symtab.h (class Symbol): Declare is_common_shndx.
12866 (Symbol::is_defined): Check Symbol::is_common_shndx.
12867 (Symbol::is_common): Likewise.
12868 (class Symbol_table): Define enum Commons_section_type. Update
12869 declarations. Add small_commons_ and large_commons_ fields.
12870 * symtab.cc (Symbol::is_common_shndx): New function.
12871 (Symbol_table::Symbol_table): Initialize new fields.
12872 (Symbol_table::add_from_object): Put small and large common
12873 symbols in the right list.
12874 (Symbol_table::sized_finalized_symbol): Check
12875 Symbol::is_common_shndx.
12876 (Symbol_table::sized_write_globals): Likewise.
12877 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12878 common symbol lists. Don't call do_allocate_commons_list if the
12879 list is empty.
12880 (Symbol_table::do_allocate_commons_list): Remove is_tls
12881 parameter. Add comons_section_type parameter. Change all
12882 callers. Handle small and large common symbols.
12883 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12884 Symbol::is_common_shndx.
12885 * resolve.cc (symbol_to_bits): Likewise.
12886 * target.h (Target::small_common_shndx): New function.
12887 (Target::small_common_section_flags): New function.
12888 (Target::large_common_shndx): New function.
12889 (Target::large_common_section_flags): New function.
12890 (Target::new_output_section): New function.
12891 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12892 small_common_section_flags, and large_common_section_flags
12893 fields.
12894 (Target::do_new_output_section): New virtual function.
12895 * arm.cc (Target_arm::arm_info): Initialize new fields.
12896 * i386.cc (Target_i386::i386_info): Likewise.
12897 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12898 Likewise.
12899 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12900 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12901 (Target_x86_64::do_new_output_section): New function.
12902 * configure.ac: Define conditional MCMODEL_MEDIUM.
12903 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12904 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12905 (large_LDFLAGS): Define.
12906 * testsuite/large.c: New file.
12907 * testsuite/testfile.cc (Target_test::test_target_info):
12908 Initialize new fields.
12909 * configure, testsuite/Makefile.in: Rebuild.
12910
bb04269c
DK
129112009-06-05 Doug Kwan <dougkwan@google.com>
12912
12913 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12914 * Makefile.in: Regenerate.
bb04269c
DK
12915 * i386.cc (class Target_i386): Define new virtual method to
12916 override do_is_local_label_name in parent.
12917 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12918 local symbols if --discard-locals or -X is given.
12919 * options.h (class General_options): Declare new options
12920 '--discard-locals' and '-X' for discarding locals.
12921 * target.h (class Target): Define new methods is_local_label_name.
12922 Declare new virtual method do_is_local_label_name.
12923 * target.cc: New file.
12924 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12925 (check_SCRIPTS): Add discard_locals_test.sh.
12926 (check_DATA): Add discard_local_tests.syms.
12927 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12928 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12929 * testsuite/Makefile.in: Regenerate.
12930 * testsuite/discard_locals_test.c: New file.
12931 * testsuite/discard_locals_test.sh: Same.
12932
805bb01c
DK
129332009-06-05 Doug Kwan <dougkwan@google.com>
12934
12935 * object.cc (Sized_relobj::Sized_relobj): Initialize
12936 discarded_eh_frame_shndx_ to -1U.
12937 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12938 section.
12939 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12940 a discarded .eh_frame section.
12941 (Sized_relobj::do_finalize_local_symbols): Ditto.
12942 * object.h (class Sized_relobj): Declare new member
12943 discarded_eh_frame_shndx_.
12944 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12945 (local_labels_test.o, local_labels_test): New rules.
12946 * testsuite/Makefile.in: Regenerate.
12947
1dcd334d
DK
129482009-06-04 Doug Kwan <dougkwan@google.com>
12949
12950 * layout.cc (Layout::section_name_mapping): Add mapping for
12951 special ARM sections.
12952
96d49306
DK
129532009-06-03 Doug Kwan <dougkwan@google.com>
12954
12955 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12956 (utils::has_overflow): Same.
12957
dff16297
ILT
129582009-06-03 Ian Lance Taylor <iant@google.com>
12959
12960 * layout.cc (Layout::section_name_mapping): New array, replacing
12961 Layout::linkonce_mapping.
12962 (Layout::section_name_mapping_count): New variable, replacing
12963 Layout::linkonce_mapping_count.
12964 (Layout::linkonce_output_name): Remove.
12965 (Layout::output_section_name): Rewrite.
12966 * layout.h (class Layout): Rename Linkonce_mapping to
12967 Section_name_mapping, linkonce_mapping to section_name_mapping,
12968 linkonce_mapping_count to section_name_mapping_count. Don't
12969 declare linkonce_output_name.
12970
c121c671
DK
129712009-06-03 Doug Kwan <dougkwan@google.com>
12972
12973 * gold/arm.cc (namespace utils): New.
12974 (Target_arm::reloc_is_non_pic): Define new method.
12975 (class Arm_relocate_functions): New.
12976 (Target_arm::Relocate::relocate): Handle relocation types used by
12977 Android.
12978
07800fab
ILT
129792009-06-03 Ian Lance Taylor <iant@google.com>
12980
12981 * arm.cc (Target_arm::scan::global): Use || instead of |.
12982
c121c671
DK
129832009-06-02 Doug Kwan <dougkwan@google.com>
12984
12985 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12986 issued_non_pic_error_.
12987 (class Target_arm::Scan): Declare new method check_non_pic.
12988 Define new method symbol_needs_plt_entry.
12989 Declare new data member issued_non_pic_error_.
12990 (class Target_arm::Relocate): Declare new method
12991 should_apply_static_reloc.
12992 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12993 (Target_arm::Scan::check_non_pic): Define new method.
12994 (Target_arm::Scan::local): Handle a small subset of reloc types used
12995 by Android.
12996 (Target_arm::Scan::local): Same.
12997 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12998
b19b0c6d
ILT
129992009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13000
13001 * incremental.cc (Incremental_inputs::report_command_line): Filter
13002 out --incremental-* options.
13003
94cdfcff
DK
130042009-05-29 Doug Kwan <dougkwan@google.com>
13005
13006 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13007 template class.
13008 (class Target_arm): Update comment.
13009 (Target_arm::Target_arm): Initialize new data members GOT_,
13010 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13011 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13012 and Target_arm::rel_dyn_section.
13013 Declare new_enum Target_arm::Got_type.
13014 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13015 and DYNBSS_.
13016 Update commments for member do_dynsym_value.
13017 (Target_arm::got_size, Target_arm::plt_section,
13018 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13019 new methods inside class defintion.
13020 (Target_arm::got_section): Define new method.
13021 (Target_arm::rel_dyn_section): Same.
13022 (Output_data_plt_arm): New template class.
13023 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13024 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13025 (Output_data_plt_arm::add_entry): Same.
13026 (Output_data_plt_arm::first_plt_entry): Define new
13027 static data member for PLT instruction template.
13028 (Output_data_plt_arm::plt_entry): Same.
13029 (Output_data_plt_arm::do_write): Define new method.
13030 (Target_arm::make_plt_entry): Same.
13031 (Target_arm::do_finalize_sections): Same.
13032 (Target_arm::do_dynsym_value): Same.
13033
4a657b0d
DK
130342009-05-28 Doug Kwan <dougkwan@google.com>
13035
13036 * Makefile.am (TARGETSOURCES): Add arm.cc.
13037 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13038 * Makefile.in: Regenerate.
13039 * arm.cc: New file.
13040 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13041
e7ae8c36
DK
130422009-05-26 Doug Kwan <dougkwan@google.com>
13043
13044 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13045 (General_options::check_excluded_libs): Strip off directories in
13046 archive name before matching like GNU ld does.
13047 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13048 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13049 (exclude_libs_test_LDFLAGS): Add linker option
13050 -Wl,--exclude-libs,libexclude_libs_test_3
13051 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13052 an explicit archive without using -l.
13053 (alt/libexclude_libs_test_3.a): New make rule.
13054 * testsuite/Makefile.in: Regenerate.
13055 * testsuite/exclude_libs_test.c : Declare lib3_default().
13056 (main): Call it.
13057 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13058 * exclude_libs_test_3.c: New file.
13059
f12e7348
NC
130602009-05-26 Nick Clifton <nickc@redhat.com>
13061
13062 * po/id.po: New Indonesian translation.
13063 * po/gold.pot: Updated template file.
13064
4daadc0d
ST
130652009-05-22 Sriraman Tallam <tmsriram@google.com>
13066
e1df38aa 13067 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13068 gc_comdat_test files. Add -Wl,--gc-sections to build
13069 gc_comdat_test.
13070 * testsuite/Makefile.in: Regenerate.
13071 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13072
531813ad
ST
130732009-05-21 Sriraman Tallam <tmsriram@google.com>
13074
13075 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13076 kept comdat section was garbage collected.
13077 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13078 * testsuite/Makefile.in: Regenerate.
13079 * testsuite/gc_comdat_test.sh: New file.
13080 * testsuite/gc_comdat_test_1.cc: New file.
13081 * testsuite/gc_comdat_test_2.cc: New file.
13082
65514900
CC
130832009-05-19 Doug Kwan <dougkwan@google.com>
13084
13085 * archive.cc (Archive::Archive): Move constructor from archive.h
13086 to here. Initialize no_export_.
13087 (Archive::get_elf_object_for_member): Set no_export flag of object.
13088 * archive.h (Archive::Archive): Move constructor body to
13089 archive.cc.
13090 (Archive::no_export): New method.
13091 (Archive::no_export_): New field.
13092 * object.h (Object::Object): Initialize no_export_ to false.
13093 (Object::no_export, Object::set_no_export): New methods.
13094 (Object::no_export_): New field.
13095 * options.cc (General_options::parse_exclude_libs): New method.
13096 (General_options::check_excluded_libs) Same.
13097 * options.h (exclude_libs): New option.
13098 (General_options::check_excluded_libs): New method declaration.
13099 (General_options::excluded_libs_): New field.
13100 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13101 default or protected visibility if an object has no-export flag set.
13102 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13103 (check_SCRIPTS): Add exclude_libs_test.sh.
13104 (check_DATA): Add exclude_libs_test.syms.
13105 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13106 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13107 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13108 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13109 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13110 libexclude_libs_test_2.a): New rules.
13111 * testsuite/Makefile.in: Regenerate.
13112 * testsuite/exclude_libs_test.c: New file.
13113 * testsuite/exclude_libs_test.sh: Ditto.
13114 * testsuite/exclude_libs_test_1.c: Ditto.
13115 * testsuite/exclude_libs_test_2.c: Ditto.
13116
1b77ea50
ILT
131172009-05-15 Ian Lance Taylor <iant@google.com>
13118
13119 * configure.ac: Check for declarations for cases where libiberty.h
13120 checks HAVE_DECL_xxx.
13121 * configure, config.in: Rebuild.
13122
072fe7ce
ILT
131232009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13124
13125 * gold.h (Incremental_argument_list): Remove (invalid) forward
13126 declaration.
13127 * incremental.cc (Incremental_inputs::report_achive): New method.
13128 (Incremental_inputs::report_object): New method.
13129 (Incremental_inputs::report_script): New method.
13130 (Incremental_inputs::finalize_inputs): New method.
13131 (Incremental_inputs::finalize): Call finalize_inputs().
13132 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13133 Create inputs entries.
13134 * incremental.h (Incremental_input_type): New enum.
13135 (Incremental_inputs::Incremental_input): Initialize new fields.
13136 (Incremental_inputs::report_inputs): New method.
13137 (Incremental_inputs::report_achive): New method.
13138 (Incremental_inputs::report_object): New method.
13139 (Incremental_inputs::report_script): New method.
13140 (Incremental_inputs::finalize_inputs): New method.
13141 (Incremental_inputs::Input_info): New struct.
13142 (Incremental_inputs::Input_info_map): New typedef.
13143 (Incremental_inputs::lock_): New field.
13144 (Incremental_inputs::Inputs_): New field.
13145 (Incremental_inputs::Inputs_map): New field.
13146 * main.cc (main): Call Incremental_input::report_inputs.
13147 * options.h (Input_argument_list): Typedef moved from
13148 Input_arguments.
13149 (Input_file_group::Files): Remove, use ::Input_argument_list.
13150 (Input_file_group::Input_argument_list): Remove, use
13151 ::Input_argument_list.
13152 * plugin.cc (Plugin_manager::add_input_file): Add error in
13153 incremental build.
13154 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13155 functions.
13156 * script.cc (read_input_script): Call
13157 Incremental_input::report_script.
13158 * script.h (Script_info): New class.
13159
b0481b0b
ILT
131602009-04-27 Ian Lance Taylor <iant@google.com>
13161
13162 * x86_64.cc (do_adjust_output_section): Set entsize to
13163 plt_entry_size.
13164
b22a5a41 131652009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13166
13167 * output.cc (Output_file::close): After short writes, continue
13168 writing from the correct offset in the buffer being written.
13169
40fde488
CD
131702009-04-23 Chris Demetriou <cgd@google.com>
13171
13172 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13173 * configure: Regenerate.
13174 * config.in: Regenerate.
13175 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13176 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13177
3ce2c28e
ILT
131782009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13179
13180 * incremental.cc (Incremental_inputs_header_data): Renamed from
13181 Incremental_input_header_data.
13182 (Incremental_inputs_header_data::data_size): New field.
13183 (Incremental_inputs_header_data::put_input_file_count): Renamed
13184 from input_file_count.
13185 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13186 from command_line_offset.
13187 (Incremental_inputs_header_data::put_reserved): Renamed from
13188 put_reserved.
13189 (Incremental_inputs_entry_data): Renamed from
13190 Incremental_input_entry_data.
13191 (Incremental_inputs_entry_data::data_size): New field.
13192 (Incremental_inputs::report_command_line): New method.
13193 (Incremental_inputs::finalize): New method.
13194 (Incremental_inputs::create_incremental_inputs_data): New method.
13195 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13196 * incremental.h: New file.
13197 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13198 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13199 incremental builds.
703d02da 13200 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13201 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13202 (Layout::create_incremental_info_sections): New method.
13203 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13204 * main.cc (main): Notify Incremental_input of the command line.
13205
e55bde5e
ILT
132062009-04-01 Ian Lance Taylor <iant@google.com>
13207 Mikolaj Zalewski <mikolajz@google.com>
13208
13209 * gold.h (reserve_unordered_map): Define, three versions, one for
13210 each version of Unordered_map.
13211 * layout.cc (Layout::Layout): Remove options parameter. Add
13212 number_of_input_files parameter. Don't initialize options_.
13213 Initialize number_of_input_files_ and resized_signatures_. Move
13214 sections_are_attached_.
13215 (Layout::layout_group): Reserve space for group_signatures_.
13216 (Layout::find_or_add_kept_section): Change name parameter to be a
13217 reference. Resize signatures_ map when it gets large enough.
13218 (Layout::layout_eh_frame): Use parameters->options() instead of
13219 this->options_.
13220 (Layout::make_output_section): Likewise.
13221 (Layout::attach_allocated_section_to_segment): Likewise.
13222 (Layout::finalize, Layout::create_executable_stack): Likewise.
13223 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13224 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13225 * layout.h (class Layout): Update declarations. Remove options_
13226 field. Add number_of_input_files_ and resized_signatures_
13227 fields. Move sections_are_attached_ field.
13228 * main.cc (main): Pass number of input files to Layout
13229 constructor. Don't pass options.
13230
154b857c
ILT
132312009-03-30 Ian Lance Taylor <iant@google.com>
13232
13233 * ffsll.c (ffsll): Correct implementation.
13234
2f35ab9b
ILT
132352009-03-27 Ian Lance Taylor <iant@google.com>
13236
fd03461a
ILT
13237 * ffsll.c: New file.
13238 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13239 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13240 * ftruncate.c (ftruncate): Declare before definition.
13241 * mremap.c (mremap): Likewise.
13242 * pread.c (pread): Likewise.
13243 * configure, Makefile.in, config.in: Rebuild.
13244
2f35ab9b
ILT
13245 * mremap.c: New file.
13246 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13247 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13248 (mremap): Declare if HAVE_MREMAP is not defined.
13249 * configure, Makefile.in, config.in: Rebuild.
13250
33aea2fd
CC
132512009-03-27 Cary Coutant <ccoutant@google.com>
13252
13253 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13254 position independent.
13255 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13256 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13257
6d479619
CC
132582009-03-24 Cary Coutant <ccoutant@google.com>
13259
13260 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13261 an executable.
13262 (needs_dynamic_reloc): Likewise.
13263
afc06bb8
ILT
132642009-03-24 Ian Lance Taylor <iant@google.com>
13265
13266 * yyscript.y (file_cmd): Recognize EXTERN.
13267 (extern_name_list, extern_name_list_body): New nonterminals.
13268 * script.cc (script_add_extern): Define.
13269 * script-c.h (script_add_extern): Declare.
13270
f6060a4d
ILT
132712009-03-24 Rafael Avila de Espindola <espindola@google.com>
13272
13273 * object.cc (is_elf_object): Define.
13274 * object.h (is_elf_object): Declare.
13275 * archive.cc (Archive::get_elf_object_for_member): Call
13276 is_elf_object.
33aea2fd 13277 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13278
26736d8e
ILT
132792009-03-24 Elliott Hughes <enh@google.com>
13280
13281 * output.cc (Output_file::map_anonymous): Define.
13282 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13283 try an anonymous one. Report the size if the mmap fails.
13284 * output.h (class Output_file): Declare map_anonymous.
13285
22fd9730
ILT
132862009-03-24 Ian Lance Taylor <iant@google.com>
13287
13288 * target-select.cc (instantiate_target): Don't acquire the lock if
13289 the instantiated_target_ field has already been set.
13290
cb010894
ILT
132912009-03-23 Ian Lance Taylor <iant@google.com>
13292
7f055c20
ILT
13293 * gold-threads.h (class Initialize_lock): Define.
13294 * gold-threads.cc (class Initialize_lock_once): Define.
13295 (initialize_lock_control): New static variable.
13296 (initialize_lock_pointer): New static variable.
13297 (initialize_lock_once): New static function.
13298 (Initialize_lock::Initialize_lock): Define.
13299 (Initialize_lock::initialize): Define.
13300 * target-select.h: Include "gold-threads.h".
13301 (class Target_selector): Add lock_ and initialize_lock_ fields.
13302 Don't define instantiate_target, just declare it.
13303 * target-select.cc (Target_selector::Target_selector): Initialize
13304 new fields.
13305 (Target_selector::instantiate_target): Define.
13306 * descriptors.h: Include "gold-threads.h".
13307 (class Descriptors): Add initialize_lock_ field.
13308 * descriptors.cc (Descriptors::Descriptors): Initialize new
13309 field.
13310 (Descriptors::open): Use initialize_lock_ field
13311 * errors.h (class Errors): Add initialize_lock_ field.
13312 * errors.cc (Errors::Errors): Initialize new field.
13313 (Errors::initialize_lock): Use initialize_lock_ field.
13314 * powerpc.cc (class Target_selector_powerpc): Remove
13315 instantiated_target_ field. In do_recognize call
13316 instantiate_target rather than do_instantiate_target. In
13317 do_instantiate_target just allocate a new target.
13318 * sparc.cc (class Target_selector_sparc): Likewise.
13319
36959681
ILT
13320 * freebsd.h: New file.
13321 * i386.cc: Include "freebsd.h".
13322 (Target_i386): Derive from Target_freebsd rather than
13323 Sized_target.
13324 (Target_selector_i386): Derive from Target_selector_freebsd rather
13325 than Target_selector.
13326 * x86_64.cc: Include "freebsd.h".
13327 (Target_x86_64): Derive from Target_freebsd rather than
13328 Sized_target.
13329 (Target_selector_x86_64): Derive from Target_selector_freebsd
13330 rather than Target_selector.
13331 * target.h (class Target): Add adjust_elf_header and
13332 do_adjust_elf_header.
13333 * output.cc (Output_file_header:: do_sized_write): Call target
13334 adjust_elf_header routine.
13335 * configure.tgt: Set targ_osabi.
13336 * configure.ac: Define GOLD_DEFAULT_OSABI.
13337 * parameters.cc (Parameters::default_target): Pass
13338 GOLD_DEFAULT_OSABI to select_target.
13339 * target-select.h (class Target_selector): Make instantiate_target
13340 protected rather than private.
13341 * Makefile.am (HFILES): Add freebsd.h.
13342 * configure, Makefile.in, config.in: Rebuild.
13343
cb010894
ILT
13344 * merge.cc (do_add_input_section): Correct pend value. Change
13345 message about last entry not being null terminated from error to
13346 warning.
13347
0e879927
ILT
133482009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13349
13350 * incremental.cc: New file.
13351 * Makefile.am (CCFILES): Add incremental.cc.
13352 * Makefile.in: Rebuild.
13353
41105937
PP
133542009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13355
13356 * layout.cc (Layout::output_section_name): Preserve names
13357 of '.note.' sections.
e1df38aa 13358
60439920
ILT
133592009-03-19 Ian Lance Taylor <iant@google.com>
13360
13361 * descriptors.cc (Descriptors::open): Check that the options are
13362 valid before using them.
13363
0d371ad3
ILT
133642009-03-18 Ian Lance Taylor <iant@google.com>
13365
13366 * script-sections.h: Include <list>.
13367 (class Script_sections): Change Sections_elements from std::vector
13368 to std::list. Typedef public Elements_iterator. Add
13369 orphan_section_placement_, data_segment_align_start_, and
13370 saw_data_segment_align_ fields. Remove data_segment_align_index_
13371 field.
13372 * script-sections.cc (class Orphan_section_placement): New class.
13373 (class Sections_element): Add virtual functions is_relro and
13374 orphan_section_init. Remove virtual function place_orphan_here.
13375 (class Output_section_definition): Add is_relro and
13376 orphan_section_init. Remove place_orphan_here.
13377 (class Orphan_output_section): Likewise.
13378 (Script_sections::Script_sections): Update for field changes.
13379 (Script_sections::data_segment_align): Set saw_data_segment_align_
13380 and data_segment_align_start_, not data_segment_align_index.
13381 (Script_sections::data_segment_relro_end): Check
13382 saw_data_segment_align_. Use data_segment_align_start_ rather
13383 than data_segment_align_index_.
13384 (Script_sections::place_orphan): Rewrite to use
13385 Orphan_section_placement.
13386
9201d894
ILT
133872009-03-17 Ian Lance Taylor <iant@google.com>
13388
9c5b8369
ILT
13389 * archive.cc (Archive::add_symbols): Check for a version attached
13390 to the symbol name in the archive map.
13391 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13392 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13393 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13394 (ver_test_11.a): New target.
13395 * testsuite/Makefile.in: Rebuild.
13396
9201d894
ILT
13397 * configure.ac: Check for chsize and posix_fallocate. Replace
13398 ftruncate.
13399 * ftruncate.c: New file, from gnulib.
13400 * output.cc (posix_fallocate): Define dummy version if not
13401 HAVE_POSIX_FALLOCATE.
13402 (Output_file::map): Call posix_fallocate rather than lseek and
13403 write.
13404 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13405 * configure, Makefile.in, config.in: Rebuild.
13406
ef4ab7a8 134072009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13408
ef4ab7a8
PP
13409 * layout.h (Layout::create_note): Add section_name parameter.
13410 * layout.cc (Layout::create_note): Likewise.
13411 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13412
8c500701
ILT
134132009-03-17 Ian Lance Taylor <iant@google.com>
13414
e85b18e1
ILT
13415 * descriptors.cc: Include "options.h".
13416 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13417 (Descriptors::open): Always use O_CLOEXEC when opening a new
13418 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13419 then set FD_CLOEXEC.
13420
9efe6174
ILT
13421 * sparc.cc (class Target_sparc): Add has_got_section.
13422 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13423 make sure we have a GOT section.
13424
13425 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13426 (Target_sparc::Scan::local): Likewise.
13427 (Target_sparc::Scan::global): Likewise.
13428 (Target_sparc::Relocate::relocate): Likewise.
13429 (Target_sparc::Relocate::relocate_tls): Likewise.
13430
8c500701
ILT
13431 * symtab.cc (Symbol_table::define_default_version): New function,
13432 broken out of add_from_object.
13433 (Symbol_table::add_from_object): Call define_default_version.
13434 (Symbol_table::define_special_symbol): Add resolve_oldsym
13435 parameter. Change all callers. If the version for a symbol comes
13436 from a version script, resolve it with the symbol with the same
13437 name with no version. Also add the symbol without a version if
13438 appropriate.
13439 (do_define_in_output_data): If resolving with oldsym, don't delete
13440 sym.
13441 (do_define_in_output_segment): Likewise.
13442 (do_define_as_constant): Likewise.
13443 * symtab.h (class Symbol_table): Update declarations.
13444
f1ed28fb
ILT
134452009-03-13 Ian Lance Taylor <iant@google.com>
13446
15f8229b
ILT
13447 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13448 (Read_symbols::requeue): New function.
13449 (Read_symbols::do_read_symbols): If make_elf_object fails because
13450 the target type is not configured, and the file was searched for,
13451 issue a warning and retry with the next directory.
13452 (Add_symbols::run): If the file has an incompatible format, and
13453 it was searched for, requeue the Read_symbols task. On error,
13454 release the object.
13455 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13456 dirindex parameter to constructor. Change all callers. Declare
13457 incompatible_warning and requeue.
13458 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13459 input_argument_ and input_group_ fields. Add them to
13460 constructor. Change all callers.
13461 (class Read_script): Add dirindex_ field. Add it to constructor.
13462 Change all callers.
13463 * archive.cc (Archive::setup): Remove input_objects parameter.
13464 Change all callers.
13465 (Archive::get_file_and_offset): Likewise.
13466 (Archive::read_all_symbols): Likewise.
13467 (Archive::read_symbols): Likewise.
13468 (Archive::get_elf_object_for_member): Remove input_objects
13469 parameter. Add punconfigured parameter. Change all callers.
13470 (Archive::add_symbols): Change return type to bool. Check return
13471 value of include_member.
13472 (Archive::include_all_members): Likewise.
13473 (Archive::include_member): Change return type to bool. Return
13474 false if first included object has incompatible target. Set
13475 included_member_ field.
13476 (Add_archive_symbols::run): If add_symbols returns false, requeue
13477 Read_symbols task.
13478 * archive.h (class Archive): Add included_member_ field.
13479 Initialize it in constructor. Add input_file and searched_for
13480 methods. Update declarations.
13481 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13482 input_argument_ fields. Add them to constructor. Change all
13483 callers.
13484 * script.cc: Include "target-select.h".
13485 (class Parser_closure): Add skip_on_incompatible_target_ and
13486 found_incompatible_target_ fields. Add
13487 skip_on_incompatible_target parameter to constructor. Change all
13488 callers. Add methods skip_on_incompatible_target,
13489 clear_skip_on_incompatible_target, found_incompatible_target, and
13490 set_found_incompatible_target.
13491 (read_input_script): Add dirindex parameter. Change all callers.
13492 If parser finds an incompatible target, requeue Read_symbols
13493 task.
13494 (script_set_symbol): Clear skip_on_incompatible_target in
13495 closure.
13496 (script_add_assertion, script_parse_option): Likewise.
13497 (script_start_sections, script_add_phdr): Likewise.
13498 (script_check_output_format): New function.
13499 * script.h (read_input_script): Update declaration.
13500 * script-c.h (script_check_output_format): Declare.
13501 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13502 (ignore_cmd): Remove OUTPUT_FORMAT.
13503 * fileread.cc (Input_file::Input_file): Add explicit this.
13504 (Input_file::will_search_for): New function.
13505 (Input_file::open): Add pindex parameter. Change all callers.
13506 * fileread.h (class Input_file): Add input_file_argument method.
13507 Declare will_search_for. Update declarations.
13508 * object.cc (make_elf_object): Add punconfigured parameter.
13509 Change all callers.
13510 * object.h (class Object): Make input_file public. Add
13511 searched_for method.
13512 (make_elf_object): Update declaration.
13513 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13514 restart search.
13515 * dirsearch.h (class Dirsearch): Update declaration.
13516 * options.h (class General_options): Add --warn-search-mismatch.
13517 * parameters.cc (Parameters::is_compatible_target): New function.
13518 * parameters.h (class Parameters): Declare is_compatible_target.
13519 * workqueue.cc (Workqueue::add_blocker): New function.
13520 * workqueue.h (class Workqueue): Declare add_blocker.
13521
f1ed28fb
ILT
13522 * fileread.cc (Input_file::open): Remove options parameter.
13523 Change all callers.
13524 (Input_file::open_binary): Likewise.
13525 * script.cc (read_input_script): Likewise.
13526 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13527 options parameter from constructor. Change all callers.
13528 (class Read_script): Likewise.
13529 * fileread.h (class Input_file): Update declarations.
13530 * script.h (read_input_script): Update declaration.
13531
34dd024a
NC
135322009-03-10 Nick Clifton <nickc@redhat.com>
13533
13534 * po/es.po: New Spanish translation.
13535
6d71b17c
CC
135362009-03-06 Cary Coutant <ccoutant@google.com>
13537
13538 * options.cc (parse_short_option): Keep dash_z from registering itself.
13539
031cdbed
ILT
135402009-03-03 Ian Lance Taylor <iant@google.com>
13541
13542 PR 9918
13543 * target-reloc.h (relocate_section): Pass output_section to
13544 relocate.
13545 * i386.cc (Target_i386::should_apply_static_reloc): Add
13546 output_section parameter. Change all callers.
13547 (Target_i386::Relocate::relocate): Add output_section parameter.
13548 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13549 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13550 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13551 * testsuite/two_file_shared.sh: New script.
13552 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13553 (check_DATA): Add two_file_shared.dbg.
13554 (two_file_shared.dbg): New target.
13555 * testsuite/Makefile.in: Rebuild.
13556
15d5fa16
ILT
135572009-03-01 Ian Lance Taylor <iant@google.com>
13558
13559 * configure.ac: Check for byteswap.h.
13560 * configure: Rebuild.
13561 * config.in: Rebuild.
13562
8a4c0b0d
ILT
135632009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13564
13565 * layout.cc (Layout::find_or_add_kept_section): New function.
13566 (Layout::add_comdat): Removed.
13567 * layout.h (struct Kept_section): Move out of class Layout.
13568 Remove trailing underscores from field names. Add group_sections
13569 field. Rename group_ field to is_group. Change all uses.
13570 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13571 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13572 comdat_groups_ field.
13573 (Sized_relobj::include_section_group): Use
13574 find_or_add_kept_section and Kept_section::group_sections.
13575 (Sized_relobj::include_linkonce_section): Likewise.
13576 * object.cc (class Sized_relobj): Don't define Comdat_group or
13577 Comdat_group_table. Remove find_comdat_group and
13578 add_comdat_group. Remove comdat_groups_ field.
13579 * plugin.cc (include_comdat_group): Use
13580 Layout::find_or_add_kept_section.
13581
b4ecf66b
ILT
135822009-02-28 Ian Lance Taylor <iant@google.com>
13583
14359ca0
ILT
13584 * README: --gc-sections and map files are now supported. Document
13585 some build requirements.
13586
b4ecf66b
ILT
13587 PR 6992
13588 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13589 relocatable link set the value of the section symbol to zero.
13590 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13591 relocatable link don't include the section address in the local
13592 symbol value.
13593
0602e05a
ILT
135942009-02-27 Ian Lance Taylor <iant@google.com>
13595
fd9d194f
ILT
13596 PR 6811
13597 * options.h (class Search_directory): Add is_system_directory.
13598 (class General_options): Declare is_in_system_directory.
13599 * options.cc (get_relative_sysroot): Make static.
13600 (get_default_sysroot): Make static.
13601 (General_optoins::is_in_system_directory): New function.
13602 * fileread.cc (Input_file::is_in_system_directory): New function.
13603 * fileread.h (class Input_file): Declare is_in_system_directory.
13604 * object.h (class Object): Add is_in_system_directory.
13605 (class Input_objects): Remove system_library_directory_ field.
13606 * object.cc (Input_objects::add_object): Don't set
13607 system_library_directory_.
13608 (input_objects::found_in_system_library_directory): Remove.
13609 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13610 parameter. Change all callers.
13611 (Symbol_table::sized_write_globals): Likewise.
13612 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13613 Call Object::is_in_system_directory.
13614 * symtab.h (class Symbol_table): Update declarations.
13615
61edd21f
ILT
13616 PR 5990
13617 * descriptors.h (Open_descriptor): Add is_on_stack field.
13618 * descriptors.cc (Descriptors::open): If the descriptor is on the
13619 top of the stack, remove it. Initialize is_on_stack field.
13620 (Descriptors::release): Only add pod to stack if it is not on the
13621 stack already.
13622 (Descriptors::close_some_descriptor): Clear stack_next and
13623 is_on_stack fields.
13624
e29e076a
ILT
13625 PR 7091
13626 * output.cc (Output_section::find_starting_output_address): Rename
13627 from starting_output_address; add PADDR parameter; change return
13628 type.
13629 * output.h (class Output_section): Declare
13630 find_starting_output_address instead of starting_output_address.
13631 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13632 section symbol for which we can't find a merge section.
13633
0602e05a
ILT
13634 PR 9836
13635 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13636 hidden or internal, force the symbol to be local.
13637 * resolve.cc (Symbol::override_visibility): Define.
13638 (Symbol::override_base): Use override_visibility.
13639 (Symbol_table::resolve): Likewise.
13640 (Symbol::override_base_with_special): Likewise.
13641 (Symbol_table::override_with_special): If the visibility is hidden
13642 or internal, force the symbol to be local.
13643 * symtab.h (class Symbol): Add set_visibility and
13644 override_visibility.
13645 * testsuite/ver_test_1.sh: New file.
13646 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13647 (check_DATA): Add ver_test_1.syms.
13648 (ver_test_1.syms): New target.
13649 * testsuite/Makefile.in: Rebuild.
13650
401a9a73
CC
136512009-02-25 Cary Coutant <ccoutant@google.com>
13652
13653 * layout.cc (Layout::choose_output_section): Don't rename sections
13654 when using a linker script that has a SECTIONS clause.
13655 * Makefile.in: Regenerate.
13656
13657 * testsuite/Makefile.am (script_test_5.sh): New test case.
13658 * testsuite/Makefile.in: Regenerate.
13659 * testsuite/script_test_5.cc: New file.
13660 * testsuite/script_test_5.sh: New file.
13661 * testsuite/script_test_5.t: New file.
13662
f488e4b0
CC
136632009-02-13 Rafael Avila de Espindola <espindola@google.com>
13664
13665 * archive.cc (Archive::include_member): Update calls to add_symbols.
13666 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13667 the Layout argument.
13668 * dynobj.h (do_add_symbols): Add the Layout argument.
13669 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13670 Layout argument.
13671 * object.h (Object::add_symbols): Add the Layout argument.
13672 (Object::do_add_symbols): Add the Layout argument.
13673 (Sized_relobj::do_add_symbols): Add the Layout argument.
13674 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13675 Unify the two versions.
13676 (Add_plugin_symbols): Remove.
13677 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13678 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13679 (Add_plugin_symbols): Remove.
13680 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13681 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13682 (Add_symbols::run): Make it work with Pulginobj.
13683
89dd1680
ILT
136842009-02-06 Ian Lance Taylor <iant@google.com>
13685
13686 * object.cc (Sized_relobj::do_layout): Make info message start
13687 with lower case letter.
13688
266d0a74
ILT
136892009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13690
602b464e
ILT
13691 * binary.cc: Fix file comment.
13692
266d0a74
ILT
13693 * options.h (enum Incremental_disposition): Define.
13694 (class General_options): Add new options: --incremental,
13695 --incremental_changed, --incremental_unchanged,
13696 --incremental_unknown. Add incremental_disposition_ and
13697 implicit_incremental_ fields.
13698 (General_options::incremental_disposition): New function.
13699 (class Position_dependent_options): Add incremental_disposition
13700 option.
13701 (Position_dependent_options::copy_from_options): Set incremental
13702 dispositions.
13703 * options.cc (General_options::parse_incremental_changed): New
13704 function.
2e702c99
RM
13705 (General_options::parse_incremental_unchanged): New function.
13706 (General_options::parse_incremental_unknown): New function.
13707 (General_options::General_options): Initialize new fields
266d0a74 13708 incremental_disposition_ and implicit_incremental_.
2e702c99 13709 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13710 without --incremental.
13711
f073bbf7
CD
137122009-02-06 Chris Demetriou <cgd@google.com>
13713
13714 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13715 pointer and to report location as the file name associated with
13716 the symbol.
13717 (gold_undefined_symbol_at_location): New function to replace the
13718 old gold_undefined_symbol functionality.
13719 * target-reloc.h (relocate_section): Update to use
13720 gold_undefined_symbol_at_location.
13721 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13722 Call gold_undefined_symbol function rather than gold_error.
13723 * errors.h (Errors::undefined_symbol): Take location as a
13724 string, rather than calculating it from a relocation.
13725 * errors.cc (Errors::fatal): Print "fatal error:" before the
13726 formatted message.
13727 (Errors::error, Errors::error_at_location): Print "error: "
13728 before the formatted message.
13729 (Errors::undefined_symbol): Take location as a string, rather
13730 than calculating it from a relocation.
13731 (gold_undefined_symbol_at_location): New function akin to
13732 old gold_undefined_symbol, calculates location from relocation.
13733 (gold_undefined_symbol): Change to take only a Symbol pointer
13734 and to report location as the file name associated with the symbol.
13735 * testsuite/debug_msg.sh: Update for changed error messages.
13736 * testsuite/undef_symbol.sh: Likewise.
13737
8e94a90c
ILT
137382009-02-04 Duncan Sands <baldrick@free.fr>
13739
13740 PR 9812
13741 * reduced_debug_output.h
13742 (Output_reduced_debug_abbrev_section::failed): Use format for
13743 gold_warning.
13744 (Output_reduced_debug_info_section::faild): Likewise.
13745
88a0e15b
ILT
137462009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13747
13748 * script.cc (Lazy_demangler): New class.
2e702c99 13749 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13750 symbol only once.
13751
5efc7cd2
CC
137522009-01-29 Cary Coutant <ccoutant@google.com>
13753
13754 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13755 to __tls_get_addr.
13756 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13757
e0ebcf42
ILT
137582009-01-28 Ian Lance Taylor <iant@google.com>
13759
5efc7cd2 13760 * version.cc (version_string): Bump to 1.9.
75fe7426 13761
e0ebcf42
ILT
13762 * gold.h: Include <cstring> and <stdint.h>.
13763 * version.cc: Include <cstdio>.
13764 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13765 warning.
13766 * reduced_debug_output.cc (insert_into_vector): Rename from
13767 Insert_into_vector; change all callers. Use Swap_unaligned to
13768 avoid aliasing issue; remove union since it is unnecessary.
13769
8e2813be 137702009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13771
13772 * Makefile.am (CCFILES): Add gc.cc.
13773 (HFILES): Add gc.h.
13774 * Makefile.in: Regenerate.
13775 * gold.cc (Gc_runner): New class.
13776 (queue_initial_tasks): Call garbage collection related tasks
13777 when corresponding options are invoked.
13778 (queue_middle_gc_tasks): New function.
13779 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13780 processed early before laying out sections during garbage collection.
13781 * gold.h (queue_middle_gc_tasks): New function.
13782 (is_prefix_of): Move from "layout.cc".
13783 * i386.cc (Target_i386::gc_process_relocs): New function.
13784 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13785 * main.cc (main): Create object of class "Garbage_collection".
13786 * object.cc (Relobj::copy_symbols_data): New function.
13787 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13788 (Sized_relobj::do_layout): Allow this function to be called twice
13789 during garbage collection and defer layout of section during the
6d03d481
ST
13790 first call.
13791 * object.h (Relobj::get_symbols_data): New function.
13792 (Relobj::is_section_name_included): New function.
13793 (Relobj::copy_symbols_data): New function.
13794 (Relobj::set_symbols_data): New function.
13795 (Relobj::get_relocs_data): New function.
13796 (Relobj::set_relocs_data): New function.
13797 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13798 (Relobj::gc_process_relocs): New function.
13799 (Relobj::do_gc_process_relocs): New pure virtual function.
13800 (Relobj::sd_): New data member.
13801 (Sized_relobj::is_output_section_offset_invalid): New function.
13802 (Sized_relobj::do_gc_process_relocs): New function.
13803 * options.h (General_options::gc_sections): Modify to not be a no-op.
13804 (General_options::print_gc_sections): New option.
13805 * plugin.cc (Plugin_finish::run): Remove function call to
13806 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13807 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13808 * reloc.cc (Read_relocs::run): Add task to process relocs and
13809 determine unreferenced sections when doing garbage collection.
13810 (Gc_process_relocs): New class.
13811 (Sized_relobj::do_gc_process_relocs): New function.
13812 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13813 sections that are garbage collected.
13814 * reloc.h (Gc_process_relocs): New class.
13815 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13816 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13817 symbols whose corresponding sections are garbage collected.
13818 (Symbol_table::Symbol_table): Add new parameter for the garbage
13819 collection object.
13820 (Symbol_table::gc_mark_undef_symbols): New function.
13821 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13822 (Symbol_table::gc_mark_dyn_syms): New function.
13823 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13824 as garbage.
13825 (Symbol_table::add_from_object): Likewise.
13826 (Symbol_table::add_from_relobj): When building shared objects, do not
13827 treat externally visible symbols as garbage.
13828 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13829 table information for static and relocatable links.
13830 * symtab.h (Symbol_table::set_gc): New function.
13831 (Symbol_table::gc): New function.
13832 (Symbol_table::gc_mark_undef_symbols): New function.
13833 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13834 (Symbol_table::gc_mark_dyn_syms): New function.
13835 (Symbol_table::gc_): New data member.
e1df38aa 13836 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13837 function.
13838 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13839 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13840
3b293544
CF
138412009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13842
13843 * options.h (General_options::gc_sections): Define as a no-op for now.
13844 (General_options::no_keep_memory): Ditto.
13845 (General_options::Bshareable): Define.
13846 * options.cc (General_options::finalize): Honor -Bshareable.
13847
83d22aa8
AS
138482009-01-20 Andreas Schwab <schwab@suse.de>
13849
13850 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13851 read the value in the contents, since we don't use it. Use the
13852 template endianness when writing.
13853 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13854
cd536b21
AS
138552009-01-19 Andreas Schwab <schwab@suse.de>
13856
13857 * configure.tgt (powerpc64-*): Fix targ_obj.
13858
99e9a495
ILT
138592009-01-15 Ian Lance Taylor <iant@google.com>
13860
13861 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13862 local symbols when stripping all symbols.
13863
bbbfea06
CC
138642009-01-14 Cary Coutant <ccoutant@google.com>
13865
99e9a495 13866 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13867
0f7c0701
CC
138682009-01-14 Cary Coutant <ccoutant@google.com>
13869
13870 * archive.cc (Archive::get_elf_object_for_member): Remove call
13871 to File_read::claim_for_plugin.
13872 * descriptors.cc (Descriptors::open): Remove reference to
13873 is_claimed.
13874 (Descriptors::claim_for_plugin): Remove.
13875 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13876 (Descriptors::is_claimed): Remove.
13877 (claim_descriptor_for_plugin): Remove.
13878 * fileread.cc (File_read::claim_for_plugin): Remove.
13879 * fileread.h (File_read::claim_for_plugin): Remove.
13880 (File_read::descriptor): Reopen descriptor if necessary.
13881 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13882 (Plugin_manager::all_symbols_read): Add task parameter. Change
13883 all callers.
13884 (Plugin_manager::get_input_file): New function.
13885 (Plugin_manager::release_input_file): New function.
13886 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13887 corresponding data member.
13888 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13889 and pass to base constructor. Change all callers.
13890 (get_input_file, release_input_file): New functions.
13891 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13892 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13893 (Plugin_manager::all_symbols_read): Add task parameter.
13894 (Plugin_manager::get_input_file): New function.
13895 (Plugin_manager::release_input_file): New function.
13896 (Plugin_manager::task_): New data member.
13897 (Pluginobj::Pluginobj): Add filesize parameter.
13898 (Pluginobj::filename): New function.
13899 (Pluginobj::descriptor): New function.
13900 (Pluginobj::filesize): New function.
13901 (Pluginobj::filesize_): New data member.
13902 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13903 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13904 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13905
13906 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13907 with archive libraries.
13908 * testsuite/Makefile.in: Regenerate.
13909 * testsuite/plugin_test.c (struct sym_info): New type.
13910 (get_input_file, release_input_file): New static variables.
13911 (onload): Capture new transfer vector entries.
13912 (claim_file_hook): Stop reading at end of file according to filesize.
13913 Factor out parsing of readelf output into separate function.
13914 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13915 APIs and get the source file name from the symbol table. Convert
13916 source file name to corresponding object file name. Print info
13917 message when adding new input files.
13918 (parse_readelf_line): New function.
13919 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13920 * testsuite/plugin_test_2.sh: Likewise.
13921 * testsuite/plugin_test_3.sh: Likewise.
13922 * testsuite/plugin_test_4.sh: New test case.
13923
62a6d109
ILT
139242009-01-07 Ian Lance Taylor <iant@google.com>
13925
13926 * version.cc (version_string): Bump to 1.8.
13927
483620e8
CC
139282008-12-23 Cary Coutant <ccoutant@google.com>
13929
13930 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13931 * plugin.cc (Plugin_manager::finish): Rename as
13932 layout_deferred_objects. Move cleanup to separate function.
13933 (Plugin_manager::cleanup): New function.
13934 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13935 separately.
13936 * plugin.h (Plugin_manager::finish): Rename as
13937 layout_deferred_objects.
13938 (Plugin_manager::cleanup): New function.
13939 (Plugin_manager::cleanup_done): New field.
13940
d66a9eb3
CC
139412008-12-23 Cary Coutant <ccoutant@google.com>
13942
13943 * plugin.cc (is_visible_from_outside): New function.
13944 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13945 so we don't return "IR only" status for exported symbols or -r links.
13946
13947 * testsuite/Makefile.am (plugin_test_3): New test case.
13948 * testsuite/Makefile.in: Regenerate.
13949 * testsuite/plugin_test_3.sh: New file.
13950
5995b570
CC
139512008-12-22 Cary Coutant <ccoutant@google.com>
13952
13953 * object.cc (Sized_relobj::layout_section): New function.
13954 (Sized_relobj::do_layout): Defer layout of input sections until after
13955 plugin has provided replacement files.
13956 (Sized_relobj::do_layout_deferred_sections): New function.
13957 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13958 (Relobj::layout_deferred_sections): New function.
13959 (Relobj::do_layout_deferred_sections): New function.
13960 (Sized_relobj::do_layout_deferred_sections): New function.
13961 (Sized_relobj::layout_section): New function.
13962 (Sized_relobj::Deferred_layout): New structure.
13963 (Sized_relobj::deferred_layout_): New field.
13964 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13965 Change all callers. Layout deferred sections.
13966 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13967 references.
13968 (Plugin_hook::run): Move code from do_plugin_hook inline.
13969 (Plugin_hook::do_plugin_hook): Remove.
13970 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13971 (Plugin_manager::finish): Renamed, was cleanup.
13972 (Plugin_manager::should_defer_layout): New function.
13973 (Plugin_manager::add_deferred_layout_object): New function.
13974 (Plugin_manager::Deferred_layout_list): New type.
13975 (Plugin_manager::deferred_layout_objects_): New field.
13976 (Plugin_hook::do_plugin_hook): Remove.
13977
ee769c88
ILT
139782008-12-17 Ian Lance Taylor <iant@google.com>
13979
13980 * options.h (class General_options): Add --no case for
13981 --export-dynamic.
13982
abc8dcba
CC
139832008-12-16 Cary Coutant <ccoutant@google.com>
13984
13985 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13986 vector.
13987 (Plugin_manager::claim_file): Create plugin object even if
13988 plugin did not call the add_symbols callback.
13989 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13990 asking for more symbols than were added.
13991 * testsuite/Makefile.am (plugin_test_1): Add test case with
13992 no global symbols.
13993 (empty.syms): New target.
13994 * testsuite/Makefile.in: Regenerate.
13995 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13996 message. Don't call add_symbols if no globals.
13997 (all_symbols_read_hook): Don't provide replacement for empty
13998 claimed file.
13999
b0074644
ILT
140002008-12-12 Ian Lance Taylor <iant@google.com>
14001
68943102
ILT
14002 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14003 r_type == 0 for a local symbol with r_sym == 0.
14004 (scan_relocatable_relocs): Pass r_sym to
14005 local_non_section_strategy.
14006 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14007 r_sym parameter.
14008
b0074644
ILT
14009 * configure.ac: Update test for TLS descriptors: they are
14010 supported as of glibc 2.9.
14011 * configure: Rebuild.
14012
c2508178
ILT
140132008-12-11 Ian Lance Taylor <iant@google.com>
14014
14015 PR 7091
14016 * target-reloc.h (Default_scan_relocatable_relocs): For each
14017 function, map r_type == 0 to RELOC_DISCARD.
14018
2756a258
CC
140192008-12-10 Cary Coutant <ccoutant@google.com>
14020
14021 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14022 object to override a kept COMDAT group from a plugin object.
14023
bb6f53d3
ILT
140242008-12-09 Ian Lance Taylor <iant@google.com>
14025
fbc558e1
ILT
14026 PR 7088
14027 * yyscript.y (file_cmd): Handle INPUT.
14028
bb6f53d3
ILT
14029 * testsuite/initpri1.c: Change all declarations to be full
14030 prototypes by adding void, to avoid compiler warnings.
14031
4674ecfc
CC
140322008-12-05 Rafael Avila de Espindola <espindola@google.com>
14033
14034 * options.cc (General_options::parse_plugin_opt): New.
14035 (General_options::add_plugin): The argument now is just the filename.
14036 (General_options::add_plugin_option): New.
14037 * options.h (plugin_opt): New.
14038 (add_plugin): Change argument name.
14039 (add_plugin_option): New.
14040 * plugin.cc (Plugin::load): Don't parse the plugin option.
14041 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14042 (Plugin::add_option): New.
14043 (Plugin::args_): Change type.
14044 (Plugin::filename_): New.
14045 (Plugin_manager::add_plugin_option): New.
14046 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14047 * testsuite/Makefile.in: Regenerate.
14048
fd06b4aa
CC
140492008-12-05 Cary Coutant <ccoutant@google.com>
14050
14051 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14052 Handle --strip-lto-sections option.
14053 * options.h (strip_lto_sections): New option.
14054
6c52134c
CC
140552008-12-01 Cary Coutant <ccoutant@google.com>
14056
14057 * plugin.cc (ld_plugin_message): Change format parameter to const.
14058 Fix mismatch between new[] and delete.
14059
a45248e0
CC
140602008-11-14 Cary Coutant <ccoutant@google.com>
14061
14062 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14063 instead of -1U.
14064
c82fbeee
CS
140652008-11-05 Craig Silverstein <csilvers@google.com>
14066
14067 * options.cc (General_options::parse_dynamic_list): New function.
14068 * options.h (General_options): New flags dynamic_list,
14069 dynamic_list_data, dynamic_list_cpp_new, and
14070 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14071 (General_options::in_dynamic_list): New function.
14072 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14073 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14074 (Lex::can_continue_name): Likewise.
14075 (yylex): Likewise.
14076 (read_script_file): New parameter script_options.
14077 (read_dynamic_list): New function.
14078 (Script_options::define_dynamic_list): New function.
14079 (dynamic_list_keyword_parsecodes): New variable.
14080 (dynamic_list_keywords): New variable.
14081 * script.h (Script_options::define_dynamic_list): New function
14082 prototype.
14083 (read_dynamic_list): New function prototype.
14084 * symtab.cc (strprefix): New macro.
14085 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14086 dynamic_list_data, dynamic_list_cpp_new, and
14087 dynamic_list_cpp_typeinfo.
14088 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14089 (dynamic_list_expr): New rule.
14090 (dynamic_list_nodes): Likewise.
14091 (dynamic_list_node): Likewise.
14092 * testsuite/Makefile.am (dynamic_list): New test.
14093 * testsuite/Makefile.in: Regenerated.
14094 * testsuite/dynamic_list.t: New file.
14095 * testsuite/dynamic_list.sh: New file.
14096
e0bb29a5
CS
140972008-11-05 Craig Silverstein <csilvers@google.com>
14098
14099 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14100 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14101 (t11_last): Likewise.
14102 * testsuite/ver_test_6.c (main): Likewise.
14103
4e1e25e0
CC
141042008-10-07 Cary Coutant <ccoutant@google.com>
14105
14106 * options.c (General_options::finalize): Add check for -static and
14107 -shared.
14108 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14109 is not empty.
14110
92f03fcb
CC
141112008-10-02 Cary Coutant <ccoutant@google.com>
14112
14113 * plugin.cc (make_sized_plugin_object): Fix conditional
14114 compilation to work when not all targets are enabled.
14115
fbd8a257
CC
141162008-09-29 Cary Coutant <ccoutant@google.com>
14117
14118 * archive.cc (Archive::get_file_and_offset): Use filename instead
14119 of name to get library path.
14120 (Archive::include_member): Unlock external member of a thin archive.
14121
14122 * testsuite/Makefile.am (TEST_AR): New variable.
14123 (thin_archive_test_1): New test.
14124 (thin_archive_test_2): New test.
81636b3f
CC
14125 * testsuite/Makefile.in: Regenerate.
14126 * testsuite/thin_archive_main.cc: New file.
14127 * testsuite/thin_archive_test_1.cc: New file.
14128 * testsuite/thin_archive_test_2.cc: New file.
14129 * testsuite/thin_archive_test_3.cc: New file.
14130 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14131
eff45813
CC
141322008-09-29 Cary Coutant <ccoutant@google.com>
14133
14134 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14135 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14136 instead of -1U.
14137 (Sized_relobj::do_finalize_local_symbols): Likewise.
14138 (Sized_relobj::map_to_kept_section): Likewise.
14139 * object.h (Sized_relobj::invalid_address): New constant.
14140 (Sized_relobj::do_output_section_offset): Check for invalid_address
14141 and return -1ULL.
14142 * output.cc (Output_reloc::local_section_offset): Use constant
14143 invalid_address instead of -1U.
14144 (Output_reloc::get_address): Likewise.
14145 (Output_section::output_address): Change -1U to -1ULL.
14146 * output.h (Output_reloc::invalid_address): New constant.
14147 * reloc.cc (Sized_relobj::write_sections): Use constant
14148 invalid_address instead of -1U.
14149 (Sized_relobj::relocate_sections): Likewise.
14150 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14151 values for merge sections.
14152 * target-reloc.h (relocate_for_relocatable): Use constant
14153 invalid_address instead of -1U.
14154
89fc3421
CC
141552008-09-19 Cary Coutant <ccoutant@google.com>
14156
14157 Add plugin functionality for link-time optimization (LTO).
14158 * configure.ac (plugins): Add --enable-plugins option.
14159 * configure: Regenerate.
14160 * config.in: Regenerate.
14161 * Makefile.am (LIBDL): New variable.
14162 (CCFILES): Add plugin.cc.
14163 (HFILES): Add plugin.h.
14164 (ldadd_var): Add LIBDL.
14165 * Makefile.in: Regenerate.
14166
14167 * archive.cc: Include "plugin.h".
14168 (Archive::setup): Don't preread archive symbols when using a plugin.
14169 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14170 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14171 files.
14172 (Archive::include_member): Add symbols from plugin objects.
14173 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14174 * descriptors.cc (Descriptors::open): Check for file descriptors
14175 abandoned by plugins.
14176 (Descriptors::claim_for_plugin): New function.
14177 * descriptors.h (Descriptors::claim_for_plugin): New function.
14178 (Open_descriptor::is_claimed): New field.
14179 (claim_descriptor_for_plugin): New function.
14180 * fileread.cc (File_read::claim_for_plugin): New function.
14181 * fileread.h (File_read::claim_for_plugin): New function.
14182 (File_read::descriptor): New function.
14183 * gold.cc: Include "plugin.h".
14184 (queue_initial_tasks): Add task to call plugin hooks for generating
14185 new object files.
14186 * main.cc: Include "plugin.h".
14187 (main): Load plugin libraries.
14188 * object.h (Pluginobj): Declare.
14189 (Object::pluginobj): New function.
14190 (Object::do_pluginobj): New function.
14191 (Object::set_target): New function.
14192 * options.cc: Include "plugin.h".
14193 (General_options::parse_plugin): New function.
14194 (General_options::General_options): Initialize plugins_ field.
14195 (General_options::add_plugin): New function.
14196 * options.h (Plugin_manager): Declare.
14197 (General_options): Add --plugin option.
14198 (General_options::has_plugins): New function.
14199 (General_options::plugins): New function.
14200 (General_options::add_plugin): New function.
14201 (General_options::plugins_): New field.
14202 * plugin.cc: New file.
14203 * plugin.h: New file.
14204 * readsyms.cc: Include "plugin.h".
14205 (Read_symbols::do_read_symbols): Check for archive before checking
14206 for ELF file. Call plugin hooks to claim files.
14207 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14208 from a real object file; force override when processing replacement
14209 files.
14210 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14211 (Symbol::init_base_object): Likewise.
14212 (Symbol::init_base_output_data): Likewise.
14213 (Symbol::init_base_output_segment): Likewise.
14214 (Symbol::init_base_constant): Likewise.
14215 (Symbol::init_base_undefined): Likewise.
14216 (Symbol::output_section): Assert that object is not a plugin.
14217 (Symbol_table::add_from_pluginobj): New function.
14218 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14219 undefined.
14220 (Symbol_table::sized_write_globals): Likewise.
14221 (Symbol_table::add_from_pluginobj): Instantiate template.
14222 * symtab.h (Sized_pluginobj): Declare.
14223 (Symbol::in_real_elf): New function.
14224 (Symbol::set_in_real_elf): New function.
14225 (Symbol::in_real_elf_): New field.
14226 (Symbol_table::add_from_pluginobj): New function.
14227
14228 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14229 (LIBDL): New variable.
14230 (LDADD): Add LIBDL.
14231 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14232 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14233 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14234 (MOSTLYCLEANFILES): Likewise.
14235 * testsuite/Makefile.in: Regenerate.
14236 * testsuite/plugin_test.c: New file.
14237 * testsuite/plugin_test_1.sh: New file.
14238 * testsuite/plugin_test_2.sh: New file.
14239
de31bda5
ILT
142402008-09-16 Ian Lance Taylor <iant@google.com>
14241
9c2d0ef9
ILT
14242 * target-reloc.h (relocate_section): Check whether a symbol is
14243 defined by the ABI before reporting an undefined symbol error.
14244 * target.h (Target::is_defined_by_abi): Make parameter const.
14245 (Target::do_is_defined_by_abi): Likewise.
14246 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14247 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14248 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14249 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14250 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14251 * testsuite/Makefile.in: Rebuild.
14252
de31bda5
ILT
14253 * fileread.cc (make_view): Add casts to avoid warning.
14254
9fa33bee
AO
142552008-09-16 Alexandre Oliva <aoliva@redhat.com>
14256
14257 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14258 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14259
183fd0e3
AO
142602008-09-16 Alexandre Oliva <aoliva@redhat.com>
14261
14262 * options.h (General_options::output_is_executable): New.
14263 (General_options::output_is_pie): New.
14264 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14265 for shared libraries.
14266 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14267
7be8330a
CD
142682008-09-11 Chris Demetriou <cgd@google.com>
14269
14270 * options.h (origin): New -z option.
14271 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14272 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14273 in DT_FLAGS_1.
14274
a9caad02
CC
142752008-09-05 Cary Coutant <ccoutant@google.com>
14276
14277 * fileread.cc (File_read::make_view): Add check for attempt to map
14278 beyond end of file.
14279
ae6dce4d
CC
142802008-09-05 Cary Coutant <ccoutant@google.com>
14281
14282 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14283 explicit instantiations.
14284
d7ab2a47
KVH
142852008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14286
14287 PR gold/6858
14288 * options.cc (General_options::finalize): Allow undefined symbols
14289 in shlibs if linking -shared.
14290
14291 PR gold/6859
14292 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14293 symbols as not needing a dynsym entry.
14294
1e52a9c1
CS
142952008-08-20 Craig Silverstein <csilvers@google.com>
14296
14297 * fileread.cc (File_read::open): Do not lock the file unless it
14298 was successfully opened.
14299
d85c80a3
CC
143002008-08-14 Cary Coutant <ccoutant@google.com>
14301
14302 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14303 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14304 * testsuite/tls_test.cc (struct int128): 128-bit struct
14305 for testing TLS relocs with non-zero addend.
14306 (v12): New TLS variable.
14307 (t12): New test.
14308 (t_last): Add check for v12.
14309 * testsuite/tls_test.h (t12): New function.
14310 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14311
2d924fd9
ILT
143122008-08-13 Ian Lance Taylor <iant@google.com>
14313
14314 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14315 set tls_segment_ or relro_segment_.
14316 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14317 when appropriate.
14318 * output.h (Output_section::clear_is_relro): New function.
14319 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14320 sections specially even when output_data_ is empty.
14321 (Output_segment::maximum_alignment): When first section is relro,
14322 only force alignment for PT_LOAD segments.
14323 * script.cc (script_data_segment_align): New function.
14324 (script_data_segment_relro_end): New function.
14325 * script-c.h (script_data_segment_align): Declare.
14326 (script_data_segment_relro_end): Declare.
14327 * script-sections.h (class Script_sections): Declare
14328 data_segment_align and data_segment_relro_end. Add fields
14329 segment_align_index_ and saw_relro_end_.
14330 * script-sections.cc (class Sections_element): Add set_is_relro
14331 virtual function. Add new bool* parameter to place_orphan_here.
14332 Add get_output_section virtual function.
14333 (class Output_section_definition): Add set_is_relro. Add new
14334 bool* parameter to place_orphan_here. Add get_output_section.
14335 Add is_relro_ field.
14336 (Output_section_definition::Output_section_definition): Initialize
14337 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14338 and is_relro_ fields.
14339 (Output_section_definition::place_orphan_here): Add is_relro
14340 parameter.
14341 (Output_section_definition::set_section_addresses): Set relro for
14342 output section.
14343 (Output_section_definition::alternate_constraint): Likewise.
14344 (class Orphan_output_section): Add new bool* parameter to
14345 place_orphan_here. Add get_output_section.
14346 (Orphan_output_section::place_orphan_here): Add is_relro
14347 parameter.
14348 (Script_sections::Script_sections): Initialize
14349 data_segment_align_index_ and saw_relro_end_.
14350 (Script_sections::data_segment_align): New function.
14351 (Script_sections::data_segment_relro_end): New function.
14352 (Script_sections::place_orphan): Set or clear is_relro.
14353 (Script_sections::set_section_addresses): Force alignment of first
14354 TLS section.
14355 * yyscript.y (exp): Call script_data_segment_align and
14356 script_data_segment_relro_end.
14357 * testsuite/relro_script_test.t: New file.
14358 * testsuite/relro_test.cc (using_script): Declare.
14359 (t1, t2): Test using_script.
14360 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14361 (relro_script_test_SOURCES): Define.
14362 (relro_script_test_DEPENDENCIES): Define.
14363 (relro_script_test_LDFLAGS): Define.
14364 (relro_script_test_LDADD): Define.
14365 (relro_script_test.so): New target.
14366 * testsuite/Makefile.in: Rebuild.
14367
f827c9a9
CC
143682008-08-06 Cary Coutant <ccoutant@google.com>
14369
14370 * archive.cc (Archive::total_archives, Archive::total_members)
14371 (Archive::total_members_loaded): New variables.
14372 (Archive::setup): Add parameter. Add option to preread
14373 archive symbols.
14374 (Archive::read_armap): Add counter.
14375 (Archive::get_file_and_offset): New function.
14376 (Archive::get_elf_object_for_member): New function.
14377 (Archive::read_all_symbols): New function.
14378 (Archive::read_symbols): New function.
14379 (Archive::add_symbols): Add counters.
14380 (Archive::include_all_members): Use armap to find members if it's
14381 already built.
14382 (Archive::include_member): Skip reading symbols if already read.
14383 Factored code into Archive::get_file_and_offset and
14384 Archive::get_elf_object_for_member. Changed call to
14385 Mapfile::report_include_archive_member.
14386 (Archive::print_stats): New function.
14387 * archive.h: Declare Object and Read_symbols_data classes.
14388 (Archive::Archive): Add initializers for new members.
14389 (Archive::setup): Add parameter.
14390 (Archive::print_stats): New function.
14391 (Archive::total_archives, Archive::total_members)
14392 (Archive::total_members_loaded): New variables.
14393 (Archive::get_file_and_offset): New function.
14394 (Archive::get_elf_object_for_member): New function.
14395 (Archive::read_all_symbols): New function.
14396 (Archive::read_symbols): New function.
14397 (Archive::Archive_member): New class.
14398 (Archive::members_): New member.
14399 (Archive::num_members_): New member.
14400 * main.cc: Include archive.h.
14401 (main): Call Archive::print_stats.
14402 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14403 archive parameter; member_name is now the fully-decorated name.
14404 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14405 * options.h: (General_options): Add --preread-archive-symbols option.
14406 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14407 Archive::setup.
14408
de4c45bd
ILT
144092008-08-04 Ian Lance Taylor <iant@google.com>
14410
14411 * symtab.h (Symbol::use_plt_offset): New function.
14412 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14413 * powerpc.cc (Relocate::relocate): Likewise.
14414 * sparc.cc (Relocate::relocate): Likewise.
14415 * x86_64.cc (Relocate::relocate): Likewise.
14416 * testsuite/weak_plt.sh: New test.
14417 * testsuite/weak_plt_main.cc: New test.
14418 * testsuite/weak_plt_shared.cc: New test.
14419 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14420 (check_PROGRAMS): Add weak_plt.
14421 (check_DATA): Add weak_plt_shared.so.
14422 (weak_plt_main_pic.o, weak_plt): New targets.
14423 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14424 * testsuite/Makefile.in: Rebuild.
14425
14426 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14427 gcctestdir/ld.
14428 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14429 * testsuite/Makefile.in: Rebuild.
14430
323ee3f4
AM
144312008-08-04 Alan Modra <amodra@bigpond.net.au>
14432
14433 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14434 * Makefile.in: Regenerate.
14435 * po/POTFILES.in: Regenerate.
14436
7c07ecec
ILT
144372008-07-29 Ian Lance Taylor <iant@google.com>
14438
14439 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14440 symbols before other symbols.
14441 * testsuite/script_test_2.cc (test_addr): Declare.
14442 (test_addr_alias): Declare.
14443 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14444 values.
7c07ecec
ILT
14445 * testsuite/script_test_2.t: Define test_addr_alias and
14446 test_addr.
14447
5778530e
ILT
144482008-07-24 Ian Lance Taylor <iant@google.com>
14449
2a00e4fb
ILT
14450 PR 5990
14451 * descriptors.cc: New file.
14452 * descriptors.h: New file.
14453 * gold-threads.h (class Hold_optional_lock): New class.
14454 * fileread.cc: Include "descriptors.h".
14455 (File_read::~File_read): Release descriptor rather than closing
14456 it.
14457 (File_read::open) [file]: Call open_descriptor rather than open.
14458 Set is_descriptor_opened_.
14459 (File_read::open) [memory]: Assert that descriptor is not open.
14460 (File_read::reopen_descriptor): New function.
14461 (File_read::release): Release descriptor.
14462 (File_read::do_read): Make non-const. Reopen descriptor.
14463 (File_read::read): Make non-const.
14464 (File_read::make_view): Reopen descriptor.
14465 (File_read::do_readv): Likewise.
14466 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14467 Update declarations.
14468 * layout.cc: Include "descriptors.h".
14469 (Layout::create_build_id): Use open_descriptor rather than open.
14470 * output.cc: Include "descriptors.h".
14471 (Output_file::open): Use open_descriptor rather than open.
14472 * archive.cc (Archive::const_iterator): Change Archive to be
14473 non-const.
14474 (Archive::begin, Archive::end): Make non-const.
14475 (Archive::count_members): Likewise.
14476 * archive.h (class Archive): Update declarations.
14477 * object.h (Object::read): Make non-const.
14478 * Makefile.am (CCFILES): Add descriptors.cc.
14479 (HFILES): Add descriptors.h.
14480 * Makefile.in: Rebuild.
14481
801647d1
ILT
14482 PR 6716
14483 * gold.h: Always include <clocale>. Add Solaris workarounds
14484 following code in binutils/sysdep.h.
14485
5edd166e
ILT
14486 PR 6048
14487 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14488 this->eh_frame_hdr_ is NULL before using it.
14489
c89ad728
ILT
14490 * dynobj.cc (Versions::Versions): Update comment.
14491
aa86f06b
ILT
14492 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14493 the base version name.
14494
5778530e
ILT
14495 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14496 array size plus one.
14497 (Stringpool_template::set_string_offsets): Subtract one from key
14498 before using it as an array index.
14499 (Stringpool_template::get_offset_with_length): Likewise.
14500 (Stringpool_template::write_to_buffer): Likewise.
14501 * stringpool.h (Stringpool_template::get_offset_from_key):
14502 Likewise.
14503
057ead22
ILT
145042008-07-23 Ian Lance Taylor <iant@google.com>
14505
7f649c59
ILT
14506 PR 6658
14507 * object.h (Merged_symbol_value::value): Do our best to handle a
14508 negative addend.
14509
057ead22
ILT
14510 PR 6647
14511 * script.cc (Version_script_info::get_versions): Don't add empty
14512 version tag to return value.
14513 (Version_script_info::get_symbol_version_helper): Change return
14514 type to bool. Add pversion parameter. Change all callers.
14515 (script_register_vers_node): Don't require a non-NULL tag.
14516 * script.h (class Version_script_info): Update declarations.
14517 (Version_script_info::get_symbol_version): Change return type to
14518 bool. Add version parameter. Change all callers.
14519 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14520 handling. Handle an empty version from a version script.
14521 (Symbol_table::define_special_symbol): Likewise.
14522 * testsuite/ver_test_10.script: New file.
14523 * testsuite/ver_test_10.sh: New file.
14524 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14525 (check_DATA): Add ver_test_10.syms.
14526 (ver_test_10.syms, ver_test_10.so): New target.
14527 * testsuite/Makefile.in: Rebuild.
14528
58e54ac2
CD
145292008-07-23 Simon Baldwin <simonb@google.com>
14530
14531 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14532 to zero for undefined symbols from dynamic libraries.
14533
95d14cd3
ILT
145342008-07-23 Ian Lance Taylor <iant@google.com>
14535
14536 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14537 Change all callers.
14538 * symtab.h (class Symbol_table): Update declaration.
14539 * testsuite/ver_test_9.cc: New file.
14540 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14541 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14542 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14543 (ver_test_9.so, ver_test_9.o): New targets.
14544 * testsuite/Makefile.in: Rebuild.
14545
92de84a6
ILT
145462008-07-22 Ian Lance Taylor <iant@google.com>
14547
34810851
ILT
14548 * options.h (class General_options): Define --check-sections.
14549 * layout.cc (Layout::set_segment_offsets): Handle
14550 --check-sections.
14551
af6156ef
ILT
14552 * options.h (class General_options): Define -n/--nmagic and
14553 -N/--omagic.
14554 * options.cc (General_options::finalize): For -n/--nmagic or
14555 -N/--omagic, set -static.
14556 * layout.cc (Layout::attach_allocated_section_to_segment): If
14557 -N/--omagic, don't put read-only and read-write sections in
14558 different segments.
14559 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14560 finding a read-only segment.
14561 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14562 don't set the minimum segment alignment to the common page size,
14563 and don't set the file offset to the address modulo the page size.
14564 * script-sections.cc (Script_sections::create_segments): If
14565 -n/--omagic, don't put read-only and read-write sections in
14566 different segments.
14567
92de84a6
ILT
14568 * cref.cc: New file.
14569 * cref.h: New file.
14570 * options.h (class General_options): Add --print-symbol-counts.
14571 * main.cc (main): Issue defined symbol report if requested.
14572 * archive.cc (Archive::interpret_header): Make into a const member
14573 function.
14574 (Archive::add_symbols): Call Input_objects::archive_start and
14575 archive_stop.
14576 (Archive::const_iterator): Define new class.
14577 (Archive::begin, Archive::end): New functions.
14578 (Archive::include_all_members): Rewrite to use iterator.
14579 (Archive::count_members): New function.
14580 * archive.h (class Archive): Update declarations.
14581 (Archive::filename): New function.
14582 * object.cc: Include "cref.h".
14583 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14584 (Sized_relobj::do_get_global_symbol_counts): New function.
14585 (Input_objects::add_object): Add object to cross-referencer.
14586 (Input_objects::archive_start): New function.
14587 (Input_objects::archive_stop): New function.
14588 (Input_objects::print_symbol_counts): New function.
14589 * object.h: Declare Cref and Archive.
14590 (Object::get_global_symbol_counts): New function.
14591 (Object::do_get_global_symbol_counts): New pure virtual function.
14592 (class Sized_relobj): Add defined_count_ field. Update
14593 declarations.
14594 (class Input_objects): Add cref_ field. Update constructor.
14595 Update declarations.
14596 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14597 defined_count_.
14598 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14599 symbol counts.
14600 (Sized_dynobj::do_get_global_symbol_counts): New function.
14601 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14602 defined_count_. Update declarations. Define Symbols typedef.
14603 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14604 parameter. Change all callers.
14605 (Symbol_table::add_from_dynobj): Add sympointers and defined
14606 parameters. Change all callers.
14607 * symtab.h (class Symbol_table): Update declarations.
14608 * Makefile.am (CCFILES): Add cref.cc.
14609 (HFILES): Add cref.h.
14610 * Makefile.in: Rebuild.
14611
3f7c5e1d
CD
146122008-07-22 Simon Baldwin <simonb@google.com>
14613
14614 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14615 to zero when writing undefined symbols.
14616
e0b64032
ILT
146172008-07-22 Ian Lance Taylor <iant@google.com>
14618
14619 * output.cc (Output_section::add_input_section): Don't try to
14620 merge empty merge sections.
14621
096b02cf
CS
146222008-07-21 Craig Silverstein <csilvers@google.com>
14623
14624 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14625 Include symbol version in error message.
cd536b21 14626
1d1f116d
CD
146272008-07-20 Chris Demetriou <cgd@google.com>
14628
cd536b21 14629 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14630 (RANDOM_SEED_CFLAGS): New substituted variable.
14631 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14632 * configure: Rebuild.
14633 * Makefile.in: Likewise.
14634 * testsuite/Makefile.in: Likewise.
14635
a18f591e
ILT
146362008-07-18 Ian Lance Taylor <iant@google.com>
14637
14638 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14639 where we see NAME/NULL and NAME/VERSION as separate symbols.
14640 * testsuite/ver_test_main.cc (main): Call t4.
14641 (t4, t4_2a): Define.
14642 * testsuite/ver_test_2.cc (t4_2): Define.
14643 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14644 * testsuite/ver_test_4.cc (t4_2a): Define.
14645 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14646 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14647
c6e3f6ed
ILT
146482008-07-17 Ian Lance Taylor <iant@google.com>
14649
14650 * dynobj.cc (Versions::add_def): If we give an error about a
14651 missing version, go ahead and create the version anyhow.
14652
ef9beddf
ILT
146532008-07-10 Ian Lance Taylor <iant@google.com>
14654
14655 Handle output sections with more than 0x7fffffff bytes.
14656 * object.h (class Relobj): Change map_to_output_ to
14657 output_sections_, and just keep a section pointer. Change all
14658 uses. Move comdat group support to Sized_relobj.
14659 (Relobj::is_section_specially_mapped): Remove.
14660 (Relobj::output_section): Remove poff parameter. Change all
14661 callers.
14662 (Relobj::output_section_offset): New function.
14663 (Relobj::set_section_offset): Rewrite.
14664 (Relobj::map_to_output): Remove.
14665 (Relobj::output_sections): New function.
14666 (Relobj::do_output_section_offset): New pure virtual function.
14667 (Relobj::do_set_section_offset): Likewise.
14668 (class Sized_relobj): Add section_offsets_ field. Add comdat
14669 group support from Relobj. Update declarations.
14670 (Sized_relobj::get_output_section_offset): New function.
14671 (Sized_relobj::do_output_section_offset): New function.
14672 (Sized_relobj::do_set_section_offset): New function.
14673 * object.cc (Relobj::output_section_address): Remove.
14674 (Sized_relobj::Sized_relobj): Initialize new fields.
14675 (Sized_relobj::include_section_group): Cast find_kept_object to
14676 Sized_relobj.
14677 (Sized_relobj::include_linkonce_section): Likewise.
14678 (Sized_relobj::do_layout): Use separate arrays for output section
14679 and output offset.
14680 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14681 output_sections.
14682 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14683 output_sections and section_offsets.
14684 (Sized_relobj::write_local_symbols): Likewise.
14685 (map_to_kept_section): Compute output address directly.
14686 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14687 output_sections and section_offsets.
14688 (Sized_relobj::write_sections): Likewise.
14689 (Sized_relobj::relocate_sections): Likewise.
14690 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14691 * output.h (class Output_reloc): Update declarations. Change
14692 u2_.relobj to Sized_relobj*.
14693 (class Output_data_reloc): Change add functions to use
14694 Sized_relobj*.
14695 * output.cc (Output_reloc::Output_reloc): Change relobj to
14696 Sized_relobj*.
14697 (Output_reloc::local_section_offset): Change return type to
14698 Elf_Addr. Use get_output_section_offset.
14699 (Output_reloc::get_address): Likewise.
14700 (Output_section::is_input_address_mapped): Don't call
14701 is_section_specially_mapped.
14702 (Output_section::output_offset): Likewise.
14703 (Output_section::output_address): Likewise.
14704 (Output_section::starting_output_address): Likewise.
14705 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14706 parameter to Sized_relobj*.
14707 (Copy_relocs::need_copy_reloc): Likewise.
14708 (Copy_relocs::save): Likewise.
14709 * copy-relocs.h (class Copy_relocs): Update declarations.
14710 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14711 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14712 * target-reloc.h (relocate_for_relocatable): Change
14713 offset_in_output_section type to Elf_Addr. Change code that uses
14714 it as well.
14715 * layout.cc (Layout::layout): Always set *off.
14716 * mapfile.cc (Mapfile::print_input_section): Use
14717 output_section_offset.
14718 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14719 Sized_relobj*.
14720 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14721 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14722 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14723
5cb66f97
ILT
147242008-07-03 Ian Lance Taylor <iant@google.com>
14725
14726 * layout.cc (Layout::include_section): Do not discard unrecognized
14727 SHT_STRTAB sections.
14728
afe47622
CS
147292008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14730
14731 * script.cc (Lex::can_continue_name): Make '?' allowable in
14732 version-script names.
14733 * testsuite/version_script.map: Change glob pattern to use '?'
14734
5adf9721
ILT
147352008-06-30 Manish Singh <yosh@gimp.org>
14736
14737 PR 6585
14738 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14739 Correct typo.
14740
e6fde208
ILT
147412008-06-30 Ian Lance Taylor <iant@google.com>
14742
14743 PR 6660
14744 PR 6682
14745 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14746 versions]: Don't try to read the value in the contents, since we
14747 don't use it. Use the template endianness when writing.
14748
3f2e6a2d
CC
147492008-06-25 Cary Coutant <ccoutant@google.com>
14750
14751 * fileread.cc (File_read::make_view): Assert on zero-length view.
14752 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14753 symbol table when there are no symbols to read.
14754
c43d3a48
CS
147552008-06-23 Craig Silverstein <csilvers@google.com>
14756
14757 * version.cc (version_string): Bump to 1.7
14758
5f494ea0
CS
147592008-06-18 Craig Silverstein <csilvers@google.com>
14760
14761 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14762 constant 0xFFFF to type Valtype.
14763 (Powerpc_relocate_functions::rel16_ha): Likewise.
14764
c42e122e
ILT
147652008-06-17 Ian Lance Taylor <iant@google.com>
14766
f34787f8
ILT
14767 * output.h (Output_section::Input_section): Initialize p2align_ to
14768 zero for Output_section_data constructors.
14769 (Output_section::Input_section::addralign): If not an input
14770 section, return the alignment of the Output_section_data.
14771 * testsuite/copy_test.cc: New file.
14772 * testsuite/copy_test_1.cc: New file.
14773 * testsuite/copy_test_2.cc: New file.
14774 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14775 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14776 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14777 (copy_test_1_pic.o, copy_test_1.so): New targets.
14778 (copy_test_2_pic.o, copy_test_2.so): New targets.
14779 * testsuite/Makefile.in: Rebuild.
14780
c42e122e
ILT
14781 * script-sections.cc (Script_sections::place_orphan): Initialize
14782 local variable exact.
14783
ce3ac18a
DE
147842008-06-13 David Edelsohn <edelsohn@gnu.org>
14785
14786 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14787
42cacb20
DE
147882008-06-12 David Edelsohn <edelsohn@gnu.org>
14789 David S. Miller <davem@davemloft.net>
14790
14791 * powerpc.cc: New file.
14792 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14793 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14794 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14795 * Makefile.in: Rebuild.
14796
7b308235
ILT
147972008-06-09 Ian Lance Taylor <iant@google.com>
14798
14799 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14800 <exception>.
14801 (throwing, orig_terminate): New static variables.
14802 (terminate_handler): New static function.
14803 (t2): Set terminate handler.
14804
f0b886e3
ILT
148052008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14806
14807 PR 6584
cd536b21 14808 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14809 alignment.
14810
3e90f135
CC
148112008-05-30 Cary Coutant <ccoutant@google.com>
14812
14813 * archive.cc (Archive::include_all_members) Correct to step
14814 over symbol table and extended name table in thin archives.
14815
e09ad04a
ILT
148162008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14817
14818 PR 6407
14819 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14820 calculation.
14821
62b01cb5
ILT
148222008-05-28 Caleb Howe <cshowe@google.com>
14823
14824 * reduced_debug_output.cc: New file.
14825 * reduced_debug_output.h: New file.
92de84a6 14826 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14827 * options.cc (General_options::finalize): Add strip_debug_non_line
14828 to the strip heirarchy.
14829 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14830 fields.
14831 * layout.cc: Include "reduced_debug_output.h".
14832 (Layout::Layout): Initialize new fields.
14833 (line_only_debug_sections): New static array.
14834 (is_lines_only_debug_sections): New static inline function.
14835 (Layout::include_section): Handle --strip-debug-non-line.
14836 (Layout::make_output_section): If --strip-debug-non-line, build
14837 new output sections for .debug_abbrev and .debug_info.
14838 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14839 gold. Warn about possible overflow.
14840 (read_signed_LEB_128): Likewise.
14841 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14842 (read_signed_LEB_128): Declare.
14843 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14844 (HFILES): Add reduced_debug_output.h.
14845 * Makefile.in: Rebuild.
14846
7d9e3d98
ILT
148472008-05-21 Ian Lance Taylor <iant@google.com>
14848
14849 * mapfile.cc: New file.
14850 * mapfile.h: New file.
14851 * options.h (class General_options): Add -M/--print-map and -Map.
14852 * options.cc (General_options::finalize): Make -M equivalent to
14853 -Map -.
14854 * main.cc: Include <cstdio> and "mapfile.h".
14855 (main): Open mapfile if requested.
14856 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14857 constructor. Change caller.
14858 (queue_initial_tasks): Add mapfile parameter. Change caller.
14859 (queue_middle_tasks): Likewise.
14860 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14861 declarations.
14862 * archive.cc: Include "mapfile.h".
14863 (Archive::add_symbols): Add mapfile parameter. Change all
14864 callers. Pass mapfile, symbol, and reason to include_member.
14865 (Archive::include_all_members): Add mapfile parameter. Change all
14866 callers.
14867 (Archive::include_member): Add mapfile, sym, and why parameters.
14868 Change all callers. Report inclusion to map file.
14869 * archive.h: Include "fileread.h".
14870 (class Archive): Update declarations.
14871 (Archive::file): New const method.
14872 (class Add_archive_symbols): Add mapfile_ field. Update
14873 constructor. Change all callers.
14874 * readsyms.h (class Read_symbols): Likewise.
14875 (class Finish_group): Likewise.
14876 (class Read_script): Likewise.
14877 * common.cc: Include "mapfile.h".
14878 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14879 all callers.
14880 (Symbol_table::do_allocate_commons): Likewise.
14881 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14882 symbol allocation to mapfile.
14883 * common.h (class Allocate_commons_task): Add mapfile_ field.
14884 Update constructor. Change all callers.
14885 * symtab.h (class Symbol_table): Update declarations.
14886 * layout.cc: Include "mapfile.h".
14887 (Layout_task_runner::run): Print information to mapfile.
14888 (Layout::create_gold_note): Change Output_data_fixed_space to
14889 Output_data_zero_fill.
14890 (Layout::create_build_id): Likewise.
14891 (Layout::print_to_mapfile): New function.
14892 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14893 constructor. Change caller.
14894 (class Layout): Declare print_to_mapfile.
14895 * output.cc (Output_section::Input_section::print_to_mapfile): New
14896 function.
14897 (Output_section::add_input_section): If producing a map, always
14898 add to input_sections_ list.
14899 (Output_section::do_print_to_mapfile): New function.
14900 (Output_segment::print_sections_to_mapfile): New function.
14901 (Output_segment::print_section_list_to_mapfile): New function.
14902 * output.h: Include "mapfile.h".
14903 (Output_data::print_to_mapfile): New function.
14904 (Output_data::do_print_to_mapfile): New virtual function.
14905 (Output_segment_headers::do_print_to_mapfile): New function.
14906 (Output_file_header::do_print_to_mapfile): New function.
14907 (Output_data_const::do_print_to_mapfile): New function.
14908 (class Output_data_const_buffer): Add map_name_ field. Update
14909 constructor. Change all callers. Add do_print_to_mapfile
14910 function.
14911 (class Output_data_fixed_space): Likewise.
14912 (class Output_data_space): Likewise.
14913 (class Output_data_zero_fill): New class.
14914 (Output_data_strtab::do_print_to_mapfile): New function.
14915 (Output_data_reloc_base::do_print_to_mapfile): New function.
14916 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14917 (Output_data_group::do_print_to_mapfile): New function.
14918 (Output_data_got::do_print_to_mapfile): New function.
14919 (Output_data_dynamic::do_print_to_mapfile): New function.
14920 (Output_symtab_xindex::do_print_to_mapfile): New function.
14921 (class Output_section): Declare do_print_to_mapflie. Declare
14922 print_to_mapfile in Input_section.
14923 (class Output_segment): Declare new functions.
14924 * object.h (Sized_relobj::symbol_count): New function.
14925 * script-sections.cc
14926 (Output_section_element_dot_assignment::set_section_addresses):
14927 Change Output_data_fixed_space to Output_data_zero_fill.
14928 (Output_data_expression::do_print_to_mapfile): New function.
14929 * script.cc (read_input_script): Add mapfile parameter. Change
14930 all callers.
14931 * script.h (read_input_script): Update declaration.
14932 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14933 (Eh_frame::do_print_to_mapfile): New function.
14934 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14935 (Output_merge_string::do_print_to_mapfile): New function.
14936 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14937 function.
14938 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14939 function.
14940 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14941 function.
14942 * Makefile.am (CCFILES): Add mapfile.cc.
14943 (HFILES): Add mapfile.h.
14944 * Makefile.in: Rebuild.
14945
9f1d377b
ILT
149462008-05-19 Ian Lance Taylor <iant@google.com>
14947
14948 * options.h (class General_options): Add -z relro.
14949 * layout.cc (Layout::Layout): Initialize relro_segment_.
14950 (Layout::add_output_section_data): Return the output section.
14951 (Layout::make_output_section): Rcognize relro sections and mark
14952 them appropriately.
14953 (Layout::attach_allocated_section_to_segment): Put relro sections
14954 in a PT_GNU_RELRO segment.
14955 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14956 section as relro.
14957 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14958 PT_TLS segments.
14959 (Layout::linkonce_mapping): Map d.rel.ro.local to
14960 .data.rel.ro.local.
14961 (Layout::output_section_name): Us .data.rel.ro.local for any
14962 section which begins with that.
14963 * layout.h (class Layout): Update add_output_section_data
14964 declaration. Add relro_segment_ field.
14965 * output.cc (Output_section::Output_section): Initialize is_relro_
14966 and is_relro_local_ fields.
14967 (Output_segment::add_output_section): Group relro sections.
14968 (Output_segment::is_first_section_relro): New function.
14969 (Output_segment::maximum_alignment): If there is a relro section,
14970 align the segment to the common page size.
14971 (Output_segment::set_section_addresses): Track whether we are
14972 looking at relro sections. If the last section is a relro
14973 section, align to the common page size.
14974 (Output_segment::set_section_list_addresses): Add in_relro
14975 parameter. Change all callers. Align to the page size when
14976 moving from relro to non-relro section.
14977 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14978 segment.
14979 * output.h (class Output_section): Add is_relro_ and
14980 is_relro_local_ fields.
14981 (Output_section::is_relro): New function.
14982 (Output_section::set_is_relro): New function.
14983 (Output_section::is_relro_local): New function.
14984 (Output_section::set_is_relro_local): New function.
14985 (class Output_segment): Update declarations.
14986 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14987 * sparc.cc (Target_sparc::got_section): Likewise.
14988 * x86_64.cc (Target_x86_64::got_section): Likewise.
14989 * testsuite/relro_test_main.cc: New file.
14990 * testsuite/relro_test.cc: New file.
14991 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14992 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14993 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14994 (relro_test.so, relro_test_pic.o): New targets.
14995 * testsuite/Makefile.in: Rebuild.
14996
a984ee1d
ILT
149972008-05-16 Ian Lance Taylor <iant@google.com>
14998
01676dcd
ILT
14999 * output.cc (Output_segment::add_output_section): Remove front
15000 parameter.
15001 * output.h (class Output_segment): Remove
15002 add_initial_output_section and overloaded add_output_section.
15003 Update declaration of remaining add_output_section.
15004 * layout.cc (Layout::create_interp): Call add_output_section
15005 rather than add_initial_output_section.
15006 (Layout::finish_dynamic_section): Likewise.
15007
497897f9
ILT
15008 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15009 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15010 know the dynamic type.
15011 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15012 field. Initialize it in constructor.
15013 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15014 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15015 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15016 reloc.
15017
a984ee1d
ILT
15018 * output.cc (Output_reloc::get_address): Change return type to
15019 Elf_Addr.
15020 * output.h (class Output_reloc): Update get_address declaration.
15021 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15022 for section addresses.
15023
55ba0940
ILT
150242008-05-09 Ian Lance Taylor <iant@google.com>
15025
15026 PR 6493
15027 * gold.cc (gold_nomem): Use return value of write.
15028
75517b77
ILT
150292008-05-08 Ian Lance Taylor <iant@google.com>
15030
15031 * symtab.c (Symbol::init_base_output_data): Add version
15032 parameter. Change all callers.
15033 (Symbol::init_base_output_segment): Likewise.
15034 (Symbol::init_base_constant): Likewise.
15035 (Symbol::init_base_undefined): Likewise.
15036 (Sized_symbol::init_output_data): Likewise.
15037 (Sized_symbol::init_output_segment): Likewise.
15038 (Sized_symbol::init_constant): Likewise.
15039 (Sized_symbol::init_undefined): Likewise.
15040 (Symbol_table::do_define_in_output_data): If the new symbol has a
15041 version, mark it as the default.
15042 (Symbol_table::do_define_in_output_segment): Likewise.
15043 (Symbol_table::do_define_as_constant): Likewise.
15044 * symtab.h (class Symbol): Update declarations.
15045 (class Sized_symbol): Likewise.
15046 * resolve.cc (Symbol::override_version): New function.
c42e122e 15047 (Symbol::override_base): Call override_version.
75517b77
ILT
15048 (Symbol::override_base_with_special): Likewise.
15049 * testsuite/ver_script_8.script: New file.
15050 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15051 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15052 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15053 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15054
f1f70eae
ILT
150552008-05-06 Ian Lance Taylor <iant@google.com>
15056
f3e9c5c5
ILT
15057 PR 6049
15058 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15059 functions.
15060 (class General_options): Remove existing --undefined, and add
15061 --no-undefined instead. Add new --undefined as synonym for -u.
15062 * archive.cc (Archive::add_symbols): Check whether symbol was
15063 named with -u.
15064 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15065 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15066 all uses. Add IS_UNDEFINED. Update declarations to split
15067 different versions of init_base. Declare init_base_undefined.
15068 (Symbol::is_defined): Handle IS_UNDEFINED.
15069 (Symbol::is_undefined): Likewise.
15070 (Symbol::is_weak_undefined): Call is_undefined.
15071 (Symbol::is_absolute): Handle IS_CONSTANT.
15072 (class Sized_symbol): Update declarations to split different
15073 versions of init. Declare init_undefined.
15074 (class Symbol_table): Declare new functions.
15075 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15076 Change all callers.
15077 (Symbol::init_base_output_data): Likewise.
15078 (Symbol::init_base_output_segment): Likewise.
15079 (Symbol::init_base_constant): Likewise.
15080 (Symbol::init_base_undefined): New function.
15081 (Sized_symbol::init_object): Rename from init. Change all
15082 callers.
15083 (Sized_symbol::init_output_data): Likewise.
15084 (Sized_symbol::init_output_segment): Likewise.
15085 (Sized_symbol::init_constant): Likewise.
15086 (Sized_symbol::init_undefined): New function.
15087 (Symbol_table::add_undefined_symbols_from_command_line): New
15088 function.
15089 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15090 function.
15091 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15092 (Symbol::output_section): Likewise.
15093 (Symbol::set_output_section): Likewise.
15094 (Symbol_table::sized_finalize_symbol): Likewise.
15095 (Symbol_table::sized_write_globals): Likewise.
15096 * resolve.cc (Symbol_table::should_override): Likewise.
15097 (Symbol::override_base_with_special): Likewise.
15098
8bdcdf2c
ILT
15099 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15100 symbol, change it to have default visibility.
15101 * testsuite/protected_1.cc: New file.
15102 * testsuite/protected_2.cc: New file.
15103 * testsuite/protected_3.cc: New file.
15104 * testsuite/protected_main_1.cc: New file.
15105 * testsuite/protected_main_2.cc: New file.
15106 * testsuite/protected_main_3.cc: New file.
15107 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15108 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15109 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15110 (protected_1.so): New target.
15111 (protected_1_pic.o, protected_2_pic.o): New targets.
15112 (protected_3_pic.o): New target.
15113 (check_PROGRAMS): Add protected_2.
15114 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15115 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15116 * testsuite/Makefile.in: Rebuild.
15117
2b706932
ILT
15118 * options.h (DEFINE_var): Add set_user_set_##varname__.
15119 (DEFINE_bool_alias): New macro.
15120 (class General_options): Define -Bstatic using DEFINE_bool_alias
15121 rather than DEFINE_special. Add --undefined as an alias for -z
15122 defs.
15123 * options.cc (General_options::parse_Bstatic): Remove.
15124
d82a5bcc
ILT
15125 * options.h (class General_options): Add --fatal-warnings.
15126 * main.cc (main): Implement --fatal-warnings.
15127 * errors.h (Errors::warning_count): New function.
15128
f1f70eae
ILT
15129 * options.h (class General_options): Add -Bsymbolic-functions.
15130 * symtab.h (Symbol::is_preemptible): Check for
15131 -Bsymbolic-functions.
15132
8825ac63
ILT
151332008-05-05 Ian Lance Taylor <iant@google.com>
15134
d98bc257
ILT
15135 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15136 as noVARNAME rather than no-VARNAME.
15137 (class General_options): Add option -z combreloc.
15138 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15139 get_address.
15140 (Output_reloc::sort_before) [SHT_REL]: New function.
15141 (Output_reloc::sort_before) [SHT_RELA]: New function.
15142 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15143 Sort_relocs_comparison.
15144 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15145 parameter. Change all callers.
15146 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15147 sort_relocs parameter. Change all callers.
15148 * output.cc (Output_reloc::get_address): New function, broken out
15149 of write_rel.
15150 (Output_reloc::write_rel): Call it.
15151 (Output_reloc::compare): New function.
15152 (Output_data_reloc_base::do_write): Optionally sort relocs.
15153
60b2b4e7
ILT
15154 * configure.ac: If targ_extra_obj is set, link it in.
15155 * configure.tgt: Initialize all variables.
15156 (x86_64*): Set targ_extra_obj and targ_extra_size.
15157 * configure: Rebuild.
15158
8825ac63
ILT
15159 * object.cc (Sized_relobj::include_section_group): Adjust section
15160 indexes read from group data. Build vector to pass to
15161 layout_group.
15162 * layout.cc (Layout::layout_group): Add flags and shndxes
15163 parameters. Remove contents parameter. Change caller. Update
15164 explicit instantiations.
15165 * layout.h (class Layout): Update layout_group declaration.
15166 * output.cc (Output_data_group::Output_data_group): Add flags and
15167 input_shndxes parameters. Remove contents parameter. Change
15168 caller.
15169 (Output_data_group::do_write): Change input_sections_ to
15170 input_shndxes_.
15171 * output.h (class Output_data_group): Update constructor
15172 declaration. Rename input_sections_ to input_shndxes_.
15173 * testsuite/many_sections_test.cc: Add template.
15174
e94cf127
CC
151752008-04-30 Cary Coutant <ccoutant@google.com>
15176
4418b2d5
CC
15177 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15178
e94cf127
CC
15179 * layout.cc (Layout::include_section): Refactored check for debug
15180 info section.
15181 (Layout::add_comdat): Add new parameters. Change type
15182 of signature parameter. Add object and shndx to signatures table.
15183 (Layout::find_kept_object): New function.
15184 * layout.h: Include <cstring>.
15185 (Layout::is_debug_info_section): New function.
15186 (Layout::add_comdat): Add new parameters.
15187 (Layout::find_kept_object): New function.
15188 (Layout::Kept_section): New struct.
15189 (Layout::Signatures): Change type of map range.
15190 * object.cc (Relobj::output_section_address): New function.
15191 (Sized_relobj::include_section_group): Add new parameters. Change
15192 calls to Layout::add_comdat. Change to build table of kept comdat
15193 groups and table mapping discarded sections to kept sections.
15194 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15195 (Sized_relobj::do_layout): Change calls to include_section_group and
15196 include_linkonce_section.
15197 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15198 value to zero when section is discarded.
15199 (Sized_relobj::map_to_kept_section): New function.
15200 * object.h (Relobj::output_section_address): New function.
15201 (Relobj::Comdat_group): New type.
15202 (Relobj::find_comdat_group): New function.
15203 (Relobj::Comdat_group_table): New type.
15204 (Relobj::Kept_comdat_section): New type.
15205 (Relobj::Kept_comdat_section_table): New type.
15206 (Relobj::add_comdat_group): New function.
15207 (Relobj::set_kept_comdat_section): New function.
15208 (Relobj::get_kept_comdat_section): New function.
15209 (Relobj::comdat_groups_): New field.
15210 (Relobj::kept_comdat_sections_): New field.
15211 (Symbol_value::input_value): Update comment.
15212 (Sized_relobj::map_to_kept_section) New function.
15213 (Sized_relobj::include_linkonce_section): Add new parameter.
15214 * target-reloc.h (Comdat_behavior): New type.
15215 (get_comdat_behavior): New function.
15216 (relocate_section): Add code to map a discarded section to the
15217 corresponding kept section when applying a relocation.
15218
e4e5049b
CS
152192008-04-30 Craig Silverstein <csilvers@google.com>
15220
15221 * dwarf_reader.cc (next_generation_count): New static var.
15222 (Addr2line_cache_entry): New struct.
15223 (addr2line_cache): New static var.
15224 (Dwarf_line_info::one_addr2line): Added caching.
15225 (Dwarf_line_info::clear_addr2line_cache): New function.
15226 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15227 cache-size parameter.
15228 (Dwarf_line_info::one_addr2line_cache): New function.
15229 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15230 new cache-size argument to one_addr2line(), and clear cache.
15231
d09e9154
CC
152322008-04-28 Cary Coutant <ccoutant@google.com>
15233
15234 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15235 R_386_PC8 relocations.
15236
7ef73768
ILT
152372008-04-23 Ian Lance Taylor <iant@google.com>
15238
55438702
ILT
15239 * object.cc (Sized_relobj::include_section_group): Check for
15240 invalid section group.
15241
c165fb93
ILT
15242 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15243 header size.
15244
7ef73768
ILT
15245 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15246 than read for file header.
15247 * archive.cc (Archive::include_member): Likewise.
15248
6194aaab
L
152492008-04-23 Paolo Bonzini <bonzini@gnu.org>
15250
15251 * aclocal.m4: Regenerate.
15252 * configure: Regenerate.
15253
d491d34e
ILT
152542008-04-19 Ian Lance Taylor <iant@google.com>
15255
5ea2bac6
ILT
15256 * version.cc (version_string): Bump to 1.6.
15257
7bc3e21a
ILT
15258 * testsuite/Makefile.am (many_sections_r_test): New target.
15259 (many_sections_r_test_SOURCES): Remove.
15260 (many_sections_r_test_DEPENDENCIES): Remove.
15261 (many_sections_r_test_LDFLAGS): Remove.
15262 (many_sections_r_test_LDADD): Remove.
15263
7fcd3aa9
ILT
15264 * object.cc (Sized_relobj::do_add_symbols): Always pass
15265 local_symbol_count_ to add_from_relobj.
15266
4c94d6ae
ILT
15267 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15268 every thousand variables.
15269 * testsuite/Makefile.in: Rebuild.
15270
d491d34e
ILT
15271 * object.cc (Xindex::initialize_symtab_xindex): New function.
15272 (Xindex::read_symtab_xindex): New function.
15273 (Xindex::sym_xindex_to_shndx): New function.
15274 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15275 available.
15276 (Sized_relobj::do_initialize_xindex): New function.
15277 (Sized_relobj::do_read_symbols): Adjust section links.
15278 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15279 parameter. Change all callers.
15280 (Sized_relobj::include_section_group): Adjust section links and
15281 symbol section indexes.
15282 (Sized_relobj::do_layout): Adjust section links.
15283 (Sized_relobj::do_count_local_symbols): Adjust section links and
15284 symbol section indexes.
15285 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15286 ordinary and special symbols.
15287 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15288 dynsym_xindex parameters. Change all callers. Adjust section
15289 links. Use SHN_XINDEX when needed.
15290 (Sized_relobj::get_symbol_location_info): Adjust section links.
15291 Don't get fooled by special symbols.
15292 * object.h (class Xindex): Define.
15293 (class Object): Add xindex_ parameter. Declare virtual functoin
15294 do_initialize_xindex.
15295 (Object::adjust_sym_shndx): New function.
15296 (Object::set_xindex): New protected function.
15297 (class Symbol_value): Add is_ordinary_shndx_ field.
15298 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15299 (Symbol_value::value): Assert ordinary section.
15300 (Symbol_value::initialize_input_to_output_map): Likewise.
15301 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15302 Change all callers.
15303 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15304 all callers.
15305 (class Sized_relobj): Update declarations.
15306 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15307 parameter. Change all callers.
15308 (Sized_relobj::adjust_shndx): New function.
15309 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15310 field.
15311 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15312 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15313 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15314 (Sized_dynobj::read_dynsym_section): Adjust section links.
15315 (Sized_dynobj::read_dynamic): Likewise.
15316 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15317 section links.
15318 (Sized_dynobj::do_initialize_xindex): New function.
15319 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15320 do_initialize_xindex.
15321 (Sized_dynobj::adjust_shndx): New function.
15322 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15323 dynsym_xindex_ fields.
15324 (Layout::finalize): Add a call to set_section_indexes before
15325 creating the symtab sections.
15326 (Layout::set_section_indexes): Don't do anything if the section
15327 already has a section index.
15328 (Layout::create_symtab_sections): Add shnum parameter. Change
15329 caller. Create .symtab_shndx section if needed.
15330 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15331 caller.
15332 (Layout::allocated_output_section_count): New function.
15333 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15334 needed.
15335 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15336 fields. Update declarations.
15337 (Layout::symtab_xindex): New function.
15338 (Layout::dynsym_xindex): New function.
15339 (class Write_symbols_task): Add layout_ field.
15340 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15341 Change caller.
15342 * output.cc (Output_section_headers::Output_section_headers): Add
15343 shstrtab_section parameter. Change all callers.
15344 (Output_section_headers::do_sized_write): Store overflow values
15345 for section count and section string table section index in
15346 section header zero.
15347 (Output_file_header::do_sized_write): Check for overflow of
15348 section count and section string table section index.
15349 (Output_symtab_xindex::do_write): New function.
15350 (Output_symtab_xindex::endian_do_write): New function.
15351 * output.h (class Output_section_headers): Add shstrtab_section_.
15352 Update declarations.
15353 (class Output_symtab_xindex): Define.
15354 (Output_section::has_out_shndx): New function.
15355 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15356 field.
15357 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15358 Change all callers.
15359 (Sized_symbol::init): Likewise.
15360 (Symbol::output_section): Check for ordinary symbol.
15361 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15362 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15363 callers.
15364 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15365 Change all callers. Simplify handling of symbols from sections
15366 not included in the link.
15367 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15368 distinction.
15369 (Weak_alias_sorter::operator()): Assert that symbols are
15370 ordinary.
15371 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15372 distinction.
15373 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15374 parameters. Change all callers.
15375 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15376 symbol distinction. Use SHN_XINDEX when needed.
15377 (Symbol_table::write_section_symbol): Add symtab_xindex
15378 parameter. Change all callers.
15379 (Symbol_table::sized_write_section_symbol): Likewise. Use
15380 SHN_XINDEX when needed.
15381 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15382 declarations.
15383 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15384 (Symbol::is_defined): Check is_ordinary.
15385 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15386 (Symbol::is_absolute, Symbol::is_common): Likewise.
15387 (class Sized_symbol): Update declarations.
15388 (class Symbol_table): Update declarations.
15389 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15390 parameters. Change all callers.
15391 (Sized_symbol::override): Likewise.
15392 (Symbol_table::override): Likewise.
15393 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15394 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15395 is_ordinary, and orig_st_shndx parameters. Change all callers.
15396 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15397 to be in an ordinary section.
15398 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15399 object and is_ordinary parameters. Change all callers.
15400 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15401 Change all callers. Don't add undefined or non-ordinary symbols
15402 to reloc_map_.
15403 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15404 Change all callers.
15405 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15406 declarations.
15407 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15408 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15409 (Sized_relobj::relocate_sections): Likewise.
15410 * target-reloc.h (scan_relocs): Adjust section symbol index.
15411 (scan_relocatable_relocs): Likewise.
15412 * i386.cc (Scan::local): Check for ordinary symbols.
15413 * sparc.cc (Scan::local): Likewise.
15414 * x86_64.cc (Scan::local): Likewise.
15415 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15416 to symbol_section_and_value.
15417 * testsuite/many_sections_test.cc: New file.
15418 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15419 (check_PROGRAMS): Add many_sections_test.
15420 (many_sections_test_SOURCES): Define.
15421 (many_sections_test_DEPENDENCIES): Define.
15422 (many_sections_test_LDFLAGS): Define.
15423 (BUILT_SOURCES): Add many_sections_define.h.
15424 (many_sections_define.h): New target.
15425 (BUILT_SOURCES): Add many_sections_check.h.
15426 (many_sections_check.h): New target.
15427 (check_PROGRAMS): Add many_sections_r_test.
15428 (many_sections_r_test_SOURCES): Define.
15429 (many_sections_r_test_DEPENDENCIES): Define.
15430 (many_sections_r_test_LDFLAGS): Define.
15431 (many_sections_r_test_LDADD): Define.
15432 (many_sections_r_test.o): New target.
15433 * testsuite/Makefile.in: Rebuild.
15434
c5818ff1
CC
154352008-04-17 Cary Coutant <ccoutant@google.com>
15436
15437 * errors.cc (Errors::info): New function.
15438 (gold_info): New function.
15439 * errors.h (Errors::info): New function.
15440 * gold.h (gold_info): New function.
15441 * object.cc (Input_objects::add_object): Print trace output.
15442 * options.cc (options::parse_set): New function.
15443 (General_options::parse_wrap): Deleted.
15444 (General_options::General_options): Deleted initializer.
15445 * options.h (options::String_set): New typedef.
15446 (options::parse_set): New function.
15447 (DEFINE_set): New macro.
15448 (General_options::wrap): Changed to use DEFINE_set. Changed
15449 callers of any_wrap_symbols and is_wrap_symbol.
15450 (General_options::trace, General_options::trace_symbol):
15451 New options.
15452 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15453 (General_options::wrap_symbols_): Deleted.
15454 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15455
b5be4a7c
DM
154562008-04-17 David S. Miller <davem@davemloft.net>
15457
15458 * options.cc (General_options::parse_V): New function.
15459 * options.h: Add entries for -V and -Qy.
15460
155a0dd7
ILT
154612008-04-17 Ian Lance Taylor <iant@google.com>
15462
15463 * common.cc (Symbol_table::allocate_commons): Remove options
15464 parameter. Change caller.
15465 (Symbol_table::do_allocate_commons): Remove options parameter.
15466 Change caller. Just call do_allocate_commons_list twice.
15467 (Symbol_table::do_allocate_commons_list): New function, broken out
15468 of do_allocate_commons.
15469 * common.h (class Allocate_commons_task): Remove options_ field.
15470 Update constructor.
15471 * symtab.cc (Symbol_table::Symbol_table): Initialize
15472 tls_commons_.
15473 (Symbol_table::add_from_object): Put TLS common symbols on
15474 tls_commons_ list.
15475 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15476 which are IN_OUTPUT_DATA.
15477 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15478 allocate_commons and do_allocate_commons declarations. Declare
15479 do_allocate_commons_list.
15480 * gold.cc (queue_middle_tasks): Update creation of
15481 Allocate_commons_task to not pass options.
15482 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15483 (TLS_TEST_C_FLAGS): New variable.
15484 (tls_test_c_pic.o): New target.
15485 (tls_test_shared.so): Link in tls_test_c_pic.o.
15486 (tls_test_c_pic_ie.o): New target.
15487 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15488 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15489 (tls_test_c.o): New target.
15490 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15491 (tls_pic_test_LDADD): Likewise.
15492 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15493 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15494 (tls_test_c_gnu2.o): New target.
15495 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15496 tls_test_c_gnu2.o.
15497 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15498 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15499 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15500 * testsuite/tls_test.cc: Include "config.h".
15501 (t_last): Call t11_last.
15502 * testsuite/tls_test.h (t11, t11_last): Declare.
15503 * testsuite/tls_test_c.c: New file.
15504 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15505 * configure.ac: Check for OpenMP support.
15506 * configure, config.in, Makefile.in: Rebuild.
15507 * testsuite/Makefile.in: Rebuild.
15508
edfbb029
CC
155092008-04-16 Cary Coutant <ccoutant@google.com>
15510
15511 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15512 (Target_i386::tls_base_symbol_defined_): New field.
15513 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15514 (Target_i386::Scan::global): Likewise.
15515 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15516 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15517 (Target_x86_64::tls_base_symbol_defined_): New field.
15518 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15519 (Target_x86_64::Scan::global): Likewise.
15520
f3c69fca
CC
155212008-04-16 Cary Coutant <ccoutant@google.com>
15522
15523 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15524 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15525 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15526 building shared libraries.
15527 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15528 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15529 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15530 * testsuite/Makefile.in: Rebuild.
15531 * testsuite/weak_undef.h: New file.
15532 * testsuite/weak_undef_file1.cc: Add extra test cases.
15533 * testsuite/weak_undef_file2.cc: Likewise.
15534 * testsuite/weak_undef_test.cc: Likewise.
15535
7c414435
DM
155362008-04-16 David S. Miller <davem@davemloft.net>
15537
32b769e1
DM
15538 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15539 Add issued_non_pic_error_ field. Declare check_non_pic.
15540 (Target_sparc::Scan::check_non_pic): New function.
15541 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15542 (Target_sparc::Scan::global): Likewise.
15543
11936fb1
DM
15544 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15545 * configure: Rebuild.
15546
7c414435
DM
15547 * options.h (DEFINE_enable): New macro.
15548 (new_dtags): New enable option.
15549 (initfirst, interpose, loadfltr, nodefaultlib,
15550 nodelete, nodlopen, nodump): New -z options.
15551 * layout.cc (Layout:finish_dynamic_section): If new
15552 dtags enabled, emit DT_RUNPATH. Also, emit a
15553 DT_FLAGS_1 containing any specified -z flags.
15554
85c7bf8b
ILT
155552008-04-16 Ian Lance Taylor <iant@google.com>
15556
12c0daef
ILT
15557 * copy-relocs.cc: New file.
15558 * copy-relocs.h: New file.
15559 * reloc.cc: Remove Copy_relocs code.
15560 * reloc.h: Likewise.
15561 * reloc-types.h (struct Reloc_types) [both versions]: Add
15562 get_reloc_addend_noerror.
15563 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15564 variants of add_global which take an addend which must be zero.
15565 * i386.cc: Include "copy-relocs.h".
15566 (class Target_i386): Change type of copy_relocs_ to variable,
15567 update initializer.
15568 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15569 Change all callers.
15570 (Target_i386::do_finalize_sections): Change handling of
15571 copy_relocs_.
15572 * sparc.cc: Include "copy-relocs.h".
15573 (class Target_sparc): Change type of copy_relocs_ to variable,
15574 update initializer.
15575 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15576 Change all callers.
15577 (Target_sparc::do_finalize_sections): Change handling of
15578 copy_relocs_.
15579 * x86_64.cc: Include "copy-relocs.h".
15580 (class Target_x86_64): Change type of copy_relocs_ to variable,
15581 update initializer.
15582 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15583 class. Change all callers.
15584 (Target_x86_64::do_finalize_sections): Change handling of
15585 copy_relocs_.
15586 * Makefile.am (CCFILES): Add copy-relocs.cc.
15587 (HFILES): Add copy-relocs.h.
15588
4f4995b6
ILT
15589 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15590
85c7bf8b
ILT
15591 * testsuite/script_test_4.sh: Permit leading zeroes.
15592
4f2a9edd
ILT
155932008-04-15 Ian Lance Taylor <iant@google.com>
15594
e6188289
ILT
15595 * script-sections.cc (Script_sections::create_segments): Use
15596 header_size_adjustment even when there is enough room for the
15597 headers.
15598 * testsuite/script_test_4.sh: New file.
15599 * testsuite/script_test_4.t: New file.
15600 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15601 (check_DATA): Add script_test_4.stdout.
15602 (MOSTLYCLEANFILES): Likewise.
15603 (script_test_4): New target.
15604 (script_test_4.stdout): New target.
15605 * testsuite/Makefile.in: Rebuild.
15606
4f2a9edd
ILT
15607 * sparc.cc: Add definitions for Output_data_plt_sparc class
15608 constants.
15609
f5314dd5
DM
156102008-04-14 David S. Miller <davem@davemloft.net>
15611
15612 * sparc.cc: New file.
15613 * Makefile.am (TARGETSOURCES): Add sparc.cc
15614 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15615 * configure.tgt: Document targ_extra_size and
15616 targ_extra_big_endian. Add entries for sparc-* and
15617 sparc64-*.
15618 * configure.ac: Handle targ_extra_size and
15619 targ_extra_big_endian.
15620 * Makefile.in: Rebuild.
15621 * configure: Likewise.
15622 * po/POTFILES.in: Likewise.
15623 * po/gold.pot: Likewise.
15624
154e0e9a
ILT
156252008-04-14 Ian Lance Taylor <iant@google.com>
15626
15627 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15628 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15629 in the name/type/flags to section mapping. Don't call
15630 allocate_output_section.
15631 (Layout::choose_output_section): Change parameter from adjust_name
15632 to is_input_section. Don't permit input sections after sections
15633 are attached to segments. Don't call allocate_output_section.
15634 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15635 not write_enable_output_section.
15636 (Layout::make_output_section): Don't push to
15637 unattached_section_list_ nor call attach_to_segment. Call
15638 attach_section_to_segment if sections are attached.
15639 (Layout::attach_sections_to_segments): New function.
15640 (Layout::attach_section_to_segment): New function.
15641 (Layout::attach_allocated_section_to_segment): Rename from
15642 attach_to_segment. Remove flags parameter.
15643 (Layout::allocate_output_section): Remove function.
15644 (Layout::write_enable_output_section): Remove function.
15645 * layout.h (class Layout): Update for above changes. Add new
15646 field sections_are_attached_.
15647 * output.h (Output_section::update_flags_for_input_section): New
15648 function.
15649 * output.cc (Output_section::add_input_section): Call
15650 update_flags_for_input_section.
15651 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15652
009a67a2
CC
156532008-04-11 Cary Coutant <ccoutant@google.com>
15654
15655 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15656 thought unnecessary.
15657 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15658
759b1a24
ILT
156592008-04-11 Ian Lance Taylor <iant@google.com>
15660
15661 * output.h (class Output_section_data): Remove inline definition
15662 of set_addralign.
15663 * output.cc (Output_section_data::set_addralign): New function.
15664
c2b45e22
CC
156652008-04-11 Cary Coutant <ccoutant@google.com>
15666
15667 Add support for TLS descriptors for i386 and x86_64.
15668 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15669 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15670 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15671 GOT_TYPE_TLS_DESC.
15672 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15673 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15674 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15675 relocations.
15676 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15677 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15678 Fix problem with initial-exec relocations.
15679 (Target_i386::Relocate::relocate_tls): Likewise.
15680 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15681 relaxation.
15682 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15683 support for section-plus-offset dynamic table entries.
15684 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15685 (Output_data_dynamic::Dynamic_entry): Add support for
15686 section-plus-offset dynamic table entries.
15687 (Output_data_dynamic::Classification): Likewise.
15688 (Output_data_dynamic::classification_): Renamed offset_.
15689 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15690 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15691 (Target_x86_64::make_plt_section): New function.
15692 (Target_x86_64::reserve_tlsdesc_entries): New function.
15693 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15694 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15695 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15696 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15697 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15698 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15699 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15700 add extra PLT entry for TLS descriptors.
15701 (Output_data_plt_x86_64::got_): New field.
15702 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15703 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15704 fields.
15705 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15706 descriptors.
15707 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15708 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15709 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15710 R_386_TLS_DESC_CALL relocations.
15711 (Target_x86_64::Scan::global): Likewise.
15712 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15713 for TLS descriptors.
15714 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15715 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15716 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15717 GD-to-IE relaxation.
15718 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15719 and TLS_DESCRIPTORS.
15720 * Makefile.in: Rebuild.
15721 * configure: Rebuild.
15722 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15723 (tls_test_shared2.so): New target.
15724 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15725 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15726 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15727 (tls_shared_gd_to_ie_test_LDADD): New variable.
15728 (tls_shared_gnu2_gd_to_ie_test): New target.
15729 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15730 New targets.
15731 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15732 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15733 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15734 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15735 (tls_shared_gnu2_test): New target.
15736 (tls_test_gnu2_shared.so): New target.
15737 (tls_shared_gnu2_test_SOURCES): New variable.
15738 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15739 (tls_shared_gnu2_test_LDFLAGS): New variable.
15740 (tls_shared_gnu2_test_LDADD): New variable.
15741 * testsuite/Makefile.in: Rebuild.
15742 * testsuite/Makefile.
15743
83bfb6b7
ILT
157442008-04-11 Ian Lance Taylor <iant@google.com>
15745
15746 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15747 justsyms.t.
15748 * testsuite/Makefile.in: Rebuild.
15749
15750 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15751 long.
15752 * testsuite/script_test_2.cc (main): Adjust test.
15753
706e1f5e
ILT
157542008-04-11 David S. Miller <davem@davemloft.net>
15755 Ian Lance Taylor <iant@google.com>
15756
15757 * options.h (General_options): Add entries for '-Y' and
15758 '-relax'.
15759 * options.cc (General_options:finalize): If -Y was used, add those
15760 entries to the library path instead of the default "/lib" and
15761 "/usr/lib".
15762
7c98e6bb
DM
157632008-04-11 David S. Miller <davem@davemloft.net>
15764
15765 * testsuite/justsyms.t: Start at 0x100.
15766 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15767 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15768 long.
15769 * testsuite/script_test_2.cc: Adjust string and section length
15770 checks.
7c98e6bb 15771
99a37bfd
ILT
157722008-04-09 Ian Lance Taylor <iant@google.com>
15773
2cefc357
ILT
15774 PR gold/5996
15775 * script-sections.cc (Sections_element::allocate_to_segment): Add
15776 orphan parameter.
15777 (Output_section_definition::allocate_to_segment): Likewise.
15778 (Orphan_output_section::allocate_to_segment): Likewise.
15779 (Script_sections::attach_sections_using_phdrs_clause): Don't
15780 propagate non-PT_LOAD segments to orphan sections.
15781 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15782 readelf rather than objdump.
15783 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15784 .interp section and PT_INTERP segment are the same size.
15785 * testsuite/Makefile.in: Rebuild.
15786
99a37bfd
ILT
15787 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15788 aliases for symbols defined in the same object.
15789 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15790 (weak_alias_test_SOURCES): New variable.
15791 (weak_alias_test_DEPENDENCIES): New variable.
15792 (weak_alias_test_LDFLAGS): New variable.
15793 (weak_alias_test_LDADD): New variable.
15794 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15795 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15796 (weak_alias_test_3.o): New target.
15797 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15798 * testsuite/weak_alias_test_main.cc: New file.
15799 * testsuite/weak_alias_test_1.cc: New file.
15800 * testsuite/weak_alias_test_2.cc: New file.
15801 * testsuite/weak_alias_test_3.cc: New file.
15802
780e49c5
ILT
158032008-04-08 Ian Lance Taylor <iant@google.com>
15804
cdb0b8f5
ILT
15805 * options.h (class General_options): Add --noinhibit-exec option.
15806 * main.cc (main): Check --noinhibit-exec.
15807
0864d551
ILT
15808 * options.h (class General_options): Define --wrap as a special
15809 option. Add wrap_symbols_ field.
15810 (General_options::any_wrap_symbols): New function.
15811 (General_options::is_wrap_symbol): New function.
15812 * options.cc (General_options::parse_wrap): New function.
15813 (General_options::General_options): Initialize wrap_symbols_.
15814 * symtab.cc (Symbol_table::wrap_symbol): New function.
15815 (Symbol_table::add_from_object): Handle --wrap.
15816 * symtab.h (class Symbol_table): Declare wrap_symbol.
15817 * target.h (Target::wrap_char): New function.
15818 (Target::Target_info): Add wrap_char field.
15819 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15820 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15821 * testsuite/testfile.cc (Target_test::test_target_info):
15822 Likewise.
15823
789aa6de
ILT
15824 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15825 there is one.
15826
2c38906f
ILT
15827 * layout.h (class Layout): Add added_eh_frame_data_ field.
15828 * layout.cc (Layout::Layout): Initialize new field.
15829 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15830 output section until we find a section we merged successfully.
15831 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15832 that the size be non-zero.
15833
780e49c5
ILT
15834 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15835 qualifier.
15836
7fcd0256
ILT
158372008-04-08 Craig Silverstein <csilvers@google.com>
15838
15839 * configure.ac: Export new conditional variable HAVE_ZLIB.
15840 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15841 on HAVE_ZLIB.
15842 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15843 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15844
6835af53
ILT
158452008-04-07 Ian Lance Taylor <iant@google.com>
15846
e24f324c
ILT
15847 * version.cc (version_string): Set to "1.5".
15848
a036edd8
ILT
15849 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15850 Add issued_non_pic_error_ field. Declare check_non_pic.
15851 (Target_x86_64::Scan::check_non_pic): New function.
15852 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15853 (Target_x86_64::Scan::global): Likewise.
15854
624f8810
ILT
15855 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15856 addend parameter. Change caller. Handle merge sections.
15857 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15858 Address to Addend. Don't add in the result of
15859 local_section_offset, pass down the addend and use the returned
15860 value.
15861 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15862 Update declarations of local_section_offset and symbol_value.
15863 * testsuite/two_file_test_1.cc (t18): New function.
15864 * testsuite/two_file_test_2.cc (f18): New function.
15865 * testsuite/two_file_test_main.cc (main): Call t18.
15866 * testsuite/two_file_test.h (t18, f18): Declare.
15867
6835af53
ILT
15868 * configure.ac: Don't test for objdump, c++filt, or readelf.
15869 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15870 conditionals.
15871 (TEST_READELF): New variable.
15872 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15873 (check_PROGRAMS): Add two_file_strip_test.
15874 (two_file_strip_test): New target.
15875 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15876 (two_file_same_shared_strip_test_SOURCES): New variable.
15877 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15878 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15879 (two_file_same_shared_strip_test_LDADD): New variable.
15880 (two_file_shared_strip.so): New target.
15881 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15882 (ver_test_5.syms, ver_test_7.syms): Likewise.
15883 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15884 (strip_test_3.stdout): Use TEST_OBJDUMP.
15885 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15886
86925eef
CC
158872008-04-04 Cary Coutant <ccoutant@google.com>
15888
15889 * symtab.h (Symbol::is_weak_undefined): New function.
15890 (Symbol::is_strong_undefined): New function.
15891 (Symbol::is_absolute): New function.
15892 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15893 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15894 absolute symbols.
15895 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15896 (weak_undef_test): New target.
15897 * testsuite/Makefile.in: Rebuild.
15898 * testsuite/weak_undef_file1.cc: New file.
15899 * testsuite/weak_undef_file2.cc: New file.
15900 * testsuite/weak_undef_test.cc: New file.
15901
126f3ece
ILT
159022008-04-03 Craig Silverstein <csilvers@google.com>
15903
15904 * compressed_output.h (class Output_compressed_section): Use
15905 unsigned buffer.
15906 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15907 add zlib header.
15908 (zlib_compressed_suffix): Removed.
15909 (Output_compressed_section::set_final_data_size): Use unsigned
15910 buffers.
15911 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15912 Fix linker invocation.
15913 (flagstest_o_specialfile_and_compress_debug_sections):
15914 Likewise.
15915 * testsuite/Makefile.in: Regenerated.
15916
deae2a14
DM
159172008-04-02 David S. Miller <davem@davemloft.net>
15918
15919 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15920 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15921
70752818
ILT
159222008-04-02 Craig Silverstein <csilvers@google.com>
15923
15924 * TODO: New file.
15925
39d0cb0e
ILT
159262008-04-02 Ian Lance Taylor <iant@google.com>
15927
15928 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15929 parameters. Update for new key type to views_. Change all
15930 callers.
15931 (File_read::read): Adjust for byteshift in returned view.
15932 (File_read::add_view): New function, broken out of
15933 find_and_make_view.
15934 (File_read::make_view): New function, broken out of
15935 find_and_make_view.
15936 (File_read::find_or_make_view): Add offset and aligned
15937 parameters. Rewrite accordingly. Change all callers.
15938 (File_read::get_view): Add offset and aligned parameters. Adjust
15939 for byteshift in return value.
15940 (File_read::get_lasting_view): Likewise.
15941 * fileread.h (class File_read): Update declarations.
15942 (class File_read::View): Add byteshift_ field. Add byteshift to
15943 constructor. Add byteshift method.
15944 * archive.h (Archive::clear_uncached_views): New function.
15945 (Archive::get_view): Add aligned parameter. Change all callers.
15946 * object.h (Object::get_view): Add aligned parameter. Change all
15947 callers.
15948 (Object::get_lasting_view): Likewise.
15949
15950 * fileread.cc (File_read::release): Don't call clear_views if
15951 there are multiple objects.
15952 * fileread.h (File_read::clear_uncached_views): New function.
15953 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15954 on the archive.
15955
a1207466
CC
159562008-03-31 Cary Coutant <ccoutant@google.com>
15957
15958 Add thin archive support.
15959 * archive.cc (Archive::armagt): New const.
15960 (Archive::setup): Remove task parameter and calls to unlock.
15961 (Archive::unlock_nested_archives): New function.
15962 (Archive::read_header): Add nested_off parameter. Change
15963 all callers.
15964 (Archive::interpret_header): Likewise.
15965 (Archive::include_all_members): Change to handle thin
15966 archives.
15967 (Archive::include_member): Likewise.
15968 * archive.h (Archive::Archive): Add new parameters and
15969 initializers.
15970 (Archive::armagt): New const.
15971 (Archive::setup): Remove task parameter.
15972 (Archive::unlock_nested_archives): New function.
15973 (Archive::read_header): Add nested_off parameter.
15974 (Archive::interpret_header): Likewise.
15975 (Archive::Nested_archive_table): New typedef.
15976 (Archive::is_thin_archive_): New field.
15977 (Archive::nested_archives_): New field.
15978 (Archive::options_): New field.
15979 (Archive::dirpath_): New field.
15980 (Archive::task_): New field.
15981 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15982 for thin archives. Pass additional parameters to
15983 Archive::Archive. Unlock the archive file after calling
15984 Archive::setup.
cd536b21 15985
479f6503
ILT
159862008-03-29 Ian Lance Taylor <iant@google.com>
15987
686c8caf
ILT
15988 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15989 version symbol to be local.
15990 * testsuite/ver_test_4.sh: New file.
15991 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15992 (check_DATA): Add ver_test_4.syms.
15993 (ver_test_4.syms): New target.
15994 * testsuite/Makefile.in: Rebuild.
15995
ab794b6b
ILT
15996 * output.cc
15997 (Output_section::Input_section_sort_entry::has_priority): New
15998 function.
15999 (Output_section::Input_section_sort_entry::match_file_name): New
16000 function.
16001 (Output_section::Input_section_sort_entry::match_section_name):
16002 Remove.
16003 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16004 Remove.
16005 (Output_section::Input_section_sort_entry::match_section_file):
16006 Remove.
16007 (Output_section::Input_section_sort_compare::operator()): Rewrite
16008 using new Input_section_sort_entry functions. Sort crtbegin and
16009 crtend first. Sort sections with no priority before sections with
16010 a priority.
16011 * testsuite/initpri1.c (d3): Check j != 4.
16012 (cd5): New constructor/destructor function.
16013 (main): Check j != 2.
16014
479f6503
ILT
16015 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16016 new symbol when resolving, don't call set_is_default.
16017 * testsuite/ver_test_7.cc: New file.
16018 * testsuite/ver_test_7.sh: New file.
16019 * testsuite/Makefile.am (ver_test_7.so): New target.
16020 (ver_test_7.o): New target.
16021 (check_SCRIPTS): Add ver_test_7.sh.
16022 (check_DATA): Add ver_test_7.syms.
16023 (ver_test_7.syms): New target.
16024
2fd32231
ILT
160252008-03-28 Ian Lance Taylor <iant@google.com>
16026
16027 * layout.cc (Layout::layout): If we see an input section with a
16028 name that needs sorting, set the must_sort flag for the output
16029 section.
16030 (Layout::make_output_section): If the name of the output section
16031 indicates that it might require sorting, set the may_sort flag.
16032 * output.h (Output_section::may_sort_attached_input_sections): New
16033 function.
16034 (Output_section::set_may_sort_attached_input_sections): New
16035 function.
16036 (Output_section::must_sort_attached_input_sections): New
16037 function.
16038 (Output_section::set_must_sort_attached_input_sections): New
16039 function.
16040 (class Output_section): Declare Input_section_sort_entry. Define
16041 Input_section_sort_compare. Declare
16042 sort_attached_input_sections. Add new fields:
16043 may_sort_attached_input_sections_,
16044 must_sort_attached_input_sections_,
16045 attached_input_sections_are_sorted_.
16046 * output.cc (Output_section::Output_section): Initialize new
16047 fields.
16048 (Output_section::add_input_section): Add an entry to
16049 input_sections_ if may_sort or must_sort are true.
16050 (Output_section::set_final_data_size): Call
16051 sort_attached_input_sections if necessary.
16052 (Output_section::Input_section_sort_entry): Define new class.
16053 (Output_section::Input_section_sort_compare::operator()): New
16054 function.
16055 (Output_section::sort_attached_input_sections): New function.
16056 * configure.ac: Check whether the compiler supports constructor
16057 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16058 * testsuite/initpri1.c: New file.
16059 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16060 CONSTRUCTOR_PRIORITY.
16061 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16062 (initpri1_LDFLAGS): New variable.
16063 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16064
18e6b24e
ILT
160652008-03-27 Ian Lance Taylor <iant@google.com>
16066
49bdd526
ILT
16067 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16068 * testsuite/common_test_1.c: New file.
16069 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16070 (common_test_1_SOURCES): New variable.
16071 (common_test_1_DEPENDENCIES): New variable.
16072 (common_test_1_LDFLAGS): New variable.
16073
18e6b24e
ILT
16074 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16075 and commons_ correctly when NAME/VERSION does not override
16076 NAME/NULL.
16077 * testsuite/ver_test_6.c: New file.
16078 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16079 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16080 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16081
04bf7072
ILT
160822008-03-26 Ian Lance Taylor <iant@google.com>
16083
5871526f
ILT
16084 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16085 of an undefined symbol from a version script.
16086 * testsuite/Makefile.am (ver_test_5.so): New target.
16087 (ver_test_5.o): New target.
16088 (check_SCRIPTS): Add ver_test_5.sh.
16089 (check_DATA): Add ver_test_5.syms.
16090 (ver_test_5.syms): New target.
16091 * testsuite/ver_test_5.cc: New file.
16092 * testsuite/ver_test_5.script: New file.
16093 * testsuite/ver_test_5.sh: New file.
16094 * Makefile.in, testsuite/Makefile.in: Rebuild.
16095
04bf7072
ILT
16096 PR gold/5986
16097 Fix problems building gold with gcc 4.3.0.
16098 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16099 (gold_error_at_location, gold_warning_at_location): Use it.
16100 * configure.ac: Check whether we can compile and use a template
16101 function with a printf attribute.
16102 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16103 when jumping over bytes.
16104 * object.cc: Instantiate Object::read_section_data.
16105 * debug.h: Include <cstring>
16106 * dwarf_reader.cc: Include <algorithm>
16107 * main.cc: Include <cstring>.
16108 * options.cc: Include <cstring>.
16109 * output.cc: Include <cstring>.
16110 * script.cc: Include <cstring>.
16111 * script.h: Include <string>.
16112 * symtab.cc: Include <cstring> and <algorithm>.
16113 * target-select.cc: Include <cstring>.
16114 * version.cc: Include <string>.
16115 * testsuite/testmain.cc: Include <cstdlib>.
16116 * configure, config.in: Rebuild.
16117
874c5b28
ILT
161182008-03-25 Ian Lance Taylor <iant@google.com>
16119
819d6c3a
ILT
16120 * options.cc: Include "../bfd/bfdver.h".
16121 (options::help): Print bug reporting address.
16122
f4b2c6f5
ILT
16123 * version.cc (print_version): Adjust output for current value of
16124 BFD_VERSION_STRING.
16125
16126 * NEWS: New file.
16127
e96caa79
ILT
16128 * options.cc (options::help): Print list of supported targets.
16129 * target-select.h: Include <vector>.
16130 (class Target_selector): Make machine_, size_, and is_big_endian_
16131 fields const. Add bfd_name_ and instantiated_target_ fields.
16132 (Target_selector::Target_selector): Add bfd_name parameter.
16133 (Target_selector::recognize): Make non-virtual, call
16134 do_recognize.
16135 (Target_selector::recognize_by_name): Make non-virtual, call
16136 do_recognize_by_name.
16137 (Target_selector::supported_names): New function.
16138 (Target_selector::bfd_name): New function.
16139 (Target_selector::do_instantiate_target): New pure virtual
16140 function.
16141 (Target_selector::do_recognize): New virtual function.
16142 (Target_selector::do_recognize_by_name): New virtual function.
16143 (Target_selector::instantiate_target): New private function.
16144 (supported_target_names): Declare.
16145 * target-select.cc (Target_selector::Target_selector): Update for
16146 new parameter and fields.
16147 (select_target_by_name): Check that the name matches before
16148 calling recognize_by_name.
16149 (supported_target_names): New function.
16150 * i386.cc (class Target_selector_i386): Update Target_selector
16151 constructor call. Remove recognize and recognize_by_name. Add
16152 do_instantiate_target.
16153 * x86_64.cc (class Target_selector_x86_64): Likewise.
16154 * testsuite/testfile.cc (class Target_selector_test): Update for
16155 changes to Target_selector.
16156
874c5b28
ILT
16157 * README: Rewrite, with some notes on unsupported features.
16158
0a65a3a7
CC
161592008-03-24 Cary Coutant <ccoutant@google.com>
16160
16161 * i386.cc (Target_i386::Got_type): New enum declaration.
16162 (Target_i386::Scan::local): Updated callers of Output_data_got
16163 member functions.
16164 (Target_i386::Scan::global): Likewise.
16165 (Target_i386::Relocate::relocate): Likewise.
16166 (Target_i386::Relocate::relocate_tls): Likewise.
16167 * object.h (Got_offset_list): New class.
16168 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16169 (Sized_relobj::local_got_offset): Likewise.
16170 (Sized_relobj::set_local_got_offset): Likewise.
16171 (Sized_relobj::local_has_tls_got_offset): Removed.
16172 (Sized_relobj::local_tls_got_offset): Removed.
16173 (Sized_relobj::set_local_tls_got_offset): Removed.
16174 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16175 * output.cc (Output_data_got::add_global): Added got_type parameter.
16176 (Output_data_got::add_global_with_rel): Likewise.
16177 (Output_data_got::add_global_with_rela): Likewise.
16178 (Output_data_got::add_global_pair_with_rel): New function.
16179 (Output_data_got::add_global_pair_with_rela): New function.
16180 (Output_data_got::add_local): Added got_type parameter.
16181 (Output_data_got::add_local_with_rel): Likewise.
16182 (Output_data_got::add_local_with_rela): Likewise.
16183 (Output_data_got::add_local_pair_with_rel): New function.
16184 (Output_data_got::add_local_pair_with_rela): New function.
16185 (Output_data_got::add_global_tls): Removed.
16186 (Output_data_got::add_global_tls_with_rel): Removed.
16187 (Output_data_got::add_global_tls_with_rela): Removed.
16188 (Output_data_got::add_local_tls): Removed.
16189 (Output_data_got::add_local_tls_with_rel): Removed.
16190 (Output_data_got::add_local_tls_with_rela): Removed.
16191 * output.h (Output_data_got::add_global): Added got_type parameter.
16192 (Output_data_got::add_global_with_rel): Likewise.
16193 (Output_data_got::add_global_with_rela): Likewise.
16194 (Output_data_got::add_global_pair_with_rel): New function.
16195 (Output_data_got::add_global_pair_with_rela): New function.
16196 (Output_data_got::add_local): Added got_type parameter.
16197 (Output_data_got::add_local_with_rel): Likewise.
16198 (Output_data_got::add_local_with_rela): Likewise.
16199 (Output_data_got::add_local_pair_with_rel): New function.
16200 (Output_data_got::add_local_pair_with_rela): New function.
16201 (Output_data_got::add_global_tls): Removed.
16202 (Output_data_got::add_global_tls_with_rel): Removed.
16203 (Output_data_got::add_global_tls_with_rela): Removed.
16204 (Output_data_got::add_local_tls): Removed.
16205 (Output_data_got::add_local_tls_with_rel): Removed.
16206 (Output_data_got::add_local_tls_with_rela): Removed.
16207 * resolve.cc (Symbol::override_base_with_special): Removed
16208 reference to has_got_offset_ field.
16209 * symtab.cc (Symbol::init_fields): Replaced initialization
16210 of got_offset_ with got_offsets_. Removed initialization
16211 of has_got_offset_
53fcba31 16212 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16213 (Symbol::got_offset): Likewise.
16214 (Symbol::set_got_offset): Likewise.
16215 (Symbol::has_tls_got_offset): Removed.
16216 (Symbol::tls_got_offset): Removed.
16217 (Symbol::set_tls_got_offset): Removed.
16218 (Symbol::got_offset_): Removed.
16219 (Symbol::tls_mod_got_offset_): Removed.
16220 (Symbol::tls_pair_got_offset_): Removed.
16221 (Symbol::got_offsets_): New field.
16222 (Symbol::has_got_offset): Removed.
16223 (Symbol::has_tls_mod_got_offset): Removed.
16224 (Symbol::has_tls_pair_got_offset): Removed.
16225 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16226 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16227 member functions.
16228 (Target_x86_64::Scan::global): Likewise.
16229 (Target_x86_64::Relocate::relocate): Likewise.
16230 (Target_x86_64::Relocate::relocate_tls): Likewise.
16231
bd52eafb
BE
162322008-03-25 Ben Elliston <bje@au.ibm.com>
16233
16234 * yyscript.y: Fix spelling error in comment.
16235
8b105e34
ILT
162362008-03-24 Ian Lance Taylor <iant@google.com>
16237
8ed814a9
ILT
16238 * options.h (class General_options): Define build_id option.
16239 * layout.h (class Layout): Declare write_build_id, create_note,
16240 create_build_id. Add build_id_note_ member.
16241 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16242 "libiberty.h", "md5.h", "sha1.h".
16243 (Layout::Layout): Initialize eh_frame_data_,
16244 eh_frame_hdr_section_, and build_id_note_.
16245 (Layout::finalize): Call create_build_id.
16246 (Layout::create_note): New function, broken out of
16247 Layout::create_gold_note.
16248 (Layout::create_gold_note): Call create_note.
16249 (Layout::create_build_id): New function.
16250 (Layout::write_build_id): New function.
16251 (Close_task_runner::run): Call write_build_id.
16252
8b105e34
ILT
16253 * x86_64.cc: Correct license to GPLv3.
16254
086a1841
ILT
162552008-03-23 Ian Lance Taylor <iant@google.com>
16256
16257 * options.cc: Include "demangle.h".
16258 (parse_optional_string): New function.
16259 (parse_long_option): Handle takes_optional_argument.
16260 (parse_short_option): Update dash_z initializer. Handle
16261 takes_optional_argument.
16262 (General_options::General_options): Initialize do_demangle_.
16263 (General_options::finalize): Set do_demangle_. Handle demangling
16264 style.
16265 * options.h (parse_optional_string): Declare.
16266 (struct One_option): Add optional_arg field. Update constructor.
16267 Update call constructor calls. Add takes_optional_argument
16268 function.
16269 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16270 (DEFINE_optional_string): Define.
16271 (General_options::demangle): Change from DEFINE_bool to
16272 DEFINE_optional_string.
16273 (General_options::no_demangle): New function.
16274 (General_options::do_demangle): New function.
16275 (General_options::set_do_demangle): New function.
16276 (General_options::execstack_status_): Move definition to end of
16277 class definition.
16278 (General_options::static_): Likewise.
16279 (General_options::do_demangle_): New field.
16280 * object.cc (big_endian>::get_symbol_location_info): Call
16281 Options::do_demangle, not Options::demangle.
16282 * symtab.cc (demangle): Likewise.
16283
cbb93e63
ILT
162842008-03-22 Ian Lance Taylor <iant@google.com>
16285
16286 * gold.h: Include <cstddef> and <sys/types.h>
16287 * options.h: Include <cstring>.
16288
ec531623
ILT
162892008-03-21 Ian Lance Taylor <iant@google.com>
16290
16291 * Added source code to GNU binutils.
752937aa 16292\f
4b95cf5c 16293Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16294
16295Copying and distribution of this file, with or without modification,
16296are permitted in any medium without royalty provided the copyright
16297notice and this notice are preserved.
16298
16299Local Variables:
16300mode: change-log
16301left-margin: 8
16302fill-column: 74
16303version-control: never
16304End:
This page took 1.035219 seconds and 4 git commands to generate.