Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
43b64deb
CC
12014-11-25 Cary Coutant <ccoutant@google.com>
2
3 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
4 (Binary_to_elf::write_symbol): Add st_size parameter.
5 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
6
c924eb67
CC
72014-11-25 Cary Coutant <ccoutant@google.com>
8
9 PR gold/17639
10 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
11 (Sized_relobj_file::do_layout): Handle deferred sections properly
12 during GC pass 1. Don't add reloc sections to deferred list twice.
13 * object.h (Sized_relobj_file::is_deferred_layout): New function.
14 (Sized_relobj_file::is_deferred_layout_): New data member.
15
9d585188
L
162014-11-21 H.J. Lu <hongjiu.lu@intel.com>
17
18 PR gold/17619
19 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
20 Check PC-relative offset overflow in PLT entry.
21
3ffaac20
AM
222014-11-21 Alan Modra <amodra@gmail.com>
23
24 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
25 for undefined weaks.
26
0cfb0717
AM
272014-11-20 Alan Modra <amodra@gmail.com>
28
29 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
30 from --stub-group-size parameter divided by 1024.
31 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
32 template parameter. Update all uses.
33 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
34 has_stub_value. Set for long branches. Don't report overflow for
35 branch to undefined weak symbols. Print info message on
36 overflowing branch to stub.
37
f9dffbf0
AM
382014-11-20 Alan Modra <amodra@gmail.com>
39
40 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
41
e88ba8d5
L
422014-11-13 H.J. Lu <hongjiu.lu@intel.com>
43
44 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
45 entry for R_X86_64_GOTPLT64.
46 (Target_x86_64<size>::Relocate::relocate): Update comments for
47 R_X86_64_GOTPLT64.
48
d37ffe25
ED
492014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
50
51 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
52 * plugin.h: add lock definition
53
9726c3c1
HS
542014-10-29 Han Shen <shenhan@google.com>
55 Jing Yu <jingyu@google.com>
56
57 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
58 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
59 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
60 Symbol::TLS_REF.
61 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
62 method.
63 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
64 (Target_aarch64::tls_ld_to_le): New method.
65 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
66 for 64bit targets.
67 (Output_data_plt_aarch64::irelative_rel_): New data member.
68 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
69 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
70 (Output_data_plt_aarch64::add_relocation): New method.
71 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
72 offset. Add got_irelative size to got size.
73 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
74 type string with the new typename.
75 (AArch64_relocate_functions::update_adr): Replace parameter x with
76 immed.
77 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
78 (AArch64_relocate_functions::reloc_common): New method.
79 (AArch64_relocate_funcsions::rela_general): Extract common part out
80 into reloc_common method.
81 (AArch64_relocate_functions::rela_general): Likewise.
82 (AArch64_relocate_functions::pcrela_general): Likewise.
83 (AArch64_relocate_functions::adr): New method.
84 (AArch64_relocate_functions::adrp): Calculate immed before calling
85 update_adr.
86 (AArch64_relocate_functions::adrp): Likewise.
87 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
88 comparing x to 0. Calculate immed from ~x when x < 0.
89 (Target_aarch64::optimize_tls_reloc): Add new cases for
90 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
91 TLSLD_MOVW_DTPREL_G0_NC.
92 (Target_aarch64::possible_function_pointer_reloc): Implement this
93 method.
94 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
95 comment.
96 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
97 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
98 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
99 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
100 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
101 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
102 (Target_aarch64::make_plt_entry): Call add_entry with two more
103 parameters.
104 (Target_aarch64::make_local_ifunc_plt_entry): New method.
105 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
106 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
107 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
108 (Target_aarch64::Relocate::relocate_tls): Add cases for
109 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
110 TLSLD_MOVW_DTPREL_G0_NC.
111 * testsuite/icf_safe_so_test.cc: Correct test comment.
112 * testsuite/icf_safe_test.sh: Add AArch64 arch.
113
80272b8c
AM
1142014-10-22 Alan Modra <amodra@gmail.com>
115
116 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
117 thread_starter.
118
998a69f4
AS
1192014-10-18 Andreas Schwab <schwab@linux-m68k.org>
120
121 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
122
aed56ec5
CC
1232014-10-17 Cary Coutant <ccoutant@google.com>
124
125 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
126 Add "typename" keyword.
127
83a01957
HS
1282014-09-22 Han Shen <shenhan@google.com>
129 Jing Yu <jingyu@google.com>
130
131 Patch for gold aarch64 backend to support relaxation.
132 * aarch64-reloc.def: Change format.
133 * aarch64.cc (class Reloc_stub): New class.
134 (class Stub_table): New class.
135 (class AArch64_relobj): New class.
136 (class AArch64_input_section): New class.
137 (class AArch64_output_section): New class.
138 (Target_aarch64::new_stub_table): New method.
139 (Target_aarch64::new_aarch64_input_section): New method.
140 (Target_aarch64::find_aarch64_input_section): New method.
141 (Target_aarch64::scan_section_for_stubs): New method.
142 (Target_aarch64::scan_reloc_section_for_stubs): New method.
143 (Target_aarch64::relocate_stub): New method.
144 (Target_aarch64::current_target): New method.
145 (Target_aarch64::do_make_elf_object): New method.
146 (Target_aarch64::do_may_relax): New method.
147 (Target_aarch64::do_relax): New method.
148 (Target_aarch64::group_sections): New method.
149 (Target_aarch64::scan_reloc_for_stub): New method.
150 (Target_aarch64::do_make_output_section): New method.
151 (Target_aarch64::stub_tables_): New data member.
152 (Target_aarch64::aarch64_input_section_map_): New data member.
153 (AArch64_relocate_functions::maybe_apply_stub): New method.
154
db4c9594
CC
1552014-09-30 Cary Coutant <ccoutant@google.com>
156
157 PR gold/17432
158 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
159
cd6da036
KC
1602014-09-30 Kito Cheng <kito@0xlab.org>
161
162 PR gold/13597
163 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
164 hash table before sysv-style hash table.
165
5f772412
ST
1662014-09-29 Sriraman Tallam <tmsriram@google.com>
167
168 * options.h (--pic-executable): Add negative to alias to -no-pie.
169
5efeedf6
CC
1702014-09-26 Cary Coutant <ccoutant@google.com>
171
172 PR gold/16773
173 * object.cc (Sized_relobj_file): Compute value of section symbols
174 for TLS sections the same as TLS symbols.
175
1707f183
CC
1762014-09-25 Cary Coutant <ccoutant@google.com>
177
178 PR gold/17432
179 * resolve.cc (Symbol_table::resolve): Override common placeholder
180 symbols, but adjust sizes.
181 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
182 symbols to common lists.
183
00cac886
AM
1842014-09-24 Alan Modra <amodra@gmail.com>
185
186 * po/POTFILES.in: Regenerate.
187
635aa30e
CC
1882014-09-23 Taiju Tsuiki <tzik@google.com>
189 Cary Coutant <ccoutant@google.com>
190
71b9b91b 191 PR gold/14860
635aa30e
CC
192 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
193 on input_sections_blocker.
194 * layout.cc (Write_sections_task::locks): Unblock
195 input_sections_blocker_.
196 * layout.h (Write_sections_task::Write_sections_task): Add
197 input_sections_blocker.
198 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
199 to DEPENDENCIES.
200 * testsuite/Makefile.in: Regenerate.
201
c0c71592
RÁE
2022014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
203
204 * testsuite/Makefile.am (plugin_test_10): New test.
205 * testsuite/Makefile.in: Regenerate
206 * testsuite/plugin_common_test_2.c (c1): Align to 8.
207 * testsuite/plugin_test_10.sh: New file.
208
6168c2a1
RÁE
2092014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
210
211 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
212 * resolve.cc (Symbol_table::resolve): Don't override common symbols
213 during the replacement phase.
214
3a531937
JY
2152014-09-17 Han Shen <shenhan@google.com>
216 Jing Yu <jingyu@google.com>
217
218 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
219 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
220 * aarch64.cc (Target_aarch64): Add data members
221 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
222 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
223 constructor.
224 (Target_aarch64::do_reloc_symbol_index): New method.
225 (Target_aarch64::do_reloc_addend): New method.
226 (Target_aarch64::add_tlsdesc_info): New method.
227 (Target_aarch64::do_dynsym_value): New method.
228 (Target_aarch64::do_make_data_plt): Add new parameters: got,
229 got_irelative. Pass them to Output_data_plt_aarch64_standard.
230 (Target_aarch64::make_data_plt): Add new parameters: got,
231 got_irelative. Pass them to do_make_data_plt.
232 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
233 (Target_aarch64::Relocate:tls_gd_to_le): New method.
234 (Target_aarch64::Relocate:tls_ie_to_le): New method.
235 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
236 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
237 (Target_aarch64::got_tlsdesc_section): New method.
238 (Target_aarch64::make_local_ifunc_plt_entry): New method.
239 (Target_aarch64::define_tls_base_symbol): New method.
240 (Target_aarch64::reserve_tlsdesc_entries): New method.
241 (Target_aarch64::got_mod_index_entry): New method.
242 (Target_aarch64::rela_tlsdesc_section): New method.
243 (Target_aarch64::rela_irelative_section): New method.
244 (Target_aarch64::Tlsdesc_info): New struct.
245 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
246 relocations and tlsdesc relocations.
247 (Target_aarch64::optimize_tls_reloc): Implement method.
248 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
249 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
250 in constructor.
251 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
252 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
253 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
254 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
255 (Output_data_plt_aarch64::rela_tlsdesc): New method.
256 (Output_data_plt_aarch64::rela_irelative): New method.
257 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
258 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
259 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
260 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
261 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
262 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
263 (Output_data_plt_aarch64_standard): New member variables:
264 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
265 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
266 New parameter: got, got_irelative.
267 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
268 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
269 (Output_data_plt_aarch64::do_write): Replace got_address with
270 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
271 (AArch64_relocate_functions::update_movnz): New method.
272 (AArch64_relocate_functions): Correct format.
273 (AArch64_relocate_functions::movnz): New method.
274 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
275 before the switch. Add new cases to switch.
00cac886 276 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
277 tlsgd tlsdesc cases.
278 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
279 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
280 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
281 Call reloc_name_in_error_message to print unsupported reloc.
282 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
283 make_data_plt.
284 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
285 relocs. Fill in some more dynamic tags.
286 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
287 Skip call tls_get_addr when tlsgd is relaxed.
288 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
289 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
290 tlsdesc->ie relaxation.
291
62661c93
SS
2922014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
293
294 * mips.cc (Target_mips_nacl): New class.
295 (Target_selector_mips_nacl): New class.
296 (target_selector_mips32): Rename from target_selector_mips32be and use
297 Target_selector_mips_nacl instead of Target_selector_mips.
298 (target_selector_mips32el): Rename from target_selector_mips32 and use
299 Target_selector_mips_nacl instead of Target_selector_mips.
300 (target_selector_mips64): Rename from target_selector_mips64be and use
301 Target_selector_mips_nacl instead of Target_selector_mips.
302 (target_selector_mips64el): Rename from target_selector_mips64 and use
303 Target_selector_mips_nacl instead of Target_selector_mips.
304 (Target_mips::mips_info): Add const attribute.
305
54674d38
CC
3062014-09-02 Cary Coutant <ccoutant@google.com>
307
308 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
309 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
310 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
311 (Sized_incr_dynobj::do_section_name): Likewise.
312 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
313 (Sized_incr_dynobj::do_section_name): Likewise.
314 * object.h (Object::section_name): Likewise.
315 (Object::do_section_name): Likewise.
316 (Sized_relobj_file::do_section_name): Likewise.
317 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
318 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
319
9860cbcf
CC
3202014-09-02 Cary Coutant <ccoutant@google.com>
321
322 PR gold/17005
323 * ehframe.cc (Fde::write): Add output_offset parameter.
324 (Cie::write): Likewise.
325 (Eh_frame::set_final_data_size): Account for offset within output
326 section.
327 (Eh_frame::do_sized_write): Likewise.
328 * ehframe.h (Fde::write): Add output_offset parameter.
329 (Cie::write): Likewise.
330 * output.cc (Output_section::Input_section_sort_entry): Remove
331 section_has_name_; add output_section_name parameter. Use
332 output section name for non-input sections.
333 (Output_section::Input_section_sort_entry::section_has_name): Remove.
334 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
335 (Output_section::Input_section_sort_compare): Remove logic for
336 sections without names.
337 (Output_section::Input_section_sort_init_fini_compare): Likewise.
338 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
339 Likewise.
340 (Output_section::Input_section_sort_section_name_compare): Likewise.
341
8e33481e
HS
3422014-08-29 Han Shen <shenhan@google.com>
343 Jing Yu <jingyu@google.com>
344
345 * aarch64-reloc-property.cc
346 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
347 reference reloc property in the table.
348 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
349 3 other entries.
350 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
351 2 new overloaded methods.
352 (Output_data_got_aarch64::do_write): Add code to write out
353 static relocs.
354 (class Output_data_got_aarch64::Static_reloc): New class to wrap
355 static relocs.
356 (Output_data_got_aarch64::static_relocs): New vector to
357 hold static relocs.
358 (Target_aarch64::TCB_SIZE): New const static memeber.
359 (Target_aarch64::tcb_size): New method.
360 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
361 (Target_aarch64::Relocate::relocate_tls): New method.
362 (Target_aarch64::Scan::local): Add code handling new reloc types.
363 (Target_aarch64::Scan::global): Add code handling new reloc types.
364
81233653
ST
3652014-08-13 Sriraman Tallam <tmsriram@google.com>
366
367 * options.h (-no-pie): Add option.
368
9363c7c3
JY
3692014-08-08 Jing Yu <jingyu@google.com>
370 Han Shen <shenhan@google.com>
371
372 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
373 (DEFFILES): add aarch64-reloc.def.
374 (TARGETSOURCES): Add aarch64-reloc-property.cc.
375 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
376 * Makefile.in: Regenerate.
377 * aarch64-reloc-property.cc: New file.
378 * aarch64-reloc-property.h: New file.
379 * aarch64-reloc.def: New file.
380 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
381 with tab to make the format consistent.
382 (Output_data_got_aarch64::symbol_table_): New method.
383 (Target_aarch64::do_plt_address_for_global): New method.
384 (Target_aarch64::do_plt_address_for_local): New method.
385 (Target_aarch64::do_select_as_default_target): New method.
386 (Target_aarch64::do_make_data_plt): New method.
387 (Target_aarch64::make_data_plt): New method.
388 (Output_data_plt_aarch64::has_irelative_section): New method.
389 (Output_data_plt_aarch64::address_for_global): New method.
390 (Output_data_plt_aarch64::address_for_local): New method.
391 (Output_data_plt_aarch64::irelative_rel_): New parameter.
392 (Output_data_plt_aarch64::add_entry): Implement contents.
393 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
394 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
395 the got_pov entry to plt0.
396 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
397 Implement contents.
398 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
399 (AArch64_howto): New struct.
400 (aarch64_howto[]): New static const array.
401 (AArch64_relocate_functions): New class.
402 (Target_aarch64::Scan::get_reference_flags): Remove method.
403 (Target_aarch64::Scan::local): Implement to support a few relocations.
404 (Target_aarch64::Scan::global): Implement to support a few relocations.
405 (Target_aarch64::make_plt_section): Implement contents.
406 (Target_aarch64::make_plt_entry): Implement contents.
407 (Target_aarch64::do_finalize_sections): Implement contents.
408 (Target_aarch64::Relocate::relocate): Implement a few relocations.
409 (Target_aarch64::relocate_section): Implement contents.
410
ad9fe6c1
AM
4112014-08-06 Alan Modra <amodra@gmail.com>
412
413 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
414
7cd4e5b7
AM
4152014-08-06 Alan Modra <amodra@gmail.com>
416
417 PR 13227
418 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
419
5ad9b0a7
ST
4202014-07-21 Sriraman Tallam <tmsriram@google.com>
421
422 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 423 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 424
e051745c
CC
4252014-07-08 Cary Coutant <ccoutant@google.com>
426
427 * expression.cc (struct Expression::Expression_eval_info): Add
428 new fields type_pointer, vis_pointer, and nonvis_pointer.
429 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
430 nonvis_pointer parameters. Adjust all calls.
431 (Symbol_expression::value): Update type, visibility, and nonvis bits
432 in caller.
433 * script.cc (Symbol_assignment::sized_finalize): Update type,
434 visibility, and remaining st_other bits for new symbol.
435 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
436 vis_pointer, and nonvis_pointer parameters.
437 * symtab.h (Symbol::set_type): New method.
438
439 * testsuite/Makefile.am (defsym_test): New test.
440 * testsuite/Makefile.in: Regenerate.
441 * testsuite/defsym_test.c: New file.
442 * testsuite/defsym_test.sh: New file.
443
f35c4853
CC
4442014-07-08 Cary Coutant <ccoutant@google.com>
445
446 PR gold/15639
447 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
448 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
449 (Sized_dynobj::base_read_symbols): ...new method.
450 * object.h (Sized_relobj_file::base_read_symbols): New method.
451 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
452 (Sized_relobj_file::base_read_symbols): ...new method.
453 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
454 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
455 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
456
2900af2d
AM
4572014-07-04 Alan Modra <amodra@gmail.com>
458
459 * po/POTFILES.in: Regenerate.
460
053a4d68
JY
4612014-07-02 Jing Yu <jingyu@google.com>
462
463 * aarch64.cc: New file
464 * Makefile.am (TARGETSOURCES): Add aarch64.cc
465 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
466 * Makefile.in: Regenerate.
467 * configure.tgt: Add entries for aarch64*.
468 * configure.ac: Likewise.
469 * configure: Likewise.
470
7b549045
AM
4712014-06-27 Alan Modra <amodra@gmail.com>
472
473 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
474
cb818dbf
CC
4752014-06-24 Cary Coutant <ccoutant@google.com>
476
477 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
478 sections.
479 (Dwo_file::sized_read_unit_index): Likewise.
480
9810d34d
SS
4812014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
482
483 * mips.cc: New file.
484 * Makefile.am (TARGETSOURCES): Add mips.cc
485 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
486 * configure.tgt: Add entries for mips*.
487 * configure.ac: Likewise.
488 * Makefile.in: Regenerate.
489 * configure: Likewise.
490
9baa787b
CC
4912014-06-09 Cary Coutant <ccoutant@google.com>
492
493 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
494 unit_length is within section bounds.
495
8f89af0a
CC
4962014-06-09 Cary Coutant <ccoutant@google.com>
497
498 PR gold/16980
499 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
500 map.
501
a47622ac
AM
5022014-06-07 Alan Modra <amodra@gmail.com>
503
504 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
505
4320c691
CC
5062014-06-06 Cary Coutant <ccoutant@google.com>
507
508 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
509 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
510 (Dwarf_pubnames_table::read_header): Likewise.
511 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
512 .debug_gnu_pubtypes.
513
270c9937
JB
5142014-06-05 Joel Brobecker <brobecker@adacore.com>
515
516 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
517 * Makefile.in, configure: Regenerate.
518
397998fc
AM
5192014-06-03 Alan Modra <amodra@gmail.com>
520
521 * powerpc.cc (addis_12_2): Define.
522 (Stub_table::do_write): Support fusion on ELFv2 stubs.
523
61f5c66f
AM
5242014-06-03 Alan Modra <amodra@gmail.com>
525
526 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
527 st_other output.
528
f6971787
AM
5292014-06-02 Alan Modra <amodra@gmail.com>
530
531 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
532 Only ignore relocs on ELFv1.
533 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
534
f6fb8322
CC
5352014-05-30 Cary Coutant <ccoutant@google.com>
536
537 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
538 * testsuite/Makefile.in: Regenerate.
539 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
540
c23dd342
L
5412014-05-27 H.J. Lu <hongjiu.lu@intel.com>
542
543 PR gold/16945
544 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
545 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
546
5fe7ffdc
AM
5472014-05-15 Alan Modra <amodra@gmail.com>
548
549 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
550 Compare FDE contents with DW_CFA_nop rather than 0.
551
a82bef93
ST
5522014-05-13 Sriraman Tallam <tmsriram@google.com>
553
554 * symtab.h (may_need_copy_reloc): Remove check for position independent
555 code.
556 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
557 position independence before pc absolute may_need_copy_reloc call.
558 Add check for executable output befor pc relative may_need_copy_reloc
559 call.
560 * i386.cc: Ditto.
561 * arm.cc: Ditto.
562 * sparc.cc: Ditto.
563 * tilegx.cc: Ditto.
564 * powerpc.cc: Add check for no position independence before
565 may_need_copy_reloc calls.
566 * testsuite/pie_copyrelocs_test.cc: New file.
567 * testsuite/pie_copyrelocs_shared_test.cc: New file.
568 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 569 * Makefile.in: Regenerate.
a82bef93 570
53c66605
ML
5712014-05-08 Martin Liška <mliska@suse.cz>
572
573 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
574
57b2284c
CC
5752014-05-06 Cary Coutant <ccoutant@google.com>
576
577 PR gold/16900
578 * i386.cc (Output_data_got_plt_i386): New class.
579 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
580 parameter. Change all callers.
581 (Output_data_plt_i386::layout_): Remove.
582 (Output_data_plt_i386::got_plt_): Change type.
583 (Target_i386::got_plt_): Change type. Change all references.
584 (Target_i386::got_section): Create instance of new class.
585 (Output_data_got_plt_i386::do_write): New function.
586 * x86_64.cc (Output_data_got_plt_x86_64): New class.
587 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
588 parameter. Change all callers.
589 (Output_data_plt_x86_64::layout_): Remove.
590 (Output_data_plt_x86_64::got_plt_): Change type.
591 (Target_x86_64::got_plt_): Change type. Change all references.
592 (Target_x86_64::got_section): Create instance of new class.
593 (Output_data_got_plt_x86_64::do_write): New function.
594 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
595 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
596 class.
597
6b97515d 5982014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 599
6b97515d
CC
600 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
601 if we have pubnames/pubtypes.
602
d1bddd3c
CC
6032014-05-02 Cary Coutant <ccoutant@google.com>
604
5fe7ffdc
AM
605 * defstd.cc (in_segment): Define __ehdr_start here...
606 * layout.cc (Layout::finalize): ...Instead of here. Set the
607 output segment when known.
608 * resolve.cc (Symbol::override_base_with_special): Remember
609 the original binding.
610 * symtab.cc (Symbol::set_output_segment): New function.
611 (Symbol::set_undefined): New function.
612 * symtab.h (Symbol::is_weak_undefined): Check original undef
613 binding.
614 (Symbol::is_strong_undefined): New function.
615 (Symbol::set_output_segment): New function.
616 (Symbol::set_undefined): New function.
617 * target-reloc.h (is_strong_undefined): Remove.
618 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
619 Check for hidden undefs.
620 (relocate_section): Call Symbol::is_strong_undefined.
621
622 * testsuite/Makefile.am (ehdr_start_test_1)
623 (ehdr_start_test_2, ehdr_start_test_3)
624 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
625 * testsuite/Makefile.in: Regenerate.
626 * testsuite/ehdr_start_def.cc: New source file.
627 * testsuite/ehdr_start_test.cc: New source file.
628 * testsuite/ehdr_start_test.t: New linker script.
629 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 630
7849f6d8
CC
6312014-04-23 Cary Coutant <ccoutant@google.com>
632
bf2cc635 633 PR gold/16870
7849f6d8
CC
634 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
635
99fd8cff
CC
6362014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
637
638 * layout.cc (Layout::include_section): Allow a target to decide
639 whether to include a section.
640 * target.h (Target::should_include_section): New function.
641 (Target::do_should_include_section): New function.
642
91f43acd
CC
6432014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
644
645 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
646 inline into ...
647 (Copy_relocs::emit): ... here.
648 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
649 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
650 (Copy_reloc_entry::entries_): Change from private to protected.
651
c4eb27e1
ST
6522014-04-02 Sriraman Tallam <tmsriram@google.com>
653
654 * icf.cc (get_section_contents): Replace copies of reloc
655 vectors with const references.
656
ae447ddd
CC
6572014-04-02 Cary Coutant <ccoutant@google.com>
658
659 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
660 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
661 * configure: Regenerate.
662 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
663 -fno-use-linker-plugin.
664 (LINK1, CXXLINK1): Add it to the link command.
665 * testsuite/Makefile.in: Regenerate.
666
fa47fa92
AM
6672014-03-12 Alan Modra <amodra@gmail.com>
668
669 * Makefile.in: Regenerate.
670
9b12c500
CC
6712014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
672
673 * symtab.h (Symbol::set_nonvis): New function.
674
beacaa96
CC
6752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
676
677 * symtab.cc (Sized_symbol<32>::init_output_data):
678 Instantiate the template.
679 (Sized_symbol<64>::init_output_data): Likewise.
680
800d9823
CC
6812014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
682
683 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
684 adjust dynamic symbol value.
685 * target.h (Target::adjust_dyn_symbol): New function.
686 (Target::do_adjust_dyn_symbol): New function.
687
918fc1f8 6882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 689
918fc1f8
CC
690 * output.cc (Output_data_dynamic::Dynamic_entry::write):
691 Get the value of DYNAMIC_CUSTOM dynamic entry.
692 * output.h (Output_data_dynamic::add_custom): New function.
693 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
694 dynamic entry.
695 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
696 * target.h (Target::dynamic_tag_custom_value): New function.
697 (Target::do_dynamic_tag_custom_value): New function.
698
98ff9231
CC
6992014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
700
701 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
702 dynsym indexes.
703 * target.h (Target::has_custom_set_dynsym_indexes): New function.
704 (Target::do_has_custom_set_dynsym_indexes): New function.
705 (Target::set_dynsym_indexes): New function.
706 (Target::do_set_dynsym_indexes): New function.
707
b80eed39
AM
7082014-03-07 Alan Modra <amodra@gmail.com>
709
710 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
711 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
712 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
713 (Powerpc_relocate_functions::has_overflow_bitfield,
714 overflowed): Use the above.
715 (Target_powerpc::Relocate::relocate): Correct overflow checking
716 for a number of relocations. Modify overflow test for 16-bit
717 fields in instructions to signed/unsigned according to whether
718 the field takes a signed or unsigned value.
719
4b95cf5c
AM
7202014-03-05 Alan Modra <amodra@gmail.com>
721
722 Update copyright years.
723
45965137
AM
7242014-03-05 Alan Modra <amodra@gmail.com>
725
726 * powerpc.cc (Target_powerpc::Scan::local, global): Support
727 R_PPC64_ADDR64_LOCAL.
728 (Target_powerpc::Relocate::relocate): Likewise.
729
2c80b753
AM
7302014-03-03 Alan Modra <amodra@gmail.com>
731
732 * dwp.cc (print_version): Update copyright year to current.
733
c1c69e83
AM
7342014-02-10 Alan Modra <amodra@gmail.com>
735
736 * po/gold.pot: Regenerate.
737
dd0c4e70
CC
7382014-02-06 Cary Coutant <ccoutant@google.com>
739
740 Fix problem where -u is ignored when a weak undef is seen.
741
742 * archive.cc (Library_base::should_include_member): Reorder
743 code to check for -u option if a weak undef has already been seen.
744 * testsuite/Makefile.am (weak_undef_test_2): New test case.
745 * testsuite/Makefile.in: Regenerate.
746 * testsuite/weak_undef_file3.cc: New file.
747 * testsuite/weak_undef_file4.cc: New file.
748 * testsuite/weak_undef_test_2.cc: New file.
749
1a221d3d
CC
7502014-02-05 Cary Coutant <ccoutant@google.com>
751
752 Fix issues with gold undefined symbol diagnostics.
753
754 PR binutils/15435
755 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
756 check to here.
757 * target-reloc.h (is_strong_undefined): New function.
758 (relocate_section): Move undef vtable symbol check from here.
759 Check for is_strong_undefined.
760
e889f0a4 7612014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 762
e889f0a4
CC
763 Fix problems with the --dynamic-list option.
764
765 PR gold/13577
766 * options.cc (General_options::parse_dynamic_list):
767 Set have_dynamic_list_.
768 (General_options::General_options): Initialize have_dynamic_list_.
769 (General_options::finalize): Turn off -Bsymbolic and
770 -Bsymbolic-functions if --dynamic-list provided.
771 * options.h (General_options::have_dynamic_list): New function.
772 (General_options::have_dynamic_list_): New data member.
773 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
774 correctly.
5fe7ffdc 775
e889f0a4
CC
776 PR gold/16530
777 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
778 in --dynamic-list, mark it.
5fe7ffdc 779
e889f0a4
CC
780 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
781 (dynamic_list_2): New test case.
782 * testsuite/Makefile.in: Regenerate.
783 * testsuite/dynamic_list_2.cc: New file.
784 * testsuite/dynamic_list_2.t: New file.
785 * testsuite/dynamic_list_lib1.cc: New file.
786 * testsuite/dynamic_list_lib2.cc: New file.
787 * testsuite/gc_dynamic_list_test.c: New file.
788 * testsuite/gc_dynamic_list_test.sh: New file.
789 * testsuite/gc_dynamic_list_test.t: New file.
790
ec673e64
CC
7912014-01-28 Cary Coutant <ccoutant@google.com>
792
793 Add .gdb_index version 7 support.
794
795 * gold/dwarf_reader.cc: include <utility> (for make_pair).
796 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
797 debug sections.
798 (Dwarf_ranges_table::read_ranges_table): Likewise.
799 (Dwarf_pubnames_table::read_section): Check for GNU-style
800 sections, and for compressed debug sections.
801 (Dwarf_pubnames_table::read_header): Compute end address of table.
802 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
803 for end of list by offset, not by offset == 0.
804 (Dwarf_info_reader::do_read_string_table): Check for compressed
805 debug sections.
806 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
807 Initialize new data members.
808 (Dwarf_pubnames_table::next_name): return flag_byte.
809 (Dwarf_pubnames_table::end_of_table_): New data member.
810 (Dwarf_pubnames_table::is_gnu_style_): New data member.
811 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
812 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
813 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
814 read skeleton type unit DIEs.
815 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
816 (Gdb_index::do_write): Write flag_byte.
817 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
818 (Gdb_index::Cu_vector): Store flags along with cu indexes.
819 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
820 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
821
221fd5d5
L
8222014-01-08 H.J. Lu <hongjiu.lu@intel.com>
823
824 * version.cc (print_version): Update copyright year to 2014.
825
6c09fb0b
ILT
8262013-12-19 Dimitry Andric <dimitry@andric.com>
827
828 * stringpool.cc (Stringpool_template::reserve): Add
829 HAVE_UNORDERED_MAP case.
830 * stringpool.cc (Stringpool_template::print_stats): Likewise.
831
8356f2d0
CC
8322013-12-18 Cary Coutant <ccoutant@google.com>
833
834 * configure.ac: Check for <unordered_set> and <unordered_map>.
835 * config.in: Regenerate.
836 * configure: Regenerate.
837 * system.h: Use <unordered_set> and <unordered_map> if available.
838
f2c7d7ee
RM
8392013-12-10 Roland McGrath <mcgrathr@google.com>
840
841 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
842 with $(INSTALL_PROGRAM_ENV).
843 * Makefile.in: Regenerate.
844
6632e8cc
CC
8452013-11-22 Cary Coutant <ccoutant@google.com>
846
847 * configure.ac: Add check for which library is needed for
848 dlopen.
849 * configure: Regenerate.
850
0c075858
CC
8512013-11-22 Cary Coutant <ccoutant@google.com>
852
853 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
854 assembler.
855 * testsuite/Makefile.in: Regenerate.
856
f49fe902
L
8572013-11-17 H.J. Lu <hongjiu.lu@intel.com>
858
859 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
860 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
861 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
862 (Target_x86_64<size>::Scan::local): Likewise.
863 (Target_x86_64<size>::Scan::global): Likewise.
864 (Target_x86_64<size>::Relocate::relocate): Likewise.
865 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
866 Likewise.
867 (Target_x86_64<size>::Scan::check_non_pic(): Handle
868 R_X86_64_PC32_BND.
869
870 * testsuite/Makefile.am (check_PROGRAMS): Add
871 exception_x86_64_bnd_test.
872 (exception_x86_64_bnd_test_SOURCES): New macro.
873 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
874 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
875 (exception_x86_64_bnd_test_LDADD): Likewise.
876 (exception_x86_64_bnd_1.o): New rule.
877 (exception_x86_64_bnd_2.o): Likewise.
878 * testsuite/Makefile.in: Regenerated.
879
9055360d
AM
8802013-11-15 Alan Modra <amodra@gmail.com>
881
882 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
883 accessor.
884 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
885 Only call ppc64_local_entry_offset for 64-bit. Restrict
886 symval_for_branch lookup to ELFv1.
887 (Stub_table::add_plt_call_entry): Use unsigned int off.
888 (Output_data_glink::Address, invalid_address): New.
889 (Output_data_glink::add_eh_frame): Move out of line. Add
890 support for ELFv2.
891 (Output_data_glink::add_global_entry, find_global_entry,
892 global_entry_address): New functions.
893 (Output_data_glink::global_entry_stubs_, end_branch_table_,
894 ge_size): New variables.
895 (Output_data_glink::set_final_data_size): Add global entry
896 stub sizing.
897 (Output_data_glink::do_write): Write global entry stubs.
898 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
899 parameter. Return true for ELFv2. Adjust callers.
900 (Target_powerpc::Scan::local, global): Restrict opd lookup to
901 ELFv1. Similarly for ifunc and dynamic relocation processing
902 specific to ELFv1. Recognize that symbols are defined on
903 their plt entries for ELFv2.
904 (Target_powerpc::symval_for_branch): Assert if called for
905 ELFv2 or ppc32.
906 (Target_powerpc::Relocate::relocate): Use global entry plt
907 stub for symbol value if such exists on ELFv2.
908 (Target_powerpc::Relocate::relocate): Don't call
909 symval_for_branch when ELFv2. Do adjust for local entry
910 offset when ELFv2.
911 (Target_powerpc::do_dynsym_value): Set symbols to global entry
912 plt stub for ELFv2.
913 (Target_powerpc::do_plt_address_for_global): Similarly.
914
cafdd569
CC
9152013-11-14 Cary Coutant <ccoutant@google.com>
916
917 Revert patch -- this did not fix the problem, and there is
918 no race there.
919
920 2013-11-14 Cary Coutant <ccoutant@google.com>
921
922 PR gold/14860
923 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
924 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
925 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
926 updating fde_offsets_.
927 (Eh_frame_hdr::lock_): New data member.
928
94e49e16
CC
9292013-11-14 Cary Coutant <ccoutant@google.com>
930
931 * dwp.cc (Dwo_file_entry): New type.
932 (File_list): Use Dwo_file_entry.
933 (Dwo_file::verify): New function.
934 (Dwo_file::verify_dwo_list): New function.
935 (Dwo_file::sized_verify_dwo_list): New function.
936 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
937 list.
938 (Dwp_options): New enum type.
939 (dwp_options): Add --verify-only.
940 (usage): Likewise.
941 (main): Likewise.
942 * dwp.h (gold_info): Add declaration.
943
7cdd7d57
CC
9442013-11-14 Cary Coutant <ccoutant@google.com>
945
946 PR gold/14860
947 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
948 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
949 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
950 updating fde_offsets_.
951 (Eh_frame_hdr::lock_): New data member.
952
1d946cb3
CC
9532013-11-06 Cary Coutant <ccoutant@google.com>
954
955 PR gold/15758
956 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
957 before reloc sections.
958
4f65b40e
AM
9592013-11-04 Alan Modra <amodra@gmail.com>
960
961 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
962 (Symbol::needs_dynamic_reloc): Test new flag.
963 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
964 (Target_powerpc::Scan::get_reference_flags): Add target param.
965 Return FUNC_DESC_ABI for 64-bit ELFv1.
966 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
967 call.
968 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
969 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
970
908794a9
CC
9712013-10-31 Cary Coutant <ccoutant@google.com>
972
973 Restore support for dwp v2 DWARF package file format.
974
975 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
976 tu_length parameter. Adjust all callers.
977 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
978 * dwp.cc: Include dwarf.h.
979 (Section_bounds): New struct type.
980 (Unit_set): New struct type.
981 (Dwo_file::Dwo_file): Initialize new data member.
982 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
983 Combine and rename to...
984 (Dwo_file::read_unit_index): ...this.
985 (Dwo_file::sized_read_compunit_index)
986 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
987 (Dwo_file::sized_read_unit_index): ...this.
988 (Dwo_file::copy_section): Remove section_name, is_str_offsets
989 parameters; add section_id parameter.
990 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
991 (Dwo_file::add_unit_set): ...this.
992 (Dwo_file::shndx_map_): Remove.
993 (Dwo_file::sect_offsets_): New data member.
994 (Dwp_output_file::Dwp_output_file): Initialize new data members.
995 (Dwp_output_file::add_section): Rename to...
996 (Dwp_output_file::add_contribution): ...this.
997 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
998 (Dwp_output_file::add_tu_set): Likewise.
999 (Dwp_output_file::Contribution): New type.
1000 (Dwp_output_file::Section::contributions): New data member.
1001 (Dwp_output_file::Cu_or_tu_set): Remove.
1002 (Dwp_output_file::Section::Section): New ctor.
1003 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1004 (Dwp_output_file::Dwp_index::Section_table): New type.
1005 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1006 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1007 parameter.
1008 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1009 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1010 (Dwp_output_file::Dwp_index::section_table): New member function.
1011 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1012 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1013 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1014 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1015 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1016 (Dwp_output_file::Dwp_index::section_table_): New data member.
1017 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1018 (Dwp_output_file::add_output_section): New member function.
1019 (Dwp_output_file::write_new_section): New member function.
1020 (Dwp_output_file::write_contributions): New member function.
1021 (Dwp_output_file::section_id_map_): New data member.
1022 (class Dwo_id_info_reader): Remove.
1023 (class Unit_reader): New class.
1024 (get_dwarf_section_name): New function.
1025 (Dwo_file::read_executable): Adjust initializations of class data.
1026 (Dwo_file::read): Add support for v2 package file format.
1027 (Dwo_file::read_unit_index): Likewise.
1028 (Dwo_file::sized_read_unit_index): Likewise.
1029 (Dwo_file::copy_section): Likewise.
1030 (Dwo_file::add_unit_set): Likewise.
1031 (Dwp_output_file::add_output_section): Likewise.
1032 (Dwp_output_file::add_contribution): Likewise.
1033 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1034 for empty slot.
1035 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1036 file format.
1037 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1038 slot.
1039 (Dwp_output_file::initialize): Remove unused function.
1040 (Dwp_output_file::finalize): Add support for v2 package file format.
1041 (Dwp_output_file::write_index): Likewise.
1042 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1043 function prototype.
1044
2500c017
CC
10452013-10-31 Cary Coutant <ccoutant@google.com>
1046
1047 * configure.ac: Fix check for -fmerge-constants.
1048 * configure.ac: Regenerate.
1049
dd0845d7
RM
10502013-10-30 Roland McGrath <mcgrathr@google.com>
1051
1052 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1053 Correct 9-byte nop sequence to match what the assembler generates.
1054
b4f7960d
AM
10552013-10-30 Alan Modra <amodra@gmail.com>
1056
1057 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1058 ppc64_local_entry_offset, ppc64_local_entry_offset,
1059 do_read_symbols): New functions.
1060 (Powerpc_relobj::e_flags_, st_other_): New vars.
1061 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1062 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1063 (Powerpc_relobj::e_flags_): New var.
1064 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1065 and adjust for ELFv2.
1066 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1067 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1068 (Powerpc_dynobj::do_find_special_sections): Likewise.
1069 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1070 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1071 to ELFv2 local entry.
1072 (Target_powerpc::do_relax): No thread safe barriers needed for
1073 ELFv2.
1074 (Output_data_plt_powerpc::initial_plt_entry_size_,
1075 plt_entry_size): Delete. Replace all uses with
1076 first_plt_entry_offset() and plt_entry_size().
1077 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1078 reserved_size parm. Update callers.
1079 (Output_data_plt_powerpc::entry_count): Update.
1080 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1081 and use Target_powerpc::first_plt_entry_offset().
1082 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1083 rename to plt_entry_size.
1084 (Output_data_plt_powerpc::add_ifunc_entry,
1085 add_local_ifunc_entry): Adjust reloc for ELFv2.
1086 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1087 (glink_eh_frame_fde_64v2): New.
1088 (Stub_table::plt_call_size): Support ELFv2 sizing.
1089 (Output_data_glink::add_eh_frame): Use the new FDE.
1090 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1091 (Stub_table::do_write): Write ELFv2 stubs and glink.
1092 (Target_powerpc::Relocate::relocate): Replaces nop after call
1093 with ld 2,24(1) and adjust local offset destination for ELFv2.
1094
f9c6b907
AM
10952013-10-30 Alan Modra <amodra@gmail.com>
1096
1097 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1098 (Target_powerpc::Scan::global, local): Likewise.
1099 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1100 on all ppc64 @h and @ha relocs.
1101
e84fe78f
AM
11022013-10-14 Alan Modra <amodra@gmail.com>
1103
1104 * output.h (Output_data_got::add_constant): Tidy.
1105 (Output_data_got::add_constant_pair): New function.
1106 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1107 methods used so as to first call reserve_ent().
1108
679e4abf
RM
11092013-10-11 Roland McGrath <mcgrathr@google.com>
1110
44dcb735
RM
1111 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1112 add_got_entry and add_got_entry_pair.
1113
13323c49
RM
1114 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1115 (HAVE_PUBNAMES): Likewise.
1116 * configure: Regenerate.
1117
1496b446
RM
1118 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1119 * testsuite/Makefile.in: Regenerate.
1120
cc84c10b
RM
1121 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1122 Remove const from declaration.
1123 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1124 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1125 * output.h (Output_file_header): Remove const from member target_
1126 and corresponding constructor argument.
1127 * output.cc (Output_file_header::Output_file_header): Update prototype.
1128 (Output_file_header::do_sized_write): Use this->target_ in place
1129 of parameters()->target().
1130
52f66a2c
RM
1131 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1132
2b64b551
RM
1133 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1134 * configure: Regenerate.
1135 * Makefile.in: Regenerate.
1136 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1137 * testsuite/merge_string_literals_2.c: Likewise.
1138 * testsuite/Makefile.am
1139 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1140 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1141 literal -fmerge-constants.
1142 * testsuite/Makefile.in: Regenerate.
1143
43819297
RM
1144 * i386.cc (Target_i386): Remove unused member dynbss_.
1145 * arm.cc (Target_arm): Likewise.
1146 * powerpc.cc (Target_powerpc): Likewise.
1147 * sparc.cc (Target_sparc): Likewise.
1148 * tilegx.cc (Target_tilegx): Likewise.
1149 * x86_64.cc (Target_x86_64): Likewise.
1150 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1151 type_signature_, type_offset_.
1152 * plugin.h (Plugin_hook): Remove unused member layout_.
1153 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1154 mapfile_.
1155 (Read_member): Remove unused members input_objects_, symtab_,
1156 mapfile_, layout_.
1157 (Check_library): Remove unused member symtab_.
1158 * archive.h (Lib_group): Remove unused member lib_.
1159 * archive.cc (Lib_group::Lib_group): Update initializer.
1160 * incremental.h (Incremental_binary): Remove unused member target_.
1161 (Incremental_script_entry): Removed unused member script_.
1162 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1163 * icf.h (Icf): Remove unused member num_tracked_relocs.
1164
39d9ead7
RM
1165 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1166 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1167 its only use.
1168 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1169
679e4abf
RM
1170 * archive.h: Use struct rather than class for forward declaration
1171 of Read_symbols_data.
1172
54de2ea6
CC
11732013-10-07 Cary Coutant <ccoutant@google.com>
1174
1175 PR gold/16010
1176 * testsuite/Makefile.am (icf_test): Fix dependencies.
1177 (icf_safe_test): Likewise.
1178 (icf_safe_so_test): Likewise.
1179 (large_symbol_alignment): Add empty _LDADD rule.
1180 * testsuite/Makefile.in: Regenerate.
1181
b14016f0
L
11822013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1183
1184 PR gold/15927
1185 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1186 relocation for R_X86_64_32 on x32.
1187
eb426534
RM
11882013-08-27 Roland McGrath <mcgrathr@google.com>
1189
1190 * output.cc (Output_segment::set_section_addresses): Take new
1191 Target* argument. If target->isolate_execinstr() and the segment
1192 is executable and starts at a target->abi_pagesize() boundary,
1193 pad its end out to a target->abi_pagesize() boundary with code fill.
1194 * output.h (Output_segment::set_section_addresses): Update decl.
1195 * layout.h (Layout::check_output_data_for_reset_values): Take new
1196 argument RELAX_OUTPUTS.
1197 (Layout): New member relax_output_list_.
1198 (Layout::add_relax_output): New method.
1199 * layout.cc (Layout::Layout): Update constructor.
1200 (Layout::reset_relax_output): New method.
1201 (Layout::clean_up_after_relaxation): Call it.
1202 (Layout::prepare_for_relaxation): Update caller.
1203 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1204 Call reset_relax_output before re-processing segments for
1205 isolate_execinstr case.
1206 (Layout::write_data): Handle relax_output_list_.
1207 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1208 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1209
9aff4b7a
NC
12102013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1211
1212 PR binutils/15834
1213 * object.h: Fix typos.
1214
93f8221c
RM
12152013-08-16 Roland McGrath <mcgrathr@google.com>
1216
1217 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1218 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1219
e44c3715
CC
12202013-08-07 Cary Coutant <ccoutant@google.com>
1221
1222 Revert support for v2 DWP files:
1223
1224 2013-03-01 Cary Coutant <ccoutant@google.com>
1225
1226 Add dwp support for v2 DWARF package file format.
1227 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1228 tu_length parameter. Adjust all callers.
1229 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1230 * dwp.cc: Include dwarf.h.
1231 (Section_bounds): New struct type.
1232 (Unit_set): New struct type.
1233 (Dwo_file::Dwo_file): Initialize new data member.
1234 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1235 Combine and rename to...
1236 (Dwo_file::read_unit_index): ...this.
1237 (Dwo_file::sized_read_compunit_index)
1238 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1239 (Dwo_file::sized_read_unit_index): ...this.
1240 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1241 parameters; add section_id parameter.
1242 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1243 (Dwo_file::add_unit_set): ...this.
1244 (Dwo_file::shndx_map_): Remove.
1245 (Dwo_file::sect_offsets_): New data member.
1246 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1247 (Dwp_output_file::add_section): Rename to...
1248 (Dwp_output_file::add_contribution): ...this.
1249 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1250 (Dwp_output_file::add_tu_set): Likewise.
1251 (Dwp_output_file::Contribution): New type.
1252 (Dwp_output_file::Section::contributions): New data member.
1253 (Dwp_output_file::Cu_or_tu_set): Remove.
1254 (Dwp_output_file::Section::Section): New ctor.
1255 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1256 (Dwp_output_file::Dwp_index::Section_table): New type.
1257 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1258 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1259 parameter.
1260 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1261 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1262 (Dwp_output_file::Dwp_index::section_table): New member function.
1263 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1264 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1265 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1266 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1267 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1268 (Dwp_output_file::Dwp_index::section_table_): New data member.
1269 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1270 (Dwp_output_file::add_output_section): New member function.
1271 (Dwp_output_file::write_new_section): New member function.
1272 (Dwp_output_file::write_contributions): New member function.
1273 (Dwp_output_file::section_id_map_): New data member.
1274 (class Dwo_id_info_reader): Remove.
1275 (class Unit_reader): New class.
1276 (get_dwarf_section_name): New function.
1277 (Dwo_file::read_executable): Adjust initializations of class data.
1278 (Dwo_file::read): Add support for v2 package file format.
1279 (Dwo_file::read_unit_index): Likewise.
1280 (Dwo_file::sized_read_unit_index): Likewise.
1281 (Dwo_file::copy_section): Likewise.
1282 (Dwo_file::add_unit_set): Likewise.
1283 (Dwp_output_file::add_output_section): Likewise.
1284 (Dwp_output_file::add_contribution): Likewise.
1285 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1286 for empty slot.
1287 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1288 file format.
1289 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1290 slot.
1291 (Dwp_output_file::initialize): Remove unused function.
1292 (Dwp_output_file::finalize): Add support for v2 package file format.
1293 (Dwp_output_file::write_index): Likewise.
1294 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1295 function prototype.
1296
c6905c28
CC
12972013-07-31 Cary Coutant <ccoutant@google.com>
1298
1299 * object.cc (Sized_relobj::do_output_section_address): New function.
1300 (Sized_relobj): Instantiate explicitly.
1301 * object.h (Object::output_section_address): New function.
1302 (Object::do_output_section_address): New function.
1303 (Sized_relobj::do_output_section_address): New function.
1304 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1305
13062013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1307 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1308
1309 * parameters.cc (Parameters::entry): Return target-specific entry
1310 symbol name.
1311 * target.h (Target::entry_symbol_name): New function.
1312 (Target_info::entry_symbol_name): New data member.
1313
1314 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1315 * i386.cc (Target_i386::i386_info): Likewise.
1316 (Target_i386_nacl::i386_nacl_info): Likewise.
1317 * sparc.cc (Target_sparc::sparc_info): Likewise.
1318 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1319 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1320 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1321 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1322
234d4ab8
SA
13232013-07-22 Sterling Augustine <saugustine@google.com>
1324
1325 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1326 Convert parameter shndx to local variable. Add parameters symtab
1327 and symtab_size. Scan over section names. Find relocation
1328 section corresponding to current section. Create and initialize
1329 reloc_mapper_ and reloc_type_.
1330 (Dwarf_pubnames_table::read_header): Add assertion. Change
1331 unit_length to off_t. Initialize member unit_length_. Fill in field
1332 cu_offset_.
1333 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1334 Initialize new fields unit_length_ and cu_offset_.
1335 (Dwarf_pubnames_table::read_section): Update prototype.
1336 (Dwarf_pubnames_table::cu_offset): New member function.
1337 (Dwarf_pubnames_table::subsection_size): Likewise.
1338 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1339 New fields.
1340 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1341 member functions public.
1342 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1343 Update comment. Rework logic. Move repeated parts to...
1344 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1345 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1346 pubtypes_table_, and stmt_list_offset.
1347 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1348 Gdb_index::find_pubtype_offset,
1349 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1350 (Gdb_index::pubnames_read): Update prototype and rework logic.
1351 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1352 Forward declare.
1353 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1354 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1355 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1356 Gdb_index::map_pubtable_to_dies):
1357 Declare functions.
1358 (Gdb_index::pubnames_read): Update declaration.
1359 (Gdb_index::Pubname_offset_map): New type.
1360 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1361 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1362 Gdb_index::stmt_list_offset): Declare.
1363 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1364 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1365 Gdb_index::pubtypes_offset_): Remove.
1366
a3ed37d8
RM
13672013-07-19 Roland McGrath <mcgrathr@google.com>
1368
1369 * options.h (General_options): Add -Trodata-segment option.
1370 * parameters.cc (Parameters::check_rodata_segment): New function.
1371 (Parameters::set_target_once): Call it.
1372 * parameters.h (Parameters): Declare it (private member function).
1373 * layout.cc (load_seg_unusable_for_headers): New function, broken
1374 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1375 then validate rodata segment rather than text segment.
1376 (relaxation_loop_body): Call that.
1377 (is_text_segment): New function. Don't admit a non-executable
1378 segment if TARGET->isolate_execinstr().
1379 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1380
eb5b4ded
CC
13812013-07-15 Shawn Landden <shawnlandden@gmail.com>
1382
1383 PR gold/15070
1384 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1385 * nacl.h (Sniff_file::View::View): Request aligned view.
1386
4d5effb9
CC
13872013-07-11 Cary Coutant <ccoutant@google.com>
1388
1389 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1390 correct BRLT entry size.
1391
ba8ca3e7
AM
13922013-07-03 Alan Modra <amodra@gmail.com>
1393
1394 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1395 comment.
1396
267257d2
CC
13972013-07-01 Cary Coutant <ccoutant@google.com>
1398
1399 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1400 reloc_type_.
1401 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1402 (Dwarf_ranges_table::lookup_reloc): New function.
1403 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1404 reloc_type_.
1405 (Dwarf_ranges_table::lookup_reloc): New function.
1406 (Dwarf_ranges_table::reloc_type_): New data member.
1407
06f30c9d
CC
14082013-06-27 Jing Yu <jingyu@google.com>
1409
1410 PR gold/15662
1411 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1412 function.
1413 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1414 (Target_powerpc::do_relax): Call the above.
1415
a2d7bf59
AM
14162013-06-27 Cary Coutant <ccoutant@google.com>
1417
1418 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1419 on garbage collected .opd section.
1420
14212013-06-27 Alan Modra <amodra@gmail.com>
1422
1423 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1424 is non-zero.
1425 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1426 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1427
32364e50
CC
14282013-06-14 Cary Coutant <ccoutant@google.com>
1429
1430 * resolve.cc (Symbol::override_base): Don't override st_type
1431 from plugin placeholder symbols.
1432 (Symbol_table::resolve): Likewise.
1433 (Symbol_table::should_override): Don't complain about TLS mismatch
1434 if the TO symbol is a plugin placeholder.
1435 * testsuite/Makefile.am (plugin_test_tls): New test.
1436 * testsuite/Makefile.in: Regenerate.
1437 * testsuite/plugin_test_tls.sh: New test script.
1438 * testsuite/two_file_test_2_tls.cc: New test source.
1439 * testsuite/two_file_test_tls.cc: New test source.
1440
7fb47cc9
CC
14412013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1442
1443 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1444 the maximum segment alignment is larger than the page size.
1445 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1446 correctly aligns the symbols with large alignemnt.
1447 * testsuite/Makefile.in: Regenerate.
1448 * testsuite/large_symbol_alignment.cc: New file.
1449
6934001a
CC
14502013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1451 Sriraman Tallam <tmsriram@google.com>
1452
1453 * options.h (sort_section): New option.
1454 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1455 Rename from Input_section_sort_section_name_special_ordering_compare.
1456 (Input_section_sort_section_name_compare): New struct.
1457 * output.cc (Output_section::Input_section_sort_section_name_compare::
1458 operator()): New function.
1459 (Output_section::sort_attached_input_sections): Use new sort function
1460 for .text if --sort-section=name is specified.
1461 * layout.cc (Layout::make_output_section):
1462 Add sorting by name when --sort-section=name is specified.
1463 * testsuite/Makefile.am (text_section_grouping): Test option
1464 --sort-section=name.
1465 * testsuite/Makefile.in: Regenerate.
1466 * testsuite/section_sorting_name.cc: New file.
1467 * testsuite/section_sorting_name.sh: New file.
1468
93acabad
CC
14692013-05-21 Cary Coutant <ccoutant@google.com>
1470
1471 * symtab.h (Symbol::is_cxx_vtable): New function.
1472 * target-reloc.h (relocate_section): Check for vtable symbol.
1473 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1474 * testsuite/Makefile.in: Regenerate.
1475 * testsuite/missing_key_func.cc: New test source.
1476 * testsuite/missing_key_func.sh: New test script.
1477
60e8b3fc
CC
14782013-05-21 Cary Coutant <ccoutant@google.com>
1479
2b64b551
RM
1480 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1481 type of enclosing symbol.
1482 (Relocate_info::location): Check symbol type when describing symbol.
1483 * object.h (Symbol_location_info): Remove unused line_number;
1484 add enclosing_symbol_type.
1485 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1486
9df9de2c
CC
14872013-05-13 Cary Coutant <ccoutant@google.com>
1488
2b64b551
RM
1489 * configure.ac: Export DEFAULT_TARGET.
1490 * configure: Regenerate.
1491 * Makefile.in: Regenerate.
1492 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1493 * testsuite/Makefile.in: Regenerate.
1494 * testsuite/debug_msg.sh: Delete duplicate tests.
1495 Don't check undef_int error message match for powerpc where the
1496 source file and line number aren't available.
9df9de2c 1497
bbc5ae17
RM
14982013-05-10 Roland McGrath <mcgrathr@google.com>
1499
1500 * options.h (General_options): Add --rosegment-gap option.
1501 * options.cc (finalize): --rosegment-gap implies --rosegment.
1502 * layout.cc (set_segment_offsets): Let user option override
1503 target->rosegment_gap().
1504
0c6e6c39
RM
15052013-05-10 Roland McGrath <mcgrathr@google.com>
1506
1507 * options.h (General_options): Remove leading space from help
1508 messages for -nostdlib and --rosegment.
1509
cde7cb01
MR
15102013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1511
1512 PR ld/15365
1513 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1514
f31ae5b8
AM
15152013-05-03 Alan Modra <amodra@gmail.com>
1516
1517 * merge.cc (Output_merge_string::do_add_input_section): Correct
1518 scan for number of strings. Rename vars to avoid shadowing.
1519 Include missing terminator in input_size_.
1520
d3a7cd45
L
15212013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1522
1523 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1524 Restore empty string handling.
1525
6ad3daba
CC
15262013-05-01 Cary Coutant <ccoutant@google.com>
1527
1528 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1529 uninitialized warning.
1530
e31908b6
CC
15312013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1532
1533 * output.cc (Output_section::add_merge_input_section): Allow
1534 to merge sections if the alignment is more than character size.
1535 * merge.h (Output_merge_string::Output_merge_string): Remove
1536 assert.
1537 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1538 only not-null strings. Check the alignment of strings.
1539 * stringpool.h
1540 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1541 alignment as the argument.
1542 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1543 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1544 Align non-zero length strings according to the addralign_.
1545 (Stringpool_template<Stringpool_char>::set_string_offsets):
1546 Updating offsets according to the given alignment.
1547 * testsuite/Makefile.am (text_section_grouping): Test if string
1548 literals are getting merged.
1549 * testsuite/Makefile.in: Regenerate.
1550 * testsuite/merge_string_literals_1.c: New file.
1551 * testsuite/merge_string_literals_2.c: Ditto.
1552 * testsuite/merge_string_literals.sh: Ditto.
1553
0e804863
ILT
15542013-04-26 Ian Lance Taylor <iant@google.com>
1555
1556 * target-reloc.h (relocate_section): If the reloc offset is out of
1557 range, pass VIEW as NULL to relocate.relocate.
1558 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1559 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1560 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1561 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1562 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1563 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1564
e7c5ea40
CC
15652013-04-26 Geoff Pike <gpike@chromium.org>
1566
1567 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1568 * layout.cc (Hash_task): New class.
1569 (Layout::queue_build_id_tasks): New function.
1570 (Layout::write_build_id): Handle single-thread portion of build ID
1571 computation. (In some cases, all of it is single-threaded.) Replace
1572 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1573 functionality in fewer lines of code.
1574 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1575 * options.h (General_options): make "--build-id" default to tree
1576 rather than sha1. Add two new options related to --build-id=tree:
1577 --build-id-chunk-size-for-treehash and
1578 --build-id-min-file-size-for-treehash.
1579 * Makefile.am: add testing of --build-id=tree and related new options
1580 (these tests will be invoked by "make check").
1581 * Makefile.in: Regenerate.
1582
49926cd0
AM
15832013-04-25 Alan Modra <amodra@gmail.com>
1584
1585 * configure.tgt: Add powerpcle and powerpc64le.
1586
a4034750
AM
15872013-04-22 Alan Modra <amodra@gmail.com>
1588
1589 PR gold/15355
1590 * layout.cc (Layout::segment_precedes): Allow more than one
1591 segment with the same type and flags.
1592
e79c84aa
CC
15932013-04-15 Cary Coutant <ccoutant@google.com>
1594
1595 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1596 allocate space in file for BSS sections.
1597
2199fbe7
CC
15982013-04-15 Cary Coutant <ccoutant@google.com>
1599
1600 * script-sections.cc (Orphan_output_section): Reset address
1601 to zero after each orphaned section for relocatable links.
1602
502e8a84
CC
16032013-04-15 Cary Coutant <ccoutant@google.com>
1604
a4034750
AM
1605 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1606 section starting address for relocatable link.
1607 * testsuite/Makefile.am (script_test_11): New test.
1608 * testsuite/Makefile.in: Regenerate.
1609 * testsuite/script_test_11.c: New source file.
1610 * testsuite/script_test_11.t: New linker script.
502e8a84 1611
0cfdc767
AM
16122013-04-13 Alan Modra <amodra@gmail.com>
1613
1614 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1615 owner when sections are not adjacent and exceed group size.
1616 (Target_powerpc::group_sections): Handle corner case.
1617 (Target_powerpc::Branch_info::make_stub): Handle case where
1618 stub table doesn't exist due to branches in non-exec sections.
1619 (Target_powerpc::Relocate::relocate): Likewise.
1620
6830ee24
AM
16212013-04-11 Alan Modra <amodra@gmail.com>
1622
1623 PR gold/15354
1624 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1625 .branch_lt to match bfd ld. Adjust comments throughout file.
1626
54a3d865
ILT
16272013-04-04 Ian Lance Taylor <iant@google.com>
1628
1629 GCC PR c++/56840
1630 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1631 sections before checking whether they are included in the link.
1632
9993ba11
ST
16332013-03-29 Sriraman Tallam <tmsriram@google.com>
1634
1635 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1636 object before calling the plugin claim_file handler. Pass the elf
1637 object of the archive to the plugin. Delete the elf object if the
1638 plugin claims the file.
1639
ebacd51e
AM
16402013-03-21 Alan Modra <amodra@gmail.com>
1641
1642 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1643 segment when omagic.
1644
117be58f
AM
16452013-03-21 Alan Modra <amodra@gmail.com>
1646
1647 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1648 comparison warning.
1649 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1650 uninitialized" warning.
1651
32e2b61d
AM
16522013-03-20 Alan Modra <amodra@gmail.com>
1653
1654 * symtab.h (Symbol::clear_version): New function.
1655 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1656 is_needed by weak references. Clear version for symbols defined
1657 in as-needed objects that are not needed.
1658
b3ccdeb5
AM
16592013-03-15 Alan Modra <amodra@gmail.com>
1660
1661 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1662 static and public. Add report_err param. Return false for data refs.
1663 (Target_powerpc::rela_dyn_section): New overloaded function.
1664 (Target_powerpc::plt_, iplt_): Elucidate.
1665 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1666 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1667 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1668 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1669 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1670 push_branch and make_plt_entry for ifunc syms when
1671 reloc_needs_plt_for_ifunc.
1672 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1673 for ifunc unless reloc_needs_plt_for_ifunc.
1674
ad3d8a2f
AM
16752013-03-15 Alan Modra <amodra@gmail.com>
1676
1677 * gc.h (gc_process_relocs): Don't look through function descriptors.
1678 * icf.cc (get_section_contents): Do so here instead.
1679
4d9aa155
AM
16802013-03-13 Alan Modra <amodra@gmail.com>
1681
1682 * powerpc.cc (is_branch_reloc): Forward declare.
1683 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1684 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1685 false for 64-bit, true for 32-bit non-branch relocs.
1686 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1687 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1688 nm output.
1689 (icf_safe_test): Generate linker map file as well as nm output.
1690 (icf_safe_so_test): Likewise.
1691 * testsuite/Makefile.in: Regenerate.
1692 * testsuite/icf_test.sh: Parse linker map file to determine
1693 section folding.
1694 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1695 * testsuite/icf_safe_so_test.sh: Likewise.
1696 (X86_32_or_ARM_specific_safe_fold): Merge into..
1697 (arch_specific_safe_fold): ..this.
1698 (X86_64_specific_safe_fold): Delete unused function.
1699
57420c20
AM
17002013-03-12 Alan Modra <amodra@gmail.com>
1701
1702 * gc.h (gc_process_relocs): Look through function descriptors
1703 to determine shndx, symvalue and addend used by ICF. Tidy
1704 variable duplication.
1705
dc3714f3
AM
17062013-03-11 Alan Modra <amodra@gmail.com>
1707
1708 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1709 * layout.cc (Layout_task_runner::run): ..to here.
1710 * symtab.h (struct Symbol_location): Extract from..
1711 (class Symbol_table): ..here.
1712 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1713 * target.h (class Target): Add function_location and
1714 do_function_location functions.
1715 (class Sized_target): Add do_function_location.
1716 * object.h (class Sized_relobj_file): Move find_shdr..
1717 (class Object): ..to here.
1718 * object.cc: Likewise. Update to suit. Instantiate.
1719 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1720 * powerpc.cc (class Powerpc_dynobj): New.
1721 (Target_powerpc::do_function_location): New function.
1722 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1723 (Powerpc_dynobj::do_read_symbols): New function.
1724 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1725
956b03bb
ILT
17262013-03-08 Ian Lance Taylor <iant@google.com>
1727
1728 * options.cc (General_options::string_to_object_format): Accept
1729 "default".
1730
4bead2d5
AM
17312013-03-08 Alan Modra <amodra@gmail.com>
1732
1733 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1734 pointer to Post_fde.
1735 (struct Post_fde): Move definition to here..
1736 * ehframe.cc (struct Post_fde): ..from here.
1737 (Cie::write): Don't alloc Post_fde.
1738 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1739
02e60bf7
AM
17402013-03-07 Alan Modra <amodra@gmail.com>
1741
1742 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1743 relocation referencing .LC0.
1744 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1745
8343f03a
AM
17462013-03-07 Alan Modra <amodra@gmail.com>
1747
1748 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1749 always_inline. Add assembly for powerpc to avoid GOT.
1750
3366d57c
AM
17512013-03-07 Alan Modra <amodra@gmail.com>
1752
1753 * testsuite/script_test_10.sh: Don't test .bss section
1754 header number.
1755
6c77229c
AM
17562013-03-06 Alan Modra <amodra@gmail.com>
1757
1758 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1759 (Target_powerpc::symval_for_branch): Add symtab param. Update
1760 all callers. Handle folded sections.
1761 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1762 to Powerpc_relobj.
1763 (Global_symbol_visitor_opd::operator()): Likewise.
1764
a39e4af6
AM
17652013-03-04 Alan Modra <amodra@gmail.com>
1766
1767 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1768 * testsuite/Makefile.in: Regenerate.
1769
d5834edb
CC
17702013-03-01 Cary Coutant <ccoutant@google.com>
1771
1772 Add dwp support for v2 DWARF package file format.
1773 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1774 tu_length parameter. Adjust all callers.
1775 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1776 * dwp.cc: Include dwarf.h.
1777 (Section_bounds): New struct type.
1778 (Unit_set): New struct type.
1779 (Dwo_file::Dwo_file): Initialize new data member.
1780 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1781 Combine and rename to...
1782 (Dwo_file::read_unit_index): ...this.
1783 (Dwo_file::sized_read_compunit_index)
1784 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1785 (Dwo_file::sized_read_unit_index): ...this.
1786 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1787 parameters; add section_id parameter.
1788 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1789 (Dwo_file::add_unit_set): ...this.
1790 (Dwo_file::shndx_map_): Remove.
1791 (Dwo_file::sect_offsets_): New data member.
1792 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1793 (Dwp_output_file::add_section): Rename to...
1794 (Dwp_output_file::add_contribution): ...this.
1795 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1796 (Dwp_output_file::add_tu_set): Likewise.
1797 (Dwp_output_file::Contribution): New type.
1798 (Dwp_output_file::Section::contributions): New data member.
1799 (Dwp_output_file::Cu_or_tu_set): Remove.
1800 (Dwp_output_file::Section::Section): New ctor.
1801 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1802 (Dwp_output_file::Dwp_index::Section_table): New type.
1803 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1804 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1805 parameter.
1806 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1807 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1808 (Dwp_output_file::Dwp_index::section_table): New member function.
1809 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1810 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1811 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1812 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1813 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1814 (Dwp_output_file::Dwp_index::section_table_): New data member.
1815 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1816 (Dwp_output_file::add_output_section): New member function.
1817 (Dwp_output_file::write_new_section): New member function.
1818 (Dwp_output_file::write_contributions): New member function.
1819 (Dwp_output_file::section_id_map_): New data member.
1820 (class Dwo_id_info_reader): Remove.
1821 (class Unit_reader): New class.
1822 (get_dwarf_section_name): New function.
1823 (Dwo_file::read_executable): Adjust initializations of class data.
1824 (Dwo_file::read): Add support for v2 package file format.
1825 (Dwo_file::read_unit_index): Likewise.
1826 (Dwo_file::sized_read_unit_index): Likewise.
1827 (Dwo_file::copy_section): Likewise.
1828 (Dwo_file::add_unit_set): Likewise.
1829 (Dwp_output_file::add_output_section): Likewise.
1830 (Dwp_output_file::add_contribution): Likewise.
1831 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1832 for empty slot.
1833 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1834 file format.
1835 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1836 slot.
1837 (Dwp_output_file::initialize): Remove unused function.
1838 (Dwp_output_file::finalize): Add support for v2 package file format.
1839 (Dwp_output_file::write_index): Likewise.
1840 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1841 function prototype.
1842
a68a081d
CC
18432013-03-01 Cary Coutant <ccoutant@google.com>
1844
1845 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1846 function into class definition in header file.
1847 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1848 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1849 New function.
1850 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1851
9d5781f8
AM
18522013-02-28 Alan Modra <amodra@gmail.com>
1853
1854 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1855 * target.cc (Target::do_plt_fde_location): New function.
1856 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1857 accessor function, and constructor param.
1858 (struct Post_fde, Post_fdes): Declare.
1859 (Cie::write): Add post_fdes param.
1860 * ehframe.cc (Fde::write): Use plt_fde_location.
1861 (struct Post_fde): Define.
1862 (Cie::write): Stash FDEs added post merge mapping.
1863 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1864 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1865 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1866 other FDEs.
1867 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1868 (Target_powerpc::has_glink): New function.
1869 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1870 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1871 glink_eh_frame_fde_32, default_fde): New data.
1872 (Stub_table::eh_frame_added_): New var.
1873 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1874 Make const.
1875 (Stub_table::add_eh_frame): New function.
1876 (Output_data_glink::add_eh_frame): New function.
1877 (Target_powerpc::make_glink_section): Call add_eh_frame.
1878
214383dd
ILT
18792013-02-15 Ian Lance Taylor <iant@google.com>
1880
1881 * options.h (DEFINE_uint64_alias): Define.
1882 (class General_options): Add -Ttext-segment as an alias for
1883 -Ttext.
1884
91c2b899
AM
18852013-02-15 Alan Modra <amodra@gmail.com>
1886
1887 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1888 (Stub_table::do_write): ..here, two places.
1889 (Stub_table::plt_call_size): Use it here too.
1890
20e2a8aa
ILT
18912013-02-11 Ian Lance Taylor <iant@google.com>
1892
1893 * descriptors.cc (Descriptors::close_all): New function.
1894 * descriptors.h (class Descriptors): Declare close_all.
1895 (close_all_descriptors): New inline function.
1896 * plugin.cc: Include "descriptors.h".
1897 (Plugin_manager::cleanup): Call close_all_descriptors.
1898
8952bc69
AM
18992013-02-06 Alan Modra <amodra@gmail.com>
1900
1901 * README: Update coding style link.
1902
29bd8b6b
CC
19032013-01-28 Cary Coutant <ccoutant@google.com>
1904
a4034750
AM
1905 * dwp.cc (File_list): New typedef.
1906 (Dwo_name_info_reader): New class.
1907 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1908 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1909 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1910 (Dwo_file::read_executable): New function.
1911 (Dwo_file::read): Move common setup code to ...
1912 (Dwo_file::make_object): ... here.
1913 (dwp_options): Add --exec/-e.
1914 (usage): Likewise.
1915 (main): Likewise.
29bd8b6b 1916
c6ac678d
ST
19172013-01-24 Sriraman Tallam <tmsriram@google.com>
1918
1919 * layout.cc (Layout::layout): Check for option text_reorder.
1920 (Layout::make_output_section): Ditto.
1921 * options.h (text_reorder): New option.
1922 * output.cc (Input_section_sort_compare): Remove special ordering
1923 of section names.
1924 (Output_section::
1925 Input_section_sort_section_name_special_ordering_compare::
1926 operator()): New function.
1927 (Output_section::sort_attached_input_sections): Use new sort function
1928 for .text.
1929 * output.h (Input_section_sort_section_name_special_ordering_compare):
1930 New struct.
1931 * testsuite/Makefile.am (text_section_grouping): Test option
1932 --no-text-reorder
1933 * testsuite/Makefile.in: Regenerate.
1934 * testsuite/text_section_grouping.sh: Check order of functions without
1935 default text reordering.
1936
50701cc1
MF
19372013-01-18 Mike Frysinger <vapier@gentoo.org>
1938
1939 * options.h (General_options): Change default to true for new_dtags.
1940
b1b00fcc
MF
19412013-01-18 Mike Frysinger <vapier@gentoo.org>
1942
1943 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1944 when enable_new_dtags is false. Only add DT_RUNPATH when
1945 enable_new_dtags is true.
1946
ec5b8187
AM
19472013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1948
1949 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1950 used in declaration and definition consistent.
1951 (Target_powerpc::symval_for_branch): Ditto.
1952
a880d4c4
ST
19532013-01-16 Sriraman Tallam <tmsriram@google.com>
1954
1955 * testsuite/plugin_final_layout.cc: Fix comment.
1956
7c381248
ST
19572013-01-16 Sriraman Tallam <tmsriram@google.com>
1958
1959 * layout.cc (Layout::layout): Do not do default sorting for
1960 text sections when section ordering is specified.
1961 (make_output_section): Ditto.
1962 * testsuite/plugin_final_layout.cc: Name the function sections
1963 to catch reordering issues.
1964
e2458743
AM
19652013-01-15 Alan Modra <amodra@gmail.com>
1966
1967 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1968 plt-thread-safe.
1969
431ed302
AM
19702013-01-15 Alan Modra <amodra@gmail.com>
1971
1972 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1973 * testsuite/Makefile.in: Regenerate.
1974
0ec6429b
AM
19752013-01-14 Alan Modra <amodra@gmail.com>
1976
1977 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1978 * testsuite/Makefile.in: Regenerate.
1979
0bf402d5
ILT
19802013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1981
36af3926 1982 PR bfd/14430
0bf402d5
ILT
1983 Fix mingw gold build with plugins enabled
1984 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1985 * configure.ac: Export DLOPEN_LIBS and add headers check.
1986 * plugin.cc: Handle non-dlfcn case.
1987 * Makefile.in: Regenerate.
1988 * config.in: Regenerate.
1989 * configure: Regenerate.
1990 * testsuite/Makefile.in: Regenerate.
1991
9e9143bc
ST
19922013-01-09 Sriraman Tallam <tmsriram@google.com>
1993
1994 * output.h (sort_attached_input_sections): Change to be public.
1995 * script-sections.cc
1996 (Output_section_definition::set_section_addresses): Sort
1997 attached input sections according to section order before linker
1998 script assigns section addresses.
1999 (Orphan_output_section::set_section_addresses): Sort
2000 attached input sections according to section order before linker
2001 script assigns section addresses.
2002 * Makefile.am (final_layout.sh): Use a simple linker script to
2003 check if section ordering still works.
2004 * Makefile.in: Regenerate.
2005
679af368
ILT
20062013-01-09 Ben Cheng <bccheng@google.com>
2007
2008 * arm.cc (Target_arm::attributes_accept_div): New function.
2009 (Target_arm::attributes_forbid_div): New function.
2010 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2011 attribute using the same new functions as what bfd/elf32_arm.c
2012 does.
2013
3136a00e
CC
20142013-01-07 Cary Coutant <ccoutant@google.com>
2015
2016 PR gold/14993
2017 * output.cc (Output_section::add_input_section): For incremental
2018 updates, don't track input sections that are allocated from patch
2019 space.
2020
f2a6224b
L
20212013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2022 Ian Lance Taylor <iant@google.com>
2023
2024 PR gold/14897
2025 * configure.ac (--enable-ld): Removed.
2026 (install_as_default): Set to yes only for --enable-gold=default
2027 or --disable-ld.
2028 * configure: Regenerated.
2029
4f46f626
L
20302013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2031
2032 * options.h (General_options): Add -fuse-ld= for GCC linker
2033 option compatibility.
2034
26e4ef59
CC
20352013-01-04 Cary Coutant <ccoutant@google.com>
2036
2037 * configure.ac: Fix typo restoring CXXFLAGS.
2038 * configure: Regenerate.
2039
3d587466
CC
20402013-01-04 Cary Coutant <ccoutant@google.com>
2041
4f46f626
L
2042 * testsuite/Makefile.am (CXXLINK_S): New macro.
2043 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2044 * testsuite/Makefile.in: Regenerate.
3d587466 2045
44db6695
L
20462013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2047
2048 * version.cc (print_version): Update copyright year to 2013.
2049
edcac0c1
ILT
20502012-12-20 Ian Lance Taylor <iant@google.com>
2051
2052 * layout.cc (Layout::special_ordering_of_input_section): New
2053 function.
2054 (Layout::layout): If input section requires special ordering, must
2055 sort input sections.
2056 (Layout::make_output_section): May sort .text input sections.
2057 (Layout::is_section_name_prefix_grouped): Remove.
2058 * layout.h (class Layout): Declare
2059 special_ordering_of_input_section. Don't declare
2060 is_section_name_prefix_grouped.
2061 * output.cc (Output_section::add_input_section): Revert last
2062 change.
2063 (Output_section::Input_section_sort::match_file_name): Don't crash
2064 if called on output section data.
2065 (Output_section::Input_section_sort_compare): Sort based on
2066 special ordering.
2067 (Output_section::Input_section_sort_section_order_index_compare):
2068 Revert last patch.
2069 (Output_section::sort_attached_input_sections): Likewise.
2070
28f2a4ac
ST
20712012-12-18 Sriraman Tallam <tmsriram@google.com>
2072
edcac0c1 2073 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2074 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2075 * output.cc (Output_section::add_input_section): Check if section
2076 name contains special prefix. Keep input sections to sort such
2077 sections.
2078 (Output_section::Input_section_sort_section_order_index_compare
2079 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2080 (Output_section::sort_attached_input_sections): Add condition to
2081 Input_section_entry constructor call.
28f2a4ac
ST
2082 * testsuite/Makefile.am (text_section_grouping): New test.
2083 * testsuite/Makefile.in: Regenerate.
2084 * testsuite/text_section_grouping.cc: New file.
2085 * testsuite/text_section_grouping.sh: New file.
2086
5bf135a7
NC
20872012-12-17 Nick Clifton <nickc@redhat.com>
2088
2089 * Makefile.am: Add copyright notice.
2090 * NEWS: Likewise.
2091 * README: Likewise.
2092 * configure.ac: Likewise.
2093 * ftruncate.c: Likewise.
2094 * Makefile.in: Regenerate.
2095
59965708
CC
20962012-12-14 Cary Coutant <ccoutant@google.com>
2097
a4034750
AM
2098 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2099 --no-as-needed flag.
2100 (exception_separate_shared_12_test): Likewise.
2101 (incremental_copy_test): Likewise.
2102 * testsuite/Makefile.in: Regenerate.
59965708 2103
2a77e2ab
CC
21042012-12-14 Cary Coutant <ccoutant@google.com>
2105
2106 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2107 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2108
e3deeb9c
AM
21092012-12-12 Alan Modra <amodra@gmail.com>
2110
2111 * powerpc.cc (class Track_tls): New.
2112 (class Relocate, class Scan): Inherit Track_tls.
2113 (Target_powerpc::Scan::local, global): Track tls optimization
2114 and avoid creating plt entry for __tls_get_addr if all uses
2115 are optimized away.
2116 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2117
d8f5a274
AM
21182012-12-12 Alan Modra <amodra@gmail.com>
2119
2120 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2121 Replace no_toc_optimize with toc_optimize.
2122 * output.h (Output_section::input_sections): Provide non-const variant.
2123 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2124 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2125 accessors.
2126 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2127 (class Sort_toc_sections): New.
2128 (Target_powerpc::do_finalize_sections): Sort toc sections.
2129 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2130
4c8a1de1
RM
21312012-12-10 Roland McGrath <mcgrathr@google.com>
2132
2133 * testsuite/binary_unittest.cc (read_all): New function.
2134 (Sized_binary_test): Use it instead of ::read.
2135 * fileread.cc (do_read): Don't assume pread always reads the whole
2136 amount in a single call.
2137
edc27beb
AM
21382012-12-10 Alan Modra <amodra@gmail.com>
2139
2140 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2141 Set EM_PPC64 or EM_PPC here.
2142 (Target_selector_powerpc::do_recognize): Delete.
2143
906b9150
AM
21442012-12-10 Alan Modra <amodra@gmail.com>
2145
2146 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2147 stub_table_.
2148 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2149
418c15ae
RM
21502012-12-07 Roland McGrath <mcgrathr@google.com>
2151
2152 * testsuite/binary_unittest.cc (Sized_binary_test):
2153 Use open_descriptor rather than ::open.
2154
decdd3bc
AM
21552012-12-07 Alan Modra <amodra@gmail.com>
2156
2157 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2158 typedef and invalid_address constant.
2159 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2160 instantiate constants.
2161
db399005
ILT
21622012-12-06 Roland McGrath <mcgrathr@google.com>
2163
2164 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2165 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2166 * aclocal.m4: Regenerate.
2167 * configure: Regenerate.
2168 * Makefile.in: Regenerate.
2169 * testsuite/Makefile.in: Regenerate.
2170
aba6bc71
AM
21712012-12-07 Alan Modra <amodra@gmail.com>
2172
2173 * options.h (General_options): Add no_toc_optimize.
2174 * powerpc.cc (ok_lo_toc_insn): New function.
2175 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2176
9e69ed50
AM
21772012-12-06 Alan Modra <amodra@gmail.com>
2178
2179 * options.h (General_options): Add plt_align, plt_static_chain,
2180 plt_thread_safe. Update stub_group_size help text.
2181 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2182 for new plt_thread_safe_ var.
2183 (use_plt_offset): Correct comments.
2184 (Target_powerpc::do_relax): Look for thread creation symbols to
2185 determine default plt_thread_safe value. Clear plt call stubs
2186 as well as branch stubs each iteration.
2187 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2188 insn constants.
2189 (l, hi, ha, write_insn): Move earlier.
2190 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2191 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2192 plt stubs too.
2193 (Stub_table::update_size): Adjust.
2194 (Stub_table::prev_size, set_prev_size): Delete.
2195 (Stub_table::stub_align): Let --plt-align affect result.
2196 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2197 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2198 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2199 (Stub_table::do_write): Support more stub variants.
2200
f43ba157
AM
22012012-12-04 Alan Modra <amodra@gmail.com>
2202
2203 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2204 (Target_powerpc::do_define_standard_symbols): New function.
2205
34171bc5
AM
22062012-12-03 Alan Modra <amodra@gmail.com>
2207
2208 * output.h: Formatting, whitespace.
2209
dc9589e9 22102012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2211
2212 * layout.h (Layout::get_executable_sections): Declare.
2213 * layout.cc (Layout::get_executable_sections): New function.
2214 * arm.cc (Target_arm::group_sections): Use it.
2215 (Arm_output_section::group_sections): Delete now redundant test.
2216 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2217 param to handle relative relocs.
2218 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2219 (Output_data_reloc::add_absolute): Adjust.
2220 (Output_data_reloc::add_relative): New function.
2221 (Output_data::reset_data_size): New function.
2222 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2223 (Output_section::set_addralign): New function.
2224 (Output_section::checkpoint_set_addralign): New function.
2225 (Output_section::clear_section_offsets_need_adjustment): New function.
2226 (Output_section::input_sections): Make public.
2227 * powerpc.cc (class Output_data_brlt_powerpc): New.
2228 (class Stub_table, class Stub_control): New.
2229 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2230 stub_table_, set_stub_table, stub_table): New vectors and accessor
2231 functions.
2232 (Target_powerpc::do_may_relax, do_relax, push_branch,
2233 new_stub_table, stub_tables, brlt_section, group_sections,
2234 add_branch_lookup_table, find_branch_lookup_table,
2235 write_branch_lookup_table, make_brlt_section): New functions.
2236 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2237 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2238 branch_info_): New vars.
2239 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2240 make call stubs here.
2241 (Output_data_glink): Remove all call stub handling from this class.
2242 (Target_powerpc::Scan::local, global): Save interesting branch
2243 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2244 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2245 functions on final link.
2246 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2247 Handle long branch destinations too.
2248 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2249 do_plt_address_for_local): Adjust lookup of plt call stubs.
2250
627b30b7
AM
22512012-11-30 Alan Modra <amodra@gmail.com>
2252
2253 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2254 relocs against protected symbols when building 32-bit shared libs.
2255
40b469d7
AM
22562012-11-30 Alan Modra <amodra@gmail.com>
2257
2258 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2259 param. Call got_section() to make .got. Update all callers
2260 and their callers and so on.
2261
bb66a627
AM
22622012-11-30 Alan Modra <amodra@gmail.com>
2263
2264 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2265 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2266 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2267 value if it already exists.
2268
d2cf1c6c
L
22692012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2270
2271 PR gold/14858
2272 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2273
edccdf7c
RM
22742012-11-14 Roland McGrath <mcgrathr@google.com>
2275
2276 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2277 than bfc instruction for data sandboxing.
2278
6febeb74
AM
22792012-11-08 Alan Modra <amodra@gmail.com>
2280
2281 * po/POTFILES.in: Regenerate.
2282
0a6f1bf2
AM
22832012-11-05 Alan Modra <amodra@gmail.com>
2284
2285 * configure.ac: Apply 2012-09-10 change to config.in here.
2286 * configure: Regenerate.
2287
26a4e9cb
AM
22882012-11-05 Alan Modra <amodra@gmail.com>
2289
2290 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2291 (struct Opd_ent): Use "Address" rather than "Offset".
2292 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2293 (Target_powerpc::got_section): Make public.
2294 (Target_powerpc::scan_relocs): Move code setting symbols..
2295 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2296 Create _SDA_BASE_ only when referenced.
2297
cc928013
RM
22982012-11-02 Roland McGrath <mcgrathr@google.com>
2299
2300 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2301 from last change.
2302
50ed5eb1
RM
23032012-11-01 Roland McGrath <mcgrathr@google.com>
2304
62fe925a
RM
2305 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2306 for offset_in_output_section parameter.
2307 (Sized_target::relocate_special_relocatable): Likewise.
2308 * arm.cc (Target_arm::relocate_relocs): Likewise.
2309 (Target_arm::relocate_special_relocatable): Likewise.
2310 * i386.cc (Target_i386::relocate_relocs): Likewise.
2311 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2312 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2313 * target-reloc.h (relocate_relocs): Likewise.
2314 * testsuite/testfile.cc (Target_test): Likewise.
2315 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2316 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2317
2318 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2319 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2320
2321 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2322 parameter, which is unused in the [!F_SETFD] case.
2323
50ed5eb1
RM
2324 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2325 SYMNDX to off_t before comparing it to this->data_size().
2326 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2327 * incremental.cc (Output_section_incremental_inputs::do_write):
2328 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2329
2cadc0bf
RM
2330 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2331
3bfcb652
NC
23322012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2333
2334 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2335 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2336 in EABI_VER5.
2337
c1a8d56e
CC
23382012-10-29 Cary Coutant <ccoutant@google.com>
2339
2340 * dwp.cc (usage): Add file and exit status parameters;
2341 add --help and --version options.
2342 (print_version): New function.
2343 (main): Add --help and --version options.
2344
b2490a7b
L
23452012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2346
2347 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2348 final_layout_sequence.txt.
2349 * testsuite/Makefile.in: Regenerated.
2350
aa543512
L
23512012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2352
2353 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2354 COMPILE generated by automake.
2355 (LINK1): Likewise.
2356 (CXXCOMPILE1): Likewise.
2357 (CXXLINK1): Likewise.
2358 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2359 (LINK): Likewise.
2360 (CXXCOMPILE): Likewise.
2361 (CXXLINK): Likewise.
2362 * testsuite/Makefile.in: Regenerated.
2363
d361fafb
L
23642012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2365
2366 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2367 on bad fwrite return.
2368
598c7410
L
23692012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2370
2371 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2372 on val.
2373
35c813e2
CC
23742012-10-23 Cary Coutant <ccoutant@google.com>
2375
2376 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2377 * testsuite/Makefile.in: Regenerate.
2378 * testsuite/dwp_test.h: New source file.
2379 * testsuite/dwp_test_1.cc: New source file.
2380 * testsuite/dwp_test_1.s: New source file.
2381 * testsuite/dwp_test_1.sh: New source file.
2382 * testsuite/dwp_test_1b.cc: New source file.
2383 * testsuite/dwp_test_1b.s: New source file.
2384 * testsuite/dwp_test_2.cc: New source file.
2385 * testsuite/dwp_test_2.s: New source file.
2386 * testsuite/dwp_test_2.sh: New source file.
2387 * testsuite/dwp_test_main.cc: New source file.
2388 * testsuite/dwp_test_main.s: New source file.
2389
77429909
CC
23902012-10-23 Cary Coutant <ccoutant@google.com>
2391
2392 * dwp.h: New header file.
2393 * dwp.cc: New source file.
2394 * gold.h: Move shared declarations to system.h.
2395 * system.h: New header file.
2396 * Makefile.am: Add dwp.
2397 * Makefile.in: Regenerate.
2398
ed5d6712
CC
23992012-10-23 Cary Coutant <ccoutant@google.com>
2400
2401 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2402 Dwarf_info_reader::read_from_pointer.
2403 (Dwarf_pubnames_table::read_header): Likewise.
2404 (Dwarf_pubnames_table::next_name): Likewise.
2405 (Dwarf_die::read_attributes): Likewise.
2406 (Dwarf_die::skip_attributes): Likewise.
2407 (Dwarf_info_reader::read_from_pointer): New function template.
2408 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2409 (Dwarf_pubnames_table): Likewise.
2410 (Dwarf_info_reader::read_from_pointer): New function template.
2411 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2412 Dwarf_pubnames_table ctor.
2413
8787852d
CC
24142012-10-23 Cary Coutant <ccoutant@google.com>
2415
2416 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2417 abbrev_shndx.
2418 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2419 abbrev_shndx_.
2420 (Dwarf_info_reader::set_abbrev_shndx): New method.
2421 (Dwarf_info_reader::abbrev_shndx_): New data member.
2422
9fc236f3
CC
24232012-10-23 Cary Coutant <ccoutant@google.com>
2424
2425 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2426 from object, not parameters.
2427 (Dwarf_info_reader::parse): Likewise.
2428 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2429 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2430 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2431 methods.
2432
effe8365
CC
24332012-10-23 Cary Coutant <ccoutant@google.com>
2434
2435 * fileread.cc (Input_file::Input_file): New constructor.
2436 * fileread.h (class Input_file): Add new constructor.
2437
1698990d
AM
24382012-10-18 Alan Modra <amodra@gmail.com>
2439
2440 PR gold/14727
2441 * object.cc (Relobj::is_section_name_included): Also match
2442 .sdata personality section.
2443
168a4726
AM
24442012-10-18 Alan Modra <amodra@gmail.com>
2445
2446 * target-reloc.h (class Default_comdat_behavior): New, package up..
2447 (get_comdat_behaviour): ..this.
2448 (relocate_section): Add Relocate_comdat_behavior template arg,
2449 adjust code to suit.
2450 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2451 (Target_arm::scan_reloc_section): Likewise.
2452 * i386.cc (Target_i386::relocate_section): Likewise.
2453 * sparc.cc (Target_sparc::relocate_section): Likewise.
2454 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2455 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2456 * powerpc.cc (class Relocate_comdat_behavior): New.
2457 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2458 gold::relocate_section with new template arg.
2459
acc276d8
AM
24602012-10-18 Alan Modra <amodra@gmail.com>
2461
2462 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2463 dynamic relocs for GOT_TPREL got entries, without symbol if
2464 resolving locally.
2465 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2466 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2467 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2468
e10f9870
AM
24692012-10-17 Alan Modra <amodra@gmail.com>
2470
2471 PR gold/14726
2472 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2473
ae034989
ST
24742012-10-16 Sriraman Tallam <tmsriram@google.com>
2475
2476 * layout.cc (Layout::include_section): Keep sections marked
2477 SHF_EXCLUDE when doing relocatable links.
2478
f3a0ed29
AM
24792012-10-16 Alan Modra <amodra@gmail.com>
2480
2481 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2482 (Target_powerpc::do_finalize_sections): Call it.
2483 (Output_data_save_res): New class and supporting functions.
2484 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2485 normal symbols defined in object files.
2486
c6de8ed4
AM
24872012-10-12 Alan Modra <amodra@gmail.com>
2488
2489 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2490 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2491 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2492 section if scan_opd_relocs not yet called.
2493 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2494
03e25981
AM
24952012-10-12 Alan Modra <amodra@gmail.com>
2496
2497 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2498 add_local_ifunc_entry): Revert last change.
2499 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2500
c9824451
AM
25012012-10-05 Alan Modra <amodra@gmail.com>
2502
2503 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2504 do_plt_address_for_global): New functions.
2505 (Output_data_got_powerpc::do_write): Don't segfault when linking
2506 statically.
2507 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2508 add_local_ifunc_entry): Return true on adding entry..
2509 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2510 glink->add_entry call. Remove unused symtab param. Adjust calls.
2511 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2512 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2513 set up symbols here.
2514 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2515 syms here. Do so even when no .iplt. Don't segfault when linking
2516 statically.
2517 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2518 new variants without reloc param.
2519 (Glink_sym_ent::Glink_sym_ent): Likewise.
2520 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2521 reloc when refs will resolve to plt call stub.
2522 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2523 R_PPC_PLTREL24 to resolve locally.
2524 (Target_powerpc::Scan::global): Correct ifunc handling.
2525 (Target_powerpc::Relocate::relocate): Correct local sym glink
2526 lookup. Don't destroy "value" when we have a plt call stub,
2527 and when checking plt call validity.
2528 (Target_powerpc::do_dynsym_value): Simplify.
2529
19fec8c1
AM
25302012-10-05 Alan Modra <amodra@gmail.com>
2531
2532 * i386.cc (Output_data_plt_i386::address_for_global,
2533 address_for_local): Add plt offset to returned value. Adjust uses.
2534 * sparc.cc (Output_data_plt_sparc::address_for_global,
2535 address_for_local): Likewise.
2536 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2537 address_for_local): Likewise.
2538 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2539 address_for_local): Likewise.
2540 * target.h (Target::plt_address_for_global, plt_address_for_local):
2541 Update comment.
2542 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2543 (Output_data_got::Got_entry::write): Nor here.
2544 * output.h: Comment fix.
2545
e867b647
WL
25462012-10-02 Jiong Wang <jiwang@tilera.com>
2547
2548 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2549 global_offset_table_ value for larget got.
2550 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2551
e5d5f5ed
AM
25522012-09-29 Alan Modra <amodra@gmail.com>
2553
2554 * powerpc.cc (Target_powerpc::iplt_): New output section.
2555 (Target_powerpc::iplt_section, make_iplt_section,
2556 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2557 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2558 Target_powerpc::plt_entry_count): Count iplt entries too.
2559 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2560 reloc section in constructor. New params.
2561 (Target_powerpc::make_plt_section): Create reloc section here instead.
2562 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2563 functions.
2564 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2565 (Output_data_glink::add_entry, find_entry): New functions to
2566 deal with local syms.
2567 (Glink_sym_ent): Add support for local syms.
2568 (Output_data_glink::do_write): Handle ifunc plt entries.
2569 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2570 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2571 (Target_powerpc::Relocate::relocate): Likewise.
2572 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2573
ec4dbad3
AM
25742012-09-25 Alan Modra <amodra@gmail.com>
2575
2576 * object.h (Sized_relobj_file::adjust_local_symbol,
2577 do_adjust_local_symbol): New functions.
2578 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2579 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2580 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2581 and irregular opd entry spacing.
2582 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2583 (Global_symbol_visitor_opd): New functor.
2584 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2585 on deleted opd entries.
2586
5c0b3823
WL
25872012-09-15 Jiong Wang <jiwang@tilera.com>
2588
2589 * tilegx.cc: New file.
2590 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2591 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2592 * configure.tgt: Add entries for tilegx*.
2593 * configure.ac: Likewise.
2594 * Makefile.in: Rebuild.
2595 * configure: Likewise.
2596 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2597 tilegx.
2598
bfdfa4cd
AM
25992012-09-13 Alan Modra <amodra@gmail.com>
2600
2601 * target-reloc.h (scan_relocs): Call scan.local for relocs
2602 against symbols in discarded sections. Pass is_discarded
2603 param.
2604 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2605 Add is_discarded param.
2606 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2607 is_discarded to flag opd entry as discarded. Don't emit dyn
2608 relocs on such entries.
2609 (Target_powerpc::Scan::global): Similarly detect and handle
2610 such opd entries.
2611 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2612 opd_ent_. Update all uses.
2613 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2614 (Target_powerpc::relocate_section): Zero out discarded opd
2615 entry relocs.
2616
d77a0555
ILT
26172012-09-12 Ian Lance Taylor <iant@google.com>
2618
2619 PR gold/14570
2620 * output.cc: Rename Output_data_got template parameter from size
2621 to got_size for all functions. Compile all variants of
2622 Output_data_got.
2623 (Output_data_got::Got_entry::write): Correct use of size for
2624 symbol value. Use local_is_tls rather than casting to
2625 Sized_relobj_file.
2626 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2627 (class Sized_relobj_file): Add do_local_is_tls.
2628 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2629
815a1205
AM
26302012-09-11 Alan Modra <amodra@gmail.com>
2631
2632 PR gold/14566
2633 * layout.cc (Layout::set_segment_offsets): When using
2634 common-page-size alignment, ensure we are on a new max-page-size
2635 page.
2636 * output.cc (Output_segment::set_section_addresses): Use
2637 abi_pagesize, not common_pagesize for relro boundary.
2638 (Output_segment::set_offset): Likewise.
2639
bd73a62d
AM
26402012-09-11 Alan Modra <amodra@gmail.com>
2641
2642 * output.h (Output_data_got::add_global_tls, add_local_tls,
2643 add_local_tls_pair): New functions.
2644 (Output_data_got::add_local_pair_with_rel): Remove second
2645 reloc param. Expand comment.
2646 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2647 use_plt_or_tls_offset_, similarly for constructor param.
2648 (Output_data_got::Got_entry::write): Add got_index param.
2649 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2650 add_local_tls_pair): New functions.
2651 (Output_data_got::Got_entry::write): Handle tls symbols
2652 with use_plt_or_tls_offset_ set specially.
2653 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2654 (Output_data_got::do_write): Replace iterator with index, pass
2655 index to entry write function.
2656 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2657 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2658 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2659 call.
2660 * i386.cc (Target_i386::Scan::local): Likewise.
2661 * sparc.cc (Target_sparc::Scan::local): Likewise.
2662 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2663 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2664 do_tls_offset_for_global): New functions.
2665 (Target_powerpc::Scan::local): Correct TLS relocations and got
2666 entry values.
2667 (Target_powerpc::Scan::global): Don't emit unnecessary
2668 dynamic relocations on TLS GOT entries.
2669
00716ab1
AM
26702012-09-10 Matthias Klose <doko@ubuntu.com>
2671
2672 * config.in: Disable sanity check for kfreebsd.
2673
c891b3f9
SA
26742012-09-10 Sterling Augustine <saugustine@google.com>
2675
2676 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2677 (Gdb_index::pubtypes_read): New parameter.
2678 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2679 to calls.
2680 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2681 pubtypes_object_.
2682
e81fea4d
AM
26832012-09-09 Alan Modra <amodra@gmail.com>
2684
2685 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2686 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2687 * gc.h (gc_process_relocs): Call target gc_add_reference.
2688 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2689 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2690 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2691 unnecessary cast.
2692 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2693 to cater for when we don't need code offset. Update use.
2694 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2695 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2696 set_opd_valid): New functions.
2697 (Target_powerpc::do_gc_add_reference): New function.
2698 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2699 stashed refs.
2700 (Target_powerpc::do_gc_mark_symbol): New function.
2701
d2d60eef
CC
27022012-09-06 Cary Coutant <ccoutant@google.com>
2703
2704 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2705 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2706 (Dwarf_die::skip_attributes): Likewise.
2707 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2708 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2709 (main): Call it.
2710 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2711
32ed4573
L
27122012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2713
2714 * testsuite/script_test_3.t: Add .got.plt output section
2715 statement.
2716 * testsuite/script_test_4.t: Likewise.
2717
f4baf0d4
AM
27182012-09-05 Alan Modra <amodra@gmail.com>
2719
2720 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2721 update all uses and lose "enum" when using type.
2722
864a1b56
AM
27232012-09-05 Alan Modra <amodra@gmail.com>
2724
2725 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2726 * configure: Regenerate.
2727 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2728 (plugin_final_layout.stdout): Likewise.
2729 (memory_test): Set page sizes to 0x1000.
2730 * testsuite/Makefile.in: Regenerate.
2731 * testsuite/discard_locals_test.sh: Add FIXME comment.
2732 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2733 * testsuite/pr14265.t: Add .got output section statement.
2734 * testsuite/script_test_2.t: Likewise.
2735 * testsuite/script_test_3.t: Likewise.
2736 * testsuite/script_test_4.t: Likewise.
2737 * testsuite/script_test_5.t: Likewise.
2738 * testsuite/script_test_6.t: Likewise.
2739 * testsuite/script_test_7.t: Likewise.
2740 * testsuite/script_test_9.t: Likewise.
2741
3ea0a085
AM
27422012-09-05 Alan Modra <amodra@gmail.com>
2743
2744 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2745 (Powerpc_relocate_functions::Status): New typedef.
2746 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2747 (Target_powerpc::Scan::local): Handle REL64.
2748 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2749 for REL32 and REL64.
2750 (Target_powerpc::symval_for_branch): New function, extracted from..
2751 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2752 checks. Report overflow errors.
2753
7404fe1b
AM
27542012-09-05 Alan Modra <amodra@gmail.com>
2755
2756 * object.h (Sized_relobj_file::emit_relocs): Delete.
2757 (Sized_relobj_file::emit_relocs_reltype): Delete.
2758 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2759 relocate_relocs for --emit-relocs.
2760 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2761 * output.h: Update comment.
2762 (Output_segment::first_section): New function.
2763 (Output_segment::first_section_load_address): Use first_section.
2764 * output.cc (Output_segment::first_section): New function extracted..
2765 (Output_segment::first_section_load_address): ..from here. Delete.
2766 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2767 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2768 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2769 adjust call to target.h function.
2770 * i386.cc (Target_i386): Likewise.
2771 * sparc.cc (Target_sparc): Likewise.
2772 * x86_64.cc (Target_x86_64): Likewise.
2773 * powerpc.cc (Target_powerpc): Likewise.
2774 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2775 first tls section has section symbol for optimised local dynamic
2776 output relocs.
2777 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2778 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2779 optimised tls code.
2780 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2781 Rename to relocate_relocs. Update error message.
2782
957564c9
AS
27832012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2784
2785 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2786 --just-symbols.
2787
dd93cd0a
AM
27882012-08-31 Alan Modra <amodra@gmail.com>
2789
2790 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2791 (Powerpc_relobj::toc_base_offset): New stub function.
2792 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2793 got_mod_index_offset to tlsld_got_offset. Update all refs.
2794 (Target_powerpc::Relocate::enum skip_tls): New.
2795 (Target_powerpc::call_tls_get_addr_): New var.
2796 (Target_powerpc::is_branch_reloc): Move to file scope.
2797 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2798 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2799 New functions.
2800 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2801 (powerpc_info): Correct common_pagesize for ppc64.
2802 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2803 (Powerpc_relocate_functions): Add overflow check enums and functions.
2804 Add non-shift version of rela, rela_ua. Delete all rel public
2805 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2806 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2807 addr16_ha3, addr14 functions.
2808 (Output_data_got_powerpc::add_constant_pair): New function.
2809 (Output_data_got_powerpc::got_base_offset): Likewise.
2810 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2811 (instruction constants): Sort, add some more.
2812 (Output_data_glink::do_write): Add and use Address typedef. Use
2813 object->toc_base_offset() stub for 64-bit.
2814 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2815 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2816 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2817 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2818 Always treat .opd relocs as against locally defined symbol.
2819 Correct condition for RELATIVE relocs.
2820 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2821 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2822 for 32-bit syms with a plt entry. Correct ppc64 toc base
2823 calculations. Handle TLS relocs, and more. Add overflow
2824 checking and adjust for Powerpc_relocate_functions changes.
2825 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2826 Reinstate --emit-relocs code with FIXME.
2827
a1373b60
AM
28282012-08-30 Alan Modra <amodra@gmail.com>
2829
2830 * layout.cc (Layout::set_segment_offsets): Set p_align to
2831 abi_pagesize, not common_pagesize.
2832 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2833 to determine whether file header can go in segment.
2834
703d02da
AM
28352012-08-30 Alan Modra <amodra@gmail.com>
2836
2837 * output.h (Output_reloc::Output_reloc <output section>): Add
2838 is_relative param. Adjust calls.
2839 (Output_reloc::add_output_section_relative): New functions.
2840 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2841 is_relative.
2842 (Output_reloc::symbol_value): Handle SECTION_CODE.
2843
16164a6b
ST
28442012-08-24 Sriraman Tallam <tmsriram@google.com>
2845
2846 * gold.cc (queue_middle_tasks): Call layout again when unique
2847 segments for sections is desired.
2848 * layout.cc (Layout::Layout): Initialize new members.
2849 (Layout::get_output_section_flags): New function.
2850 (Layout::choose_output_section): Call get_output_section_flags.
2851 (Layout::layout): Make output section for mapping to a unique segment.
2852 (Layout::insert_section_segment_map): New function.
2853 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2854 output sections marked so.
16164a6b
ST
2855 (Layout::segment_precedes): Check for unique segments when sorting.
2856 * layout.h (Layout::Unique_segment_info): New struct.
2857 (Layout::Section_segment_map): New typedef.
2858 (Layout::insert_section_segment_map): New function.
2859 (Layout::get_output_section_flags): New function.
2860 (Layout::is_unique_segment_for_sections_specified): New function.
2861 (Layout::set_unique_segment_for_sections_specified): New function.
2862 (Layout::unique_segment_for_sections_specified_): New member.
2863 (Layout::section_segment_map_): New member.
2864 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2865 Rename is_gc_pass_one to is_pass_one.
2866 Rename is_gc_pass_two to is_pass_two.
2867 Rename is_gc_or_icf to is_two_pass.
2868 Check for which pass based on whether symbols data is present.
2869 Make it two pass when unique segments for sections is desired.
2870 * output.cc (Output_section::Output_section): Initialize new
2871 members.
2872 * output.h (Output_section::is_unique_segment): New function.
2873 (Output_section::set_is_unique_segment): New function.
2874 (Output_section::is_unique_segment_): New member.
2875 (Output_section::extra_segment_flags): New function.
2876 (Output_section::set_extra_segment_flags): New function.
2877 (Output_section::extra_segment_flags_): New member.
2878 (Output_section::segment_alignment): New function.
2879 (Output_section::set_segment_alignment): New function.
2880 (Output_section::segment_alignment_): New member.
2881 (Output_segment::Output_segment): Initialize is_unique_segment_.
2882 (Output_segment::is_unique_segment): New function.
2883 (Output_segment::set_is_unique_segment): New function.
2884 (Output_segment::is_unique_segment_): New member.
2885 * plugin.cc (allow_unique_segment_for_sections): New function.
2886 (unique_segment_for_sections): New function.
2887 (Plugin::load): Add new functions to transfer vector.
2888 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2889 * Makefile.in: Regenerate.
2890 * testsuite/plugin_final_layout.sh: Check if unique segment
2891 functionality works.
2892 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2893 are available.
2894 (allow_unique_segment_for_sections): New global.
2895 (unique_segment_for_sections): New global.
2896 (claim_file_hook): Call allow_unique_segment_for_sections.
2897 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2898
1e2bee4f
CC
28992012-08-22 Cary Coutant <ccoutant@google.com>
2900
2901 * layout.cc (Layout::include_section): Don't assert on GROUP
2902 sections with --emit-relocs.
2903
1d5dfe78
CC
29042012-08-21 Cary Coutant <ccoutant@google.com>
2905
2906 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2907 if --export-dynamic-symbol names an undef symbol.
2908
c9269dff
AM
29092012-08-18 Alan Modra <amodra@gmail.com>
2910
2911 * powerpc.cc: Formatting and white space.
2912 (Powerpc_relobj): Rename got2_section_ to special_.
2913 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2914 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2915 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2916 (Target_powerpc): Add Address typedef and invalid_address. Use
2917 throughout.
2918 (Target_powerpc::is_branch_reloc): New function.
2919 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2920 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2921 for dst_mask, value and addend.
2922 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2923 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2924 (Output_data_glink::do_write): Correct toc base. Don't try to use
2925 uint16_t for 24-bit offset. Use get_output_section_offset and
2926 check return.
2927 (Target_powerpc::Scan::local): Handle more relocs.
2928 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2929 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2930 Plug in toc restoring insn after plt calls. Translate branches
2931 to function descriptor symbols to corresponding entry point.
2932 (Target_powerpc::relocate_for_relocatable): Check return from
2933 get_output_section_offset.
2934 * symtab.h: Comment typo.
2935
b1759dce
ILT
29362012-08-14 Ian Lance Taylor <iant@google.com>
2937
2938 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2939 unsupported_relocal_local to call unsupported_reloc_global.
2940
b9b2ae8b
NC
29412012-08-14 Nick Clifton <nickc@redhat.com>
2942
2943 PR ld/14265
2944 * script-sections.cc (Sections_element::output_section_name): Add
2945 keep return parameter.
2946 (Output_section_element::match_name): Add keep return parameter.
2947 Return the value of the keep_ member.
2948 * script-sections.h (class Output_section): Update
2949 output_section_name prototype.
2950 * layout.cc (Layout::keep_input_section): New public member
2951 function.
2952 (Layout::choose_output_section): Pass keep parameter to
2953 output_section_name.
2954 * layout.h (class Layout): Add keep_input_section.
2955 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2956 sections.
2957 * testsuite/Makefile.am: Add a test.
2958 * testsuite/Makefile.in: Regenerate.
2959 * testsuite/pr14265.c: Source file for the test.
2960 * testsuite/pr14265.t: Linker script for the test.
2961 * testsuite/pr14265.sh: Shell script for the test.
2962
921b5322
AM
29632012-08-14 Alan Modra <amodra@gmail.com>
2964
2965 * target.h (Target::output_section_name): New function.
2966 (Target::do_output_section_name): New function.
2967 * layout.cc (Layout::choose_output_section): Call the above.
2968 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2969
6ce78956
AM
29702012-08-14 Alan Modra <amodra@gmail.com>
2971
2972 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2973 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2974 for replace_constant call.
2975 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2976 (Output_data_glink::do_print_to_mapfile): New function.
2977 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2978 (Target_powerpc::Relocate::relocate): Likewise.
2979
d1a8cabd
AM
29802012-08-14 Alan Modra <amodra@gmail.com>
2981
2982 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2983 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2984 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2985 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2986 all references to shndx_. Handle special case for R_PPC_PLTREL24
2987 here.
2988 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2989 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2990 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2991 here.
2992 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2993 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2994
d83ce4e3
AM
29952012-08-12 Alan Modra <amodra@gmail.com>
2996
2997 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2998 (glink insn constants): Use uint32_t.
2999 (Output_data_glink::add_entry): Use insert, not [] operator.
3000
cf43a2fe
AM
30012012-08-11 Alan Modra <amodra@gmail.com>
3002
3003 * object.h (Sized_relobj_file::find_shdr): New function.
3004 (Sized_relobj_file::find_special_sections): New function.
3005 * object.cc (Sized_relobj_file::find_shdr): New function.
3006 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3007 (Sized_relobj_file::find_special_sections): New function, split out..
3008 (Sized_relobj_file::do_read_symbols): ..from here.
3009 * output.h (Output_data_got::replace_constant): New function.
3010 (Output_data_got::num_entries): New function.
3011 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3012 (Output_data_got::got_offset): Protected rather than private.
3013 (Output_data_got::replace_got_entry): New function.
3014 * output.cc (Output_data_got::replace_got_entry): New function.
3015 * powerpc.cc (class Powerpc_relobj): New.
3016 (class Powerpc_relocate_functions): Delete all psymval variants or
3017 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3018 Implement _ha functions using corresponding _hi function.
3019 (Powerpc_relobj::find_special_sections): New function.
3020 (Target_powerpc::do_make_elf_object): New function.
3021 (class Output_data_got_powerpc): New.
3022 (class Output_data_glink): New.
3023 (class Powerpc_scan_relocatable_reloc): New.
3024 Many more changes througout file.
3025
3c892704
NC
30262012-08-09 Nick Clifton <nickc@redhat.com>
3027
3028 * po/vi.po: Updated Vietnamese translation.
3029
82435b3b
ILT
30302012-08-07 Ian Lance Taylor <iant@google.com>
3031
3032 * layout.cc (Layout::add_target_dynamic_tags): If
3033 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3034 plt_rel.
3035
a6dc81d2
NC
30362012-07-30 Nick Clifton <nickc@redhat.com>
3037
3038 * po/gold.pot: Updated template.
3039 * po/es.po: Updated Spanish translation.
3040
f1415016
CC
30412012-07-18 Cary Coutant <ccoutant@google.com>
3042
3043 PR gold/14344
3044 * configure.ac: Add check for -gpubnames support.
3045 * configure: Regenerate.
3046 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3047 support; force -gno-pubnames.
3048 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3049 support.
3050 (gdb_index_test_4): New test.
3051 * testsuite/Makefile.in: Regenerate.
3052 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3053 * testsuite/gdb_index_test_2.sh: Likewise.
3054 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3055 * testsuite/gdb_index_test_4.sh: New script.
3056 * testsuite/gdb_index_test_comm.sh: New script with common code;
3057 don't look for space after colon.
3058
b7fd7c37
ST
30592012-07-16 Sriraman Tallam <tmsriram@google.com>
3060
3061 * gold.cc (queue_middle_tasks): Update function order only after
3062 deferred objects due to plugins are processed.
3063
1f3212db
ILT
30642012-07-11 Ian Lance Taylor <iant@google.com>
3065
3066 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3067 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3068 (Target_arm::scan_reloc_for_stub): Likewise.
3069 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3070 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3071 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3072 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3073 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3074
81c82a68
ILT
30752012-07-10 Dodji Seketeli <dodji@redhat.com>
3076 Ian Lance Taylor <iant@google.com>
3077
3078 PR gold/14309
3079 * configure.ac: Test whether std::tr1::hash<off_t> works.
3080 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3081 needed.
3082 * output.h (class Output_fill): Add virtual destructor.
3083 * configure, config.in: Rebuild.
3084
eabc84f4
RM
30852012-06-22 Roland McGrath <mcgrathr@google.com>
3086
3087 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3088
370e30b6
RÁE
30892012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3090
3091 * plugin.cc (Plugin::load): Handle position independent executables.
3092
fb1b895d
CC
30932012-06-06 Cary Coutant <ccoutant@google.com>
3094
3095 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3096 add .debug_macro.
3097 (lines_only_debug_sections): Likewise.
3098 (gdb_fast_lookup_sections): New static array.
3099 (is_gdb_debug_section): Rename formal parameter.
3100 (is_lines_only_debug_section): Likewise.
3101 (is_gdb_fast_lookup_section): New function.
3102 (Layout::include_section): Check for ".zdebug_" prefix; pass
3103 section name suffix to is_gdb_debug_section, et al.; check for
3104 fast-lookup sections when building .gdb_index.
3105 * options.h (--strip-debug-gdb): Update GDB version number.
3106
7c0640fa
CC
31072012-06-06 Cary Coutant <ccoutant@google.com>
3108
3109 * configure.ac: Add check for fallocate.
3110 * configure: Regenerate.
3111 * config.in: Regenerate.
3112
3113 * options.h (class General_options): Add --mmap-output-file and
3114 --posix-fallocate options.
3115 * output.cc: (posix_fallocate): Remove; replace with...
3116 (gold_fallocate): New function.
3117 (Output_file::map_no_anonymous): Call gold_fallocate.
3118 (Output_file::map): Check --mmap-output-file option.
3119
2a49eb69
DK
31202012-06-05 Jing Yu <jingyu@google.com>
3121
3122 * gold.h (textdomain): Add do {} to empty while(0).
3123 (bindtextdomain): Likewise.
3124
fad072ac
CC
31252012-06-04 Cary Coutant <ccoutant@google.com>
3126
3127 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3128 has_dynsym_index.
3129
8cc69fb6
ST
31302012-05-25 Sriraman Tallam <tmsriram@google.com>
3131
3132 * symtab.cc (Symbol_table::define_special_symbol):
3133 Initialize *poldsym to prevent uninitialized variable errors.
3134
1be75daa
CC
31352012-05-23 Cary Coutant <ccoutant@google.com>
3136
3137 * layout.cc (Layout::section_name_mapping): Add rules to handle
3138 exact match on .data.rel.ro.local or .data.rel.ro.
3139 (Layout::output_section_name): Check for exact matches.
3140
9b689de0
CC
31412012-05-23 Cary Coutant <ccoutant@google.com>
3142
3143 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3144 more carefully.
3145
b24fdbf5
CC
31462012-05-22 Cary Coutant <ccoutant@google.com>
3147
3148 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3149 object before exporting symbol.
3150
e550e1a2
L
31512012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3152
3153 * testsuite/tls_test.cc: Include "config.h" first.
3154 * testsuite/tls_test_c.c: Likewise.
3155
df7b86aa
NC
31562012-05-17 Daniel Richard G. <skunk@iskunk.org>
3157 Nick Clifton <nickc@redhat.com>
3158
3159 PR 14072
3160 * configure.in: Add check that sysdep.h has been included before
3161 any system header files.
3162 * configure: Regenerate.
3163 * config.in: Regenerate.
3164
1007b503
CC
31652012-05-14 Cary Coutant <ccoutant@google.com>
3166
3167 * layout.cc (Layout::make_output_section): Mark .tdata section
3168 as RELRO.
3169 * testsuite/relro_test.cc: Add a TLS variable.
3170
fd885f3a
L
31712012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3172
3173 PR gold/14091
3174 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3175 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3176 R_X86_64_64.
3177
80f5885c
CC
31782012-05-08 Cary Coutant <ccoutant@google.com>
3179
3180 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3181 (lines_only_debug_sections): Likewise.
3182
2e702c99
RM
31832012-05-02 Roland McGrath <mcgrathr@google.com>
3184
3185 * nacl.cc: New file.
3186 * nacl.h: New file.
3187 * Makefile.am (CCFILES, HFILES): Add them.
3188 * Makefile.in: Regenerate.
3189 * i386.cc (Output_data_plt_i386_nacl): New class.
3190 (Output_data_plt_i386_nacl_exec): New class.
3191 (Output_data_plt_i386_nacl_dyn): New class.
3192 (Target_i386_nacl): New class.
3193 (Target_selector_i386_nacl): New class.
3194 (target_selector_i386): Use it instead of Target_selector_i386.
3195 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3196 (Target_x86_64_nacl): New class.
3197 (Target_selector_x86_64_nacl): New class.
3198 (target_selector_x86_64, target_selector_x32): Use it instead of
3199 Target_selector_x86_64.
3200 * arm.cc (Output_data_plt_arm_nacl): New class.
3201 (Target_arm_nacl): New class.
3202 (Target_selector_arm_nacl): New class.
3203 (target_selector_arm, target_selector_armbe): Use it instead of
3204 Target_selector_arm.
3205
3206 * target-select.cc (select_target): Take new Input_file* and off_t
3207 arguments, pass them on to recognize method of selector.
3208 * object.cc (make_elf_sized_object): Update caller.
3209 * parameters.cc (parameters_force_valid_target): Likewise.
3210 * incremental.cc (make_sized_incremental_binary): Likewise.
3211 * target-select.h: Update decl.
3212 (Target_selector::recognize): Take new Input_file* argument,
3213 pass it on to do_recognize.
3214 (Target_selector::do_recognize): Take new Input_file* argument.
3215 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3216 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3217 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3218 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3219
3220 * target.h (Target::Target_info): New members isolate_execinstr
3221 and rosegment_gap.
3222 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3223 * arm.cc (Target_arm::arm_info): Update initializer.
3224 * i386.cc (Target_i386::i386_info): Likewise.
3225 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3226 * sparc.cc (Target_sparc::sparc_info): Likewise.
3227 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3228 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3229 * layout.cc (Layout::attach_allocated_section_to_segment):
3230 Take new const Target* argument. If target->isolate_execinstr(), act
3231 like --rosegment.
3232 (Layout::find_first_load_seg): Take new const Target* argument;
3233 if target->isolate_execinstr(), reject PF_X segments.
3234 (Layout::relaxation_loop_body): Update caller.
3235 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3236 reset file offset to zero when we hit LOAD_SEG, and then do a second
3237 loop over the segments before LOAD_SEG to reassign offsets after
3238 addresses have been determined. Handle target->rosegment_gap().
3239 (Layout::attach_section_to_segment): Take new const Target* argument;
3240 pass it to attach_allocated_section_to_segment.
3241 (Layout::make_output_section): Update caller.
3242 (Layout::attach_sections_to_segments): Take new const Target* argument;
3243 pass it to attach_section_to_segment.
3244 * gold.cc (queue_middle_tasks): Update caller.
3245 * layout.h (Layout): Update method decls with new arguments.
3246
3247 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3248 Target_info pointer to use.
3249 (Target_arm::do_make_data_plt): New virtual method.
3250 (Target_arm::make_data_plt): New method that calls it.
3251 (Target_arm::make_plt_entry): Use it.
3252 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3253 for the section alignment.
3254 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3255 method.
3256 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3257 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3258 method.
3259 (Output_data_plt_arm::get_plt_entry_size): Call it.
3260 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3261 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3262 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3263 method.
3264 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3265 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3266 method instead of sizeof(plt_entry).
3267 (Output_data_plt_arm::add_entry): Likewise.
3268 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3269 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3270 than static method.
3271 (Target_arm::plt_entry_size): Likewise.
3272 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3273 Move to ...
3274 (Output_data_plt_arm_standard): ... here, new class.
3275 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3276 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3277 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3278
3279 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3280 Take additional argument for the PLT entry size.
3281 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3282 Use get_plt_entry_size method rather than plt_entry_size variable.
3283 (Output_data_plt_x86_64::reserve_slot): Likewise.
3284 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3285 (Output_data_plt_x86_64::add_entry): Likewise.
3286 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3287 (Output_data_plt_x86_64::address_for_global): Likewise.
3288 (Output_data_plt_x86_64::address_for_local): Likewise.
3289 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3290 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3291 Make method non-static.
3292 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3293 method.
3294 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3295 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3296 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3297 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3298 virtual method.
3299 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3300 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3301 virtual method.
3302 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3303 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3304 virtual method.
3305 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3306 (Output_data_plt_x86_64::plt_entry_size)
3307 (Output_data_plt_x86_64::first_plt_entry)
3308 (Output_data_plt_x86_64::plt_entry)
3309 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3310 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3311 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3312 (Output_data_plt_x86_64_standard): ... here, new class.
3313 (Target_x86_64::Target_x86_64): Take optional argument for the
3314 Target_info pointer to use.
3315 (Target_x86_64::do_make_data_plt): New virtual method.
3316 (Target_x86_64::make_data_plt): New method to call it.
3317 (Target_x86_64::init_got_plt_for_update): Use that.
3318 Call this->plt_->add_eh_frame method here.
3319 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3320 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3321 rather than static method.
3322 (Target_x86_64::plt_entry_size): Likewise.
3323 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3324 rather than plt_entry_size variable. Move guts of PLT filling to...
3325 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3326 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3327 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3328
3329 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3330 additional argument for the section alignment.
3331 Don't do add_eh_frame_for_plt here.
3332 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3333 non-static. Use get_plt_entry_size method rather than plt_entry_size
3334 variable.
3335 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3336 method.
3337 (Output_data_plt_i386::get_plt_entry_size): Call it.
3338 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3339 (Output_data_plt_i386::add_eh_frame): New method to call it.
3340 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3341 method.
3342 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3343 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3344 method.
3345 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3346 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3347 method instead of plt_entry_size.
3348 (Output_data_plt_i386::plt_entry_size)
3349 (Output_data_plt_i386::plt_eh_frame_fde_size)
3350 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3351 (Output_data_plt_i386_standard): ... here, new class.
3352 (Output_data_plt_i386_exec): New class.
3353 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3354 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3355 (Output_data_plt_i386::exec_plt_entry): Move to ...
3356 (Output_data_plt_i386_exec::plt_entry): ... here.
3357 (Output_data_plt_i386_dyn): New class.
3358 (Output_data_plt_i386::first_plt_entry): Move to ...
3359 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3360 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3361 (Output_data_plt_i386_dyn::plt_entry): ... here.
3362 (Target_i386::Target_i386): Take optional argument for the Target_info
3363 pointer to use.
3364 (Target_i386::do_make_data_plt): New virtual method.
3365 (Target_i386::make_data_plt): New method to call it.
3366 (Target_i386::make_plt_section): Use that.
3367 Call this->plt_->add_eh_frame method here.
3368 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3369 rather than plt_entry_size variable.
3370 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3371 (Output_data_plt_i386::address_for_local): Likewise.
3372 (Output_data_plt_i386::do_write): Likewise.
3373 Move guts of PLT filling to...
3374 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3375 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3376 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3377 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3378
b9b9f2ee
CC
33792012-05-01 Cary Coutant <ccoutant@google.com>
3380
3381 * dwarf_reader.cc (Dwarf_die::read_attributes)
3382 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3383 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3384 * reduced_debug_output.cc
3385 (Output_reduced_debug_info_section::get_die_end): Remove
3386 DW_FORM_GNU_ref_index. Add default case.
3387
57923f48
MW
33882012-04-26 Mark Wielaard <mjw@redhat.com>
3389
3390 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3391 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3392 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3393 DW_AT_high_pc as offset from DW_AT_low_pc.
3394
3395 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3396 * testsuite/Makefile.in: Regenerate.
3397 * testsuite/gdb_index_test_3.c: New test source file.
3398 * testsuite/gdb_index_test_3.sh: New test source file.
3399
2c54b4f4
ILT
34002012-04-25 Ian Lance Taylor <iant@google.com>
3401
3402 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3403 pointer.
3404 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3405 as a class, not a struct.
3406 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3407 (Target_arm::apply_cortex_a8_workaround): Likewise.
3408 * gc.h: Declare Reloc_types as a struct, not a class.
3409 * object.h: Declare Symbols_data as a struct.
3410 * reloc.h: Declare Read_relocs_data as a struct.
3411 * target.h: Declare Relocate_info as a struct.
3412
a5a5f7a3
DM
34132012-04-24 David S. Miller <davem@davemloft.net>
3414
3415 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3416 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3417 and R_SPARC_WPLT30.
3418
f038d496
CC
34192012-04-24 Cary Coutant <ccoutant@google.com>
3420
3421 * incremental-dump.cc (find_input_containing_global): Replace
3422 magic number with symbolic constant.
3423 (dump_incremental_inputs): Update version number.
3424 * incremental.cc (Output_section_incremental_inputs): Update version
3425 number; import symbolic constants from Incremental_inputs_reader.
3426 (Incremental_inputs::create_data_sections): Align relocations
3427 section correctly for 64-bit targets.
3428 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3429 constants; add padding.
3430 (Output_section_incremental_inputs::write_header): Add assert for
3431 header_size.
3432 (Output_section_incremental_inputs::write_input_files): Add assert
3433 for input_entry_size.
3434 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3435 add assert for object_info_size, input_section_entry_size,
3436 global_sym_entry_size.
3437 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3438 for data structure sizes; use them.
3439 (Incremental_input_entry_reader): Import symbolic constants from
3440 Incremental_inputs_reader; use them.
3441
a4d85145
DM
34422012-04-23 David S. Miller <davem@davemloft.net>
3443
3444 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3445 and elf_flags_set_.
3446 (Target_sparc::Target_sparc): Initialize new fields.
3447 (Target_sparc::do_make_elf_object): New function.
3448 (Target_sparc::do_adjust_elf_header): New function.
3449
1d509098
CC
34502012-04-23 Cary Coutant <ccoutant@google.com>
3451
3452 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3453 CU range table of gdb index.
3454
7ebeff7f
DM
34552012-04-20 David S. Miller <davem@davemloft.net>
3456
3457 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3458 instead of false.
3459
13cf9988
DM
34602012-04-16 David S. Miller <davem@davemloft.net>
3461
2a1079e8
DM
3462 * sparc.cc (Target_sparc::got_address): New function.
3463 (Sparc_relocate_functions::gdop_hix22): New function.
3464 (Sparc_relocate_functions::gdop_lox10): New function.
3465 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3466 relocs.
3467 (Target_sparc::Scan::local): Likewise if the global symbol is not
3468 preemptible and is not IFUNC.
3469 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3470 transformations for local and non-preemptible non-IFUNC global
3471 symbols.
3472
0bc964fc
DM
3473 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3474 writing out 64-bit part of ranges.
3475
661d7a80
DM
3476 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3477 -fpic and -fpie respectively.
3478 * Makefile.in: Regenerate.
3479
8c2bf391
DM
3480 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3481 (Target_sparc::Target_sparc): Initialize new field.
3482 (Target_sparc::do_plt_section_for_global): New function.
3483 (Target_sparc::do_plt_section_for_local): New function.
3484 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3485 (Target_sparc::make_plt_section): New function, broken out of
3486 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3487 (Target_sparc::make_plt_entry): Call make_plt_section.
3488 (Target_sparc::make_local_ifunc_plt_entry): New function.
3489 (Target_sparc::rela_ifunc_section): New function.
3490 (Target_sparc::plt_section): Remove const.
3491 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3492 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3493 and ifunc_count_ fields.
3494 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3495 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3496 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3497 (Output_data_plt_sparc::rela_ifunc): New function.
3498 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3499 (Output_data_plt_sparc::has_ifunc_section): New function.
3500 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3501 (Output_data_plt_sparc::address_for_global): New function.
3502 (Output_data_plt_sparc::address_for_local): New function.
3503 (Output_data_plt_sparc::plt_index_to_offset): New function.
3504 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3505 and entry_count.
3506 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3507 entry_count.
3508 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3509 R_SPARC_JMP_IREL to switch.
3510 (Target_sparc::Scan::check_non_pic): Likewise.
3511 (Target_sparc::Scan::local): Handle IFUNC symbols.
3512 (Target_sparc::Scan::local): Likewise.
3513 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3514 and plt_address_for_local.
3515 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3516 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3517
13cf9988
DM
3518 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3519 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3520 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3521 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3522 global relocs too.
3523 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3524 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3525 calls.
3526 * sparc.cc (Target_sparc::Scan::global): Likewise.
3527 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3528
31821be0
CC
35292012-04-16 Cary Coutant <ccoutant@google.com>
3530
3531 * archive.cc (Library_base::should_include_member): Check for
3532 --export-dynamic-symbol.
3533 * options.h (class General_options): Add --export-dynamic-symbol.
3534 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3535 --export-dynamic-symbol.
3536 (Symbol_table::gc_mark_undef_symbols): Likewise.
3537 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3538
2615994e
DM
35392012-04-12 David S. Miller <davem@davemloft.net>
3540
3541 * sparc.cc (Reloc::wdisp10): New relocation method.
3542 (Reloc::h34): Likewise.
3543 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3544 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3545 R_SPARC_WDISP10.
3546 (Target_sparc::Scan::local): Likewise.
3547 (Target_sparc::Scan::global): Likewise.
3548 (Target_sparc::Relocate::relocate): Likewise.
3549
6782735d
CC
35502012-04-09 Cary Coutant <ccoutant@google.com>
3551
3552 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3553 low_pc == 0.
3554
8c7a0b00
ILT
35552012-04-06 Ian Lance Taylor <iant@google.com>
3556
3557 * timer.cc: #include <unistd.h>.
3558
58797674
RM
35592012-04-06 Roland McGrath <mcgrathr@google.com>
3560
3561 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3562 * config.in: Regenerate.
3563 * configure: Regenerate.
3564
44350750
NC
35652012-04-05 Nick Clifton <nickc@redhat.com>
3566
3567 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3568 (AM_LC_MESSAGES): Add.
3569 * aclocal.m4: Regenerate.
3570 * config.in: Regenerate.
3571 * configure: Regenerate.
3572
c1027032
CC
35732012-03-21 Cary Coutant <ccoutant@google.com>
3574
3575 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3576 * Makefile.in: Regenerate.
3577 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3578 (Sized_elf_reloc_mapper::symbol_section): New function.
3579 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3580 (make_elf_reloc_mapper): New function.
3581 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3582 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3583 (Dwarf_abbrev_table::do_get_abbrev): New function.
3584 (Dwarf_ranges_table::read_ranges_table): New function.
3585 (Dwarf_ranges_table::read_range_list): New function.
3586 (Dwarf_pubnames_table::read_section): New function.
3587 (Dwarf_pubnames_table::read_header): New function.
3588 (Dwarf_pubnames_table::next_name): New function.
3589 (Dwarf_die::Dwarf_die): New function.
3590 (Dwarf_die::read_attributes): New function.
3591 (Dwarf_die::skip_attributes): New function.
3592 (Dwarf_die::set_name): New function.
3593 (Dwarf_die::set_linkage_name): New function.
3594 (Dwarf_die::attribute): New function.
3595 (Dwarf_die::string_attribute): New function.
3596 (Dwarf_die::int_attribute): New function.
3597 (Dwarf_die::uint_attribute): New function.
3598 (Dwarf_die::ref_attribute): New function.
3599 (Dwarf_die::child_offset): New function.
3600 (Dwarf_die::sibling_offset): New function.
3601 (Dwarf_info_reader::check_buffer): New function.
3602 (Dwarf_info_reader::parse): New function.
3603 (Dwarf_info_reader::do_parse): New function.
3604 (Dwarf_info_reader::do_read_string_table): New function.
3605 (Dwarf_info_reader::lookup_reloc): New function.
3606 (Dwarf_info_reader::get_string): New function.
3607 (Dwarf_info_reader::visit_compilation_unit): New function.
3608 (Dwarf_info_reader::visit_type_unit): New function.
3609 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3610 Sized_elf_reloc_mapper.
3611 (Sized_dwarf_line_info::symbol_section): Remove function.
3612 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3613 (Sized_dwarf_line_info::read_line_mappings): Remove object
3614 parameter, adjust callers.
3615 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3616 * dwarf_reader.h: Include <sys/types.h>.
3617 (class Track_relocs): Remove forward declaration.
3618 (class Elf_reloc_mapper): New class.
3619 (class Sized_elf_reloc_mapper): New class.
3620 (class Dwarf_abbrev_table): New class.
3621 (class Dwarf_range_list): New class.
3622 (class Dwarf_ranges_table): New class.
3623 (class Dwarf_pubnames_table): New class.
3624 (class Dwarf_die): New class.
3625 (class Dwarf_info_reader): New class.
3626 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3627 (Sized_dwarf_line_info::symbol_section): Remove member function.
3628 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3629 base class.
3630 * gdb-index.cc: New source file.
3631 * gdb-index.h: New source file.
3632 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3633 and .debug_types sections, call Layout::add_to_gdb_index.
3634 (Sized_relobj_incr::do_section_name): Implement.
3635 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3636 return type; Implement.
3637 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3638 return type.
3639 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3640 parameter list and return type.
3641 (Sized_incr_dynobj::do_section_contents): Likewise.
3642 * layout.cc: Include gdb-index.h.
3643 (Layout::Layout): Initialize gdb_index_data_.
3644 (Layout::init_fixed_output_section): Check for .gdb_index section.
3645 (Layout::add_to_gdb_index): New function. Instantiate.
3646 * layout.h: Add forward declaration for class Gdb_index.
3647 (Layout::add_to_gdb_index): New member function.
3648 (Layout::gdb_index_data_): New data member.
3649 * main.cc: Include gdb-index.h.
3650 (main): Print statistics for gdb index.
3651 * object.cc (Object::section_contents): Move code into
3652 do_section_contents.
3653 (need_decompressed_section): Check for sections needed when building
3654 gdb index.
3655 (build_compressed_section_map): Likewise.
3656 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3657 gdb index.
3658 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3659 sections; call Layout::add_to_gdb_index.
3660 (Sized_relobj_file::do_decompressed_section_contents): Call
3661 do_section_contents directly.
3662 * object.h (Object::do_section_contents): Adjust parameter list and
3663 return type.
3664 (Object::do_decompressed_section_contents): Call do_section_contents
3665 directly.
3666 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3667 return type.
3668 * options.h (class General_options): Add --gdb-index option.
3669 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3670 list and return type.
3671 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3672 * reloc.h (Track_relocs::checkpoint): New function.
3673 (Track_relocs::reset): New function.
3674
3675 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3676 New test cases.
3677 * testsuite/Makefile.in: Regenerate.
3678 * testsuite/gdb_index_test.cc: New test source file.
3679 * testsuite/gdb_index_test_1.sh: New test source file.
3680 * testsuite/gdb_index_test_2.sh: New test source file.
3681
647f1574
DK
36822012-03-19 Doug Kwan <dougkwan@google.com>
3683
3684 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3685 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3686 __exidx_start and __exidx_end. Make symbol table parameter
3687 anonymous as it is not used.
3688 * gold.cc (queue_middle_tasks): Call target hook to define any
3689 target-specific symbols.
3690 * target.h (Target::define_standard_symbols): New method.
3691 (Target::do_define_standard_symbols): Same.
3692 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3693 * testsuite/Makefile.in: Regenerate.
3694 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3695 and __exidx_end.
3696 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3697 relocations are generated for __exidx_start and __exidx_end.
3698
7c6109da
DK
36992012-03-16 Doug Kwan <dougkwan@google.com>
3700
3701 * testsuite/Makefile.am: Disable test initpri3b.
3702 * testsuite/Makefile.in: Regenerate.
3703
7b8957f8
DK
37042012-03-15 Doug Kwan <dougkwan@google.com>
3705
3706 * arm.cc (Target_arm::got_section): Make .got section read-only
3707 if -z now is given.
3708
14dc9ef7
ILT
37092012-03-15 Ian Lance Taylor <iant@google.com>
3710
3711 PR gold/13850
3712 * layout.cc (Layout::make_output_section): Correctly mark
3713 SHT_INIT_ARRAY, et. al., as relro.
3714
fa40b62a
DK
37152012-03-14 Doug Kwan <dougkwan@google.com>
3716
3717 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3718 dynamic relocations for protected symbols in shared objects.
3719
fd325007
ILT
37202012-03-13 Ian Lance Taylor <iant@google.com>
3721
3722 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3723 keep the larger alignment.
3724
e8dd54e1
CC
37252012-03-12 Cary Coutant <ccoutant@google.com>
3726
3727 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3728 handling of DW_LNE_define_file.
3729
feb5f3b0
CC
37302012-03-12 Cary Coutant <ccoutant@google.com>
3731
3732 * reduced_debug_output.cc
3733 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3734 codes to switch.
3735
a1fb4256
CC
37362012-02-29 Cary Coutant <ccoutant@google.com>
3737
3738 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3739
5dd8762a
CC
37402012-02-29 Cary Coutant <ccoutant@google.com>
3741
3742 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3743 Call Object::decompressed_section_contents.
3744 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3745 New dtor.
3746 (Sized_dwarf_line_info::buffer_start_): New data member.
3747 * merge.cc (Output_merge_data::do_add_input_section): Call
3748 Object::decompressed_section_contents.
3749 (Output_merge_string::do_add_input_section): Likewise.
3750 * object.cc (need_decompressed_section): New function.
3751 (build_compressed_section_map): Decompress sections needed later.
3752 (Sized_relobj_file::do_decompressed_section_contents): New function.
3753 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3754 * object.h (Object::decompressed_section_contents): New function.
3755 (Object::discard_decompressed_sections): New function.
3756 (Object::do_decompressed_section_contents): New function.
3757 (Object::do_discard_decompressed_sections): New function.
3758 (Compressed_section_info): New type.
3759 (Compressed_section_map): Include decompressed section contents.
3760 (Sized_relobj_file::do_decompressed_section_contents): New function.
3761 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3762
7b5de7ee
CC
37632012-02-16 Cary Coutant <ccoutant@google.com>
3764
3765 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3766 * testsuite/Makefile.in: Regenerate.
3767
f9fa4a63
CC
37682012-02-14 Cary Coutant <ccoutant@google.com>
3769
3770 * options.cc (General_options::finalize): Disallow -pie and -static.
3771
2c175ebc
DK
37722012-02-03 Doug Kwan <dougkwan@google.com>
3773
3774 * arm.cc (Arm_relocate_functions::abs8,
3775 Arm_relocate_functions::abs16): Use
3776 Bits::has_signed_unsigned_overflow32.
3777 (Arm_relocate_functions::thm_abs8): Correct range of
3778 overflow check.
3779 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3780 in assertions.
3781
90cff06f
DK
37822012-02-02 Doug Kwan <dougkwan@google.com>
3783
3784 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3785 position independent outputs, not just shared objects.
3786
63887f3d
L
37872012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3788
3789 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3790 * configure: Regenerated.
3791
bef2b434
ILT
37922012-01-27 Ian Lance Taylor <iant@google.com>
3793
3794 * reloc.h (Bits): New class with static functions, copied from
3795 namespace utils in arm.cc.
3796 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3797 instead.
3798
c335b55d
L
37992012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3800
3801 * incremental.cc (write_info_blocks): Correct relocation offset.
3802
41194d9f
L
38032012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3804
3805 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3806 (Relocate::tls_gd_to_le): Likewise.
3807
1bae613c
L
38082012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3809
3810 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3811
24482ca0
L
38122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3813
3814 * configure.ac: Check if -mcmodel=medium works.
3815 * configure: Regenerated.
3816
c2c7840a
CC
38172012-01-24 Cary Coutant <ccoutant@google.com>
3818
3819 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3820 definition and ...
3821 (read_unsigned_LEB_128_x): ... this new function.
3822 (read_signed_LEB_128): Replaced with inline definition and ...
3823 (read_signed_LEB_128_x): ... this new function.
3824 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3825 (read_unsigned_LEB_128): Add inline definition.
3826 (read_signed_LEB_128_x): New function.
3827 (read_signed_LEB_128): Add inline definition.
3828 * testsuite/Makefile.am (leb128_unittest): New unit test.
3829 * testsuite/Makefile.in: Regenerate.
3830 * testsuite/leb128_unittest.cc: New unit test.
3831
833de760 38322012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3833
3834 PR gold/13617
3835 * i386.cc (Target_i386::do_code_fill): When using a jmp
3836 instruction, pad with nop instructions.
3837 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3838
618d6666
L
38392012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3840
3841 * x86_64.cc (gc_process_relocs): Add typename on types used in
3842 template.
3843 (scan_relocs): Likewise.
3844 (relocate_section): Likewise.
3845 (apply_relocation): Likewise.
3846
3660ff06
L
38472012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3848
3849 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3850 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3851 under x32.
3852
fc51264f
L
38532012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3854
3855 * x86_64.cc: Initial support for x32.
3856
dd74ae06
CC
38572012-01-03 Cary Coutant <ccoutant@google.com>
3858
3859 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3860 Use abstract base class for GOT.
3861 * gold/output.h (class Output_data_got_base): New abstract base class.
3862 (class Output_data_got): Derive from new base class, adjust ctors.
3863 (Output_data_got::reserve_slot): Make virtual; rename to
3864 do_reserve_slot; Adjust callers.
3865 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3866 pointer to abstract base class.
3867 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3868
83896202
ILT
38692011-12-18 Ian Lance Taylor <iant@google.com>
3870
3871 * object.h (Relobj::local_symbol_value): New function.
3872 (Relobj::local_plt_offset): New function.
3873 (Relobj::local_has_got_offset): New function.
3874 (Relobj::local_got_offset): New function.
3875 (Relobj::set_local_got_offset): New function.
3876 (Relobj::do_local_symbol_value): New pure virtual function.
3877 (Relobj::do_local_plt_offset): Likewise.
3878 (Relobj::do_local_has_got_offset): Likewise.
3879 (Relobj::do_local_got_offset): Likewise.
3880 (Relobj::do_set_local_got_offset): Likewise.
3881 (Sized_relobj::do_local_has_got_offset): Rename from
3882 local_has_got_offset.
3883 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3884 (Sized_relobj::do_set_local_got_offset): Rename from
3885 set_local_got_offset.
3886 (Sized_relobj_file::do_local_plt_offset): Rename from
3887 local_plt_offset.
3888 (Sized_relobj_file::do_local_symbol_value): New function.
3889 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3890 local_plt_offset.
3891 * output.cc (Output_data_got::Got_entry::write): Change object to
3892 Relobj. Use local_symbol_value.
3893 (Output_data_got::add_global_with_rel): Change rel_dyn to
3894 Output_data_reloc_generic*. Use add_global_generic.
3895 (Output_data_got::add_global_with_rela): Remove. Change all
3896 callers to use add_global_with_rel.
3897 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3898 Output_data_reloc_generic*. Use add_global_generic.
3899 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3900 callers to use add_global_pair_with_rel.
3901 (Output_data_got::add_local): Change object to Relobj*.
3902 (Output_data_got::add_local_plt): Likewise.
3903 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3904 change rel_dyn to Output_data_reloc_generic*. Use
3905 add_local_generic.
3906 (Output_data_got::add_local_with_rela): Remove. Change all
3907 callers to use all_local_with_rel.
3908 (Output_data_got::add_local_pair_with_rel): Change object to
3909 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3910 add_output_section_generic.
3911 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3912 callers to use add_local_pair_with_rel.
3913 (Output_data_got::reserve_local): Change object to Relobj*.
3914 * output.h: (class Output_data_reloc_generic): Add pure virtual
3915 declarations for add_global_generic, add_local_generic,
3916 add_output_section_generic.
3917 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3918 functions for Output_data_reloc_generic. Update declarations for
3919 changes listed in output.cc.
3920 (class Output_data_got): Change template parameter to got_size.
3921 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3922 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3923 function.
3924 (Sized_relobj_incr::do_local_plt_offset): New function.
3925 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3926 add_global_generic.
3927
76677ad0
CC
39282011-12-17 Cary Coutant <ccoutant@google.com>
3929
3930 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3931 * resolve.cc (Symbol_table::resolve): Likewise.
3932 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3933 arrays.
3934 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3935
8b8dd8d5
ILT
39362011-12-16 Ian Lance Taylor <iant@google.com>
3937
3938 * output.h (Output_data_reloc_generic::add): Only call
3939 add_dynamic_reloc if this is a dynamic reloc section.
3940
d55525b9
L
39412011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3942
3943 PR gold/13505
3944 * target-reloc.h (apply_relocation): Replace <64, false> with
3945 <size, big_endian>.
3946
ff81c7c1
NC
39472011-11-25 Nick Clifton <nickc@redhat.com>
3948
3949 * po/it.po: New Italian translation.
3950
628f39be
SA
39512011-11-17 Sterling Augustine <saugustine@google.com>
3952
3953 * script.cc (script_include_directive): Implement.
3954 (read_script_file): New local variables name and search_path. Update
3955 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3956 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3957 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3958
98ef3ea4
SA
39592011-11-11 Sterling Augustine <saugustine@google.com>
3960
3961 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3962 (file_or_sections_cmd): Likewise.
3963
f4a8b6d7
DK
39642011-11-11 Doug Kwan <dougkwan@google.com>
3965
3966 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3967 if --just-symbols is given.
3968
29ab395d
DK
39692011-11-10 Doug Kwan <dougkwan@google.com>
3970
3971 PR gold/13362
3972 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3973 when processing data relocs.
3974 * reloc.h (Relocate_functions::rel_unaligned): New method.
3975 (Relocate_functions::pcrel_unaligned): Ditto.
3976 (Relocate_functions::rel32_unaligned): Ditto.
3977 (Relocate_functions::pcrel32_unaligned): Ditto.
3978
2c339f71
DK
39792011-11-09 Doug Kwan <dougkwan@google.com>
3980
3981 PR gold/13362
3982 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3983 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3984 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3985 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3986 (Relocate_functions::rel_unaligned): New.
3987 (Relocate_functions::rel32_unaligned): New.
3988 * target-reloc.h (relocate_for_relocatable): Add code to handle
3989 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3990 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3991 arm_unaligned_reloc_r): New targets.
3992 * testsuite/Makefile.in: Regenerate.
3993 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3994 linking.
3995
3f3cddf1
ILT
39962011-11-02 Ian Lance Taylor <iant@google.com>
3997
3998 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3999 NATIVE_LINKER.
4000 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4001 * options.cc (General_options::finalize): Use library search path
4002 from configure script if specified. If not native and no sysroot,
4003 only search TOOLLIBDIR.
4004 * options.h (Search_directory::Search_directory): Change name to
4005 const std::string&.
4006 (General_options::add_to_library_path_with_sysroot): Change arg to
4007 const std::string&.
4008 * configure, Makefile.in, config.in: Rebuild.
4009
a8e2273b
ILT
40102011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4011
4012 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4013 we are working around the ARM1176 Erratum.
4014 * options.h (General_options::fix_arm1176): Add option.
4015 * testsuite/Makefile.am: Add testcases, and keep current ones
4016 working.
4017 * testsuite/Makefile.in: Regenerate.
4018 * testsuite/arm_fix_1176.s: New file.
4019 * testsuite/arm_fix_1176.sh: Likewise.
4020
cd6eab1c
ILT
40212011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4022
4023 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4024 may_use_blx_.
4025 (Target_arm::may_use_blx): Remove method.
4026 (Target_arm::set_may_use_blx): Likewise.
4027 (Target_arm::may_use_v4t_interworking): New method.
4028 (Target_arm::may_use_v5t_interworking): Likewise.
4029 (Target_arm::may_use_blx_): Remove member variable.
4030 (Arm_relocate_functions::arm_branch_common): Check for v5T
4031 interworking.
4032 (Arm_relocate_functions::thumb_branch_common): Likewise.
4033 (Reloc_stub::stub_type_for_reloc): Likewise.
4034 (Target_arm::do_finalize_sections): Correct interworking checks.
4035 * testsuite/Makefile.am: Add new tests.
4036 * testsuite/Makefile.in: Regenerate.
4037 * testsuite/arm_farcall_arm_arm.s: New test.
4038 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4039 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4040 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4041 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4042 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4043 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4044 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4045
286adcf4
CC
40462011-10-31 Cary Coutant <ccoutant@google.com>
4047
4048 PR gold/13023
4049 * expression.cc (Expression::eval_with_dot): Add
4050 is_section_dot_assignment parameter.
4051 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4052 absolute and assigning to dot within a section.
4053 * script-sections.cc
4054 (Output_section_element_assignment::set_section_addresses): Pass
4055 dot_section to set_if_absolute.
4056 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4057 as is_section_dot_assignment flag to eval_with_dot.
4058 (Output_section_element_dot_assignment::set_section_addresses):
4059 Likewise.
4060 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4061 parameter. Also set value if relative to dot_section; set the
4062 symbol's output_section.
4063 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4064 parameter. Adjust all callers.
4065 (Expression::eval_maybe_dot): Likewise.
4066 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4067 Adjust all callers.
4068 * testsuite/script_test_2.t: Test assignment of an absolute value
4069 to dot within an output section element.
4070
9634ed06
CC
40712011-10-31 Cary Coutant <ccoutant@google.com>
4072
4073 * options.h (class General_options): Add --[no-]gnu-unique options.
4074 * symtab.cc (Symbol_table::sized_write_globals): Convert
4075 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4076
de4101c7
CC
40772011-10-31 Cary Coutant <ccoutant@google.com>
4078
4079 PR gold/13359
4080 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4081 unnecessary assertion.
4082 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4083
7257cc92
ST
40842011-10-31 Sriraman Tallam <tmsriram@google.com>
4085
4086 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4087 gc_mark_symbol.
4088 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4089 gc_mark_symbol.
4090 Change to just keep the section associated with symbol.
4091 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4092 they are externally visible and --export-dynamic is turned on.
4093 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4094
bfc34b3f
ILT
40952011-10-19 Ian Lance Taylor <iant@google.com>
4096
4097 PR gold/13163
4098 * script-sections.cc
4099 (Output_section_element_dot_assignment::needs_output_section): New
4100 function.
4101
ea0d8c47
ILT
41022011-10-19 Ian Lance Taylor <iant@google.com>
4103
4104 PR gold/13204
4105 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4106 --section-start option was seen.
4107 * options.h (General_options::any_section_start): New function.
4108
abd242a9
DM
41092011-10-18 David S. Miller <davem@davemloft.net>
4110
4111 PR binutils/13301
4112 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4113 member to track relocation locations that have moved during TLS
4114 reloc optimizations.
4115 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4116 (Target_sparc::Relocate::relocate): Adjust view down by 4
4117 bytes if it matches reloc_adjust_addr_.
4118 (Target_sparc::Relocate::relocate_tls): Always move the
4119 __tls_get_addr call delay slot instruction forward 4 bytes when
4120 performing relaxation.
4121
bab9090f
CC
41222011-10-18 Cary Coutant <ccoutant@google.com>
4123
4124 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4125 (Output_file::map_no_anonymous): Check for non-zero
4126 return code from posix_fallocate.
4127
f7c5b166
CC
41282011-10-17 Cary Coutant <ccoutant@google.com>
4129
4130 PR gold/13245
4131 * plugin.cc (is_visible_from_outside): Check for symbols
4132 referenced from dynamic objects.
4133 * resolve.cc (Symbol_table::resolve): Don't count references
4134 from dynamic objects as references from real ELF files.
4135 * testsuite/plugin_test_2.sh: Adjust expected result.
4136
b490c0bb
CC
41372011-10-17 Cary Coutant <ccoutant@google.com>
4138
4139 * gold.cc: Include timer.h.
4140 (queue_middle_tasks): Stamp time.
4141 (queue_final_tasks): Likewise.
4142 * main.cc (main): Store timer in parameters. Print timers
4143 for each pass.
4144 * parameters.cc (Parameters::Parameters): Initialize timer_.
4145 (Parameters::set_timer): New function.
4146 (set_parameters_timer): New function.
4147 * parameters.h (Parameters::set_timer): New function.
4148 (Parameters::timer): New function.
4149 (Parameters::timer_): New data member.
4150 (set_parameters_timer): New function.
4151 * timer.cc (Timer::stamp): New function.
4152 (Timer::get_pass_time): New function.
4153 * timer.h (Timer::stamp): New function.
4154 (Timer::get_pass_time): New function.
4155 (Timer::pass_times_): New data member.
4156
f475cf7b
CC
41572011-10-17 Cary Coutant <ccoutant@google.com>
4158
4159 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4160 task for members of lib groups.
4161
cdd7e244
CC
41622011-10-17 Cary Coutant <ccoutant@google.com>
4163
4164 PR gold/13288
4f95c8b4 4165 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4166 (File_read::make_view): Move bounds check (replace with assert)...
4167 (File_read::find_or_make_view): ... to here.
4168
dfb45471
CC
41692011-10-12 Cary Coutant <ccoutant@google.com>
4170
4f95c8b4 4171 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4172 ::read returns less than requested size.
4173
53bbcc1b
CC
41742011-10-10 Cary Coutant <ccoutant@google.com>
4175
4f95c8b4 4176 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4177 Initialize defined_count_.
4178 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4179 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4180 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4181 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4182 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4183 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4184 member.
4185 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4186 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4187 Return zeroes instead of internal error.
4188
397b129b
CC
41892011-10-10 Cary Coutant <ccoutant@google.com>
4190
4191 PR gold/13249
4f95c8b4 4192 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4193 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4194 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4195 (Output_reloc::type_): Adjust size of bit field.
4196 (Output_reloc::use_plt_offset_): New bit field.
4197 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4198 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4199 flag. Adjust all callers.
4f95c8b4 4200 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4201 creating RELATIVE relocations.
4202
d5698657
NC
42032011-10-10 Nick Clifton <nickc@redhat.com>
4204
4205 * po/es.po: Updated Spanish translation.
4206 * po/fi.po: Updated Finnish translation.
4207
6a59a5c2
DN
42082011-10-03 Diego Novillo <dnovillo@google.com>
4209
4210 * options.cc (parse_uint): Fix dereference of RETVAL.
4211
f0558624
ST
42122011-09-29 Sriraman Tallam <tmsriram@google.com>
4213
4214 * layout.h (section_order_map_): New member.
4215 (get_section_order_map): New member function.
4216 * output.cc (Output_section::add_input_section): Check for patterns
4217 only when --section-ordering-file is specified.
4218 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4219 output_sections have been formed.
4220 * layout.cc (Layout_Layout): Initialize section_order_map_.
4221 * plugin.cc (update_section_order): Store order in order_map. Do not
4222 update the order.
4223 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4224 * testsuite/Makefile.in: Regenerate.
4225 * testsuite/plugin_section_order.c: New file.
4226 * testsuite/plugin_final_layout.cc: New file.
4227 * testsuite/plugin_final_layout.sh: New file.
4228
a7dac153
CC
42292011-09-29 Cary Coutant <ccoutant@google.com>
4230
4f95c8b4 4231 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4232 Check for NULL.
4f95c8b4 4233 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4234 symbols during incremental update.
4235 (Symbol_table::add_from_dynobj): Likewise.
4236
eebd87a5
ILT
42372011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4238 Ian Lance Taylor <iant@google.com>
4239
4240 * symtab.cc (Symbol_table::define_special_symbol): Always
4241 canonicalize version string.
4242
403a3331
CC
42432011-09-26 Cary Coutant <ccoutant@google.com>
4244
4f95c8b4
CC
4245 * gold.cc (queue_initial_tasks): Move option checks ...
4246 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4247 some options; make others fatal.
4248
235061c2
CC
42492011-09-26 Cary Coutant <ccoutant@google.com>
4250
4251 gcc PR lto/47247
4252 * plugin.cc (get_symbols_v2): New function.
4253 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4254 (is_referenced_from_outside): New function.
4255 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4256 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4257 (get_symbols): Pass version parameter.
4258 (get_symbols_v2): New function.
4259 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4260 parameter.
4261 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4262 (onload): Add LDPT_GET_SYMBOLS_V2.
4263 (all_symbols_read_hook): Use get_symbols_v2; check for
4264 LDPR_PREVAILING_DEF_IRONLY_EXP.
4265 * testsuite/plugin_test_3.sh: Update expected results.
4266
dc87f620
ILT
42672011-09-23 Simon Baldwin <simonb@google.com>
4268
4269 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4270 configuration options.
4271 * configure: Regenerate.
4272 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4273 * Makefile.in: Regenerate.
4274 * testsuite/Makefile.in: Regenerate.
4275
a8279f82
ST
42762011-09-19 Sriraman Tallam <tmsriram@google.com>
4277
4278 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4279
0c9350c8
CC
42802011-09-19 Cary Coutant <ccoutant@google.com>
4281
4282 * incremental.cc (can_incremental_update): Fix typo in comment.
4283 * incremental.h (can_incremental_update): Likewise.
4284
aa06ae28
CC
42852011-09-18 Cary Coutant <ccoutant@google.com>
4286
4287 * incremental.cc (can_incremental_update): New function.
4288 * incremental.h (can_incremental_update): New function.
4289 * layout.cc (Layout::init_fixed_output_section): Call it.
4290 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4291 * object.cc (Sized_relobj_file::do_layout): Call
4292 can_incremental_update.
4293
ebb300b2
CC
42942011-09-13 Cary Coutant <ccoutant@google.com>
4295
4296 * configure.ac: Check for glibc support for gnu_indirect_function
4297 support with static linking, setting automake conditional
4298 IFUNC_STATIC.
4299 * Makefile.in: Regenerate.
4300 * configure: Regenerate.
4301
4302 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4303 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4304 for IFUNC_STATIC.
4305 * testsuite/Makefile.in: Regenerate.
4306
1206d0d5
CC
43072011-09-13 Cary Coutant <ccoutant@google.com>
4308
4309 * incremental.cc (Sized_relobj_incr::do_layout): Call
4310 report_comdat_group for kept comdat sections.
4311 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4312 * testsuite/Makefile.in: Regenerate.
4313 * testsuite/incr_comdat_test_1.cc: New source file.
4314 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4315 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4316 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4317
40b29874
ILT
43182011-09-13 Ian Lance Taylor <iant@google.com>
4319
4320 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4321 variable external_symbols_offset.
4322
1b045aac
ILT
43232011-09-12 Ian Lance Taylor <iant@google.com>
4324
4325 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4326 triggered if object has no symbols.
4327
24c6c55a
DM
43282011-09-09 David S. Miller <davem@davemloft.net>
4329
4330 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4331 (Output_fill_debug_line::do_write): Likewise.
4332
66570254
CC
43332011-08-29 Cary Coutant <ccoutant@google.com>
4334
4335 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4336 casts to match formatting specs.
4337 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4338
8ea8cd50
CC
43392011-08-26 Cary Coutant <ccoutant@google.com>
4340
4341 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4342 remaining hole size when allocating.
4343 (Layout::make_output_section): Set fill methods for debug sections.
4344 * layout.h (Free_list::Free_list_node): Move from private to
4345 public.
4346 (Free_list::set_min_hole_size): New function.
4347 (Free_list::begin, Free_list::end): New functions.
4348 (Free_list::min_hole_): New data member.
4349 * output.cc: Include dwarf.h.
4350 (Output_fill_debug_info::do_minimum_hole_size): New function.
4351 (Output_fill_debug_info::do_write): New function.
4352 (Output_fill_debug_line::do_minimum_hole_size): New function.
4353 (Output_fill_debug_line::do_write): New function.
4354 (Output_section::Output_section): Initialize new data member.
4355 (Output_section::set_final_data_size): Ensure patch space is larger
4356 than minimum hole size.
4357 (Output_section::do_write): Fill holes in debug sections.
4358 * output.h (Output_fill): New class.
4359 (Output_fill_debug_info): New class.
4360 (Output_fill_debug_line): New class.
4361 (Output_section::set_free_space_fill): New function.
4362 (Output_section::free_space_fill_): New data member.
4363 * testsuite/Makefile.am (incremental_test_3): Add
4364 --incremental-patch option.
4365 (incremental_test_4): Likewise.
4366 (incremental_test_5): Likewise.
4367 (incremental_test_6): Likewise.
4368 (incremental_copy_test): Likewise.
4369 (incremental_common_test_1): Likewise.
4370 * testsuite/Makefile.in: Regenerate.
4371
7cf80422
NC
43722011-08-26 Nick Clifton <nickc@redhat.com>
4373
4374 * po/es.po: Updated Spanish translation.
4375
c3f7b0e5
CC
43762011-08-01 Cary Coutant <ccoutant@google.com>
4377
4378 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4379 * gold/testsuite/Makefile.in: Regenerate.
4380 * gold/testsuite/justsyms_exec.c: New source file.
4381 * gold/testsuite/justsyms_lib.c: New source file.
4382
9590bf25
CC
43832011-08-01 Cary Coutant <ccoutant@google.com>
4384
4385 * layout.cc (Layout::set_segment_offsets): Don't realign text
4386 segment if -Ttext was specified.
4387 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4388 file type.
4389 * object.h (Sized_relobj_file::e_type): New function.
4390 (Sized_relobj_file::e_type_): New data member.
4391 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4392 base address for ET_EXEC files.
4393 * target.cc (Target::do_make_elf_object_implementation): Allow
4394 ET_EXEC files with --just-symbols option.
4395
dcd8d12e
CC
43962011-07-28 Cary Coutant <ccoutant@google.com>
4397
4398 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4399 Add thread_number parameter.
4400 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4401 * workqueue-threads.cc
4402 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4403 current thread if its thread number is greater than desired thread
4404 count.
4405 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4406 Add thread_number parameter.
4407 (Workqueue::should_cancel_thread): Likewise.
4408 (Workqueue::find_runnable_or_wait): Pass thread_number to
4409 should_cancel_thread.
4410 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4411 parameter.
4412
804eb480
ST
44132011-07-22 Sriraman Tallam <tmsriram@google.com>
4414
4415 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4416 only after checking if it cannot be forced local.
4417 * symtab.h (is_externally_visible): Check if the symbol is not forced
4418 local.
4419
f1ddb600
ILT
44202011-07-15 Ian Lance Taylor <iant@google.com>
4421
4422 * options.h (class General_options): Add --print-output-format.
4423 Move -EL next to -EB, for better --help output.
4424 * target-select.cc: Include <cstdio>, "options.h", and
4425 "parameters.h".
4426 (Target_selector::do_target_bfd_name): New function.
4427 (print_output_format): New function.
4428 * target-select.h (class Target_selector): Update declarations.
4429 (Target_selector::target_bfd_name): New function.
4430 (print_output_format): Declare.
4431 * main.cc: Include "target-select.h".
4432 (main): Handle --print-output-format.
4433 * gold.cc: Include "target-select.h".
4434 (queue_initial_tasks): Handle --print-output-format when there are
4435 no input files.
4436 * parameters.cc (parameters_force_valid_target): Give a better
4437 error message if -EB/-EL does not match target.
4438 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4439 function.
4440
7d172687
ILT
44412011-07-15 Ian Lance Taylor <iant@google.com>
4442
4443 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4444 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4445 (Output_data_plt_i386::do_write): Write address of .dynamic
4446 section to first entry in .got.plt section.
4447 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4448 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4449 Initialize layout_.
4450 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4451 section to first entry in .got.plt section.
4452 * layout.h (Layout::dynamic_section): New function.
4453
e9552f7e
ST
44542011-07-13 Sriraman Tallam <tmsriram@google.com>
4455
4456 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4457 to claim_file call.
4458 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4459 input_section_position_, and input_section_glob_.
4460 (read_layout_from_file): Call function section_ordering_specified.
4461 * layout.h (is_section_ordering_specified): New function.
4462 (section_ordering_specified): New function.
4463 (section_ordering_specified_): New boolean member.
4464 * main.cc(main): Call load_plugins after layout object is defined.
4465 * output.cc (Output_section::add_input_section): Use
4466 function section_ordering_specified to check if section ordering is
4467 needed.
4468 * output.cc (Output_section::add_relaxed_input_section): Use
4469 function section_ordering_specified to check if section ordering is
4470 needed.
4471 (Output_section::update_section_layout): New function.
4472 (Output_section::sort_attached_input_sections): Check if input section
4473 must be reordered.
4474 * output.h (Output_section::update_section_layout): New function.
4475 * plugin.cc (get_section_count): New function.
4476 (get_section_type): New function.
4477 (get_section_name): New function.
4478 (get_section_contents): New function.
4479 (update_section_order): New function.
58797674 4480 (allow_section_ordering): New function.
e9552f7e
ST
4481 (Plugin::load): Add the new interfaces to the transfer vector.
4482 (Plugin_manager::load_plugins): New parameter.
4483 (Plugin_manager::all_symbols_read): New parameter.
4484 (Plugin_manager::claim_file): New parameter. Save the elf object for
4485 unclaimed objects.
4486 (Plugin_manager::get_elf_object): New function.
4487 (Plugin_manager::get_view): Change to directly use the bool to check
4488 if get_view is called from claim_file_hook.
4489 * plugin.h (input_objects): New function
4490 (Plugin__manager::load_plugins): New parameter.
4491 (Plugin_manager::claim_file): New parameter.
4492 (Plugin_manager::get_elf_object): New function.
4493 (Plugin_manager::in_claim_file_handler): New function.
4494 (Plugin_manager::in_claim_file_handler_): New member.
4495 (layout): New function.
4496 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4497 handler with an extra parameter. Make the elf object before calling
4498 claim_file handler.
4499 * testsuite/plugin_test.c (get_section_count): New function pointer.
4500 (get_section_type): New function pointer.
4501 (get_section_name): New function pointer.
4502 (get_section_contents): New function pointer.
4503 (update_section_order): New function pointer.
4504 (allow_section_ordering): New function pointer.
4505 (onload): Check if the new interfaces exist.
4506
9446efde
ILT
45072011-07-13 Ian Lance Taylor <iant@google.com>
4508
4509 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4510 relro section.
4511 * x86_64.cc (Target_x86_64::got_section): Likewise.
4512 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4513 (relro_now_test_SOURCES): New variable.
4514 (relro_now_test_DEPENDENCIES): New variable.
4515 (relro_now_test_LDFLAGS): New variable.
4516 (relro_now_test_LDADD): New variable.
4517 (relro_now_test.so): New target.
4518 * testsuite/Makefile.in: Rebuild.
4519
07aa62f2
ILT
45202011-07-12 Ian Lance Taylor <iant@google.com>
4521
4522 PR gold/12980
4523 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4524 GLOB_DAT relocation rather than a RELATIVE relocation for a
4525 protected symbol when creating a shared library.
4526 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4527 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4528 * testsuite/protected_main_1.cc (main): Test that protected
4529 function has same address.
4530
e2153196
ILT
45312011-07-11 Ian Lance Taylor <iant@google.com>
4532
4533 PR gold/12979
4534 * options.h (class General_options): Add -Bgroup.
4535 * options.cc (General_options::finalize): If -Bgroup is set,
4536 default to --unresolved-symbols=report-all.
4537 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4538 * target-reloc.h (issue_undefined_symbol_error): Handle
4539 --unresolved-symbols=report-all.
4540
6daf5215
ILT
45412011-07-08 Ian Lance Taylor <iant@google.com>
4542
4543 PR gold/11985
4544 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4545 if linker script discards key sections.
4546 (Layout::create_dynamic_symtab): Likewise.
4547 (Layout::assign_local_dynsym_offsets): Likewise.
4548 (Layout::sized_create_version_sections): Likewise.
4549 (Layout::create_interp): Likewise.
4550 (Layout::finish_dynamic_section): Likewise.
4551 (Layout::set_dynamic_symbol_size): Likewise.
4552
beabb2c6
ILT
45532011-07-08 Ian Lance Taylor <iant@google.com>
4554
4555 PR gold/12386
4556 * options.h (class General_options): Add --unresolved-symbols.
4557 * target-reloc.h (issue_undefined_symbol_error): Check
4558 --unresolved-symbols. Add comments.
4559
9c16daf1
ILT
45602011-07-08 Ian Lance Taylor <iant@google.com>
4561
4562 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4563 expression more complex.
4564
191f1a2d
ILT
45652011-07-08 Ian Lance Taylor <iant@google.com>
4566
4567 PR gold/11317
4568 * target-reloc.h (issue_undefined_symbol_error): New inline
4569 function, broken out of relocate_section.
4570 (relocate_section): Call issue_undefined_symbol_error.
4571 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4572 there is no TLS segment if we are about to issue an undefined
4573 symbol error.
4574 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4575
62855347
ILT
45762011-07-08 Ian Lance Taylor <iant@google.com>
4577
4578 PR gold/12279
4579 * resolve.cc (Symbol_table::should_override): Add fromtype
4580 parameter. Change all callers. Give error when linking together
4581 TLS and non-TLS symbol.
4582 (Symbol_table::should_override_with_special): Add fromtype
4583 parameter. Change all callers.
4584 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4585 there is no TLS segment if we have reported some errors.
4586 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4587
67181c72
ILT
45882011-07-08 Ian Lance Taylor <iant@google.com>
4589
4590 PR gold/12372
4591 * target.h (Target::plt_address_for_global): New function.
4592 (Target::plt_address_for_local): New function.
4593 (Target::plt_section_for_global): Remove.
4594 (Target::plt_section_for_local): Remove.
4595 (Target::do_plt_address_for_global): New virtual function.
4596 (Target::do_plt_address_for_local): New virtual function.
4597 (Target::do_plt_section_for_global): Remove.
4598 (Target::do_plt_section_for_local): Remove.
4599 (Target::register_global_plt_entry): Add Symbol_table and Layout
4600 parameters.
4601 * output.cc (Output_data_got::Got_entry::write): Use
4602 plt_address_for_global and plt_address_for_local.
4603 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4604 address of output section.
4605 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4606 got_irelative_, and irelative_count_ fields. Update
4607 declarations.
4608 (Output_data_plt_i386::has_irelative_section): New function.
4609 (Output_data_plt_i386::entry_count): Add irelative_count_.
4610 (Output_data_plt_i386::set_final_data_size): Likewise.
4611 (class Target_i386): Add got_irelative_ and rel_irelative_
4612 fields. Update declarations.
4613 (Target_i386::Target_i386): Initialize new fields.
4614 (Target_i386::do_plt_address_for_global): New function replacing
4615 do_plt_section_for_global.
4616 (Target_i386::do_plt_address_for_local): New function replacing
4617 do_plt_section_for_local.
4618 (Target_i386::got_section): Create got_irelative_.
4619 (Target_i386::rel_irelative_section): New function.
4620 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4621 fields. Don't define __rel_iplt_{start,end}.
4622 (Output_data_plt_i386::add_entry): Add symtab and layout
4623 parameters. Change all callers. Use different PLT and GOT for
4624 IFUNC symbols.
4625 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4626 layout parameters. Change all callers. Use different PLT and
4627 GOT.
4628 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4629 (Output_data_plt_i386::rel_irelative): New function.
4630 (Output_data_plt_i386::address_for_global): New function.
4631 (Output_data_plt_i386::address_for_local): New function.
4632 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4633 IRELATIVE GOT when changing IFUNC GOT entries.
4634 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4635 reloc.
4636 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4637 if we didn't create an IRELATIVE GOT.
4638 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4639 plt_address_for_local.
4640 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4641 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4642 got_irelative_, and irelative_count_ fields. Update
4643 declarations.
4644 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4645 Initialize new fields. Remove symtab parameter. Change all
4646 callers.
4647 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4648 irelative_count_.
4649 (Output_data_plt_x86_64::has_irelative_section): New function.
4650 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4651 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4652 fields. Update declarations.
4653 (Target_x86_64::Target_x86_64): Initialize new fields.
4654 (Target_x86_64::do_plt_address_for_global): New function replacing
4655 do_plt_section_for_global.
4656 (Target_x86_64::do_plt_address_for_local): New function replacing
4657 do_plt_section_for_local.
4658 (Target_x86_64::got_section): Create got_irelative_.
4659 (Target_x86_64::rela_irelative_section): New function.
4660 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4661 all callers. Don't create __rel_iplt_{start,end}.
4662 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4663 parameters. Change all callers. Use different PLT and GOT for
4664 IFUNC symbols.
4665 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4666 layout parameters. Change all callers. Use different PLT and
4667 GOT.
4668 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4669 parameters. Change all callers. Use different PLT and GOT for
4670 IFUNC symbols.
4671 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4672 (Output_data_plt_x86_64::rela_irelative): New function.
4673 (Output_data_plt_x86_64::address_for_global): New function.
4674 (Output_data_plt_x86_64::address_for_local): New function.
4675 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4676 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4677 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4678 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4679 parameters.
4680 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4681 reloc.
4682 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4683 symbols if we didn't create an IRELATIVE GOT.
4684 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4685 plt_address_for_local.
4686 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4687 * testsuite/ifuncvar1.c: New test file.
4688 * testsuite/ifuncvar2.c: New test file.
4689 * testsuite/ifuncvar3.c: New test file.
4690 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4691 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4692 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4693 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4694 * testsuite/Makefile.in: Rebuild.
4695
33c15b45
CC
46962011-07-07 Cary Coutant <ccoutant@google.com>
4697
4698 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4699 (two_file_test_1_ndebug.o): Likewise.
4700 (two_file_test_1b_ndebug.o): Likewise.
4701 (two_file_test_2_ndebug.o): Likewise.
4702 (two_file_test_main_ndebug.o): Likewise.
4703 (incremental_test_2): Link with no-debug versions.
4704
f48b5fb7
CC
47052011-07-06 Cary Coutant <ccoutant@google.com>
4706
4707 * gold/incremental.cc
4708 (Output_section_incremental_inputs::write_info_blocks): Check for
4709 hidden and internal symbols.
4710
221597a5
CC
47112011-07-06 Cary Coutant <ccoutant@google.com>
4712
4713 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4714 Check disposition for startup file.
4715 (Incremental_inputs::report_command_line): Ignore
4716 --incremental-startup-unchanged option.
4717 * options.cc (General_options::parse_incremental_startup_unchanged):
4718 New function.
4719 (General_options::General_options): Initialize new data member.
4720 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4721 (General_options): Add --incremental-startup-unchanged option.
4722 (General_options::incremental_startup_disposition): New function.
4723 (General_options::incremental_startup_disposition_): New data member.
4724
e24719f6
CC
47252011-07-06 Cary Coutant <ccoutant@google.com>
4726
4727 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4728 input file index to Script_info ctor.
4729 (Sized_incremental_binary::do_file_has_changed): Find the
4730 command-line argument for files named in scripts.
4731 * incremental.h (Script_info::Script_info): New ctor
4732 with input file index.
4733 (Script_info::input_file_index): New function.
4734 (Script_info::input_file_index_): New data member.
4735 (Incremental_binary::get_library): Add const.
4736 (Incremental_binary::get_script_info): Add const.
4737 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4738 * testsuite/Makefile.am (incremental_test_5): New test case.
4739 (incremental_test_6): New test case.
4740 * testsuite/Makefile.in: Regenerate.
4741
8f7c81e8
CC
47422011-07-06 Cary Coutant <ccoutant@google.com>
4743
4744 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4745 debug output when command lines differ.
4746
9fbd3822
CC
47472011-07-06 Cary Coutant <ccoutant@google.com>
4748
4749 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4750 --incremental-patch option.
4751 * layout.cc (Free_list::allocate): Extend allocation beyond original
4752 end if enabled.
4753 (Layout::make_output_section): Mark sections that should get
4754 patch space.
4755 * options.cc (parse_percent): New function.
4756 * options.h (parse_percent): New function.
4757 (DEFINE_percent): New macro.
4758 (General_options): Add --incremental-patch option.
4759 * output.cc (Output_section::Output_section): Initialize new data
4760 members.
4761 (Output_section::add_input_section): Print section name when out
4762 of patch space.
4763 (Output_section::add_output_section_data): Likewise.
4764 (Output_section::set_final_data_size): Add patch space when
4765 doing --incremental-full.
4766 (Output_section::do_reset_address_and_file_offset): Remove patch
4767 space.
4768 (Output_segment::set_section_list_addresses): Print debug output
4769 only if --incremental-update.
4770 * output.h (Output_section::set_is_patch_space_allowed): New function.
4771 (Output_section::is_patch_space_allowed_): New data member.
4772 (Output_section::patch_space_): New data member.
4773 * parameters.cc (Parameters::incremental_full): New function.
4774 * parameters.h (Parameters::incremental_full): New function
4775 * testsuite/Makefile.am (incremental_test_2): Add test for
4776 --incremental-patch option.
4777 * testsuite/Makefile.in: Regenerate.
4778 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4779 (t18): Remove function body.
4780
f6cccc2c
DK
47812011-07-05 Doug Kwan <dougkwan@google.com>
4782
4783 PR gold/12771
4784 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4785 Arm_Address type for relocation result.
4786 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4787 overflow check.
4788 (Arm_relocate_functions::abs32): Use unaligned access.
4789 (Arm_relocate_functions::rel32): Ditto.
4790 (Arm_relocate_functions::prel31): Ditto.
4791 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4792 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4793 static data relocations.
4794 * testsuite/Makefile.in: Regnerate.
4795 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4796
28a13fec
ILT
47972011-07-05 Ian Lance Taylor <iant@google.com>
4798
4799 PR gold/12392
4800 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4801 symbols if necessary.
4802 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4803
24d47b34
ILT
48042011-07-05 Ian Lance Taylor <iant@google.com>
4805
4806 PR gold/12952
4807 * resolve.cc (Symbol::override_base_with_special): Simply override
4808 version with special symbol version, ignoring previous version.
4809
41f9cbbe
ILT
48102011-07-05 Ian Lance Taylor <iant@google.com>
4811
4812 * object.cc (Sized_relobj_file::include_section_group): Add
4813 information to comment about signature location.
4814
886288f1
ILT
48152011-07-02 Ian Lance Taylor <iant@google.com>
4816
4817 PR gold/12957
4818 * options.h (class General_options): Add -f and -F.
4819 * options.cc (General_options::finalize): Fatal error if -f/-F
4820 are used without -shared.
4821 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4822
ae3a6d4f
ILT
48232011-07-02 Ian Lance Taylor <iant@google.com>
4824
4825 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4826
21131061
ILT
48272011-07-01 Ian Lance Taylor <iant@google.com>
4828
4829 PR gold/12525
4830 PR gold/12952
4831 * resolve.cc (Symbol::override_base_with_special): Don't override
4832 the version if the overriding symbol has a different name.
4833 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4834 all callers. If we give an error about an undefined version,
4835 define the base version if necessary.
4836 * dynobj.h (class Versions): Update declaration.
4837 * testsuite/weak_alias_test_5.cc: New file.
4838 * testsuite/weak_alias_test.script: New file.
4839 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4840 and versioned_alias have the right value, and call t2.
4841 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4842 weak_alias_test_5.so.
4843 (weak_alias_test_LDADD): Likewise.
4844 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4845 * testsuite/Makefile.in: Rebuild.
4846
611062c0
ILT
48472011-07-01 Ian Lance Taylor <iant@google.com>
4848
4849 PR gold/12525
4850 * options.h (class General_options): Support -z notext.
4851 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4852 -Wl,-z,notext.
4853 (two_file_shared_nonpic.so): Likewise.
4854 (two_file_shared_mixed.so): Likewise.
4855 (two_file_shared_mixed_1.so): Likewise.
4856 (weak_undef_lib_nonpic.so): Likewise.
4857 (alt/weak_undef_lib_nonpic.so): Likewise.
4858 (tls_test_shared_nonpic.so): Likewise.
4859 * testsuite/Makefile.in: Rebuild.
4860
328c7c2f
ILT
48612011-07-01 Ian Lance Taylor <iant@google.com>
4862
4863 PR gold/12525
4864 * configure.ac: Test whether static linking works, setting
4865 the automake conditional HAVE_STATIC.
4866 * testsuite/Makefile.am: Disable tests using -static if
4867 HAVE_STATIC is not true.
4868 * configure, testsuite/Makefile.in: Rebuild.
4869
02d7cd44
ILT
48702011-07-01 Ian Lance Taylor <iant@google.com>
4871
4872 PR gold/12525
4873 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4874 Assert if we see DW_EH_PE_indirect.
4875 * target.h (Target::ehframe_datarel_base): New function.
4876 (Target::do_ehframe_datarel_base): New target function.
4877 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4878 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4879 function.
4880
07a60597
ILT
48812011-07-01 Ian Lance Taylor <iant@google.com>
4882
4883 PR gold/12571
4884 * options.h (class General_options): Add
4885 --ld-generated-unwind-info.
4886 * ehframe.cc (Fde::write): Add address parameter. Change all
4887 callers. If associated with PLT, fill in address and size.
4888 (Cie::set_output_offset): Only add merge mapping if there is an
4889 object.
4890 (Cie::write): Add address parameter. Change all callers.
4891 (Eh_frame::add_ehframe_for_plt): New function.
4892 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4893 input_offset_ fields into union u_, with new plt field.
4894 (Fde::Fde): Adjust for new union field.
4895 (Fde::Fde) [Output_data version]: New constructor.
4896 (Fde::add_mapping): Only add merge mapping if there is an object.
4897 (class Cie): Update declarations.
4898 (class Eh_frame): Declare add_ehframe_for_plt.
4899 * layout.cc (Layout::layout_eh_frame): Break out code into
4900 make_eh_frame_section, and call it.
4901 (Layout::make_eh_frame_section): New function.
4902 (Layout::add_eh_frame_for_plt): New function.
4903 * layout.h (class Layout): Update declarations.
4904 * merge.cc (Merge_map::add_mapping): Add assertion.
4905 * i386.cc: Include "dwarf.h".
4906 (class Output_data_plt_i386): Make first_plt_entry,
4907 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4908 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4909 and plt_eh_frame_fde.
4910 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4911 boundary. Call add_eh_frame_for_plt if appropriate.
4912 * x86_64.cc: Include "dwarf.h".
4913 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4914 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4915 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4916 and plt_eh_frame_fde.
4917 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4918 appropriate.
4919
14788a3f
ILT
49202011-06-29 Ian Lance Taylor <iant@google.com>
4921
4922 PR gold/12629
4923 * object.cc (Sized_relobj_file::layout_section): Change shdr
4924 parameter to be const.
4925 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4926 out of do_layout.
4927 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4928 appropriate. Call layout_eh_frame_section.
4929 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4930 sections.
4931 * object.h (class Sized_relobj_file): Update declarations.
4932
6c21fce1
ILT
49332011-06-29 Ian Lance Taylor <iant@google.com>
4934
37e41b03 4935 PR gold/12652
6c21fce1
ILT
4936 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4937 modifier.
4938 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4939
4d5e4e62
ILT
49402011-06-29 Ian Lance Taylor <iant@google.com>
4941
4942 PR gold/12675
4943 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4944 SHT_X86_64_UNWIND.
4945 * layout.cc (Layout::layout_eh_frame): Likewise.
4946
886f533a
ILT
49472011-06-29 Ian Lance Taylor <iant@google.com>
4948
4949 PR gold/12695
4950 * layout.cc (Layout::symtab_section_shndx): New function.
4951 * layout.h (class Layout): Declare symtab_section_shndx.
4952 * output.cc (Output_section::write_header): Call it.
4953
f3ae1b28
ILT
49542011-06-29 Ian Lance Taylor <iant@google.com>
4955
4956 PR gold/12818
4957 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4958 symbols which are not used in a relocation.
4959
aecf301f
ILT
49602011-06-28 Ian Lance Taylor <iant@google.com>
4961
4962 PR gold/12898
4963 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4964 script create indistinguishable segments.
4965 (Layout::set_segment_offsets): Use stable_sort when sorting
4966 segments. Pass this to Compare_segments constructor.
4967 * layout.h (class Layout): Make segment_precedes non-static.
4968 (class Compare_segments): Change from struct to class. Add
4969 layout_ field. Add constructor.
4970 * script-sections.cc
4971 (Script_sections::attach_sections_using_phdrs_clause): Rename
4972 local orphan to is_orphan. Don't report failure to put empty
4973 section in segment. On attachment failure, report name of
4974 section, and attach to first PT_LOAD segment.
4975
03ef7571
ILT
49762011-06-28 Ian Lance Taylor <iant@google.com>
4977
4978 PR gold/12934
4979 * target-select.cc (Target_selector::Target_selector): Add
4980 emulation parameter. Change all callers.
4981 (select_target_by_bfd_name): Rename from select_target_by_name.
4982 Change all callers.
4983 (select_target_by_emulation): New function.
4984 (supported_emulation_names): New function.
4985 * target-select.h (class Target_selector): Add emulation_ field.
4986 Update declarations.
4987 (Target_selector::recognize_by_bfd_name): Rename from
4988 recognize_by_name. Change all callers.
4989 (Target_selector::supported_bfd_names): Rename from
4990 supported_names. Change all callers.
4991 (Target_selector::recognize_by_emulation): New function.
4992 (Target_selector::supported_emulations): New function.
4993 (Target_selector::emulation): New function.
4994 (Target_selector::do_recognize_by_bfd_name): Rename from
4995 do_recognize_by_name. Change all callers.
4996 (Target_selector::do_supported_bfd_names): Rename from
4997 do_supported_names. Change all callers.
4998 (Target_selector::do_recognize_by_emulation): New function.
4999 (Target_selector::do_supported_emulations): New function.
5000 (select_target_by_bfd_name): Change name in declaration.
5001 (select_target_by_emulation): Declare.
5002 (supported_emulation_names): Declare.
5003 * parameters.cc (parameters_force_valid_target): Try to find
5004 target based on emulation from -m option.
5005 * options.h (class General_options): Change doc string for -m.
5006 * options.cc (help): Print emulations.
5007 (General_options::parse_V): Likewise.
5008 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5009 Add emulation parameter. Change all callers.
5010
200b2bb9
ILT
50112011-06-28 Ian Lance Taylor <iant@google.com>
5012
5013 * target.h (class Target): Add osabi_ field.
5014 (Target::osabi): New function.
5015 (Target::set_osabi): New function.
5016 (Target::Target): Initialize osabi_.
5017 (Target::do_adjust_elf_header): Make pure virtual.
5018 (Sized_target::do_adjust_elf_header): Declare.
5019 * target.cc (Sized_target::do_adjust_elf_header): New function.
5020 (class Sized_target): Instantiate all versions.
5021 * freebsd.h (class Target_freebsd): Remove.
5022 (Target_selector_freebsd::do_recognize): Call set_osabi on
5023 Target.
5024 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5025 (Target_selector_freebsd::set_osabi): Remove.
5026 * i386.cc (class Target_i386): Inherit from Sized_target rather
5027 than Target_freebsd.
5028 * x86_64.cc (class Target_x86_64): Likewise.
5029
b3ce541e
ILT
50302011-06-28 Ian Lance Taylor <iant@google.com>
5031
5032 * target.h (Target::can_check_for_function_pointers): Rewrite.
5033 Make non-virtual.
5034 (Target::can_icf_inline_merge_sections): Likewise.
5035 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5036 (Target::Target_info): Add can_icf_inline_merge_sections field.
5037 (Target::do_can_check_for_function_pointers): New virtual
5038 function.
5039 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5040 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5041 from can_check_for_function_pointers, move in file.
5042 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5043 section_may_have_icf_unsafe_poineters, move in file.
5044 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5045 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5046 Rename from can_check_for_function_pointers, move in file.
5047 (Target_i386::can_icf_inline_merge_sections): Remove.
5048 (Target_i386::i386_info): Initialize
5049 can_icf_inline_merge_sections.
5050 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5051 Initialize can_icf_inline_merge_sections.
5052 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5053 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5054 Rename from can_check_for_function_pointers, move in file.
5055 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5056 (Target_x86_64::x86_64_info): Initialize
5057 can_icf_inline_merge_sections.
5058 * testsuite/testfile.cc (Target_test::test_target_info):
5059 Likewise.
5060 * icf.cc (get_section_contents): Correct formatting.
5061
6d1c4efb
ILT
50622011-06-27 Ian Lance Taylor <iant@google.com>
5063
5064 * symtab.cc (Symbol::versioned_name): New function.
5065 (Symbol_table::add_to_final_symtab): Use versioned_name when
5066 appropriate.
5067 (Symbol_table::sized_write_symbol): Likewise.
5068 * symtab.h (class Symbol): Declare versioned_name.
5069 * stringpool.h (class Stringpool_template): Add variant of add
5070 which takes a std::basic_string.
5071 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5072 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5073 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5074 (ver_test_12.o): New target.
5075 * testsuite/Makefile.in: Rebuild.
5076
57eb9b50
DK
50772011-06-27 Doug Kwan <dougkwan@google.com>
5078
5079 * arm.cc (Arm_relocate_functions::thm_jump8,
5080 Arm_relocate_functions::thm_jump11): Use a wider signed
5081 type to compute offset.
5082 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5083 arm_thm_jump8.
5084 * testsuite/Makefile.in: Regenerate.
5085 * testsuite/arm_branch_in_range.sh: Check test results of
5086 arm_thm_jump11 and arm_thm_jump8.
5087 * testsuite/arm_thm_jump11.s: New test source file.
5088 * testsuite/arm_thm_jump11.t: New linker script.
5089 * testsuite/arm_thm_jump8.s: New test source file.
5090 * testsuite/arm_thm_jump8.t: New linker script.
5091
487b39df
ILT
50922011-06-24 Ian Lance Taylor <iant@google.com>
5093
5094 * layout.cc: Include "object.h".
5095 (ctors_sections_in_init_array): New static variable.
5096 (Layout::is_ctors_in_init_array): New function.
5097 (Layout::layout): Add entry to ctors_sections_in_init_array if
5098 appropriate.
5099 * layout.h (class Layout): Declare is_ctors_in_init_array.
5100 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5101 is_ctors_reverse_view is set.
5102 (Sized_relobj_file::write_sections): Add layout parameter. Change
5103 all callers. Set is_ctors_reverse_view field of View_size.
5104 (Sized_relobj_file::reverse_words): New function.
5105 * object.h (Sized_relobj_file::View_size): Add
5106 is_ctors_reverse_view field.
5107 (class Sized_relobj_file): Update declarations.
5108 * testsuite/initpri3.c: New test.
5109 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5110 initpri3b.
5111 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5112 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5113 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5114 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5115 * testsuite/Makefile.in: Rebuild.
5116
472076e4
CC
51172011-06-24 Cary Coutant <ccoutant@google.com>
5118
5119 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5120 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5121 (debug_msg_cdebug.err): New targets.
5122 * testsuite/Makefile.in: Regenerate.
5123 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5124 Fix checks for link with shared library.
5125
a60af0db
DK
51262011-06-24 Doug Kwan <dougkwan@google.com>
5127
5128 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5129 skip empty text sections.
5130 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5131
5393d741
ILT
51322011-06-22 Ian Lance Taylor <iant@google.com>
5133
5134 PR gold/12910
5135 * options.h (class General_options): Add --ctors-in-init-array.
5136 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5137 friends as SHT_PROGBITS for merging sections.
5138 (Layout::layout): Remove special handling of .init_array and
5139 friends. Don't sort if doing relocatable link. Sort for .ctors
5140 and .dtors if ctors_in_init_array.
5141 (Layout::make_output_section): Force correct section types for
5142 .init_array and friends. Don't sort if doing relocatable link,
5143 Don't sort .ctors and .dtors if ctors_in_init_array.
5144 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5145 (Layout::output_section_name): Add relobj parameter. Change all
5146 callers. Handle .ctors. and .dtors. in code rather than table.
5147 Handle .ctors and .dtors if ctors_in_init_array.
5148 (Layout::match_file_name): New function, moved from output.cc.
5149 * layout.h (class Layout): Update declarations.
5150 * output.cc: Include "layout.h".
5151 (Input_section_sort_entry::get_priority): New function.
5152 (Input_section_sort_entry::match_file_name): Just call
5153 Layout::match_file_name.
5154 (Output_section::Input_section_sort_init_fini_compare::operator()):
5155 Handle .ctors and .dtors. Sort by explicit priority rather than
5156 by name.
5157 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5158 * testsuite/initpri2.c: New test.
5159 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5160 (check_PROGRAMS): Add initpri2.
5161 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5162 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5163 * configure, testsuite/Makefile.in: Rebuild.
5164
e1f74f98
ILT
51652011-06-19 Ian Lance Taylor <iant@google.com>
5166
5167 PR gold/12880
5168 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5169 .interp section to a PT_INTERP segment even if we have seen a
5170 --dynamic-linker option. Don't do it if we have seen a PHDRS
5171 clause in a linker script.
5172 (Layout::finalize): Don't create a .interp section if we've
5173 already create a PT_INTERP segment.
5174 (Layout::create_interp): Always call choose_output_section (revert
5175 patch of 2011-06-17). Don't create PT_INTERP segment.
5176 * script-sections.cc
5177 (Script_sections::create_note_and_tls_segments): Add a .interp
5178 section to a PT_INTERP segment even if we have seen a
5179 --dynamic-linker option.
5180
766f91bb
ILT
51812011-06-18 Ian Lance Taylor <iant@google.com>
5182
5183 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5184 merely because a non-PT_LOAD segment has a dynamic reloc.
5185
0d212c3a
ILT
51862011-06-18 Ian Lance Taylor <iant@google.com>
5187
5188 * layout.cc (Layout::finish_dynamic_section): Don't create
5189 DT_FLAGS entry if not needed.
5190
911a5072
ILT
51912011-06-18 Ian Lance Taylor <iant@google.com>
5192
5193 PR gold/12745
5194 * layout.cc (Layout::layout_eh_frame): Correct handling of
5195 writable .eh_frame section.
5196
534b4e5f
ILT
51972011-06-17 Ian Lance Taylor <iant@google.com>
5198
5199 PR gold/12893
5200 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5201 symbol is redefined with the exact same object and value.
5202
10b4f102
ILT
52032011-06-17 Ian Lance Taylor <iant@google.com>
5204
5205 PR gold/12880
5206 * layout.h (class Layout): Add interp_segment_ field.
5207 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5208 (Layout::attach_allocated_section_to_segment): If making shared
5209 library, put .interp section in PT_INTERP segment.
5210 (Layout::finalize): Also call create_interp if -dynamic-linker
5211 option was used.
5212 (Layout::create_interp): Assert that there is no PT_INTERP
5213 segment. If not using a SECTIONS clause, use make_output_section.
5214 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5215 * script-sections.cc
5216 (Script_sections::create_note_and_tls_segments): If making shared
5217 library, put .interp section in PT_INTERP segment.
5218
a29b0dad
ILT
52192011-06-17 Ian Lance Taylor <iant@google.com>
5220
e588ea8d
ILT
5221 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5222 when making a shared library.
5223
52242011-06-17 Ian Lance Taylor <iant@google.com>
5225
5226 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5227 parameter. Change all callers. Don't issue warning about PC32
5228 against locally defined symbol.
a29b0dad 5229
9d3b0698
ILT
52302011-06-16 Ian Lance Taylor <iant@google.com>
5231
5232 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5233 occurs in same object.
5234
85b0f90c
AM
52352011-06-14 Alan Modra <amodra@gmail.com>
5236
5237 * po/POTFILES.in: Regenerate.
5238
a94907d9
ILT
52392011-06-09 Ian Lance Taylor <iant@google.com>
5240
5241 * script-sections.cc
5242 (Orphan_output_section::set_section_addresses): For a relocatable
5243 link set address to 0.
5244
4fb3a1c3
CC
52452011-06-09 Cary Coutant <ccoutant@google.com>
5246
5247 PR gold/12804
5248 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5249 used with --compress-debug-sections.
5250 * gold/object.cc (Sized_relobj_file::do_layout): Report
5251 uncompressed size of compressed input sections.
5252
61220854
CC
52532011-06-08 Cary Coutant <ccoutant@google.com>
5254
5255 PR gold/12804
5256 * testsuite/two_file_test_2_v1.cc: Change initialization of
5257 v2 to keep it in .data.
5258
e6455dfb
CC
52592011-06-07 Cary Coutant <ccoutant@google.com>
5260
5261 * common.cc (Symbol_table::do_allocate_commons_list): Call
5262 gold_fallback.
5263 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5264 (Errors::fallback): New function.
5265 (gold_fallback): New function.
5266 * errors.h (Errors::fallback): New function.
5267 * gold.cc (gold_exit): Change status parameter to enum; adjust
5268 all callers.
5269 (queue_initial_tasks): Call gold_fallback.
5270 * gold.h: Include cstdlib.
5271 (Exit_status): New enum type.
5272 (gold_exit): Change status parameter to enum.
5273 (gold_fallback): New function.
5274 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5275 (Layout::create_symtab_sections): Likewise.
5276 (Layout::create_shdrs): Likewise.
5277 * main.cc (main): Adjust call to gold_exit.
5278 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5279 (Output_data_got::add_got_entry_pair): Likewise.
5280 (Output_section::add_input_section): Likewise.
5281 (Output_section::add_output_section_data): Likewise.
5282 (Output_segment::set_section_list_addresses): Likewise.
5283 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5284
fb0e076f
CC
52852011-06-07 Cary Coutant <ccoutant@google.com>
5286
5287 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5288 for incremental links.
5289 * output.cc (Output_segment::set_section_list_addresses): Remove
5290 FIXME and test for TLS or BSS.
5291
a5ee4d5d
CC
52922011-06-07 Cary Coutant <ccoutant@google.com>
5293
5294 * testsuite/Makefile.am: Add incremental_copy_test,
5295 incremental_common_test_1.
5296 * testsuite/Makefile.in: Regenerate.
5297 * testsuite/common_test_1_v1.c: New source file.
5298 * testsuite/common_test_1_v2.c: New source file.
5299 * testsuite/copy_test_v1.cc: New source file.
5300
5146f448
CC
53012011-06-07 Cary Coutant <ccoutant@google.com>
5302
5303 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5304 update, allocate common from bss section's free list.
5305 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5306 linker-defined symbols.
5307 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5308 Skip GOT and PLT entries that are no longer referenced.
5309 (Output_section_incremental_inputs::write_info_blocks): Mark
5310 linker-defined symbols.
5311 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5312 * output.cc (Output_section::allocate): New function.
5313 * output.h (Output_section::allocate): New function.
5314 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5315 linker-defined symbols.
5316 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5317 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5318 (Symbol::init_base_output_data): Likewise.
5319 (Symbol::init_base_output_segment): Likewise.
5320 (Symbol::init_base_constant): Likewise.
5321 (Sized_symbol::init_output_data): Likewise.
5322 (Sized_symbol::init_output_segment): Likewise.
5323 (Sized_symbol::init_constant): Likewise.
5324 (Symbol_table::do_define_in_output_data): Likewise.
5325 (Symbol_table::do_define_in_output_segment): Likewise.
5326 (Symbol_table::do_define_as_constant): Likewise.
5327 * symtab.h (Symbol::is_predefined): New function.
5328 (Symbol::init_base_output_data): Add is_predefined parameter.
5329 (Symbol::init_base_output_segment): Likewise.
5330 (Symbol::init_base_constant): Likewise.
5331 (Symbol::is_predefined_): New data member.
5332 (Sized_symbol::init_output_data): Add is_predefined parameter.
5333 (Sized_symbol::init_output_segment): Likewise.
5334 (Sized_symbol::init_constant): Likewise.
5335 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5336
26d3c67d
CC
53372011-06-07 Cary Coutant <ccoutant@google.com>
5338
5339 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5340 instead of emit_copy_reloc.
5341 (Copy_relocs::emit_copy_reloc): Refactor.
5342 (Copy_relocs::make_copy_reloc): New function.
5343 (Copy_relocs::add_copy_reloc): Remove.
5344 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5345 section.
5346 (Copy_relocs::make_copy_reloc): New function.
5347 (Copy_relocs::add_copy_reloc): Remove.
5348 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5349 unchanged input files.
5350 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5351 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5352 Reserve BSS space for COPY relocations.
5353 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5354 (Output_section_incremental_inputs::write_info_blocks): Record
5355 whether a symbol is copied from a shared object.
5356 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5357 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5358 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5359 (Incremental_input_entry_reader::get_output_symbol_index): Add
5360 is_copy parameter.
5361 (Incremental_binary::emit_copy_relocs): New function.
5362 (Incremental_binary::do_emit_copy_relocs): New function.
5363 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5364 new data member.
5365 (Sized_incremental_binary::add_copy_reloc): New function.
5366 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5367 (Sized_incremental_binary::Copy_reloc): New struct.
5368 (Sized_incremental_binary::Copy_relocs): New typedef.
5369 (Sized_incremental_binary::copy_relocs_): New data member.
5370 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5371 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5372 * target.h (Sized_target::emit_copy_reloc): New function.
5373 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5374
7cdb37d9
CC
53752011-06-02 Cary Coutant <ccoutant@google.com>
5376
5377 PR gold/12163
5378 * gold/archive.cc (Archive::Archive): Initialize new data member.
5379 (Archive::include_all_members): Return if archive has already been
5380 included.
5381 * gold/archive.h (Archive::include_all_members_): New data member.
5382
cc643b88
NC
53832011-06-02 Nick Clifton <nickc@redhat.com>
5384
5385 * dynobj.h: Fix spelling mistake in comment.
5386 * output.cc: Likewise.
5387
f62a3ca7 53882011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5389 Asier Llano
f62a3ca7
DK
5390
5391 PR gold/12826
cc643b88 5392 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5393 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5394 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5395 redundant arm_exidx_test.so.
5396 * testsuite/Makefile.in: Regenerate.
5397 (check_SCRIPTS): Add pr12826.sh
5398 (check_DATA): Add pr12826.stdout
5399 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5400 * testsuite/pr12826.sh: New file.
5401 * testsuite/pr12826_1.s: Ditto.
5402 * testsuite/pr12826_1.s: Ditto.
5403
8dbe1edc
ILT
54042011-05-30 Ian Lance Taylor <iant@google.com>
5405
5406 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5407 sections.
5408
c49875be
ILT
54092011-05-29 Ian Lance Taylor <iant@google.com>
5410
5411 PR gold/12804
5412 * testsuite/Makefile.am: Use different file name for two_file_test
5413 temporary file for each incremental test.
5414 * testsuite/Makefile.in: Rebuild.
5415
69d53f7a
ILT
54162011-05-29 Ian Lance Taylor <iant@google.com>
5417
5418 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5419 binary input file is empty.
5420
41d0ab5f
ILT
54212011-05-27 Ian Lance Taylor <iant@google.com>
5422
5423 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5424 (ver_test_9.so): Likewise.
5425 * testsuite/Makefile.in: Rebuild.
5426
89d8a36b
CC
54272011-05-26 Cary Coutant <ccoutant@google.com>
5428
5429 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5430 * incremental.cc (Incremental_inputs::report_input_section): Fix
5431 comment, indentation.
5432 (Incremental_inputs::report_comdat_group): New function.
5433 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5434 of data for incremental input file entry.
5435 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5436 group count, COMDAT group signatures.
5437 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5438 an unchanged input file.
5439 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5440 Initialize new data member.
5441 (Incremental_object_entry::add_comdat_group): New function.
5442 (Incremental_object_entry::get_comdat_group_count): New function.
5443 (Incremental_object_entry::get_comdat_signature_key): New function.
5444 (Incremental_object_entry::groups_): New data member.
5445 (Incremental_inputs::report_comdat_group): New function.
5446 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5447 data for incremental input file entry.
5448 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5449 (Incremental_input_entry_reader::get_input_section): Adjust size of
5450 data for incremental input file entry.
5451 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5452 (Incremental_input_entry_reader::get_comdat_group_signature): New
5453 function.
5454 * object.cc (Sized_relobj::include_section_group): Report kept
5455 COMDAT groups for incremental links.
5456
1706a06f
ILT
54572011-05-24 David Meyer <pdox@google.com>
5458
5459 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5460 with name parameter. Add found_name parameter.
5461 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5462 * dirsearch.h (class Dirsearch): Update declaration.
5463
a10ae760
ILT
54642011-05-24 Ian Lance Taylor <iant@google.com>
5465
5466 * archive.cc (Library_base::should_include_member): Pull in object
5467 from archive if it defines the entry symbol.
5468 * parameters.cc (Parameters::entry): New function.
5469 * parameters.h (class Parameters): Declare entry.
5470 * output.h (class Output_file_header): Remove entry_ field.
5471 * output.cc (Output_file_header::Output_file_header): Remove entry
5472 parameter. Change all callers.
5473 (Output_file_header::entry): Use parameters->entry.
5474 * gold.cc (queue_middle_tasks): Likewise.
5475 * plugin.cc (Plugin_hook::run): Likewise.
5476
aa92d6ed
CC
54772011-05-24 Cary Coutant <ccoutant@google.com>
5478
5479 * gold.cc (queue_initial_tasks): Pass incremental base filename
5480 to Output_file::open_base_file; don't print error message.
5481 * incremental-dump.cc (main): Adjust call to
5482 Output_file::open_for_modification.
5483 * incremental-dump.cc (main): Likewise.
5484 * incremental.cc (Incremental_inputs::report_command_line):
5485 Ignore --incremental-base option when comparing command lines.
5486 Ignore parameter when given as separate argument.
5487 * options.h (class General_options): Add --incremental-base.
5488 * output.cc (Output_file::Output_file):
5489 (Output_file::open_base_file): Add base_name and writable parameters;
5490 read base file into new file; print error message here.
5491 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5492 callers.
5493 * output.h (Output_file::open_for_modification): Rename to...
5494 (Output_file::open_base_file): ...this; add base_name and
5495 writable parameters; adjust all callers.
5496 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5497 callers.
5498 * testsuite/Makefile.am (incremental_test_4): Test
5499 --incremental-base.
5500 * testsuite/Makefile.in: Regenerate.
5501
2eedd706
CC
55022011-05-24 Cary Coutant <ccoutant@google.com>
5503
5504 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5505 incremental_test_4.
5506 * testsuite/Makefile.in: Regenerate.
5507 * testsuite/two_file_test_1_v1.cc: New test source file.
5508 * testsuite/two_file_test_1b_v1.cc: New test source file.
5509 * testsuite/two_file_test_2_v1.cc: New test source file.
5510
0f1c85a6
CC
55112011-05-24 Cary Coutant <ccoutant@google.com>
5512
5513 * dynobj.h (Dynobj::do_dynobj): New function.
5514 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5515 flag and soname for shared objects.
5516 * incremental.cc (Incremental_inputs::report_object): Make
5517 either Incremental_object_entry or Incremental_dynobj_entry; add
5518 soname to string table.
5519 (Incremental_inputs::report_input_section): Add assertion.
5520 (Output_section_incremental_inputs::set_final_data_size): Adjust
5521 type of input file entry for shared libraries; adjust size of
5522 shared library info entry.
5523 (Output_section_incremental_inputs::write_input_files): Write
5524 as_needed flag for shared libraries.
5525 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5526 of input file entry for shared libraries; write soname.
5527 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5528 soname from incremental info.
5529 * incremental.h (enum Incremental_input_flags): Add
5530 INCREMENTAL_INPUT_AS_NEEDED.
5531 (Incremental_input_entry::Incremental_input_entry): Initialize new
5532 data member.
5533 (Incremental_input_entry::set_as_needed): New function.
5534 (Incremental_input_entry::as_needed): New function.
5535 (Incremental_input_entry::do_dynobj_entry): New function.
5536 (Incremental_input_entry::as_needed_): New data member.
5537 (Incremental_object_entry::Incremental_object_entry): Don't check
5538 for shared library.
5539 (Incremental_object_entry::do_type): Likewise.
5540 (class Incremental_dynobj_entry): New class.
5541 (Incremental_input_entry_reader::as_needed): New function.
5542 (Incremental_input_entry_reader::get_soname): New function.
5543 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5544 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5545 size of shared library info entry.
58797674 5546 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5547 incremental link when adding DT_NEEDED entries.
5548 * object.h (Object::Object): Initialize new data member.
5549 (Object::dynobj): New function.
5550 (Object::set_as_needed): New function.
5551 (Object::as_needed): New function.
5552 (Object::do_dynobj): New function.
5553 (Object::as_needed_): New data member.
5554
6fa2a40b
CC
55552011-05-24 Cary Coutant <ccoutant@google.com>
5556
5557 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5558 info; adjust display of GOT entries.
5559 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5560 vector of input objects; remove file_status_.
5561 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5562 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5563 got_plt reader; call target hooks to reserve GOT entries.
5564 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5565 of input file info header and GOT info entry.
5566 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5567 relocation info.
5568 (Got_plt_view_info::got_descriptor): Remove.
5569 (Got_plt_view_info::sym_index): New data member.
5570 (Got_plt_view_info::input_index): New data member.
5571 (Local_got_offset_visitor::visit): Write input file index.
5572 (Global_got_offset_visitor::visit): Write 0 for input file index.
5573 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5574 with sym_index and input_index.
5575 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5576 incremental info GOT entry; replace got_descriptor with input_index.
5577 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5578 map from input file index to object.
5579 (Sized_relobj_incr::do_layout): Replace direct data member reference
5580 with accessor function.
5581 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5582 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5583 Adjust size of input file info header.
5584 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5585 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5586 (Incremental_input_entry_reader::get_input_section): Adjust size of
5587 input file info header.
5588 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5589 of incremental info GOT entry.
5590 (Incremental_got_plt_reader::get_got_desc): Remove.
5591 (Incremental_got_plt_reader::get_got_symndx): New function.
5592 (Incremental_got_plt_reader::get_got_input_index): New function.
5593 (Sized_incremental_binary::Sized_incremental_binary): Remove
5594 file_status_; add input_objects_.
5595 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5596 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5597 (Sized_incremental_binary::file_is_unchanged): Remove.
5598 (Sized_incremental_binary::set_input_object): New function.
5599 (Sized_incremental_binary::input_object): New function.
5600 (Sized_incremental_binary::file_status_): Remove.
5601 (Sized_incremental_binary::input_objects_): New data member.
5602 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5603 references.
5604 (Sized_relobj_incr::invalid_address): Move to base class.
5605 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5606 class.
5607 (Sized_relobj_incr::do_output_section_offset): Likewise.
5608 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5609 (Sized_relobj_incr::section_offsets_): Likewise.
5610 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5611 function.
5612 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5613 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5614 with accessor function.
5615 (Sized_relobj_file::do_layout): Likewise.
5616 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5617 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5618 (Sized_relobj_file::compute_final_local_value): Replace refs to
5619 section_offsets_ with accessor function.
5620 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5621 * object.h (Relobj::Relobj): Initialize new data members.
5622 (Relobj::add_dyn_reloc): New function.
5623 (Relobj::first_dyn_reloc): New function.
5624 (Relobj::dyn_reloc_count): New function.
5625 (Relobj::first_dyn_reloc_): New data member.
5626 (Relobj::dyn_reloc_count_): New data member.
5627 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5628 references.
5629 (Sized_relobj::Address): New typedef.
5630 (Sized_relobj::invalid_address): Move here from child class.
5631 (Sized_relobj::Sized_relobj): Initialize new data members.
5632 (Sized_relobj::sized_relobj): New function.
5633 (Sized_relobj::is_output_section_offset_invalid): Move here from
5634 child class.
5635 (Sized_relobj::get_output_section_offset): Likewise.
5636 (Sized_relobj::local_has_got_offset): Likewise.
5637 (Sized_relobj::local_got_offset): Likewise.
5638 (Sized_relobj::set_local_got_offset): Likewise.
5639 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5640 (Sized_relobj::clear_got_offsets): New function.
5641 (Sized_relobj::section_offsets): Move here from child class.
5642 (Sized_relobj::do_output_section_offset): Likewise.
5643 (Sized_relobj::do_set_section_offset): Likewise.
5644 (Sized_relobj::Local_got_offsets): Likewise.
5645 (Sized_relobj::local_got_offsets_): Likewise.
5646 (Sized_relobj::section_offsets_): Likewise.
5647 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5648 references.
5649 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5650 class.
5651 (Sized_relobj_file::sized_relobj): New function
5652 (Sized_relobj_file::local_has_got_offset): Move to base class.
5653 (Sized_relobj_file::local_got_offset): Likewise.
5654 (Sized_relobj_file::set_local_got_offset): Likewise.
5655 (Sized_relobj_file::get_output_section_offset): Likewise.
5656 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5657 (Sized_relobj_file::do_output_section_offset): Likewise.
5658 (Sized_relobj_file::do_set_section_offset): Likewise.
5659 (Sized_relobj_file::Local_got_offsets): Likewise.
5660 (Sized_relobj_file::local_got_offsets_): Likewise.
5661 (Sized_relobj_file::section_offsets_): Likewise.
5662 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5663 (all constructors).
5664 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5665 (Output_reloc::get_symbol_index): Likewise.
5666 (Output_reloc::local_section_offset): Likewise.
5667 (Output_reloc::get_address): Likewise.
5668 (Output_reloc::symbol_value): Likewise.
5669 (Output_data_got::reserve_slot): Move to class definition.
5670 (Output_data_got::reserve_local): New function.
5671 (Output_data_got::reserve_slot_for_global): Remove.
5672 (Output_data_got::reserve_global): New function.
5673 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5674 (all constructors, two instantiations).
5675 (Output_reloc::get_relobj): New function (two instantiations).
5676 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5677 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5678 (Output_data_reloc::add_global): Adjust type of relobj.
5679 (Output_data_reloc::add_global_relative): Likewise.
5680 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5681 (Output_data_reloc::add_local): Likewise.
5682 (Output_data_reloc::add_local_relative): Likewise.
5683 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5684 (Output_data_reloc::add_local_section): Likewise.
5685 (Output_data_reloc::add_output_section): Likewise.
5686 (Output_data_reloc::add_absolute): Likewise.
5687 (Output_data_reloc::add_target_specific): Likewise.
5688 (Output_data_got::reserve_slot): Move definition here.
5689 (Output_data_got::reserve_local): New function.
5690 (Output_data_got::reserve_global): New function.
5691 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5692 section_offsets_ with accessor function.
5693 (Sized_relobj_file::write_sections): Likewise.
5694 (Sized_relobj_file::do_relocate_sections): Likewise.
5695 * target.h (Sized_target::reserve_local_got_entry): New function.
5696 (Sized_target::reserve_global_got_entry): New function.
5697 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5698 (Target_x86_64::reserve_global_got_entry): New function.
5699 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5700
4829d394
CC
57012011-05-23 Cary Coutant <ccoutant@google.com>
5702
5703 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5704 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5705 bit when checking got_type.
5706 * incremental.cc (Sized_incremental_binary::setup_readers):
5707 Store symbol table and string table locations; initialize bit vector
5708 of file status flags.
5709 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5710 unchanged files.
5711 (Sized_incremental_binary::do_process_got_plt): New function.
5712 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5713 (Output_section_incremental_inputs::set_final_data_size): Record
5714 file index for each input file.
5715 (Output_section_incremental_inputs::write_got_plt): Store file index
5716 instead of input entry offset for each GOT entry.
5717 * incremental.h
5718 (Incremental_input_entry::Incremental_input_entry): Initialize new
5719 data member.
5720 (Incremental_input_entry::set_offset): Store file index.
5721 (Incremental_input_entry::get_file_index): New function.
5722 (Incremental_input_entry::file_index_): New data member.
5723 (Incremental_binary::process_got_plt): New function.
5724 (Incremental_binary::do_process_got_plt): New function.
5725 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5726 data members.
5727 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5728 (Sized_incremental_binary::set_file_is_unchanged): New function.
5729 (Sized_incremental_binary::file_is_unchanged): New function.
5730 (Sized_incremental_binary::do_process_got_plt): New function.
5731 (Sized_incremental_binary::file_status_): New data member.
5732 (Sized_incremental_binary::main_symtab_loc_): New data member.
5733 (Sized_incremental_binary::main_strtab_loc_): New data member.
5734 * output.cc (Output_data_got::Got_entry::write): Add case
5735 RESERVED_CODE.
5736 (Output_data_got::add_global): Call add_got_entry.
5737 (Output_data_got::add_global_plt): Likewise.
5738 (Output_data_got::add_global_with_rel): Likewise.
5739 (Output_data_got::add_global_with_rela): Likewise.
5740 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5741 (Output_data_got::add_global_pair_with_rela): Likewise.
5742 (Output_data_got::add_local): Call add_got_entry.
5743 (Output_data_got::add_local_plt): Likewise.
5744 (Output_data_got::add_local_with_rel): Likewise.
5745 (Output_data_got::add_local_with_rela): Likewise.
5746 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5747 (Output_data_got::add_local_pair_with_rela): Likewise.
5748 (Output_data_got::reserve_slot): New function.
5749 (Output_data_got::reserve_slot_for_global): New function.
5750 (Output_data_got::add_got_entry): New function.
5751 (Output_data_got::add_got_entry_pair): New function.
5752 (Output_section::add_output_section_data): Edit FIXME.
5753 * output.h
5754 (Output_section_data_build::Output_section_data_build): New
5755 constructor with size parameter.
5756 (Output_data_space::Output_data_space): Likewise.
5757 (Output_data_got::Output_data_got): Initialize new data member; new
5758 constructor with size parameter.
5759 (Output_data_got::add_constant): Call add_got_entry.
5760 (Output_data_got::reserve_slot): New function.
5761 (Output_data_got::reserve_slot_for_global): New function.
5762 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5763 (Output_data_got::add_got_entry): New function.
5764 (Output_data_got::add_got_entry_pair): New function.
5765 (Output_data_got::free_list_): New data member.
5766 * target.h (Sized_target::init_got_plt_for_update): New function.
5767 (Sized_target::register_global_plt_entry): New function.
5768 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5769 Initialize new data member; call init; add constructor with PLT count.
5770 (Output_data_plt_x86_64::init): New function.
5771 (Output_data_plt_x86_64::add_relocation): New function.
5772 (Output_data_plt_x86_64::reserve_slot): New function.
5773 (Output_data_plt_x86_64::free_list_): New data member.
5774 (Target_x86_64::init_got_plt_for_update): New function.
5775 (Target_x86_64::register_global_plt_entry): New function.
5776 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5777 incremental updates.
5778 (Output_data_plt_x86_64::add_relocation): New function.
5779 * testsuite/object_unittest.cc (Object_test): Set default options.
5780
ec69d6da
ILT
57812011-05-16 Ian Lance Taylor <iant@google.com>
5782
5783 * options.h (class General_options): Make -i a synonym for -r.
5784
732e31de
ILT
57852011-05-16 Ian Lance Taylor <iant@google.com>
5786
5787 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5788
403676b5
CC
57892011-05-10 Cary Coutant <ccoutant@google.com>
5790
5791 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5792 strip_all (-s).
5793
5b7b7d6e
ILT
57942011-05-06 Ian Lance Taylor <iant@google.com>
5795
5796 * layout.cc (Layout::layout): If the output section flags change,
5797 update the ordering.
5798
f0f9babf
CC
57992011-04-25 Cary Coutant <ccoutant@google.com>
5800
5801 * incremental-dump.cc (dump_incremental_inputs): Print local
5802 symbol info for each input file.
5803 * incremental.cc
5804 (Output_section_incremental_inputs::set_final_data_size): Add local
5805 symbol info to input file entries in incremental info.
5806 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5807 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5808 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5809 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5810 implementation.
5811 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5812 (Sized_incr_relobj::do_relocate): Write the local symbols.
5813 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5814 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5815 Adjust size of input file header.
5816 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5817 (Incremental_inputs_reader::get_local_symbol_count): New function.
5818 (Incremental_inputs_reader::get_input_section): Adjust size of input
5819 file header.
5820 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5821 (Sized_incr_relobj::This): New typedef.
5822 (Sized_incr_relobj::sym_size): New const data member.
5823 (Sized_incr_relobj::Local_symbol): New struct.
5824 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5825 (Sized_incr_relobj::do_local_symbol_offset): New function.
5826 (Sized_incr_relobj::local_symbol_count_): New data member.
5827 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5828 (Sized_incr_relobj::local_symbol_index_): New data member.
5829 (Sized_incr_relobj::local_symbol_offset_): New data member.
5830 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5831 (Sized_incr_relobj::local_symbols_): New data member.
5832 * object.h (Relobj::output_local_symbol_count): New function.
5833 (Relobj::local_symbol_offset): New function.
5834 (Relobj::do_output_local_symbol_count): New function.
5835 (Relobj::do_local_symbol_offset): New function.
5836 (Sized_relobj::do_output_local_symbol_count): New function.
5837 (Sized_relobj::do_local_symbol_offset): New function.
5838
d0a9ace3
ILT
58392011-04-22 Vladimir Simonov <sv@sw.ru>
5840
5841 * descriptors.cc (set_close_on_exec): New function.
5842 (Descriptors::open): Use set_close_on_exec.
5843 * output.cc (S_ISLNK): Define if not defined.
5844
94a3fc8b
CC
58452011-04-22 Cary Coutant <ccoutant@google.com>
5846
5847 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5848 global symbol map.
5849 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5850 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5851 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5852 relocations.
5853 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5854 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5855 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5856 * incremental.h
5857 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5858 function.
5859 (Incremental_binary::apply_incremental_relocs): New function.
5860 (Incremental_binary::do_apply_incremental_relocs): New function.
5861 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5862 data member.
5863 (Sized_incremental_binary::add_global_symbol): New function.
5864 (Sized_incremental_binary::global_symbol): New function.
5865 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5866 (Sized_incremental_binary::symbol_map_): New data member.
5867 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5868 * target.h (Sized_target::apply_relocation): New function.
5869 * target-reloc.h (apply_relocation): New function.
5870 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5871
c87e4302
DK
58722011-04-22 Doug Kwan <dougkwan@google.com>
5873
5874 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5875 flag of a SHT_ARM_EXIDX section.
2e702c99 5876 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5877 * testsuite/Makefile.in: Regenerate.
5878 * testsuite/arm_exidx_test.s: New file.
5879 * testsuite/arm_exidx_test.sh: Same.
5880
e7782cf6
CC
58812011-04-20 Cary Coutant <ccoutant@google.com>
5882
5883 PR gold/12689
5884 * archive.h (Incremental_archive_entry::Archive_member):
5885 Initialize arg_serial_ (second constructor).
5886
308ecdc7
ILT
58872011-04-17 Ian Lance Taylor <iant@google.com>
5888
5889 * object.cc (Relocate_info::location): Simplify location string.
5890 * errors.cc (Errors::error_at_location): Don't print program
5891 name.
5892 (Errors::warning_at_location): Likewise.
5893 (Errors::undefined_symbol): Likewise.
5894 * testsuite/debug_msg.sh: Update accordingly.
5895
bec5b579
CC
58962011-04-14 Cary Coutant <ccoutant@google.com>
5897
5898 * gold/layout.cc (Layout::symtab_section_offset): New function.
5899 * gold/layout.h (Layout::symtab_section_offset): New function.
5900 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5901
88597d34
ILT
59022011-04-12 Ian Lance Taylor <iant@google.com>
5903
5904 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5905 with MREMAP_MAYMOVE.
5906 * output.h (class Output_file): Add map_is_allocated_ field.
5907 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5908 not available, provide stubs. If mremap is not available, #define
5909 it to gold_mremap.
5910 (MREMAP_MAYMOVE): Define if not defined.
5911 (Output_file::Output_file): Initialize map_is_allocated_.
5912 (Output_file::resize): Check map_is_allocated_.
5913 (Output_file::map_anonymous): If mmap fails, use malloc.
5914 (Output_file::unmap): Don't do anything for an anonymous map.
5915 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5916 is not available, provide stubs.
5917 (File_read::View::~View): Use free rather than delete[].
5918 (File_read::make_view): Use malloc rather than new[]. If mmap
5919 fails, use malloc.
5920 (File_read::find_or_make_view): Use malloc rather than new[].
5921 * gold.h: Remove HAVE_REMAP code.
5922 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5923 exists. Rename mremap to gold_mremap. If mmap is not available
5924 don't do anything.
5925 * configure, config.in: Rebuild.
5926
11e361bc
ILT
59272011-04-11 Ian Lance Taylor <iant@google.com>
5928
5929 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5930 initialize local variable v.
5931
cdc29364
CC
59322011-04-11 Cary Coutant <ccoutant@google.com>
5933
5934 * archive.cc (Archive::include_member): Adjust call to
5935 report_object.
5936 (Add_archive_symbols::run): Track argument serial numbers.
5937 (Lib_group::include_member): Likewise.
5938 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5939 * archive.h (Incremental_archive_entry::Archive_member):
5940 Initialize arg_serial_.
5941 (Archive_member::arg_serial_): New data member.
5942 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5943 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5944 incremental link.
5945 (Sized_dynobj::do_for_all_local_got_entries): New function.
5946 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5947 function.
5948 * fileread.cc (get_mtime): New function.
5949 * fileread.h (get_mtime): New function.
5950 * gold.cc (queue_initial_tasks): Check for incremental update.
5951 (process_incremental_input): New function.
5952 (queue_middle_tasks): Don't force valid target for incremental
5953 update.
5954 * incremental-dump.cc (find_input_containing_global): Adjust
5955 size of symbol info entry.
5956 (dump_incremental_inputs): Dump argument serial number and
5957 in_system_directory flag; bias shndx by 1; print symbol names
5958 when dumping per-file symbol lists; use new symbol info readers.
5959 * incremental.cc
5960 (Output_section_incremental_inputs:update_data_size): New function.
5961 (Sized_incremental_binary::setup_readers): Setup input readers
5962 for each input file; build maps for files added from libraries
5963 and scripts.
5964 (Sized_incremental_binary::check_input_args): New function.
5965 (Sized_incremental_binary::do_check_inputs): Build map of argument
5966 serial numbers to input arguments.
5967 (Sized_incremental_binary::do_file_has_changed): Rename
5968 do_file_is_unchanged to this; compare file modification times.
5969 (Sized_incremental_binary::do_init_layout): New function.
5970 (Sized_incremental_binary::do_reserve_layout): New function.
5971 (Sized_incremental_binary::do_get_input_reader): Remove.
5972 (Sized_incremental_binary::get_symtab_view): New function.
5973 (Incremental_checker::can_incrementally_link_output_file): Remove.
5974 (Incremental_inputs::report_command_line): Exclude --debug options.
5975 (Incremental_inputs::report_archive_begin): Add parameter; track
5976 argument serial numbers; don't put input file entry for archive
5977 before archive members.
5978 (Incremental_inputs::report_archive_end): Put input file entry
5979 for archive after archive members.
5980 (Incremental_inputs::report_object): Add parameter; track argument
5981 serial numbers and in_system_directory flag.
5982 (Incremental_inputs::report_script): Add parameter; track argument
5983 serial numbers.
5984 (Output_section_incremental_inputs::set_final_data_size): Adjust
5985 size of symbol info entry; check for forwarding symbols.
5986 (Output_section_incremental_inputs::write_input_files): Write
5987 in_system_directory flag and argument serial number.
5988 (Output_section_incremental_inputs::write_info_blocks): Map section
5989 indices between incremental info and original input file; store
5990 input section index for each symbol.
5991 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5992 change operator() to visit().
5993 (class Global_got_offset_visitor): Likewise.
5994 (class Global_symbol_visitor_got_plt):
5995 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5996 classes.
5997 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5998 (Sized_incr_relobj::do_read_symbols): New function.
5999 (Sized_incr_relobj::do_layout): New function.
6000 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6001 (Sized_incr_relobj::do_add_symbols): New function.
6002 (Sized_incr_relobj::do_should_include_member): New function.
6003 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6004 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6005 (Sized_incr_relobj::do_section_size): New function.
6006 (Sized_incr_relobj::do_section_name): New function.
6007 (Sized_incr_relobj::do_section_contents): New function.
6008 (Sized_incr_relobj::do_section_flags): New function.
6009 (Sized_incr_relobj::do_section_entsize): New function.
6010 (Sized_incr_relobj::do_section_address): New function.
6011 (Sized_incr_relobj::do_section_type): New function.
6012 (Sized_incr_relobj::do_section_link): New function.
6013 (Sized_incr_relobj::do_section_info): New function.
6014 (Sized_incr_relobj::do_section_addralign): New function.
6015 (Sized_incr_relobj::do_initialize_xindex): New function.
6016 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6017 (Sized_incr_relobj::do_read_relocs): New function.
6018 (Sized_incr_relobj::do_gc_process_relocs): New function.
6019 (Sized_incr_relobj::do_scan_relocs): New function.
6020 (Sized_incr_relobj::do_count_local_symbols): New function.
6021 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6022 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6023 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6024 (Sized_incr_relobj::do_relocate): New function.
6025 (Sized_incr_relobj::do_set_section_offset): New function.
6026 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6027 (Sized_incr_dynobj::do_read_symbols): New function.
6028 (Sized_incr_dynobj::do_layout): New function.
6029 (Sized_incr_dynobj::do_add_symbols): New function.
6030 (Sized_incr_dynobj::do_should_include_member): New function.
6031 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6032 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6033 (Sized_incr_dynobj::do_section_size): New function.
6034 (Sized_incr_dynobj::do_section_name): New function.
6035 (Sized_incr_dynobj::do_section_contents): New function.
6036 (Sized_incr_dynobj::do_section_flags): New function.
6037 (Sized_incr_dynobj::do_section_entsize): New function.
6038 (Sized_incr_dynobj::do_section_address): New function.
6039 (Sized_incr_dynobj::do_section_type): New function.
6040 (Sized_incr_dynobj::do_section_link): New function.
6041 (Sized_incr_dynobj::do_section_info): New function.
6042 (Sized_incr_dynobj::do_section_addralign): New function.
6043 (Sized_incr_dynobj::do_initialize_xindex): New function.
6044 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6045 (make_sized_incremental_object): New function.
6046 (Incremental_library::copy_unused_symbols): New function.
6047 (Incremental_library::do_for_all_unused_symbols): New function.
6048 * incremental.h (enum Incremental_input_flags): New type.
6049 (class Incremental_checker): Remove.
6050 (Incremental_input_entry::Incremental_input_entry): Add argument
6051 serial number.
6052 (Incremental_input_entry::arg_serial): New function.
6053 (Incremental_input_entry::set_is_in_system_directory): New function.
6054 (Incremental_input_entry::is_in_system_directory): New function.
6055 (Incremental_input_entry::arg_serial_): New data member.
6056 (Incremental_input_entry::is_in_system_directory_): New data member.
6057 (class Script_info): Move here from script.h.
6058 (Script_info::Script_info): Add filename parameter.
6059 (Script_info::filename): New function.
6060 (Script_info::filename_): New data member.
6061 (Incremental_script_entry::Incremental_script_entry): Add argument
6062 serial number.
6063 (Incremental_object_entry::Incremental_object_entry): Likewise.
6064 (Incremental_object_entry::add_input_section): Build list of input
6065 sections with map to original shndx.
6066 (Incremental_object_entry::get_input_section_index): New function.
6067 (Incremental_object_entry::shndx_): New data member.
6068 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6069 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6070 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6071 serial number.
6072 (Incremental_inputs::report_archive_begin): Likewise.
6073 (Incremental_inputs::report_object): Likewise.
6074 (Incremental_inputs::report_script): Likewise.
6075 (class Incremental_global_symbol_reader): New class.
6076 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6077 and store flags and input file type.
6078 (Incremental_input_entry_reader::arg_serial): New function.
6079 (Incremental_input_entry_reader::type): Extract type from flags.
6080 (Incremental_input_entry_reader::is_in_system_directory): New function.
6081 (Incremental_input_entry_reader::get_input_section_count): Call
6082 accessor function for type.
6083 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6084 function for type; adjust size of global symbol entry.
6085 (Incremental_input_entry_reader::get_global_symbol_count): Call
6086 accessor function for type.
6087 (Incremental_input_entry_reader::get_object_count): Likewise.
6088 (Incremental_input_entry_reader::get_object_offset): Likewise.
6089 (Incremental_input_entry_reader::get_member_count): Likewise.
6090 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6091 (Incremental_input_entry_reader::get_member_offset): Likewise.
6092 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6093 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6094 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6095 (Incremental_input_entry_reader::get_global_symbol_reader): New
6096 function.
6097 (Incremental_input_entry_reader::get_output_symbol_index): New
6098 function.
6099 (Incremental_input_entry_reader::type_): Remove.
6100 (Incremental_input_entry_reader::flags_): New data member.
6101 (Incremental_inputs_reader::input_file_offset): New function.
6102 (Incremental_inputs_reader::input_file_index): New function.
6103 (Incremental_inputs_reader::input_file): Call input_file_offset.
6104 (Incremental_inputs_reader::input_file_at_offset): New function.
6105 (Incremental_relocs_reader::get_r_type): Reformat.
6106 (Incremental_relocs_reader::get_r_shndx): Reformat.
6107 (Incremental_relocs_reader::get_r_offset): Reformat.
6108 (Incremental_relocs_reader::data): New function.
6109 (Incremental_binary::Incremental_binary): Initialize new data members.
6110 (Incremental_binary::check_inputs): Add cmdline parameter.
6111 (Incremental_binary::file_is_unchanged): Remove.
6112 (Input_reader::arg_serial): New function.
6113 (Input_reader::get_unused_symbol_count): New function.
6114 (Input_reader::get_unused_symbol): New function.
6115 (Input_reader::do_arg_serial): New function.
6116 (Input_reader::do_get_unused_symbol_count): New function.
6117 (Input_reader::do_get_unused_symbol): New function.
6118 (Incremental_binary::input_file_count): New function.
6119 (Incremental_binary::get_input_reader): Change signature to use
6120 index instead of filename.
6121 (Incremental_binary::file_has_changed): New function.
6122 (Incremental_binary::get_input_argument): New function.
6123 (Incremental_binary::get_library): New function.
6124 (Incremental_binary::get_script_info): New function.
6125 (Incremental_binary::init_layout): New function.
6126 (Incremental_binary::reserve_layout): New function.
6127 (Incremental_binary::output_file): New function.
6128 (Incremental_binary::do_check_inputs): New function.
6129 (Incremental_binary::do_file_is_unchanged): Remove.
6130 (Incremental_binary::do_file_has_changed): New function.
6131 (Incremental_binary::do_init_layout): New function.
6132 (Incremental_binary::do_reserve_layout): New function.
6133 (Incremental_binary::do_input_file_count): New function.
6134 (Incremental_binary::do_get_input_reader): Change signature.
6135 (Incremental_binary::input_args_map_): New data member.
6136 (Incremental_binary::library_map_): New data member.
6137 (Incremental_binary::script_map_): New data member.
6138 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6139 new data members.
6140 (Sized_incremental_binary::output_section): New function.
6141 (Sized_incremental_binary::inputs_reader): Add const.
6142 (Sized_incremental_binary::symtab_reader): Add const.
6143 (Sized_incremental_binary::relocs_reader): Add const.
6144 (Sized_incremental_binary::got_plt_reader): Add const.
6145 (Sized_incremental_binary::get_symtab_view): New function.
6146 (Sized_incremental_binary::Inputs_reader): New typedef.
6147 (Sized_incremental_binary::Input_entry_reader): New typedef.
6148 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6149 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6150 (Sized_incremental_binary::do_file_has_changed): New function.
6151 (Sized_incremental_binary::do_init_layout): New function.
6152 (Sized_incremental_binary::do_reserve_layout): New function.
6153 (Sized_input_reader::Inputs_reader): Remove.
6154 (Sized_input_reader::Input_entry_reader): Remove.
6155 (Sized_input_reader::do_arg_serial): New function.
6156 (Sized_input_reader::do_get_unused_symbol_count): New function.
6157 (Sized_input_reader::do_get_unused_symbol): New function.
6158 (Sized_incremental_binary::do_input_file_count): New function.
6159 (Sized_incremental_binary::do_get_input_reader): Change signature;
6160 use index instead of filename.
6161 (Sized_incremental_binary::section_map_): New data member.
6162 (Sized_incremental_binary::input_entry_readers_): New data member.
6163 (class Sized_incr_relobj): New class.
6164 (class Sized_incr_dynobj): New class.
6165 (make_sized_incremental_object): New function.
6166 (class Incremental_library): New class.
6167 * layout.cc (Free_list::num_lists): New static data member.
6168 (Free_list::num_nodes): New static data member.
6169 (Free_list::num_removes): New static data member.
6170 (Free_list::num_remove_visits): New static data member.
6171 (Free_list::num_allocates): New static data member.
6172 (Free_list::num_allocate_visits): New static data member.
6173 (Free_list::init): New function.
6174 (Free_list::remove): New function.
6175 (Free_list::allocate): New function.
6176 (Free_list::dump): New function.
6177 (Free_list::print_stats): New function.
6178 (Layout_task_runner::run): Resize output file for incremental updates.
6179 (Layout::Layout): Initialize new data members.
6180 (Layout::set_incremental_base): New function.
6181 (Layout::init_fixed_output_section): New function.
6182 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6183 incremental updates.
6184 (Layout::create_gold_note): Do not create gold note section for
6185 incremental updates.
6186 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6187 for incremental updates.
6188 (Layout::set_section_offsets): For incremental updates, allocate space
6189 from free list.
6190 (Layout::create_symtab_sections): Layout with offsets relative to
6191 start of section; for incremental updates, allocate space from free
6192 list.
6193 (Layout::create_shdrs): For incremental updates, allocate space from
6194 free list.
6195 (Layout::finish_dynamic_section): For incremental updates, do not
6196 check --as-needed (fixed in subsequent patch).
6197 * layout.h (class Free_list): New class.
6198 (Layout::set_incremental_base): New function.
6199 (Layout::incremental_base): New function.
6200 (Layout::init_fixed_output_section): New function.
6201 (Layout::allocate): New function.
6202 (Layout::incremental_base_): New data member.
6203 (Layout::free_list_): New data member.
6204 * main.cc (main): Print Free_list statistics.
6205 * object.cc (Relobj::finalize_incremental_relocs): Add
6206 clear_counts parameter; clear counts only when clear_counts is set.
6207 (Sized_relobj::Sized_relobj): Initialize new base class.
6208 (Sized_relobj::do_layout): Don't report special sections.
6209 (Sized_relobj::do_for_all_local_got_entries): New function.
6210 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6211 symtab_off to all symbol table offsets.
6212 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6213 * object.h (class Got_offset_list): Move to top of file.
6214 (Object::Object): Allow case where input_file == NULL.
6215 (Object::~Object): Likewise.
6216 (Object::input_file): Assert that input_file != NULL.
6217 (Object::lock): Allow case where input_file == NULL.
6218 (Object::unlock): Likewise.
6219 (Object::is_locked): Likewise.
6220 (Object::token): Likewise.
6221 (Object::release): Likewise.
6222 (Object::is_incremental): New function.
6223 (Object::get_mtime): New function.
6224 (Object::for_all_local_got_entries): New function.
6225 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6226 (Object::set_is_in_system_directory): New function.
6227 (Object::is_in_system_directory): New function.
6228 (Object::do_is_incremental): New function.
6229 (Object::do_get_mtime): New function.
6230 (Object::do_for_all_local_got_entries): New function.
6231 (Object::is_in_system_directory_): New data member.
6232 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6233 (class Sized_relobj_base): New class.
6234 (class Sized_relobj): Derive from Sized_relobj_base.
6235 (class Sized_relobj::Symbols): Redeclare from base class.
6236 (class Sized_relobj::local_got_offset_list): Remove.
6237 (class Sized_relobj::Output_sections): Redeclare from base class.
6238 (class Sized_relobj::do_for_all_local_got_entries): New function.
6239 (class Sized_relobj::write_local_symbols): Add offset parameter.
6240 (class Sized_relobj::local_symbol_offset_): Update comment.
6241 (class Sized_relobj::local_dynsym_offset_): Update comment.
6242 * options.cc (Input_arguments::add_file): Remove const.
6243 * options.h (Input_file_argument::Input_file_argument):
6244 Initialize arg_serial_ (all constructors).
6245 (Input_file_argument::set_arg_serial): New function.
6246 (Input_file_argument::arg_serial): New function.
6247 (Input_file_argument::arg_serial_): New data member.
6248 (Input_arguments::Input_arguments): Initialize file_count_.
6249 (Input_arguments::add_file): Remove const.
6250 (Input_arguments::number_of_input_files): New function.
6251 (Input_arguments::file_count_): New data member.
6252 (Command_line::number_of_input_files): Call
6253 Input_arguments::number_of_input_files.
6254 * output.cc (Output_segment_headers::Output_segment_headers):
6255 Set current size.
6256 (Output_section::Input_section::current_data_size): New function.
6257 (Output_section::Output_section): Initialize new data members.
6258 (Output_section::add_input_section): Don't do merge sections for
6259 an incremental link; allocate space from free list for an
6260 incremental update.
6261 (Output_section::add_output_section_data): Allocate space from
6262 free list for an incremental update.
6263 (Output_section::update_data_size): New function.
6264 (Output_section::set_fixed_layout): New function.
6265 (Output_section::reserve): New function.
6266 (Output_segment::set_section_addresses): Remove const.
6267 (Output_segment::set_section_list_addresses): Remove const; allocate
6268 space from free list for an incremental update.
6269 (Output_segment::set_offset): Adjust size of RELRO segment for an
6270 incremental update.
6271 * output.h (Output_data::current_data_size): Move here from
6272 child classes.
6273 (Output_data::pre_finalize_data_size): New function.
6274 (Output_data::update_data_size): New function.
6275 (Output_section_headers::update_data_size): new function.
6276 (Output_section_data_build::current_data_size): Move to Output_data.
6277 (Output_data_strtab::update_data_size): New function.
6278 (Output_section::current_data_size): Move to Output_data.
6279 (Output_section::set_fixed_layout): New function.
6280 (Output_section::has_fixed_layout): New function.
6281 (Output_section::reserve): New function.
6282 (Output_section::update_data_size): New function.
6283 (Output_section::has_fixed_layout_): New data member.
6284 (Output_section::free_list_): New data member.
6285 (Output_segment::set_section_addresses): Remove const.
6286 (Output_segment::set_section_list_addresses): Remove const.
6287 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6288 New function.
6289 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6290 New function.
6291 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6292 parameter when calling Add_symbols constructor; store argument
6293 serial number for members of a lib group.
6294 (Add_symbols::locks): Allow case where token == NULL.
6295 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6296 (Read_member::~Read_member): New function.
6297 (Read_member::is_runnable): New function.
6298 (Read_member::locks): New function.
6299 (Read_member::run): New function.
6300 (Check_script::~Check_script): New function.
6301 (Check_script::is_runnable): New function.
6302 (Check_script::locks): New function.
6303 (Check_script::run): New function.
6304 (Check_library::~Check_library): New function.
6305 (Check_library::is_runnable): New function.
6306 (Check_library::locks): New function.
6307 (Check_library::run): New function.
6308 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6309 (Add_symbols::library_): New data member.
6310 (class Read_member): New class.
6311 (class Check_script): New class.
6312 (class Check_library): New class.
6313 * reloc.cc (Read_relocs::is_runnable): Allow case where
6314 token == NULL.
6315 (Read_relocs::locks): Likewise.
6316 (Scan_relocs::locks): Likewise.
6317 (Relocate_task::locks): Likewise.
6318 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6319 to clear counters.
6320 (Sized_relobj::incremental_relocs_scan): Fix comment.
6321 (Sized_relobj::do_relocate): Pass output file offset to
6322 write_local_symbols.
6323 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6324 from class declaration.
6325 * script.cc (read_input_script): Allocate Script_info; pass
6326 argument serial number to report_script.
6327 * script.h (class Script_info): Move to incremental.h.
6328 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6329 * symtab.h (Symbol_table::add_from_incrobj): New function.
6330 (Symbol_table::set_file_offset): New function.
6331
b961d0d7
CC
63322011-04-05 Cary Coutant <ccoutant@google.com>
6333
6334 * incremental-dump.cc (dump_incremental_inputs): Change signature
6335 to take a Sized_incremental_binary; change caller. Use readers
6336 in Sized_incremental_binary.
6337 * incremental.cc
6338 (Sized_incremental_binary::find_incremental_inputs_sections):
6339 Rename do_find_incremental_inputs_sections to this.
6340 (Sized_incremental_binary::setup_readers): New function.
6341 (Sized_incremental_binary::do_check_inputs): Check
6342 has_incremental_info_ flag; move setup code to setup_readers;
6343 use input readers.
6344 (Sized_incremental_binary::do_file_is_unchanged): New function.
6345 (Sized_incremental_binary::do_get_input_reader): New function.
6346 * incremental.h (class Incremental_binary): Move to end of file.
6347 (Incremental_binary::file_is_unchanged): New function.
6348 (Incremental_binary::do_file_is_unchanged): New function.
6349 (Incremental_binary::Input_reader): New class.
6350 (Incremental_binary::get_input_reader): New function.
6351 (class Sized_incremental_binary): Move to end of file.
6352 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6353 input section reader classes.
6354 (Sized_incremental_binary::has_incremental_info): New function.
6355 (Sized_incremental_binary::inputs_reader): New function.
6356 (Sized_incremental_binary::symtab_reader): New function.
6357 (Sized_incremental_binary::relocs_reader): New function.
6358 (Sized_incremental_binary::got_plt_reader): New function.
6359 (Sized_incremental_binary::do_file_is_unchanged): New function.
6360 (Sized_incremental_binary::Sized_input_reader): New class.
6361 (Sized_incremental_binary::get_input_reader): New function.
6362 (Sized_incremental_binary::find_incremental_inputs_sections):
6363 Rename do_find_incremental_inputs_sections to this.
6364 (Sized_incremental_binary::setup_readers): New function.
6365 (Sized_incremental_binary::has_incremental_info_): New data member.
6366 (Sized_incremental_binary::inputs_reader_): New data member.
6367 (Sized_incremental_binary::symtab_reader_): New data member.
6368 (Sized_incremental_binary::relocs_reader_): New data member.
6369 (Sized_incremental_binary::got_plt_reader_): New data member.
6370 (Sized_incremental_binary::current_input_file_): New data member.
6371
a869183f
PP
63722011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6373
6374 PR gold/12640
6375 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6376 violation.
6377
63782011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6379
6380 * archive.cc (Archive::include_member): Adjust call to report_object.
6381 (Add_archive_symbols::run): Add script_info to call to
6382 report_archive_begin.
6383 (Lib_group::include_member): Adjust call to report_object.
6384 (Add_lib_group_symbols::run): Adjust call to report_object.
6385 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6386 blocks. Add object count for script input files.
6387 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6388 script_info parameter; change all callers.
6389 (Incremental_inputs::report_object): Add script_info parameter;
6390 change all callers.
6391 (Incremental_inputs::report_script): Store backpointer to
6392 incremental info entry.
6393 (Output_section_incremental_inputs::set_final_data_size): Record
6394 additional information for scripts.
6395 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6396 * incremental.h (Incremental_script_entry::add_object): New function.
6397 (Incremental_script_entry::get_object_count): New function.
6398 (Incremental_script_entry::get_object): New function.
6399 (Incremental_script_entry::objects_): New data member; adjust
6400 constructor.
6401 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6402 (Incremental_inputs::report_object): Add script_info parameter.
6403 (Incremental_inputs_reader::get_object_count): New function.
6404 (Incremental_inputs_reader::get_object_offset): New function.
6405 * options.cc (Input_arguments::add_file): Return reference to
6406 new input argument.
6407 * options.h (Input_argument::set_script_info): New function.
6408 (Input_argument::script_info): New function.
6409 (Input_argument::script_info_): New data member; adjust all
6410 constructors.
6411 (Input_file_group::add_file): Return reference to new input argument.
6412 (Input_file_lib::add_file): Likewise.
6413 (Input_arguments::add_file): Likewise.
6414 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6415 * script.cc (Parser_closure::Parser_closure): Add script_info
6416 parameter; adjust all callers.
6417 (Parser_closure::script_info): New function.
6418 (Parser_closure::script_info_): New data member.
6419 (read_input_script): Report scripts earlier to incremental info.
6420 (script_add_file): Set script_info in Input_argument.
6421 (script_add_library): Likewise.
6422 * script.h (Script_options::Script_info): Rewrite class.
6423
a869183f 64242011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6425
6426 * archive.cc (Library_base::should_include_member): Move
6427 method here from class Archive.
6428 (Archive::Archive): Initialize base class.
6429 (Archive::should_include_member): Move to base class.
6430 (Archive::do_for_all_unused_symbols): New function.
6431 (Add_archive_symbols::run): Remove redundant access to
6432 incremental_inputs.
6433 (Lib_group::Lib_group): Initialize base class.
6434 (Lib_group::do_filename): New function.
6435 (Lib_group::include_member): Pass pointer to Lib_group to
6436 report_object.
6437 (Lib_group::do_for_all_unused_symbols): New function.
6438 (Add_lib_group_symbols::run): Report archive information for
6439 incremental links.
6440 * archive.h (class Library_base): New base class.
6441 (class Archive): Derive from Library_base.
6442 (Archive::filename): Move to base class.
6443 (Archive::set_incremental_info): Likewise.
6444 (Archive::incremental_info): Likewise.
6445 (Archive::Should_include): Likewise.
6446 (Archive::should_include_member): Likewise.
6447 (Archive::Armap_entry): Remove.
6448 (Archive::Unused_symbol_iterator): Remove.
6449 (Archive::unused_symbols_begin): Remove.
6450 (Archive::unused_symbols_end): Remove.
6451 (Archive::do_filename): New function.
6452 (Archive::do_get_mtime): New function.
6453 (Archive::do_for_all_unused_symbols): New function.
6454 (Archive::task_): Move to base class.
6455 (Archive::incremental_info_): Likewise.
6456 (class Lib_group): Derive from Library_base.
6457 (Lib_group::do_filename): New function.
6458 (Lib_group::do_get_mtime): New function.
6459 (Lib_group::do_for_all_unused_symbols): New function.
6460 (Lib_group::task_): Move to base class.
6461 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6462 function.
6463 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6464 function.
6465 * incremental.cc (Incremental_inputs::report_archive_begin):
6466 Use Library_base; call library's get_mtime; add incremental inputs
6467 entry before members.
6468 (class Unused_symbol_visitor): New class.
6469 (Incremental_inputs::report_archive_end): Use Library_base; use
6470 visitor class to record unused symbols; don't add incremental inputs
6471 entry after members.
6472 (Incremental_inputs::report_object): Use Library_base.
6473 * incremental.h
6474 (Incremental_archive_entry::Incremental_archive_entry): Remove
6475 unused Archive parameter.
6476 (Incremental_inputs::report_archive_begin): Use Library_base.
6477 (Incremental_inputs::report_archive_end): Likewise.
6478 (Incremental_inputs::report_object): Likewise.
6479 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6480 function.
6481 * object.h (Object::for_all_global_symbols): New function.
6482 (Object::do_for_all_global_symbols): New function.
6483 (Sized_relobj::do_for_all_global_symbols): New function.
6484 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6485 function.
6486 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6487 function.
6488
61ab3e40
ILT
64892011-03-27 Ian Lance Taylor <iant@google.com>
6490
6491 * archive.cc (Archive::interpret_header): Return -1 if something
6492 goes wrong. Change callers accordingly.
6493
30e1f9e6
CC
64942011-03-25 Cary Coutant <ccoutant@google.com>
6495
6496 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6497 * testsuite/Makefile.in: Regenerate.
6498
9370ce59 64992011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6500
6501 * plugin.cc (get_view): New.
6502 (Plugin::load): Pass get_view to the plugin.
6503 (Plugin_manager::get_view): New.
6504
9312bb0a
ILT
65052011-03-21 Ian Lance Taylor <iant@google.com>
6506
6507 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6508 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6509
7e12ba9e
ST
65102011-03-21 Sriraman Tallam <tmsriram@google.com>
6511
6512 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6513 Change == to -eq.
6514 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6515 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6516 Change == to -eq.
6517 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6518 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6519
fd7a005d
ILT
65202011-03-14 Ian Lance Taylor <iant@google.com>
6521
6522 * script-sections.cc (Sort_output_sections::script_compare):
6523 Rename from is_before, change return type.
6524 (Sort_output_sections::operator()): Adjust accordingly.
6525
ed16fd1b
ILT
65262011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6527
6528 PR gold/12572
6529 * testsuite/odr_violation2.cc: Add comment to make all error line
6530 numbers double digits.
6531 * testsuite/debug_msg.sh: Adjust expected errors.
6532
71ff8986
ILT
65332011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6534
6535 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6536 but mark earlier ones as non-canonical
6537 (offset_to_iterator): Update search target and example
6538 (do_addr2line): Return extra lines in a vector*
6539 (format_file_lineno): Extract from do_addr2line
6540 (one_addr2line): Add vector* out-param
6541 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6542 when a lineno entry appeared last for its instruction
6543 (Dwarf_line_info): Add vector* out-param
6544 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6545 * symtab.cc (Odr_violation_compare): Include the lineno in the
6546 comparison again.
6547 (linenos_from_loc): New. Combine the canonical line for an
6548 address with its other lines.
6549 (True_if_intersect): New. Helper functor to make
6550 std::set_intersection a query.
6551 (detect_odr_violations): Compare sets of lines instead of just
6552 one line for each function. This became less deterministic, but
6553 has fewer false positives.
6554 * symtab.h: Declarations.
6555 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6556 mix an optimized and non-optimized object in the same binary
6557 (odr_violation2.so): Same.
6558 * testsuite/Makefile.in: Regenerate from Makefile.am.
6559 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6560 * testsuite/debug_msg.sh: Update line numbers and add
6561 assertions.
6562 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6563 non-optimized context.
6564 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6565 isn't inlined, and use OdrDerived in an optimized context.
6566 * testsuite/odr_header1.h: Defines OdrDerived, where
6567 optimization will change the
6568 first-instruction-in-the-destructor's file and line number.
6569 * testsuite/odr_header2.h: Defines OdrBase.
6570
a19fefdc
ILT
65712011-03-09 Ian Lance Taylor <iant@google.com>
6572
6573 * fileread.cc (File_read::clear_views): Don't delete the whole
6574 file view.
6575
ecb351e9
ILT
65762011-03-08 Ian Lance Taylor <iant@google.com>
6577
6578 PR gold/12525
6579 * fileread.cc: #include <climits>.
6580 (GOLD_IOV_MAX): Define.
6581 (File_read::read_multiple): Limit number of entries by iov_max.
6582 * fileread.h (class File_read): Always set max_readv_entries to
6583 128.
6584
b821d13c
ILT
65852011-03-07 Ian Lance Taylor <iant@google.com>
6586
6587 PR gold/12525
6588 * options.h (class General_options): Add -dy and -dn.
6589
89243142
CC
65902011-03-02 Cary Coutant <ccoutant@google.com>
6591
6592 * testsuite/script_test_9.t: Add TLS segment.
6593
d0773f31
ILT
65942011-03-02 Simon Baldwin <simonb@google.com>
6595
6596 * configure.ac: Add check for gnu_indirect_function support in
6597 the toolchain building binutils.
6598 * configure: Rebuild.
6599
9370ce59 66002011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6601
6602 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6603 plugin only symbols.
6604 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6605 in plugin files as not needed in the symbol table.
6606
4cf7a849
ST
66072011-02-11 Sriraman Tallam <tmsriram@google.com>
6608
6609 * output.cc (Output_section::add_input_section): Delay fill
6610 generation for section ordering.
6611
b578bd7d
ILT
66122011-02-09 Ian Lance Taylor <iant@google.com>
6613
6614 PR gold/12316
6615 * object.h (class Sized_relobj): Remove clear_local_symbols.
6616 * reloc.cc (Sized_relobj::do_relocate): Don't call
6617 clear_local_symbols.
6618
9370ce59 66192011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6620
6621 * plugin.cc (is_visible_from_outside): Return true for symbols
6622 in the -u option.
6623
55382fb7
ILT
66242011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6625
6626 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6627 filename.
6628
4e271fff
ST
66292011-02-02 Sriraman Tallam <tmsriram@google.com>
6630
6631 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6632 to std::string.
4e271fff 6633 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6634 section_name to be std::string.
4e271fff
ST
6635 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6636
d433c3ac
ILT
66372011-01-25 Ian Lance Taylor <iant@google.com>
6638
6639 * script.cc (script_add_extern): Rewrite to use
6640 add_symbol_reference.
6641
880473a6
DK
66422011-01-25 Doug Kwan <dougkwan@google.com>
6643
d433c3ac 6644 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6645
f30f86fa
ILT
66462011-01-24 Ian Lance Taylor <iant@google.com>
6647
6648 * options.h (class General_options): Accept
6649 --no-detect-odr-violations.
6650
8e51a0b9
ILT
66512011-01-24 Ian Lance Taylor <iant@google.com>
6652
6653 * version.cc (version_string): Bump to 1.11.
6654
0f3b89d8
ILT
66552011-01-24 Ian Lance Taylor <iant@google.com>
6656
6657 * plugin.cc (class Plugin_rescan): Define new class.
6658 (Plugin_manager::claim_file): Set any_claimed_.
6659 (Plugin_manager::save_archive): New function.
6660 (Plugin_manager::save_input_group): New function.
6661 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6662 necessary.
6663 (Plugin_manager::new_undefined_symbol): New function.
6664 (Plugin_manager::rescan): New function.
6665 (Plugin_manager::rescannable_defines): New function.
6666 (Plugin_manager::add_input_file): Set any_added_.
6667 * plugin.h (class Plugin_manager): define new fields rescannable_,
6668 undefined_symbols_, any_claimed_, and any_added_. Declare
6669 Plugin_rescan as friend. Declare new functions.
6670 (Plugin_manager::Rescannable): Define type.
6671 (Plugin_manager::Rescannable_list): Define type.
6672 (Plugin_manager::Undefined_symbol_list): Define type.
6673 (Plugin_manager::Plugin_manager): Initialize new fields.
6674 * archive.cc (Archive::defines_symbol): New function.
6675 (Add_archive_symbols::run): Pass archive to plugins if any.
6676 * archive.h (class Archive): Declare defines_symbol.
6677 * readsyms.cc (Input_group::~Input_group): New function.
6678 (Finish_group::run): Pass input_group to plugins if any.
6679 * readsyms.h (class Input_group): Declare destructor.
6680 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6681 any.
6682
3bb951e5
ILT
66832011-01-10 Ian Lance Taylor <iant@google.com>
6684
6685 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6686 section as relro.
6687 (Layout::set_segment_offsets): Reset increase_relro before calling
6688 set_section_addresses a second time.
6689
0aa45fac
CC
66902011-01-04 Cary Coutant <ccoutant@google.com>
6691
6692 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6693 sections before NOBITS sections.
6694
0db46eb4
L
66952011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6696
6697 * version.cc (print_version): Update copyright to 2011.
6698
829c9745
CC
66992010-12-23 Cary Coutant <ccoutant@google.com>
6700
6701 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6702 of OS to this->add. Add OD parameter to second form of the function.
6703
7500420b
ILT
67042010-12-20 Ian Lance Taylor <iant@google.com>
6705
6706 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6707 second of two consecutive entries with same offset.
6708
f8e9a930
RW
67092010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6710
6711 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6712 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6713 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6714 to avoid unneeded links against $(LDADD).
6715 * testsuite/Makefile.in: Regenerate.
6716
2fbb4320
ILT
67172010-12-15 Ian Lance Taylor <iant@google.com>
6718
6719 PR gold/12324
6720 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6721 for R_X86_64_32 and R_X86_64_PC32.
6722 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6723 ver_matching_def_pic.o.
6724 (ver_matching_def_pic.o): New target.
6725
fedb228d
RW
67262010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6727
6728 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6729 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6730 Move definition before File_read::View member definitions.
6731 (File_read::View::~View): Initialize and hold lock before
6732 updating current_mapped_bytes.
6733
9b547ce6
RW
67342010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6735
6736 * dwarf_reader.cc: Remove outdated comment.
6737 * gold-threads.cc: Fix typo in error message.
6738 * archive.cc: Fix typos in comments.
6739 * archive.h: Likewise.
6740 * arm-reloc-property.cc: Likewise.
6741 * arm-reloc-property.h: Likewise.
6742 * arm-reloc.def: Likewise.
6743 * arm.cc: Likewise.
6744 * attributes.h: Likewise.
6745 * cref.cc: Likewise.
6746 * ehframe.cc: Likewise.
6747 * fileread.h: Likewise.
6748 * gold.h: Likewise.
6749 * i386.cc: Likewise.
6750 * icf.cc: Likewise.
6751 * incremental.h: Likewise.
6752 * int_encoding.cc: Likewise.
6753 * layout.h: Likewise.
6754 * main.cc: Likewise.
6755 * merge.h: Likewise.
6756 * object.cc: Likewise.
6757 * object.h: Likewise.
6758 * options.cc: Likewise.
6759 * readsyms.cc: Likewise.
6760 * reduced_debug_output.cc: Likewise.
6761 * reloc.cc: Likewise.
6762 * script-sections.cc: Likewise.
6763 * sparc.cc: Likewise.
6764 * symtab.h: Likewise.
6765 * target-reloc.h: Likewise.
6766 * target.cc: Likewise.
6767 * target.h: Likewise.
6768 * timer.cc: Likewise.
6769 * timer.h: Likewise.
6770 * x86_64.cc: Likewise.
6771
83e17bd5
CC
67722010-12-09 Cary Coutant <ccoutant@google.com>
6773
6774 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6775 stack.
6776 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6777 parameter; change all callers.
6778 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6779 * options.h (warn_execstack): New option.
6780
017257f8
DK
67812010-12-07 Doug Kwan <dougkwan@google.com>
6782
6783 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6784 like function call relocations.
6785
c20cbc06
ILT
67862010-12-07 Ian Lance Taylor <iant@google.com>
6787
6788 * archive.cc (Archive::get_elf_object_for_member): Permit
6789 punconfigured to be NULL.
6790 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6791 (Archive::include_member): Pass NULL to get_elf_object_for_member
6792 if we searched for the archive and this is the first included
6793 object.
6794
4dbfafcc
ILT
67952010-12-01 Ian Lance Taylor <iant@google.com>
6796
6797 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6798 track_relocs_type_ field.
6799 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6800 Set track_relocs_type_.
6801 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6802 contents when using RELA relocs.
6803 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6804 reloc_map_.
6805 * reloc.cc (Track_relocs::next_addend): New function.
6806 * reloc.h (class Track_relocs): Declare next_addend.
6807
e5e19edd
ILT
68082010-12-01 Ian Lance Taylor <iant@google.com>
6809
6810 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6811 virtual destructor.
6812
9a5ce24c
ILT
68132010-12-01 Ian Lance Taylor <iant@google.com>
6814
6815 * README: Update compilers known to work and fail.
6816
c7791212
NC
68172010-11-23 Matthias Klose <doko@ubuntu.com>
6818
6819 * configure.in: For --enable-gold, handle value `default' instead of
6820 `both*'. Always install ld as ld.bfd, install as ld if gold is
6821 not the default.
6822 * configure: Regenerate.
6823
0ad220c9
DK
68242010-11-18 Doug Kwan <dougkwan@google.com>
6825
6826 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6827 and right_alignment to be zero. Store result alignment only if it is
6828 greater than existing alignment.
6829
ab8056e0
CC
68302010-11-16 Cary Coutant <ccoutant@google.com>
6831
6832 PR gold/12220
6833 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6834 Check for ".zdebug_line".
6835
fd064a5b
CC
68362010-11-16 Doug Kwan <dougkwan@google.com>
6837 Cary Coutant <ccoutant@google.com>
6838
6839 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6840 by reference; adjust all callers.
6841 * output.cc (Output_segment::set_section_addresses): Adjust references
6842 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6843 list is empty.
6844 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6845 end at page boundary.
6846
6fc6ea19
CC
68472010-11-16 Cary Coutant <ccoutant@google.com>
6848
6849 PR gold/12220
6850 * layout.cc (Layout::choose_output_section): Transform names of
6851 compressed sections even when using a script with a SECTIONS clause.
6852 (Layout::output_section_name): Remove code to transform
6853 compressed debug section names.
6854 * output.cc (Output_section::add_input_section): Use uncompressed
6855 section size when tracking input sections.
6856
95a2c8d6
RS
68572010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6858
6859 * symtab.h (Symbol::NON_PIC_REF): Remove.
6860 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6861 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6862 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6863 (Symbol::use_plt_offset): Take a flags argument and pass it
6864 directly to needs_dynamic_reloc. Restrict check for undefined
6865 weak symbols to function calls.
6866 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6867 (Target_arm::Scan::global): Use it.
6868 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6869 (Target_arm::Relocate::relocate): Likewise.
6870 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6871 parameter with an r_type parameter. Use get_reference_flags
6872 to get the flags.
6873 (Target_arm::Relocate::relocate): Update accordingly.
6874 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6875 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6876 (Target_i386::Scan::global): Likewise.
6877 (Target_i386::Relocate::relocate): Likewise.
6878 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6879 parameter with an r_type parameter. Use get_reference_flags
6880 to get the flags.
6881 (Target_i386::Relocate::relocate): Update accordingly.
6882 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6883 (Target_powerpc::Scan::global): Use it.
6884 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6885 (Target_powerpc::Relocate::relocate): Likewise.
6886 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6887 (Target_sparc::Scan::global): Use it.
6888 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6889 (Target_sparc::Relocate::relocate): Likewise.
6890 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6891 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6892 (Target_x86_64::Scan::global): Likewise.
6893 (Target_x86_64::Relocate::relocate): Likewise.
6894
f625ae50
DK
68952010-11-08 Doug Kwan <dougkwan@google.com>
6896 Cary Coutant <ccoutant@google.com>
6897
6898 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6899 (Arm_exidx_merge_section::section_contents_): New data member.
6900 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6901 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6902 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6903 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6904 in parameters instead of calling Object::section_contents without
6905 locking.
6906 (Arm_output_section::group_section): New parameter TASK. Pass it
6907 to callees that need locking objects.
6908 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6909 to lock EXIDX input sections. Fix a formatting issue. Call
6910 Arm_exidx_merged_section::build_contents to create merged section
6911 contents.
6912 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6913 to lock object of stub table owner.
6914 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6915 TEXT_SIZE to initialize data member TEXT_SIZE_.
6916 (Arm_exidx_input_section::addralign): Fix typo in comment.
6917 (Arm_exidx_input_section::text_size): New method.
6918 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6919 that require locking objects. Lock objects before scanning for stubs
6920 and updating local symbols.
6921 (Arm_input_section<big_endian>::init): Copy contents of original
6922 input section.
2e702c99 6923 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6924 original input section instead of calling Object::section_contents
6925 without locking.
6926 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6927 size without calling Object::section_size().
6928 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6929 for size. Allocate a buffer for merged EXIDX entries.
6930 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6931 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6932 building code to Arm_exidx_merged_section::build_contetns. Write
6933 out contetns in buffer instead of building it on the fly.
6934 (Arm_relobj::make_exidx_input_section): Also pass text section size
6935 to Arm_exidx_input_section constructor.
6936 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6937 (Arm_dynobj::do_read_symbols): Fix memory leak.
6938 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6939 * target.h: (class Task): Add forward declaration.
6940 (Target::relax): Add new parameter TASK and pass it to
6941 Target::do_relax().
6942 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6943
5f9bcf58
CC
69442010-11-05 Cary Coutant <ccoutant@google.com>
6945
6946 PR gold/10708
6947 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6948 object when reading from the file.
6949 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6950 second layout pass.
6951 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6952 when reading section contents.
6953 (get_section_contents): Likewise.
6954 (icf::find_identical_sections): Likewise.
6955 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6956 object when reading from the file.
6957 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6958 the object when doing deferred section layout.
6959
e597fa08
NC
69602010-11-03 Nick Clifton <nickc@redhat.com>
6961
6962 PR gold/12001
6963 * script.h (class Symbol_assignment: name): New member. Returns
6964 the name of the symbol.
6965 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6966 Returns true if the given symbol name is on the list of
6967 assignments wating to be processed.
6968 * archive.cc (should_incldue_member): If the symbol is undefined,
6969 check to see if it is on the list of symbols pending assignment.
6970
3f9a3278
ILT
69712010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6972
6973 * script-sections.cc (Script_sections::find_memory_region): Check
6974 for a NULL output section pointer.
6975
d06fb4d1
DK
69762010-10-29 Doug Kwan <dougkwan@google.com>
6977
6978 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6979 Output_section::add_relaxed_input_section.
6980 * output.cc (Output_section::add_relaxed_input_section): Add new
6981 arguments LAYOUT and NAME. Set section order index.
6982 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6983 Copy section order index.
6984 * output.h (Output_section::add_relaxed_input_section): Add new
6985 arguments LAYOUT and NAME.
6986
90e24de5
ILT
69872010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6988
6989 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6990 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6991 * testsuite/Makefile.in: Regenerate.
6992
c9484ea5
DK
69932010-10-20 Doug Kwan <dougkwan@google.com>
6994
6995 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6996 without SHF_LINK_ORDER flags.
6997 * layout.cc (Layout::choose_output_section): Do not filter
6998 SHF_LINK_ORDER flag in a relocatable link.
6999
5bc2f5be
CC
70002010-10-17 Cary Coutant <ccoutant@google.com>
7001
7002 * output.h (Output_segment::set_section_addresses): Change function
7003 signature. Update all callers.
7004 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7005 sections.
7006 (Output_segment::set_section_addresses): Align after last TLS
7007 section. Add padding before last relro section instead of after.
7008
0c91cf04
DK
70092010-10-17 Doug Kwan <dougkwan@google.com>
7010
7011 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7012 GOT output section to be writable.
7013
8c21d9d3
CC
70142010-10-14 Cary Coutant <ccoutant@google.com>
7015
7016 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7017 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7018 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7019 mode.
7020 * incremental.cc (report_command_line): Ignore all forms of
7021 --incremental.
7022 * layout.cc (Layout::Layout): Check parameters for incremental link
7023 mode.
7024 * options.cc (General_options::parse_incremental): New function.
7025 (General_options::parse_no_incremental): New function.
7026 (General_options::parse_incremental_full): New function.
7027 (General_options::parse_incremental_update): New function.
7028 (General_options::incremental_mode_): New data member.
7029 (General_options::finalize): Check incremental_mode_.
7030 * options.h (General_options): Update help text for --incremental.
7031 Add --no-incremental, --incremental-full, --incremental-update.
7032 (General_options::Incremental_mode): New enum type.
7033 (General_options::incremental_mode): New function.
7034 (General_options::incremental_mode_): New data member.
7035 * parameters.cc (Parameters::incremental_mode_): New data member.
7036 (Parameters::set_options): Set incremental_mode_.
7037 (Parameters::set_incremental_full): New function.
7038 (Parameters::incremental): New function.
7039 (Parameters::incremental_update): New function.
7040 (set_parameters_incremental_full): New function.
7041 * parameters.h (Parameters::set_incremental_full): New function.
7042 (Parameters::incremental): New function.
7043 (Parameters::incremental_update): New function.
7044 (Parameters::incremental_mode_): New data member.
7045 (set_parameters_incremental_full): New function.
7046 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7047 incremental link mode.
7048 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7049 (Sized_relobj::do_relocate_sections): Likewise.
7050 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7051 option.
7052 * testsuite/Makefile.in: Regenerate.
7053 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7054
bb32aa18 70552010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7056
7057 * script-sections.h (class Script_sections): Make
7058 Sections_elements typedef public.
7059 * script-sections.cc (class Sort_output_sections): Add elements_
7060 field. Add constructor which sets it; change all callers.
7061 (Sort_output_sections::is_before): New function.
7062 (Sort_output_sections::operator()): Call is_before.
7063 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7064 conditional.
7065 * testsuite/script_test_10.sh: New test. Test script section
7066 order.
7067 * testsuite/script_test_10.t: Likewise.
7068 * testsuite/script_test_10.s: Likewise.
7069 * testsuite/Makefile.am: Wrap the cross linker tests and the
7070 common tests into NATIVE_OR_CROSS_LINKER.
7071 (check_SCRIPTS): Add script_test_10.sh.
7072 (check_DATA): Add script_test_10.stdout.
7073 (script_test_10.o, script_test_10): New targets.
7074 (script_test_10.stdout): New target.
7075 * configure, testsuite/Makefile.in: Regenerate.
7076
3cef7179
ILT
70772010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7078
7079 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7080 error for the deprecated relocations.
7081 (Target_arm::Scan::global): Likewise.
7082 (Target_arm::Relocate::relocate): Likewise.
7083
7411e9a8
RS
70842010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7085
7086 * fileread.cc (Input_file::find_file): Initialize *found_name
7087 and *namep when using the fallback search for case 4.
7088
6a9da32a
CC
70892010-10-11 Cary Coutant <ccoutant@google.com>
7090
7091 * options.h (class General_options): Redefine -z lazy as an alias for
7092 the negation of -z now.
7093
ac897c20
ILT
70942010-10-11 Ian Lance Taylor <iant@google.com>
7095
7096 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7097 binding.
7098
ea5cae92
NC
70992010-10-06 Nick Clifton <nickc@redhat.com>
7100
7101 * script-sections.cc(class Memory_region): Remove
7102 current_lma_offset_ field. Rename current_vma_offset_ to
7103 current_offset_. Add last_section_ field.
7104 (Memory_region::get_current_vma_address): Rename to
7105 get_current_address.
7106 (Memory_region::get_current_lma_address): Delete.
7107 (Memory_region::increment_vma_offset): Rename to
7108 increment_offset.
7109 (Memory_region::increment_lma_offset): Delete.
7110 (Memory_region::attributes_compatible): New method. Returns
7111 true if the provided section is compatible with the region.
7112 (Memory_region::get_last_section): New method. Returns the last
7113 section to use the region.
7114 (Memory_region::set_last_section): New method. Stores the last
7115 section to use the region.
7116 (Script_sections::block_in_region): New method. Returns true if
7117 a block of memory is contained within a region.
7118 (Script_sections::find_memory_region): New method. Locates a
7119 memory region to be used to set a VMA or LMA address.
7120 (Output_section_definition::set_section_addresses): Add code to
7121 check for addresses set by memory regions.
7122 (Output_segment::set_section_addresses): Remove memory region
7123 walking code.
7124 (Script_sections::create_segment): Add a warning if a header
7125 segment is created outside of any region.
7126 * script-sections.h (class Script_sections): Add prototypes for
7127 find_memory_region and block_in_region methods.
7128 * testsuite/memory_test.s: Use .long instead of .word.
7129 * testsuite/memory_test.t: Add some more output sections.
7130 * testsuite/memory_test.sh: Update expected output.
7131
a9bfd952
DK
71322010-10-02 Doug Kwan <dougkwan@google.com>
7133
7134 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7135 defintion to symtab.h
7136 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7137 declaration to defintion.
7138
bacff3ab
NC
71392010-10-01 Nick Clifton <nickc@redhat.com>
7140
7141 * expression.cc (eval): Replace dummy argument with NULL.
7142 (eval_maybe_dot): Check for a NULL result section pointer.
7143 (Symbol_expression::value): Likewise.
7144 (Dot_expression::value): Likewise.
7145 (BINARY_EXPRESSION): Likewise.
7146 (Max_expression::value): Likewise.
7147 (Min_expression::value): Likewise.
7148 (Absolute_expression::value): Likewise.
7149 (Addr_expression::value_from_output_section): Likewise.
7150 (Loaddddr_expression::value_from_output_section): Likewise.
7151 (Segment_start_expression::value): Likewise.
7152 * script-sections.cc
7153 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7154 argument with NULL.
7155 (Sections_elememt_dot_assignment::set_section_addresses):
7156 Likewise.
7157 (Output_data_expression::do_write_to_buffer): Likewise.
7158 (Output_section_definition::finalize_symbols): Likewise.
7159 (Output_section_definition::set_section_addresses): Likewise.
7160
f81bc8b5
DK
71612010-09-30 Doug Kwan <dougkwan@google.com>
7162
7163 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7164
c95e9f27
ST
71652010-09-28 Sriraman Tallam <tmsriram@google.com>
7166
7167 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7168 function.
c95e9f27
ST
7169 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7170 virtual function.
7171 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7172 virtual function.
7173 * icf.cc (get_section_contents): Inline merge sections only when
7174 target allows it.
7175
3cac54d2
RW
71762010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7177
7178 * configure: Regenerate.
7179
2904037a
ILT
71802010-09-17 Ian Lance Taylor <iant@google.com>
7181
7182 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7183 * testsuite/Makefile.am (memory_test.o): New target.
7184 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7185 memory_test.t.
7186 * testsuite/Makefile.in: Rebuild.
2904037a 7187
bca7fb63
DK
71882010-09-17 Doug Kwan <dougkwan@google.com>
7189
7190 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7191 defintion if relocation uses GOT entries of the symbol.
7192 * testsuite/icf_safe_test.sh: Fix test.
7193 * testsuite/icf_safe_so_test.sh: Fix test.
7194
4ef28648
CC
71952010-09-16 Cary Coutant <ccoutant@google.com>
7196
7197 * script_sections.cc (class Memory_region): Remove "NULL" from
7198 vector initializations.
7199
793990de
CC
72002010-09-15 Cary Coutant <ccoutant@google.com>
7201
7202 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7203 Resolve forwarding symbols.
7204
81e015e2
DK
72052010-09-15 Doug Kwan <dougkwan@google.com>
7206
7207 * gold/testsuite/script_test_3.t: Add ARM special sections.
7208 * gold/testsuite/script_test_4.t: Same.
7209 * gold/testsuite/script_test_5.t: Same.
7210 * gold/testsuite/script_test_6.t: Same.
7211 * gold/testsuite/script_test_7.t: Same.
7212 * gold/testsuite/script_test_7.t: Same.
7213 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7214
36171d64
CC
72152010-09-14 Cary Coutant <ccoutant@google.com>
7216
7217 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7218 (Target_x86_64::Relocate::relocate_tls): Replace check for
7219 saw_tls_block_reloc_ with test for executable section.
7220
d89051bd
CC
72212010-09-12 Cary Coutant <ccoutant@google.com>
7222
7223 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7224 position-independent executables to shared libraries need dynamic
7225 relocations.
7226 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7227 position-independent executables.
7228 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7229 * testsuite/Makefile.in: Regenerate.
7230
fca41f0f
NC
72312010-09-10 Nick Clifton <nickc@redhat.com>
7232
7233 PR gold/11997
7234 * testsuite/memory_test.t: Discard any sections that are not
7235 needed.
7236
6695e4b3
L
72372010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7238
7239 PR gold/11996
7240 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7241 "This::" to work around a bug in gcc 4.2.
7242
7243 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7244
0f72bf6f
RÁE
72452010-09-09 Rafael Espindola <espindola@google.com>
7246
7247 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7248 sections with different PF_X flags in the same segment.
7249 (Layout::find_first_load_seg): Search all segments to find the first
7250 one.
7251 * options.h (rosegment): New.
7252
72532010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7254
05a79166 7255 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7256
aa98ff75
DK
72572010-09-08 Doug Kwan <dougkwan@google.com>
7258
7259 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7260 (Arm_relobj::do_relocate_sections): Add new parameter for output
7261 file to match the parent.
7262 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7263 of local symbols instead of input values. Update code to track
7264 changes in gold::relocate_section.
7265 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7266 (Sized_relobj::compute_final_local_value_internal): New methods.
7267 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7268 body into private version of Sized_relobj::compute_final_local_value.
7269 Call the inline method.
7270 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7271 merged symbol value if there is one.
7272 (Symbol_value::has_output_value): New method defintiion.
7273 (Sized_relobj::Compute_final_local_value_status): New enum type.
7274 (Sized_relobj::compute_final_local_value): New methods.
7275 (Sized_relobj::compute_final_local_value_internal): New methods.
7276 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7277 and arm_cortex_a8.sh.
7278 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7279 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7280 New tests.
7281 * Makefile.in: Regenerate.
7282 * testsuite/arm_bl_out_of_range.s: Update test.
7283 * testsuite/thumb_bl_out_of_range.s: Ditto.
7284 * testsuite/thumb_blx_out_of_range.s: Ditto.
7285 * testsuite/arm_branch_out_of_range.sh: New file.
7286 * testsuite/arm_cortex_a8.sh: Ditto.
7287 * testsuite/arm_cortex_a8_b.s: Ditto.
7288 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7289 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7290 * testsuite/arm_cortex_a8_bl.s: Ditto.
7291 * testsuite/arm_cortex_a8_blx.s: Ditto.
7292 * testsuite/arm_cortex_a8_local.s: Ditto.
7293 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7294 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7295
05a79166
L
72962010-09-08 Rafael Espindola <espindola@google.com>
7297
7298 * Makefile.am (memory_test.stdout): Run readelf with -W.
7299 * Makefile.in: Regenerate.
7300 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7301 64 bit output.
7302
33dbc701
RÁE
73032010-09-08 Rafael Espindola <espindola@google.com>
7304
7305 * script-sections.cc (Script_sections::add_memory_region): Convert
7306 field precision to int.
7307 * script.cc (script_set_section_region, script_set_section_region):
7308 Convert field precision to int.
7309
731ca54a
RÁE
73102010-09-08 Rafael Espindola <espindola@google.com>
7311
7312 * arm.cc (do_finalize_sections): Create the __exidx_start and
7313 __exdix_end symbols even when the section is missing.
7314
7f8cd844
NC
73152010-09-08 Nick Clifton <nickc@redhat.com>
7316
7317 * README: Remove claim that MEMORY is not supported.
7318 * expression.cc (script_exp_function_origin)
7319 (script_exp_function_length): Move from here to ...
7320 * script.cc: ... here.
7321 (script_set_section_region, script_add_memory)
7322 (script_parse_memory_attr, script_include_directive): New
7323 functions.
7324 * script-sections.cc
7325 (class Memory_region): New class.
7326 (class Output_section_definition): Add set_memory_region,
7327 set_section_vma, set_section_lma and get_section_name methods.
7328 (class Script_Sections): Add add_memory_region,
7329 find_memory_region, find_memory_region_origin,
7330 find_memory_region_length and set_memory_region methods.
7331 Have set_section_addresses method walk the list of set memory
7332 regions.
7333 Extend the print methos to display memory regions.
7334 * script-sections.h: Add prototypes for new methods.
7335 Add enum for MEMORY region attributes.
7336 * yyscript.y: Add support for parsing MEMORY regions.
7337 * script-c.h: Add prototypes for new functions.
7338 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7339 * testsuite/Makefile.in: Regenerate.
7340 * testsuite/memory_test.sh: New script.
7341 * testsuite/memory_test.s: New assembler source file.
7342 * testsuite/memory_test.t: New linker script.
7343
a4649286
DK
73442010-08-27 Doug Kwan <dougkwan@google.com>
7345
7346 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7347 reference override an existing dynamic weak reference.
7348 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7349 * testsuite/Makefile.in: Regenerate.
7350 * testsuite/dyn_weak_ref.sh: New file.
7351 * testsuite/dyn_weak_ref_1.c: Ditto.
7352 * testsuite/dyn_weak_ref_2.c: Ditto.
7353
b56648ad
ILT
73542010-08-27 Ian Lance Taylor <iant@google.com>
7355
7356 * incremental.h (class Incremental_input_entry): Add virtual
7357 destructor.
7358
809313cb
ILT
73592010-08-27 Ian Lance Taylor <iant@google.com>
7360
7361 * testsuite/start_lib_test_3.c: Mark t3 as used.
7362
11e32464
NC
73632010-08-27 Nick Clifton <nickc@redhat.com>
7364
7365 * options.cc (version_script): Fix small typo in previous
7366 whitespace tidyup.
7367
ca09d69a
NC
73682010-08-25 Nick Clifton <nickc@redhat.com>
7369
7370 * archive.cc: Formatting fixes: Remove whitespace between
7371 typename and following asterisk. Remove whitespace between
7372 function name and opening parenthesis.
7373 * archive.h: Likewise.
7374 * arm.cc: Likewise.
7375 * attributes.cc: Likewise.
7376 * attributes.h: Likewise.
7377 * common.cc: Likewise.
7378 * copy-relocs.cc: Likewise.
7379 * dirsearch.h: Likewise.
7380 * dynobj.cc: Likewise.
7381 * ehframe.cc: Likewise.
7382 * ehframe.h: Likewise.
7383 * expression.cc: Likewise.
7384 * fileread.cc: Likewise.
7385 * fileread.h: Likewise.
7386 * gc.h: Likewise.
7387 * gold-threads.cc: Likewise.
7388 * gold.cc: Likewise.
7389 * i386.cc: Likewise.
7390 * icf.h: Likewise.
7391 * incremental-dump.cc: Likewise.
7392 * incremental.cc: Likewise.
7393 * layout.cc: Likewise.
7394 * layout.h: Likewise.
7395 * main.cc: Likewise.
7396 * merge.cc: Likewise.
7397 * merge.h: Likewise.
7398 * object.cc: Likewise.
7399 * object.h: Likewise.
7400 * options.cc: Likewise.
7401 * options.h: Likewise.
7402 * output.cc: Likewise.
7403 * output.h: Likewise.
7404 * plugin.cc: Likewise.
7405 * plugin.h: Likewise.
7406 * powerpc.cc: Likewise.
7407 * reloc.cc: Likewise.
7408 * script-c.h: Likewise.
7409 * script-sections.cc: Likewise.
7410 * script.cc: Likewise.
7411 * stringpool.cc: Likewise.
7412 * symtab.cc: Likewise.
7413 * symtab.h: Likewise.
7414 * target.cc: Likewise.
7415 * timer.cc: Likewise.
7416 * timer.h: Likewise.
7417 * version.cc: Likewise.
7418 * x86_64.cc: Likewise.
7419
b8fa8750
NC
74202010-08-24 Nick Clifton <nickc@redhat.com>
7421
7422 PR 11899
7423 * layout.cc (segment_precedes): Sort segments by their physical
7424 addresses, if they have been set.
7425
9919d93b
CC
74262010-08-23 Cary Coutant <ccoutant@google.com>
7427
7428 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7429 symbols data.
7430 (Lib_group::include_member): Unlock object after deleting its
7431 symbols data.
7432 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7433 the bug fixed here.
7434
97b4be1c
CC
74352010-08-19 Neil Vachharajani <nvachhar@google.com>
7436 Cary Coutant <ccoutant@google.com>
7437
7438 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7439 constructor, and set_blocker.
7440 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7441 readsyms_blocker_.
7442 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7443 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7444 * testsuite/Makefile.am (start_lib_test): New test case.
7445 * testsuite/Makefile.in: Regenerate.
7446 * testsuite/start_lib_test_main.c: New file.
7447 * testsuite/start_lib_test_1.c: New file.
7448 * testsuite/start_lib_test_2.c: New file.
7449 * testsuite/start_lib_test_3.c: New file.
7450
dd0b1884
ILT
74512010-08-19 Ian Lance Taylor <iant@google.com>
7452
7453 * Makefile.in: Rebuild with automake 1.11.1.
7454 * aclocal.m4: Likewise.
7455 * testsuite/Makefile.in: Likewise.
7456
7223e9ca
ILT
74572010-08-19 Ian Lance Taylor <iant@google.com>
7458
7459 PR 10893
7460 * i386.cc (class Output_data_plt_i386): Update declarations.
7461 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7462 local_ifuncs_ fields.
7463 (Target_i386::do_plt_section_for_global): New function.
7464 (Target_i386::do_plt_section_for_local): New function.
7465 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7466 parameter; change all callers. Initialize global_ifuncs_ and
7467 local_ifuncs_. If doing a static link define __rel_iplt_start and
7468 __rel_iplt_end.
7469 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7470 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7471 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7472 symbols.
7473 (Target_i386::make_plt_section): New function, broken out of
7474 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7475 (Target_i386::make_plt_entry): Call make_plt_section.
7476 (Target_i386::make_local_ifunc_plt_entry): New function.
7477 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7478 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7479 R_386_IRELATIVE to switch.
7480 (Target_i386::Scan::global): Likewise.
7481 (Target_i386::Relocate::relocate): Likewise.
7482 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7483 switch.
7484 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7485 (Target_x86_64::do_plt_section_for_global): New function.
7486 (Target_x86_64::do_plt_section_for_local): New function.
7487 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7488 parameter; change all callers. If doing a static link define
7489 __rela_iplt_start and __rela_iplt_end.
7490 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7491 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7492 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7493 to point to .plt.
7494 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7495 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7496 switch.
7497 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7498 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7499 R_X86_64_IRELATIVE to switch.
7500 (Target_x86_64::Scan::global): Likewise.
7501 (Target_x86_64::Relocate::relocate): Likewise.
7502 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7503 switch.
7504 * target.h (class Target): Add plt_section_for_global and
7505 plt_section_for_local functions. Add do_plt_section_for_global
7506 and do_plt_section_for_local virtual functions.
7507 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7508 clarifying comments.
7509 (Symbol::use_plt_offset): Handle IFUNC symbol.
7510 * object.cc (Sized_relobj::Sized_relobj): Initialize
7511 local_plt_offsets_.
7512 (Sized_relobj::local_has_plt_offset): New function.
7513 (Sized_relobj::local_plt_offset): New function.
7514 (Sized_relobj::set_local_plt_offset): New function.
7515 (Sized_relobj::do_count): Handle IFUNC symbol.
7516 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7517 a bit away from input_shndx_ field. Add set_is_func_symbol and
7518 is_ifunc_symbol functions.
7519 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7520 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7521 local_plt_offsets_ field.
7522 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7523 * output.h (class Output_section_data): Add non-const
7524 output_section function.
7525 (class Output_data_got): Update declarations.
7526 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7527 Add use_plt_offset parameter to global and local constructors.
7528 Change all callers. Change local_sym_index_ field to 31 bits.
7529 Change GSYM_CODE and CONSTANT_CODE accordingly.
7530 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7531 doing a static link don't set sh_link field.
7532 (Output_data_got::Got_entry::write): Use PLT offset if
7533 appropriate.
7534 (Output_data_got::add_global_plt): New function.
7535 (Output_data_got::add_local_plt): New function.
7536 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7537 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7538 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7539 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7540 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7541 IFUNC conditional.
7542 * testsuite/ifunc-sel.h: New file.
7543 * testsuite/ifuncmain1.c: New file.
7544 * testsuite/ifuncmain1vis.c: New file.
7545 * testsuite/ifuncmod1.c: New file.
7546 * testsuite/ifuncdep2.c: New file.
7547 * testsuite/ifuncmain2.c: New file.
7548 * testsuite/ifuncmain3.c: New file.
7549 * testsuite/ifuncmod3.c: New file.
7550 * testsuite/ifuncmain4.c: New file.
7551 * testsuite/ifuncmain5.c: New file.
7552 * testsuite/ifuncmod5.c: New file.
7553 * testsuite/ifuncmain6pie.c: New file.
7554 * testsuite/ifuncmod6.c: New file.
7555 * testsuite/ifuncmain7.c: New file.
7556 * configure, testsuite/Makefile.in: Rebuild.
7557
56f75c03
ILT
75582010-08-18 Ian Lance Taylor <iant@google.com>
7559
7560 * incremental.cc
7561 (Output_section_incremental_inputs::write_input_files): Add cast
7562 to avoid signed/unsigned comparison warning.
7563 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7564
55455f89
CC
75652010-08-12 Cary Coutant <ccoutant@google.com>
7566
7567 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7568
e2054bcb
ILT
75692010-08-13 Ian Lance Taylor <iant@google.com>
7570
7571 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7572
74f67560
DK
75732010-08-12 Cary Coutant <ccoutant@google.com>
7574 Doug Kwan <dougkwan@google.com>
7575
7576 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7577 defintion overrides non-weak undef, remember that the original undef
7578 is not weak.
7579 * symtab.cc (Symbol_table::sized_write_global): For undef without
7580 an original weak binding, set binding to global in output.
7581 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7582 * testsuite/Makefile.in: Regenerate.
7583 * testsuite/strong_ref_weak_def.sh: New file.
7584 * testsuite/strong_ref_weak_def_1.c: Ditto.
7585 * testsuite/strong_ref_weak_def_2.c: Ditto.
7586
d1238d12
CC
75872010-08-12 Cary Coutant <ccoutant@google.com>
7588
7589 * testsuite/incremental_test.sh: Rewrite.
7590 * testsuite/incremental_test_1.c: Rewrite.
7591 * testsuite/incremental_test_2.c: Rewrite.
7592
0e70b911
CC
75932010-08-12 Cary Coutant <ccoutant@google.com>
7594
7595 * arm.cc (Target_arm::got_size): Add const.
7596 (Target_arm::got_entry_count): New function.
7597 (Target_arm::plt_entry_count): New function.
7598 (Target_arm::first_plt_entry_offset): New function.
7599 (Target_arm::plt_entry_size): New function.
7600 (Output_data_plt_arm::entry_count): New function.
7601 (Output_data_plt_arm::first_plt_entry_offset): New function.
7602 (Output_data_plt_arm::get_plt_entry_size): New function.
7603 * i386.cc (Target_i386::got_size): Add const.
7604 (Target_i386::got_entry_count): New function.
7605 (Target_i386::plt_entry_count): New function.
7606 (Target_i386::first_plt_entry_offset): New function.
7607 (Target_i386::plt_entry_size): New function.
7608 (Output_data_plt_i386::entry_count): New function.
7609 (Output_data_plt_i386::first_plt_entry_offset): New function.
7610 (Output_data_plt_i386::get_plt_entry_size): New function.
7611 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7612 find_incremental_inputs_sections. Dump incremental_got_plt section.
7613 * incremental.cc: Include target.h.
7614 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7615 parameter. Adjust all callers. Find incremental_got_plt section.
7616 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7617 section.
7618 (Output_section_incremental_inputs::set_final_data_size): Calculate
7619 size of incremental_got_plt section.
7620 (Output_section_incremental_inputs::do_write): Write the
7621 incremental_got_plt section.
7622 (Got_plt_view_info): New struct.
7623 (Local_got_offset_visitor): New class.
7624 (Global_got_offset_visitor): New class.
7625 (Global_symbol_visitor_got_plt): New class.
7626 (Output_section_incremental_inputs::write_got_plt): New function.
7627 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7628 Add parameter. Adjust all callers.
7629 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7630 (Incremental_inputs::got_plt_section): New function.
7631 (Incremental_inputs::got_plt_section_): New data member.
7632 (Incremental_got_plt_reader): New class.
7633 * layout.cc (Layout::create_incremental_info_sections): Add the
7634 incremental_got_plt section.
7635 * object.h (Got_offset_list::get_list): New function.
7636 (Got offset_list::for_all_got_offsets): New function.
7637 (Sized_relobj::local_got_offset_list): New function.
7638 * powerpc.cc (Target_powerpc::got_size): Add const.
7639 (Target_powerpc::got_entry_count): New function.
7640 (Target_powerpc::plt_entry_count): New function.
7641 (Target_powerpc::first_plt_entry_offset): New function.
7642 (Target_powerpc::plt_entry_size): New function.
7643 (Output_data_plt_powerpc::entry_count): New function.
7644 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7645 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7646 * sparc.cc (Target_sparc::got_size): Add const.
7647 (Target_sparc::got_entry_count): New function.
7648 (Target_sparc::plt_entry_count): New function.
7649 (Target_sparc::first_plt_entry_offset): New function.
7650 (Target_sparc::plt_entry_size): New function.
7651 (Output_data_plt_sparc::entry_count): New function.
7652 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7653 (Output_data_plt_sparc::get_plt_entry_size): New function.
7654 * symtab.h (Symbol::got_offset_list): New function.
7655 (Symbol_table::for_all_symbols): New function.
7656 * target.h (Sized_target::got_entry_count): New function.
7657 (Sized_target::plt_entry_count): New function.
7658 (Sized_target::plt_entry_size): New function.
7659 * x86_64.cc (Target_x86_64::got_size): Add const.
7660 (Target_x86_64::got_entry_count): New function.
7661 (Target_x86_64::plt_entry_count): New function.
7662 (Target_x86_64::first_plt_entry_offset): New function.
7663 (Target_x86_64::plt_entry_size): New function.
7664 (Output_data_plt_x86_64::entry_count): New function.
7665 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7666 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7667
09ec0418
CC
76682010-08-12 Cary Coutant <ccoutant@google.com>
7669
7670 * archive.cc: Include incremental.h.
7671 (Archive::Archive): Initialize incremental_info_.
7672 (Archive::include_member): Record archive members in incremental info.
7673 (Add_archive_symbols::run): Record begin and end of an archive in
7674 incremental info.
7675 (Lib_group::include_member): Record objects in incremental info.
7676 * archive.h (Incremental_archive_entry): Forward declaration.
7677 (Archive::set_incremental_info): New member function.
7678 (Archive::incremental_info): New member function.
7679 (Archive::Unused_symbol_iterator): New class.
7680 (Archive::unused_symbols_begin): New member function.
7681 (Archive::unused_symbols_end): New member function.
7682 (Archive::incremental_info_): New data member.
7683 * incremental-dump.cc (find_input_containing_global): New function.
7684 (dump_incremental_inputs): Dump new incremental info sections.
7685 * incremental.cc: Include symtab.h.
7686 (Output_section_incremental_inputs): New class.
7687 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7688 new incremental info sections.
7689 (Sized_incremental_binary::do_check_inputs): Likewise.
7690 (Incremental_inputs::report_archive): Remove.
7691 (Incremental_inputs::report_archive_begin): New function.
7692 (Incremental_inputs::report_archive_end): New function.
7693 (Incremental_inputs::report_object): New function.
7694 (Incremental_inputs::finalize_inputs): Remove.
7695 (Incremental_inputs::report_input_section): New function.
7696 (Incremental_inputs::report_script): Rewrite.
7697 (Incremental_inputs::finalize): Do nothing but finalize string table.
7698 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7699 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7700 (Incremental_inputs::create_data_sections): New function.
7701 (Incremental_inputs::relocs_entsize): New function.
7702 (Output_section_incremental_inputs::set_final_data_size): New function.
7703 (Output_section_incremental_inputs::do_write): New function.
7704 (Output_section_incremental_inputs::write_header): New function.
7705 (Output_section_incremental_inputs::write_input_files): New function.
7706 (Output_section_incremental_inputs::write_info_blocks): New function.
7707 (Output_section_incremental_inputs::write_symtab): New function.
7708 * incremental.h (Incremental_script_entry): Forward declaration.
7709 (Incremental_object_entry): Forward declaration.
7710 (Incremental_archive_entry): Forward declaration.
7711 (Incremental_inputs): Forward declaration.
7712 (Incremental_inputs_header_data): Remove.
7713 (Incremental_inputs_header): Remove.
7714 (Incremental_inputs_header_write): Remove.
7715 (Incremental_inputs_entry_data): Remove.
7716 (Incremental_inputs_entry): Remove.
7717 (Incremental_inputs_entry_write): Remove.
7718 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7719 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7720 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7721 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7722 Likewise.
7723 (Incremental_input_entry): New class.
7724 (Incremental_script_entry): New class.
7725 (Incremental_object_entry): New class.
7726 (Incremental_archive_entry): New class.
7727 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7728 (Incremental_inputs::report_inputs): Remove.
7729 (Incremental_inputs::report_archive): Remove.
7730 (Incremental_inputs::report_archive_begin): New function.
7731 (Incremental_inputs::report_archive_end): New function.
7732 (Incremental_inputs::report_object): Change prototype.
7733 (Incremental_inputs::report_input_section): New function.
7734 (Incremental_inputs::report_script): Change prototype.
7735 (Incremental_inputs::get_reloc_count): New function.
7736 (Incremental_inputs::set_reloc_count): New function.
7737 (Incremental_inputs::create_data_sections): New function.
7738 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7739 (Incremental_inputs::inputs_section): New function.
7740 (Incremental_inputs::symtab_section): New function.
7741 (Incremental_inputs::relocs_section): New function.
7742 (Incremental_inputs::get_stringpool): Add const.
7743 (Incremental_inputs::command_line): Add const.
7744 (Incremental_inputs::inputs): Remove.
7745 (Incremental_inputs::command_line_key): New function.
7746 (Incremental_inputs::input_file_count): New function.
7747 (Incremental_inputs::input_files): New function.
7748 (Incremental_inputs::relocs_entsize): New function.
7749 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7750 (Incremental_inputs::finalize_inputs): Remove.
7751 (Incremental_inputs::Input_info): Remove.
7752 (Incremental_inputs::lock_): Remove.
7753 (Incremental_inputs::inputs_): Change type.
7754 (Incremental_inputs::inputs_map_): Remove.
7755 (Incremental_inputs::current_object_entry_): New data member.
7756 (Incremental_inputs::inputs_section_): New data member.
7757 (Incremental_inputs::symtab_section_): New data member.
7758 (Incremental_inputs::relocs_section_): New data member.
7759 (Incremental_inputs::reloc_count_): New data member.
7760 (Incremental_inputs_reader): New class.
7761 (Incremental_symtab_reader): New class.
7762 (Incremental_relocs_reader): New class.
7763 * layout.cc (Layout::finalize): Move finalization of incremental info
7764 and creation of incremental info sections to follow finalization of
7765 symbol table. Set offsets for postprocessing sections.
7766 (Layout::create_incremental_info_sections): Call
7767 Incremental_inputs::create_data_sections. Add incremental symtab
7768 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7769 sections to layout after input sections.
7770 * layout.h (struct Timespec): Forward declaration.
7771 (Layout::incremental_inputs): Add const.
7772 (Layout::create_incremental_info_sections): Add parameter.
7773 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7774 * object.cc: Include incremental.h.
7775 (Relobj::finalize_incremental_relocs): New function.
7776 (Sized_relobj::do_layout): Record input sections in incremental info.
7777 * object.h (Object::output_section): New function.
7778 (Object::output_section_offset): Moved from Relobj.
7779 (Object::get_incremental_reloc_base): New function.
7780 (Object::get_incremental_reloc_count): New function.
7781 (Object::do_output_section): New function.
7782 (Object::do_output_section_offset): Moved from Relobj.
7783 (Object::do_get_incremental_reloc_base): New function.
7784 (Object::do_get_incremental_reloc_count): New function.
7785 (Object::Object): Initialize new data members.
7786 (Relobj::output_section): Renamed do_output_section and moved to
7787 protected.
7788 (Relobj::output_section_offset): Moved to Object.
7789 (Relobj::do_get_incremental_reloc_base): New function.
7790 (Relobj::do_get_incremental_reloc_count): New function.
7791 (Relobj::allocate_incremental_reloc_counts): New function.
7792 (Relobj::count_incremental_reloc): New function.
7793 (Relobj::finalize_incremental_relocs): New function.
7794 (Relobj::next_incremental_reloc_index): New function.
7795 (Relobj::reloc_counts_): New data member.
7796 (Relobj::reloc_bases_): New data member.
7797 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7798 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7799 (Sized_relobj::incremental_relocs_scan): New function.
7800 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7801 (Sized_relobj::incremental_relocs_write): New function.
7802 (Sized_relobj::incremental_relocs_write_reltype): New function.
7803 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7804 incremental link.
7805 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7806 archives and object files elsewhere.
7807 (Add_symbols::run): Report object files here.
7808 (Finish_group::run): Report end of archive at end of group.
7809 * reloc.cc: Include layout.h, incremental.h.
7810 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7811 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7812 (Sized_relobj::incremental_relocs_scan): New function.
7813 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7814 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7815 (Sized_relobj::incremental_relocs_write): New function.
7816 (Sized_relobj::incremental_relocs_write_reltype): New function.
7817 * script.cc (read_input_script): Rewrite test for incremental link.
7818 Change call to Incremental_inputs::report_script.
7819 * symtab.h (Symbol_table::first_global_index): New function.
7820 (Symbol_table::output_count): New function.
7821
ce0d1972
DK
78222010-08-12 Doug Kwan <dougkwan@google.com>
7823
7824 * arm.cc (Target_arm::merge_object_attributes): Check command line
7825 options --no-wchar-size-warning and --no-enum-size-warning.
7826 * options.h (General_options): Add ld-compatible options
7827 --no-enum-size-warning and --no-wchar-size-warning.
7828
6e5710ce
ILT
78292010-08-04 Ian Lance Taylor <iant@google.com>
7830
7831 * x86_64.cc (Target_x86_64::Scan::local): Use
7832 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7833 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7834 (Target_x86_64::Scan::global): Likewise.
7835 (Target_x86_64::Relocate::relocate): Likewise.
7836 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7837 Likewise.
7838
fef830db
CC
78392010-08-03 Cary Coutant <ccoutant@google.com>
7840
7841 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7842 to reserve space in merged_strings vector. Keep total input size
7843 for stats.
7844 (Output_merge_string::do_print_merge_stats): Print total input size.
7845 * merge.h (Output_merge_string): Add input_size_ field.
7846 * stringpool.cc (Stringpool_template::string_length): Move
7847 implementations out of Stringpool_template class and place in
7848 stringpool.h.
7849 * stringpool.h (string_length): Move out of Stringpool_template.
7850
1e3811b0
ILT
78512010-08-03 Ian Lance Taylor <iant@google.com>
7852
7853 PR 11712
7854 * layout.cc (relaxation_loop_body): If address of load segment is
7855 set, adjust address to include headers if possible.
7856
7af0c620
ILT
78572010-08-03 Ian Lance Taylor <iant@google.com>
7858
7859 * version.cc (version_string): Bump to 1.10.
7860
22f0da72
ILT
78612010-08-03 Ian Lance Taylor <iant@google.com>
7862
7863 PR 11805
7864 * layout.h (enum Output_section_order): Define.
7865 (class Layout): Update declarations.
7866 * layout.cc (Layout::get_output_section): Add order parameter.
7867 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7868 is_first_non_relro parameters. Change all callers.
7869 (Layout::choose_output_section): Likewise.
7870 (Layout::add_output_section_data): Likewise.
7871 (Layout::make_output_section): Likewise. Set order.
7872 (Layout::default_section_order): New function.
7873 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7874 * output.cc (Output_section::Output_section): Initialize order_.
7875 Don't initialize deleted fields.
7876 (Output_segment::Output_segment): Don't initialize deleted
7877 fields.
7878 (Output_segment::add_output_section_to_load): New function
7879 replacing add_output_section. Change all callers to call this or
7880 add_output_section_to_nonload.
7881 (Output_segment::add_output_section_to_nonload): New function.
7882 (Output_segment::remove_output_section): Rewrite.
7883 (Output_segment::add_initial_output_data): Likewise.
7884 (Output_segment::has_any_data_sections): Likewise.
7885 (Output_segment::is_first_section_relro): Likewise.
7886 (Output_segment::maximum_alignment): Likewise.
7887 (Output_segment::has_dynamic_reloc): New function replacing
7888 dynamic_reloc_count. Change all callers.
7889 (Output_segment::has_dynamic_reloc_list): New function replacing
7890 dynamic_reloc_count_list. Change all callers.
7891 (Output_segment::set_section_addresses): Rewrite.
7892 (Output_segment::set_offset): Rewrite.
7893 (Output_segment::find_first_and_last_list): Remove.
7894 (Output_segment::set_tls_offsets): Rewrite.
7895 (Output_segment::first_section_load_address): Likewise.
7896 (Output_segment::output_section_count): Likewise.
7897 (Output_segment::section_with_lowest_load_address): Likewise.
7898 (Output_segment::write_section_headers): Likewise.
7899 (Output_segment::print_sections_to_map): Likewise.
7900 * output.h (class Output_data): Remove dynamic_reloc_count_
7901 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7902 (Output_data::add_dynamic_reloc): Rewrite.
7903 (Output_data::has_dynamic_reloc): New function.
7904 (Output_data::dynamic_reloc_count): Remove.
7905 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7906 is_last_relro_, is_first_non_relro_, is_interp_,
7907 is_dynamic_linker_section_ fields. Add order and set_order
7908 functions. Remove is_relro_local, set_is_relro_local,
7909 is_last_relro, set_is_last_relro, is_first_non_relro,
7910 set_is_first_non_relro functions, is_interp, set_is_interp,
7911 is_dynamic_linker_section, and set_is_dynamic_linker_section
7912 functions.
7913 (class Output_segment): Change Output_data_list from std::list to
7914 std:;vector. Add output_lists_ field. Remove output_data_ and
7915 output_bss_ fields. Update declarations.
7916
3ff2ccb0
ILT
79172010-08-02 Ian Lance Taylor <iant@google.com>
7918
7919 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7920 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7921 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7922
88a4108b
ILT
79232010-08-02 Ian Lance Taylor <iant@google.com>
7924
7925 PR 11855
7926 * script.cc (Script_options::Script_options): Initialize
7927 symbol_definitions_ and symbol_references_.
7928 (Script_options::add_symbol_assignment): Update
7929 symbol_definitions_ and symbol_references_.
7930 (Script_options::add_symbol_reference): New function.
7931 (script_symbol): New function.
7932 * script.h (class Script_options): Add symbol_definitions_ and
7933 symbol_references_ fields.
7934 (Script_options::referenced_const_iterator): New type.
7935 (Script_options::referenced_begin): New function.
7936 (Script_options::referenced_end): New function.
7937 (Script_options::is_referenced): New function.
7938 (Script_options::any_unreferenced): New function.
7939 * script-c.h (script_symbol): Declare.
7940 * yyscript.y (exp): Call script_symbol.
7941 * symtab.cc: Include "script.h".
7942 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7943 Change all callers. Check symbols referenced by scripts.
7944 (Symbol_table::add_undefined_symbols_from_command_line): Add
7945 layout parameter. Change all callers.
7946 (Symbol_table::do_add_undefined_symbols_from_command_line):
7947 Likewise. Break out loop body. Check symbols referenced by
7948 scripts.
7949 (Symbol_table::add_undefined_symbol_from_command_line): New
7950 function broken out of
7951 do_add_undefined_symbols_from_command_line.
7952 * symtab.h (class Symbol_table): Update declarations.
7953 * archive.cc: Include "layout.h".
7954 (Archive::should_include_member): Add layout parameter. Change
7955 all callers. Check for symbol mentioned in expression.
7956 * archive.h (class Archive): Update declaration.
7957 * object.cc (Sized_relobj::do_should_include_member): Add layout
7958 parameter.
7959 * object.h (Object::should_include_member): Add layout parameter.
7960 Change all callers.
7961 (Object::do_should_include_member): Add layout parameter.
7962 (class Sized_relobj): Update declaration.
7963 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7964 parameter.
7965 * dynobj.h (class Sized_dynobj): Update declaration.
7966 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7967 layout parameter.
7968 * plugin.h (class Sized_pluginobj): Update declaration.
7969
5f1ab67a
ILT
79702010-08-02 Ian Lance Taylor <iant@google.com>
7971
7972 PR 11866
7973 * output.cc (Output_segment::set_offset): Search for the first and
7974 last sections rather than assuming that the list is in order.
7975 (Output_segment::find_first_and_last_list): New function.
7976 * output.h (class Output_segment): Update declarations.
7977 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7978 (relro_strip_test_SOURCES): New variable.
7979 (relro_strip_test_DEPENDENCIES): New variable.
7980 (relro_strip_test_LDFLAGS): New variable.
7981 (relro_strip_test_LDADD): New variable.
7982 (relro_strip_test.so): New target.
7983
a8df5856
ILT
79842010-08-02 Ian Lance Taylor <iant@google.com>
7985
7986 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7987 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7988 (Target_i386::got_tlsdesc_section): New function.
7989 (Target_i386::got_section): Create space for GOT entries for
7990 TLSDESC relocations.
7991 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7992 R_386_TLS_GOTDESC.
7993 (Target_i386::Scan::global): Likewise.
7994 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7995 using TLSDESC GOT.
7996 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7997 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7998 (Target_x86_64::got_tlsdesc_section): New function.
7999 (Target_x86_64::got_section): Create space for GOT entries for
8000 TLSDESC relocations.
8001 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8002 R_386_TLS_GOTDESC.
8003 (Target_x86_64::Scan::global): Likewise.
8004 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8005 using TLSDESC GOT.
8006
0c10a0a6
ILT
80072010-08-02 Ian Lance Taylor <iant@google.com>
8008
8009 * testsuite/final_layout.sh: Use dc to convert from hex to
8010 decimal.
8011
41cbeecc
ST
80122010-07-29 Sriraman Tallam <tmsriram@google.com>
8013
8014 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8015 paramter to the call to gold::gc_process_relocs.
8016 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8017 paramter to the call to gold::gc_process_relocs.
8018 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8019 parameter to the call to gold::gc_process_relocs.
8020 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8021 template parameter to the call to gold::gc_process_relocs.
8022 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8023 paramter to the call to gold::gc_process_relocs.
8024 * gc.h (get_embedded_addend_size): New function.
8025 (gc_process_relocs): Save the size of the reloc for use by ICF.
8026 * icf.cc (get_section_contents): Get the addend from the text section
8027 for SHT_REL relocation sections.
8028 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8029 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8030 * int_encoding.h (read_from_pointer): New overloaded function.
8031 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8032 * testsuite/icf_sht_rel_addend_test.sh: New file.
8033 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8034 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8035
6ea55b82
RW
80362010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8037
8038 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8039 * Makefile.in: Regenerate.
8040 * testsuite/Makefile.in: Regenerate.
8041
9691462b
ILT
80422010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8043
8044 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8045 * gold/testsuite/debug_msg.cc: Likewise.
8046 * gold/testsuite/odr_violation1.cc
8047 * gold/testsuite/odr_violation2.cc
8048
76897331
CC
80492010-07-21 Cary Coutant <ccoutant@google.com>
8050
8051 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8052 string, and length fields.
8053 (Output_merge_string::Merged_strings_list): New type.
8054 (Output_merge_string::Merged_strings_lists): New typedef.
8055 (Output_merge_string): Replace merged_strings_ with
8056 merged_strings_lists_.
8057 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8058 Merged_strings_list per input object and section. Don't store pointer
8059 to the string. Don't store length with each merged string entry.
8060 (Output_merge_string::finalize_merged_data): Loop over list of merged
8061 strings lists. Recompute length of each merged string.
8062
78384e8f
CC
80632010-07-15 Cary Coutant <ccoutant@google.com>
8064
8065 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8066 here.
8067
783659f9
ILT
80682010-07-14 Ian Lance Taylor <iant@google.com>
8069
8070 * descriptors.cc (Descriptors::open): Report correct name in error
8071 message.
8072
131687b4
DK
80732010-07-13 Doug Kwan <dougkwan@google.com>
8074
8075 * arm.cc (Arm_input_section::Arm_input_section): For a
8076 SHT_ARM_EXIDX section, always keeps the input sections.
8077 (Arm_input_section::set_exidx_section_link): New method.
8078 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8079 has_errors_ to false.
8080 (Arm_exidx_input_section::has_errors,
8081 Arm_exidx_input_section::set_has_errors): New methods.
8082 (Arm_exidx_input_section::has_errors_): New data member.
8083 (Arm_relobj::get_exidx_shndx_list): New method.
8084 (Arm_output_section::append_text_sections_to_list): Do not skip
8085 section without SHF_EXECINSTR.
8086 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8087 errors.
2e702c99 8088 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8089 section header. Make error messages more verbose. Check for
8090 a non-executable section linked to an EXIDX section.
8091 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8092 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8093 check that there is no deferred EXIDX section if we exit early.
8094 Instead of not making an EXIDX section in case of an error, make one
8095 and set the has_errors flag of it.
8096 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8097 in a relocatable link.
8098 (Target_arm::do_relax): Look for the EXIDX output section instead of
8099 assuming that it is called .ARM.exidx.
2e702c99 8100 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8101 section list. Do not check for SHF_EXECINSTR section flags but
8102 skip any input section with errors.
8103 * output.cc (Output_section::Output_section): Initialize
8104 always_keeps_input_sections_ to false.
8105 (Output_section::add_input_section): Check for
8106 always_keeps_input_sections_.
8107 * output.h (Output_section::always_keeps_input_sections,
8108 Output_section::set_always_keeps_input_sections): New methods.
8109 (Output_section::always_keeps_input_sections): New data member.
8110
69517287
RÁE
81112010-07-13 Rafael Espindola <espindola@google.com>
8112
8113 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8114 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8115
82742395
ILT
81162010-07-13 Philip Herron <herron.philip@googlemail.com>
8117 Ian Lance Taylor <iant@google.com>
8118
8119 * output.h (Output_section_lookup_maps::add_merge_section):
8120 Correct check of whether value was inserted.
8121 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8122 (Output_section_lookup_maps::add_relaxed_input_section):
8123 Likewise.
8124 * arm.cc (Target_arm::got_section): Remove used local os.
8125 * i386.cc (Target_i386::got_section): Likewise.
8126 * x86_64.cc (Target_x86_64::got_section): Likewise.
8127 * sparc.cc (Target_sparc::got_section): Likewise.
8128 (Target_sparc::relocate): Remove unused local have_got_offset.
8129 * powerpc.cc (Target_powerpc::relocate): Likewise.
8130
f2d707b5
ILT
81312010-07-13 Ian Lance Taylor <iant@google.com>
8132
241531d6
ILT
8133 * compressed_output.cc (zlib_decompress): Fix signature in
8134 !HAVE_ZLIB_H case.
8135
f2d707b5
ILT
8136 * archive.cc (Archive::include_member): Unlock an external member
8137 of a thin archive. Don't bother to delete an object we know is
8138 NULL.
8139
a2e47362
CC
81402010-07-12 Cary Coutant <ccoutant@google.com>
8141
8142 * compressed_output.cc (zlib_decompress): New function.
8143 (get_uncompressed_size): New function.
8144 (decompress_input_section): New function.
8145 * compressed_output.h (get_uncompressed_size): New function.
8146 (decompress_input_section): New function.
8147 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8148 Handle compressed debug sections.
8149 * layout.cc (is_compressed_debug_section): New function.
8150 (Layout::output_section_name): Map compressed section names to
8151 canonical names.
8152 * layout.h (is_compressed_debug_section): New function.
8153 (is_debug_info_section): Recognize compressed debug sections.
8154 * merge.cc: Include compressed_output.h.
8155 (Output_merge_data::do_add_input_section): Handle compressed
8156 debug sections.
8157 (Output_merge_string::do_add_input_section): Handle compressed
8158 debug sections.
8159 * object.cc: Include compressed_output.h.
8160 (Sized_relobj::Sized_relobj): Initialize new data members.
8161 (build_compressed_section_map): New function.
8162 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8163 * object.h (Object::section_is_compressed): New method.
8164 (Object::do_section_is_compressed): New method.
8165 (Sized_relobj::Compressed_section_map): New type.
8166 (Sized_relobj::do_section_is_compressed): New method.
8167 (Sized_relobj::compressed_sections_): New data member.
8168 * output.cc (Output_section::add_input_section): Handle compressed
8169 debug sections.
8170 * reloc.cc: Include compressed_output.h.
8171 (Sized_relobj::write_sections): Handle compressed debug sections.
8172
ce279a62
CC
81732010-07-08 Cary Coutant <ccoutant@google.com>
8174
8175 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8176 weak when resolving to a dynamic def.
8177 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8178 for weak undef/dynamic def cases. Adjust callers.
8179 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8180 undef_binding_weak_.
8181 (Symbol_table::sized_write_globals): Adjust symbol binding.
8182 (Symbol_table::sized_write_symbol): Add binding parameter.
8183 * symtab.h (Symbol::set_undef_binding): New method.
8184 (Symbol::is_undef_binding_weak): New method.
8185 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8186 (Symbol_table::should_override): Add new parameter.
8187 (Symbol_table::sized_write_symbol): Add new parameter.
8188
8189 * testsuite/weak_undef_file1.cc: Add new test case.
8190 * testsuite/weak_undef_file2.cc: Fix header comment.
8191 * testsuite/weak_undef_test.cc: Add new test case.
8192
b2286c10
DK
81932010-06-29 Doug Kwan <dougkwan@google.com>
8194
8195 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8196 Initialize USE_SYMBOL_.
8197 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8198 definition.
8199 (Arm_reloc_property::uses_symbol_): New data member declaration.
8200 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8201 uses symbol value and symbol is undefined but not weakly undefined.
8202
4802450a
RÁE
82032010-06-28 Rafael Espindola <espindola@google.com>
8204
8205 * plugin.cc (Plugin::load): Use dlerror.
8206
e5ca47ba
ILT
82072010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8208
8209 * symtab.cc (detect_odr_violations): When reporting an ODR
8210 violation, report an object where the symbol is defined.
8211
8a75a161
DK
82122010-06-25 Doug Kwan <dougkwan@google.com>
8213
8214 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8215 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8216 definition.
8217 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8218 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8219 target hook to detect function points.
8220 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8221 * icf.h (Icf::check_section_for_function_pointers): Change type of
8222 parameter SECTION_NAME to const reference to std::string. Use
8223 target hook to determine if section may have unsafe pointers.
8224 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8225 method definition.
8226
42218b9f
RÁE
82272010-06-21 Rafael Espindola <espindola@google.com>
8228
8229 * fileread.cc (Input_file::find_fie): New
8230 (Input_file::open): Use Input_file::find_fie.
8231 * fileread.h (Input_file::find_fie): New
8232 * plugin.cc (set_extra_library_path): New.
8233 (Plugin::load): Add set_extra_library_path to the transfer vector.
8234 (Plugin_manager::set_extra_library_path): New.
8235 (Plugin_manager::add_input_file): Use the extra search path if set.
8236 (set_extra_library_path(): New.
8237 * plugin.h (Plugin_manager): Add set_extra_library_path and
8238 extra_search_path_.
8239
a0506cca
CC
82402010-06-19 Cary Coutant <ccoutant@google.com>
8241
8242 * layout.cc (gdb_sections): Add .debug_types.
8243 (lines_only_debug_sections): Likewise.
8244
6508b958
RÁE
82452010-06-18 Rafael Espindola <espindola@google.com>
8246
8247 * plugin.cc (add_input_file,add_input_library)
8248 (Plugin_manager::add_input_file): Make filename arguments const.
8249 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8250 const.
8251
3e235302
DK
82522010-06-16 Doug Kwan <dougkwan@google.com>
8253
8254 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8255 .ARM.attributes section if we have not merged any input
8256 attributes sections.
8257
106e8a6c
DK
82582010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8259
8260 * arm.cc: Allow combining objects with no EABI version
8261 information.
8262
91ff43fe
RÁE
82632010-06-15 Rafael Espindola <espindola@google.com>
8264
8265 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8266
68ed838c
ILT
82672010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8268
8269 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8270 (struct iovec): Correct !HAVE_READV definition.
8271
f3a2388f
CC
82722010-06-10 Cary Coutant <ccoutant@google.com>
8273
8274 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8275 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8276 reloc sections.
8277 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8278
8279 PR 11683
8280 * symtab.h (Symbol::is_placeholder): New member function.
8281 * target-reloc.h (relocate_section): Check for placeholder symbols.
8282
8283 * testsuite/Makefile.am (plugin_test_8): New test.
8284 (plugin_test_9): New test.
8285 * testsuite/Makefile.in: Regenerate.
8286
e1df38aa
NC
82872010-06-09 Nick Clifton <nickc@redhat.com>
8288
8289 * yyscript.y (input_list_element): Allow strings prefixed with
8290 the '-' character. Treat these as libraries.
8291 * script.cc (script_add_library): New function. Adds a library
8292 specified by "-l<name>" found in an input script.
8293 * script-c.h: Add prototype for script_add_library.
8294
25bbe950
DK
82952010-06-07 Doug Kwan <dougkwan@google.com>
8296
8297 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8298 Restrict stub-group size to be within long conditional branch
8299 range when working around cortex-A8 erratum.
8300
0f32ea4c
ILT
83012010-06-07 Damien Diederen <dd@crosstwine.com>
8302
8303 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8304 #ifdef typo.
8305
8fe2a369
ST
83062010-06-03 Sriraman Tallam <tmsriram@google.com>
8307
8308 PR gold/11658
8309 * output.cc
8310 (Output_section::Input_section_sort_entry::compare_section_ordering):
8311 Change to return non-zero correctly.
8312 (Output_section::Input_section_sort_section_order_index_compare
8313 ::operator()): Change to fix ambiguity in comparisons.
8314
6e9ba2ca
ST
83152010-06-01 Sriraman Tallam <tmsriram@google.com>
8316
8317 * gold.h (is_wildcard_string): New function.
8318 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8319 (Layout::layout_eh_frame): Ditto.
8320 (Layout::find_section_order_index): New method.
8321 (Layout::read_layout_from_file): New method.
8322 * layout.h (Layout::find_section_order_index): New method.
8323 (Layout::read_layout_from_file): New method.
8324 (Layout::input_section_position_): New private member.
8325 (Layout::input_section_glob_): New private member.
8326 * main.cc (main): Call read_layout_from_file here.
8327 * options.h (--section-ordering-file): New option.
8328 * output.cc (Output_section::input_section_order_specified_): New
8329 member.
8330 (Output_section::Output_section): Initialize new member.
8331 (Output_section::add_input_section): Add new parameter.
8332 Keep input sections when --section-ordering-file is used.
8333 (Output_section::set_final_data_size): Sort input sections when
8334 section ordering file is specified.
8335 (Output_section::Input_section_sort_entry): Add new parameter.
8336 Check sorting type.
8337 (Output_section::Input_section_sort_entry::compare_section_ordering):
8338 New method.
8339 (Output_section::Input_section_sort_compare::operator()): Change to
8340 consider section_order_index.
8341 (Output_section::Input_section_sort_init_fini_compare::operator()):
8342 Change to consider section_order_index.
8343 (Output_section::Input_section_sort_section_order_index_compare
8344 ::operator()): New method.
8345 (Output_section::sort_attached_input_sections): Change to sort
8346 according to section order when specified.
e1df38aa
NC
8347 (Output_section::add_input_section<32, true>): Add new parameter.
8348 (Output_section::add_input_section<64, true>): Add new parameter.
8349 (Output_section::add_input_section<32, false>): Add new parameter.
8350 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8351 * output.h (Output_section::add_input_section): Add new parameter.
8352 (Output_section::input_section_order_specified): New
8353 method.
8354 (Output_section::set_input_section_order_specified): New method.
8355 (Input_section::Input_section): Initialize section_order_index_.
8356 (Input_section::section_order_index): New method.
8357 (Input_section::set_section_order_index): New method.
8358 (Input_section::section_order_index_): New member.
8359 (Input_section::Input_section_sort_section_order_index_compare): New
8360 struct.
8361 (Output_section::input_section_order_specified_): New member.
8362 * script-sections.cc (is_wildcard_string): Delete and move modified
8363 method to gold.h.
8364 (Output_section_element_input::Output_section_element_input): Modify
8365 call to is_wildcard_string.
8366 (Output_section_element_input::Input_section_pattern
8367 ::Input_section_pattern): Ditto.
8368 (Output_section_element_input::Output_section_element_input): Ditto.
8369 * testsuite/Makefile.am (final_layout): New test case.
8370 * testsuite/Makefile.in: Regenerate.
8371 * testsuite/final_layout.cc: New file.
8372 * testsuite/final_layout.sh: New file.
8373
3537c84b
RÁE
83742010-06-01 Rafael Espindola <espindola@google.com>
8375
8376 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8377
105b6afd
RÁE
83782010-06-01 Rafael Espindola <espindola@google.com>
8379
8380 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8381 visibility of symbols.
8382
29e11421
DK
83832010-05-27 Doug Kwan <dougkwan@google.com>
8384
8385 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8386 from start of output section instead of address for a local symbol
8387 in a merged or relaxed section when doing a relocatable link.
8388
5e0f337e
RÁE
83892010-05-26 Rafael Espindola <espindola@google.com>
8390
703d02da 8391 PR 11604
5e0f337e
RÁE
8392 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8393 adding sections the garbage collector removed.
8394 * gold/testsuite/Makefile.am: Add test.
8395 * gold/testsuite/Makefile.in: Regenerate.
8396 * gold/testsuite/plugin_test_7.sh: New.
8397 * gold/testsuite/plugin_test_7_1.c: New.
8398 * gold/testsuite/plugin_test_7_2.c: New.
8399
f4187277
RÁE
84002010-05-26 Rafael Espindola <espindola@google.com>
8401
8402 * script-sections.cc (Output_section_definition::set_section_addresses):
8403 Check for --section-start.
8404
5c388529
DK
84052010-05-26 Doug Kwan <dougkwan@google.com>
8406
8407 * arm.cc (Arm_scan_relocatable_relocs): New class.
8408 (Target_arm::relocate_special_relocatable): New method.
8409 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8410 (Arm_relocate_functions::thumb_branch_common): Same.
8411 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8412 instead of Default_scan_relocatable_relocs.
8413 * target-reloc.h (relocate_for_relocatable): Let target handle
8414 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8415 * target.h (Sized_target::relocate_special_relocatable): New method.
8416
bca1c3ae
ILT
84172010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8418
8419 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8420
0439c796
DK
84212010-05-23 Doug Kwan <dougkwan@google.com>
8422
8423 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8424 instead of a cast.
8425 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8426 with a direct branch, not a conditional branch, to a stub.
8427 * merge.cc (Output_merge_base::record_input_section): New method
8428 defintion.
8429 (Output_merge_data::do_add_input_section): Record input section if
8430 keeps-input-sections flag is set.
8431 (Output_merge_string::do_add_input_section): Ditto.
8432 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8433 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8434 INPUT_SECTIONS_.
8435 (Output_merge_base::keeps_input_sections,
8436 Output_merge_base::set_keeps_input_sections,
8437 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8438 method definitions.
8439 (Output_merge_base::Input_sections): New type declaration.
8440 (Output_merge_base::input_sections_begin,
8441 Output_merge_base::input_sections_end,
8442 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8443 (Output_merge_base::bool keeps_input_sections_,
8444 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8445 Output_merge_base::input_sections_): New data members.
8446 (Output_merge_data::do_set_keeps_input_sections): New method
8447 defintion.
8448 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8449 * output.cc (Output_section::Input_section::relobj): Move method
8450 defintion from class declaration to here and handle merge sections.
8451 (Output_section::Input_section::shndx): Ditto.
8452 (Output_section::Output_section): Remove initializations of removed
8453 data members and initialize new data member LOOKUP_MAPS_.
8454 (Output_section::add_input_section): Set keeps-input-sections flag
8455 for a newly created merge output section as appropriate. Adjust code
8456 to use Output_section_lookup_maps class.
8457 (Output_section::add_relaxed_input_section): Adjst code for lookup
8458 maps code refactoring.
2e702c99 8459 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8460 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8461 class. If adding input section to a newly created merge output
8462 section fails, remove the new merge section.
8463 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8464 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8465 (Output_section::find_merge_section): Ditto.
0439c796 8466 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8467 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8468 Output_section_lookup_maps class.
8469 (Output_section::get_input_sections): Export merge sections. Adjust
8470 code to use Output_section_lookup_maps class.
8471 (Output_section:::add_script_input_section): Adjust code to use
8472 Output_section_lookup_maps class. Update lookup maps for merge
8473 sections also.
8474 (Output_section::discard_states): Use Output_section_lookup_maps.
8475 (Output_section::restore_states): Same.
8476 * output.h (Merge_section_properties): Move class defintion out of
8477 Output_section.
8478 (Output_section_lookup_maps): New class.
8479 (Output_section::Input_section::is_merge_section): New method
8480 defintion.
8481 (Output_section::Input_section::relobj): Move defintion out of class
8482 defintion. Declare method only.
8483 (Output_section::Input_section::shndx): Ditto.
8484 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8485 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8486 (Output_section::Merge_section_by_properties_map,
8487 Output_section::Output_section_data_by_input_section_map,
8488 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8489 Remove types.
2e702c99 8490 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8491 KEEPS_INPUT_SECTIONS.
8492 (Output_section::build_lookup_maps): New method declaration.
8493 (Output_section::merge_section_map_,
8494 Output_section::merge_section_by_properties_map_,
8495 Output_section::relaxed_input_section_map_,
8496 Output_section::is_relaxed_input_section_map_valid_): Remove data
8497 members.
8498 (Output_section::lookup_maps_): New data member.
8499
76295588
L
85002010-05-21 Doug Kwan <dougkwan@google.com>
8501
8502 PR gold/11619
8503 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8504 avoid a compilation error.
8505
d103a984
RÁE
85062010-05-19 Rafael Espindola <espindola@google.com>
8507
8508 * script-sections.cc (Output_section_definition::allocate_to_segment):
8509 Update the phdrs_list even when the output section is NULL.
8510 * testsuite/Makefile.am: Add test.
8511 * testsuite/Makefile.in: Regenerate.
8512 * testsuite/script_test_9.cc: New.
8513 * testsuite/script_test_9.sh: New.
8514 * testsuite/script_test_9.t: New.
8515
6625d24e
DK
85162010-05-19 Doug Kwan <dougkwan@google.com>
8517
8518 * arm.cc (Arm_input_section::original_size): New method.
8519 (Arm_input_section::do_addralign): Add a cast.
8520 (Arm_input_section::do_output_offset): Remove static cast.
8521 (Arm_input_section::original_addralign,
8522 Arm_input_section::original_size_): Change type to uint32_t.
8523 (Arm_input_section::init): Add safe casts for section alignment
8524 and size.
8525 (Arm_input_section::set_final_data_size): Do not set address and
8526 offset of stub table.
8527 (Arm_output_section::fix_exidx_coverage): Change use of of
8528 Output_section::Simple_input_section to that of
8529 Output_section::Input_section.
8530 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8531 except for the first pass.
8532 * output.cc (Output_section::get_input_sections): Change type of
8533 input_sections to std::list<Input_section>.
8534 (Output_section::add_script_input_section): Rename from
8535 Output_section::add_simple_input_section. Change type of SIS
8536 parameter from Simple_input_section to Input_section.
8537 * output.h (Output_section::Simple_input_section): Remove class.
8538 (Output_section::Input_section): Change class visibility to public.
8539 (Output_section::Input_section::addralign): Use stored alignments
8540 for special input sections if set.
8541 (Output_section::Input_section::set_addralign): New method.
8542 (Output_section::get_input_sections): Change parameter type from
8543 list of Simple_input_section to list of Input_section.
8544 (Output_section::add_script_input_section): Rename from
8545 Output_section::add_simple_input_section. Change first parameter's
8546 type from Simple_input_section to Input_section and remove the
8547 second and third parameters.
8548 * script-sections.cc (Input_section::Input_section_list): Change
8549 type to list of Output_section::Input_section/
8550 (Input_section_info::Input_section_info): Change parameter type of
8551 INPUT_SECTION to Output_section::Input_section.
8552 (Input_section_info::input_section): Change return type.
8553 (Input_section_info::input_section_): Change type to
8554 Output_section::Input_section.
8555 (Output_section_element_input::set_section_addresses): Adjust code
8556 to use Output_section::Input_section instead of
8557 Output_section::Simple_input_section. Adjust code for renaming
8558 of Output_section::add_simple_input_section.
8559 (Orphan_output_section::set_section_addresses): Ditto.
8560
e1e82ea4
RW
85612010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8562
8563 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8564 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8565
91e75c8a
RÁE
85662010-05-18 Rafael Espindola <espindola@google.com>
8567
8568 * options.cc (General_options::finalize): Handle -nostdlib.
8569 * options.h (nostdlib): New option.
8570 * script.cc (script_add_search_dir): Handle -nostdlib.
8571
da59ad79
DK
85722010-05-12 Doug Kwan <dougkwan@google.com>
8573
8574 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8575 attributes section only if there no attributes section after merging.
8576 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8577 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8578 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8579 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8580 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8581 and arm_attr_merge_7.stdout.
8582 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8583 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8584 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8585 arm_attr_merge_7b.o): New rules.
8586 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8587 arm_attr_merge_7
8588 * testsuite/Makefile.in: Regenerate.
8589 * testsuite/arm_attr_merge.sh: New file.
8590 * testsuite/arm_attr_merge_[67][ab].s: Same.
8591
3e01a7fd
NC
85922010-05-05 Nick Clifton <nickc@redhat.com>
8593
8594 * po/es.po: Updated Spanish translation.
8595
7ad2014a
L
85962010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8597
8598 * Makefile.am (install-exec-local): Properly install gold as
8599 default cross linker.
8600 * Makefile.in: Regenerated.
8601
4fda8867
NC
86022010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8603 Nick Clifton <nickc@redhat.com>
8604
8605 * configure.ac (install_as_default): Define and set to false
8606 unless --enable-gold or --enable-gold=both/gold has been
8607 specified.
8608 * configure: Regenerate.
8609
8610 * Makefile.am (install-exec-local): Install the executable as
8611 'ld.gold'. If install_as_default is true then also install it as
8612 'ld'.
8613 * Makefile.in: Regenerated.
8614
bd288ea2
ILT
86152010-04-24 Ian Lance Taylor <iant@google.com>
8616
8617 * layout.cc (Layout::layout_reloc): In relocatable link don't
8618 combine reloc sections for grouped sections.
8619
ef38fd8a
ST
86202010-04-23 Sriraman Tallam <tmsriram@google.com>
8621
8622 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8623 sections that are not ordinary to icf.
8624 * icf.cc (get_section_contents): Handle relocation pointing to section
8625 with no object or shndx information.
8626 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8627 * testsuite/Makefile.in: Regenerate.
8628 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8629 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8630
f6973bdc
ILT
86312010-04-22 Ian Lance Taylor <iant@google.com>
8632
8633 * expression.cc (Expression::Expression_eval_info): Add
8634 result_alignment_pointer field.
8635 (Expression::eval_with_dot): Add result_alignment_pointer
8636 parameter. Change all callers.
8637 (Expression::eval_maybe_dot): Likewise.
8638 (class Binary_expression): Add alignment_pointer parameter to
8639 left_value and right_value. Change all callers.
8640 (BINARY_EXPRESSION): Set result alignment.
8641 (class Trinary_expression): Add alignment_pointer parameter to
8642 arg2_value and arg3_value. Change all callers.
8643 (Trinary_cond::value): Set result alignment.
8644 (Max_expression::value, Min_expression::value): Likewise.
8645 (Align_expression::value): Likewise.
8646 * script-sections.cc (class Sections_element): Add dot_alignment
8647 parameter to set_section_addresses virtual function. Update
8648 instantiations.
8649 (class Output_section_element): Likewise.
8650 (Script_sections::create_segments): Add dot_alignment parameter.
8651 Change all callers.
8652 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8653 (Script_sections::set_phdrs_clause_addresses): Likewise.
8654 * script-sections.h: Update declarations.
8655 * script.h: Update declarations.
8656 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8657 min_p_align.
8658 * testsuite/script_test_3.t: Set large alignment.
8659 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8660 segment has expected alignment.
8661
9c9c98a5
NC
86622010-04-22 Nick Clifton <nickc@redhat.com>
8663
8664 * po/gold.pot: Updated by the Translation project.
8665 * po/vi.po: Updated Vietnamese translation.
8666
2253bfba
L
86672010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8668
8669 * testsuite/Makefile.am (check_PROGRAMS): Add
8670 icf_virtual_function_folding_test.
8671 * testsuite/Makefile.in: Regenerated.
8672
85fdf906
AH
86732010-04-15 Andrew Haley <aph@redhat.com>
8674
8675 * options.h (merge_exidx_entries): New option.
8676 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8677 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8678 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8679 (Target_arm::merge_exidx_entries): New function.
8680 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8681 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8682 to Arm_exidx_fixup constructor.
8683 Add new arg, merge_exidx_entries.
8684 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8685 Arm_output_section::fix_exidx_coverage.
8686
ce97fa81
ST
86872010-04-18 Sriraman Tallam <tmsriram@google.com>
8688
8689 * icf.cc (get_section_contents): Check for preemptible functions.
8690 Ignore addend when appropriate.
8691 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8692 section folded.
8693 (add_from_relobj): Check for section folded.
8694 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8695 * symtab.h (should_add_dynsym_entry): Add new parameter.
8696 * target-reloc.h (scan_relocs): Check for section folded.
8697 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8698 Check reloc types for function pointers in shared objects.
8699 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8700 case.
8701 (icf_preemptible_functions_test): New test case.
8702 (icf_string_merge_test): New test case.
8703 * testsuite.Makefile.in: Regenerate.
8704 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8705 bar_glob. Refactor code.
8706 * testsuite/icf_preemptible_functions_test.cc: New file.
8707 * testsuite/icf_preemptible_functions_test.sh: New file.
8708 * testsuite/icf_string_merge_test.cc: New file.
8709 * testsuite/icf_string_merge_test.sh: New file.
8710 * testsuite/icf_virtual_function_folding_test.cc: New file.
8711 * testsuite/icf_virtual_function_folding_test.sh: New file.
8712
04ceb17c
DK
87132010-04-14 Doug Kwan <dougkwan@google.com>
8714
8715 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8716 for local symbol recounting if we remove a section due to ICF.
8717 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8718 there are no regular objects in input.
8719
153e7da4
DK
87202010-04-13 Doug Kwan <dougkwan@google.com>
8721
8722 * arm.cc (Arm_input_section::set_final_data_size): Compute
8723 accurate final data size instead of using current data size.
8724
4dbd9faf
DK
87252010-04-09 Doug Kwan <dougkwan@google.com>
8726
8727 * layout.cc (Layout::choose_output_section): Handle script section
8728 types.
8729 (Layout::make_output_section_for_script): Add section type parameter.
8730 Handle script section types.
8731 * layout.h (Layout::make_output_section_for_script): Add section
8732 type parameter.
8733 * output.cc (Output_section::Output_section): Initialize data member
8734 is_noload_.
8735 (Output_section::do_reset_address_and_file_offset): Do not set address
8736 to 0 if section is a NOLOAD section.
8737 * output.h (Output_section::is_noload): New method.
8738 (Output_section::set_is_noload): Ditto.
8739 (Output_section::is_noload_): New data member.
8740 * script-c.h (Script_section_type): New enum type.
8741 (struct Parser_output_section_header): Add new file section_type.
8742 * script-sections.cc (Sections_element::output_section_name): Add
8743 parameter for returning script section type.
8744 (Output_section_definition::output_section_name): Ditto.
8745 (Output_section_definition::section_type)P; New method.
8746 (Output_section_definiton::script_section_type_name): Ditto.
8747 (Output_section_definition::script_section_type_): New data member.
8748 (Output_section_definition::Output_section_definition): Initialize
8749 data member Output_section_definition::script_section_type_.
8750 (Output_section_definition::create_sections): Pass script section type
8751 to Layout::make_output_section_for_script.
8752 (Output_section_definition::output_section_name): Return script
8753 section type to caller.
8754 (Output_section_definition::set_section_address): Do not advance
8755 dot value and load address if section type is NOLOAD. Set address
8756 of NOLOAD sections regardless of section flags.
8757 (Output_section_definition::print): Print section type if it is
8758 not SCRIPT_SECTION_TYPE_NONE.
8759 (Output_section_definition::section_type): New method.
8760 (Output_section_definition::script_section_type_name): Ditto.
8761 (Script_sections::output_section_name): Add new parameter
8762 PSECTION_TYPE for returning script section type. Pass it to
8763 section elements. Handle discard sections.
8764 (Sort_output_sections::operator()): Handle NOLOAD sections.
8765 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8766 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8767 returning script section type.
8768 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8769 INFO and NOLOAD.
8770 * yyscript.y (union): Add new field SECTION_TYPE.
8771 (COPY, DSECT, INFO, NOLOAD): New tokens.
8772 (opt_address_and_section_type): Change type to output_section_header.
8773 (section_type): New non-terminal
8774 (section_header): Handle section type.
2253bfba 8775 (opt_address_and_section_type): Return section type value.
4dbd9faf 8776
721ea635
L
87772010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8778
8779 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8780 * testsuite/plugin_common_test_2.c (foo): Likewise.
8781
6bf924b0
DK
87822010-04-08 Doug Kwan <dougkwan@google.com>
8783
8784 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8785 Output_merge_data.
8786 * output.cc (Output_section::add_merge_input_section): Simplify
8787 code and return status of Output_merge_base::add_input_section.
e1df38aa 8788 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8789 returns true.
8790
24af6f92
DK
87912010-04-07 Doug Kwan <dougkwan@google.com>
8792
8793 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8794 if section is marked as containing instructions but has no mapping
8795 symbols.
8796 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8797 correct section index.
8798 (Arm_relobj::find_linked_text_section): Ditto.
8799
00698fc5
CC
88002010-04-07 Cary Coutant <ccoutant@google.com>
8801
8802 * archive.cc (include_member): Destroy Read_symbols_data object before
8803 releasing file.
8804 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8805 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8806 (Read_symbols_data::~Read_symbols_data) New destructor.
8807 (Section_relocs::Section_relocs) New constructor.
8808 (Section_relocs::~Section_relocs) New destructor.
8809 (Read_relocs_data::Read_relocs_data) New constructor.
8810 (Read_relocs_data::~Read_relocs_data) New destructor.
8811 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8812 pointers to NULL after deleting.
8813
7296d933
DK
88142010-04-07 Doug Kwan <dougkwan@google.com>
8815
8816 * arm.cc: Replace "endianity" with "endianness" in comments.
8817 (Arm_exidx_cantunwind): Ditto.
8818 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8819 (Arm_relobj::merge_flags_and_attributes): New method.
8820 (Arm_relobj::merge_flags_and_attributes_): New data member.
8821 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8822 (Arm_relobj::scan_sections_for_stubs): Ditto.
8823 (Arm_relobj::do_read_symbols): Check to see if we really want to
8824 merge processor-specific flags and attributes. Exit early if
8825 an object is empty except for section names and the undefined symbol.
8826 (Target_arm::do_finalize_sections): Move check for ELF format to
8827 Arm_relobj::do_read_symbols. Merge processor specific flags and
8828 attributes from a regular object only when we have determined that
8829 it is aapropriate. Do not create an .ARM.attributes section in
8830 output if there is no regular input object.
8831 (Target_arm::merge_processor_specific_flags): Check
8832 --warn-mismatch before printing any error.
8833 (Target_arm::merge_object_attributes): Ditto.
8834 * gold.cc (queue_middle_tasks): Handle the case in which there is
8835 no regular object in input.
8836 * options.cc (General_options::parse_EB): New method.
8837 (General_options::parse_EL): Same.
8838 (General_options::General_options): Initialize endianness_.
8839 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8840 New options.
8841 (General_options::Endianness): New enum.
8842 (General_options::endianness): New method.
8843 (General_options::endianness_): New data member.
8844 * parameters.cc (Parameters::set_options): Check target endianness.
8845 (Parameters::set_target_once): Ditto.
8846 (Parameters::check_target_endianness): New method.
8847 (parameters_force_valid_target): If either -EL or -EB is specified,
8848 use it to define endianness of default target.
8849 * parameters.h (Parameters::check_target_endianness): New method
8850 declaration.
8851 * target.h (class Target): Change "endianity" to "endianness"
8852 in comments.
8853
efc8d4f2
RW
88542010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8855
8856 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8857 * configure: Regenerate.
8858 * Makefile.in: Regenerate.
8859 * testsuite/Makefile.in: Regenerate.
8860
be234d88
CC
88612010-04-06 Cary Coutant <ccoutant@google.com>
8862
8863 gcc PR lto/42757
8864 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8865 prevailing definitions of common symbols.
8866 * testsuite/plugin_test_6.sh: New test case.
8867 * testsuite/plugin_common_test_1.c: New test case.
8868 * testsuite/plugin_common_test_2.c: New test case.
8869 * testsuite/Makefile.am (plugin_test_6): New test case.
8870 * testsuite/Makefile.in: Regenerate.
8871
bd32c6bd
NC
88722010-04-06 Nick Clifton <nickc@redhat.com>
8873
8874 * po/vi.po: New Vietnamese translation.
8875
323c532f
DK
88762010-03-30 Doug Kwan <dougkwan@google.com>
8877
8878 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8879
4fcd97eb
DK
88802010-03-25 Doug Kwan <dougkwan@google.com>
8881
8882 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8883 to avoid a conversion warning on a 32-bit host.
8884
4ebf39db
ILT
88852010-03-24 Ian Lance Taylor <iant@google.com>
8886
8887 * testsuite/script_test_3.t: Add a TLS segment.
8888 * testsuite/Makefile.am (check_PROGRAMS): Add
8889 tls_phdrs_script_test.
8890 (tls_phdrs_script_test_SOURCES): Define.
8891 (tls_phdrs_script_test_DEPENDENCIES): Define.
8892 (tls_phdrs_script_test_LDFLAGS): Define.
8893 (tls_phdrs_script_test_LDADD): Define.
8894 * testsuite/Makefile.in: Rebuild.
8895
4a599bdd
CC
88962010-03-23 Cary Coutant <ccoutant@google.com>
8897
8898 * fileread.cc (find_or_make_view): Fix comment.
8899
6c93b22c
ILT
89002010-03-23 Ian Lance Taylor <iant@google.com>
8901
8902 * script-sections.cc (class Orphan_section_placement): Define
8903 PLACE_TLS and PLACE_TLS_BSS.
8904 (Orphan_section_placement::Orphan_section_placement): Initialize
8905 new places.
8906 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8907 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8908 (tls_script_test_SOURCES): Define.
8909 (tls_script_test_DEPENDENCIES): Define.
8910 (tls_script_test_LDFLAGS): Define.
8911 (tls_script_test_LDADD): Define.
8912 * testsuite/Makefile.in: Rebuild.
8913
a2c7281b
DK
89142010-03-22 Doug Kwan <dougkwan@google.com>
8915
8916 * arm.cc (Arm_relocate_functions::abs8,
8917 Arm_relocate_functions::abs16): Use correct check for overflow
8918 specified in the ARM ELF specs.
8919 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8920 target of a BLX instruction specially.
8921 (Reloc_stub::stub_type_for_reloc): Ditto.
8922 (Relocate::relocate): Use symbolic names instead of numeric relocation
8923 codes to report error.
8924 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8925 workaround.
8926 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8927 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8928 thumb2_blx_out_of_range.stdout
8929 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8930 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8931 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8932 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8933 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8934 thumb2_blx_in_range, thumb2_blx_in_range.o,
8935 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8936 thumb2_blx_out_of_range.o): New rules.
2e702c99 8937 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8938 thumb2_blx_in_range and thumb2_blx_out_of_range.
8939 * testsuite/Makefile.in: Regenerate.
8940 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8941 * testsuite/thumb_blx_in_range.s: New file.
8942 * testsuite/thumb_blx_out_of_range.s: New file.
8943
b0193076
RÁE
89442010-03-22 Rafael Espindola <espindola@google.com>
8945
8946 * archive.cc (Should_include): Move to archive.h.
8947 (should_include_member): Make it a member of Archive.
8948 (Lib_group): New.
8949 (Add_lib_group_symbols): New.
8950 * archive.h: Include options.h.
8951 (Archive_member): Moved from Archive.
8952 (Should_include): Moved from archive.cc.
8953 (Lib_group): New.
8954 (Add_lib_group_symbols): New.
8955 * dynobj.cc (do_should_include_member): New.
8956 * dynobj.h (do_should_include_member): New.
8957 * gold.cc (queue_initial_tasks): Update call to queue.
8958 * main.cc (main): Print lib group stats.
8959 * object.cc (do_should_include_member): New.
8960 * object.h: Include archive.h.
8961 (Object::should_include_member): New.
8962 (Object::do_should_include_member): New.
8963 (Sized_relobj::do_should_include_member): New.
8964 * options.cc (General_options::parse_start_lib): New.
8965 (General_options::parse_end_lib): New.
8966 (Input_arguments::add_file): Handle lib groups.
8967 (Input_arguments::start_group): Check we are not in a lib.
8968 (Input_arguments::start_lib): New.
8969 (Input_arguments::end_lib): New.
8970 * options.h (General_options): Add start_lib and end_lib.
8971 (Input_argument::lib_): New.
8972 (Input_argument::lib): New.
8973 (Input_argument::is_lib): New.
8974 (Input_file_lib): New.
8975 (Input_arguments::in_lib_): New.
8976 (Input_arguments::in_lib): New.
8977 (Input_arguments::start_lib): New.
8978 (Input_arguments::end_lib_): New.
8979 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8980 in unused members as preempted.
8981 (Sized_pluginobj::do_should_include_member): New.
8982 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8983 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8984 return the blocker.
8985 (Read_symbols::do_whole_lib_group): New.
8986 (Read_symbols::do_lib_group): New.
8987 (Read_symbols::do_read_symbols): Handle lib groups.
8988 (Read_symbols::get_name): Handle lib groups.
8989 * readsyms.h (Read_symbols): Add an archive member pointer.
8990 (Read_symbols::do_whole_lib_group): New.
8991 (Read_symbols::do_lib_group): New.
8992 (Read_symbols::member_): New.
8993 * script.cc (read_input_script): Update call to queue_soon.
8994
d099120c
DK
89952010-03-19 Doug Kwan <dougkwan@google.com>
8996
8997 * arm.cc (Stub_table::Stub_table): Initialize new data members
8998 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8999 (Stub_table::add_reloc_stub): Assign stub offset and update
9000 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9001 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9002 New data members.
2e702c99 9003 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9004 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9005 instead of going over all reloc stubs.
2e702c99 9006 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9007 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9008 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9009 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9010 Stringpool_template::offset_.
9011 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9012 Stringpool_template::offset_ to zero.
9013
1aa37384
DK
90142010-03-15 Doug Kwan <dougkwan@google.com>
9015
9016 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9017 offset_.
9018 (Stringpool_template::new_key_offset): New method.
9019 (Stringpool_template::add_string): Assign offsets when adding new
9020 strings.
9021 (Stringpool_template::set_string_offsets): Do not set string offsets
9022 when not optimizing.
9023 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9024 member size_.
2e702c99
RM
9025 (Chunked_vector::clear): Clear size_.
9026 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9027 (Chunked_vector::size): Return size_.
9028 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9029 (Chunked_vector::size_): New data member.
1aa37384
DK
9030 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9031 (Stringpool_template::new_key_offset): New method declaration.
9032 (Stringpool_template::offset_): New data member.
9033
b672b057
RÁE
90342010-03-15 Rafael Espindola <espindola@google.com>
9035
9036 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9037 Add_symbols' constructor.
9038 * readsyms.h (Add_symbols): Remove the input_group member.
9039
b6848d3c
ILT
90402010-03-10 Ian Lance Taylor <iant@google.com>
9041
9042 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9043 target to ask whether a reference to a symbol requires a stack
9044 split.
9045 * target.h (Target::is_call_to_non_split): New function.
9046 (Target::do_is_call_to_non_split): Declare virtual function.
9047 * target.cc: Include "symtab.h".
9048 (Target::do_is_call_to_non_split): New function.
9049 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9050
a2a5469e
CC
90512010-03-10 Cary Coutant <ccoutant@google.com>
9052
9053 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9054 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9055 (File_read::open[2]): Add whole_file_view_ to list of views.
9056 (File_read::make_view): Remove test of whole_file_view_.
9057 (File_read::find_or_make_view): Create whole_file_view_ if
9058 necessary.
9059 (File_read::clear_views): Replace bool parameter with enum;
9060 adjust all callers. Don't delete views with permanent data;
9061 do delete cached views and views from archives if
9062 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9063 if clearing the corresponding view.
9064 * fileread.h (File_read::Clear_views_mode): New enum.
9065 (File_read::View::is_permanent_view): New method.
9066 (File_read::clear_views): Replace bool parameter
9067 with enum; adjust all callers.
9068 * options.h (General_options): Change keep_files_mapped option;
9069 add map_whole_files.
9070 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9071 releasing the file.
9072 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9073 the file.
9074
8861f32b
DM
90752010-03-10 David S. Miller <davem@davemloft.net>
9076
9077 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9078
d62d0f5f
ST
90792010-03-09 Sriraman Tallam <tmsriram@google.com>
9080
9081 * icf.cc (get_section_contents): Add '@' marker after processing the
9082 merge reloc.
9083
9177756d
DK
90842010-03-08 Doug Kwan <dougkwan@google.com>
9085
9086 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9087 due to a conversion warning.
9088 (Arm_relobj::update_output_local_symbol_count): Check for local
9089 symbol with unset output index.
9090
9e9e071b
ILT
90912010-03-05 Ian Lance Taylor <iant@google.com>
9092
9093 * options.h (class General_options): Add --spare-dynamic-tags.
9094 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9095 --spare-dynamic-tags.
9096
a81ee015
ILT
90972010-03-05 Ian Lance Taylor <iant@google.com>
9098
9099 * incremental.cc: Include "libiberty.h".
9100
44ec90b9
RO
91012010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9102
9103 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9104 function, is_info_ member.
9105 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9106 (Versions::Versions): Update caller.
9107 (Versions::define_base_version): Likewise.
9108 (Versions::add_def): Likewise.
9109
0897ed3b
ST
91102010-03-03 Sriraman Tallam <tmsriram@google.com>
9111
9112 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9113 (Scan::possible_function_pointer_reloc): New function.
9114 (Scan::local_reloc_may_be_function_pointer): Change to call
9115 possible_function_pointer_reloc.
9116 (Scan::global_reloc_may_be_function_pointer): Ditto.
9117 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9118 relocations in ".data.rel.ro._ZTV" section.
9119 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9120 * testsuite/icf_safe_so_test.cc: Ditto.
9121 * testsuite/icf_safe_test.cc: Ditto.
9122 * testsuite/icf_safe_test.sh: Ditto.
9123
d3bbad62
ILT
91242010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9125 Ian Lance Taylor <iant@google.com>
9126
9127 * target-reloc.h (relocate_section): Check the symbol table index
9128 for -1U before setting the local symbol index.
9129 (scan_relocatable_relocs): If copying the relocation, record that
9130 the local symbol is required.
9131 * object.h (Symbol_value::is_output_symtab_index_set): New
9132 function.
9133 (Symbol_value::may_be_discarded_from_output_symtab): New
9134 function.
9135 (Symbol_value::has_output_symtab_entry): New function.
9136 (Symbol_value::needs_output_symtab_entry): Remove.
9137 (Symbol_value::output_symtab_index): Make sure the symbol index is
9138 set.
9139 (Symbol_value::set_output_symtab_index): Make sure the symbol
9140 index is not set. Make sure the new index is valid.
9141 (Symbol_value::set_must_have_output_symtab_entry): New function.
9142 (Symbol_value::has_output_dynsym_entry): New function.
9143 (Symbol_value::set_output_dynsym_index): Make sure the new index
9144 is valid.
9145 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9146 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9147 local symbol if permitted.
9148 (Sized_relobj::do_finalize_local_symbols): Call
9149 is_output_symtab_index_set rather than needs_output_symtab_entry.
9150 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9151 rather than needs_output_symtab_entry. Call
9152 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9153 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9154 is_output_symtab_index_set rather than needs_output_symtab_entry.
9155 * testsuite/discard_locals_relocatable_test.c: New file.
9156 * testsuite/discard_locals_test.sh: Test -r.
9157 * testsuite/Makefile.am (check_DATA): Add
9158 discard_locals_relocatable_test1.syms,
9159 discard_local_relocatable_test2.syms.
9160 (MOSTLYCLEANFILES): Likewise. Also add
9161 discard_locals_relocatable_test1.lout and
9162 discard_locals_relocatable_test2.out.
9163 (discard_locals_relocatable_test1.syms): New target.
9164 (discard_locals_relocatable_test.o): New target.
9165 (discard_locals_relocatable_test1.out): New target.
9166 (discard_locals_relocatable_test2.syms): New target.
9167 (discard_locals_relocatable_test2.out): New target.
9168 (various): Add missing ../ld-new dependencies.
9169 * testsuite/Makefile.in: Rebuild.
9170
7e8ccf26
NC
91712010-03-03 Nick Clifton <nickc@redhat.com>
9172
9173 * po/fi.po: New Finnish translation.
9174
2a0ff005
DK
91752010-03-01 Doug Kwan <dougkwan@google.com>
9176
9177 * layout.cc (Layout::Layout): Force section types of .init_array*,
9178 .preinit_array* and .fini_array* sections.
9179 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9180 Fix check of return value of std::string::find.().
9181 (Output_section::Input_section_sort_compare::operator()): Remove
9182 comment about .init_array.
9183 (Output_section::Input_section_sort_init_fini_compare::operator()):
9184 New method.
9185 (Output_section::sort_attached_input_sections): Handle .init_array
9186 and .fini_array specially.
9187 * output.h (Output_section::Inut_section_sort_compare): Update
9188 comment.
9189 (Output_section::Input_section_sort_init_fini_compare): New struct.
9190
c3e4ae29
DK
91912010-02-26 Doug Kwan <dougkwan@google.com>
9192
9193 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9194 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9195 * testsuite/debug_msg.sh: Avoid matching source line number for
9196 use of global variable undef_int.
9197
2fd9ae7a
DK
91982010-02-26 Doug Kwan <dougkwan@google.com>
9199
9200 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9201 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9202 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9203 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9204 * options.cc (General_options::General_options): Initialize member
9205 fix_v4bx_.
9206 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9207 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9208 and rm_no_fix_v4bx.stdout
9209 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9210 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9211 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9212 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9213 and arm_no_fix_v4bx.
9214 * Makefile.in: Regenerate.
9215 * testsuite/arm_fix_v4bx.s: New file.
9216 * testsuite/arm_fix_v4bx.sh: Ditto.
9217
67ec7d0b
DK
92182010-02-24 Doug Kwan <dougkwan@google.com>
9219
9220 * arm.cc (Target_arm::got_section): Make the .got section the first
9221 non RELRO section in the data segment.
9222 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9223 suffixes of section names.
9224
10165461
DK
92252010-02-24 Doug Kwan <dougkwan@google.com>
9226
9227 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9228 flags and attributes merging if an input file is a binary file.
9229 * fileread.cc (Input_file::open): Record format of original file.
9230 * fileread.h (Input_file::Format): New enum type.
2e702c99 9231 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9232 (Input_file::format): New method definition.
9233 (Input_file::format_):: New data member.
9234
4a54abbb
DK
92352010-02-24 Doug Kwan <dougkwan@google.com>
9236
9237 * arm.cc (Arm_output_data_got): New class.
9238 (ARM_TCB_SIZE): New constant
9239 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9240 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9241 If user uses a script with a SECTIONS clause, issue only a warning
9242 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9243 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9244 garbage collection.
9245 (Target_arm::got_mode_index_entry): Handle static linking.
9246 (Target_arm::Scan::local): Ditto.
9247 (Target_arm::Scan::global): Ditto.
9248 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9249 all incorrectly implemented relocations.
e1df38aa 9250 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9251 Arm_output_section::fix_exidx_coverage.
9252 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9253 from ".ARM.exidx." and ".ARM.extab.".
9254
ca419a6f
ILT
92552010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9256
9257 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9258 section if it does not already exist.
9259 * attributes.cc (Attributes_section_data::Attributes_section_data):
9260 Don't crash if size is zero.
9261
135b9c78
ILT
92622010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9263 Ian Lance Taylor <iant@google.com>
9264
9265 * gold.cc (queue_middle_tasks): If no input files were opened,
9266 exit.
9267 * workqueue.h (Task_function::Task_function): Assert that there is
9268 a blocker.
9269
bb0bfe4f
DK
92702010-02-22 Doug Kwan <dougkwan@google.com>
9271
9272 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9273 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9274 types to avoid warnings due to different uint64_t implementations
9275 on different hosts.
9276
2a2b6d42
DK
92772010-02-21 Doug Kwan <dougkwan@google.com>
9278
9279 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9280 handling of the maximum backward branch offset.
2e702c99 9281 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9282 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9283 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9284 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9285 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9286 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9287 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9288 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9289 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9290 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9291 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9292 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9293 thumb2_bl_out_of_range.o): New rules.
9294 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9295 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9296 thumb2_bl_out_of_range
9297 * testsuite/Makefile.in: Regenerate.
9298 * testsuite/arm_bl_in_range.s: New file.
9299 * testsuite/arm_bl_out_of_range.s: Ditto.
9300 * testsuite/arm_branch_in_range.sh: Ditto.
9301 * testsuite/arm_branch_range.t: Ditto.
9302 * testsuite/thumb2_branch_range.t: Ditto.
9303 * testsuite/thumb_bl_in_range.s: Ditto.
9304 * testsuite/thumb_bl_out_of_range.s: Ditto.
9305 * testsuite/thumb_branch_range.t: Ditto.
9306
b487ad64
ST
93072010-02-20 Sriraman Tallam <tmsriram@google.com>
9308
9309 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9310 Add reloc offset information.
9311 * icf.cc (get_section_contents): Change iterators to point to the new
9312 vectors. Add reloc offset information to the contents.
9313 * icf.h (Icf::Sections_reachable_info): New typedef.
9314 (Icf::Sections_reachable_list): New typedef.
9315 (Icf::Offset_info): New typedef.
9316 (Icf::Reloc_info): New struct typedef.
9317 (Icf::Reloc_info_list): New typedef.
9318 (Icf::symbol_reloc_list): Delete method.
9319 (Icf::addend_reloc_list): Delete method.
9320 (Icf::section_reloc_list): Delete method.
9321 (Icf::reloc_info_list): New method.
9322 (Icf::reloc_info_list_): New member.
9323
f96accdf
DK
93242010-02-19 Doug Kwan <dougkwan@google.com>
9325
9326 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9327 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9328 * arm.cc (Arm_relocation_functions): New forward declaration.
9329 (Target_arm::Target_arm): Initialize new data members
9330 got_mod_index_offset_ and tls_base_symbol_defined_.
9331 (Target_arm::Relocate::relocate_tls): New method.
9332 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9333 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9334 New methods.
2e702c99 9335 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9336 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9337 (Target_arm::got_mod_index_offset_,
9338 Target_arm::tls_base_symbol_defined_): New data members.
9339 (Target_arm::Scan::local, Target::Scan::global,
9340 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9341 relocations.
9342
c8761b9a
DK
93432010-02-18 Doug Kwan <dougkwan@google.com>
9344
9345 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9346 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9347 text section as a parameter becuase some broken tools may not set
9348 the link in section header.
9349 (Target_arm::has_got_section): New method.
9350 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9351 without any mapping symbol as data only. Remove warning.
9352 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9353 link in its section header, try to discover the link by inspecting the
9354 REL31 relocation at the beginning of the section.
9355 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9356 in error message.
9357 (Target_arm::Scan::global): Treat any reference to the symbol
9358 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9359
21bb3914
ST
93602010-02-12 Sriraman Tallam <tmsriram@google.com>
9361
9362 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9363 (Scan::global_reloc_may_be_function_pointer): New function.
9364 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9365 (Scan::global_reloc_may_be_function_pointer): New function.
9366 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9367 (Scan::global_reloc_may_be_function_pointer): New function.
9368 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9369 (Scan::global_reloc_may_be_function_pointer): New function.
9370 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9371 (Scan::global_reloc_may_be_function_pointer): New function.
9372 (Scan::possible_function_pointer_reloc): New function.
9373 (Target_x86_64::can_check_for_function_pointers): New function.
9374 * gc.h (gc_process_relocs): Scan relocation types to determine if
9375 function pointers were taken for targets that support it.
9376 * icf.cc (Icf::find_identical_sections): Include functions for
9377 folding in safe ICF whose pointer is not taken.
9378 * icf.h (Secn_fptr_taken_set): New typedef.
9379 (fptr_section_id_): New member.
9380 (section_has_function_pointers): New function.
9381 (set_section_has_function_pointers): New function.
9382 (check_section_for_function_pointers): New function.
9383 * options.h: Fix comment for safe ICF option.
9384 * target.h (can_check_for_function_pointers): New function.
9385 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9386 Modify icf_safe_test for X86-64.
9387 * testsuite/Makefile.in: Regenerate.
9388 * testsuite/icf_safe_so_test.cc: New file.
9389 * testsuite/icf_safe_so_test.sh: New file.
9390 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9391 (main): Change to take pointer to function kept_func_3.
9392 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9393 folding is done correctly for X86-64.
9394
0da6fa6c
DM
93952010-02-12 David S. Miller <davem@davemloft.net>
9396
9397 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9398 is_symbolless parameter.
9399 (Output_reloc<SHT_REL>::is_symbolless): New.
9400 (Output_reloc<SHT_REL>::is_symbolless_): New.
9401 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9402 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9403 (Output_reloc<SHT_RELA>::is_symbolless): New.
9404 (Output_data_reloc::add_global): Handle is_symbolless.
9405 (Output_data_reloc::add_global_relative): Likewise.
9406 (Output_data_reloc::add_local): Likewise.
9407 (Output_data_reloc::add_local_relative): Likewise.
9408 (Output_data_reloc::add_symbolless_global_addend): New.
9409 (Output_data_reloc::add_symbolless_local_addend): New.
9410 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9411 is_symbolless.
9412 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9413 instead of ->is_relative_
9414 (Output_reloc::write): Likewise.
9415 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9416 (Output_reloc::write_rel): Simplify.
9417
9418 * sparc.cc (Target_sparc::Scan::local): Use
9419 ->add_symbolless_local_addend as needed.
9420 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9421 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9422 based upon relocation offset.
9423
e4782e83
DK
94242010-02-11 Doug Kwan <dougkwan@google.com>
9425
9426 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9427 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9428 beginning of function.
9429 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9430 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9431 parameter is_32bit in calls to should_apply_static_reloc.
9432 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9433 (check_DATA): Add arm_abs_global.stdout.
9434 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9435 arm_abs_global.stdout): New rules.
9436 (MOSTLLYCLEANFILES): Add arm_abs_global
9437 * Makefile.in: Regenerate.
9438 * testsuite/arm_abs_global.s: New file.
9439 * testsuite/arm_abs_global.sh: Ditto.
9440 * testsuite/arm_abs_lib.s: Ditto.
9441
93ceb764
ILT
94422010-02-11 Ian Lance Taylor <iant@google.com>
9443
9444 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9445 Read_relocs task.
9446 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9447 Allocate_commons_task first.
9448 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9449 task, rather than symtab_lock_.
9450 (Gc_process_relocs::~Gc_process_relocs): New function.
9451 (Gc_process_relocs::is_runnable): Check this_blocker_.
9452 (Gc_process_relocs::locks): Use next_blocker_ rather than
9453 blocker_.
9454 (Scan_relocs::~Scan_relocs): New function.
9455 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9456 symtab_lock_.
9457 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9458 next_blocker_.
9459 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9460 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9461 constructor accordingly.
9462 (class Gc_process_relocs): Likewise.
9463 (class Scan_relocs): Likewise.
9464 * common.h (class Allocate_commons_task): Remove symtab_lock_
9465 field, and corresponding constructor parameter.
9466 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9467 symtab_lock_.
9468 (Allocate_commons_task::locks): Likewise.
9469
114dfbe1
ILT
94702010-02-11 Ian Lance Taylor <iant@google.com>
9471
9472 * gold-threads.h (class Once): Define.
9473 (class Initialize_lock): Rewrite as child of Once.
9474 * gold-threads.cc (class Once_initialize): Define.
9475 (once_pointer_control): New static variable.
9476 (once_pointer, once_arg): New static variables.
9477 (c_run_once): New static function.
9478 (Once::Once, Once::run_once, Once::internal_run): New functions.
9479 (class Initialize_lock_once): Remove.
9480 (initialize_lock_control): Remove.
9481 (initialize_lock_pointer): Remove.
9482 (initialize_lock_once): Remove.
9483 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9484 (Initialize_lock::initialize): Rewrite.
9485 (Initialize_lock::do_run_once): New function.
9486 * archive.cc (Archive::interpret_header): Only clear name if it is
9487 not already empty.
9488 * fileread.cc: Include "gold-threads.h"
9489 (file_counts_lock): New static variable.
9490 (file_counts_initialize_lock): Likewise.
9491 (File_read::release): Only increment counts when using --stats.
9492 Use a lock around the increment.
9493 * parameters.cc (class Set_parameters_target_once): Define.
9494 (set_parameters_target_once): New static variable.
9495 (Parameters::Parameters): Move here from parameters.h.
9496 (Parameters::set_target): Rewrite.
9497 (Parameters::set_target_once): New function.
9498 (Parameters::clear_target): Move here and rewrite.
9499 * parameters.h (class Parameters): Update declarations. Add
9500 set_parameters_target_once_ field.
9501 (Parameters::Parameters): Move to parameters.cc.
9502 (Parameters::clear_target): Likewise.
9503 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9504 task.
9505 (Start_group::~Start_group): New function.
9506 (Start_group::is_runnable): New function.
9507 (Start_group::locks, Start_group::run): New functions.
9508 (Finish_group::run): Change saw_undefined to size_t.
9509 * readsyms.h (class Start_group): Define.
9510 (class Finish_group): Change saw_undefined_ field to size_t.
9511 (Finish_group::Finish_group): Remove saw_undefined and
9512 this_blocker parameters. Change all callers.
9513 (Finish_group::set_saw_undefined): New function.
9514 (Finish_group::set_blocker): New function.
9515 * symtab.h (class Symbol_table): Change saw_undefined to return
9516 size_t. Change saw_undefined_ field to size_t.
9517 * target-select.cc (Set_target_once::do_run_once): New function.
9518 (Target_selector::Target_selector): Initialize set_target_once_
9519 field. Don't initialize lock_ and initialize_lock_ fields.
9520 (Target_selector::instantiate_target): Rewrite.
9521 (Target_selector::set_target): New function.
9522 * target-select.h (class Set_target_once): Define.
9523 (class Target_selector): Update declarations. Make
9524 Set_target_once a friend. Remove lock_ and initialize_lock_
9525 fields. Add set_target_once_ field.
9526
fa17a3f4
ILT
95272010-02-10 Ian Lance Taylor <iant@google.com>
9528
9529 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9530 queueing any tasks.
9531 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9532 (queue_middle_tasks): Add all blockers before queueing any tasks.
9533 (queue_final_tasks): Likewise.
9534 * token.h (Task_token::add_blockers): New function.
9535 * object.h (Input_objects::number_of_relobjs): New function.
9536
c7177d31
ILT
95372010-02-10 Ian Lance Taylor <iant@google.com>
9538
5de0e392
ILT
9539 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9540 shared, not if not position independent.
9541 * x86_64.cc (Relocate::relocate_tls): Likewise.
9542 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9543 (tls_pie_pic_test): New target.
9544 * testsuite/Makefile.in: Rebuild.
9545
c7177d31
ILT
9546 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9547 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9548 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9549 * testsuite/Makefile.in: Rebuild.
9550
684b268a
DM
95512010-02-09 David S. Miller <davem@davemloft.net>
9552
9553 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9554 R_SPARC_RELATIVE using ->add_local_relative().
9555 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9556
612a8d3d
DM
9557 * output.h (Output_data_dynamic::add_section_size): New method
9558 that takes two Output_data objects.
9559 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9560 entry param. Handle it in initializers.
9561 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9562 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9563 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9564 arg.
9565 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9566 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9567 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9568 for dynrel_includes_plt.
9569 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9570 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9571 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9572 before .rela.plt
9573 (Target_sparc::do_finalize_sections): Update to pass true for
9574 dynrel_includes_plt.
9575 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9576 output before .rela.plt
9577 (Target_powerpc::do_finalize_sections): Update to pass true for
9578 dynrel_includes_plt when 32-bit.
9579
cb1be87e
DK
95802010-02-08 Doug Kwan <dougkwan@google.com>
9581
9582 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9583 method.
9584 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9585 Arm_relobj::scan_section_for_cortex_a8_stubs,
9586 Arm_relobj::do_relocation_section): Instead of calling
9587 Output_section::output_address, use faster
9588 Arm_relobj::simple_input_section_output_address.
9589
705b5121
DM
95902010-02-08 David S. Miller <davem@davemloft.net>
9591
9592 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9593 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9594 relocation helper function.
9595
024c4466
DM
9596 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9597 just like R_SPARC_GOT{10,13,22}.
9598 (Target_sparc::Scan::local): Likewise.
9599 (Target_sparc::Relocate:relocate): Likewise.
9600
9109c078
ILT
96012010-02-06 Ian Lance Taylor <iant@google.com>
9602
9603 * configure.ac: Rewrite targetobjs duplicate removal code to use
9604 only shell constructs.
9605 * configure: Rebuild.
9606
cf846138
DK
96072010-02-05 Doug Kwan <dougkwan@google.com>
9608
9609 PR 11247
9610 * arm.cc (Arm_relobj::section_is_scannable): New method.
9611 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9612 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9613
6cfaf60b
DK
96142010-02-04 Doug Kwan <dougkwan@google.com>
9615
9616 PR 11247
9617 * arm-reloc-property.cc (cstdio): Include.
9618 * configure.ac (targetobjs): Remove duplicates.
9619 * configure: Regenerate.
9620 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9621 big and little endian version for a given address size.
9622
5c57f1be
DK
96232010-02-03 Doug Kwan <dougkwan@google.com>
9624
9625 * arm-reloc-property.cc
9626 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9627 definition.
9628 * arm-reloc-property.h
9629 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9630 New method definition.
9631 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9632 declaration.
9633 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9634 overflow to N.
9635 (GOT_PREL): Change implemented to Y.
9636 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9637 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9638 (Arm_relocate_functions::movw_abs_nc): Remove method.
9639 (Arm_relocate_functions::movt_abs): Ditto.
9640 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9641 (Arm_relocate_functions::thm_movt_abs): Ditto.
9642 (Arm_relocate_functions::movw_rel_nc): Ditto.
9643 (Arm_relocate_functions::movw_rel): Ditto.
9644 (Arm_relocate_functions::movt_rel): Ditto.
9645 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9646 (Arm_relocate_functions:thm_movw_rel): Ditto.
9647 (Arm_relocate_functions:thm_movt_rel): Ditto.
9648 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9649 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9650 New method definitions.
9651 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9652 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9653 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9654 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9655 (Target_arm::Relocate::relocate): Check for non-static or
9656 unimplemented relocation code and exit early. Change calls to
9657 Target_arm::reloc_uses_thumb_bit and
9658 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9659 instead. Refactor code to handle similar relocations to increase
9660 code sharing. Remove check for unsupported relocation code in switch
9661 statement.
9662 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9663 relocation property table to find out size. Change error message to
9664 print out the name of a relocation code instead of the numeric value.
9665 (Target_arm::scan_reloc_for_stub): Use relocation property table
9666 instead of calling Target_arm::reloc_uses_thumb_bit().
9667
218c5831
DK
96682010-02-02 Doug Kwan <dougkwan@google.com>
9669
9670 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9671 types of relaxed input section.
9672
0d31c79d
DK
96732010-02-02 Doug Kwan <dougkwan@google.com>
9674
9675 * Makefile.am (HFILES): Add arm-reloc-property.h.
9676 (DEFFILES): New.
2e702c99
RM
9677 (TARGETSOURCES): Add arm-reloc-property.cc
9678 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9679 (libgold_a_SOURCES): $(DEFFILES)
9680 * Makefile.in: Regenerate.
9681 * arm-reloc-property.cc: New file.
9682 * arm-reloc-property.h: New file.
9683 * arm-reloc.def: New file.
9684 * arm.cc: Update comments.
9685 (arm-reloc-property.h): New included header.
9686 (arm_reloc_property_table): New global variable.
9687 (Target_arm::do_select_as_default_target): New method definition.
9688 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9689 arm-reloc-property to targ_extra_obj.
9690 * parameters.cc (set_parameters_target): Call
9691 Target::select_as_default_target().
9692 * target.h (Target::select_as_default_target): New method definition.
9693 (Target::do_select_as_default_target): Same.
9694
546c7457
DK
96952010-02-01 Doug Kwan <dougkwan@google.com>
9696
9697 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9698 first_output_text_section_.
9699 (Arm_exidx_fixup::first_output_text_section): New method definition.
9700 (Arm_exidx_fixup::first_output_text_section_): New data member.
9701 (Arm_exidx_fixup::process_exidx_section): Record the first text
9702 output section seen.
9703 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9704 and entsize in output section header.
9705
11b861d5
DK
97062010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9707
9708 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9709 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9710 (Arm_relocate_functions::thm_alu11): New Method.
9711 (Arm_relocate_functions::thm_pc8): New Method.
9712 (Arm_relocate_functions::thm_pc12): New Method.
9713 (Target_arm::Scan::local): Handle the relocations.
9714 (Target_arm::Scan::global): Likewise.
9715 (Target_arm::Relocate::relocate): Likewise.
9716 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9717
c9a2c125
DK
97182010-01-29 Doug Kwan <dougkwan@google.com>
9719
9720 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9721 of relocation types as ld.
9722
1521477a
DK
97232010-01-29 Doug Kwan <dougkwan@google.com>
9724
9725 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9726 to public.
9727 (Arm_relocate_functions::thumb_branch_common): Ditto.
9728 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9729 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9730 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9731 Arm_relocate_functions::jump24): Remove.
9732 (Target_arm::Relocate::relocate): Adjust code to call
9733 Arm_relocation_functions::arm_branch_common and
9734 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9735 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9736
e7eca48c
DK
97372010-01-29 Doug Kwan <dougkwan@google.com>
9738
9739 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9740 output_local_symbol_count_needs_update_.
9741 (Arm_relobj::output_local_symbol_count_needs_update,
9742 Arm_relobj::set_output_local_symbol_count_needs_update,
9743 Arm_relobj::update_output_local_symbol_count): New methods.
9744 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9745 member.
9746 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9747 of pointed function as in a R_ARM_PREL31 relocation.
9748 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9749 for output local symbol count updating.
9750 (Target_arm::do_relax): Update output local symbol counts in objects
9751 if necessary.
9752 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9753
02961d7e
ILT
97542010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9755
9756 * arm.cc: Added support for the ARM relocations:
9757 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9758 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9759 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9760 movw_prel_nc).
9761 (Arm_relocate_functions::movw_rel): New method.
9762 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9763 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9764 thm_movw_prel_nc).
9765 (Arm_relocate_functions::thm_movw_rel): New method.
9766 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9767 thm_movt_prel).
9768 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9769 relocations.
9770 (Target_arm::Scan::global): Likewise.
9771 (Target_arm::Relocate::relocate): Likewise.
9772 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9773 Likewise.
9774
b10d2873
ILT
97752010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9776
9777 * arm.cc: Added support for ARM group relocations.
9778 (Target_arm::reloc_needs_sym_origin): New method.
9779 (Arm_relocate_functions::calc_grp_kn): New method.
9780 (Arm_relocate_functions::calc_grp_residual): New method.
9781 (Arm_relocate_functions::calc_grp_gn): New method.
9782 (Arm_relocate_functions::arm_grp_alu): New Method.
9783 (Arm_relocate_functions::arm_grp_ldr): New Method.
9784 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9785 (Arm_relocate_functions::arm_grp_ldc): New Method.
9786 (Target_arm::Scan::local): Handle the ARM group relocations.
9787 (Target_arm::Scan::global): Likewise.
9788 (Target_arm::Relocate::relocate): Likewise.
9789 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9790 Likewise.
9791
2b328d4e
DK
97922010-01-26 Doug Kwan <dougkwan@google.com>
9793
9794 * arm.cc (set): Include.
9795 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9796 pointer type.
2e702c99 9797 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9798 (Arm_output_section::append_text_sections_to_list): New method.
9799 (Arm_output_section::fix_exidx_coverage): Ditto.
9800 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9801 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9802 Relobj::set_section_offset() instead of
9803 Sized_relobj::invalidate_section_offset().
2e702c99 9804 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9805 parameter for section headers. Ignore relocation sections for
9806 unallocated sections and EXIDX sections.
9807 (Target_arm::fix_exidx_coverage): New method.
9808 (Target_arm::output_section_address_less_than): New type.
9809 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9810 linked text section instead of the EXIDX section.
9811 (Arm_output_section::create_stub_group): Add an assertion to check
9812 that this is not an EXIDX output section.
9813 (Arm_output_section::append_text_sections_to_list): New method.
9814 (Arm_output_section::fix_exidx_coverage): Ditto.
9815 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9816 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9817 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9818 first pass.
9819 (Target_arm::fix_exidx_coverage): New method.
9820 * object.h (Relobj::set_output_section): New method.
9821 (Sized_relobj::invalidate_section_offset): Remove method.
9822 (Sized_relobj::do_invalidate_section_offset): Remove method.
9823 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9824
c7f3c371
DK
98252010-01-25 Doug Kwan <dougkwan@google.com>
9826
9827 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9828 Fix warning due to signed and unsigned comparison on a 32-bit host.
9829
8923b24c
DK
98302010-01-22 Doug Kwan <dougkwan@google.com>
9831
9832 * arm.cc (Target_arm::do_relax): Record an output section for section
9833 offset adjustment it contains any stub table that has changed.
9834 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9835 offsets in an output section if necessary.
9836 * output.cc (Output_section::Output_section): Initialize
9837 section_offsets_need_adjustments_.
9838 (Output_section::add_input_section_for_script): Renamed to
9839 Output_section::add_simple_input_section.
9840 (Output_section::save_states): Add a comment.
9841 (Output_section::discard_states): New method defintion.
9842 (Output_section::adjust_section_offsets): Same.
9843 * output.h (Output_section::add_input_section_for_script): Renamed to
9844 Output_section::add_simple_input_section.
9845 (Output_section::discard_states): New method declaration.
9846 (Output_section::adjust_section_offsets): Same.
9847 (Output_section::section_offsets_need_adjustment,
9848 Output_section::set_section_offsets_need_adjustment): New method
9849 definitions.
9850 (Output_section::section_offsets_need_adjustment_): New data member.
9851 * script-sections.cc
9852 (Output_section_element_input::set_section_address): Adjust code for
9853 renaming of Output_section::add_input_section_for_script.
9854 (Orphan_output_section::set_section_address): Same.
9855
9b2fd367
DK
98562010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9857
9858 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9859 Fix_v4bx enum values .
9860 * gold/options.h (General_options): New option definitions.
9861 (General_options::fix_v4bx): New method.
9862 (General_options::Fix_v4bx): New enum.
9863 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9864 (General_options::parse_fix_v4bx_interworking): New method.
9865
80d0d023
DK
98662010-01-22 Doug Kwan <dougkwan@google.com>
9867
9868 * arm.cc (Arm_exidx_fixup): New class.
9869
af2cdeae
DK
98702010-01-21 Doug Kwan <dougkwan@google.com>
9871
9872 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9873 classes.
9874 (Arm_exidx_section_offset_map): New type.
9875
993d07c1
DK
98762010-01-21 Doug Kwan <dougkwan@google.com>
9877
9878 * arm.cc (Arm_exidx_input_section): New class.
9879 (Arm_relobj::exidx_input_section_by_link,
9880 Arm_relobj::exidx_input_section_by_shndx,
9881 Arm_relobj::make_exidx_input_section): New methods.
9882 (read_arm_attributes_section): Remove.
9883 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9884 information about them.
9885 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9886 to here.
9887
5ac169d4
DK
98882010-01-20 Doug Kwan <dougkwan@google.com>
9889
9890 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9891 Input_section_specifier to Section_id.
9892 (Target_arm::new_arm_input_section: Adjust code for change of key
9893 type.
9894 (Target_arm::find_arm_input_section): Ditto.
9895 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9896 (Section_id): Remove.
9897 (Garbage_collection::Section_id_hash): Remove.
9898 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9899 (Section_id): Remove.
9900 (Icf::Section_id_hash): Remove.
9901 * object.h (Section_id, Const_section_id, Section_id_hash,
9902 Const_section_id_hash): New type definitions.
9903 * output.cc (Output_section::add_relaxed_input_section): Change to
9904 use Const_section_id instead of Input_section_specifier as key type.
9905 (Output_section::add_merge_input_section): Ditto.
9906 (Output_section::build_relaxation_map): Change to use Section_id
9907 instead of Input_section_specifier as key type.
2e702c99 9908 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9909 Ditto.
9910 (Output_section::convert_input_sections_to_relaxed_sections): Change
9911 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9912 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9913 (Output_section::find_relaxed_input_section): Ditto.
9914 * output.h (Input_section_specifier): Remove class.
9915 (Output_section::Output_section_data_by_input_section_map): Change
9916 key type to Const_section_id.
9917 (Output_section::Output_relaxed_input_section_by_input_section_map):
9918 Ditto.
9919 (Output_section::Relaxation_map): Change key type to Section_id.
9920
a2162063
ILT
99212010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9922
9923 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9924 (class Arm_v4bx_stub): New class.
9925 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9926 (Stub_factory::make_arm_v4bx_stub): New method.
9927 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9928 (Stub_table::empty): Handle v4bx stubs.
9929 (Stub_table::add_arm_v4bx_stub): New method.
9930 (Stub_table::find_arm_v4bx_stub): New method.
9931 (Arm_relocate_functions::v4bx): New method.
9932 (Target_arm::fix_v4bx): New method.
9933 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9934 (Stub_table::relocate_stubs): Likewise.
9935 (Stub_table::do_write): Likewise.
9936 (Stub_table::update_data_size_and_addralign): Likewise.
9937 (Stub_table::finalize_stubs): Likewise.
9938 (Target_arm::Scan::local): Likewise.
9939 (Target_arm::Scan::global): Likewise.
9940 (Target_arm::do_finalize_sections): Likewise.
9941 (Target_arm::Relocate::relocate): Likewise.
9942 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9943 Likewise.
9944 (Target_arm::scan_reloc_for_stub): Likewise.
9945 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9946
5696ab0b
ILT
99472010-01-19 Ian Lance Taylor <iant@google.com>
9948
9949 * output.cc (Output_section_headers::do_sized_write): Write large
9950 segment count to sh_info field.
9951 (Output_file_header::do_sized_write): For large segment count,
9952 write PN_XNUM to e_phnum field.
9953
800d0f56
ILT
99542010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9955
9956 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9957 (Arm_relocate_functions::thm_jump8): New function.
9958 (Arm_relocate_functions::thm_jump11): New function.
9959 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9960 R_ARM_THM_JUMP11.
9961 (Target_arm::Scan::global): Likewise.
9962 (Target_arm::Relocate::relocate): Likewise.
9963 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9964 Likewise.
9965
41263c05
DK
99662010-01-14 Doug Kwan <dougkwan@google.com>
9967
9968 * arm.cc (map, utility): Include headers.
9969 (Target_arm::apply_cortex_a8_workaround): New method.
9970 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9971 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9972 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9973 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9974 the --[no-]fix-cortex-a8 command line options.
9975 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9976 (Target_arm::relocate_stub): Use addend in instruction template.
9977 * options.h (DEFINE_bool): Set the user-set flag.
9978 (General_options): Add --[no-]-fix-cortex options.
9979 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9980 : Update fast look-up map after conversion.
41263c05 9981
459e9b03
ST
99822010-01-14 Sriraman Tallam <tmsriram@google.com>
9983
9984 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9985 in the first pass of do_layout.
9986
b521dfe4
DK
99872010-01-13 Doug Kwan <dougkwan@google.com>
9988
9989 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9990 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9991 apparent compiler problem of not folding static constant integral
9992 data members of elfcpp::Elf_sizes<32>.
9993
44272192
DK
99942010-01-13 Doug Kwan <dougkwan@google.com>
9995
9996 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9997 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9998 Arm_relobj::scan_section_for_cortex_a8_erratum,
9999 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10000 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10001 sections to scan for relocation stubs into a new method
10002 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10003 relocation and Cortex-A8 stub scanning.
10004 (Target_arm::do_relax): Force stubs to be after stubbed sections
10005 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10006 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10007 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10008
44b71ece
ILT
100092010-01-12 Ian Lance Taylor <iant@google.com>
10010
10011 * target-reloc.h (visibility_error): New inline function.
10012 (relocate_section): Call visibility_error.
10013 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10014 (MOSTLYCLEANFILES): Likewise.
10015 (protected_4_pic.o, protected_3.err): New targets.
10016 * testsuite/protected_4.cc: New file.
10017
a120bc7f
DK
100182010-01-12 Doug Kwan <dougkwan@google.com>
10019
10020 * arm.cc (Cortex_a8_reloc): New class.
10021 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10022 and cortex_a8_relocs_info_.
10023 (Target_arm::fix_cortex_a8): New method definition.
10024 (Target_arm::Cortex_a8_relocs_info): New type.
10025 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10026 New data member declarations.
10027 (Target_arm::scan_reloc_for_stub): Record information about
10028 relocations for THUMB branches that might be exempted from the
10029 Cortex-A8 workaround.
10030 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10031 at the beginning of a relaxation pass.
10032
20138696
DK
100332010-01-12 Doug Kwan <dougkwan@google.com>
10034
10035 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10036 (Arm_relobj::Mapping_symbol_position,
10037 Arm_reloj::Mapping_symbol_position_less,
10038 Arm_relobj::Mapping_symbols_info): New types.
10039 (Target_arm::is_mapping_symbol_name): New method definition.
10040 (Arm_relobj::do_count_local_symbols): Save information about mapping
10041 symbols.
10042
089d69dc
DK
100432010-01-11 Doug Kwan <dougkwan@google.com>
10044
10045 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10046 Arm_relocate_functions::thumb32_branch_upper,
10047 Arm_relocate_functions::thumb32_branch_lower,
10048 Arm_relocate_functions::thumb32_cond_branch_offset,
10049 Arm_relocate_functions::thumb32_cond_branch_upper,
10050 Arm_relocate_functions::thumb32_cond_branch_lower,
10051 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10052 branch offset encoding.
10053 (Arm_relocate_functions::thumb_branch_common): Use new branch
10054 offset encoding methods to avoid code duplication.
10055 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10056 (Stub_addend_reader::operator()): Use new branch encoding method
10057 to avoid code duplication.
10058
99e5bff2
DK
100592010-01-11 Doug Kwan <dougkwan@google.com>
10060
10061 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10062 (Target_arm::do_finalize_sections): Define special EXIDX section
10063 symbols only if referenced.
10064 * gc.h (Garbage_collection::add_reference): New method.
10065 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10066 code duplication.
10067
98e090bd
ILT
100682010-01-11 Ian Lance Taylor <iant@google.com>
10069
d0a91bd8
ILT
10070 * script.cc (Version_script_info::build_expression_list_lookup):
10071 Change complaing about duplicate wildcard match from error to
10072 warning.
10073
98e090bd
ILT
10074 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10075 of 2009-12-30.
10076 (Version_script_info::Version_script_info): Initialize globs_,
10077 default_version_, default_is_global_, and exact_. Don't
10078 initialize globals_ or locals_.
10079 (Version_script_info::build_lookup_tables): Build local symbols
10080 first.
10081 (Version_script_info::unquote): New function.
10082 (Version_script_info::add_exact_match): New function.
10083 (Version_script_info::build_expression_list_lookup): Remove lookup
10084 parameter. Add is_global parameter. Change all callers. Handle
10085 wildcard pattern specially. Unquote pattern. Call
10086 add_exact_match.
10087 (Version_script_info::get_name_to_match): New function.
10088 (Version_script_info::get_symbol_version): New function.
10089 (Version_script_info::get_symbol_version_helper): Remove.
10090 (Version_script_info::check_unmatched_names): Call unquote.
10091 * script.h (class Version_script_info): Change get_symbol_version
10092 to be non-inline and add is_global parameter; change all callers.
10093 Rewrite symbol_is_local. Update declarations. Define struct
10094 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10095 Remove globals_ and locals_ members. Add exact_, globs_,
10096 default_version_, is_global_.
10097 (Version_script_info::Glob): Remove pattern, add expression and
10098 is_global. Update constructor. Change all callers.
10099 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10100 default version.
10101 (Versions::symbol_section_contents): If a symbol is undefined, or
10102 defined in a dynamic object, set the version index to
10103 VER_NDX_LOCAL.
10104 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10105 symbol_is_local.
10106 (Symbol_table::add_from_pluginobj): Likewise.
10107 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10108
d56962d3
DK
101092010-01-11 Doug Kwan <dougkwan@google.com>
10110
10111 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10112 (incremental_dump_LDADD): Add linking option for libintl.
10113 * Makefile.in: Regenerate.
10114
94e6ee91
L
101152010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10116
10117 PR gold/11144
10118 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10119 instead of -Ds.
10120 * testsuite/Makefile.in: Regenerated.
10121
e96c574b
DK
101222010-01-10 Doug Kwan <dougkwan@google.com>
10123
10124 * options.h (DEFINE_var): Use parentheses around argument varname__
10125 in macro body to avoid any unintended subsequent substitutions.
10126
7198066b
ILT
101272010-01-10 Ian Lance Taylor <iant@google.com>
10128
ba4d53bf
ILT
10129 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10130 candidates before doing symbol resolution.
10131
7198066b
ILT
10132 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10133 ODR candidates if only one is weak.
10134
a2beed37
ILT
101352010-01-08 Ian Lance Taylor <iant@google.com>
10136
10137 * script.cc (Version_script_info::build_expression_list_lookup):
10138 Don't warn about ambiguous version, just record the ambiguity.
10139 (Version_script_info::get_symbol_version_helper): Give error if
10140 version is ambiguous.
10141
2fb7225c
DK
101422010-01-08 Doug Kwan <dougkwan@google.com>
10143
10144 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10145 prev_data_size_ and prev_addralign_. Remove initializer for
10146 deleted data member has_been_changed_.
10147 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10148 to determine if the table is empty.
10149 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10150 Remove.
10151 (Stub_table::add_reloc_stub): Define method in class definition
10152 instead of just declaring it there.
10153 (Stub_table::add_cortex_a8_stub): New method definition.
10154 (Stub_table::update_data_size_and_addralign): Ditto.
10155 (Stub_table::finalize_stubs): Ditto.
10156 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10157 (Stub_table::do_addralign_): Return address alignment in the
10158 (Stub_table::do_reset_address_and_file_offset): Define method in
10159 class definition instead of declaring it there. Set current data
10160 size to be the data size of the previous pass.
10161 (Stub_table::set_final_data_size): Use current data size as the
10162 final data size.
10163 (Stub_table::relocate_stub): Change parameter type of stub from
10164 Reloc_stub pointer to Stub pointer.
10165 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10166 (Stub_table::Cortex_a8_stub_list): New typedef.
10167 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10168 Stub_table::prev_addralign_): New data member.
10169 (Arm_relobj::Arm_relobj): Initialize data member
10170 section_has_cortex_a8_workaround_.
10171 (Arm_relobj::section_has_cortex_a8_workaround,
10172 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10173 definitions.
10174 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10175 declarations.
10176 (Target_arm::relocate_stub): Change parameter type of stub from
10177 Reloc_stub pointer to Stub pointer.
10178 (Insn_template::size, Insn_template::alignment): Handle
10179 THUMB16_SPECIAL_TYPE.
10180 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10181 Stub_table::update_data_size_and_addralign,
10182 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10183 definitions.
10184 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10185 (Stub_table::do_write): Ditto.
10186 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10187
880cd20d
ILT
101882010-01-08 Ian Lance Taylor <iant@google.com>
10189
10190 PR 11108
10191 * symtab.h (class Symbol): Remove fields is_target_special_ and
10192 has_plt_offset_. Add field is_defined_in_discarded_section_.
10193 (Symbol::is_defined_in_discarded_section): New function.
10194 (Symbol::set_is_defined_in_discarded_section): New function.
10195 (Symbol::has_plt_offset): Rewrite.
10196 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10197 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10198 Don't initialize is_target_special_ or has_plt_offset_.
10199 Initialize is_defined_in_discarded_section_.
10200 (Symbol_table::add_from_relobj): If appropriate, set
10201 is_defined_in_discarded_section.
10202 * resolve.cc (Symbol::override_base_with_special): Don't test
10203 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10204 * target-reloc.h (relocate_section): Do special handling for
10205 symbols defined in discarded sections for global symbols as well
10206 as local symbols.
10207
2703e3eb
ILT
102082010-01-08 Ian Lance Taylor <iant@google.com>
10209
10210 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10211 the SHT_SYMTAB case.
10212
339d40a3
ILT
102132010-01-08 Ian Lance Taylor <iant@google.com>
10214
10215 * object.cc (Sized_relobj::do_layout): Don't get confused if
10216 layout_eh_frame returns NULL.
10217
abecea76
ILT
102182010-01-08 Ian Lance Taylor <iant@google.com>
10219
10220 PR 11084
10221 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10222 dynamic symbol table, use the normal symbol table.
10223 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10224 symbol table.
10225
6b7dd3f3
ILT
102262010-01-08 Ian Lance Taylor <iant@google.com>
10227
10228 PR 11072
10229 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10230 sections.
10231
36c50e63
L
102322010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10233
10234 * version.cc (print_version): Change to "Copyright 2010".
10235
e291e7b9
ILT
102362010-01-08 Ian Lance Taylor <iant@google.com>
10237
10238 PR 10287
10239 PR 11063
10240 * i386.cc (class Target_i386): Change return type of plt_section
10241 to be non-const.
10242 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10243 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10244 tls_desc_rel_ field.
10245 (Output_data_plt_i386::rel_tls_desc): New function.
10246 (Target_i386::rel_tls_desc_section): New function.
10247 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10248 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10249 R_386_TLS_DESC reloc in rel_tls_desc_section.
10250 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10251 Define struct Tlsdesc_info.
10252 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10253 (Target_x86_64::do_reloc_symbol_index): New function.
10254 (Target_x86_64::add_tlsdesc_info): New function.
10255 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10256 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10257 tlsdesc_rel_ field.
10258 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10259 all callers.
10260 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10261 (Target_x86_64::rela_tlsdesc_section): New function.
10262 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10263 handling.
10264 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10265 (Target_x86_64::do_reloc_addend): New function.
10266 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10267 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10268 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10269 (Output_reloc::type): New function.
10270 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10271 (Output_reloc::is_target_specific): New function.
10272 (Output_reloc::target_arg): New function.
10273 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10274 absolute relocs and target specific relocs.
10275 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10276 add_target_specific.
10277 (class Output_data_reloc) [SHT_RELA]: Likewise.
10278 * output.cc (Output_reloc::Output_reloc): Add four new versions
10279 for absolute relocs and target specific relocs.
10280 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10281 (Output_reloc::get_symbol_index): Likewise.
10282 (Output_reloc::local_section_offset): Check that local_sym_index_
10283 is not TARGET_CODE or 0.
10284 (Output_reloc::symbol_value): Likewise.
10285 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10286 reloc.
10287 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10288 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10289 functions.
10290 * layout.cc (add_target_dynamic_tags): Use output section for
10291 DT_PLTRELSZ and DT_JMPREL.
10292
3a44184e
ILT
102932010-01-07 Ian Lance Taylor <iant@google.com>
10294
10295 PR 11061
10296 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10297 function.
10298 (class Output_data_reloc_generic): Define.
10299 (class Output_data_reloc_base): Change base class to
10300 Output_data_reloc_generic. Change add() method to call
10301 bump_relative_reloc_count for a relative reloc. Remove
10302 sort_relocs_ field.
10303 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10304 to sort_relocs().
10305 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10306 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10307 appropriate.
10308 * layout.h (class Layout): Update declaration.
10309
ea715a34
ILT
103102010-01-07 Ian Lance Taylor <iant@google.com>
10311
10312 * output.h (class Output_data): Add const version of
10313 output_section and do_output_section.
10314 (class Output_section_data): Add const version of
10315 do_output_section.
10316 (class Output_section): Likewise.
10317 * layout.cc (Layout::add_target_dynamic_tags): New function.
10318 * layout.h (class Layout): Update declarations.
10319 * arm.cc (Target_arm::do_finalize_sections): Use
10320 add_target_dynamic_tags.
10321 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10322 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10323 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10324 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10325
659948a4
ILT
103262010-01-07 Ian Lance Taylor <iant@google.com>
10327
10328 PR 11042
10329 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10330 object as needed.
10331
9d3b86f6
ILT
103322010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10333 Ian Lance Taylor <iant@google.com>
10334
10335 PR 11019
10336 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10337 Xindex::read_symtab_xindex.
10338
bb0d3eb0
DK
103392010-01-07 Doug Kwan <dougkwan@google.com>
10340
10341 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10342 (Insn_template::thumb16_bcond_insn): New method declaration.
10343 (Insn_template): Fix spelling.
10344 (Stub::thumb16_special): New method declaration.
10345 (Stub::do_write): Define virtual method which was previously pure
10346 virtual.
10347 (Stub::do_thumb16_special): New method declaration.
10348 (Stub::do_fixed_endian_write): New template member.
10349 (Reloc_stub::do_write): Remove.
10350 (Reloc_stub::do_fixed_endian_write): Remove.
10351 (Cortex_a8_stub): New class definition.
10352 (Stub_factory::make_cortex_a8_stub): New method definition.
10353 (Stub_factory::Stub_factory): Add missing static storage class
10354 qualifier for elf32_arm_stub_a8_veneer_blx.
10355
ffeef7df
ILT
103562010-01-07 Ian Lance Taylor <iant@google.com>
10357
dc3f80fe
ILT
10358 PR 10980
10359 * options.h (class General_options): Add --warn-unresolved-symbols
10360 and --error-unresolved-symbols.
10361 * errors.cc (Errors::undefined_symbol): Implement
10362 --warn-unresolved-symbols.
10363
ffeef7df
ILT
10364 * options.h (class General_options): Add -z text and -z textoff.
10365 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10366
f1ec9ded
ST
103672010-01-06 Sriraman Tallam <tmsriram@google.com>
10368
10369 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10370 (Garbage_collection::cident_sections): New function.
10371 (Garbage_collection::add_cident_section): New function.
10372 (Garbage_collection::cident_sections_): New member.
10373 (gc_process_relocs): Add references to sections whose names are C
10374 identifiers.
10375 * gold.h (cident_section_start_prefix): New constant.
10376 (cident_section_stop_prefix): New constant.
10377 (is_cident): New function.
10378 * layout.cc (Layout::define_section_symbols): Replace string constants
10379 with the newly defined constants.
10380 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10381 C identifiers.
10382 * testsuite/Makefile.am: Add gc_orphan_section_test.
10383 * testsuite/Makefile.in: Regenerate.
10384 * testsuite/gc_orphan_section_test.cc: New file.
10385 * testsuite/gc_orphan_section_test.sh: New file.
10386
6eda8c29
ILT
103872010-01-06 Ian Lance Taylor <iant@google.com>
10388
b9674e17
ILT
10389 PR 10980
10390 * options.h (class General_options): Add --warn-shared-textrel.
10391 * layout.cc (Layout::finish_dynamic_section): Implement
10392 --warn-shared-textrel.
10393
6eda8c29
ILT
10394 PR 10980
10395 * options.h (class General_options): Add --warn-multiple-gp.
10396
32dcd44e
ILT
103972010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10398
10399 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10400 $(THREADSLIB) and $(LIBDL).
10401 * Makefile.in: Rebuild.
10402
a192ba05
ILT
104032010-01-06 Ian Lance Taylor <iant@google.com>
10404
10405 PR 10980
10406 * options.cc (General_options::parse_section_start): New function.
10407 (General_options::section_start): New function.
10408 (General_options::General_options): Initialize all members.
10409 * options.h: Include <map>
10410 (class General_options): Add --section-start. Add section_starts_
10411 member.
10412 * layout.cc (Layout::attach_allocated_section_to_segment): If
10413 --section-start was used, set the address of the segment. Remove
10414 local sort_sections.
10415 (Layout::relaxation_loop_body): If the address of the load segment
10416 has been set by --section-start, don't use it.
10417 * output.h (Output_segment::update_flags_for_output_section): New
10418 function.
10419 * output.cc (Output_segment::add_output_section): Call
10420 update_flags_for_output_section.
10421
dde3f402
ILT
104222010-01-05 Ian Lance Taylor <iant@google.com>
10423
62dfdd4d
ILT
10424 PR 10980
10425 * options.h (class General_options): Add --undefined-version.
10426 * script.cc (struct Version_expression): Add was_matched_by_symbol
10427 field.
10428 (Version_script_info::matched_symbol): New function.
10429 (Version_script_info::get_symbol_version_helper): Call
10430 matched_symbol.
10431 (Version_script_info::check_unmatched_names): New function.
10432 * script.h (class Version_script_info): Update declarations.
10433 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10434
9c4ae156
ILT
10435 * options.h (class General_options): Use DEFINE_bool_alias for
10436 allow_multiple_definition.
10437 * resolve.cc (Symbol_table::should_override): Don't test
10438 allow_multiple_definition.
10439
dde3f402
ILT
10440 PR 10980
10441 * options.h (class General_options): Add --cref.
10442 * main.cc (main): Print cref table if --cref. Don't close mapfile
10443 until after printing cref table.
10444 * cref.cc: Include "symtab.h".
10445 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10446 (Cref_table_compare::operator()): New function.
10447 (Cref_inputs::gather_cref): New function.
10448 (filecol): New static const.
10449 (Cref_inputs::print_cref): New function.
10450 (Cref::print_cref): New function.
10451 * cref.h: Include <cstdio>.
10452 (class Cref): Update declarations.
10453 * mapfile.h (Mapfile::file): New function.
10454 * object.h (class Object): Define Symbols. Declare virtual
10455 do_get_global_symbols.
10456 (Object::get_global_symbols): New function.
10457 * object.cc (Input_objects::add_object): Pass object to cref_ if
10458 --cref.
10459 (Input_objects::archive_start): Likewise.
10460 (Input_objects::archive_stop): Likewise.
10461 (Input_objects::print_cref): New function.
10462 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10463 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10464 --cref.
10465 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10466 function.
10467 * plugin.h (class Sized_pluginobj): Update declarations.
10468
8781f709
ILT
104692010-01-05 Ian Lance Taylor <iant@google.com>
10470
10471 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10472 to is_default_version. Rename insdef to insdefault.
10473 (Symbol_table::add_from_relobj): Rename def to is_default_version
10474 and local to is_forced_local.
10475 (Symbol_table::add_from_pluginobj): Likewise.
10476 (Symbol_table::add_from_dynobj): Likewise.
10477 (Symbol_table::define_special_symbol): Rename insdef to
10478 insdefault.
10479
fe35d28d
ILT
104802010-01-04 Ian Lance Taylor <iant@google.com>
10481
30bc8c46
ILT
10482 PR 10980
10483 * options.h (class General_options): Add
10484 --allow-multiple-definition and -z muldefs.
10485 * resolve.cc (Symbol_table::should_override): Don't warn about a
10486 multiple symbol definition if --allow-multiple-definition or -z
10487 muldefs.
10488
7eaea549
ILT
10489 PR 10980
10490 * options.h (class General_options): Add --add-needed and
10491 --copy-dt-needed-entries. Tweak --as-needed help entry.
10492 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10493 error if --copy-dt-needed-entries aka --add-needed is used and
10494 would cause a change in behaviour.
10495
fe35d28d
ILT
10496 PR 10980
10497 * options.h (class General_options): Add -G as a short version of
10498 --shared. Add no-op options -assert, -g, and -i.
10499
55a2bb35
ST
105002010-01-04 Sriraman Tallam <tmsriram@google.com>
10501
10502 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10503 check for .text or .gnu.linkonce.t sections.
10504 * icf.cc (Icf::find_identical_sections): Ditto.
10505 Change the detection for mangled function name within the section
10506 name.
10507 * icf.h (is_section_foldable_candidate): New function.
10508
719328e1
ILT
105092009-12-30 Ian Lance Taylor <iant@google.com>
10510
10511 PR 10980
10512 * options.h (class General_options): Permit two dashes with
10513 --retain-symbols-file.
10514
d7bb5745
ILT
105152009-12-30 Ian Lance Taylor <iant@google.com>
10516
403a15dd
ILT
10517 PR 10979
10518 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10519 don't put the file header and segment headers in the text
10520 segment.
10521
eda294df
ILT
10522 PR 10979
10523 * common.cc (Sort_commons::operator()): Stabilize sort when both
10524 entries are NULL.
10525 (Symbol_table::do_allocate_commons_list): When allocating common
10526 symbols, skip a symbol which is no longer common.
10527 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10528 an object before checking its type.
10529 * testsuite/common_test_2.c: New file.
10530 * testsuite/common_test_3.c: New file.
10531 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10532 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10533 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10534 (common_test_2_pic.o, common_test_2.so): New targets.
10535 (common_test_3_pic.o, common_test_3.so): New targets.
10536 * testsuite/Makefile.in: Rebuild.
10537
d7bb5745
ILT
10538 PR 10979
10539 * script.cc (read_input_script): If we see a new SECTIONS clause,
10540 and we have added an input section, give an error.
10541 * layout.h (class Layout): Add have_added_input_section function.
10542 Add have_added_input_section_ field.
10543 * layout.cc (Layout::Layout): Initialize
10544 have_added_input_section_.
10545 (Layout::layout): Set have_added_input_section_.
10546 (Layout::layout_eh_frame): Likewise.
10547
fc59c572
ILT
105482009-12-30 Ian Lance Taylor <iant@google.com>
10549
10550 PR 10931
10551 * options.h (class General_options): Add --sort-common option.
10552 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10553 * common.cc (Sort_common): Add sort_order parameter to
10554 constructor. Add sort_order_ field.
10555 (Sort_commons::operator): Check sort_order_.
10556 (Symbol_table::allocate_commons): Determine the sort order.
10557 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10558 Change all callers.
10559 (Symbol_table::do_allocate_commons_list): Likewise.
10560
1c74fab0
ILT
105612009-12-30 Ian Lance Taylor <iant@google.com>
10562
10563 PR 10916
10564 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10565 symbols from this object, don't change the visibility of an
10566 undefined symbol.
10567 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10568
6affe781
ILT
105692009-12-30 Ian Lance Taylor <iant@google.com>
10570
10571 PR 10861
10572 * script.h (class Version_script_info): Define Language enum.
10573 Update declarations. Define Glob, Exact, and Lookup types. Add
10574 new fields globals_, locals_, and is_finalized_.
10575 * script.cc: Various formatting fixes.
10576 (class Parser_closure): Change language_stack_ from a vector of
10577 std::string to one of Version_script_info::Language. Adjust all
10578 uses accordingly.
10579 (class Lazy_demangler): Remove.
10580 (struct Version_expression): Change language from std::string to
10581 Version_script_info::Language.
10582 (Version_script_info::Version_script_info): New function.
10583 (Version_script_info::~Version_script_info): Don't call clear.
10584 (Version_script_info::finalize): New function.
10585 (Version_script_info::build_lookup_tables): New function.
10586 (Version_script_info::build_expression_list_lookup): New
10587 function.
10588 (Version_script_info::get_symbol_version_helper): Rewrite to use
10589 lookup tables.
10590 (Version_script_info::print_expression_list): Adjust to use
10591 Version_script_info::Language.
10592 (script_push_lex_into_version_mode): Check that the version script
10593 has not been finalized.
10594 (version_script_push_lang): Change language string to
10595 Version_script_info::Language.
10596 * options.cc (Command_line::version_script): New function.
10597 * options.h (class General_options): Add finalize_dynamic_list
10598 function. Change version_script from declaration to definition.
10599 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10600 * testsuite/version_script.map: Remove duplicate def of foo.
10601 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10602 version_script.map.
10603 * testsuite/Makefile.in: Rebuild.
10604
818bf354
ILT
106052009-12-30 Ian Lance Taylor <iant@google.com>
10606
10607 PR 10843
10608 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10609 if the input symbol index is 0, make the output symbol index 0.
10610
ebcc8304
ILT
106112009-12-30 Ian Lance Taylor <iant@google.com>
10612
10613 PR 10670
10614 * options.h (class General_options): Add -x/--discard-all.
10615 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10616 --discard-all. If the local symbol needs a dynamic entry, check
10617 that before handling --discard-locals.
10618
176fe33f
ILT
106192009-12-30 Ian Lance Taylor <iant@google.com>
10620
bb321bb1
ILT
10621 PR 10450
10622 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10623 flags to PF_R.
10624 (Output_segment::add_output_section): Don't change the flags if
10625 the type is PT_TLS.
10626
176fe33f
ILT
10627 PR 10450
10628 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10629 GNU hash table if they need a dynamic value. Otherwise, don't add
10630 them if they are defined in a dynamic object or are forced local.
10631
e8cd95c7
ILT
106322009-12-29 Ian Lance Taylor <iant@google.com>
10633
1b81fb71
ILT
10634 PR 10450
10635 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10636 .gnu.hash table for a 32-bit target.
10637
8d6d383d
ILT
10638 PR 10450
10639 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10640 regular and a dynamic object only needs a dynamic symbol table
10641 entry if it is externally visible.
10642
e785ec03
ILT
10643 PR 10450
10644 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10645 constructor. Add global_offset_table_ field.
10646 (Target_i386::got_section): Set global_offset_table_.
10647 (Target_i386::do_finalize_sections): Set global_offset_table_
10648 size.
10649 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10650 in constructor. Add global_offset_table_ field.
10651 (Target_x86_64::got_section): Set global_offset_table_.
10652 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10653 size.
10654
1a2dff53
ILT
10655 * layout.cc (Layout::Layout): Initialize increase_relro_.
10656 (Layout::get_output_section): Add is_relro, is_last_relro, and
10657 is_first_non_relro parameters. Change all callers.
10658 (Layout::choose_output_section): Likewise.
10659 (Layout::add_output_section_data): Likewise.
10660 (Layout::make_output_section): Likewise.
10661 (Layout::set_segment_offsets): Clear increase_relro when using a
10662 linker script.
10663 * layout.h (class Layout): Add increase_relro method. Add
10664 increase_relro_ field. Update declarations.
10665 * output.cc (Output_section::Output_section): Initialize
10666 is_last_relro_ and is_first_non_relro_.
10667 (Output_segment::add_output_section): Group relro sections is
10668 do_sort is true. Handle is_last_relro and is_first_non_relro.
10669 (Output_segment::maximum_alignment): Remove relro handling.
10670 (Output_segment::set_section_addresses): Add increase_relro
10671 parameter. Change all callers. Add initial alignment to align
10672 relro sections on separate page. Remove old relro handling.
10673 (Output_segment::set_section_list_addresses): Remove in_relro
10674 parameter. Change all callers.
10675 (Output_segment::set_offset): Add increase parameter. Change all
10676 callers. Remove old relro handling.
10677 * output.h (class Output_section): Add new methods: is_last_relro,
10678 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10679 Add is_last_relro_ and is_first_non_relro_ fields.
10680 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10681 Create separate .got.plt section. Call increase_relro.
10682 * x86_64.cc (Target_x86_64::got_section): Likewise.
10683 * testsuite/relro_script_test.t: Add .got.plt.
10684
f0ba79e2
ILT
10685 PR 10450
10686 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10687 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10688 (Layout::finalize): Call set_dynamic_symbol_size.
10689 (Layout::set_dynamic_symbol_size): New function.
10690 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10691 set_dynamic_symbol_size.
10692
e8cd95c7
ILT
10693 PR 10450
10694 * output.h (class Output_section): Add is_entsize_zero_ field.
10695 * output.cc (Output_section::Output_section): Initialize
10696 is_entsize_zero_.
10697 (Output_section::set_entsize): If two different entsizes are
10698 requested, force it to zero.
10699 (Output_section::add_input_section): Set flags for .debug_str
10700 before updating section flags. Set entsize.
10701 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10702 and SHF_STRING if all input sections have those flags.
10703
3e1b9a8a
RÁE
107042009-12-29 Rafael Espindola <espindola@google.com>
10705
10706 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10707 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10708 reporting.
3e1b9a8a 10709
3dcad376
ST
107102009-12-29 Sriraman Tallam <tmsriram@google.com>
10711
10712 * options.cc (General_options::parse_version): Allow -v to exit
10713 without an error if there is nothing to link.
10714
084e2665
ILT
107152009-12-29 Ian Lance Taylor <iant@google.com>
10716
10717 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10718 using a version of gcc before 4.1.
10719 * configure: Rebuild.
10720
250acde3
CD
107212009-12-28 Chris Demetriou <cgd@google.com>
10722
10723 * attributes.cc (Output_attributes_section_data::do_write): Use
10724 std::vector::front rather than std::vector::data.
10725
99fff23b
ILT
107262009-12-28 Ian Lance Taylor <iant@google.com>
10727
10728 * symtab.h (class Symbol_table): Add enum Defined.
10729 * resolve.cc (Symbol_table::should_override): Add defined
10730 parameter. Change all callers. Test whether object is NULL
10731 before calling a method on it.
10732 (Symbol_table::report_resolve_problem): Add defined parameter.
10733 Change all callers.
10734 (Symbol_table::should_override_with_special): Likewise.
10735 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10736 parameter. Change all callers.
10737 (Symbol_table::do_define_in_output_data): Likewise.
10738 (Symbol_table::define_in_output_segment): Likewise.
10739 (Symbol_table::do_define_in_output_segment): Likewise.
10740 (Symbol_table::define_as_constant): Likewise.
10741 (Symbol_table::do_define_as_constant): Likewise.
10742 * script.h (class Symbol_assignment): Add is_defsym parameter to
10743 constructor; change all callers.
10744 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10745 parameter. Change all callers. Add is_defsym_ field.
10746 (class Parser_closure): Add parsing_defsym parameter to
10747 constructor; change all callers. Add parsing_defsym accessor
10748 function. Add parsing_defsym_ field.
10749
556bd683
ILT
107502009-12-28 Ian Lance Taylor <iant@google.com>
10751
10752 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10753 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10754
1782c879
ILT
107552009-12-23 Ian Lance Taylor <iant@google.com>
10756
10757 * i386.cc (Target_i386::do_calls_non_split): Recognize
10758 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10759 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10760 -fsplit-stack prologue when using %r11.
1782c879 10761
329ca2b1
ST
107622009-12-21 Sriraman Tallam <tmsriram@google.com>
10763
10764 * options.cc (General_options::parse_version): Make -v continue and do
10765 the link like GNU ld does.
10766
d675ff46
RÁE
107672009-12-17 Rafael Avila de Espindola <espindola@google.com>
10768
10769 * Makefile.am (CCFILES): Add timer.cc.
10770 (HFILES): Add timer.h.
10771 * configure.ac: Check for sysconf and times.
10772 * main.cc: include timer.h.
10773 (main): Use Timer instead of get_run_time.
10774 * timer.cc: New.
10775 * timer.h: New.
10776 * workqueue.cc: include timer.h.
10777 (Workqueue::find_and_run_task):
10778 Report user, sys and wall time.
10779 * Makefile.in: Regenerate.
10780 * config.in: Regenerate.
10781 * configure: Regenerate.
10782
d6344fb5
DK
107832009-12-16 Doug Kwan <dougkwan@google.com>
10784
10785 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10786 sections.
10787 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10788 relaxed input sections.
10789 * output.cc (Output_section::find_relaxed_input_section): Change
10790 return type to Output_relaxed_input_section pointer. Adjust code
10791 for new type of relaxed_input_section_map_.
10792 * output.h (Output_section::find_relaxed_input_section): Change
10793 return type to Output_relaxed_input_section pointer.
10794 (Output_section::Output_relaxed_input_section_by_input_section_map):
10795 New type.
10796 (Output_section::relaxed_input_section_map_): Change type to
10797 Output_section::Output_relaxed_input_section_by_input_section_map.
10798 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10799 input section.
10800
0e0d5469
ILT
108012009-12-15 Ian Lance Taylor <iant@google.com>
10802
10803 * layout.cc (Layout::create_shstrtab): Only write out after input
10804 sections if we are compressing debug sections.
10805
0649a889
ILT
108062009-12-15 Ian Lance Taylor <iant@google.com>
10807
10808 * archive.cc (Archive::add_symbols): Only look up a symbol without
10809 a version if there is, in fact, a version.
10810
2ea97941
ILT
108112009-12-14 Ian Lance Taylor <iant@google.com>
10812
10813 Revert -Wshadow changes, all changes from:
10814 2009-12-11 Doug Kwan <dougkwan@google.com>
10815 2009-12-11 Nick Clifton <nickc@redhat.com>
10816 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10817
b0eec2cc
DK
108182009-12-11 Doug Kwan <dougkwan@google.com>
10819
10820 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10821 due to -Wshadow.
10822 * attributes.cc (Object_attribute::size): Ditto.
10823 (Attributes_section_data::size): Ditto.
10824 (Attributes_section_data::Attributes_section_data): Ditto.
10825 (Output_attributes_section_data::do_write): Ditto.
10826 * attributes.h (Object_attribute::set_type): Ditto.
10827 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10828
91d6fa6a
NC
108292009-12-11 Nick Clifton <nickc@redhat.com>
10830
10831 * archive.cc: Fix shadowed variable warnings.
10832 * arm.cc: Likewise.
10833 * compressed_output.cc: Likewise.
10834 * compressed_output.h: Likewise.
10835 * configure: Likewise.
10836 * dwarf_reader.cc: Likewise.
10837 * dynobj.cc: Likewise.
10838 * dynobj.h: Likewise.
10839 * ehframe.cc: Likewise.
10840 * ehframe.h: Likewise.
10841 * errors.cc: Likewise.
10842 * expression.cc: Likewise.
10843 * fileread.cc: Likewise.
10844 * fileread.h: Likewise.
10845 * freebsd.h: Likewise.
10846 * i386.cc: Likewise.
10847 * icf.cc: Likewise.
10848 * incremental.h: Likewise.
10849 * layout.cc: Likewise.
10850 * layout.h: Likewise.
10851 * mapfile.cc: Likewise.
10852 * merge.cc: Likewise.
10853 * merge.h: Likewise.
10854 * object.cc: Likewise.
10855 * object.h: Likewise.
10856 * options.h: Likewise.
10857 * output.cc: Likewise.
10858 * output.h: Likewise.
10859 * parameters.cc: Likewise.
10860 * plugin.cc: Likewise.
10861 * powerpc.cc: Likewise.
10862 * reduced_debug_output.cc: Likewise.
10863 * reduced_debug_output.h: Likewise.
10864 * reloc.cc: Likewise.
10865 * reloc.h: Likewise.
10866 * resolve.cc: Likewise.
10867 * script-sections.cc: Likewise.
10868 * script.cc: Likewise.
10869 * script.h: Likewise.
10870 * sparc.cc: Likewise.
10871 * symtab.cc: Likewise.
10872 * symtab.h: Likewise.
10873 * target-select.cc: Likewise.
10874 * target-select.h: Likewise.
10875 * token.h: Likewise.
10876 * workqueue.cc: Likewise.
10877 * workqueue.h: Likewise.
10878 * x86_64.cc: Likewise.
10879
a0351a69
DK
108802009-12-10 Doug Kwan <dougkwan@google.com>
10881
10882 * arm.cc (attributes.h): New include.
10883 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10884 (Arm_relobj::~Arm_relobj): Delete object pointed by
10885 attributes_section_data_.
10886 (Arm_relobj::attributes_section_data): New method definition.
10887 (Arm_relobj::attributes_section_data_): New data member declaration.
10888 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10889 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10890 attributes_section_data_.
10891 (Arm_dynobj::attributes_section_data): New method definition.
10892 (Arm_dynobj::attributes_section_data_): New data member declaration.
10893 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10894 initialization value of may_use_blx_ to false.
2e702c99 10895 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10896 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10897 object attributes to compute results instead of hard-coding.
10898 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10899 Target_arm::get_secondary_compatible_arch,
10900 Target_arm::set_secondary_compatible_arch
10901 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10902 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10903 New method declarations.
10904 (Target_arm::get_aeabi_object_attribute): New method definition.
10905 (Target_arm::attributes_section_data_): New data member declaration.
10906 (read_arm_attributes_section): New template definition.
10907 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10908 (Arm_dynobj::do_read_symbols): Ditto.
10909 (Target_arm::do_finalize_sections): Merge attributes sections from
10910 input. Check for BLX use after attributes section merging.
10911 Fix __exidx_start and __exidx_end visibility. Create an
10912 .ARM.attributes section if necessary.
10913 (Target_arm::get_secondary_compatible_arch,
10914 Target_arm::set_secondary_compatible_arch,
10915 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10916 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10917 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10918 New method definitions.
10919
b59befec
ILT
109202009-12-09 Ian Lance Taylor <iant@google.com>
10921
10922 * plugin.cc (Plugin::load): Don't cast from void* to a function
10923 pointer.
10924
1276bc89
ILT
109252009-12-09 Ian Lance Taylor <iant@google.com>
10926
10927 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10928 information fields.
10929
2f2de248
L
109302009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10931
10932 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10933 Replace two_file_shared_1.so with two_file_shared_2.so.
10934 * testsuite/Makefile.in: Regenerated.
10935
4f787271
DK
109362009-12-08 Doug Kwan <dougkwan@google.com>
10937
10938 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10939 (HFILES): Add attributes.h and int_encoding.h.
10940 * Makefile.in: Regenerate.
10941 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10942 function definitions to int_encoding.cc
10943 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10944 prototypes to int_encoding.h
10945 * reduced_debug_output.cc (int_encoding.h): New include.
10946 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10947 function definitions to int_encoding.cc
10948 (insert_into_vector, read_from_pointer): Move template definitions to
10949 int_encoding.h
10950 * attributes.cc: New file.
10951 * attributes.h: New file.
10952 * int_encoding.cc: New file.
10953 * int_encoding.h: New file.
10954
20b52f1a
RÁE
109552009-12-07 Rafael Avila de Espindola <espindola@google.com>
10956
10957 PR gold/11055
10958 * incremental-dump.cc (dump_incremental_inputs): New.
10959 (main): Use dump_incremental_inputs.
10960
53d7974c
L
109612009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10962
10963 PR gold/10893
10964 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10965 checking elfcpp::STT_FUNC.
10966 (Target_i386::Relocate::relocate): Likewise.
10967 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10968
10969 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10970 symbols from shared libraries into normal FUNC symbols.
10971
10972 * symtab.h (Symbol): Add is_func and use it.
10973
05a352e6
DK
109742009-12-05 Doug Kwan <dougkwan@google.com>
10975
10976 * arm.cc (Target_arm::arm_info): Initialize new fields
10977 attributes_section and attributes_vendor.
10978 * i386.cc (Target_i386::i386_info): Same.
10979 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10980 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10981 fields attributes_section and attributes_vendor.
53d7974c 10982 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10983 * target.h (Target::attributes_section, Target::attributes_vendor,
10984 Target::is_attributes_section, Target::attribute_arg_type,
10985 Target::attributes_order): New method definitions.
10986 (Target::Target_info::attributes_section,
10987 Target::Target_info::attributes_vendor): New fields.
10988 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10989 virtual method definitions.
10990 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10991 attributes_section and attributes_vendor.
10992 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10993
f4e5969c
DK
109942009-12-05 Doug Kwan <dougkwan@google.com>
10995
10996 * arm.cc: Update comments about interworking and stub generation.
10997 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10998 considered as non-PIC.
10999 (Arm_relocate_functions::base_abs): Fix formatting.
11000 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11001 of function to use GOT entry address instead of offset.
11002 (Target_arm::Scan::global): Issue an error if a symbol would need a
11003 PLT does not get one because it is untyped. Remove code to create
11004 dynamic symbols for relative branches.
11005 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11006 takes unsigned integer instead of boolean.
11007
1abce4a6
L
110082009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11009
11010 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11011 (two_file_test_LDADD): Likewise.
11012 (common_test_1_LDADD): Likewise.
11013 (exception_test_LDADD) Likewise.
11014 (weak_test_LDADD): Likewise.
11015 (many_sections_test_LDADD): Likewise.
11016 (initpri1_LDADD): Likewise.
11017 (script_test_1_LDADD): Likewise.
11018 (script_test_2_LDADD): Likewise.
11019 (justsyms_LDADD): Likewise.
11020 (binary_test_LDADD): Likewise.
11021 (large_LDADD): Likewise.
11022 * testsuite/Makefile.in: Regenerated.
11023
adcf2816 110242009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11025
adcf2816
L
11026 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11027 (Symbol_table::override_with_special): Likewise.
11028 (Symbol_table::add_from_object): Likewise.
11029
28e67f5d
RÁE
110302009-12-04 Rafael Avila de Espindola <espindola@google.com>
11031
11032 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11033 Don't set the data_offset twice.
11034
ae10a101
RÁE
110352009-12-04 Rafael Avila de Espindola <espindola@google.com>
11036
11037 * testsuite/Makefile.in: Regenerate.
11038
f59f41f3
DK
110392009-12-03 Doug Kwan <dougkwan@google.com>
11040
11041 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11042 (Target_arm::do_finalize_sections): Add parameter for symbol table
11043 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11044 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11045 parameter for symbol table pointer.
11046 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11047 an additional parameter for a pointer to symbol table.
11048 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11049 parameter for a symbol table pointer.
11050 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11051 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11052 Ditto.
11053 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11054 parameter for a symbol table pointer.
11055
ca55d848
RÁE
110562009-12-03 Rafael Avila de Espindola <espindola@google.com>
11057
11058 * incremental.cc (Incremental_inputs_header)
11059 (Incremental_inputs_header_write, Incremental_inputs_entry)
11060 (Incremental_inputs_entry_write): Move ...
11061 * incremental.h (Incremental_inputs_header)
11062 (Incremental_inputs_header_write, Incremental_inputs_entry)
11063 (Incremental_inputs_entry_write): here.
11064
3aec4f9c
RÁE
110652009-12-02 Rafael Avila de Espindola <espindola@google.com>
11066
11067 * incremental.cc (make_sized_incremental_binary): Set the target.
11068 Error if it is incompatible.
11069 * output.h (Output_file): Add filename method.
11070
9c0ae74d
RÁE
110712009-12-02 Rafael Avila de Espindola <espindola@google.com>
11072
11073 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11074 from the get_* methods.
11075
a45500ae
RÁE
110762009-12-02 Rafael Avila de Espindola <espindola@google.com>
11077
11078 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11079 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11080 Write 0 for the data_offset of scripts.
11081
325e6408
RÁE
110822009-12-02 Rafael Avila de Espindola <espindola@google.com>
11083
11084 * testsuite/Makefile.am: Add the incremental_test.sh test.
11085 * testsuite/incremental_test.sh: New.
11086 * testsuite/incremental_test_1.c: New.
11087 * testsuite/incremental_test_2.c: New.
11088
954c3e2e
RÁE
110892009-12-01 Rafael Avila de Espindola <espindola@google.com>
11090
703d02da 11091 * incremental-dump.cc (main): Fix typos.
954c3e2e 11092
f8086623
RÁE
110932009-11-27 Rafael Avila de Espindola <espindola@google.com>
11094
11095 PR gold/11025
11096 * incremental-dump.cc (main): Use llu to print 64 bit values.
11097
3b0dd6ac
L
110982009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11099 H.J. Lu <hongjiu.lu@intel.com>
11100
11101 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11102 $(LIBDL).
11103 (incremental_dump_LDADD): Likewise.
11104 * Makefile.in: Regenerated.
11105
a6d1ef57 111062009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11107
a6d1ef57
DK
11108 Revert:
11109
11110 2009-11-25 Doug Kwan <dougkwan@google.com>
11111
11112 * arm.cc (Target_arm::Target_arm): Move method definition
11113 outside of class definition. Add code to handle
11114 --target1-rel, --target1-abs and --target2= options.
11115 (Target_arm::get_reloc_reloc_type): Change method to be
11116 non-static and const.
11117 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11118 New data member declaration.
11119 (Target_arm::Scan::local, Target_arm::Scan::global,
11120 Target_arm::Relocate::relocate,
11121 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11122 Adjust call to Target_arm::get_real_reloc_type.
11123 (Target_arm::get_real_reloc_type): Use command line options
11124 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11125 * options.h (--target1-rel, --target1-abs, --target2): New
11126 ARM-only options.
11127
50aeb7d4
DK
111282009-11-25 Doug Kwan <dougkwan@google.com>
11129
11130 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11131 class definition. Add code to handle --target1-rel, --target1-abs
11132 and --target2= options.
11133 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11134 and const.
11135 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11136 member declaration.
11137 (Target_arm::Scan::local, Target_arm::Scan::global,
11138 Target_arm::Relocate::relocate,
11139 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11140 call to Target_arm::get_real_reloc_type.
11141 (Target_arm::get_real_reloc_type): Use command line options to
11142 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11143 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11144 options.
11145
51938283
DK
111462009-11-25 Doug Kwan <dougkwan@google.com>
11147
11148 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11149 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11150 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11151 formatting.
11152 (Arm_relocate_functions::thm_call): Replace body with a call to
11153 Arm_relocate_functions::thumb_branch_common.
11154 (Arm_relocate_functions::thm_jump24,
11155 Arm_relocate_functions::thm_xpc22): New method definitions.
11156 (Arm_relocate_functions::thumb_branch_common): New method definition.
11157 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11158 operator.
11159 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11160 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11161
e2b8f3c4
RÁE
111622009-11-24 Rafael Avila de Espindola <espindola@google.com>
11163
11164 * Makefile.am: Build incremental-dump
11165 * Makefile.in: Regenerate.
11166 * incremental-dump.cc: New.
11167 * incremental.cc (Incremental_inputs_header_data,
11168 Incremental_inputs_entry_data): Move to incremental.h
11169 * incremental.h: (Incremental_inputs_header_data,
11170 Incremental_inputs_entry_data): Move from incremental.cc
11171
bcba9aec
RÁE
111722009-11-24 Rafael Avila de Espindola <espindola@google.com>
11173
11174 * incremental.cc (Incremental_inputs_header,
11175 Incremental_inputs_header_write, Incremental_inputs_entry,
11176 Incremental_inputs_entry_write): Add a typedef with the data type.
11177
7c3afe08
RÁE
111782009-11-24 Rafael Avila de Espindola <espindola@google.com>
11179
11180 * incremental.cc (Incremental_inputs_header,
11181 Incremental_inputs_header_write, Incremental_inputs_entry,
11182 Incremental_inputs_entry_write): Update comment about which
11183 type has the filed descriptions.
11184
d204b6e9
DK
111852009-11-15 Doug Kwan <dougkwan@google.com>
11186
11187 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11188 (Arm_relocate_functions::arm_branch_common): Change method defintion
11189 in class definition to a method declaration and update list of formal
11190 parameters.
11191 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11192 Arm_relocation_functions::jump24): Adjust call to
11193 Arm_relocate_functions::arm_branch_common. Update list of formal
11194 parameters.
11195 (Arm_relocate_functions::xpc25): New method definition.
11196 (Arm_relocate_functions::arm_branch_common): Move method defintion
11197 out from class definition. Use stubs for mode-switching and extending
11198 branch ranges.
11199 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11200 specially. Change code to enable use of stubs in ARM branches.
11201
43d12afe
DK
112022009-11-10 Doug Kwan <dougkwan@google.com>
11203
11204 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11205 in method declaration.
11206 (Target_arm::relocate_stub): New method declaration.
11207 (Target_arm::default_target): Change to return a pointer instead of
11208 a const reference.
11209 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11210 Target_arm::default_target.
11211 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11212 method definition.
11213 (Target_arm::relocate_section): Adjust view.
11214 (Target_arm::relocate_stub): New method definition.
11215
ac33a407
DK
112162009-11-10 Doug Kwan <dougkwan@google.com>
11217
11218 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11219 a format warning.
11220 * incremental.cc (open_incremental_binary): Initialized local
11221 variables to avoid warnings.
11222 * object.cc (make_elf_object): Ditto.
11223 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11224 a format warning.
e1df38aa 11225
88ee28e9
L
11226009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11227
11228 PR gold/10930
11229 * testsuite/plugin_test.c: Include "config.h".
11230
2daedcd6
DK
112312009-11-09 Doug Kwan <dougkwan@google.com>
11232
11233 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11234 (arm_symbol_value): Remove.
11235 (Arm_relocate_functions::arm_branch_common,
11236 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11237 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11238 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11239 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11240 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11241 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11242 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11243 Arm_relocate_functions::thm_mobw_abs_nc,
11244 Arm_relocate_functions::thm_mov_abs,
11245 Arm_relocate_functions::movw_prel_nc,
11246 Arm_relocate_functions::thm_movt_abs,
11247 Arm_relocate_functions::movt_prel,
11248 Arm_relocate_functions::thm_movw_prel_nc,
11249 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11250 (Target_arm::Relocate::relocate): Only decompose address into two
11251 parts if relocation type uses the thumb-bit and pass the actual
11252 bit instead of a flag indicating that the thumb-bit is used. Adjust
11253 calls to methods in Arm_relocate_functions for this change.
11254
1276bc89 112552009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11256
11257 PR 10925
11258 * reloc.cc: Instantiate
11259 Sized_relobj::initialize_input_to_output_maps and
11260 Sized_relobj:free_input_to_output_maps.
11261
e53ad1b5
ILT
112622009-11-06 Ian Lance Taylor <iant@google.com>
11263
11264 PR 10876
11265 * defstd.cc (in_segment): Set only_if_ref true for "end".
11266
eb44217c
DK
112672009-11-06 Doug Kwan <dougkwan@google.com>
11268
11269 * arm.cc (class Reloc_stub): Correct a comment.
11270 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11271 (Target_arm::scan_section_for_stubs): New method declaration.
11272 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11273 Change methods from private to protected.
11274 (Target_arm::do_may_relax): New method definition.
11275 (Target_arm::do_relax, Target_arm::group_sections,
11276 Target_arm::scan_reloc_for_stub,
11277 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11278 (Target_arm::arm_input_section_map_): New data member declaration.
11279 (Target_arm::scan_reloc_for_stub,
11280 Target_arm::scan_reloc_section_for_stubs,
11281 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11282 Target_arm::do_relax): New method definitions.
11283
5d329b7d
ILT
112842009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11285
11286 * configure.ac: Check for (struct stat)::st_mtim
11287 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11288 * config.in: Regenerate.
11289 * configure: Regenerate.
11290
96a0d71b
ILT
112912009-11-05 Ian Lance Taylor <iant@google.com>
11292
11293 PR 10910
11294 * output.cc (Output_segment::add_output_section): Add missing
11295 return statement.
11296
594c8e5e
ILT
112972009-11-04 Ian Lance Taylor <iant@google.com>
11298
11299 PR 10880
11300 * object.h (class Object): Add is_needed and set_is_needed
11301 methods. Add is_needed_ field. Make bool fields into bitfields.
11302 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11303 defined in a dynamic object and referenced by a regular object,
11304 set is_needed for the dynamic object.
11305 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11306 if the file is marked with as_needed and it is not needed.
11307
22b127cc
ILT
113082009-11-04 Ian Lance Taylor <iant@google.com>
11309
11310 PR 10887
11311 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11312 tags if data is discarded by linker script.
11313 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11314 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11315 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11316 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11317
f5c870d2
ILT
113182009-11-04 Ian Lance Taylor <iant@google.com>
11319
11320 * layout.cc (Layout::get_output_section): Add is_interp and
11321 is_dynamic_linker_section parameters. Change all callers.
11322 (Layout::choose_output_section): Likewise.
11323 (Layout::make_output_section): Likewise.
11324 (Layout::add_output_section_data): Add is_dynamic_linker_section
11325 parameter. Change all callers.
11326 * layout.h (class Layout): Update declarations.
11327 * output.h (class Output_section): Add is_interp, set_is_interp,
11328 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11329 Add is_interp_, is_dynamic_linker_section_ fields. Change
11330 generate_code_fills_at_write_ to a bitfield.
11331 * output.cc (Output_section::Output_sections): Initialize new
11332 fields.
11333 (Output_segment::add_output_section): Add do_sort parameter.
11334 Change all callers.
11335
1ae4d23b
ILT
113362009-11-03 Ian Lance Taylor <iant@google.com>
11337
11338 PR 10860
11339 * options.h (class General_options): Add --warn-common.
11340 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11341 merging two common symbols.
11342 (Symbol_table::should_override): Handle --warn-common when merging
11343 a common symbol with a defined symbol. Use report_resolve_problem
11344 for multiple definitions.
11345 (Symbol_table::report_resolve_problem): New function.
11346 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11347
55da9579
DK
113482009-11-03 Doug Kwan <dougkwan@google.com>
11349
11350 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11351 stub_factory_.
11352 (Target_arm::stub_factory): New method definition.
11353 (Target_arm::new_arm_input_section,
11354 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11355 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11356 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11357 New type definitions.
11358 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11359 member declarations.
11360 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11361 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11362 New method definitions.
11363
37a9ac43
ILT
113642009-11-03 Ian Lance Taylor <iant@google.com>
11365
11366 * options.h (class General_options): Add --warn_constructors.
11367
b3d6a3d4
ILT
113682009-11-03 Ian Lance Taylor <iant@google.com>
11369
11370 PR 10893
11371 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11372 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11373
934b01dd
ILT
113742009-11-03 Ian Lance Taylor <iant@google.com>
11375
11376 PR 10895
11377 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11378 --msgid-bugs-address.
11379 (install-pdf): New target.
11380 (install-data_yes): Look up one directory to find mkinstalldirs.
11381
03c1939b
L
113822009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11383
11384 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11385 tree.
11386
ebd95253
DK
113872009-10-30 Doug Kwan <dougkwan@google.com>
11388
11389 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11390
e9bbb538
DK
113912009-10-30 Doug Kwan <dougkwan@google.com>
11392
11393 * arm.cc (Stub_addend_reader): New struct template definition
11394 and partial specializations.
11395 (Stub_addend_reader::operator()): New method definition for a
11396 partially specialized template.
11397
d5b40221
DK
113982009-10-30 Doug Kwan <dougkwan@google.com>
11399
11400 * arm.cc (Arm_relobj::processor_specific_flags): New method
11401 definition.
11402 (Arm_relobj::do_read_symbols): New method declaration.
11403 (Arm_relobj::processor_specific_flags_): New data member declaration.
11404 (Arm_dynobj): New class definition.
11405 (Target_arm::do_finalize_sections): Add input_objects parameter.
11406 (Target_arm::do_adjust_elf_header): New method declaration.
11407 (Target_arm::are_eabi_versions_compatible,
11408 (Target_arm::merge_processor_specific_flags): New method declaration.
11409 (Target_arm::do_make_elf_object): New overloaded method definitions
11410 and declaration.
11411 (Arm_relobj::do_read_symbols): New method definition.
11412 (Arm_dynobj::do_read_symbols): Ditto.
11413 (Target_arm::do_finalize_sections): Add input_objects parameters.
11414 Merge processor-specific flags from all input objects.
11415 (Target_arm::are_eabi_versions_compatible,
11416 Target_arm::merge_processor_specific_flags,
11417 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11418 New method definitions.
11419 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11420 Input_objects pointer type parameter.
11421 * layout.cc (Layout::finalize): Pass input objects to target's.
11422 finalize_sections function.
11423 * output.cc (Output_file_header::do_sized_write): Set ELF file
11424 header's processor-specific flags.
11425 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11426 Input_objects pointer type parameter.
11427 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11428 * target.h (Input_objects): New forward class declaration.
11429 (Target::processor_specific_flags,
11430 Target::are_processor_specific_flags_sect): New method definitions.
11431 (Target::finalize_sections): Add input_objects parameter.
11432 (Target::Target): Initialize processor_specific_flags_ and
11433 are_processor_specific_flags_set_.
11434 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11435 parameter.
11436 (Target::set_processor_specific_flags): New method definition.
11437 (Target::processor_specific_flags_,
11438 Target::are_processor_specific_flags_set_): New data member
11439 declarations.
11440 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11441 Input_objects pointer type parameter.
11442
ebabffbd
DK
114432009-10-30 Doug Kwan <dougkwan@google.com>
11444
11445 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11446
ad0f2072
ILT
114472009-10-28 Ian Lance Taylor <iant@google.com>
11448
11449 * object.h (class Relobj): Drop options parameter from
11450 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11451 do_scan_relocs, do_relocate. Change all callers.
11452 (class Sized_relobj): Drop options parameters from
11453 do_gc_process_relocs, do_scan_relocs, do_relocate,
11454 do_relocate_sections, relocate_sections, emit_relocs_scan,
11455 emit_relocs_scan_reltype. Change all callers.
11456 (struct Relocate_info): Remove options field and all references to
11457 it.
11458 * reloc.h (class Read_relocs): Remove options constructor
11459 parameter and options_ field. Change all callers.
11460 (class Gc_process_relocs, class Scan_relocs): Likewise.
11461 (class Relocate_task): Likewise.
11462 * target-reloc.h (scan_relocs): Remove options parameter. Change
11463 all callers.
11464 (scan_relocatable_relocs): Likewise.
11465 * target.h (class Sized_target): Remove options parameter from
11466 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11467 all callers.
11468 * gc.h (gc_process_relocs): Remove options parameter. Change all
11469 callers.
11470 * arm.cc: Update functions to remove options parameters.
11471 * i386.cc: Likewise.
11472 * powerpc.cc: Likewise.
11473 * sparc.cc: Likewise.
11474 * x86_64.cc: Likewise.
11475 * testsuite/testfile.cc: Likewise.
11476
8ffa3667
DK
114772009-10-28 Doug Kwan <dougkwan@google.com>
11478
11479 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11480 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11481 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11482 New method definitions.
11483
40f36857
CC
114842009-10-28 Cary Coutant <ccoutant@google.com>
11485
11486 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11487 (Plugin::cleanup_done_): New member.
11488 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11489 (Plugin_manager::cleanup_done_): Remove.
11490 (Plugin_manager::add_input_file): Edit error message.
11491 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11492 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11493
2c849493
ILT
114942009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11495
11496 * fileread.cc: (File_read::View::~View): Use the new
11497 data_ownership_ filed.
11498 (File_read::~File_read): Dispose the new whole_file_view_.
11499 (File_read::open): Mmap the whole file if needed.
11500 (File_read::open): Use whole_file_view_ instead of contents_.
11501 (File_read::find_view): Use whole_file_view_ if applicable.
11502 (File_read::do_read): Use whole_file_view_ instead of contents_.
11503 (File_read::make_view): Use whole_file_view_ instead of contents_,
11504 update File_read::View::View call.
11505 (File_read::find_or_make_view): Update File_read::View::View
11506 call.
11507 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11508 remove contents_
11509 (File_read::View::Data_ownership): New enum.
11510 (File_read::View::View): Replace bool mapped_ with Data_ownership
11511 argument.
11512 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11513 (File_read::View::data_ownership_): New field.
11514 (File_read::contents_): Remove (replaced by whole_file_view_).
11515 (File_read::whole_file_view_): New field.
11516 * options.h (class General_options): Add --keep-files-mapped.
11517
24998053
CC
115182009-10-27 Cary Coutant <ccoutant@google.com>
11519
11520 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11521 * testsuite/Makefile.am (plugin_test_5): New test case.
11522 * testsuite/Makefile.in: Regenerate.
11523
72adc4fa
DK
115242009-10-25 Doug Kwan <dougkwan@google.com>
11525
11526 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11527 from private to protected to allow access by child class.
11528 (Sized_relobj::do_relocate_sections): New method declaration.
11529 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11530 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11531 Sized_relobj::relocate_sections. Instantiate template explicitly
11532 for different target sizes and endianity.
11533
07f508a2
DK
115342009-10-24 Doug Kwan <dougkwan@google.com>
11535
11536 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11537 (Arm_input_section::as_arm_input_section): New method.
11538 (Arm_output_section): New class definition.
11539 (Arm_output_section::create_stub_group,
11540 Arm_output_section::group_sections): New method definitions.
11541
10ad9fe5
DK
115422009-10-22 Doug Kwan <dougkwan@google.com>
11543
11544 * arm.cc (Arm_input_section): New class definition.
11545 (Arm_input_section::init, Arm_input_section:do_write,
11546 Arm_input_section::set_final_data_size,
11547 Arm_input_section::do_reset_address_and_file_offset): New method
11548 definitions.
11549
56ee5e00
DK
115502009-10-21 Doug Kwan <dougkwan@google.com>
11551
11552 * arm.cc (Stub_table, Arm_input_section): New forward class
11553 declarations.
11554 (Stub_table): New class defintion.
11555 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11556 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11557 New method definition.
11558
b569affa
DK
115592009-10-21 Doug Kwan <dougkwan@google.com>
11560
11561 * arm.cc: Update copyright comments.
11562 (Target_arm): New forward class template declaration.
11563 (Arm_address): New type.
11564 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11565 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11566 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11567 constants.
11568 (Insn_template): Same.
11569 (DEF_STUBS): New macro.
11570 (Stub_type): New enum type.
11571 (Stub_template): New class definition.
11572 (Stub): Same.
11573 (Reloc_stub): Same.
11574 (Stub_factory): Same.
11575 (Target_arm::Target_arm): Initialize may_use_blx_ and
11576 should_force_pic_veneer_.
11577 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11578 Target_arm::should_force_pic_veneer,
11579 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11580 Target_arm::using_thumb_only, Target_arm:;default_target): New
11581 method defintions.
11582 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11583 New data member declarations.
11584 (Insn_template::size, Insn_template::alignment): New method defintions.
11585 (Stub_template::Stub_template): New method definition.
11586 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11587 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11588 (Stub_factory::Stub_factory): New method definition.
11589 * gold.h (string_hash): New template.
11590 * output.h (Input_section_specifier::hash_value): Use
11591 gold::string_hash.
11592 (Input_section_specifier::string_hash): Remove.
11593 * stringpool.cc (Stringpool_template::string_hash): Use
11594 gold::string_hash.
11595
6c172549
DK
115962009-10-20 Doug Kwan <dougkwan@google.com>
11597
11598 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11599 symbols of relaxed input sections.
11600 * output.h (Output_section::find_relaxed_input_section): Make
11601 method public.
11602
c5617f2f
DK
116032009-10-16 Doug Kwan <dougkwan@google.com>
11604
11605 * dynobj.cc (Versions::Versions): Initialize version_script_.
11606 Only insert base version symbol definition for a shared object
11607 if version script defines any version versions.
11608 (Versions::define_base_version): New method definition.
11609 (Versions::add_def): Check that base version is not needed.
11610 (Versions::add_need): Define base version lazily.
11611 * dynobj.h (Versions::define_base_version): New method declaration.
11612 (Versions::needs_base_version_): New data member declaration.
11613 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11614 (check_DATA): Add no_version_test.stdout.
11615 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11616 New make rules.
11617 * testsuite/Makefile.in: Regenerate.
11618 * testsuite/no_version_test.c: New file.
11619 * testsuite/no_version_test.sh: Ditto.
11620
3c12dcdb
DK
116212009-10-16 Doug Kwan <dougkwan@google.com>
11622
11623 * expression.cc (class Segment_start_expression): New class definition.
11624 (Segment_start_expression::value): New method definition.
11625 (script_exp_function_segment_start): Return a new
11626 Segment_start_expression.
11627 * gold/script-c.h (script_saw_segment_start_expression): New function
11628 prototype.
11629 * script-sections.cc (Script_sections::Script_sections): Initialize
11630 SAW_SEGMENT_START_EXPRESSION_ to false.
11631 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11632 and -Tbbs options to specify section addresses if given in
11633 command line and no SEGMENT_START expression is seen in a script.
11634 * script-sections.h (Script_sections::saw_segment_start_expression,
11635 Script_sections::set_saw_segment_start_expression): New method
11636 definition.
11637 (Script_sections::saw_segment_start_expression_): New data member
11638 declaration.
11639 * script.cc (script_saw_segment_start_expression): New function.
11640 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11641 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11642 script_test_7.sh and script_test_8.sh.
11643 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11644 script_test_8.stdout.
11645 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11646 (script_test_6, script_test_6.stdout, script_test_7,
11647 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11648 * Makefile.in: Regenerate.
11649 * testsuite/script_test_6.sh: New file.
11650 * testsuite/script_test_6.t: Same.
11651 * testsuite/script_test_7.sh: Same.
11652 * testsuite/script_test_7.t: Same.
11653 * testsuite/script_test_8.sh: Same.
11654
64b1ae37
DK
116552009-10-16 Doug Kwan <dougkwan@google.com>
11656
11657 * output.cc (Output_segment::set_section_list_address): Cast
11658 expressions to unsigned long long type to avoid format warnings.
11659
661be1e2
ILT
116602009-10-15 Ian Lance Taylor <iant@google.com>
11661
12edd763 11662 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11663 dot assignment to script_sections_.
12edd763
ILT
11664 * script-sections.cc (Script_sections::add_dot_assignment):
11665 Initialize if necessary.
11666
68b6574b
ILT
11667 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11668 program headers with no load segment if there is a linker script.
11669
661be1e2
ILT
11670 * layout.cc (Layout::set_segment_offsets): Align the file offset
11671 to the segment aligment for -N or -n with no load segment.
11672 * output.cc (Output_segment::add_output_section): Don't crash if
11673 the first section is a TLS section.
11674 (Output_segment::set_section_list_addresses): Print an error
11675 message if the address moves backward in a linker script.
11676 * script-sections.cc
11677 (Output_section_element_input::set_section_addresses): Don't
11678 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11679 (Orphan_output_section::set_section_addresses): Likewise.
11680
f15f61a7
DK
116812009-10-15 Doug Kwan <dougkwan@google.com>
11682
11683 * layout.cc (Layout::finish_dynamic_section): Generate tags
11684 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11685 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11686 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11687
82bb573a
ILT
116882009-10-14 Ian Lance Taylor <iant@google.com>
11689
11690 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11691 fields.
11692 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11693 data_shdr fields of relinfo.
11694 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11695 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11696 R_386_TLS_LDO_32, adjust based on section flags.
11697 (Target_i386::Relocate::fix_up_ldo): Remove.
11698
374ad285
ILT
116992009-10-13 Ian Lance Taylor <iant@google.com>
11700
11701 Add support for -pie.
11702 * options.h (class General_options): Add -pie and
11703 --pic-executable.
11704 (General_options::output_is_position_independent): Test -pie.
11705 (General_options::output_is_executable): Return true if not shared
11706 and not relocatable.
11707 (General_options::output_is_pie): Remove.
11708 * options.cc (General_options::finalize): Reject incompatible uses
11709 of -pie.
11710 * gold.cc (queue_middle_tasks): A -pie link is not static.
11711 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11712 * symtab.cc (Symbol::final_value_is_known): Return false if
11713 output_is_position_independent.
11714 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11715 output_is_position_independent.
11716 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11717 output_is_position_independent.
11718 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11719 output_is_position_independent.
11720 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11721 two_file_pie_test.
11722 (basic_pie_test.o, basic_pie_test): New targets.
11723 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11724 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11725 (two_file_pie_test): New target.
11726 * testsuite/Makefile.in: Rebuild.
11727 * README: Remove note saying that -pie is not supported.
11728
c6585162
ILT
117292009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11730
11731 * options.h (class General_options): Add -init and -fini.
11732 * layout.cc (Layout::finish_dynamic_section): Emit
11733 given init and fini functions.
11734
032ce4e9
ST
117352009-10-13 Sriraman Tallam <tmsriram@google.com>
11736
11737 * gc.h (gc_process_relocs): Check if icf is enabled using new
11738 function.
11739 * gold.cc (queue_initial_tasks): Likewise.
11740 (queue_middle_tasks): Likewise.
11741 * object.cc (do_layout): Likewise.
11742 * symtab.cc (is_section_folded): Likewise.
11743 * main.cc (main): Likewise.
11744 * reloc.cc (Read_relocs::run): Likewise.
11745 (Sized_relobj::do_scan_relocs): Likewise.
11746 * icf.cc (is_function_ctor_or_dtor): New function.
11747 (Icf::find_identical_sections): Check if function is ctor or dtor when
11748 safe icf is chosen.
11749 * options.h (General_options::icf): Change option to be an enum.
11750 (Icf_status): New enum.
11751 (icf_enabled): New method.
11752 (icf_safe_folding): New method.
11753 (set_icf_status): New method.
11754 (icf_status_): New variable.
11755 * (options.cc) (General_options::finalize): Set icf_status_.
11756 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11757 icf_test and icf_keep_unique_test to use the --icf enum flag.
11758 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11759 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11760
f345227a
ST
117612009-10-12 Sriraman Tallam <tmsriram@google.com>
11762
11763 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11764 includes to gc.h and icf.h.
11765 * arm.cc: Include gc.h.
11766 * gold.cc: Likewise.
11767 * i386.cc: Likewise.
11768 * powerpc.cc: Likewise.
11769 * sparc.cc: Likewise.
11770 * x86_64.cc: Likewise.
11771 * gc.h: Include icf.h.
11772
1c7814ed
ILT
117732009-10-11 Ian Lance Taylor <iant@google.com>
11774
11775 * plugin.cc: Include "gold.h" before other header files.
11776
ae3b5189
CD
117772009-10-10 Chris Demetriou <cgd@google.com>
11778
11779 * options.h (Input_file_argument::Input_file_type): New enum.
11780 (Input_file_argument::is_lib_): Replace with...
11781 (Input_file_argument::type_): New member.
11782 (Input_file_argument::Input_file_argument): Take Input_file_type
11783 'type' rather than boolean 'is_lib' as second argument.
11784 (Input_file_argument::is_lib): Use type_.
11785 (Input_file_argument::is_searched_file): New function.
11786 (Input_file_argument::may_need_search): Handle is_searched_file.
11787 * options.cc (General_options::parse_library): Support -l:filename.
11788 (General_options::parse_just_symbols): Update for Input_file_argument
11789 changes.
11790 (Command_line::process): Likewise.
11791 * archive.cc (Archive::get_file_and_offset): Likewise.
11792 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11793 * script.cc (read_script_file, script_add_file): Likewise.
11794 * fileread.cc (Input_file::Input_file): Likewise.
11795 (Input_file::will_search_for): Handle is_searched_file.
11796 (Input_file::open): Likewise.
11797 * readsyms.cc (Read_symbols::get_name): Likewise.
11798 * testsuite/Makefile.am (searched_file_test): New test.
11799 * testsuite/Makefile.in: Regenerate.
11800 * testsuite/searched_file_test.cc: New file.
11801 * testsuite/searched_file_test_lib.cc: New file.
11802
f3048a1d
ILT
118032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11804 Ian Lance Taylor <iant@google.com>
11805
11806 * descriptor.cc: Include <cstdio> and "binary-io.h".
11807 (Descriptors::open): Open the files in binary mode always.
11808 * script.cc (Lex::get_token): Treat \r as whitespace.
11809
d4780e57
ILT
118102009-10-09 Ian Lance Taylor <iant@google.com>
11811
11812 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11813
d9a893b8
ILT
118142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11815 Ian Lance Taylor <iant@google.com>
11816
11817 * configure.ac: Check for readv function also.
11818 * fileread.cc (readv): Define if not HAVE_READV.
11819 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11820 does not exist.
11821 * config.in: Regenerate.
11822 * configure: Regenerate.
11823
c0a62865
DK
118242009-10-09 Doug Kwan <dougkwan@google.com>
11825
11826 * layout.cc (Layout::make_output_section): Call target hook to make
11827 ordinary output section.
11828 (Layout::finalize): Adjust parameter list of call the
11829 Target::may_relax().
11830 * layout.h (class Layout::section_list): New method.
11831 * merge.h (Output_merge_base::entsize): Change visibility to public.
11832 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11833 New methods.
11834 (Output_merge_string::do_is_string): New method.
11835 * object.cc (Sized_relobj::do_setup): renamed from
11836 Sized_relobj::set_up.
11837 * object.h (Sized_relobj::adjust_shndx,
11838 Sized_relobj::initializ_input_to_output_maps,
11839 Sized_relobj::free_input_to_output_maps): Change visibilities to
11840 protected.
11841 (Sized_relobj::setup): Virtualize.
11842 (Sized_relobj::do_setup): New method declaration.
11843 (Sized_relobj::invalidate_section_offset,
11844 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11845 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11846 * options.cc (parse_int): New function.
11847 * options.h (parse_int): New declaration.
11848 (DEFINE_int): New macro.
11849 (stub_group_size): New option.
11850 * output.cc (Output_section::Output_section): Initialize memebers
11851 merge_section_map_, merge_section_by_properties_map_,
11852 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11853 (Output_section::add_input_section): Handled deferred code-fill
11854 generation and remove an old comment.
11855 (Output_section::add_relaxed_input_section): New method definition.
11856 (Output_section::add_merge_input_section): Use merge section by
11857 properties map to speed to search. Update merge section maps
11858 as appropriate.
11859 (Output_section::build_relaxation_map): New method definition.
11860 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11861 Same.
11862 (Output_section::relax_input_section): Renamed to
11863 Output_section::convert_input_sections_to_relaxed_sections and change
11864 interface to take a vector of pointers to relaxed sections.
11865 (Output_section::find_merge_section,
11866 Output_section::find_relaxed_input_section): New method definitions.
11867 (Output_section::is_input_address_mapped,
11868 Output_section::output_offset, Output_section::output_address):
11869 Use output section data maps to speed up searching.
11870 (Output_section::find_starting_output_address): Add comments.
11871 (Output_section::do_write,
11872 Output_section::write_to_postprocessing_buffer): Do code-fill
11873 generation as appropriate.
11874 (Output_section::get_input_sections): Invalidate relaxed input section
11875 map.
11876 (Output_section::restore_states): Adjust type of checkpoint .
11877 Invalidate relaxed input section map.
11878 * output.h (Output_merge_base): New class declaration.
11879 (Input_section_specifier): New class defintion.
11880 (class Output_relaxed_input_section) Change base class to
11881 Output_section_data_build.
11882 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11883 base class initializer.
11884 (Output_section::add_relaxed_input_section): New method declaration.
11885 (Output_section::Input_section): Change visibility to protected.
2e702c99 11886 (Output_section::Input_section::relobj,
c0a62865
DK
11887 Output_section::Input_section::shndx): Handle relaxed input sections.
11888 Output_section::input_sections) Change visibility to protected. Also
11889 define overload to return a non-const pointer.
11890 (Output_section::Merge_section_properties): New class defintion.
11891 (Output_section::Merge_section_by_properties_map,
11892 Output_section::Output_section_data_by_input_section_map,
11893 Output_section::Relaxation_map): New types.
11894 (Output_section::relax_input_section): Rename method to
11895 Output_section::convert_input_sections_to_relaxed_sections and change
11896 interface to take a vector of relaxed section pointers.
11897 (Output_section::find_merge_section,
11898 Output_section::find_relaxed_input_section,
11899 Output_section::build_relaxation_map,
11900 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11901 New method declarations.
11902 (Output_section::merge_section_map_
11903 Output_section::merge_section_by_properties_map_,
11904 Output_section::relaxed_input_section_map_,
11905 Output_section::is_relaxed_input_section_map_valid_,
11906 Output_section::generate_code_fills_at_write_): New data members.
11907 * script-sections.cc
11908 (Output_section_element_input::set_section_addresses): Call
11909 current_data_size and addralign methods of relaxed input sections.
11910 (Orphan_output_section::set_section_addresses): Call current_data_size
11911 and addralign methods of relaxed input sections.
11912 * symtab.cc (Symbol_table::compute_final_value): Extract template
11913 from the body of Symbol_table::sized_finalize_symbol.
11914 (Symbol_table::sized_finalized_symbol): Call
11915 Symbol_table::compute_final_value.
11916 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11917 (Symbol_table::compute_final_value): New templated method declaration.
11918 * target.cc (Target::do_make_output_section): New method defintion.
11919 * target.h (Target::make_output_section): New method declaration.
11920 (Target::relax): Add more parameters for input objects, symbol table
11921 and layout. Adjust call to do_relax.
11922 (Target::do_make_output_section): New method declaration.
11923 (Target::do_relax): Add parameters for input objects, symbol table
11924 and layout.
11925
d446d6c4
ILT
119262009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11927
11928 * pread.c: Include stdio.h.
11929
bc06c745
ILT
119302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11931
11932 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11933 defined.
11934
75aea3d0
ILT
119352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11936
11937 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11938 Change read_shndx type to unsigned int.
11939 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11940 int.
11941 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11942 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11943 Change read_shndx type to unsigned int.
11944 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11945 int.
11946 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11947 * layout.cc (Layout::create_symtab_sections): Cast the result of
11948 local_symcount * symsize to off_t in the gold_assert.
11949
be8fcb75
ILT
119502009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11951
11952 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11953 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11954 R_ARM_BASE_ABS.
11955 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11956 (Arm_relocate_functions::thm_abs5): New function.
11957 (Arm_relocate_functions::abs12): New function.
11958 (Arm_relocate_functions::abs16): New function.
11959 (Arm_relocate_functions::base_abs): New function.
11960 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11961 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11962 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11963 R_ARM_BASE_ABS.
11964 (Scan::global): Likewise.
11965 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11966 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11967 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11968 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11969 R_ARM_BASE_ABS.
11970
c2a122b6
ILT
119712009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11972
11973 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11974 (Arm_relocate_functions::movt_prel): New function.
11975 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11976 (Arm_relocate_functions::thm_movt_prel): New function.
11977 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11978 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11979 (Scan::global, Relocate::relocate): Likewise.
11980 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11981
c4aa1e2d
ILT
119822009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11983
11984 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11985 Incremental_checker.
11986 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11987 unsigned int.
11988 (class Incremental_inputs_header): New class.
11989 (Incremental_inputs_header_writer): Edit comment.
11990 (Incremental_inputs_entry): New class.
11991 (Incremental_inputs_entry_writer): Edit comment.
11992 (Sized_incremental_binary::do_find_incremental_inputs_section):
11993 Add *strtab_shndx parameter, fill it.
11994 (Sized_incremental_binary::do_check_inputs): New method.
11995 (Incremental_checker::can_incrementally_link_output_file): Use
11996 Sized_incremental_binary::check_inputs.
11997 (Incremental_inputs::report_command_line): Save command line in
11998 command_line_.
11999 * incremental.h:
12000 (Incremental_binary::find_incremental_inputs_section): New
12001 method.
12002 (Incremental_binary::do_find_incremental_inputs_section): Add
12003 strtab_shndx parameter.
12004 (Incremental_binary::do_check_inputs): New pure virtual method.
12005 (Sized_incremental_binary::do_check_inputs): Declare.
12006 (Incremental_checker::Incremental_checker): Add incremental_inputs
12007 parameter, use it to initialize incremental_inputs_.
12008 (Incremental_checker::incremental_inputs_): New field.
12009 (Incremental_checker::command_line): New method.
12010 (Incremental_checker::inputs): New method.
12011 (Incremental_checker::command_line_): New field.
12012
c549a694
ILT
120132009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12014
12015 * incremental.cc: Include <cstdarg> and "target-select.h".
12016 (vexplain_no_incremental): New function.
12017 (explain_no_incremental): New function.
12018 (Incremental_binary::error): New method.
12019 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12020 method.
12021 (make_sized_incremental_binary): New function.
12022 (open_incremental_binary): New function.
12023 (can_incrementally_link_file): Add checks if output is ELF and has
12024 inputs section.
12025 * incremental.h: Include "elfcpp_file.h" and "output.h".
12026 (Incremental_binary): New class.
12027 (Sized_incremental_binary): New class.
12028 (open_incremental_binary): Declare.
12029 * object.cc (is_elf_object): Use
12030 elfcpp::Elf_recognizer::is_elf_file.
12031 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12032 * output.h (Output_file::filesize): New method.
12033
fd3c5f0b
ILT
120342009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12035
12036 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12037 New function.
12038 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12039 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12040 function.
12041 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12042 function.
12043 (Arm_relocate_functions::movw_abs_nc): New function.
12044 (Arm_relocate_functions::movt_abs): New function.
12045 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12046 (Arm_relocate_functions::thm_movt_abs): New function.
12047 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12048 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12049 (Scan::global): Likewise.
12050 (Relocate::relocate): Likewise.
12051 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12052
7f5309a5
ILT
120532009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12054
12055 * arm.cc (Arm_relocate_functions::got_prel) New function.
12056 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12057 (Relocate::relocate): Likewise.
12058 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12059
364c7fa5
ILT
120602009-10-06 Ian Lance Taylor <iant@google.com>
12061
12062 * options.h (class General_options): Define
12063 split_stack_adjust_size parameter.
12064 * object.h (class Object): Add uses_split_stack_ and
12065 has_no_split_stack_ fields. Add uses_split_stack and
12066 has_no_split_stack accessor functions. Declare
12067 handle_split_stack_section.
12068 (class Reloc_symbol_changes): Define.
12069 (class Sized_relobj): Define Function_offsets. Declare
12070 split_stack_adjust, split_stack_adjust_reltype, and
12071 find_functions.
12072 * object.cc (Object::handle_split_stack_section): New function.
12073 (Sized_relobj::do_layout): Call handle_split_stack_section.
12074 * dynobj.cc (Sized_dynobj::do_layout): Call
12075 handle_split_stack_section.
12076 * reloc.cc (Sized_relobj::relocate_sections): Call
12077 split_stack_adjust for executable sections in split_stack
12078 objects. Pass reloc_map to relocate_section.
12079 (Sized_relobj::split_stack_adjust): New function.
12080 (Sized_relobj::split_stack_adjust_reltype): New function.
12081 (Sized_relobj::find_functions): New function.
12082 * target-reloc.h: Include "object.h".
12083 (relocate_section): Add reloc_symbol_changes parameter. Change
12084 all callers.
12085 * target.h (class Target): Add calls_non_split method. Declare
12086 do_calls_non_split virtual method. Declare match_view and
12087 set_view_to_nop.
12088 * target.cc: Include "elfcpp.h".
12089 (Target::do_calls_non_split): New function.
12090 (Target::match_view): New function.
12091 (Target::set_view_to_nop): New function.
12092 * gold.cc (queue_middle_tasks): Give an error if mixing
12093 split-stack and non-split-stack objects with -r.
12094 * i386.cc (Target_i386::relocate_section): Add
12095 reloc_symbol_changes parameter.
12096 (Target_i386::do_calls_non_split): New function.
12097 * x86_64.cc (Target_x86_64::relocate_section): Add
12098 reloc_symbol_changes parameter.
12099 (Target_x86_64::do_calls_non_split): New function.
12100 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12101 parameter.
12102 * powerpc.cc (Target_powerpc::relocate_section): Add
12103 reloc_symbol_changes parameter.
12104 * sparc.cc (Target_sparc::relocate_section): Add
12105 reloc_symbol_changes parameter.
12106 * configure.ac: Call AM_CONDITIONAL for the default target.
12107 * configure: Rebuild.
12108 * testsuite/Makefile.am (TEST_AS): New variable.
12109 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12110 (check_DATA): Add split_i386 and split_x86_64 files.
12111 (SPLIT_DEFSYMS): Define.
12112 (split_i386_[1234n].o): New targets.
12113 (split_i386_[124]): New targets.
12114 (split_i386_[1234r].stdout): New targets.
12115 (split_x86_64_[1234n].o): New targets.
12116 (split_x86_64_[124]): New targets.
12117 (split_x86_64_[1234r].stdout): New targets.
12118 (MOSTLYCLEANFILES): Add new executables.
12119 * testsuite/split_i386.sh: New file.
12120 * testsuite/split_x86_64.sh: New file.
12121 * testsuite/split_i386_1.s: New file.
12122 * testsuite/split_i386_2.s: New file.
12123 * testsuite/split_i386_3.s: New file.
12124 * testsuite/split_i386_4.s: New file.
12125 * testsuite/split_i386_n.s: New file.
12126 * testsuite/split_x86_64_1.s: New file.
12127 * testsuite/split_x86_64_2.s: New file.
12128 * testsuite/split_x86_64_3.s: New file.
12129 * testsuite/split_x86_64_4.s: New file.
12130 * testsuite/split_x86_64_n.s: New file.
12131 * testsuite/testfile.cc (Target_test): Update relocation_section
12132 function.
12133 * testsuite/Makefile.in: Rebuild.
12134
e8a9fcda
ILT
121352009-10-06 Ian Lance Taylor <iant@google.com>
12136
12137 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12138 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12139 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12140 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12141 the address on ldo_addrs_.
12142 (Target_i386::Relocate::fix_up_ldo): New function.
12143
e99daf92
ILT
121442009-10-06 Rafael Espindola <espindola@google.com>
12145
12146 * plugin.cc (add_input_library): New.
12147 (Plugin::load): Add add_input_library to tv.
12148 (Plugin_manager::add_input_file): Add the is_lib argument.
12149 (add_input_file): Update call to Plugin_manager::add_input_file.
12150 (add_input_library): New.
12151 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12152
966d4097
DK
121532009-09-30 Doug Kwan <dougkwan@google.com>
12154
12155 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12156 symbol and call Symbol::may_need_copy_reloc to determine if
12157 a copy reloc is needed.
12158 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12159 nocopyreloc is given in command line.
12160 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12161 given in command line.
12162 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12163 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12164 of the removed Target_i386::may_need_copy_reloc.
12165 * options.h (copyreloc): New option with default value false.
12166 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12167 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12168 instead of the removed Target_powerpc::may_need_copy_reloc.
12169 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12170 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12171 instead of the removed Target_sparc::may_need_copy_reloc.
12172 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12173 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12174 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12175 instead of the removed Target_x86_64::may_need_copy_reloc.
12176
029ba973
ILT
121772009-09-30 Ian Lance Taylor <iant@google.com>
12178
12179 * object.h (class Object): Remove target_ field, and target,
12180 sized_target, and set_target methods.
12181 (Object::sized_target): Remove.
12182 (class Sized_relobj): Update declarations. Remove sized_target.
12183 * object.cc (Sized_relobj::setup): Remove target parameter.
12184 Change all callers.
12185 (Input_objects::add_object): Don't do anything with the target.
12186 (make_elf_sized_object): Add punconfigured parameter. Change all
12187 callers. Set or test parameter target.
12188 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12189 Change all callers.
12190 * parameters.cc (Parameters::set_target): Change parameter type to
12191 be non-const.
12192 (Parameters::default_target): Remove.
12193 (set_parameters_target): Change parameter type to be non-const.
12194 (parameters_force_valid_target): New function.
12195 (parameters_clear_target): New function.
12196 * parameters.h (class Parameters): Update declarations. Remove
12197 default_target method. Add sized_target and clear_target
12198 methods. Change target_ to be non-const.
12199 (set_parameters_target): Update declaration.
12200 (parameters_force_valid_target): Declare.
12201 (parameters_clear_target): Declare.
12202 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12203 as NULL if we aren't searching.
12204 (Add_symbols::run): Don't check for compatible target.
12205 * fileread.cc (Input_file::open_binary): Call
12206 parameters_force_valid_target.
12207 * gold.cc (queue_middle_tasks): Likewise.
12208 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12209 set_target on object.
12210 * dynobj.h (class Sized_dynobj): Update declarations.
12211 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12212 make_elf_object returns NULL.
12213 (Archive::include_member): Don't check whether object target is
12214 compatible.
12215 * output.cc (Output_section::add_input_section): Get target from
12216 parameters.
12217 (Output_section::relax_input_section): Likewise.
12218 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12219 parameters.
12220 (Sized_relobj::do_scan_relocs): Likewise.
12221 (Sized_relobj::relocate_sections): Likewise.
12222 * resolve.cc (Symbol_table::resolve): Likewise.
12223 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12224 parameter. Change all callers.
12225 (Symbol_table::add_from_object): Get target from parameters.
12226 (Symbol_table::add_from_relobj): Don't check object target.
12227 (Symbol_table::add_from_dynobj): Likewise.
12228 (Symbol_table::define_special_symbol): Get target from
12229 parameters.
12230 * symtab.h (class Symbol_table): Update declaration.
12231 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12232 parameter. Change all callers. Clear parameter target.
12233 (Binary_test): Test target here.
12234 * testsuite/object_unittest.cc (gold_testsuite): Remove
12235 target_test_pointer parameter. Change all callers.
12236 (Object_test): Test target here.
12237
a6a22b83
ILT
122382009-09-26 Ian Lance Taylor <iant@google.com>
12239
12240 * testsuite/initpri1.c: Don't try to use constructor priorities if
12241 compiling with gcc before 4.3.
12242
6a8f49fe
ILT
122432009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12244
12245 * testsuite/retain_symbols_file_test.sh (check_present): Change
12246 output file name to retain_symbols_file_test.stdout.
12247 (check_absent): Likewise.
12248
8c604651
CS
122492009-09-18 Craig Silverstein <csilvers@google.com>
12250
12251 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12252 * options.cc: Include <cerrno> and <fstream>.
12253 (General_options::finalize): Parse -retain-symbols-file tag.
12254 * options.h: New flag.
12255 (General_options): New method should_retain_symbol, new
12256 variable symbols_to_retain.
12257 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12258 should_retain_symbol map.
12259 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12260 * testsuite/Makefile.in: Regenerate.
12261 * testsuite/retain_symbols_file_test.sh: New file.
12262
ca58b19f
NC
122632009-09-18 Nick Clifton <nickc@redhat.com>
12264
12265 * po/es.po: Updated Spanish translation.
12266
20e6d0d6
DK
122672009-09-17 Doug Kwan <dougkwan@google.com>
12268
12269 * debug.h (DEBUG_RELAXATION): New constant.
12270 (DEBUG_ALL): Add DEBUG_RELAXATION.
12271 (debug_string_to_enum): Add relaxation debug option.
12272 * layout.cc
12273 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12274 Layout::Relaxation_debug_check::read_sections,
12275 Layout::Relaxation_debug_check::read_sections): New method definitions.
12276 (Layout::Layout): Initialize data members
12277 record_output_section_data_from_scrips_,
12278 script_output_section_data_list_ and relaxation_debug_check_.
12279 (Layout::save_segments, Layout::restore_segments,
12280 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12281 Layout::relaxation_loop_body): New method definitions.
12282 (Layout::finalize): Support relaxation. Move section layout code to
12283 Layout::relaxation_loop_body.
12284 (Layout::set_asection_address_from_script): Move code for orphan
12285 section placement out.
12286 (Layout::place_orphan_sections_in_script): New method definition.
12287 * layout.h (Output_segment_headers, Output_file_header):
12288 New forward class declarations.
12289 (Layout::~Layout): Define.
12290 (Layout::new_output_section_data_from_script): New method definition.
12291 (Layout::place_orphan_sections_in_script): New method declaration.
12292 (Layout::Segment_states): New type declaration.
12293 (Layout::save_segments, Layout::restore_segments,
12294 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12295 Layout::relaxation_loop_body): New method declarations.
12296 (Layout::Output_section_data_list): New type declaration.
12297 (Layout::Relaxation_debug_check): New class definition.
12298 (Layout::record_output_section_data_from_script_,
12299 Layout::script_output_section_data_list_, Layout::segment_states_,
12300 Layout::relaxation_debug_check_): New data members.
12301 * output.cc: (Output_section_headers::do_size): New method definition.
12302 (Output_section_headers::Output_section_headers): Move size
12303 computation to Output_section_headers::do_size.
12304 (Output_segment_headers::do_size): New method definition.
e1df38aa 12305 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12306 Output_file_header::do_size and call it.
12307 (Output_file_header::do_size): New method definition.
12308 (Output_data_group::Output_data_group): Adjust call to
12309 Output_section_data.
12310 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12311 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12312 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12313 RELAXED_INPUT_SECTION_CODE.
12314 (Output_section::Output_section): Initialize data member checkpoint_.
12315 (Output_section::~Output_section): Delete checkpoint object pointed
12316 by checkpoint_.
12317 (Output_section::add_input_section): Always add an Input_section if
12318 relaxing.
12319 (Output_section::add_merge_input_section): Add assert.
12320 (Output_section::relax_input_section): New method definition.
12321 (Output_section::set_final_data_size): Set load address to zero for
12322 an unallocated section.
12323 (Output_section::do_address_and_file_offset_have_reset_values):
12324 New method definition.
12325 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12326 Handle relaxed input section.
12327 (Output_section::sort_attached_input_sections): Checkpoint input
12328 section list lazily.
12329 (Output_section::get_input_sections): Change type of input_sections to
12330 list of Simple_input_section pointers. Checkpoint input section list
12331 lazily. Also handle relaxed input sections.
12332 (Output_section::add_input_section_for_script): Take a reference to
12333 a Simple_input_section object instead of Relobj pointer and section
12334 index as parameter. Handle relaxed input sections.
12335 (Output_section::save_states, Output_section::restore_states): New
12336 method definitions.
12337 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12338 (Output_data::is_data_size_fixed): New method definition.
12339 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12340 if it is fixed.
12341 (Output_data::address_and_file_offset_have_reset_values): New method
12342 definition.
12343 (Output_data::do_address_and_file_offset_have_reset_values): New method
12344 definition.
12345 (Output_data::set_data_size): Check that data size is not fixed.
12346 (Output_data::fix_data_size): New method definition.
12347 (Output_data::is_data_size_fixed_): New data member.
12348 (Output_section_headers::set_final_data_size): New method definition.
12349 (Output_section_headers::do_size): New method declaration.
12350 (Output_segment_headers::set_final_data_size): New method definition.
12351 (Output_segment_headers::do_size): New method declaration.
12352 (Output_file_header::set_final_data_size)::New method definition.
12353 (Output_file_header::do_size)::New method declaration.
12354 (Output_section_data::Output_section_data): Add new parameter
12355 is_data_size_fixed and use it to fix data size.
12356 (Output_data_const::Output_data_const): Adjust call to base class
12357 constructor and fix data size.
12358 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12359 base class constructor and fix data size.
12360 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12361 base class constructor and fix data size.
12362 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12363 class constructor and fix data size.
12364 (Output_data_group::set_final_data_size): New method definition.
12365 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12366 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12367 class constructor and fix data size.
12368 (Output_relaxed_input_section): New class definition.
12369 (Output_section::Simple_input_section): New class definition.
12370 (Output_section::get_input_sections): Adjust parameter list.
12371 (Output_section::add_input_section_for_script): Same.
12372 (Output_section::save_states, Output_section::restore_states,
12373 Output_section::do_address_and_file_offset_have_reset_values,
12374 (Output_section::Input_section::Input_section): Handle
12375 RELAXED_INPUT_SECTION_CODE. Add new overload for
12376 Output_relaxed_input_section.
12377 (Output_section::Input_section::is_input_section,
12378 Output_section::Input_section::set_output_section): Handle relaxed
12379 input section.
12380 (Output_section::Input_section::is_relaxed_input_section,
12381 Output_section::Input_section::output_section_data,
12382 Output_section::Input_section::relaxed_input_section): New method
12383 definitions.
12384 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12385 value.
12386 (Output_section::Input_section::u1_): Update comments.
12387 (Output_section::Input_section::u2_): Add new union member poris.
12388 (Output_section::Checkpoint_output_section): New classs definition.
12389 (Output_section::relax_input_section): New method declaration.
12390 (Output_section::checkpoint_): New data member.
12391 (Output_segment): Update comments.
12392 (Output_segment::Output_segment): Un-privatize copy constructor.
12393 (Output_segment::operator=): Un-privatize.
12394 * script-sections.cc (Output_section_element::Input_section_list):
12395 Change element type to Output_section::Simple_input_section.
12396 (Output_section_element_dot_assignment::set_section_addresses):
12397 Register output section data for relaxation clean up.
12398 (Output_data_exression::Output_data_expression): Adjust call to base
12399 constructor to fix data size.
12400 (Output_section_element_data::set_section_addresses): Register
12401 Output_data_expression object for relaxation clean up.
12402 (struct Input_section_info): Replace Relobj pointer and section index
12403 pair with Output_section::Simple_input_section and Convert struct to a
12404 class.
12405 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12406 Input_section_info data member to use accessors.
20e6d0d6
DK
12407 (Output_section_element_input::set_section_addresses): Use layout
12408 parameter. Adjust code to use Output_section::Simple_input_section
12409 and Input_secction_info classes. Register filler for relaxation
12410 clean up.
12411 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12412 and section index pair with Output_section::Simple_input_section
12413 class. Adjust code accordingly.
12414 (Phdrs_element::release_segment): New method definition.
12415 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12416 segment list.
12417 (Script_sections::release_segments): New method definition.
12418 * gold/script-sections.h (Script_sections::release_segments): New
12419 method declaration.
12420 * gold/target.h (Target::may_relax, Target::relax,
12421 Target::do_may_relax, Target::do_relax): New method definitions.
12422
5e445df6
ILT
124232009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12424
12425 * arm.cc (has_signed_unsigned_overflow): New function.
12426 (Arm_relocate_functions::abs8): New function.
12427 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12428 (Target_arm::Scan::global): Likewise.
12429 (Target_arm::relocate::relocate): Likewise.
12430 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12431 Likewise.
12432
8c604651 124332009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12434
12435 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12436 * testsuite/Makefile.in: Regenerate.
12437
1e9cc1c2
NC
124382009-09-11 Nick Clifton <nickc@redhat.com>
12439
12440 * po/gold.pot: Updated by the Translation project.
12441
6a89f575
CC
124422009-09-08 Cary Coutant <ccoutant@google.com>
12443
12444 * output.cc (Output_file::open): Add execute permission to empty file.
12445 * testsuite/Makefile.am (permission_test): New test.
12446 * testsuite/Makefile.in: Regenerate.
12447
fdcac5af
ILT
124482009-09-02 Ian Lance Taylor <iant@google.com>
12449
12450 * output.cc (Output_file::resize): Call map_no_anonymous rather
12451 than map.
12452
44453f85
ILT
124532009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12454
12455 * gold.cc: Include "incremental.h".
12456 (queue_initial_tasks): Call Incremental_checker methods.
12457 * incremental.cc: Include "output.h".
12458 (Incremental_checker::can_incrementally_link_output_file): New
12459 method.
12460 * incremental.h (Incremental_checker): New class.
12461
12462 * output.cc (Output_file::open_for_modification): New method.
12463 (Output_file::map_anonymous): Changed return type to bool. Record
12464 map in base_ field.
12465 (Output_file::map_no_anonymous): New method, broken out of map.
12466 (Output_file::map): Use map_no_anonymous and map_anonymous.
12467 * output.h (class Output_file): Update declarations.
12468
293c1386
CC
124692009-08-24 Cary Coutant <ccoutant@google.com>
12470
12471 * options.h (Command_line::Pre_options): New class.
12472 (Command_line::pre_options): New member.
12473 * options.cc (gold::options::ready_to_register): New variable.
12474 (One_option::register_option): Do nothing if not registering options.
12475 Assert if same short option registered twice.
12476 (General_options::General_options): Turn off option registration when
12477 done constructing.
12478 (Command_line::Pre_options::Pre_options): New constructor.
12479
f773f3d2
CC
124802009-08-24 Cary Coutant <ccoutant@google.com>
12481
06a73cfe
CC
12482 * options.h (General_options::no_keep_memory): Remove incorrect
12483 short option.
f773f3d2 12484
a15af8e2
RW
124852009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12486
12487 * Makefile.am (am__skiplex, am__skipyacc): New.
12488 * Makefile.in: Regenerate.
12489
c462b41b
RW
124902009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12491
14ec8efd
RW
12492 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12493 (INCLUDES): ... this.
12494 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12495 (AM_CPPFLAGS): Renamed from ...
12496 (INCLUDE): ... this.
12497 * Makefile.in, testsuite/Makefile.in: Regenerate.
12498
81ecdfbb
RW
12499 * Makefile.in: Regenerate.
12500 * aclocal.m4: Likewise.
12501 * config.in: Likewise.
12502 * configure: Likewise.
12503 * testsuite/Makefile.in: Likewise.
12504
c462b41b
RW
12505 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12506 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12507 * Makefile.in: Regenerate.
12508 * testsuite/Makefile.in: Regenerate.
12509
2da73f13
CC
125102009-08-19 Cary Coutant <ccoutant@google.com>
12511
12512 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12513 symbols in shared libraries overridden by hidden or internal symbols
12514 in the main program.
12515
2db70501
CD
125162009-08-19 Chris Demetriou <cgd@google.com>
12517
12518 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12519 checking source file names in error messages.
12520
f733487b
DK
125212009-08-18 Doug Kwan <dougkwan@google.com>
12522
12523 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12524 an elcpp::Ehdr as parameter. Adjust call to set_target.
12525 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12526 an elfcpp::Ehdr as parameter.
12527 * object.cc (Object::set_target): Remove the version that looks up
12528 a target and sets it.
12529 (Sized_relobj::setup): Take a Target object instead of
12530 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12531 (make_elf_sized_object): Find target and ask target to
12532 make an ELF object.
12533 * object.h: (Object::set_target): Remove the version that looks up
12534 a target and sets it.
12535 (Sized_relobj::setup): Take a Target object instead of
12536 an elfcpp:Ehdr as parameter.
12537 * target.cc: Include dynobj.h.
12538 (Target::do_make_elf_object_implementation): New.
2e702c99 12539 (Target::do_make_elf_object): New.
f733487b
DK
12540 * target.h (Target::make_elf_object): New template declaration.
12541 (Target::do_make_elf_object): New method declarations.
12542 (Target::do_make_elf_object_implementation): New template declaration.
12543
cc70f101
ILT
125442009-08-14 Ian Lance Taylor <iant@google.com>
12545
12546 * gold.h (FUNCTION_NAME): Define.
12547 (gold_unreachable): Use FUNCTION_NAME.
12548
ef5e0cb1
ST
125492009-08-12 Sriraman Tallam <tmsriram@google.com>
12550
12551 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12552 symbol in the --keep-unique list is not found.
12553
48c187ce
ST
125542009-08-12 Sriraman Tallam <tmsriram@google.com>
12555
12556 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12557 been maked as --keep-unique.
12558 (Icf::unfold_section): New function.
12559 * icf.h (Icf::unfold_section): New function.
12560 * options.h (General_options::keep_unique): New option.
12561 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12562 * testsuite/Makefile.in: Regenerate.
12563 * testsuite/icf_keep_unique_test.sh: New file.
12564 * testsuite/icf_keep_unique_test.cc: New file.
12565
645afe0c
CC
125662009-08-12 Cary Coutant <ccoutant@google.com>
12567
12568 PR 10471
12569 * resolve.cc (Symbol_table::resolve): Check for references from
12570 dynamic objects to hidden and internal symbols.
12571 * testsuite/Makefile.am (hidden_test.sh): New test.
12572 * testsuite/Makefile.in: Regenerate.
12573 * testsuite/hidden_test.sh: New script.
12574 * testsuite/hidden_test_1.c: New test source.
12575 * testsuite/hidden_test_main.c: New test source.
12576
11af873f
DK
125772009-08-11 Doug Kwan <dougkwan@google.com>
12578
12579 * arm.cc: Update comments.
12580 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12581 segment to locate the .ARM.exidx section if present.
12582
b9f7d72d
DK
125832009-08-09 Doug Kwan <dougkwan@google.com>
12584
12585 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12586 patch.
12587
ddd3c53c
ST
125882009-08-07 Sriraman Tallam <tmsriram@google.com>
12589 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12590 compiler warnings.
12591
27721062
ST
125922009-08-06 Sriraman Tallam <tmsriram@google.com>
12593
12594 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12595 valid tls_segment only for non-debug-section relocations.
12596 * testsuite/Makefile.am: Add gc_tls_test.
12597 * testsuite/Makefile.in: Regenerate.
12598 * testsuite/gc_tls_test.cc: New file.
12599 * testsuite/gc_tls_test.sh: New file.
12600
ef15dade 126012009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12602
ef15dade
ST
12603 * icf.cc: New file.
12604 * icf.h: New file.
12605 * Makefile.am (CCFILES): Add icf.cc.
12606 (HFILES): Add icf.h
12607 * Makefile.in: Regenerate.
12608 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12609 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12610 section, symbol and addend information for the relocs.
12611 * gold.cc (queue_middle_tasks): Call identical code folding.
12612 * gold.h: Add defines for multimap.
12613 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12614 to the call of finalize_local_symbols.
12615 * main.cc (main): Create object of class Icf.
12616 * object.cc (Sized_relobj::do_layout): Allow this function to be
12617 called twice during icf.
12618 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12619 to sections marked as identical by icf.
12620 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12621 when available.
12622 (Sized_relobj::do_section_entsize): New function.
12623 * object.h (Object::section_entsize): New function.
12624 (Object::do_section_entsize): New pure virtual function.
12625 (Relobj::finalize_local_symbols): Add new parameter.
12626 (Relobj::do_section_entsize): New function.
12627 * options.h (General_options::icf): New option.
12628 (General_options::icf_iterations): New option.
12629 (General_options::print_icf_sections): New option.
12630 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12631 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12632 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12633 icf.
12634 * symtab.cc (Symbol_table::is_section_folded): New function.
12635 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12636 to sections marked as identical by icf.
12637 * symtab.h (Symbol_table::set_icf): New function.
12638 (Symbol_table::icf): New function.
12639 (Symbol_table::is_section_folded): New function.
12640 (Symbol_table::icf_): New data member.
12641 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12642 * testsuite/Makefile.am: Add commands to build icf_test.
12643 * testsuite/Makefile.in: Regenerate.
12644 * testsuite/icf_test.sh: New file.
12645 * testsuite/icf_test.cc: New file.
12646
c3b65ac4
CD
126472009-07-24 Chris Demetriou <cgd@google.com>
12648
12649 * layout.cc (is_compressible_debug_section): Fix incorrect
12650 comment about compressed section names.
12651
1caf2c51
ILT
126522009-07-20 Ian Lance Taylor <ian@airs.com>
12653
12654 PR 10419
12655 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12656
1ef4d87f
ILT
126572009-07-16 Ian Lance Taylor <iant@google.com>
12658
12659 PR 10400
12660 * layout.h: #include <map>.
12661 (class Kept_section): Change from struct to class. Add accessors
12662 and setters. Add section size to Comdat_group mapping. Change
12663 Comdat_group to std::map. Add is_comdat_ field. Add
12664 linkonce_size field in union.
12665 (class Layout): Update declaration of find_or_add_kept_section.
12666 Don't declare find_kept_object.
12667 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12668 parameter. Add object, shndx, is_comdat, and is_group_name
12669 parameters. Change all callers. Adjust for new Kept_section.
12670 (Layout::find_kept_object): Remove.
12671 * object.cc (Sized_relobj::include_section_group): Update use of
12672 Kept_section. Rename secnum to shndx. Only record
12673 Kept_comdat_section if sections are the same size.
12674 (Sized_relobj::include_linkonce_section): Update use of
12675 Kept_section. Only record Kept_comdat_section if sections are the
12676 same size. Set size of linkonce section.
12677 (Sized_relobj::map_to_kept_section): Update call to
12678 get_kept_comdat_section.
12679 * object.h (class Sized_relobj): Rename fields in
12680 Kept_comdat_section to drop trailing underscores; change object
12681 field to Relobj*. Change Kept_comdat_section_table to store
12682 struct rather than pointer.
12683 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12684 Add kept_object and kept_shndx parameters. Change all callers.
12685 (Sized_relobj::get_kept_comdat_section): Change return type to
12686 bool. Add kept_object and kept_shndx parameters. Change all
12687 callers.
12688 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12689 Layout::find_or_add_kept_section.
12690
37c3b7b0
ILT
126912009-07-09 Ian Lance Taylor <iant@google.com>
12692
12693 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12694 Reserve space in the hash table.
12695
98fa85cb
ILT
126962009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12697
12698 * fileread.cc (File_read::get_mtime): New method.
12699 * fileread.h (Timespec): New structure.
12700 (File_read::get_mtime): New method.
12701 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12702 Renamed from timestamp_nsec.
12703 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12704 Elf_Xword.
e1df38aa 12705 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12706 timestamp_nsec.
e1df38aa 12707 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12708 (Incremental_inputs::report_obejct): Save mtime; style fix.
12709 (Incremental_inputs::report_script): Save mtime; style fix.
12710 (Incremental_inputs::finalize_inputs): Style fix.
12711 (Incremental_inputs::finalize): Style fix.
12712 (Incremental_inputs::create_input_section_data): Store inputs
12713 mtime.
12714 * incremental.h (Incremental_inputs::report_script): Add mtime
12715 argument.
12716 (Incremental_inputs::Input_info::Input_info): Intialize only one
12717 union member.
12718 (Incremental_inputs::Input_info::archive): Move to nameless
12719 union.
12720 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12721 (Incremental_inputs::Input_info::script): Move to nameless union.
12722 (Incremental_inputs::mtime): New field.
12723 * script.cc (read_input_script): Pass file mtime to
12724 Incremental_input.
12725 * script.h (Script_info::inputs): Style fix.
12726
c9d70757
ILT
127272009-07-01 Ian Lance Taylor <ian@airs.com>
12728
12729 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12730 instead of 32.
12731
9c547ec3
ILT
127322009-06-24 Ian Lance Taylor <iant@google.com>
12733
12734 PR 10156
12735 * layout.cc (Layout::choose_output_section): If we find an
12736 existing section, update the flags.
12737 (Layout::create_notes): New function, broken out of
12738 Layout::finalize.
12739 (Layout::finalize): Don't create note sections.
12740 (Layout::create_note): Don't crash if linker script discards
12741 section.
12742 (Layout::create_gold_note): Likewise.
12743 (Layout::create_build_id): Likewise. Don't set
12744 after_input_sections on the section.
12745 (Layout::create_executable_stack_info): Remove target parameter.
12746 Change caller.
12747 * layout.h (class Layout): Declare create_notes. Update
12748 declaration of create_executable_stack_info.
12749 * gold.cc (queue_middle_tasks): Call create_notes.
12750 * output.cc (Output_section::update_flags_for_input_section): Move
12751 here from output.h. If SHF_ALLOC flag is newly set, mark address
12752 invalid.
12753 * output.h (Output_data::mark_address_invalid): New function.
12754 (class Output_section): Only declare, not define,
12755 update_flags_for_input_section. Remove set_flags.
12756
55458500
ILT
127572009-06-24 Ian Lance Taylor <iant@google.com>
12758
12759 * script-sections.cc (Output_section_definition::
12760 set_section_addresses): Rename shadowing local load_address to
12761 laddr.
12762
1307d6cd
ILT
127632009-06-24 Ian Lance Taylor <iant@google.com>
12764
12765 PR 10244
12766 * reloc.cc (relocate_sections): Skip empty relocation sections.
12767
ec3f783e
ILT
127682009-06-23 Ian Lance Taylor <iant@google.com>
12769
12770 PR 10156
12771 * layout.cc (Layout::create_note): Use choose_output_section
12772 rather than make_output_section.
12773
459c9f1c
ILT
127742009-06-23 Ian Lance Taylor <iant@google.com>
12775
12776 PR 10237
12777 * options.cc (General_options::parse_V): Set printed_version_.
12778 (General_options::General_options): Initialize printed_version_.
12779 * options.h (class General_options): Add printed_version_ field.
12780 * gold.cc (queue_initial_tasks): If there are no input files,
12781 don't give a fatal error if we printed the version information.
12782 (queue_middle_tasks): If using -r with a shared object, give a
12783 fatal error rather than an ordinary error.
12784
1518dc8f
ILT
127852009-06-23 Ian Lance Taylor <iant@google.com>
12786
12787 PR 10219
12788 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12789 (Layout::make_output_section): Set have_stabstr_section_ if we see
12790 a .stab*str section.
12791 (Layout::finalize): Call link_stabs_sections.
12792 (Layout::link_stabs_sections): New file.
12793 * layout.h (class Layout): Add have_stabstr_section_ field.
12794 Declare link_stabs_sections.
12795
3d857b98
DK
127962009-06-23 Doug Kwan <dougkwan@google.com>
12797
12798 * Makefile.am (libgold_a_LIBADD): New.
12799 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12800 * Makefile.in: Regenerate.
3d857b98
DK
12801 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12802 * configure: Regenerate.
12803 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12804 * fileread.cc: Include sys/state.h
12805 * gold.h: Declare memmem and strndup if found missing.
12806 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12807
0639a6f6
ILT
128082009-06-23 Ian Lance Taylor <iant@google.com>
12809
12810 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12811 * configure: Rebuild.
12812
8d63875c
ILT
128132009-06-23 Ian Lance Taylor <iant@google.com>
12814
12815 PR 10147
12816 * object.cc (Object::section_contents): Don't try to get a view if
12817 the section has length zero.
12818 (Object::handle_gnu_warning_section): If the section is empty, use
12819 the name of the section as the warning.
12820
f7c8a183
ILT
128212009-06-23 Ian Lance Taylor <iant@google.com>
12822
12823 PR 10133
12824 * stringpool.h (class Stringpool_template): Add optimize_ field.
12825 (Stringpool_template::set_optimize): New function.
12826 * stringpool.cc (Stringpool_template::Stringpool_template):
12827 Initialize optimize_ field.
12828 (Stringpool_template::set_string_offsets): Test local optimize
12829 fild rather than parameter.
12830 * layout.cc (Layout::Layout): Call set_optimize on the section
12831 name stringpool.
12832
e6a307ba
ILT
128332009-06-22 Ian Lance Taylor <iant@google.com>
12834
12835 PR 10030
12836 * yyscript.y: Parse TARGET.
12837 * script.cc (script_set_target): New function.
12838 * script-c.h (script_set_target): Declare.
12839 * options.cc (General_options::string_to_object_format): Rename
12840 from string_to_object_format in anonymous namespace. Change
12841 callers.
12842 * options.h (class General_options): Declare
12843 string_to_object_format.
12844
3ee173de
ILT
128452009-06-22 Ian Lance Taylor <iant@google.com>
12846
12847 * script-sections.cc (Script_sections::create_segments): Don't put
12848 program headers in a PT_LOAD segment if -n or -N.
12849
128502009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12851
12852 PR 10141
12853 * options.h (class General_options): Add -z lazy and -z now. Sort
12854 -z options into alphabetical order.
12855 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12856
cd6739a1 128572009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12858
12859 * layout.cc (Layout::make_output_section): Call
12860 Target::new_output_section.
12861 (Layout::attach_allocated_section_to_segment): Put large section
12862 sections in a separate load segment with the large segment flag
12863 set.
12864 (Layout::segment_precedes): Sort large data segments after other
12865 load segments.
12866 (align_file_offset): New static function.
12867 (Layout::set_segment_offsets): Use align_file_offset.
12868 * output.h (class Output_section): Add is_small_section_ and
12869 is_large_section_ fields.
12870 (Output_section::is_small_section): New function.
12871 (Output_section::set_is_small_section): New function.
12872 (Output_section::is_large_section): New function.
12873 (Output_section::set_is_large_section): New function.
12874 (Output_section::is_large_data_section): New function.
12875 (class Output_segment): Add is_large_data_segment_ field.
12876 (Output_segment::is_large_data_segment): New function.
12877 (Output_segment::set_is_large_data_segment): New function.
12878 * output.cc (Output_section::Output_section): Initialize new
12879 fields.
12880 (Output_segment::Output_segment): Likewise.
12881 (Output_segment::add_output_section): Add assertion that large
12882 data sections always go in large data segments. Force small data
12883 sections to the end of the list of data sections. Force small BSS
12884 sections to the start of the list of BSS sections. For large BSS
12885 sections to the end of the list of BSS sections.
12886 * symtab.h (class Symbol): Declare is_common_shndx.
12887 (Symbol::is_defined): Check Symbol::is_common_shndx.
12888 (Symbol::is_common): Likewise.
12889 (class Symbol_table): Define enum Commons_section_type. Update
12890 declarations. Add small_commons_ and large_commons_ fields.
12891 * symtab.cc (Symbol::is_common_shndx): New function.
12892 (Symbol_table::Symbol_table): Initialize new fields.
12893 (Symbol_table::add_from_object): Put small and large common
12894 symbols in the right list.
12895 (Symbol_table::sized_finalized_symbol): Check
12896 Symbol::is_common_shndx.
12897 (Symbol_table::sized_write_globals): Likewise.
12898 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12899 common symbol lists. Don't call do_allocate_commons_list if the
12900 list is empty.
12901 (Symbol_table::do_allocate_commons_list): Remove is_tls
12902 parameter. Add comons_section_type parameter. Change all
12903 callers. Handle small and large common symbols.
12904 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12905 Symbol::is_common_shndx.
12906 * resolve.cc (symbol_to_bits): Likewise.
12907 * target.h (Target::small_common_shndx): New function.
12908 (Target::small_common_section_flags): New function.
12909 (Target::large_common_shndx): New function.
12910 (Target::large_common_section_flags): New function.
12911 (Target::new_output_section): New function.
12912 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12913 small_common_section_flags, and large_common_section_flags
12914 fields.
12915 (Target::do_new_output_section): New virtual function.
12916 * arm.cc (Target_arm::arm_info): Initialize new fields.
12917 * i386.cc (Target_i386::i386_info): Likewise.
12918 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12919 Likewise.
12920 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12921 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12922 (Target_x86_64::do_new_output_section): New function.
12923 * configure.ac: Define conditional MCMODEL_MEDIUM.
12924 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12925 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12926 (large_LDFLAGS): Define.
12927 * testsuite/large.c: New file.
12928 * testsuite/testfile.cc (Target_test::test_target_info):
12929 Initialize new fields.
12930 * configure, testsuite/Makefile.in: Rebuild.
12931
bb04269c
DK
129322009-06-05 Doug Kwan <dougkwan@google.com>
12933
12934 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12935 * Makefile.in: Regenerate.
bb04269c
DK
12936 * i386.cc (class Target_i386): Define new virtual method to
12937 override do_is_local_label_name in parent.
12938 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12939 local symbols if --discard-locals or -X is given.
12940 * options.h (class General_options): Declare new options
12941 '--discard-locals' and '-X' for discarding locals.
12942 * target.h (class Target): Define new methods is_local_label_name.
12943 Declare new virtual method do_is_local_label_name.
12944 * target.cc: New file.
12945 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12946 (check_SCRIPTS): Add discard_locals_test.sh.
12947 (check_DATA): Add discard_local_tests.syms.
12948 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12949 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12950 * testsuite/Makefile.in: Regenerate.
12951 * testsuite/discard_locals_test.c: New file.
12952 * testsuite/discard_locals_test.sh: Same.
12953
805bb01c
DK
129542009-06-05 Doug Kwan <dougkwan@google.com>
12955
12956 * object.cc (Sized_relobj::Sized_relobj): Initialize
12957 discarded_eh_frame_shndx_ to -1U.
12958 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12959 section.
12960 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12961 a discarded .eh_frame section.
12962 (Sized_relobj::do_finalize_local_symbols): Ditto.
12963 * object.h (class Sized_relobj): Declare new member
12964 discarded_eh_frame_shndx_.
12965 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12966 (local_labels_test.o, local_labels_test): New rules.
12967 * testsuite/Makefile.in: Regenerate.
12968
1dcd334d
DK
129692009-06-04 Doug Kwan <dougkwan@google.com>
12970
12971 * layout.cc (Layout::section_name_mapping): Add mapping for
12972 special ARM sections.
12973
96d49306
DK
129742009-06-03 Doug Kwan <dougkwan@google.com>
12975
12976 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12977 (utils::has_overflow): Same.
12978
dff16297
ILT
129792009-06-03 Ian Lance Taylor <iant@google.com>
12980
12981 * layout.cc (Layout::section_name_mapping): New array, replacing
12982 Layout::linkonce_mapping.
12983 (Layout::section_name_mapping_count): New variable, replacing
12984 Layout::linkonce_mapping_count.
12985 (Layout::linkonce_output_name): Remove.
12986 (Layout::output_section_name): Rewrite.
12987 * layout.h (class Layout): Rename Linkonce_mapping to
12988 Section_name_mapping, linkonce_mapping to section_name_mapping,
12989 linkonce_mapping_count to section_name_mapping_count. Don't
12990 declare linkonce_output_name.
12991
c121c671
DK
129922009-06-03 Doug Kwan <dougkwan@google.com>
12993
12994 * gold/arm.cc (namespace utils): New.
12995 (Target_arm::reloc_is_non_pic): Define new method.
12996 (class Arm_relocate_functions): New.
12997 (Target_arm::Relocate::relocate): Handle relocation types used by
12998 Android.
12999
07800fab
ILT
130002009-06-03 Ian Lance Taylor <iant@google.com>
13001
13002 * arm.cc (Target_arm::scan::global): Use || instead of |.
13003
c121c671
DK
130042009-06-02 Doug Kwan <dougkwan@google.com>
13005
13006 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13007 issued_non_pic_error_.
13008 (class Target_arm::Scan): Declare new method check_non_pic.
13009 Define new method symbol_needs_plt_entry.
13010 Declare new data member issued_non_pic_error_.
13011 (class Target_arm::Relocate): Declare new method
13012 should_apply_static_reloc.
13013 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13014 (Target_arm::Scan::check_non_pic): Define new method.
13015 (Target_arm::Scan::local): Handle a small subset of reloc types used
13016 by Android.
13017 (Target_arm::Scan::local): Same.
13018 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13019
b19b0c6d
ILT
130202009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13021
13022 * incremental.cc (Incremental_inputs::report_command_line): Filter
13023 out --incremental-* options.
13024
94cdfcff
DK
130252009-05-29 Doug Kwan <dougkwan@google.com>
13026
13027 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13028 template class.
13029 (class Target_arm): Update comment.
13030 (Target_arm::Target_arm): Initialize new data members GOT_,
13031 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13032 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13033 and Target_arm::rel_dyn_section.
13034 Declare new_enum Target_arm::Got_type.
13035 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13036 and DYNBSS_.
13037 Update commments for member do_dynsym_value.
13038 (Target_arm::got_size, Target_arm::plt_section,
13039 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13040 new methods inside class defintion.
13041 (Target_arm::got_section): Define new method.
13042 (Target_arm::rel_dyn_section): Same.
13043 (Output_data_plt_arm): New template class.
13044 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13045 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13046 (Output_data_plt_arm::add_entry): Same.
13047 (Output_data_plt_arm::first_plt_entry): Define new
13048 static data member for PLT instruction template.
13049 (Output_data_plt_arm::plt_entry): Same.
13050 (Output_data_plt_arm::do_write): Define new method.
13051 (Target_arm::make_plt_entry): Same.
13052 (Target_arm::do_finalize_sections): Same.
13053 (Target_arm::do_dynsym_value): Same.
13054
4a657b0d
DK
130552009-05-28 Doug Kwan <dougkwan@google.com>
13056
13057 * Makefile.am (TARGETSOURCES): Add arm.cc.
13058 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13059 * Makefile.in: Regenerate.
13060 * arm.cc: New file.
13061 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13062
e7ae8c36
DK
130632009-05-26 Doug Kwan <dougkwan@google.com>
13064
13065 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13066 (General_options::check_excluded_libs): Strip off directories in
13067 archive name before matching like GNU ld does.
13068 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13069 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13070 (exclude_libs_test_LDFLAGS): Add linker option
13071 -Wl,--exclude-libs,libexclude_libs_test_3
13072 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13073 an explicit archive without using -l.
13074 (alt/libexclude_libs_test_3.a): New make rule.
13075 * testsuite/Makefile.in: Regenerate.
13076 * testsuite/exclude_libs_test.c : Declare lib3_default().
13077 (main): Call it.
13078 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13079 * exclude_libs_test_3.c: New file.
13080
f12e7348
NC
130812009-05-26 Nick Clifton <nickc@redhat.com>
13082
13083 * po/id.po: New Indonesian translation.
13084 * po/gold.pot: Updated template file.
13085
4daadc0d
ST
130862009-05-22 Sriraman Tallam <tmsriram@google.com>
13087
e1df38aa 13088 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13089 gc_comdat_test files. Add -Wl,--gc-sections to build
13090 gc_comdat_test.
13091 * testsuite/Makefile.in: Regenerate.
13092 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13093
531813ad
ST
130942009-05-21 Sriraman Tallam <tmsriram@google.com>
13095
13096 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13097 kept comdat section was garbage collected.
13098 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13099 * testsuite/Makefile.in: Regenerate.
13100 * testsuite/gc_comdat_test.sh: New file.
13101 * testsuite/gc_comdat_test_1.cc: New file.
13102 * testsuite/gc_comdat_test_2.cc: New file.
13103
65514900
CC
131042009-05-19 Doug Kwan <dougkwan@google.com>
13105
13106 * archive.cc (Archive::Archive): Move constructor from archive.h
13107 to here. Initialize no_export_.
13108 (Archive::get_elf_object_for_member): Set no_export flag of object.
13109 * archive.h (Archive::Archive): Move constructor body to
13110 archive.cc.
13111 (Archive::no_export): New method.
13112 (Archive::no_export_): New field.
13113 * object.h (Object::Object): Initialize no_export_ to false.
13114 (Object::no_export, Object::set_no_export): New methods.
13115 (Object::no_export_): New field.
13116 * options.cc (General_options::parse_exclude_libs): New method.
13117 (General_options::check_excluded_libs) Same.
13118 * options.h (exclude_libs): New option.
13119 (General_options::check_excluded_libs): New method declaration.
13120 (General_options::excluded_libs_): New field.
13121 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13122 default or protected visibility if an object has no-export flag set.
13123 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13124 (check_SCRIPTS): Add exclude_libs_test.sh.
13125 (check_DATA): Add exclude_libs_test.syms.
13126 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13127 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13128 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13129 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13130 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13131 libexclude_libs_test_2.a): New rules.
13132 * testsuite/Makefile.in: Regenerate.
13133 * testsuite/exclude_libs_test.c: New file.
13134 * testsuite/exclude_libs_test.sh: Ditto.
13135 * testsuite/exclude_libs_test_1.c: Ditto.
13136 * testsuite/exclude_libs_test_2.c: Ditto.
13137
1b77ea50
ILT
131382009-05-15 Ian Lance Taylor <iant@google.com>
13139
13140 * configure.ac: Check for declarations for cases where libiberty.h
13141 checks HAVE_DECL_xxx.
13142 * configure, config.in: Rebuild.
13143
072fe7ce
ILT
131442009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13145
13146 * gold.h (Incremental_argument_list): Remove (invalid) forward
13147 declaration.
13148 * incremental.cc (Incremental_inputs::report_achive): New method.
13149 (Incremental_inputs::report_object): New method.
13150 (Incremental_inputs::report_script): New method.
13151 (Incremental_inputs::finalize_inputs): New method.
13152 (Incremental_inputs::finalize): Call finalize_inputs().
13153 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13154 Create inputs entries.
13155 * incremental.h (Incremental_input_type): New enum.
13156 (Incremental_inputs::Incremental_input): Initialize new fields.
13157 (Incremental_inputs::report_inputs): New method.
13158 (Incremental_inputs::report_achive): New method.
13159 (Incremental_inputs::report_object): New method.
13160 (Incremental_inputs::report_script): New method.
13161 (Incremental_inputs::finalize_inputs): New method.
13162 (Incremental_inputs::Input_info): New struct.
13163 (Incremental_inputs::Input_info_map): New typedef.
13164 (Incremental_inputs::lock_): New field.
13165 (Incremental_inputs::Inputs_): New field.
13166 (Incremental_inputs::Inputs_map): New field.
13167 * main.cc (main): Call Incremental_input::report_inputs.
13168 * options.h (Input_argument_list): Typedef moved from
13169 Input_arguments.
13170 (Input_file_group::Files): Remove, use ::Input_argument_list.
13171 (Input_file_group::Input_argument_list): Remove, use
13172 ::Input_argument_list.
13173 * plugin.cc (Plugin_manager::add_input_file): Add error in
13174 incremental build.
13175 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13176 functions.
13177 * script.cc (read_input_script): Call
13178 Incremental_input::report_script.
13179 * script.h (Script_info): New class.
13180
b0481b0b
ILT
131812009-04-27 Ian Lance Taylor <iant@google.com>
13182
13183 * x86_64.cc (do_adjust_output_section): Set entsize to
13184 plt_entry_size.
13185
b22a5a41 131862009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13187
13188 * output.cc (Output_file::close): After short writes, continue
13189 writing from the correct offset in the buffer being written.
13190
40fde488
CD
131912009-04-23 Chris Demetriou <cgd@google.com>
13192
13193 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13194 * configure: Regenerate.
13195 * config.in: Regenerate.
13196 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13197 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13198
3ce2c28e
ILT
131992009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13200
13201 * incremental.cc (Incremental_inputs_header_data): Renamed from
13202 Incremental_input_header_data.
13203 (Incremental_inputs_header_data::data_size): New field.
13204 (Incremental_inputs_header_data::put_input_file_count): Renamed
13205 from input_file_count.
13206 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13207 from command_line_offset.
13208 (Incremental_inputs_header_data::put_reserved): Renamed from
13209 put_reserved.
13210 (Incremental_inputs_entry_data): Renamed from
13211 Incremental_input_entry_data.
13212 (Incremental_inputs_entry_data::data_size): New field.
13213 (Incremental_inputs::report_command_line): New method.
13214 (Incremental_inputs::finalize): New method.
13215 (Incremental_inputs::create_incremental_inputs_data): New method.
13216 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13217 * incremental.h: New file.
13218 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13219 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13220 incremental builds.
703d02da 13221 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13222 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13223 (Layout::create_incremental_info_sections): New method.
13224 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13225 * main.cc (main): Notify Incremental_input of the command line.
13226
e55bde5e
ILT
132272009-04-01 Ian Lance Taylor <iant@google.com>
13228 Mikolaj Zalewski <mikolajz@google.com>
13229
13230 * gold.h (reserve_unordered_map): Define, three versions, one for
13231 each version of Unordered_map.
13232 * layout.cc (Layout::Layout): Remove options parameter. Add
13233 number_of_input_files parameter. Don't initialize options_.
13234 Initialize number_of_input_files_ and resized_signatures_. Move
13235 sections_are_attached_.
13236 (Layout::layout_group): Reserve space for group_signatures_.
13237 (Layout::find_or_add_kept_section): Change name parameter to be a
13238 reference. Resize signatures_ map when it gets large enough.
13239 (Layout::layout_eh_frame): Use parameters->options() instead of
13240 this->options_.
13241 (Layout::make_output_section): Likewise.
13242 (Layout::attach_allocated_section_to_segment): Likewise.
13243 (Layout::finalize, Layout::create_executable_stack): Likewise.
13244 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13245 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13246 * layout.h (class Layout): Update declarations. Remove options_
13247 field. Add number_of_input_files_ and resized_signatures_
13248 fields. Move sections_are_attached_ field.
13249 * main.cc (main): Pass number of input files to Layout
13250 constructor. Don't pass options.
13251
154b857c
ILT
132522009-03-30 Ian Lance Taylor <iant@google.com>
13253
13254 * ffsll.c (ffsll): Correct implementation.
13255
2f35ab9b
ILT
132562009-03-27 Ian Lance Taylor <iant@google.com>
13257
fd03461a
ILT
13258 * ffsll.c: New file.
13259 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13260 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13261 * ftruncate.c (ftruncate): Declare before definition.
13262 * mremap.c (mremap): Likewise.
13263 * pread.c (pread): Likewise.
13264 * configure, Makefile.in, config.in: Rebuild.
13265
2f35ab9b
ILT
13266 * mremap.c: New file.
13267 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13268 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13269 (mremap): Declare if HAVE_MREMAP is not defined.
13270 * configure, Makefile.in, config.in: Rebuild.
13271
33aea2fd
CC
132722009-03-27 Cary Coutant <ccoutant@google.com>
13273
13274 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13275 position independent.
13276 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13277 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13278
6d479619
CC
132792009-03-24 Cary Coutant <ccoutant@google.com>
13280
13281 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13282 an executable.
13283 (needs_dynamic_reloc): Likewise.
13284
afc06bb8
ILT
132852009-03-24 Ian Lance Taylor <iant@google.com>
13286
13287 * yyscript.y (file_cmd): Recognize EXTERN.
13288 (extern_name_list, extern_name_list_body): New nonterminals.
13289 * script.cc (script_add_extern): Define.
13290 * script-c.h (script_add_extern): Declare.
13291
f6060a4d
ILT
132922009-03-24 Rafael Avila de Espindola <espindola@google.com>
13293
13294 * object.cc (is_elf_object): Define.
13295 * object.h (is_elf_object): Declare.
13296 * archive.cc (Archive::get_elf_object_for_member): Call
13297 is_elf_object.
33aea2fd 13298 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13299
26736d8e
ILT
133002009-03-24 Elliott Hughes <enh@google.com>
13301
13302 * output.cc (Output_file::map_anonymous): Define.
13303 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13304 try an anonymous one. Report the size if the mmap fails.
13305 * output.h (class Output_file): Declare map_anonymous.
13306
22fd9730
ILT
133072009-03-24 Ian Lance Taylor <iant@google.com>
13308
13309 * target-select.cc (instantiate_target): Don't acquire the lock if
13310 the instantiated_target_ field has already been set.
13311
cb010894
ILT
133122009-03-23 Ian Lance Taylor <iant@google.com>
13313
7f055c20
ILT
13314 * gold-threads.h (class Initialize_lock): Define.
13315 * gold-threads.cc (class Initialize_lock_once): Define.
13316 (initialize_lock_control): New static variable.
13317 (initialize_lock_pointer): New static variable.
13318 (initialize_lock_once): New static function.
13319 (Initialize_lock::Initialize_lock): Define.
13320 (Initialize_lock::initialize): Define.
13321 * target-select.h: Include "gold-threads.h".
13322 (class Target_selector): Add lock_ and initialize_lock_ fields.
13323 Don't define instantiate_target, just declare it.
13324 * target-select.cc (Target_selector::Target_selector): Initialize
13325 new fields.
13326 (Target_selector::instantiate_target): Define.
13327 * descriptors.h: Include "gold-threads.h".
13328 (class Descriptors): Add initialize_lock_ field.
13329 * descriptors.cc (Descriptors::Descriptors): Initialize new
13330 field.
13331 (Descriptors::open): Use initialize_lock_ field
13332 * errors.h (class Errors): Add initialize_lock_ field.
13333 * errors.cc (Errors::Errors): Initialize new field.
13334 (Errors::initialize_lock): Use initialize_lock_ field.
13335 * powerpc.cc (class Target_selector_powerpc): Remove
13336 instantiated_target_ field. In do_recognize call
13337 instantiate_target rather than do_instantiate_target. In
13338 do_instantiate_target just allocate a new target.
13339 * sparc.cc (class Target_selector_sparc): Likewise.
13340
36959681
ILT
13341 * freebsd.h: New file.
13342 * i386.cc: Include "freebsd.h".
13343 (Target_i386): Derive from Target_freebsd rather than
13344 Sized_target.
13345 (Target_selector_i386): Derive from Target_selector_freebsd rather
13346 than Target_selector.
13347 * x86_64.cc: Include "freebsd.h".
13348 (Target_x86_64): Derive from Target_freebsd rather than
13349 Sized_target.
13350 (Target_selector_x86_64): Derive from Target_selector_freebsd
13351 rather than Target_selector.
13352 * target.h (class Target): Add adjust_elf_header and
13353 do_adjust_elf_header.
13354 * output.cc (Output_file_header:: do_sized_write): Call target
13355 adjust_elf_header routine.
13356 * configure.tgt: Set targ_osabi.
13357 * configure.ac: Define GOLD_DEFAULT_OSABI.
13358 * parameters.cc (Parameters::default_target): Pass
13359 GOLD_DEFAULT_OSABI to select_target.
13360 * target-select.h (class Target_selector): Make instantiate_target
13361 protected rather than private.
13362 * Makefile.am (HFILES): Add freebsd.h.
13363 * configure, Makefile.in, config.in: Rebuild.
13364
cb010894
ILT
13365 * merge.cc (do_add_input_section): Correct pend value. Change
13366 message about last entry not being null terminated from error to
13367 warning.
13368
0e879927
ILT
133692009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13370
13371 * incremental.cc: New file.
13372 * Makefile.am (CCFILES): Add incremental.cc.
13373 * Makefile.in: Rebuild.
13374
41105937
PP
133752009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13376
13377 * layout.cc (Layout::output_section_name): Preserve names
13378 of '.note.' sections.
e1df38aa 13379
60439920
ILT
133802009-03-19 Ian Lance Taylor <iant@google.com>
13381
13382 * descriptors.cc (Descriptors::open): Check that the options are
13383 valid before using them.
13384
0d371ad3
ILT
133852009-03-18 Ian Lance Taylor <iant@google.com>
13386
13387 * script-sections.h: Include <list>.
13388 (class Script_sections): Change Sections_elements from std::vector
13389 to std::list. Typedef public Elements_iterator. Add
13390 orphan_section_placement_, data_segment_align_start_, and
13391 saw_data_segment_align_ fields. Remove data_segment_align_index_
13392 field.
13393 * script-sections.cc (class Orphan_section_placement): New class.
13394 (class Sections_element): Add virtual functions is_relro and
13395 orphan_section_init. Remove virtual function place_orphan_here.
13396 (class Output_section_definition): Add is_relro and
13397 orphan_section_init. Remove place_orphan_here.
13398 (class Orphan_output_section): Likewise.
13399 (Script_sections::Script_sections): Update for field changes.
13400 (Script_sections::data_segment_align): Set saw_data_segment_align_
13401 and data_segment_align_start_, not data_segment_align_index.
13402 (Script_sections::data_segment_relro_end): Check
13403 saw_data_segment_align_. Use data_segment_align_start_ rather
13404 than data_segment_align_index_.
13405 (Script_sections::place_orphan): Rewrite to use
13406 Orphan_section_placement.
13407
9201d894
ILT
134082009-03-17 Ian Lance Taylor <iant@google.com>
13409
9c5b8369
ILT
13410 * archive.cc (Archive::add_symbols): Check for a version attached
13411 to the symbol name in the archive map.
13412 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13413 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13414 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13415 (ver_test_11.a): New target.
13416 * testsuite/Makefile.in: Rebuild.
13417
9201d894
ILT
13418 * configure.ac: Check for chsize and posix_fallocate. Replace
13419 ftruncate.
13420 * ftruncate.c: New file, from gnulib.
13421 * output.cc (posix_fallocate): Define dummy version if not
13422 HAVE_POSIX_FALLOCATE.
13423 (Output_file::map): Call posix_fallocate rather than lseek and
13424 write.
13425 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13426 * configure, Makefile.in, config.in: Rebuild.
13427
ef4ab7a8 134282009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13429
ef4ab7a8
PP
13430 * layout.h (Layout::create_note): Add section_name parameter.
13431 * layout.cc (Layout::create_note): Likewise.
13432 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13433
8c500701
ILT
134342009-03-17 Ian Lance Taylor <iant@google.com>
13435
e85b18e1
ILT
13436 * descriptors.cc: Include "options.h".
13437 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13438 (Descriptors::open): Always use O_CLOEXEC when opening a new
13439 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13440 then set FD_CLOEXEC.
13441
9efe6174
ILT
13442 * sparc.cc (class Target_sparc): Add has_got_section.
13443 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13444 make sure we have a GOT section.
13445
13446 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13447 (Target_sparc::Scan::local): Likewise.
13448 (Target_sparc::Scan::global): Likewise.
13449 (Target_sparc::Relocate::relocate): Likewise.
13450 (Target_sparc::Relocate::relocate_tls): Likewise.
13451
8c500701
ILT
13452 * symtab.cc (Symbol_table::define_default_version): New function,
13453 broken out of add_from_object.
13454 (Symbol_table::add_from_object): Call define_default_version.
13455 (Symbol_table::define_special_symbol): Add resolve_oldsym
13456 parameter. Change all callers. If the version for a symbol comes
13457 from a version script, resolve it with the symbol with the same
13458 name with no version. Also add the symbol without a version if
13459 appropriate.
13460 (do_define_in_output_data): If resolving with oldsym, don't delete
13461 sym.
13462 (do_define_in_output_segment): Likewise.
13463 (do_define_as_constant): Likewise.
13464 * symtab.h (class Symbol_table): Update declarations.
13465
f1ed28fb
ILT
134662009-03-13 Ian Lance Taylor <iant@google.com>
13467
15f8229b
ILT
13468 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13469 (Read_symbols::requeue): New function.
13470 (Read_symbols::do_read_symbols): If make_elf_object fails because
13471 the target type is not configured, and the file was searched for,
13472 issue a warning and retry with the next directory.
13473 (Add_symbols::run): If the file has an incompatible format, and
13474 it was searched for, requeue the Read_symbols task. On error,
13475 release the object.
13476 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13477 dirindex parameter to constructor. Change all callers. Declare
13478 incompatible_warning and requeue.
13479 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13480 input_argument_ and input_group_ fields. Add them to
13481 constructor. Change all callers.
13482 (class Read_script): Add dirindex_ field. Add it to constructor.
13483 Change all callers.
13484 * archive.cc (Archive::setup): Remove input_objects parameter.
13485 Change all callers.
13486 (Archive::get_file_and_offset): Likewise.
13487 (Archive::read_all_symbols): Likewise.
13488 (Archive::read_symbols): Likewise.
13489 (Archive::get_elf_object_for_member): Remove input_objects
13490 parameter. Add punconfigured parameter. Change all callers.
13491 (Archive::add_symbols): Change return type to bool. Check return
13492 value of include_member.
13493 (Archive::include_all_members): Likewise.
13494 (Archive::include_member): Change return type to bool. Return
13495 false if first included object has incompatible target. Set
13496 included_member_ field.
13497 (Add_archive_symbols::run): If add_symbols returns false, requeue
13498 Read_symbols task.
13499 * archive.h (class Archive): Add included_member_ field.
13500 Initialize it in constructor. Add input_file and searched_for
13501 methods. Update declarations.
13502 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13503 input_argument_ fields. Add them to constructor. Change all
13504 callers.
13505 * script.cc: Include "target-select.h".
13506 (class Parser_closure): Add skip_on_incompatible_target_ and
13507 found_incompatible_target_ fields. Add
13508 skip_on_incompatible_target parameter to constructor. Change all
13509 callers. Add methods skip_on_incompatible_target,
13510 clear_skip_on_incompatible_target, found_incompatible_target, and
13511 set_found_incompatible_target.
13512 (read_input_script): Add dirindex parameter. Change all callers.
13513 If parser finds an incompatible target, requeue Read_symbols
13514 task.
13515 (script_set_symbol): Clear skip_on_incompatible_target in
13516 closure.
13517 (script_add_assertion, script_parse_option): Likewise.
13518 (script_start_sections, script_add_phdr): Likewise.
13519 (script_check_output_format): New function.
13520 * script.h (read_input_script): Update declaration.
13521 * script-c.h (script_check_output_format): Declare.
13522 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13523 (ignore_cmd): Remove OUTPUT_FORMAT.
13524 * fileread.cc (Input_file::Input_file): Add explicit this.
13525 (Input_file::will_search_for): New function.
13526 (Input_file::open): Add pindex parameter. Change all callers.
13527 * fileread.h (class Input_file): Add input_file_argument method.
13528 Declare will_search_for. Update declarations.
13529 * object.cc (make_elf_object): Add punconfigured parameter.
13530 Change all callers.
13531 * object.h (class Object): Make input_file public. Add
13532 searched_for method.
13533 (make_elf_object): Update declaration.
13534 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13535 restart search.
13536 * dirsearch.h (class Dirsearch): Update declaration.
13537 * options.h (class General_options): Add --warn-search-mismatch.
13538 * parameters.cc (Parameters::is_compatible_target): New function.
13539 * parameters.h (class Parameters): Declare is_compatible_target.
13540 * workqueue.cc (Workqueue::add_blocker): New function.
13541 * workqueue.h (class Workqueue): Declare add_blocker.
13542
f1ed28fb
ILT
13543 * fileread.cc (Input_file::open): Remove options parameter.
13544 Change all callers.
13545 (Input_file::open_binary): Likewise.
13546 * script.cc (read_input_script): Likewise.
13547 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13548 options parameter from constructor. Change all callers.
13549 (class Read_script): Likewise.
13550 * fileread.h (class Input_file): Update declarations.
13551 * script.h (read_input_script): Update declaration.
13552
34dd024a
NC
135532009-03-10 Nick Clifton <nickc@redhat.com>
13554
13555 * po/es.po: New Spanish translation.
13556
6d71b17c
CC
135572009-03-06 Cary Coutant <ccoutant@google.com>
13558
13559 * options.cc (parse_short_option): Keep dash_z from registering itself.
13560
031cdbed
ILT
135612009-03-03 Ian Lance Taylor <iant@google.com>
13562
13563 PR 9918
13564 * target-reloc.h (relocate_section): Pass output_section to
13565 relocate.
13566 * i386.cc (Target_i386::should_apply_static_reloc): Add
13567 output_section parameter. Change all callers.
13568 (Target_i386::Relocate::relocate): Add output_section parameter.
13569 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13570 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13571 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13572 * testsuite/two_file_shared.sh: New script.
13573 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13574 (check_DATA): Add two_file_shared.dbg.
13575 (two_file_shared.dbg): New target.
13576 * testsuite/Makefile.in: Rebuild.
13577
15d5fa16
ILT
135782009-03-01 Ian Lance Taylor <iant@google.com>
13579
13580 * configure.ac: Check for byteswap.h.
13581 * configure: Rebuild.
13582 * config.in: Rebuild.
13583
8a4c0b0d
ILT
135842009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13585
13586 * layout.cc (Layout::find_or_add_kept_section): New function.
13587 (Layout::add_comdat): Removed.
13588 * layout.h (struct Kept_section): Move out of class Layout.
13589 Remove trailing underscores from field names. Add group_sections
13590 field. Rename group_ field to is_group. Change all uses.
13591 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13592 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13593 comdat_groups_ field.
13594 (Sized_relobj::include_section_group): Use
13595 find_or_add_kept_section and Kept_section::group_sections.
13596 (Sized_relobj::include_linkonce_section): Likewise.
13597 * object.cc (class Sized_relobj): Don't define Comdat_group or
13598 Comdat_group_table. Remove find_comdat_group and
13599 add_comdat_group. Remove comdat_groups_ field.
13600 * plugin.cc (include_comdat_group): Use
13601 Layout::find_or_add_kept_section.
13602
b4ecf66b
ILT
136032009-02-28 Ian Lance Taylor <iant@google.com>
13604
14359ca0
ILT
13605 * README: --gc-sections and map files are now supported. Document
13606 some build requirements.
13607
b4ecf66b
ILT
13608 PR 6992
13609 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13610 relocatable link set the value of the section symbol to zero.
13611 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13612 relocatable link don't include the section address in the local
13613 symbol value.
13614
0602e05a
ILT
136152009-02-27 Ian Lance Taylor <iant@google.com>
13616
fd9d194f
ILT
13617 PR 6811
13618 * options.h (class Search_directory): Add is_system_directory.
13619 (class General_options): Declare is_in_system_directory.
13620 * options.cc (get_relative_sysroot): Make static.
13621 (get_default_sysroot): Make static.
13622 (General_optoins::is_in_system_directory): New function.
13623 * fileread.cc (Input_file::is_in_system_directory): New function.
13624 * fileread.h (class Input_file): Declare is_in_system_directory.
13625 * object.h (class Object): Add is_in_system_directory.
13626 (class Input_objects): Remove system_library_directory_ field.
13627 * object.cc (Input_objects::add_object): Don't set
13628 system_library_directory_.
13629 (input_objects::found_in_system_library_directory): Remove.
13630 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13631 parameter. Change all callers.
13632 (Symbol_table::sized_write_globals): Likewise.
13633 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13634 Call Object::is_in_system_directory.
13635 * symtab.h (class Symbol_table): Update declarations.
13636
61edd21f
ILT
13637 PR 5990
13638 * descriptors.h (Open_descriptor): Add is_on_stack field.
13639 * descriptors.cc (Descriptors::open): If the descriptor is on the
13640 top of the stack, remove it. Initialize is_on_stack field.
13641 (Descriptors::release): Only add pod to stack if it is not on the
13642 stack already.
13643 (Descriptors::close_some_descriptor): Clear stack_next and
13644 is_on_stack fields.
13645
e29e076a
ILT
13646 PR 7091
13647 * output.cc (Output_section::find_starting_output_address): Rename
13648 from starting_output_address; add PADDR parameter; change return
13649 type.
13650 * output.h (class Output_section): Declare
13651 find_starting_output_address instead of starting_output_address.
13652 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13653 section symbol for which we can't find a merge section.
13654
0602e05a
ILT
13655 PR 9836
13656 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13657 hidden or internal, force the symbol to be local.
13658 * resolve.cc (Symbol::override_visibility): Define.
13659 (Symbol::override_base): Use override_visibility.
13660 (Symbol_table::resolve): Likewise.
13661 (Symbol::override_base_with_special): Likewise.
13662 (Symbol_table::override_with_special): If the visibility is hidden
13663 or internal, force the symbol to be local.
13664 * symtab.h (class Symbol): Add set_visibility and
13665 override_visibility.
13666 * testsuite/ver_test_1.sh: New file.
13667 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13668 (check_DATA): Add ver_test_1.syms.
13669 (ver_test_1.syms): New target.
13670 * testsuite/Makefile.in: Rebuild.
13671
401a9a73
CC
136722009-02-25 Cary Coutant <ccoutant@google.com>
13673
13674 * layout.cc (Layout::choose_output_section): Don't rename sections
13675 when using a linker script that has a SECTIONS clause.
13676 * Makefile.in: Regenerate.
13677
13678 * testsuite/Makefile.am (script_test_5.sh): New test case.
13679 * testsuite/Makefile.in: Regenerate.
13680 * testsuite/script_test_5.cc: New file.
13681 * testsuite/script_test_5.sh: New file.
13682 * testsuite/script_test_5.t: New file.
13683
f488e4b0
CC
136842009-02-13 Rafael Avila de Espindola <espindola@google.com>
13685
13686 * archive.cc (Archive::include_member): Update calls to add_symbols.
13687 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13688 the Layout argument.
13689 * dynobj.h (do_add_symbols): Add the Layout argument.
13690 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13691 Layout argument.
13692 * object.h (Object::add_symbols): Add the Layout argument.
13693 (Object::do_add_symbols): Add the Layout argument.
13694 (Sized_relobj::do_add_symbols): Add the Layout argument.
13695 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13696 Unify the two versions.
13697 (Add_plugin_symbols): Remove.
13698 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13699 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13700 (Add_plugin_symbols): Remove.
13701 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13702 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13703 (Add_symbols::run): Make it work with Pulginobj.
13704
89dd1680
ILT
137052009-02-06 Ian Lance Taylor <iant@google.com>
13706
13707 * object.cc (Sized_relobj::do_layout): Make info message start
13708 with lower case letter.
13709
266d0a74
ILT
137102009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13711
602b464e
ILT
13712 * binary.cc: Fix file comment.
13713
266d0a74
ILT
13714 * options.h (enum Incremental_disposition): Define.
13715 (class General_options): Add new options: --incremental,
13716 --incremental_changed, --incremental_unchanged,
13717 --incremental_unknown. Add incremental_disposition_ and
13718 implicit_incremental_ fields.
13719 (General_options::incremental_disposition): New function.
13720 (class Position_dependent_options): Add incremental_disposition
13721 option.
13722 (Position_dependent_options::copy_from_options): Set incremental
13723 dispositions.
13724 * options.cc (General_options::parse_incremental_changed): New
13725 function.
2e702c99
RM
13726 (General_options::parse_incremental_unchanged): New function.
13727 (General_options::parse_incremental_unknown): New function.
13728 (General_options::General_options): Initialize new fields
266d0a74 13729 incremental_disposition_ and implicit_incremental_.
2e702c99 13730 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13731 without --incremental.
13732
f073bbf7
CD
137332009-02-06 Chris Demetriou <cgd@google.com>
13734
13735 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13736 pointer and to report location as the file name associated with
13737 the symbol.
13738 (gold_undefined_symbol_at_location): New function to replace the
13739 old gold_undefined_symbol functionality.
13740 * target-reloc.h (relocate_section): Update to use
13741 gold_undefined_symbol_at_location.
13742 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13743 Call gold_undefined_symbol function rather than gold_error.
13744 * errors.h (Errors::undefined_symbol): Take location as a
13745 string, rather than calculating it from a relocation.
13746 * errors.cc (Errors::fatal): Print "fatal error:" before the
13747 formatted message.
13748 (Errors::error, Errors::error_at_location): Print "error: "
13749 before the formatted message.
13750 (Errors::undefined_symbol): Take location as a string, rather
13751 than calculating it from a relocation.
13752 (gold_undefined_symbol_at_location): New function akin to
13753 old gold_undefined_symbol, calculates location from relocation.
13754 (gold_undefined_symbol): Change to take only a Symbol pointer
13755 and to report location as the file name associated with the symbol.
13756 * testsuite/debug_msg.sh: Update for changed error messages.
13757 * testsuite/undef_symbol.sh: Likewise.
13758
8e94a90c
ILT
137592009-02-04 Duncan Sands <baldrick@free.fr>
13760
13761 PR 9812
13762 * reduced_debug_output.h
13763 (Output_reduced_debug_abbrev_section::failed): Use format for
13764 gold_warning.
13765 (Output_reduced_debug_info_section::faild): Likewise.
13766
88a0e15b
ILT
137672009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13768
13769 * script.cc (Lazy_demangler): New class.
2e702c99 13770 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13771 symbol only once.
13772
5efc7cd2
CC
137732009-01-29 Cary Coutant <ccoutant@google.com>
13774
13775 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13776 to __tls_get_addr.
13777 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13778
e0ebcf42
ILT
137792009-01-28 Ian Lance Taylor <iant@google.com>
13780
5efc7cd2 13781 * version.cc (version_string): Bump to 1.9.
75fe7426 13782
e0ebcf42
ILT
13783 * gold.h: Include <cstring> and <stdint.h>.
13784 * version.cc: Include <cstdio>.
13785 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13786 warning.
13787 * reduced_debug_output.cc (insert_into_vector): Rename from
13788 Insert_into_vector; change all callers. Use Swap_unaligned to
13789 avoid aliasing issue; remove union since it is unnecessary.
13790
8e2813be 137912009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13792
13793 * Makefile.am (CCFILES): Add gc.cc.
13794 (HFILES): Add gc.h.
13795 * Makefile.in: Regenerate.
13796 * gold.cc (Gc_runner): New class.
13797 (queue_initial_tasks): Call garbage collection related tasks
13798 when corresponding options are invoked.
13799 (queue_middle_gc_tasks): New function.
13800 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13801 processed early before laying out sections during garbage collection.
13802 * gold.h (queue_middle_gc_tasks): New function.
13803 (is_prefix_of): Move from "layout.cc".
13804 * i386.cc (Target_i386::gc_process_relocs): New function.
13805 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13806 * main.cc (main): Create object of class "Garbage_collection".
13807 * object.cc (Relobj::copy_symbols_data): New function.
13808 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13809 (Sized_relobj::do_layout): Allow this function to be called twice
13810 during garbage collection and defer layout of section during the
6d03d481
ST
13811 first call.
13812 * object.h (Relobj::get_symbols_data): New function.
13813 (Relobj::is_section_name_included): New function.
13814 (Relobj::copy_symbols_data): New function.
13815 (Relobj::set_symbols_data): New function.
13816 (Relobj::get_relocs_data): New function.
13817 (Relobj::set_relocs_data): New function.
13818 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13819 (Relobj::gc_process_relocs): New function.
13820 (Relobj::do_gc_process_relocs): New pure virtual function.
13821 (Relobj::sd_): New data member.
13822 (Sized_relobj::is_output_section_offset_invalid): New function.
13823 (Sized_relobj::do_gc_process_relocs): New function.
13824 * options.h (General_options::gc_sections): Modify to not be a no-op.
13825 (General_options::print_gc_sections): New option.
13826 * plugin.cc (Plugin_finish::run): Remove function call to
13827 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13828 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13829 * reloc.cc (Read_relocs::run): Add task to process relocs and
13830 determine unreferenced sections when doing garbage collection.
13831 (Gc_process_relocs): New class.
13832 (Sized_relobj::do_gc_process_relocs): New function.
13833 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13834 sections that are garbage collected.
13835 * reloc.h (Gc_process_relocs): New class.
13836 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13837 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13838 symbols whose corresponding sections are garbage collected.
13839 (Symbol_table::Symbol_table): Add new parameter for the garbage
13840 collection object.
13841 (Symbol_table::gc_mark_undef_symbols): New function.
13842 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13843 (Symbol_table::gc_mark_dyn_syms): New function.
13844 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13845 as garbage.
13846 (Symbol_table::add_from_object): Likewise.
13847 (Symbol_table::add_from_relobj): When building shared objects, do not
13848 treat externally visible symbols as garbage.
13849 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13850 table information for static and relocatable links.
13851 * symtab.h (Symbol_table::set_gc): New function.
13852 (Symbol_table::gc): New function.
13853 (Symbol_table::gc_mark_undef_symbols): New function.
13854 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13855 (Symbol_table::gc_mark_dyn_syms): New function.
13856 (Symbol_table::gc_): New data member.
e1df38aa 13857 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13858 function.
13859 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13860 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13861
3b293544
CF
138622009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13863
13864 * options.h (General_options::gc_sections): Define as a no-op for now.
13865 (General_options::no_keep_memory): Ditto.
13866 (General_options::Bshareable): Define.
13867 * options.cc (General_options::finalize): Honor -Bshareable.
13868
83d22aa8
AS
138692009-01-20 Andreas Schwab <schwab@suse.de>
13870
13871 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13872 read the value in the contents, since we don't use it. Use the
13873 template endianness when writing.
13874 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13875
cd536b21
AS
138762009-01-19 Andreas Schwab <schwab@suse.de>
13877
13878 * configure.tgt (powerpc64-*): Fix targ_obj.
13879
99e9a495
ILT
138802009-01-15 Ian Lance Taylor <iant@google.com>
13881
13882 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13883 local symbols when stripping all symbols.
13884
bbbfea06
CC
138852009-01-14 Cary Coutant <ccoutant@google.com>
13886
99e9a495 13887 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13888
0f7c0701
CC
138892009-01-14 Cary Coutant <ccoutant@google.com>
13890
13891 * archive.cc (Archive::get_elf_object_for_member): Remove call
13892 to File_read::claim_for_plugin.
13893 * descriptors.cc (Descriptors::open): Remove reference to
13894 is_claimed.
13895 (Descriptors::claim_for_plugin): Remove.
13896 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13897 (Descriptors::is_claimed): Remove.
13898 (claim_descriptor_for_plugin): Remove.
13899 * fileread.cc (File_read::claim_for_plugin): Remove.
13900 * fileread.h (File_read::claim_for_plugin): Remove.
13901 (File_read::descriptor): Reopen descriptor if necessary.
13902 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13903 (Plugin_manager::all_symbols_read): Add task parameter. Change
13904 all callers.
13905 (Plugin_manager::get_input_file): New function.
13906 (Plugin_manager::release_input_file): New function.
13907 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13908 corresponding data member.
13909 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13910 and pass to base constructor. Change all callers.
13911 (get_input_file, release_input_file): New functions.
13912 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13913 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13914 (Plugin_manager::all_symbols_read): Add task parameter.
13915 (Plugin_manager::get_input_file): New function.
13916 (Plugin_manager::release_input_file): New function.
13917 (Plugin_manager::task_): New data member.
13918 (Pluginobj::Pluginobj): Add filesize parameter.
13919 (Pluginobj::filename): New function.
13920 (Pluginobj::descriptor): New function.
13921 (Pluginobj::filesize): New function.
13922 (Pluginobj::filesize_): New data member.
13923 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13924 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13925 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13926
13927 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13928 with archive libraries.
13929 * testsuite/Makefile.in: Regenerate.
13930 * testsuite/plugin_test.c (struct sym_info): New type.
13931 (get_input_file, release_input_file): New static variables.
13932 (onload): Capture new transfer vector entries.
13933 (claim_file_hook): Stop reading at end of file according to filesize.
13934 Factor out parsing of readelf output into separate function.
13935 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13936 APIs and get the source file name from the symbol table. Convert
13937 source file name to corresponding object file name. Print info
13938 message when adding new input files.
13939 (parse_readelf_line): New function.
13940 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13941 * testsuite/plugin_test_2.sh: Likewise.
13942 * testsuite/plugin_test_3.sh: Likewise.
13943 * testsuite/plugin_test_4.sh: New test case.
13944
62a6d109
ILT
139452009-01-07 Ian Lance Taylor <iant@google.com>
13946
13947 * version.cc (version_string): Bump to 1.8.
13948
483620e8
CC
139492008-12-23 Cary Coutant <ccoutant@google.com>
13950
13951 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13952 * plugin.cc (Plugin_manager::finish): Rename as
13953 layout_deferred_objects. Move cleanup to separate function.
13954 (Plugin_manager::cleanup): New function.
13955 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13956 separately.
13957 * plugin.h (Plugin_manager::finish): Rename as
13958 layout_deferred_objects.
13959 (Plugin_manager::cleanup): New function.
13960 (Plugin_manager::cleanup_done): New field.
13961
d66a9eb3
CC
139622008-12-23 Cary Coutant <ccoutant@google.com>
13963
13964 * plugin.cc (is_visible_from_outside): New function.
13965 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13966 so we don't return "IR only" status for exported symbols or -r links.
13967
13968 * testsuite/Makefile.am (plugin_test_3): New test case.
13969 * testsuite/Makefile.in: Regenerate.
13970 * testsuite/plugin_test_3.sh: New file.
13971
5995b570
CC
139722008-12-22 Cary Coutant <ccoutant@google.com>
13973
13974 * object.cc (Sized_relobj::layout_section): New function.
13975 (Sized_relobj::do_layout): Defer layout of input sections until after
13976 plugin has provided replacement files.
13977 (Sized_relobj::do_layout_deferred_sections): New function.
13978 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13979 (Relobj::layout_deferred_sections): New function.
13980 (Relobj::do_layout_deferred_sections): New function.
13981 (Sized_relobj::do_layout_deferred_sections): New function.
13982 (Sized_relobj::layout_section): New function.
13983 (Sized_relobj::Deferred_layout): New structure.
13984 (Sized_relobj::deferred_layout_): New field.
13985 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13986 Change all callers. Layout deferred sections.
13987 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13988 references.
13989 (Plugin_hook::run): Move code from do_plugin_hook inline.
13990 (Plugin_hook::do_plugin_hook): Remove.
13991 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13992 (Plugin_manager::finish): Renamed, was cleanup.
13993 (Plugin_manager::should_defer_layout): New function.
13994 (Plugin_manager::add_deferred_layout_object): New function.
13995 (Plugin_manager::Deferred_layout_list): New type.
13996 (Plugin_manager::deferred_layout_objects_): New field.
13997 (Plugin_hook::do_plugin_hook): Remove.
13998
ee769c88
ILT
139992008-12-17 Ian Lance Taylor <iant@google.com>
14000
14001 * options.h (class General_options): Add --no case for
14002 --export-dynamic.
14003
abc8dcba
CC
140042008-12-16 Cary Coutant <ccoutant@google.com>
14005
14006 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14007 vector.
14008 (Plugin_manager::claim_file): Create plugin object even if
14009 plugin did not call the add_symbols callback.
14010 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14011 asking for more symbols than were added.
14012 * testsuite/Makefile.am (plugin_test_1): Add test case with
14013 no global symbols.
14014 (empty.syms): New target.
14015 * testsuite/Makefile.in: Regenerate.
14016 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14017 message. Don't call add_symbols if no globals.
14018 (all_symbols_read_hook): Don't provide replacement for empty
14019 claimed file.
14020
b0074644
ILT
140212008-12-12 Ian Lance Taylor <iant@google.com>
14022
68943102
ILT
14023 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14024 r_type == 0 for a local symbol with r_sym == 0.
14025 (scan_relocatable_relocs): Pass r_sym to
14026 local_non_section_strategy.
14027 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14028 r_sym parameter.
14029
b0074644
ILT
14030 * configure.ac: Update test for TLS descriptors: they are
14031 supported as of glibc 2.9.
14032 * configure: Rebuild.
14033
c2508178
ILT
140342008-12-11 Ian Lance Taylor <iant@google.com>
14035
14036 PR 7091
14037 * target-reloc.h (Default_scan_relocatable_relocs): For each
14038 function, map r_type == 0 to RELOC_DISCARD.
14039
2756a258
CC
140402008-12-10 Cary Coutant <ccoutant@google.com>
14041
14042 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14043 object to override a kept COMDAT group from a plugin object.
14044
bb6f53d3
ILT
140452008-12-09 Ian Lance Taylor <iant@google.com>
14046
fbc558e1
ILT
14047 PR 7088
14048 * yyscript.y (file_cmd): Handle INPUT.
14049
bb6f53d3
ILT
14050 * testsuite/initpri1.c: Change all declarations to be full
14051 prototypes by adding void, to avoid compiler warnings.
14052
4674ecfc
CC
140532008-12-05 Rafael Avila de Espindola <espindola@google.com>
14054
14055 * options.cc (General_options::parse_plugin_opt): New.
14056 (General_options::add_plugin): The argument now is just the filename.
14057 (General_options::add_plugin_option): New.
14058 * options.h (plugin_opt): New.
14059 (add_plugin): Change argument name.
14060 (add_plugin_option): New.
14061 * plugin.cc (Plugin::load): Don't parse the plugin option.
14062 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14063 (Plugin::add_option): New.
14064 (Plugin::args_): Change type.
14065 (Plugin::filename_): New.
14066 (Plugin_manager::add_plugin_option): New.
14067 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14068 * testsuite/Makefile.in: Regenerate.
14069
fd06b4aa
CC
140702008-12-05 Cary Coutant <ccoutant@google.com>
14071
14072 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14073 Handle --strip-lto-sections option.
14074 * options.h (strip_lto_sections): New option.
14075
6c52134c
CC
140762008-12-01 Cary Coutant <ccoutant@google.com>
14077
14078 * plugin.cc (ld_plugin_message): Change format parameter to const.
14079 Fix mismatch between new[] and delete.
14080
a45248e0
CC
140812008-11-14 Cary Coutant <ccoutant@google.com>
14082
14083 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14084 instead of -1U.
14085
c82fbeee
CS
140862008-11-05 Craig Silverstein <csilvers@google.com>
14087
14088 * options.cc (General_options::parse_dynamic_list): New function.
14089 * options.h (General_options): New flags dynamic_list,
14090 dynamic_list_data, dynamic_list_cpp_new, and
14091 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14092 (General_options::in_dynamic_list): New function.
14093 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14094 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14095 (Lex::can_continue_name): Likewise.
14096 (yylex): Likewise.
14097 (read_script_file): New parameter script_options.
14098 (read_dynamic_list): New function.
14099 (Script_options::define_dynamic_list): New function.
14100 (dynamic_list_keyword_parsecodes): New variable.
14101 (dynamic_list_keywords): New variable.
14102 * script.h (Script_options::define_dynamic_list): New function
14103 prototype.
14104 (read_dynamic_list): New function prototype.
14105 * symtab.cc (strprefix): New macro.
14106 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14107 dynamic_list_data, dynamic_list_cpp_new, and
14108 dynamic_list_cpp_typeinfo.
14109 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14110 (dynamic_list_expr): New rule.
14111 (dynamic_list_nodes): Likewise.
14112 (dynamic_list_node): Likewise.
14113 * testsuite/Makefile.am (dynamic_list): New test.
14114 * testsuite/Makefile.in: Regenerated.
14115 * testsuite/dynamic_list.t: New file.
14116 * testsuite/dynamic_list.sh: New file.
14117
e0bb29a5
CS
141182008-11-05 Craig Silverstein <csilvers@google.com>
14119
14120 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14121 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14122 (t11_last): Likewise.
14123 * testsuite/ver_test_6.c (main): Likewise.
14124
4e1e25e0
CC
141252008-10-07 Cary Coutant <ccoutant@google.com>
14126
14127 * options.c (General_options::finalize): Add check for -static and
14128 -shared.
14129 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14130 is not empty.
14131
92f03fcb
CC
141322008-10-02 Cary Coutant <ccoutant@google.com>
14133
14134 * plugin.cc (make_sized_plugin_object): Fix conditional
14135 compilation to work when not all targets are enabled.
14136
fbd8a257
CC
141372008-09-29 Cary Coutant <ccoutant@google.com>
14138
14139 * archive.cc (Archive::get_file_and_offset): Use filename instead
14140 of name to get library path.
14141 (Archive::include_member): Unlock external member of a thin archive.
14142
14143 * testsuite/Makefile.am (TEST_AR): New variable.
14144 (thin_archive_test_1): New test.
14145 (thin_archive_test_2): New test.
81636b3f
CC
14146 * testsuite/Makefile.in: Regenerate.
14147 * testsuite/thin_archive_main.cc: New file.
14148 * testsuite/thin_archive_test_1.cc: New file.
14149 * testsuite/thin_archive_test_2.cc: New file.
14150 * testsuite/thin_archive_test_3.cc: New file.
14151 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14152
eff45813
CC
141532008-09-29 Cary Coutant <ccoutant@google.com>
14154
14155 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14156 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14157 instead of -1U.
14158 (Sized_relobj::do_finalize_local_symbols): Likewise.
14159 (Sized_relobj::map_to_kept_section): Likewise.
14160 * object.h (Sized_relobj::invalid_address): New constant.
14161 (Sized_relobj::do_output_section_offset): Check for invalid_address
14162 and return -1ULL.
14163 * output.cc (Output_reloc::local_section_offset): Use constant
14164 invalid_address instead of -1U.
14165 (Output_reloc::get_address): Likewise.
14166 (Output_section::output_address): Change -1U to -1ULL.
14167 * output.h (Output_reloc::invalid_address): New constant.
14168 * reloc.cc (Sized_relobj::write_sections): Use constant
14169 invalid_address instead of -1U.
14170 (Sized_relobj::relocate_sections): Likewise.
14171 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14172 values for merge sections.
14173 * target-reloc.h (relocate_for_relocatable): Use constant
14174 invalid_address instead of -1U.
14175
89fc3421
CC
141762008-09-19 Cary Coutant <ccoutant@google.com>
14177
14178 Add plugin functionality for link-time optimization (LTO).
14179 * configure.ac (plugins): Add --enable-plugins option.
14180 * configure: Regenerate.
14181 * config.in: Regenerate.
14182 * Makefile.am (LIBDL): New variable.
14183 (CCFILES): Add plugin.cc.
14184 (HFILES): Add plugin.h.
14185 (ldadd_var): Add LIBDL.
14186 * Makefile.in: Regenerate.
14187
14188 * archive.cc: Include "plugin.h".
14189 (Archive::setup): Don't preread archive symbols when using a plugin.
14190 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14191 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14192 files.
14193 (Archive::include_member): Add symbols from plugin objects.
14194 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14195 * descriptors.cc (Descriptors::open): Check for file descriptors
14196 abandoned by plugins.
14197 (Descriptors::claim_for_plugin): New function.
14198 * descriptors.h (Descriptors::claim_for_plugin): New function.
14199 (Open_descriptor::is_claimed): New field.
14200 (claim_descriptor_for_plugin): New function.
14201 * fileread.cc (File_read::claim_for_plugin): New function.
14202 * fileread.h (File_read::claim_for_plugin): New function.
14203 (File_read::descriptor): New function.
14204 * gold.cc: Include "plugin.h".
14205 (queue_initial_tasks): Add task to call plugin hooks for generating
14206 new object files.
14207 * main.cc: Include "plugin.h".
14208 (main): Load plugin libraries.
14209 * object.h (Pluginobj): Declare.
14210 (Object::pluginobj): New function.
14211 (Object::do_pluginobj): New function.
14212 (Object::set_target): New function.
14213 * options.cc: Include "plugin.h".
14214 (General_options::parse_plugin): New function.
14215 (General_options::General_options): Initialize plugins_ field.
14216 (General_options::add_plugin): New function.
14217 * options.h (Plugin_manager): Declare.
14218 (General_options): Add --plugin option.
14219 (General_options::has_plugins): New function.
14220 (General_options::plugins): New function.
14221 (General_options::add_plugin): New function.
14222 (General_options::plugins_): New field.
14223 * plugin.cc: New file.
14224 * plugin.h: New file.
14225 * readsyms.cc: Include "plugin.h".
14226 (Read_symbols::do_read_symbols): Check for archive before checking
14227 for ELF file. Call plugin hooks to claim files.
14228 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14229 from a real object file; force override when processing replacement
14230 files.
14231 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14232 (Symbol::init_base_object): Likewise.
14233 (Symbol::init_base_output_data): Likewise.
14234 (Symbol::init_base_output_segment): Likewise.
14235 (Symbol::init_base_constant): Likewise.
14236 (Symbol::init_base_undefined): Likewise.
14237 (Symbol::output_section): Assert that object is not a plugin.
14238 (Symbol_table::add_from_pluginobj): New function.
14239 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14240 undefined.
14241 (Symbol_table::sized_write_globals): Likewise.
14242 (Symbol_table::add_from_pluginobj): Instantiate template.
14243 * symtab.h (Sized_pluginobj): Declare.
14244 (Symbol::in_real_elf): New function.
14245 (Symbol::set_in_real_elf): New function.
14246 (Symbol::in_real_elf_): New field.
14247 (Symbol_table::add_from_pluginobj): New function.
14248
14249 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14250 (LIBDL): New variable.
14251 (LDADD): Add LIBDL.
14252 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14253 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14254 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14255 (MOSTLYCLEANFILES): Likewise.
14256 * testsuite/Makefile.in: Regenerate.
14257 * testsuite/plugin_test.c: New file.
14258 * testsuite/plugin_test_1.sh: New file.
14259 * testsuite/plugin_test_2.sh: New file.
14260
de31bda5
ILT
142612008-09-16 Ian Lance Taylor <iant@google.com>
14262
9c2d0ef9
ILT
14263 * target-reloc.h (relocate_section): Check whether a symbol is
14264 defined by the ABI before reporting an undefined symbol error.
14265 * target.h (Target::is_defined_by_abi): Make parameter const.
14266 (Target::do_is_defined_by_abi): Likewise.
14267 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14268 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14269 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14270 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14271 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14272 * testsuite/Makefile.in: Rebuild.
14273
de31bda5
ILT
14274 * fileread.cc (make_view): Add casts to avoid warning.
14275
9fa33bee
AO
142762008-09-16 Alexandre Oliva <aoliva@redhat.com>
14277
14278 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14279 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14280
183fd0e3
AO
142812008-09-16 Alexandre Oliva <aoliva@redhat.com>
14282
14283 * options.h (General_options::output_is_executable): New.
14284 (General_options::output_is_pie): New.
14285 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14286 for shared libraries.
14287 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14288
7be8330a
CD
142892008-09-11 Chris Demetriou <cgd@google.com>
14290
14291 * options.h (origin): New -z option.
14292 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14293 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14294 in DT_FLAGS_1.
14295
a9caad02
CC
142962008-09-05 Cary Coutant <ccoutant@google.com>
14297
14298 * fileread.cc (File_read::make_view): Add check for attempt to map
14299 beyond end of file.
14300
ae6dce4d
CC
143012008-09-05 Cary Coutant <ccoutant@google.com>
14302
14303 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14304 explicit instantiations.
14305
d7ab2a47
KVH
143062008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14307
14308 PR gold/6858
14309 * options.cc (General_options::finalize): Allow undefined symbols
14310 in shlibs if linking -shared.
14311
14312 PR gold/6859
14313 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14314 symbols as not needing a dynsym entry.
14315
1e52a9c1
CS
143162008-08-20 Craig Silverstein <csilvers@google.com>
14317
14318 * fileread.cc (File_read::open): Do not lock the file unless it
14319 was successfully opened.
14320
d85c80a3
CC
143212008-08-14 Cary Coutant <ccoutant@google.com>
14322
14323 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14324 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14325 * testsuite/tls_test.cc (struct int128): 128-bit struct
14326 for testing TLS relocs with non-zero addend.
14327 (v12): New TLS variable.
14328 (t12): New test.
14329 (t_last): Add check for v12.
14330 * testsuite/tls_test.h (t12): New function.
14331 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14332
2d924fd9
ILT
143332008-08-13 Ian Lance Taylor <iant@google.com>
14334
14335 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14336 set tls_segment_ or relro_segment_.
14337 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14338 when appropriate.
14339 * output.h (Output_section::clear_is_relro): New function.
14340 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14341 sections specially even when output_data_ is empty.
14342 (Output_segment::maximum_alignment): When first section is relro,
14343 only force alignment for PT_LOAD segments.
14344 * script.cc (script_data_segment_align): New function.
14345 (script_data_segment_relro_end): New function.
14346 * script-c.h (script_data_segment_align): Declare.
14347 (script_data_segment_relro_end): Declare.
14348 * script-sections.h (class Script_sections): Declare
14349 data_segment_align and data_segment_relro_end. Add fields
14350 segment_align_index_ and saw_relro_end_.
14351 * script-sections.cc (class Sections_element): Add set_is_relro
14352 virtual function. Add new bool* parameter to place_orphan_here.
14353 Add get_output_section virtual function.
14354 (class Output_section_definition): Add set_is_relro. Add new
14355 bool* parameter to place_orphan_here. Add get_output_section.
14356 Add is_relro_ field.
14357 (Output_section_definition::Output_section_definition): Initialize
14358 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14359 and is_relro_ fields.
14360 (Output_section_definition::place_orphan_here): Add is_relro
14361 parameter.
14362 (Output_section_definition::set_section_addresses): Set relro for
14363 output section.
14364 (Output_section_definition::alternate_constraint): Likewise.
14365 (class Orphan_output_section): Add new bool* parameter to
14366 place_orphan_here. Add get_output_section.
14367 (Orphan_output_section::place_orphan_here): Add is_relro
14368 parameter.
14369 (Script_sections::Script_sections): Initialize
14370 data_segment_align_index_ and saw_relro_end_.
14371 (Script_sections::data_segment_align): New function.
14372 (Script_sections::data_segment_relro_end): New function.
14373 (Script_sections::place_orphan): Set or clear is_relro.
14374 (Script_sections::set_section_addresses): Force alignment of first
14375 TLS section.
14376 * yyscript.y (exp): Call script_data_segment_align and
14377 script_data_segment_relro_end.
14378 * testsuite/relro_script_test.t: New file.
14379 * testsuite/relro_test.cc (using_script): Declare.
14380 (t1, t2): Test using_script.
14381 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14382 (relro_script_test_SOURCES): Define.
14383 (relro_script_test_DEPENDENCIES): Define.
14384 (relro_script_test_LDFLAGS): Define.
14385 (relro_script_test_LDADD): Define.
14386 (relro_script_test.so): New target.
14387 * testsuite/Makefile.in: Rebuild.
14388
f827c9a9
CC
143892008-08-06 Cary Coutant <ccoutant@google.com>
14390
14391 * archive.cc (Archive::total_archives, Archive::total_members)
14392 (Archive::total_members_loaded): New variables.
14393 (Archive::setup): Add parameter. Add option to preread
14394 archive symbols.
14395 (Archive::read_armap): Add counter.
14396 (Archive::get_file_and_offset): New function.
14397 (Archive::get_elf_object_for_member): New function.
14398 (Archive::read_all_symbols): New function.
14399 (Archive::read_symbols): New function.
14400 (Archive::add_symbols): Add counters.
14401 (Archive::include_all_members): Use armap to find members if it's
14402 already built.
14403 (Archive::include_member): Skip reading symbols if already read.
14404 Factored code into Archive::get_file_and_offset and
14405 Archive::get_elf_object_for_member. Changed call to
14406 Mapfile::report_include_archive_member.
14407 (Archive::print_stats): New function.
14408 * archive.h: Declare Object and Read_symbols_data classes.
14409 (Archive::Archive): Add initializers for new members.
14410 (Archive::setup): Add parameter.
14411 (Archive::print_stats): New function.
14412 (Archive::total_archives, Archive::total_members)
14413 (Archive::total_members_loaded): New variables.
14414 (Archive::get_file_and_offset): New function.
14415 (Archive::get_elf_object_for_member): New function.
14416 (Archive::read_all_symbols): New function.
14417 (Archive::read_symbols): New function.
14418 (Archive::Archive_member): New class.
14419 (Archive::members_): New member.
14420 (Archive::num_members_): New member.
14421 * main.cc: Include archive.h.
14422 (main): Call Archive::print_stats.
14423 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14424 archive parameter; member_name is now the fully-decorated name.
14425 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14426 * options.h: (General_options): Add --preread-archive-symbols option.
14427 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14428 Archive::setup.
14429
de4c45bd
ILT
144302008-08-04 Ian Lance Taylor <iant@google.com>
14431
14432 * symtab.h (Symbol::use_plt_offset): New function.
14433 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14434 * powerpc.cc (Relocate::relocate): Likewise.
14435 * sparc.cc (Relocate::relocate): Likewise.
14436 * x86_64.cc (Relocate::relocate): Likewise.
14437 * testsuite/weak_plt.sh: New test.
14438 * testsuite/weak_plt_main.cc: New test.
14439 * testsuite/weak_plt_shared.cc: New test.
14440 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14441 (check_PROGRAMS): Add weak_plt.
14442 (check_DATA): Add weak_plt_shared.so.
14443 (weak_plt_main_pic.o, weak_plt): New targets.
14444 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14445 * testsuite/Makefile.in: Rebuild.
14446
14447 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14448 gcctestdir/ld.
14449 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14450 * testsuite/Makefile.in: Rebuild.
14451
323ee3f4
AM
144522008-08-04 Alan Modra <amodra@bigpond.net.au>
14453
14454 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14455 * Makefile.in: Regenerate.
14456 * po/POTFILES.in: Regenerate.
14457
7c07ecec
ILT
144582008-07-29 Ian Lance Taylor <iant@google.com>
14459
14460 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14461 symbols before other symbols.
14462 * testsuite/script_test_2.cc (test_addr): Declare.
14463 (test_addr_alias): Declare.
14464 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14465 values.
7c07ecec
ILT
14466 * testsuite/script_test_2.t: Define test_addr_alias and
14467 test_addr.
14468
5778530e
ILT
144692008-07-24 Ian Lance Taylor <iant@google.com>
14470
2a00e4fb
ILT
14471 PR 5990
14472 * descriptors.cc: New file.
14473 * descriptors.h: New file.
14474 * gold-threads.h (class Hold_optional_lock): New class.
14475 * fileread.cc: Include "descriptors.h".
14476 (File_read::~File_read): Release descriptor rather than closing
14477 it.
14478 (File_read::open) [file]: Call open_descriptor rather than open.
14479 Set is_descriptor_opened_.
14480 (File_read::open) [memory]: Assert that descriptor is not open.
14481 (File_read::reopen_descriptor): New function.
14482 (File_read::release): Release descriptor.
14483 (File_read::do_read): Make non-const. Reopen descriptor.
14484 (File_read::read): Make non-const.
14485 (File_read::make_view): Reopen descriptor.
14486 (File_read::do_readv): Likewise.
14487 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14488 Update declarations.
14489 * layout.cc: Include "descriptors.h".
14490 (Layout::create_build_id): Use open_descriptor rather than open.
14491 * output.cc: Include "descriptors.h".
14492 (Output_file::open): Use open_descriptor rather than open.
14493 * archive.cc (Archive::const_iterator): Change Archive to be
14494 non-const.
14495 (Archive::begin, Archive::end): Make non-const.
14496 (Archive::count_members): Likewise.
14497 * archive.h (class Archive): Update declarations.
14498 * object.h (Object::read): Make non-const.
14499 * Makefile.am (CCFILES): Add descriptors.cc.
14500 (HFILES): Add descriptors.h.
14501 * Makefile.in: Rebuild.
14502
801647d1
ILT
14503 PR 6716
14504 * gold.h: Always include <clocale>. Add Solaris workarounds
14505 following code in binutils/sysdep.h.
14506
5edd166e
ILT
14507 PR 6048
14508 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14509 this->eh_frame_hdr_ is NULL before using it.
14510
c89ad728
ILT
14511 * dynobj.cc (Versions::Versions): Update comment.
14512
aa86f06b
ILT
14513 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14514 the base version name.
14515
5778530e
ILT
14516 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14517 array size plus one.
14518 (Stringpool_template::set_string_offsets): Subtract one from key
14519 before using it as an array index.
14520 (Stringpool_template::get_offset_with_length): Likewise.
14521 (Stringpool_template::write_to_buffer): Likewise.
14522 * stringpool.h (Stringpool_template::get_offset_from_key):
14523 Likewise.
14524
057ead22
ILT
145252008-07-23 Ian Lance Taylor <iant@google.com>
14526
7f649c59
ILT
14527 PR 6658
14528 * object.h (Merged_symbol_value::value): Do our best to handle a
14529 negative addend.
14530
057ead22
ILT
14531 PR 6647
14532 * script.cc (Version_script_info::get_versions): Don't add empty
14533 version tag to return value.
14534 (Version_script_info::get_symbol_version_helper): Change return
14535 type to bool. Add pversion parameter. Change all callers.
14536 (script_register_vers_node): Don't require a non-NULL tag.
14537 * script.h (class Version_script_info): Update declarations.
14538 (Version_script_info::get_symbol_version): Change return type to
14539 bool. Add version parameter. Change all callers.
14540 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14541 handling. Handle an empty version from a version script.
14542 (Symbol_table::define_special_symbol): Likewise.
14543 * testsuite/ver_test_10.script: New file.
14544 * testsuite/ver_test_10.sh: New file.
14545 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14546 (check_DATA): Add ver_test_10.syms.
14547 (ver_test_10.syms, ver_test_10.so): New target.
14548 * testsuite/Makefile.in: Rebuild.
14549
58e54ac2
CD
145502008-07-23 Simon Baldwin <simonb@google.com>
14551
14552 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14553 to zero for undefined symbols from dynamic libraries.
14554
95d14cd3
ILT
145552008-07-23 Ian Lance Taylor <iant@google.com>
14556
14557 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14558 Change all callers.
14559 * symtab.h (class Symbol_table): Update declaration.
14560 * testsuite/ver_test_9.cc: New file.
14561 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14562 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14563 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14564 (ver_test_9.so, ver_test_9.o): New targets.
14565 * testsuite/Makefile.in: Rebuild.
14566
92de84a6
ILT
145672008-07-22 Ian Lance Taylor <iant@google.com>
14568
34810851
ILT
14569 * options.h (class General_options): Define --check-sections.
14570 * layout.cc (Layout::set_segment_offsets): Handle
14571 --check-sections.
14572
af6156ef
ILT
14573 * options.h (class General_options): Define -n/--nmagic and
14574 -N/--omagic.
14575 * options.cc (General_options::finalize): For -n/--nmagic or
14576 -N/--omagic, set -static.
14577 * layout.cc (Layout::attach_allocated_section_to_segment): If
14578 -N/--omagic, don't put read-only and read-write sections in
14579 different segments.
14580 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14581 finding a read-only segment.
14582 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14583 don't set the minimum segment alignment to the common page size,
14584 and don't set the file offset to the address modulo the page size.
14585 * script-sections.cc (Script_sections::create_segments): If
14586 -n/--omagic, don't put read-only and read-write sections in
14587 different segments.
14588
92de84a6
ILT
14589 * cref.cc: New file.
14590 * cref.h: New file.
14591 * options.h (class General_options): Add --print-symbol-counts.
14592 * main.cc (main): Issue defined symbol report if requested.
14593 * archive.cc (Archive::interpret_header): Make into a const member
14594 function.
14595 (Archive::add_symbols): Call Input_objects::archive_start and
14596 archive_stop.
14597 (Archive::const_iterator): Define new class.
14598 (Archive::begin, Archive::end): New functions.
14599 (Archive::include_all_members): Rewrite to use iterator.
14600 (Archive::count_members): New function.
14601 * archive.h (class Archive): Update declarations.
14602 (Archive::filename): New function.
14603 * object.cc: Include "cref.h".
14604 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14605 (Sized_relobj::do_get_global_symbol_counts): New function.
14606 (Input_objects::add_object): Add object to cross-referencer.
14607 (Input_objects::archive_start): New function.
14608 (Input_objects::archive_stop): New function.
14609 (Input_objects::print_symbol_counts): New function.
14610 * object.h: Declare Cref and Archive.
14611 (Object::get_global_symbol_counts): New function.
14612 (Object::do_get_global_symbol_counts): New pure virtual function.
14613 (class Sized_relobj): Add defined_count_ field. Update
14614 declarations.
14615 (class Input_objects): Add cref_ field. Update constructor.
14616 Update declarations.
14617 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14618 defined_count_.
14619 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14620 symbol counts.
14621 (Sized_dynobj::do_get_global_symbol_counts): New function.
14622 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14623 defined_count_. Update declarations. Define Symbols typedef.
14624 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14625 parameter. Change all callers.
14626 (Symbol_table::add_from_dynobj): Add sympointers and defined
14627 parameters. Change all callers.
14628 * symtab.h (class Symbol_table): Update declarations.
14629 * Makefile.am (CCFILES): Add cref.cc.
14630 (HFILES): Add cref.h.
14631 * Makefile.in: Rebuild.
14632
3f7c5e1d
CD
146332008-07-22 Simon Baldwin <simonb@google.com>
14634
14635 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14636 to zero when writing undefined symbols.
14637
e0b64032
ILT
146382008-07-22 Ian Lance Taylor <iant@google.com>
14639
14640 * output.cc (Output_section::add_input_section): Don't try to
14641 merge empty merge sections.
14642
096b02cf
CS
146432008-07-21 Craig Silverstein <csilvers@google.com>
14644
14645 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14646 Include symbol version in error message.
cd536b21 14647
1d1f116d
CD
146482008-07-20 Chris Demetriou <cgd@google.com>
14649
cd536b21 14650 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14651 (RANDOM_SEED_CFLAGS): New substituted variable.
14652 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14653 * configure: Rebuild.
14654 * Makefile.in: Likewise.
14655 * testsuite/Makefile.in: Likewise.
14656
a18f591e
ILT
146572008-07-18 Ian Lance Taylor <iant@google.com>
14658
14659 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14660 where we see NAME/NULL and NAME/VERSION as separate symbols.
14661 * testsuite/ver_test_main.cc (main): Call t4.
14662 (t4, t4_2a): Define.
14663 * testsuite/ver_test_2.cc (t4_2): Define.
14664 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14665 * testsuite/ver_test_4.cc (t4_2a): Define.
14666 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14667 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14668
c6e3f6ed
ILT
146692008-07-17 Ian Lance Taylor <iant@google.com>
14670
14671 * dynobj.cc (Versions::add_def): If we give an error about a
14672 missing version, go ahead and create the version anyhow.
14673
ef9beddf
ILT
146742008-07-10 Ian Lance Taylor <iant@google.com>
14675
14676 Handle output sections with more than 0x7fffffff bytes.
14677 * object.h (class Relobj): Change map_to_output_ to
14678 output_sections_, and just keep a section pointer. Change all
14679 uses. Move comdat group support to Sized_relobj.
14680 (Relobj::is_section_specially_mapped): Remove.
14681 (Relobj::output_section): Remove poff parameter. Change all
14682 callers.
14683 (Relobj::output_section_offset): New function.
14684 (Relobj::set_section_offset): Rewrite.
14685 (Relobj::map_to_output): Remove.
14686 (Relobj::output_sections): New function.
14687 (Relobj::do_output_section_offset): New pure virtual function.
14688 (Relobj::do_set_section_offset): Likewise.
14689 (class Sized_relobj): Add section_offsets_ field. Add comdat
14690 group support from Relobj. Update declarations.
14691 (Sized_relobj::get_output_section_offset): New function.
14692 (Sized_relobj::do_output_section_offset): New function.
14693 (Sized_relobj::do_set_section_offset): New function.
14694 * object.cc (Relobj::output_section_address): Remove.
14695 (Sized_relobj::Sized_relobj): Initialize new fields.
14696 (Sized_relobj::include_section_group): Cast find_kept_object to
14697 Sized_relobj.
14698 (Sized_relobj::include_linkonce_section): Likewise.
14699 (Sized_relobj::do_layout): Use separate arrays for output section
14700 and output offset.
14701 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14702 output_sections.
14703 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14704 output_sections and section_offsets.
14705 (Sized_relobj::write_local_symbols): Likewise.
14706 (map_to_kept_section): Compute output address directly.
14707 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14708 output_sections and section_offsets.
14709 (Sized_relobj::write_sections): Likewise.
14710 (Sized_relobj::relocate_sections): Likewise.
14711 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14712 * output.h (class Output_reloc): Update declarations. Change
14713 u2_.relobj to Sized_relobj*.
14714 (class Output_data_reloc): Change add functions to use
14715 Sized_relobj*.
14716 * output.cc (Output_reloc::Output_reloc): Change relobj to
14717 Sized_relobj*.
14718 (Output_reloc::local_section_offset): Change return type to
14719 Elf_Addr. Use get_output_section_offset.
14720 (Output_reloc::get_address): Likewise.
14721 (Output_section::is_input_address_mapped): Don't call
14722 is_section_specially_mapped.
14723 (Output_section::output_offset): Likewise.
14724 (Output_section::output_address): Likewise.
14725 (Output_section::starting_output_address): Likewise.
14726 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14727 parameter to Sized_relobj*.
14728 (Copy_relocs::need_copy_reloc): Likewise.
14729 (Copy_relocs::save): Likewise.
14730 * copy-relocs.h (class Copy_relocs): Update declarations.
14731 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14732 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14733 * target-reloc.h (relocate_for_relocatable): Change
14734 offset_in_output_section type to Elf_Addr. Change code that uses
14735 it as well.
14736 * layout.cc (Layout::layout): Always set *off.
14737 * mapfile.cc (Mapfile::print_input_section): Use
14738 output_section_offset.
14739 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14740 Sized_relobj*.
14741 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14742 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14743 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14744
5cb66f97
ILT
147452008-07-03 Ian Lance Taylor <iant@google.com>
14746
14747 * layout.cc (Layout::include_section): Do not discard unrecognized
14748 SHT_STRTAB sections.
14749
afe47622
CS
147502008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14751
14752 * script.cc (Lex::can_continue_name): Make '?' allowable in
14753 version-script names.
14754 * testsuite/version_script.map: Change glob pattern to use '?'
14755
5adf9721
ILT
147562008-06-30 Manish Singh <yosh@gimp.org>
14757
14758 PR 6585
14759 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14760 Correct typo.
14761
e6fde208
ILT
147622008-06-30 Ian Lance Taylor <iant@google.com>
14763
14764 PR 6660
14765 PR 6682
14766 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14767 versions]: Don't try to read the value in the contents, since we
14768 don't use it. Use the template endianness when writing.
14769
3f2e6a2d
CC
147702008-06-25 Cary Coutant <ccoutant@google.com>
14771
14772 * fileread.cc (File_read::make_view): Assert on zero-length view.
14773 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14774 symbol table when there are no symbols to read.
14775
c43d3a48
CS
147762008-06-23 Craig Silverstein <csilvers@google.com>
14777
14778 * version.cc (version_string): Bump to 1.7
14779
5f494ea0
CS
147802008-06-18 Craig Silverstein <csilvers@google.com>
14781
14782 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14783 constant 0xFFFF to type Valtype.
14784 (Powerpc_relocate_functions::rel16_ha): Likewise.
14785
c42e122e
ILT
147862008-06-17 Ian Lance Taylor <iant@google.com>
14787
f34787f8
ILT
14788 * output.h (Output_section::Input_section): Initialize p2align_ to
14789 zero for Output_section_data constructors.
14790 (Output_section::Input_section::addralign): If not an input
14791 section, return the alignment of the Output_section_data.
14792 * testsuite/copy_test.cc: New file.
14793 * testsuite/copy_test_1.cc: New file.
14794 * testsuite/copy_test_2.cc: New file.
14795 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14796 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14797 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14798 (copy_test_1_pic.o, copy_test_1.so): New targets.
14799 (copy_test_2_pic.o, copy_test_2.so): New targets.
14800 * testsuite/Makefile.in: Rebuild.
14801
c42e122e
ILT
14802 * script-sections.cc (Script_sections::place_orphan): Initialize
14803 local variable exact.
14804
ce3ac18a
DE
148052008-06-13 David Edelsohn <edelsohn@gnu.org>
14806
14807 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14808
42cacb20
DE
148092008-06-12 David Edelsohn <edelsohn@gnu.org>
14810 David S. Miller <davem@davemloft.net>
14811
14812 * powerpc.cc: New file.
14813 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14814 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14815 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14816 * Makefile.in: Rebuild.
14817
7b308235
ILT
148182008-06-09 Ian Lance Taylor <iant@google.com>
14819
14820 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14821 <exception>.
14822 (throwing, orig_terminate): New static variables.
14823 (terminate_handler): New static function.
14824 (t2): Set terminate handler.
14825
f0b886e3
ILT
148262008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14827
14828 PR 6584
cd536b21 14829 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14830 alignment.
14831
3e90f135
CC
148322008-05-30 Cary Coutant <ccoutant@google.com>
14833
14834 * archive.cc (Archive::include_all_members) Correct to step
14835 over symbol table and extended name table in thin archives.
14836
e09ad04a
ILT
148372008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14838
14839 PR 6407
14840 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14841 calculation.
14842
62b01cb5
ILT
148432008-05-28 Caleb Howe <cshowe@google.com>
14844
14845 * reduced_debug_output.cc: New file.
14846 * reduced_debug_output.h: New file.
92de84a6 14847 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14848 * options.cc (General_options::finalize): Add strip_debug_non_line
14849 to the strip heirarchy.
14850 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14851 fields.
14852 * layout.cc: Include "reduced_debug_output.h".
14853 (Layout::Layout): Initialize new fields.
14854 (line_only_debug_sections): New static array.
14855 (is_lines_only_debug_sections): New static inline function.
14856 (Layout::include_section): Handle --strip-debug-non-line.
14857 (Layout::make_output_section): If --strip-debug-non-line, build
14858 new output sections for .debug_abbrev and .debug_info.
14859 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14860 gold. Warn about possible overflow.
14861 (read_signed_LEB_128): Likewise.
14862 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14863 (read_signed_LEB_128): Declare.
14864 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14865 (HFILES): Add reduced_debug_output.h.
14866 * Makefile.in: Rebuild.
14867
7d9e3d98
ILT
148682008-05-21 Ian Lance Taylor <iant@google.com>
14869
14870 * mapfile.cc: New file.
14871 * mapfile.h: New file.
14872 * options.h (class General_options): Add -M/--print-map and -Map.
14873 * options.cc (General_options::finalize): Make -M equivalent to
14874 -Map -.
14875 * main.cc: Include <cstdio> and "mapfile.h".
14876 (main): Open mapfile if requested.
14877 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14878 constructor. Change caller.
14879 (queue_initial_tasks): Add mapfile parameter. Change caller.
14880 (queue_middle_tasks): Likewise.
14881 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14882 declarations.
14883 * archive.cc: Include "mapfile.h".
14884 (Archive::add_symbols): Add mapfile parameter. Change all
14885 callers. Pass mapfile, symbol, and reason to include_member.
14886 (Archive::include_all_members): Add mapfile parameter. Change all
14887 callers.
14888 (Archive::include_member): Add mapfile, sym, and why parameters.
14889 Change all callers. Report inclusion to map file.
14890 * archive.h: Include "fileread.h".
14891 (class Archive): Update declarations.
14892 (Archive::file): New const method.
14893 (class Add_archive_symbols): Add mapfile_ field. Update
14894 constructor. Change all callers.
14895 * readsyms.h (class Read_symbols): Likewise.
14896 (class Finish_group): Likewise.
14897 (class Read_script): Likewise.
14898 * common.cc: Include "mapfile.h".
14899 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14900 all callers.
14901 (Symbol_table::do_allocate_commons): Likewise.
14902 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14903 symbol allocation to mapfile.
14904 * common.h (class Allocate_commons_task): Add mapfile_ field.
14905 Update constructor. Change all callers.
14906 * symtab.h (class Symbol_table): Update declarations.
14907 * layout.cc: Include "mapfile.h".
14908 (Layout_task_runner::run): Print information to mapfile.
14909 (Layout::create_gold_note): Change Output_data_fixed_space to
14910 Output_data_zero_fill.
14911 (Layout::create_build_id): Likewise.
14912 (Layout::print_to_mapfile): New function.
14913 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14914 constructor. Change caller.
14915 (class Layout): Declare print_to_mapfile.
14916 * output.cc (Output_section::Input_section::print_to_mapfile): New
14917 function.
14918 (Output_section::add_input_section): If producing a map, always
14919 add to input_sections_ list.
14920 (Output_section::do_print_to_mapfile): New function.
14921 (Output_segment::print_sections_to_mapfile): New function.
14922 (Output_segment::print_section_list_to_mapfile): New function.
14923 * output.h: Include "mapfile.h".
14924 (Output_data::print_to_mapfile): New function.
14925 (Output_data::do_print_to_mapfile): New virtual function.
14926 (Output_segment_headers::do_print_to_mapfile): New function.
14927 (Output_file_header::do_print_to_mapfile): New function.
14928 (Output_data_const::do_print_to_mapfile): New function.
14929 (class Output_data_const_buffer): Add map_name_ field. Update
14930 constructor. Change all callers. Add do_print_to_mapfile
14931 function.
14932 (class Output_data_fixed_space): Likewise.
14933 (class Output_data_space): Likewise.
14934 (class Output_data_zero_fill): New class.
14935 (Output_data_strtab::do_print_to_mapfile): New function.
14936 (Output_data_reloc_base::do_print_to_mapfile): New function.
14937 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14938 (Output_data_group::do_print_to_mapfile): New function.
14939 (Output_data_got::do_print_to_mapfile): New function.
14940 (Output_data_dynamic::do_print_to_mapfile): New function.
14941 (Output_symtab_xindex::do_print_to_mapfile): New function.
14942 (class Output_section): Declare do_print_to_mapflie. Declare
14943 print_to_mapfile in Input_section.
14944 (class Output_segment): Declare new functions.
14945 * object.h (Sized_relobj::symbol_count): New function.
14946 * script-sections.cc
14947 (Output_section_element_dot_assignment::set_section_addresses):
14948 Change Output_data_fixed_space to Output_data_zero_fill.
14949 (Output_data_expression::do_print_to_mapfile): New function.
14950 * script.cc (read_input_script): Add mapfile parameter. Change
14951 all callers.
14952 * script.h (read_input_script): Update declaration.
14953 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14954 (Eh_frame::do_print_to_mapfile): New function.
14955 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14956 (Output_merge_string::do_print_to_mapfile): New function.
14957 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14958 function.
14959 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14960 function.
14961 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14962 function.
14963 * Makefile.am (CCFILES): Add mapfile.cc.
14964 (HFILES): Add mapfile.h.
14965 * Makefile.in: Rebuild.
14966
9f1d377b
ILT
149672008-05-19 Ian Lance Taylor <iant@google.com>
14968
14969 * options.h (class General_options): Add -z relro.
14970 * layout.cc (Layout::Layout): Initialize relro_segment_.
14971 (Layout::add_output_section_data): Return the output section.
14972 (Layout::make_output_section): Rcognize relro sections and mark
14973 them appropriately.
14974 (Layout::attach_allocated_section_to_segment): Put relro sections
14975 in a PT_GNU_RELRO segment.
14976 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14977 section as relro.
14978 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14979 PT_TLS segments.
14980 (Layout::linkonce_mapping): Map d.rel.ro.local to
14981 .data.rel.ro.local.
14982 (Layout::output_section_name): Us .data.rel.ro.local for any
14983 section which begins with that.
14984 * layout.h (class Layout): Update add_output_section_data
14985 declaration. Add relro_segment_ field.
14986 * output.cc (Output_section::Output_section): Initialize is_relro_
14987 and is_relro_local_ fields.
14988 (Output_segment::add_output_section): Group relro sections.
14989 (Output_segment::is_first_section_relro): New function.
14990 (Output_segment::maximum_alignment): If there is a relro section,
14991 align the segment to the common page size.
14992 (Output_segment::set_section_addresses): Track whether we are
14993 looking at relro sections. If the last section is a relro
14994 section, align to the common page size.
14995 (Output_segment::set_section_list_addresses): Add in_relro
14996 parameter. Change all callers. Align to the page size when
14997 moving from relro to non-relro section.
14998 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14999 segment.
15000 * output.h (class Output_section): Add is_relro_ and
15001 is_relro_local_ fields.
15002 (Output_section::is_relro): New function.
15003 (Output_section::set_is_relro): New function.
15004 (Output_section::is_relro_local): New function.
15005 (Output_section::set_is_relro_local): New function.
15006 (class Output_segment): Update declarations.
15007 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15008 * sparc.cc (Target_sparc::got_section): Likewise.
15009 * x86_64.cc (Target_x86_64::got_section): Likewise.
15010 * testsuite/relro_test_main.cc: New file.
15011 * testsuite/relro_test.cc: New file.
15012 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15013 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15014 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15015 (relro_test.so, relro_test_pic.o): New targets.
15016 * testsuite/Makefile.in: Rebuild.
15017
a984ee1d
ILT
150182008-05-16 Ian Lance Taylor <iant@google.com>
15019
01676dcd
ILT
15020 * output.cc (Output_segment::add_output_section): Remove front
15021 parameter.
15022 * output.h (class Output_segment): Remove
15023 add_initial_output_section and overloaded add_output_section.
15024 Update declaration of remaining add_output_section.
15025 * layout.cc (Layout::create_interp): Call add_output_section
15026 rather than add_initial_output_section.
15027 (Layout::finish_dynamic_section): Likewise.
15028
497897f9
ILT
15029 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15030 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15031 know the dynamic type.
15032 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15033 field. Initialize it in constructor.
15034 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15035 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15036 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15037 reloc.
15038
a984ee1d
ILT
15039 * output.cc (Output_reloc::get_address): Change return type to
15040 Elf_Addr.
15041 * output.h (class Output_reloc): Update get_address declaration.
15042 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15043 for section addresses.
15044
55ba0940
ILT
150452008-05-09 Ian Lance Taylor <iant@google.com>
15046
15047 PR 6493
15048 * gold.cc (gold_nomem): Use return value of write.
15049
75517b77
ILT
150502008-05-08 Ian Lance Taylor <iant@google.com>
15051
15052 * symtab.c (Symbol::init_base_output_data): Add version
15053 parameter. Change all callers.
15054 (Symbol::init_base_output_segment): Likewise.
15055 (Symbol::init_base_constant): Likewise.
15056 (Symbol::init_base_undefined): Likewise.
15057 (Sized_symbol::init_output_data): Likewise.
15058 (Sized_symbol::init_output_segment): Likewise.
15059 (Sized_symbol::init_constant): Likewise.
15060 (Sized_symbol::init_undefined): Likewise.
15061 (Symbol_table::do_define_in_output_data): If the new symbol has a
15062 version, mark it as the default.
15063 (Symbol_table::do_define_in_output_segment): Likewise.
15064 (Symbol_table::do_define_as_constant): Likewise.
15065 * symtab.h (class Symbol): Update declarations.
15066 (class Sized_symbol): Likewise.
15067 * resolve.cc (Symbol::override_version): New function.
c42e122e 15068 (Symbol::override_base): Call override_version.
75517b77
ILT
15069 (Symbol::override_base_with_special): Likewise.
15070 * testsuite/ver_script_8.script: New file.
15071 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15072 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15073 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15074 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15075
f1f70eae
ILT
150762008-05-06 Ian Lance Taylor <iant@google.com>
15077
f3e9c5c5
ILT
15078 PR 6049
15079 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15080 functions.
15081 (class General_options): Remove existing --undefined, and add
15082 --no-undefined instead. Add new --undefined as synonym for -u.
15083 * archive.cc (Archive::add_symbols): Check whether symbol was
15084 named with -u.
15085 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15086 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15087 all uses. Add IS_UNDEFINED. Update declarations to split
15088 different versions of init_base. Declare init_base_undefined.
15089 (Symbol::is_defined): Handle IS_UNDEFINED.
15090 (Symbol::is_undefined): Likewise.
15091 (Symbol::is_weak_undefined): Call is_undefined.
15092 (Symbol::is_absolute): Handle IS_CONSTANT.
15093 (class Sized_symbol): Update declarations to split different
15094 versions of init. Declare init_undefined.
15095 (class Symbol_table): Declare new functions.
15096 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15097 Change all callers.
15098 (Symbol::init_base_output_data): Likewise.
15099 (Symbol::init_base_output_segment): Likewise.
15100 (Symbol::init_base_constant): Likewise.
15101 (Symbol::init_base_undefined): New function.
15102 (Sized_symbol::init_object): Rename from init. Change all
15103 callers.
15104 (Sized_symbol::init_output_data): Likewise.
15105 (Sized_symbol::init_output_segment): Likewise.
15106 (Sized_symbol::init_constant): Likewise.
15107 (Sized_symbol::init_undefined): New function.
15108 (Symbol_table::add_undefined_symbols_from_command_line): New
15109 function.
15110 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15111 function.
15112 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15113 (Symbol::output_section): Likewise.
15114 (Symbol::set_output_section): Likewise.
15115 (Symbol_table::sized_finalize_symbol): Likewise.
15116 (Symbol_table::sized_write_globals): Likewise.
15117 * resolve.cc (Symbol_table::should_override): Likewise.
15118 (Symbol::override_base_with_special): Likewise.
15119
8bdcdf2c
ILT
15120 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15121 symbol, change it to have default visibility.
15122 * testsuite/protected_1.cc: New file.
15123 * testsuite/protected_2.cc: New file.
15124 * testsuite/protected_3.cc: New file.
15125 * testsuite/protected_main_1.cc: New file.
15126 * testsuite/protected_main_2.cc: New file.
15127 * testsuite/protected_main_3.cc: New file.
15128 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15129 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15130 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15131 (protected_1.so): New target.
15132 (protected_1_pic.o, protected_2_pic.o): New targets.
15133 (protected_3_pic.o): New target.
15134 (check_PROGRAMS): Add protected_2.
15135 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15136 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15137 * testsuite/Makefile.in: Rebuild.
15138
2b706932
ILT
15139 * options.h (DEFINE_var): Add set_user_set_##varname__.
15140 (DEFINE_bool_alias): New macro.
15141 (class General_options): Define -Bstatic using DEFINE_bool_alias
15142 rather than DEFINE_special. Add --undefined as an alias for -z
15143 defs.
15144 * options.cc (General_options::parse_Bstatic): Remove.
15145
d82a5bcc
ILT
15146 * options.h (class General_options): Add --fatal-warnings.
15147 * main.cc (main): Implement --fatal-warnings.
15148 * errors.h (Errors::warning_count): New function.
15149
f1f70eae
ILT
15150 * options.h (class General_options): Add -Bsymbolic-functions.
15151 * symtab.h (Symbol::is_preemptible): Check for
15152 -Bsymbolic-functions.
15153
8825ac63
ILT
151542008-05-05 Ian Lance Taylor <iant@google.com>
15155
d98bc257
ILT
15156 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15157 as noVARNAME rather than no-VARNAME.
15158 (class General_options): Add option -z combreloc.
15159 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15160 get_address.
15161 (Output_reloc::sort_before) [SHT_REL]: New function.
15162 (Output_reloc::sort_before) [SHT_RELA]: New function.
15163 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15164 Sort_relocs_comparison.
15165 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15166 parameter. Change all callers.
15167 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15168 sort_relocs parameter. Change all callers.
15169 * output.cc (Output_reloc::get_address): New function, broken out
15170 of write_rel.
15171 (Output_reloc::write_rel): Call it.
15172 (Output_reloc::compare): New function.
15173 (Output_data_reloc_base::do_write): Optionally sort relocs.
15174
60b2b4e7
ILT
15175 * configure.ac: If targ_extra_obj is set, link it in.
15176 * configure.tgt: Initialize all variables.
15177 (x86_64*): Set targ_extra_obj and targ_extra_size.
15178 * configure: Rebuild.
15179
8825ac63
ILT
15180 * object.cc (Sized_relobj::include_section_group): Adjust section
15181 indexes read from group data. Build vector to pass to
15182 layout_group.
15183 * layout.cc (Layout::layout_group): Add flags and shndxes
15184 parameters. Remove contents parameter. Change caller. Update
15185 explicit instantiations.
15186 * layout.h (class Layout): Update layout_group declaration.
15187 * output.cc (Output_data_group::Output_data_group): Add flags and
15188 input_shndxes parameters. Remove contents parameter. Change
15189 caller.
15190 (Output_data_group::do_write): Change input_sections_ to
15191 input_shndxes_.
15192 * output.h (class Output_data_group): Update constructor
15193 declaration. Rename input_sections_ to input_shndxes_.
15194 * testsuite/many_sections_test.cc: Add template.
15195
e94cf127
CC
151962008-04-30 Cary Coutant <ccoutant@google.com>
15197
4418b2d5
CC
15198 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15199
e94cf127
CC
15200 * layout.cc (Layout::include_section): Refactored check for debug
15201 info section.
15202 (Layout::add_comdat): Add new parameters. Change type
15203 of signature parameter. Add object and shndx to signatures table.
15204 (Layout::find_kept_object): New function.
15205 * layout.h: Include <cstring>.
15206 (Layout::is_debug_info_section): New function.
15207 (Layout::add_comdat): Add new parameters.
15208 (Layout::find_kept_object): New function.
15209 (Layout::Kept_section): New struct.
15210 (Layout::Signatures): Change type of map range.
15211 * object.cc (Relobj::output_section_address): New function.
15212 (Sized_relobj::include_section_group): Add new parameters. Change
15213 calls to Layout::add_comdat. Change to build table of kept comdat
15214 groups and table mapping discarded sections to kept sections.
15215 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15216 (Sized_relobj::do_layout): Change calls to include_section_group and
15217 include_linkonce_section.
15218 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15219 value to zero when section is discarded.
15220 (Sized_relobj::map_to_kept_section): New function.
15221 * object.h (Relobj::output_section_address): New function.
15222 (Relobj::Comdat_group): New type.
15223 (Relobj::find_comdat_group): New function.
15224 (Relobj::Comdat_group_table): New type.
15225 (Relobj::Kept_comdat_section): New type.
15226 (Relobj::Kept_comdat_section_table): New type.
15227 (Relobj::add_comdat_group): New function.
15228 (Relobj::set_kept_comdat_section): New function.
15229 (Relobj::get_kept_comdat_section): New function.
15230 (Relobj::comdat_groups_): New field.
15231 (Relobj::kept_comdat_sections_): New field.
15232 (Symbol_value::input_value): Update comment.
15233 (Sized_relobj::map_to_kept_section) New function.
15234 (Sized_relobj::include_linkonce_section): Add new parameter.
15235 * target-reloc.h (Comdat_behavior): New type.
15236 (get_comdat_behavior): New function.
15237 (relocate_section): Add code to map a discarded section to the
15238 corresponding kept section when applying a relocation.
15239
e4e5049b
CS
152402008-04-30 Craig Silverstein <csilvers@google.com>
15241
15242 * dwarf_reader.cc (next_generation_count): New static var.
15243 (Addr2line_cache_entry): New struct.
15244 (addr2line_cache): New static var.
15245 (Dwarf_line_info::one_addr2line): Added caching.
15246 (Dwarf_line_info::clear_addr2line_cache): New function.
15247 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15248 cache-size parameter.
15249 (Dwarf_line_info::one_addr2line_cache): New function.
15250 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15251 new cache-size argument to one_addr2line(), and clear cache.
15252
d09e9154
CC
152532008-04-28 Cary Coutant <ccoutant@google.com>
15254
15255 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15256 R_386_PC8 relocations.
15257
7ef73768
ILT
152582008-04-23 Ian Lance Taylor <iant@google.com>
15259
55438702
ILT
15260 * object.cc (Sized_relobj::include_section_group): Check for
15261 invalid section group.
15262
c165fb93
ILT
15263 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15264 header size.
15265
7ef73768
ILT
15266 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15267 than read for file header.
15268 * archive.cc (Archive::include_member): Likewise.
15269
6194aaab
L
152702008-04-23 Paolo Bonzini <bonzini@gnu.org>
15271
15272 * aclocal.m4: Regenerate.
15273 * configure: Regenerate.
15274
d491d34e
ILT
152752008-04-19 Ian Lance Taylor <iant@google.com>
15276
5ea2bac6
ILT
15277 * version.cc (version_string): Bump to 1.6.
15278
7bc3e21a
ILT
15279 * testsuite/Makefile.am (many_sections_r_test): New target.
15280 (many_sections_r_test_SOURCES): Remove.
15281 (many_sections_r_test_DEPENDENCIES): Remove.
15282 (many_sections_r_test_LDFLAGS): Remove.
15283 (many_sections_r_test_LDADD): Remove.
15284
7fcd3aa9
ILT
15285 * object.cc (Sized_relobj::do_add_symbols): Always pass
15286 local_symbol_count_ to add_from_relobj.
15287
4c94d6ae
ILT
15288 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15289 every thousand variables.
15290 * testsuite/Makefile.in: Rebuild.
15291
d491d34e
ILT
15292 * object.cc (Xindex::initialize_symtab_xindex): New function.
15293 (Xindex::read_symtab_xindex): New function.
15294 (Xindex::sym_xindex_to_shndx): New function.
15295 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15296 available.
15297 (Sized_relobj::do_initialize_xindex): New function.
15298 (Sized_relobj::do_read_symbols): Adjust section links.
15299 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15300 parameter. Change all callers.
15301 (Sized_relobj::include_section_group): Adjust section links and
15302 symbol section indexes.
15303 (Sized_relobj::do_layout): Adjust section links.
15304 (Sized_relobj::do_count_local_symbols): Adjust section links and
15305 symbol section indexes.
15306 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15307 ordinary and special symbols.
15308 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15309 dynsym_xindex parameters. Change all callers. Adjust section
15310 links. Use SHN_XINDEX when needed.
15311 (Sized_relobj::get_symbol_location_info): Adjust section links.
15312 Don't get fooled by special symbols.
15313 * object.h (class Xindex): Define.
15314 (class Object): Add xindex_ parameter. Declare virtual functoin
15315 do_initialize_xindex.
15316 (Object::adjust_sym_shndx): New function.
15317 (Object::set_xindex): New protected function.
15318 (class Symbol_value): Add is_ordinary_shndx_ field.
15319 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15320 (Symbol_value::value): Assert ordinary section.
15321 (Symbol_value::initialize_input_to_output_map): Likewise.
15322 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15323 Change all callers.
15324 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15325 all callers.
15326 (class Sized_relobj): Update declarations.
15327 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15328 parameter. Change all callers.
15329 (Sized_relobj::adjust_shndx): New function.
15330 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15331 field.
15332 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15333 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15334 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15335 (Sized_dynobj::read_dynsym_section): Adjust section links.
15336 (Sized_dynobj::read_dynamic): Likewise.
15337 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15338 section links.
15339 (Sized_dynobj::do_initialize_xindex): New function.
15340 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15341 do_initialize_xindex.
15342 (Sized_dynobj::adjust_shndx): New function.
15343 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15344 dynsym_xindex_ fields.
15345 (Layout::finalize): Add a call to set_section_indexes before
15346 creating the symtab sections.
15347 (Layout::set_section_indexes): Don't do anything if the section
15348 already has a section index.
15349 (Layout::create_symtab_sections): Add shnum parameter. Change
15350 caller. Create .symtab_shndx section if needed.
15351 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15352 caller.
15353 (Layout::allocated_output_section_count): New function.
15354 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15355 needed.
15356 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15357 fields. Update declarations.
15358 (Layout::symtab_xindex): New function.
15359 (Layout::dynsym_xindex): New function.
15360 (class Write_symbols_task): Add layout_ field.
15361 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15362 Change caller.
15363 * output.cc (Output_section_headers::Output_section_headers): Add
15364 shstrtab_section parameter. Change all callers.
15365 (Output_section_headers::do_sized_write): Store overflow values
15366 for section count and section string table section index in
15367 section header zero.
15368 (Output_file_header::do_sized_write): Check for overflow of
15369 section count and section string table section index.
15370 (Output_symtab_xindex::do_write): New function.
15371 (Output_symtab_xindex::endian_do_write): New function.
15372 * output.h (class Output_section_headers): Add shstrtab_section_.
15373 Update declarations.
15374 (class Output_symtab_xindex): Define.
15375 (Output_section::has_out_shndx): New function.
15376 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15377 field.
15378 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15379 Change all callers.
15380 (Sized_symbol::init): Likewise.
15381 (Symbol::output_section): Check for ordinary symbol.
15382 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15383 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15384 callers.
15385 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15386 Change all callers. Simplify handling of symbols from sections
15387 not included in the link.
15388 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15389 distinction.
15390 (Weak_alias_sorter::operator()): Assert that symbols are
15391 ordinary.
15392 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15393 distinction.
15394 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15395 parameters. Change all callers.
15396 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15397 symbol distinction. Use SHN_XINDEX when needed.
15398 (Symbol_table::write_section_symbol): Add symtab_xindex
15399 parameter. Change all callers.
15400 (Symbol_table::sized_write_section_symbol): Likewise. Use
15401 SHN_XINDEX when needed.
15402 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15403 declarations.
15404 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15405 (Symbol::is_defined): Check is_ordinary.
15406 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15407 (Symbol::is_absolute, Symbol::is_common): Likewise.
15408 (class Sized_symbol): Update declarations.
15409 (class Symbol_table): Update declarations.
15410 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15411 parameters. Change all callers.
15412 (Sized_symbol::override): Likewise.
15413 (Symbol_table::override): Likewise.
15414 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15415 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15416 is_ordinary, and orig_st_shndx parameters. Change all callers.
15417 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15418 to be in an ordinary section.
15419 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15420 object and is_ordinary parameters. Change all callers.
15421 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15422 Change all callers. Don't add undefined or non-ordinary symbols
15423 to reloc_map_.
15424 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15425 Change all callers.
15426 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15427 declarations.
15428 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15429 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15430 (Sized_relobj::relocate_sections): Likewise.
15431 * target-reloc.h (scan_relocs): Adjust section symbol index.
15432 (scan_relocatable_relocs): Likewise.
15433 * i386.cc (Scan::local): Check for ordinary symbols.
15434 * sparc.cc (Scan::local): Likewise.
15435 * x86_64.cc (Scan::local): Likewise.
15436 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15437 to symbol_section_and_value.
15438 * testsuite/many_sections_test.cc: New file.
15439 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15440 (check_PROGRAMS): Add many_sections_test.
15441 (many_sections_test_SOURCES): Define.
15442 (many_sections_test_DEPENDENCIES): Define.
15443 (many_sections_test_LDFLAGS): Define.
15444 (BUILT_SOURCES): Add many_sections_define.h.
15445 (many_sections_define.h): New target.
15446 (BUILT_SOURCES): Add many_sections_check.h.
15447 (many_sections_check.h): New target.
15448 (check_PROGRAMS): Add many_sections_r_test.
15449 (many_sections_r_test_SOURCES): Define.
15450 (many_sections_r_test_DEPENDENCIES): Define.
15451 (many_sections_r_test_LDFLAGS): Define.
15452 (many_sections_r_test_LDADD): Define.
15453 (many_sections_r_test.o): New target.
15454 * testsuite/Makefile.in: Rebuild.
15455
c5818ff1
CC
154562008-04-17 Cary Coutant <ccoutant@google.com>
15457
15458 * errors.cc (Errors::info): New function.
15459 (gold_info): New function.
15460 * errors.h (Errors::info): New function.
15461 * gold.h (gold_info): New function.
15462 * object.cc (Input_objects::add_object): Print trace output.
15463 * options.cc (options::parse_set): New function.
15464 (General_options::parse_wrap): Deleted.
15465 (General_options::General_options): Deleted initializer.
15466 * options.h (options::String_set): New typedef.
15467 (options::parse_set): New function.
15468 (DEFINE_set): New macro.
15469 (General_options::wrap): Changed to use DEFINE_set. Changed
15470 callers of any_wrap_symbols and is_wrap_symbol.
15471 (General_options::trace, General_options::trace_symbol):
15472 New options.
15473 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15474 (General_options::wrap_symbols_): Deleted.
15475 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15476
b5be4a7c
DM
154772008-04-17 David S. Miller <davem@davemloft.net>
15478
15479 * options.cc (General_options::parse_V): New function.
15480 * options.h: Add entries for -V and -Qy.
15481
155a0dd7
ILT
154822008-04-17 Ian Lance Taylor <iant@google.com>
15483
15484 * common.cc (Symbol_table::allocate_commons): Remove options
15485 parameter. Change caller.
15486 (Symbol_table::do_allocate_commons): Remove options parameter.
15487 Change caller. Just call do_allocate_commons_list twice.
15488 (Symbol_table::do_allocate_commons_list): New function, broken out
15489 of do_allocate_commons.
15490 * common.h (class Allocate_commons_task): Remove options_ field.
15491 Update constructor.
15492 * symtab.cc (Symbol_table::Symbol_table): Initialize
15493 tls_commons_.
15494 (Symbol_table::add_from_object): Put TLS common symbols on
15495 tls_commons_ list.
15496 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15497 which are IN_OUTPUT_DATA.
15498 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15499 allocate_commons and do_allocate_commons declarations. Declare
15500 do_allocate_commons_list.
15501 * gold.cc (queue_middle_tasks): Update creation of
15502 Allocate_commons_task to not pass options.
15503 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15504 (TLS_TEST_C_FLAGS): New variable.
15505 (tls_test_c_pic.o): New target.
15506 (tls_test_shared.so): Link in tls_test_c_pic.o.
15507 (tls_test_c_pic_ie.o): New target.
15508 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15509 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15510 (tls_test_c.o): New target.
15511 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15512 (tls_pic_test_LDADD): Likewise.
15513 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15514 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15515 (tls_test_c_gnu2.o): New target.
15516 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15517 tls_test_c_gnu2.o.
15518 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15519 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15520 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15521 * testsuite/tls_test.cc: Include "config.h".
15522 (t_last): Call t11_last.
15523 * testsuite/tls_test.h (t11, t11_last): Declare.
15524 * testsuite/tls_test_c.c: New file.
15525 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15526 * configure.ac: Check for OpenMP support.
15527 * configure, config.in, Makefile.in: Rebuild.
15528 * testsuite/Makefile.in: Rebuild.
15529
edfbb029
CC
155302008-04-16 Cary Coutant <ccoutant@google.com>
15531
15532 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15533 (Target_i386::tls_base_symbol_defined_): New field.
15534 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15535 (Target_i386::Scan::global): Likewise.
15536 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15537 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15538 (Target_x86_64::tls_base_symbol_defined_): New field.
15539 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15540 (Target_x86_64::Scan::global): Likewise.
15541
f3c69fca
CC
155422008-04-16 Cary Coutant <ccoutant@google.com>
15543
15544 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15545 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15546 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15547 building shared libraries.
15548 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15549 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15550 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15551 * testsuite/Makefile.in: Rebuild.
15552 * testsuite/weak_undef.h: New file.
15553 * testsuite/weak_undef_file1.cc: Add extra test cases.
15554 * testsuite/weak_undef_file2.cc: Likewise.
15555 * testsuite/weak_undef_test.cc: Likewise.
15556
7c414435
DM
155572008-04-16 David S. Miller <davem@davemloft.net>
15558
32b769e1
DM
15559 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15560 Add issued_non_pic_error_ field. Declare check_non_pic.
15561 (Target_sparc::Scan::check_non_pic): New function.
15562 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15563 (Target_sparc::Scan::global): Likewise.
15564
11936fb1
DM
15565 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15566 * configure: Rebuild.
15567
7c414435
DM
15568 * options.h (DEFINE_enable): New macro.
15569 (new_dtags): New enable option.
15570 (initfirst, interpose, loadfltr, nodefaultlib,
15571 nodelete, nodlopen, nodump): New -z options.
15572 * layout.cc (Layout:finish_dynamic_section): If new
15573 dtags enabled, emit DT_RUNPATH. Also, emit a
15574 DT_FLAGS_1 containing any specified -z flags.
15575
85c7bf8b
ILT
155762008-04-16 Ian Lance Taylor <iant@google.com>
15577
12c0daef
ILT
15578 * copy-relocs.cc: New file.
15579 * copy-relocs.h: New file.
15580 * reloc.cc: Remove Copy_relocs code.
15581 * reloc.h: Likewise.
15582 * reloc-types.h (struct Reloc_types) [both versions]: Add
15583 get_reloc_addend_noerror.
15584 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15585 variants of add_global which take an addend which must be zero.
15586 * i386.cc: Include "copy-relocs.h".
15587 (class Target_i386): Change type of copy_relocs_ to variable,
15588 update initializer.
15589 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15590 Change all callers.
15591 (Target_i386::do_finalize_sections): Change handling of
15592 copy_relocs_.
15593 * sparc.cc: Include "copy-relocs.h".
15594 (class Target_sparc): Change type of copy_relocs_ to variable,
15595 update initializer.
15596 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15597 Change all callers.
15598 (Target_sparc::do_finalize_sections): Change handling of
15599 copy_relocs_.
15600 * x86_64.cc: Include "copy-relocs.h".
15601 (class Target_x86_64): Change type of copy_relocs_ to variable,
15602 update initializer.
15603 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15604 class. Change all callers.
15605 (Target_x86_64::do_finalize_sections): Change handling of
15606 copy_relocs_.
15607 * Makefile.am (CCFILES): Add copy-relocs.cc.
15608 (HFILES): Add copy-relocs.h.
15609
4f4995b6
ILT
15610 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15611
85c7bf8b
ILT
15612 * testsuite/script_test_4.sh: Permit leading zeroes.
15613
4f2a9edd
ILT
156142008-04-15 Ian Lance Taylor <iant@google.com>
15615
e6188289
ILT
15616 * script-sections.cc (Script_sections::create_segments): Use
15617 header_size_adjustment even when there is enough room for the
15618 headers.
15619 * testsuite/script_test_4.sh: New file.
15620 * testsuite/script_test_4.t: New file.
15621 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15622 (check_DATA): Add script_test_4.stdout.
15623 (MOSTLYCLEANFILES): Likewise.
15624 (script_test_4): New target.
15625 (script_test_4.stdout): New target.
15626 * testsuite/Makefile.in: Rebuild.
15627
4f2a9edd
ILT
15628 * sparc.cc: Add definitions for Output_data_plt_sparc class
15629 constants.
15630
f5314dd5
DM
156312008-04-14 David S. Miller <davem@davemloft.net>
15632
15633 * sparc.cc: New file.
15634 * Makefile.am (TARGETSOURCES): Add sparc.cc
15635 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15636 * configure.tgt: Document targ_extra_size and
15637 targ_extra_big_endian. Add entries for sparc-* and
15638 sparc64-*.
15639 * configure.ac: Handle targ_extra_size and
15640 targ_extra_big_endian.
15641 * Makefile.in: Rebuild.
15642 * configure: Likewise.
15643 * po/POTFILES.in: Likewise.
15644 * po/gold.pot: Likewise.
15645
154e0e9a
ILT
156462008-04-14 Ian Lance Taylor <iant@google.com>
15647
15648 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15649 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15650 in the name/type/flags to section mapping. Don't call
15651 allocate_output_section.
15652 (Layout::choose_output_section): Change parameter from adjust_name
15653 to is_input_section. Don't permit input sections after sections
15654 are attached to segments. Don't call allocate_output_section.
15655 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15656 not write_enable_output_section.
15657 (Layout::make_output_section): Don't push to
15658 unattached_section_list_ nor call attach_to_segment. Call
15659 attach_section_to_segment if sections are attached.
15660 (Layout::attach_sections_to_segments): New function.
15661 (Layout::attach_section_to_segment): New function.
15662 (Layout::attach_allocated_section_to_segment): Rename from
15663 attach_to_segment. Remove flags parameter.
15664 (Layout::allocate_output_section): Remove function.
15665 (Layout::write_enable_output_section): Remove function.
15666 * layout.h (class Layout): Update for above changes. Add new
15667 field sections_are_attached_.
15668 * output.h (Output_section::update_flags_for_input_section): New
15669 function.
15670 * output.cc (Output_section::add_input_section): Call
15671 update_flags_for_input_section.
15672 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15673
009a67a2
CC
156742008-04-11 Cary Coutant <ccoutant@google.com>
15675
15676 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15677 thought unnecessary.
15678 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15679
759b1a24
ILT
156802008-04-11 Ian Lance Taylor <iant@google.com>
15681
15682 * output.h (class Output_section_data): Remove inline definition
15683 of set_addralign.
15684 * output.cc (Output_section_data::set_addralign): New function.
15685
c2b45e22
CC
156862008-04-11 Cary Coutant <ccoutant@google.com>
15687
15688 Add support for TLS descriptors for i386 and x86_64.
15689 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15690 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15691 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15692 GOT_TYPE_TLS_DESC.
15693 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15694 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15695 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15696 relocations.
15697 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15698 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15699 Fix problem with initial-exec relocations.
15700 (Target_i386::Relocate::relocate_tls): Likewise.
15701 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15702 relaxation.
15703 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15704 support for section-plus-offset dynamic table entries.
15705 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15706 (Output_data_dynamic::Dynamic_entry): Add support for
15707 section-plus-offset dynamic table entries.
15708 (Output_data_dynamic::Classification): Likewise.
15709 (Output_data_dynamic::classification_): Renamed offset_.
15710 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15711 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15712 (Target_x86_64::make_plt_section): New function.
15713 (Target_x86_64::reserve_tlsdesc_entries): New function.
15714 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15715 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15716 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15717 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15718 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15719 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15720 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15721 add extra PLT entry for TLS descriptors.
15722 (Output_data_plt_x86_64::got_): New field.
15723 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15724 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15725 fields.
15726 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15727 descriptors.
15728 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15729 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15730 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15731 R_386_TLS_DESC_CALL relocations.
15732 (Target_x86_64::Scan::global): Likewise.
15733 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15734 for TLS descriptors.
15735 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15736 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15737 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15738 GD-to-IE relaxation.
15739 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15740 and TLS_DESCRIPTORS.
15741 * Makefile.in: Rebuild.
15742 * configure: Rebuild.
15743 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15744 (tls_test_shared2.so): New target.
15745 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15746 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15747 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15748 (tls_shared_gd_to_ie_test_LDADD): New variable.
15749 (tls_shared_gnu2_gd_to_ie_test): New target.
15750 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15751 New targets.
15752 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15753 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15754 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15755 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15756 (tls_shared_gnu2_test): New target.
15757 (tls_test_gnu2_shared.so): New target.
15758 (tls_shared_gnu2_test_SOURCES): New variable.
15759 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15760 (tls_shared_gnu2_test_LDFLAGS): New variable.
15761 (tls_shared_gnu2_test_LDADD): New variable.
15762 * testsuite/Makefile.in: Rebuild.
15763 * testsuite/Makefile.
15764
83bfb6b7
ILT
157652008-04-11 Ian Lance Taylor <iant@google.com>
15766
15767 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15768 justsyms.t.
15769 * testsuite/Makefile.in: Rebuild.
15770
15771 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15772 long.
15773 * testsuite/script_test_2.cc (main): Adjust test.
15774
706e1f5e
ILT
157752008-04-11 David S. Miller <davem@davemloft.net>
15776 Ian Lance Taylor <iant@google.com>
15777
15778 * options.h (General_options): Add entries for '-Y' and
15779 '-relax'.
15780 * options.cc (General_options:finalize): If -Y was used, add those
15781 entries to the library path instead of the default "/lib" and
15782 "/usr/lib".
15783
7c98e6bb
DM
157842008-04-11 David S. Miller <davem@davemloft.net>
15785
15786 * testsuite/justsyms.t: Start at 0x100.
15787 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15788 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15789 long.
15790 * testsuite/script_test_2.cc: Adjust string and section length
15791 checks.
7c98e6bb 15792
99a37bfd
ILT
157932008-04-09 Ian Lance Taylor <iant@google.com>
15794
2cefc357
ILT
15795 PR gold/5996
15796 * script-sections.cc (Sections_element::allocate_to_segment): Add
15797 orphan parameter.
15798 (Output_section_definition::allocate_to_segment): Likewise.
15799 (Orphan_output_section::allocate_to_segment): Likewise.
15800 (Script_sections::attach_sections_using_phdrs_clause): Don't
15801 propagate non-PT_LOAD segments to orphan sections.
15802 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15803 readelf rather than objdump.
15804 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15805 .interp section and PT_INTERP segment are the same size.
15806 * testsuite/Makefile.in: Rebuild.
15807
99a37bfd
ILT
15808 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15809 aliases for symbols defined in the same object.
15810 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15811 (weak_alias_test_SOURCES): New variable.
15812 (weak_alias_test_DEPENDENCIES): New variable.
15813 (weak_alias_test_LDFLAGS): New variable.
15814 (weak_alias_test_LDADD): New variable.
15815 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15816 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15817 (weak_alias_test_3.o): New target.
15818 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15819 * testsuite/weak_alias_test_main.cc: New file.
15820 * testsuite/weak_alias_test_1.cc: New file.
15821 * testsuite/weak_alias_test_2.cc: New file.
15822 * testsuite/weak_alias_test_3.cc: New file.
15823
780e49c5
ILT
158242008-04-08 Ian Lance Taylor <iant@google.com>
15825
cdb0b8f5
ILT
15826 * options.h (class General_options): Add --noinhibit-exec option.
15827 * main.cc (main): Check --noinhibit-exec.
15828
0864d551
ILT
15829 * options.h (class General_options): Define --wrap as a special
15830 option. Add wrap_symbols_ field.
15831 (General_options::any_wrap_symbols): New function.
15832 (General_options::is_wrap_symbol): New function.
15833 * options.cc (General_options::parse_wrap): New function.
15834 (General_options::General_options): Initialize wrap_symbols_.
15835 * symtab.cc (Symbol_table::wrap_symbol): New function.
15836 (Symbol_table::add_from_object): Handle --wrap.
15837 * symtab.h (class Symbol_table): Declare wrap_symbol.
15838 * target.h (Target::wrap_char): New function.
15839 (Target::Target_info): Add wrap_char field.
15840 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15841 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15842 * testsuite/testfile.cc (Target_test::test_target_info):
15843 Likewise.
15844
789aa6de
ILT
15845 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15846 there is one.
15847
2c38906f
ILT
15848 * layout.h (class Layout): Add added_eh_frame_data_ field.
15849 * layout.cc (Layout::Layout): Initialize new field.
15850 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15851 output section until we find a section we merged successfully.
15852 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15853 that the size be non-zero.
15854
780e49c5
ILT
15855 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15856 qualifier.
15857
7fcd0256
ILT
158582008-04-08 Craig Silverstein <csilvers@google.com>
15859
15860 * configure.ac: Export new conditional variable HAVE_ZLIB.
15861 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15862 on HAVE_ZLIB.
15863 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15864 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15865
6835af53
ILT
158662008-04-07 Ian Lance Taylor <iant@google.com>
15867
e24f324c
ILT
15868 * version.cc (version_string): Set to "1.5".
15869
a036edd8
ILT
15870 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15871 Add issued_non_pic_error_ field. Declare check_non_pic.
15872 (Target_x86_64::Scan::check_non_pic): New function.
15873 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15874 (Target_x86_64::Scan::global): Likewise.
15875
624f8810
ILT
15876 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15877 addend parameter. Change caller. Handle merge sections.
15878 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15879 Address to Addend. Don't add in the result of
15880 local_section_offset, pass down the addend and use the returned
15881 value.
15882 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15883 Update declarations of local_section_offset and symbol_value.
15884 * testsuite/two_file_test_1.cc (t18): New function.
15885 * testsuite/two_file_test_2.cc (f18): New function.
15886 * testsuite/two_file_test_main.cc (main): Call t18.
15887 * testsuite/two_file_test.h (t18, f18): Declare.
15888
6835af53
ILT
15889 * configure.ac: Don't test for objdump, c++filt, or readelf.
15890 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15891 conditionals.
15892 (TEST_READELF): New variable.
15893 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15894 (check_PROGRAMS): Add two_file_strip_test.
15895 (two_file_strip_test): New target.
15896 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15897 (two_file_same_shared_strip_test_SOURCES): New variable.
15898 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15899 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15900 (two_file_same_shared_strip_test_LDADD): New variable.
15901 (two_file_shared_strip.so): New target.
15902 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15903 (ver_test_5.syms, ver_test_7.syms): Likewise.
15904 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15905 (strip_test_3.stdout): Use TEST_OBJDUMP.
15906 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15907
86925eef
CC
159082008-04-04 Cary Coutant <ccoutant@google.com>
15909
15910 * symtab.h (Symbol::is_weak_undefined): New function.
15911 (Symbol::is_strong_undefined): New function.
15912 (Symbol::is_absolute): New function.
15913 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15914 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15915 absolute symbols.
15916 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15917 (weak_undef_test): New target.
15918 * testsuite/Makefile.in: Rebuild.
15919 * testsuite/weak_undef_file1.cc: New file.
15920 * testsuite/weak_undef_file2.cc: New file.
15921 * testsuite/weak_undef_test.cc: New file.
15922
126f3ece
ILT
159232008-04-03 Craig Silverstein <csilvers@google.com>
15924
15925 * compressed_output.h (class Output_compressed_section): Use
15926 unsigned buffer.
15927 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15928 add zlib header.
15929 (zlib_compressed_suffix): Removed.
15930 (Output_compressed_section::set_final_data_size): Use unsigned
15931 buffers.
15932 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15933 Fix linker invocation.
15934 (flagstest_o_specialfile_and_compress_debug_sections):
15935 Likewise.
15936 * testsuite/Makefile.in: Regenerated.
15937
deae2a14
DM
159382008-04-02 David S. Miller <davem@davemloft.net>
15939
15940 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15941 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15942
70752818
ILT
159432008-04-02 Craig Silverstein <csilvers@google.com>
15944
15945 * TODO: New file.
15946
39d0cb0e
ILT
159472008-04-02 Ian Lance Taylor <iant@google.com>
15948
15949 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15950 parameters. Update for new key type to views_. Change all
15951 callers.
15952 (File_read::read): Adjust for byteshift in returned view.
15953 (File_read::add_view): New function, broken out of
15954 find_and_make_view.
15955 (File_read::make_view): New function, broken out of
15956 find_and_make_view.
15957 (File_read::find_or_make_view): Add offset and aligned
15958 parameters. Rewrite accordingly. Change all callers.
15959 (File_read::get_view): Add offset and aligned parameters. Adjust
15960 for byteshift in return value.
15961 (File_read::get_lasting_view): Likewise.
15962 * fileread.h (class File_read): Update declarations.
15963 (class File_read::View): Add byteshift_ field. Add byteshift to
15964 constructor. Add byteshift method.
15965 * archive.h (Archive::clear_uncached_views): New function.
15966 (Archive::get_view): Add aligned parameter. Change all callers.
15967 * object.h (Object::get_view): Add aligned parameter. Change all
15968 callers.
15969 (Object::get_lasting_view): Likewise.
15970
15971 * fileread.cc (File_read::release): Don't call clear_views if
15972 there are multiple objects.
15973 * fileread.h (File_read::clear_uncached_views): New function.
15974 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15975 on the archive.
15976
a1207466
CC
159772008-03-31 Cary Coutant <ccoutant@google.com>
15978
15979 Add thin archive support.
15980 * archive.cc (Archive::armagt): New const.
15981 (Archive::setup): Remove task parameter and calls to unlock.
15982 (Archive::unlock_nested_archives): New function.
15983 (Archive::read_header): Add nested_off parameter. Change
15984 all callers.
15985 (Archive::interpret_header): Likewise.
15986 (Archive::include_all_members): Change to handle thin
15987 archives.
15988 (Archive::include_member): Likewise.
15989 * archive.h (Archive::Archive): Add new parameters and
15990 initializers.
15991 (Archive::armagt): New const.
15992 (Archive::setup): Remove task parameter.
15993 (Archive::unlock_nested_archives): New function.
15994 (Archive::read_header): Add nested_off parameter.
15995 (Archive::interpret_header): Likewise.
15996 (Archive::Nested_archive_table): New typedef.
15997 (Archive::is_thin_archive_): New field.
15998 (Archive::nested_archives_): New field.
15999 (Archive::options_): New field.
16000 (Archive::dirpath_): New field.
16001 (Archive::task_): New field.
16002 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16003 for thin archives. Pass additional parameters to
16004 Archive::Archive. Unlock the archive file after calling
16005 Archive::setup.
cd536b21 16006
479f6503
ILT
160072008-03-29 Ian Lance Taylor <iant@google.com>
16008
686c8caf
ILT
16009 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16010 version symbol to be local.
16011 * testsuite/ver_test_4.sh: New file.
16012 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16013 (check_DATA): Add ver_test_4.syms.
16014 (ver_test_4.syms): New target.
16015 * testsuite/Makefile.in: Rebuild.
16016
ab794b6b
ILT
16017 * output.cc
16018 (Output_section::Input_section_sort_entry::has_priority): New
16019 function.
16020 (Output_section::Input_section_sort_entry::match_file_name): New
16021 function.
16022 (Output_section::Input_section_sort_entry::match_section_name):
16023 Remove.
16024 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16025 Remove.
16026 (Output_section::Input_section_sort_entry::match_section_file):
16027 Remove.
16028 (Output_section::Input_section_sort_compare::operator()): Rewrite
16029 using new Input_section_sort_entry functions. Sort crtbegin and
16030 crtend first. Sort sections with no priority before sections with
16031 a priority.
16032 * testsuite/initpri1.c (d3): Check j != 4.
16033 (cd5): New constructor/destructor function.
16034 (main): Check j != 2.
16035
479f6503
ILT
16036 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16037 new symbol when resolving, don't call set_is_default.
16038 * testsuite/ver_test_7.cc: New file.
16039 * testsuite/ver_test_7.sh: New file.
16040 * testsuite/Makefile.am (ver_test_7.so): New target.
16041 (ver_test_7.o): New target.
16042 (check_SCRIPTS): Add ver_test_7.sh.
16043 (check_DATA): Add ver_test_7.syms.
16044 (ver_test_7.syms): New target.
16045
2fd32231
ILT
160462008-03-28 Ian Lance Taylor <iant@google.com>
16047
16048 * layout.cc (Layout::layout): If we see an input section with a
16049 name that needs sorting, set the must_sort flag for the output
16050 section.
16051 (Layout::make_output_section): If the name of the output section
16052 indicates that it might require sorting, set the may_sort flag.
16053 * output.h (Output_section::may_sort_attached_input_sections): New
16054 function.
16055 (Output_section::set_may_sort_attached_input_sections): New
16056 function.
16057 (Output_section::must_sort_attached_input_sections): New
16058 function.
16059 (Output_section::set_must_sort_attached_input_sections): New
16060 function.
16061 (class Output_section): Declare Input_section_sort_entry. Define
16062 Input_section_sort_compare. Declare
16063 sort_attached_input_sections. Add new fields:
16064 may_sort_attached_input_sections_,
16065 must_sort_attached_input_sections_,
16066 attached_input_sections_are_sorted_.
16067 * output.cc (Output_section::Output_section): Initialize new
16068 fields.
16069 (Output_section::add_input_section): Add an entry to
16070 input_sections_ if may_sort or must_sort are true.
16071 (Output_section::set_final_data_size): Call
16072 sort_attached_input_sections if necessary.
16073 (Output_section::Input_section_sort_entry): Define new class.
16074 (Output_section::Input_section_sort_compare::operator()): New
16075 function.
16076 (Output_section::sort_attached_input_sections): New function.
16077 * configure.ac: Check whether the compiler supports constructor
16078 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16079 * testsuite/initpri1.c: New file.
16080 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16081 CONSTRUCTOR_PRIORITY.
16082 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16083 (initpri1_LDFLAGS): New variable.
16084 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16085
18e6b24e
ILT
160862008-03-27 Ian Lance Taylor <iant@google.com>
16087
49bdd526
ILT
16088 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16089 * testsuite/common_test_1.c: New file.
16090 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16091 (common_test_1_SOURCES): New variable.
16092 (common_test_1_DEPENDENCIES): New variable.
16093 (common_test_1_LDFLAGS): New variable.
16094
18e6b24e
ILT
16095 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16096 and commons_ correctly when NAME/VERSION does not override
16097 NAME/NULL.
16098 * testsuite/ver_test_6.c: New file.
16099 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16100 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16101 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16102
04bf7072
ILT
161032008-03-26 Ian Lance Taylor <iant@google.com>
16104
5871526f
ILT
16105 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16106 of an undefined symbol from a version script.
16107 * testsuite/Makefile.am (ver_test_5.so): New target.
16108 (ver_test_5.o): New target.
16109 (check_SCRIPTS): Add ver_test_5.sh.
16110 (check_DATA): Add ver_test_5.syms.
16111 (ver_test_5.syms): New target.
16112 * testsuite/ver_test_5.cc: New file.
16113 * testsuite/ver_test_5.script: New file.
16114 * testsuite/ver_test_5.sh: New file.
16115 * Makefile.in, testsuite/Makefile.in: Rebuild.
16116
04bf7072
ILT
16117 PR gold/5986
16118 Fix problems building gold with gcc 4.3.0.
16119 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16120 (gold_error_at_location, gold_warning_at_location): Use it.
16121 * configure.ac: Check whether we can compile and use a template
16122 function with a printf attribute.
16123 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16124 when jumping over bytes.
16125 * object.cc: Instantiate Object::read_section_data.
16126 * debug.h: Include <cstring>
16127 * dwarf_reader.cc: Include <algorithm>
16128 * main.cc: Include <cstring>.
16129 * options.cc: Include <cstring>.
16130 * output.cc: Include <cstring>.
16131 * script.cc: Include <cstring>.
16132 * script.h: Include <string>.
16133 * symtab.cc: Include <cstring> and <algorithm>.
16134 * target-select.cc: Include <cstring>.
16135 * version.cc: Include <string>.
16136 * testsuite/testmain.cc: Include <cstdlib>.
16137 * configure, config.in: Rebuild.
16138
874c5b28
ILT
161392008-03-25 Ian Lance Taylor <iant@google.com>
16140
819d6c3a
ILT
16141 * options.cc: Include "../bfd/bfdver.h".
16142 (options::help): Print bug reporting address.
16143
f4b2c6f5
ILT
16144 * version.cc (print_version): Adjust output for current value of
16145 BFD_VERSION_STRING.
16146
16147 * NEWS: New file.
16148
e96caa79
ILT
16149 * options.cc (options::help): Print list of supported targets.
16150 * target-select.h: Include <vector>.
16151 (class Target_selector): Make machine_, size_, and is_big_endian_
16152 fields const. Add bfd_name_ and instantiated_target_ fields.
16153 (Target_selector::Target_selector): Add bfd_name parameter.
16154 (Target_selector::recognize): Make non-virtual, call
16155 do_recognize.
16156 (Target_selector::recognize_by_name): Make non-virtual, call
16157 do_recognize_by_name.
16158 (Target_selector::supported_names): New function.
16159 (Target_selector::bfd_name): New function.
16160 (Target_selector::do_instantiate_target): New pure virtual
16161 function.
16162 (Target_selector::do_recognize): New virtual function.
16163 (Target_selector::do_recognize_by_name): New virtual function.
16164 (Target_selector::instantiate_target): New private function.
16165 (supported_target_names): Declare.
16166 * target-select.cc (Target_selector::Target_selector): Update for
16167 new parameter and fields.
16168 (select_target_by_name): Check that the name matches before
16169 calling recognize_by_name.
16170 (supported_target_names): New function.
16171 * i386.cc (class Target_selector_i386): Update Target_selector
16172 constructor call. Remove recognize and recognize_by_name. Add
16173 do_instantiate_target.
16174 * x86_64.cc (class Target_selector_x86_64): Likewise.
16175 * testsuite/testfile.cc (class Target_selector_test): Update for
16176 changes to Target_selector.
16177
874c5b28
ILT
16178 * README: Rewrite, with some notes on unsupported features.
16179
0a65a3a7
CC
161802008-03-24 Cary Coutant <ccoutant@google.com>
16181
16182 * i386.cc (Target_i386::Got_type): New enum declaration.
16183 (Target_i386::Scan::local): Updated callers of Output_data_got
16184 member functions.
16185 (Target_i386::Scan::global): Likewise.
16186 (Target_i386::Relocate::relocate): Likewise.
16187 (Target_i386::Relocate::relocate_tls): Likewise.
16188 * object.h (Got_offset_list): New class.
16189 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16190 (Sized_relobj::local_got_offset): Likewise.
16191 (Sized_relobj::set_local_got_offset): Likewise.
16192 (Sized_relobj::local_has_tls_got_offset): Removed.
16193 (Sized_relobj::local_tls_got_offset): Removed.
16194 (Sized_relobj::set_local_tls_got_offset): Removed.
16195 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16196 * output.cc (Output_data_got::add_global): Added got_type parameter.
16197 (Output_data_got::add_global_with_rel): Likewise.
16198 (Output_data_got::add_global_with_rela): Likewise.
16199 (Output_data_got::add_global_pair_with_rel): New function.
16200 (Output_data_got::add_global_pair_with_rela): New function.
16201 (Output_data_got::add_local): Added got_type parameter.
16202 (Output_data_got::add_local_with_rel): Likewise.
16203 (Output_data_got::add_local_with_rela): Likewise.
16204 (Output_data_got::add_local_pair_with_rel): New function.
16205 (Output_data_got::add_local_pair_with_rela): New function.
16206 (Output_data_got::add_global_tls): Removed.
16207 (Output_data_got::add_global_tls_with_rel): Removed.
16208 (Output_data_got::add_global_tls_with_rela): Removed.
16209 (Output_data_got::add_local_tls): Removed.
16210 (Output_data_got::add_local_tls_with_rel): Removed.
16211 (Output_data_got::add_local_tls_with_rela): Removed.
16212 * output.h (Output_data_got::add_global): Added got_type parameter.
16213 (Output_data_got::add_global_with_rel): Likewise.
16214 (Output_data_got::add_global_with_rela): Likewise.
16215 (Output_data_got::add_global_pair_with_rel): New function.
16216 (Output_data_got::add_global_pair_with_rela): New function.
16217 (Output_data_got::add_local): Added got_type parameter.
16218 (Output_data_got::add_local_with_rel): Likewise.
16219 (Output_data_got::add_local_with_rela): Likewise.
16220 (Output_data_got::add_local_pair_with_rel): New function.
16221 (Output_data_got::add_local_pair_with_rela): New function.
16222 (Output_data_got::add_global_tls): Removed.
16223 (Output_data_got::add_global_tls_with_rel): Removed.
16224 (Output_data_got::add_global_tls_with_rela): Removed.
16225 (Output_data_got::add_local_tls): Removed.
16226 (Output_data_got::add_local_tls_with_rel): Removed.
16227 (Output_data_got::add_local_tls_with_rela): Removed.
16228 * resolve.cc (Symbol::override_base_with_special): Removed
16229 reference to has_got_offset_ field.
16230 * symtab.cc (Symbol::init_fields): Replaced initialization
16231 of got_offset_ with got_offsets_. Removed initialization
16232 of has_got_offset_
53fcba31 16233 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16234 (Symbol::got_offset): Likewise.
16235 (Symbol::set_got_offset): Likewise.
16236 (Symbol::has_tls_got_offset): Removed.
16237 (Symbol::tls_got_offset): Removed.
16238 (Symbol::set_tls_got_offset): Removed.
16239 (Symbol::got_offset_): Removed.
16240 (Symbol::tls_mod_got_offset_): Removed.
16241 (Symbol::tls_pair_got_offset_): Removed.
16242 (Symbol::got_offsets_): New field.
16243 (Symbol::has_got_offset): Removed.
16244 (Symbol::has_tls_mod_got_offset): Removed.
16245 (Symbol::has_tls_pair_got_offset): Removed.
16246 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16247 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16248 member functions.
16249 (Target_x86_64::Scan::global): Likewise.
16250 (Target_x86_64::Relocate::relocate): Likewise.
16251 (Target_x86_64::Relocate::relocate_tls): Likewise.
16252
bd52eafb
BE
162532008-03-25 Ben Elliston <bje@au.ibm.com>
16254
16255 * yyscript.y: Fix spelling error in comment.
16256
8b105e34
ILT
162572008-03-24 Ian Lance Taylor <iant@google.com>
16258
8ed814a9
ILT
16259 * options.h (class General_options): Define build_id option.
16260 * layout.h (class Layout): Declare write_build_id, create_note,
16261 create_build_id. Add build_id_note_ member.
16262 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16263 "libiberty.h", "md5.h", "sha1.h".
16264 (Layout::Layout): Initialize eh_frame_data_,
16265 eh_frame_hdr_section_, and build_id_note_.
16266 (Layout::finalize): Call create_build_id.
16267 (Layout::create_note): New function, broken out of
16268 Layout::create_gold_note.
16269 (Layout::create_gold_note): Call create_note.
16270 (Layout::create_build_id): New function.
16271 (Layout::write_build_id): New function.
16272 (Close_task_runner::run): Call write_build_id.
16273
8b105e34
ILT
16274 * x86_64.cc: Correct license to GPLv3.
16275
086a1841
ILT
162762008-03-23 Ian Lance Taylor <iant@google.com>
16277
16278 * options.cc: Include "demangle.h".
16279 (parse_optional_string): New function.
16280 (parse_long_option): Handle takes_optional_argument.
16281 (parse_short_option): Update dash_z initializer. Handle
16282 takes_optional_argument.
16283 (General_options::General_options): Initialize do_demangle_.
16284 (General_options::finalize): Set do_demangle_. Handle demangling
16285 style.
16286 * options.h (parse_optional_string): Declare.
16287 (struct One_option): Add optional_arg field. Update constructor.
16288 Update call constructor calls. Add takes_optional_argument
16289 function.
16290 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16291 (DEFINE_optional_string): Define.
16292 (General_options::demangle): Change from DEFINE_bool to
16293 DEFINE_optional_string.
16294 (General_options::no_demangle): New function.
16295 (General_options::do_demangle): New function.
16296 (General_options::set_do_demangle): New function.
16297 (General_options::execstack_status_): Move definition to end of
16298 class definition.
16299 (General_options::static_): Likewise.
16300 (General_options::do_demangle_): New field.
16301 * object.cc (big_endian>::get_symbol_location_info): Call
16302 Options::do_demangle, not Options::demangle.
16303 * symtab.cc (demangle): Likewise.
16304
cbb93e63
ILT
163052008-03-22 Ian Lance Taylor <iant@google.com>
16306
16307 * gold.h: Include <cstddef> and <sys/types.h>
16308 * options.h: Include <cstring>.
16309
ec531623
ILT
163102008-03-21 Ian Lance Taylor <iant@google.com>
16311
16312 * Added source code to GNU binutils.
752937aa 16313\f
4b95cf5c 16314Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16315
16316Copying and distribution of this file, with or without modification,
16317are permitted in any medium without royalty provided the copyright
16318notice and this notice are preserved.
16319
16320Local Variables:
16321mode: change-log
16322left-margin: 8
16323fill-column: 74
16324version-control: never
16325End:
This page took 1.044699 seconds and 4 git commands to generate.