ppc476 workaround sizing
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
f9dffbf0
AM
12014-11-20 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
4
e88ba8d5
L
52014-11-13 H.J. Lu <hongjiu.lu@intel.com>
6
7 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
8 entry for R_X86_64_GOTPLT64.
9 (Target_x86_64<size>::Relocate::relocate): Update comments for
10 R_X86_64_GOTPLT64.
11
d37ffe25
ED
122014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
13
14 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
15 * plugin.h: add lock definition
16
9726c3c1
HS
172014-10-29 Han Shen <shenhan@google.com>
18 Jing Yu <jingyu@google.com>
19
20 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
21 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
22 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
23 Symbol::TLS_REF.
24 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
25 method.
26 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
27 (Target_aarch64::tls_ld_to_le): New method.
28 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
29 for 64bit targets.
30 (Output_data_plt_aarch64::irelative_rel_): New data member.
31 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
32 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
33 (Output_data_plt_aarch64::add_relocation): New method.
34 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
35 offset. Add got_irelative size to got size.
36 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
37 type string with the new typename.
38 (AArch64_relocate_functions::update_adr): Replace parameter x with
39 immed.
40 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
41 (AArch64_relocate_functions::reloc_common): New method.
42 (AArch64_relocate_funcsions::rela_general): Extract common part out
43 into reloc_common method.
44 (AArch64_relocate_functions::rela_general): Likewise.
45 (AArch64_relocate_functions::pcrela_general): Likewise.
46 (AArch64_relocate_functions::adr): New method.
47 (AArch64_relocate_functions::adrp): Calculate immed before calling
48 update_adr.
49 (AArch64_relocate_functions::adrp): Likewise.
50 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
51 comparing x to 0. Calculate immed from ~x when x < 0.
52 (Target_aarch64::optimize_tls_reloc): Add new cases for
53 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
54 TLSLD_MOVW_DTPREL_G0_NC.
55 (Target_aarch64::possible_function_pointer_reloc): Implement this
56 method.
57 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
58 comment.
59 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
60 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
61 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
62 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
63 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
64 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
65 (Target_aarch64::make_plt_entry): Call add_entry with two more
66 parameters.
67 (Target_aarch64::make_local_ifunc_plt_entry): New method.
68 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
69 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
70 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
71 (Target_aarch64::Relocate::relocate_tls): Add cases for
72 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
73 TLSLD_MOVW_DTPREL_G0_NC.
74 * testsuite/icf_safe_so_test.cc: Correct test comment.
75 * testsuite/icf_safe_test.sh: Add AArch64 arch.
76
80272b8c
AM
772014-10-22 Alan Modra <amodra@gmail.com>
78
79 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
80 thread_starter.
81
998a69f4
AS
822014-10-18 Andreas Schwab <schwab@linux-m68k.org>
83
84 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
85
aed56ec5
CC
862014-10-17 Cary Coutant <ccoutant@google.com>
87
88 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
89 Add "typename" keyword.
90
83a01957
HS
912014-09-22 Han Shen <shenhan@google.com>
92 Jing Yu <jingyu@google.com>
93
94 Patch for gold aarch64 backend to support relaxation.
95 * aarch64-reloc.def: Change format.
96 * aarch64.cc (class Reloc_stub): New class.
97 (class Stub_table): New class.
98 (class AArch64_relobj): New class.
99 (class AArch64_input_section): New class.
100 (class AArch64_output_section): New class.
101 (Target_aarch64::new_stub_table): New method.
102 (Target_aarch64::new_aarch64_input_section): New method.
103 (Target_aarch64::find_aarch64_input_section): New method.
104 (Target_aarch64::scan_section_for_stubs): New method.
105 (Target_aarch64::scan_reloc_section_for_stubs): New method.
106 (Target_aarch64::relocate_stub): New method.
107 (Target_aarch64::current_target): New method.
108 (Target_aarch64::do_make_elf_object): New method.
109 (Target_aarch64::do_may_relax): New method.
110 (Target_aarch64::do_relax): New method.
111 (Target_aarch64::group_sections): New method.
112 (Target_aarch64::scan_reloc_for_stub): New method.
113 (Target_aarch64::do_make_output_section): New method.
114 (Target_aarch64::stub_tables_): New data member.
115 (Target_aarch64::aarch64_input_section_map_): New data member.
116 (AArch64_relocate_functions::maybe_apply_stub): New method.
117
db4c9594
CC
1182014-09-30 Cary Coutant <ccoutant@google.com>
119
120 PR gold/17432
121 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
122
cd6da036
KC
1232014-09-30 Kito Cheng <kito@0xlab.org>
124
125 PR gold/13597
126 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
127 hash table before sysv-style hash table.
128
5f772412
ST
1292014-09-29 Sriraman Tallam <tmsriram@google.com>
130
131 * options.h (--pic-executable): Add negative to alias to -no-pie.
132
5efeedf6
CC
1332014-09-26 Cary Coutant <ccoutant@google.com>
134
135 PR gold/16773
136 * object.cc (Sized_relobj_file): Compute value of section symbols
137 for TLS sections the same as TLS symbols.
138
1707f183
CC
1392014-09-25 Cary Coutant <ccoutant@google.com>
140
141 PR gold/17432
142 * resolve.cc (Symbol_table::resolve): Override common placeholder
143 symbols, but adjust sizes.
144 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
145 symbols to common lists.
146
00cac886
AM
1472014-09-24 Alan Modra <amodra@gmail.com>
148
149 * po/POTFILES.in: Regenerate.
150
635aa30e
CC
1512014-09-23 Taiju Tsuiki <tzik@google.com>
152 Cary Coutant <ccoutant@google.com>
153
71b9b91b 154 PR gold/14860
635aa30e
CC
155 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
156 on input_sections_blocker.
157 * layout.cc (Write_sections_task::locks): Unblock
158 input_sections_blocker_.
159 * layout.h (Write_sections_task::Write_sections_task): Add
160 input_sections_blocker.
161 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
162 to DEPENDENCIES.
163 * testsuite/Makefile.in: Regenerate.
164
c0c71592
RÁE
1652014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
166
167 * testsuite/Makefile.am (plugin_test_10): New test.
168 * testsuite/Makefile.in: Regenerate
169 * testsuite/plugin_common_test_2.c (c1): Align to 8.
170 * testsuite/plugin_test_10.sh: New file.
171
6168c2a1
RÁE
1722014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
173
174 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
175 * resolve.cc (Symbol_table::resolve): Don't override common symbols
176 during the replacement phase.
177
3a531937
JY
1782014-09-17 Han Shen <shenhan@google.com>
179 Jing Yu <jingyu@google.com>
180
181 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
182 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
183 * aarch64.cc (Target_aarch64): Add data members
184 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
185 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
186 constructor.
187 (Target_aarch64::do_reloc_symbol_index): New method.
188 (Target_aarch64::do_reloc_addend): New method.
189 (Target_aarch64::add_tlsdesc_info): New method.
190 (Target_aarch64::do_dynsym_value): New method.
191 (Target_aarch64::do_make_data_plt): Add new parameters: got,
192 got_irelative. Pass them to Output_data_plt_aarch64_standard.
193 (Target_aarch64::make_data_plt): Add new parameters: got,
194 got_irelative. Pass them to do_make_data_plt.
195 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
196 (Target_aarch64::Relocate:tls_gd_to_le): New method.
197 (Target_aarch64::Relocate:tls_ie_to_le): New method.
198 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
199 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
200 (Target_aarch64::got_tlsdesc_section): New method.
201 (Target_aarch64::make_local_ifunc_plt_entry): New method.
202 (Target_aarch64::define_tls_base_symbol): New method.
203 (Target_aarch64::reserve_tlsdesc_entries): New method.
204 (Target_aarch64::got_mod_index_entry): New method.
205 (Target_aarch64::rela_tlsdesc_section): New method.
206 (Target_aarch64::rela_irelative_section): New method.
207 (Target_aarch64::Tlsdesc_info): New struct.
208 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
209 relocations and tlsdesc relocations.
210 (Target_aarch64::optimize_tls_reloc): Implement method.
211 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
212 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
213 in constructor.
214 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
215 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
216 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
217 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
218 (Output_data_plt_aarch64::rela_tlsdesc): New method.
219 (Output_data_plt_aarch64::rela_irelative): New method.
220 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
221 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
222 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
223 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
224 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
225 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
226 (Output_data_plt_aarch64_standard): New member variables:
227 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
228 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
229 New parameter: got, got_irelative.
230 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
231 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
232 (Output_data_plt_aarch64::do_write): Replace got_address with
233 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
234 (AArch64_relocate_functions::update_movnz): New method.
235 (AArch64_relocate_functions): Correct format.
236 (AArch64_relocate_functions::movnz): New method.
237 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
238 before the switch. Add new cases to switch.
00cac886 239 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
240 tlsgd tlsdesc cases.
241 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
242 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
243 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
244 Call reloc_name_in_error_message to print unsupported reloc.
245 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
246 make_data_plt.
247 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
248 relocs. Fill in some more dynamic tags.
249 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
250 Skip call tls_get_addr when tlsgd is relaxed.
251 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
252 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
253 tlsdesc->ie relaxation.
254
62661c93
SS
2552014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
256
257 * mips.cc (Target_mips_nacl): New class.
258 (Target_selector_mips_nacl): New class.
259 (target_selector_mips32): Rename from target_selector_mips32be and use
260 Target_selector_mips_nacl instead of Target_selector_mips.
261 (target_selector_mips32el): Rename from target_selector_mips32 and use
262 Target_selector_mips_nacl instead of Target_selector_mips.
263 (target_selector_mips64): Rename from target_selector_mips64be and use
264 Target_selector_mips_nacl instead of Target_selector_mips.
265 (target_selector_mips64el): Rename from target_selector_mips64 and use
266 Target_selector_mips_nacl instead of Target_selector_mips.
267 (Target_mips::mips_info): Add const attribute.
268
54674d38
CC
2692014-09-02 Cary Coutant <ccoutant@google.com>
270
271 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
272 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
273 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
274 (Sized_incr_dynobj::do_section_name): Likewise.
275 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
276 (Sized_incr_dynobj::do_section_name): Likewise.
277 * object.h (Object::section_name): Likewise.
278 (Object::do_section_name): Likewise.
279 (Sized_relobj_file::do_section_name): Likewise.
280 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
281 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
282
9860cbcf
CC
2832014-09-02 Cary Coutant <ccoutant@google.com>
284
285 PR gold/17005
286 * ehframe.cc (Fde::write): Add output_offset parameter.
287 (Cie::write): Likewise.
288 (Eh_frame::set_final_data_size): Account for offset within output
289 section.
290 (Eh_frame::do_sized_write): Likewise.
291 * ehframe.h (Fde::write): Add output_offset parameter.
292 (Cie::write): Likewise.
293 * output.cc (Output_section::Input_section_sort_entry): Remove
294 section_has_name_; add output_section_name parameter. Use
295 output section name for non-input sections.
296 (Output_section::Input_section_sort_entry::section_has_name): Remove.
297 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
298 (Output_section::Input_section_sort_compare): Remove logic for
299 sections without names.
300 (Output_section::Input_section_sort_init_fini_compare): Likewise.
301 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
302 Likewise.
303 (Output_section::Input_section_sort_section_name_compare): Likewise.
304
8e33481e
HS
3052014-08-29 Han Shen <shenhan@google.com>
306 Jing Yu <jingyu@google.com>
307
308 * aarch64-reloc-property.cc
309 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
310 reference reloc property in the table.
311 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
312 3 other entries.
313 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
314 2 new overloaded methods.
315 (Output_data_got_aarch64::do_write): Add code to write out
316 static relocs.
317 (class Output_data_got_aarch64::Static_reloc): New class to wrap
318 static relocs.
319 (Output_data_got_aarch64::static_relocs): New vector to
320 hold static relocs.
321 (Target_aarch64::TCB_SIZE): New const static memeber.
322 (Target_aarch64::tcb_size): New method.
323 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
324 (Target_aarch64::Relocate::relocate_tls): New method.
325 (Target_aarch64::Scan::local): Add code handling new reloc types.
326 (Target_aarch64::Scan::global): Add code handling new reloc types.
327
81233653
ST
3282014-08-13 Sriraman Tallam <tmsriram@google.com>
329
330 * options.h (-no-pie): Add option.
331
9363c7c3
JY
3322014-08-08 Jing Yu <jingyu@google.com>
333 Han Shen <shenhan@google.com>
334
335 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
336 (DEFFILES): add aarch64-reloc.def.
337 (TARGETSOURCES): Add aarch64-reloc-property.cc.
338 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
339 * Makefile.in: Regenerate.
340 * aarch64-reloc-property.cc: New file.
341 * aarch64-reloc-property.h: New file.
342 * aarch64-reloc.def: New file.
343 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
344 with tab to make the format consistent.
345 (Output_data_got_aarch64::symbol_table_): New method.
346 (Target_aarch64::do_plt_address_for_global): New method.
347 (Target_aarch64::do_plt_address_for_local): New method.
348 (Target_aarch64::do_select_as_default_target): New method.
349 (Target_aarch64::do_make_data_plt): New method.
350 (Target_aarch64::make_data_plt): New method.
351 (Output_data_plt_aarch64::has_irelative_section): New method.
352 (Output_data_plt_aarch64::address_for_global): New method.
353 (Output_data_plt_aarch64::address_for_local): New method.
354 (Output_data_plt_aarch64::irelative_rel_): New parameter.
355 (Output_data_plt_aarch64::add_entry): Implement contents.
356 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
357 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
358 the got_pov entry to plt0.
359 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
360 Implement contents.
361 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
362 (AArch64_howto): New struct.
363 (aarch64_howto[]): New static const array.
364 (AArch64_relocate_functions): New class.
365 (Target_aarch64::Scan::get_reference_flags): Remove method.
366 (Target_aarch64::Scan::local): Implement to support a few relocations.
367 (Target_aarch64::Scan::global): Implement to support a few relocations.
368 (Target_aarch64::make_plt_section): Implement contents.
369 (Target_aarch64::make_plt_entry): Implement contents.
370 (Target_aarch64::do_finalize_sections): Implement contents.
371 (Target_aarch64::Relocate::relocate): Implement a few relocations.
372 (Target_aarch64::relocate_section): Implement contents.
373
ad9fe6c1
AM
3742014-08-06 Alan Modra <amodra@gmail.com>
375
376 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
377
7cd4e5b7
AM
3782014-08-06 Alan Modra <amodra@gmail.com>
379
380 PR 13227
381 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
382
5ad9b0a7
ST
3832014-07-21 Sriraman Tallam <tmsriram@google.com>
384
385 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 386 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 387
e051745c
CC
3882014-07-08 Cary Coutant <ccoutant@google.com>
389
390 * expression.cc (struct Expression::Expression_eval_info): Add
391 new fields type_pointer, vis_pointer, and nonvis_pointer.
392 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
393 nonvis_pointer parameters. Adjust all calls.
394 (Symbol_expression::value): Update type, visibility, and nonvis bits
395 in caller.
396 * script.cc (Symbol_assignment::sized_finalize): Update type,
397 visibility, and remaining st_other bits for new symbol.
398 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
399 vis_pointer, and nonvis_pointer parameters.
400 * symtab.h (Symbol::set_type): New method.
401
402 * testsuite/Makefile.am (defsym_test): New test.
403 * testsuite/Makefile.in: Regenerate.
404 * testsuite/defsym_test.c: New file.
405 * testsuite/defsym_test.sh: New file.
406
f35c4853
CC
4072014-07-08 Cary Coutant <ccoutant@google.com>
408
409 PR gold/15639
410 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
411 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
412 (Sized_dynobj::base_read_symbols): ...new method.
413 * object.h (Sized_relobj_file::base_read_symbols): New method.
414 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
415 (Sized_relobj_file::base_read_symbols): ...new method.
416 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
417 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
418 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
419
2900af2d
AM
4202014-07-04 Alan Modra <amodra@gmail.com>
421
422 * po/POTFILES.in: Regenerate.
423
053a4d68
JY
4242014-07-02 Jing Yu <jingyu@google.com>
425
426 * aarch64.cc: New file
427 * Makefile.am (TARGETSOURCES): Add aarch64.cc
428 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
429 * Makefile.in: Regenerate.
430 * configure.tgt: Add entries for aarch64*.
431 * configure.ac: Likewise.
432 * configure: Likewise.
433
7b549045
AM
4342014-06-27 Alan Modra <amodra@gmail.com>
435
436 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
437
cb818dbf
CC
4382014-06-24 Cary Coutant <ccoutant@google.com>
439
440 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
441 sections.
442 (Dwo_file::sized_read_unit_index): Likewise.
443
9810d34d
SS
4442014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
445
446 * mips.cc: New file.
447 * Makefile.am (TARGETSOURCES): Add mips.cc
448 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
449 * configure.tgt: Add entries for mips*.
450 * configure.ac: Likewise.
451 * Makefile.in: Regenerate.
452 * configure: Likewise.
453
9baa787b
CC
4542014-06-09 Cary Coutant <ccoutant@google.com>
455
456 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
457 unit_length is within section bounds.
458
8f89af0a
CC
4592014-06-09 Cary Coutant <ccoutant@google.com>
460
461 PR gold/16980
462 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
463 map.
464
a47622ac
AM
4652014-06-07 Alan Modra <amodra@gmail.com>
466
467 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
468
4320c691
CC
4692014-06-06 Cary Coutant <ccoutant@google.com>
470
471 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
472 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
473 (Dwarf_pubnames_table::read_header): Likewise.
474 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
475 .debug_gnu_pubtypes.
476
270c9937
JB
4772014-06-05 Joel Brobecker <brobecker@adacore.com>
478
479 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
480 * Makefile.in, configure: Regenerate.
481
397998fc
AM
4822014-06-03 Alan Modra <amodra@gmail.com>
483
484 * powerpc.cc (addis_12_2): Define.
485 (Stub_table::do_write): Support fusion on ELFv2 stubs.
486
61f5c66f
AM
4872014-06-03 Alan Modra <amodra@gmail.com>
488
489 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
490 st_other output.
491
f6971787
AM
4922014-06-02 Alan Modra <amodra@gmail.com>
493
494 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
495 Only ignore relocs on ELFv1.
496 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
497
f6fb8322
CC
4982014-05-30 Cary Coutant <ccoutant@google.com>
499
500 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
501 * testsuite/Makefile.in: Regenerate.
502 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
503
c23dd342
L
5042014-05-27 H.J. Lu <hongjiu.lu@intel.com>
505
506 PR gold/16945
507 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
508 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
509
5fe7ffdc
AM
5102014-05-15 Alan Modra <amodra@gmail.com>
511
512 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
513 Compare FDE contents with DW_CFA_nop rather than 0.
514
a82bef93
ST
5152014-05-13 Sriraman Tallam <tmsriram@google.com>
516
517 * symtab.h (may_need_copy_reloc): Remove check for position independent
518 code.
519 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
520 position independence before pc absolute may_need_copy_reloc call.
521 Add check for executable output befor pc relative may_need_copy_reloc
522 call.
523 * i386.cc: Ditto.
524 * arm.cc: Ditto.
525 * sparc.cc: Ditto.
526 * tilegx.cc: Ditto.
527 * powerpc.cc: Add check for no position independence before
528 may_need_copy_reloc calls.
529 * testsuite/pie_copyrelocs_test.cc: New file.
530 * testsuite/pie_copyrelocs_shared_test.cc: New file.
531 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 532 * Makefile.in: Regenerate.
a82bef93 533
53c66605
ML
5342014-05-08 Martin Liška <mliska@suse.cz>
535
536 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
537
57b2284c
CC
5382014-05-06 Cary Coutant <ccoutant@google.com>
539
540 PR gold/16900
541 * i386.cc (Output_data_got_plt_i386): New class.
542 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
543 parameter. Change all callers.
544 (Output_data_plt_i386::layout_): Remove.
545 (Output_data_plt_i386::got_plt_): Change type.
546 (Target_i386::got_plt_): Change type. Change all references.
547 (Target_i386::got_section): Create instance of new class.
548 (Output_data_got_plt_i386::do_write): New function.
549 * x86_64.cc (Output_data_got_plt_x86_64): New class.
550 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
551 parameter. Change all callers.
552 (Output_data_plt_x86_64::layout_): Remove.
553 (Output_data_plt_x86_64::got_plt_): Change type.
554 (Target_x86_64::got_plt_): Change type. Change all references.
555 (Target_x86_64::got_section): Create instance of new class.
556 (Output_data_got_plt_x86_64::do_write): New function.
557 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
558 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
559 class.
560
6b97515d 5612014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 562
6b97515d
CC
563 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
564 if we have pubnames/pubtypes.
565
d1bddd3c
CC
5662014-05-02 Cary Coutant <ccoutant@google.com>
567
5fe7ffdc
AM
568 * defstd.cc (in_segment): Define __ehdr_start here...
569 * layout.cc (Layout::finalize): ...Instead of here. Set the
570 output segment when known.
571 * resolve.cc (Symbol::override_base_with_special): Remember
572 the original binding.
573 * symtab.cc (Symbol::set_output_segment): New function.
574 (Symbol::set_undefined): New function.
575 * symtab.h (Symbol::is_weak_undefined): Check original undef
576 binding.
577 (Symbol::is_strong_undefined): New function.
578 (Symbol::set_output_segment): New function.
579 (Symbol::set_undefined): New function.
580 * target-reloc.h (is_strong_undefined): Remove.
581 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
582 Check for hidden undefs.
583 (relocate_section): Call Symbol::is_strong_undefined.
584
585 * testsuite/Makefile.am (ehdr_start_test_1)
586 (ehdr_start_test_2, ehdr_start_test_3)
587 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
588 * testsuite/Makefile.in: Regenerate.
589 * testsuite/ehdr_start_def.cc: New source file.
590 * testsuite/ehdr_start_test.cc: New source file.
591 * testsuite/ehdr_start_test.t: New linker script.
592 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 593
7849f6d8
CC
5942014-04-23 Cary Coutant <ccoutant@google.com>
595
bf2cc635 596 PR gold/16870
7849f6d8
CC
597 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
598
99fd8cff
CC
5992014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
600
601 * layout.cc (Layout::include_section): Allow a target to decide
602 whether to include a section.
603 * target.h (Target::should_include_section): New function.
604 (Target::do_should_include_section): New function.
605
91f43acd
CC
6062014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
607
608 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
609 inline into ...
610 (Copy_relocs::emit): ... here.
611 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
612 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
613 (Copy_reloc_entry::entries_): Change from private to protected.
614
c4eb27e1
ST
6152014-04-02 Sriraman Tallam <tmsriram@google.com>
616
617 * icf.cc (get_section_contents): Replace copies of reloc
618 vectors with const references.
619
ae447ddd
CC
6202014-04-02 Cary Coutant <ccoutant@google.com>
621
622 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
623 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
624 * configure: Regenerate.
625 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
626 -fno-use-linker-plugin.
627 (LINK1, CXXLINK1): Add it to the link command.
628 * testsuite/Makefile.in: Regenerate.
629
fa47fa92
AM
6302014-03-12 Alan Modra <amodra@gmail.com>
631
632 * Makefile.in: Regenerate.
633
9b12c500
CC
6342014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
635
636 * symtab.h (Symbol::set_nonvis): New function.
637
beacaa96
CC
6382014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
639
640 * symtab.cc (Sized_symbol<32>::init_output_data):
641 Instantiate the template.
642 (Sized_symbol<64>::init_output_data): Likewise.
643
800d9823
CC
6442014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
645
646 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
647 adjust dynamic symbol value.
648 * target.h (Target::adjust_dyn_symbol): New function.
649 (Target::do_adjust_dyn_symbol): New function.
650
918fc1f8 6512014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 652
918fc1f8
CC
653 * output.cc (Output_data_dynamic::Dynamic_entry::write):
654 Get the value of DYNAMIC_CUSTOM dynamic entry.
655 * output.h (Output_data_dynamic::add_custom): New function.
656 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
657 dynamic entry.
658 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
659 * target.h (Target::dynamic_tag_custom_value): New function.
660 (Target::do_dynamic_tag_custom_value): New function.
661
98ff9231
CC
6622014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
663
664 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
665 dynsym indexes.
666 * target.h (Target::has_custom_set_dynsym_indexes): New function.
667 (Target::do_has_custom_set_dynsym_indexes): New function.
668 (Target::set_dynsym_indexes): New function.
669 (Target::do_set_dynsym_indexes): New function.
670
b80eed39
AM
6712014-03-07 Alan Modra <amodra@gmail.com>
672
673 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
674 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
675 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
676 (Powerpc_relocate_functions::has_overflow_bitfield,
677 overflowed): Use the above.
678 (Target_powerpc::Relocate::relocate): Correct overflow checking
679 for a number of relocations. Modify overflow test for 16-bit
680 fields in instructions to signed/unsigned according to whether
681 the field takes a signed or unsigned value.
682
4b95cf5c
AM
6832014-03-05 Alan Modra <amodra@gmail.com>
684
685 Update copyright years.
686
45965137
AM
6872014-03-05 Alan Modra <amodra@gmail.com>
688
689 * powerpc.cc (Target_powerpc::Scan::local, global): Support
690 R_PPC64_ADDR64_LOCAL.
691 (Target_powerpc::Relocate::relocate): Likewise.
692
2c80b753
AM
6932014-03-03 Alan Modra <amodra@gmail.com>
694
695 * dwp.cc (print_version): Update copyright year to current.
696
c1c69e83
AM
6972014-02-10 Alan Modra <amodra@gmail.com>
698
699 * po/gold.pot: Regenerate.
700
dd0c4e70
CC
7012014-02-06 Cary Coutant <ccoutant@google.com>
702
703 Fix problem where -u is ignored when a weak undef is seen.
704
705 * archive.cc (Library_base::should_include_member): Reorder
706 code to check for -u option if a weak undef has already been seen.
707 * testsuite/Makefile.am (weak_undef_test_2): New test case.
708 * testsuite/Makefile.in: Regenerate.
709 * testsuite/weak_undef_file3.cc: New file.
710 * testsuite/weak_undef_file4.cc: New file.
711 * testsuite/weak_undef_test_2.cc: New file.
712
1a221d3d
CC
7132014-02-05 Cary Coutant <ccoutant@google.com>
714
715 Fix issues with gold undefined symbol diagnostics.
716
717 PR binutils/15435
718 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
719 check to here.
720 * target-reloc.h (is_strong_undefined): New function.
721 (relocate_section): Move undef vtable symbol check from here.
722 Check for is_strong_undefined.
723
e889f0a4 7242014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 725
e889f0a4
CC
726 Fix problems with the --dynamic-list option.
727
728 PR gold/13577
729 * options.cc (General_options::parse_dynamic_list):
730 Set have_dynamic_list_.
731 (General_options::General_options): Initialize have_dynamic_list_.
732 (General_options::finalize): Turn off -Bsymbolic and
733 -Bsymbolic-functions if --dynamic-list provided.
734 * options.h (General_options::have_dynamic_list): New function.
735 (General_options::have_dynamic_list_): New data member.
736 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
737 correctly.
5fe7ffdc 738
e889f0a4
CC
739 PR gold/16530
740 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
741 in --dynamic-list, mark it.
5fe7ffdc 742
e889f0a4
CC
743 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
744 (dynamic_list_2): New test case.
745 * testsuite/Makefile.in: Regenerate.
746 * testsuite/dynamic_list_2.cc: New file.
747 * testsuite/dynamic_list_2.t: New file.
748 * testsuite/dynamic_list_lib1.cc: New file.
749 * testsuite/dynamic_list_lib2.cc: New file.
750 * testsuite/gc_dynamic_list_test.c: New file.
751 * testsuite/gc_dynamic_list_test.sh: New file.
752 * testsuite/gc_dynamic_list_test.t: New file.
753
ec673e64
CC
7542014-01-28 Cary Coutant <ccoutant@google.com>
755
756 Add .gdb_index version 7 support.
757
758 * gold/dwarf_reader.cc: include <utility> (for make_pair).
759 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
760 debug sections.
761 (Dwarf_ranges_table::read_ranges_table): Likewise.
762 (Dwarf_pubnames_table::read_section): Check for GNU-style
763 sections, and for compressed debug sections.
764 (Dwarf_pubnames_table::read_header): Compute end address of table.
765 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
766 for end of list by offset, not by offset == 0.
767 (Dwarf_info_reader::do_read_string_table): Check for compressed
768 debug sections.
769 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
770 Initialize new data members.
771 (Dwarf_pubnames_table::next_name): return flag_byte.
772 (Dwarf_pubnames_table::end_of_table_): New data member.
773 (Dwarf_pubnames_table::is_gnu_style_): New data member.
774 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
775 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
776 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
777 read skeleton type unit DIEs.
778 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
779 (Gdb_index::do_write): Write flag_byte.
780 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
781 (Gdb_index::Cu_vector): Store flags along with cu indexes.
782 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
783 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
784
221fd5d5
L
7852014-01-08 H.J. Lu <hongjiu.lu@intel.com>
786
787 * version.cc (print_version): Update copyright year to 2014.
788
6c09fb0b
ILT
7892013-12-19 Dimitry Andric <dimitry@andric.com>
790
791 * stringpool.cc (Stringpool_template::reserve): Add
792 HAVE_UNORDERED_MAP case.
793 * stringpool.cc (Stringpool_template::print_stats): Likewise.
794
8356f2d0
CC
7952013-12-18 Cary Coutant <ccoutant@google.com>
796
797 * configure.ac: Check for <unordered_set> and <unordered_map>.
798 * config.in: Regenerate.
799 * configure: Regenerate.
800 * system.h: Use <unordered_set> and <unordered_map> if available.
801
f2c7d7ee
RM
8022013-12-10 Roland McGrath <mcgrathr@google.com>
803
804 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
805 with $(INSTALL_PROGRAM_ENV).
806 * Makefile.in: Regenerate.
807
6632e8cc
CC
8082013-11-22 Cary Coutant <ccoutant@google.com>
809
810 * configure.ac: Add check for which library is needed for
811 dlopen.
812 * configure: Regenerate.
813
0c075858
CC
8142013-11-22 Cary Coutant <ccoutant@google.com>
815
816 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
817 assembler.
818 * testsuite/Makefile.in: Regenerate.
819
f49fe902
L
8202013-11-17 H.J. Lu <hongjiu.lu@intel.com>
821
822 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
823 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
824 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
825 (Target_x86_64<size>::Scan::local): Likewise.
826 (Target_x86_64<size>::Scan::global): Likewise.
827 (Target_x86_64<size>::Relocate::relocate): Likewise.
828 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
829 Likewise.
830 (Target_x86_64<size>::Scan::check_non_pic(): Handle
831 R_X86_64_PC32_BND.
832
833 * testsuite/Makefile.am (check_PROGRAMS): Add
834 exception_x86_64_bnd_test.
835 (exception_x86_64_bnd_test_SOURCES): New macro.
836 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
837 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
838 (exception_x86_64_bnd_test_LDADD): Likewise.
839 (exception_x86_64_bnd_1.o): New rule.
840 (exception_x86_64_bnd_2.o): Likewise.
841 * testsuite/Makefile.in: Regenerated.
842
9055360d
AM
8432013-11-15 Alan Modra <amodra@gmail.com>
844
845 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
846 accessor.
847 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
848 Only call ppc64_local_entry_offset for 64-bit. Restrict
849 symval_for_branch lookup to ELFv1.
850 (Stub_table::add_plt_call_entry): Use unsigned int off.
851 (Output_data_glink::Address, invalid_address): New.
852 (Output_data_glink::add_eh_frame): Move out of line. Add
853 support for ELFv2.
854 (Output_data_glink::add_global_entry, find_global_entry,
855 global_entry_address): New functions.
856 (Output_data_glink::global_entry_stubs_, end_branch_table_,
857 ge_size): New variables.
858 (Output_data_glink::set_final_data_size): Add global entry
859 stub sizing.
860 (Output_data_glink::do_write): Write global entry stubs.
861 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
862 parameter. Return true for ELFv2. Adjust callers.
863 (Target_powerpc::Scan::local, global): Restrict opd lookup to
864 ELFv1. Similarly for ifunc and dynamic relocation processing
865 specific to ELFv1. Recognize that symbols are defined on
866 their plt entries for ELFv2.
867 (Target_powerpc::symval_for_branch): Assert if called for
868 ELFv2 or ppc32.
869 (Target_powerpc::Relocate::relocate): Use global entry plt
870 stub for symbol value if such exists on ELFv2.
871 (Target_powerpc::Relocate::relocate): Don't call
872 symval_for_branch when ELFv2. Do adjust for local entry
873 offset when ELFv2.
874 (Target_powerpc::do_dynsym_value): Set symbols to global entry
875 plt stub for ELFv2.
876 (Target_powerpc::do_plt_address_for_global): Similarly.
877
cafdd569
CC
8782013-11-14 Cary Coutant <ccoutant@google.com>
879
880 Revert patch -- this did not fix the problem, and there is
881 no race there.
882
883 2013-11-14 Cary Coutant <ccoutant@google.com>
884
885 PR gold/14860
886 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
887 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
888 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
889 updating fde_offsets_.
890 (Eh_frame_hdr::lock_): New data member.
891
94e49e16
CC
8922013-11-14 Cary Coutant <ccoutant@google.com>
893
894 * dwp.cc (Dwo_file_entry): New type.
895 (File_list): Use Dwo_file_entry.
896 (Dwo_file::verify): New function.
897 (Dwo_file::verify_dwo_list): New function.
898 (Dwo_file::sized_verify_dwo_list): New function.
899 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
900 list.
901 (Dwp_options): New enum type.
902 (dwp_options): Add --verify-only.
903 (usage): Likewise.
904 (main): Likewise.
905 * dwp.h (gold_info): Add declaration.
906
7cdd7d57
CC
9072013-11-14 Cary Coutant <ccoutant@google.com>
908
909 PR gold/14860
910 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
911 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
912 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
913 updating fde_offsets_.
914 (Eh_frame_hdr::lock_): New data member.
915
1d946cb3
CC
9162013-11-06 Cary Coutant <ccoutant@google.com>
917
918 PR gold/15758
919 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
920 before reloc sections.
921
4f65b40e
AM
9222013-11-04 Alan Modra <amodra@gmail.com>
923
924 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
925 (Symbol::needs_dynamic_reloc): Test new flag.
926 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
927 (Target_powerpc::Scan::get_reference_flags): Add target param.
928 Return FUNC_DESC_ABI for 64-bit ELFv1.
929 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
930 call.
931 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
932 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
933
908794a9
CC
9342013-10-31 Cary Coutant <ccoutant@google.com>
935
936 Restore support for dwp v2 DWARF package file format.
937
938 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
939 tu_length parameter. Adjust all callers.
940 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
941 * dwp.cc: Include dwarf.h.
942 (Section_bounds): New struct type.
943 (Unit_set): New struct type.
944 (Dwo_file::Dwo_file): Initialize new data member.
945 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
946 Combine and rename to...
947 (Dwo_file::read_unit_index): ...this.
948 (Dwo_file::sized_read_compunit_index)
949 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
950 (Dwo_file::sized_read_unit_index): ...this.
951 (Dwo_file::copy_section): Remove section_name, is_str_offsets
952 parameters; add section_id parameter.
953 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
954 (Dwo_file::add_unit_set): ...this.
955 (Dwo_file::shndx_map_): Remove.
956 (Dwo_file::sect_offsets_): New data member.
957 (Dwp_output_file::Dwp_output_file): Initialize new data members.
958 (Dwp_output_file::add_section): Rename to...
959 (Dwp_output_file::add_contribution): ...this.
960 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
961 (Dwp_output_file::add_tu_set): Likewise.
962 (Dwp_output_file::Contribution): New type.
963 (Dwp_output_file::Section::contributions): New data member.
964 (Dwp_output_file::Cu_or_tu_set): Remove.
965 (Dwp_output_file::Section::Section): New ctor.
966 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
967 (Dwp_output_file::Dwp_index::Section_table): New type.
968 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
969 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
970 parameter.
971 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
972 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
973 (Dwp_output_file::Dwp_index::section_table): New member function.
974 (Dwp_output_file::Dwp_index::section_table_end): New member function.
975 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
976 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
977 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
978 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
979 (Dwp_output_file::Dwp_index::section_table_): New data member.
980 (Dwp_output_file::Dwp_index::section_mask_): New data member.
981 (Dwp_output_file::add_output_section): New member function.
982 (Dwp_output_file::write_new_section): New member function.
983 (Dwp_output_file::write_contributions): New member function.
984 (Dwp_output_file::section_id_map_): New data member.
985 (class Dwo_id_info_reader): Remove.
986 (class Unit_reader): New class.
987 (get_dwarf_section_name): New function.
988 (Dwo_file::read_executable): Adjust initializations of class data.
989 (Dwo_file::read): Add support for v2 package file format.
990 (Dwo_file::read_unit_index): Likewise.
991 (Dwo_file::sized_read_unit_index): Likewise.
992 (Dwo_file::copy_section): Likewise.
993 (Dwo_file::add_unit_set): Likewise.
994 (Dwp_output_file::add_output_section): Likewise.
995 (Dwp_output_file::add_contribution): Likewise.
996 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
997 for empty slot.
998 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
999 file format.
1000 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1001 slot.
1002 (Dwp_output_file::initialize): Remove unused function.
1003 (Dwp_output_file::finalize): Add support for v2 package file format.
1004 (Dwp_output_file::write_index): Likewise.
1005 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1006 function prototype.
1007
2500c017
CC
10082013-10-31 Cary Coutant <ccoutant@google.com>
1009
1010 * configure.ac: Fix check for -fmerge-constants.
1011 * configure.ac: Regenerate.
1012
dd0845d7
RM
10132013-10-30 Roland McGrath <mcgrathr@google.com>
1014
1015 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1016 Correct 9-byte nop sequence to match what the assembler generates.
1017
b4f7960d
AM
10182013-10-30 Alan Modra <amodra@gmail.com>
1019
1020 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1021 ppc64_local_entry_offset, ppc64_local_entry_offset,
1022 do_read_symbols): New functions.
1023 (Powerpc_relobj::e_flags_, st_other_): New vars.
1024 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1025 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1026 (Powerpc_relobj::e_flags_): New var.
1027 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1028 and adjust for ELFv2.
1029 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1030 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1031 (Powerpc_dynobj::do_find_special_sections): Likewise.
1032 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1033 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1034 to ELFv2 local entry.
1035 (Target_powerpc::do_relax): No thread safe barriers needed for
1036 ELFv2.
1037 (Output_data_plt_powerpc::initial_plt_entry_size_,
1038 plt_entry_size): Delete. Replace all uses with
1039 first_plt_entry_offset() and plt_entry_size().
1040 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1041 reserved_size parm. Update callers.
1042 (Output_data_plt_powerpc::entry_count): Update.
1043 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1044 and use Target_powerpc::first_plt_entry_offset().
1045 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1046 rename to plt_entry_size.
1047 (Output_data_plt_powerpc::add_ifunc_entry,
1048 add_local_ifunc_entry): Adjust reloc for ELFv2.
1049 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1050 (glink_eh_frame_fde_64v2): New.
1051 (Stub_table::plt_call_size): Support ELFv2 sizing.
1052 (Output_data_glink::add_eh_frame): Use the new FDE.
1053 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1054 (Stub_table::do_write): Write ELFv2 stubs and glink.
1055 (Target_powerpc::Relocate::relocate): Replaces nop after call
1056 with ld 2,24(1) and adjust local offset destination for ELFv2.
1057
f9c6b907
AM
10582013-10-30 Alan Modra <amodra@gmail.com>
1059
1060 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1061 (Target_powerpc::Scan::global, local): Likewise.
1062 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1063 on all ppc64 @h and @ha relocs.
1064
e84fe78f
AM
10652013-10-14 Alan Modra <amodra@gmail.com>
1066
1067 * output.h (Output_data_got::add_constant): Tidy.
1068 (Output_data_got::add_constant_pair): New function.
1069 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1070 methods used so as to first call reserve_ent().
1071
679e4abf
RM
10722013-10-11 Roland McGrath <mcgrathr@google.com>
1073
44dcb735
RM
1074 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1075 add_got_entry and add_got_entry_pair.
1076
13323c49
RM
1077 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1078 (HAVE_PUBNAMES): Likewise.
1079 * configure: Regenerate.
1080
1496b446
RM
1081 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1082 * testsuite/Makefile.in: Regenerate.
1083
cc84c10b
RM
1084 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1085 Remove const from declaration.
1086 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1087 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1088 * output.h (Output_file_header): Remove const from member target_
1089 and corresponding constructor argument.
1090 * output.cc (Output_file_header::Output_file_header): Update prototype.
1091 (Output_file_header::do_sized_write): Use this->target_ in place
1092 of parameters()->target().
1093
52f66a2c
RM
1094 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1095
2b64b551
RM
1096 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1097 * configure: Regenerate.
1098 * Makefile.in: Regenerate.
1099 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1100 * testsuite/merge_string_literals_2.c: Likewise.
1101 * testsuite/Makefile.am
1102 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1103 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1104 literal -fmerge-constants.
1105 * testsuite/Makefile.in: Regenerate.
1106
43819297
RM
1107 * i386.cc (Target_i386): Remove unused member dynbss_.
1108 * arm.cc (Target_arm): Likewise.
1109 * powerpc.cc (Target_powerpc): Likewise.
1110 * sparc.cc (Target_sparc): Likewise.
1111 * tilegx.cc (Target_tilegx): Likewise.
1112 * x86_64.cc (Target_x86_64): Likewise.
1113 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1114 type_signature_, type_offset_.
1115 * plugin.h (Plugin_hook): Remove unused member layout_.
1116 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1117 mapfile_.
1118 (Read_member): Remove unused members input_objects_, symtab_,
1119 mapfile_, layout_.
1120 (Check_library): Remove unused member symtab_.
1121 * archive.h (Lib_group): Remove unused member lib_.
1122 * archive.cc (Lib_group::Lib_group): Update initializer.
1123 * incremental.h (Incremental_binary): Remove unused member target_.
1124 (Incremental_script_entry): Removed unused member script_.
1125 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1126 * icf.h (Icf): Remove unused member num_tracked_relocs.
1127
39d9ead7
RM
1128 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1129 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1130 its only use.
1131 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1132
679e4abf
RM
1133 * archive.h: Use struct rather than class for forward declaration
1134 of Read_symbols_data.
1135
54de2ea6
CC
11362013-10-07 Cary Coutant <ccoutant@google.com>
1137
1138 PR gold/16010
1139 * testsuite/Makefile.am (icf_test): Fix dependencies.
1140 (icf_safe_test): Likewise.
1141 (icf_safe_so_test): Likewise.
1142 (large_symbol_alignment): Add empty _LDADD rule.
1143 * testsuite/Makefile.in: Regenerate.
1144
b14016f0
L
11452013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1146
1147 PR gold/15927
1148 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1149 relocation for R_X86_64_32 on x32.
1150
eb426534
RM
11512013-08-27 Roland McGrath <mcgrathr@google.com>
1152
1153 * output.cc (Output_segment::set_section_addresses): Take new
1154 Target* argument. If target->isolate_execinstr() and the segment
1155 is executable and starts at a target->abi_pagesize() boundary,
1156 pad its end out to a target->abi_pagesize() boundary with code fill.
1157 * output.h (Output_segment::set_section_addresses): Update decl.
1158 * layout.h (Layout::check_output_data_for_reset_values): Take new
1159 argument RELAX_OUTPUTS.
1160 (Layout): New member relax_output_list_.
1161 (Layout::add_relax_output): New method.
1162 * layout.cc (Layout::Layout): Update constructor.
1163 (Layout::reset_relax_output): New method.
1164 (Layout::clean_up_after_relaxation): Call it.
1165 (Layout::prepare_for_relaxation): Update caller.
1166 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1167 Call reset_relax_output before re-processing segments for
1168 isolate_execinstr case.
1169 (Layout::write_data): Handle relax_output_list_.
1170 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1171 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1172
9aff4b7a
NC
11732013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1174
1175 PR binutils/15834
1176 * object.h: Fix typos.
1177
93f8221c
RM
11782013-08-16 Roland McGrath <mcgrathr@google.com>
1179
1180 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1181 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1182
e44c3715
CC
11832013-08-07 Cary Coutant <ccoutant@google.com>
1184
1185 Revert support for v2 DWP files:
1186
1187 2013-03-01 Cary Coutant <ccoutant@google.com>
1188
1189 Add dwp support for v2 DWARF package file format.
1190 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1191 tu_length parameter. Adjust all callers.
1192 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1193 * dwp.cc: Include dwarf.h.
1194 (Section_bounds): New struct type.
1195 (Unit_set): New struct type.
1196 (Dwo_file::Dwo_file): Initialize new data member.
1197 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1198 Combine and rename to...
1199 (Dwo_file::read_unit_index): ...this.
1200 (Dwo_file::sized_read_compunit_index)
1201 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1202 (Dwo_file::sized_read_unit_index): ...this.
1203 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1204 parameters; add section_id parameter.
1205 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1206 (Dwo_file::add_unit_set): ...this.
1207 (Dwo_file::shndx_map_): Remove.
1208 (Dwo_file::sect_offsets_): New data member.
1209 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1210 (Dwp_output_file::add_section): Rename to...
1211 (Dwp_output_file::add_contribution): ...this.
1212 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1213 (Dwp_output_file::add_tu_set): Likewise.
1214 (Dwp_output_file::Contribution): New type.
1215 (Dwp_output_file::Section::contributions): New data member.
1216 (Dwp_output_file::Cu_or_tu_set): Remove.
1217 (Dwp_output_file::Section::Section): New ctor.
1218 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1219 (Dwp_output_file::Dwp_index::Section_table): New type.
1220 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1221 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1222 parameter.
1223 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1224 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1225 (Dwp_output_file::Dwp_index::section_table): New member function.
1226 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1227 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1228 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1229 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1230 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1231 (Dwp_output_file::Dwp_index::section_table_): New data member.
1232 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1233 (Dwp_output_file::add_output_section): New member function.
1234 (Dwp_output_file::write_new_section): New member function.
1235 (Dwp_output_file::write_contributions): New member function.
1236 (Dwp_output_file::section_id_map_): New data member.
1237 (class Dwo_id_info_reader): Remove.
1238 (class Unit_reader): New class.
1239 (get_dwarf_section_name): New function.
1240 (Dwo_file::read_executable): Adjust initializations of class data.
1241 (Dwo_file::read): Add support for v2 package file format.
1242 (Dwo_file::read_unit_index): Likewise.
1243 (Dwo_file::sized_read_unit_index): Likewise.
1244 (Dwo_file::copy_section): Likewise.
1245 (Dwo_file::add_unit_set): Likewise.
1246 (Dwp_output_file::add_output_section): Likewise.
1247 (Dwp_output_file::add_contribution): Likewise.
1248 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1249 for empty slot.
1250 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1251 file format.
1252 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1253 slot.
1254 (Dwp_output_file::initialize): Remove unused function.
1255 (Dwp_output_file::finalize): Add support for v2 package file format.
1256 (Dwp_output_file::write_index): Likewise.
1257 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1258 function prototype.
1259
c6905c28
CC
12602013-07-31 Cary Coutant <ccoutant@google.com>
1261
1262 * object.cc (Sized_relobj::do_output_section_address): New function.
1263 (Sized_relobj): Instantiate explicitly.
1264 * object.h (Object::output_section_address): New function.
1265 (Object::do_output_section_address): New function.
1266 (Sized_relobj::do_output_section_address): New function.
1267 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1268
12692013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1270 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1271
1272 * parameters.cc (Parameters::entry): Return target-specific entry
1273 symbol name.
1274 * target.h (Target::entry_symbol_name): New function.
1275 (Target_info::entry_symbol_name): New data member.
1276
1277 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1278 * i386.cc (Target_i386::i386_info): Likewise.
1279 (Target_i386_nacl::i386_nacl_info): Likewise.
1280 * sparc.cc (Target_sparc::sparc_info): Likewise.
1281 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1282 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1283 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1284 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1285
234d4ab8
SA
12862013-07-22 Sterling Augustine <saugustine@google.com>
1287
1288 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1289 Convert parameter shndx to local variable. Add parameters symtab
1290 and symtab_size. Scan over section names. Find relocation
1291 section corresponding to current section. Create and initialize
1292 reloc_mapper_ and reloc_type_.
1293 (Dwarf_pubnames_table::read_header): Add assertion. Change
1294 unit_length to off_t. Initialize member unit_length_. Fill in field
1295 cu_offset_.
1296 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1297 Initialize new fields unit_length_ and cu_offset_.
1298 (Dwarf_pubnames_table::read_section): Update prototype.
1299 (Dwarf_pubnames_table::cu_offset): New member function.
1300 (Dwarf_pubnames_table::subsection_size): Likewise.
1301 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1302 New fields.
1303 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1304 member functions public.
1305 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1306 Update comment. Rework logic. Move repeated parts to...
1307 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1308 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1309 pubtypes_table_, and stmt_list_offset.
1310 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1311 Gdb_index::find_pubtype_offset,
1312 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1313 (Gdb_index::pubnames_read): Update prototype and rework logic.
1314 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1315 Forward declare.
1316 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1317 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1318 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1319 Gdb_index::map_pubtable_to_dies):
1320 Declare functions.
1321 (Gdb_index::pubnames_read): Update declaration.
1322 (Gdb_index::Pubname_offset_map): New type.
1323 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1324 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1325 Gdb_index::stmt_list_offset): Declare.
1326 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1327 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1328 Gdb_index::pubtypes_offset_): Remove.
1329
a3ed37d8
RM
13302013-07-19 Roland McGrath <mcgrathr@google.com>
1331
1332 * options.h (General_options): Add -Trodata-segment option.
1333 * parameters.cc (Parameters::check_rodata_segment): New function.
1334 (Parameters::set_target_once): Call it.
1335 * parameters.h (Parameters): Declare it (private member function).
1336 * layout.cc (load_seg_unusable_for_headers): New function, broken
1337 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1338 then validate rodata segment rather than text segment.
1339 (relaxation_loop_body): Call that.
1340 (is_text_segment): New function. Don't admit a non-executable
1341 segment if TARGET->isolate_execinstr().
1342 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1343
eb5b4ded
CC
13442013-07-15 Shawn Landden <shawnlandden@gmail.com>
1345
1346 PR gold/15070
1347 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1348 * nacl.h (Sniff_file::View::View): Request aligned view.
1349
4d5effb9
CC
13502013-07-11 Cary Coutant <ccoutant@google.com>
1351
1352 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1353 correct BRLT entry size.
1354
ba8ca3e7
AM
13552013-07-03 Alan Modra <amodra@gmail.com>
1356
1357 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1358 comment.
1359
267257d2
CC
13602013-07-01 Cary Coutant <ccoutant@google.com>
1361
1362 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1363 reloc_type_.
1364 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1365 (Dwarf_ranges_table::lookup_reloc): New function.
1366 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1367 reloc_type_.
1368 (Dwarf_ranges_table::lookup_reloc): New function.
1369 (Dwarf_ranges_table::reloc_type_): New data member.
1370
06f30c9d
CC
13712013-06-27 Jing Yu <jingyu@google.com>
1372
1373 PR gold/15662
1374 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1375 function.
1376 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1377 (Target_powerpc::do_relax): Call the above.
1378
a2d7bf59
AM
13792013-06-27 Cary Coutant <ccoutant@google.com>
1380
1381 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1382 on garbage collected .opd section.
1383
13842013-06-27 Alan Modra <amodra@gmail.com>
1385
1386 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1387 is non-zero.
1388 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1389 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1390
32364e50
CC
13912013-06-14 Cary Coutant <ccoutant@google.com>
1392
1393 * resolve.cc (Symbol::override_base): Don't override st_type
1394 from plugin placeholder symbols.
1395 (Symbol_table::resolve): Likewise.
1396 (Symbol_table::should_override): Don't complain about TLS mismatch
1397 if the TO symbol is a plugin placeholder.
1398 * testsuite/Makefile.am (plugin_test_tls): New test.
1399 * testsuite/Makefile.in: Regenerate.
1400 * testsuite/plugin_test_tls.sh: New test script.
1401 * testsuite/two_file_test_2_tls.cc: New test source.
1402 * testsuite/two_file_test_tls.cc: New test source.
1403
7fb47cc9
CC
14042013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1405
1406 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1407 the maximum segment alignment is larger than the page size.
1408 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1409 correctly aligns the symbols with large alignemnt.
1410 * testsuite/Makefile.in: Regenerate.
1411 * testsuite/large_symbol_alignment.cc: New file.
1412
6934001a
CC
14132013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1414 Sriraman Tallam <tmsriram@google.com>
1415
1416 * options.h (sort_section): New option.
1417 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1418 Rename from Input_section_sort_section_name_special_ordering_compare.
1419 (Input_section_sort_section_name_compare): New struct.
1420 * output.cc (Output_section::Input_section_sort_section_name_compare::
1421 operator()): New function.
1422 (Output_section::sort_attached_input_sections): Use new sort function
1423 for .text if --sort-section=name is specified.
1424 * layout.cc (Layout::make_output_section):
1425 Add sorting by name when --sort-section=name is specified.
1426 * testsuite/Makefile.am (text_section_grouping): Test option
1427 --sort-section=name.
1428 * testsuite/Makefile.in: Regenerate.
1429 * testsuite/section_sorting_name.cc: New file.
1430 * testsuite/section_sorting_name.sh: New file.
1431
93acabad
CC
14322013-05-21 Cary Coutant <ccoutant@google.com>
1433
1434 * symtab.h (Symbol::is_cxx_vtable): New function.
1435 * target-reloc.h (relocate_section): Check for vtable symbol.
1436 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1437 * testsuite/Makefile.in: Regenerate.
1438 * testsuite/missing_key_func.cc: New test source.
1439 * testsuite/missing_key_func.sh: New test script.
1440
60e8b3fc
CC
14412013-05-21 Cary Coutant <ccoutant@google.com>
1442
2b64b551
RM
1443 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1444 type of enclosing symbol.
1445 (Relocate_info::location): Check symbol type when describing symbol.
1446 * object.h (Symbol_location_info): Remove unused line_number;
1447 add enclosing_symbol_type.
1448 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1449
9df9de2c
CC
14502013-05-13 Cary Coutant <ccoutant@google.com>
1451
2b64b551
RM
1452 * configure.ac: Export DEFAULT_TARGET.
1453 * configure: Regenerate.
1454 * Makefile.in: Regenerate.
1455 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1456 * testsuite/Makefile.in: Regenerate.
1457 * testsuite/debug_msg.sh: Delete duplicate tests.
1458 Don't check undef_int error message match for powerpc where the
1459 source file and line number aren't available.
9df9de2c 1460
bbc5ae17
RM
14612013-05-10 Roland McGrath <mcgrathr@google.com>
1462
1463 * options.h (General_options): Add --rosegment-gap option.
1464 * options.cc (finalize): --rosegment-gap implies --rosegment.
1465 * layout.cc (set_segment_offsets): Let user option override
1466 target->rosegment_gap().
1467
0c6e6c39
RM
14682013-05-10 Roland McGrath <mcgrathr@google.com>
1469
1470 * options.h (General_options): Remove leading space from help
1471 messages for -nostdlib and --rosegment.
1472
cde7cb01
MR
14732013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1474
1475 PR ld/15365
1476 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1477
f31ae5b8
AM
14782013-05-03 Alan Modra <amodra@gmail.com>
1479
1480 * merge.cc (Output_merge_string::do_add_input_section): Correct
1481 scan for number of strings. Rename vars to avoid shadowing.
1482 Include missing terminator in input_size_.
1483
d3a7cd45
L
14842013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1485
1486 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1487 Restore empty string handling.
1488
6ad3daba
CC
14892013-05-01 Cary Coutant <ccoutant@google.com>
1490
1491 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1492 uninitialized warning.
1493
e31908b6
CC
14942013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1495
1496 * output.cc (Output_section::add_merge_input_section): Allow
1497 to merge sections if the alignment is more than character size.
1498 * merge.h (Output_merge_string::Output_merge_string): Remove
1499 assert.
1500 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1501 only not-null strings. Check the alignment of strings.
1502 * stringpool.h
1503 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1504 alignment as the argument.
1505 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1506 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1507 Align non-zero length strings according to the addralign_.
1508 (Stringpool_template<Stringpool_char>::set_string_offsets):
1509 Updating offsets according to the given alignment.
1510 * testsuite/Makefile.am (text_section_grouping): Test if string
1511 literals are getting merged.
1512 * testsuite/Makefile.in: Regenerate.
1513 * testsuite/merge_string_literals_1.c: New file.
1514 * testsuite/merge_string_literals_2.c: Ditto.
1515 * testsuite/merge_string_literals.sh: Ditto.
1516
0e804863
ILT
15172013-04-26 Ian Lance Taylor <iant@google.com>
1518
1519 * target-reloc.h (relocate_section): If the reloc offset is out of
1520 range, pass VIEW as NULL to relocate.relocate.
1521 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1522 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1523 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1524 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1525 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1526 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1527
e7c5ea40
CC
15282013-04-26 Geoff Pike <gpike@chromium.org>
1529
1530 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1531 * layout.cc (Hash_task): New class.
1532 (Layout::queue_build_id_tasks): New function.
1533 (Layout::write_build_id): Handle single-thread portion of build ID
1534 computation. (In some cases, all of it is single-threaded.) Replace
1535 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1536 functionality in fewer lines of code.
1537 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1538 * options.h (General_options): make "--build-id" default to tree
1539 rather than sha1. Add two new options related to --build-id=tree:
1540 --build-id-chunk-size-for-treehash and
1541 --build-id-min-file-size-for-treehash.
1542 * Makefile.am: add testing of --build-id=tree and related new options
1543 (these tests will be invoked by "make check").
1544 * Makefile.in: Regenerate.
1545
49926cd0
AM
15462013-04-25 Alan Modra <amodra@gmail.com>
1547
1548 * configure.tgt: Add powerpcle and powerpc64le.
1549
a4034750
AM
15502013-04-22 Alan Modra <amodra@gmail.com>
1551
1552 PR gold/15355
1553 * layout.cc (Layout::segment_precedes): Allow more than one
1554 segment with the same type and flags.
1555
e79c84aa
CC
15562013-04-15 Cary Coutant <ccoutant@google.com>
1557
1558 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1559 allocate space in file for BSS sections.
1560
2199fbe7
CC
15612013-04-15 Cary Coutant <ccoutant@google.com>
1562
1563 * script-sections.cc (Orphan_output_section): Reset address
1564 to zero after each orphaned section for relocatable links.
1565
502e8a84
CC
15662013-04-15 Cary Coutant <ccoutant@google.com>
1567
a4034750
AM
1568 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1569 section starting address for relocatable link.
1570 * testsuite/Makefile.am (script_test_11): New test.
1571 * testsuite/Makefile.in: Regenerate.
1572 * testsuite/script_test_11.c: New source file.
1573 * testsuite/script_test_11.t: New linker script.
502e8a84 1574
0cfdc767
AM
15752013-04-13 Alan Modra <amodra@gmail.com>
1576
1577 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1578 owner when sections are not adjacent and exceed group size.
1579 (Target_powerpc::group_sections): Handle corner case.
1580 (Target_powerpc::Branch_info::make_stub): Handle case where
1581 stub table doesn't exist due to branches in non-exec sections.
1582 (Target_powerpc::Relocate::relocate): Likewise.
1583
6830ee24
AM
15842013-04-11 Alan Modra <amodra@gmail.com>
1585
1586 PR gold/15354
1587 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1588 .branch_lt to match bfd ld. Adjust comments throughout file.
1589
54a3d865
ILT
15902013-04-04 Ian Lance Taylor <iant@google.com>
1591
1592 GCC PR c++/56840
1593 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1594 sections before checking whether they are included in the link.
1595
9993ba11
ST
15962013-03-29 Sriraman Tallam <tmsriram@google.com>
1597
1598 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1599 object before calling the plugin claim_file handler. Pass the elf
1600 object of the archive to the plugin. Delete the elf object if the
1601 plugin claims the file.
1602
ebacd51e
AM
16032013-03-21 Alan Modra <amodra@gmail.com>
1604
1605 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1606 segment when omagic.
1607
117be58f
AM
16082013-03-21 Alan Modra <amodra@gmail.com>
1609
1610 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1611 comparison warning.
1612 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1613 uninitialized" warning.
1614
32e2b61d
AM
16152013-03-20 Alan Modra <amodra@gmail.com>
1616
1617 * symtab.h (Symbol::clear_version): New function.
1618 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1619 is_needed by weak references. Clear version for symbols defined
1620 in as-needed objects that are not needed.
1621
b3ccdeb5
AM
16222013-03-15 Alan Modra <amodra@gmail.com>
1623
1624 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1625 static and public. Add report_err param. Return false for data refs.
1626 (Target_powerpc::rela_dyn_section): New overloaded function.
1627 (Target_powerpc::plt_, iplt_): Elucidate.
1628 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1629 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1630 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1631 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1632 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1633 push_branch and make_plt_entry for ifunc syms when
1634 reloc_needs_plt_for_ifunc.
1635 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1636 for ifunc unless reloc_needs_plt_for_ifunc.
1637
ad3d8a2f
AM
16382013-03-15 Alan Modra <amodra@gmail.com>
1639
1640 * gc.h (gc_process_relocs): Don't look through function descriptors.
1641 * icf.cc (get_section_contents): Do so here instead.
1642
4d9aa155
AM
16432013-03-13 Alan Modra <amodra@gmail.com>
1644
1645 * powerpc.cc (is_branch_reloc): Forward declare.
1646 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1647 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1648 false for 64-bit, true for 32-bit non-branch relocs.
1649 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1650 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1651 nm output.
1652 (icf_safe_test): Generate linker map file as well as nm output.
1653 (icf_safe_so_test): Likewise.
1654 * testsuite/Makefile.in: Regenerate.
1655 * testsuite/icf_test.sh: Parse linker map file to determine
1656 section folding.
1657 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1658 * testsuite/icf_safe_so_test.sh: Likewise.
1659 (X86_32_or_ARM_specific_safe_fold): Merge into..
1660 (arch_specific_safe_fold): ..this.
1661 (X86_64_specific_safe_fold): Delete unused function.
1662
57420c20
AM
16632013-03-12 Alan Modra <amodra@gmail.com>
1664
1665 * gc.h (gc_process_relocs): Look through function descriptors
1666 to determine shndx, symvalue and addend used by ICF. Tidy
1667 variable duplication.
1668
dc3714f3
AM
16692013-03-11 Alan Modra <amodra@gmail.com>
1670
1671 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1672 * layout.cc (Layout_task_runner::run): ..to here.
1673 * symtab.h (struct Symbol_location): Extract from..
1674 (class Symbol_table): ..here.
1675 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1676 * target.h (class Target): Add function_location and
1677 do_function_location functions.
1678 (class Sized_target): Add do_function_location.
1679 * object.h (class Sized_relobj_file): Move find_shdr..
1680 (class Object): ..to here.
1681 * object.cc: Likewise. Update to suit. Instantiate.
1682 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1683 * powerpc.cc (class Powerpc_dynobj): New.
1684 (Target_powerpc::do_function_location): New function.
1685 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1686 (Powerpc_dynobj::do_read_symbols): New function.
1687 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1688
956b03bb
ILT
16892013-03-08 Ian Lance Taylor <iant@google.com>
1690
1691 * options.cc (General_options::string_to_object_format): Accept
1692 "default".
1693
4bead2d5
AM
16942013-03-08 Alan Modra <amodra@gmail.com>
1695
1696 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1697 pointer to Post_fde.
1698 (struct Post_fde): Move definition to here..
1699 * ehframe.cc (struct Post_fde): ..from here.
1700 (Cie::write): Don't alloc Post_fde.
1701 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1702
02e60bf7
AM
17032013-03-07 Alan Modra <amodra@gmail.com>
1704
1705 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1706 relocation referencing .LC0.
1707 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1708
8343f03a
AM
17092013-03-07 Alan Modra <amodra@gmail.com>
1710
1711 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1712 always_inline. Add assembly for powerpc to avoid GOT.
1713
3366d57c
AM
17142013-03-07 Alan Modra <amodra@gmail.com>
1715
1716 * testsuite/script_test_10.sh: Don't test .bss section
1717 header number.
1718
6c77229c
AM
17192013-03-06 Alan Modra <amodra@gmail.com>
1720
1721 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1722 (Target_powerpc::symval_for_branch): Add symtab param. Update
1723 all callers. Handle folded sections.
1724 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1725 to Powerpc_relobj.
1726 (Global_symbol_visitor_opd::operator()): Likewise.
1727
a39e4af6
AM
17282013-03-04 Alan Modra <amodra@gmail.com>
1729
1730 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1731 * testsuite/Makefile.in: Regenerate.
1732
d5834edb
CC
17332013-03-01 Cary Coutant <ccoutant@google.com>
1734
1735 Add dwp support for v2 DWARF package file format.
1736 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1737 tu_length parameter. Adjust all callers.
1738 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1739 * dwp.cc: Include dwarf.h.
1740 (Section_bounds): New struct type.
1741 (Unit_set): New struct type.
1742 (Dwo_file::Dwo_file): Initialize new data member.
1743 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1744 Combine and rename to...
1745 (Dwo_file::read_unit_index): ...this.
1746 (Dwo_file::sized_read_compunit_index)
1747 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1748 (Dwo_file::sized_read_unit_index): ...this.
1749 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1750 parameters; add section_id parameter.
1751 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1752 (Dwo_file::add_unit_set): ...this.
1753 (Dwo_file::shndx_map_): Remove.
1754 (Dwo_file::sect_offsets_): New data member.
1755 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1756 (Dwp_output_file::add_section): Rename to...
1757 (Dwp_output_file::add_contribution): ...this.
1758 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1759 (Dwp_output_file::add_tu_set): Likewise.
1760 (Dwp_output_file::Contribution): New type.
1761 (Dwp_output_file::Section::contributions): New data member.
1762 (Dwp_output_file::Cu_or_tu_set): Remove.
1763 (Dwp_output_file::Section::Section): New ctor.
1764 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1765 (Dwp_output_file::Dwp_index::Section_table): New type.
1766 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1767 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1768 parameter.
1769 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1770 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1771 (Dwp_output_file::Dwp_index::section_table): New member function.
1772 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1773 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1774 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1775 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1776 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1777 (Dwp_output_file::Dwp_index::section_table_): New data member.
1778 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1779 (Dwp_output_file::add_output_section): New member function.
1780 (Dwp_output_file::write_new_section): New member function.
1781 (Dwp_output_file::write_contributions): New member function.
1782 (Dwp_output_file::section_id_map_): New data member.
1783 (class Dwo_id_info_reader): Remove.
1784 (class Unit_reader): New class.
1785 (get_dwarf_section_name): New function.
1786 (Dwo_file::read_executable): Adjust initializations of class data.
1787 (Dwo_file::read): Add support for v2 package file format.
1788 (Dwo_file::read_unit_index): Likewise.
1789 (Dwo_file::sized_read_unit_index): Likewise.
1790 (Dwo_file::copy_section): Likewise.
1791 (Dwo_file::add_unit_set): Likewise.
1792 (Dwp_output_file::add_output_section): Likewise.
1793 (Dwp_output_file::add_contribution): Likewise.
1794 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1795 for empty slot.
1796 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1797 file format.
1798 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1799 slot.
1800 (Dwp_output_file::initialize): Remove unused function.
1801 (Dwp_output_file::finalize): Add support for v2 package file format.
1802 (Dwp_output_file::write_index): Likewise.
1803 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1804 function prototype.
1805
a68a081d
CC
18062013-03-01 Cary Coutant <ccoutant@google.com>
1807
1808 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1809 function into class definition in header file.
1810 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1811 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1812 New function.
1813 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1814
9d5781f8
AM
18152013-02-28 Alan Modra <amodra@gmail.com>
1816
1817 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1818 * target.cc (Target::do_plt_fde_location): New function.
1819 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1820 accessor function, and constructor param.
1821 (struct Post_fde, Post_fdes): Declare.
1822 (Cie::write): Add post_fdes param.
1823 * ehframe.cc (Fde::write): Use plt_fde_location.
1824 (struct Post_fde): Define.
1825 (Cie::write): Stash FDEs added post merge mapping.
1826 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1827 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1828 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1829 other FDEs.
1830 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1831 (Target_powerpc::has_glink): New function.
1832 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1833 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1834 glink_eh_frame_fde_32, default_fde): New data.
1835 (Stub_table::eh_frame_added_): New var.
1836 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1837 Make const.
1838 (Stub_table::add_eh_frame): New function.
1839 (Output_data_glink::add_eh_frame): New function.
1840 (Target_powerpc::make_glink_section): Call add_eh_frame.
1841
214383dd
ILT
18422013-02-15 Ian Lance Taylor <iant@google.com>
1843
1844 * options.h (DEFINE_uint64_alias): Define.
1845 (class General_options): Add -Ttext-segment as an alias for
1846 -Ttext.
1847
91c2b899
AM
18482013-02-15 Alan Modra <amodra@gmail.com>
1849
1850 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1851 (Stub_table::do_write): ..here, two places.
1852 (Stub_table::plt_call_size): Use it here too.
1853
20e2a8aa
ILT
18542013-02-11 Ian Lance Taylor <iant@google.com>
1855
1856 * descriptors.cc (Descriptors::close_all): New function.
1857 * descriptors.h (class Descriptors): Declare close_all.
1858 (close_all_descriptors): New inline function.
1859 * plugin.cc: Include "descriptors.h".
1860 (Plugin_manager::cleanup): Call close_all_descriptors.
1861
8952bc69
AM
18622013-02-06 Alan Modra <amodra@gmail.com>
1863
1864 * README: Update coding style link.
1865
29bd8b6b
CC
18662013-01-28 Cary Coutant <ccoutant@google.com>
1867
a4034750
AM
1868 * dwp.cc (File_list): New typedef.
1869 (Dwo_name_info_reader): New class.
1870 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1871 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1872 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1873 (Dwo_file::read_executable): New function.
1874 (Dwo_file::read): Move common setup code to ...
1875 (Dwo_file::make_object): ... here.
1876 (dwp_options): Add --exec/-e.
1877 (usage): Likewise.
1878 (main): Likewise.
29bd8b6b 1879
c6ac678d
ST
18802013-01-24 Sriraman Tallam <tmsriram@google.com>
1881
1882 * layout.cc (Layout::layout): Check for option text_reorder.
1883 (Layout::make_output_section): Ditto.
1884 * options.h (text_reorder): New option.
1885 * output.cc (Input_section_sort_compare): Remove special ordering
1886 of section names.
1887 (Output_section::
1888 Input_section_sort_section_name_special_ordering_compare::
1889 operator()): New function.
1890 (Output_section::sort_attached_input_sections): Use new sort function
1891 for .text.
1892 * output.h (Input_section_sort_section_name_special_ordering_compare):
1893 New struct.
1894 * testsuite/Makefile.am (text_section_grouping): Test option
1895 --no-text-reorder
1896 * testsuite/Makefile.in: Regenerate.
1897 * testsuite/text_section_grouping.sh: Check order of functions without
1898 default text reordering.
1899
50701cc1
MF
19002013-01-18 Mike Frysinger <vapier@gentoo.org>
1901
1902 * options.h (General_options): Change default to true for new_dtags.
1903
b1b00fcc
MF
19042013-01-18 Mike Frysinger <vapier@gentoo.org>
1905
1906 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1907 when enable_new_dtags is false. Only add DT_RUNPATH when
1908 enable_new_dtags is true.
1909
ec5b8187
AM
19102013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1911
1912 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1913 used in declaration and definition consistent.
1914 (Target_powerpc::symval_for_branch): Ditto.
1915
a880d4c4
ST
19162013-01-16 Sriraman Tallam <tmsriram@google.com>
1917
1918 * testsuite/plugin_final_layout.cc: Fix comment.
1919
7c381248
ST
19202013-01-16 Sriraman Tallam <tmsriram@google.com>
1921
1922 * layout.cc (Layout::layout): Do not do default sorting for
1923 text sections when section ordering is specified.
1924 (make_output_section): Ditto.
1925 * testsuite/plugin_final_layout.cc: Name the function sections
1926 to catch reordering issues.
1927
e2458743
AM
19282013-01-15 Alan Modra <amodra@gmail.com>
1929
1930 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1931 plt-thread-safe.
1932
431ed302
AM
19332013-01-15 Alan Modra <amodra@gmail.com>
1934
1935 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1936 * testsuite/Makefile.in: Regenerate.
1937
0ec6429b
AM
19382013-01-14 Alan Modra <amodra@gmail.com>
1939
1940 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1941 * testsuite/Makefile.in: Regenerate.
1942
0bf402d5
ILT
19432013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1944
36af3926 1945 PR bfd/14430
0bf402d5
ILT
1946 Fix mingw gold build with plugins enabled
1947 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1948 * configure.ac: Export DLOPEN_LIBS and add headers check.
1949 * plugin.cc: Handle non-dlfcn case.
1950 * Makefile.in: Regenerate.
1951 * config.in: Regenerate.
1952 * configure: Regenerate.
1953 * testsuite/Makefile.in: Regenerate.
1954
9e9143bc
ST
19552013-01-09 Sriraman Tallam <tmsriram@google.com>
1956
1957 * output.h (sort_attached_input_sections): Change to be public.
1958 * script-sections.cc
1959 (Output_section_definition::set_section_addresses): Sort
1960 attached input sections according to section order before linker
1961 script assigns section addresses.
1962 (Orphan_output_section::set_section_addresses): Sort
1963 attached input sections according to section order before linker
1964 script assigns section addresses.
1965 * Makefile.am (final_layout.sh): Use a simple linker script to
1966 check if section ordering still works.
1967 * Makefile.in: Regenerate.
1968
679af368
ILT
19692013-01-09 Ben Cheng <bccheng@google.com>
1970
1971 * arm.cc (Target_arm::attributes_accept_div): New function.
1972 (Target_arm::attributes_forbid_div): New function.
1973 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1974 attribute using the same new functions as what bfd/elf32_arm.c
1975 does.
1976
3136a00e
CC
19772013-01-07 Cary Coutant <ccoutant@google.com>
1978
1979 PR gold/14993
1980 * output.cc (Output_section::add_input_section): For incremental
1981 updates, don't track input sections that are allocated from patch
1982 space.
1983
f2a6224b
L
19842013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1985 Ian Lance Taylor <iant@google.com>
1986
1987 PR gold/14897
1988 * configure.ac (--enable-ld): Removed.
1989 (install_as_default): Set to yes only for --enable-gold=default
1990 or --disable-ld.
1991 * configure: Regenerated.
1992
4f46f626
L
19932013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1994
1995 * options.h (General_options): Add -fuse-ld= for GCC linker
1996 option compatibility.
1997
26e4ef59
CC
19982013-01-04 Cary Coutant <ccoutant@google.com>
1999
2000 * configure.ac: Fix typo restoring CXXFLAGS.
2001 * configure: Regenerate.
2002
3d587466
CC
20032013-01-04 Cary Coutant <ccoutant@google.com>
2004
4f46f626
L
2005 * testsuite/Makefile.am (CXXLINK_S): New macro.
2006 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2007 * testsuite/Makefile.in: Regenerate.
3d587466 2008
44db6695
L
20092013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2010
2011 * version.cc (print_version): Update copyright year to 2013.
2012
edcac0c1
ILT
20132012-12-20 Ian Lance Taylor <iant@google.com>
2014
2015 * layout.cc (Layout::special_ordering_of_input_section): New
2016 function.
2017 (Layout::layout): If input section requires special ordering, must
2018 sort input sections.
2019 (Layout::make_output_section): May sort .text input sections.
2020 (Layout::is_section_name_prefix_grouped): Remove.
2021 * layout.h (class Layout): Declare
2022 special_ordering_of_input_section. Don't declare
2023 is_section_name_prefix_grouped.
2024 * output.cc (Output_section::add_input_section): Revert last
2025 change.
2026 (Output_section::Input_section_sort::match_file_name): Don't crash
2027 if called on output section data.
2028 (Output_section::Input_section_sort_compare): Sort based on
2029 special ordering.
2030 (Output_section::Input_section_sort_section_order_index_compare):
2031 Revert last patch.
2032 (Output_section::sort_attached_input_sections): Likewise.
2033
28f2a4ac
ST
20342012-12-18 Sriraman Tallam <tmsriram@google.com>
2035
edcac0c1 2036 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2037 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2038 * output.cc (Output_section::add_input_section): Check if section
2039 name contains special prefix. Keep input sections to sort such
2040 sections.
2041 (Output_section::Input_section_sort_section_order_index_compare
2042 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2043 (Output_section::sort_attached_input_sections): Add condition to
2044 Input_section_entry constructor call.
28f2a4ac
ST
2045 * testsuite/Makefile.am (text_section_grouping): New test.
2046 * testsuite/Makefile.in: Regenerate.
2047 * testsuite/text_section_grouping.cc: New file.
2048 * testsuite/text_section_grouping.sh: New file.
2049
5bf135a7
NC
20502012-12-17 Nick Clifton <nickc@redhat.com>
2051
2052 * Makefile.am: Add copyright notice.
2053 * NEWS: Likewise.
2054 * README: Likewise.
2055 * configure.ac: Likewise.
2056 * ftruncate.c: Likewise.
2057 * Makefile.in: Regenerate.
2058
59965708
CC
20592012-12-14 Cary Coutant <ccoutant@google.com>
2060
a4034750
AM
2061 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2062 --no-as-needed flag.
2063 (exception_separate_shared_12_test): Likewise.
2064 (incremental_copy_test): Likewise.
2065 * testsuite/Makefile.in: Regenerate.
59965708 2066
2a77e2ab
CC
20672012-12-14 Cary Coutant <ccoutant@google.com>
2068
2069 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2070 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2071
e3deeb9c
AM
20722012-12-12 Alan Modra <amodra@gmail.com>
2073
2074 * powerpc.cc (class Track_tls): New.
2075 (class Relocate, class Scan): Inherit Track_tls.
2076 (Target_powerpc::Scan::local, global): Track tls optimization
2077 and avoid creating plt entry for __tls_get_addr if all uses
2078 are optimized away.
2079 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2080
d8f5a274
AM
20812012-12-12 Alan Modra <amodra@gmail.com>
2082
2083 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2084 Replace no_toc_optimize with toc_optimize.
2085 * output.h (Output_section::input_sections): Provide non-const variant.
2086 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2087 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2088 accessors.
2089 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2090 (class Sort_toc_sections): New.
2091 (Target_powerpc::do_finalize_sections): Sort toc sections.
2092 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2093
4c8a1de1
RM
20942012-12-10 Roland McGrath <mcgrathr@google.com>
2095
2096 * testsuite/binary_unittest.cc (read_all): New function.
2097 (Sized_binary_test): Use it instead of ::read.
2098 * fileread.cc (do_read): Don't assume pread always reads the whole
2099 amount in a single call.
2100
edc27beb
AM
21012012-12-10 Alan Modra <amodra@gmail.com>
2102
2103 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2104 Set EM_PPC64 or EM_PPC here.
2105 (Target_selector_powerpc::do_recognize): Delete.
2106
906b9150
AM
21072012-12-10 Alan Modra <amodra@gmail.com>
2108
2109 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2110 stub_table_.
2111 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2112
418c15ae
RM
21132012-12-07 Roland McGrath <mcgrathr@google.com>
2114
2115 * testsuite/binary_unittest.cc (Sized_binary_test):
2116 Use open_descriptor rather than ::open.
2117
decdd3bc
AM
21182012-12-07 Alan Modra <amodra@gmail.com>
2119
2120 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2121 typedef and invalid_address constant.
2122 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2123 instantiate constants.
2124
db399005
ILT
21252012-12-06 Roland McGrath <mcgrathr@google.com>
2126
2127 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2128 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2129 * aclocal.m4: Regenerate.
2130 * configure: Regenerate.
2131 * Makefile.in: Regenerate.
2132 * testsuite/Makefile.in: Regenerate.
2133
aba6bc71
AM
21342012-12-07 Alan Modra <amodra@gmail.com>
2135
2136 * options.h (General_options): Add no_toc_optimize.
2137 * powerpc.cc (ok_lo_toc_insn): New function.
2138 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2139
9e69ed50
AM
21402012-12-06 Alan Modra <amodra@gmail.com>
2141
2142 * options.h (General_options): Add plt_align, plt_static_chain,
2143 plt_thread_safe. Update stub_group_size help text.
2144 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2145 for new plt_thread_safe_ var.
2146 (use_plt_offset): Correct comments.
2147 (Target_powerpc::do_relax): Look for thread creation symbols to
2148 determine default plt_thread_safe value. Clear plt call stubs
2149 as well as branch stubs each iteration.
2150 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2151 insn constants.
2152 (l, hi, ha, write_insn): Move earlier.
2153 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2154 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2155 plt stubs too.
2156 (Stub_table::update_size): Adjust.
2157 (Stub_table::prev_size, set_prev_size): Delete.
2158 (Stub_table::stub_align): Let --plt-align affect result.
2159 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2160 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2161 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2162 (Stub_table::do_write): Support more stub variants.
2163
f43ba157
AM
21642012-12-04 Alan Modra <amodra@gmail.com>
2165
2166 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2167 (Target_powerpc::do_define_standard_symbols): New function.
2168
34171bc5
AM
21692012-12-03 Alan Modra <amodra@gmail.com>
2170
2171 * output.h: Formatting, whitespace.
2172
dc9589e9 21732012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2174
2175 * layout.h (Layout::get_executable_sections): Declare.
2176 * layout.cc (Layout::get_executable_sections): New function.
2177 * arm.cc (Target_arm::group_sections): Use it.
2178 (Arm_output_section::group_sections): Delete now redundant test.
2179 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2180 param to handle relative relocs.
2181 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2182 (Output_data_reloc::add_absolute): Adjust.
2183 (Output_data_reloc::add_relative): New function.
2184 (Output_data::reset_data_size): New function.
2185 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2186 (Output_section::set_addralign): New function.
2187 (Output_section::checkpoint_set_addralign): New function.
2188 (Output_section::clear_section_offsets_need_adjustment): New function.
2189 (Output_section::input_sections): Make public.
2190 * powerpc.cc (class Output_data_brlt_powerpc): New.
2191 (class Stub_table, class Stub_control): New.
2192 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2193 stub_table_, set_stub_table, stub_table): New vectors and accessor
2194 functions.
2195 (Target_powerpc::do_may_relax, do_relax, push_branch,
2196 new_stub_table, stub_tables, brlt_section, group_sections,
2197 add_branch_lookup_table, find_branch_lookup_table,
2198 write_branch_lookup_table, make_brlt_section): New functions.
2199 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2200 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2201 branch_info_): New vars.
2202 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2203 make call stubs here.
2204 (Output_data_glink): Remove all call stub handling from this class.
2205 (Target_powerpc::Scan::local, global): Save interesting branch
2206 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2207 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2208 functions on final link.
2209 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2210 Handle long branch destinations too.
2211 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2212 do_plt_address_for_local): Adjust lookup of plt call stubs.
2213
627b30b7
AM
22142012-11-30 Alan Modra <amodra@gmail.com>
2215
2216 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2217 relocs against protected symbols when building 32-bit shared libs.
2218
40b469d7
AM
22192012-11-30 Alan Modra <amodra@gmail.com>
2220
2221 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2222 param. Call got_section() to make .got. Update all callers
2223 and their callers and so on.
2224
bb66a627
AM
22252012-11-30 Alan Modra <amodra@gmail.com>
2226
2227 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2228 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2229 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2230 value if it already exists.
2231
d2cf1c6c
L
22322012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2233
2234 PR gold/14858
2235 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2236
edccdf7c
RM
22372012-11-14 Roland McGrath <mcgrathr@google.com>
2238
2239 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2240 than bfc instruction for data sandboxing.
2241
6febeb74
AM
22422012-11-08 Alan Modra <amodra@gmail.com>
2243
2244 * po/POTFILES.in: Regenerate.
2245
0a6f1bf2
AM
22462012-11-05 Alan Modra <amodra@gmail.com>
2247
2248 * configure.ac: Apply 2012-09-10 change to config.in here.
2249 * configure: Regenerate.
2250
26a4e9cb
AM
22512012-11-05 Alan Modra <amodra@gmail.com>
2252
2253 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2254 (struct Opd_ent): Use "Address" rather than "Offset".
2255 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2256 (Target_powerpc::got_section): Make public.
2257 (Target_powerpc::scan_relocs): Move code setting symbols..
2258 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2259 Create _SDA_BASE_ only when referenced.
2260
cc928013
RM
22612012-11-02 Roland McGrath <mcgrathr@google.com>
2262
2263 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2264 from last change.
2265
50ed5eb1
RM
22662012-11-01 Roland McGrath <mcgrathr@google.com>
2267
62fe925a
RM
2268 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2269 for offset_in_output_section parameter.
2270 (Sized_target::relocate_special_relocatable): Likewise.
2271 * arm.cc (Target_arm::relocate_relocs): Likewise.
2272 (Target_arm::relocate_special_relocatable): Likewise.
2273 * i386.cc (Target_i386::relocate_relocs): Likewise.
2274 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2275 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2276 * target-reloc.h (relocate_relocs): Likewise.
2277 * testsuite/testfile.cc (Target_test): Likewise.
2278 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2279 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2280
2281 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2282 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2283
2284 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2285 parameter, which is unused in the [!F_SETFD] case.
2286
50ed5eb1
RM
2287 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2288 SYMNDX to off_t before comparing it to this->data_size().
2289 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2290 * incremental.cc (Output_section_incremental_inputs::do_write):
2291 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2292
2cadc0bf
RM
2293 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2294
3bfcb652
NC
22952012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2296
2297 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2298 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2299 in EABI_VER5.
2300
c1a8d56e
CC
23012012-10-29 Cary Coutant <ccoutant@google.com>
2302
2303 * dwp.cc (usage): Add file and exit status parameters;
2304 add --help and --version options.
2305 (print_version): New function.
2306 (main): Add --help and --version options.
2307
b2490a7b
L
23082012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2309
2310 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2311 final_layout_sequence.txt.
2312 * testsuite/Makefile.in: Regenerated.
2313
aa543512
L
23142012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2315
2316 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2317 COMPILE generated by automake.
2318 (LINK1): Likewise.
2319 (CXXCOMPILE1): Likewise.
2320 (CXXLINK1): Likewise.
2321 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2322 (LINK): Likewise.
2323 (CXXCOMPILE): Likewise.
2324 (CXXLINK): Likewise.
2325 * testsuite/Makefile.in: Regenerated.
2326
d361fafb
L
23272012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2328
2329 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2330 on bad fwrite return.
2331
598c7410
L
23322012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2333
2334 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2335 on val.
2336
35c813e2
CC
23372012-10-23 Cary Coutant <ccoutant@google.com>
2338
2339 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2340 * testsuite/Makefile.in: Regenerate.
2341 * testsuite/dwp_test.h: New source file.
2342 * testsuite/dwp_test_1.cc: New source file.
2343 * testsuite/dwp_test_1.s: New source file.
2344 * testsuite/dwp_test_1.sh: New source file.
2345 * testsuite/dwp_test_1b.cc: New source file.
2346 * testsuite/dwp_test_1b.s: New source file.
2347 * testsuite/dwp_test_2.cc: New source file.
2348 * testsuite/dwp_test_2.s: New source file.
2349 * testsuite/dwp_test_2.sh: New source file.
2350 * testsuite/dwp_test_main.cc: New source file.
2351 * testsuite/dwp_test_main.s: New source file.
2352
77429909
CC
23532012-10-23 Cary Coutant <ccoutant@google.com>
2354
2355 * dwp.h: New header file.
2356 * dwp.cc: New source file.
2357 * gold.h: Move shared declarations to system.h.
2358 * system.h: New header file.
2359 * Makefile.am: Add dwp.
2360 * Makefile.in: Regenerate.
2361
ed5d6712
CC
23622012-10-23 Cary Coutant <ccoutant@google.com>
2363
2364 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2365 Dwarf_info_reader::read_from_pointer.
2366 (Dwarf_pubnames_table::read_header): Likewise.
2367 (Dwarf_pubnames_table::next_name): Likewise.
2368 (Dwarf_die::read_attributes): Likewise.
2369 (Dwarf_die::skip_attributes): Likewise.
2370 (Dwarf_info_reader::read_from_pointer): New function template.
2371 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2372 (Dwarf_pubnames_table): Likewise.
2373 (Dwarf_info_reader::read_from_pointer): New function template.
2374 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2375 Dwarf_pubnames_table ctor.
2376
8787852d
CC
23772012-10-23 Cary Coutant <ccoutant@google.com>
2378
2379 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2380 abbrev_shndx.
2381 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2382 abbrev_shndx_.
2383 (Dwarf_info_reader::set_abbrev_shndx): New method.
2384 (Dwarf_info_reader::abbrev_shndx_): New data member.
2385
9fc236f3
CC
23862012-10-23 Cary Coutant <ccoutant@google.com>
2387
2388 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2389 from object, not parameters.
2390 (Dwarf_info_reader::parse): Likewise.
2391 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2392 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2393 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2394 methods.
2395
effe8365
CC
23962012-10-23 Cary Coutant <ccoutant@google.com>
2397
2398 * fileread.cc (Input_file::Input_file): New constructor.
2399 * fileread.h (class Input_file): Add new constructor.
2400
1698990d
AM
24012012-10-18 Alan Modra <amodra@gmail.com>
2402
2403 PR gold/14727
2404 * object.cc (Relobj::is_section_name_included): Also match
2405 .sdata personality section.
2406
168a4726
AM
24072012-10-18 Alan Modra <amodra@gmail.com>
2408
2409 * target-reloc.h (class Default_comdat_behavior): New, package up..
2410 (get_comdat_behaviour): ..this.
2411 (relocate_section): Add Relocate_comdat_behavior template arg,
2412 adjust code to suit.
2413 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2414 (Target_arm::scan_reloc_section): Likewise.
2415 * i386.cc (Target_i386::relocate_section): Likewise.
2416 * sparc.cc (Target_sparc::relocate_section): Likewise.
2417 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2418 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2419 * powerpc.cc (class Relocate_comdat_behavior): New.
2420 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2421 gold::relocate_section with new template arg.
2422
acc276d8
AM
24232012-10-18 Alan Modra <amodra@gmail.com>
2424
2425 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2426 dynamic relocs for GOT_TPREL got entries, without symbol if
2427 resolving locally.
2428 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2429 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2430 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2431
e10f9870
AM
24322012-10-17 Alan Modra <amodra@gmail.com>
2433
2434 PR gold/14726
2435 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2436
ae034989
ST
24372012-10-16 Sriraman Tallam <tmsriram@google.com>
2438
2439 * layout.cc (Layout::include_section): Keep sections marked
2440 SHF_EXCLUDE when doing relocatable links.
2441
f3a0ed29
AM
24422012-10-16 Alan Modra <amodra@gmail.com>
2443
2444 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2445 (Target_powerpc::do_finalize_sections): Call it.
2446 (Output_data_save_res): New class and supporting functions.
2447 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2448 normal symbols defined in object files.
2449
c6de8ed4
AM
24502012-10-12 Alan Modra <amodra@gmail.com>
2451
2452 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2453 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2454 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2455 section if scan_opd_relocs not yet called.
2456 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2457
03e25981
AM
24582012-10-12 Alan Modra <amodra@gmail.com>
2459
2460 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2461 add_local_ifunc_entry): Revert last change.
2462 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2463
c9824451
AM
24642012-10-05 Alan Modra <amodra@gmail.com>
2465
2466 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2467 do_plt_address_for_global): New functions.
2468 (Output_data_got_powerpc::do_write): Don't segfault when linking
2469 statically.
2470 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2471 add_local_ifunc_entry): Return true on adding entry..
2472 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2473 glink->add_entry call. Remove unused symtab param. Adjust calls.
2474 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2475 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2476 set up symbols here.
2477 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2478 syms here. Do so even when no .iplt. Don't segfault when linking
2479 statically.
2480 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2481 new variants without reloc param.
2482 (Glink_sym_ent::Glink_sym_ent): Likewise.
2483 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2484 reloc when refs will resolve to plt call stub.
2485 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2486 R_PPC_PLTREL24 to resolve locally.
2487 (Target_powerpc::Scan::global): Correct ifunc handling.
2488 (Target_powerpc::Relocate::relocate): Correct local sym glink
2489 lookup. Don't destroy "value" when we have a plt call stub,
2490 and when checking plt call validity.
2491 (Target_powerpc::do_dynsym_value): Simplify.
2492
19fec8c1
AM
24932012-10-05 Alan Modra <amodra@gmail.com>
2494
2495 * i386.cc (Output_data_plt_i386::address_for_global,
2496 address_for_local): Add plt offset to returned value. Adjust uses.
2497 * sparc.cc (Output_data_plt_sparc::address_for_global,
2498 address_for_local): Likewise.
2499 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2500 address_for_local): Likewise.
2501 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2502 address_for_local): Likewise.
2503 * target.h (Target::plt_address_for_global, plt_address_for_local):
2504 Update comment.
2505 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2506 (Output_data_got::Got_entry::write): Nor here.
2507 * output.h: Comment fix.
2508
e867b647
WL
25092012-10-02 Jiong Wang <jiwang@tilera.com>
2510
2511 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2512 global_offset_table_ value for larget got.
2513 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2514
e5d5f5ed
AM
25152012-09-29 Alan Modra <amodra@gmail.com>
2516
2517 * powerpc.cc (Target_powerpc::iplt_): New output section.
2518 (Target_powerpc::iplt_section, make_iplt_section,
2519 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2520 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2521 Target_powerpc::plt_entry_count): Count iplt entries too.
2522 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2523 reloc section in constructor. New params.
2524 (Target_powerpc::make_plt_section): Create reloc section here instead.
2525 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2526 functions.
2527 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2528 (Output_data_glink::add_entry, find_entry): New functions to
2529 deal with local syms.
2530 (Glink_sym_ent): Add support for local syms.
2531 (Output_data_glink::do_write): Handle ifunc plt entries.
2532 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2533 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2534 (Target_powerpc::Relocate::relocate): Likewise.
2535 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2536
ec4dbad3
AM
25372012-09-25 Alan Modra <amodra@gmail.com>
2538
2539 * object.h (Sized_relobj_file::adjust_local_symbol,
2540 do_adjust_local_symbol): New functions.
2541 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2542 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2543 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2544 and irregular opd entry spacing.
2545 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2546 (Global_symbol_visitor_opd): New functor.
2547 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2548 on deleted opd entries.
2549
5c0b3823
WL
25502012-09-15 Jiong Wang <jiwang@tilera.com>
2551
2552 * tilegx.cc: New file.
2553 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2554 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2555 * configure.tgt: Add entries for tilegx*.
2556 * configure.ac: Likewise.
2557 * Makefile.in: Rebuild.
2558 * configure: Likewise.
2559 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2560 tilegx.
2561
bfdfa4cd
AM
25622012-09-13 Alan Modra <amodra@gmail.com>
2563
2564 * target-reloc.h (scan_relocs): Call scan.local for relocs
2565 against symbols in discarded sections. Pass is_discarded
2566 param.
2567 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2568 Add is_discarded param.
2569 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2570 is_discarded to flag opd entry as discarded. Don't emit dyn
2571 relocs on such entries.
2572 (Target_powerpc::Scan::global): Similarly detect and handle
2573 such opd entries.
2574 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2575 opd_ent_. Update all uses.
2576 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2577 (Target_powerpc::relocate_section): Zero out discarded opd
2578 entry relocs.
2579
d77a0555
ILT
25802012-09-12 Ian Lance Taylor <iant@google.com>
2581
2582 PR gold/14570
2583 * output.cc: Rename Output_data_got template parameter from size
2584 to got_size for all functions. Compile all variants of
2585 Output_data_got.
2586 (Output_data_got::Got_entry::write): Correct use of size for
2587 symbol value. Use local_is_tls rather than casting to
2588 Sized_relobj_file.
2589 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2590 (class Sized_relobj_file): Add do_local_is_tls.
2591 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2592
815a1205
AM
25932012-09-11 Alan Modra <amodra@gmail.com>
2594
2595 PR gold/14566
2596 * layout.cc (Layout::set_segment_offsets): When using
2597 common-page-size alignment, ensure we are on a new max-page-size
2598 page.
2599 * output.cc (Output_segment::set_section_addresses): Use
2600 abi_pagesize, not common_pagesize for relro boundary.
2601 (Output_segment::set_offset): Likewise.
2602
bd73a62d
AM
26032012-09-11 Alan Modra <amodra@gmail.com>
2604
2605 * output.h (Output_data_got::add_global_tls, add_local_tls,
2606 add_local_tls_pair): New functions.
2607 (Output_data_got::add_local_pair_with_rel): Remove second
2608 reloc param. Expand comment.
2609 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2610 use_plt_or_tls_offset_, similarly for constructor param.
2611 (Output_data_got::Got_entry::write): Add got_index param.
2612 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2613 add_local_tls_pair): New functions.
2614 (Output_data_got::Got_entry::write): Handle tls symbols
2615 with use_plt_or_tls_offset_ set specially.
2616 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2617 (Output_data_got::do_write): Replace iterator with index, pass
2618 index to entry write function.
2619 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2620 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2621 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2622 call.
2623 * i386.cc (Target_i386::Scan::local): Likewise.
2624 * sparc.cc (Target_sparc::Scan::local): Likewise.
2625 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2626 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2627 do_tls_offset_for_global): New functions.
2628 (Target_powerpc::Scan::local): Correct TLS relocations and got
2629 entry values.
2630 (Target_powerpc::Scan::global): Don't emit unnecessary
2631 dynamic relocations on TLS GOT entries.
2632
00716ab1
AM
26332012-09-10 Matthias Klose <doko@ubuntu.com>
2634
2635 * config.in: Disable sanity check for kfreebsd.
2636
c891b3f9
SA
26372012-09-10 Sterling Augustine <saugustine@google.com>
2638
2639 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2640 (Gdb_index::pubtypes_read): New parameter.
2641 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2642 to calls.
2643 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2644 pubtypes_object_.
2645
e81fea4d
AM
26462012-09-09 Alan Modra <amodra@gmail.com>
2647
2648 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2649 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2650 * gc.h (gc_process_relocs): Call target gc_add_reference.
2651 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2652 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2653 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2654 unnecessary cast.
2655 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2656 to cater for when we don't need code offset. Update use.
2657 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2658 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2659 set_opd_valid): New functions.
2660 (Target_powerpc::do_gc_add_reference): New function.
2661 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2662 stashed refs.
2663 (Target_powerpc::do_gc_mark_symbol): New function.
2664
d2d60eef
CC
26652012-09-06 Cary Coutant <ccoutant@google.com>
2666
2667 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2668 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2669 (Dwarf_die::skip_attributes): Likewise.
2670 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2671 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2672 (main): Call it.
2673 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2674
32ed4573
L
26752012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2676
2677 * testsuite/script_test_3.t: Add .got.plt output section
2678 statement.
2679 * testsuite/script_test_4.t: Likewise.
2680
f4baf0d4
AM
26812012-09-05 Alan Modra <amodra@gmail.com>
2682
2683 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2684 update all uses and lose "enum" when using type.
2685
864a1b56
AM
26862012-09-05 Alan Modra <amodra@gmail.com>
2687
2688 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2689 * configure: Regenerate.
2690 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2691 (plugin_final_layout.stdout): Likewise.
2692 (memory_test): Set page sizes to 0x1000.
2693 * testsuite/Makefile.in: Regenerate.
2694 * testsuite/discard_locals_test.sh: Add FIXME comment.
2695 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2696 * testsuite/pr14265.t: Add .got output section statement.
2697 * testsuite/script_test_2.t: Likewise.
2698 * testsuite/script_test_3.t: Likewise.
2699 * testsuite/script_test_4.t: Likewise.
2700 * testsuite/script_test_5.t: Likewise.
2701 * testsuite/script_test_6.t: Likewise.
2702 * testsuite/script_test_7.t: Likewise.
2703 * testsuite/script_test_9.t: Likewise.
2704
3ea0a085
AM
27052012-09-05 Alan Modra <amodra@gmail.com>
2706
2707 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2708 (Powerpc_relocate_functions::Status): New typedef.
2709 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2710 (Target_powerpc::Scan::local): Handle REL64.
2711 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2712 for REL32 and REL64.
2713 (Target_powerpc::symval_for_branch): New function, extracted from..
2714 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2715 checks. Report overflow errors.
2716
7404fe1b
AM
27172012-09-05 Alan Modra <amodra@gmail.com>
2718
2719 * object.h (Sized_relobj_file::emit_relocs): Delete.
2720 (Sized_relobj_file::emit_relocs_reltype): Delete.
2721 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2722 relocate_relocs for --emit-relocs.
2723 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2724 * output.h: Update comment.
2725 (Output_segment::first_section): New function.
2726 (Output_segment::first_section_load_address): Use first_section.
2727 * output.cc (Output_segment::first_section): New function extracted..
2728 (Output_segment::first_section_load_address): ..from here. Delete.
2729 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2730 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2731 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2732 adjust call to target.h function.
2733 * i386.cc (Target_i386): Likewise.
2734 * sparc.cc (Target_sparc): Likewise.
2735 * x86_64.cc (Target_x86_64): Likewise.
2736 * powerpc.cc (Target_powerpc): Likewise.
2737 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2738 first tls section has section symbol for optimised local dynamic
2739 output relocs.
2740 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2741 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2742 optimised tls code.
2743 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2744 Rename to relocate_relocs. Update error message.
2745
957564c9
AS
27462012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2747
2748 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2749 --just-symbols.
2750
dd93cd0a
AM
27512012-08-31 Alan Modra <amodra@gmail.com>
2752
2753 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2754 (Powerpc_relobj::toc_base_offset): New stub function.
2755 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2756 got_mod_index_offset to tlsld_got_offset. Update all refs.
2757 (Target_powerpc::Relocate::enum skip_tls): New.
2758 (Target_powerpc::call_tls_get_addr_): New var.
2759 (Target_powerpc::is_branch_reloc): Move to file scope.
2760 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2761 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2762 New functions.
2763 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2764 (powerpc_info): Correct common_pagesize for ppc64.
2765 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2766 (Powerpc_relocate_functions): Add overflow check enums and functions.
2767 Add non-shift version of rela, rela_ua. Delete all rel public
2768 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2769 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2770 addr16_ha3, addr14 functions.
2771 (Output_data_got_powerpc::add_constant_pair): New function.
2772 (Output_data_got_powerpc::got_base_offset): Likewise.
2773 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2774 (instruction constants): Sort, add some more.
2775 (Output_data_glink::do_write): Add and use Address typedef. Use
2776 object->toc_base_offset() stub for 64-bit.
2777 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2778 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2779 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2780 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2781 Always treat .opd relocs as against locally defined symbol.
2782 Correct condition for RELATIVE relocs.
2783 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2784 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2785 for 32-bit syms with a plt entry. Correct ppc64 toc base
2786 calculations. Handle TLS relocs, and more. Add overflow
2787 checking and adjust for Powerpc_relocate_functions changes.
2788 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2789 Reinstate --emit-relocs code with FIXME.
2790
a1373b60
AM
27912012-08-30 Alan Modra <amodra@gmail.com>
2792
2793 * layout.cc (Layout::set_segment_offsets): Set p_align to
2794 abi_pagesize, not common_pagesize.
2795 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2796 to determine whether file header can go in segment.
2797
703d02da
AM
27982012-08-30 Alan Modra <amodra@gmail.com>
2799
2800 * output.h (Output_reloc::Output_reloc <output section>): Add
2801 is_relative param. Adjust calls.
2802 (Output_reloc::add_output_section_relative): New functions.
2803 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2804 is_relative.
2805 (Output_reloc::symbol_value): Handle SECTION_CODE.
2806
16164a6b
ST
28072012-08-24 Sriraman Tallam <tmsriram@google.com>
2808
2809 * gold.cc (queue_middle_tasks): Call layout again when unique
2810 segments for sections is desired.
2811 * layout.cc (Layout::Layout): Initialize new members.
2812 (Layout::get_output_section_flags): New function.
2813 (Layout::choose_output_section): Call get_output_section_flags.
2814 (Layout::layout): Make output section for mapping to a unique segment.
2815 (Layout::insert_section_segment_map): New function.
2816 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2817 output sections marked so.
16164a6b
ST
2818 (Layout::segment_precedes): Check for unique segments when sorting.
2819 * layout.h (Layout::Unique_segment_info): New struct.
2820 (Layout::Section_segment_map): New typedef.
2821 (Layout::insert_section_segment_map): New function.
2822 (Layout::get_output_section_flags): New function.
2823 (Layout::is_unique_segment_for_sections_specified): New function.
2824 (Layout::set_unique_segment_for_sections_specified): New function.
2825 (Layout::unique_segment_for_sections_specified_): New member.
2826 (Layout::section_segment_map_): New member.
2827 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2828 Rename is_gc_pass_one to is_pass_one.
2829 Rename is_gc_pass_two to is_pass_two.
2830 Rename is_gc_or_icf to is_two_pass.
2831 Check for which pass based on whether symbols data is present.
2832 Make it two pass when unique segments for sections is desired.
2833 * output.cc (Output_section::Output_section): Initialize new
2834 members.
2835 * output.h (Output_section::is_unique_segment): New function.
2836 (Output_section::set_is_unique_segment): New function.
2837 (Output_section::is_unique_segment_): New member.
2838 (Output_section::extra_segment_flags): New function.
2839 (Output_section::set_extra_segment_flags): New function.
2840 (Output_section::extra_segment_flags_): New member.
2841 (Output_section::segment_alignment): New function.
2842 (Output_section::set_segment_alignment): New function.
2843 (Output_section::segment_alignment_): New member.
2844 (Output_segment::Output_segment): Initialize is_unique_segment_.
2845 (Output_segment::is_unique_segment): New function.
2846 (Output_segment::set_is_unique_segment): New function.
2847 (Output_segment::is_unique_segment_): New member.
2848 * plugin.cc (allow_unique_segment_for_sections): New function.
2849 (unique_segment_for_sections): New function.
2850 (Plugin::load): Add new functions to transfer vector.
2851 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2852 * Makefile.in: Regenerate.
2853 * testsuite/plugin_final_layout.sh: Check if unique segment
2854 functionality works.
2855 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2856 are available.
2857 (allow_unique_segment_for_sections): New global.
2858 (unique_segment_for_sections): New global.
2859 (claim_file_hook): Call allow_unique_segment_for_sections.
2860 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2861
1e2bee4f
CC
28622012-08-22 Cary Coutant <ccoutant@google.com>
2863
2864 * layout.cc (Layout::include_section): Don't assert on GROUP
2865 sections with --emit-relocs.
2866
1d5dfe78
CC
28672012-08-21 Cary Coutant <ccoutant@google.com>
2868
2869 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2870 if --export-dynamic-symbol names an undef symbol.
2871
c9269dff
AM
28722012-08-18 Alan Modra <amodra@gmail.com>
2873
2874 * powerpc.cc: Formatting and white space.
2875 (Powerpc_relobj): Rename got2_section_ to special_.
2876 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2877 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2878 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2879 (Target_powerpc): Add Address typedef and invalid_address. Use
2880 throughout.
2881 (Target_powerpc::is_branch_reloc): New function.
2882 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2883 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2884 for dst_mask, value and addend.
2885 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2886 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2887 (Output_data_glink::do_write): Correct toc base. Don't try to use
2888 uint16_t for 24-bit offset. Use get_output_section_offset and
2889 check return.
2890 (Target_powerpc::Scan::local): Handle more relocs.
2891 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2892 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2893 Plug in toc restoring insn after plt calls. Translate branches
2894 to function descriptor symbols to corresponding entry point.
2895 (Target_powerpc::relocate_for_relocatable): Check return from
2896 get_output_section_offset.
2897 * symtab.h: Comment typo.
2898
b1759dce
ILT
28992012-08-14 Ian Lance Taylor <iant@google.com>
2900
2901 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2902 unsupported_relocal_local to call unsupported_reloc_global.
2903
b9b2ae8b
NC
29042012-08-14 Nick Clifton <nickc@redhat.com>
2905
2906 PR ld/14265
2907 * script-sections.cc (Sections_element::output_section_name): Add
2908 keep return parameter.
2909 (Output_section_element::match_name): Add keep return parameter.
2910 Return the value of the keep_ member.
2911 * script-sections.h (class Output_section): Update
2912 output_section_name prototype.
2913 * layout.cc (Layout::keep_input_section): New public member
2914 function.
2915 (Layout::choose_output_section): Pass keep parameter to
2916 output_section_name.
2917 * layout.h (class Layout): Add keep_input_section.
2918 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2919 sections.
2920 * testsuite/Makefile.am: Add a test.
2921 * testsuite/Makefile.in: Regenerate.
2922 * testsuite/pr14265.c: Source file for the test.
2923 * testsuite/pr14265.t: Linker script for the test.
2924 * testsuite/pr14265.sh: Shell script for the test.
2925
921b5322
AM
29262012-08-14 Alan Modra <amodra@gmail.com>
2927
2928 * target.h (Target::output_section_name): New function.
2929 (Target::do_output_section_name): New function.
2930 * layout.cc (Layout::choose_output_section): Call the above.
2931 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2932
6ce78956
AM
29332012-08-14 Alan Modra <amodra@gmail.com>
2934
2935 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2936 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2937 for replace_constant call.
2938 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2939 (Output_data_glink::do_print_to_mapfile): New function.
2940 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2941 (Target_powerpc::Relocate::relocate): Likewise.
2942
d1a8cabd
AM
29432012-08-14 Alan Modra <amodra@gmail.com>
2944
2945 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2946 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2947 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2948 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2949 all references to shndx_. Handle special case for R_PPC_PLTREL24
2950 here.
2951 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2952 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2953 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2954 here.
2955 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2956 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2957
d83ce4e3
AM
29582012-08-12 Alan Modra <amodra@gmail.com>
2959
2960 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2961 (glink insn constants): Use uint32_t.
2962 (Output_data_glink::add_entry): Use insert, not [] operator.
2963
cf43a2fe
AM
29642012-08-11 Alan Modra <amodra@gmail.com>
2965
2966 * object.h (Sized_relobj_file::find_shdr): New function.
2967 (Sized_relobj_file::find_special_sections): New function.
2968 * object.cc (Sized_relobj_file::find_shdr): New function.
2969 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2970 (Sized_relobj_file::find_special_sections): New function, split out..
2971 (Sized_relobj_file::do_read_symbols): ..from here.
2972 * output.h (Output_data_got::replace_constant): New function.
2973 (Output_data_got::num_entries): New function.
2974 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2975 (Output_data_got::got_offset): Protected rather than private.
2976 (Output_data_got::replace_got_entry): New function.
2977 * output.cc (Output_data_got::replace_got_entry): New function.
2978 * powerpc.cc (class Powerpc_relobj): New.
2979 (class Powerpc_relocate_functions): Delete all psymval variants or
2980 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2981 Implement _ha functions using corresponding _hi function.
2982 (Powerpc_relobj::find_special_sections): New function.
2983 (Target_powerpc::do_make_elf_object): New function.
2984 (class Output_data_got_powerpc): New.
2985 (class Output_data_glink): New.
2986 (class Powerpc_scan_relocatable_reloc): New.
2987 Many more changes througout file.
2988
3c892704
NC
29892012-08-09 Nick Clifton <nickc@redhat.com>
2990
2991 * po/vi.po: Updated Vietnamese translation.
2992
82435b3b
ILT
29932012-08-07 Ian Lance Taylor <iant@google.com>
2994
2995 * layout.cc (Layout::add_target_dynamic_tags): If
2996 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2997 plt_rel.
2998
a6dc81d2
NC
29992012-07-30 Nick Clifton <nickc@redhat.com>
3000
3001 * po/gold.pot: Updated template.
3002 * po/es.po: Updated Spanish translation.
3003
f1415016
CC
30042012-07-18 Cary Coutant <ccoutant@google.com>
3005
3006 PR gold/14344
3007 * configure.ac: Add check for -gpubnames support.
3008 * configure: Regenerate.
3009 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3010 support; force -gno-pubnames.
3011 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3012 support.
3013 (gdb_index_test_4): New test.
3014 * testsuite/Makefile.in: Regenerate.
3015 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3016 * testsuite/gdb_index_test_2.sh: Likewise.
3017 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3018 * testsuite/gdb_index_test_4.sh: New script.
3019 * testsuite/gdb_index_test_comm.sh: New script with common code;
3020 don't look for space after colon.
3021
b7fd7c37
ST
30222012-07-16 Sriraman Tallam <tmsriram@google.com>
3023
3024 * gold.cc (queue_middle_tasks): Update function order only after
3025 deferred objects due to plugins are processed.
3026
1f3212db
ILT
30272012-07-11 Ian Lance Taylor <iant@google.com>
3028
3029 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3030 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3031 (Target_arm::scan_reloc_for_stub): Likewise.
3032 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3033 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3034 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3035 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3036 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3037
81c82a68
ILT
30382012-07-10 Dodji Seketeli <dodji@redhat.com>
3039 Ian Lance Taylor <iant@google.com>
3040
3041 PR gold/14309
3042 * configure.ac: Test whether std::tr1::hash<off_t> works.
3043 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3044 needed.
3045 * output.h (class Output_fill): Add virtual destructor.
3046 * configure, config.in: Rebuild.
3047
eabc84f4
RM
30482012-06-22 Roland McGrath <mcgrathr@google.com>
3049
3050 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3051
370e30b6
RÁE
30522012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3053
3054 * plugin.cc (Plugin::load): Handle position independent executables.
3055
fb1b895d
CC
30562012-06-06 Cary Coutant <ccoutant@google.com>
3057
3058 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3059 add .debug_macro.
3060 (lines_only_debug_sections): Likewise.
3061 (gdb_fast_lookup_sections): New static array.
3062 (is_gdb_debug_section): Rename formal parameter.
3063 (is_lines_only_debug_section): Likewise.
3064 (is_gdb_fast_lookup_section): New function.
3065 (Layout::include_section): Check for ".zdebug_" prefix; pass
3066 section name suffix to is_gdb_debug_section, et al.; check for
3067 fast-lookup sections when building .gdb_index.
3068 * options.h (--strip-debug-gdb): Update GDB version number.
3069
7c0640fa
CC
30702012-06-06 Cary Coutant <ccoutant@google.com>
3071
3072 * configure.ac: Add check for fallocate.
3073 * configure: Regenerate.
3074 * config.in: Regenerate.
3075
3076 * options.h (class General_options): Add --mmap-output-file and
3077 --posix-fallocate options.
3078 * output.cc: (posix_fallocate): Remove; replace with...
3079 (gold_fallocate): New function.
3080 (Output_file::map_no_anonymous): Call gold_fallocate.
3081 (Output_file::map): Check --mmap-output-file option.
3082
2a49eb69
DK
30832012-06-05 Jing Yu <jingyu@google.com>
3084
3085 * gold.h (textdomain): Add do {} to empty while(0).
3086 (bindtextdomain): Likewise.
3087
fad072ac
CC
30882012-06-04 Cary Coutant <ccoutant@google.com>
3089
3090 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3091 has_dynsym_index.
3092
8cc69fb6
ST
30932012-05-25 Sriraman Tallam <tmsriram@google.com>
3094
3095 * symtab.cc (Symbol_table::define_special_symbol):
3096 Initialize *poldsym to prevent uninitialized variable errors.
3097
1be75daa
CC
30982012-05-23 Cary Coutant <ccoutant@google.com>
3099
3100 * layout.cc (Layout::section_name_mapping): Add rules to handle
3101 exact match on .data.rel.ro.local or .data.rel.ro.
3102 (Layout::output_section_name): Check for exact matches.
3103
9b689de0
CC
31042012-05-23 Cary Coutant <ccoutant@google.com>
3105
3106 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3107 more carefully.
3108
b24fdbf5
CC
31092012-05-22 Cary Coutant <ccoutant@google.com>
3110
3111 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3112 object before exporting symbol.
3113
e550e1a2
L
31142012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3115
3116 * testsuite/tls_test.cc: Include "config.h" first.
3117 * testsuite/tls_test_c.c: Likewise.
3118
df7b86aa
NC
31192012-05-17 Daniel Richard G. <skunk@iskunk.org>
3120 Nick Clifton <nickc@redhat.com>
3121
3122 PR 14072
3123 * configure.in: Add check that sysdep.h has been included before
3124 any system header files.
3125 * configure: Regenerate.
3126 * config.in: Regenerate.
3127
1007b503
CC
31282012-05-14 Cary Coutant <ccoutant@google.com>
3129
3130 * layout.cc (Layout::make_output_section): Mark .tdata section
3131 as RELRO.
3132 * testsuite/relro_test.cc: Add a TLS variable.
3133
fd885f3a
L
31342012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3135
3136 PR gold/14091
3137 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3138 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3139 R_X86_64_64.
3140
80f5885c
CC
31412012-05-08 Cary Coutant <ccoutant@google.com>
3142
3143 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3144 (lines_only_debug_sections): Likewise.
3145
2e702c99
RM
31462012-05-02 Roland McGrath <mcgrathr@google.com>
3147
3148 * nacl.cc: New file.
3149 * nacl.h: New file.
3150 * Makefile.am (CCFILES, HFILES): Add them.
3151 * Makefile.in: Regenerate.
3152 * i386.cc (Output_data_plt_i386_nacl): New class.
3153 (Output_data_plt_i386_nacl_exec): New class.
3154 (Output_data_plt_i386_nacl_dyn): New class.
3155 (Target_i386_nacl): New class.
3156 (Target_selector_i386_nacl): New class.
3157 (target_selector_i386): Use it instead of Target_selector_i386.
3158 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3159 (Target_x86_64_nacl): New class.
3160 (Target_selector_x86_64_nacl): New class.
3161 (target_selector_x86_64, target_selector_x32): Use it instead of
3162 Target_selector_x86_64.
3163 * arm.cc (Output_data_plt_arm_nacl): New class.
3164 (Target_arm_nacl): New class.
3165 (Target_selector_arm_nacl): New class.
3166 (target_selector_arm, target_selector_armbe): Use it instead of
3167 Target_selector_arm.
3168
3169 * target-select.cc (select_target): Take new Input_file* and off_t
3170 arguments, pass them on to recognize method of selector.
3171 * object.cc (make_elf_sized_object): Update caller.
3172 * parameters.cc (parameters_force_valid_target): Likewise.
3173 * incremental.cc (make_sized_incremental_binary): Likewise.
3174 * target-select.h: Update decl.
3175 (Target_selector::recognize): Take new Input_file* argument,
3176 pass it on to do_recognize.
3177 (Target_selector::do_recognize): Take new Input_file* argument.
3178 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3179 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3180 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3181 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3182
3183 * target.h (Target::Target_info): New members isolate_execinstr
3184 and rosegment_gap.
3185 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3186 * arm.cc (Target_arm::arm_info): Update initializer.
3187 * i386.cc (Target_i386::i386_info): Likewise.
3188 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3189 * sparc.cc (Target_sparc::sparc_info): Likewise.
3190 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3191 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3192 * layout.cc (Layout::attach_allocated_section_to_segment):
3193 Take new const Target* argument. If target->isolate_execinstr(), act
3194 like --rosegment.
3195 (Layout::find_first_load_seg): Take new const Target* argument;
3196 if target->isolate_execinstr(), reject PF_X segments.
3197 (Layout::relaxation_loop_body): Update caller.
3198 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3199 reset file offset to zero when we hit LOAD_SEG, and then do a second
3200 loop over the segments before LOAD_SEG to reassign offsets after
3201 addresses have been determined. Handle target->rosegment_gap().
3202 (Layout::attach_section_to_segment): Take new const Target* argument;
3203 pass it to attach_allocated_section_to_segment.
3204 (Layout::make_output_section): Update caller.
3205 (Layout::attach_sections_to_segments): Take new const Target* argument;
3206 pass it to attach_section_to_segment.
3207 * gold.cc (queue_middle_tasks): Update caller.
3208 * layout.h (Layout): Update method decls with new arguments.
3209
3210 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3211 Target_info pointer to use.
3212 (Target_arm::do_make_data_plt): New virtual method.
3213 (Target_arm::make_data_plt): New method that calls it.
3214 (Target_arm::make_plt_entry): Use it.
3215 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3216 for the section alignment.
3217 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3218 method.
3219 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3220 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3221 method.
3222 (Output_data_plt_arm::get_plt_entry_size): Call it.
3223 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3224 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3225 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3226 method.
3227 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3228 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3229 method instead of sizeof(plt_entry).
3230 (Output_data_plt_arm::add_entry): Likewise.
3231 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3232 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3233 than static method.
3234 (Target_arm::plt_entry_size): Likewise.
3235 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3236 Move to ...
3237 (Output_data_plt_arm_standard): ... here, new class.
3238 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3239 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3240 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3241
3242 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3243 Take additional argument for the PLT entry size.
3244 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3245 Use get_plt_entry_size method rather than plt_entry_size variable.
3246 (Output_data_plt_x86_64::reserve_slot): Likewise.
3247 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3248 (Output_data_plt_x86_64::add_entry): Likewise.
3249 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3250 (Output_data_plt_x86_64::address_for_global): Likewise.
3251 (Output_data_plt_x86_64::address_for_local): Likewise.
3252 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3253 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3254 Make method non-static.
3255 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3256 method.
3257 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3258 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3259 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3260 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3261 virtual method.
3262 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3263 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3264 virtual method.
3265 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3266 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3267 virtual method.
3268 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3269 (Output_data_plt_x86_64::plt_entry_size)
3270 (Output_data_plt_x86_64::first_plt_entry)
3271 (Output_data_plt_x86_64::plt_entry)
3272 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3273 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3274 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3275 (Output_data_plt_x86_64_standard): ... here, new class.
3276 (Target_x86_64::Target_x86_64): Take optional argument for the
3277 Target_info pointer to use.
3278 (Target_x86_64::do_make_data_plt): New virtual method.
3279 (Target_x86_64::make_data_plt): New method to call it.
3280 (Target_x86_64::init_got_plt_for_update): Use that.
3281 Call this->plt_->add_eh_frame method here.
3282 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3283 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3284 rather than static method.
3285 (Target_x86_64::plt_entry_size): Likewise.
3286 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3287 rather than plt_entry_size variable. Move guts of PLT filling to...
3288 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3289 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3290 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3291
3292 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3293 additional argument for the section alignment.
3294 Don't do add_eh_frame_for_plt here.
3295 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3296 non-static. Use get_plt_entry_size method rather than plt_entry_size
3297 variable.
3298 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3299 method.
3300 (Output_data_plt_i386::get_plt_entry_size): Call it.
3301 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3302 (Output_data_plt_i386::add_eh_frame): New method to call it.
3303 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3304 method.
3305 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3306 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3307 method.
3308 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3309 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3310 method instead of plt_entry_size.
3311 (Output_data_plt_i386::plt_entry_size)
3312 (Output_data_plt_i386::plt_eh_frame_fde_size)
3313 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3314 (Output_data_plt_i386_standard): ... here, new class.
3315 (Output_data_plt_i386_exec): New class.
3316 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3317 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3318 (Output_data_plt_i386::exec_plt_entry): Move to ...
3319 (Output_data_plt_i386_exec::plt_entry): ... here.
3320 (Output_data_plt_i386_dyn): New class.
3321 (Output_data_plt_i386::first_plt_entry): Move to ...
3322 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3323 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3324 (Output_data_plt_i386_dyn::plt_entry): ... here.
3325 (Target_i386::Target_i386): Take optional argument for the Target_info
3326 pointer to use.
3327 (Target_i386::do_make_data_plt): New virtual method.
3328 (Target_i386::make_data_plt): New method to call it.
3329 (Target_i386::make_plt_section): Use that.
3330 Call this->plt_->add_eh_frame method here.
3331 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3332 rather than plt_entry_size variable.
3333 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3334 (Output_data_plt_i386::address_for_local): Likewise.
3335 (Output_data_plt_i386::do_write): Likewise.
3336 Move guts of PLT filling to...
3337 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3338 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3339 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3340 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3341
b9b9f2ee
CC
33422012-05-01 Cary Coutant <ccoutant@google.com>
3343
3344 * dwarf_reader.cc (Dwarf_die::read_attributes)
3345 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3346 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3347 * reduced_debug_output.cc
3348 (Output_reduced_debug_info_section::get_die_end): Remove
3349 DW_FORM_GNU_ref_index. Add default case.
3350
57923f48
MW
33512012-04-26 Mark Wielaard <mjw@redhat.com>
3352
3353 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3354 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3355 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3356 DW_AT_high_pc as offset from DW_AT_low_pc.
3357
3358 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3359 * testsuite/Makefile.in: Regenerate.
3360 * testsuite/gdb_index_test_3.c: New test source file.
3361 * testsuite/gdb_index_test_3.sh: New test source file.
3362
2c54b4f4
ILT
33632012-04-25 Ian Lance Taylor <iant@google.com>
3364
3365 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3366 pointer.
3367 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3368 as a class, not a struct.
3369 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3370 (Target_arm::apply_cortex_a8_workaround): Likewise.
3371 * gc.h: Declare Reloc_types as a struct, not a class.
3372 * object.h: Declare Symbols_data as a struct.
3373 * reloc.h: Declare Read_relocs_data as a struct.
3374 * target.h: Declare Relocate_info as a struct.
3375
a5a5f7a3
DM
33762012-04-24 David S. Miller <davem@davemloft.net>
3377
3378 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3379 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3380 and R_SPARC_WPLT30.
3381
f038d496
CC
33822012-04-24 Cary Coutant <ccoutant@google.com>
3383
3384 * incremental-dump.cc (find_input_containing_global): Replace
3385 magic number with symbolic constant.
3386 (dump_incremental_inputs): Update version number.
3387 * incremental.cc (Output_section_incremental_inputs): Update version
3388 number; import symbolic constants from Incremental_inputs_reader.
3389 (Incremental_inputs::create_data_sections): Align relocations
3390 section correctly for 64-bit targets.
3391 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3392 constants; add padding.
3393 (Output_section_incremental_inputs::write_header): Add assert for
3394 header_size.
3395 (Output_section_incremental_inputs::write_input_files): Add assert
3396 for input_entry_size.
3397 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3398 add assert for object_info_size, input_section_entry_size,
3399 global_sym_entry_size.
3400 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3401 for data structure sizes; use them.
3402 (Incremental_input_entry_reader): Import symbolic constants from
3403 Incremental_inputs_reader; use them.
3404
a4d85145
DM
34052012-04-23 David S. Miller <davem@davemloft.net>
3406
3407 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3408 and elf_flags_set_.
3409 (Target_sparc::Target_sparc): Initialize new fields.
3410 (Target_sparc::do_make_elf_object): New function.
3411 (Target_sparc::do_adjust_elf_header): New function.
3412
1d509098
CC
34132012-04-23 Cary Coutant <ccoutant@google.com>
3414
3415 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3416 CU range table of gdb index.
3417
7ebeff7f
DM
34182012-04-20 David S. Miller <davem@davemloft.net>
3419
3420 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3421 instead of false.
3422
13cf9988
DM
34232012-04-16 David S. Miller <davem@davemloft.net>
3424
2a1079e8
DM
3425 * sparc.cc (Target_sparc::got_address): New function.
3426 (Sparc_relocate_functions::gdop_hix22): New function.
3427 (Sparc_relocate_functions::gdop_lox10): New function.
3428 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3429 relocs.
3430 (Target_sparc::Scan::local): Likewise if the global symbol is not
3431 preemptible and is not IFUNC.
3432 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3433 transformations for local and non-preemptible non-IFUNC global
3434 symbols.
3435
0bc964fc
DM
3436 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3437 writing out 64-bit part of ranges.
3438
661d7a80
DM
3439 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3440 -fpic and -fpie respectively.
3441 * Makefile.in: Regenerate.
3442
8c2bf391
DM
3443 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3444 (Target_sparc::Target_sparc): Initialize new field.
3445 (Target_sparc::do_plt_section_for_global): New function.
3446 (Target_sparc::do_plt_section_for_local): New function.
3447 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3448 (Target_sparc::make_plt_section): New function, broken out of
3449 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3450 (Target_sparc::make_plt_entry): Call make_plt_section.
3451 (Target_sparc::make_local_ifunc_plt_entry): New function.
3452 (Target_sparc::rela_ifunc_section): New function.
3453 (Target_sparc::plt_section): Remove const.
3454 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3455 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3456 and ifunc_count_ fields.
3457 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3458 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3459 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3460 (Output_data_plt_sparc::rela_ifunc): New function.
3461 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3462 (Output_data_plt_sparc::has_ifunc_section): New function.
3463 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3464 (Output_data_plt_sparc::address_for_global): New function.
3465 (Output_data_plt_sparc::address_for_local): New function.
3466 (Output_data_plt_sparc::plt_index_to_offset): New function.
3467 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3468 and entry_count.
3469 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3470 entry_count.
3471 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3472 R_SPARC_JMP_IREL to switch.
3473 (Target_sparc::Scan::check_non_pic): Likewise.
3474 (Target_sparc::Scan::local): Handle IFUNC symbols.
3475 (Target_sparc::Scan::local): Likewise.
3476 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3477 and plt_address_for_local.
3478 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3479 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3480
13cf9988
DM
3481 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3482 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3483 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3484 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3485 global relocs too.
3486 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3487 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3488 calls.
3489 * sparc.cc (Target_sparc::Scan::global): Likewise.
3490 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3491
31821be0
CC
34922012-04-16 Cary Coutant <ccoutant@google.com>
3493
3494 * archive.cc (Library_base::should_include_member): Check for
3495 --export-dynamic-symbol.
3496 * options.h (class General_options): Add --export-dynamic-symbol.
3497 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3498 --export-dynamic-symbol.
3499 (Symbol_table::gc_mark_undef_symbols): Likewise.
3500 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3501
2615994e
DM
35022012-04-12 David S. Miller <davem@davemloft.net>
3503
3504 * sparc.cc (Reloc::wdisp10): New relocation method.
3505 (Reloc::h34): Likewise.
3506 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3507 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3508 R_SPARC_WDISP10.
3509 (Target_sparc::Scan::local): Likewise.
3510 (Target_sparc::Scan::global): Likewise.
3511 (Target_sparc::Relocate::relocate): Likewise.
3512
6782735d
CC
35132012-04-09 Cary Coutant <ccoutant@google.com>
3514
3515 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3516 low_pc == 0.
3517
8c7a0b00
ILT
35182012-04-06 Ian Lance Taylor <iant@google.com>
3519
3520 * timer.cc: #include <unistd.h>.
3521
58797674
RM
35222012-04-06 Roland McGrath <mcgrathr@google.com>
3523
3524 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3525 * config.in: Regenerate.
3526 * configure: Regenerate.
3527
44350750
NC
35282012-04-05 Nick Clifton <nickc@redhat.com>
3529
3530 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3531 (AM_LC_MESSAGES): Add.
3532 * aclocal.m4: Regenerate.
3533 * config.in: Regenerate.
3534 * configure: Regenerate.
3535
c1027032
CC
35362012-03-21 Cary Coutant <ccoutant@google.com>
3537
3538 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3539 * Makefile.in: Regenerate.
3540 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3541 (Sized_elf_reloc_mapper::symbol_section): New function.
3542 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3543 (make_elf_reloc_mapper): New function.
3544 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3545 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3546 (Dwarf_abbrev_table::do_get_abbrev): New function.
3547 (Dwarf_ranges_table::read_ranges_table): New function.
3548 (Dwarf_ranges_table::read_range_list): New function.
3549 (Dwarf_pubnames_table::read_section): New function.
3550 (Dwarf_pubnames_table::read_header): New function.
3551 (Dwarf_pubnames_table::next_name): New function.
3552 (Dwarf_die::Dwarf_die): New function.
3553 (Dwarf_die::read_attributes): New function.
3554 (Dwarf_die::skip_attributes): New function.
3555 (Dwarf_die::set_name): New function.
3556 (Dwarf_die::set_linkage_name): New function.
3557 (Dwarf_die::attribute): New function.
3558 (Dwarf_die::string_attribute): New function.
3559 (Dwarf_die::int_attribute): New function.
3560 (Dwarf_die::uint_attribute): New function.
3561 (Dwarf_die::ref_attribute): New function.
3562 (Dwarf_die::child_offset): New function.
3563 (Dwarf_die::sibling_offset): New function.
3564 (Dwarf_info_reader::check_buffer): New function.
3565 (Dwarf_info_reader::parse): New function.
3566 (Dwarf_info_reader::do_parse): New function.
3567 (Dwarf_info_reader::do_read_string_table): New function.
3568 (Dwarf_info_reader::lookup_reloc): New function.
3569 (Dwarf_info_reader::get_string): New function.
3570 (Dwarf_info_reader::visit_compilation_unit): New function.
3571 (Dwarf_info_reader::visit_type_unit): New function.
3572 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3573 Sized_elf_reloc_mapper.
3574 (Sized_dwarf_line_info::symbol_section): Remove function.
3575 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3576 (Sized_dwarf_line_info::read_line_mappings): Remove object
3577 parameter, adjust callers.
3578 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3579 * dwarf_reader.h: Include <sys/types.h>.
3580 (class Track_relocs): Remove forward declaration.
3581 (class Elf_reloc_mapper): New class.
3582 (class Sized_elf_reloc_mapper): New class.
3583 (class Dwarf_abbrev_table): New class.
3584 (class Dwarf_range_list): New class.
3585 (class Dwarf_ranges_table): New class.
3586 (class Dwarf_pubnames_table): New class.
3587 (class Dwarf_die): New class.
3588 (class Dwarf_info_reader): New class.
3589 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3590 (Sized_dwarf_line_info::symbol_section): Remove member function.
3591 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3592 base class.
3593 * gdb-index.cc: New source file.
3594 * gdb-index.h: New source file.
3595 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3596 and .debug_types sections, call Layout::add_to_gdb_index.
3597 (Sized_relobj_incr::do_section_name): Implement.
3598 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3599 return type; Implement.
3600 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3601 return type.
3602 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3603 parameter list and return type.
3604 (Sized_incr_dynobj::do_section_contents): Likewise.
3605 * layout.cc: Include gdb-index.h.
3606 (Layout::Layout): Initialize gdb_index_data_.
3607 (Layout::init_fixed_output_section): Check for .gdb_index section.
3608 (Layout::add_to_gdb_index): New function. Instantiate.
3609 * layout.h: Add forward declaration for class Gdb_index.
3610 (Layout::add_to_gdb_index): New member function.
3611 (Layout::gdb_index_data_): New data member.
3612 * main.cc: Include gdb-index.h.
3613 (main): Print statistics for gdb index.
3614 * object.cc (Object::section_contents): Move code into
3615 do_section_contents.
3616 (need_decompressed_section): Check for sections needed when building
3617 gdb index.
3618 (build_compressed_section_map): Likewise.
3619 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3620 gdb index.
3621 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3622 sections; call Layout::add_to_gdb_index.
3623 (Sized_relobj_file::do_decompressed_section_contents): Call
3624 do_section_contents directly.
3625 * object.h (Object::do_section_contents): Adjust parameter list and
3626 return type.
3627 (Object::do_decompressed_section_contents): Call do_section_contents
3628 directly.
3629 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3630 return type.
3631 * options.h (class General_options): Add --gdb-index option.
3632 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3633 list and return type.
3634 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3635 * reloc.h (Track_relocs::checkpoint): New function.
3636 (Track_relocs::reset): New function.
3637
3638 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3639 New test cases.
3640 * testsuite/Makefile.in: Regenerate.
3641 * testsuite/gdb_index_test.cc: New test source file.
3642 * testsuite/gdb_index_test_1.sh: New test source file.
3643 * testsuite/gdb_index_test_2.sh: New test source file.
3644
647f1574
DK
36452012-03-19 Doug Kwan <dougkwan@google.com>
3646
3647 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3648 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3649 __exidx_start and __exidx_end. Make symbol table parameter
3650 anonymous as it is not used.
3651 * gold.cc (queue_middle_tasks): Call target hook to define any
3652 target-specific symbols.
3653 * target.h (Target::define_standard_symbols): New method.
3654 (Target::do_define_standard_symbols): Same.
3655 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3656 * testsuite/Makefile.in: Regenerate.
3657 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3658 and __exidx_end.
3659 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3660 relocations are generated for __exidx_start and __exidx_end.
3661
7c6109da
DK
36622012-03-16 Doug Kwan <dougkwan@google.com>
3663
3664 * testsuite/Makefile.am: Disable test initpri3b.
3665 * testsuite/Makefile.in: Regenerate.
3666
7b8957f8
DK
36672012-03-15 Doug Kwan <dougkwan@google.com>
3668
3669 * arm.cc (Target_arm::got_section): Make .got section read-only
3670 if -z now is given.
3671
14dc9ef7
ILT
36722012-03-15 Ian Lance Taylor <iant@google.com>
3673
3674 PR gold/13850
3675 * layout.cc (Layout::make_output_section): Correctly mark
3676 SHT_INIT_ARRAY, et. al., as relro.
3677
fa40b62a
DK
36782012-03-14 Doug Kwan <dougkwan@google.com>
3679
3680 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3681 dynamic relocations for protected symbols in shared objects.
3682
fd325007
ILT
36832012-03-13 Ian Lance Taylor <iant@google.com>
3684
3685 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3686 keep the larger alignment.
3687
e8dd54e1
CC
36882012-03-12 Cary Coutant <ccoutant@google.com>
3689
3690 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3691 handling of DW_LNE_define_file.
3692
feb5f3b0
CC
36932012-03-12 Cary Coutant <ccoutant@google.com>
3694
3695 * reduced_debug_output.cc
3696 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3697 codes to switch.
3698
a1fb4256
CC
36992012-02-29 Cary Coutant <ccoutant@google.com>
3700
3701 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3702
5dd8762a
CC
37032012-02-29 Cary Coutant <ccoutant@google.com>
3704
3705 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3706 Call Object::decompressed_section_contents.
3707 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3708 New dtor.
3709 (Sized_dwarf_line_info::buffer_start_): New data member.
3710 * merge.cc (Output_merge_data::do_add_input_section): Call
3711 Object::decompressed_section_contents.
3712 (Output_merge_string::do_add_input_section): Likewise.
3713 * object.cc (need_decompressed_section): New function.
3714 (build_compressed_section_map): Decompress sections needed later.
3715 (Sized_relobj_file::do_decompressed_section_contents): New function.
3716 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3717 * object.h (Object::decompressed_section_contents): New function.
3718 (Object::discard_decompressed_sections): New function.
3719 (Object::do_decompressed_section_contents): New function.
3720 (Object::do_discard_decompressed_sections): New function.
3721 (Compressed_section_info): New type.
3722 (Compressed_section_map): Include decompressed section contents.
3723 (Sized_relobj_file::do_decompressed_section_contents): New function.
3724 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3725
7b5de7ee
CC
37262012-02-16 Cary Coutant <ccoutant@google.com>
3727
3728 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3729 * testsuite/Makefile.in: Regenerate.
3730
f9fa4a63
CC
37312012-02-14 Cary Coutant <ccoutant@google.com>
3732
3733 * options.cc (General_options::finalize): Disallow -pie and -static.
3734
2c175ebc
DK
37352012-02-03 Doug Kwan <dougkwan@google.com>
3736
3737 * arm.cc (Arm_relocate_functions::abs8,
3738 Arm_relocate_functions::abs16): Use
3739 Bits::has_signed_unsigned_overflow32.
3740 (Arm_relocate_functions::thm_abs8): Correct range of
3741 overflow check.
3742 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3743 in assertions.
3744
90cff06f
DK
37452012-02-02 Doug Kwan <dougkwan@google.com>
3746
3747 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3748 position independent outputs, not just shared objects.
3749
63887f3d
L
37502012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3751
3752 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3753 * configure: Regenerated.
3754
bef2b434
ILT
37552012-01-27 Ian Lance Taylor <iant@google.com>
3756
3757 * reloc.h (Bits): New class with static functions, copied from
3758 namespace utils in arm.cc.
3759 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3760 instead.
3761
c335b55d
L
37622012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3763
3764 * incremental.cc (write_info_blocks): Correct relocation offset.
3765
41194d9f
L
37662012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3767
3768 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3769 (Relocate::tls_gd_to_le): Likewise.
3770
1bae613c
L
37712012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3772
3773 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3774
24482ca0
L
37752012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3776
3777 * configure.ac: Check if -mcmodel=medium works.
3778 * configure: Regenerated.
3779
c2c7840a
CC
37802012-01-24 Cary Coutant <ccoutant@google.com>
3781
3782 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3783 definition and ...
3784 (read_unsigned_LEB_128_x): ... this new function.
3785 (read_signed_LEB_128): Replaced with inline definition and ...
3786 (read_signed_LEB_128_x): ... this new function.
3787 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3788 (read_unsigned_LEB_128): Add inline definition.
3789 (read_signed_LEB_128_x): New function.
3790 (read_signed_LEB_128): Add inline definition.
3791 * testsuite/Makefile.am (leb128_unittest): New unit test.
3792 * testsuite/Makefile.in: Regenerate.
3793 * testsuite/leb128_unittest.cc: New unit test.
3794
833de760 37952012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3796
3797 PR gold/13617
3798 * i386.cc (Target_i386::do_code_fill): When using a jmp
3799 instruction, pad with nop instructions.
3800 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3801
618d6666
L
38022012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3803
3804 * x86_64.cc (gc_process_relocs): Add typename on types used in
3805 template.
3806 (scan_relocs): Likewise.
3807 (relocate_section): Likewise.
3808 (apply_relocation): Likewise.
3809
3660ff06
L
38102012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3811
3812 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3813 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3814 under x32.
3815
fc51264f
L
38162012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3817
3818 * x86_64.cc: Initial support for x32.
3819
dd74ae06
CC
38202012-01-03 Cary Coutant <ccoutant@google.com>
3821
3822 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3823 Use abstract base class for GOT.
3824 * gold/output.h (class Output_data_got_base): New abstract base class.
3825 (class Output_data_got): Derive from new base class, adjust ctors.
3826 (Output_data_got::reserve_slot): Make virtual; rename to
3827 do_reserve_slot; Adjust callers.
3828 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3829 pointer to abstract base class.
3830 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3831
83896202
ILT
38322011-12-18 Ian Lance Taylor <iant@google.com>
3833
3834 * object.h (Relobj::local_symbol_value): New function.
3835 (Relobj::local_plt_offset): New function.
3836 (Relobj::local_has_got_offset): New function.
3837 (Relobj::local_got_offset): New function.
3838 (Relobj::set_local_got_offset): New function.
3839 (Relobj::do_local_symbol_value): New pure virtual function.
3840 (Relobj::do_local_plt_offset): Likewise.
3841 (Relobj::do_local_has_got_offset): Likewise.
3842 (Relobj::do_local_got_offset): Likewise.
3843 (Relobj::do_set_local_got_offset): Likewise.
3844 (Sized_relobj::do_local_has_got_offset): Rename from
3845 local_has_got_offset.
3846 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3847 (Sized_relobj::do_set_local_got_offset): Rename from
3848 set_local_got_offset.
3849 (Sized_relobj_file::do_local_plt_offset): Rename from
3850 local_plt_offset.
3851 (Sized_relobj_file::do_local_symbol_value): New function.
3852 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3853 local_plt_offset.
3854 * output.cc (Output_data_got::Got_entry::write): Change object to
3855 Relobj. Use local_symbol_value.
3856 (Output_data_got::add_global_with_rel): Change rel_dyn to
3857 Output_data_reloc_generic*. Use add_global_generic.
3858 (Output_data_got::add_global_with_rela): Remove. Change all
3859 callers to use add_global_with_rel.
3860 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3861 Output_data_reloc_generic*. Use add_global_generic.
3862 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3863 callers to use add_global_pair_with_rel.
3864 (Output_data_got::add_local): Change object to Relobj*.
3865 (Output_data_got::add_local_plt): Likewise.
3866 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3867 change rel_dyn to Output_data_reloc_generic*. Use
3868 add_local_generic.
3869 (Output_data_got::add_local_with_rela): Remove. Change all
3870 callers to use all_local_with_rel.
3871 (Output_data_got::add_local_pair_with_rel): Change object to
3872 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3873 add_output_section_generic.
3874 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3875 callers to use add_local_pair_with_rel.
3876 (Output_data_got::reserve_local): Change object to Relobj*.
3877 * output.h: (class Output_data_reloc_generic): Add pure virtual
3878 declarations for add_global_generic, add_local_generic,
3879 add_output_section_generic.
3880 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3881 functions for Output_data_reloc_generic. Update declarations for
3882 changes listed in output.cc.
3883 (class Output_data_got): Change template parameter to got_size.
3884 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3885 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3886 function.
3887 (Sized_relobj_incr::do_local_plt_offset): New function.
3888 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3889 add_global_generic.
3890
76677ad0
CC
38912011-12-17 Cary Coutant <ccoutant@google.com>
3892
3893 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3894 * resolve.cc (Symbol_table::resolve): Likewise.
3895 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3896 arrays.
3897 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3898
8b8dd8d5
ILT
38992011-12-16 Ian Lance Taylor <iant@google.com>
3900
3901 * output.h (Output_data_reloc_generic::add): Only call
3902 add_dynamic_reloc if this is a dynamic reloc section.
3903
d55525b9
L
39042011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3905
3906 PR gold/13505
3907 * target-reloc.h (apply_relocation): Replace <64, false> with
3908 <size, big_endian>.
3909
ff81c7c1
NC
39102011-11-25 Nick Clifton <nickc@redhat.com>
3911
3912 * po/it.po: New Italian translation.
3913
628f39be
SA
39142011-11-17 Sterling Augustine <saugustine@google.com>
3915
3916 * script.cc (script_include_directive): Implement.
3917 (read_script_file): New local variables name and search_path. Update
3918 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3919 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3920 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3921
98ef3ea4
SA
39222011-11-11 Sterling Augustine <saugustine@google.com>
3923
3924 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3925 (file_or_sections_cmd): Likewise.
3926
f4a8b6d7
DK
39272011-11-11 Doug Kwan <dougkwan@google.com>
3928
3929 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3930 if --just-symbols is given.
3931
29ab395d
DK
39322011-11-10 Doug Kwan <dougkwan@google.com>
3933
3934 PR gold/13362
3935 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3936 when processing data relocs.
3937 * reloc.h (Relocate_functions::rel_unaligned): New method.
3938 (Relocate_functions::pcrel_unaligned): Ditto.
3939 (Relocate_functions::rel32_unaligned): Ditto.
3940 (Relocate_functions::pcrel32_unaligned): Ditto.
3941
2c339f71
DK
39422011-11-09 Doug Kwan <dougkwan@google.com>
3943
3944 PR gold/13362
3945 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3946 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3947 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3948 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3949 (Relocate_functions::rel_unaligned): New.
3950 (Relocate_functions::rel32_unaligned): New.
3951 * target-reloc.h (relocate_for_relocatable): Add code to handle
3952 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3953 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3954 arm_unaligned_reloc_r): New targets.
3955 * testsuite/Makefile.in: Regenerate.
3956 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3957 linking.
3958
3f3cddf1
ILT
39592011-11-02 Ian Lance Taylor <iant@google.com>
3960
3961 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3962 NATIVE_LINKER.
3963 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3964 * options.cc (General_options::finalize): Use library search path
3965 from configure script if specified. If not native and no sysroot,
3966 only search TOOLLIBDIR.
3967 * options.h (Search_directory::Search_directory): Change name to
3968 const std::string&.
3969 (General_options::add_to_library_path_with_sysroot): Change arg to
3970 const std::string&.
3971 * configure, Makefile.in, config.in: Rebuild.
3972
a8e2273b
ILT
39732011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3974
3975 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3976 we are working around the ARM1176 Erratum.
3977 * options.h (General_options::fix_arm1176): Add option.
3978 * testsuite/Makefile.am: Add testcases, and keep current ones
3979 working.
3980 * testsuite/Makefile.in: Regenerate.
3981 * testsuite/arm_fix_1176.s: New file.
3982 * testsuite/arm_fix_1176.sh: Likewise.
3983
cd6eab1c
ILT
39842011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3985
3986 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3987 may_use_blx_.
3988 (Target_arm::may_use_blx): Remove method.
3989 (Target_arm::set_may_use_blx): Likewise.
3990 (Target_arm::may_use_v4t_interworking): New method.
3991 (Target_arm::may_use_v5t_interworking): Likewise.
3992 (Target_arm::may_use_blx_): Remove member variable.
3993 (Arm_relocate_functions::arm_branch_common): Check for v5T
3994 interworking.
3995 (Arm_relocate_functions::thumb_branch_common): Likewise.
3996 (Reloc_stub::stub_type_for_reloc): Likewise.
3997 (Target_arm::do_finalize_sections): Correct interworking checks.
3998 * testsuite/Makefile.am: Add new tests.
3999 * testsuite/Makefile.in: Regenerate.
4000 * testsuite/arm_farcall_arm_arm.s: New test.
4001 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4002 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4003 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4004 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4005 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4006 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4007 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4008
286adcf4
CC
40092011-10-31 Cary Coutant <ccoutant@google.com>
4010
4011 PR gold/13023
4012 * expression.cc (Expression::eval_with_dot): Add
4013 is_section_dot_assignment parameter.
4014 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4015 absolute and assigning to dot within a section.
4016 * script-sections.cc
4017 (Output_section_element_assignment::set_section_addresses): Pass
4018 dot_section to set_if_absolute.
4019 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4020 as is_section_dot_assignment flag to eval_with_dot.
4021 (Output_section_element_dot_assignment::set_section_addresses):
4022 Likewise.
4023 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4024 parameter. Also set value if relative to dot_section; set the
4025 symbol's output_section.
4026 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4027 parameter. Adjust all callers.
4028 (Expression::eval_maybe_dot): Likewise.
4029 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4030 Adjust all callers.
4031 * testsuite/script_test_2.t: Test assignment of an absolute value
4032 to dot within an output section element.
4033
9634ed06
CC
40342011-10-31 Cary Coutant <ccoutant@google.com>
4035
4036 * options.h (class General_options): Add --[no-]gnu-unique options.
4037 * symtab.cc (Symbol_table::sized_write_globals): Convert
4038 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4039
de4101c7
CC
40402011-10-31 Cary Coutant <ccoutant@google.com>
4041
4042 PR gold/13359
4043 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4044 unnecessary assertion.
4045 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4046
7257cc92
ST
40472011-10-31 Sriraman Tallam <tmsriram@google.com>
4048
4049 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4050 gc_mark_symbol.
4051 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4052 gc_mark_symbol.
4053 Change to just keep the section associated with symbol.
4054 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4055 they are externally visible and --export-dynamic is turned on.
4056 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4057
bfc34b3f
ILT
40582011-10-19 Ian Lance Taylor <iant@google.com>
4059
4060 PR gold/13163
4061 * script-sections.cc
4062 (Output_section_element_dot_assignment::needs_output_section): New
4063 function.
4064
ea0d8c47
ILT
40652011-10-19 Ian Lance Taylor <iant@google.com>
4066
4067 PR gold/13204
4068 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4069 --section-start option was seen.
4070 * options.h (General_options::any_section_start): New function.
4071
abd242a9
DM
40722011-10-18 David S. Miller <davem@davemloft.net>
4073
4074 PR binutils/13301
4075 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4076 member to track relocation locations that have moved during TLS
4077 reloc optimizations.
4078 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4079 (Target_sparc::Relocate::relocate): Adjust view down by 4
4080 bytes if it matches reloc_adjust_addr_.
4081 (Target_sparc::Relocate::relocate_tls): Always move the
4082 __tls_get_addr call delay slot instruction forward 4 bytes when
4083 performing relaxation.
4084
bab9090f
CC
40852011-10-18 Cary Coutant <ccoutant@google.com>
4086
4087 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4088 (Output_file::map_no_anonymous): Check for non-zero
4089 return code from posix_fallocate.
4090
f7c5b166
CC
40912011-10-17 Cary Coutant <ccoutant@google.com>
4092
4093 PR gold/13245
4094 * plugin.cc (is_visible_from_outside): Check for symbols
4095 referenced from dynamic objects.
4096 * resolve.cc (Symbol_table::resolve): Don't count references
4097 from dynamic objects as references from real ELF files.
4098 * testsuite/plugin_test_2.sh: Adjust expected result.
4099
b490c0bb
CC
41002011-10-17 Cary Coutant <ccoutant@google.com>
4101
4102 * gold.cc: Include timer.h.
4103 (queue_middle_tasks): Stamp time.
4104 (queue_final_tasks): Likewise.
4105 * main.cc (main): Store timer in parameters. Print timers
4106 for each pass.
4107 * parameters.cc (Parameters::Parameters): Initialize timer_.
4108 (Parameters::set_timer): New function.
4109 (set_parameters_timer): New function.
4110 * parameters.h (Parameters::set_timer): New function.
4111 (Parameters::timer): New function.
4112 (Parameters::timer_): New data member.
4113 (set_parameters_timer): New function.
4114 * timer.cc (Timer::stamp): New function.
4115 (Timer::get_pass_time): New function.
4116 * timer.h (Timer::stamp): New function.
4117 (Timer::get_pass_time): New function.
4118 (Timer::pass_times_): New data member.
4119
f475cf7b
CC
41202011-10-17 Cary Coutant <ccoutant@google.com>
4121
4122 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4123 task for members of lib groups.
4124
cdd7e244
CC
41252011-10-17 Cary Coutant <ccoutant@google.com>
4126
4127 PR gold/13288
4f95c8b4 4128 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4129 (File_read::make_view): Move bounds check (replace with assert)...
4130 (File_read::find_or_make_view): ... to here.
4131
dfb45471
CC
41322011-10-12 Cary Coutant <ccoutant@google.com>
4133
4f95c8b4 4134 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4135 ::read returns less than requested size.
4136
53bbcc1b
CC
41372011-10-10 Cary Coutant <ccoutant@google.com>
4138
4f95c8b4 4139 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4140 Initialize defined_count_.
4141 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4142 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4143 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4144 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4145 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4146 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4147 member.
4148 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4149 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4150 Return zeroes instead of internal error.
4151
397b129b
CC
41522011-10-10 Cary Coutant <ccoutant@google.com>
4153
4154 PR gold/13249
4f95c8b4 4155 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4156 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4157 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4158 (Output_reloc::type_): Adjust size of bit field.
4159 (Output_reloc::use_plt_offset_): New bit field.
4160 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4161 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4162 flag. Adjust all callers.
4f95c8b4 4163 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4164 creating RELATIVE relocations.
4165
d5698657
NC
41662011-10-10 Nick Clifton <nickc@redhat.com>
4167
4168 * po/es.po: Updated Spanish translation.
4169 * po/fi.po: Updated Finnish translation.
4170
6a59a5c2
DN
41712011-10-03 Diego Novillo <dnovillo@google.com>
4172
4173 * options.cc (parse_uint): Fix dereference of RETVAL.
4174
f0558624
ST
41752011-09-29 Sriraman Tallam <tmsriram@google.com>
4176
4177 * layout.h (section_order_map_): New member.
4178 (get_section_order_map): New member function.
4179 * output.cc (Output_section::add_input_section): Check for patterns
4180 only when --section-ordering-file is specified.
4181 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4182 output_sections have been formed.
4183 * layout.cc (Layout_Layout): Initialize section_order_map_.
4184 * plugin.cc (update_section_order): Store order in order_map. Do not
4185 update the order.
4186 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4187 * testsuite/Makefile.in: Regenerate.
4188 * testsuite/plugin_section_order.c: New file.
4189 * testsuite/plugin_final_layout.cc: New file.
4190 * testsuite/plugin_final_layout.sh: New file.
4191
a7dac153
CC
41922011-09-29 Cary Coutant <ccoutant@google.com>
4193
4f95c8b4 4194 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4195 Check for NULL.
4f95c8b4 4196 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4197 symbols during incremental update.
4198 (Symbol_table::add_from_dynobj): Likewise.
4199
eebd87a5
ILT
42002011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4201 Ian Lance Taylor <iant@google.com>
4202
4203 * symtab.cc (Symbol_table::define_special_symbol): Always
4204 canonicalize version string.
4205
403a3331
CC
42062011-09-26 Cary Coutant <ccoutant@google.com>
4207
4f95c8b4
CC
4208 * gold.cc (queue_initial_tasks): Move option checks ...
4209 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4210 some options; make others fatal.
4211
235061c2
CC
42122011-09-26 Cary Coutant <ccoutant@google.com>
4213
4214 gcc PR lto/47247
4215 * plugin.cc (get_symbols_v2): New function.
4216 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4217 (is_referenced_from_outside): New function.
4218 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4219 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4220 (get_symbols): Pass version parameter.
4221 (get_symbols_v2): New function.
4222 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4223 parameter.
4224 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4225 (onload): Add LDPT_GET_SYMBOLS_V2.
4226 (all_symbols_read_hook): Use get_symbols_v2; check for
4227 LDPR_PREVAILING_DEF_IRONLY_EXP.
4228 * testsuite/plugin_test_3.sh: Update expected results.
4229
dc87f620
ILT
42302011-09-23 Simon Baldwin <simonb@google.com>
4231
4232 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4233 configuration options.
4234 * configure: Regenerate.
4235 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4236 * Makefile.in: Regenerate.
4237 * testsuite/Makefile.in: Regenerate.
4238
a8279f82
ST
42392011-09-19 Sriraman Tallam <tmsriram@google.com>
4240
4241 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4242
0c9350c8
CC
42432011-09-19 Cary Coutant <ccoutant@google.com>
4244
4245 * incremental.cc (can_incremental_update): Fix typo in comment.
4246 * incremental.h (can_incremental_update): Likewise.
4247
aa06ae28
CC
42482011-09-18 Cary Coutant <ccoutant@google.com>
4249
4250 * incremental.cc (can_incremental_update): New function.
4251 * incremental.h (can_incremental_update): New function.
4252 * layout.cc (Layout::init_fixed_output_section): Call it.
4253 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4254 * object.cc (Sized_relobj_file::do_layout): Call
4255 can_incremental_update.
4256
ebb300b2
CC
42572011-09-13 Cary Coutant <ccoutant@google.com>
4258
4259 * configure.ac: Check for glibc support for gnu_indirect_function
4260 support with static linking, setting automake conditional
4261 IFUNC_STATIC.
4262 * Makefile.in: Regenerate.
4263 * configure: Regenerate.
4264
4265 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4266 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4267 for IFUNC_STATIC.
4268 * testsuite/Makefile.in: Regenerate.
4269
1206d0d5
CC
42702011-09-13 Cary Coutant <ccoutant@google.com>
4271
4272 * incremental.cc (Sized_relobj_incr::do_layout): Call
4273 report_comdat_group for kept comdat sections.
4274 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4275 * testsuite/Makefile.in: Regenerate.
4276 * testsuite/incr_comdat_test_1.cc: New source file.
4277 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4278 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4279 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4280
40b29874
ILT
42812011-09-13 Ian Lance Taylor <iant@google.com>
4282
4283 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4284 variable external_symbols_offset.
4285
1b045aac
ILT
42862011-09-12 Ian Lance Taylor <iant@google.com>
4287
4288 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4289 triggered if object has no symbols.
4290
24c6c55a
DM
42912011-09-09 David S. Miller <davem@davemloft.net>
4292
4293 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4294 (Output_fill_debug_line::do_write): Likewise.
4295
66570254
CC
42962011-08-29 Cary Coutant <ccoutant@google.com>
4297
4298 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4299 casts to match formatting specs.
4300 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4301
8ea8cd50
CC
43022011-08-26 Cary Coutant <ccoutant@google.com>
4303
4304 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4305 remaining hole size when allocating.
4306 (Layout::make_output_section): Set fill methods for debug sections.
4307 * layout.h (Free_list::Free_list_node): Move from private to
4308 public.
4309 (Free_list::set_min_hole_size): New function.
4310 (Free_list::begin, Free_list::end): New functions.
4311 (Free_list::min_hole_): New data member.
4312 * output.cc: Include dwarf.h.
4313 (Output_fill_debug_info::do_minimum_hole_size): New function.
4314 (Output_fill_debug_info::do_write): New function.
4315 (Output_fill_debug_line::do_minimum_hole_size): New function.
4316 (Output_fill_debug_line::do_write): New function.
4317 (Output_section::Output_section): Initialize new data member.
4318 (Output_section::set_final_data_size): Ensure patch space is larger
4319 than minimum hole size.
4320 (Output_section::do_write): Fill holes in debug sections.
4321 * output.h (Output_fill): New class.
4322 (Output_fill_debug_info): New class.
4323 (Output_fill_debug_line): New class.
4324 (Output_section::set_free_space_fill): New function.
4325 (Output_section::free_space_fill_): New data member.
4326 * testsuite/Makefile.am (incremental_test_3): Add
4327 --incremental-patch option.
4328 (incremental_test_4): Likewise.
4329 (incremental_test_5): Likewise.
4330 (incremental_test_6): Likewise.
4331 (incremental_copy_test): Likewise.
4332 (incremental_common_test_1): Likewise.
4333 * testsuite/Makefile.in: Regenerate.
4334
7cf80422
NC
43352011-08-26 Nick Clifton <nickc@redhat.com>
4336
4337 * po/es.po: Updated Spanish translation.
4338
c3f7b0e5
CC
43392011-08-01 Cary Coutant <ccoutant@google.com>
4340
4341 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4342 * gold/testsuite/Makefile.in: Regenerate.
4343 * gold/testsuite/justsyms_exec.c: New source file.
4344 * gold/testsuite/justsyms_lib.c: New source file.
4345
9590bf25
CC
43462011-08-01 Cary Coutant <ccoutant@google.com>
4347
4348 * layout.cc (Layout::set_segment_offsets): Don't realign text
4349 segment if -Ttext was specified.
4350 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4351 file type.
4352 * object.h (Sized_relobj_file::e_type): New function.
4353 (Sized_relobj_file::e_type_): New data member.
4354 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4355 base address for ET_EXEC files.
4356 * target.cc (Target::do_make_elf_object_implementation): Allow
4357 ET_EXEC files with --just-symbols option.
4358
dcd8d12e
CC
43592011-07-28 Cary Coutant <ccoutant@google.com>
4360
4361 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4362 Add thread_number parameter.
4363 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4364 * workqueue-threads.cc
4365 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4366 current thread if its thread number is greater than desired thread
4367 count.
4368 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4369 Add thread_number parameter.
4370 (Workqueue::should_cancel_thread): Likewise.
4371 (Workqueue::find_runnable_or_wait): Pass thread_number to
4372 should_cancel_thread.
4373 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4374 parameter.
4375
804eb480
ST
43762011-07-22 Sriraman Tallam <tmsriram@google.com>
4377
4378 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4379 only after checking if it cannot be forced local.
4380 * symtab.h (is_externally_visible): Check if the symbol is not forced
4381 local.
4382
f1ddb600
ILT
43832011-07-15 Ian Lance Taylor <iant@google.com>
4384
4385 * options.h (class General_options): Add --print-output-format.
4386 Move -EL next to -EB, for better --help output.
4387 * target-select.cc: Include <cstdio>, "options.h", and
4388 "parameters.h".
4389 (Target_selector::do_target_bfd_name): New function.
4390 (print_output_format): New function.
4391 * target-select.h (class Target_selector): Update declarations.
4392 (Target_selector::target_bfd_name): New function.
4393 (print_output_format): Declare.
4394 * main.cc: Include "target-select.h".
4395 (main): Handle --print-output-format.
4396 * gold.cc: Include "target-select.h".
4397 (queue_initial_tasks): Handle --print-output-format when there are
4398 no input files.
4399 * parameters.cc (parameters_force_valid_target): Give a better
4400 error message if -EB/-EL does not match target.
4401 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4402 function.
4403
7d172687
ILT
44042011-07-15 Ian Lance Taylor <iant@google.com>
4405
4406 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4407 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4408 (Output_data_plt_i386::do_write): Write address of .dynamic
4409 section to first entry in .got.plt section.
4410 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4411 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4412 Initialize layout_.
4413 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4414 section to first entry in .got.plt section.
4415 * layout.h (Layout::dynamic_section): New function.
4416
e9552f7e
ST
44172011-07-13 Sriraman Tallam <tmsriram@google.com>
4418
4419 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4420 to claim_file call.
4421 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4422 input_section_position_, and input_section_glob_.
4423 (read_layout_from_file): Call function section_ordering_specified.
4424 * layout.h (is_section_ordering_specified): New function.
4425 (section_ordering_specified): New function.
4426 (section_ordering_specified_): New boolean member.
4427 * main.cc(main): Call load_plugins after layout object is defined.
4428 * output.cc (Output_section::add_input_section): Use
4429 function section_ordering_specified to check if section ordering is
4430 needed.
4431 * output.cc (Output_section::add_relaxed_input_section): Use
4432 function section_ordering_specified to check if section ordering is
4433 needed.
4434 (Output_section::update_section_layout): New function.
4435 (Output_section::sort_attached_input_sections): Check if input section
4436 must be reordered.
4437 * output.h (Output_section::update_section_layout): New function.
4438 * plugin.cc (get_section_count): New function.
4439 (get_section_type): New function.
4440 (get_section_name): New function.
4441 (get_section_contents): New function.
4442 (update_section_order): New function.
58797674 4443 (allow_section_ordering): New function.
e9552f7e
ST
4444 (Plugin::load): Add the new interfaces to the transfer vector.
4445 (Plugin_manager::load_plugins): New parameter.
4446 (Plugin_manager::all_symbols_read): New parameter.
4447 (Plugin_manager::claim_file): New parameter. Save the elf object for
4448 unclaimed objects.
4449 (Plugin_manager::get_elf_object): New function.
4450 (Plugin_manager::get_view): Change to directly use the bool to check
4451 if get_view is called from claim_file_hook.
4452 * plugin.h (input_objects): New function
4453 (Plugin__manager::load_plugins): New parameter.
4454 (Plugin_manager::claim_file): New parameter.
4455 (Plugin_manager::get_elf_object): New function.
4456 (Plugin_manager::in_claim_file_handler): New function.
4457 (Plugin_manager::in_claim_file_handler_): New member.
4458 (layout): New function.
4459 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4460 handler with an extra parameter. Make the elf object before calling
4461 claim_file handler.
4462 * testsuite/plugin_test.c (get_section_count): New function pointer.
4463 (get_section_type): New function pointer.
4464 (get_section_name): New function pointer.
4465 (get_section_contents): New function pointer.
4466 (update_section_order): New function pointer.
4467 (allow_section_ordering): New function pointer.
4468 (onload): Check if the new interfaces exist.
4469
9446efde
ILT
44702011-07-13 Ian Lance Taylor <iant@google.com>
4471
4472 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4473 relro section.
4474 * x86_64.cc (Target_x86_64::got_section): Likewise.
4475 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4476 (relro_now_test_SOURCES): New variable.
4477 (relro_now_test_DEPENDENCIES): New variable.
4478 (relro_now_test_LDFLAGS): New variable.
4479 (relro_now_test_LDADD): New variable.
4480 (relro_now_test.so): New target.
4481 * testsuite/Makefile.in: Rebuild.
4482
07aa62f2
ILT
44832011-07-12 Ian Lance Taylor <iant@google.com>
4484
4485 PR gold/12980
4486 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4487 GLOB_DAT relocation rather than a RELATIVE relocation for a
4488 protected symbol when creating a shared library.
4489 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4490 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4491 * testsuite/protected_main_1.cc (main): Test that protected
4492 function has same address.
4493
e2153196
ILT
44942011-07-11 Ian Lance Taylor <iant@google.com>
4495
4496 PR gold/12979
4497 * options.h (class General_options): Add -Bgroup.
4498 * options.cc (General_options::finalize): If -Bgroup is set,
4499 default to --unresolved-symbols=report-all.
4500 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4501 * target-reloc.h (issue_undefined_symbol_error): Handle
4502 --unresolved-symbols=report-all.
4503
6daf5215
ILT
45042011-07-08 Ian Lance Taylor <iant@google.com>
4505
4506 PR gold/11985
4507 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4508 if linker script discards key sections.
4509 (Layout::create_dynamic_symtab): Likewise.
4510 (Layout::assign_local_dynsym_offsets): Likewise.
4511 (Layout::sized_create_version_sections): Likewise.
4512 (Layout::create_interp): Likewise.
4513 (Layout::finish_dynamic_section): Likewise.
4514 (Layout::set_dynamic_symbol_size): Likewise.
4515
beabb2c6
ILT
45162011-07-08 Ian Lance Taylor <iant@google.com>
4517
4518 PR gold/12386
4519 * options.h (class General_options): Add --unresolved-symbols.
4520 * target-reloc.h (issue_undefined_symbol_error): Check
4521 --unresolved-symbols. Add comments.
4522
9c16daf1
ILT
45232011-07-08 Ian Lance Taylor <iant@google.com>
4524
4525 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4526 expression more complex.
4527
191f1a2d
ILT
45282011-07-08 Ian Lance Taylor <iant@google.com>
4529
4530 PR gold/11317
4531 * target-reloc.h (issue_undefined_symbol_error): New inline
4532 function, broken out of relocate_section.
4533 (relocate_section): Call issue_undefined_symbol_error.
4534 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4535 there is no TLS segment if we are about to issue an undefined
4536 symbol error.
4537 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4538
62855347
ILT
45392011-07-08 Ian Lance Taylor <iant@google.com>
4540
4541 PR gold/12279
4542 * resolve.cc (Symbol_table::should_override): Add fromtype
4543 parameter. Change all callers. Give error when linking together
4544 TLS and non-TLS symbol.
4545 (Symbol_table::should_override_with_special): Add fromtype
4546 parameter. Change all callers.
4547 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4548 there is no TLS segment if we have reported some errors.
4549 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4550
67181c72
ILT
45512011-07-08 Ian Lance Taylor <iant@google.com>
4552
4553 PR gold/12372
4554 * target.h (Target::plt_address_for_global): New function.
4555 (Target::plt_address_for_local): New function.
4556 (Target::plt_section_for_global): Remove.
4557 (Target::plt_section_for_local): Remove.
4558 (Target::do_plt_address_for_global): New virtual function.
4559 (Target::do_plt_address_for_local): New virtual function.
4560 (Target::do_plt_section_for_global): Remove.
4561 (Target::do_plt_section_for_local): Remove.
4562 (Target::register_global_plt_entry): Add Symbol_table and Layout
4563 parameters.
4564 * output.cc (Output_data_got::Got_entry::write): Use
4565 plt_address_for_global and plt_address_for_local.
4566 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4567 address of output section.
4568 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4569 got_irelative_, and irelative_count_ fields. Update
4570 declarations.
4571 (Output_data_plt_i386::has_irelative_section): New function.
4572 (Output_data_plt_i386::entry_count): Add irelative_count_.
4573 (Output_data_plt_i386::set_final_data_size): Likewise.
4574 (class Target_i386): Add got_irelative_ and rel_irelative_
4575 fields. Update declarations.
4576 (Target_i386::Target_i386): Initialize new fields.
4577 (Target_i386::do_plt_address_for_global): New function replacing
4578 do_plt_section_for_global.
4579 (Target_i386::do_plt_address_for_local): New function replacing
4580 do_plt_section_for_local.
4581 (Target_i386::got_section): Create got_irelative_.
4582 (Target_i386::rel_irelative_section): New function.
4583 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4584 fields. Don't define __rel_iplt_{start,end}.
4585 (Output_data_plt_i386::add_entry): Add symtab and layout
4586 parameters. Change all callers. Use different PLT and GOT for
4587 IFUNC symbols.
4588 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4589 layout parameters. Change all callers. Use different PLT and
4590 GOT.
4591 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4592 (Output_data_plt_i386::rel_irelative): New function.
4593 (Output_data_plt_i386::address_for_global): New function.
4594 (Output_data_plt_i386::address_for_local): New function.
4595 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4596 IRELATIVE GOT when changing IFUNC GOT entries.
4597 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4598 reloc.
4599 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4600 if we didn't create an IRELATIVE GOT.
4601 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4602 plt_address_for_local.
4603 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4604 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4605 got_irelative_, and irelative_count_ fields. Update
4606 declarations.
4607 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4608 Initialize new fields. Remove symtab parameter. Change all
4609 callers.
4610 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4611 irelative_count_.
4612 (Output_data_plt_x86_64::has_irelative_section): New function.
4613 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4614 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4615 fields. Update declarations.
4616 (Target_x86_64::Target_x86_64): Initialize new fields.
4617 (Target_x86_64::do_plt_address_for_global): New function replacing
4618 do_plt_section_for_global.
4619 (Target_x86_64::do_plt_address_for_local): New function replacing
4620 do_plt_section_for_local.
4621 (Target_x86_64::got_section): Create got_irelative_.
4622 (Target_x86_64::rela_irelative_section): New function.
4623 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4624 all callers. Don't create __rel_iplt_{start,end}.
4625 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4626 parameters. Change all callers. Use different PLT and GOT for
4627 IFUNC symbols.
4628 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4629 layout parameters. Change all callers. Use different PLT and
4630 GOT.
4631 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4632 parameters. Change all callers. Use different PLT and GOT for
4633 IFUNC symbols.
4634 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4635 (Output_data_plt_x86_64::rela_irelative): New function.
4636 (Output_data_plt_x86_64::address_for_global): New function.
4637 (Output_data_plt_x86_64::address_for_local): New function.
4638 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4639 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4640 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4641 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4642 parameters.
4643 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4644 reloc.
4645 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4646 symbols if we didn't create an IRELATIVE GOT.
4647 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4648 plt_address_for_local.
4649 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4650 * testsuite/ifuncvar1.c: New test file.
4651 * testsuite/ifuncvar2.c: New test file.
4652 * testsuite/ifuncvar3.c: New test file.
4653 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4654 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4655 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4656 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4657 * testsuite/Makefile.in: Rebuild.
4658
33c15b45
CC
46592011-07-07 Cary Coutant <ccoutant@google.com>
4660
4661 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4662 (two_file_test_1_ndebug.o): Likewise.
4663 (two_file_test_1b_ndebug.o): Likewise.
4664 (two_file_test_2_ndebug.o): Likewise.
4665 (two_file_test_main_ndebug.o): Likewise.
4666 (incremental_test_2): Link with no-debug versions.
4667
f48b5fb7
CC
46682011-07-06 Cary Coutant <ccoutant@google.com>
4669
4670 * gold/incremental.cc
4671 (Output_section_incremental_inputs::write_info_blocks): Check for
4672 hidden and internal symbols.
4673
221597a5
CC
46742011-07-06 Cary Coutant <ccoutant@google.com>
4675
4676 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4677 Check disposition for startup file.
4678 (Incremental_inputs::report_command_line): Ignore
4679 --incremental-startup-unchanged option.
4680 * options.cc (General_options::parse_incremental_startup_unchanged):
4681 New function.
4682 (General_options::General_options): Initialize new data member.
4683 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4684 (General_options): Add --incremental-startup-unchanged option.
4685 (General_options::incremental_startup_disposition): New function.
4686 (General_options::incremental_startup_disposition_): New data member.
4687
e24719f6
CC
46882011-07-06 Cary Coutant <ccoutant@google.com>
4689
4690 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4691 input file index to Script_info ctor.
4692 (Sized_incremental_binary::do_file_has_changed): Find the
4693 command-line argument for files named in scripts.
4694 * incremental.h (Script_info::Script_info): New ctor
4695 with input file index.
4696 (Script_info::input_file_index): New function.
4697 (Script_info::input_file_index_): New data member.
4698 (Incremental_binary::get_library): Add const.
4699 (Incremental_binary::get_script_info): Add const.
4700 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4701 * testsuite/Makefile.am (incremental_test_5): New test case.
4702 (incremental_test_6): New test case.
4703 * testsuite/Makefile.in: Regenerate.
4704
8f7c81e8
CC
47052011-07-06 Cary Coutant <ccoutant@google.com>
4706
4707 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4708 debug output when command lines differ.
4709
9fbd3822
CC
47102011-07-06 Cary Coutant <ccoutant@google.com>
4711
4712 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4713 --incremental-patch option.
4714 * layout.cc (Free_list::allocate): Extend allocation beyond original
4715 end if enabled.
4716 (Layout::make_output_section): Mark sections that should get
4717 patch space.
4718 * options.cc (parse_percent): New function.
4719 * options.h (parse_percent): New function.
4720 (DEFINE_percent): New macro.
4721 (General_options): Add --incremental-patch option.
4722 * output.cc (Output_section::Output_section): Initialize new data
4723 members.
4724 (Output_section::add_input_section): Print section name when out
4725 of patch space.
4726 (Output_section::add_output_section_data): Likewise.
4727 (Output_section::set_final_data_size): Add patch space when
4728 doing --incremental-full.
4729 (Output_section::do_reset_address_and_file_offset): Remove patch
4730 space.
4731 (Output_segment::set_section_list_addresses): Print debug output
4732 only if --incremental-update.
4733 * output.h (Output_section::set_is_patch_space_allowed): New function.
4734 (Output_section::is_patch_space_allowed_): New data member.
4735 (Output_section::patch_space_): New data member.
4736 * parameters.cc (Parameters::incremental_full): New function.
4737 * parameters.h (Parameters::incremental_full): New function
4738 * testsuite/Makefile.am (incremental_test_2): Add test for
4739 --incremental-patch option.
4740 * testsuite/Makefile.in: Regenerate.
4741 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4742 (t18): Remove function body.
4743
f6cccc2c
DK
47442011-07-05 Doug Kwan <dougkwan@google.com>
4745
4746 PR gold/12771
4747 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4748 Arm_Address type for relocation result.
4749 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4750 overflow check.
4751 (Arm_relocate_functions::abs32): Use unaligned access.
4752 (Arm_relocate_functions::rel32): Ditto.
4753 (Arm_relocate_functions::prel31): Ditto.
4754 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4755 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4756 static data relocations.
4757 * testsuite/Makefile.in: Regnerate.
4758 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4759
28a13fec
ILT
47602011-07-05 Ian Lance Taylor <iant@google.com>
4761
4762 PR gold/12392
4763 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4764 symbols if necessary.
4765 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4766
24d47b34
ILT
47672011-07-05 Ian Lance Taylor <iant@google.com>
4768
4769 PR gold/12952
4770 * resolve.cc (Symbol::override_base_with_special): Simply override
4771 version with special symbol version, ignoring previous version.
4772
41f9cbbe
ILT
47732011-07-05 Ian Lance Taylor <iant@google.com>
4774
4775 * object.cc (Sized_relobj_file::include_section_group): Add
4776 information to comment about signature location.
4777
886288f1
ILT
47782011-07-02 Ian Lance Taylor <iant@google.com>
4779
4780 PR gold/12957
4781 * options.h (class General_options): Add -f and -F.
4782 * options.cc (General_options::finalize): Fatal error if -f/-F
4783 are used without -shared.
4784 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4785
ae3a6d4f
ILT
47862011-07-02 Ian Lance Taylor <iant@google.com>
4787
4788 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4789
21131061
ILT
47902011-07-01 Ian Lance Taylor <iant@google.com>
4791
4792 PR gold/12525
4793 PR gold/12952
4794 * resolve.cc (Symbol::override_base_with_special): Don't override
4795 the version if the overriding symbol has a different name.
4796 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4797 all callers. If we give an error about an undefined version,
4798 define the base version if necessary.
4799 * dynobj.h (class Versions): Update declaration.
4800 * testsuite/weak_alias_test_5.cc: New file.
4801 * testsuite/weak_alias_test.script: New file.
4802 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4803 and versioned_alias have the right value, and call t2.
4804 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4805 weak_alias_test_5.so.
4806 (weak_alias_test_LDADD): Likewise.
4807 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4808 * testsuite/Makefile.in: Rebuild.
4809
611062c0
ILT
48102011-07-01 Ian Lance Taylor <iant@google.com>
4811
4812 PR gold/12525
4813 * options.h (class General_options): Support -z notext.
4814 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4815 -Wl,-z,notext.
4816 (two_file_shared_nonpic.so): Likewise.
4817 (two_file_shared_mixed.so): Likewise.
4818 (two_file_shared_mixed_1.so): Likewise.
4819 (weak_undef_lib_nonpic.so): Likewise.
4820 (alt/weak_undef_lib_nonpic.so): Likewise.
4821 (tls_test_shared_nonpic.so): Likewise.
4822 * testsuite/Makefile.in: Rebuild.
4823
328c7c2f
ILT
48242011-07-01 Ian Lance Taylor <iant@google.com>
4825
4826 PR gold/12525
4827 * configure.ac: Test whether static linking works, setting
4828 the automake conditional HAVE_STATIC.
4829 * testsuite/Makefile.am: Disable tests using -static if
4830 HAVE_STATIC is not true.
4831 * configure, testsuite/Makefile.in: Rebuild.
4832
02d7cd44
ILT
48332011-07-01 Ian Lance Taylor <iant@google.com>
4834
4835 PR gold/12525
4836 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4837 Assert if we see DW_EH_PE_indirect.
4838 * target.h (Target::ehframe_datarel_base): New function.
4839 (Target::do_ehframe_datarel_base): New target function.
4840 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4841 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4842 function.
4843
07a60597
ILT
48442011-07-01 Ian Lance Taylor <iant@google.com>
4845
4846 PR gold/12571
4847 * options.h (class General_options): Add
4848 --ld-generated-unwind-info.
4849 * ehframe.cc (Fde::write): Add address parameter. Change all
4850 callers. If associated with PLT, fill in address and size.
4851 (Cie::set_output_offset): Only add merge mapping if there is an
4852 object.
4853 (Cie::write): Add address parameter. Change all callers.
4854 (Eh_frame::add_ehframe_for_plt): New function.
4855 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4856 input_offset_ fields into union u_, with new plt field.
4857 (Fde::Fde): Adjust for new union field.
4858 (Fde::Fde) [Output_data version]: New constructor.
4859 (Fde::add_mapping): Only add merge mapping if there is an object.
4860 (class Cie): Update declarations.
4861 (class Eh_frame): Declare add_ehframe_for_plt.
4862 * layout.cc (Layout::layout_eh_frame): Break out code into
4863 make_eh_frame_section, and call it.
4864 (Layout::make_eh_frame_section): New function.
4865 (Layout::add_eh_frame_for_plt): New function.
4866 * layout.h (class Layout): Update declarations.
4867 * merge.cc (Merge_map::add_mapping): Add assertion.
4868 * i386.cc: Include "dwarf.h".
4869 (class Output_data_plt_i386): Make first_plt_entry,
4870 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4871 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4872 and plt_eh_frame_fde.
4873 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4874 boundary. Call add_eh_frame_for_plt if appropriate.
4875 * x86_64.cc: Include "dwarf.h".
4876 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4877 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4878 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4879 and plt_eh_frame_fde.
4880 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4881 appropriate.
4882
14788a3f
ILT
48832011-06-29 Ian Lance Taylor <iant@google.com>
4884
4885 PR gold/12629
4886 * object.cc (Sized_relobj_file::layout_section): Change shdr
4887 parameter to be const.
4888 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4889 out of do_layout.
4890 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4891 appropriate. Call layout_eh_frame_section.
4892 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4893 sections.
4894 * object.h (class Sized_relobj_file): Update declarations.
4895
6c21fce1
ILT
48962011-06-29 Ian Lance Taylor <iant@google.com>
4897
37e41b03 4898 PR gold/12652
6c21fce1
ILT
4899 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4900 modifier.
4901 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4902
4d5e4e62
ILT
49032011-06-29 Ian Lance Taylor <iant@google.com>
4904
4905 PR gold/12675
4906 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4907 SHT_X86_64_UNWIND.
4908 * layout.cc (Layout::layout_eh_frame): Likewise.
4909
886f533a
ILT
49102011-06-29 Ian Lance Taylor <iant@google.com>
4911
4912 PR gold/12695
4913 * layout.cc (Layout::symtab_section_shndx): New function.
4914 * layout.h (class Layout): Declare symtab_section_shndx.
4915 * output.cc (Output_section::write_header): Call it.
4916
f3ae1b28
ILT
49172011-06-29 Ian Lance Taylor <iant@google.com>
4918
4919 PR gold/12818
4920 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4921 symbols which are not used in a relocation.
4922
aecf301f
ILT
49232011-06-28 Ian Lance Taylor <iant@google.com>
4924
4925 PR gold/12898
4926 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4927 script create indistinguishable segments.
4928 (Layout::set_segment_offsets): Use stable_sort when sorting
4929 segments. Pass this to Compare_segments constructor.
4930 * layout.h (class Layout): Make segment_precedes non-static.
4931 (class Compare_segments): Change from struct to class. Add
4932 layout_ field. Add constructor.
4933 * script-sections.cc
4934 (Script_sections::attach_sections_using_phdrs_clause): Rename
4935 local orphan to is_orphan. Don't report failure to put empty
4936 section in segment. On attachment failure, report name of
4937 section, and attach to first PT_LOAD segment.
4938
03ef7571
ILT
49392011-06-28 Ian Lance Taylor <iant@google.com>
4940
4941 PR gold/12934
4942 * target-select.cc (Target_selector::Target_selector): Add
4943 emulation parameter. Change all callers.
4944 (select_target_by_bfd_name): Rename from select_target_by_name.
4945 Change all callers.
4946 (select_target_by_emulation): New function.
4947 (supported_emulation_names): New function.
4948 * target-select.h (class Target_selector): Add emulation_ field.
4949 Update declarations.
4950 (Target_selector::recognize_by_bfd_name): Rename from
4951 recognize_by_name. Change all callers.
4952 (Target_selector::supported_bfd_names): Rename from
4953 supported_names. Change all callers.
4954 (Target_selector::recognize_by_emulation): New function.
4955 (Target_selector::supported_emulations): New function.
4956 (Target_selector::emulation): New function.
4957 (Target_selector::do_recognize_by_bfd_name): Rename from
4958 do_recognize_by_name. Change all callers.
4959 (Target_selector::do_supported_bfd_names): Rename from
4960 do_supported_names. Change all callers.
4961 (Target_selector::do_recognize_by_emulation): New function.
4962 (Target_selector::do_supported_emulations): New function.
4963 (select_target_by_bfd_name): Change name in declaration.
4964 (select_target_by_emulation): Declare.
4965 (supported_emulation_names): Declare.
4966 * parameters.cc (parameters_force_valid_target): Try to find
4967 target based on emulation from -m option.
4968 * options.h (class General_options): Change doc string for -m.
4969 * options.cc (help): Print emulations.
4970 (General_options::parse_V): Likewise.
4971 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4972 Add emulation parameter. Change all callers.
4973
200b2bb9
ILT
49742011-06-28 Ian Lance Taylor <iant@google.com>
4975
4976 * target.h (class Target): Add osabi_ field.
4977 (Target::osabi): New function.
4978 (Target::set_osabi): New function.
4979 (Target::Target): Initialize osabi_.
4980 (Target::do_adjust_elf_header): Make pure virtual.
4981 (Sized_target::do_adjust_elf_header): Declare.
4982 * target.cc (Sized_target::do_adjust_elf_header): New function.
4983 (class Sized_target): Instantiate all versions.
4984 * freebsd.h (class Target_freebsd): Remove.
4985 (Target_selector_freebsd::do_recognize): Call set_osabi on
4986 Target.
4987 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4988 (Target_selector_freebsd::set_osabi): Remove.
4989 * i386.cc (class Target_i386): Inherit from Sized_target rather
4990 than Target_freebsd.
4991 * x86_64.cc (class Target_x86_64): Likewise.
4992
b3ce541e
ILT
49932011-06-28 Ian Lance Taylor <iant@google.com>
4994
4995 * target.h (Target::can_check_for_function_pointers): Rewrite.
4996 Make non-virtual.
4997 (Target::can_icf_inline_merge_sections): Likewise.
4998 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4999 (Target::Target_info): Add can_icf_inline_merge_sections field.
5000 (Target::do_can_check_for_function_pointers): New virtual
5001 function.
5002 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5003 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5004 from can_check_for_function_pointers, move in file.
5005 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5006 section_may_have_icf_unsafe_poineters, move in file.
5007 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5008 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5009 Rename from can_check_for_function_pointers, move in file.
5010 (Target_i386::can_icf_inline_merge_sections): Remove.
5011 (Target_i386::i386_info): Initialize
5012 can_icf_inline_merge_sections.
5013 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5014 Initialize can_icf_inline_merge_sections.
5015 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5016 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5017 Rename from can_check_for_function_pointers, move in file.
5018 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5019 (Target_x86_64::x86_64_info): Initialize
5020 can_icf_inline_merge_sections.
5021 * testsuite/testfile.cc (Target_test::test_target_info):
5022 Likewise.
5023 * icf.cc (get_section_contents): Correct formatting.
5024
6d1c4efb
ILT
50252011-06-27 Ian Lance Taylor <iant@google.com>
5026
5027 * symtab.cc (Symbol::versioned_name): New function.
5028 (Symbol_table::add_to_final_symtab): Use versioned_name when
5029 appropriate.
5030 (Symbol_table::sized_write_symbol): Likewise.
5031 * symtab.h (class Symbol): Declare versioned_name.
5032 * stringpool.h (class Stringpool_template): Add variant of add
5033 which takes a std::basic_string.
5034 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5035 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5036 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5037 (ver_test_12.o): New target.
5038 * testsuite/Makefile.in: Rebuild.
5039
57eb9b50
DK
50402011-06-27 Doug Kwan <dougkwan@google.com>
5041
5042 * arm.cc (Arm_relocate_functions::thm_jump8,
5043 Arm_relocate_functions::thm_jump11): Use a wider signed
5044 type to compute offset.
5045 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5046 arm_thm_jump8.
5047 * testsuite/Makefile.in: Regenerate.
5048 * testsuite/arm_branch_in_range.sh: Check test results of
5049 arm_thm_jump11 and arm_thm_jump8.
5050 * testsuite/arm_thm_jump11.s: New test source file.
5051 * testsuite/arm_thm_jump11.t: New linker script.
5052 * testsuite/arm_thm_jump8.s: New test source file.
5053 * testsuite/arm_thm_jump8.t: New linker script.
5054
487b39df
ILT
50552011-06-24 Ian Lance Taylor <iant@google.com>
5056
5057 * layout.cc: Include "object.h".
5058 (ctors_sections_in_init_array): New static variable.
5059 (Layout::is_ctors_in_init_array): New function.
5060 (Layout::layout): Add entry to ctors_sections_in_init_array if
5061 appropriate.
5062 * layout.h (class Layout): Declare is_ctors_in_init_array.
5063 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5064 is_ctors_reverse_view is set.
5065 (Sized_relobj_file::write_sections): Add layout parameter. Change
5066 all callers. Set is_ctors_reverse_view field of View_size.
5067 (Sized_relobj_file::reverse_words): New function.
5068 * object.h (Sized_relobj_file::View_size): Add
5069 is_ctors_reverse_view field.
5070 (class Sized_relobj_file): Update declarations.
5071 * testsuite/initpri3.c: New test.
5072 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5073 initpri3b.
5074 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5075 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5076 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5077 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5078 * testsuite/Makefile.in: Rebuild.
5079
472076e4
CC
50802011-06-24 Cary Coutant <ccoutant@google.com>
5081
5082 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5083 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5084 (debug_msg_cdebug.err): New targets.
5085 * testsuite/Makefile.in: Regenerate.
5086 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5087 Fix checks for link with shared library.
5088
a60af0db
DK
50892011-06-24 Doug Kwan <dougkwan@google.com>
5090
5091 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5092 skip empty text sections.
5093 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5094
5393d741
ILT
50952011-06-22 Ian Lance Taylor <iant@google.com>
5096
5097 PR gold/12910
5098 * options.h (class General_options): Add --ctors-in-init-array.
5099 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5100 friends as SHT_PROGBITS for merging sections.
5101 (Layout::layout): Remove special handling of .init_array and
5102 friends. Don't sort if doing relocatable link. Sort for .ctors
5103 and .dtors if ctors_in_init_array.
5104 (Layout::make_output_section): Force correct section types for
5105 .init_array and friends. Don't sort if doing relocatable link,
5106 Don't sort .ctors and .dtors if ctors_in_init_array.
5107 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5108 (Layout::output_section_name): Add relobj parameter. Change all
5109 callers. Handle .ctors. and .dtors. in code rather than table.
5110 Handle .ctors and .dtors if ctors_in_init_array.
5111 (Layout::match_file_name): New function, moved from output.cc.
5112 * layout.h (class Layout): Update declarations.
5113 * output.cc: Include "layout.h".
5114 (Input_section_sort_entry::get_priority): New function.
5115 (Input_section_sort_entry::match_file_name): Just call
5116 Layout::match_file_name.
5117 (Output_section::Input_section_sort_init_fini_compare::operator()):
5118 Handle .ctors and .dtors. Sort by explicit priority rather than
5119 by name.
5120 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5121 * testsuite/initpri2.c: New test.
5122 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5123 (check_PROGRAMS): Add initpri2.
5124 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5125 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5126 * configure, testsuite/Makefile.in: Rebuild.
5127
e1f74f98
ILT
51282011-06-19 Ian Lance Taylor <iant@google.com>
5129
5130 PR gold/12880
5131 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5132 .interp section to a PT_INTERP segment even if we have seen a
5133 --dynamic-linker option. Don't do it if we have seen a PHDRS
5134 clause in a linker script.
5135 (Layout::finalize): Don't create a .interp section if we've
5136 already create a PT_INTERP segment.
5137 (Layout::create_interp): Always call choose_output_section (revert
5138 patch of 2011-06-17). Don't create PT_INTERP segment.
5139 * script-sections.cc
5140 (Script_sections::create_note_and_tls_segments): Add a .interp
5141 section to a PT_INTERP segment even if we have seen a
5142 --dynamic-linker option.
5143
766f91bb
ILT
51442011-06-18 Ian Lance Taylor <iant@google.com>
5145
5146 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5147 merely because a non-PT_LOAD segment has a dynamic reloc.
5148
0d212c3a
ILT
51492011-06-18 Ian Lance Taylor <iant@google.com>
5150
5151 * layout.cc (Layout::finish_dynamic_section): Don't create
5152 DT_FLAGS entry if not needed.
5153
911a5072
ILT
51542011-06-18 Ian Lance Taylor <iant@google.com>
5155
5156 PR gold/12745
5157 * layout.cc (Layout::layout_eh_frame): Correct handling of
5158 writable .eh_frame section.
5159
534b4e5f
ILT
51602011-06-17 Ian Lance Taylor <iant@google.com>
5161
5162 PR gold/12893
5163 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5164 symbol is redefined with the exact same object and value.
5165
10b4f102
ILT
51662011-06-17 Ian Lance Taylor <iant@google.com>
5167
5168 PR gold/12880
5169 * layout.h (class Layout): Add interp_segment_ field.
5170 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5171 (Layout::attach_allocated_section_to_segment): If making shared
5172 library, put .interp section in PT_INTERP segment.
5173 (Layout::finalize): Also call create_interp if -dynamic-linker
5174 option was used.
5175 (Layout::create_interp): Assert that there is no PT_INTERP
5176 segment. If not using a SECTIONS clause, use make_output_section.
5177 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5178 * script-sections.cc
5179 (Script_sections::create_note_and_tls_segments): If making shared
5180 library, put .interp section in PT_INTERP segment.
5181
a29b0dad
ILT
51822011-06-17 Ian Lance Taylor <iant@google.com>
5183
e588ea8d
ILT
5184 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5185 when making a shared library.
5186
51872011-06-17 Ian Lance Taylor <iant@google.com>
5188
5189 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5190 parameter. Change all callers. Don't issue warning about PC32
5191 against locally defined symbol.
a29b0dad 5192
9d3b0698
ILT
51932011-06-16 Ian Lance Taylor <iant@google.com>
5194
5195 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5196 occurs in same object.
5197
85b0f90c
AM
51982011-06-14 Alan Modra <amodra@gmail.com>
5199
5200 * po/POTFILES.in: Regenerate.
5201
a94907d9
ILT
52022011-06-09 Ian Lance Taylor <iant@google.com>
5203
5204 * script-sections.cc
5205 (Orphan_output_section::set_section_addresses): For a relocatable
5206 link set address to 0.
5207
4fb3a1c3
CC
52082011-06-09 Cary Coutant <ccoutant@google.com>
5209
5210 PR gold/12804
5211 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5212 used with --compress-debug-sections.
5213 * gold/object.cc (Sized_relobj_file::do_layout): Report
5214 uncompressed size of compressed input sections.
5215
61220854
CC
52162011-06-08 Cary Coutant <ccoutant@google.com>
5217
5218 PR gold/12804
5219 * testsuite/two_file_test_2_v1.cc: Change initialization of
5220 v2 to keep it in .data.
5221
e6455dfb
CC
52222011-06-07 Cary Coutant <ccoutant@google.com>
5223
5224 * common.cc (Symbol_table::do_allocate_commons_list): Call
5225 gold_fallback.
5226 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5227 (Errors::fallback): New function.
5228 (gold_fallback): New function.
5229 * errors.h (Errors::fallback): New function.
5230 * gold.cc (gold_exit): Change status parameter to enum; adjust
5231 all callers.
5232 (queue_initial_tasks): Call gold_fallback.
5233 * gold.h: Include cstdlib.
5234 (Exit_status): New enum type.
5235 (gold_exit): Change status parameter to enum.
5236 (gold_fallback): New function.
5237 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5238 (Layout::create_symtab_sections): Likewise.
5239 (Layout::create_shdrs): Likewise.
5240 * main.cc (main): Adjust call to gold_exit.
5241 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5242 (Output_data_got::add_got_entry_pair): Likewise.
5243 (Output_section::add_input_section): Likewise.
5244 (Output_section::add_output_section_data): Likewise.
5245 (Output_segment::set_section_list_addresses): Likewise.
5246 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5247
fb0e076f
CC
52482011-06-07 Cary Coutant <ccoutant@google.com>
5249
5250 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5251 for incremental links.
5252 * output.cc (Output_segment::set_section_list_addresses): Remove
5253 FIXME and test for TLS or BSS.
5254
a5ee4d5d
CC
52552011-06-07 Cary Coutant <ccoutant@google.com>
5256
5257 * testsuite/Makefile.am: Add incremental_copy_test,
5258 incremental_common_test_1.
5259 * testsuite/Makefile.in: Regenerate.
5260 * testsuite/common_test_1_v1.c: New source file.
5261 * testsuite/common_test_1_v2.c: New source file.
5262 * testsuite/copy_test_v1.cc: New source file.
5263
5146f448
CC
52642011-06-07 Cary Coutant <ccoutant@google.com>
5265
5266 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5267 update, allocate common from bss section's free list.
5268 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5269 linker-defined symbols.
5270 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5271 Skip GOT and PLT entries that are no longer referenced.
5272 (Output_section_incremental_inputs::write_info_blocks): Mark
5273 linker-defined symbols.
5274 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5275 * output.cc (Output_section::allocate): New function.
5276 * output.h (Output_section::allocate): New function.
5277 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5278 linker-defined symbols.
5279 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5280 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5281 (Symbol::init_base_output_data): Likewise.
5282 (Symbol::init_base_output_segment): Likewise.
5283 (Symbol::init_base_constant): Likewise.
5284 (Sized_symbol::init_output_data): Likewise.
5285 (Sized_symbol::init_output_segment): Likewise.
5286 (Sized_symbol::init_constant): Likewise.
5287 (Symbol_table::do_define_in_output_data): Likewise.
5288 (Symbol_table::do_define_in_output_segment): Likewise.
5289 (Symbol_table::do_define_as_constant): Likewise.
5290 * symtab.h (Symbol::is_predefined): New function.
5291 (Symbol::init_base_output_data): Add is_predefined parameter.
5292 (Symbol::init_base_output_segment): Likewise.
5293 (Symbol::init_base_constant): Likewise.
5294 (Symbol::is_predefined_): New data member.
5295 (Sized_symbol::init_output_data): Add is_predefined parameter.
5296 (Sized_symbol::init_output_segment): Likewise.
5297 (Sized_symbol::init_constant): Likewise.
5298 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5299
26d3c67d
CC
53002011-06-07 Cary Coutant <ccoutant@google.com>
5301
5302 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5303 instead of emit_copy_reloc.
5304 (Copy_relocs::emit_copy_reloc): Refactor.
5305 (Copy_relocs::make_copy_reloc): New function.
5306 (Copy_relocs::add_copy_reloc): Remove.
5307 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5308 section.
5309 (Copy_relocs::make_copy_reloc): New function.
5310 (Copy_relocs::add_copy_reloc): Remove.
5311 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5312 unchanged input files.
5313 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5314 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5315 Reserve BSS space for COPY relocations.
5316 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5317 (Output_section_incremental_inputs::write_info_blocks): Record
5318 whether a symbol is copied from a shared object.
5319 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5320 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5321 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5322 (Incremental_input_entry_reader::get_output_symbol_index): Add
5323 is_copy parameter.
5324 (Incremental_binary::emit_copy_relocs): New function.
5325 (Incremental_binary::do_emit_copy_relocs): New function.
5326 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5327 new data member.
5328 (Sized_incremental_binary::add_copy_reloc): New function.
5329 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5330 (Sized_incremental_binary::Copy_reloc): New struct.
5331 (Sized_incremental_binary::Copy_relocs): New typedef.
5332 (Sized_incremental_binary::copy_relocs_): New data member.
5333 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5334 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5335 * target.h (Sized_target::emit_copy_reloc): New function.
5336 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5337
7cdb37d9
CC
53382011-06-02 Cary Coutant <ccoutant@google.com>
5339
5340 PR gold/12163
5341 * gold/archive.cc (Archive::Archive): Initialize new data member.
5342 (Archive::include_all_members): Return if archive has already been
5343 included.
5344 * gold/archive.h (Archive::include_all_members_): New data member.
5345
cc643b88
NC
53462011-06-02 Nick Clifton <nickc@redhat.com>
5347
5348 * dynobj.h: Fix spelling mistake in comment.
5349 * output.cc: Likewise.
5350
f62a3ca7 53512011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5352 Asier Llano
f62a3ca7
DK
5353
5354 PR gold/12826
cc643b88 5355 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5356 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5357 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5358 redundant arm_exidx_test.so.
5359 * testsuite/Makefile.in: Regenerate.
5360 (check_SCRIPTS): Add pr12826.sh
5361 (check_DATA): Add pr12826.stdout
5362 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5363 * testsuite/pr12826.sh: New file.
5364 * testsuite/pr12826_1.s: Ditto.
5365 * testsuite/pr12826_1.s: Ditto.
5366
8dbe1edc
ILT
53672011-05-30 Ian Lance Taylor <iant@google.com>
5368
5369 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5370 sections.
5371
c49875be
ILT
53722011-05-29 Ian Lance Taylor <iant@google.com>
5373
5374 PR gold/12804
5375 * testsuite/Makefile.am: Use different file name for two_file_test
5376 temporary file for each incremental test.
5377 * testsuite/Makefile.in: Rebuild.
5378
69d53f7a
ILT
53792011-05-29 Ian Lance Taylor <iant@google.com>
5380
5381 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5382 binary input file is empty.
5383
41d0ab5f
ILT
53842011-05-27 Ian Lance Taylor <iant@google.com>
5385
5386 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5387 (ver_test_9.so): Likewise.
5388 * testsuite/Makefile.in: Rebuild.
5389
89d8a36b
CC
53902011-05-26 Cary Coutant <ccoutant@google.com>
5391
5392 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5393 * incremental.cc (Incremental_inputs::report_input_section): Fix
5394 comment, indentation.
5395 (Incremental_inputs::report_comdat_group): New function.
5396 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5397 of data for incremental input file entry.
5398 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5399 group count, COMDAT group signatures.
5400 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5401 an unchanged input file.
5402 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5403 Initialize new data member.
5404 (Incremental_object_entry::add_comdat_group): New function.
5405 (Incremental_object_entry::get_comdat_group_count): New function.
5406 (Incremental_object_entry::get_comdat_signature_key): New function.
5407 (Incremental_object_entry::groups_): New data member.
5408 (Incremental_inputs::report_comdat_group): New function.
5409 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5410 data for incremental input file entry.
5411 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5412 (Incremental_input_entry_reader::get_input_section): Adjust size of
5413 data for incremental input file entry.
5414 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5415 (Incremental_input_entry_reader::get_comdat_group_signature): New
5416 function.
5417 * object.cc (Sized_relobj::include_section_group): Report kept
5418 COMDAT groups for incremental links.
5419
1706a06f
ILT
54202011-05-24 David Meyer <pdox@google.com>
5421
5422 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5423 with name parameter. Add found_name parameter.
5424 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5425 * dirsearch.h (class Dirsearch): Update declaration.
5426
a10ae760
ILT
54272011-05-24 Ian Lance Taylor <iant@google.com>
5428
5429 * archive.cc (Library_base::should_include_member): Pull in object
5430 from archive if it defines the entry symbol.
5431 * parameters.cc (Parameters::entry): New function.
5432 * parameters.h (class Parameters): Declare entry.
5433 * output.h (class Output_file_header): Remove entry_ field.
5434 * output.cc (Output_file_header::Output_file_header): Remove entry
5435 parameter. Change all callers.
5436 (Output_file_header::entry): Use parameters->entry.
5437 * gold.cc (queue_middle_tasks): Likewise.
5438 * plugin.cc (Plugin_hook::run): Likewise.
5439
aa92d6ed
CC
54402011-05-24 Cary Coutant <ccoutant@google.com>
5441
5442 * gold.cc (queue_initial_tasks): Pass incremental base filename
5443 to Output_file::open_base_file; don't print error message.
5444 * incremental-dump.cc (main): Adjust call to
5445 Output_file::open_for_modification.
5446 * incremental-dump.cc (main): Likewise.
5447 * incremental.cc (Incremental_inputs::report_command_line):
5448 Ignore --incremental-base option when comparing command lines.
5449 Ignore parameter when given as separate argument.
5450 * options.h (class General_options): Add --incremental-base.
5451 * output.cc (Output_file::Output_file):
5452 (Output_file::open_base_file): Add base_name and writable parameters;
5453 read base file into new file; print error message here.
5454 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5455 callers.
5456 * output.h (Output_file::open_for_modification): Rename to...
5457 (Output_file::open_base_file): ...this; add base_name and
5458 writable parameters; adjust all callers.
5459 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5460 callers.
5461 * testsuite/Makefile.am (incremental_test_4): Test
5462 --incremental-base.
5463 * testsuite/Makefile.in: Regenerate.
5464
2eedd706
CC
54652011-05-24 Cary Coutant <ccoutant@google.com>
5466
5467 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5468 incremental_test_4.
5469 * testsuite/Makefile.in: Regenerate.
5470 * testsuite/two_file_test_1_v1.cc: New test source file.
5471 * testsuite/two_file_test_1b_v1.cc: New test source file.
5472 * testsuite/two_file_test_2_v1.cc: New test source file.
5473
0f1c85a6
CC
54742011-05-24 Cary Coutant <ccoutant@google.com>
5475
5476 * dynobj.h (Dynobj::do_dynobj): New function.
5477 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5478 flag and soname for shared objects.
5479 * incremental.cc (Incremental_inputs::report_object): Make
5480 either Incremental_object_entry or Incremental_dynobj_entry; add
5481 soname to string table.
5482 (Incremental_inputs::report_input_section): Add assertion.
5483 (Output_section_incremental_inputs::set_final_data_size): Adjust
5484 type of input file entry for shared libraries; adjust size of
5485 shared library info entry.
5486 (Output_section_incremental_inputs::write_input_files): Write
5487 as_needed flag for shared libraries.
5488 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5489 of input file entry for shared libraries; write soname.
5490 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5491 soname from incremental info.
5492 * incremental.h (enum Incremental_input_flags): Add
5493 INCREMENTAL_INPUT_AS_NEEDED.
5494 (Incremental_input_entry::Incremental_input_entry): Initialize new
5495 data member.
5496 (Incremental_input_entry::set_as_needed): New function.
5497 (Incremental_input_entry::as_needed): New function.
5498 (Incremental_input_entry::do_dynobj_entry): New function.
5499 (Incremental_input_entry::as_needed_): New data member.
5500 (Incremental_object_entry::Incremental_object_entry): Don't check
5501 for shared library.
5502 (Incremental_object_entry::do_type): Likewise.
5503 (class Incremental_dynobj_entry): New class.
5504 (Incremental_input_entry_reader::as_needed): New function.
5505 (Incremental_input_entry_reader::get_soname): New function.
5506 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5507 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5508 size of shared library info entry.
58797674 5509 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5510 incremental link when adding DT_NEEDED entries.
5511 * object.h (Object::Object): Initialize new data member.
5512 (Object::dynobj): New function.
5513 (Object::set_as_needed): New function.
5514 (Object::as_needed): New function.
5515 (Object::do_dynobj): New function.
5516 (Object::as_needed_): New data member.
5517
6fa2a40b
CC
55182011-05-24 Cary Coutant <ccoutant@google.com>
5519
5520 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5521 info; adjust display of GOT entries.
5522 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5523 vector of input objects; remove file_status_.
5524 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5525 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5526 got_plt reader; call target hooks to reserve GOT entries.
5527 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5528 of input file info header and GOT info entry.
5529 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5530 relocation info.
5531 (Got_plt_view_info::got_descriptor): Remove.
5532 (Got_plt_view_info::sym_index): New data member.
5533 (Got_plt_view_info::input_index): New data member.
5534 (Local_got_offset_visitor::visit): Write input file index.
5535 (Global_got_offset_visitor::visit): Write 0 for input file index.
5536 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5537 with sym_index and input_index.
5538 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5539 incremental info GOT entry; replace got_descriptor with input_index.
5540 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5541 map from input file index to object.
5542 (Sized_relobj_incr::do_layout): Replace direct data member reference
5543 with accessor function.
5544 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5545 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5546 Adjust size of input file info header.
5547 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5548 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5549 (Incremental_input_entry_reader::get_input_section): Adjust size of
5550 input file info header.
5551 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5552 of incremental info GOT entry.
5553 (Incremental_got_plt_reader::get_got_desc): Remove.
5554 (Incremental_got_plt_reader::get_got_symndx): New function.
5555 (Incremental_got_plt_reader::get_got_input_index): New function.
5556 (Sized_incremental_binary::Sized_incremental_binary): Remove
5557 file_status_; add input_objects_.
5558 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5559 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5560 (Sized_incremental_binary::file_is_unchanged): Remove.
5561 (Sized_incremental_binary::set_input_object): New function.
5562 (Sized_incremental_binary::input_object): New function.
5563 (Sized_incremental_binary::file_status_): Remove.
5564 (Sized_incremental_binary::input_objects_): New data member.
5565 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5566 references.
5567 (Sized_relobj_incr::invalid_address): Move to base class.
5568 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5569 class.
5570 (Sized_relobj_incr::do_output_section_offset): Likewise.
5571 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5572 (Sized_relobj_incr::section_offsets_): Likewise.
5573 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5574 function.
5575 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5576 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5577 with accessor function.
5578 (Sized_relobj_file::do_layout): Likewise.
5579 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5580 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5581 (Sized_relobj_file::compute_final_local_value): Replace refs to
5582 section_offsets_ with accessor function.
5583 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5584 * object.h (Relobj::Relobj): Initialize new data members.
5585 (Relobj::add_dyn_reloc): New function.
5586 (Relobj::first_dyn_reloc): New function.
5587 (Relobj::dyn_reloc_count): New function.
5588 (Relobj::first_dyn_reloc_): New data member.
5589 (Relobj::dyn_reloc_count_): New data member.
5590 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5591 references.
5592 (Sized_relobj::Address): New typedef.
5593 (Sized_relobj::invalid_address): Move here from child class.
5594 (Sized_relobj::Sized_relobj): Initialize new data members.
5595 (Sized_relobj::sized_relobj): New function.
5596 (Sized_relobj::is_output_section_offset_invalid): Move here from
5597 child class.
5598 (Sized_relobj::get_output_section_offset): Likewise.
5599 (Sized_relobj::local_has_got_offset): Likewise.
5600 (Sized_relobj::local_got_offset): Likewise.
5601 (Sized_relobj::set_local_got_offset): Likewise.
5602 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5603 (Sized_relobj::clear_got_offsets): New function.
5604 (Sized_relobj::section_offsets): Move here from child class.
5605 (Sized_relobj::do_output_section_offset): Likewise.
5606 (Sized_relobj::do_set_section_offset): Likewise.
5607 (Sized_relobj::Local_got_offsets): Likewise.
5608 (Sized_relobj::local_got_offsets_): Likewise.
5609 (Sized_relobj::section_offsets_): Likewise.
5610 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5611 references.
5612 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5613 class.
5614 (Sized_relobj_file::sized_relobj): New function
5615 (Sized_relobj_file::local_has_got_offset): Move to base class.
5616 (Sized_relobj_file::local_got_offset): Likewise.
5617 (Sized_relobj_file::set_local_got_offset): Likewise.
5618 (Sized_relobj_file::get_output_section_offset): Likewise.
5619 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5620 (Sized_relobj_file::do_output_section_offset): Likewise.
5621 (Sized_relobj_file::do_set_section_offset): Likewise.
5622 (Sized_relobj_file::Local_got_offsets): Likewise.
5623 (Sized_relobj_file::local_got_offsets_): Likewise.
5624 (Sized_relobj_file::section_offsets_): Likewise.
5625 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5626 (all constructors).
5627 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5628 (Output_reloc::get_symbol_index): Likewise.
5629 (Output_reloc::local_section_offset): Likewise.
5630 (Output_reloc::get_address): Likewise.
5631 (Output_reloc::symbol_value): Likewise.
5632 (Output_data_got::reserve_slot): Move to class definition.
5633 (Output_data_got::reserve_local): New function.
5634 (Output_data_got::reserve_slot_for_global): Remove.
5635 (Output_data_got::reserve_global): New function.
5636 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5637 (all constructors, two instantiations).
5638 (Output_reloc::get_relobj): New function (two instantiations).
5639 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5640 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5641 (Output_data_reloc::add_global): Adjust type of relobj.
5642 (Output_data_reloc::add_global_relative): Likewise.
5643 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5644 (Output_data_reloc::add_local): Likewise.
5645 (Output_data_reloc::add_local_relative): Likewise.
5646 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5647 (Output_data_reloc::add_local_section): Likewise.
5648 (Output_data_reloc::add_output_section): Likewise.
5649 (Output_data_reloc::add_absolute): Likewise.
5650 (Output_data_reloc::add_target_specific): Likewise.
5651 (Output_data_got::reserve_slot): Move definition here.
5652 (Output_data_got::reserve_local): New function.
5653 (Output_data_got::reserve_global): New function.
5654 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5655 section_offsets_ with accessor function.
5656 (Sized_relobj_file::write_sections): Likewise.
5657 (Sized_relobj_file::do_relocate_sections): Likewise.
5658 * target.h (Sized_target::reserve_local_got_entry): New function.
5659 (Sized_target::reserve_global_got_entry): New function.
5660 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5661 (Target_x86_64::reserve_global_got_entry): New function.
5662 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5663
4829d394
CC
56642011-05-23 Cary Coutant <ccoutant@google.com>
5665
5666 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5667 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5668 bit when checking got_type.
5669 * incremental.cc (Sized_incremental_binary::setup_readers):
5670 Store symbol table and string table locations; initialize bit vector
5671 of file status flags.
5672 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5673 unchanged files.
5674 (Sized_incremental_binary::do_process_got_plt): New function.
5675 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5676 (Output_section_incremental_inputs::set_final_data_size): Record
5677 file index for each input file.
5678 (Output_section_incremental_inputs::write_got_plt): Store file index
5679 instead of input entry offset for each GOT entry.
5680 * incremental.h
5681 (Incremental_input_entry::Incremental_input_entry): Initialize new
5682 data member.
5683 (Incremental_input_entry::set_offset): Store file index.
5684 (Incremental_input_entry::get_file_index): New function.
5685 (Incremental_input_entry::file_index_): New data member.
5686 (Incremental_binary::process_got_plt): New function.
5687 (Incremental_binary::do_process_got_plt): New function.
5688 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5689 data members.
5690 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5691 (Sized_incremental_binary::set_file_is_unchanged): New function.
5692 (Sized_incremental_binary::file_is_unchanged): New function.
5693 (Sized_incremental_binary::do_process_got_plt): New function.
5694 (Sized_incremental_binary::file_status_): New data member.
5695 (Sized_incremental_binary::main_symtab_loc_): New data member.
5696 (Sized_incremental_binary::main_strtab_loc_): New data member.
5697 * output.cc (Output_data_got::Got_entry::write): Add case
5698 RESERVED_CODE.
5699 (Output_data_got::add_global): Call add_got_entry.
5700 (Output_data_got::add_global_plt): Likewise.
5701 (Output_data_got::add_global_with_rel): Likewise.
5702 (Output_data_got::add_global_with_rela): Likewise.
5703 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5704 (Output_data_got::add_global_pair_with_rela): Likewise.
5705 (Output_data_got::add_local): Call add_got_entry.
5706 (Output_data_got::add_local_plt): Likewise.
5707 (Output_data_got::add_local_with_rel): Likewise.
5708 (Output_data_got::add_local_with_rela): Likewise.
5709 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5710 (Output_data_got::add_local_pair_with_rela): Likewise.
5711 (Output_data_got::reserve_slot): New function.
5712 (Output_data_got::reserve_slot_for_global): New function.
5713 (Output_data_got::add_got_entry): New function.
5714 (Output_data_got::add_got_entry_pair): New function.
5715 (Output_section::add_output_section_data): Edit FIXME.
5716 * output.h
5717 (Output_section_data_build::Output_section_data_build): New
5718 constructor with size parameter.
5719 (Output_data_space::Output_data_space): Likewise.
5720 (Output_data_got::Output_data_got): Initialize new data member; new
5721 constructor with size parameter.
5722 (Output_data_got::add_constant): Call add_got_entry.
5723 (Output_data_got::reserve_slot): New function.
5724 (Output_data_got::reserve_slot_for_global): New function.
5725 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5726 (Output_data_got::add_got_entry): New function.
5727 (Output_data_got::add_got_entry_pair): New function.
5728 (Output_data_got::free_list_): New data member.
5729 * target.h (Sized_target::init_got_plt_for_update): New function.
5730 (Sized_target::register_global_plt_entry): New function.
5731 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5732 Initialize new data member; call init; add constructor with PLT count.
5733 (Output_data_plt_x86_64::init): New function.
5734 (Output_data_plt_x86_64::add_relocation): New function.
5735 (Output_data_plt_x86_64::reserve_slot): New function.
5736 (Output_data_plt_x86_64::free_list_): New data member.
5737 (Target_x86_64::init_got_plt_for_update): New function.
5738 (Target_x86_64::register_global_plt_entry): New function.
5739 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5740 incremental updates.
5741 (Output_data_plt_x86_64::add_relocation): New function.
5742 * testsuite/object_unittest.cc (Object_test): Set default options.
5743
ec69d6da
ILT
57442011-05-16 Ian Lance Taylor <iant@google.com>
5745
5746 * options.h (class General_options): Make -i a synonym for -r.
5747
732e31de
ILT
57482011-05-16 Ian Lance Taylor <iant@google.com>
5749
5750 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5751
403676b5
CC
57522011-05-10 Cary Coutant <ccoutant@google.com>
5753
5754 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5755 strip_all (-s).
5756
5b7b7d6e
ILT
57572011-05-06 Ian Lance Taylor <iant@google.com>
5758
5759 * layout.cc (Layout::layout): If the output section flags change,
5760 update the ordering.
5761
f0f9babf
CC
57622011-04-25 Cary Coutant <ccoutant@google.com>
5763
5764 * incremental-dump.cc (dump_incremental_inputs): Print local
5765 symbol info for each input file.
5766 * incremental.cc
5767 (Output_section_incremental_inputs::set_final_data_size): Add local
5768 symbol info to input file entries in incremental info.
5769 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5770 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5771 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5772 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5773 implementation.
5774 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5775 (Sized_incr_relobj::do_relocate): Write the local symbols.
5776 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5777 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5778 Adjust size of input file header.
5779 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5780 (Incremental_inputs_reader::get_local_symbol_count): New function.
5781 (Incremental_inputs_reader::get_input_section): Adjust size of input
5782 file header.
5783 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5784 (Sized_incr_relobj::This): New typedef.
5785 (Sized_incr_relobj::sym_size): New const data member.
5786 (Sized_incr_relobj::Local_symbol): New struct.
5787 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5788 (Sized_incr_relobj::do_local_symbol_offset): New function.
5789 (Sized_incr_relobj::local_symbol_count_): New data member.
5790 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5791 (Sized_incr_relobj::local_symbol_index_): New data member.
5792 (Sized_incr_relobj::local_symbol_offset_): New data member.
5793 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5794 (Sized_incr_relobj::local_symbols_): New data member.
5795 * object.h (Relobj::output_local_symbol_count): New function.
5796 (Relobj::local_symbol_offset): New function.
5797 (Relobj::do_output_local_symbol_count): New function.
5798 (Relobj::do_local_symbol_offset): New function.
5799 (Sized_relobj::do_output_local_symbol_count): New function.
5800 (Sized_relobj::do_local_symbol_offset): New function.
5801
d0a9ace3
ILT
58022011-04-22 Vladimir Simonov <sv@sw.ru>
5803
5804 * descriptors.cc (set_close_on_exec): New function.
5805 (Descriptors::open): Use set_close_on_exec.
5806 * output.cc (S_ISLNK): Define if not defined.
5807
94a3fc8b
CC
58082011-04-22 Cary Coutant <ccoutant@google.com>
5809
5810 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5811 global symbol map.
5812 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5813 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5814 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5815 relocations.
5816 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5817 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5818 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5819 * incremental.h
5820 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5821 function.
5822 (Incremental_binary::apply_incremental_relocs): New function.
5823 (Incremental_binary::do_apply_incremental_relocs): New function.
5824 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5825 data member.
5826 (Sized_incremental_binary::add_global_symbol): New function.
5827 (Sized_incremental_binary::global_symbol): New function.
5828 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5829 (Sized_incremental_binary::symbol_map_): New data member.
5830 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5831 * target.h (Sized_target::apply_relocation): New function.
5832 * target-reloc.h (apply_relocation): New function.
5833 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5834
c87e4302
DK
58352011-04-22 Doug Kwan <dougkwan@google.com>
5836
5837 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5838 flag of a SHT_ARM_EXIDX section.
2e702c99 5839 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5840 * testsuite/Makefile.in: Regenerate.
5841 * testsuite/arm_exidx_test.s: New file.
5842 * testsuite/arm_exidx_test.sh: Same.
5843
e7782cf6
CC
58442011-04-20 Cary Coutant <ccoutant@google.com>
5845
5846 PR gold/12689
5847 * archive.h (Incremental_archive_entry::Archive_member):
5848 Initialize arg_serial_ (second constructor).
5849
308ecdc7
ILT
58502011-04-17 Ian Lance Taylor <iant@google.com>
5851
5852 * object.cc (Relocate_info::location): Simplify location string.
5853 * errors.cc (Errors::error_at_location): Don't print program
5854 name.
5855 (Errors::warning_at_location): Likewise.
5856 (Errors::undefined_symbol): Likewise.
5857 * testsuite/debug_msg.sh: Update accordingly.
5858
bec5b579
CC
58592011-04-14 Cary Coutant <ccoutant@google.com>
5860
5861 * gold/layout.cc (Layout::symtab_section_offset): New function.
5862 * gold/layout.h (Layout::symtab_section_offset): New function.
5863 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5864
88597d34
ILT
58652011-04-12 Ian Lance Taylor <iant@google.com>
5866
5867 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5868 with MREMAP_MAYMOVE.
5869 * output.h (class Output_file): Add map_is_allocated_ field.
5870 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5871 not available, provide stubs. If mremap is not available, #define
5872 it to gold_mremap.
5873 (MREMAP_MAYMOVE): Define if not defined.
5874 (Output_file::Output_file): Initialize map_is_allocated_.
5875 (Output_file::resize): Check map_is_allocated_.
5876 (Output_file::map_anonymous): If mmap fails, use malloc.
5877 (Output_file::unmap): Don't do anything for an anonymous map.
5878 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5879 is not available, provide stubs.
5880 (File_read::View::~View): Use free rather than delete[].
5881 (File_read::make_view): Use malloc rather than new[]. If mmap
5882 fails, use malloc.
5883 (File_read::find_or_make_view): Use malloc rather than new[].
5884 * gold.h: Remove HAVE_REMAP code.
5885 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5886 exists. Rename mremap to gold_mremap. If mmap is not available
5887 don't do anything.
5888 * configure, config.in: Rebuild.
5889
11e361bc
ILT
58902011-04-11 Ian Lance Taylor <iant@google.com>
5891
5892 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5893 initialize local variable v.
5894
cdc29364
CC
58952011-04-11 Cary Coutant <ccoutant@google.com>
5896
5897 * archive.cc (Archive::include_member): Adjust call to
5898 report_object.
5899 (Add_archive_symbols::run): Track argument serial numbers.
5900 (Lib_group::include_member): Likewise.
5901 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5902 * archive.h (Incremental_archive_entry::Archive_member):
5903 Initialize arg_serial_.
5904 (Archive_member::arg_serial_): New data member.
5905 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5906 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5907 incremental link.
5908 (Sized_dynobj::do_for_all_local_got_entries): New function.
5909 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5910 function.
5911 * fileread.cc (get_mtime): New function.
5912 * fileread.h (get_mtime): New function.
5913 * gold.cc (queue_initial_tasks): Check for incremental update.
5914 (process_incremental_input): New function.
5915 (queue_middle_tasks): Don't force valid target for incremental
5916 update.
5917 * incremental-dump.cc (find_input_containing_global): Adjust
5918 size of symbol info entry.
5919 (dump_incremental_inputs): Dump argument serial number and
5920 in_system_directory flag; bias shndx by 1; print symbol names
5921 when dumping per-file symbol lists; use new symbol info readers.
5922 * incremental.cc
5923 (Output_section_incremental_inputs:update_data_size): New function.
5924 (Sized_incremental_binary::setup_readers): Setup input readers
5925 for each input file; build maps for files added from libraries
5926 and scripts.
5927 (Sized_incremental_binary::check_input_args): New function.
5928 (Sized_incremental_binary::do_check_inputs): Build map of argument
5929 serial numbers to input arguments.
5930 (Sized_incremental_binary::do_file_has_changed): Rename
5931 do_file_is_unchanged to this; compare file modification times.
5932 (Sized_incremental_binary::do_init_layout): New function.
5933 (Sized_incremental_binary::do_reserve_layout): New function.
5934 (Sized_incremental_binary::do_get_input_reader): Remove.
5935 (Sized_incremental_binary::get_symtab_view): New function.
5936 (Incremental_checker::can_incrementally_link_output_file): Remove.
5937 (Incremental_inputs::report_command_line): Exclude --debug options.
5938 (Incremental_inputs::report_archive_begin): Add parameter; track
5939 argument serial numbers; don't put input file entry for archive
5940 before archive members.
5941 (Incremental_inputs::report_archive_end): Put input file entry
5942 for archive after archive members.
5943 (Incremental_inputs::report_object): Add parameter; track argument
5944 serial numbers and in_system_directory flag.
5945 (Incremental_inputs::report_script): Add parameter; track argument
5946 serial numbers.
5947 (Output_section_incremental_inputs::set_final_data_size): Adjust
5948 size of symbol info entry; check for forwarding symbols.
5949 (Output_section_incremental_inputs::write_input_files): Write
5950 in_system_directory flag and argument serial number.
5951 (Output_section_incremental_inputs::write_info_blocks): Map section
5952 indices between incremental info and original input file; store
5953 input section index for each symbol.
5954 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5955 change operator() to visit().
5956 (class Global_got_offset_visitor): Likewise.
5957 (class Global_symbol_visitor_got_plt):
5958 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5959 classes.
5960 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5961 (Sized_incr_relobj::do_read_symbols): New function.
5962 (Sized_incr_relobj::do_layout): New function.
5963 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5964 (Sized_incr_relobj::do_add_symbols): New function.
5965 (Sized_incr_relobj::do_should_include_member): New function.
5966 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5967 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5968 (Sized_incr_relobj::do_section_size): New function.
5969 (Sized_incr_relobj::do_section_name): New function.
5970 (Sized_incr_relobj::do_section_contents): New function.
5971 (Sized_incr_relobj::do_section_flags): New function.
5972 (Sized_incr_relobj::do_section_entsize): New function.
5973 (Sized_incr_relobj::do_section_address): New function.
5974 (Sized_incr_relobj::do_section_type): New function.
5975 (Sized_incr_relobj::do_section_link): New function.
5976 (Sized_incr_relobj::do_section_info): New function.
5977 (Sized_incr_relobj::do_section_addralign): New function.
5978 (Sized_incr_relobj::do_initialize_xindex): New function.
5979 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5980 (Sized_incr_relobj::do_read_relocs): New function.
5981 (Sized_incr_relobj::do_gc_process_relocs): New function.
5982 (Sized_incr_relobj::do_scan_relocs): New function.
5983 (Sized_incr_relobj::do_count_local_symbols): New function.
5984 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5985 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5986 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5987 (Sized_incr_relobj::do_relocate): New function.
5988 (Sized_incr_relobj::do_set_section_offset): New function.
5989 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5990 (Sized_incr_dynobj::do_read_symbols): New function.
5991 (Sized_incr_dynobj::do_layout): New function.
5992 (Sized_incr_dynobj::do_add_symbols): New function.
5993 (Sized_incr_dynobj::do_should_include_member): New function.
5994 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5995 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5996 (Sized_incr_dynobj::do_section_size): New function.
5997 (Sized_incr_dynobj::do_section_name): New function.
5998 (Sized_incr_dynobj::do_section_contents): New function.
5999 (Sized_incr_dynobj::do_section_flags): New function.
6000 (Sized_incr_dynobj::do_section_entsize): New function.
6001 (Sized_incr_dynobj::do_section_address): New function.
6002 (Sized_incr_dynobj::do_section_type): New function.
6003 (Sized_incr_dynobj::do_section_link): New function.
6004 (Sized_incr_dynobj::do_section_info): New function.
6005 (Sized_incr_dynobj::do_section_addralign): New function.
6006 (Sized_incr_dynobj::do_initialize_xindex): New function.
6007 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6008 (make_sized_incremental_object): New function.
6009 (Incremental_library::copy_unused_symbols): New function.
6010 (Incremental_library::do_for_all_unused_symbols): New function.
6011 * incremental.h (enum Incremental_input_flags): New type.
6012 (class Incremental_checker): Remove.
6013 (Incremental_input_entry::Incremental_input_entry): Add argument
6014 serial number.
6015 (Incremental_input_entry::arg_serial): New function.
6016 (Incremental_input_entry::set_is_in_system_directory): New function.
6017 (Incremental_input_entry::is_in_system_directory): New function.
6018 (Incremental_input_entry::arg_serial_): New data member.
6019 (Incremental_input_entry::is_in_system_directory_): New data member.
6020 (class Script_info): Move here from script.h.
6021 (Script_info::Script_info): Add filename parameter.
6022 (Script_info::filename): New function.
6023 (Script_info::filename_): New data member.
6024 (Incremental_script_entry::Incremental_script_entry): Add argument
6025 serial number.
6026 (Incremental_object_entry::Incremental_object_entry): Likewise.
6027 (Incremental_object_entry::add_input_section): Build list of input
6028 sections with map to original shndx.
6029 (Incremental_object_entry::get_input_section_index): New function.
6030 (Incremental_object_entry::shndx_): New data member.
6031 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6032 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6033 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6034 serial number.
6035 (Incremental_inputs::report_archive_begin): Likewise.
6036 (Incremental_inputs::report_object): Likewise.
6037 (Incremental_inputs::report_script): Likewise.
6038 (class Incremental_global_symbol_reader): New class.
6039 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6040 and store flags and input file type.
6041 (Incremental_input_entry_reader::arg_serial): New function.
6042 (Incremental_input_entry_reader::type): Extract type from flags.
6043 (Incremental_input_entry_reader::is_in_system_directory): New function.
6044 (Incremental_input_entry_reader::get_input_section_count): Call
6045 accessor function for type.
6046 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6047 function for type; adjust size of global symbol entry.
6048 (Incremental_input_entry_reader::get_global_symbol_count): Call
6049 accessor function for type.
6050 (Incremental_input_entry_reader::get_object_count): Likewise.
6051 (Incremental_input_entry_reader::get_object_offset): Likewise.
6052 (Incremental_input_entry_reader::get_member_count): Likewise.
6053 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6054 (Incremental_input_entry_reader::get_member_offset): Likewise.
6055 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6056 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6057 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6058 (Incremental_input_entry_reader::get_global_symbol_reader): New
6059 function.
6060 (Incremental_input_entry_reader::get_output_symbol_index): New
6061 function.
6062 (Incremental_input_entry_reader::type_): Remove.
6063 (Incremental_input_entry_reader::flags_): New data member.
6064 (Incremental_inputs_reader::input_file_offset): New function.
6065 (Incremental_inputs_reader::input_file_index): New function.
6066 (Incremental_inputs_reader::input_file): Call input_file_offset.
6067 (Incremental_inputs_reader::input_file_at_offset): New function.
6068 (Incremental_relocs_reader::get_r_type): Reformat.
6069 (Incremental_relocs_reader::get_r_shndx): Reformat.
6070 (Incremental_relocs_reader::get_r_offset): Reformat.
6071 (Incremental_relocs_reader::data): New function.
6072 (Incremental_binary::Incremental_binary): Initialize new data members.
6073 (Incremental_binary::check_inputs): Add cmdline parameter.
6074 (Incremental_binary::file_is_unchanged): Remove.
6075 (Input_reader::arg_serial): New function.
6076 (Input_reader::get_unused_symbol_count): New function.
6077 (Input_reader::get_unused_symbol): New function.
6078 (Input_reader::do_arg_serial): New function.
6079 (Input_reader::do_get_unused_symbol_count): New function.
6080 (Input_reader::do_get_unused_symbol): New function.
6081 (Incremental_binary::input_file_count): New function.
6082 (Incremental_binary::get_input_reader): Change signature to use
6083 index instead of filename.
6084 (Incremental_binary::file_has_changed): New function.
6085 (Incremental_binary::get_input_argument): New function.
6086 (Incremental_binary::get_library): New function.
6087 (Incremental_binary::get_script_info): New function.
6088 (Incremental_binary::init_layout): New function.
6089 (Incremental_binary::reserve_layout): New function.
6090 (Incremental_binary::output_file): New function.
6091 (Incremental_binary::do_check_inputs): New function.
6092 (Incremental_binary::do_file_is_unchanged): Remove.
6093 (Incremental_binary::do_file_has_changed): New function.
6094 (Incremental_binary::do_init_layout): New function.
6095 (Incremental_binary::do_reserve_layout): New function.
6096 (Incremental_binary::do_input_file_count): New function.
6097 (Incremental_binary::do_get_input_reader): Change signature.
6098 (Incremental_binary::input_args_map_): New data member.
6099 (Incremental_binary::library_map_): New data member.
6100 (Incremental_binary::script_map_): New data member.
6101 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6102 new data members.
6103 (Sized_incremental_binary::output_section): New function.
6104 (Sized_incremental_binary::inputs_reader): Add const.
6105 (Sized_incremental_binary::symtab_reader): Add const.
6106 (Sized_incremental_binary::relocs_reader): Add const.
6107 (Sized_incremental_binary::got_plt_reader): Add const.
6108 (Sized_incremental_binary::get_symtab_view): New function.
6109 (Sized_incremental_binary::Inputs_reader): New typedef.
6110 (Sized_incremental_binary::Input_entry_reader): New typedef.
6111 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6112 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6113 (Sized_incremental_binary::do_file_has_changed): New function.
6114 (Sized_incremental_binary::do_init_layout): New function.
6115 (Sized_incremental_binary::do_reserve_layout): New function.
6116 (Sized_input_reader::Inputs_reader): Remove.
6117 (Sized_input_reader::Input_entry_reader): Remove.
6118 (Sized_input_reader::do_arg_serial): New function.
6119 (Sized_input_reader::do_get_unused_symbol_count): New function.
6120 (Sized_input_reader::do_get_unused_symbol): New function.
6121 (Sized_incremental_binary::do_input_file_count): New function.
6122 (Sized_incremental_binary::do_get_input_reader): Change signature;
6123 use index instead of filename.
6124 (Sized_incremental_binary::section_map_): New data member.
6125 (Sized_incremental_binary::input_entry_readers_): New data member.
6126 (class Sized_incr_relobj): New class.
6127 (class Sized_incr_dynobj): New class.
6128 (make_sized_incremental_object): New function.
6129 (class Incremental_library): New class.
6130 * layout.cc (Free_list::num_lists): New static data member.
6131 (Free_list::num_nodes): New static data member.
6132 (Free_list::num_removes): New static data member.
6133 (Free_list::num_remove_visits): New static data member.
6134 (Free_list::num_allocates): New static data member.
6135 (Free_list::num_allocate_visits): New static data member.
6136 (Free_list::init): New function.
6137 (Free_list::remove): New function.
6138 (Free_list::allocate): New function.
6139 (Free_list::dump): New function.
6140 (Free_list::print_stats): New function.
6141 (Layout_task_runner::run): Resize output file for incremental updates.
6142 (Layout::Layout): Initialize new data members.
6143 (Layout::set_incremental_base): New function.
6144 (Layout::init_fixed_output_section): New function.
6145 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6146 incremental updates.
6147 (Layout::create_gold_note): Do not create gold note section for
6148 incremental updates.
6149 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6150 for incremental updates.
6151 (Layout::set_section_offsets): For incremental updates, allocate space
6152 from free list.
6153 (Layout::create_symtab_sections): Layout with offsets relative to
6154 start of section; for incremental updates, allocate space from free
6155 list.
6156 (Layout::create_shdrs): For incremental updates, allocate space from
6157 free list.
6158 (Layout::finish_dynamic_section): For incremental updates, do not
6159 check --as-needed (fixed in subsequent patch).
6160 * layout.h (class Free_list): New class.
6161 (Layout::set_incremental_base): New function.
6162 (Layout::incremental_base): New function.
6163 (Layout::init_fixed_output_section): New function.
6164 (Layout::allocate): New function.
6165 (Layout::incremental_base_): New data member.
6166 (Layout::free_list_): New data member.
6167 * main.cc (main): Print Free_list statistics.
6168 * object.cc (Relobj::finalize_incremental_relocs): Add
6169 clear_counts parameter; clear counts only when clear_counts is set.
6170 (Sized_relobj::Sized_relobj): Initialize new base class.
6171 (Sized_relobj::do_layout): Don't report special sections.
6172 (Sized_relobj::do_for_all_local_got_entries): New function.
6173 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6174 symtab_off to all symbol table offsets.
6175 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6176 * object.h (class Got_offset_list): Move to top of file.
6177 (Object::Object): Allow case where input_file == NULL.
6178 (Object::~Object): Likewise.
6179 (Object::input_file): Assert that input_file != NULL.
6180 (Object::lock): Allow case where input_file == NULL.
6181 (Object::unlock): Likewise.
6182 (Object::is_locked): Likewise.
6183 (Object::token): Likewise.
6184 (Object::release): Likewise.
6185 (Object::is_incremental): New function.
6186 (Object::get_mtime): New function.
6187 (Object::for_all_local_got_entries): New function.
6188 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6189 (Object::set_is_in_system_directory): New function.
6190 (Object::is_in_system_directory): New function.
6191 (Object::do_is_incremental): New function.
6192 (Object::do_get_mtime): New function.
6193 (Object::do_for_all_local_got_entries): New function.
6194 (Object::is_in_system_directory_): New data member.
6195 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6196 (class Sized_relobj_base): New class.
6197 (class Sized_relobj): Derive from Sized_relobj_base.
6198 (class Sized_relobj::Symbols): Redeclare from base class.
6199 (class Sized_relobj::local_got_offset_list): Remove.
6200 (class Sized_relobj::Output_sections): Redeclare from base class.
6201 (class Sized_relobj::do_for_all_local_got_entries): New function.
6202 (class Sized_relobj::write_local_symbols): Add offset parameter.
6203 (class Sized_relobj::local_symbol_offset_): Update comment.
6204 (class Sized_relobj::local_dynsym_offset_): Update comment.
6205 * options.cc (Input_arguments::add_file): Remove const.
6206 * options.h (Input_file_argument::Input_file_argument):
6207 Initialize arg_serial_ (all constructors).
6208 (Input_file_argument::set_arg_serial): New function.
6209 (Input_file_argument::arg_serial): New function.
6210 (Input_file_argument::arg_serial_): New data member.
6211 (Input_arguments::Input_arguments): Initialize file_count_.
6212 (Input_arguments::add_file): Remove const.
6213 (Input_arguments::number_of_input_files): New function.
6214 (Input_arguments::file_count_): New data member.
6215 (Command_line::number_of_input_files): Call
6216 Input_arguments::number_of_input_files.
6217 * output.cc (Output_segment_headers::Output_segment_headers):
6218 Set current size.
6219 (Output_section::Input_section::current_data_size): New function.
6220 (Output_section::Output_section): Initialize new data members.
6221 (Output_section::add_input_section): Don't do merge sections for
6222 an incremental link; allocate space from free list for an
6223 incremental update.
6224 (Output_section::add_output_section_data): Allocate space from
6225 free list for an incremental update.
6226 (Output_section::update_data_size): New function.
6227 (Output_section::set_fixed_layout): New function.
6228 (Output_section::reserve): New function.
6229 (Output_segment::set_section_addresses): Remove const.
6230 (Output_segment::set_section_list_addresses): Remove const; allocate
6231 space from free list for an incremental update.
6232 (Output_segment::set_offset): Adjust size of RELRO segment for an
6233 incremental update.
6234 * output.h (Output_data::current_data_size): Move here from
6235 child classes.
6236 (Output_data::pre_finalize_data_size): New function.
6237 (Output_data::update_data_size): New function.
6238 (Output_section_headers::update_data_size): new function.
6239 (Output_section_data_build::current_data_size): Move to Output_data.
6240 (Output_data_strtab::update_data_size): New function.
6241 (Output_section::current_data_size): Move to Output_data.
6242 (Output_section::set_fixed_layout): New function.
6243 (Output_section::has_fixed_layout): New function.
6244 (Output_section::reserve): New function.
6245 (Output_section::update_data_size): New function.
6246 (Output_section::has_fixed_layout_): New data member.
6247 (Output_section::free_list_): New data member.
6248 (Output_segment::set_section_addresses): Remove const.
6249 (Output_segment::set_section_list_addresses): Remove const.
6250 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6251 New function.
6252 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6253 New function.
6254 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6255 parameter when calling Add_symbols constructor; store argument
6256 serial number for members of a lib group.
6257 (Add_symbols::locks): Allow case where token == NULL.
6258 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6259 (Read_member::~Read_member): New function.
6260 (Read_member::is_runnable): New function.
6261 (Read_member::locks): New function.
6262 (Read_member::run): New function.
6263 (Check_script::~Check_script): New function.
6264 (Check_script::is_runnable): New function.
6265 (Check_script::locks): New function.
6266 (Check_script::run): New function.
6267 (Check_library::~Check_library): New function.
6268 (Check_library::is_runnable): New function.
6269 (Check_library::locks): New function.
6270 (Check_library::run): New function.
6271 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6272 (Add_symbols::library_): New data member.
6273 (class Read_member): New class.
6274 (class Check_script): New class.
6275 (class Check_library): New class.
6276 * reloc.cc (Read_relocs::is_runnable): Allow case where
6277 token == NULL.
6278 (Read_relocs::locks): Likewise.
6279 (Scan_relocs::locks): Likewise.
6280 (Relocate_task::locks): Likewise.
6281 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6282 to clear counters.
6283 (Sized_relobj::incremental_relocs_scan): Fix comment.
6284 (Sized_relobj::do_relocate): Pass output file offset to
6285 write_local_symbols.
6286 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6287 from class declaration.
6288 * script.cc (read_input_script): Allocate Script_info; pass
6289 argument serial number to report_script.
6290 * script.h (class Script_info): Move to incremental.h.
6291 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6292 * symtab.h (Symbol_table::add_from_incrobj): New function.
6293 (Symbol_table::set_file_offset): New function.
6294
b961d0d7
CC
62952011-04-05 Cary Coutant <ccoutant@google.com>
6296
6297 * incremental-dump.cc (dump_incremental_inputs): Change signature
6298 to take a Sized_incremental_binary; change caller. Use readers
6299 in Sized_incremental_binary.
6300 * incremental.cc
6301 (Sized_incremental_binary::find_incremental_inputs_sections):
6302 Rename do_find_incremental_inputs_sections to this.
6303 (Sized_incremental_binary::setup_readers): New function.
6304 (Sized_incremental_binary::do_check_inputs): Check
6305 has_incremental_info_ flag; move setup code to setup_readers;
6306 use input readers.
6307 (Sized_incremental_binary::do_file_is_unchanged): New function.
6308 (Sized_incremental_binary::do_get_input_reader): New function.
6309 * incremental.h (class Incremental_binary): Move to end of file.
6310 (Incremental_binary::file_is_unchanged): New function.
6311 (Incremental_binary::do_file_is_unchanged): New function.
6312 (Incremental_binary::Input_reader): New class.
6313 (Incremental_binary::get_input_reader): New function.
6314 (class Sized_incremental_binary): Move to end of file.
6315 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6316 input section reader classes.
6317 (Sized_incremental_binary::has_incremental_info): New function.
6318 (Sized_incremental_binary::inputs_reader): New function.
6319 (Sized_incremental_binary::symtab_reader): New function.
6320 (Sized_incremental_binary::relocs_reader): New function.
6321 (Sized_incremental_binary::got_plt_reader): New function.
6322 (Sized_incremental_binary::do_file_is_unchanged): New function.
6323 (Sized_incremental_binary::Sized_input_reader): New class.
6324 (Sized_incremental_binary::get_input_reader): New function.
6325 (Sized_incremental_binary::find_incremental_inputs_sections):
6326 Rename do_find_incremental_inputs_sections to this.
6327 (Sized_incremental_binary::setup_readers): New function.
6328 (Sized_incremental_binary::has_incremental_info_): New data member.
6329 (Sized_incremental_binary::inputs_reader_): New data member.
6330 (Sized_incremental_binary::symtab_reader_): New data member.
6331 (Sized_incremental_binary::relocs_reader_): New data member.
6332 (Sized_incremental_binary::got_plt_reader_): New data member.
6333 (Sized_incremental_binary::current_input_file_): New data member.
6334
a869183f
PP
63352011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6336
6337 PR gold/12640
6338 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6339 violation.
6340
63412011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6342
6343 * archive.cc (Archive::include_member): Adjust call to report_object.
6344 (Add_archive_symbols::run): Add script_info to call to
6345 report_archive_begin.
6346 (Lib_group::include_member): Adjust call to report_object.
6347 (Add_lib_group_symbols::run): Adjust call to report_object.
6348 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6349 blocks. Add object count for script input files.
6350 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6351 script_info parameter; change all callers.
6352 (Incremental_inputs::report_object): Add script_info parameter;
6353 change all callers.
6354 (Incremental_inputs::report_script): Store backpointer to
6355 incremental info entry.
6356 (Output_section_incremental_inputs::set_final_data_size): Record
6357 additional information for scripts.
6358 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6359 * incremental.h (Incremental_script_entry::add_object): New function.
6360 (Incremental_script_entry::get_object_count): New function.
6361 (Incremental_script_entry::get_object): New function.
6362 (Incremental_script_entry::objects_): New data member; adjust
6363 constructor.
6364 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6365 (Incremental_inputs::report_object): Add script_info parameter.
6366 (Incremental_inputs_reader::get_object_count): New function.
6367 (Incremental_inputs_reader::get_object_offset): New function.
6368 * options.cc (Input_arguments::add_file): Return reference to
6369 new input argument.
6370 * options.h (Input_argument::set_script_info): New function.
6371 (Input_argument::script_info): New function.
6372 (Input_argument::script_info_): New data member; adjust all
6373 constructors.
6374 (Input_file_group::add_file): Return reference to new input argument.
6375 (Input_file_lib::add_file): Likewise.
6376 (Input_arguments::add_file): Likewise.
6377 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6378 * script.cc (Parser_closure::Parser_closure): Add script_info
6379 parameter; adjust all callers.
6380 (Parser_closure::script_info): New function.
6381 (Parser_closure::script_info_): New data member.
6382 (read_input_script): Report scripts earlier to incremental info.
6383 (script_add_file): Set script_info in Input_argument.
6384 (script_add_library): Likewise.
6385 * script.h (Script_options::Script_info): Rewrite class.
6386
a869183f 63872011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6388
6389 * archive.cc (Library_base::should_include_member): Move
6390 method here from class Archive.
6391 (Archive::Archive): Initialize base class.
6392 (Archive::should_include_member): Move to base class.
6393 (Archive::do_for_all_unused_symbols): New function.
6394 (Add_archive_symbols::run): Remove redundant access to
6395 incremental_inputs.
6396 (Lib_group::Lib_group): Initialize base class.
6397 (Lib_group::do_filename): New function.
6398 (Lib_group::include_member): Pass pointer to Lib_group to
6399 report_object.
6400 (Lib_group::do_for_all_unused_symbols): New function.
6401 (Add_lib_group_symbols::run): Report archive information for
6402 incremental links.
6403 * archive.h (class Library_base): New base class.
6404 (class Archive): Derive from Library_base.
6405 (Archive::filename): Move to base class.
6406 (Archive::set_incremental_info): Likewise.
6407 (Archive::incremental_info): Likewise.
6408 (Archive::Should_include): Likewise.
6409 (Archive::should_include_member): Likewise.
6410 (Archive::Armap_entry): Remove.
6411 (Archive::Unused_symbol_iterator): Remove.
6412 (Archive::unused_symbols_begin): Remove.
6413 (Archive::unused_symbols_end): Remove.
6414 (Archive::do_filename): New function.
6415 (Archive::do_get_mtime): New function.
6416 (Archive::do_for_all_unused_symbols): New function.
6417 (Archive::task_): Move to base class.
6418 (Archive::incremental_info_): Likewise.
6419 (class Lib_group): Derive from Library_base.
6420 (Lib_group::do_filename): New function.
6421 (Lib_group::do_get_mtime): New function.
6422 (Lib_group::do_for_all_unused_symbols): New function.
6423 (Lib_group::task_): Move to base class.
6424 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6425 function.
6426 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6427 function.
6428 * incremental.cc (Incremental_inputs::report_archive_begin):
6429 Use Library_base; call library's get_mtime; add incremental inputs
6430 entry before members.
6431 (class Unused_symbol_visitor): New class.
6432 (Incremental_inputs::report_archive_end): Use Library_base; use
6433 visitor class to record unused symbols; don't add incremental inputs
6434 entry after members.
6435 (Incremental_inputs::report_object): Use Library_base.
6436 * incremental.h
6437 (Incremental_archive_entry::Incremental_archive_entry): Remove
6438 unused Archive parameter.
6439 (Incremental_inputs::report_archive_begin): Use Library_base.
6440 (Incremental_inputs::report_archive_end): Likewise.
6441 (Incremental_inputs::report_object): Likewise.
6442 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6443 function.
6444 * object.h (Object::for_all_global_symbols): New function.
6445 (Object::do_for_all_global_symbols): New function.
6446 (Sized_relobj::do_for_all_global_symbols): New function.
6447 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6448 function.
6449 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6450 function.
6451
61ab3e40
ILT
64522011-03-27 Ian Lance Taylor <iant@google.com>
6453
6454 * archive.cc (Archive::interpret_header): Return -1 if something
6455 goes wrong. Change callers accordingly.
6456
30e1f9e6
CC
64572011-03-25 Cary Coutant <ccoutant@google.com>
6458
6459 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6460 * testsuite/Makefile.in: Regenerate.
6461
9370ce59 64622011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6463
6464 * plugin.cc (get_view): New.
6465 (Plugin::load): Pass get_view to the plugin.
6466 (Plugin_manager::get_view): New.
6467
9312bb0a
ILT
64682011-03-21 Ian Lance Taylor <iant@google.com>
6469
6470 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6471 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6472
7e12ba9e
ST
64732011-03-21 Sriraman Tallam <tmsriram@google.com>
6474
6475 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6476 Change == to -eq.
6477 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6478 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6479 Change == to -eq.
6480 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6481 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6482
fd7a005d
ILT
64832011-03-14 Ian Lance Taylor <iant@google.com>
6484
6485 * script-sections.cc (Sort_output_sections::script_compare):
6486 Rename from is_before, change return type.
6487 (Sort_output_sections::operator()): Adjust accordingly.
6488
ed16fd1b
ILT
64892011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6490
6491 PR gold/12572
6492 * testsuite/odr_violation2.cc: Add comment to make all error line
6493 numbers double digits.
6494 * testsuite/debug_msg.sh: Adjust expected errors.
6495
71ff8986
ILT
64962011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6497
6498 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6499 but mark earlier ones as non-canonical
6500 (offset_to_iterator): Update search target and example
6501 (do_addr2line): Return extra lines in a vector*
6502 (format_file_lineno): Extract from do_addr2line
6503 (one_addr2line): Add vector* out-param
6504 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6505 when a lineno entry appeared last for its instruction
6506 (Dwarf_line_info): Add vector* out-param
6507 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6508 * symtab.cc (Odr_violation_compare): Include the lineno in the
6509 comparison again.
6510 (linenos_from_loc): New. Combine the canonical line for an
6511 address with its other lines.
6512 (True_if_intersect): New. Helper functor to make
6513 std::set_intersection a query.
6514 (detect_odr_violations): Compare sets of lines instead of just
6515 one line for each function. This became less deterministic, but
6516 has fewer false positives.
6517 * symtab.h: Declarations.
6518 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6519 mix an optimized and non-optimized object in the same binary
6520 (odr_violation2.so): Same.
6521 * testsuite/Makefile.in: Regenerate from Makefile.am.
6522 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6523 * testsuite/debug_msg.sh: Update line numbers and add
6524 assertions.
6525 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6526 non-optimized context.
6527 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6528 isn't inlined, and use OdrDerived in an optimized context.
6529 * testsuite/odr_header1.h: Defines OdrDerived, where
6530 optimization will change the
6531 first-instruction-in-the-destructor's file and line number.
6532 * testsuite/odr_header2.h: Defines OdrBase.
6533
a19fefdc
ILT
65342011-03-09 Ian Lance Taylor <iant@google.com>
6535
6536 * fileread.cc (File_read::clear_views): Don't delete the whole
6537 file view.
6538
ecb351e9
ILT
65392011-03-08 Ian Lance Taylor <iant@google.com>
6540
6541 PR gold/12525
6542 * fileread.cc: #include <climits>.
6543 (GOLD_IOV_MAX): Define.
6544 (File_read::read_multiple): Limit number of entries by iov_max.
6545 * fileread.h (class File_read): Always set max_readv_entries to
6546 128.
6547
b821d13c
ILT
65482011-03-07 Ian Lance Taylor <iant@google.com>
6549
6550 PR gold/12525
6551 * options.h (class General_options): Add -dy and -dn.
6552
89243142
CC
65532011-03-02 Cary Coutant <ccoutant@google.com>
6554
6555 * testsuite/script_test_9.t: Add TLS segment.
6556
d0773f31
ILT
65572011-03-02 Simon Baldwin <simonb@google.com>
6558
6559 * configure.ac: Add check for gnu_indirect_function support in
6560 the toolchain building binutils.
6561 * configure: Rebuild.
6562
9370ce59 65632011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6564
6565 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6566 plugin only symbols.
6567 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6568 in plugin files as not needed in the symbol table.
6569
4cf7a849
ST
65702011-02-11 Sriraman Tallam <tmsriram@google.com>
6571
6572 * output.cc (Output_section::add_input_section): Delay fill
6573 generation for section ordering.
6574
b578bd7d
ILT
65752011-02-09 Ian Lance Taylor <iant@google.com>
6576
6577 PR gold/12316
6578 * object.h (class Sized_relobj): Remove clear_local_symbols.
6579 * reloc.cc (Sized_relobj::do_relocate): Don't call
6580 clear_local_symbols.
6581
9370ce59 65822011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6583
6584 * plugin.cc (is_visible_from_outside): Return true for symbols
6585 in the -u option.
6586
55382fb7
ILT
65872011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6588
6589 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6590 filename.
6591
4e271fff
ST
65922011-02-02 Sriraman Tallam <tmsriram@google.com>
6593
6594 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6595 to std::string.
4e271fff 6596 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6597 section_name to be std::string.
4e271fff
ST
6598 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6599
d433c3ac
ILT
66002011-01-25 Ian Lance Taylor <iant@google.com>
6601
6602 * script.cc (script_add_extern): Rewrite to use
6603 add_symbol_reference.
6604
880473a6
DK
66052011-01-25 Doug Kwan <dougkwan@google.com>
6606
d433c3ac 6607 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6608
f30f86fa
ILT
66092011-01-24 Ian Lance Taylor <iant@google.com>
6610
6611 * options.h (class General_options): Accept
6612 --no-detect-odr-violations.
6613
8e51a0b9
ILT
66142011-01-24 Ian Lance Taylor <iant@google.com>
6615
6616 * version.cc (version_string): Bump to 1.11.
6617
0f3b89d8
ILT
66182011-01-24 Ian Lance Taylor <iant@google.com>
6619
6620 * plugin.cc (class Plugin_rescan): Define new class.
6621 (Plugin_manager::claim_file): Set any_claimed_.
6622 (Plugin_manager::save_archive): New function.
6623 (Plugin_manager::save_input_group): New function.
6624 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6625 necessary.
6626 (Plugin_manager::new_undefined_symbol): New function.
6627 (Plugin_manager::rescan): New function.
6628 (Plugin_manager::rescannable_defines): New function.
6629 (Plugin_manager::add_input_file): Set any_added_.
6630 * plugin.h (class Plugin_manager): define new fields rescannable_,
6631 undefined_symbols_, any_claimed_, and any_added_. Declare
6632 Plugin_rescan as friend. Declare new functions.
6633 (Plugin_manager::Rescannable): Define type.
6634 (Plugin_manager::Rescannable_list): Define type.
6635 (Plugin_manager::Undefined_symbol_list): Define type.
6636 (Plugin_manager::Plugin_manager): Initialize new fields.
6637 * archive.cc (Archive::defines_symbol): New function.
6638 (Add_archive_symbols::run): Pass archive to plugins if any.
6639 * archive.h (class Archive): Declare defines_symbol.
6640 * readsyms.cc (Input_group::~Input_group): New function.
6641 (Finish_group::run): Pass input_group to plugins if any.
6642 * readsyms.h (class Input_group): Declare destructor.
6643 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6644 any.
6645
3bb951e5
ILT
66462011-01-10 Ian Lance Taylor <iant@google.com>
6647
6648 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6649 section as relro.
6650 (Layout::set_segment_offsets): Reset increase_relro before calling
6651 set_section_addresses a second time.
6652
0aa45fac
CC
66532011-01-04 Cary Coutant <ccoutant@google.com>
6654
6655 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6656 sections before NOBITS sections.
6657
0db46eb4
L
66582011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6659
6660 * version.cc (print_version): Update copyright to 2011.
6661
829c9745
CC
66622010-12-23 Cary Coutant <ccoutant@google.com>
6663
6664 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6665 of OS to this->add. Add OD parameter to second form of the function.
6666
7500420b
ILT
66672010-12-20 Ian Lance Taylor <iant@google.com>
6668
6669 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6670 second of two consecutive entries with same offset.
6671
f8e9a930
RW
66722010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6673
6674 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6675 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6676 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6677 to avoid unneeded links against $(LDADD).
6678 * testsuite/Makefile.in: Regenerate.
6679
2fbb4320
ILT
66802010-12-15 Ian Lance Taylor <iant@google.com>
6681
6682 PR gold/12324
6683 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6684 for R_X86_64_32 and R_X86_64_PC32.
6685 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6686 ver_matching_def_pic.o.
6687 (ver_matching_def_pic.o): New target.
6688
fedb228d
RW
66892010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6690
6691 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6692 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6693 Move definition before File_read::View member definitions.
6694 (File_read::View::~View): Initialize and hold lock before
6695 updating current_mapped_bytes.
6696
9b547ce6
RW
66972010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6698
6699 * dwarf_reader.cc: Remove outdated comment.
6700 * gold-threads.cc: Fix typo in error message.
6701 * archive.cc: Fix typos in comments.
6702 * archive.h: Likewise.
6703 * arm-reloc-property.cc: Likewise.
6704 * arm-reloc-property.h: Likewise.
6705 * arm-reloc.def: Likewise.
6706 * arm.cc: Likewise.
6707 * attributes.h: Likewise.
6708 * cref.cc: Likewise.
6709 * ehframe.cc: Likewise.
6710 * fileread.h: Likewise.
6711 * gold.h: Likewise.
6712 * i386.cc: Likewise.
6713 * icf.cc: Likewise.
6714 * incremental.h: Likewise.
6715 * int_encoding.cc: Likewise.
6716 * layout.h: Likewise.
6717 * main.cc: Likewise.
6718 * merge.h: Likewise.
6719 * object.cc: Likewise.
6720 * object.h: Likewise.
6721 * options.cc: Likewise.
6722 * readsyms.cc: Likewise.
6723 * reduced_debug_output.cc: Likewise.
6724 * reloc.cc: Likewise.
6725 * script-sections.cc: Likewise.
6726 * sparc.cc: Likewise.
6727 * symtab.h: Likewise.
6728 * target-reloc.h: Likewise.
6729 * target.cc: Likewise.
6730 * target.h: Likewise.
6731 * timer.cc: Likewise.
6732 * timer.h: Likewise.
6733 * x86_64.cc: Likewise.
6734
83e17bd5
CC
67352010-12-09 Cary Coutant <ccoutant@google.com>
6736
6737 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6738 stack.
6739 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6740 parameter; change all callers.
6741 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6742 * options.h (warn_execstack): New option.
6743
017257f8
DK
67442010-12-07 Doug Kwan <dougkwan@google.com>
6745
6746 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6747 like function call relocations.
6748
c20cbc06
ILT
67492010-12-07 Ian Lance Taylor <iant@google.com>
6750
6751 * archive.cc (Archive::get_elf_object_for_member): Permit
6752 punconfigured to be NULL.
6753 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6754 (Archive::include_member): Pass NULL to get_elf_object_for_member
6755 if we searched for the archive and this is the first included
6756 object.
6757
4dbfafcc
ILT
67582010-12-01 Ian Lance Taylor <iant@google.com>
6759
6760 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6761 track_relocs_type_ field.
6762 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6763 Set track_relocs_type_.
6764 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6765 contents when using RELA relocs.
6766 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6767 reloc_map_.
6768 * reloc.cc (Track_relocs::next_addend): New function.
6769 * reloc.h (class Track_relocs): Declare next_addend.
6770
e5e19edd
ILT
67712010-12-01 Ian Lance Taylor <iant@google.com>
6772
6773 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6774 virtual destructor.
6775
9a5ce24c
ILT
67762010-12-01 Ian Lance Taylor <iant@google.com>
6777
6778 * README: Update compilers known to work and fail.
6779
c7791212
NC
67802010-11-23 Matthias Klose <doko@ubuntu.com>
6781
6782 * configure.in: For --enable-gold, handle value `default' instead of
6783 `both*'. Always install ld as ld.bfd, install as ld if gold is
6784 not the default.
6785 * configure: Regenerate.
6786
0ad220c9
DK
67872010-11-18 Doug Kwan <dougkwan@google.com>
6788
6789 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6790 and right_alignment to be zero. Store result alignment only if it is
6791 greater than existing alignment.
6792
ab8056e0
CC
67932010-11-16 Cary Coutant <ccoutant@google.com>
6794
6795 PR gold/12220
6796 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6797 Check for ".zdebug_line".
6798
fd064a5b
CC
67992010-11-16 Doug Kwan <dougkwan@google.com>
6800 Cary Coutant <ccoutant@google.com>
6801
6802 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6803 by reference; adjust all callers.
6804 * output.cc (Output_segment::set_section_addresses): Adjust references
6805 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6806 list is empty.
6807 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6808 end at page boundary.
6809
6fc6ea19
CC
68102010-11-16 Cary Coutant <ccoutant@google.com>
6811
6812 PR gold/12220
6813 * layout.cc (Layout::choose_output_section): Transform names of
6814 compressed sections even when using a script with a SECTIONS clause.
6815 (Layout::output_section_name): Remove code to transform
6816 compressed debug section names.
6817 * output.cc (Output_section::add_input_section): Use uncompressed
6818 section size when tracking input sections.
6819
95a2c8d6
RS
68202010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6821
6822 * symtab.h (Symbol::NON_PIC_REF): Remove.
6823 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6824 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6825 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6826 (Symbol::use_plt_offset): Take a flags argument and pass it
6827 directly to needs_dynamic_reloc. Restrict check for undefined
6828 weak symbols to function calls.
6829 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6830 (Target_arm::Scan::global): Use it.
6831 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6832 (Target_arm::Relocate::relocate): Likewise.
6833 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6834 parameter with an r_type parameter. Use get_reference_flags
6835 to get the flags.
6836 (Target_arm::Relocate::relocate): Update accordingly.
6837 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6838 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6839 (Target_i386::Scan::global): Likewise.
6840 (Target_i386::Relocate::relocate): Likewise.
6841 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6842 parameter with an r_type parameter. Use get_reference_flags
6843 to get the flags.
6844 (Target_i386::Relocate::relocate): Update accordingly.
6845 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6846 (Target_powerpc::Scan::global): Use it.
6847 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6848 (Target_powerpc::Relocate::relocate): Likewise.
6849 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6850 (Target_sparc::Scan::global): Use it.
6851 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6852 (Target_sparc::Relocate::relocate): Likewise.
6853 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6854 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6855 (Target_x86_64::Scan::global): Likewise.
6856 (Target_x86_64::Relocate::relocate): Likewise.
6857
f625ae50
DK
68582010-11-08 Doug Kwan <dougkwan@google.com>
6859 Cary Coutant <ccoutant@google.com>
6860
6861 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6862 (Arm_exidx_merge_section::section_contents_): New data member.
6863 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6864 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6865 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6866 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6867 in parameters instead of calling Object::section_contents without
6868 locking.
6869 (Arm_output_section::group_section): New parameter TASK. Pass it
6870 to callees that need locking objects.
6871 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6872 to lock EXIDX input sections. Fix a formatting issue. Call
6873 Arm_exidx_merged_section::build_contents to create merged section
6874 contents.
6875 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6876 to lock object of stub table owner.
6877 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6878 TEXT_SIZE to initialize data member TEXT_SIZE_.
6879 (Arm_exidx_input_section::addralign): Fix typo in comment.
6880 (Arm_exidx_input_section::text_size): New method.
6881 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6882 that require locking objects. Lock objects before scanning for stubs
6883 and updating local symbols.
6884 (Arm_input_section<big_endian>::init): Copy contents of original
6885 input section.
2e702c99 6886 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6887 original input section instead of calling Object::section_contents
6888 without locking.
6889 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6890 size without calling Object::section_size().
6891 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6892 for size. Allocate a buffer for merged EXIDX entries.
6893 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6894 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6895 building code to Arm_exidx_merged_section::build_contetns. Write
6896 out contetns in buffer instead of building it on the fly.
6897 (Arm_relobj::make_exidx_input_section): Also pass text section size
6898 to Arm_exidx_input_section constructor.
6899 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6900 (Arm_dynobj::do_read_symbols): Fix memory leak.
6901 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6902 * target.h: (class Task): Add forward declaration.
6903 (Target::relax): Add new parameter TASK and pass it to
6904 Target::do_relax().
6905 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6906
5f9bcf58
CC
69072010-11-05 Cary Coutant <ccoutant@google.com>
6908
6909 PR gold/10708
6910 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6911 object when reading from the file.
6912 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6913 second layout pass.
6914 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6915 when reading section contents.
6916 (get_section_contents): Likewise.
6917 (icf::find_identical_sections): Likewise.
6918 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6919 object when reading from the file.
6920 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6921 the object when doing deferred section layout.
6922
e597fa08
NC
69232010-11-03 Nick Clifton <nickc@redhat.com>
6924
6925 PR gold/12001
6926 * script.h (class Symbol_assignment: name): New member. Returns
6927 the name of the symbol.
6928 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6929 Returns true if the given symbol name is on the list of
6930 assignments wating to be processed.
6931 * archive.cc (should_incldue_member): If the symbol is undefined,
6932 check to see if it is on the list of symbols pending assignment.
6933
3f9a3278
ILT
69342010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6935
6936 * script-sections.cc (Script_sections::find_memory_region): Check
6937 for a NULL output section pointer.
6938
d06fb4d1
DK
69392010-10-29 Doug Kwan <dougkwan@google.com>
6940
6941 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6942 Output_section::add_relaxed_input_section.
6943 * output.cc (Output_section::add_relaxed_input_section): Add new
6944 arguments LAYOUT and NAME. Set section order index.
6945 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6946 Copy section order index.
6947 * output.h (Output_section::add_relaxed_input_section): Add new
6948 arguments LAYOUT and NAME.
6949
90e24de5
ILT
69502010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6951
6952 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6953 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6954 * testsuite/Makefile.in: Regenerate.
6955
c9484ea5
DK
69562010-10-20 Doug Kwan <dougkwan@google.com>
6957
6958 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6959 without SHF_LINK_ORDER flags.
6960 * layout.cc (Layout::choose_output_section): Do not filter
6961 SHF_LINK_ORDER flag in a relocatable link.
6962
5bc2f5be
CC
69632010-10-17 Cary Coutant <ccoutant@google.com>
6964
6965 * output.h (Output_segment::set_section_addresses): Change function
6966 signature. Update all callers.
6967 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6968 sections.
6969 (Output_segment::set_section_addresses): Align after last TLS
6970 section. Add padding before last relro section instead of after.
6971
0c91cf04
DK
69722010-10-17 Doug Kwan <dougkwan@google.com>
6973
6974 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6975 GOT output section to be writable.
6976
8c21d9d3
CC
69772010-10-14 Cary Coutant <ccoutant@google.com>
6978
6979 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6980 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6981 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6982 mode.
6983 * incremental.cc (report_command_line): Ignore all forms of
6984 --incremental.
6985 * layout.cc (Layout::Layout): Check parameters for incremental link
6986 mode.
6987 * options.cc (General_options::parse_incremental): New function.
6988 (General_options::parse_no_incremental): New function.
6989 (General_options::parse_incremental_full): New function.
6990 (General_options::parse_incremental_update): New function.
6991 (General_options::incremental_mode_): New data member.
6992 (General_options::finalize): Check incremental_mode_.
6993 * options.h (General_options): Update help text for --incremental.
6994 Add --no-incremental, --incremental-full, --incremental-update.
6995 (General_options::Incremental_mode): New enum type.
6996 (General_options::incremental_mode): New function.
6997 (General_options::incremental_mode_): New data member.
6998 * parameters.cc (Parameters::incremental_mode_): New data member.
6999 (Parameters::set_options): Set incremental_mode_.
7000 (Parameters::set_incremental_full): New function.
7001 (Parameters::incremental): New function.
7002 (Parameters::incremental_update): New function.
7003 (set_parameters_incremental_full): New function.
7004 * parameters.h (Parameters::set_incremental_full): New function.
7005 (Parameters::incremental): New function.
7006 (Parameters::incremental_update): New function.
7007 (Parameters::incremental_mode_): New data member.
7008 (set_parameters_incremental_full): New function.
7009 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7010 incremental link mode.
7011 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7012 (Sized_relobj::do_relocate_sections): Likewise.
7013 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7014 option.
7015 * testsuite/Makefile.in: Regenerate.
7016 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7017
bb32aa18 70182010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7019
7020 * script-sections.h (class Script_sections): Make
7021 Sections_elements typedef public.
7022 * script-sections.cc (class Sort_output_sections): Add elements_
7023 field. Add constructor which sets it; change all callers.
7024 (Sort_output_sections::is_before): New function.
7025 (Sort_output_sections::operator()): Call is_before.
7026 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7027 conditional.
7028 * testsuite/script_test_10.sh: New test. Test script section
7029 order.
7030 * testsuite/script_test_10.t: Likewise.
7031 * testsuite/script_test_10.s: Likewise.
7032 * testsuite/Makefile.am: Wrap the cross linker tests and the
7033 common tests into NATIVE_OR_CROSS_LINKER.
7034 (check_SCRIPTS): Add script_test_10.sh.
7035 (check_DATA): Add script_test_10.stdout.
7036 (script_test_10.o, script_test_10): New targets.
7037 (script_test_10.stdout): New target.
7038 * configure, testsuite/Makefile.in: Regenerate.
7039
3cef7179
ILT
70402010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7041
7042 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7043 error for the deprecated relocations.
7044 (Target_arm::Scan::global): Likewise.
7045 (Target_arm::Relocate::relocate): Likewise.
7046
7411e9a8
RS
70472010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7048
7049 * fileread.cc (Input_file::find_file): Initialize *found_name
7050 and *namep when using the fallback search for case 4.
7051
6a9da32a
CC
70522010-10-11 Cary Coutant <ccoutant@google.com>
7053
7054 * options.h (class General_options): Redefine -z lazy as an alias for
7055 the negation of -z now.
7056
ac897c20
ILT
70572010-10-11 Ian Lance Taylor <iant@google.com>
7058
7059 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7060 binding.
7061
ea5cae92
NC
70622010-10-06 Nick Clifton <nickc@redhat.com>
7063
7064 * script-sections.cc(class Memory_region): Remove
7065 current_lma_offset_ field. Rename current_vma_offset_ to
7066 current_offset_. Add last_section_ field.
7067 (Memory_region::get_current_vma_address): Rename to
7068 get_current_address.
7069 (Memory_region::get_current_lma_address): Delete.
7070 (Memory_region::increment_vma_offset): Rename to
7071 increment_offset.
7072 (Memory_region::increment_lma_offset): Delete.
7073 (Memory_region::attributes_compatible): New method. Returns
7074 true if the provided section is compatible with the region.
7075 (Memory_region::get_last_section): New method. Returns the last
7076 section to use the region.
7077 (Memory_region::set_last_section): New method. Stores the last
7078 section to use the region.
7079 (Script_sections::block_in_region): New method. Returns true if
7080 a block of memory is contained within a region.
7081 (Script_sections::find_memory_region): New method. Locates a
7082 memory region to be used to set a VMA or LMA address.
7083 (Output_section_definition::set_section_addresses): Add code to
7084 check for addresses set by memory regions.
7085 (Output_segment::set_section_addresses): Remove memory region
7086 walking code.
7087 (Script_sections::create_segment): Add a warning if a header
7088 segment is created outside of any region.
7089 * script-sections.h (class Script_sections): Add prototypes for
7090 find_memory_region and block_in_region methods.
7091 * testsuite/memory_test.s: Use .long instead of .word.
7092 * testsuite/memory_test.t: Add some more output sections.
7093 * testsuite/memory_test.sh: Update expected output.
7094
a9bfd952
DK
70952010-10-02 Doug Kwan <dougkwan@google.com>
7096
7097 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7098 defintion to symtab.h
7099 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7100 declaration to defintion.
7101
bacff3ab
NC
71022010-10-01 Nick Clifton <nickc@redhat.com>
7103
7104 * expression.cc (eval): Replace dummy argument with NULL.
7105 (eval_maybe_dot): Check for a NULL result section pointer.
7106 (Symbol_expression::value): Likewise.
7107 (Dot_expression::value): Likewise.
7108 (BINARY_EXPRESSION): Likewise.
7109 (Max_expression::value): Likewise.
7110 (Min_expression::value): Likewise.
7111 (Absolute_expression::value): Likewise.
7112 (Addr_expression::value_from_output_section): Likewise.
7113 (Loaddddr_expression::value_from_output_section): Likewise.
7114 (Segment_start_expression::value): Likewise.
7115 * script-sections.cc
7116 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7117 argument with NULL.
7118 (Sections_elememt_dot_assignment::set_section_addresses):
7119 Likewise.
7120 (Output_data_expression::do_write_to_buffer): Likewise.
7121 (Output_section_definition::finalize_symbols): Likewise.
7122 (Output_section_definition::set_section_addresses): Likewise.
7123
f81bc8b5
DK
71242010-09-30 Doug Kwan <dougkwan@google.com>
7125
7126 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7127
c95e9f27
ST
71282010-09-28 Sriraman Tallam <tmsriram@google.com>
7129
7130 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7131 function.
c95e9f27
ST
7132 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7133 virtual function.
7134 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7135 virtual function.
7136 * icf.cc (get_section_contents): Inline merge sections only when
7137 target allows it.
7138
3cac54d2
RW
71392010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7140
7141 * configure: Regenerate.
7142
2904037a
ILT
71432010-09-17 Ian Lance Taylor <iant@google.com>
7144
7145 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7146 * testsuite/Makefile.am (memory_test.o): New target.
7147 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7148 memory_test.t.
7149 * testsuite/Makefile.in: Rebuild.
2904037a 7150
bca7fb63
DK
71512010-09-17 Doug Kwan <dougkwan@google.com>
7152
7153 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7154 defintion if relocation uses GOT entries of the symbol.
7155 * testsuite/icf_safe_test.sh: Fix test.
7156 * testsuite/icf_safe_so_test.sh: Fix test.
7157
4ef28648
CC
71582010-09-16 Cary Coutant <ccoutant@google.com>
7159
7160 * script_sections.cc (class Memory_region): Remove "NULL" from
7161 vector initializations.
7162
793990de
CC
71632010-09-15 Cary Coutant <ccoutant@google.com>
7164
7165 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7166 Resolve forwarding symbols.
7167
81e015e2
DK
71682010-09-15 Doug Kwan <dougkwan@google.com>
7169
7170 * gold/testsuite/script_test_3.t: Add ARM special sections.
7171 * gold/testsuite/script_test_4.t: Same.
7172 * gold/testsuite/script_test_5.t: Same.
7173 * gold/testsuite/script_test_6.t: Same.
7174 * gold/testsuite/script_test_7.t: Same.
7175 * gold/testsuite/script_test_7.t: Same.
7176 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7177
36171d64
CC
71782010-09-14 Cary Coutant <ccoutant@google.com>
7179
7180 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7181 (Target_x86_64::Relocate::relocate_tls): Replace check for
7182 saw_tls_block_reloc_ with test for executable section.
7183
d89051bd
CC
71842010-09-12 Cary Coutant <ccoutant@google.com>
7185
7186 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7187 position-independent executables to shared libraries need dynamic
7188 relocations.
7189 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7190 position-independent executables.
7191 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7192 * testsuite/Makefile.in: Regenerate.
7193
fca41f0f
NC
71942010-09-10 Nick Clifton <nickc@redhat.com>
7195
7196 PR gold/11997
7197 * testsuite/memory_test.t: Discard any sections that are not
7198 needed.
7199
6695e4b3
L
72002010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7201
7202 PR gold/11996
7203 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7204 "This::" to work around a bug in gcc 4.2.
7205
7206 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7207
0f72bf6f
RÁE
72082010-09-09 Rafael Espindola <espindola@google.com>
7209
7210 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7211 sections with different PF_X flags in the same segment.
7212 (Layout::find_first_load_seg): Search all segments to find the first
7213 one.
7214 * options.h (rosegment): New.
7215
72162010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7217
05a79166 7218 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7219
aa98ff75
DK
72202010-09-08 Doug Kwan <dougkwan@google.com>
7221
7222 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7223 (Arm_relobj::do_relocate_sections): Add new parameter for output
7224 file to match the parent.
7225 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7226 of local symbols instead of input values. Update code to track
7227 changes in gold::relocate_section.
7228 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7229 (Sized_relobj::compute_final_local_value_internal): New methods.
7230 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7231 body into private version of Sized_relobj::compute_final_local_value.
7232 Call the inline method.
7233 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7234 merged symbol value if there is one.
7235 (Symbol_value::has_output_value): New method defintiion.
7236 (Sized_relobj::Compute_final_local_value_status): New enum type.
7237 (Sized_relobj::compute_final_local_value): New methods.
7238 (Sized_relobj::compute_final_local_value_internal): New methods.
7239 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7240 and arm_cortex_a8.sh.
7241 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7242 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7243 New tests.
7244 * Makefile.in: Regenerate.
7245 * testsuite/arm_bl_out_of_range.s: Update test.
7246 * testsuite/thumb_bl_out_of_range.s: Ditto.
7247 * testsuite/thumb_blx_out_of_range.s: Ditto.
7248 * testsuite/arm_branch_out_of_range.sh: New file.
7249 * testsuite/arm_cortex_a8.sh: Ditto.
7250 * testsuite/arm_cortex_a8_b.s: Ditto.
7251 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7252 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7253 * testsuite/arm_cortex_a8_bl.s: Ditto.
7254 * testsuite/arm_cortex_a8_blx.s: Ditto.
7255 * testsuite/arm_cortex_a8_local.s: Ditto.
7256 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7257 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7258
05a79166
L
72592010-09-08 Rafael Espindola <espindola@google.com>
7260
7261 * Makefile.am (memory_test.stdout): Run readelf with -W.
7262 * Makefile.in: Regenerate.
7263 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7264 64 bit output.
7265
33dbc701
RÁE
72662010-09-08 Rafael Espindola <espindola@google.com>
7267
7268 * script-sections.cc (Script_sections::add_memory_region): Convert
7269 field precision to int.
7270 * script.cc (script_set_section_region, script_set_section_region):
7271 Convert field precision to int.
7272
731ca54a
RÁE
72732010-09-08 Rafael Espindola <espindola@google.com>
7274
7275 * arm.cc (do_finalize_sections): Create the __exidx_start and
7276 __exdix_end symbols even when the section is missing.
7277
7f8cd844
NC
72782010-09-08 Nick Clifton <nickc@redhat.com>
7279
7280 * README: Remove claim that MEMORY is not supported.
7281 * expression.cc (script_exp_function_origin)
7282 (script_exp_function_length): Move from here to ...
7283 * script.cc: ... here.
7284 (script_set_section_region, script_add_memory)
7285 (script_parse_memory_attr, script_include_directive): New
7286 functions.
7287 * script-sections.cc
7288 (class Memory_region): New class.
7289 (class Output_section_definition): Add set_memory_region,
7290 set_section_vma, set_section_lma and get_section_name methods.
7291 (class Script_Sections): Add add_memory_region,
7292 find_memory_region, find_memory_region_origin,
7293 find_memory_region_length and set_memory_region methods.
7294 Have set_section_addresses method walk the list of set memory
7295 regions.
7296 Extend the print methos to display memory regions.
7297 * script-sections.h: Add prototypes for new methods.
7298 Add enum for MEMORY region attributes.
7299 * yyscript.y: Add support for parsing MEMORY regions.
7300 * script-c.h: Add prototypes for new functions.
7301 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7302 * testsuite/Makefile.in: Regenerate.
7303 * testsuite/memory_test.sh: New script.
7304 * testsuite/memory_test.s: New assembler source file.
7305 * testsuite/memory_test.t: New linker script.
7306
a4649286
DK
73072010-08-27 Doug Kwan <dougkwan@google.com>
7308
7309 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7310 reference override an existing dynamic weak reference.
7311 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7312 * testsuite/Makefile.in: Regenerate.
7313 * testsuite/dyn_weak_ref.sh: New file.
7314 * testsuite/dyn_weak_ref_1.c: Ditto.
7315 * testsuite/dyn_weak_ref_2.c: Ditto.
7316
b56648ad
ILT
73172010-08-27 Ian Lance Taylor <iant@google.com>
7318
7319 * incremental.h (class Incremental_input_entry): Add virtual
7320 destructor.
7321
809313cb
ILT
73222010-08-27 Ian Lance Taylor <iant@google.com>
7323
7324 * testsuite/start_lib_test_3.c: Mark t3 as used.
7325
11e32464
NC
73262010-08-27 Nick Clifton <nickc@redhat.com>
7327
7328 * options.cc (version_script): Fix small typo in previous
7329 whitespace tidyup.
7330
ca09d69a
NC
73312010-08-25 Nick Clifton <nickc@redhat.com>
7332
7333 * archive.cc: Formatting fixes: Remove whitespace between
7334 typename and following asterisk. Remove whitespace between
7335 function name and opening parenthesis.
7336 * archive.h: Likewise.
7337 * arm.cc: Likewise.
7338 * attributes.cc: Likewise.
7339 * attributes.h: Likewise.
7340 * common.cc: Likewise.
7341 * copy-relocs.cc: Likewise.
7342 * dirsearch.h: Likewise.
7343 * dynobj.cc: Likewise.
7344 * ehframe.cc: Likewise.
7345 * ehframe.h: Likewise.
7346 * expression.cc: Likewise.
7347 * fileread.cc: Likewise.
7348 * fileread.h: Likewise.
7349 * gc.h: Likewise.
7350 * gold-threads.cc: Likewise.
7351 * gold.cc: Likewise.
7352 * i386.cc: Likewise.
7353 * icf.h: Likewise.
7354 * incremental-dump.cc: Likewise.
7355 * incremental.cc: Likewise.
7356 * layout.cc: Likewise.
7357 * layout.h: Likewise.
7358 * main.cc: Likewise.
7359 * merge.cc: Likewise.
7360 * merge.h: Likewise.
7361 * object.cc: Likewise.
7362 * object.h: Likewise.
7363 * options.cc: Likewise.
7364 * options.h: Likewise.
7365 * output.cc: Likewise.
7366 * output.h: Likewise.
7367 * plugin.cc: Likewise.
7368 * plugin.h: Likewise.
7369 * powerpc.cc: Likewise.
7370 * reloc.cc: Likewise.
7371 * script-c.h: Likewise.
7372 * script-sections.cc: Likewise.
7373 * script.cc: Likewise.
7374 * stringpool.cc: Likewise.
7375 * symtab.cc: Likewise.
7376 * symtab.h: Likewise.
7377 * target.cc: Likewise.
7378 * timer.cc: Likewise.
7379 * timer.h: Likewise.
7380 * version.cc: Likewise.
7381 * x86_64.cc: Likewise.
7382
b8fa8750
NC
73832010-08-24 Nick Clifton <nickc@redhat.com>
7384
7385 PR 11899
7386 * layout.cc (segment_precedes): Sort segments by their physical
7387 addresses, if they have been set.
7388
9919d93b
CC
73892010-08-23 Cary Coutant <ccoutant@google.com>
7390
7391 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7392 symbols data.
7393 (Lib_group::include_member): Unlock object after deleting its
7394 symbols data.
7395 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7396 the bug fixed here.
7397
97b4be1c
CC
73982010-08-19 Neil Vachharajani <nvachhar@google.com>
7399 Cary Coutant <ccoutant@google.com>
7400
7401 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7402 constructor, and set_blocker.
7403 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7404 readsyms_blocker_.
7405 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7406 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7407 * testsuite/Makefile.am (start_lib_test): New test case.
7408 * testsuite/Makefile.in: Regenerate.
7409 * testsuite/start_lib_test_main.c: New file.
7410 * testsuite/start_lib_test_1.c: New file.
7411 * testsuite/start_lib_test_2.c: New file.
7412 * testsuite/start_lib_test_3.c: New file.
7413
dd0b1884
ILT
74142010-08-19 Ian Lance Taylor <iant@google.com>
7415
7416 * Makefile.in: Rebuild with automake 1.11.1.
7417 * aclocal.m4: Likewise.
7418 * testsuite/Makefile.in: Likewise.
7419
7223e9ca
ILT
74202010-08-19 Ian Lance Taylor <iant@google.com>
7421
7422 PR 10893
7423 * i386.cc (class Output_data_plt_i386): Update declarations.
7424 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7425 local_ifuncs_ fields.
7426 (Target_i386::do_plt_section_for_global): New function.
7427 (Target_i386::do_plt_section_for_local): New function.
7428 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7429 parameter; change all callers. Initialize global_ifuncs_ and
7430 local_ifuncs_. If doing a static link define __rel_iplt_start and
7431 __rel_iplt_end.
7432 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7433 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7434 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7435 symbols.
7436 (Target_i386::make_plt_section): New function, broken out of
7437 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7438 (Target_i386::make_plt_entry): Call make_plt_section.
7439 (Target_i386::make_local_ifunc_plt_entry): New function.
7440 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7441 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7442 R_386_IRELATIVE to switch.
7443 (Target_i386::Scan::global): Likewise.
7444 (Target_i386::Relocate::relocate): Likewise.
7445 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7446 switch.
7447 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7448 (Target_x86_64::do_plt_section_for_global): New function.
7449 (Target_x86_64::do_plt_section_for_local): New function.
7450 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7451 parameter; change all callers. If doing a static link define
7452 __rela_iplt_start and __rela_iplt_end.
7453 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7454 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7455 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7456 to point to .plt.
7457 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7458 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7459 switch.
7460 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7461 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7462 R_X86_64_IRELATIVE to switch.
7463 (Target_x86_64::Scan::global): Likewise.
7464 (Target_x86_64::Relocate::relocate): Likewise.
7465 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7466 switch.
7467 * target.h (class Target): Add plt_section_for_global and
7468 plt_section_for_local functions. Add do_plt_section_for_global
7469 and do_plt_section_for_local virtual functions.
7470 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7471 clarifying comments.
7472 (Symbol::use_plt_offset): Handle IFUNC symbol.
7473 * object.cc (Sized_relobj::Sized_relobj): Initialize
7474 local_plt_offsets_.
7475 (Sized_relobj::local_has_plt_offset): New function.
7476 (Sized_relobj::local_plt_offset): New function.
7477 (Sized_relobj::set_local_plt_offset): New function.
7478 (Sized_relobj::do_count): Handle IFUNC symbol.
7479 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7480 a bit away from input_shndx_ field. Add set_is_func_symbol and
7481 is_ifunc_symbol functions.
7482 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7483 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7484 local_plt_offsets_ field.
7485 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7486 * output.h (class Output_section_data): Add non-const
7487 output_section function.
7488 (class Output_data_got): Update declarations.
7489 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7490 Add use_plt_offset parameter to global and local constructors.
7491 Change all callers. Change local_sym_index_ field to 31 bits.
7492 Change GSYM_CODE and CONSTANT_CODE accordingly.
7493 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7494 doing a static link don't set sh_link field.
7495 (Output_data_got::Got_entry::write): Use PLT offset if
7496 appropriate.
7497 (Output_data_got::add_global_plt): New function.
7498 (Output_data_got::add_local_plt): New function.
7499 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7500 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7501 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7502 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7503 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7504 IFUNC conditional.
7505 * testsuite/ifunc-sel.h: New file.
7506 * testsuite/ifuncmain1.c: New file.
7507 * testsuite/ifuncmain1vis.c: New file.
7508 * testsuite/ifuncmod1.c: New file.
7509 * testsuite/ifuncdep2.c: New file.
7510 * testsuite/ifuncmain2.c: New file.
7511 * testsuite/ifuncmain3.c: New file.
7512 * testsuite/ifuncmod3.c: New file.
7513 * testsuite/ifuncmain4.c: New file.
7514 * testsuite/ifuncmain5.c: New file.
7515 * testsuite/ifuncmod5.c: New file.
7516 * testsuite/ifuncmain6pie.c: New file.
7517 * testsuite/ifuncmod6.c: New file.
7518 * testsuite/ifuncmain7.c: New file.
7519 * configure, testsuite/Makefile.in: Rebuild.
7520
56f75c03
ILT
75212010-08-18 Ian Lance Taylor <iant@google.com>
7522
7523 * incremental.cc
7524 (Output_section_incremental_inputs::write_input_files): Add cast
7525 to avoid signed/unsigned comparison warning.
7526 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7527
55455f89
CC
75282010-08-12 Cary Coutant <ccoutant@google.com>
7529
7530 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7531
e2054bcb
ILT
75322010-08-13 Ian Lance Taylor <iant@google.com>
7533
7534 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7535
74f67560
DK
75362010-08-12 Cary Coutant <ccoutant@google.com>
7537 Doug Kwan <dougkwan@google.com>
7538
7539 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7540 defintion overrides non-weak undef, remember that the original undef
7541 is not weak.
7542 * symtab.cc (Symbol_table::sized_write_global): For undef without
7543 an original weak binding, set binding to global in output.
7544 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7545 * testsuite/Makefile.in: Regenerate.
7546 * testsuite/strong_ref_weak_def.sh: New file.
7547 * testsuite/strong_ref_weak_def_1.c: Ditto.
7548 * testsuite/strong_ref_weak_def_2.c: Ditto.
7549
d1238d12
CC
75502010-08-12 Cary Coutant <ccoutant@google.com>
7551
7552 * testsuite/incremental_test.sh: Rewrite.
7553 * testsuite/incremental_test_1.c: Rewrite.
7554 * testsuite/incremental_test_2.c: Rewrite.
7555
0e70b911
CC
75562010-08-12 Cary Coutant <ccoutant@google.com>
7557
7558 * arm.cc (Target_arm::got_size): Add const.
7559 (Target_arm::got_entry_count): New function.
7560 (Target_arm::plt_entry_count): New function.
7561 (Target_arm::first_plt_entry_offset): New function.
7562 (Target_arm::plt_entry_size): New function.
7563 (Output_data_plt_arm::entry_count): New function.
7564 (Output_data_plt_arm::first_plt_entry_offset): New function.
7565 (Output_data_plt_arm::get_plt_entry_size): New function.
7566 * i386.cc (Target_i386::got_size): Add const.
7567 (Target_i386::got_entry_count): New function.
7568 (Target_i386::plt_entry_count): New function.
7569 (Target_i386::first_plt_entry_offset): New function.
7570 (Target_i386::plt_entry_size): New function.
7571 (Output_data_plt_i386::entry_count): New function.
7572 (Output_data_plt_i386::first_plt_entry_offset): New function.
7573 (Output_data_plt_i386::get_plt_entry_size): New function.
7574 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7575 find_incremental_inputs_sections. Dump incremental_got_plt section.
7576 * incremental.cc: Include target.h.
7577 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7578 parameter. Adjust all callers. Find incremental_got_plt section.
7579 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7580 section.
7581 (Output_section_incremental_inputs::set_final_data_size): Calculate
7582 size of incremental_got_plt section.
7583 (Output_section_incremental_inputs::do_write): Write the
7584 incremental_got_plt section.
7585 (Got_plt_view_info): New struct.
7586 (Local_got_offset_visitor): New class.
7587 (Global_got_offset_visitor): New class.
7588 (Global_symbol_visitor_got_plt): New class.
7589 (Output_section_incremental_inputs::write_got_plt): New function.
7590 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7591 Add parameter. Adjust all callers.
7592 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7593 (Incremental_inputs::got_plt_section): New function.
7594 (Incremental_inputs::got_plt_section_): New data member.
7595 (Incremental_got_plt_reader): New class.
7596 * layout.cc (Layout::create_incremental_info_sections): Add the
7597 incremental_got_plt section.
7598 * object.h (Got_offset_list::get_list): New function.
7599 (Got offset_list::for_all_got_offsets): New function.
7600 (Sized_relobj::local_got_offset_list): New function.
7601 * powerpc.cc (Target_powerpc::got_size): Add const.
7602 (Target_powerpc::got_entry_count): New function.
7603 (Target_powerpc::plt_entry_count): New function.
7604 (Target_powerpc::first_plt_entry_offset): New function.
7605 (Target_powerpc::plt_entry_size): New function.
7606 (Output_data_plt_powerpc::entry_count): New function.
7607 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7608 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7609 * sparc.cc (Target_sparc::got_size): Add const.
7610 (Target_sparc::got_entry_count): New function.
7611 (Target_sparc::plt_entry_count): New function.
7612 (Target_sparc::first_plt_entry_offset): New function.
7613 (Target_sparc::plt_entry_size): New function.
7614 (Output_data_plt_sparc::entry_count): New function.
7615 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7616 (Output_data_plt_sparc::get_plt_entry_size): New function.
7617 * symtab.h (Symbol::got_offset_list): New function.
7618 (Symbol_table::for_all_symbols): New function.
7619 * target.h (Sized_target::got_entry_count): New function.
7620 (Sized_target::plt_entry_count): New function.
7621 (Sized_target::plt_entry_size): New function.
7622 * x86_64.cc (Target_x86_64::got_size): Add const.
7623 (Target_x86_64::got_entry_count): New function.
7624 (Target_x86_64::plt_entry_count): New function.
7625 (Target_x86_64::first_plt_entry_offset): New function.
7626 (Target_x86_64::plt_entry_size): New function.
7627 (Output_data_plt_x86_64::entry_count): New function.
7628 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7629 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7630
09ec0418
CC
76312010-08-12 Cary Coutant <ccoutant@google.com>
7632
7633 * archive.cc: Include incremental.h.
7634 (Archive::Archive): Initialize incremental_info_.
7635 (Archive::include_member): Record archive members in incremental info.
7636 (Add_archive_symbols::run): Record begin and end of an archive in
7637 incremental info.
7638 (Lib_group::include_member): Record objects in incremental info.
7639 * archive.h (Incremental_archive_entry): Forward declaration.
7640 (Archive::set_incremental_info): New member function.
7641 (Archive::incremental_info): New member function.
7642 (Archive::Unused_symbol_iterator): New class.
7643 (Archive::unused_symbols_begin): New member function.
7644 (Archive::unused_symbols_end): New member function.
7645 (Archive::incremental_info_): New data member.
7646 * incremental-dump.cc (find_input_containing_global): New function.
7647 (dump_incremental_inputs): Dump new incremental info sections.
7648 * incremental.cc: Include symtab.h.
7649 (Output_section_incremental_inputs): New class.
7650 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7651 new incremental info sections.
7652 (Sized_incremental_binary::do_check_inputs): Likewise.
7653 (Incremental_inputs::report_archive): Remove.
7654 (Incremental_inputs::report_archive_begin): New function.
7655 (Incremental_inputs::report_archive_end): New function.
7656 (Incremental_inputs::report_object): New function.
7657 (Incremental_inputs::finalize_inputs): Remove.
7658 (Incremental_inputs::report_input_section): New function.
7659 (Incremental_inputs::report_script): Rewrite.
7660 (Incremental_inputs::finalize): Do nothing but finalize string table.
7661 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7662 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7663 (Incremental_inputs::create_data_sections): New function.
7664 (Incremental_inputs::relocs_entsize): New function.
7665 (Output_section_incremental_inputs::set_final_data_size): New function.
7666 (Output_section_incremental_inputs::do_write): New function.
7667 (Output_section_incremental_inputs::write_header): New function.
7668 (Output_section_incremental_inputs::write_input_files): New function.
7669 (Output_section_incremental_inputs::write_info_blocks): New function.
7670 (Output_section_incremental_inputs::write_symtab): New function.
7671 * incremental.h (Incremental_script_entry): Forward declaration.
7672 (Incremental_object_entry): Forward declaration.
7673 (Incremental_archive_entry): Forward declaration.
7674 (Incremental_inputs): Forward declaration.
7675 (Incremental_inputs_header_data): Remove.
7676 (Incremental_inputs_header): Remove.
7677 (Incremental_inputs_header_write): Remove.
7678 (Incremental_inputs_entry_data): Remove.
7679 (Incremental_inputs_entry): Remove.
7680 (Incremental_inputs_entry_write): Remove.
7681 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7682 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7683 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7684 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7685 Likewise.
7686 (Incremental_input_entry): New class.
7687 (Incremental_script_entry): New class.
7688 (Incremental_object_entry): New class.
7689 (Incremental_archive_entry): New class.
7690 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7691 (Incremental_inputs::report_inputs): Remove.
7692 (Incremental_inputs::report_archive): Remove.
7693 (Incremental_inputs::report_archive_begin): New function.
7694 (Incremental_inputs::report_archive_end): New function.
7695 (Incremental_inputs::report_object): Change prototype.
7696 (Incremental_inputs::report_input_section): New function.
7697 (Incremental_inputs::report_script): Change prototype.
7698 (Incremental_inputs::get_reloc_count): New function.
7699 (Incremental_inputs::set_reloc_count): New function.
7700 (Incremental_inputs::create_data_sections): New function.
7701 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7702 (Incremental_inputs::inputs_section): New function.
7703 (Incremental_inputs::symtab_section): New function.
7704 (Incremental_inputs::relocs_section): New function.
7705 (Incremental_inputs::get_stringpool): Add const.
7706 (Incremental_inputs::command_line): Add const.
7707 (Incremental_inputs::inputs): Remove.
7708 (Incremental_inputs::command_line_key): New function.
7709 (Incremental_inputs::input_file_count): New function.
7710 (Incremental_inputs::input_files): New function.
7711 (Incremental_inputs::relocs_entsize): New function.
7712 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7713 (Incremental_inputs::finalize_inputs): Remove.
7714 (Incremental_inputs::Input_info): Remove.
7715 (Incremental_inputs::lock_): Remove.
7716 (Incremental_inputs::inputs_): Change type.
7717 (Incremental_inputs::inputs_map_): Remove.
7718 (Incremental_inputs::current_object_entry_): New data member.
7719 (Incremental_inputs::inputs_section_): New data member.
7720 (Incremental_inputs::symtab_section_): New data member.
7721 (Incremental_inputs::relocs_section_): New data member.
7722 (Incremental_inputs::reloc_count_): New data member.
7723 (Incremental_inputs_reader): New class.
7724 (Incremental_symtab_reader): New class.
7725 (Incremental_relocs_reader): New class.
7726 * layout.cc (Layout::finalize): Move finalization of incremental info
7727 and creation of incremental info sections to follow finalization of
7728 symbol table. Set offsets for postprocessing sections.
7729 (Layout::create_incremental_info_sections): Call
7730 Incremental_inputs::create_data_sections. Add incremental symtab
7731 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7732 sections to layout after input sections.
7733 * layout.h (struct Timespec): Forward declaration.
7734 (Layout::incremental_inputs): Add const.
7735 (Layout::create_incremental_info_sections): Add parameter.
7736 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7737 * object.cc: Include incremental.h.
7738 (Relobj::finalize_incremental_relocs): New function.
7739 (Sized_relobj::do_layout): Record input sections in incremental info.
7740 * object.h (Object::output_section): New function.
7741 (Object::output_section_offset): Moved from Relobj.
7742 (Object::get_incremental_reloc_base): New function.
7743 (Object::get_incremental_reloc_count): New function.
7744 (Object::do_output_section): New function.
7745 (Object::do_output_section_offset): Moved from Relobj.
7746 (Object::do_get_incremental_reloc_base): New function.
7747 (Object::do_get_incremental_reloc_count): New function.
7748 (Object::Object): Initialize new data members.
7749 (Relobj::output_section): Renamed do_output_section and moved to
7750 protected.
7751 (Relobj::output_section_offset): Moved to Object.
7752 (Relobj::do_get_incremental_reloc_base): New function.
7753 (Relobj::do_get_incremental_reloc_count): New function.
7754 (Relobj::allocate_incremental_reloc_counts): New function.
7755 (Relobj::count_incremental_reloc): New function.
7756 (Relobj::finalize_incremental_relocs): New function.
7757 (Relobj::next_incremental_reloc_index): New function.
7758 (Relobj::reloc_counts_): New data member.
7759 (Relobj::reloc_bases_): New data member.
7760 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7761 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7762 (Sized_relobj::incremental_relocs_scan): New function.
7763 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7764 (Sized_relobj::incremental_relocs_write): New function.
7765 (Sized_relobj::incremental_relocs_write_reltype): New function.
7766 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7767 incremental link.
7768 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7769 archives and object files elsewhere.
7770 (Add_symbols::run): Report object files here.
7771 (Finish_group::run): Report end of archive at end of group.
7772 * reloc.cc: Include layout.h, incremental.h.
7773 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7774 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7775 (Sized_relobj::incremental_relocs_scan): New function.
7776 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7777 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7778 (Sized_relobj::incremental_relocs_write): New function.
7779 (Sized_relobj::incremental_relocs_write_reltype): New function.
7780 * script.cc (read_input_script): Rewrite test for incremental link.
7781 Change call to Incremental_inputs::report_script.
7782 * symtab.h (Symbol_table::first_global_index): New function.
7783 (Symbol_table::output_count): New function.
7784
ce0d1972
DK
77852010-08-12 Doug Kwan <dougkwan@google.com>
7786
7787 * arm.cc (Target_arm::merge_object_attributes): Check command line
7788 options --no-wchar-size-warning and --no-enum-size-warning.
7789 * options.h (General_options): Add ld-compatible options
7790 --no-enum-size-warning and --no-wchar-size-warning.
7791
6e5710ce
ILT
77922010-08-04 Ian Lance Taylor <iant@google.com>
7793
7794 * x86_64.cc (Target_x86_64::Scan::local): Use
7795 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7796 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7797 (Target_x86_64::Scan::global): Likewise.
7798 (Target_x86_64::Relocate::relocate): Likewise.
7799 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7800 Likewise.
7801
fef830db
CC
78022010-08-03 Cary Coutant <ccoutant@google.com>
7803
7804 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7805 to reserve space in merged_strings vector. Keep total input size
7806 for stats.
7807 (Output_merge_string::do_print_merge_stats): Print total input size.
7808 * merge.h (Output_merge_string): Add input_size_ field.
7809 * stringpool.cc (Stringpool_template::string_length): Move
7810 implementations out of Stringpool_template class and place in
7811 stringpool.h.
7812 * stringpool.h (string_length): Move out of Stringpool_template.
7813
1e3811b0
ILT
78142010-08-03 Ian Lance Taylor <iant@google.com>
7815
7816 PR 11712
7817 * layout.cc (relaxation_loop_body): If address of load segment is
7818 set, adjust address to include headers if possible.
7819
7af0c620
ILT
78202010-08-03 Ian Lance Taylor <iant@google.com>
7821
7822 * version.cc (version_string): Bump to 1.10.
7823
22f0da72
ILT
78242010-08-03 Ian Lance Taylor <iant@google.com>
7825
7826 PR 11805
7827 * layout.h (enum Output_section_order): Define.
7828 (class Layout): Update declarations.
7829 * layout.cc (Layout::get_output_section): Add order parameter.
7830 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7831 is_first_non_relro parameters. Change all callers.
7832 (Layout::choose_output_section): Likewise.
7833 (Layout::add_output_section_data): Likewise.
7834 (Layout::make_output_section): Likewise. Set order.
7835 (Layout::default_section_order): New function.
7836 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7837 * output.cc (Output_section::Output_section): Initialize order_.
7838 Don't initialize deleted fields.
7839 (Output_segment::Output_segment): Don't initialize deleted
7840 fields.
7841 (Output_segment::add_output_section_to_load): New function
7842 replacing add_output_section. Change all callers to call this or
7843 add_output_section_to_nonload.
7844 (Output_segment::add_output_section_to_nonload): New function.
7845 (Output_segment::remove_output_section): Rewrite.
7846 (Output_segment::add_initial_output_data): Likewise.
7847 (Output_segment::has_any_data_sections): Likewise.
7848 (Output_segment::is_first_section_relro): Likewise.
7849 (Output_segment::maximum_alignment): Likewise.
7850 (Output_segment::has_dynamic_reloc): New function replacing
7851 dynamic_reloc_count. Change all callers.
7852 (Output_segment::has_dynamic_reloc_list): New function replacing
7853 dynamic_reloc_count_list. Change all callers.
7854 (Output_segment::set_section_addresses): Rewrite.
7855 (Output_segment::set_offset): Rewrite.
7856 (Output_segment::find_first_and_last_list): Remove.
7857 (Output_segment::set_tls_offsets): Rewrite.
7858 (Output_segment::first_section_load_address): Likewise.
7859 (Output_segment::output_section_count): Likewise.
7860 (Output_segment::section_with_lowest_load_address): Likewise.
7861 (Output_segment::write_section_headers): Likewise.
7862 (Output_segment::print_sections_to_map): Likewise.
7863 * output.h (class Output_data): Remove dynamic_reloc_count_
7864 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7865 (Output_data::add_dynamic_reloc): Rewrite.
7866 (Output_data::has_dynamic_reloc): New function.
7867 (Output_data::dynamic_reloc_count): Remove.
7868 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7869 is_last_relro_, is_first_non_relro_, is_interp_,
7870 is_dynamic_linker_section_ fields. Add order and set_order
7871 functions. Remove is_relro_local, set_is_relro_local,
7872 is_last_relro, set_is_last_relro, is_first_non_relro,
7873 set_is_first_non_relro functions, is_interp, set_is_interp,
7874 is_dynamic_linker_section, and set_is_dynamic_linker_section
7875 functions.
7876 (class Output_segment): Change Output_data_list from std::list to
7877 std:;vector. Add output_lists_ field. Remove output_data_ and
7878 output_bss_ fields. Update declarations.
7879
3ff2ccb0
ILT
78802010-08-02 Ian Lance Taylor <iant@google.com>
7881
7882 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7883 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7884 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7885
88a4108b
ILT
78862010-08-02 Ian Lance Taylor <iant@google.com>
7887
7888 PR 11855
7889 * script.cc (Script_options::Script_options): Initialize
7890 symbol_definitions_ and symbol_references_.
7891 (Script_options::add_symbol_assignment): Update
7892 symbol_definitions_ and symbol_references_.
7893 (Script_options::add_symbol_reference): New function.
7894 (script_symbol): New function.
7895 * script.h (class Script_options): Add symbol_definitions_ and
7896 symbol_references_ fields.
7897 (Script_options::referenced_const_iterator): New type.
7898 (Script_options::referenced_begin): New function.
7899 (Script_options::referenced_end): New function.
7900 (Script_options::is_referenced): New function.
7901 (Script_options::any_unreferenced): New function.
7902 * script-c.h (script_symbol): Declare.
7903 * yyscript.y (exp): Call script_symbol.
7904 * symtab.cc: Include "script.h".
7905 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7906 Change all callers. Check symbols referenced by scripts.
7907 (Symbol_table::add_undefined_symbols_from_command_line): Add
7908 layout parameter. Change all callers.
7909 (Symbol_table::do_add_undefined_symbols_from_command_line):
7910 Likewise. Break out loop body. Check symbols referenced by
7911 scripts.
7912 (Symbol_table::add_undefined_symbol_from_command_line): New
7913 function broken out of
7914 do_add_undefined_symbols_from_command_line.
7915 * symtab.h (class Symbol_table): Update declarations.
7916 * archive.cc: Include "layout.h".
7917 (Archive::should_include_member): Add layout parameter. Change
7918 all callers. Check for symbol mentioned in expression.
7919 * archive.h (class Archive): Update declaration.
7920 * object.cc (Sized_relobj::do_should_include_member): Add layout
7921 parameter.
7922 * object.h (Object::should_include_member): Add layout parameter.
7923 Change all callers.
7924 (Object::do_should_include_member): Add layout parameter.
7925 (class Sized_relobj): Update declaration.
7926 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7927 parameter.
7928 * dynobj.h (class Sized_dynobj): Update declaration.
7929 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7930 layout parameter.
7931 * plugin.h (class Sized_pluginobj): Update declaration.
7932
5f1ab67a
ILT
79332010-08-02 Ian Lance Taylor <iant@google.com>
7934
7935 PR 11866
7936 * output.cc (Output_segment::set_offset): Search for the first and
7937 last sections rather than assuming that the list is in order.
7938 (Output_segment::find_first_and_last_list): New function.
7939 * output.h (class Output_segment): Update declarations.
7940 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7941 (relro_strip_test_SOURCES): New variable.
7942 (relro_strip_test_DEPENDENCIES): New variable.
7943 (relro_strip_test_LDFLAGS): New variable.
7944 (relro_strip_test_LDADD): New variable.
7945 (relro_strip_test.so): New target.
7946
a8df5856
ILT
79472010-08-02 Ian Lance Taylor <iant@google.com>
7948
7949 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7950 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7951 (Target_i386::got_tlsdesc_section): New function.
7952 (Target_i386::got_section): Create space for GOT entries for
7953 TLSDESC relocations.
7954 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7955 R_386_TLS_GOTDESC.
7956 (Target_i386::Scan::global): Likewise.
7957 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7958 using TLSDESC GOT.
7959 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7960 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7961 (Target_x86_64::got_tlsdesc_section): New function.
7962 (Target_x86_64::got_section): Create space for GOT entries for
7963 TLSDESC relocations.
7964 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7965 R_386_TLS_GOTDESC.
7966 (Target_x86_64::Scan::global): Likewise.
7967 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7968 using TLSDESC GOT.
7969
0c10a0a6
ILT
79702010-08-02 Ian Lance Taylor <iant@google.com>
7971
7972 * testsuite/final_layout.sh: Use dc to convert from hex to
7973 decimal.
7974
41cbeecc
ST
79752010-07-29 Sriraman Tallam <tmsriram@google.com>
7976
7977 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7978 paramter to the call to gold::gc_process_relocs.
7979 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7980 paramter to the call to gold::gc_process_relocs.
7981 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7982 parameter to the call to gold::gc_process_relocs.
7983 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7984 template parameter to the call to gold::gc_process_relocs.
7985 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7986 paramter to the call to gold::gc_process_relocs.
7987 * gc.h (get_embedded_addend_size): New function.
7988 (gc_process_relocs): Save the size of the reloc for use by ICF.
7989 * icf.cc (get_section_contents): Get the addend from the text section
7990 for SHT_REL relocation sections.
7991 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7992 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7993 * int_encoding.h (read_from_pointer): New overloaded function.
7994 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7995 * testsuite/icf_sht_rel_addend_test.sh: New file.
7996 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7997 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7998
6ea55b82
RW
79992010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8000
8001 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8002 * Makefile.in: Regenerate.
8003 * testsuite/Makefile.in: Regenerate.
8004
9691462b
ILT
80052010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8006
8007 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8008 * gold/testsuite/debug_msg.cc: Likewise.
8009 * gold/testsuite/odr_violation1.cc
8010 * gold/testsuite/odr_violation2.cc
8011
76897331
CC
80122010-07-21 Cary Coutant <ccoutant@google.com>
8013
8014 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8015 string, and length fields.
8016 (Output_merge_string::Merged_strings_list): New type.
8017 (Output_merge_string::Merged_strings_lists): New typedef.
8018 (Output_merge_string): Replace merged_strings_ with
8019 merged_strings_lists_.
8020 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8021 Merged_strings_list per input object and section. Don't store pointer
8022 to the string. Don't store length with each merged string entry.
8023 (Output_merge_string::finalize_merged_data): Loop over list of merged
8024 strings lists. Recompute length of each merged string.
8025
78384e8f
CC
80262010-07-15 Cary Coutant <ccoutant@google.com>
8027
8028 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8029 here.
8030
783659f9
ILT
80312010-07-14 Ian Lance Taylor <iant@google.com>
8032
8033 * descriptors.cc (Descriptors::open): Report correct name in error
8034 message.
8035
131687b4
DK
80362010-07-13 Doug Kwan <dougkwan@google.com>
8037
8038 * arm.cc (Arm_input_section::Arm_input_section): For a
8039 SHT_ARM_EXIDX section, always keeps the input sections.
8040 (Arm_input_section::set_exidx_section_link): New method.
8041 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8042 has_errors_ to false.
8043 (Arm_exidx_input_section::has_errors,
8044 Arm_exidx_input_section::set_has_errors): New methods.
8045 (Arm_exidx_input_section::has_errors_): New data member.
8046 (Arm_relobj::get_exidx_shndx_list): New method.
8047 (Arm_output_section::append_text_sections_to_list): Do not skip
8048 section without SHF_EXECINSTR.
8049 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8050 errors.
2e702c99 8051 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8052 section header. Make error messages more verbose. Check for
8053 a non-executable section linked to an EXIDX section.
8054 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8055 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8056 check that there is no deferred EXIDX section if we exit early.
8057 Instead of not making an EXIDX section in case of an error, make one
8058 and set the has_errors flag of it.
8059 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8060 in a relocatable link.
8061 (Target_arm::do_relax): Look for the EXIDX output section instead of
8062 assuming that it is called .ARM.exidx.
2e702c99 8063 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8064 section list. Do not check for SHF_EXECINSTR section flags but
8065 skip any input section with errors.
8066 * output.cc (Output_section::Output_section): Initialize
8067 always_keeps_input_sections_ to false.
8068 (Output_section::add_input_section): Check for
8069 always_keeps_input_sections_.
8070 * output.h (Output_section::always_keeps_input_sections,
8071 Output_section::set_always_keeps_input_sections): New methods.
8072 (Output_section::always_keeps_input_sections): New data member.
8073
69517287
RÁE
80742010-07-13 Rafael Espindola <espindola@google.com>
8075
8076 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8077 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8078
82742395
ILT
80792010-07-13 Philip Herron <herron.philip@googlemail.com>
8080 Ian Lance Taylor <iant@google.com>
8081
8082 * output.h (Output_section_lookup_maps::add_merge_section):
8083 Correct check of whether value was inserted.
8084 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8085 (Output_section_lookup_maps::add_relaxed_input_section):
8086 Likewise.
8087 * arm.cc (Target_arm::got_section): Remove used local os.
8088 * i386.cc (Target_i386::got_section): Likewise.
8089 * x86_64.cc (Target_x86_64::got_section): Likewise.
8090 * sparc.cc (Target_sparc::got_section): Likewise.
8091 (Target_sparc::relocate): Remove unused local have_got_offset.
8092 * powerpc.cc (Target_powerpc::relocate): Likewise.
8093
f2d707b5
ILT
80942010-07-13 Ian Lance Taylor <iant@google.com>
8095
241531d6
ILT
8096 * compressed_output.cc (zlib_decompress): Fix signature in
8097 !HAVE_ZLIB_H case.
8098
f2d707b5
ILT
8099 * archive.cc (Archive::include_member): Unlock an external member
8100 of a thin archive. Don't bother to delete an object we know is
8101 NULL.
8102
a2e47362
CC
81032010-07-12 Cary Coutant <ccoutant@google.com>
8104
8105 * compressed_output.cc (zlib_decompress): New function.
8106 (get_uncompressed_size): New function.
8107 (decompress_input_section): New function.
8108 * compressed_output.h (get_uncompressed_size): New function.
8109 (decompress_input_section): New function.
8110 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8111 Handle compressed debug sections.
8112 * layout.cc (is_compressed_debug_section): New function.
8113 (Layout::output_section_name): Map compressed section names to
8114 canonical names.
8115 * layout.h (is_compressed_debug_section): New function.
8116 (is_debug_info_section): Recognize compressed debug sections.
8117 * merge.cc: Include compressed_output.h.
8118 (Output_merge_data::do_add_input_section): Handle compressed
8119 debug sections.
8120 (Output_merge_string::do_add_input_section): Handle compressed
8121 debug sections.
8122 * object.cc: Include compressed_output.h.
8123 (Sized_relobj::Sized_relobj): Initialize new data members.
8124 (build_compressed_section_map): New function.
8125 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8126 * object.h (Object::section_is_compressed): New method.
8127 (Object::do_section_is_compressed): New method.
8128 (Sized_relobj::Compressed_section_map): New type.
8129 (Sized_relobj::do_section_is_compressed): New method.
8130 (Sized_relobj::compressed_sections_): New data member.
8131 * output.cc (Output_section::add_input_section): Handle compressed
8132 debug sections.
8133 * reloc.cc: Include compressed_output.h.
8134 (Sized_relobj::write_sections): Handle compressed debug sections.
8135
ce279a62
CC
81362010-07-08 Cary Coutant <ccoutant@google.com>
8137
8138 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8139 weak when resolving to a dynamic def.
8140 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8141 for weak undef/dynamic def cases. Adjust callers.
8142 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8143 undef_binding_weak_.
8144 (Symbol_table::sized_write_globals): Adjust symbol binding.
8145 (Symbol_table::sized_write_symbol): Add binding parameter.
8146 * symtab.h (Symbol::set_undef_binding): New method.
8147 (Symbol::is_undef_binding_weak): New method.
8148 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8149 (Symbol_table::should_override): Add new parameter.
8150 (Symbol_table::sized_write_symbol): Add new parameter.
8151
8152 * testsuite/weak_undef_file1.cc: Add new test case.
8153 * testsuite/weak_undef_file2.cc: Fix header comment.
8154 * testsuite/weak_undef_test.cc: Add new test case.
8155
b2286c10
DK
81562010-06-29 Doug Kwan <dougkwan@google.com>
8157
8158 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8159 Initialize USE_SYMBOL_.
8160 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8161 definition.
8162 (Arm_reloc_property::uses_symbol_): New data member declaration.
8163 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8164 uses symbol value and symbol is undefined but not weakly undefined.
8165
4802450a
RÁE
81662010-06-28 Rafael Espindola <espindola@google.com>
8167
8168 * plugin.cc (Plugin::load): Use dlerror.
8169
e5ca47ba
ILT
81702010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8171
8172 * symtab.cc (detect_odr_violations): When reporting an ODR
8173 violation, report an object where the symbol is defined.
8174
8a75a161
DK
81752010-06-25 Doug Kwan <dougkwan@google.com>
8176
8177 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8178 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8179 definition.
8180 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8181 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8182 target hook to detect function points.
8183 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8184 * icf.h (Icf::check_section_for_function_pointers): Change type of
8185 parameter SECTION_NAME to const reference to std::string. Use
8186 target hook to determine if section may have unsafe pointers.
8187 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8188 method definition.
8189
42218b9f
RÁE
81902010-06-21 Rafael Espindola <espindola@google.com>
8191
8192 * fileread.cc (Input_file::find_fie): New
8193 (Input_file::open): Use Input_file::find_fie.
8194 * fileread.h (Input_file::find_fie): New
8195 * plugin.cc (set_extra_library_path): New.
8196 (Plugin::load): Add set_extra_library_path to the transfer vector.
8197 (Plugin_manager::set_extra_library_path): New.
8198 (Plugin_manager::add_input_file): Use the extra search path if set.
8199 (set_extra_library_path(): New.
8200 * plugin.h (Plugin_manager): Add set_extra_library_path and
8201 extra_search_path_.
8202
a0506cca
CC
82032010-06-19 Cary Coutant <ccoutant@google.com>
8204
8205 * layout.cc (gdb_sections): Add .debug_types.
8206 (lines_only_debug_sections): Likewise.
8207
6508b958
RÁE
82082010-06-18 Rafael Espindola <espindola@google.com>
8209
8210 * plugin.cc (add_input_file,add_input_library)
8211 (Plugin_manager::add_input_file): Make filename arguments const.
8212 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8213 const.
8214
3e235302
DK
82152010-06-16 Doug Kwan <dougkwan@google.com>
8216
8217 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8218 .ARM.attributes section if we have not merged any input
8219 attributes sections.
8220
106e8a6c
DK
82212010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8222
8223 * arm.cc: Allow combining objects with no EABI version
8224 information.
8225
91ff43fe
RÁE
82262010-06-15 Rafael Espindola <espindola@google.com>
8227
8228 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8229
68ed838c
ILT
82302010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8231
8232 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8233 (struct iovec): Correct !HAVE_READV definition.
8234
f3a2388f
CC
82352010-06-10 Cary Coutant <ccoutant@google.com>
8236
8237 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8238 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8239 reloc sections.
8240 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8241
8242 PR 11683
8243 * symtab.h (Symbol::is_placeholder): New member function.
8244 * target-reloc.h (relocate_section): Check for placeholder symbols.
8245
8246 * testsuite/Makefile.am (plugin_test_8): New test.
8247 (plugin_test_9): New test.
8248 * testsuite/Makefile.in: Regenerate.
8249
e1df38aa
NC
82502010-06-09 Nick Clifton <nickc@redhat.com>
8251
8252 * yyscript.y (input_list_element): Allow strings prefixed with
8253 the '-' character. Treat these as libraries.
8254 * script.cc (script_add_library): New function. Adds a library
8255 specified by "-l<name>" found in an input script.
8256 * script-c.h: Add prototype for script_add_library.
8257
25bbe950
DK
82582010-06-07 Doug Kwan <dougkwan@google.com>
8259
8260 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8261 Restrict stub-group size to be within long conditional branch
8262 range when working around cortex-A8 erratum.
8263
0f32ea4c
ILT
82642010-06-07 Damien Diederen <dd@crosstwine.com>
8265
8266 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8267 #ifdef typo.
8268
8fe2a369
ST
82692010-06-03 Sriraman Tallam <tmsriram@google.com>
8270
8271 PR gold/11658
8272 * output.cc
8273 (Output_section::Input_section_sort_entry::compare_section_ordering):
8274 Change to return non-zero correctly.
8275 (Output_section::Input_section_sort_section_order_index_compare
8276 ::operator()): Change to fix ambiguity in comparisons.
8277
6e9ba2ca
ST
82782010-06-01 Sriraman Tallam <tmsriram@google.com>
8279
8280 * gold.h (is_wildcard_string): New function.
8281 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8282 (Layout::layout_eh_frame): Ditto.
8283 (Layout::find_section_order_index): New method.
8284 (Layout::read_layout_from_file): New method.
8285 * layout.h (Layout::find_section_order_index): New method.
8286 (Layout::read_layout_from_file): New method.
8287 (Layout::input_section_position_): New private member.
8288 (Layout::input_section_glob_): New private member.
8289 * main.cc (main): Call read_layout_from_file here.
8290 * options.h (--section-ordering-file): New option.
8291 * output.cc (Output_section::input_section_order_specified_): New
8292 member.
8293 (Output_section::Output_section): Initialize new member.
8294 (Output_section::add_input_section): Add new parameter.
8295 Keep input sections when --section-ordering-file is used.
8296 (Output_section::set_final_data_size): Sort input sections when
8297 section ordering file is specified.
8298 (Output_section::Input_section_sort_entry): Add new parameter.
8299 Check sorting type.
8300 (Output_section::Input_section_sort_entry::compare_section_ordering):
8301 New method.
8302 (Output_section::Input_section_sort_compare::operator()): Change to
8303 consider section_order_index.
8304 (Output_section::Input_section_sort_init_fini_compare::operator()):
8305 Change to consider section_order_index.
8306 (Output_section::Input_section_sort_section_order_index_compare
8307 ::operator()): New method.
8308 (Output_section::sort_attached_input_sections): Change to sort
8309 according to section order when specified.
e1df38aa
NC
8310 (Output_section::add_input_section<32, true>): Add new parameter.
8311 (Output_section::add_input_section<64, true>): Add new parameter.
8312 (Output_section::add_input_section<32, false>): Add new parameter.
8313 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8314 * output.h (Output_section::add_input_section): Add new parameter.
8315 (Output_section::input_section_order_specified): New
8316 method.
8317 (Output_section::set_input_section_order_specified): New method.
8318 (Input_section::Input_section): Initialize section_order_index_.
8319 (Input_section::section_order_index): New method.
8320 (Input_section::set_section_order_index): New method.
8321 (Input_section::section_order_index_): New member.
8322 (Input_section::Input_section_sort_section_order_index_compare): New
8323 struct.
8324 (Output_section::input_section_order_specified_): New member.
8325 * script-sections.cc (is_wildcard_string): Delete and move modified
8326 method to gold.h.
8327 (Output_section_element_input::Output_section_element_input): Modify
8328 call to is_wildcard_string.
8329 (Output_section_element_input::Input_section_pattern
8330 ::Input_section_pattern): Ditto.
8331 (Output_section_element_input::Output_section_element_input): Ditto.
8332 * testsuite/Makefile.am (final_layout): New test case.
8333 * testsuite/Makefile.in: Regenerate.
8334 * testsuite/final_layout.cc: New file.
8335 * testsuite/final_layout.sh: New file.
8336
3537c84b
RÁE
83372010-06-01 Rafael Espindola <espindola@google.com>
8338
8339 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8340
105b6afd
RÁE
83412010-06-01 Rafael Espindola <espindola@google.com>
8342
8343 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8344 visibility of symbols.
8345
29e11421
DK
83462010-05-27 Doug Kwan <dougkwan@google.com>
8347
8348 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8349 from start of output section instead of address for a local symbol
8350 in a merged or relaxed section when doing a relocatable link.
8351
5e0f337e
RÁE
83522010-05-26 Rafael Espindola <espindola@google.com>
8353
703d02da 8354 PR 11604
5e0f337e
RÁE
8355 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8356 adding sections the garbage collector removed.
8357 * gold/testsuite/Makefile.am: Add test.
8358 * gold/testsuite/Makefile.in: Regenerate.
8359 * gold/testsuite/plugin_test_7.sh: New.
8360 * gold/testsuite/plugin_test_7_1.c: New.
8361 * gold/testsuite/plugin_test_7_2.c: New.
8362
f4187277
RÁE
83632010-05-26 Rafael Espindola <espindola@google.com>
8364
8365 * script-sections.cc (Output_section_definition::set_section_addresses):
8366 Check for --section-start.
8367
5c388529
DK
83682010-05-26 Doug Kwan <dougkwan@google.com>
8369
8370 * arm.cc (Arm_scan_relocatable_relocs): New class.
8371 (Target_arm::relocate_special_relocatable): New method.
8372 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8373 (Arm_relocate_functions::thumb_branch_common): Same.
8374 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8375 instead of Default_scan_relocatable_relocs.
8376 * target-reloc.h (relocate_for_relocatable): Let target handle
8377 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8378 * target.h (Sized_target::relocate_special_relocatable): New method.
8379
bca1c3ae
ILT
83802010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8381
8382 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8383
0439c796
DK
83842010-05-23 Doug Kwan <dougkwan@google.com>
8385
8386 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8387 instead of a cast.
8388 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8389 with a direct branch, not a conditional branch, to a stub.
8390 * merge.cc (Output_merge_base::record_input_section): New method
8391 defintion.
8392 (Output_merge_data::do_add_input_section): Record input section if
8393 keeps-input-sections flag is set.
8394 (Output_merge_string::do_add_input_section): Ditto.
8395 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8396 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8397 INPUT_SECTIONS_.
8398 (Output_merge_base::keeps_input_sections,
8399 Output_merge_base::set_keeps_input_sections,
8400 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8401 method definitions.
8402 (Output_merge_base::Input_sections): New type declaration.
8403 (Output_merge_base::input_sections_begin,
8404 Output_merge_base::input_sections_end,
8405 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8406 (Output_merge_base::bool keeps_input_sections_,
8407 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8408 Output_merge_base::input_sections_): New data members.
8409 (Output_merge_data::do_set_keeps_input_sections): New method
8410 defintion.
8411 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8412 * output.cc (Output_section::Input_section::relobj): Move method
8413 defintion from class declaration to here and handle merge sections.
8414 (Output_section::Input_section::shndx): Ditto.
8415 (Output_section::Output_section): Remove initializations of removed
8416 data members and initialize new data member LOOKUP_MAPS_.
8417 (Output_section::add_input_section): Set keeps-input-sections flag
8418 for a newly created merge output section as appropriate. Adjust code
8419 to use Output_section_lookup_maps class.
8420 (Output_section::add_relaxed_input_section): Adjst code for lookup
8421 maps code refactoring.
2e702c99 8422 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8423 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8424 class. If adding input section to a newly created merge output
8425 section fails, remove the new merge section.
8426 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8427 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8428 (Output_section::find_merge_section): Ditto.
0439c796 8429 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8430 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8431 Output_section_lookup_maps class.
8432 (Output_section::get_input_sections): Export merge sections. Adjust
8433 code to use Output_section_lookup_maps class.
8434 (Output_section:::add_script_input_section): Adjust code to use
8435 Output_section_lookup_maps class. Update lookup maps for merge
8436 sections also.
8437 (Output_section::discard_states): Use Output_section_lookup_maps.
8438 (Output_section::restore_states): Same.
8439 * output.h (Merge_section_properties): Move class defintion out of
8440 Output_section.
8441 (Output_section_lookup_maps): New class.
8442 (Output_section::Input_section::is_merge_section): New method
8443 defintion.
8444 (Output_section::Input_section::relobj): Move defintion out of class
8445 defintion. Declare method only.
8446 (Output_section::Input_section::shndx): Ditto.
8447 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8448 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8449 (Output_section::Merge_section_by_properties_map,
8450 Output_section::Output_section_data_by_input_section_map,
8451 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8452 Remove types.
2e702c99 8453 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8454 KEEPS_INPUT_SECTIONS.
8455 (Output_section::build_lookup_maps): New method declaration.
8456 (Output_section::merge_section_map_,
8457 Output_section::merge_section_by_properties_map_,
8458 Output_section::relaxed_input_section_map_,
8459 Output_section::is_relaxed_input_section_map_valid_): Remove data
8460 members.
8461 (Output_section::lookup_maps_): New data member.
8462
76295588
L
84632010-05-21 Doug Kwan <dougkwan@google.com>
8464
8465 PR gold/11619
8466 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8467 avoid a compilation error.
8468
d103a984
RÁE
84692010-05-19 Rafael Espindola <espindola@google.com>
8470
8471 * script-sections.cc (Output_section_definition::allocate_to_segment):
8472 Update the phdrs_list even when the output section is NULL.
8473 * testsuite/Makefile.am: Add test.
8474 * testsuite/Makefile.in: Regenerate.
8475 * testsuite/script_test_9.cc: New.
8476 * testsuite/script_test_9.sh: New.
8477 * testsuite/script_test_9.t: New.
8478
6625d24e
DK
84792010-05-19 Doug Kwan <dougkwan@google.com>
8480
8481 * arm.cc (Arm_input_section::original_size): New method.
8482 (Arm_input_section::do_addralign): Add a cast.
8483 (Arm_input_section::do_output_offset): Remove static cast.
8484 (Arm_input_section::original_addralign,
8485 Arm_input_section::original_size_): Change type to uint32_t.
8486 (Arm_input_section::init): Add safe casts for section alignment
8487 and size.
8488 (Arm_input_section::set_final_data_size): Do not set address and
8489 offset of stub table.
8490 (Arm_output_section::fix_exidx_coverage): Change use of of
8491 Output_section::Simple_input_section to that of
8492 Output_section::Input_section.
8493 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8494 except for the first pass.
8495 * output.cc (Output_section::get_input_sections): Change type of
8496 input_sections to std::list<Input_section>.
8497 (Output_section::add_script_input_section): Rename from
8498 Output_section::add_simple_input_section. Change type of SIS
8499 parameter from Simple_input_section to Input_section.
8500 * output.h (Output_section::Simple_input_section): Remove class.
8501 (Output_section::Input_section): Change class visibility to public.
8502 (Output_section::Input_section::addralign): Use stored alignments
8503 for special input sections if set.
8504 (Output_section::Input_section::set_addralign): New method.
8505 (Output_section::get_input_sections): Change parameter type from
8506 list of Simple_input_section to list of Input_section.
8507 (Output_section::add_script_input_section): Rename from
8508 Output_section::add_simple_input_section. Change first parameter's
8509 type from Simple_input_section to Input_section and remove the
8510 second and third parameters.
8511 * script-sections.cc (Input_section::Input_section_list): Change
8512 type to list of Output_section::Input_section/
8513 (Input_section_info::Input_section_info): Change parameter type of
8514 INPUT_SECTION to Output_section::Input_section.
8515 (Input_section_info::input_section): Change return type.
8516 (Input_section_info::input_section_): Change type to
8517 Output_section::Input_section.
8518 (Output_section_element_input::set_section_addresses): Adjust code
8519 to use Output_section::Input_section instead of
8520 Output_section::Simple_input_section. Adjust code for renaming
8521 of Output_section::add_simple_input_section.
8522 (Orphan_output_section::set_section_addresses): Ditto.
8523
e1e82ea4
RW
85242010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8525
8526 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8527 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8528
91e75c8a
RÁE
85292010-05-18 Rafael Espindola <espindola@google.com>
8530
8531 * options.cc (General_options::finalize): Handle -nostdlib.
8532 * options.h (nostdlib): New option.
8533 * script.cc (script_add_search_dir): Handle -nostdlib.
8534
da59ad79
DK
85352010-05-12 Doug Kwan <dougkwan@google.com>
8536
8537 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8538 attributes section only if there no attributes section after merging.
8539 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8540 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8541 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8542 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8543 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8544 and arm_attr_merge_7.stdout.
8545 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8546 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8547 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8548 arm_attr_merge_7b.o): New rules.
8549 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8550 arm_attr_merge_7
8551 * testsuite/Makefile.in: Regenerate.
8552 * testsuite/arm_attr_merge.sh: New file.
8553 * testsuite/arm_attr_merge_[67][ab].s: Same.
8554
3e01a7fd
NC
85552010-05-05 Nick Clifton <nickc@redhat.com>
8556
8557 * po/es.po: Updated Spanish translation.
8558
7ad2014a
L
85592010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8560
8561 * Makefile.am (install-exec-local): Properly install gold as
8562 default cross linker.
8563 * Makefile.in: Regenerated.
8564
4fda8867
NC
85652010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8566 Nick Clifton <nickc@redhat.com>
8567
8568 * configure.ac (install_as_default): Define and set to false
8569 unless --enable-gold or --enable-gold=both/gold has been
8570 specified.
8571 * configure: Regenerate.
8572
8573 * Makefile.am (install-exec-local): Install the executable as
8574 'ld.gold'. If install_as_default is true then also install it as
8575 'ld'.
8576 * Makefile.in: Regenerated.
8577
bd288ea2
ILT
85782010-04-24 Ian Lance Taylor <iant@google.com>
8579
8580 * layout.cc (Layout::layout_reloc): In relocatable link don't
8581 combine reloc sections for grouped sections.
8582
ef38fd8a
ST
85832010-04-23 Sriraman Tallam <tmsriram@google.com>
8584
8585 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8586 sections that are not ordinary to icf.
8587 * icf.cc (get_section_contents): Handle relocation pointing to section
8588 with no object or shndx information.
8589 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8590 * testsuite/Makefile.in: Regenerate.
8591 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8592 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8593
f6973bdc
ILT
85942010-04-22 Ian Lance Taylor <iant@google.com>
8595
8596 * expression.cc (Expression::Expression_eval_info): Add
8597 result_alignment_pointer field.
8598 (Expression::eval_with_dot): Add result_alignment_pointer
8599 parameter. Change all callers.
8600 (Expression::eval_maybe_dot): Likewise.
8601 (class Binary_expression): Add alignment_pointer parameter to
8602 left_value and right_value. Change all callers.
8603 (BINARY_EXPRESSION): Set result alignment.
8604 (class Trinary_expression): Add alignment_pointer parameter to
8605 arg2_value and arg3_value. Change all callers.
8606 (Trinary_cond::value): Set result alignment.
8607 (Max_expression::value, Min_expression::value): Likewise.
8608 (Align_expression::value): Likewise.
8609 * script-sections.cc (class Sections_element): Add dot_alignment
8610 parameter to set_section_addresses virtual function. Update
8611 instantiations.
8612 (class Output_section_element): Likewise.
8613 (Script_sections::create_segments): Add dot_alignment parameter.
8614 Change all callers.
8615 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8616 (Script_sections::set_phdrs_clause_addresses): Likewise.
8617 * script-sections.h: Update declarations.
8618 * script.h: Update declarations.
8619 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8620 min_p_align.
8621 * testsuite/script_test_3.t: Set large alignment.
8622 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8623 segment has expected alignment.
8624
9c9c98a5
NC
86252010-04-22 Nick Clifton <nickc@redhat.com>
8626
8627 * po/gold.pot: Updated by the Translation project.
8628 * po/vi.po: Updated Vietnamese translation.
8629
2253bfba
L
86302010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8631
8632 * testsuite/Makefile.am (check_PROGRAMS): Add
8633 icf_virtual_function_folding_test.
8634 * testsuite/Makefile.in: Regenerated.
8635
85fdf906
AH
86362010-04-15 Andrew Haley <aph@redhat.com>
8637
8638 * options.h (merge_exidx_entries): New option.
8639 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8640 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8641 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8642 (Target_arm::merge_exidx_entries): New function.
8643 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8644 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8645 to Arm_exidx_fixup constructor.
8646 Add new arg, merge_exidx_entries.
8647 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8648 Arm_output_section::fix_exidx_coverage.
8649
ce97fa81
ST
86502010-04-18 Sriraman Tallam <tmsriram@google.com>
8651
8652 * icf.cc (get_section_contents): Check for preemptible functions.
8653 Ignore addend when appropriate.
8654 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8655 section folded.
8656 (add_from_relobj): Check for section folded.
8657 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8658 * symtab.h (should_add_dynsym_entry): Add new parameter.
8659 * target-reloc.h (scan_relocs): Check for section folded.
8660 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8661 Check reloc types for function pointers in shared objects.
8662 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8663 case.
8664 (icf_preemptible_functions_test): New test case.
8665 (icf_string_merge_test): New test case.
8666 * testsuite.Makefile.in: Regenerate.
8667 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8668 bar_glob. Refactor code.
8669 * testsuite/icf_preemptible_functions_test.cc: New file.
8670 * testsuite/icf_preemptible_functions_test.sh: New file.
8671 * testsuite/icf_string_merge_test.cc: New file.
8672 * testsuite/icf_string_merge_test.sh: New file.
8673 * testsuite/icf_virtual_function_folding_test.cc: New file.
8674 * testsuite/icf_virtual_function_folding_test.sh: New file.
8675
04ceb17c
DK
86762010-04-14 Doug Kwan <dougkwan@google.com>
8677
8678 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8679 for local symbol recounting if we remove a section due to ICF.
8680 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8681 there are no regular objects in input.
8682
153e7da4
DK
86832010-04-13 Doug Kwan <dougkwan@google.com>
8684
8685 * arm.cc (Arm_input_section::set_final_data_size): Compute
8686 accurate final data size instead of using current data size.
8687
4dbd9faf
DK
86882010-04-09 Doug Kwan <dougkwan@google.com>
8689
8690 * layout.cc (Layout::choose_output_section): Handle script section
8691 types.
8692 (Layout::make_output_section_for_script): Add section type parameter.
8693 Handle script section types.
8694 * layout.h (Layout::make_output_section_for_script): Add section
8695 type parameter.
8696 * output.cc (Output_section::Output_section): Initialize data member
8697 is_noload_.
8698 (Output_section::do_reset_address_and_file_offset): Do not set address
8699 to 0 if section is a NOLOAD section.
8700 * output.h (Output_section::is_noload): New method.
8701 (Output_section::set_is_noload): Ditto.
8702 (Output_section::is_noload_): New data member.
8703 * script-c.h (Script_section_type): New enum type.
8704 (struct Parser_output_section_header): Add new file section_type.
8705 * script-sections.cc (Sections_element::output_section_name): Add
8706 parameter for returning script section type.
8707 (Output_section_definition::output_section_name): Ditto.
8708 (Output_section_definition::section_type)P; New method.
8709 (Output_section_definiton::script_section_type_name): Ditto.
8710 (Output_section_definition::script_section_type_): New data member.
8711 (Output_section_definition::Output_section_definition): Initialize
8712 data member Output_section_definition::script_section_type_.
8713 (Output_section_definition::create_sections): Pass script section type
8714 to Layout::make_output_section_for_script.
8715 (Output_section_definition::output_section_name): Return script
8716 section type to caller.
8717 (Output_section_definition::set_section_address): Do not advance
8718 dot value and load address if section type is NOLOAD. Set address
8719 of NOLOAD sections regardless of section flags.
8720 (Output_section_definition::print): Print section type if it is
8721 not SCRIPT_SECTION_TYPE_NONE.
8722 (Output_section_definition::section_type): New method.
8723 (Output_section_definition::script_section_type_name): Ditto.
8724 (Script_sections::output_section_name): Add new parameter
8725 PSECTION_TYPE for returning script section type. Pass it to
8726 section elements. Handle discard sections.
8727 (Sort_output_sections::operator()): Handle NOLOAD sections.
8728 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8729 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8730 returning script section type.
8731 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8732 INFO and NOLOAD.
8733 * yyscript.y (union): Add new field SECTION_TYPE.
8734 (COPY, DSECT, INFO, NOLOAD): New tokens.
8735 (opt_address_and_section_type): Change type to output_section_header.
8736 (section_type): New non-terminal
8737 (section_header): Handle section type.
2253bfba 8738 (opt_address_and_section_type): Return section type value.
4dbd9faf 8739
721ea635
L
87402010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8741
8742 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8743 * testsuite/plugin_common_test_2.c (foo): Likewise.
8744
6bf924b0
DK
87452010-04-08 Doug Kwan <dougkwan@google.com>
8746
8747 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8748 Output_merge_data.
8749 * output.cc (Output_section::add_merge_input_section): Simplify
8750 code and return status of Output_merge_base::add_input_section.
e1df38aa 8751 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8752 returns true.
8753
24af6f92
DK
87542010-04-07 Doug Kwan <dougkwan@google.com>
8755
8756 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8757 if section is marked as containing instructions but has no mapping
8758 symbols.
8759 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8760 correct section index.
8761 (Arm_relobj::find_linked_text_section): Ditto.
8762
00698fc5
CC
87632010-04-07 Cary Coutant <ccoutant@google.com>
8764
8765 * archive.cc (include_member): Destroy Read_symbols_data object before
8766 releasing file.
8767 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8768 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8769 (Read_symbols_data::~Read_symbols_data) New destructor.
8770 (Section_relocs::Section_relocs) New constructor.
8771 (Section_relocs::~Section_relocs) New destructor.
8772 (Read_relocs_data::Read_relocs_data) New constructor.
8773 (Read_relocs_data::~Read_relocs_data) New destructor.
8774 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8775 pointers to NULL after deleting.
8776
7296d933
DK
87772010-04-07 Doug Kwan <dougkwan@google.com>
8778
8779 * arm.cc: Replace "endianity" with "endianness" in comments.
8780 (Arm_exidx_cantunwind): Ditto.
8781 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8782 (Arm_relobj::merge_flags_and_attributes): New method.
8783 (Arm_relobj::merge_flags_and_attributes_): New data member.
8784 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8785 (Arm_relobj::scan_sections_for_stubs): Ditto.
8786 (Arm_relobj::do_read_symbols): Check to see if we really want to
8787 merge processor-specific flags and attributes. Exit early if
8788 an object is empty except for section names and the undefined symbol.
8789 (Target_arm::do_finalize_sections): Move check for ELF format to
8790 Arm_relobj::do_read_symbols. Merge processor specific flags and
8791 attributes from a regular object only when we have determined that
8792 it is aapropriate. Do not create an .ARM.attributes section in
8793 output if there is no regular input object.
8794 (Target_arm::merge_processor_specific_flags): Check
8795 --warn-mismatch before printing any error.
8796 (Target_arm::merge_object_attributes): Ditto.
8797 * gold.cc (queue_middle_tasks): Handle the case in which there is
8798 no regular object in input.
8799 * options.cc (General_options::parse_EB): New method.
8800 (General_options::parse_EL): Same.
8801 (General_options::General_options): Initialize endianness_.
8802 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8803 New options.
8804 (General_options::Endianness): New enum.
8805 (General_options::endianness): New method.
8806 (General_options::endianness_): New data member.
8807 * parameters.cc (Parameters::set_options): Check target endianness.
8808 (Parameters::set_target_once): Ditto.
8809 (Parameters::check_target_endianness): New method.
8810 (parameters_force_valid_target): If either -EL or -EB is specified,
8811 use it to define endianness of default target.
8812 * parameters.h (Parameters::check_target_endianness): New method
8813 declaration.
8814 * target.h (class Target): Change "endianity" to "endianness"
8815 in comments.
8816
efc8d4f2
RW
88172010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8818
8819 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8820 * configure: Regenerate.
8821 * Makefile.in: Regenerate.
8822 * testsuite/Makefile.in: Regenerate.
8823
be234d88
CC
88242010-04-06 Cary Coutant <ccoutant@google.com>
8825
8826 gcc PR lto/42757
8827 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8828 prevailing definitions of common symbols.
8829 * testsuite/plugin_test_6.sh: New test case.
8830 * testsuite/plugin_common_test_1.c: New test case.
8831 * testsuite/plugin_common_test_2.c: New test case.
8832 * testsuite/Makefile.am (plugin_test_6): New test case.
8833 * testsuite/Makefile.in: Regenerate.
8834
bd32c6bd
NC
88352010-04-06 Nick Clifton <nickc@redhat.com>
8836
8837 * po/vi.po: New Vietnamese translation.
8838
323c532f
DK
88392010-03-30 Doug Kwan <dougkwan@google.com>
8840
8841 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8842
4fcd97eb
DK
88432010-03-25 Doug Kwan <dougkwan@google.com>
8844
8845 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8846 to avoid a conversion warning on a 32-bit host.
8847
4ebf39db
ILT
88482010-03-24 Ian Lance Taylor <iant@google.com>
8849
8850 * testsuite/script_test_3.t: Add a TLS segment.
8851 * testsuite/Makefile.am (check_PROGRAMS): Add
8852 tls_phdrs_script_test.
8853 (tls_phdrs_script_test_SOURCES): Define.
8854 (tls_phdrs_script_test_DEPENDENCIES): Define.
8855 (tls_phdrs_script_test_LDFLAGS): Define.
8856 (tls_phdrs_script_test_LDADD): Define.
8857 * testsuite/Makefile.in: Rebuild.
8858
4a599bdd
CC
88592010-03-23 Cary Coutant <ccoutant@google.com>
8860
8861 * fileread.cc (find_or_make_view): Fix comment.
8862
6c93b22c
ILT
88632010-03-23 Ian Lance Taylor <iant@google.com>
8864
8865 * script-sections.cc (class Orphan_section_placement): Define
8866 PLACE_TLS and PLACE_TLS_BSS.
8867 (Orphan_section_placement::Orphan_section_placement): Initialize
8868 new places.
8869 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8870 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8871 (tls_script_test_SOURCES): Define.
8872 (tls_script_test_DEPENDENCIES): Define.
8873 (tls_script_test_LDFLAGS): Define.
8874 (tls_script_test_LDADD): Define.
8875 * testsuite/Makefile.in: Rebuild.
8876
a2c7281b
DK
88772010-03-22 Doug Kwan <dougkwan@google.com>
8878
8879 * arm.cc (Arm_relocate_functions::abs8,
8880 Arm_relocate_functions::abs16): Use correct check for overflow
8881 specified in the ARM ELF specs.
8882 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8883 target of a BLX instruction specially.
8884 (Reloc_stub::stub_type_for_reloc): Ditto.
8885 (Relocate::relocate): Use symbolic names instead of numeric relocation
8886 codes to report error.
8887 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8888 workaround.
8889 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8890 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8891 thumb2_blx_out_of_range.stdout
8892 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8893 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8894 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8895 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8896 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8897 thumb2_blx_in_range, thumb2_blx_in_range.o,
8898 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8899 thumb2_blx_out_of_range.o): New rules.
2e702c99 8900 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8901 thumb2_blx_in_range and thumb2_blx_out_of_range.
8902 * testsuite/Makefile.in: Regenerate.
8903 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8904 * testsuite/thumb_blx_in_range.s: New file.
8905 * testsuite/thumb_blx_out_of_range.s: New file.
8906
b0193076
RÁE
89072010-03-22 Rafael Espindola <espindola@google.com>
8908
8909 * archive.cc (Should_include): Move to archive.h.
8910 (should_include_member): Make it a member of Archive.
8911 (Lib_group): New.
8912 (Add_lib_group_symbols): New.
8913 * archive.h: Include options.h.
8914 (Archive_member): Moved from Archive.
8915 (Should_include): Moved from archive.cc.
8916 (Lib_group): New.
8917 (Add_lib_group_symbols): New.
8918 * dynobj.cc (do_should_include_member): New.
8919 * dynobj.h (do_should_include_member): New.
8920 * gold.cc (queue_initial_tasks): Update call to queue.
8921 * main.cc (main): Print lib group stats.
8922 * object.cc (do_should_include_member): New.
8923 * object.h: Include archive.h.
8924 (Object::should_include_member): New.
8925 (Object::do_should_include_member): New.
8926 (Sized_relobj::do_should_include_member): New.
8927 * options.cc (General_options::parse_start_lib): New.
8928 (General_options::parse_end_lib): New.
8929 (Input_arguments::add_file): Handle lib groups.
8930 (Input_arguments::start_group): Check we are not in a lib.
8931 (Input_arguments::start_lib): New.
8932 (Input_arguments::end_lib): New.
8933 * options.h (General_options): Add start_lib and end_lib.
8934 (Input_argument::lib_): New.
8935 (Input_argument::lib): New.
8936 (Input_argument::is_lib): New.
8937 (Input_file_lib): New.
8938 (Input_arguments::in_lib_): New.
8939 (Input_arguments::in_lib): New.
8940 (Input_arguments::start_lib): New.
8941 (Input_arguments::end_lib_): New.
8942 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8943 in unused members as preempted.
8944 (Sized_pluginobj::do_should_include_member): New.
8945 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8946 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8947 return the blocker.
8948 (Read_symbols::do_whole_lib_group): New.
8949 (Read_symbols::do_lib_group): New.
8950 (Read_symbols::do_read_symbols): Handle lib groups.
8951 (Read_symbols::get_name): Handle lib groups.
8952 * readsyms.h (Read_symbols): Add an archive member pointer.
8953 (Read_symbols::do_whole_lib_group): New.
8954 (Read_symbols::do_lib_group): New.
8955 (Read_symbols::member_): New.
8956 * script.cc (read_input_script): Update call to queue_soon.
8957
d099120c
DK
89582010-03-19 Doug Kwan <dougkwan@google.com>
8959
8960 * arm.cc (Stub_table::Stub_table): Initialize new data members
8961 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8962 (Stub_table::add_reloc_stub): Assign stub offset and update
8963 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8964 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8965 New data members.
2e702c99 8966 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8967 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8968 instead of going over all reloc stubs.
2e702c99 8969 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8970 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8971 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8972 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8973 Stringpool_template::offset_.
8974 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8975 Stringpool_template::offset_ to zero.
8976
1aa37384
DK
89772010-03-15 Doug Kwan <dougkwan@google.com>
8978
8979 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8980 offset_.
8981 (Stringpool_template::new_key_offset): New method.
8982 (Stringpool_template::add_string): Assign offsets when adding new
8983 strings.
8984 (Stringpool_template::set_string_offsets): Do not set string offsets
8985 when not optimizing.
8986 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8987 member size_.
2e702c99
RM
8988 (Chunked_vector::clear): Clear size_.
8989 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8990 (Chunked_vector::size): Return size_.
8991 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8992 (Chunked_vector::size_): New data member.
1aa37384
DK
8993 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8994 (Stringpool_template::new_key_offset): New method declaration.
8995 (Stringpool_template::offset_): New data member.
8996
b672b057
RÁE
89972010-03-15 Rafael Espindola <espindola@google.com>
8998
8999 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9000 Add_symbols' constructor.
9001 * readsyms.h (Add_symbols): Remove the input_group member.
9002
b6848d3c
ILT
90032010-03-10 Ian Lance Taylor <iant@google.com>
9004
9005 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9006 target to ask whether a reference to a symbol requires a stack
9007 split.
9008 * target.h (Target::is_call_to_non_split): New function.
9009 (Target::do_is_call_to_non_split): Declare virtual function.
9010 * target.cc: Include "symtab.h".
9011 (Target::do_is_call_to_non_split): New function.
9012 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9013
a2a5469e
CC
90142010-03-10 Cary Coutant <ccoutant@google.com>
9015
9016 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9017 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9018 (File_read::open[2]): Add whole_file_view_ to list of views.
9019 (File_read::make_view): Remove test of whole_file_view_.
9020 (File_read::find_or_make_view): Create whole_file_view_ if
9021 necessary.
9022 (File_read::clear_views): Replace bool parameter with enum;
9023 adjust all callers. Don't delete views with permanent data;
9024 do delete cached views and views from archives if
9025 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9026 if clearing the corresponding view.
9027 * fileread.h (File_read::Clear_views_mode): New enum.
9028 (File_read::View::is_permanent_view): New method.
9029 (File_read::clear_views): Replace bool parameter
9030 with enum; adjust all callers.
9031 * options.h (General_options): Change keep_files_mapped option;
9032 add map_whole_files.
9033 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9034 releasing the file.
9035 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9036 the file.
9037
8861f32b
DM
90382010-03-10 David S. Miller <davem@davemloft.net>
9039
9040 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9041
d62d0f5f
ST
90422010-03-09 Sriraman Tallam <tmsriram@google.com>
9043
9044 * icf.cc (get_section_contents): Add '@' marker after processing the
9045 merge reloc.
9046
9177756d
DK
90472010-03-08 Doug Kwan <dougkwan@google.com>
9048
9049 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9050 due to a conversion warning.
9051 (Arm_relobj::update_output_local_symbol_count): Check for local
9052 symbol with unset output index.
9053
9e9e071b
ILT
90542010-03-05 Ian Lance Taylor <iant@google.com>
9055
9056 * options.h (class General_options): Add --spare-dynamic-tags.
9057 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9058 --spare-dynamic-tags.
9059
a81ee015
ILT
90602010-03-05 Ian Lance Taylor <iant@google.com>
9061
9062 * incremental.cc: Include "libiberty.h".
9063
44ec90b9
RO
90642010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9065
9066 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9067 function, is_info_ member.
9068 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9069 (Versions::Versions): Update caller.
9070 (Versions::define_base_version): Likewise.
9071 (Versions::add_def): Likewise.
9072
0897ed3b
ST
90732010-03-03 Sriraman Tallam <tmsriram@google.com>
9074
9075 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9076 (Scan::possible_function_pointer_reloc): New function.
9077 (Scan::local_reloc_may_be_function_pointer): Change to call
9078 possible_function_pointer_reloc.
9079 (Scan::global_reloc_may_be_function_pointer): Ditto.
9080 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9081 relocations in ".data.rel.ro._ZTV" section.
9082 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9083 * testsuite/icf_safe_so_test.cc: Ditto.
9084 * testsuite/icf_safe_test.cc: Ditto.
9085 * testsuite/icf_safe_test.sh: Ditto.
9086
d3bbad62
ILT
90872010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9088 Ian Lance Taylor <iant@google.com>
9089
9090 * target-reloc.h (relocate_section): Check the symbol table index
9091 for -1U before setting the local symbol index.
9092 (scan_relocatable_relocs): If copying the relocation, record that
9093 the local symbol is required.
9094 * object.h (Symbol_value::is_output_symtab_index_set): New
9095 function.
9096 (Symbol_value::may_be_discarded_from_output_symtab): New
9097 function.
9098 (Symbol_value::has_output_symtab_entry): New function.
9099 (Symbol_value::needs_output_symtab_entry): Remove.
9100 (Symbol_value::output_symtab_index): Make sure the symbol index is
9101 set.
9102 (Symbol_value::set_output_symtab_index): Make sure the symbol
9103 index is not set. Make sure the new index is valid.
9104 (Symbol_value::set_must_have_output_symtab_entry): New function.
9105 (Symbol_value::has_output_dynsym_entry): New function.
9106 (Symbol_value::set_output_dynsym_index): Make sure the new index
9107 is valid.
9108 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9109 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9110 local symbol if permitted.
9111 (Sized_relobj::do_finalize_local_symbols): Call
9112 is_output_symtab_index_set rather than needs_output_symtab_entry.
9113 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9114 rather than needs_output_symtab_entry. Call
9115 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9116 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9117 is_output_symtab_index_set rather than needs_output_symtab_entry.
9118 * testsuite/discard_locals_relocatable_test.c: New file.
9119 * testsuite/discard_locals_test.sh: Test -r.
9120 * testsuite/Makefile.am (check_DATA): Add
9121 discard_locals_relocatable_test1.syms,
9122 discard_local_relocatable_test2.syms.
9123 (MOSTLYCLEANFILES): Likewise. Also add
9124 discard_locals_relocatable_test1.lout and
9125 discard_locals_relocatable_test2.out.
9126 (discard_locals_relocatable_test1.syms): New target.
9127 (discard_locals_relocatable_test.o): New target.
9128 (discard_locals_relocatable_test1.out): New target.
9129 (discard_locals_relocatable_test2.syms): New target.
9130 (discard_locals_relocatable_test2.out): New target.
9131 (various): Add missing ../ld-new dependencies.
9132 * testsuite/Makefile.in: Rebuild.
9133
7e8ccf26
NC
91342010-03-03 Nick Clifton <nickc@redhat.com>
9135
9136 * po/fi.po: New Finnish translation.
9137
2a0ff005
DK
91382010-03-01 Doug Kwan <dougkwan@google.com>
9139
9140 * layout.cc (Layout::Layout): Force section types of .init_array*,
9141 .preinit_array* and .fini_array* sections.
9142 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9143 Fix check of return value of std::string::find.().
9144 (Output_section::Input_section_sort_compare::operator()): Remove
9145 comment about .init_array.
9146 (Output_section::Input_section_sort_init_fini_compare::operator()):
9147 New method.
9148 (Output_section::sort_attached_input_sections): Handle .init_array
9149 and .fini_array specially.
9150 * output.h (Output_section::Inut_section_sort_compare): Update
9151 comment.
9152 (Output_section::Input_section_sort_init_fini_compare): New struct.
9153
c3e4ae29
DK
91542010-02-26 Doug Kwan <dougkwan@google.com>
9155
9156 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9157 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9158 * testsuite/debug_msg.sh: Avoid matching source line number for
9159 use of global variable undef_int.
9160
2fd9ae7a
DK
91612010-02-26 Doug Kwan <dougkwan@google.com>
9162
9163 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9164 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9165 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9166 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9167 * options.cc (General_options::General_options): Initialize member
9168 fix_v4bx_.
9169 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9170 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9171 and rm_no_fix_v4bx.stdout
9172 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9173 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9174 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9175 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9176 and arm_no_fix_v4bx.
9177 * Makefile.in: Regenerate.
9178 * testsuite/arm_fix_v4bx.s: New file.
9179 * testsuite/arm_fix_v4bx.sh: Ditto.
9180
67ec7d0b
DK
91812010-02-24 Doug Kwan <dougkwan@google.com>
9182
9183 * arm.cc (Target_arm::got_section): Make the .got section the first
9184 non RELRO section in the data segment.
9185 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9186 suffixes of section names.
9187
10165461
DK
91882010-02-24 Doug Kwan <dougkwan@google.com>
9189
9190 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9191 flags and attributes merging if an input file is a binary file.
9192 * fileread.cc (Input_file::open): Record format of original file.
9193 * fileread.h (Input_file::Format): New enum type.
2e702c99 9194 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9195 (Input_file::format): New method definition.
9196 (Input_file::format_):: New data member.
9197
4a54abbb
DK
91982010-02-24 Doug Kwan <dougkwan@google.com>
9199
9200 * arm.cc (Arm_output_data_got): New class.
9201 (ARM_TCB_SIZE): New constant
9202 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9203 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9204 If user uses a script with a SECTIONS clause, issue only a warning
9205 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9206 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9207 garbage collection.
9208 (Target_arm::got_mode_index_entry): Handle static linking.
9209 (Target_arm::Scan::local): Ditto.
9210 (Target_arm::Scan::global): Ditto.
9211 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9212 all incorrectly implemented relocations.
e1df38aa 9213 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9214 Arm_output_section::fix_exidx_coverage.
9215 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9216 from ".ARM.exidx." and ".ARM.extab.".
9217
ca419a6f
ILT
92182010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9219
9220 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9221 section if it does not already exist.
9222 * attributes.cc (Attributes_section_data::Attributes_section_data):
9223 Don't crash if size is zero.
9224
135b9c78
ILT
92252010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9226 Ian Lance Taylor <iant@google.com>
9227
9228 * gold.cc (queue_middle_tasks): If no input files were opened,
9229 exit.
9230 * workqueue.h (Task_function::Task_function): Assert that there is
9231 a blocker.
9232
bb0bfe4f
DK
92332010-02-22 Doug Kwan <dougkwan@google.com>
9234
9235 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9236 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9237 types to avoid warnings due to different uint64_t implementations
9238 on different hosts.
9239
2a2b6d42
DK
92402010-02-21 Doug Kwan <dougkwan@google.com>
9241
9242 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9243 handling of the maximum backward branch offset.
2e702c99 9244 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9245 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9246 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9247 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9248 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9249 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9250 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9251 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9252 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9253 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9254 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9255 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9256 thumb2_bl_out_of_range.o): New rules.
9257 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9258 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9259 thumb2_bl_out_of_range
9260 * testsuite/Makefile.in: Regenerate.
9261 * testsuite/arm_bl_in_range.s: New file.
9262 * testsuite/arm_bl_out_of_range.s: Ditto.
9263 * testsuite/arm_branch_in_range.sh: Ditto.
9264 * testsuite/arm_branch_range.t: Ditto.
9265 * testsuite/thumb2_branch_range.t: Ditto.
9266 * testsuite/thumb_bl_in_range.s: Ditto.
9267 * testsuite/thumb_bl_out_of_range.s: Ditto.
9268 * testsuite/thumb_branch_range.t: Ditto.
9269
b487ad64
ST
92702010-02-20 Sriraman Tallam <tmsriram@google.com>
9271
9272 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9273 Add reloc offset information.
9274 * icf.cc (get_section_contents): Change iterators to point to the new
9275 vectors. Add reloc offset information to the contents.
9276 * icf.h (Icf::Sections_reachable_info): New typedef.
9277 (Icf::Sections_reachable_list): New typedef.
9278 (Icf::Offset_info): New typedef.
9279 (Icf::Reloc_info): New struct typedef.
9280 (Icf::Reloc_info_list): New typedef.
9281 (Icf::symbol_reloc_list): Delete method.
9282 (Icf::addend_reloc_list): Delete method.
9283 (Icf::section_reloc_list): Delete method.
9284 (Icf::reloc_info_list): New method.
9285 (Icf::reloc_info_list_): New member.
9286
f96accdf
DK
92872010-02-19 Doug Kwan <dougkwan@google.com>
9288
9289 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9290 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9291 * arm.cc (Arm_relocation_functions): New forward declaration.
9292 (Target_arm::Target_arm): Initialize new data members
9293 got_mod_index_offset_ and tls_base_symbol_defined_.
9294 (Target_arm::Relocate::relocate_tls): New method.
9295 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9296 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9297 New methods.
2e702c99 9298 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9299 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9300 (Target_arm::got_mod_index_offset_,
9301 Target_arm::tls_base_symbol_defined_): New data members.
9302 (Target_arm::Scan::local, Target::Scan::global,
9303 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9304 relocations.
9305
c8761b9a
DK
93062010-02-18 Doug Kwan <dougkwan@google.com>
9307
9308 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9309 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9310 text section as a parameter becuase some broken tools may not set
9311 the link in section header.
9312 (Target_arm::has_got_section): New method.
9313 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9314 without any mapping symbol as data only. Remove warning.
9315 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9316 link in its section header, try to discover the link by inspecting the
9317 REL31 relocation at the beginning of the section.
9318 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9319 in error message.
9320 (Target_arm::Scan::global): Treat any reference to the symbol
9321 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9322
21bb3914
ST
93232010-02-12 Sriraman Tallam <tmsriram@google.com>
9324
9325 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9326 (Scan::global_reloc_may_be_function_pointer): New function.
9327 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9328 (Scan::global_reloc_may_be_function_pointer): New function.
9329 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9330 (Scan::global_reloc_may_be_function_pointer): New function.
9331 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9332 (Scan::global_reloc_may_be_function_pointer): New function.
9333 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9334 (Scan::global_reloc_may_be_function_pointer): New function.
9335 (Scan::possible_function_pointer_reloc): New function.
9336 (Target_x86_64::can_check_for_function_pointers): New function.
9337 * gc.h (gc_process_relocs): Scan relocation types to determine if
9338 function pointers were taken for targets that support it.
9339 * icf.cc (Icf::find_identical_sections): Include functions for
9340 folding in safe ICF whose pointer is not taken.
9341 * icf.h (Secn_fptr_taken_set): New typedef.
9342 (fptr_section_id_): New member.
9343 (section_has_function_pointers): New function.
9344 (set_section_has_function_pointers): New function.
9345 (check_section_for_function_pointers): New function.
9346 * options.h: Fix comment for safe ICF option.
9347 * target.h (can_check_for_function_pointers): New function.
9348 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9349 Modify icf_safe_test for X86-64.
9350 * testsuite/Makefile.in: Regenerate.
9351 * testsuite/icf_safe_so_test.cc: New file.
9352 * testsuite/icf_safe_so_test.sh: New file.
9353 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9354 (main): Change to take pointer to function kept_func_3.
9355 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9356 folding is done correctly for X86-64.
9357
0da6fa6c
DM
93582010-02-12 David S. Miller <davem@davemloft.net>
9359
9360 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9361 is_symbolless parameter.
9362 (Output_reloc<SHT_REL>::is_symbolless): New.
9363 (Output_reloc<SHT_REL>::is_symbolless_): New.
9364 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9365 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9366 (Output_reloc<SHT_RELA>::is_symbolless): New.
9367 (Output_data_reloc::add_global): Handle is_symbolless.
9368 (Output_data_reloc::add_global_relative): Likewise.
9369 (Output_data_reloc::add_local): Likewise.
9370 (Output_data_reloc::add_local_relative): Likewise.
9371 (Output_data_reloc::add_symbolless_global_addend): New.
9372 (Output_data_reloc::add_symbolless_local_addend): New.
9373 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9374 is_symbolless.
9375 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9376 instead of ->is_relative_
9377 (Output_reloc::write): Likewise.
9378 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9379 (Output_reloc::write_rel): Simplify.
9380
9381 * sparc.cc (Target_sparc::Scan::local): Use
9382 ->add_symbolless_local_addend as needed.
9383 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9384 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9385 based upon relocation offset.
9386
e4782e83
DK
93872010-02-11 Doug Kwan <dougkwan@google.com>
9388
9389 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9390 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9391 beginning of function.
9392 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9393 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9394 parameter is_32bit in calls to should_apply_static_reloc.
9395 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9396 (check_DATA): Add arm_abs_global.stdout.
9397 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9398 arm_abs_global.stdout): New rules.
9399 (MOSTLLYCLEANFILES): Add arm_abs_global
9400 * Makefile.in: Regenerate.
9401 * testsuite/arm_abs_global.s: New file.
9402 * testsuite/arm_abs_global.sh: Ditto.
9403 * testsuite/arm_abs_lib.s: Ditto.
9404
93ceb764
ILT
94052010-02-11 Ian Lance Taylor <iant@google.com>
9406
9407 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9408 Read_relocs task.
9409 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9410 Allocate_commons_task first.
9411 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9412 task, rather than symtab_lock_.
9413 (Gc_process_relocs::~Gc_process_relocs): New function.
9414 (Gc_process_relocs::is_runnable): Check this_blocker_.
9415 (Gc_process_relocs::locks): Use next_blocker_ rather than
9416 blocker_.
9417 (Scan_relocs::~Scan_relocs): New function.
9418 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9419 symtab_lock_.
9420 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9421 next_blocker_.
9422 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9423 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9424 constructor accordingly.
9425 (class Gc_process_relocs): Likewise.
9426 (class Scan_relocs): Likewise.
9427 * common.h (class Allocate_commons_task): Remove symtab_lock_
9428 field, and corresponding constructor parameter.
9429 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9430 symtab_lock_.
9431 (Allocate_commons_task::locks): Likewise.
9432
114dfbe1
ILT
94332010-02-11 Ian Lance Taylor <iant@google.com>
9434
9435 * gold-threads.h (class Once): Define.
9436 (class Initialize_lock): Rewrite as child of Once.
9437 * gold-threads.cc (class Once_initialize): Define.
9438 (once_pointer_control): New static variable.
9439 (once_pointer, once_arg): New static variables.
9440 (c_run_once): New static function.
9441 (Once::Once, Once::run_once, Once::internal_run): New functions.
9442 (class Initialize_lock_once): Remove.
9443 (initialize_lock_control): Remove.
9444 (initialize_lock_pointer): Remove.
9445 (initialize_lock_once): Remove.
9446 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9447 (Initialize_lock::initialize): Rewrite.
9448 (Initialize_lock::do_run_once): New function.
9449 * archive.cc (Archive::interpret_header): Only clear name if it is
9450 not already empty.
9451 * fileread.cc: Include "gold-threads.h"
9452 (file_counts_lock): New static variable.
9453 (file_counts_initialize_lock): Likewise.
9454 (File_read::release): Only increment counts when using --stats.
9455 Use a lock around the increment.
9456 * parameters.cc (class Set_parameters_target_once): Define.
9457 (set_parameters_target_once): New static variable.
9458 (Parameters::Parameters): Move here from parameters.h.
9459 (Parameters::set_target): Rewrite.
9460 (Parameters::set_target_once): New function.
9461 (Parameters::clear_target): Move here and rewrite.
9462 * parameters.h (class Parameters): Update declarations. Add
9463 set_parameters_target_once_ field.
9464 (Parameters::Parameters): Move to parameters.cc.
9465 (Parameters::clear_target): Likewise.
9466 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9467 task.
9468 (Start_group::~Start_group): New function.
9469 (Start_group::is_runnable): New function.
9470 (Start_group::locks, Start_group::run): New functions.
9471 (Finish_group::run): Change saw_undefined to size_t.
9472 * readsyms.h (class Start_group): Define.
9473 (class Finish_group): Change saw_undefined_ field to size_t.
9474 (Finish_group::Finish_group): Remove saw_undefined and
9475 this_blocker parameters. Change all callers.
9476 (Finish_group::set_saw_undefined): New function.
9477 (Finish_group::set_blocker): New function.
9478 * symtab.h (class Symbol_table): Change saw_undefined to return
9479 size_t. Change saw_undefined_ field to size_t.
9480 * target-select.cc (Set_target_once::do_run_once): New function.
9481 (Target_selector::Target_selector): Initialize set_target_once_
9482 field. Don't initialize lock_ and initialize_lock_ fields.
9483 (Target_selector::instantiate_target): Rewrite.
9484 (Target_selector::set_target): New function.
9485 * target-select.h (class Set_target_once): Define.
9486 (class Target_selector): Update declarations. Make
9487 Set_target_once a friend. Remove lock_ and initialize_lock_
9488 fields. Add set_target_once_ field.
9489
fa17a3f4
ILT
94902010-02-10 Ian Lance Taylor <iant@google.com>
9491
9492 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9493 queueing any tasks.
9494 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9495 (queue_middle_tasks): Add all blockers before queueing any tasks.
9496 (queue_final_tasks): Likewise.
9497 * token.h (Task_token::add_blockers): New function.
9498 * object.h (Input_objects::number_of_relobjs): New function.
9499
c7177d31
ILT
95002010-02-10 Ian Lance Taylor <iant@google.com>
9501
5de0e392
ILT
9502 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9503 shared, not if not position independent.
9504 * x86_64.cc (Relocate::relocate_tls): Likewise.
9505 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9506 (tls_pie_pic_test): New target.
9507 * testsuite/Makefile.in: Rebuild.
9508
c7177d31
ILT
9509 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9510 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9511 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9512 * testsuite/Makefile.in: Rebuild.
9513
684b268a
DM
95142010-02-09 David S. Miller <davem@davemloft.net>
9515
9516 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9517 R_SPARC_RELATIVE using ->add_local_relative().
9518 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9519
612a8d3d
DM
9520 * output.h (Output_data_dynamic::add_section_size): New method
9521 that takes two Output_data objects.
9522 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9523 entry param. Handle it in initializers.
9524 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9525 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9526 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9527 arg.
9528 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9529 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9530 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9531 for dynrel_includes_plt.
9532 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9533 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9534 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9535 before .rela.plt
9536 (Target_sparc::do_finalize_sections): Update to pass true for
9537 dynrel_includes_plt.
9538 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9539 output before .rela.plt
9540 (Target_powerpc::do_finalize_sections): Update to pass true for
9541 dynrel_includes_plt when 32-bit.
9542
cb1be87e
DK
95432010-02-08 Doug Kwan <dougkwan@google.com>
9544
9545 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9546 method.
9547 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9548 Arm_relobj::scan_section_for_cortex_a8_stubs,
9549 Arm_relobj::do_relocation_section): Instead of calling
9550 Output_section::output_address, use faster
9551 Arm_relobj::simple_input_section_output_address.
9552
705b5121
DM
95532010-02-08 David S. Miller <davem@davemloft.net>
9554
9555 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9556 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9557 relocation helper function.
9558
024c4466
DM
9559 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9560 just like R_SPARC_GOT{10,13,22}.
9561 (Target_sparc::Scan::local): Likewise.
9562 (Target_sparc::Relocate:relocate): Likewise.
9563
9109c078
ILT
95642010-02-06 Ian Lance Taylor <iant@google.com>
9565
9566 * configure.ac: Rewrite targetobjs duplicate removal code to use
9567 only shell constructs.
9568 * configure: Rebuild.
9569
cf846138
DK
95702010-02-05 Doug Kwan <dougkwan@google.com>
9571
9572 PR 11247
9573 * arm.cc (Arm_relobj::section_is_scannable): New method.
9574 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9575 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9576
6cfaf60b
DK
95772010-02-04 Doug Kwan <dougkwan@google.com>
9578
9579 PR 11247
9580 * arm-reloc-property.cc (cstdio): Include.
9581 * configure.ac (targetobjs): Remove duplicates.
9582 * configure: Regenerate.
9583 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9584 big and little endian version for a given address size.
9585
5c57f1be
DK
95862010-02-03 Doug Kwan <dougkwan@google.com>
9587
9588 * arm-reloc-property.cc
9589 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9590 definition.
9591 * arm-reloc-property.h
9592 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9593 New method definition.
9594 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9595 declaration.
9596 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9597 overflow to N.
9598 (GOT_PREL): Change implemented to Y.
9599 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9600 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9601 (Arm_relocate_functions::movw_abs_nc): Remove method.
9602 (Arm_relocate_functions::movt_abs): Ditto.
9603 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9604 (Arm_relocate_functions::thm_movt_abs): Ditto.
9605 (Arm_relocate_functions::movw_rel_nc): Ditto.
9606 (Arm_relocate_functions::movw_rel): Ditto.
9607 (Arm_relocate_functions::movt_rel): Ditto.
9608 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9609 (Arm_relocate_functions:thm_movw_rel): Ditto.
9610 (Arm_relocate_functions:thm_movt_rel): Ditto.
9611 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9612 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9613 New method definitions.
9614 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9615 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9616 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9617 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9618 (Target_arm::Relocate::relocate): Check for non-static or
9619 unimplemented relocation code and exit early. Change calls to
9620 Target_arm::reloc_uses_thumb_bit and
9621 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9622 instead. Refactor code to handle similar relocations to increase
9623 code sharing. Remove check for unsupported relocation code in switch
9624 statement.
9625 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9626 relocation property table to find out size. Change error message to
9627 print out the name of a relocation code instead of the numeric value.
9628 (Target_arm::scan_reloc_for_stub): Use relocation property table
9629 instead of calling Target_arm::reloc_uses_thumb_bit().
9630
218c5831
DK
96312010-02-02 Doug Kwan <dougkwan@google.com>
9632
9633 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9634 types of relaxed input section.
9635
0d31c79d
DK
96362010-02-02 Doug Kwan <dougkwan@google.com>
9637
9638 * Makefile.am (HFILES): Add arm-reloc-property.h.
9639 (DEFFILES): New.
2e702c99
RM
9640 (TARGETSOURCES): Add arm-reloc-property.cc
9641 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9642 (libgold_a_SOURCES): $(DEFFILES)
9643 * Makefile.in: Regenerate.
9644 * arm-reloc-property.cc: New file.
9645 * arm-reloc-property.h: New file.
9646 * arm-reloc.def: New file.
9647 * arm.cc: Update comments.
9648 (arm-reloc-property.h): New included header.
9649 (arm_reloc_property_table): New global variable.
9650 (Target_arm::do_select_as_default_target): New method definition.
9651 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9652 arm-reloc-property to targ_extra_obj.
9653 * parameters.cc (set_parameters_target): Call
9654 Target::select_as_default_target().
9655 * target.h (Target::select_as_default_target): New method definition.
9656 (Target::do_select_as_default_target): Same.
9657
546c7457
DK
96582010-02-01 Doug Kwan <dougkwan@google.com>
9659
9660 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9661 first_output_text_section_.
9662 (Arm_exidx_fixup::first_output_text_section): New method definition.
9663 (Arm_exidx_fixup::first_output_text_section_): New data member.
9664 (Arm_exidx_fixup::process_exidx_section): Record the first text
9665 output section seen.
9666 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9667 and entsize in output section header.
9668
11b861d5
DK
96692010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9670
9671 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9672 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9673 (Arm_relocate_functions::thm_alu11): New Method.
9674 (Arm_relocate_functions::thm_pc8): New Method.
9675 (Arm_relocate_functions::thm_pc12): New Method.
9676 (Target_arm::Scan::local): Handle the relocations.
9677 (Target_arm::Scan::global): Likewise.
9678 (Target_arm::Relocate::relocate): Likewise.
9679 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9680
c9a2c125
DK
96812010-01-29 Doug Kwan <dougkwan@google.com>
9682
9683 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9684 of relocation types as ld.
9685
1521477a
DK
96862010-01-29 Doug Kwan <dougkwan@google.com>
9687
9688 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9689 to public.
9690 (Arm_relocate_functions::thumb_branch_common): Ditto.
9691 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9692 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9693 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9694 Arm_relocate_functions::jump24): Remove.
9695 (Target_arm::Relocate::relocate): Adjust code to call
9696 Arm_relocation_functions::arm_branch_common and
9697 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9698 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9699
e7eca48c
DK
97002010-01-29 Doug Kwan <dougkwan@google.com>
9701
9702 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9703 output_local_symbol_count_needs_update_.
9704 (Arm_relobj::output_local_symbol_count_needs_update,
9705 Arm_relobj::set_output_local_symbol_count_needs_update,
9706 Arm_relobj::update_output_local_symbol_count): New methods.
9707 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9708 member.
9709 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9710 of pointed function as in a R_ARM_PREL31 relocation.
9711 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9712 for output local symbol count updating.
9713 (Target_arm::do_relax): Update output local symbol counts in objects
9714 if necessary.
9715 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9716
02961d7e
ILT
97172010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9718
9719 * arm.cc: Added support for the ARM relocations:
9720 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9721 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9722 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9723 movw_prel_nc).
9724 (Arm_relocate_functions::movw_rel): New method.
9725 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9726 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9727 thm_movw_prel_nc).
9728 (Arm_relocate_functions::thm_movw_rel): New method.
9729 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9730 thm_movt_prel).
9731 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9732 relocations.
9733 (Target_arm::Scan::global): Likewise.
9734 (Target_arm::Relocate::relocate): Likewise.
9735 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9736 Likewise.
9737
b10d2873
ILT
97382010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9739
9740 * arm.cc: Added support for ARM group relocations.
9741 (Target_arm::reloc_needs_sym_origin): New method.
9742 (Arm_relocate_functions::calc_grp_kn): New method.
9743 (Arm_relocate_functions::calc_grp_residual): New method.
9744 (Arm_relocate_functions::calc_grp_gn): New method.
9745 (Arm_relocate_functions::arm_grp_alu): New Method.
9746 (Arm_relocate_functions::arm_grp_ldr): New Method.
9747 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9748 (Arm_relocate_functions::arm_grp_ldc): New Method.
9749 (Target_arm::Scan::local): Handle the ARM group relocations.
9750 (Target_arm::Scan::global): Likewise.
9751 (Target_arm::Relocate::relocate): Likewise.
9752 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9753 Likewise.
9754
2b328d4e
DK
97552010-01-26 Doug Kwan <dougkwan@google.com>
9756
9757 * arm.cc (set): Include.
9758 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9759 pointer type.
2e702c99 9760 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9761 (Arm_output_section::append_text_sections_to_list): New method.
9762 (Arm_output_section::fix_exidx_coverage): Ditto.
9763 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9764 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9765 Relobj::set_section_offset() instead of
9766 Sized_relobj::invalidate_section_offset().
2e702c99 9767 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9768 parameter for section headers. Ignore relocation sections for
9769 unallocated sections and EXIDX sections.
9770 (Target_arm::fix_exidx_coverage): New method.
9771 (Target_arm::output_section_address_less_than): New type.
9772 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9773 linked text section instead of the EXIDX section.
9774 (Arm_output_section::create_stub_group): Add an assertion to check
9775 that this is not an EXIDX output section.
9776 (Arm_output_section::append_text_sections_to_list): New method.
9777 (Arm_output_section::fix_exidx_coverage): Ditto.
9778 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9779 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9780 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9781 first pass.
9782 (Target_arm::fix_exidx_coverage): New method.
9783 * object.h (Relobj::set_output_section): New method.
9784 (Sized_relobj::invalidate_section_offset): Remove method.
9785 (Sized_relobj::do_invalidate_section_offset): Remove method.
9786 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9787
c7f3c371
DK
97882010-01-25 Doug Kwan <dougkwan@google.com>
9789
9790 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9791 Fix warning due to signed and unsigned comparison on a 32-bit host.
9792
8923b24c
DK
97932010-01-22 Doug Kwan <dougkwan@google.com>
9794
9795 * arm.cc (Target_arm::do_relax): Record an output section for section
9796 offset adjustment it contains any stub table that has changed.
9797 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9798 offsets in an output section if necessary.
9799 * output.cc (Output_section::Output_section): Initialize
9800 section_offsets_need_adjustments_.
9801 (Output_section::add_input_section_for_script): Renamed to
9802 Output_section::add_simple_input_section.
9803 (Output_section::save_states): Add a comment.
9804 (Output_section::discard_states): New method defintion.
9805 (Output_section::adjust_section_offsets): Same.
9806 * output.h (Output_section::add_input_section_for_script): Renamed to
9807 Output_section::add_simple_input_section.
9808 (Output_section::discard_states): New method declaration.
9809 (Output_section::adjust_section_offsets): Same.
9810 (Output_section::section_offsets_need_adjustment,
9811 Output_section::set_section_offsets_need_adjustment): New method
9812 definitions.
9813 (Output_section::section_offsets_need_adjustment_): New data member.
9814 * script-sections.cc
9815 (Output_section_element_input::set_section_address): Adjust code for
9816 renaming of Output_section::add_input_section_for_script.
9817 (Orphan_output_section::set_section_address): Same.
9818
9b2fd367
DK
98192010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9820
9821 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9822 Fix_v4bx enum values .
9823 * gold/options.h (General_options): New option definitions.
9824 (General_options::fix_v4bx): New method.
9825 (General_options::Fix_v4bx): New enum.
9826 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9827 (General_options::parse_fix_v4bx_interworking): New method.
9828
80d0d023
DK
98292010-01-22 Doug Kwan <dougkwan@google.com>
9830
9831 * arm.cc (Arm_exidx_fixup): New class.
9832
af2cdeae
DK
98332010-01-21 Doug Kwan <dougkwan@google.com>
9834
9835 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9836 classes.
9837 (Arm_exidx_section_offset_map): New type.
9838
993d07c1
DK
98392010-01-21 Doug Kwan <dougkwan@google.com>
9840
9841 * arm.cc (Arm_exidx_input_section): New class.
9842 (Arm_relobj::exidx_input_section_by_link,
9843 Arm_relobj::exidx_input_section_by_shndx,
9844 Arm_relobj::make_exidx_input_section): New methods.
9845 (read_arm_attributes_section): Remove.
9846 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9847 information about them.
9848 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9849 to here.
9850
5ac169d4
DK
98512010-01-20 Doug Kwan <dougkwan@google.com>
9852
9853 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9854 Input_section_specifier to Section_id.
9855 (Target_arm::new_arm_input_section: Adjust code for change of key
9856 type.
9857 (Target_arm::find_arm_input_section): Ditto.
9858 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9859 (Section_id): Remove.
9860 (Garbage_collection::Section_id_hash): Remove.
9861 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9862 (Section_id): Remove.
9863 (Icf::Section_id_hash): Remove.
9864 * object.h (Section_id, Const_section_id, Section_id_hash,
9865 Const_section_id_hash): New type definitions.
9866 * output.cc (Output_section::add_relaxed_input_section): Change to
9867 use Const_section_id instead of Input_section_specifier as key type.
9868 (Output_section::add_merge_input_section): Ditto.
9869 (Output_section::build_relaxation_map): Change to use Section_id
9870 instead of Input_section_specifier as key type.
2e702c99 9871 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9872 Ditto.
9873 (Output_section::convert_input_sections_to_relaxed_sections): Change
9874 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9875 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9876 (Output_section::find_relaxed_input_section): Ditto.
9877 * output.h (Input_section_specifier): Remove class.
9878 (Output_section::Output_section_data_by_input_section_map): Change
9879 key type to Const_section_id.
9880 (Output_section::Output_relaxed_input_section_by_input_section_map):
9881 Ditto.
9882 (Output_section::Relaxation_map): Change key type to Section_id.
9883
a2162063
ILT
98842010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9885
9886 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9887 (class Arm_v4bx_stub): New class.
9888 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9889 (Stub_factory::make_arm_v4bx_stub): New method.
9890 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9891 (Stub_table::empty): Handle v4bx stubs.
9892 (Stub_table::add_arm_v4bx_stub): New method.
9893 (Stub_table::find_arm_v4bx_stub): New method.
9894 (Arm_relocate_functions::v4bx): New method.
9895 (Target_arm::fix_v4bx): New method.
9896 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9897 (Stub_table::relocate_stubs): Likewise.
9898 (Stub_table::do_write): Likewise.
9899 (Stub_table::update_data_size_and_addralign): Likewise.
9900 (Stub_table::finalize_stubs): Likewise.
9901 (Target_arm::Scan::local): Likewise.
9902 (Target_arm::Scan::global): Likewise.
9903 (Target_arm::do_finalize_sections): Likewise.
9904 (Target_arm::Relocate::relocate): Likewise.
9905 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9906 Likewise.
9907 (Target_arm::scan_reloc_for_stub): Likewise.
9908 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9909
5696ab0b
ILT
99102010-01-19 Ian Lance Taylor <iant@google.com>
9911
9912 * output.cc (Output_section_headers::do_sized_write): Write large
9913 segment count to sh_info field.
9914 (Output_file_header::do_sized_write): For large segment count,
9915 write PN_XNUM to e_phnum field.
9916
800d0f56
ILT
99172010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9918
9919 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9920 (Arm_relocate_functions::thm_jump8): New function.
9921 (Arm_relocate_functions::thm_jump11): New function.
9922 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9923 R_ARM_THM_JUMP11.
9924 (Target_arm::Scan::global): Likewise.
9925 (Target_arm::Relocate::relocate): Likewise.
9926 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9927 Likewise.
9928
41263c05
DK
99292010-01-14 Doug Kwan <dougkwan@google.com>
9930
9931 * arm.cc (map, utility): Include headers.
9932 (Target_arm::apply_cortex_a8_workaround): New method.
9933 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9934 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9935 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9936 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9937 the --[no-]fix-cortex-a8 command line options.
9938 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9939 (Target_arm::relocate_stub): Use addend in instruction template.
9940 * options.h (DEFINE_bool): Set the user-set flag.
9941 (General_options): Add --[no-]-fix-cortex options.
9942 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9943 : Update fast look-up map after conversion.
41263c05 9944
459e9b03
ST
99452010-01-14 Sriraman Tallam <tmsriram@google.com>
9946
9947 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9948 in the first pass of do_layout.
9949
b521dfe4
DK
99502010-01-13 Doug Kwan <dougkwan@google.com>
9951
9952 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9953 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9954 apparent compiler problem of not folding static constant integral
9955 data members of elfcpp::Elf_sizes<32>.
9956
44272192
DK
99572010-01-13 Doug Kwan <dougkwan@google.com>
9958
9959 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9960 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9961 Arm_relobj::scan_section_for_cortex_a8_erratum,
9962 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9963 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9964 sections to scan for relocation stubs into a new method
9965 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9966 relocation and Cortex-A8 stub scanning.
9967 (Target_arm::do_relax): Force stubs to be after stubbed sections
9968 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9969 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9970 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9971
44b71ece
ILT
99722010-01-12 Ian Lance Taylor <iant@google.com>
9973
9974 * target-reloc.h (visibility_error): New inline function.
9975 (relocate_section): Call visibility_error.
9976 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9977 (MOSTLYCLEANFILES): Likewise.
9978 (protected_4_pic.o, protected_3.err): New targets.
9979 * testsuite/protected_4.cc: New file.
9980
a120bc7f
DK
99812010-01-12 Doug Kwan <dougkwan@google.com>
9982
9983 * arm.cc (Cortex_a8_reloc): New class.
9984 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9985 and cortex_a8_relocs_info_.
9986 (Target_arm::fix_cortex_a8): New method definition.
9987 (Target_arm::Cortex_a8_relocs_info): New type.
9988 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9989 New data member declarations.
9990 (Target_arm::scan_reloc_for_stub): Record information about
9991 relocations for THUMB branches that might be exempted from the
9992 Cortex-A8 workaround.
9993 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9994 at the beginning of a relaxation pass.
9995
20138696
DK
99962010-01-12 Doug Kwan <dougkwan@google.com>
9997
9998 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9999 (Arm_relobj::Mapping_symbol_position,
10000 Arm_reloj::Mapping_symbol_position_less,
10001 Arm_relobj::Mapping_symbols_info): New types.
10002 (Target_arm::is_mapping_symbol_name): New method definition.
10003 (Arm_relobj::do_count_local_symbols): Save information about mapping
10004 symbols.
10005
089d69dc
DK
100062010-01-11 Doug Kwan <dougkwan@google.com>
10007
10008 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10009 Arm_relocate_functions::thumb32_branch_upper,
10010 Arm_relocate_functions::thumb32_branch_lower,
10011 Arm_relocate_functions::thumb32_cond_branch_offset,
10012 Arm_relocate_functions::thumb32_cond_branch_upper,
10013 Arm_relocate_functions::thumb32_cond_branch_lower,
10014 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10015 branch offset encoding.
10016 (Arm_relocate_functions::thumb_branch_common): Use new branch
10017 offset encoding methods to avoid code duplication.
10018 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10019 (Stub_addend_reader::operator()): Use new branch encoding method
10020 to avoid code duplication.
10021
99e5bff2
DK
100222010-01-11 Doug Kwan <dougkwan@google.com>
10023
10024 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10025 (Target_arm::do_finalize_sections): Define special EXIDX section
10026 symbols only if referenced.
10027 * gc.h (Garbage_collection::add_reference): New method.
10028 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10029 code duplication.
10030
98e090bd
ILT
100312010-01-11 Ian Lance Taylor <iant@google.com>
10032
d0a91bd8
ILT
10033 * script.cc (Version_script_info::build_expression_list_lookup):
10034 Change complaing about duplicate wildcard match from error to
10035 warning.
10036
98e090bd
ILT
10037 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10038 of 2009-12-30.
10039 (Version_script_info::Version_script_info): Initialize globs_,
10040 default_version_, default_is_global_, and exact_. Don't
10041 initialize globals_ or locals_.
10042 (Version_script_info::build_lookup_tables): Build local symbols
10043 first.
10044 (Version_script_info::unquote): New function.
10045 (Version_script_info::add_exact_match): New function.
10046 (Version_script_info::build_expression_list_lookup): Remove lookup
10047 parameter. Add is_global parameter. Change all callers. Handle
10048 wildcard pattern specially. Unquote pattern. Call
10049 add_exact_match.
10050 (Version_script_info::get_name_to_match): New function.
10051 (Version_script_info::get_symbol_version): New function.
10052 (Version_script_info::get_symbol_version_helper): Remove.
10053 (Version_script_info::check_unmatched_names): Call unquote.
10054 * script.h (class Version_script_info): Change get_symbol_version
10055 to be non-inline and add is_global parameter; change all callers.
10056 Rewrite symbol_is_local. Update declarations. Define struct
10057 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10058 Remove globals_ and locals_ members. Add exact_, globs_,
10059 default_version_, is_global_.
10060 (Version_script_info::Glob): Remove pattern, add expression and
10061 is_global. Update constructor. Change all callers.
10062 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10063 default version.
10064 (Versions::symbol_section_contents): If a symbol is undefined, or
10065 defined in a dynamic object, set the version index to
10066 VER_NDX_LOCAL.
10067 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10068 symbol_is_local.
10069 (Symbol_table::add_from_pluginobj): Likewise.
10070 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10071
d56962d3
DK
100722010-01-11 Doug Kwan <dougkwan@google.com>
10073
10074 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10075 (incremental_dump_LDADD): Add linking option for libintl.
10076 * Makefile.in: Regenerate.
10077
94e6ee91
L
100782010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10079
10080 PR gold/11144
10081 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10082 instead of -Ds.
10083 * testsuite/Makefile.in: Regenerated.
10084
e96c574b
DK
100852010-01-10 Doug Kwan <dougkwan@google.com>
10086
10087 * options.h (DEFINE_var): Use parentheses around argument varname__
10088 in macro body to avoid any unintended subsequent substitutions.
10089
7198066b
ILT
100902010-01-10 Ian Lance Taylor <iant@google.com>
10091
ba4d53bf
ILT
10092 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10093 candidates before doing symbol resolution.
10094
7198066b
ILT
10095 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10096 ODR candidates if only one is weak.
10097
a2beed37
ILT
100982010-01-08 Ian Lance Taylor <iant@google.com>
10099
10100 * script.cc (Version_script_info::build_expression_list_lookup):
10101 Don't warn about ambiguous version, just record the ambiguity.
10102 (Version_script_info::get_symbol_version_helper): Give error if
10103 version is ambiguous.
10104
2fb7225c
DK
101052010-01-08 Doug Kwan <dougkwan@google.com>
10106
10107 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10108 prev_data_size_ and prev_addralign_. Remove initializer for
10109 deleted data member has_been_changed_.
10110 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10111 to determine if the table is empty.
10112 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10113 Remove.
10114 (Stub_table::add_reloc_stub): Define method in class definition
10115 instead of just declaring it there.
10116 (Stub_table::add_cortex_a8_stub): New method definition.
10117 (Stub_table::update_data_size_and_addralign): Ditto.
10118 (Stub_table::finalize_stubs): Ditto.
10119 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10120 (Stub_table::do_addralign_): Return address alignment in the
10121 (Stub_table::do_reset_address_and_file_offset): Define method in
10122 class definition instead of declaring it there. Set current data
10123 size to be the data size of the previous pass.
10124 (Stub_table::set_final_data_size): Use current data size as the
10125 final data size.
10126 (Stub_table::relocate_stub): Change parameter type of stub from
10127 Reloc_stub pointer to Stub pointer.
10128 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10129 (Stub_table::Cortex_a8_stub_list): New typedef.
10130 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10131 Stub_table::prev_addralign_): New data member.
10132 (Arm_relobj::Arm_relobj): Initialize data member
10133 section_has_cortex_a8_workaround_.
10134 (Arm_relobj::section_has_cortex_a8_workaround,
10135 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10136 definitions.
10137 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10138 declarations.
10139 (Target_arm::relocate_stub): Change parameter type of stub from
10140 Reloc_stub pointer to Stub pointer.
10141 (Insn_template::size, Insn_template::alignment): Handle
10142 THUMB16_SPECIAL_TYPE.
10143 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10144 Stub_table::update_data_size_and_addralign,
10145 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10146 definitions.
10147 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10148 (Stub_table::do_write): Ditto.
10149 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10150
880cd20d
ILT
101512010-01-08 Ian Lance Taylor <iant@google.com>
10152
10153 PR 11108
10154 * symtab.h (class Symbol): Remove fields is_target_special_ and
10155 has_plt_offset_. Add field is_defined_in_discarded_section_.
10156 (Symbol::is_defined_in_discarded_section): New function.
10157 (Symbol::set_is_defined_in_discarded_section): New function.
10158 (Symbol::has_plt_offset): Rewrite.
10159 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10160 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10161 Don't initialize is_target_special_ or has_plt_offset_.
10162 Initialize is_defined_in_discarded_section_.
10163 (Symbol_table::add_from_relobj): If appropriate, set
10164 is_defined_in_discarded_section.
10165 * resolve.cc (Symbol::override_base_with_special): Don't test
10166 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10167 * target-reloc.h (relocate_section): Do special handling for
10168 symbols defined in discarded sections for global symbols as well
10169 as local symbols.
10170
2703e3eb
ILT
101712010-01-08 Ian Lance Taylor <iant@google.com>
10172
10173 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10174 the SHT_SYMTAB case.
10175
339d40a3
ILT
101762010-01-08 Ian Lance Taylor <iant@google.com>
10177
10178 * object.cc (Sized_relobj::do_layout): Don't get confused if
10179 layout_eh_frame returns NULL.
10180
abecea76
ILT
101812010-01-08 Ian Lance Taylor <iant@google.com>
10182
10183 PR 11084
10184 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10185 dynamic symbol table, use the normal symbol table.
10186 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10187 symbol table.
10188
6b7dd3f3
ILT
101892010-01-08 Ian Lance Taylor <iant@google.com>
10190
10191 PR 11072
10192 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10193 sections.
10194
36c50e63
L
101952010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10196
10197 * version.cc (print_version): Change to "Copyright 2010".
10198
e291e7b9
ILT
101992010-01-08 Ian Lance Taylor <iant@google.com>
10200
10201 PR 10287
10202 PR 11063
10203 * i386.cc (class Target_i386): Change return type of plt_section
10204 to be non-const.
10205 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10206 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10207 tls_desc_rel_ field.
10208 (Output_data_plt_i386::rel_tls_desc): New function.
10209 (Target_i386::rel_tls_desc_section): New function.
10210 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10211 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10212 R_386_TLS_DESC reloc in rel_tls_desc_section.
10213 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10214 Define struct Tlsdesc_info.
10215 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10216 (Target_x86_64::do_reloc_symbol_index): New function.
10217 (Target_x86_64::add_tlsdesc_info): New function.
10218 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10219 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10220 tlsdesc_rel_ field.
10221 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10222 all callers.
10223 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10224 (Target_x86_64::rela_tlsdesc_section): New function.
10225 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10226 handling.
10227 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10228 (Target_x86_64::do_reloc_addend): New function.
10229 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10230 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10231 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10232 (Output_reloc::type): New function.
10233 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10234 (Output_reloc::is_target_specific): New function.
10235 (Output_reloc::target_arg): New function.
10236 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10237 absolute relocs and target specific relocs.
10238 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10239 add_target_specific.
10240 (class Output_data_reloc) [SHT_RELA]: Likewise.
10241 * output.cc (Output_reloc::Output_reloc): Add four new versions
10242 for absolute relocs and target specific relocs.
10243 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10244 (Output_reloc::get_symbol_index): Likewise.
10245 (Output_reloc::local_section_offset): Check that local_sym_index_
10246 is not TARGET_CODE or 0.
10247 (Output_reloc::symbol_value): Likewise.
10248 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10249 reloc.
10250 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10251 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10252 functions.
10253 * layout.cc (add_target_dynamic_tags): Use output section for
10254 DT_PLTRELSZ and DT_JMPREL.
10255
3a44184e
ILT
102562010-01-07 Ian Lance Taylor <iant@google.com>
10257
10258 PR 11061
10259 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10260 function.
10261 (class Output_data_reloc_generic): Define.
10262 (class Output_data_reloc_base): Change base class to
10263 Output_data_reloc_generic. Change add() method to call
10264 bump_relative_reloc_count for a relative reloc. Remove
10265 sort_relocs_ field.
10266 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10267 to sort_relocs().
10268 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10269 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10270 appropriate.
10271 * layout.h (class Layout): Update declaration.
10272
ea715a34
ILT
102732010-01-07 Ian Lance Taylor <iant@google.com>
10274
10275 * output.h (class Output_data): Add const version of
10276 output_section and do_output_section.
10277 (class Output_section_data): Add const version of
10278 do_output_section.
10279 (class Output_section): Likewise.
10280 * layout.cc (Layout::add_target_dynamic_tags): New function.
10281 * layout.h (class Layout): Update declarations.
10282 * arm.cc (Target_arm::do_finalize_sections): Use
10283 add_target_dynamic_tags.
10284 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10285 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10286 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10287 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10288
659948a4
ILT
102892010-01-07 Ian Lance Taylor <iant@google.com>
10290
10291 PR 11042
10292 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10293 object as needed.
10294
9d3b86f6
ILT
102952010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10296 Ian Lance Taylor <iant@google.com>
10297
10298 PR 11019
10299 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10300 Xindex::read_symtab_xindex.
10301
bb0d3eb0
DK
103022010-01-07 Doug Kwan <dougkwan@google.com>
10303
10304 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10305 (Insn_template::thumb16_bcond_insn): New method declaration.
10306 (Insn_template): Fix spelling.
10307 (Stub::thumb16_special): New method declaration.
10308 (Stub::do_write): Define virtual method which was previously pure
10309 virtual.
10310 (Stub::do_thumb16_special): New method declaration.
10311 (Stub::do_fixed_endian_write): New template member.
10312 (Reloc_stub::do_write): Remove.
10313 (Reloc_stub::do_fixed_endian_write): Remove.
10314 (Cortex_a8_stub): New class definition.
10315 (Stub_factory::make_cortex_a8_stub): New method definition.
10316 (Stub_factory::Stub_factory): Add missing static storage class
10317 qualifier for elf32_arm_stub_a8_veneer_blx.
10318
ffeef7df
ILT
103192010-01-07 Ian Lance Taylor <iant@google.com>
10320
dc3f80fe
ILT
10321 PR 10980
10322 * options.h (class General_options): Add --warn-unresolved-symbols
10323 and --error-unresolved-symbols.
10324 * errors.cc (Errors::undefined_symbol): Implement
10325 --warn-unresolved-symbols.
10326
ffeef7df
ILT
10327 * options.h (class General_options): Add -z text and -z textoff.
10328 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10329
f1ec9ded
ST
103302010-01-06 Sriraman Tallam <tmsriram@google.com>
10331
10332 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10333 (Garbage_collection::cident_sections): New function.
10334 (Garbage_collection::add_cident_section): New function.
10335 (Garbage_collection::cident_sections_): New member.
10336 (gc_process_relocs): Add references to sections whose names are C
10337 identifiers.
10338 * gold.h (cident_section_start_prefix): New constant.
10339 (cident_section_stop_prefix): New constant.
10340 (is_cident): New function.
10341 * layout.cc (Layout::define_section_symbols): Replace string constants
10342 with the newly defined constants.
10343 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10344 C identifiers.
10345 * testsuite/Makefile.am: Add gc_orphan_section_test.
10346 * testsuite/Makefile.in: Regenerate.
10347 * testsuite/gc_orphan_section_test.cc: New file.
10348 * testsuite/gc_orphan_section_test.sh: New file.
10349
6eda8c29
ILT
103502010-01-06 Ian Lance Taylor <iant@google.com>
10351
b9674e17
ILT
10352 PR 10980
10353 * options.h (class General_options): Add --warn-shared-textrel.
10354 * layout.cc (Layout::finish_dynamic_section): Implement
10355 --warn-shared-textrel.
10356
6eda8c29
ILT
10357 PR 10980
10358 * options.h (class General_options): Add --warn-multiple-gp.
10359
32dcd44e
ILT
103602010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10361
10362 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10363 $(THREADSLIB) and $(LIBDL).
10364 * Makefile.in: Rebuild.
10365
a192ba05
ILT
103662010-01-06 Ian Lance Taylor <iant@google.com>
10367
10368 PR 10980
10369 * options.cc (General_options::parse_section_start): New function.
10370 (General_options::section_start): New function.
10371 (General_options::General_options): Initialize all members.
10372 * options.h: Include <map>
10373 (class General_options): Add --section-start. Add section_starts_
10374 member.
10375 * layout.cc (Layout::attach_allocated_section_to_segment): If
10376 --section-start was used, set the address of the segment. Remove
10377 local sort_sections.
10378 (Layout::relaxation_loop_body): If the address of the load segment
10379 has been set by --section-start, don't use it.
10380 * output.h (Output_segment::update_flags_for_output_section): New
10381 function.
10382 * output.cc (Output_segment::add_output_section): Call
10383 update_flags_for_output_section.
10384
dde3f402
ILT
103852010-01-05 Ian Lance Taylor <iant@google.com>
10386
62dfdd4d
ILT
10387 PR 10980
10388 * options.h (class General_options): Add --undefined-version.
10389 * script.cc (struct Version_expression): Add was_matched_by_symbol
10390 field.
10391 (Version_script_info::matched_symbol): New function.
10392 (Version_script_info::get_symbol_version_helper): Call
10393 matched_symbol.
10394 (Version_script_info::check_unmatched_names): New function.
10395 * script.h (class Version_script_info): Update declarations.
10396 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10397
9c4ae156
ILT
10398 * options.h (class General_options): Use DEFINE_bool_alias for
10399 allow_multiple_definition.
10400 * resolve.cc (Symbol_table::should_override): Don't test
10401 allow_multiple_definition.
10402
dde3f402
ILT
10403 PR 10980
10404 * options.h (class General_options): Add --cref.
10405 * main.cc (main): Print cref table if --cref. Don't close mapfile
10406 until after printing cref table.
10407 * cref.cc: Include "symtab.h".
10408 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10409 (Cref_table_compare::operator()): New function.
10410 (Cref_inputs::gather_cref): New function.
10411 (filecol): New static const.
10412 (Cref_inputs::print_cref): New function.
10413 (Cref::print_cref): New function.
10414 * cref.h: Include <cstdio>.
10415 (class Cref): Update declarations.
10416 * mapfile.h (Mapfile::file): New function.
10417 * object.h (class Object): Define Symbols. Declare virtual
10418 do_get_global_symbols.
10419 (Object::get_global_symbols): New function.
10420 * object.cc (Input_objects::add_object): Pass object to cref_ if
10421 --cref.
10422 (Input_objects::archive_start): Likewise.
10423 (Input_objects::archive_stop): Likewise.
10424 (Input_objects::print_cref): New function.
10425 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10426 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10427 --cref.
10428 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10429 function.
10430 * plugin.h (class Sized_pluginobj): Update declarations.
10431
8781f709
ILT
104322010-01-05 Ian Lance Taylor <iant@google.com>
10433
10434 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10435 to is_default_version. Rename insdef to insdefault.
10436 (Symbol_table::add_from_relobj): Rename def to is_default_version
10437 and local to is_forced_local.
10438 (Symbol_table::add_from_pluginobj): Likewise.
10439 (Symbol_table::add_from_dynobj): Likewise.
10440 (Symbol_table::define_special_symbol): Rename insdef to
10441 insdefault.
10442
fe35d28d
ILT
104432010-01-04 Ian Lance Taylor <iant@google.com>
10444
30bc8c46
ILT
10445 PR 10980
10446 * options.h (class General_options): Add
10447 --allow-multiple-definition and -z muldefs.
10448 * resolve.cc (Symbol_table::should_override): Don't warn about a
10449 multiple symbol definition if --allow-multiple-definition or -z
10450 muldefs.
10451
7eaea549
ILT
10452 PR 10980
10453 * options.h (class General_options): Add --add-needed and
10454 --copy-dt-needed-entries. Tweak --as-needed help entry.
10455 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10456 error if --copy-dt-needed-entries aka --add-needed is used and
10457 would cause a change in behaviour.
10458
fe35d28d
ILT
10459 PR 10980
10460 * options.h (class General_options): Add -G as a short version of
10461 --shared. Add no-op options -assert, -g, and -i.
10462
55a2bb35
ST
104632010-01-04 Sriraman Tallam <tmsriram@google.com>
10464
10465 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10466 check for .text or .gnu.linkonce.t sections.
10467 * icf.cc (Icf::find_identical_sections): Ditto.
10468 Change the detection for mangled function name within the section
10469 name.
10470 * icf.h (is_section_foldable_candidate): New function.
10471
719328e1
ILT
104722009-12-30 Ian Lance Taylor <iant@google.com>
10473
10474 PR 10980
10475 * options.h (class General_options): Permit two dashes with
10476 --retain-symbols-file.
10477
d7bb5745
ILT
104782009-12-30 Ian Lance Taylor <iant@google.com>
10479
403a15dd
ILT
10480 PR 10979
10481 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10482 don't put the file header and segment headers in the text
10483 segment.
10484
eda294df
ILT
10485 PR 10979
10486 * common.cc (Sort_commons::operator()): Stabilize sort when both
10487 entries are NULL.
10488 (Symbol_table::do_allocate_commons_list): When allocating common
10489 symbols, skip a symbol which is no longer common.
10490 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10491 an object before checking its type.
10492 * testsuite/common_test_2.c: New file.
10493 * testsuite/common_test_3.c: New file.
10494 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10495 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10496 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10497 (common_test_2_pic.o, common_test_2.so): New targets.
10498 (common_test_3_pic.o, common_test_3.so): New targets.
10499 * testsuite/Makefile.in: Rebuild.
10500
d7bb5745
ILT
10501 PR 10979
10502 * script.cc (read_input_script): If we see a new SECTIONS clause,
10503 and we have added an input section, give an error.
10504 * layout.h (class Layout): Add have_added_input_section function.
10505 Add have_added_input_section_ field.
10506 * layout.cc (Layout::Layout): Initialize
10507 have_added_input_section_.
10508 (Layout::layout): Set have_added_input_section_.
10509 (Layout::layout_eh_frame): Likewise.
10510
fc59c572
ILT
105112009-12-30 Ian Lance Taylor <iant@google.com>
10512
10513 PR 10931
10514 * options.h (class General_options): Add --sort-common option.
10515 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10516 * common.cc (Sort_common): Add sort_order parameter to
10517 constructor. Add sort_order_ field.
10518 (Sort_commons::operator): Check sort_order_.
10519 (Symbol_table::allocate_commons): Determine the sort order.
10520 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10521 Change all callers.
10522 (Symbol_table::do_allocate_commons_list): Likewise.
10523
1c74fab0
ILT
105242009-12-30 Ian Lance Taylor <iant@google.com>
10525
10526 PR 10916
10527 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10528 symbols from this object, don't change the visibility of an
10529 undefined symbol.
10530 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10531
6affe781
ILT
105322009-12-30 Ian Lance Taylor <iant@google.com>
10533
10534 PR 10861
10535 * script.h (class Version_script_info): Define Language enum.
10536 Update declarations. Define Glob, Exact, and Lookup types. Add
10537 new fields globals_, locals_, and is_finalized_.
10538 * script.cc: Various formatting fixes.
10539 (class Parser_closure): Change language_stack_ from a vector of
10540 std::string to one of Version_script_info::Language. Adjust all
10541 uses accordingly.
10542 (class Lazy_demangler): Remove.
10543 (struct Version_expression): Change language from std::string to
10544 Version_script_info::Language.
10545 (Version_script_info::Version_script_info): New function.
10546 (Version_script_info::~Version_script_info): Don't call clear.
10547 (Version_script_info::finalize): New function.
10548 (Version_script_info::build_lookup_tables): New function.
10549 (Version_script_info::build_expression_list_lookup): New
10550 function.
10551 (Version_script_info::get_symbol_version_helper): Rewrite to use
10552 lookup tables.
10553 (Version_script_info::print_expression_list): Adjust to use
10554 Version_script_info::Language.
10555 (script_push_lex_into_version_mode): Check that the version script
10556 has not been finalized.
10557 (version_script_push_lang): Change language string to
10558 Version_script_info::Language.
10559 * options.cc (Command_line::version_script): New function.
10560 * options.h (class General_options): Add finalize_dynamic_list
10561 function. Change version_script from declaration to definition.
10562 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10563 * testsuite/version_script.map: Remove duplicate def of foo.
10564 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10565 version_script.map.
10566 * testsuite/Makefile.in: Rebuild.
10567
818bf354
ILT
105682009-12-30 Ian Lance Taylor <iant@google.com>
10569
10570 PR 10843
10571 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10572 if the input symbol index is 0, make the output symbol index 0.
10573
ebcc8304
ILT
105742009-12-30 Ian Lance Taylor <iant@google.com>
10575
10576 PR 10670
10577 * options.h (class General_options): Add -x/--discard-all.
10578 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10579 --discard-all. If the local symbol needs a dynamic entry, check
10580 that before handling --discard-locals.
10581
176fe33f
ILT
105822009-12-30 Ian Lance Taylor <iant@google.com>
10583
bb321bb1
ILT
10584 PR 10450
10585 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10586 flags to PF_R.
10587 (Output_segment::add_output_section): Don't change the flags if
10588 the type is PT_TLS.
10589
176fe33f
ILT
10590 PR 10450
10591 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10592 GNU hash table if they need a dynamic value. Otherwise, don't add
10593 them if they are defined in a dynamic object or are forced local.
10594
e8cd95c7
ILT
105952009-12-29 Ian Lance Taylor <iant@google.com>
10596
1b81fb71
ILT
10597 PR 10450
10598 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10599 .gnu.hash table for a 32-bit target.
10600
8d6d383d
ILT
10601 PR 10450
10602 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10603 regular and a dynamic object only needs a dynamic symbol table
10604 entry if it is externally visible.
10605
e785ec03
ILT
10606 PR 10450
10607 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10608 constructor. Add global_offset_table_ field.
10609 (Target_i386::got_section): Set global_offset_table_.
10610 (Target_i386::do_finalize_sections): Set global_offset_table_
10611 size.
10612 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10613 in constructor. Add global_offset_table_ field.
10614 (Target_x86_64::got_section): Set global_offset_table_.
10615 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10616 size.
10617
1a2dff53
ILT
10618 * layout.cc (Layout::Layout): Initialize increase_relro_.
10619 (Layout::get_output_section): Add is_relro, is_last_relro, and
10620 is_first_non_relro parameters. Change all callers.
10621 (Layout::choose_output_section): Likewise.
10622 (Layout::add_output_section_data): Likewise.
10623 (Layout::make_output_section): Likewise.
10624 (Layout::set_segment_offsets): Clear increase_relro when using a
10625 linker script.
10626 * layout.h (class Layout): Add increase_relro method. Add
10627 increase_relro_ field. Update declarations.
10628 * output.cc (Output_section::Output_section): Initialize
10629 is_last_relro_ and is_first_non_relro_.
10630 (Output_segment::add_output_section): Group relro sections is
10631 do_sort is true. Handle is_last_relro and is_first_non_relro.
10632 (Output_segment::maximum_alignment): Remove relro handling.
10633 (Output_segment::set_section_addresses): Add increase_relro
10634 parameter. Change all callers. Add initial alignment to align
10635 relro sections on separate page. Remove old relro handling.
10636 (Output_segment::set_section_list_addresses): Remove in_relro
10637 parameter. Change all callers.
10638 (Output_segment::set_offset): Add increase parameter. Change all
10639 callers. Remove old relro handling.
10640 * output.h (class Output_section): Add new methods: is_last_relro,
10641 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10642 Add is_last_relro_ and is_first_non_relro_ fields.
10643 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10644 Create separate .got.plt section. Call increase_relro.
10645 * x86_64.cc (Target_x86_64::got_section): Likewise.
10646 * testsuite/relro_script_test.t: Add .got.plt.
10647
f0ba79e2
ILT
10648 PR 10450
10649 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10650 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10651 (Layout::finalize): Call set_dynamic_symbol_size.
10652 (Layout::set_dynamic_symbol_size): New function.
10653 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10654 set_dynamic_symbol_size.
10655
e8cd95c7
ILT
10656 PR 10450
10657 * output.h (class Output_section): Add is_entsize_zero_ field.
10658 * output.cc (Output_section::Output_section): Initialize
10659 is_entsize_zero_.
10660 (Output_section::set_entsize): If two different entsizes are
10661 requested, force it to zero.
10662 (Output_section::add_input_section): Set flags for .debug_str
10663 before updating section flags. Set entsize.
10664 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10665 and SHF_STRING if all input sections have those flags.
10666
3e1b9a8a
RÁE
106672009-12-29 Rafael Espindola <espindola@google.com>
10668
10669 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10670 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10671 reporting.
3e1b9a8a 10672
3dcad376
ST
106732009-12-29 Sriraman Tallam <tmsriram@google.com>
10674
10675 * options.cc (General_options::parse_version): Allow -v to exit
10676 without an error if there is nothing to link.
10677
084e2665
ILT
106782009-12-29 Ian Lance Taylor <iant@google.com>
10679
10680 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10681 using a version of gcc before 4.1.
10682 * configure: Rebuild.
10683
250acde3
CD
106842009-12-28 Chris Demetriou <cgd@google.com>
10685
10686 * attributes.cc (Output_attributes_section_data::do_write): Use
10687 std::vector::front rather than std::vector::data.
10688
99fff23b
ILT
106892009-12-28 Ian Lance Taylor <iant@google.com>
10690
10691 * symtab.h (class Symbol_table): Add enum Defined.
10692 * resolve.cc (Symbol_table::should_override): Add defined
10693 parameter. Change all callers. Test whether object is NULL
10694 before calling a method on it.
10695 (Symbol_table::report_resolve_problem): Add defined parameter.
10696 Change all callers.
10697 (Symbol_table::should_override_with_special): Likewise.
10698 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10699 parameter. Change all callers.
10700 (Symbol_table::do_define_in_output_data): Likewise.
10701 (Symbol_table::define_in_output_segment): Likewise.
10702 (Symbol_table::do_define_in_output_segment): Likewise.
10703 (Symbol_table::define_as_constant): Likewise.
10704 (Symbol_table::do_define_as_constant): Likewise.
10705 * script.h (class Symbol_assignment): Add is_defsym parameter to
10706 constructor; change all callers.
10707 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10708 parameter. Change all callers. Add is_defsym_ field.
10709 (class Parser_closure): Add parsing_defsym parameter to
10710 constructor; change all callers. Add parsing_defsym accessor
10711 function. Add parsing_defsym_ field.
10712
556bd683
ILT
107132009-12-28 Ian Lance Taylor <iant@google.com>
10714
10715 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10716 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10717
1782c879
ILT
107182009-12-23 Ian Lance Taylor <iant@google.com>
10719
10720 * i386.cc (Target_i386::do_calls_non_split): Recognize
10721 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10722 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10723 -fsplit-stack prologue when using %r11.
1782c879 10724
329ca2b1
ST
107252009-12-21 Sriraman Tallam <tmsriram@google.com>
10726
10727 * options.cc (General_options::parse_version): Make -v continue and do
10728 the link like GNU ld does.
10729
d675ff46
RÁE
107302009-12-17 Rafael Avila de Espindola <espindola@google.com>
10731
10732 * Makefile.am (CCFILES): Add timer.cc.
10733 (HFILES): Add timer.h.
10734 * configure.ac: Check for sysconf and times.
10735 * main.cc: include timer.h.
10736 (main): Use Timer instead of get_run_time.
10737 * timer.cc: New.
10738 * timer.h: New.
10739 * workqueue.cc: include timer.h.
10740 (Workqueue::find_and_run_task):
10741 Report user, sys and wall time.
10742 * Makefile.in: Regenerate.
10743 * config.in: Regenerate.
10744 * configure: Regenerate.
10745
d6344fb5
DK
107462009-12-16 Doug Kwan <dougkwan@google.com>
10747
10748 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10749 sections.
10750 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10751 relaxed input sections.
10752 * output.cc (Output_section::find_relaxed_input_section): Change
10753 return type to Output_relaxed_input_section pointer. Adjust code
10754 for new type of relaxed_input_section_map_.
10755 * output.h (Output_section::find_relaxed_input_section): Change
10756 return type to Output_relaxed_input_section pointer.
10757 (Output_section::Output_relaxed_input_section_by_input_section_map):
10758 New type.
10759 (Output_section::relaxed_input_section_map_): Change type to
10760 Output_section::Output_relaxed_input_section_by_input_section_map.
10761 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10762 input section.
10763
0e0d5469
ILT
107642009-12-15 Ian Lance Taylor <iant@google.com>
10765
10766 * layout.cc (Layout::create_shstrtab): Only write out after input
10767 sections if we are compressing debug sections.
10768
0649a889
ILT
107692009-12-15 Ian Lance Taylor <iant@google.com>
10770
10771 * archive.cc (Archive::add_symbols): Only look up a symbol without
10772 a version if there is, in fact, a version.
10773
2ea97941
ILT
107742009-12-14 Ian Lance Taylor <iant@google.com>
10775
10776 Revert -Wshadow changes, all changes from:
10777 2009-12-11 Doug Kwan <dougkwan@google.com>
10778 2009-12-11 Nick Clifton <nickc@redhat.com>
10779 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10780
b0eec2cc
DK
107812009-12-11 Doug Kwan <dougkwan@google.com>
10782
10783 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10784 due to -Wshadow.
10785 * attributes.cc (Object_attribute::size): Ditto.
10786 (Attributes_section_data::size): Ditto.
10787 (Attributes_section_data::Attributes_section_data): Ditto.
10788 (Output_attributes_section_data::do_write): Ditto.
10789 * attributes.h (Object_attribute::set_type): Ditto.
10790 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10791
91d6fa6a
NC
107922009-12-11 Nick Clifton <nickc@redhat.com>
10793
10794 * archive.cc: Fix shadowed variable warnings.
10795 * arm.cc: Likewise.
10796 * compressed_output.cc: Likewise.
10797 * compressed_output.h: Likewise.
10798 * configure: Likewise.
10799 * dwarf_reader.cc: Likewise.
10800 * dynobj.cc: Likewise.
10801 * dynobj.h: Likewise.
10802 * ehframe.cc: Likewise.
10803 * ehframe.h: Likewise.
10804 * errors.cc: Likewise.
10805 * expression.cc: Likewise.
10806 * fileread.cc: Likewise.
10807 * fileread.h: Likewise.
10808 * freebsd.h: Likewise.
10809 * i386.cc: Likewise.
10810 * icf.cc: Likewise.
10811 * incremental.h: Likewise.
10812 * layout.cc: Likewise.
10813 * layout.h: Likewise.
10814 * mapfile.cc: Likewise.
10815 * merge.cc: Likewise.
10816 * merge.h: Likewise.
10817 * object.cc: Likewise.
10818 * object.h: Likewise.
10819 * options.h: Likewise.
10820 * output.cc: Likewise.
10821 * output.h: Likewise.
10822 * parameters.cc: Likewise.
10823 * plugin.cc: Likewise.
10824 * powerpc.cc: Likewise.
10825 * reduced_debug_output.cc: Likewise.
10826 * reduced_debug_output.h: Likewise.
10827 * reloc.cc: Likewise.
10828 * reloc.h: Likewise.
10829 * resolve.cc: Likewise.
10830 * script-sections.cc: Likewise.
10831 * script.cc: Likewise.
10832 * script.h: Likewise.
10833 * sparc.cc: Likewise.
10834 * symtab.cc: Likewise.
10835 * symtab.h: Likewise.
10836 * target-select.cc: Likewise.
10837 * target-select.h: Likewise.
10838 * token.h: Likewise.
10839 * workqueue.cc: Likewise.
10840 * workqueue.h: Likewise.
10841 * x86_64.cc: Likewise.
10842
a0351a69
DK
108432009-12-10 Doug Kwan <dougkwan@google.com>
10844
10845 * arm.cc (attributes.h): New include.
10846 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10847 (Arm_relobj::~Arm_relobj): Delete object pointed by
10848 attributes_section_data_.
10849 (Arm_relobj::attributes_section_data): New method definition.
10850 (Arm_relobj::attributes_section_data_): New data member declaration.
10851 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10852 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10853 attributes_section_data_.
10854 (Arm_dynobj::attributes_section_data): New method definition.
10855 (Arm_dynobj::attributes_section_data_): New data member declaration.
10856 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10857 initialization value of may_use_blx_ to false.
2e702c99 10858 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10859 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10860 object attributes to compute results instead of hard-coding.
10861 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10862 Target_arm::get_secondary_compatible_arch,
10863 Target_arm::set_secondary_compatible_arch
10864 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10865 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10866 New method declarations.
10867 (Target_arm::get_aeabi_object_attribute): New method definition.
10868 (Target_arm::attributes_section_data_): New data member declaration.
10869 (read_arm_attributes_section): New template definition.
10870 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10871 (Arm_dynobj::do_read_symbols): Ditto.
10872 (Target_arm::do_finalize_sections): Merge attributes sections from
10873 input. Check for BLX use after attributes section merging.
10874 Fix __exidx_start and __exidx_end visibility. Create an
10875 .ARM.attributes section if necessary.
10876 (Target_arm::get_secondary_compatible_arch,
10877 Target_arm::set_secondary_compatible_arch,
10878 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10879 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10880 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10881 New method definitions.
10882
b59befec
ILT
108832009-12-09 Ian Lance Taylor <iant@google.com>
10884
10885 * plugin.cc (Plugin::load): Don't cast from void* to a function
10886 pointer.
10887
1276bc89
ILT
108882009-12-09 Ian Lance Taylor <iant@google.com>
10889
10890 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10891 information fields.
10892
2f2de248
L
108932009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10894
10895 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10896 Replace two_file_shared_1.so with two_file_shared_2.so.
10897 * testsuite/Makefile.in: Regenerated.
10898
4f787271
DK
108992009-12-08 Doug Kwan <dougkwan@google.com>
10900
10901 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10902 (HFILES): Add attributes.h and int_encoding.h.
10903 * Makefile.in: Regenerate.
10904 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10905 function definitions to int_encoding.cc
10906 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10907 prototypes to int_encoding.h
10908 * reduced_debug_output.cc (int_encoding.h): New include.
10909 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10910 function definitions to int_encoding.cc
10911 (insert_into_vector, read_from_pointer): Move template definitions to
10912 int_encoding.h
10913 * attributes.cc: New file.
10914 * attributes.h: New file.
10915 * int_encoding.cc: New file.
10916 * int_encoding.h: New file.
10917
20b52f1a
RÁE
109182009-12-07 Rafael Avila de Espindola <espindola@google.com>
10919
10920 PR gold/11055
10921 * incremental-dump.cc (dump_incremental_inputs): New.
10922 (main): Use dump_incremental_inputs.
10923
53d7974c
L
109242009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10925
10926 PR gold/10893
10927 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10928 checking elfcpp::STT_FUNC.
10929 (Target_i386::Relocate::relocate): Likewise.
10930 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10931
10932 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10933 symbols from shared libraries into normal FUNC symbols.
10934
10935 * symtab.h (Symbol): Add is_func and use it.
10936
05a352e6
DK
109372009-12-05 Doug Kwan <dougkwan@google.com>
10938
10939 * arm.cc (Target_arm::arm_info): Initialize new fields
10940 attributes_section and attributes_vendor.
10941 * i386.cc (Target_i386::i386_info): Same.
10942 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10943 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10944 fields attributes_section and attributes_vendor.
53d7974c 10945 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10946 * target.h (Target::attributes_section, Target::attributes_vendor,
10947 Target::is_attributes_section, Target::attribute_arg_type,
10948 Target::attributes_order): New method definitions.
10949 (Target::Target_info::attributes_section,
10950 Target::Target_info::attributes_vendor): New fields.
10951 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10952 virtual method definitions.
10953 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10954 attributes_section and attributes_vendor.
10955 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10956
f4e5969c
DK
109572009-12-05 Doug Kwan <dougkwan@google.com>
10958
10959 * arm.cc: Update comments about interworking and stub generation.
10960 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10961 considered as non-PIC.
10962 (Arm_relocate_functions::base_abs): Fix formatting.
10963 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10964 of function to use GOT entry address instead of offset.
10965 (Target_arm::Scan::global): Issue an error if a symbol would need a
10966 PLT does not get one because it is untyped. Remove code to create
10967 dynamic symbols for relative branches.
10968 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10969 takes unsigned integer instead of boolean.
10970
1abce4a6
L
109712009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10972
10973 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10974 (two_file_test_LDADD): Likewise.
10975 (common_test_1_LDADD): Likewise.
10976 (exception_test_LDADD) Likewise.
10977 (weak_test_LDADD): Likewise.
10978 (many_sections_test_LDADD): Likewise.
10979 (initpri1_LDADD): Likewise.
10980 (script_test_1_LDADD): Likewise.
10981 (script_test_2_LDADD): Likewise.
10982 (justsyms_LDADD): Likewise.
10983 (binary_test_LDADD): Likewise.
10984 (large_LDADD): Likewise.
10985 * testsuite/Makefile.in: Regenerated.
10986
adcf2816 109872009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10988
adcf2816
L
10989 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10990 (Symbol_table::override_with_special): Likewise.
10991 (Symbol_table::add_from_object): Likewise.
10992
28e67f5d
RÁE
109932009-12-04 Rafael Avila de Espindola <espindola@google.com>
10994
10995 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10996 Don't set the data_offset twice.
10997
ae10a101
RÁE
109982009-12-04 Rafael Avila de Espindola <espindola@google.com>
10999
11000 * testsuite/Makefile.in: Regenerate.
11001
f59f41f3
DK
110022009-12-03 Doug Kwan <dougkwan@google.com>
11003
11004 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11005 (Target_arm::do_finalize_sections): Add parameter for symbol table
11006 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11007 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11008 parameter for symbol table pointer.
11009 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11010 an additional parameter for a pointer to symbol table.
11011 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11012 parameter for a symbol table pointer.
11013 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11014 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11015 Ditto.
11016 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11017 parameter for a symbol table pointer.
11018
ca55d848
RÁE
110192009-12-03 Rafael Avila de Espindola <espindola@google.com>
11020
11021 * incremental.cc (Incremental_inputs_header)
11022 (Incremental_inputs_header_write, Incremental_inputs_entry)
11023 (Incremental_inputs_entry_write): Move ...
11024 * incremental.h (Incremental_inputs_header)
11025 (Incremental_inputs_header_write, Incremental_inputs_entry)
11026 (Incremental_inputs_entry_write): here.
11027
3aec4f9c
RÁE
110282009-12-02 Rafael Avila de Espindola <espindola@google.com>
11029
11030 * incremental.cc (make_sized_incremental_binary): Set the target.
11031 Error if it is incompatible.
11032 * output.h (Output_file): Add filename method.
11033
9c0ae74d
RÁE
110342009-12-02 Rafael Avila de Espindola <espindola@google.com>
11035
11036 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11037 from the get_* methods.
11038
a45500ae
RÁE
110392009-12-02 Rafael Avila de Espindola <espindola@google.com>
11040
11041 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11042 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11043 Write 0 for the data_offset of scripts.
11044
325e6408
RÁE
110452009-12-02 Rafael Avila de Espindola <espindola@google.com>
11046
11047 * testsuite/Makefile.am: Add the incremental_test.sh test.
11048 * testsuite/incremental_test.sh: New.
11049 * testsuite/incremental_test_1.c: New.
11050 * testsuite/incremental_test_2.c: New.
11051
954c3e2e
RÁE
110522009-12-01 Rafael Avila de Espindola <espindola@google.com>
11053
703d02da 11054 * incremental-dump.cc (main): Fix typos.
954c3e2e 11055
f8086623
RÁE
110562009-11-27 Rafael Avila de Espindola <espindola@google.com>
11057
11058 PR gold/11025
11059 * incremental-dump.cc (main): Use llu to print 64 bit values.
11060
3b0dd6ac
L
110612009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11062 H.J. Lu <hongjiu.lu@intel.com>
11063
11064 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11065 $(LIBDL).
11066 (incremental_dump_LDADD): Likewise.
11067 * Makefile.in: Regenerated.
11068
a6d1ef57 110692009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11070
a6d1ef57
DK
11071 Revert:
11072
11073 2009-11-25 Doug Kwan <dougkwan@google.com>
11074
11075 * arm.cc (Target_arm::Target_arm): Move method definition
11076 outside of class definition. Add code to handle
11077 --target1-rel, --target1-abs and --target2= options.
11078 (Target_arm::get_reloc_reloc_type): Change method to be
11079 non-static and const.
11080 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11081 New data member declaration.
11082 (Target_arm::Scan::local, Target_arm::Scan::global,
11083 Target_arm::Relocate::relocate,
11084 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11085 Adjust call to Target_arm::get_real_reloc_type.
11086 (Target_arm::get_real_reloc_type): Use command line options
11087 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11088 * options.h (--target1-rel, --target1-abs, --target2): New
11089 ARM-only options.
11090
50aeb7d4
DK
110912009-11-25 Doug Kwan <dougkwan@google.com>
11092
11093 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11094 class definition. Add code to handle --target1-rel, --target1-abs
11095 and --target2= options.
11096 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11097 and const.
11098 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11099 member declaration.
11100 (Target_arm::Scan::local, Target_arm::Scan::global,
11101 Target_arm::Relocate::relocate,
11102 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11103 call to Target_arm::get_real_reloc_type.
11104 (Target_arm::get_real_reloc_type): Use command line options to
11105 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11106 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11107 options.
11108
51938283
DK
111092009-11-25 Doug Kwan <dougkwan@google.com>
11110
11111 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11112 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11113 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11114 formatting.
11115 (Arm_relocate_functions::thm_call): Replace body with a call to
11116 Arm_relocate_functions::thumb_branch_common.
11117 (Arm_relocate_functions::thm_jump24,
11118 Arm_relocate_functions::thm_xpc22): New method definitions.
11119 (Arm_relocate_functions::thumb_branch_common): New method definition.
11120 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11121 operator.
11122 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11123 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11124
e2b8f3c4
RÁE
111252009-11-24 Rafael Avila de Espindola <espindola@google.com>
11126
11127 * Makefile.am: Build incremental-dump
11128 * Makefile.in: Regenerate.
11129 * incremental-dump.cc: New.
11130 * incremental.cc (Incremental_inputs_header_data,
11131 Incremental_inputs_entry_data): Move to incremental.h
11132 * incremental.h: (Incremental_inputs_header_data,
11133 Incremental_inputs_entry_data): Move from incremental.cc
11134
bcba9aec
RÁE
111352009-11-24 Rafael Avila de Espindola <espindola@google.com>
11136
11137 * incremental.cc (Incremental_inputs_header,
11138 Incremental_inputs_header_write, Incremental_inputs_entry,
11139 Incremental_inputs_entry_write): Add a typedef with the data type.
11140
7c3afe08
RÁE
111412009-11-24 Rafael Avila de Espindola <espindola@google.com>
11142
11143 * incremental.cc (Incremental_inputs_header,
11144 Incremental_inputs_header_write, Incremental_inputs_entry,
11145 Incremental_inputs_entry_write): Update comment about which
11146 type has the filed descriptions.
11147
d204b6e9
DK
111482009-11-15 Doug Kwan <dougkwan@google.com>
11149
11150 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11151 (Arm_relocate_functions::arm_branch_common): Change method defintion
11152 in class definition to a method declaration and update list of formal
11153 parameters.
11154 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11155 Arm_relocation_functions::jump24): Adjust call to
11156 Arm_relocate_functions::arm_branch_common. Update list of formal
11157 parameters.
11158 (Arm_relocate_functions::xpc25): New method definition.
11159 (Arm_relocate_functions::arm_branch_common): Move method defintion
11160 out from class definition. Use stubs for mode-switching and extending
11161 branch ranges.
11162 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11163 specially. Change code to enable use of stubs in ARM branches.
11164
43d12afe
DK
111652009-11-10 Doug Kwan <dougkwan@google.com>
11166
11167 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11168 in method declaration.
11169 (Target_arm::relocate_stub): New method declaration.
11170 (Target_arm::default_target): Change to return a pointer instead of
11171 a const reference.
11172 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11173 Target_arm::default_target.
11174 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11175 method definition.
11176 (Target_arm::relocate_section): Adjust view.
11177 (Target_arm::relocate_stub): New method definition.
11178
ac33a407
DK
111792009-11-10 Doug Kwan <dougkwan@google.com>
11180
11181 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11182 a format warning.
11183 * incremental.cc (open_incremental_binary): Initialized local
11184 variables to avoid warnings.
11185 * object.cc (make_elf_object): Ditto.
11186 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11187 a format warning.
e1df38aa 11188
88ee28e9
L
11189009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11190
11191 PR gold/10930
11192 * testsuite/plugin_test.c: Include "config.h".
11193
2daedcd6
DK
111942009-11-09 Doug Kwan <dougkwan@google.com>
11195
11196 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11197 (arm_symbol_value): Remove.
11198 (Arm_relocate_functions::arm_branch_common,
11199 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11200 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11201 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11202 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11203 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11204 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11205 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11206 Arm_relocate_functions::thm_mobw_abs_nc,
11207 Arm_relocate_functions::thm_mov_abs,
11208 Arm_relocate_functions::movw_prel_nc,
11209 Arm_relocate_functions::thm_movt_abs,
11210 Arm_relocate_functions::movt_prel,
11211 Arm_relocate_functions::thm_movw_prel_nc,
11212 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11213 (Target_arm::Relocate::relocate): Only decompose address into two
11214 parts if relocation type uses the thumb-bit and pass the actual
11215 bit instead of a flag indicating that the thumb-bit is used. Adjust
11216 calls to methods in Arm_relocate_functions for this change.
11217
1276bc89 112182009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11219
11220 PR 10925
11221 * reloc.cc: Instantiate
11222 Sized_relobj::initialize_input_to_output_maps and
11223 Sized_relobj:free_input_to_output_maps.
11224
e53ad1b5
ILT
112252009-11-06 Ian Lance Taylor <iant@google.com>
11226
11227 PR 10876
11228 * defstd.cc (in_segment): Set only_if_ref true for "end".
11229
eb44217c
DK
112302009-11-06 Doug Kwan <dougkwan@google.com>
11231
11232 * arm.cc (class Reloc_stub): Correct a comment.
11233 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11234 (Target_arm::scan_section_for_stubs): New method declaration.
11235 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11236 Change methods from private to protected.
11237 (Target_arm::do_may_relax): New method definition.
11238 (Target_arm::do_relax, Target_arm::group_sections,
11239 Target_arm::scan_reloc_for_stub,
11240 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11241 (Target_arm::arm_input_section_map_): New data member declaration.
11242 (Target_arm::scan_reloc_for_stub,
11243 Target_arm::scan_reloc_section_for_stubs,
11244 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11245 Target_arm::do_relax): New method definitions.
11246
5d329b7d
ILT
112472009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11248
11249 * configure.ac: Check for (struct stat)::st_mtim
11250 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11251 * config.in: Regenerate.
11252 * configure: Regenerate.
11253
96a0d71b
ILT
112542009-11-05 Ian Lance Taylor <iant@google.com>
11255
11256 PR 10910
11257 * output.cc (Output_segment::add_output_section): Add missing
11258 return statement.
11259
594c8e5e
ILT
112602009-11-04 Ian Lance Taylor <iant@google.com>
11261
11262 PR 10880
11263 * object.h (class Object): Add is_needed and set_is_needed
11264 methods. Add is_needed_ field. Make bool fields into bitfields.
11265 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11266 defined in a dynamic object and referenced by a regular object,
11267 set is_needed for the dynamic object.
11268 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11269 if the file is marked with as_needed and it is not needed.
11270
22b127cc
ILT
112712009-11-04 Ian Lance Taylor <iant@google.com>
11272
11273 PR 10887
11274 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11275 tags if data is discarded by linker script.
11276 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11277 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11278 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11279 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11280
f5c870d2
ILT
112812009-11-04 Ian Lance Taylor <iant@google.com>
11282
11283 * layout.cc (Layout::get_output_section): Add is_interp and
11284 is_dynamic_linker_section parameters. Change all callers.
11285 (Layout::choose_output_section): Likewise.
11286 (Layout::make_output_section): Likewise.
11287 (Layout::add_output_section_data): Add is_dynamic_linker_section
11288 parameter. Change all callers.
11289 * layout.h (class Layout): Update declarations.
11290 * output.h (class Output_section): Add is_interp, set_is_interp,
11291 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11292 Add is_interp_, is_dynamic_linker_section_ fields. Change
11293 generate_code_fills_at_write_ to a bitfield.
11294 * output.cc (Output_section::Output_sections): Initialize new
11295 fields.
11296 (Output_segment::add_output_section): Add do_sort parameter.
11297 Change all callers.
11298
1ae4d23b
ILT
112992009-11-03 Ian Lance Taylor <iant@google.com>
11300
11301 PR 10860
11302 * options.h (class General_options): Add --warn-common.
11303 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11304 merging two common symbols.
11305 (Symbol_table::should_override): Handle --warn-common when merging
11306 a common symbol with a defined symbol. Use report_resolve_problem
11307 for multiple definitions.
11308 (Symbol_table::report_resolve_problem): New function.
11309 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11310
55da9579
DK
113112009-11-03 Doug Kwan <dougkwan@google.com>
11312
11313 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11314 stub_factory_.
11315 (Target_arm::stub_factory): New method definition.
11316 (Target_arm::new_arm_input_section,
11317 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11318 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11319 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11320 New type definitions.
11321 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11322 member declarations.
11323 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11324 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11325 New method definitions.
11326
37a9ac43
ILT
113272009-11-03 Ian Lance Taylor <iant@google.com>
11328
11329 * options.h (class General_options): Add --warn_constructors.
11330
b3d6a3d4
ILT
113312009-11-03 Ian Lance Taylor <iant@google.com>
11332
11333 PR 10893
11334 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11335 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11336
934b01dd
ILT
113372009-11-03 Ian Lance Taylor <iant@google.com>
11338
11339 PR 10895
11340 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11341 --msgid-bugs-address.
11342 (install-pdf): New target.
11343 (install-data_yes): Look up one directory to find mkinstalldirs.
11344
03c1939b
L
113452009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11346
11347 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11348 tree.
11349
ebd95253
DK
113502009-10-30 Doug Kwan <dougkwan@google.com>
11351
11352 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11353
e9bbb538
DK
113542009-10-30 Doug Kwan <dougkwan@google.com>
11355
11356 * arm.cc (Stub_addend_reader): New struct template definition
11357 and partial specializations.
11358 (Stub_addend_reader::operator()): New method definition for a
11359 partially specialized template.
11360
d5b40221
DK
113612009-10-30 Doug Kwan <dougkwan@google.com>
11362
11363 * arm.cc (Arm_relobj::processor_specific_flags): New method
11364 definition.
11365 (Arm_relobj::do_read_symbols): New method declaration.
11366 (Arm_relobj::processor_specific_flags_): New data member declaration.
11367 (Arm_dynobj): New class definition.
11368 (Target_arm::do_finalize_sections): Add input_objects parameter.
11369 (Target_arm::do_adjust_elf_header): New method declaration.
11370 (Target_arm::are_eabi_versions_compatible,
11371 (Target_arm::merge_processor_specific_flags): New method declaration.
11372 (Target_arm::do_make_elf_object): New overloaded method definitions
11373 and declaration.
11374 (Arm_relobj::do_read_symbols): New method definition.
11375 (Arm_dynobj::do_read_symbols): Ditto.
11376 (Target_arm::do_finalize_sections): Add input_objects parameters.
11377 Merge processor-specific flags from all input objects.
11378 (Target_arm::are_eabi_versions_compatible,
11379 Target_arm::merge_processor_specific_flags,
11380 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11381 New method definitions.
11382 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11383 Input_objects pointer type parameter.
11384 * layout.cc (Layout::finalize): Pass input objects to target's.
11385 finalize_sections function.
11386 * output.cc (Output_file_header::do_sized_write): Set ELF file
11387 header's processor-specific flags.
11388 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11389 Input_objects pointer type parameter.
11390 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11391 * target.h (Input_objects): New forward class declaration.
11392 (Target::processor_specific_flags,
11393 Target::are_processor_specific_flags_sect): New method definitions.
11394 (Target::finalize_sections): Add input_objects parameter.
11395 (Target::Target): Initialize processor_specific_flags_ and
11396 are_processor_specific_flags_set_.
11397 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11398 parameter.
11399 (Target::set_processor_specific_flags): New method definition.
11400 (Target::processor_specific_flags_,
11401 Target::are_processor_specific_flags_set_): New data member
11402 declarations.
11403 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11404 Input_objects pointer type parameter.
11405
ebabffbd
DK
114062009-10-30 Doug Kwan <dougkwan@google.com>
11407
11408 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11409
ad0f2072
ILT
114102009-10-28 Ian Lance Taylor <iant@google.com>
11411
11412 * object.h (class Relobj): Drop options parameter from
11413 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11414 do_scan_relocs, do_relocate. Change all callers.
11415 (class Sized_relobj): Drop options parameters from
11416 do_gc_process_relocs, do_scan_relocs, do_relocate,
11417 do_relocate_sections, relocate_sections, emit_relocs_scan,
11418 emit_relocs_scan_reltype. Change all callers.
11419 (struct Relocate_info): Remove options field and all references to
11420 it.
11421 * reloc.h (class Read_relocs): Remove options constructor
11422 parameter and options_ field. Change all callers.
11423 (class Gc_process_relocs, class Scan_relocs): Likewise.
11424 (class Relocate_task): Likewise.
11425 * target-reloc.h (scan_relocs): Remove options parameter. Change
11426 all callers.
11427 (scan_relocatable_relocs): Likewise.
11428 * target.h (class Sized_target): Remove options parameter from
11429 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11430 all callers.
11431 * gc.h (gc_process_relocs): Remove options parameter. Change all
11432 callers.
11433 * arm.cc: Update functions to remove options parameters.
11434 * i386.cc: Likewise.
11435 * powerpc.cc: Likewise.
11436 * sparc.cc: Likewise.
11437 * x86_64.cc: Likewise.
11438 * testsuite/testfile.cc: Likewise.
11439
8ffa3667
DK
114402009-10-28 Doug Kwan <dougkwan@google.com>
11441
11442 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11443 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11444 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11445 New method definitions.
11446
40f36857
CC
114472009-10-28 Cary Coutant <ccoutant@google.com>
11448
11449 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11450 (Plugin::cleanup_done_): New member.
11451 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11452 (Plugin_manager::cleanup_done_): Remove.
11453 (Plugin_manager::add_input_file): Edit error message.
11454 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11455 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11456
2c849493
ILT
114572009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11458
11459 * fileread.cc: (File_read::View::~View): Use the new
11460 data_ownership_ filed.
11461 (File_read::~File_read): Dispose the new whole_file_view_.
11462 (File_read::open): Mmap the whole file if needed.
11463 (File_read::open): Use whole_file_view_ instead of contents_.
11464 (File_read::find_view): Use whole_file_view_ if applicable.
11465 (File_read::do_read): Use whole_file_view_ instead of contents_.
11466 (File_read::make_view): Use whole_file_view_ instead of contents_,
11467 update File_read::View::View call.
11468 (File_read::find_or_make_view): Update File_read::View::View
11469 call.
11470 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11471 remove contents_
11472 (File_read::View::Data_ownership): New enum.
11473 (File_read::View::View): Replace bool mapped_ with Data_ownership
11474 argument.
11475 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11476 (File_read::View::data_ownership_): New field.
11477 (File_read::contents_): Remove (replaced by whole_file_view_).
11478 (File_read::whole_file_view_): New field.
11479 * options.h (class General_options): Add --keep-files-mapped.
11480
24998053
CC
114812009-10-27 Cary Coutant <ccoutant@google.com>
11482
11483 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11484 * testsuite/Makefile.am (plugin_test_5): New test case.
11485 * testsuite/Makefile.in: Regenerate.
11486
72adc4fa
DK
114872009-10-25 Doug Kwan <dougkwan@google.com>
11488
11489 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11490 from private to protected to allow access by child class.
11491 (Sized_relobj::do_relocate_sections): New method declaration.
11492 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11493 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11494 Sized_relobj::relocate_sections. Instantiate template explicitly
11495 for different target sizes and endianity.
11496
07f508a2
DK
114972009-10-24 Doug Kwan <dougkwan@google.com>
11498
11499 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11500 (Arm_input_section::as_arm_input_section): New method.
11501 (Arm_output_section): New class definition.
11502 (Arm_output_section::create_stub_group,
11503 Arm_output_section::group_sections): New method definitions.
11504
10ad9fe5
DK
115052009-10-22 Doug Kwan <dougkwan@google.com>
11506
11507 * arm.cc (Arm_input_section): New class definition.
11508 (Arm_input_section::init, Arm_input_section:do_write,
11509 Arm_input_section::set_final_data_size,
11510 Arm_input_section::do_reset_address_and_file_offset): New method
11511 definitions.
11512
56ee5e00
DK
115132009-10-21 Doug Kwan <dougkwan@google.com>
11514
11515 * arm.cc (Stub_table, Arm_input_section): New forward class
11516 declarations.
11517 (Stub_table): New class defintion.
11518 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11519 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11520 New method definition.
11521
b569affa
DK
115222009-10-21 Doug Kwan <dougkwan@google.com>
11523
11524 * arm.cc: Update copyright comments.
11525 (Target_arm): New forward class template declaration.
11526 (Arm_address): New type.
11527 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11528 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11529 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11530 constants.
11531 (Insn_template): Same.
11532 (DEF_STUBS): New macro.
11533 (Stub_type): New enum type.
11534 (Stub_template): New class definition.
11535 (Stub): Same.
11536 (Reloc_stub): Same.
11537 (Stub_factory): Same.
11538 (Target_arm::Target_arm): Initialize may_use_blx_ and
11539 should_force_pic_veneer_.
11540 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11541 Target_arm::should_force_pic_veneer,
11542 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11543 Target_arm::using_thumb_only, Target_arm:;default_target): New
11544 method defintions.
11545 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11546 New data member declarations.
11547 (Insn_template::size, Insn_template::alignment): New method defintions.
11548 (Stub_template::Stub_template): New method definition.
11549 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11550 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11551 (Stub_factory::Stub_factory): New method definition.
11552 * gold.h (string_hash): New template.
11553 * output.h (Input_section_specifier::hash_value): Use
11554 gold::string_hash.
11555 (Input_section_specifier::string_hash): Remove.
11556 * stringpool.cc (Stringpool_template::string_hash): Use
11557 gold::string_hash.
11558
6c172549
DK
115592009-10-20 Doug Kwan <dougkwan@google.com>
11560
11561 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11562 symbols of relaxed input sections.
11563 * output.h (Output_section::find_relaxed_input_section): Make
11564 method public.
11565
c5617f2f
DK
115662009-10-16 Doug Kwan <dougkwan@google.com>
11567
11568 * dynobj.cc (Versions::Versions): Initialize version_script_.
11569 Only insert base version symbol definition for a shared object
11570 if version script defines any version versions.
11571 (Versions::define_base_version): New method definition.
11572 (Versions::add_def): Check that base version is not needed.
11573 (Versions::add_need): Define base version lazily.
11574 * dynobj.h (Versions::define_base_version): New method declaration.
11575 (Versions::needs_base_version_): New data member declaration.
11576 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11577 (check_DATA): Add no_version_test.stdout.
11578 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11579 New make rules.
11580 * testsuite/Makefile.in: Regenerate.
11581 * testsuite/no_version_test.c: New file.
11582 * testsuite/no_version_test.sh: Ditto.
11583
3c12dcdb
DK
115842009-10-16 Doug Kwan <dougkwan@google.com>
11585
11586 * expression.cc (class Segment_start_expression): New class definition.
11587 (Segment_start_expression::value): New method definition.
11588 (script_exp_function_segment_start): Return a new
11589 Segment_start_expression.
11590 * gold/script-c.h (script_saw_segment_start_expression): New function
11591 prototype.
11592 * script-sections.cc (Script_sections::Script_sections): Initialize
11593 SAW_SEGMENT_START_EXPRESSION_ to false.
11594 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11595 and -Tbbs options to specify section addresses if given in
11596 command line and no SEGMENT_START expression is seen in a script.
11597 * script-sections.h (Script_sections::saw_segment_start_expression,
11598 Script_sections::set_saw_segment_start_expression): New method
11599 definition.
11600 (Script_sections::saw_segment_start_expression_): New data member
11601 declaration.
11602 * script.cc (script_saw_segment_start_expression): New function.
11603 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11604 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11605 script_test_7.sh and script_test_8.sh.
11606 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11607 script_test_8.stdout.
11608 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11609 (script_test_6, script_test_6.stdout, script_test_7,
11610 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11611 * Makefile.in: Regenerate.
11612 * testsuite/script_test_6.sh: New file.
11613 * testsuite/script_test_6.t: Same.
11614 * testsuite/script_test_7.sh: Same.
11615 * testsuite/script_test_7.t: Same.
11616 * testsuite/script_test_8.sh: Same.
11617
64b1ae37
DK
116182009-10-16 Doug Kwan <dougkwan@google.com>
11619
11620 * output.cc (Output_segment::set_section_list_address): Cast
11621 expressions to unsigned long long type to avoid format warnings.
11622
661be1e2
ILT
116232009-10-15 Ian Lance Taylor <iant@google.com>
11624
12edd763 11625 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11626 dot assignment to script_sections_.
12edd763
ILT
11627 * script-sections.cc (Script_sections::add_dot_assignment):
11628 Initialize if necessary.
11629
68b6574b
ILT
11630 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11631 program headers with no load segment if there is a linker script.
11632
661be1e2
ILT
11633 * layout.cc (Layout::set_segment_offsets): Align the file offset
11634 to the segment aligment for -N or -n with no load segment.
11635 * output.cc (Output_segment::add_output_section): Don't crash if
11636 the first section is a TLS section.
11637 (Output_segment::set_section_list_addresses): Print an error
11638 message if the address moves backward in a linker script.
11639 * script-sections.cc
11640 (Output_section_element_input::set_section_addresses): Don't
11641 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11642 (Orphan_output_section::set_section_addresses): Likewise.
11643
f15f61a7
DK
116442009-10-15 Doug Kwan <dougkwan@google.com>
11645
11646 * layout.cc (Layout::finish_dynamic_section): Generate tags
11647 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11648 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11649 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11650
82bb573a
ILT
116512009-10-14 Ian Lance Taylor <iant@google.com>
11652
11653 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11654 fields.
11655 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11656 data_shdr fields of relinfo.
11657 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11658 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11659 R_386_TLS_LDO_32, adjust based on section flags.
11660 (Target_i386::Relocate::fix_up_ldo): Remove.
11661
374ad285
ILT
116622009-10-13 Ian Lance Taylor <iant@google.com>
11663
11664 Add support for -pie.
11665 * options.h (class General_options): Add -pie and
11666 --pic-executable.
11667 (General_options::output_is_position_independent): Test -pie.
11668 (General_options::output_is_executable): Return true if not shared
11669 and not relocatable.
11670 (General_options::output_is_pie): Remove.
11671 * options.cc (General_options::finalize): Reject incompatible uses
11672 of -pie.
11673 * gold.cc (queue_middle_tasks): A -pie link is not static.
11674 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11675 * symtab.cc (Symbol::final_value_is_known): Return false if
11676 output_is_position_independent.
11677 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11678 output_is_position_independent.
11679 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11680 output_is_position_independent.
11681 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11682 output_is_position_independent.
11683 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11684 two_file_pie_test.
11685 (basic_pie_test.o, basic_pie_test): New targets.
11686 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11687 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11688 (two_file_pie_test): New target.
11689 * testsuite/Makefile.in: Rebuild.
11690 * README: Remove note saying that -pie is not supported.
11691
c6585162
ILT
116922009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11693
11694 * options.h (class General_options): Add -init and -fini.
11695 * layout.cc (Layout::finish_dynamic_section): Emit
11696 given init and fini functions.
11697
032ce4e9
ST
116982009-10-13 Sriraman Tallam <tmsriram@google.com>
11699
11700 * gc.h (gc_process_relocs): Check if icf is enabled using new
11701 function.
11702 * gold.cc (queue_initial_tasks): Likewise.
11703 (queue_middle_tasks): Likewise.
11704 * object.cc (do_layout): Likewise.
11705 * symtab.cc (is_section_folded): Likewise.
11706 * main.cc (main): Likewise.
11707 * reloc.cc (Read_relocs::run): Likewise.
11708 (Sized_relobj::do_scan_relocs): Likewise.
11709 * icf.cc (is_function_ctor_or_dtor): New function.
11710 (Icf::find_identical_sections): Check if function is ctor or dtor when
11711 safe icf is chosen.
11712 * options.h (General_options::icf): Change option to be an enum.
11713 (Icf_status): New enum.
11714 (icf_enabled): New method.
11715 (icf_safe_folding): New method.
11716 (set_icf_status): New method.
11717 (icf_status_): New variable.
11718 * (options.cc) (General_options::finalize): Set icf_status_.
11719 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11720 icf_test and icf_keep_unique_test to use the --icf enum flag.
11721 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11722 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11723
f345227a
ST
117242009-10-12 Sriraman Tallam <tmsriram@google.com>
11725
11726 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11727 includes to gc.h and icf.h.
11728 * arm.cc: Include gc.h.
11729 * gold.cc: Likewise.
11730 * i386.cc: Likewise.
11731 * powerpc.cc: Likewise.
11732 * sparc.cc: Likewise.
11733 * x86_64.cc: Likewise.
11734 * gc.h: Include icf.h.
11735
1c7814ed
ILT
117362009-10-11 Ian Lance Taylor <iant@google.com>
11737
11738 * plugin.cc: Include "gold.h" before other header files.
11739
ae3b5189
CD
117402009-10-10 Chris Demetriou <cgd@google.com>
11741
11742 * options.h (Input_file_argument::Input_file_type): New enum.
11743 (Input_file_argument::is_lib_): Replace with...
11744 (Input_file_argument::type_): New member.
11745 (Input_file_argument::Input_file_argument): Take Input_file_type
11746 'type' rather than boolean 'is_lib' as second argument.
11747 (Input_file_argument::is_lib): Use type_.
11748 (Input_file_argument::is_searched_file): New function.
11749 (Input_file_argument::may_need_search): Handle is_searched_file.
11750 * options.cc (General_options::parse_library): Support -l:filename.
11751 (General_options::parse_just_symbols): Update for Input_file_argument
11752 changes.
11753 (Command_line::process): Likewise.
11754 * archive.cc (Archive::get_file_and_offset): Likewise.
11755 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11756 * script.cc (read_script_file, script_add_file): Likewise.
11757 * fileread.cc (Input_file::Input_file): Likewise.
11758 (Input_file::will_search_for): Handle is_searched_file.
11759 (Input_file::open): Likewise.
11760 * readsyms.cc (Read_symbols::get_name): Likewise.
11761 * testsuite/Makefile.am (searched_file_test): New test.
11762 * testsuite/Makefile.in: Regenerate.
11763 * testsuite/searched_file_test.cc: New file.
11764 * testsuite/searched_file_test_lib.cc: New file.
11765
f3048a1d
ILT
117662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11767 Ian Lance Taylor <iant@google.com>
11768
11769 * descriptor.cc: Include <cstdio> and "binary-io.h".
11770 (Descriptors::open): Open the files in binary mode always.
11771 * script.cc (Lex::get_token): Treat \r as whitespace.
11772
d4780e57
ILT
117732009-10-09 Ian Lance Taylor <iant@google.com>
11774
11775 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11776
d9a893b8
ILT
117772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11778 Ian Lance Taylor <iant@google.com>
11779
11780 * configure.ac: Check for readv function also.
11781 * fileread.cc (readv): Define if not HAVE_READV.
11782 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11783 does not exist.
11784 * config.in: Regenerate.
11785 * configure: Regenerate.
11786
c0a62865
DK
117872009-10-09 Doug Kwan <dougkwan@google.com>
11788
11789 * layout.cc (Layout::make_output_section): Call target hook to make
11790 ordinary output section.
11791 (Layout::finalize): Adjust parameter list of call the
11792 Target::may_relax().
11793 * layout.h (class Layout::section_list): New method.
11794 * merge.h (Output_merge_base::entsize): Change visibility to public.
11795 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11796 New methods.
11797 (Output_merge_string::do_is_string): New method.
11798 * object.cc (Sized_relobj::do_setup): renamed from
11799 Sized_relobj::set_up.
11800 * object.h (Sized_relobj::adjust_shndx,
11801 Sized_relobj::initializ_input_to_output_maps,
11802 Sized_relobj::free_input_to_output_maps): Change visibilities to
11803 protected.
11804 (Sized_relobj::setup): Virtualize.
11805 (Sized_relobj::do_setup): New method declaration.
11806 (Sized_relobj::invalidate_section_offset,
11807 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11808 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11809 * options.cc (parse_int): New function.
11810 * options.h (parse_int): New declaration.
11811 (DEFINE_int): New macro.
11812 (stub_group_size): New option.
11813 * output.cc (Output_section::Output_section): Initialize memebers
11814 merge_section_map_, merge_section_by_properties_map_,
11815 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11816 (Output_section::add_input_section): Handled deferred code-fill
11817 generation and remove an old comment.
11818 (Output_section::add_relaxed_input_section): New method definition.
11819 (Output_section::add_merge_input_section): Use merge section by
11820 properties map to speed to search. Update merge section maps
11821 as appropriate.
11822 (Output_section::build_relaxation_map): New method definition.
11823 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11824 Same.
11825 (Output_section::relax_input_section): Renamed to
11826 Output_section::convert_input_sections_to_relaxed_sections and change
11827 interface to take a vector of pointers to relaxed sections.
11828 (Output_section::find_merge_section,
11829 Output_section::find_relaxed_input_section): New method definitions.
11830 (Output_section::is_input_address_mapped,
11831 Output_section::output_offset, Output_section::output_address):
11832 Use output section data maps to speed up searching.
11833 (Output_section::find_starting_output_address): Add comments.
11834 (Output_section::do_write,
11835 Output_section::write_to_postprocessing_buffer): Do code-fill
11836 generation as appropriate.
11837 (Output_section::get_input_sections): Invalidate relaxed input section
11838 map.
11839 (Output_section::restore_states): Adjust type of checkpoint .
11840 Invalidate relaxed input section map.
11841 * output.h (Output_merge_base): New class declaration.
11842 (Input_section_specifier): New class defintion.
11843 (class Output_relaxed_input_section) Change base class to
11844 Output_section_data_build.
11845 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11846 base class initializer.
11847 (Output_section::add_relaxed_input_section): New method declaration.
11848 (Output_section::Input_section): Change visibility to protected.
2e702c99 11849 (Output_section::Input_section::relobj,
c0a62865
DK
11850 Output_section::Input_section::shndx): Handle relaxed input sections.
11851 Output_section::input_sections) Change visibility to protected. Also
11852 define overload to return a non-const pointer.
11853 (Output_section::Merge_section_properties): New class defintion.
11854 (Output_section::Merge_section_by_properties_map,
11855 Output_section::Output_section_data_by_input_section_map,
11856 Output_section::Relaxation_map): New types.
11857 (Output_section::relax_input_section): Rename method to
11858 Output_section::convert_input_sections_to_relaxed_sections and change
11859 interface to take a vector of relaxed section pointers.
11860 (Output_section::find_merge_section,
11861 Output_section::find_relaxed_input_section,
11862 Output_section::build_relaxation_map,
11863 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11864 New method declarations.
11865 (Output_section::merge_section_map_
11866 Output_section::merge_section_by_properties_map_,
11867 Output_section::relaxed_input_section_map_,
11868 Output_section::is_relaxed_input_section_map_valid_,
11869 Output_section::generate_code_fills_at_write_): New data members.
11870 * script-sections.cc
11871 (Output_section_element_input::set_section_addresses): Call
11872 current_data_size and addralign methods of relaxed input sections.
11873 (Orphan_output_section::set_section_addresses): Call current_data_size
11874 and addralign methods of relaxed input sections.
11875 * symtab.cc (Symbol_table::compute_final_value): Extract template
11876 from the body of Symbol_table::sized_finalize_symbol.
11877 (Symbol_table::sized_finalized_symbol): Call
11878 Symbol_table::compute_final_value.
11879 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11880 (Symbol_table::compute_final_value): New templated method declaration.
11881 * target.cc (Target::do_make_output_section): New method defintion.
11882 * target.h (Target::make_output_section): New method declaration.
11883 (Target::relax): Add more parameters for input objects, symbol table
11884 and layout. Adjust call to do_relax.
11885 (Target::do_make_output_section): New method declaration.
11886 (Target::do_relax): Add parameters for input objects, symbol table
11887 and layout.
11888
d446d6c4
ILT
118892009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11890
11891 * pread.c: Include stdio.h.
11892
bc06c745
ILT
118932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11894
11895 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11896 defined.
11897
75aea3d0
ILT
118982009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11899
11900 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11901 Change read_shndx type to unsigned int.
11902 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11903 int.
11904 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11905 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11906 Change read_shndx type to unsigned int.
11907 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11908 int.
11909 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11910 * layout.cc (Layout::create_symtab_sections): Cast the result of
11911 local_symcount * symsize to off_t in the gold_assert.
11912
be8fcb75
ILT
119132009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11914
11915 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11916 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11917 R_ARM_BASE_ABS.
11918 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11919 (Arm_relocate_functions::thm_abs5): New function.
11920 (Arm_relocate_functions::abs12): New function.
11921 (Arm_relocate_functions::abs16): New function.
11922 (Arm_relocate_functions::base_abs): New function.
11923 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11924 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11925 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11926 R_ARM_BASE_ABS.
11927 (Scan::global): Likewise.
11928 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11929 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11930 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11931 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11932 R_ARM_BASE_ABS.
11933
c2a122b6
ILT
119342009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11935
11936 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11937 (Arm_relocate_functions::movt_prel): New function.
11938 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11939 (Arm_relocate_functions::thm_movt_prel): New function.
11940 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11941 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11942 (Scan::global, Relocate::relocate): Likewise.
11943 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11944
c4aa1e2d
ILT
119452009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11946
11947 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11948 Incremental_checker.
11949 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11950 unsigned int.
11951 (class Incremental_inputs_header): New class.
11952 (Incremental_inputs_header_writer): Edit comment.
11953 (Incremental_inputs_entry): New class.
11954 (Incremental_inputs_entry_writer): Edit comment.
11955 (Sized_incremental_binary::do_find_incremental_inputs_section):
11956 Add *strtab_shndx parameter, fill it.
11957 (Sized_incremental_binary::do_check_inputs): New method.
11958 (Incremental_checker::can_incrementally_link_output_file): Use
11959 Sized_incremental_binary::check_inputs.
11960 (Incremental_inputs::report_command_line): Save command line in
11961 command_line_.
11962 * incremental.h:
11963 (Incremental_binary::find_incremental_inputs_section): New
11964 method.
11965 (Incremental_binary::do_find_incremental_inputs_section): Add
11966 strtab_shndx parameter.
11967 (Incremental_binary::do_check_inputs): New pure virtual method.
11968 (Sized_incremental_binary::do_check_inputs): Declare.
11969 (Incremental_checker::Incremental_checker): Add incremental_inputs
11970 parameter, use it to initialize incremental_inputs_.
11971 (Incremental_checker::incremental_inputs_): New field.
11972 (Incremental_checker::command_line): New method.
11973 (Incremental_checker::inputs): New method.
11974 (Incremental_checker::command_line_): New field.
11975
c549a694
ILT
119762009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11977
11978 * incremental.cc: Include <cstdarg> and "target-select.h".
11979 (vexplain_no_incremental): New function.
11980 (explain_no_incremental): New function.
11981 (Incremental_binary::error): New method.
11982 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11983 method.
11984 (make_sized_incremental_binary): New function.
11985 (open_incremental_binary): New function.
11986 (can_incrementally_link_file): Add checks if output is ELF and has
11987 inputs section.
11988 * incremental.h: Include "elfcpp_file.h" and "output.h".
11989 (Incremental_binary): New class.
11990 (Sized_incremental_binary): New class.
11991 (open_incremental_binary): Declare.
11992 * object.cc (is_elf_object): Use
11993 elfcpp::Elf_recognizer::is_elf_file.
11994 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11995 * output.h (Output_file::filesize): New method.
11996
fd3c5f0b
ILT
119972009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11998
11999 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12000 New function.
12001 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12002 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12003 function.
12004 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12005 function.
12006 (Arm_relocate_functions::movw_abs_nc): New function.
12007 (Arm_relocate_functions::movt_abs): New function.
12008 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12009 (Arm_relocate_functions::thm_movt_abs): New function.
12010 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12011 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12012 (Scan::global): Likewise.
12013 (Relocate::relocate): Likewise.
12014 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12015
7f5309a5
ILT
120162009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12017
12018 * arm.cc (Arm_relocate_functions::got_prel) New function.
12019 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12020 (Relocate::relocate): Likewise.
12021 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12022
364c7fa5
ILT
120232009-10-06 Ian Lance Taylor <iant@google.com>
12024
12025 * options.h (class General_options): Define
12026 split_stack_adjust_size parameter.
12027 * object.h (class Object): Add uses_split_stack_ and
12028 has_no_split_stack_ fields. Add uses_split_stack and
12029 has_no_split_stack accessor functions. Declare
12030 handle_split_stack_section.
12031 (class Reloc_symbol_changes): Define.
12032 (class Sized_relobj): Define Function_offsets. Declare
12033 split_stack_adjust, split_stack_adjust_reltype, and
12034 find_functions.
12035 * object.cc (Object::handle_split_stack_section): New function.
12036 (Sized_relobj::do_layout): Call handle_split_stack_section.
12037 * dynobj.cc (Sized_dynobj::do_layout): Call
12038 handle_split_stack_section.
12039 * reloc.cc (Sized_relobj::relocate_sections): Call
12040 split_stack_adjust for executable sections in split_stack
12041 objects. Pass reloc_map to relocate_section.
12042 (Sized_relobj::split_stack_adjust): New function.
12043 (Sized_relobj::split_stack_adjust_reltype): New function.
12044 (Sized_relobj::find_functions): New function.
12045 * target-reloc.h: Include "object.h".
12046 (relocate_section): Add reloc_symbol_changes parameter. Change
12047 all callers.
12048 * target.h (class Target): Add calls_non_split method. Declare
12049 do_calls_non_split virtual method. Declare match_view and
12050 set_view_to_nop.
12051 * target.cc: Include "elfcpp.h".
12052 (Target::do_calls_non_split): New function.
12053 (Target::match_view): New function.
12054 (Target::set_view_to_nop): New function.
12055 * gold.cc (queue_middle_tasks): Give an error if mixing
12056 split-stack and non-split-stack objects with -r.
12057 * i386.cc (Target_i386::relocate_section): Add
12058 reloc_symbol_changes parameter.
12059 (Target_i386::do_calls_non_split): New function.
12060 * x86_64.cc (Target_x86_64::relocate_section): Add
12061 reloc_symbol_changes parameter.
12062 (Target_x86_64::do_calls_non_split): New function.
12063 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12064 parameter.
12065 * powerpc.cc (Target_powerpc::relocate_section): Add
12066 reloc_symbol_changes parameter.
12067 * sparc.cc (Target_sparc::relocate_section): Add
12068 reloc_symbol_changes parameter.
12069 * configure.ac: Call AM_CONDITIONAL for the default target.
12070 * configure: Rebuild.
12071 * testsuite/Makefile.am (TEST_AS): New variable.
12072 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12073 (check_DATA): Add split_i386 and split_x86_64 files.
12074 (SPLIT_DEFSYMS): Define.
12075 (split_i386_[1234n].o): New targets.
12076 (split_i386_[124]): New targets.
12077 (split_i386_[1234r].stdout): New targets.
12078 (split_x86_64_[1234n].o): New targets.
12079 (split_x86_64_[124]): New targets.
12080 (split_x86_64_[1234r].stdout): New targets.
12081 (MOSTLYCLEANFILES): Add new executables.
12082 * testsuite/split_i386.sh: New file.
12083 * testsuite/split_x86_64.sh: New file.
12084 * testsuite/split_i386_1.s: New file.
12085 * testsuite/split_i386_2.s: New file.
12086 * testsuite/split_i386_3.s: New file.
12087 * testsuite/split_i386_4.s: New file.
12088 * testsuite/split_i386_n.s: New file.
12089 * testsuite/split_x86_64_1.s: New file.
12090 * testsuite/split_x86_64_2.s: New file.
12091 * testsuite/split_x86_64_3.s: New file.
12092 * testsuite/split_x86_64_4.s: New file.
12093 * testsuite/split_x86_64_n.s: New file.
12094 * testsuite/testfile.cc (Target_test): Update relocation_section
12095 function.
12096 * testsuite/Makefile.in: Rebuild.
12097
e8a9fcda
ILT
120982009-10-06 Ian Lance Taylor <iant@google.com>
12099
12100 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12101 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12102 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12103 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12104 the address on ldo_addrs_.
12105 (Target_i386::Relocate::fix_up_ldo): New function.
12106
e99daf92
ILT
121072009-10-06 Rafael Espindola <espindola@google.com>
12108
12109 * plugin.cc (add_input_library): New.
12110 (Plugin::load): Add add_input_library to tv.
12111 (Plugin_manager::add_input_file): Add the is_lib argument.
12112 (add_input_file): Update call to Plugin_manager::add_input_file.
12113 (add_input_library): New.
12114 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12115
966d4097
DK
121162009-09-30 Doug Kwan <dougkwan@google.com>
12117
12118 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12119 symbol and call Symbol::may_need_copy_reloc to determine if
12120 a copy reloc is needed.
12121 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12122 nocopyreloc is given in command line.
12123 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12124 given in command line.
12125 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12126 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12127 of the removed Target_i386::may_need_copy_reloc.
12128 * options.h (copyreloc): New option with default value false.
12129 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12130 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12131 instead of the removed Target_powerpc::may_need_copy_reloc.
12132 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12133 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12134 instead of the removed Target_sparc::may_need_copy_reloc.
12135 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12136 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12137 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12138 instead of the removed Target_x86_64::may_need_copy_reloc.
12139
029ba973
ILT
121402009-09-30 Ian Lance Taylor <iant@google.com>
12141
12142 * object.h (class Object): Remove target_ field, and target,
12143 sized_target, and set_target methods.
12144 (Object::sized_target): Remove.
12145 (class Sized_relobj): Update declarations. Remove sized_target.
12146 * object.cc (Sized_relobj::setup): Remove target parameter.
12147 Change all callers.
12148 (Input_objects::add_object): Don't do anything with the target.
12149 (make_elf_sized_object): Add punconfigured parameter. Change all
12150 callers. Set or test parameter target.
12151 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12152 Change all callers.
12153 * parameters.cc (Parameters::set_target): Change parameter type to
12154 be non-const.
12155 (Parameters::default_target): Remove.
12156 (set_parameters_target): Change parameter type to be non-const.
12157 (parameters_force_valid_target): New function.
12158 (parameters_clear_target): New function.
12159 * parameters.h (class Parameters): Update declarations. Remove
12160 default_target method. Add sized_target and clear_target
12161 methods. Change target_ to be non-const.
12162 (set_parameters_target): Update declaration.
12163 (parameters_force_valid_target): Declare.
12164 (parameters_clear_target): Declare.
12165 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12166 as NULL if we aren't searching.
12167 (Add_symbols::run): Don't check for compatible target.
12168 * fileread.cc (Input_file::open_binary): Call
12169 parameters_force_valid_target.
12170 * gold.cc (queue_middle_tasks): Likewise.
12171 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12172 set_target on object.
12173 * dynobj.h (class Sized_dynobj): Update declarations.
12174 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12175 make_elf_object returns NULL.
12176 (Archive::include_member): Don't check whether object target is
12177 compatible.
12178 * output.cc (Output_section::add_input_section): Get target from
12179 parameters.
12180 (Output_section::relax_input_section): Likewise.
12181 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12182 parameters.
12183 (Sized_relobj::do_scan_relocs): Likewise.
12184 (Sized_relobj::relocate_sections): Likewise.
12185 * resolve.cc (Symbol_table::resolve): Likewise.
12186 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12187 parameter. Change all callers.
12188 (Symbol_table::add_from_object): Get target from parameters.
12189 (Symbol_table::add_from_relobj): Don't check object target.
12190 (Symbol_table::add_from_dynobj): Likewise.
12191 (Symbol_table::define_special_symbol): Get target from
12192 parameters.
12193 * symtab.h (class Symbol_table): Update declaration.
12194 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12195 parameter. Change all callers. Clear parameter target.
12196 (Binary_test): Test target here.
12197 * testsuite/object_unittest.cc (gold_testsuite): Remove
12198 target_test_pointer parameter. Change all callers.
12199 (Object_test): Test target here.
12200
a6a22b83
ILT
122012009-09-26 Ian Lance Taylor <iant@google.com>
12202
12203 * testsuite/initpri1.c: Don't try to use constructor priorities if
12204 compiling with gcc before 4.3.
12205
6a8f49fe
ILT
122062009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12207
12208 * testsuite/retain_symbols_file_test.sh (check_present): Change
12209 output file name to retain_symbols_file_test.stdout.
12210 (check_absent): Likewise.
12211
8c604651
CS
122122009-09-18 Craig Silverstein <csilvers@google.com>
12213
12214 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12215 * options.cc: Include <cerrno> and <fstream>.
12216 (General_options::finalize): Parse -retain-symbols-file tag.
12217 * options.h: New flag.
12218 (General_options): New method should_retain_symbol, new
12219 variable symbols_to_retain.
12220 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12221 should_retain_symbol map.
12222 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12223 * testsuite/Makefile.in: Regenerate.
12224 * testsuite/retain_symbols_file_test.sh: New file.
12225
ca58b19f
NC
122262009-09-18 Nick Clifton <nickc@redhat.com>
12227
12228 * po/es.po: Updated Spanish translation.
12229
20e6d0d6
DK
122302009-09-17 Doug Kwan <dougkwan@google.com>
12231
12232 * debug.h (DEBUG_RELAXATION): New constant.
12233 (DEBUG_ALL): Add DEBUG_RELAXATION.
12234 (debug_string_to_enum): Add relaxation debug option.
12235 * layout.cc
12236 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12237 Layout::Relaxation_debug_check::read_sections,
12238 Layout::Relaxation_debug_check::read_sections): New method definitions.
12239 (Layout::Layout): Initialize data members
12240 record_output_section_data_from_scrips_,
12241 script_output_section_data_list_ and relaxation_debug_check_.
12242 (Layout::save_segments, Layout::restore_segments,
12243 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12244 Layout::relaxation_loop_body): New method definitions.
12245 (Layout::finalize): Support relaxation. Move section layout code to
12246 Layout::relaxation_loop_body.
12247 (Layout::set_asection_address_from_script): Move code for orphan
12248 section placement out.
12249 (Layout::place_orphan_sections_in_script): New method definition.
12250 * layout.h (Output_segment_headers, Output_file_header):
12251 New forward class declarations.
12252 (Layout::~Layout): Define.
12253 (Layout::new_output_section_data_from_script): New method definition.
12254 (Layout::place_orphan_sections_in_script): New method declaration.
12255 (Layout::Segment_states): New type declaration.
12256 (Layout::save_segments, Layout::restore_segments,
12257 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12258 Layout::relaxation_loop_body): New method declarations.
12259 (Layout::Output_section_data_list): New type declaration.
12260 (Layout::Relaxation_debug_check): New class definition.
12261 (Layout::record_output_section_data_from_script_,
12262 Layout::script_output_section_data_list_, Layout::segment_states_,
12263 Layout::relaxation_debug_check_): New data members.
12264 * output.cc: (Output_section_headers::do_size): New method definition.
12265 (Output_section_headers::Output_section_headers): Move size
12266 computation to Output_section_headers::do_size.
12267 (Output_segment_headers::do_size): New method definition.
e1df38aa 12268 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12269 Output_file_header::do_size and call it.
12270 (Output_file_header::do_size): New method definition.
12271 (Output_data_group::Output_data_group): Adjust call to
12272 Output_section_data.
12273 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12274 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12275 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12276 RELAXED_INPUT_SECTION_CODE.
12277 (Output_section::Output_section): Initialize data member checkpoint_.
12278 (Output_section::~Output_section): Delete checkpoint object pointed
12279 by checkpoint_.
12280 (Output_section::add_input_section): Always add an Input_section if
12281 relaxing.
12282 (Output_section::add_merge_input_section): Add assert.
12283 (Output_section::relax_input_section): New method definition.
12284 (Output_section::set_final_data_size): Set load address to zero for
12285 an unallocated section.
12286 (Output_section::do_address_and_file_offset_have_reset_values):
12287 New method definition.
12288 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12289 Handle relaxed input section.
12290 (Output_section::sort_attached_input_sections): Checkpoint input
12291 section list lazily.
12292 (Output_section::get_input_sections): Change type of input_sections to
12293 list of Simple_input_section pointers. Checkpoint input section list
12294 lazily. Also handle relaxed input sections.
12295 (Output_section::add_input_section_for_script): Take a reference to
12296 a Simple_input_section object instead of Relobj pointer and section
12297 index as parameter. Handle relaxed input sections.
12298 (Output_section::save_states, Output_section::restore_states): New
12299 method definitions.
12300 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12301 (Output_data::is_data_size_fixed): New method definition.
12302 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12303 if it is fixed.
12304 (Output_data::address_and_file_offset_have_reset_values): New method
12305 definition.
12306 (Output_data::do_address_and_file_offset_have_reset_values): New method
12307 definition.
12308 (Output_data::set_data_size): Check that data size is not fixed.
12309 (Output_data::fix_data_size): New method definition.
12310 (Output_data::is_data_size_fixed_): New data member.
12311 (Output_section_headers::set_final_data_size): New method definition.
12312 (Output_section_headers::do_size): New method declaration.
12313 (Output_segment_headers::set_final_data_size): New method definition.
12314 (Output_segment_headers::do_size): New method declaration.
12315 (Output_file_header::set_final_data_size)::New method definition.
12316 (Output_file_header::do_size)::New method declaration.
12317 (Output_section_data::Output_section_data): Add new parameter
12318 is_data_size_fixed and use it to fix data size.
12319 (Output_data_const::Output_data_const): Adjust call to base class
12320 constructor and fix data size.
12321 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12322 base class constructor and fix data size.
12323 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12324 base class constructor and fix data size.
12325 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12326 class constructor and fix data size.
12327 (Output_data_group::set_final_data_size): New method definition.
12328 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12329 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12330 class constructor and fix data size.
12331 (Output_relaxed_input_section): New class definition.
12332 (Output_section::Simple_input_section): New class definition.
12333 (Output_section::get_input_sections): Adjust parameter list.
12334 (Output_section::add_input_section_for_script): Same.
12335 (Output_section::save_states, Output_section::restore_states,
12336 Output_section::do_address_and_file_offset_have_reset_values,
12337 (Output_section::Input_section::Input_section): Handle
12338 RELAXED_INPUT_SECTION_CODE. Add new overload for
12339 Output_relaxed_input_section.
12340 (Output_section::Input_section::is_input_section,
12341 Output_section::Input_section::set_output_section): Handle relaxed
12342 input section.
12343 (Output_section::Input_section::is_relaxed_input_section,
12344 Output_section::Input_section::output_section_data,
12345 Output_section::Input_section::relaxed_input_section): New method
12346 definitions.
12347 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12348 value.
12349 (Output_section::Input_section::u1_): Update comments.
12350 (Output_section::Input_section::u2_): Add new union member poris.
12351 (Output_section::Checkpoint_output_section): New classs definition.
12352 (Output_section::relax_input_section): New method declaration.
12353 (Output_section::checkpoint_): New data member.
12354 (Output_segment): Update comments.
12355 (Output_segment::Output_segment): Un-privatize copy constructor.
12356 (Output_segment::operator=): Un-privatize.
12357 * script-sections.cc (Output_section_element::Input_section_list):
12358 Change element type to Output_section::Simple_input_section.
12359 (Output_section_element_dot_assignment::set_section_addresses):
12360 Register output section data for relaxation clean up.
12361 (Output_data_exression::Output_data_expression): Adjust call to base
12362 constructor to fix data size.
12363 (Output_section_element_data::set_section_addresses): Register
12364 Output_data_expression object for relaxation clean up.
12365 (struct Input_section_info): Replace Relobj pointer and section index
12366 pair with Output_section::Simple_input_section and Convert struct to a
12367 class.
12368 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12369 Input_section_info data member to use accessors.
20e6d0d6
DK
12370 (Output_section_element_input::set_section_addresses): Use layout
12371 parameter. Adjust code to use Output_section::Simple_input_section
12372 and Input_secction_info classes. Register filler for relaxation
12373 clean up.
12374 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12375 and section index pair with Output_section::Simple_input_section
12376 class. Adjust code accordingly.
12377 (Phdrs_element::release_segment): New method definition.
12378 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12379 segment list.
12380 (Script_sections::release_segments): New method definition.
12381 * gold/script-sections.h (Script_sections::release_segments): New
12382 method declaration.
12383 * gold/target.h (Target::may_relax, Target::relax,
12384 Target::do_may_relax, Target::do_relax): New method definitions.
12385
5e445df6
ILT
123862009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12387
12388 * arm.cc (has_signed_unsigned_overflow): New function.
12389 (Arm_relocate_functions::abs8): New function.
12390 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12391 (Target_arm::Scan::global): Likewise.
12392 (Target_arm::relocate::relocate): Likewise.
12393 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12394 Likewise.
12395
8c604651 123962009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12397
12398 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12399 * testsuite/Makefile.in: Regenerate.
12400
1e9cc1c2
NC
124012009-09-11 Nick Clifton <nickc@redhat.com>
12402
12403 * po/gold.pot: Updated by the Translation project.
12404
6a89f575
CC
124052009-09-08 Cary Coutant <ccoutant@google.com>
12406
12407 * output.cc (Output_file::open): Add execute permission to empty file.
12408 * testsuite/Makefile.am (permission_test): New test.
12409 * testsuite/Makefile.in: Regenerate.
12410
fdcac5af
ILT
124112009-09-02 Ian Lance Taylor <iant@google.com>
12412
12413 * output.cc (Output_file::resize): Call map_no_anonymous rather
12414 than map.
12415
44453f85
ILT
124162009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12417
12418 * gold.cc: Include "incremental.h".
12419 (queue_initial_tasks): Call Incremental_checker methods.
12420 * incremental.cc: Include "output.h".
12421 (Incremental_checker::can_incrementally_link_output_file): New
12422 method.
12423 * incremental.h (Incremental_checker): New class.
12424
12425 * output.cc (Output_file::open_for_modification): New method.
12426 (Output_file::map_anonymous): Changed return type to bool. Record
12427 map in base_ field.
12428 (Output_file::map_no_anonymous): New method, broken out of map.
12429 (Output_file::map): Use map_no_anonymous and map_anonymous.
12430 * output.h (class Output_file): Update declarations.
12431
293c1386
CC
124322009-08-24 Cary Coutant <ccoutant@google.com>
12433
12434 * options.h (Command_line::Pre_options): New class.
12435 (Command_line::pre_options): New member.
12436 * options.cc (gold::options::ready_to_register): New variable.
12437 (One_option::register_option): Do nothing if not registering options.
12438 Assert if same short option registered twice.
12439 (General_options::General_options): Turn off option registration when
12440 done constructing.
12441 (Command_line::Pre_options::Pre_options): New constructor.
12442
f773f3d2
CC
124432009-08-24 Cary Coutant <ccoutant@google.com>
12444
06a73cfe
CC
12445 * options.h (General_options::no_keep_memory): Remove incorrect
12446 short option.
f773f3d2 12447
a15af8e2
RW
124482009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12449
12450 * Makefile.am (am__skiplex, am__skipyacc): New.
12451 * Makefile.in: Regenerate.
12452
c462b41b
RW
124532009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12454
14ec8efd
RW
12455 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12456 (INCLUDES): ... this.
12457 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12458 (AM_CPPFLAGS): Renamed from ...
12459 (INCLUDE): ... this.
12460 * Makefile.in, testsuite/Makefile.in: Regenerate.
12461
81ecdfbb
RW
12462 * Makefile.in: Regenerate.
12463 * aclocal.m4: Likewise.
12464 * config.in: Likewise.
12465 * configure: Likewise.
12466 * testsuite/Makefile.in: Likewise.
12467
c462b41b
RW
12468 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12469 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12470 * Makefile.in: Regenerate.
12471 * testsuite/Makefile.in: Regenerate.
12472
2da73f13
CC
124732009-08-19 Cary Coutant <ccoutant@google.com>
12474
12475 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12476 symbols in shared libraries overridden by hidden or internal symbols
12477 in the main program.
12478
2db70501
CD
124792009-08-19 Chris Demetriou <cgd@google.com>
12480
12481 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12482 checking source file names in error messages.
12483
f733487b
DK
124842009-08-18 Doug Kwan <dougkwan@google.com>
12485
12486 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12487 an elcpp::Ehdr as parameter. Adjust call to set_target.
12488 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12489 an elfcpp::Ehdr as parameter.
12490 * object.cc (Object::set_target): Remove the version that looks up
12491 a target and sets it.
12492 (Sized_relobj::setup): Take a Target object instead of
12493 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12494 (make_elf_sized_object): Find target and ask target to
12495 make an ELF object.
12496 * object.h: (Object::set_target): Remove the version that looks up
12497 a target and sets it.
12498 (Sized_relobj::setup): Take a Target object instead of
12499 an elfcpp:Ehdr as parameter.
12500 * target.cc: Include dynobj.h.
12501 (Target::do_make_elf_object_implementation): New.
2e702c99 12502 (Target::do_make_elf_object): New.
f733487b
DK
12503 * target.h (Target::make_elf_object): New template declaration.
12504 (Target::do_make_elf_object): New method declarations.
12505 (Target::do_make_elf_object_implementation): New template declaration.
12506
cc70f101
ILT
125072009-08-14 Ian Lance Taylor <iant@google.com>
12508
12509 * gold.h (FUNCTION_NAME): Define.
12510 (gold_unreachable): Use FUNCTION_NAME.
12511
ef5e0cb1
ST
125122009-08-12 Sriraman Tallam <tmsriram@google.com>
12513
12514 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12515 symbol in the --keep-unique list is not found.
12516
48c187ce
ST
125172009-08-12 Sriraman Tallam <tmsriram@google.com>
12518
12519 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12520 been maked as --keep-unique.
12521 (Icf::unfold_section): New function.
12522 * icf.h (Icf::unfold_section): New function.
12523 * options.h (General_options::keep_unique): New option.
12524 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12525 * testsuite/Makefile.in: Regenerate.
12526 * testsuite/icf_keep_unique_test.sh: New file.
12527 * testsuite/icf_keep_unique_test.cc: New file.
12528
645afe0c
CC
125292009-08-12 Cary Coutant <ccoutant@google.com>
12530
12531 PR 10471
12532 * resolve.cc (Symbol_table::resolve): Check for references from
12533 dynamic objects to hidden and internal symbols.
12534 * testsuite/Makefile.am (hidden_test.sh): New test.
12535 * testsuite/Makefile.in: Regenerate.
12536 * testsuite/hidden_test.sh: New script.
12537 * testsuite/hidden_test_1.c: New test source.
12538 * testsuite/hidden_test_main.c: New test source.
12539
11af873f
DK
125402009-08-11 Doug Kwan <dougkwan@google.com>
12541
12542 * arm.cc: Update comments.
12543 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12544 segment to locate the .ARM.exidx section if present.
12545
b9f7d72d
DK
125462009-08-09 Doug Kwan <dougkwan@google.com>
12547
12548 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12549 patch.
12550
ddd3c53c
ST
125512009-08-07 Sriraman Tallam <tmsriram@google.com>
12552 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12553 compiler warnings.
12554
27721062
ST
125552009-08-06 Sriraman Tallam <tmsriram@google.com>
12556
12557 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12558 valid tls_segment only for non-debug-section relocations.
12559 * testsuite/Makefile.am: Add gc_tls_test.
12560 * testsuite/Makefile.in: Regenerate.
12561 * testsuite/gc_tls_test.cc: New file.
12562 * testsuite/gc_tls_test.sh: New file.
12563
ef15dade 125642009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12565
ef15dade
ST
12566 * icf.cc: New file.
12567 * icf.h: New file.
12568 * Makefile.am (CCFILES): Add icf.cc.
12569 (HFILES): Add icf.h
12570 * Makefile.in: Regenerate.
12571 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12572 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12573 section, symbol and addend information for the relocs.
12574 * gold.cc (queue_middle_tasks): Call identical code folding.
12575 * gold.h: Add defines for multimap.
12576 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12577 to the call of finalize_local_symbols.
12578 * main.cc (main): Create object of class Icf.
12579 * object.cc (Sized_relobj::do_layout): Allow this function to be
12580 called twice during icf.
12581 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12582 to sections marked as identical by icf.
12583 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12584 when available.
12585 (Sized_relobj::do_section_entsize): New function.
12586 * object.h (Object::section_entsize): New function.
12587 (Object::do_section_entsize): New pure virtual function.
12588 (Relobj::finalize_local_symbols): Add new parameter.
12589 (Relobj::do_section_entsize): New function.
12590 * options.h (General_options::icf): New option.
12591 (General_options::icf_iterations): New option.
12592 (General_options::print_icf_sections): New option.
12593 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12594 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12595 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12596 icf.
12597 * symtab.cc (Symbol_table::is_section_folded): New function.
12598 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12599 to sections marked as identical by icf.
12600 * symtab.h (Symbol_table::set_icf): New function.
12601 (Symbol_table::icf): New function.
12602 (Symbol_table::is_section_folded): New function.
12603 (Symbol_table::icf_): New data member.
12604 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12605 * testsuite/Makefile.am: Add commands to build icf_test.
12606 * testsuite/Makefile.in: Regenerate.
12607 * testsuite/icf_test.sh: New file.
12608 * testsuite/icf_test.cc: New file.
12609
c3b65ac4
CD
126102009-07-24 Chris Demetriou <cgd@google.com>
12611
12612 * layout.cc (is_compressible_debug_section): Fix incorrect
12613 comment about compressed section names.
12614
1caf2c51
ILT
126152009-07-20 Ian Lance Taylor <ian@airs.com>
12616
12617 PR 10419
12618 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12619
1ef4d87f
ILT
126202009-07-16 Ian Lance Taylor <iant@google.com>
12621
12622 PR 10400
12623 * layout.h: #include <map>.
12624 (class Kept_section): Change from struct to class. Add accessors
12625 and setters. Add section size to Comdat_group mapping. Change
12626 Comdat_group to std::map. Add is_comdat_ field. Add
12627 linkonce_size field in union.
12628 (class Layout): Update declaration of find_or_add_kept_section.
12629 Don't declare find_kept_object.
12630 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12631 parameter. Add object, shndx, is_comdat, and is_group_name
12632 parameters. Change all callers. Adjust for new Kept_section.
12633 (Layout::find_kept_object): Remove.
12634 * object.cc (Sized_relobj::include_section_group): Update use of
12635 Kept_section. Rename secnum to shndx. Only record
12636 Kept_comdat_section if sections are the same size.
12637 (Sized_relobj::include_linkonce_section): Update use of
12638 Kept_section. Only record Kept_comdat_section if sections are the
12639 same size. Set size of linkonce section.
12640 (Sized_relobj::map_to_kept_section): Update call to
12641 get_kept_comdat_section.
12642 * object.h (class Sized_relobj): Rename fields in
12643 Kept_comdat_section to drop trailing underscores; change object
12644 field to Relobj*. Change Kept_comdat_section_table to store
12645 struct rather than pointer.
12646 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12647 Add kept_object and kept_shndx parameters. Change all callers.
12648 (Sized_relobj::get_kept_comdat_section): Change return type to
12649 bool. Add kept_object and kept_shndx parameters. Change all
12650 callers.
12651 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12652 Layout::find_or_add_kept_section.
12653
37c3b7b0
ILT
126542009-07-09 Ian Lance Taylor <iant@google.com>
12655
12656 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12657 Reserve space in the hash table.
12658
98fa85cb
ILT
126592009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12660
12661 * fileread.cc (File_read::get_mtime): New method.
12662 * fileread.h (Timespec): New structure.
12663 (File_read::get_mtime): New method.
12664 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12665 Renamed from timestamp_nsec.
12666 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12667 Elf_Xword.
e1df38aa 12668 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12669 timestamp_nsec.
e1df38aa 12670 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12671 (Incremental_inputs::report_obejct): Save mtime; style fix.
12672 (Incremental_inputs::report_script): Save mtime; style fix.
12673 (Incremental_inputs::finalize_inputs): Style fix.
12674 (Incremental_inputs::finalize): Style fix.
12675 (Incremental_inputs::create_input_section_data): Store inputs
12676 mtime.
12677 * incremental.h (Incremental_inputs::report_script): Add mtime
12678 argument.
12679 (Incremental_inputs::Input_info::Input_info): Intialize only one
12680 union member.
12681 (Incremental_inputs::Input_info::archive): Move to nameless
12682 union.
12683 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12684 (Incremental_inputs::Input_info::script): Move to nameless union.
12685 (Incremental_inputs::mtime): New field.
12686 * script.cc (read_input_script): Pass file mtime to
12687 Incremental_input.
12688 * script.h (Script_info::inputs): Style fix.
12689
c9d70757
ILT
126902009-07-01 Ian Lance Taylor <ian@airs.com>
12691
12692 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12693 instead of 32.
12694
9c547ec3
ILT
126952009-06-24 Ian Lance Taylor <iant@google.com>
12696
12697 PR 10156
12698 * layout.cc (Layout::choose_output_section): If we find an
12699 existing section, update the flags.
12700 (Layout::create_notes): New function, broken out of
12701 Layout::finalize.
12702 (Layout::finalize): Don't create note sections.
12703 (Layout::create_note): Don't crash if linker script discards
12704 section.
12705 (Layout::create_gold_note): Likewise.
12706 (Layout::create_build_id): Likewise. Don't set
12707 after_input_sections on the section.
12708 (Layout::create_executable_stack_info): Remove target parameter.
12709 Change caller.
12710 * layout.h (class Layout): Declare create_notes. Update
12711 declaration of create_executable_stack_info.
12712 * gold.cc (queue_middle_tasks): Call create_notes.
12713 * output.cc (Output_section::update_flags_for_input_section): Move
12714 here from output.h. If SHF_ALLOC flag is newly set, mark address
12715 invalid.
12716 * output.h (Output_data::mark_address_invalid): New function.
12717 (class Output_section): Only declare, not define,
12718 update_flags_for_input_section. Remove set_flags.
12719
55458500
ILT
127202009-06-24 Ian Lance Taylor <iant@google.com>
12721
12722 * script-sections.cc (Output_section_definition::
12723 set_section_addresses): Rename shadowing local load_address to
12724 laddr.
12725
1307d6cd
ILT
127262009-06-24 Ian Lance Taylor <iant@google.com>
12727
12728 PR 10244
12729 * reloc.cc (relocate_sections): Skip empty relocation sections.
12730
ec3f783e
ILT
127312009-06-23 Ian Lance Taylor <iant@google.com>
12732
12733 PR 10156
12734 * layout.cc (Layout::create_note): Use choose_output_section
12735 rather than make_output_section.
12736
459c9f1c
ILT
127372009-06-23 Ian Lance Taylor <iant@google.com>
12738
12739 PR 10237
12740 * options.cc (General_options::parse_V): Set printed_version_.
12741 (General_options::General_options): Initialize printed_version_.
12742 * options.h (class General_options): Add printed_version_ field.
12743 * gold.cc (queue_initial_tasks): If there are no input files,
12744 don't give a fatal error if we printed the version information.
12745 (queue_middle_tasks): If using -r with a shared object, give a
12746 fatal error rather than an ordinary error.
12747
1518dc8f
ILT
127482009-06-23 Ian Lance Taylor <iant@google.com>
12749
12750 PR 10219
12751 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12752 (Layout::make_output_section): Set have_stabstr_section_ if we see
12753 a .stab*str section.
12754 (Layout::finalize): Call link_stabs_sections.
12755 (Layout::link_stabs_sections): New file.
12756 * layout.h (class Layout): Add have_stabstr_section_ field.
12757 Declare link_stabs_sections.
12758
3d857b98
DK
127592009-06-23 Doug Kwan <dougkwan@google.com>
12760
12761 * Makefile.am (libgold_a_LIBADD): New.
12762 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12763 * Makefile.in: Regenerate.
3d857b98
DK
12764 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12765 * configure: Regenerate.
12766 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12767 * fileread.cc: Include sys/state.h
12768 * gold.h: Declare memmem and strndup if found missing.
12769 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12770
0639a6f6
ILT
127712009-06-23 Ian Lance Taylor <iant@google.com>
12772
12773 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12774 * configure: Rebuild.
12775
8d63875c
ILT
127762009-06-23 Ian Lance Taylor <iant@google.com>
12777
12778 PR 10147
12779 * object.cc (Object::section_contents): Don't try to get a view if
12780 the section has length zero.
12781 (Object::handle_gnu_warning_section): If the section is empty, use
12782 the name of the section as the warning.
12783
f7c8a183
ILT
127842009-06-23 Ian Lance Taylor <iant@google.com>
12785
12786 PR 10133
12787 * stringpool.h (class Stringpool_template): Add optimize_ field.
12788 (Stringpool_template::set_optimize): New function.
12789 * stringpool.cc (Stringpool_template::Stringpool_template):
12790 Initialize optimize_ field.
12791 (Stringpool_template::set_string_offsets): Test local optimize
12792 fild rather than parameter.
12793 * layout.cc (Layout::Layout): Call set_optimize on the section
12794 name stringpool.
12795
e6a307ba
ILT
127962009-06-22 Ian Lance Taylor <iant@google.com>
12797
12798 PR 10030
12799 * yyscript.y: Parse TARGET.
12800 * script.cc (script_set_target): New function.
12801 * script-c.h (script_set_target): Declare.
12802 * options.cc (General_options::string_to_object_format): Rename
12803 from string_to_object_format in anonymous namespace. Change
12804 callers.
12805 * options.h (class General_options): Declare
12806 string_to_object_format.
12807
3ee173de
ILT
128082009-06-22 Ian Lance Taylor <iant@google.com>
12809
12810 * script-sections.cc (Script_sections::create_segments): Don't put
12811 program headers in a PT_LOAD segment if -n or -N.
12812
128132009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12814
12815 PR 10141
12816 * options.h (class General_options): Add -z lazy and -z now. Sort
12817 -z options into alphabetical order.
12818 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12819
cd6739a1 128202009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12821
12822 * layout.cc (Layout::make_output_section): Call
12823 Target::new_output_section.
12824 (Layout::attach_allocated_section_to_segment): Put large section
12825 sections in a separate load segment with the large segment flag
12826 set.
12827 (Layout::segment_precedes): Sort large data segments after other
12828 load segments.
12829 (align_file_offset): New static function.
12830 (Layout::set_segment_offsets): Use align_file_offset.
12831 * output.h (class Output_section): Add is_small_section_ and
12832 is_large_section_ fields.
12833 (Output_section::is_small_section): New function.
12834 (Output_section::set_is_small_section): New function.
12835 (Output_section::is_large_section): New function.
12836 (Output_section::set_is_large_section): New function.
12837 (Output_section::is_large_data_section): New function.
12838 (class Output_segment): Add is_large_data_segment_ field.
12839 (Output_segment::is_large_data_segment): New function.
12840 (Output_segment::set_is_large_data_segment): New function.
12841 * output.cc (Output_section::Output_section): Initialize new
12842 fields.
12843 (Output_segment::Output_segment): Likewise.
12844 (Output_segment::add_output_section): Add assertion that large
12845 data sections always go in large data segments. Force small data
12846 sections to the end of the list of data sections. Force small BSS
12847 sections to the start of the list of BSS sections. For large BSS
12848 sections to the end of the list of BSS sections.
12849 * symtab.h (class Symbol): Declare is_common_shndx.
12850 (Symbol::is_defined): Check Symbol::is_common_shndx.
12851 (Symbol::is_common): Likewise.
12852 (class Symbol_table): Define enum Commons_section_type. Update
12853 declarations. Add small_commons_ and large_commons_ fields.
12854 * symtab.cc (Symbol::is_common_shndx): New function.
12855 (Symbol_table::Symbol_table): Initialize new fields.
12856 (Symbol_table::add_from_object): Put small and large common
12857 symbols in the right list.
12858 (Symbol_table::sized_finalized_symbol): Check
12859 Symbol::is_common_shndx.
12860 (Symbol_table::sized_write_globals): Likewise.
12861 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12862 common symbol lists. Don't call do_allocate_commons_list if the
12863 list is empty.
12864 (Symbol_table::do_allocate_commons_list): Remove is_tls
12865 parameter. Add comons_section_type parameter. Change all
12866 callers. Handle small and large common symbols.
12867 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12868 Symbol::is_common_shndx.
12869 * resolve.cc (symbol_to_bits): Likewise.
12870 * target.h (Target::small_common_shndx): New function.
12871 (Target::small_common_section_flags): New function.
12872 (Target::large_common_shndx): New function.
12873 (Target::large_common_section_flags): New function.
12874 (Target::new_output_section): New function.
12875 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12876 small_common_section_flags, and large_common_section_flags
12877 fields.
12878 (Target::do_new_output_section): New virtual function.
12879 * arm.cc (Target_arm::arm_info): Initialize new fields.
12880 * i386.cc (Target_i386::i386_info): Likewise.
12881 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12882 Likewise.
12883 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12884 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12885 (Target_x86_64::do_new_output_section): New function.
12886 * configure.ac: Define conditional MCMODEL_MEDIUM.
12887 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12888 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12889 (large_LDFLAGS): Define.
12890 * testsuite/large.c: New file.
12891 * testsuite/testfile.cc (Target_test::test_target_info):
12892 Initialize new fields.
12893 * configure, testsuite/Makefile.in: Rebuild.
12894
bb04269c
DK
128952009-06-05 Doug Kwan <dougkwan@google.com>
12896
12897 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12898 * Makefile.in: Regenerate.
bb04269c
DK
12899 * i386.cc (class Target_i386): Define new virtual method to
12900 override do_is_local_label_name in parent.
12901 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12902 local symbols if --discard-locals or -X is given.
12903 * options.h (class General_options): Declare new options
12904 '--discard-locals' and '-X' for discarding locals.
12905 * target.h (class Target): Define new methods is_local_label_name.
12906 Declare new virtual method do_is_local_label_name.
12907 * target.cc: New file.
12908 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12909 (check_SCRIPTS): Add discard_locals_test.sh.
12910 (check_DATA): Add discard_local_tests.syms.
12911 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12912 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12913 * testsuite/Makefile.in: Regenerate.
12914 * testsuite/discard_locals_test.c: New file.
12915 * testsuite/discard_locals_test.sh: Same.
12916
805bb01c
DK
129172009-06-05 Doug Kwan <dougkwan@google.com>
12918
12919 * object.cc (Sized_relobj::Sized_relobj): Initialize
12920 discarded_eh_frame_shndx_ to -1U.
12921 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12922 section.
12923 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12924 a discarded .eh_frame section.
12925 (Sized_relobj::do_finalize_local_symbols): Ditto.
12926 * object.h (class Sized_relobj): Declare new member
12927 discarded_eh_frame_shndx_.
12928 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12929 (local_labels_test.o, local_labels_test): New rules.
12930 * testsuite/Makefile.in: Regenerate.
12931
1dcd334d
DK
129322009-06-04 Doug Kwan <dougkwan@google.com>
12933
12934 * layout.cc (Layout::section_name_mapping): Add mapping for
12935 special ARM sections.
12936
96d49306
DK
129372009-06-03 Doug Kwan <dougkwan@google.com>
12938
12939 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12940 (utils::has_overflow): Same.
12941
dff16297
ILT
129422009-06-03 Ian Lance Taylor <iant@google.com>
12943
12944 * layout.cc (Layout::section_name_mapping): New array, replacing
12945 Layout::linkonce_mapping.
12946 (Layout::section_name_mapping_count): New variable, replacing
12947 Layout::linkonce_mapping_count.
12948 (Layout::linkonce_output_name): Remove.
12949 (Layout::output_section_name): Rewrite.
12950 * layout.h (class Layout): Rename Linkonce_mapping to
12951 Section_name_mapping, linkonce_mapping to section_name_mapping,
12952 linkonce_mapping_count to section_name_mapping_count. Don't
12953 declare linkonce_output_name.
12954
c121c671
DK
129552009-06-03 Doug Kwan <dougkwan@google.com>
12956
12957 * gold/arm.cc (namespace utils): New.
12958 (Target_arm::reloc_is_non_pic): Define new method.
12959 (class Arm_relocate_functions): New.
12960 (Target_arm::Relocate::relocate): Handle relocation types used by
12961 Android.
12962
07800fab
ILT
129632009-06-03 Ian Lance Taylor <iant@google.com>
12964
12965 * arm.cc (Target_arm::scan::global): Use || instead of |.
12966
c121c671
DK
129672009-06-02 Doug Kwan <dougkwan@google.com>
12968
12969 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12970 issued_non_pic_error_.
12971 (class Target_arm::Scan): Declare new method check_non_pic.
12972 Define new method symbol_needs_plt_entry.
12973 Declare new data member issued_non_pic_error_.
12974 (class Target_arm::Relocate): Declare new method
12975 should_apply_static_reloc.
12976 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12977 (Target_arm::Scan::check_non_pic): Define new method.
12978 (Target_arm::Scan::local): Handle a small subset of reloc types used
12979 by Android.
12980 (Target_arm::Scan::local): Same.
12981 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12982
b19b0c6d
ILT
129832009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12984
12985 * incremental.cc (Incremental_inputs::report_command_line): Filter
12986 out --incremental-* options.
12987
94cdfcff
DK
129882009-05-29 Doug Kwan <dougkwan@google.com>
12989
12990 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12991 template class.
12992 (class Target_arm): Update comment.
12993 (Target_arm::Target_arm): Initialize new data members GOT_,
12994 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12995 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12996 and Target_arm::rel_dyn_section.
12997 Declare new_enum Target_arm::Got_type.
12998 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12999 and DYNBSS_.
13000 Update commments for member do_dynsym_value.
13001 (Target_arm::got_size, Target_arm::plt_section,
13002 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13003 new methods inside class defintion.
13004 (Target_arm::got_section): Define new method.
13005 (Target_arm::rel_dyn_section): Same.
13006 (Output_data_plt_arm): New template class.
13007 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13008 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13009 (Output_data_plt_arm::add_entry): Same.
13010 (Output_data_plt_arm::first_plt_entry): Define new
13011 static data member for PLT instruction template.
13012 (Output_data_plt_arm::plt_entry): Same.
13013 (Output_data_plt_arm::do_write): Define new method.
13014 (Target_arm::make_plt_entry): Same.
13015 (Target_arm::do_finalize_sections): Same.
13016 (Target_arm::do_dynsym_value): Same.
13017
4a657b0d
DK
130182009-05-28 Doug Kwan <dougkwan@google.com>
13019
13020 * Makefile.am (TARGETSOURCES): Add arm.cc.
13021 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13022 * Makefile.in: Regenerate.
13023 * arm.cc: New file.
13024 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13025
e7ae8c36
DK
130262009-05-26 Doug Kwan <dougkwan@google.com>
13027
13028 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13029 (General_options::check_excluded_libs): Strip off directories in
13030 archive name before matching like GNU ld does.
13031 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13032 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13033 (exclude_libs_test_LDFLAGS): Add linker option
13034 -Wl,--exclude-libs,libexclude_libs_test_3
13035 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13036 an explicit archive without using -l.
13037 (alt/libexclude_libs_test_3.a): New make rule.
13038 * testsuite/Makefile.in: Regenerate.
13039 * testsuite/exclude_libs_test.c : Declare lib3_default().
13040 (main): Call it.
13041 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13042 * exclude_libs_test_3.c: New file.
13043
f12e7348
NC
130442009-05-26 Nick Clifton <nickc@redhat.com>
13045
13046 * po/id.po: New Indonesian translation.
13047 * po/gold.pot: Updated template file.
13048
4daadc0d
ST
130492009-05-22 Sriraman Tallam <tmsriram@google.com>
13050
e1df38aa 13051 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13052 gc_comdat_test files. Add -Wl,--gc-sections to build
13053 gc_comdat_test.
13054 * testsuite/Makefile.in: Regenerate.
13055 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13056
531813ad
ST
130572009-05-21 Sriraman Tallam <tmsriram@google.com>
13058
13059 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13060 kept comdat section was garbage collected.
13061 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13062 * testsuite/Makefile.in: Regenerate.
13063 * testsuite/gc_comdat_test.sh: New file.
13064 * testsuite/gc_comdat_test_1.cc: New file.
13065 * testsuite/gc_comdat_test_2.cc: New file.
13066
65514900
CC
130672009-05-19 Doug Kwan <dougkwan@google.com>
13068
13069 * archive.cc (Archive::Archive): Move constructor from archive.h
13070 to here. Initialize no_export_.
13071 (Archive::get_elf_object_for_member): Set no_export flag of object.
13072 * archive.h (Archive::Archive): Move constructor body to
13073 archive.cc.
13074 (Archive::no_export): New method.
13075 (Archive::no_export_): New field.
13076 * object.h (Object::Object): Initialize no_export_ to false.
13077 (Object::no_export, Object::set_no_export): New methods.
13078 (Object::no_export_): New field.
13079 * options.cc (General_options::parse_exclude_libs): New method.
13080 (General_options::check_excluded_libs) Same.
13081 * options.h (exclude_libs): New option.
13082 (General_options::check_excluded_libs): New method declaration.
13083 (General_options::excluded_libs_): New field.
13084 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13085 default or protected visibility if an object has no-export flag set.
13086 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13087 (check_SCRIPTS): Add exclude_libs_test.sh.
13088 (check_DATA): Add exclude_libs_test.syms.
13089 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13090 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13091 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13092 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13093 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13094 libexclude_libs_test_2.a): New rules.
13095 * testsuite/Makefile.in: Regenerate.
13096 * testsuite/exclude_libs_test.c: New file.
13097 * testsuite/exclude_libs_test.sh: Ditto.
13098 * testsuite/exclude_libs_test_1.c: Ditto.
13099 * testsuite/exclude_libs_test_2.c: Ditto.
13100
1b77ea50
ILT
131012009-05-15 Ian Lance Taylor <iant@google.com>
13102
13103 * configure.ac: Check for declarations for cases where libiberty.h
13104 checks HAVE_DECL_xxx.
13105 * configure, config.in: Rebuild.
13106
072fe7ce
ILT
131072009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13108
13109 * gold.h (Incremental_argument_list): Remove (invalid) forward
13110 declaration.
13111 * incremental.cc (Incremental_inputs::report_achive): New method.
13112 (Incremental_inputs::report_object): New method.
13113 (Incremental_inputs::report_script): New method.
13114 (Incremental_inputs::finalize_inputs): New method.
13115 (Incremental_inputs::finalize): Call finalize_inputs().
13116 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13117 Create inputs entries.
13118 * incremental.h (Incremental_input_type): New enum.
13119 (Incremental_inputs::Incremental_input): Initialize new fields.
13120 (Incremental_inputs::report_inputs): New method.
13121 (Incremental_inputs::report_achive): New method.
13122 (Incremental_inputs::report_object): New method.
13123 (Incremental_inputs::report_script): New method.
13124 (Incremental_inputs::finalize_inputs): New method.
13125 (Incremental_inputs::Input_info): New struct.
13126 (Incremental_inputs::Input_info_map): New typedef.
13127 (Incremental_inputs::lock_): New field.
13128 (Incremental_inputs::Inputs_): New field.
13129 (Incremental_inputs::Inputs_map): New field.
13130 * main.cc (main): Call Incremental_input::report_inputs.
13131 * options.h (Input_argument_list): Typedef moved from
13132 Input_arguments.
13133 (Input_file_group::Files): Remove, use ::Input_argument_list.
13134 (Input_file_group::Input_argument_list): Remove, use
13135 ::Input_argument_list.
13136 * plugin.cc (Plugin_manager::add_input_file): Add error in
13137 incremental build.
13138 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13139 functions.
13140 * script.cc (read_input_script): Call
13141 Incremental_input::report_script.
13142 * script.h (Script_info): New class.
13143
b0481b0b
ILT
131442009-04-27 Ian Lance Taylor <iant@google.com>
13145
13146 * x86_64.cc (do_adjust_output_section): Set entsize to
13147 plt_entry_size.
13148
b22a5a41 131492009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13150
13151 * output.cc (Output_file::close): After short writes, continue
13152 writing from the correct offset in the buffer being written.
13153
40fde488
CD
131542009-04-23 Chris Demetriou <cgd@google.com>
13155
13156 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13157 * configure: Regenerate.
13158 * config.in: Regenerate.
13159 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13160 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13161
3ce2c28e
ILT
131622009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13163
13164 * incremental.cc (Incremental_inputs_header_data): Renamed from
13165 Incremental_input_header_data.
13166 (Incremental_inputs_header_data::data_size): New field.
13167 (Incremental_inputs_header_data::put_input_file_count): Renamed
13168 from input_file_count.
13169 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13170 from command_line_offset.
13171 (Incremental_inputs_header_data::put_reserved): Renamed from
13172 put_reserved.
13173 (Incremental_inputs_entry_data): Renamed from
13174 Incremental_input_entry_data.
13175 (Incremental_inputs_entry_data::data_size): New field.
13176 (Incremental_inputs::report_command_line): New method.
13177 (Incremental_inputs::finalize): New method.
13178 (Incremental_inputs::create_incremental_inputs_data): New method.
13179 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13180 * incremental.h: New file.
13181 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13182 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13183 incremental builds.
703d02da 13184 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13185 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13186 (Layout::create_incremental_info_sections): New method.
13187 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13188 * main.cc (main): Notify Incremental_input of the command line.
13189
e55bde5e
ILT
131902009-04-01 Ian Lance Taylor <iant@google.com>
13191 Mikolaj Zalewski <mikolajz@google.com>
13192
13193 * gold.h (reserve_unordered_map): Define, three versions, one for
13194 each version of Unordered_map.
13195 * layout.cc (Layout::Layout): Remove options parameter. Add
13196 number_of_input_files parameter. Don't initialize options_.
13197 Initialize number_of_input_files_ and resized_signatures_. Move
13198 sections_are_attached_.
13199 (Layout::layout_group): Reserve space for group_signatures_.
13200 (Layout::find_or_add_kept_section): Change name parameter to be a
13201 reference. Resize signatures_ map when it gets large enough.
13202 (Layout::layout_eh_frame): Use parameters->options() instead of
13203 this->options_.
13204 (Layout::make_output_section): Likewise.
13205 (Layout::attach_allocated_section_to_segment): Likewise.
13206 (Layout::finalize, Layout::create_executable_stack): Likewise.
13207 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13208 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13209 * layout.h (class Layout): Update declarations. Remove options_
13210 field. Add number_of_input_files_ and resized_signatures_
13211 fields. Move sections_are_attached_ field.
13212 * main.cc (main): Pass number of input files to Layout
13213 constructor. Don't pass options.
13214
154b857c
ILT
132152009-03-30 Ian Lance Taylor <iant@google.com>
13216
13217 * ffsll.c (ffsll): Correct implementation.
13218
2f35ab9b
ILT
132192009-03-27 Ian Lance Taylor <iant@google.com>
13220
fd03461a
ILT
13221 * ffsll.c: New file.
13222 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13223 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13224 * ftruncate.c (ftruncate): Declare before definition.
13225 * mremap.c (mremap): Likewise.
13226 * pread.c (pread): Likewise.
13227 * configure, Makefile.in, config.in: Rebuild.
13228
2f35ab9b
ILT
13229 * mremap.c: New file.
13230 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13231 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13232 (mremap): Declare if HAVE_MREMAP is not defined.
13233 * configure, Makefile.in, config.in: Rebuild.
13234
33aea2fd
CC
132352009-03-27 Cary Coutant <ccoutant@google.com>
13236
13237 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13238 position independent.
13239 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13240 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13241
6d479619
CC
132422009-03-24 Cary Coutant <ccoutant@google.com>
13243
13244 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13245 an executable.
13246 (needs_dynamic_reloc): Likewise.
13247
afc06bb8
ILT
132482009-03-24 Ian Lance Taylor <iant@google.com>
13249
13250 * yyscript.y (file_cmd): Recognize EXTERN.
13251 (extern_name_list, extern_name_list_body): New nonterminals.
13252 * script.cc (script_add_extern): Define.
13253 * script-c.h (script_add_extern): Declare.
13254
f6060a4d
ILT
132552009-03-24 Rafael Avila de Espindola <espindola@google.com>
13256
13257 * object.cc (is_elf_object): Define.
13258 * object.h (is_elf_object): Declare.
13259 * archive.cc (Archive::get_elf_object_for_member): Call
13260 is_elf_object.
33aea2fd 13261 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13262
26736d8e
ILT
132632009-03-24 Elliott Hughes <enh@google.com>
13264
13265 * output.cc (Output_file::map_anonymous): Define.
13266 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13267 try an anonymous one. Report the size if the mmap fails.
13268 * output.h (class Output_file): Declare map_anonymous.
13269
22fd9730
ILT
132702009-03-24 Ian Lance Taylor <iant@google.com>
13271
13272 * target-select.cc (instantiate_target): Don't acquire the lock if
13273 the instantiated_target_ field has already been set.
13274
cb010894
ILT
132752009-03-23 Ian Lance Taylor <iant@google.com>
13276
7f055c20
ILT
13277 * gold-threads.h (class Initialize_lock): Define.
13278 * gold-threads.cc (class Initialize_lock_once): Define.
13279 (initialize_lock_control): New static variable.
13280 (initialize_lock_pointer): New static variable.
13281 (initialize_lock_once): New static function.
13282 (Initialize_lock::Initialize_lock): Define.
13283 (Initialize_lock::initialize): Define.
13284 * target-select.h: Include "gold-threads.h".
13285 (class Target_selector): Add lock_ and initialize_lock_ fields.
13286 Don't define instantiate_target, just declare it.
13287 * target-select.cc (Target_selector::Target_selector): Initialize
13288 new fields.
13289 (Target_selector::instantiate_target): Define.
13290 * descriptors.h: Include "gold-threads.h".
13291 (class Descriptors): Add initialize_lock_ field.
13292 * descriptors.cc (Descriptors::Descriptors): Initialize new
13293 field.
13294 (Descriptors::open): Use initialize_lock_ field
13295 * errors.h (class Errors): Add initialize_lock_ field.
13296 * errors.cc (Errors::Errors): Initialize new field.
13297 (Errors::initialize_lock): Use initialize_lock_ field.
13298 * powerpc.cc (class Target_selector_powerpc): Remove
13299 instantiated_target_ field. In do_recognize call
13300 instantiate_target rather than do_instantiate_target. In
13301 do_instantiate_target just allocate a new target.
13302 * sparc.cc (class Target_selector_sparc): Likewise.
13303
36959681
ILT
13304 * freebsd.h: New file.
13305 * i386.cc: Include "freebsd.h".
13306 (Target_i386): Derive from Target_freebsd rather than
13307 Sized_target.
13308 (Target_selector_i386): Derive from Target_selector_freebsd rather
13309 than Target_selector.
13310 * x86_64.cc: Include "freebsd.h".
13311 (Target_x86_64): Derive from Target_freebsd rather than
13312 Sized_target.
13313 (Target_selector_x86_64): Derive from Target_selector_freebsd
13314 rather than Target_selector.
13315 * target.h (class Target): Add adjust_elf_header and
13316 do_adjust_elf_header.
13317 * output.cc (Output_file_header:: do_sized_write): Call target
13318 adjust_elf_header routine.
13319 * configure.tgt: Set targ_osabi.
13320 * configure.ac: Define GOLD_DEFAULT_OSABI.
13321 * parameters.cc (Parameters::default_target): Pass
13322 GOLD_DEFAULT_OSABI to select_target.
13323 * target-select.h (class Target_selector): Make instantiate_target
13324 protected rather than private.
13325 * Makefile.am (HFILES): Add freebsd.h.
13326 * configure, Makefile.in, config.in: Rebuild.
13327
cb010894
ILT
13328 * merge.cc (do_add_input_section): Correct pend value. Change
13329 message about last entry not being null terminated from error to
13330 warning.
13331
0e879927
ILT
133322009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13333
13334 * incremental.cc: New file.
13335 * Makefile.am (CCFILES): Add incremental.cc.
13336 * Makefile.in: Rebuild.
13337
41105937
PP
133382009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13339
13340 * layout.cc (Layout::output_section_name): Preserve names
13341 of '.note.' sections.
e1df38aa 13342
60439920
ILT
133432009-03-19 Ian Lance Taylor <iant@google.com>
13344
13345 * descriptors.cc (Descriptors::open): Check that the options are
13346 valid before using them.
13347
0d371ad3
ILT
133482009-03-18 Ian Lance Taylor <iant@google.com>
13349
13350 * script-sections.h: Include <list>.
13351 (class Script_sections): Change Sections_elements from std::vector
13352 to std::list. Typedef public Elements_iterator. Add
13353 orphan_section_placement_, data_segment_align_start_, and
13354 saw_data_segment_align_ fields. Remove data_segment_align_index_
13355 field.
13356 * script-sections.cc (class Orphan_section_placement): New class.
13357 (class Sections_element): Add virtual functions is_relro and
13358 orphan_section_init. Remove virtual function place_orphan_here.
13359 (class Output_section_definition): Add is_relro and
13360 orphan_section_init. Remove place_orphan_here.
13361 (class Orphan_output_section): Likewise.
13362 (Script_sections::Script_sections): Update for field changes.
13363 (Script_sections::data_segment_align): Set saw_data_segment_align_
13364 and data_segment_align_start_, not data_segment_align_index.
13365 (Script_sections::data_segment_relro_end): Check
13366 saw_data_segment_align_. Use data_segment_align_start_ rather
13367 than data_segment_align_index_.
13368 (Script_sections::place_orphan): Rewrite to use
13369 Orphan_section_placement.
13370
9201d894
ILT
133712009-03-17 Ian Lance Taylor <iant@google.com>
13372
9c5b8369
ILT
13373 * archive.cc (Archive::add_symbols): Check for a version attached
13374 to the symbol name in the archive map.
13375 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13376 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13377 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13378 (ver_test_11.a): New target.
13379 * testsuite/Makefile.in: Rebuild.
13380
9201d894
ILT
13381 * configure.ac: Check for chsize and posix_fallocate. Replace
13382 ftruncate.
13383 * ftruncate.c: New file, from gnulib.
13384 * output.cc (posix_fallocate): Define dummy version if not
13385 HAVE_POSIX_FALLOCATE.
13386 (Output_file::map): Call posix_fallocate rather than lseek and
13387 write.
13388 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13389 * configure, Makefile.in, config.in: Rebuild.
13390
ef4ab7a8 133912009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13392
ef4ab7a8
PP
13393 * layout.h (Layout::create_note): Add section_name parameter.
13394 * layout.cc (Layout::create_note): Likewise.
13395 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13396
8c500701
ILT
133972009-03-17 Ian Lance Taylor <iant@google.com>
13398
e85b18e1
ILT
13399 * descriptors.cc: Include "options.h".
13400 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13401 (Descriptors::open): Always use O_CLOEXEC when opening a new
13402 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13403 then set FD_CLOEXEC.
13404
9efe6174
ILT
13405 * sparc.cc (class Target_sparc): Add has_got_section.
13406 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13407 make sure we have a GOT section.
13408
13409 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13410 (Target_sparc::Scan::local): Likewise.
13411 (Target_sparc::Scan::global): Likewise.
13412 (Target_sparc::Relocate::relocate): Likewise.
13413 (Target_sparc::Relocate::relocate_tls): Likewise.
13414
8c500701
ILT
13415 * symtab.cc (Symbol_table::define_default_version): New function,
13416 broken out of add_from_object.
13417 (Symbol_table::add_from_object): Call define_default_version.
13418 (Symbol_table::define_special_symbol): Add resolve_oldsym
13419 parameter. Change all callers. If the version for a symbol comes
13420 from a version script, resolve it with the symbol with the same
13421 name with no version. Also add the symbol without a version if
13422 appropriate.
13423 (do_define_in_output_data): If resolving with oldsym, don't delete
13424 sym.
13425 (do_define_in_output_segment): Likewise.
13426 (do_define_as_constant): Likewise.
13427 * symtab.h (class Symbol_table): Update declarations.
13428
f1ed28fb
ILT
134292009-03-13 Ian Lance Taylor <iant@google.com>
13430
15f8229b
ILT
13431 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13432 (Read_symbols::requeue): New function.
13433 (Read_symbols::do_read_symbols): If make_elf_object fails because
13434 the target type is not configured, and the file was searched for,
13435 issue a warning and retry with the next directory.
13436 (Add_symbols::run): If the file has an incompatible format, and
13437 it was searched for, requeue the Read_symbols task. On error,
13438 release the object.
13439 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13440 dirindex parameter to constructor. Change all callers. Declare
13441 incompatible_warning and requeue.
13442 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13443 input_argument_ and input_group_ fields. Add them to
13444 constructor. Change all callers.
13445 (class Read_script): Add dirindex_ field. Add it to constructor.
13446 Change all callers.
13447 * archive.cc (Archive::setup): Remove input_objects parameter.
13448 Change all callers.
13449 (Archive::get_file_and_offset): Likewise.
13450 (Archive::read_all_symbols): Likewise.
13451 (Archive::read_symbols): Likewise.
13452 (Archive::get_elf_object_for_member): Remove input_objects
13453 parameter. Add punconfigured parameter. Change all callers.
13454 (Archive::add_symbols): Change return type to bool. Check return
13455 value of include_member.
13456 (Archive::include_all_members): Likewise.
13457 (Archive::include_member): Change return type to bool. Return
13458 false if first included object has incompatible target. Set
13459 included_member_ field.
13460 (Add_archive_symbols::run): If add_symbols returns false, requeue
13461 Read_symbols task.
13462 * archive.h (class Archive): Add included_member_ field.
13463 Initialize it in constructor. Add input_file and searched_for
13464 methods. Update declarations.
13465 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13466 input_argument_ fields. Add them to constructor. Change all
13467 callers.
13468 * script.cc: Include "target-select.h".
13469 (class Parser_closure): Add skip_on_incompatible_target_ and
13470 found_incompatible_target_ fields. Add
13471 skip_on_incompatible_target parameter to constructor. Change all
13472 callers. Add methods skip_on_incompatible_target,
13473 clear_skip_on_incompatible_target, found_incompatible_target, and
13474 set_found_incompatible_target.
13475 (read_input_script): Add dirindex parameter. Change all callers.
13476 If parser finds an incompatible target, requeue Read_symbols
13477 task.
13478 (script_set_symbol): Clear skip_on_incompatible_target in
13479 closure.
13480 (script_add_assertion, script_parse_option): Likewise.
13481 (script_start_sections, script_add_phdr): Likewise.
13482 (script_check_output_format): New function.
13483 * script.h (read_input_script): Update declaration.
13484 * script-c.h (script_check_output_format): Declare.
13485 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13486 (ignore_cmd): Remove OUTPUT_FORMAT.
13487 * fileread.cc (Input_file::Input_file): Add explicit this.
13488 (Input_file::will_search_for): New function.
13489 (Input_file::open): Add pindex parameter. Change all callers.
13490 * fileread.h (class Input_file): Add input_file_argument method.
13491 Declare will_search_for. Update declarations.
13492 * object.cc (make_elf_object): Add punconfigured parameter.
13493 Change all callers.
13494 * object.h (class Object): Make input_file public. Add
13495 searched_for method.
13496 (make_elf_object): Update declaration.
13497 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13498 restart search.
13499 * dirsearch.h (class Dirsearch): Update declaration.
13500 * options.h (class General_options): Add --warn-search-mismatch.
13501 * parameters.cc (Parameters::is_compatible_target): New function.
13502 * parameters.h (class Parameters): Declare is_compatible_target.
13503 * workqueue.cc (Workqueue::add_blocker): New function.
13504 * workqueue.h (class Workqueue): Declare add_blocker.
13505
f1ed28fb
ILT
13506 * fileread.cc (Input_file::open): Remove options parameter.
13507 Change all callers.
13508 (Input_file::open_binary): Likewise.
13509 * script.cc (read_input_script): Likewise.
13510 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13511 options parameter from constructor. Change all callers.
13512 (class Read_script): Likewise.
13513 * fileread.h (class Input_file): Update declarations.
13514 * script.h (read_input_script): Update declaration.
13515
34dd024a
NC
135162009-03-10 Nick Clifton <nickc@redhat.com>
13517
13518 * po/es.po: New Spanish translation.
13519
6d71b17c
CC
135202009-03-06 Cary Coutant <ccoutant@google.com>
13521
13522 * options.cc (parse_short_option): Keep dash_z from registering itself.
13523
031cdbed
ILT
135242009-03-03 Ian Lance Taylor <iant@google.com>
13525
13526 PR 9918
13527 * target-reloc.h (relocate_section): Pass output_section to
13528 relocate.
13529 * i386.cc (Target_i386::should_apply_static_reloc): Add
13530 output_section parameter. Change all callers.
13531 (Target_i386::Relocate::relocate): Add output_section parameter.
13532 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13533 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13534 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13535 * testsuite/two_file_shared.sh: New script.
13536 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13537 (check_DATA): Add two_file_shared.dbg.
13538 (two_file_shared.dbg): New target.
13539 * testsuite/Makefile.in: Rebuild.
13540
15d5fa16
ILT
135412009-03-01 Ian Lance Taylor <iant@google.com>
13542
13543 * configure.ac: Check for byteswap.h.
13544 * configure: Rebuild.
13545 * config.in: Rebuild.
13546
8a4c0b0d
ILT
135472009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13548
13549 * layout.cc (Layout::find_or_add_kept_section): New function.
13550 (Layout::add_comdat): Removed.
13551 * layout.h (struct Kept_section): Move out of class Layout.
13552 Remove trailing underscores from field names. Add group_sections
13553 field. Rename group_ field to is_group. Change all uses.
13554 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13555 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13556 comdat_groups_ field.
13557 (Sized_relobj::include_section_group): Use
13558 find_or_add_kept_section and Kept_section::group_sections.
13559 (Sized_relobj::include_linkonce_section): Likewise.
13560 * object.cc (class Sized_relobj): Don't define Comdat_group or
13561 Comdat_group_table. Remove find_comdat_group and
13562 add_comdat_group. Remove comdat_groups_ field.
13563 * plugin.cc (include_comdat_group): Use
13564 Layout::find_or_add_kept_section.
13565
b4ecf66b
ILT
135662009-02-28 Ian Lance Taylor <iant@google.com>
13567
14359ca0
ILT
13568 * README: --gc-sections and map files are now supported. Document
13569 some build requirements.
13570
b4ecf66b
ILT
13571 PR 6992
13572 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13573 relocatable link set the value of the section symbol to zero.
13574 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13575 relocatable link don't include the section address in the local
13576 symbol value.
13577
0602e05a
ILT
135782009-02-27 Ian Lance Taylor <iant@google.com>
13579
fd9d194f
ILT
13580 PR 6811
13581 * options.h (class Search_directory): Add is_system_directory.
13582 (class General_options): Declare is_in_system_directory.
13583 * options.cc (get_relative_sysroot): Make static.
13584 (get_default_sysroot): Make static.
13585 (General_optoins::is_in_system_directory): New function.
13586 * fileread.cc (Input_file::is_in_system_directory): New function.
13587 * fileread.h (class Input_file): Declare is_in_system_directory.
13588 * object.h (class Object): Add is_in_system_directory.
13589 (class Input_objects): Remove system_library_directory_ field.
13590 * object.cc (Input_objects::add_object): Don't set
13591 system_library_directory_.
13592 (input_objects::found_in_system_library_directory): Remove.
13593 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13594 parameter. Change all callers.
13595 (Symbol_table::sized_write_globals): Likewise.
13596 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13597 Call Object::is_in_system_directory.
13598 * symtab.h (class Symbol_table): Update declarations.
13599
61edd21f
ILT
13600 PR 5990
13601 * descriptors.h (Open_descriptor): Add is_on_stack field.
13602 * descriptors.cc (Descriptors::open): If the descriptor is on the
13603 top of the stack, remove it. Initialize is_on_stack field.
13604 (Descriptors::release): Only add pod to stack if it is not on the
13605 stack already.
13606 (Descriptors::close_some_descriptor): Clear stack_next and
13607 is_on_stack fields.
13608
e29e076a
ILT
13609 PR 7091
13610 * output.cc (Output_section::find_starting_output_address): Rename
13611 from starting_output_address; add PADDR parameter; change return
13612 type.
13613 * output.h (class Output_section): Declare
13614 find_starting_output_address instead of starting_output_address.
13615 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13616 section symbol for which we can't find a merge section.
13617
0602e05a
ILT
13618 PR 9836
13619 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13620 hidden or internal, force the symbol to be local.
13621 * resolve.cc (Symbol::override_visibility): Define.
13622 (Symbol::override_base): Use override_visibility.
13623 (Symbol_table::resolve): Likewise.
13624 (Symbol::override_base_with_special): Likewise.
13625 (Symbol_table::override_with_special): If the visibility is hidden
13626 or internal, force the symbol to be local.
13627 * symtab.h (class Symbol): Add set_visibility and
13628 override_visibility.
13629 * testsuite/ver_test_1.sh: New file.
13630 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13631 (check_DATA): Add ver_test_1.syms.
13632 (ver_test_1.syms): New target.
13633 * testsuite/Makefile.in: Rebuild.
13634
401a9a73
CC
136352009-02-25 Cary Coutant <ccoutant@google.com>
13636
13637 * layout.cc (Layout::choose_output_section): Don't rename sections
13638 when using a linker script that has a SECTIONS clause.
13639 * Makefile.in: Regenerate.
13640
13641 * testsuite/Makefile.am (script_test_5.sh): New test case.
13642 * testsuite/Makefile.in: Regenerate.
13643 * testsuite/script_test_5.cc: New file.
13644 * testsuite/script_test_5.sh: New file.
13645 * testsuite/script_test_5.t: New file.
13646
f488e4b0
CC
136472009-02-13 Rafael Avila de Espindola <espindola@google.com>
13648
13649 * archive.cc (Archive::include_member): Update calls to add_symbols.
13650 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13651 the Layout argument.
13652 * dynobj.h (do_add_symbols): Add the Layout argument.
13653 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13654 Layout argument.
13655 * object.h (Object::add_symbols): Add the Layout argument.
13656 (Object::do_add_symbols): Add the Layout argument.
13657 (Sized_relobj::do_add_symbols): Add the Layout argument.
13658 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13659 Unify the two versions.
13660 (Add_plugin_symbols): Remove.
13661 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13662 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13663 (Add_plugin_symbols): Remove.
13664 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13665 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13666 (Add_symbols::run): Make it work with Pulginobj.
13667
89dd1680
ILT
136682009-02-06 Ian Lance Taylor <iant@google.com>
13669
13670 * object.cc (Sized_relobj::do_layout): Make info message start
13671 with lower case letter.
13672
266d0a74
ILT
136732009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13674
602b464e
ILT
13675 * binary.cc: Fix file comment.
13676
266d0a74
ILT
13677 * options.h (enum Incremental_disposition): Define.
13678 (class General_options): Add new options: --incremental,
13679 --incremental_changed, --incremental_unchanged,
13680 --incremental_unknown. Add incremental_disposition_ and
13681 implicit_incremental_ fields.
13682 (General_options::incremental_disposition): New function.
13683 (class Position_dependent_options): Add incremental_disposition
13684 option.
13685 (Position_dependent_options::copy_from_options): Set incremental
13686 dispositions.
13687 * options.cc (General_options::parse_incremental_changed): New
13688 function.
2e702c99
RM
13689 (General_options::parse_incremental_unchanged): New function.
13690 (General_options::parse_incremental_unknown): New function.
13691 (General_options::General_options): Initialize new fields
266d0a74 13692 incremental_disposition_ and implicit_incremental_.
2e702c99 13693 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13694 without --incremental.
13695
f073bbf7
CD
136962009-02-06 Chris Demetriou <cgd@google.com>
13697
13698 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13699 pointer and to report location as the file name associated with
13700 the symbol.
13701 (gold_undefined_symbol_at_location): New function to replace the
13702 old gold_undefined_symbol functionality.
13703 * target-reloc.h (relocate_section): Update to use
13704 gold_undefined_symbol_at_location.
13705 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13706 Call gold_undefined_symbol function rather than gold_error.
13707 * errors.h (Errors::undefined_symbol): Take location as a
13708 string, rather than calculating it from a relocation.
13709 * errors.cc (Errors::fatal): Print "fatal error:" before the
13710 formatted message.
13711 (Errors::error, Errors::error_at_location): Print "error: "
13712 before the formatted message.
13713 (Errors::undefined_symbol): Take location as a string, rather
13714 than calculating it from a relocation.
13715 (gold_undefined_symbol_at_location): New function akin to
13716 old gold_undefined_symbol, calculates location from relocation.
13717 (gold_undefined_symbol): Change to take only a Symbol pointer
13718 and to report location as the file name associated with the symbol.
13719 * testsuite/debug_msg.sh: Update for changed error messages.
13720 * testsuite/undef_symbol.sh: Likewise.
13721
8e94a90c
ILT
137222009-02-04 Duncan Sands <baldrick@free.fr>
13723
13724 PR 9812
13725 * reduced_debug_output.h
13726 (Output_reduced_debug_abbrev_section::failed): Use format for
13727 gold_warning.
13728 (Output_reduced_debug_info_section::faild): Likewise.
13729
88a0e15b
ILT
137302009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13731
13732 * script.cc (Lazy_demangler): New class.
2e702c99 13733 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13734 symbol only once.
13735
5efc7cd2
CC
137362009-01-29 Cary Coutant <ccoutant@google.com>
13737
13738 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13739 to __tls_get_addr.
13740 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13741
e0ebcf42
ILT
137422009-01-28 Ian Lance Taylor <iant@google.com>
13743
5efc7cd2 13744 * version.cc (version_string): Bump to 1.9.
75fe7426 13745
e0ebcf42
ILT
13746 * gold.h: Include <cstring> and <stdint.h>.
13747 * version.cc: Include <cstdio>.
13748 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13749 warning.
13750 * reduced_debug_output.cc (insert_into_vector): Rename from
13751 Insert_into_vector; change all callers. Use Swap_unaligned to
13752 avoid aliasing issue; remove union since it is unnecessary.
13753
8e2813be 137542009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13755
13756 * Makefile.am (CCFILES): Add gc.cc.
13757 (HFILES): Add gc.h.
13758 * Makefile.in: Regenerate.
13759 * gold.cc (Gc_runner): New class.
13760 (queue_initial_tasks): Call garbage collection related tasks
13761 when corresponding options are invoked.
13762 (queue_middle_gc_tasks): New function.
13763 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13764 processed early before laying out sections during garbage collection.
13765 * gold.h (queue_middle_gc_tasks): New function.
13766 (is_prefix_of): Move from "layout.cc".
13767 * i386.cc (Target_i386::gc_process_relocs): New function.
13768 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13769 * main.cc (main): Create object of class "Garbage_collection".
13770 * object.cc (Relobj::copy_symbols_data): New function.
13771 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13772 (Sized_relobj::do_layout): Allow this function to be called twice
13773 during garbage collection and defer layout of section during the
6d03d481
ST
13774 first call.
13775 * object.h (Relobj::get_symbols_data): New function.
13776 (Relobj::is_section_name_included): New function.
13777 (Relobj::copy_symbols_data): New function.
13778 (Relobj::set_symbols_data): New function.
13779 (Relobj::get_relocs_data): New function.
13780 (Relobj::set_relocs_data): New function.
13781 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13782 (Relobj::gc_process_relocs): New function.
13783 (Relobj::do_gc_process_relocs): New pure virtual function.
13784 (Relobj::sd_): New data member.
13785 (Sized_relobj::is_output_section_offset_invalid): New function.
13786 (Sized_relobj::do_gc_process_relocs): New function.
13787 * options.h (General_options::gc_sections): Modify to not be a no-op.
13788 (General_options::print_gc_sections): New option.
13789 * plugin.cc (Plugin_finish::run): Remove function call to
13790 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13791 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13792 * reloc.cc (Read_relocs::run): Add task to process relocs and
13793 determine unreferenced sections when doing garbage collection.
13794 (Gc_process_relocs): New class.
13795 (Sized_relobj::do_gc_process_relocs): New function.
13796 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13797 sections that are garbage collected.
13798 * reloc.h (Gc_process_relocs): New class.
13799 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13800 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13801 symbols whose corresponding sections are garbage collected.
13802 (Symbol_table::Symbol_table): Add new parameter for the garbage
13803 collection object.
13804 (Symbol_table::gc_mark_undef_symbols): New function.
13805 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13806 (Symbol_table::gc_mark_dyn_syms): New function.
13807 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13808 as garbage.
13809 (Symbol_table::add_from_object): Likewise.
13810 (Symbol_table::add_from_relobj): When building shared objects, do not
13811 treat externally visible symbols as garbage.
13812 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13813 table information for static and relocatable links.
13814 * symtab.h (Symbol_table::set_gc): New function.
13815 (Symbol_table::gc): New function.
13816 (Symbol_table::gc_mark_undef_symbols): New function.
13817 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13818 (Symbol_table::gc_mark_dyn_syms): New function.
13819 (Symbol_table::gc_): New data member.
e1df38aa 13820 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13821 function.
13822 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13823 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13824
3b293544
CF
138252009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13826
13827 * options.h (General_options::gc_sections): Define as a no-op for now.
13828 (General_options::no_keep_memory): Ditto.
13829 (General_options::Bshareable): Define.
13830 * options.cc (General_options::finalize): Honor -Bshareable.
13831
83d22aa8
AS
138322009-01-20 Andreas Schwab <schwab@suse.de>
13833
13834 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13835 read the value in the contents, since we don't use it. Use the
13836 template endianness when writing.
13837 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13838
cd536b21
AS
138392009-01-19 Andreas Schwab <schwab@suse.de>
13840
13841 * configure.tgt (powerpc64-*): Fix targ_obj.
13842
99e9a495
ILT
138432009-01-15 Ian Lance Taylor <iant@google.com>
13844
13845 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13846 local symbols when stripping all symbols.
13847
bbbfea06
CC
138482009-01-14 Cary Coutant <ccoutant@google.com>
13849
99e9a495 13850 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13851
0f7c0701
CC
138522009-01-14 Cary Coutant <ccoutant@google.com>
13853
13854 * archive.cc (Archive::get_elf_object_for_member): Remove call
13855 to File_read::claim_for_plugin.
13856 * descriptors.cc (Descriptors::open): Remove reference to
13857 is_claimed.
13858 (Descriptors::claim_for_plugin): Remove.
13859 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13860 (Descriptors::is_claimed): Remove.
13861 (claim_descriptor_for_plugin): Remove.
13862 * fileread.cc (File_read::claim_for_plugin): Remove.
13863 * fileread.h (File_read::claim_for_plugin): Remove.
13864 (File_read::descriptor): Reopen descriptor if necessary.
13865 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13866 (Plugin_manager::all_symbols_read): Add task parameter. Change
13867 all callers.
13868 (Plugin_manager::get_input_file): New function.
13869 (Plugin_manager::release_input_file): New function.
13870 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13871 corresponding data member.
13872 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13873 and pass to base constructor. Change all callers.
13874 (get_input_file, release_input_file): New functions.
13875 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13876 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13877 (Plugin_manager::all_symbols_read): Add task parameter.
13878 (Plugin_manager::get_input_file): New function.
13879 (Plugin_manager::release_input_file): New function.
13880 (Plugin_manager::task_): New data member.
13881 (Pluginobj::Pluginobj): Add filesize parameter.
13882 (Pluginobj::filename): New function.
13883 (Pluginobj::descriptor): New function.
13884 (Pluginobj::filesize): New function.
13885 (Pluginobj::filesize_): New data member.
13886 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13887 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13888 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13889
13890 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13891 with archive libraries.
13892 * testsuite/Makefile.in: Regenerate.
13893 * testsuite/plugin_test.c (struct sym_info): New type.
13894 (get_input_file, release_input_file): New static variables.
13895 (onload): Capture new transfer vector entries.
13896 (claim_file_hook): Stop reading at end of file according to filesize.
13897 Factor out parsing of readelf output into separate function.
13898 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13899 APIs and get the source file name from the symbol table. Convert
13900 source file name to corresponding object file name. Print info
13901 message when adding new input files.
13902 (parse_readelf_line): New function.
13903 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13904 * testsuite/plugin_test_2.sh: Likewise.
13905 * testsuite/plugin_test_3.sh: Likewise.
13906 * testsuite/plugin_test_4.sh: New test case.
13907
62a6d109
ILT
139082009-01-07 Ian Lance Taylor <iant@google.com>
13909
13910 * version.cc (version_string): Bump to 1.8.
13911
483620e8
CC
139122008-12-23 Cary Coutant <ccoutant@google.com>
13913
13914 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13915 * plugin.cc (Plugin_manager::finish): Rename as
13916 layout_deferred_objects. Move cleanup to separate function.
13917 (Plugin_manager::cleanup): New function.
13918 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13919 separately.
13920 * plugin.h (Plugin_manager::finish): Rename as
13921 layout_deferred_objects.
13922 (Plugin_manager::cleanup): New function.
13923 (Plugin_manager::cleanup_done): New field.
13924
d66a9eb3
CC
139252008-12-23 Cary Coutant <ccoutant@google.com>
13926
13927 * plugin.cc (is_visible_from_outside): New function.
13928 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13929 so we don't return "IR only" status for exported symbols or -r links.
13930
13931 * testsuite/Makefile.am (plugin_test_3): New test case.
13932 * testsuite/Makefile.in: Regenerate.
13933 * testsuite/plugin_test_3.sh: New file.
13934
5995b570
CC
139352008-12-22 Cary Coutant <ccoutant@google.com>
13936
13937 * object.cc (Sized_relobj::layout_section): New function.
13938 (Sized_relobj::do_layout): Defer layout of input sections until after
13939 plugin has provided replacement files.
13940 (Sized_relobj::do_layout_deferred_sections): New function.
13941 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13942 (Relobj::layout_deferred_sections): New function.
13943 (Relobj::do_layout_deferred_sections): New function.
13944 (Sized_relobj::do_layout_deferred_sections): New function.
13945 (Sized_relobj::layout_section): New function.
13946 (Sized_relobj::Deferred_layout): New structure.
13947 (Sized_relobj::deferred_layout_): New field.
13948 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13949 Change all callers. Layout deferred sections.
13950 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13951 references.
13952 (Plugin_hook::run): Move code from do_plugin_hook inline.
13953 (Plugin_hook::do_plugin_hook): Remove.
13954 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13955 (Plugin_manager::finish): Renamed, was cleanup.
13956 (Plugin_manager::should_defer_layout): New function.
13957 (Plugin_manager::add_deferred_layout_object): New function.
13958 (Plugin_manager::Deferred_layout_list): New type.
13959 (Plugin_manager::deferred_layout_objects_): New field.
13960 (Plugin_hook::do_plugin_hook): Remove.
13961
ee769c88
ILT
139622008-12-17 Ian Lance Taylor <iant@google.com>
13963
13964 * options.h (class General_options): Add --no case for
13965 --export-dynamic.
13966
abc8dcba
CC
139672008-12-16 Cary Coutant <ccoutant@google.com>
13968
13969 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13970 vector.
13971 (Plugin_manager::claim_file): Create plugin object even if
13972 plugin did not call the add_symbols callback.
13973 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13974 asking for more symbols than were added.
13975 * testsuite/Makefile.am (plugin_test_1): Add test case with
13976 no global symbols.
13977 (empty.syms): New target.
13978 * testsuite/Makefile.in: Regenerate.
13979 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13980 message. Don't call add_symbols if no globals.
13981 (all_symbols_read_hook): Don't provide replacement for empty
13982 claimed file.
13983
b0074644
ILT
139842008-12-12 Ian Lance Taylor <iant@google.com>
13985
68943102
ILT
13986 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13987 r_type == 0 for a local symbol with r_sym == 0.
13988 (scan_relocatable_relocs): Pass r_sym to
13989 local_non_section_strategy.
13990 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13991 r_sym parameter.
13992
b0074644
ILT
13993 * configure.ac: Update test for TLS descriptors: they are
13994 supported as of glibc 2.9.
13995 * configure: Rebuild.
13996
c2508178
ILT
139972008-12-11 Ian Lance Taylor <iant@google.com>
13998
13999 PR 7091
14000 * target-reloc.h (Default_scan_relocatable_relocs): For each
14001 function, map r_type == 0 to RELOC_DISCARD.
14002
2756a258
CC
140032008-12-10 Cary Coutant <ccoutant@google.com>
14004
14005 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14006 object to override a kept COMDAT group from a plugin object.
14007
bb6f53d3
ILT
140082008-12-09 Ian Lance Taylor <iant@google.com>
14009
fbc558e1
ILT
14010 PR 7088
14011 * yyscript.y (file_cmd): Handle INPUT.
14012
bb6f53d3
ILT
14013 * testsuite/initpri1.c: Change all declarations to be full
14014 prototypes by adding void, to avoid compiler warnings.
14015
4674ecfc
CC
140162008-12-05 Rafael Avila de Espindola <espindola@google.com>
14017
14018 * options.cc (General_options::parse_plugin_opt): New.
14019 (General_options::add_plugin): The argument now is just the filename.
14020 (General_options::add_plugin_option): New.
14021 * options.h (plugin_opt): New.
14022 (add_plugin): Change argument name.
14023 (add_plugin_option): New.
14024 * plugin.cc (Plugin::load): Don't parse the plugin option.
14025 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14026 (Plugin::add_option): New.
14027 (Plugin::args_): Change type.
14028 (Plugin::filename_): New.
14029 (Plugin_manager::add_plugin_option): New.
14030 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14031 * testsuite/Makefile.in: Regenerate.
14032
fd06b4aa
CC
140332008-12-05 Cary Coutant <ccoutant@google.com>
14034
14035 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14036 Handle --strip-lto-sections option.
14037 * options.h (strip_lto_sections): New option.
14038
6c52134c
CC
140392008-12-01 Cary Coutant <ccoutant@google.com>
14040
14041 * plugin.cc (ld_plugin_message): Change format parameter to const.
14042 Fix mismatch between new[] and delete.
14043
a45248e0
CC
140442008-11-14 Cary Coutant <ccoutant@google.com>
14045
14046 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14047 instead of -1U.
14048
c82fbeee
CS
140492008-11-05 Craig Silverstein <csilvers@google.com>
14050
14051 * options.cc (General_options::parse_dynamic_list): New function.
14052 * options.h (General_options): New flags dynamic_list,
14053 dynamic_list_data, dynamic_list_cpp_new, and
14054 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14055 (General_options::in_dynamic_list): New function.
14056 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14057 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14058 (Lex::can_continue_name): Likewise.
14059 (yylex): Likewise.
14060 (read_script_file): New parameter script_options.
14061 (read_dynamic_list): New function.
14062 (Script_options::define_dynamic_list): New function.
14063 (dynamic_list_keyword_parsecodes): New variable.
14064 (dynamic_list_keywords): New variable.
14065 * script.h (Script_options::define_dynamic_list): New function
14066 prototype.
14067 (read_dynamic_list): New function prototype.
14068 * symtab.cc (strprefix): New macro.
14069 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14070 dynamic_list_data, dynamic_list_cpp_new, and
14071 dynamic_list_cpp_typeinfo.
14072 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14073 (dynamic_list_expr): New rule.
14074 (dynamic_list_nodes): Likewise.
14075 (dynamic_list_node): Likewise.
14076 * testsuite/Makefile.am (dynamic_list): New test.
14077 * testsuite/Makefile.in: Regenerated.
14078 * testsuite/dynamic_list.t: New file.
14079 * testsuite/dynamic_list.sh: New file.
14080
e0bb29a5
CS
140812008-11-05 Craig Silverstein <csilvers@google.com>
14082
14083 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14084 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14085 (t11_last): Likewise.
14086 * testsuite/ver_test_6.c (main): Likewise.
14087
4e1e25e0
CC
140882008-10-07 Cary Coutant <ccoutant@google.com>
14089
14090 * options.c (General_options::finalize): Add check for -static and
14091 -shared.
14092 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14093 is not empty.
14094
92f03fcb
CC
140952008-10-02 Cary Coutant <ccoutant@google.com>
14096
14097 * plugin.cc (make_sized_plugin_object): Fix conditional
14098 compilation to work when not all targets are enabled.
14099
fbd8a257
CC
141002008-09-29 Cary Coutant <ccoutant@google.com>
14101
14102 * archive.cc (Archive::get_file_and_offset): Use filename instead
14103 of name to get library path.
14104 (Archive::include_member): Unlock external member of a thin archive.
14105
14106 * testsuite/Makefile.am (TEST_AR): New variable.
14107 (thin_archive_test_1): New test.
14108 (thin_archive_test_2): New test.
81636b3f
CC
14109 * testsuite/Makefile.in: Regenerate.
14110 * testsuite/thin_archive_main.cc: New file.
14111 * testsuite/thin_archive_test_1.cc: New file.
14112 * testsuite/thin_archive_test_2.cc: New file.
14113 * testsuite/thin_archive_test_3.cc: New file.
14114 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14115
eff45813
CC
141162008-09-29 Cary Coutant <ccoutant@google.com>
14117
14118 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14119 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14120 instead of -1U.
14121 (Sized_relobj::do_finalize_local_symbols): Likewise.
14122 (Sized_relobj::map_to_kept_section): Likewise.
14123 * object.h (Sized_relobj::invalid_address): New constant.
14124 (Sized_relobj::do_output_section_offset): Check for invalid_address
14125 and return -1ULL.
14126 * output.cc (Output_reloc::local_section_offset): Use constant
14127 invalid_address instead of -1U.
14128 (Output_reloc::get_address): Likewise.
14129 (Output_section::output_address): Change -1U to -1ULL.
14130 * output.h (Output_reloc::invalid_address): New constant.
14131 * reloc.cc (Sized_relobj::write_sections): Use constant
14132 invalid_address instead of -1U.
14133 (Sized_relobj::relocate_sections): Likewise.
14134 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14135 values for merge sections.
14136 * target-reloc.h (relocate_for_relocatable): Use constant
14137 invalid_address instead of -1U.
14138
89fc3421
CC
141392008-09-19 Cary Coutant <ccoutant@google.com>
14140
14141 Add plugin functionality for link-time optimization (LTO).
14142 * configure.ac (plugins): Add --enable-plugins option.
14143 * configure: Regenerate.
14144 * config.in: Regenerate.
14145 * Makefile.am (LIBDL): New variable.
14146 (CCFILES): Add plugin.cc.
14147 (HFILES): Add plugin.h.
14148 (ldadd_var): Add LIBDL.
14149 * Makefile.in: Regenerate.
14150
14151 * archive.cc: Include "plugin.h".
14152 (Archive::setup): Don't preread archive symbols when using a plugin.
14153 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14154 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14155 files.
14156 (Archive::include_member): Add symbols from plugin objects.
14157 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14158 * descriptors.cc (Descriptors::open): Check for file descriptors
14159 abandoned by plugins.
14160 (Descriptors::claim_for_plugin): New function.
14161 * descriptors.h (Descriptors::claim_for_plugin): New function.
14162 (Open_descriptor::is_claimed): New field.
14163 (claim_descriptor_for_plugin): New function.
14164 * fileread.cc (File_read::claim_for_plugin): New function.
14165 * fileread.h (File_read::claim_for_plugin): New function.
14166 (File_read::descriptor): New function.
14167 * gold.cc: Include "plugin.h".
14168 (queue_initial_tasks): Add task to call plugin hooks for generating
14169 new object files.
14170 * main.cc: Include "plugin.h".
14171 (main): Load plugin libraries.
14172 * object.h (Pluginobj): Declare.
14173 (Object::pluginobj): New function.
14174 (Object::do_pluginobj): New function.
14175 (Object::set_target): New function.
14176 * options.cc: Include "plugin.h".
14177 (General_options::parse_plugin): New function.
14178 (General_options::General_options): Initialize plugins_ field.
14179 (General_options::add_plugin): New function.
14180 * options.h (Plugin_manager): Declare.
14181 (General_options): Add --plugin option.
14182 (General_options::has_plugins): New function.
14183 (General_options::plugins): New function.
14184 (General_options::add_plugin): New function.
14185 (General_options::plugins_): New field.
14186 * plugin.cc: New file.
14187 * plugin.h: New file.
14188 * readsyms.cc: Include "plugin.h".
14189 (Read_symbols::do_read_symbols): Check for archive before checking
14190 for ELF file. Call plugin hooks to claim files.
14191 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14192 from a real object file; force override when processing replacement
14193 files.
14194 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14195 (Symbol::init_base_object): Likewise.
14196 (Symbol::init_base_output_data): Likewise.
14197 (Symbol::init_base_output_segment): Likewise.
14198 (Symbol::init_base_constant): Likewise.
14199 (Symbol::init_base_undefined): Likewise.
14200 (Symbol::output_section): Assert that object is not a plugin.
14201 (Symbol_table::add_from_pluginobj): New function.
14202 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14203 undefined.
14204 (Symbol_table::sized_write_globals): Likewise.
14205 (Symbol_table::add_from_pluginobj): Instantiate template.
14206 * symtab.h (Sized_pluginobj): Declare.
14207 (Symbol::in_real_elf): New function.
14208 (Symbol::set_in_real_elf): New function.
14209 (Symbol::in_real_elf_): New field.
14210 (Symbol_table::add_from_pluginobj): New function.
14211
14212 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14213 (LIBDL): New variable.
14214 (LDADD): Add LIBDL.
14215 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14216 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14217 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14218 (MOSTLYCLEANFILES): Likewise.
14219 * testsuite/Makefile.in: Regenerate.
14220 * testsuite/plugin_test.c: New file.
14221 * testsuite/plugin_test_1.sh: New file.
14222 * testsuite/plugin_test_2.sh: New file.
14223
de31bda5
ILT
142242008-09-16 Ian Lance Taylor <iant@google.com>
14225
9c2d0ef9
ILT
14226 * target-reloc.h (relocate_section): Check whether a symbol is
14227 defined by the ABI before reporting an undefined symbol error.
14228 * target.h (Target::is_defined_by_abi): Make parameter const.
14229 (Target::do_is_defined_by_abi): Likewise.
14230 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14231 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14232 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14233 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14234 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14235 * testsuite/Makefile.in: Rebuild.
14236
de31bda5
ILT
14237 * fileread.cc (make_view): Add casts to avoid warning.
14238
9fa33bee
AO
142392008-09-16 Alexandre Oliva <aoliva@redhat.com>
14240
14241 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14242 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14243
183fd0e3
AO
142442008-09-16 Alexandre Oliva <aoliva@redhat.com>
14245
14246 * options.h (General_options::output_is_executable): New.
14247 (General_options::output_is_pie): New.
14248 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14249 for shared libraries.
14250 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14251
7be8330a
CD
142522008-09-11 Chris Demetriou <cgd@google.com>
14253
14254 * options.h (origin): New -z option.
14255 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14256 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14257 in DT_FLAGS_1.
14258
a9caad02
CC
142592008-09-05 Cary Coutant <ccoutant@google.com>
14260
14261 * fileread.cc (File_read::make_view): Add check for attempt to map
14262 beyond end of file.
14263
ae6dce4d
CC
142642008-09-05 Cary Coutant <ccoutant@google.com>
14265
14266 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14267 explicit instantiations.
14268
d7ab2a47
KVH
142692008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14270
14271 PR gold/6858
14272 * options.cc (General_options::finalize): Allow undefined symbols
14273 in shlibs if linking -shared.
14274
14275 PR gold/6859
14276 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14277 symbols as not needing a dynsym entry.
14278
1e52a9c1
CS
142792008-08-20 Craig Silverstein <csilvers@google.com>
14280
14281 * fileread.cc (File_read::open): Do not lock the file unless it
14282 was successfully opened.
14283
d85c80a3
CC
142842008-08-14 Cary Coutant <ccoutant@google.com>
14285
14286 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14287 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14288 * testsuite/tls_test.cc (struct int128): 128-bit struct
14289 for testing TLS relocs with non-zero addend.
14290 (v12): New TLS variable.
14291 (t12): New test.
14292 (t_last): Add check for v12.
14293 * testsuite/tls_test.h (t12): New function.
14294 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14295
2d924fd9
ILT
142962008-08-13 Ian Lance Taylor <iant@google.com>
14297
14298 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14299 set tls_segment_ or relro_segment_.
14300 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14301 when appropriate.
14302 * output.h (Output_section::clear_is_relro): New function.
14303 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14304 sections specially even when output_data_ is empty.
14305 (Output_segment::maximum_alignment): When first section is relro,
14306 only force alignment for PT_LOAD segments.
14307 * script.cc (script_data_segment_align): New function.
14308 (script_data_segment_relro_end): New function.
14309 * script-c.h (script_data_segment_align): Declare.
14310 (script_data_segment_relro_end): Declare.
14311 * script-sections.h (class Script_sections): Declare
14312 data_segment_align and data_segment_relro_end. Add fields
14313 segment_align_index_ and saw_relro_end_.
14314 * script-sections.cc (class Sections_element): Add set_is_relro
14315 virtual function. Add new bool* parameter to place_orphan_here.
14316 Add get_output_section virtual function.
14317 (class Output_section_definition): Add set_is_relro. Add new
14318 bool* parameter to place_orphan_here. Add get_output_section.
14319 Add is_relro_ field.
14320 (Output_section_definition::Output_section_definition): Initialize
14321 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14322 and is_relro_ fields.
14323 (Output_section_definition::place_orphan_here): Add is_relro
14324 parameter.
14325 (Output_section_definition::set_section_addresses): Set relro for
14326 output section.
14327 (Output_section_definition::alternate_constraint): Likewise.
14328 (class Orphan_output_section): Add new bool* parameter to
14329 place_orphan_here. Add get_output_section.
14330 (Orphan_output_section::place_orphan_here): Add is_relro
14331 parameter.
14332 (Script_sections::Script_sections): Initialize
14333 data_segment_align_index_ and saw_relro_end_.
14334 (Script_sections::data_segment_align): New function.
14335 (Script_sections::data_segment_relro_end): New function.
14336 (Script_sections::place_orphan): Set or clear is_relro.
14337 (Script_sections::set_section_addresses): Force alignment of first
14338 TLS section.
14339 * yyscript.y (exp): Call script_data_segment_align and
14340 script_data_segment_relro_end.
14341 * testsuite/relro_script_test.t: New file.
14342 * testsuite/relro_test.cc (using_script): Declare.
14343 (t1, t2): Test using_script.
14344 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14345 (relro_script_test_SOURCES): Define.
14346 (relro_script_test_DEPENDENCIES): Define.
14347 (relro_script_test_LDFLAGS): Define.
14348 (relro_script_test_LDADD): Define.
14349 (relro_script_test.so): New target.
14350 * testsuite/Makefile.in: Rebuild.
14351
f827c9a9
CC
143522008-08-06 Cary Coutant <ccoutant@google.com>
14353
14354 * archive.cc (Archive::total_archives, Archive::total_members)
14355 (Archive::total_members_loaded): New variables.
14356 (Archive::setup): Add parameter. Add option to preread
14357 archive symbols.
14358 (Archive::read_armap): Add counter.
14359 (Archive::get_file_and_offset): New function.
14360 (Archive::get_elf_object_for_member): New function.
14361 (Archive::read_all_symbols): New function.
14362 (Archive::read_symbols): New function.
14363 (Archive::add_symbols): Add counters.
14364 (Archive::include_all_members): Use armap to find members if it's
14365 already built.
14366 (Archive::include_member): Skip reading symbols if already read.
14367 Factored code into Archive::get_file_and_offset and
14368 Archive::get_elf_object_for_member. Changed call to
14369 Mapfile::report_include_archive_member.
14370 (Archive::print_stats): New function.
14371 * archive.h: Declare Object and Read_symbols_data classes.
14372 (Archive::Archive): Add initializers for new members.
14373 (Archive::setup): Add parameter.
14374 (Archive::print_stats): New function.
14375 (Archive::total_archives, Archive::total_members)
14376 (Archive::total_members_loaded): New variables.
14377 (Archive::get_file_and_offset): New function.
14378 (Archive::get_elf_object_for_member): New function.
14379 (Archive::read_all_symbols): New function.
14380 (Archive::read_symbols): New function.
14381 (Archive::Archive_member): New class.
14382 (Archive::members_): New member.
14383 (Archive::num_members_): New member.
14384 * main.cc: Include archive.h.
14385 (main): Call Archive::print_stats.
14386 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14387 archive parameter; member_name is now the fully-decorated name.
14388 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14389 * options.h: (General_options): Add --preread-archive-symbols option.
14390 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14391 Archive::setup.
14392
de4c45bd
ILT
143932008-08-04 Ian Lance Taylor <iant@google.com>
14394
14395 * symtab.h (Symbol::use_plt_offset): New function.
14396 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14397 * powerpc.cc (Relocate::relocate): Likewise.
14398 * sparc.cc (Relocate::relocate): Likewise.
14399 * x86_64.cc (Relocate::relocate): Likewise.
14400 * testsuite/weak_plt.sh: New test.
14401 * testsuite/weak_plt_main.cc: New test.
14402 * testsuite/weak_plt_shared.cc: New test.
14403 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14404 (check_PROGRAMS): Add weak_plt.
14405 (check_DATA): Add weak_plt_shared.so.
14406 (weak_plt_main_pic.o, weak_plt): New targets.
14407 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14408 * testsuite/Makefile.in: Rebuild.
14409
14410 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14411 gcctestdir/ld.
14412 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14413 * testsuite/Makefile.in: Rebuild.
14414
323ee3f4
AM
144152008-08-04 Alan Modra <amodra@bigpond.net.au>
14416
14417 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14418 * Makefile.in: Regenerate.
14419 * po/POTFILES.in: Regenerate.
14420
7c07ecec
ILT
144212008-07-29 Ian Lance Taylor <iant@google.com>
14422
14423 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14424 symbols before other symbols.
14425 * testsuite/script_test_2.cc (test_addr): Declare.
14426 (test_addr_alias): Declare.
14427 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14428 values.
7c07ecec
ILT
14429 * testsuite/script_test_2.t: Define test_addr_alias and
14430 test_addr.
14431
5778530e
ILT
144322008-07-24 Ian Lance Taylor <iant@google.com>
14433
2a00e4fb
ILT
14434 PR 5990
14435 * descriptors.cc: New file.
14436 * descriptors.h: New file.
14437 * gold-threads.h (class Hold_optional_lock): New class.
14438 * fileread.cc: Include "descriptors.h".
14439 (File_read::~File_read): Release descriptor rather than closing
14440 it.
14441 (File_read::open) [file]: Call open_descriptor rather than open.
14442 Set is_descriptor_opened_.
14443 (File_read::open) [memory]: Assert that descriptor is not open.
14444 (File_read::reopen_descriptor): New function.
14445 (File_read::release): Release descriptor.
14446 (File_read::do_read): Make non-const. Reopen descriptor.
14447 (File_read::read): Make non-const.
14448 (File_read::make_view): Reopen descriptor.
14449 (File_read::do_readv): Likewise.
14450 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14451 Update declarations.
14452 * layout.cc: Include "descriptors.h".
14453 (Layout::create_build_id): Use open_descriptor rather than open.
14454 * output.cc: Include "descriptors.h".
14455 (Output_file::open): Use open_descriptor rather than open.
14456 * archive.cc (Archive::const_iterator): Change Archive to be
14457 non-const.
14458 (Archive::begin, Archive::end): Make non-const.
14459 (Archive::count_members): Likewise.
14460 * archive.h (class Archive): Update declarations.
14461 * object.h (Object::read): Make non-const.
14462 * Makefile.am (CCFILES): Add descriptors.cc.
14463 (HFILES): Add descriptors.h.
14464 * Makefile.in: Rebuild.
14465
801647d1
ILT
14466 PR 6716
14467 * gold.h: Always include <clocale>. Add Solaris workarounds
14468 following code in binutils/sysdep.h.
14469
5edd166e
ILT
14470 PR 6048
14471 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14472 this->eh_frame_hdr_ is NULL before using it.
14473
c89ad728
ILT
14474 * dynobj.cc (Versions::Versions): Update comment.
14475
aa86f06b
ILT
14476 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14477 the base version name.
14478
5778530e
ILT
14479 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14480 array size plus one.
14481 (Stringpool_template::set_string_offsets): Subtract one from key
14482 before using it as an array index.
14483 (Stringpool_template::get_offset_with_length): Likewise.
14484 (Stringpool_template::write_to_buffer): Likewise.
14485 * stringpool.h (Stringpool_template::get_offset_from_key):
14486 Likewise.
14487
057ead22
ILT
144882008-07-23 Ian Lance Taylor <iant@google.com>
14489
7f649c59
ILT
14490 PR 6658
14491 * object.h (Merged_symbol_value::value): Do our best to handle a
14492 negative addend.
14493
057ead22
ILT
14494 PR 6647
14495 * script.cc (Version_script_info::get_versions): Don't add empty
14496 version tag to return value.
14497 (Version_script_info::get_symbol_version_helper): Change return
14498 type to bool. Add pversion parameter. Change all callers.
14499 (script_register_vers_node): Don't require a non-NULL tag.
14500 * script.h (class Version_script_info): Update declarations.
14501 (Version_script_info::get_symbol_version): Change return type to
14502 bool. Add version parameter. Change all callers.
14503 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14504 handling. Handle an empty version from a version script.
14505 (Symbol_table::define_special_symbol): Likewise.
14506 * testsuite/ver_test_10.script: New file.
14507 * testsuite/ver_test_10.sh: New file.
14508 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14509 (check_DATA): Add ver_test_10.syms.
14510 (ver_test_10.syms, ver_test_10.so): New target.
14511 * testsuite/Makefile.in: Rebuild.
14512
58e54ac2
CD
145132008-07-23 Simon Baldwin <simonb@google.com>
14514
14515 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14516 to zero for undefined symbols from dynamic libraries.
14517
95d14cd3
ILT
145182008-07-23 Ian Lance Taylor <iant@google.com>
14519
14520 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14521 Change all callers.
14522 * symtab.h (class Symbol_table): Update declaration.
14523 * testsuite/ver_test_9.cc: New file.
14524 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14525 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14526 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14527 (ver_test_9.so, ver_test_9.o): New targets.
14528 * testsuite/Makefile.in: Rebuild.
14529
92de84a6
ILT
145302008-07-22 Ian Lance Taylor <iant@google.com>
14531
34810851
ILT
14532 * options.h (class General_options): Define --check-sections.
14533 * layout.cc (Layout::set_segment_offsets): Handle
14534 --check-sections.
14535
af6156ef
ILT
14536 * options.h (class General_options): Define -n/--nmagic and
14537 -N/--omagic.
14538 * options.cc (General_options::finalize): For -n/--nmagic or
14539 -N/--omagic, set -static.
14540 * layout.cc (Layout::attach_allocated_section_to_segment): If
14541 -N/--omagic, don't put read-only and read-write sections in
14542 different segments.
14543 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14544 finding a read-only segment.
14545 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14546 don't set the minimum segment alignment to the common page size,
14547 and don't set the file offset to the address modulo the page size.
14548 * script-sections.cc (Script_sections::create_segments): If
14549 -n/--omagic, don't put read-only and read-write sections in
14550 different segments.
14551
92de84a6
ILT
14552 * cref.cc: New file.
14553 * cref.h: New file.
14554 * options.h (class General_options): Add --print-symbol-counts.
14555 * main.cc (main): Issue defined symbol report if requested.
14556 * archive.cc (Archive::interpret_header): Make into a const member
14557 function.
14558 (Archive::add_symbols): Call Input_objects::archive_start and
14559 archive_stop.
14560 (Archive::const_iterator): Define new class.
14561 (Archive::begin, Archive::end): New functions.
14562 (Archive::include_all_members): Rewrite to use iterator.
14563 (Archive::count_members): New function.
14564 * archive.h (class Archive): Update declarations.
14565 (Archive::filename): New function.
14566 * object.cc: Include "cref.h".
14567 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14568 (Sized_relobj::do_get_global_symbol_counts): New function.
14569 (Input_objects::add_object): Add object to cross-referencer.
14570 (Input_objects::archive_start): New function.
14571 (Input_objects::archive_stop): New function.
14572 (Input_objects::print_symbol_counts): New function.
14573 * object.h: Declare Cref and Archive.
14574 (Object::get_global_symbol_counts): New function.
14575 (Object::do_get_global_symbol_counts): New pure virtual function.
14576 (class Sized_relobj): Add defined_count_ field. Update
14577 declarations.
14578 (class Input_objects): Add cref_ field. Update constructor.
14579 Update declarations.
14580 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14581 defined_count_.
14582 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14583 symbol counts.
14584 (Sized_dynobj::do_get_global_symbol_counts): New function.
14585 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14586 defined_count_. Update declarations. Define Symbols typedef.
14587 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14588 parameter. Change all callers.
14589 (Symbol_table::add_from_dynobj): Add sympointers and defined
14590 parameters. Change all callers.
14591 * symtab.h (class Symbol_table): Update declarations.
14592 * Makefile.am (CCFILES): Add cref.cc.
14593 (HFILES): Add cref.h.
14594 * Makefile.in: Rebuild.
14595
3f7c5e1d
CD
145962008-07-22 Simon Baldwin <simonb@google.com>
14597
14598 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14599 to zero when writing undefined symbols.
14600
e0b64032
ILT
146012008-07-22 Ian Lance Taylor <iant@google.com>
14602
14603 * output.cc (Output_section::add_input_section): Don't try to
14604 merge empty merge sections.
14605
096b02cf
CS
146062008-07-21 Craig Silverstein <csilvers@google.com>
14607
14608 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14609 Include symbol version in error message.
cd536b21 14610
1d1f116d
CD
146112008-07-20 Chris Demetriou <cgd@google.com>
14612
cd536b21 14613 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14614 (RANDOM_SEED_CFLAGS): New substituted variable.
14615 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14616 * configure: Rebuild.
14617 * Makefile.in: Likewise.
14618 * testsuite/Makefile.in: Likewise.
14619
a18f591e
ILT
146202008-07-18 Ian Lance Taylor <iant@google.com>
14621
14622 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14623 where we see NAME/NULL and NAME/VERSION as separate symbols.
14624 * testsuite/ver_test_main.cc (main): Call t4.
14625 (t4, t4_2a): Define.
14626 * testsuite/ver_test_2.cc (t4_2): Define.
14627 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14628 * testsuite/ver_test_4.cc (t4_2a): Define.
14629 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14630 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14631
c6e3f6ed
ILT
146322008-07-17 Ian Lance Taylor <iant@google.com>
14633
14634 * dynobj.cc (Versions::add_def): If we give an error about a
14635 missing version, go ahead and create the version anyhow.
14636
ef9beddf
ILT
146372008-07-10 Ian Lance Taylor <iant@google.com>
14638
14639 Handle output sections with more than 0x7fffffff bytes.
14640 * object.h (class Relobj): Change map_to_output_ to
14641 output_sections_, and just keep a section pointer. Change all
14642 uses. Move comdat group support to Sized_relobj.
14643 (Relobj::is_section_specially_mapped): Remove.
14644 (Relobj::output_section): Remove poff parameter. Change all
14645 callers.
14646 (Relobj::output_section_offset): New function.
14647 (Relobj::set_section_offset): Rewrite.
14648 (Relobj::map_to_output): Remove.
14649 (Relobj::output_sections): New function.
14650 (Relobj::do_output_section_offset): New pure virtual function.
14651 (Relobj::do_set_section_offset): Likewise.
14652 (class Sized_relobj): Add section_offsets_ field. Add comdat
14653 group support from Relobj. Update declarations.
14654 (Sized_relobj::get_output_section_offset): New function.
14655 (Sized_relobj::do_output_section_offset): New function.
14656 (Sized_relobj::do_set_section_offset): New function.
14657 * object.cc (Relobj::output_section_address): Remove.
14658 (Sized_relobj::Sized_relobj): Initialize new fields.
14659 (Sized_relobj::include_section_group): Cast find_kept_object to
14660 Sized_relobj.
14661 (Sized_relobj::include_linkonce_section): Likewise.
14662 (Sized_relobj::do_layout): Use separate arrays for output section
14663 and output offset.
14664 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14665 output_sections.
14666 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14667 output_sections and section_offsets.
14668 (Sized_relobj::write_local_symbols): Likewise.
14669 (map_to_kept_section): Compute output address directly.
14670 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14671 output_sections and section_offsets.
14672 (Sized_relobj::write_sections): Likewise.
14673 (Sized_relobj::relocate_sections): Likewise.
14674 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14675 * output.h (class Output_reloc): Update declarations. Change
14676 u2_.relobj to Sized_relobj*.
14677 (class Output_data_reloc): Change add functions to use
14678 Sized_relobj*.
14679 * output.cc (Output_reloc::Output_reloc): Change relobj to
14680 Sized_relobj*.
14681 (Output_reloc::local_section_offset): Change return type to
14682 Elf_Addr. Use get_output_section_offset.
14683 (Output_reloc::get_address): Likewise.
14684 (Output_section::is_input_address_mapped): Don't call
14685 is_section_specially_mapped.
14686 (Output_section::output_offset): Likewise.
14687 (Output_section::output_address): Likewise.
14688 (Output_section::starting_output_address): Likewise.
14689 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14690 parameter to Sized_relobj*.
14691 (Copy_relocs::need_copy_reloc): Likewise.
14692 (Copy_relocs::save): Likewise.
14693 * copy-relocs.h (class Copy_relocs): Update declarations.
14694 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14695 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14696 * target-reloc.h (relocate_for_relocatable): Change
14697 offset_in_output_section type to Elf_Addr. Change code that uses
14698 it as well.
14699 * layout.cc (Layout::layout): Always set *off.
14700 * mapfile.cc (Mapfile::print_input_section): Use
14701 output_section_offset.
14702 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14703 Sized_relobj*.
14704 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14705 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14706 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14707
5cb66f97
ILT
147082008-07-03 Ian Lance Taylor <iant@google.com>
14709
14710 * layout.cc (Layout::include_section): Do not discard unrecognized
14711 SHT_STRTAB sections.
14712
afe47622
CS
147132008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14714
14715 * script.cc (Lex::can_continue_name): Make '?' allowable in
14716 version-script names.
14717 * testsuite/version_script.map: Change glob pattern to use '?'
14718
5adf9721
ILT
147192008-06-30 Manish Singh <yosh@gimp.org>
14720
14721 PR 6585
14722 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14723 Correct typo.
14724
e6fde208
ILT
147252008-06-30 Ian Lance Taylor <iant@google.com>
14726
14727 PR 6660
14728 PR 6682
14729 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14730 versions]: Don't try to read the value in the contents, since we
14731 don't use it. Use the template endianness when writing.
14732
3f2e6a2d
CC
147332008-06-25 Cary Coutant <ccoutant@google.com>
14734
14735 * fileread.cc (File_read::make_view): Assert on zero-length view.
14736 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14737 symbol table when there are no symbols to read.
14738
c43d3a48
CS
147392008-06-23 Craig Silverstein <csilvers@google.com>
14740
14741 * version.cc (version_string): Bump to 1.7
14742
5f494ea0
CS
147432008-06-18 Craig Silverstein <csilvers@google.com>
14744
14745 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14746 constant 0xFFFF to type Valtype.
14747 (Powerpc_relocate_functions::rel16_ha): Likewise.
14748
c42e122e
ILT
147492008-06-17 Ian Lance Taylor <iant@google.com>
14750
f34787f8
ILT
14751 * output.h (Output_section::Input_section): Initialize p2align_ to
14752 zero for Output_section_data constructors.
14753 (Output_section::Input_section::addralign): If not an input
14754 section, return the alignment of the Output_section_data.
14755 * testsuite/copy_test.cc: New file.
14756 * testsuite/copy_test_1.cc: New file.
14757 * testsuite/copy_test_2.cc: New file.
14758 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14759 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14760 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14761 (copy_test_1_pic.o, copy_test_1.so): New targets.
14762 (copy_test_2_pic.o, copy_test_2.so): New targets.
14763 * testsuite/Makefile.in: Rebuild.
14764
c42e122e
ILT
14765 * script-sections.cc (Script_sections::place_orphan): Initialize
14766 local variable exact.
14767
ce3ac18a
DE
147682008-06-13 David Edelsohn <edelsohn@gnu.org>
14769
14770 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14771
42cacb20
DE
147722008-06-12 David Edelsohn <edelsohn@gnu.org>
14773 David S. Miller <davem@davemloft.net>
14774
14775 * powerpc.cc: New file.
14776 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14777 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14778 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14779 * Makefile.in: Rebuild.
14780
7b308235
ILT
147812008-06-09 Ian Lance Taylor <iant@google.com>
14782
14783 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14784 <exception>.
14785 (throwing, orig_terminate): New static variables.
14786 (terminate_handler): New static function.
14787 (t2): Set terminate handler.
14788
f0b886e3
ILT
147892008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14790
14791 PR 6584
cd536b21 14792 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14793 alignment.
14794
3e90f135
CC
147952008-05-30 Cary Coutant <ccoutant@google.com>
14796
14797 * archive.cc (Archive::include_all_members) Correct to step
14798 over symbol table and extended name table in thin archives.
14799
e09ad04a
ILT
148002008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14801
14802 PR 6407
14803 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14804 calculation.
14805
62b01cb5
ILT
148062008-05-28 Caleb Howe <cshowe@google.com>
14807
14808 * reduced_debug_output.cc: New file.
14809 * reduced_debug_output.h: New file.
92de84a6 14810 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14811 * options.cc (General_options::finalize): Add strip_debug_non_line
14812 to the strip heirarchy.
14813 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14814 fields.
14815 * layout.cc: Include "reduced_debug_output.h".
14816 (Layout::Layout): Initialize new fields.
14817 (line_only_debug_sections): New static array.
14818 (is_lines_only_debug_sections): New static inline function.
14819 (Layout::include_section): Handle --strip-debug-non-line.
14820 (Layout::make_output_section): If --strip-debug-non-line, build
14821 new output sections for .debug_abbrev and .debug_info.
14822 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14823 gold. Warn about possible overflow.
14824 (read_signed_LEB_128): Likewise.
14825 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14826 (read_signed_LEB_128): Declare.
14827 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14828 (HFILES): Add reduced_debug_output.h.
14829 * Makefile.in: Rebuild.
14830
7d9e3d98
ILT
148312008-05-21 Ian Lance Taylor <iant@google.com>
14832
14833 * mapfile.cc: New file.
14834 * mapfile.h: New file.
14835 * options.h (class General_options): Add -M/--print-map and -Map.
14836 * options.cc (General_options::finalize): Make -M equivalent to
14837 -Map -.
14838 * main.cc: Include <cstdio> and "mapfile.h".
14839 (main): Open mapfile if requested.
14840 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14841 constructor. Change caller.
14842 (queue_initial_tasks): Add mapfile parameter. Change caller.
14843 (queue_middle_tasks): Likewise.
14844 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14845 declarations.
14846 * archive.cc: Include "mapfile.h".
14847 (Archive::add_symbols): Add mapfile parameter. Change all
14848 callers. Pass mapfile, symbol, and reason to include_member.
14849 (Archive::include_all_members): Add mapfile parameter. Change all
14850 callers.
14851 (Archive::include_member): Add mapfile, sym, and why parameters.
14852 Change all callers. Report inclusion to map file.
14853 * archive.h: Include "fileread.h".
14854 (class Archive): Update declarations.
14855 (Archive::file): New const method.
14856 (class Add_archive_symbols): Add mapfile_ field. Update
14857 constructor. Change all callers.
14858 * readsyms.h (class Read_symbols): Likewise.
14859 (class Finish_group): Likewise.
14860 (class Read_script): Likewise.
14861 * common.cc: Include "mapfile.h".
14862 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14863 all callers.
14864 (Symbol_table::do_allocate_commons): Likewise.
14865 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14866 symbol allocation to mapfile.
14867 * common.h (class Allocate_commons_task): Add mapfile_ field.
14868 Update constructor. Change all callers.
14869 * symtab.h (class Symbol_table): Update declarations.
14870 * layout.cc: Include "mapfile.h".
14871 (Layout_task_runner::run): Print information to mapfile.
14872 (Layout::create_gold_note): Change Output_data_fixed_space to
14873 Output_data_zero_fill.
14874 (Layout::create_build_id): Likewise.
14875 (Layout::print_to_mapfile): New function.
14876 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14877 constructor. Change caller.
14878 (class Layout): Declare print_to_mapfile.
14879 * output.cc (Output_section::Input_section::print_to_mapfile): New
14880 function.
14881 (Output_section::add_input_section): If producing a map, always
14882 add to input_sections_ list.
14883 (Output_section::do_print_to_mapfile): New function.
14884 (Output_segment::print_sections_to_mapfile): New function.
14885 (Output_segment::print_section_list_to_mapfile): New function.
14886 * output.h: Include "mapfile.h".
14887 (Output_data::print_to_mapfile): New function.
14888 (Output_data::do_print_to_mapfile): New virtual function.
14889 (Output_segment_headers::do_print_to_mapfile): New function.
14890 (Output_file_header::do_print_to_mapfile): New function.
14891 (Output_data_const::do_print_to_mapfile): New function.
14892 (class Output_data_const_buffer): Add map_name_ field. Update
14893 constructor. Change all callers. Add do_print_to_mapfile
14894 function.
14895 (class Output_data_fixed_space): Likewise.
14896 (class Output_data_space): Likewise.
14897 (class Output_data_zero_fill): New class.
14898 (Output_data_strtab::do_print_to_mapfile): New function.
14899 (Output_data_reloc_base::do_print_to_mapfile): New function.
14900 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14901 (Output_data_group::do_print_to_mapfile): New function.
14902 (Output_data_got::do_print_to_mapfile): New function.
14903 (Output_data_dynamic::do_print_to_mapfile): New function.
14904 (Output_symtab_xindex::do_print_to_mapfile): New function.
14905 (class Output_section): Declare do_print_to_mapflie. Declare
14906 print_to_mapfile in Input_section.
14907 (class Output_segment): Declare new functions.
14908 * object.h (Sized_relobj::symbol_count): New function.
14909 * script-sections.cc
14910 (Output_section_element_dot_assignment::set_section_addresses):
14911 Change Output_data_fixed_space to Output_data_zero_fill.
14912 (Output_data_expression::do_print_to_mapfile): New function.
14913 * script.cc (read_input_script): Add mapfile parameter. Change
14914 all callers.
14915 * script.h (read_input_script): Update declaration.
14916 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14917 (Eh_frame::do_print_to_mapfile): New function.
14918 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14919 (Output_merge_string::do_print_to_mapfile): New function.
14920 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14921 function.
14922 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14923 function.
14924 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14925 function.
14926 * Makefile.am (CCFILES): Add mapfile.cc.
14927 (HFILES): Add mapfile.h.
14928 * Makefile.in: Rebuild.
14929
9f1d377b
ILT
149302008-05-19 Ian Lance Taylor <iant@google.com>
14931
14932 * options.h (class General_options): Add -z relro.
14933 * layout.cc (Layout::Layout): Initialize relro_segment_.
14934 (Layout::add_output_section_data): Return the output section.
14935 (Layout::make_output_section): Rcognize relro sections and mark
14936 them appropriately.
14937 (Layout::attach_allocated_section_to_segment): Put relro sections
14938 in a PT_GNU_RELRO segment.
14939 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14940 section as relro.
14941 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14942 PT_TLS segments.
14943 (Layout::linkonce_mapping): Map d.rel.ro.local to
14944 .data.rel.ro.local.
14945 (Layout::output_section_name): Us .data.rel.ro.local for any
14946 section which begins with that.
14947 * layout.h (class Layout): Update add_output_section_data
14948 declaration. Add relro_segment_ field.
14949 * output.cc (Output_section::Output_section): Initialize is_relro_
14950 and is_relro_local_ fields.
14951 (Output_segment::add_output_section): Group relro sections.
14952 (Output_segment::is_first_section_relro): New function.
14953 (Output_segment::maximum_alignment): If there is a relro section,
14954 align the segment to the common page size.
14955 (Output_segment::set_section_addresses): Track whether we are
14956 looking at relro sections. If the last section is a relro
14957 section, align to the common page size.
14958 (Output_segment::set_section_list_addresses): Add in_relro
14959 parameter. Change all callers. Align to the page size when
14960 moving from relro to non-relro section.
14961 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14962 segment.
14963 * output.h (class Output_section): Add is_relro_ and
14964 is_relro_local_ fields.
14965 (Output_section::is_relro): New function.
14966 (Output_section::set_is_relro): New function.
14967 (Output_section::is_relro_local): New function.
14968 (Output_section::set_is_relro_local): New function.
14969 (class Output_segment): Update declarations.
14970 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14971 * sparc.cc (Target_sparc::got_section): Likewise.
14972 * x86_64.cc (Target_x86_64::got_section): Likewise.
14973 * testsuite/relro_test_main.cc: New file.
14974 * testsuite/relro_test.cc: New file.
14975 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14976 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14977 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14978 (relro_test.so, relro_test_pic.o): New targets.
14979 * testsuite/Makefile.in: Rebuild.
14980
a984ee1d
ILT
149812008-05-16 Ian Lance Taylor <iant@google.com>
14982
01676dcd
ILT
14983 * output.cc (Output_segment::add_output_section): Remove front
14984 parameter.
14985 * output.h (class Output_segment): Remove
14986 add_initial_output_section and overloaded add_output_section.
14987 Update declaration of remaining add_output_section.
14988 * layout.cc (Layout::create_interp): Call add_output_section
14989 rather than add_initial_output_section.
14990 (Layout::finish_dynamic_section): Likewise.
14991
497897f9
ILT
14992 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14993 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14994 know the dynamic type.
14995 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14996 field. Initialize it in constructor.
14997 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14998 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14999 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15000 reloc.
15001
a984ee1d
ILT
15002 * output.cc (Output_reloc::get_address): Change return type to
15003 Elf_Addr.
15004 * output.h (class Output_reloc): Update get_address declaration.
15005 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15006 for section addresses.
15007
55ba0940
ILT
150082008-05-09 Ian Lance Taylor <iant@google.com>
15009
15010 PR 6493
15011 * gold.cc (gold_nomem): Use return value of write.
15012
75517b77
ILT
150132008-05-08 Ian Lance Taylor <iant@google.com>
15014
15015 * symtab.c (Symbol::init_base_output_data): Add version
15016 parameter. Change all callers.
15017 (Symbol::init_base_output_segment): Likewise.
15018 (Symbol::init_base_constant): Likewise.
15019 (Symbol::init_base_undefined): Likewise.
15020 (Sized_symbol::init_output_data): Likewise.
15021 (Sized_symbol::init_output_segment): Likewise.
15022 (Sized_symbol::init_constant): Likewise.
15023 (Sized_symbol::init_undefined): Likewise.
15024 (Symbol_table::do_define_in_output_data): If the new symbol has a
15025 version, mark it as the default.
15026 (Symbol_table::do_define_in_output_segment): Likewise.
15027 (Symbol_table::do_define_as_constant): Likewise.
15028 * symtab.h (class Symbol): Update declarations.
15029 (class Sized_symbol): Likewise.
15030 * resolve.cc (Symbol::override_version): New function.
c42e122e 15031 (Symbol::override_base): Call override_version.
75517b77
ILT
15032 (Symbol::override_base_with_special): Likewise.
15033 * testsuite/ver_script_8.script: New file.
15034 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15035 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15036 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15037 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15038
f1f70eae
ILT
150392008-05-06 Ian Lance Taylor <iant@google.com>
15040
f3e9c5c5
ILT
15041 PR 6049
15042 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15043 functions.
15044 (class General_options): Remove existing --undefined, and add
15045 --no-undefined instead. Add new --undefined as synonym for -u.
15046 * archive.cc (Archive::add_symbols): Check whether symbol was
15047 named with -u.
15048 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15049 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15050 all uses. Add IS_UNDEFINED. Update declarations to split
15051 different versions of init_base. Declare init_base_undefined.
15052 (Symbol::is_defined): Handle IS_UNDEFINED.
15053 (Symbol::is_undefined): Likewise.
15054 (Symbol::is_weak_undefined): Call is_undefined.
15055 (Symbol::is_absolute): Handle IS_CONSTANT.
15056 (class Sized_symbol): Update declarations to split different
15057 versions of init. Declare init_undefined.
15058 (class Symbol_table): Declare new functions.
15059 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15060 Change all callers.
15061 (Symbol::init_base_output_data): Likewise.
15062 (Symbol::init_base_output_segment): Likewise.
15063 (Symbol::init_base_constant): Likewise.
15064 (Symbol::init_base_undefined): New function.
15065 (Sized_symbol::init_object): Rename from init. Change all
15066 callers.
15067 (Sized_symbol::init_output_data): Likewise.
15068 (Sized_symbol::init_output_segment): Likewise.
15069 (Sized_symbol::init_constant): Likewise.
15070 (Sized_symbol::init_undefined): New function.
15071 (Symbol_table::add_undefined_symbols_from_command_line): New
15072 function.
15073 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15074 function.
15075 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15076 (Symbol::output_section): Likewise.
15077 (Symbol::set_output_section): Likewise.
15078 (Symbol_table::sized_finalize_symbol): Likewise.
15079 (Symbol_table::sized_write_globals): Likewise.
15080 * resolve.cc (Symbol_table::should_override): Likewise.
15081 (Symbol::override_base_with_special): Likewise.
15082
8bdcdf2c
ILT
15083 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15084 symbol, change it to have default visibility.
15085 * testsuite/protected_1.cc: New file.
15086 * testsuite/protected_2.cc: New file.
15087 * testsuite/protected_3.cc: New file.
15088 * testsuite/protected_main_1.cc: New file.
15089 * testsuite/protected_main_2.cc: New file.
15090 * testsuite/protected_main_3.cc: New file.
15091 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15092 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15093 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15094 (protected_1.so): New target.
15095 (protected_1_pic.o, protected_2_pic.o): New targets.
15096 (protected_3_pic.o): New target.
15097 (check_PROGRAMS): Add protected_2.
15098 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15099 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15100 * testsuite/Makefile.in: Rebuild.
15101
2b706932
ILT
15102 * options.h (DEFINE_var): Add set_user_set_##varname__.
15103 (DEFINE_bool_alias): New macro.
15104 (class General_options): Define -Bstatic using DEFINE_bool_alias
15105 rather than DEFINE_special. Add --undefined as an alias for -z
15106 defs.
15107 * options.cc (General_options::parse_Bstatic): Remove.
15108
d82a5bcc
ILT
15109 * options.h (class General_options): Add --fatal-warnings.
15110 * main.cc (main): Implement --fatal-warnings.
15111 * errors.h (Errors::warning_count): New function.
15112
f1f70eae
ILT
15113 * options.h (class General_options): Add -Bsymbolic-functions.
15114 * symtab.h (Symbol::is_preemptible): Check for
15115 -Bsymbolic-functions.
15116
8825ac63
ILT
151172008-05-05 Ian Lance Taylor <iant@google.com>
15118
d98bc257
ILT
15119 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15120 as noVARNAME rather than no-VARNAME.
15121 (class General_options): Add option -z combreloc.
15122 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15123 get_address.
15124 (Output_reloc::sort_before) [SHT_REL]: New function.
15125 (Output_reloc::sort_before) [SHT_RELA]: New function.
15126 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15127 Sort_relocs_comparison.
15128 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15129 parameter. Change all callers.
15130 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15131 sort_relocs parameter. Change all callers.
15132 * output.cc (Output_reloc::get_address): New function, broken out
15133 of write_rel.
15134 (Output_reloc::write_rel): Call it.
15135 (Output_reloc::compare): New function.
15136 (Output_data_reloc_base::do_write): Optionally sort relocs.
15137
60b2b4e7
ILT
15138 * configure.ac: If targ_extra_obj is set, link it in.
15139 * configure.tgt: Initialize all variables.
15140 (x86_64*): Set targ_extra_obj and targ_extra_size.
15141 * configure: Rebuild.
15142
8825ac63
ILT
15143 * object.cc (Sized_relobj::include_section_group): Adjust section
15144 indexes read from group data. Build vector to pass to
15145 layout_group.
15146 * layout.cc (Layout::layout_group): Add flags and shndxes
15147 parameters. Remove contents parameter. Change caller. Update
15148 explicit instantiations.
15149 * layout.h (class Layout): Update layout_group declaration.
15150 * output.cc (Output_data_group::Output_data_group): Add flags and
15151 input_shndxes parameters. Remove contents parameter. Change
15152 caller.
15153 (Output_data_group::do_write): Change input_sections_ to
15154 input_shndxes_.
15155 * output.h (class Output_data_group): Update constructor
15156 declaration. Rename input_sections_ to input_shndxes_.
15157 * testsuite/many_sections_test.cc: Add template.
15158
e94cf127
CC
151592008-04-30 Cary Coutant <ccoutant@google.com>
15160
4418b2d5
CC
15161 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15162
e94cf127
CC
15163 * layout.cc (Layout::include_section): Refactored check for debug
15164 info section.
15165 (Layout::add_comdat): Add new parameters. Change type
15166 of signature parameter. Add object and shndx to signatures table.
15167 (Layout::find_kept_object): New function.
15168 * layout.h: Include <cstring>.
15169 (Layout::is_debug_info_section): New function.
15170 (Layout::add_comdat): Add new parameters.
15171 (Layout::find_kept_object): New function.
15172 (Layout::Kept_section): New struct.
15173 (Layout::Signatures): Change type of map range.
15174 * object.cc (Relobj::output_section_address): New function.
15175 (Sized_relobj::include_section_group): Add new parameters. Change
15176 calls to Layout::add_comdat. Change to build table of kept comdat
15177 groups and table mapping discarded sections to kept sections.
15178 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15179 (Sized_relobj::do_layout): Change calls to include_section_group and
15180 include_linkonce_section.
15181 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15182 value to zero when section is discarded.
15183 (Sized_relobj::map_to_kept_section): New function.
15184 * object.h (Relobj::output_section_address): New function.
15185 (Relobj::Comdat_group): New type.
15186 (Relobj::find_comdat_group): New function.
15187 (Relobj::Comdat_group_table): New type.
15188 (Relobj::Kept_comdat_section): New type.
15189 (Relobj::Kept_comdat_section_table): New type.
15190 (Relobj::add_comdat_group): New function.
15191 (Relobj::set_kept_comdat_section): New function.
15192 (Relobj::get_kept_comdat_section): New function.
15193 (Relobj::comdat_groups_): New field.
15194 (Relobj::kept_comdat_sections_): New field.
15195 (Symbol_value::input_value): Update comment.
15196 (Sized_relobj::map_to_kept_section) New function.
15197 (Sized_relobj::include_linkonce_section): Add new parameter.
15198 * target-reloc.h (Comdat_behavior): New type.
15199 (get_comdat_behavior): New function.
15200 (relocate_section): Add code to map a discarded section to the
15201 corresponding kept section when applying a relocation.
15202
e4e5049b
CS
152032008-04-30 Craig Silverstein <csilvers@google.com>
15204
15205 * dwarf_reader.cc (next_generation_count): New static var.
15206 (Addr2line_cache_entry): New struct.
15207 (addr2line_cache): New static var.
15208 (Dwarf_line_info::one_addr2line): Added caching.
15209 (Dwarf_line_info::clear_addr2line_cache): New function.
15210 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15211 cache-size parameter.
15212 (Dwarf_line_info::one_addr2line_cache): New function.
15213 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15214 new cache-size argument to one_addr2line(), and clear cache.
15215
d09e9154
CC
152162008-04-28 Cary Coutant <ccoutant@google.com>
15217
15218 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15219 R_386_PC8 relocations.
15220
7ef73768
ILT
152212008-04-23 Ian Lance Taylor <iant@google.com>
15222
55438702
ILT
15223 * object.cc (Sized_relobj::include_section_group): Check for
15224 invalid section group.
15225
c165fb93
ILT
15226 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15227 header size.
15228
7ef73768
ILT
15229 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15230 than read for file header.
15231 * archive.cc (Archive::include_member): Likewise.
15232
6194aaab
L
152332008-04-23 Paolo Bonzini <bonzini@gnu.org>
15234
15235 * aclocal.m4: Regenerate.
15236 * configure: Regenerate.
15237
d491d34e
ILT
152382008-04-19 Ian Lance Taylor <iant@google.com>
15239
5ea2bac6
ILT
15240 * version.cc (version_string): Bump to 1.6.
15241
7bc3e21a
ILT
15242 * testsuite/Makefile.am (many_sections_r_test): New target.
15243 (many_sections_r_test_SOURCES): Remove.
15244 (many_sections_r_test_DEPENDENCIES): Remove.
15245 (many_sections_r_test_LDFLAGS): Remove.
15246 (many_sections_r_test_LDADD): Remove.
15247
7fcd3aa9
ILT
15248 * object.cc (Sized_relobj::do_add_symbols): Always pass
15249 local_symbol_count_ to add_from_relobj.
15250
4c94d6ae
ILT
15251 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15252 every thousand variables.
15253 * testsuite/Makefile.in: Rebuild.
15254
d491d34e
ILT
15255 * object.cc (Xindex::initialize_symtab_xindex): New function.
15256 (Xindex::read_symtab_xindex): New function.
15257 (Xindex::sym_xindex_to_shndx): New function.
15258 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15259 available.
15260 (Sized_relobj::do_initialize_xindex): New function.
15261 (Sized_relobj::do_read_symbols): Adjust section links.
15262 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15263 parameter. Change all callers.
15264 (Sized_relobj::include_section_group): Adjust section links and
15265 symbol section indexes.
15266 (Sized_relobj::do_layout): Adjust section links.
15267 (Sized_relobj::do_count_local_symbols): Adjust section links and
15268 symbol section indexes.
15269 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15270 ordinary and special symbols.
15271 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15272 dynsym_xindex parameters. Change all callers. Adjust section
15273 links. Use SHN_XINDEX when needed.
15274 (Sized_relobj::get_symbol_location_info): Adjust section links.
15275 Don't get fooled by special symbols.
15276 * object.h (class Xindex): Define.
15277 (class Object): Add xindex_ parameter. Declare virtual functoin
15278 do_initialize_xindex.
15279 (Object::adjust_sym_shndx): New function.
15280 (Object::set_xindex): New protected function.
15281 (class Symbol_value): Add is_ordinary_shndx_ field.
15282 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15283 (Symbol_value::value): Assert ordinary section.
15284 (Symbol_value::initialize_input_to_output_map): Likewise.
15285 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15286 Change all callers.
15287 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15288 all callers.
15289 (class Sized_relobj): Update declarations.
15290 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15291 parameter. Change all callers.
15292 (Sized_relobj::adjust_shndx): New function.
15293 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15294 field.
15295 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15296 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15297 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15298 (Sized_dynobj::read_dynsym_section): Adjust section links.
15299 (Sized_dynobj::read_dynamic): Likewise.
15300 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15301 section links.
15302 (Sized_dynobj::do_initialize_xindex): New function.
15303 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15304 do_initialize_xindex.
15305 (Sized_dynobj::adjust_shndx): New function.
15306 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15307 dynsym_xindex_ fields.
15308 (Layout::finalize): Add a call to set_section_indexes before
15309 creating the symtab sections.
15310 (Layout::set_section_indexes): Don't do anything if the section
15311 already has a section index.
15312 (Layout::create_symtab_sections): Add shnum parameter. Change
15313 caller. Create .symtab_shndx section if needed.
15314 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15315 caller.
15316 (Layout::allocated_output_section_count): New function.
15317 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15318 needed.
15319 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15320 fields. Update declarations.
15321 (Layout::symtab_xindex): New function.
15322 (Layout::dynsym_xindex): New function.
15323 (class Write_symbols_task): Add layout_ field.
15324 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15325 Change caller.
15326 * output.cc (Output_section_headers::Output_section_headers): Add
15327 shstrtab_section parameter. Change all callers.
15328 (Output_section_headers::do_sized_write): Store overflow values
15329 for section count and section string table section index in
15330 section header zero.
15331 (Output_file_header::do_sized_write): Check for overflow of
15332 section count and section string table section index.
15333 (Output_symtab_xindex::do_write): New function.
15334 (Output_symtab_xindex::endian_do_write): New function.
15335 * output.h (class Output_section_headers): Add shstrtab_section_.
15336 Update declarations.
15337 (class Output_symtab_xindex): Define.
15338 (Output_section::has_out_shndx): New function.
15339 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15340 field.
15341 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15342 Change all callers.
15343 (Sized_symbol::init): Likewise.
15344 (Symbol::output_section): Check for ordinary symbol.
15345 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15346 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15347 callers.
15348 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15349 Change all callers. Simplify handling of symbols from sections
15350 not included in the link.
15351 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15352 distinction.
15353 (Weak_alias_sorter::operator()): Assert that symbols are
15354 ordinary.
15355 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15356 distinction.
15357 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15358 parameters. Change all callers.
15359 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15360 symbol distinction. Use SHN_XINDEX when needed.
15361 (Symbol_table::write_section_symbol): Add symtab_xindex
15362 parameter. Change all callers.
15363 (Symbol_table::sized_write_section_symbol): Likewise. Use
15364 SHN_XINDEX when needed.
15365 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15366 declarations.
15367 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15368 (Symbol::is_defined): Check is_ordinary.
15369 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15370 (Symbol::is_absolute, Symbol::is_common): Likewise.
15371 (class Sized_symbol): Update declarations.
15372 (class Symbol_table): Update declarations.
15373 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15374 parameters. Change all callers.
15375 (Sized_symbol::override): Likewise.
15376 (Symbol_table::override): Likewise.
15377 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15378 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15379 is_ordinary, and orig_st_shndx parameters. Change all callers.
15380 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15381 to be in an ordinary section.
15382 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15383 object and is_ordinary parameters. Change all callers.
15384 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15385 Change all callers. Don't add undefined or non-ordinary symbols
15386 to reloc_map_.
15387 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15388 Change all callers.
15389 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15390 declarations.
15391 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15392 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15393 (Sized_relobj::relocate_sections): Likewise.
15394 * target-reloc.h (scan_relocs): Adjust section symbol index.
15395 (scan_relocatable_relocs): Likewise.
15396 * i386.cc (Scan::local): Check for ordinary symbols.
15397 * sparc.cc (Scan::local): Likewise.
15398 * x86_64.cc (Scan::local): Likewise.
15399 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15400 to symbol_section_and_value.
15401 * testsuite/many_sections_test.cc: New file.
15402 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15403 (check_PROGRAMS): Add many_sections_test.
15404 (many_sections_test_SOURCES): Define.
15405 (many_sections_test_DEPENDENCIES): Define.
15406 (many_sections_test_LDFLAGS): Define.
15407 (BUILT_SOURCES): Add many_sections_define.h.
15408 (many_sections_define.h): New target.
15409 (BUILT_SOURCES): Add many_sections_check.h.
15410 (many_sections_check.h): New target.
15411 (check_PROGRAMS): Add many_sections_r_test.
15412 (many_sections_r_test_SOURCES): Define.
15413 (many_sections_r_test_DEPENDENCIES): Define.
15414 (many_sections_r_test_LDFLAGS): Define.
15415 (many_sections_r_test_LDADD): Define.
15416 (many_sections_r_test.o): New target.
15417 * testsuite/Makefile.in: Rebuild.
15418
c5818ff1
CC
154192008-04-17 Cary Coutant <ccoutant@google.com>
15420
15421 * errors.cc (Errors::info): New function.
15422 (gold_info): New function.
15423 * errors.h (Errors::info): New function.
15424 * gold.h (gold_info): New function.
15425 * object.cc (Input_objects::add_object): Print trace output.
15426 * options.cc (options::parse_set): New function.
15427 (General_options::parse_wrap): Deleted.
15428 (General_options::General_options): Deleted initializer.
15429 * options.h (options::String_set): New typedef.
15430 (options::parse_set): New function.
15431 (DEFINE_set): New macro.
15432 (General_options::wrap): Changed to use DEFINE_set. Changed
15433 callers of any_wrap_symbols and is_wrap_symbol.
15434 (General_options::trace, General_options::trace_symbol):
15435 New options.
15436 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15437 (General_options::wrap_symbols_): Deleted.
15438 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15439
b5be4a7c
DM
154402008-04-17 David S. Miller <davem@davemloft.net>
15441
15442 * options.cc (General_options::parse_V): New function.
15443 * options.h: Add entries for -V and -Qy.
15444
155a0dd7
ILT
154452008-04-17 Ian Lance Taylor <iant@google.com>
15446
15447 * common.cc (Symbol_table::allocate_commons): Remove options
15448 parameter. Change caller.
15449 (Symbol_table::do_allocate_commons): Remove options parameter.
15450 Change caller. Just call do_allocate_commons_list twice.
15451 (Symbol_table::do_allocate_commons_list): New function, broken out
15452 of do_allocate_commons.
15453 * common.h (class Allocate_commons_task): Remove options_ field.
15454 Update constructor.
15455 * symtab.cc (Symbol_table::Symbol_table): Initialize
15456 tls_commons_.
15457 (Symbol_table::add_from_object): Put TLS common symbols on
15458 tls_commons_ list.
15459 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15460 which are IN_OUTPUT_DATA.
15461 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15462 allocate_commons and do_allocate_commons declarations. Declare
15463 do_allocate_commons_list.
15464 * gold.cc (queue_middle_tasks): Update creation of
15465 Allocate_commons_task to not pass options.
15466 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15467 (TLS_TEST_C_FLAGS): New variable.
15468 (tls_test_c_pic.o): New target.
15469 (tls_test_shared.so): Link in tls_test_c_pic.o.
15470 (tls_test_c_pic_ie.o): New target.
15471 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15472 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15473 (tls_test_c.o): New target.
15474 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15475 (tls_pic_test_LDADD): Likewise.
15476 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15477 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15478 (tls_test_c_gnu2.o): New target.
15479 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15480 tls_test_c_gnu2.o.
15481 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15482 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15483 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15484 * testsuite/tls_test.cc: Include "config.h".
15485 (t_last): Call t11_last.
15486 * testsuite/tls_test.h (t11, t11_last): Declare.
15487 * testsuite/tls_test_c.c: New file.
15488 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15489 * configure.ac: Check for OpenMP support.
15490 * configure, config.in, Makefile.in: Rebuild.
15491 * testsuite/Makefile.in: Rebuild.
15492
edfbb029
CC
154932008-04-16 Cary Coutant <ccoutant@google.com>
15494
15495 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15496 (Target_i386::tls_base_symbol_defined_): New field.
15497 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15498 (Target_i386::Scan::global): Likewise.
15499 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15500 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15501 (Target_x86_64::tls_base_symbol_defined_): New field.
15502 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15503 (Target_x86_64::Scan::global): Likewise.
15504
f3c69fca
CC
155052008-04-16 Cary Coutant <ccoutant@google.com>
15506
15507 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15508 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15509 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15510 building shared libraries.
15511 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15512 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15513 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15514 * testsuite/Makefile.in: Rebuild.
15515 * testsuite/weak_undef.h: New file.
15516 * testsuite/weak_undef_file1.cc: Add extra test cases.
15517 * testsuite/weak_undef_file2.cc: Likewise.
15518 * testsuite/weak_undef_test.cc: Likewise.
15519
7c414435
DM
155202008-04-16 David S. Miller <davem@davemloft.net>
15521
32b769e1
DM
15522 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15523 Add issued_non_pic_error_ field. Declare check_non_pic.
15524 (Target_sparc::Scan::check_non_pic): New function.
15525 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15526 (Target_sparc::Scan::global): Likewise.
15527
11936fb1
DM
15528 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15529 * configure: Rebuild.
15530
7c414435
DM
15531 * options.h (DEFINE_enable): New macro.
15532 (new_dtags): New enable option.
15533 (initfirst, interpose, loadfltr, nodefaultlib,
15534 nodelete, nodlopen, nodump): New -z options.
15535 * layout.cc (Layout:finish_dynamic_section): If new
15536 dtags enabled, emit DT_RUNPATH. Also, emit a
15537 DT_FLAGS_1 containing any specified -z flags.
15538
85c7bf8b
ILT
155392008-04-16 Ian Lance Taylor <iant@google.com>
15540
12c0daef
ILT
15541 * copy-relocs.cc: New file.
15542 * copy-relocs.h: New file.
15543 * reloc.cc: Remove Copy_relocs code.
15544 * reloc.h: Likewise.
15545 * reloc-types.h (struct Reloc_types) [both versions]: Add
15546 get_reloc_addend_noerror.
15547 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15548 variants of add_global which take an addend which must be zero.
15549 * i386.cc: Include "copy-relocs.h".
15550 (class Target_i386): Change type of copy_relocs_ to variable,
15551 update initializer.
15552 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15553 Change all callers.
15554 (Target_i386::do_finalize_sections): Change handling of
15555 copy_relocs_.
15556 * sparc.cc: Include "copy-relocs.h".
15557 (class Target_sparc): Change type of copy_relocs_ to variable,
15558 update initializer.
15559 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15560 Change all callers.
15561 (Target_sparc::do_finalize_sections): Change handling of
15562 copy_relocs_.
15563 * x86_64.cc: Include "copy-relocs.h".
15564 (class Target_x86_64): Change type of copy_relocs_ to variable,
15565 update initializer.
15566 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15567 class. Change all callers.
15568 (Target_x86_64::do_finalize_sections): Change handling of
15569 copy_relocs_.
15570 * Makefile.am (CCFILES): Add copy-relocs.cc.
15571 (HFILES): Add copy-relocs.h.
15572
4f4995b6
ILT
15573 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15574
85c7bf8b
ILT
15575 * testsuite/script_test_4.sh: Permit leading zeroes.
15576
4f2a9edd
ILT
155772008-04-15 Ian Lance Taylor <iant@google.com>
15578
e6188289
ILT
15579 * script-sections.cc (Script_sections::create_segments): Use
15580 header_size_adjustment even when there is enough room for the
15581 headers.
15582 * testsuite/script_test_4.sh: New file.
15583 * testsuite/script_test_4.t: New file.
15584 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15585 (check_DATA): Add script_test_4.stdout.
15586 (MOSTLYCLEANFILES): Likewise.
15587 (script_test_4): New target.
15588 (script_test_4.stdout): New target.
15589 * testsuite/Makefile.in: Rebuild.
15590
4f2a9edd
ILT
15591 * sparc.cc: Add definitions for Output_data_plt_sparc class
15592 constants.
15593
f5314dd5
DM
155942008-04-14 David S. Miller <davem@davemloft.net>
15595
15596 * sparc.cc: New file.
15597 * Makefile.am (TARGETSOURCES): Add sparc.cc
15598 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15599 * configure.tgt: Document targ_extra_size and
15600 targ_extra_big_endian. Add entries for sparc-* and
15601 sparc64-*.
15602 * configure.ac: Handle targ_extra_size and
15603 targ_extra_big_endian.
15604 * Makefile.in: Rebuild.
15605 * configure: Likewise.
15606 * po/POTFILES.in: Likewise.
15607 * po/gold.pot: Likewise.
15608
154e0e9a
ILT
156092008-04-14 Ian Lance Taylor <iant@google.com>
15610
15611 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15612 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15613 in the name/type/flags to section mapping. Don't call
15614 allocate_output_section.
15615 (Layout::choose_output_section): Change parameter from adjust_name
15616 to is_input_section. Don't permit input sections after sections
15617 are attached to segments. Don't call allocate_output_section.
15618 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15619 not write_enable_output_section.
15620 (Layout::make_output_section): Don't push to
15621 unattached_section_list_ nor call attach_to_segment. Call
15622 attach_section_to_segment if sections are attached.
15623 (Layout::attach_sections_to_segments): New function.
15624 (Layout::attach_section_to_segment): New function.
15625 (Layout::attach_allocated_section_to_segment): Rename from
15626 attach_to_segment. Remove flags parameter.
15627 (Layout::allocate_output_section): Remove function.
15628 (Layout::write_enable_output_section): Remove function.
15629 * layout.h (class Layout): Update for above changes. Add new
15630 field sections_are_attached_.
15631 * output.h (Output_section::update_flags_for_input_section): New
15632 function.
15633 * output.cc (Output_section::add_input_section): Call
15634 update_flags_for_input_section.
15635 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15636
009a67a2
CC
156372008-04-11 Cary Coutant <ccoutant@google.com>
15638
15639 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15640 thought unnecessary.
15641 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15642
759b1a24
ILT
156432008-04-11 Ian Lance Taylor <iant@google.com>
15644
15645 * output.h (class Output_section_data): Remove inline definition
15646 of set_addralign.
15647 * output.cc (Output_section_data::set_addralign): New function.
15648
c2b45e22
CC
156492008-04-11 Cary Coutant <ccoutant@google.com>
15650
15651 Add support for TLS descriptors for i386 and x86_64.
15652 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15653 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15654 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15655 GOT_TYPE_TLS_DESC.
15656 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15657 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15658 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15659 relocations.
15660 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15661 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15662 Fix problem with initial-exec relocations.
15663 (Target_i386::Relocate::relocate_tls): Likewise.
15664 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15665 relaxation.
15666 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15667 support for section-plus-offset dynamic table entries.
15668 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15669 (Output_data_dynamic::Dynamic_entry): Add support for
15670 section-plus-offset dynamic table entries.
15671 (Output_data_dynamic::Classification): Likewise.
15672 (Output_data_dynamic::classification_): Renamed offset_.
15673 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15674 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15675 (Target_x86_64::make_plt_section): New function.
15676 (Target_x86_64::reserve_tlsdesc_entries): New function.
15677 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15678 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15679 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15680 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15681 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15682 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15683 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15684 add extra PLT entry for TLS descriptors.
15685 (Output_data_plt_x86_64::got_): New field.
15686 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15687 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15688 fields.
15689 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15690 descriptors.
15691 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15692 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15693 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15694 R_386_TLS_DESC_CALL relocations.
15695 (Target_x86_64::Scan::global): Likewise.
15696 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15697 for TLS descriptors.
15698 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15699 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15700 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15701 GD-to-IE relaxation.
15702 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15703 and TLS_DESCRIPTORS.
15704 * Makefile.in: Rebuild.
15705 * configure: Rebuild.
15706 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15707 (tls_test_shared2.so): New target.
15708 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15709 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15710 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15711 (tls_shared_gd_to_ie_test_LDADD): New variable.
15712 (tls_shared_gnu2_gd_to_ie_test): New target.
15713 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15714 New targets.
15715 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15716 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15717 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15718 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15719 (tls_shared_gnu2_test): New target.
15720 (tls_test_gnu2_shared.so): New target.
15721 (tls_shared_gnu2_test_SOURCES): New variable.
15722 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15723 (tls_shared_gnu2_test_LDFLAGS): New variable.
15724 (tls_shared_gnu2_test_LDADD): New variable.
15725 * testsuite/Makefile.in: Rebuild.
15726 * testsuite/Makefile.
15727
83bfb6b7
ILT
157282008-04-11 Ian Lance Taylor <iant@google.com>
15729
15730 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15731 justsyms.t.
15732 * testsuite/Makefile.in: Rebuild.
15733
15734 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15735 long.
15736 * testsuite/script_test_2.cc (main): Adjust test.
15737
706e1f5e
ILT
157382008-04-11 David S. Miller <davem@davemloft.net>
15739 Ian Lance Taylor <iant@google.com>
15740
15741 * options.h (General_options): Add entries for '-Y' and
15742 '-relax'.
15743 * options.cc (General_options:finalize): If -Y was used, add those
15744 entries to the library path instead of the default "/lib" and
15745 "/usr/lib".
15746
7c98e6bb
DM
157472008-04-11 David S. Miller <davem@davemloft.net>
15748
15749 * testsuite/justsyms.t: Start at 0x100.
15750 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15751 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15752 long.
15753 * testsuite/script_test_2.cc: Adjust string and section length
15754 checks.
7c98e6bb 15755
99a37bfd
ILT
157562008-04-09 Ian Lance Taylor <iant@google.com>
15757
2cefc357
ILT
15758 PR gold/5996
15759 * script-sections.cc (Sections_element::allocate_to_segment): Add
15760 orphan parameter.
15761 (Output_section_definition::allocate_to_segment): Likewise.
15762 (Orphan_output_section::allocate_to_segment): Likewise.
15763 (Script_sections::attach_sections_using_phdrs_clause): Don't
15764 propagate non-PT_LOAD segments to orphan sections.
15765 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15766 readelf rather than objdump.
15767 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15768 .interp section and PT_INTERP segment are the same size.
15769 * testsuite/Makefile.in: Rebuild.
15770
99a37bfd
ILT
15771 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15772 aliases for symbols defined in the same object.
15773 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15774 (weak_alias_test_SOURCES): New variable.
15775 (weak_alias_test_DEPENDENCIES): New variable.
15776 (weak_alias_test_LDFLAGS): New variable.
15777 (weak_alias_test_LDADD): New variable.
15778 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15779 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15780 (weak_alias_test_3.o): New target.
15781 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15782 * testsuite/weak_alias_test_main.cc: New file.
15783 * testsuite/weak_alias_test_1.cc: New file.
15784 * testsuite/weak_alias_test_2.cc: New file.
15785 * testsuite/weak_alias_test_3.cc: New file.
15786
780e49c5
ILT
157872008-04-08 Ian Lance Taylor <iant@google.com>
15788
cdb0b8f5
ILT
15789 * options.h (class General_options): Add --noinhibit-exec option.
15790 * main.cc (main): Check --noinhibit-exec.
15791
0864d551
ILT
15792 * options.h (class General_options): Define --wrap as a special
15793 option. Add wrap_symbols_ field.
15794 (General_options::any_wrap_symbols): New function.
15795 (General_options::is_wrap_symbol): New function.
15796 * options.cc (General_options::parse_wrap): New function.
15797 (General_options::General_options): Initialize wrap_symbols_.
15798 * symtab.cc (Symbol_table::wrap_symbol): New function.
15799 (Symbol_table::add_from_object): Handle --wrap.
15800 * symtab.h (class Symbol_table): Declare wrap_symbol.
15801 * target.h (Target::wrap_char): New function.
15802 (Target::Target_info): Add wrap_char field.
15803 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15804 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15805 * testsuite/testfile.cc (Target_test::test_target_info):
15806 Likewise.
15807
789aa6de
ILT
15808 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15809 there is one.
15810
2c38906f
ILT
15811 * layout.h (class Layout): Add added_eh_frame_data_ field.
15812 * layout.cc (Layout::Layout): Initialize new field.
15813 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15814 output section until we find a section we merged successfully.
15815 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15816 that the size be non-zero.
15817
780e49c5
ILT
15818 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15819 qualifier.
15820
7fcd0256
ILT
158212008-04-08 Craig Silverstein <csilvers@google.com>
15822
15823 * configure.ac: Export new conditional variable HAVE_ZLIB.
15824 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15825 on HAVE_ZLIB.
15826 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15827 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15828
6835af53
ILT
158292008-04-07 Ian Lance Taylor <iant@google.com>
15830
e24f324c
ILT
15831 * version.cc (version_string): Set to "1.5".
15832
a036edd8
ILT
15833 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15834 Add issued_non_pic_error_ field. Declare check_non_pic.
15835 (Target_x86_64::Scan::check_non_pic): New function.
15836 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15837 (Target_x86_64::Scan::global): Likewise.
15838
624f8810
ILT
15839 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15840 addend parameter. Change caller. Handle merge sections.
15841 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15842 Address to Addend. Don't add in the result of
15843 local_section_offset, pass down the addend and use the returned
15844 value.
15845 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15846 Update declarations of local_section_offset and symbol_value.
15847 * testsuite/two_file_test_1.cc (t18): New function.
15848 * testsuite/two_file_test_2.cc (f18): New function.
15849 * testsuite/two_file_test_main.cc (main): Call t18.
15850 * testsuite/two_file_test.h (t18, f18): Declare.
15851
6835af53
ILT
15852 * configure.ac: Don't test for objdump, c++filt, or readelf.
15853 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15854 conditionals.
15855 (TEST_READELF): New variable.
15856 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15857 (check_PROGRAMS): Add two_file_strip_test.
15858 (two_file_strip_test): New target.
15859 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15860 (two_file_same_shared_strip_test_SOURCES): New variable.
15861 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15862 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15863 (two_file_same_shared_strip_test_LDADD): New variable.
15864 (two_file_shared_strip.so): New target.
15865 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15866 (ver_test_5.syms, ver_test_7.syms): Likewise.
15867 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15868 (strip_test_3.stdout): Use TEST_OBJDUMP.
15869 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15870
86925eef
CC
158712008-04-04 Cary Coutant <ccoutant@google.com>
15872
15873 * symtab.h (Symbol::is_weak_undefined): New function.
15874 (Symbol::is_strong_undefined): New function.
15875 (Symbol::is_absolute): New function.
15876 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15877 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15878 absolute symbols.
15879 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15880 (weak_undef_test): New target.
15881 * testsuite/Makefile.in: Rebuild.
15882 * testsuite/weak_undef_file1.cc: New file.
15883 * testsuite/weak_undef_file2.cc: New file.
15884 * testsuite/weak_undef_test.cc: New file.
15885
126f3ece
ILT
158862008-04-03 Craig Silverstein <csilvers@google.com>
15887
15888 * compressed_output.h (class Output_compressed_section): Use
15889 unsigned buffer.
15890 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15891 add zlib header.
15892 (zlib_compressed_suffix): Removed.
15893 (Output_compressed_section::set_final_data_size): Use unsigned
15894 buffers.
15895 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15896 Fix linker invocation.
15897 (flagstest_o_specialfile_and_compress_debug_sections):
15898 Likewise.
15899 * testsuite/Makefile.in: Regenerated.
15900
deae2a14
DM
159012008-04-02 David S. Miller <davem@davemloft.net>
15902
15903 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15904 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15905
70752818
ILT
159062008-04-02 Craig Silverstein <csilvers@google.com>
15907
15908 * TODO: New file.
15909
39d0cb0e
ILT
159102008-04-02 Ian Lance Taylor <iant@google.com>
15911
15912 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15913 parameters. Update for new key type to views_. Change all
15914 callers.
15915 (File_read::read): Adjust for byteshift in returned view.
15916 (File_read::add_view): New function, broken out of
15917 find_and_make_view.
15918 (File_read::make_view): New function, broken out of
15919 find_and_make_view.
15920 (File_read::find_or_make_view): Add offset and aligned
15921 parameters. Rewrite accordingly. Change all callers.
15922 (File_read::get_view): Add offset and aligned parameters. Adjust
15923 for byteshift in return value.
15924 (File_read::get_lasting_view): Likewise.
15925 * fileread.h (class File_read): Update declarations.
15926 (class File_read::View): Add byteshift_ field. Add byteshift to
15927 constructor. Add byteshift method.
15928 * archive.h (Archive::clear_uncached_views): New function.
15929 (Archive::get_view): Add aligned parameter. Change all callers.
15930 * object.h (Object::get_view): Add aligned parameter. Change all
15931 callers.
15932 (Object::get_lasting_view): Likewise.
15933
15934 * fileread.cc (File_read::release): Don't call clear_views if
15935 there are multiple objects.
15936 * fileread.h (File_read::clear_uncached_views): New function.
15937 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15938 on the archive.
15939
a1207466
CC
159402008-03-31 Cary Coutant <ccoutant@google.com>
15941
15942 Add thin archive support.
15943 * archive.cc (Archive::armagt): New const.
15944 (Archive::setup): Remove task parameter and calls to unlock.
15945 (Archive::unlock_nested_archives): New function.
15946 (Archive::read_header): Add nested_off parameter. Change
15947 all callers.
15948 (Archive::interpret_header): Likewise.
15949 (Archive::include_all_members): Change to handle thin
15950 archives.
15951 (Archive::include_member): Likewise.
15952 * archive.h (Archive::Archive): Add new parameters and
15953 initializers.
15954 (Archive::armagt): New const.
15955 (Archive::setup): Remove task parameter.
15956 (Archive::unlock_nested_archives): New function.
15957 (Archive::read_header): Add nested_off parameter.
15958 (Archive::interpret_header): Likewise.
15959 (Archive::Nested_archive_table): New typedef.
15960 (Archive::is_thin_archive_): New field.
15961 (Archive::nested_archives_): New field.
15962 (Archive::options_): New field.
15963 (Archive::dirpath_): New field.
15964 (Archive::task_): New field.
15965 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15966 for thin archives. Pass additional parameters to
15967 Archive::Archive. Unlock the archive file after calling
15968 Archive::setup.
cd536b21 15969
479f6503
ILT
159702008-03-29 Ian Lance Taylor <iant@google.com>
15971
686c8caf
ILT
15972 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15973 version symbol to be local.
15974 * testsuite/ver_test_4.sh: New file.
15975 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15976 (check_DATA): Add ver_test_4.syms.
15977 (ver_test_4.syms): New target.
15978 * testsuite/Makefile.in: Rebuild.
15979
ab794b6b
ILT
15980 * output.cc
15981 (Output_section::Input_section_sort_entry::has_priority): New
15982 function.
15983 (Output_section::Input_section_sort_entry::match_file_name): New
15984 function.
15985 (Output_section::Input_section_sort_entry::match_section_name):
15986 Remove.
15987 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15988 Remove.
15989 (Output_section::Input_section_sort_entry::match_section_file):
15990 Remove.
15991 (Output_section::Input_section_sort_compare::operator()): Rewrite
15992 using new Input_section_sort_entry functions. Sort crtbegin and
15993 crtend first. Sort sections with no priority before sections with
15994 a priority.
15995 * testsuite/initpri1.c (d3): Check j != 4.
15996 (cd5): New constructor/destructor function.
15997 (main): Check j != 2.
15998
479f6503
ILT
15999 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16000 new symbol when resolving, don't call set_is_default.
16001 * testsuite/ver_test_7.cc: New file.
16002 * testsuite/ver_test_7.sh: New file.
16003 * testsuite/Makefile.am (ver_test_7.so): New target.
16004 (ver_test_7.o): New target.
16005 (check_SCRIPTS): Add ver_test_7.sh.
16006 (check_DATA): Add ver_test_7.syms.
16007 (ver_test_7.syms): New target.
16008
2fd32231
ILT
160092008-03-28 Ian Lance Taylor <iant@google.com>
16010
16011 * layout.cc (Layout::layout): If we see an input section with a
16012 name that needs sorting, set the must_sort flag for the output
16013 section.
16014 (Layout::make_output_section): If the name of the output section
16015 indicates that it might require sorting, set the may_sort flag.
16016 * output.h (Output_section::may_sort_attached_input_sections): New
16017 function.
16018 (Output_section::set_may_sort_attached_input_sections): New
16019 function.
16020 (Output_section::must_sort_attached_input_sections): New
16021 function.
16022 (Output_section::set_must_sort_attached_input_sections): New
16023 function.
16024 (class Output_section): Declare Input_section_sort_entry. Define
16025 Input_section_sort_compare. Declare
16026 sort_attached_input_sections. Add new fields:
16027 may_sort_attached_input_sections_,
16028 must_sort_attached_input_sections_,
16029 attached_input_sections_are_sorted_.
16030 * output.cc (Output_section::Output_section): Initialize new
16031 fields.
16032 (Output_section::add_input_section): Add an entry to
16033 input_sections_ if may_sort or must_sort are true.
16034 (Output_section::set_final_data_size): Call
16035 sort_attached_input_sections if necessary.
16036 (Output_section::Input_section_sort_entry): Define new class.
16037 (Output_section::Input_section_sort_compare::operator()): New
16038 function.
16039 (Output_section::sort_attached_input_sections): New function.
16040 * configure.ac: Check whether the compiler supports constructor
16041 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16042 * testsuite/initpri1.c: New file.
16043 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16044 CONSTRUCTOR_PRIORITY.
16045 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16046 (initpri1_LDFLAGS): New variable.
16047 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16048
18e6b24e
ILT
160492008-03-27 Ian Lance Taylor <iant@google.com>
16050
49bdd526
ILT
16051 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16052 * testsuite/common_test_1.c: New file.
16053 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16054 (common_test_1_SOURCES): New variable.
16055 (common_test_1_DEPENDENCIES): New variable.
16056 (common_test_1_LDFLAGS): New variable.
16057
18e6b24e
ILT
16058 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16059 and commons_ correctly when NAME/VERSION does not override
16060 NAME/NULL.
16061 * testsuite/ver_test_6.c: New file.
16062 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16063 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16064 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16065
04bf7072
ILT
160662008-03-26 Ian Lance Taylor <iant@google.com>
16067
5871526f
ILT
16068 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16069 of an undefined symbol from a version script.
16070 * testsuite/Makefile.am (ver_test_5.so): New target.
16071 (ver_test_5.o): New target.
16072 (check_SCRIPTS): Add ver_test_5.sh.
16073 (check_DATA): Add ver_test_5.syms.
16074 (ver_test_5.syms): New target.
16075 * testsuite/ver_test_5.cc: New file.
16076 * testsuite/ver_test_5.script: New file.
16077 * testsuite/ver_test_5.sh: New file.
16078 * Makefile.in, testsuite/Makefile.in: Rebuild.
16079
04bf7072
ILT
16080 PR gold/5986
16081 Fix problems building gold with gcc 4.3.0.
16082 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16083 (gold_error_at_location, gold_warning_at_location): Use it.
16084 * configure.ac: Check whether we can compile and use a template
16085 function with a printf attribute.
16086 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16087 when jumping over bytes.
16088 * object.cc: Instantiate Object::read_section_data.
16089 * debug.h: Include <cstring>
16090 * dwarf_reader.cc: Include <algorithm>
16091 * main.cc: Include <cstring>.
16092 * options.cc: Include <cstring>.
16093 * output.cc: Include <cstring>.
16094 * script.cc: Include <cstring>.
16095 * script.h: Include <string>.
16096 * symtab.cc: Include <cstring> and <algorithm>.
16097 * target-select.cc: Include <cstring>.
16098 * version.cc: Include <string>.
16099 * testsuite/testmain.cc: Include <cstdlib>.
16100 * configure, config.in: Rebuild.
16101
874c5b28
ILT
161022008-03-25 Ian Lance Taylor <iant@google.com>
16103
819d6c3a
ILT
16104 * options.cc: Include "../bfd/bfdver.h".
16105 (options::help): Print bug reporting address.
16106
f4b2c6f5
ILT
16107 * version.cc (print_version): Adjust output for current value of
16108 BFD_VERSION_STRING.
16109
16110 * NEWS: New file.
16111
e96caa79
ILT
16112 * options.cc (options::help): Print list of supported targets.
16113 * target-select.h: Include <vector>.
16114 (class Target_selector): Make machine_, size_, and is_big_endian_
16115 fields const. Add bfd_name_ and instantiated_target_ fields.
16116 (Target_selector::Target_selector): Add bfd_name parameter.
16117 (Target_selector::recognize): Make non-virtual, call
16118 do_recognize.
16119 (Target_selector::recognize_by_name): Make non-virtual, call
16120 do_recognize_by_name.
16121 (Target_selector::supported_names): New function.
16122 (Target_selector::bfd_name): New function.
16123 (Target_selector::do_instantiate_target): New pure virtual
16124 function.
16125 (Target_selector::do_recognize): New virtual function.
16126 (Target_selector::do_recognize_by_name): New virtual function.
16127 (Target_selector::instantiate_target): New private function.
16128 (supported_target_names): Declare.
16129 * target-select.cc (Target_selector::Target_selector): Update for
16130 new parameter and fields.
16131 (select_target_by_name): Check that the name matches before
16132 calling recognize_by_name.
16133 (supported_target_names): New function.
16134 * i386.cc (class Target_selector_i386): Update Target_selector
16135 constructor call. Remove recognize and recognize_by_name. Add
16136 do_instantiate_target.
16137 * x86_64.cc (class Target_selector_x86_64): Likewise.
16138 * testsuite/testfile.cc (class Target_selector_test): Update for
16139 changes to Target_selector.
16140
874c5b28
ILT
16141 * README: Rewrite, with some notes on unsupported features.
16142
0a65a3a7
CC
161432008-03-24 Cary Coutant <ccoutant@google.com>
16144
16145 * i386.cc (Target_i386::Got_type): New enum declaration.
16146 (Target_i386::Scan::local): Updated callers of Output_data_got
16147 member functions.
16148 (Target_i386::Scan::global): Likewise.
16149 (Target_i386::Relocate::relocate): Likewise.
16150 (Target_i386::Relocate::relocate_tls): Likewise.
16151 * object.h (Got_offset_list): New class.
16152 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16153 (Sized_relobj::local_got_offset): Likewise.
16154 (Sized_relobj::set_local_got_offset): Likewise.
16155 (Sized_relobj::local_has_tls_got_offset): Removed.
16156 (Sized_relobj::local_tls_got_offset): Removed.
16157 (Sized_relobj::set_local_tls_got_offset): Removed.
16158 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16159 * output.cc (Output_data_got::add_global): Added got_type parameter.
16160 (Output_data_got::add_global_with_rel): Likewise.
16161 (Output_data_got::add_global_with_rela): Likewise.
16162 (Output_data_got::add_global_pair_with_rel): New function.
16163 (Output_data_got::add_global_pair_with_rela): New function.
16164 (Output_data_got::add_local): Added got_type parameter.
16165 (Output_data_got::add_local_with_rel): Likewise.
16166 (Output_data_got::add_local_with_rela): Likewise.
16167 (Output_data_got::add_local_pair_with_rel): New function.
16168 (Output_data_got::add_local_pair_with_rela): New function.
16169 (Output_data_got::add_global_tls): Removed.
16170 (Output_data_got::add_global_tls_with_rel): Removed.
16171 (Output_data_got::add_global_tls_with_rela): Removed.
16172 (Output_data_got::add_local_tls): Removed.
16173 (Output_data_got::add_local_tls_with_rel): Removed.
16174 (Output_data_got::add_local_tls_with_rela): Removed.
16175 * output.h (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 * resolve.cc (Symbol::override_base_with_special): Removed
16192 reference to has_got_offset_ field.
16193 * symtab.cc (Symbol::init_fields): Replaced initialization
16194 of got_offset_ with got_offsets_. Removed initialization
16195 of has_got_offset_
53fcba31 16196 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16197 (Symbol::got_offset): Likewise.
16198 (Symbol::set_got_offset): Likewise.
16199 (Symbol::has_tls_got_offset): Removed.
16200 (Symbol::tls_got_offset): Removed.
16201 (Symbol::set_tls_got_offset): Removed.
16202 (Symbol::got_offset_): Removed.
16203 (Symbol::tls_mod_got_offset_): Removed.
16204 (Symbol::tls_pair_got_offset_): Removed.
16205 (Symbol::got_offsets_): New field.
16206 (Symbol::has_got_offset): Removed.
16207 (Symbol::has_tls_mod_got_offset): Removed.
16208 (Symbol::has_tls_pair_got_offset): Removed.
16209 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16210 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16211 member functions.
16212 (Target_x86_64::Scan::global): Likewise.
16213 (Target_x86_64::Relocate::relocate): Likewise.
16214 (Target_x86_64::Relocate::relocate_tls): Likewise.
16215
bd52eafb
BE
162162008-03-25 Ben Elliston <bje@au.ibm.com>
16217
16218 * yyscript.y: Fix spelling error in comment.
16219
8b105e34
ILT
162202008-03-24 Ian Lance Taylor <iant@google.com>
16221
8ed814a9
ILT
16222 * options.h (class General_options): Define build_id option.
16223 * layout.h (class Layout): Declare write_build_id, create_note,
16224 create_build_id. Add build_id_note_ member.
16225 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16226 "libiberty.h", "md5.h", "sha1.h".
16227 (Layout::Layout): Initialize eh_frame_data_,
16228 eh_frame_hdr_section_, and build_id_note_.
16229 (Layout::finalize): Call create_build_id.
16230 (Layout::create_note): New function, broken out of
16231 Layout::create_gold_note.
16232 (Layout::create_gold_note): Call create_note.
16233 (Layout::create_build_id): New function.
16234 (Layout::write_build_id): New function.
16235 (Close_task_runner::run): Call write_build_id.
16236
8b105e34
ILT
16237 * x86_64.cc: Correct license to GPLv3.
16238
086a1841
ILT
162392008-03-23 Ian Lance Taylor <iant@google.com>
16240
16241 * options.cc: Include "demangle.h".
16242 (parse_optional_string): New function.
16243 (parse_long_option): Handle takes_optional_argument.
16244 (parse_short_option): Update dash_z initializer. Handle
16245 takes_optional_argument.
16246 (General_options::General_options): Initialize do_demangle_.
16247 (General_options::finalize): Set do_demangle_. Handle demangling
16248 style.
16249 * options.h (parse_optional_string): Declare.
16250 (struct One_option): Add optional_arg field. Update constructor.
16251 Update call constructor calls. Add takes_optional_argument
16252 function.
16253 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16254 (DEFINE_optional_string): Define.
16255 (General_options::demangle): Change from DEFINE_bool to
16256 DEFINE_optional_string.
16257 (General_options::no_demangle): New function.
16258 (General_options::do_demangle): New function.
16259 (General_options::set_do_demangle): New function.
16260 (General_options::execstack_status_): Move definition to end of
16261 class definition.
16262 (General_options::static_): Likewise.
16263 (General_options::do_demangle_): New field.
16264 * object.cc (big_endian>::get_symbol_location_info): Call
16265 Options::do_demangle, not Options::demangle.
16266 * symtab.cc (demangle): Likewise.
16267
cbb93e63
ILT
162682008-03-22 Ian Lance Taylor <iant@google.com>
16269
16270 * gold.h: Include <cstddef> and <sys/types.h>
16271 * options.h: Include <cstring>.
16272
ec531623
ILT
162732008-03-21 Ian Lance Taylor <iant@google.com>
16274
16275 * Added source code to GNU binutils.
752937aa 16276\f
4b95cf5c 16277Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16278
16279Copying and distribution of this file, with or without modification,
16280are permitted in any medium without royalty provided the copyright
16281notice and this notice are preserved.
16282
16283Local Variables:
16284mode: change-log
16285left-margin: 8
16286fill-column: 74
16287version-control: never
16288End:
This page took 1.043456 seconds and 4 git commands to generate.