Properly check for an out of range row index
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
982bbd97
CC
12014-11-26 Cary Coutant <ccoutant@google.com>
2
3 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
4 .debug_str_offsets; strip .debug_gnu_pubnames and
5 .debug_gnu_pubtypes.
6 (lines_only_debug_sections): Strip all four new sections.
7
bb779192
HS
82014-11-26 Jing Yu <jingyu@google.com>
9
10 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
11 register to be x0 when to relax TLSDESC_LD64_LO12.
12
a3e60ddb
AM
132014-11-26 Alan Modra <amodra@gmail.com>
14
15 * powerpc.cc (struct Stub_table_owner): New.
16 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
17 unsigned int vector. Update all references.
18 (powerpc_relobj::set_stub_table): Take an unsigned int param
19 rather than a Stub_table. Update callers.
20 (Powerpc_relobj::clear_stub_table): New function.
21 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
22 stub_group_size_ vars.
23 (Target_powerpc::new_stub_table): Delete.
24 (max_branch_delta): New function, extracted from..
25 (Target_powerpc::Relocate::relocate): ..here..
26 (Target_powerpc::Branch_info::make_stub): ..and here. Return
27 status on whether stub created successfully.
28 (Stub_control::Stub_control): Add "no_size_errors" param. Move
29 default sizing to..
30 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
31 reduce on relax failure.
32 (Target_powerpc::group_sections): Add "no_size_errors" param.
33 Use stub_group_size_. Set up group info in a temp vector,
34 before building Stub_table vector. Account for input sections
35 possibly already converted to relaxed sections.
36 (Stub_table::init): Delete. Merge into..
37 (Stub_table::Stub_table): ..here.
38 (Stub_table::can_reach_stub): New function.
39 (Stub_table::add_plt_call_entry): Add "from" parameter and
40 return true iff stub could be reached.
41 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
42 param too.
43 (Stub_table::clear_stubs): Add "all" param.
44
a20605cf
AM
452014-11-26 Alan Modra <amodra@gmail.com>
46
47 * powerpc.cc (Stub_control::set_output_and_owner): New function.
48 (Target_powerpc::group_sections): Use it.
49
43b64deb
CC
502014-11-25 Cary Coutant <ccoutant@google.com>
51
52 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
53 (Binary_to_elf::write_symbol): Add st_size parameter.
54 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
55
c924eb67
CC
562014-11-25 Cary Coutant <ccoutant@google.com>
57
58 PR gold/17639
59 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
60 (Sized_relobj_file::do_layout): Handle deferred sections properly
61 during GC pass 1. Don't add reloc sections to deferred list twice.
62 * object.h (Sized_relobj_file::is_deferred_layout): New function.
63 (Sized_relobj_file::is_deferred_layout_): New data member.
64
9d585188
L
652014-11-21 H.J. Lu <hongjiu.lu@intel.com>
66
67 PR gold/17619
68 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
69 Check PC-relative offset overflow in PLT entry.
70
3ffaac20
AM
712014-11-21 Alan Modra <amodra@gmail.com>
72
73 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
74 for undefined weaks.
75
0cfb0717
AM
762014-11-20 Alan Modra <amodra@gmail.com>
77
78 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
79 from --stub-group-size parameter divided by 1024.
80 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
81 template parameter. Update all uses.
82 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
83 has_stub_value. Set for long branches. Don't report overflow for
84 branch to undefined weak symbols. Print info message on
85 overflowing branch to stub.
86
f9dffbf0
AM
872014-11-20 Alan Modra <amodra@gmail.com>
88
89 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
90
e88ba8d5
L
912014-11-13 H.J. Lu <hongjiu.lu@intel.com>
92
93 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
94 entry for R_X86_64_GOTPLT64.
95 (Target_x86_64<size>::Relocate::relocate): Update comments for
96 R_X86_64_GOTPLT64.
97
d37ffe25
ED
982014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
99
100 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
101 * plugin.h: add lock definition
102
9726c3c1
HS
1032014-10-29 Han Shen <shenhan@google.com>
104 Jing Yu <jingyu@google.com>
105
106 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
107 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
108 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
109 Symbol::TLS_REF.
110 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
111 method.
112 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
113 (Target_aarch64::tls_ld_to_le): New method.
114 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
115 for 64bit targets.
116 (Output_data_plt_aarch64::irelative_rel_): New data member.
117 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
118 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
119 (Output_data_plt_aarch64::add_relocation): New method.
120 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
121 offset. Add got_irelative size to got size.
122 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
123 type string with the new typename.
124 (AArch64_relocate_functions::update_adr): Replace parameter x with
125 immed.
126 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
127 (AArch64_relocate_functions::reloc_common): New method.
128 (AArch64_relocate_funcsions::rela_general): Extract common part out
129 into reloc_common method.
130 (AArch64_relocate_functions::rela_general): Likewise.
131 (AArch64_relocate_functions::pcrela_general): Likewise.
132 (AArch64_relocate_functions::adr): New method.
133 (AArch64_relocate_functions::adrp): Calculate immed before calling
134 update_adr.
135 (AArch64_relocate_functions::adrp): Likewise.
136 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
137 comparing x to 0. Calculate immed from ~x when x < 0.
138 (Target_aarch64::optimize_tls_reloc): Add new cases for
139 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
140 TLSLD_MOVW_DTPREL_G0_NC.
141 (Target_aarch64::possible_function_pointer_reloc): Implement this
142 method.
143 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
144 comment.
145 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
146 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
147 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
148 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
149 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
150 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
151 (Target_aarch64::make_plt_entry): Call add_entry with two more
152 parameters.
153 (Target_aarch64::make_local_ifunc_plt_entry): New method.
154 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
155 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
156 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
157 (Target_aarch64::Relocate::relocate_tls): Add cases for
158 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
159 TLSLD_MOVW_DTPREL_G0_NC.
160 * testsuite/icf_safe_so_test.cc: Correct test comment.
161 * testsuite/icf_safe_test.sh: Add AArch64 arch.
162
80272b8c
AM
1632014-10-22 Alan Modra <amodra@gmail.com>
164
165 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
166 thread_starter.
167
998a69f4
AS
1682014-10-18 Andreas Schwab <schwab@linux-m68k.org>
169
170 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
171
aed56ec5
CC
1722014-10-17 Cary Coutant <ccoutant@google.com>
173
174 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
175 Add "typename" keyword.
176
bb779192 1772014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
178 Jing Yu <jingyu@google.com>
179
180 Patch for gold aarch64 backend to support relaxation.
181 * aarch64-reloc.def: Change format.
182 * aarch64.cc (class Reloc_stub): New class.
183 (class Stub_table): New class.
184 (class AArch64_relobj): New class.
185 (class AArch64_input_section): New class.
186 (class AArch64_output_section): New class.
187 (Target_aarch64::new_stub_table): New method.
188 (Target_aarch64::new_aarch64_input_section): New method.
189 (Target_aarch64::find_aarch64_input_section): New method.
190 (Target_aarch64::scan_section_for_stubs): New method.
191 (Target_aarch64::scan_reloc_section_for_stubs): New method.
192 (Target_aarch64::relocate_stub): New method.
193 (Target_aarch64::current_target): New method.
194 (Target_aarch64::do_make_elf_object): New method.
195 (Target_aarch64::do_may_relax): New method.
196 (Target_aarch64::do_relax): New method.
197 (Target_aarch64::group_sections): New method.
198 (Target_aarch64::scan_reloc_for_stub): New method.
199 (Target_aarch64::do_make_output_section): New method.
200 (Target_aarch64::stub_tables_): New data member.
201 (Target_aarch64::aarch64_input_section_map_): New data member.
202 (AArch64_relocate_functions::maybe_apply_stub): New method.
203
db4c9594
CC
2042014-09-30 Cary Coutant <ccoutant@google.com>
205
206 PR gold/17432
207 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
208
cd6da036
KC
2092014-09-30 Kito Cheng <kito@0xlab.org>
210
211 PR gold/13597
212 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
213 hash table before sysv-style hash table.
214
5f772412
ST
2152014-09-29 Sriraman Tallam <tmsriram@google.com>
216
217 * options.h (--pic-executable): Add negative to alias to -no-pie.
218
5efeedf6
CC
2192014-09-26 Cary Coutant <ccoutant@google.com>
220
221 PR gold/16773
222 * object.cc (Sized_relobj_file): Compute value of section symbols
223 for TLS sections the same as TLS symbols.
224
1707f183
CC
2252014-09-25 Cary Coutant <ccoutant@google.com>
226
227 PR gold/17432
228 * resolve.cc (Symbol_table::resolve): Override common placeholder
229 symbols, but adjust sizes.
230 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
231 symbols to common lists.
232
00cac886
AM
2332014-09-24 Alan Modra <amodra@gmail.com>
234
235 * po/POTFILES.in: Regenerate.
236
635aa30e
CC
2372014-09-23 Taiju Tsuiki <tzik@google.com>
238 Cary Coutant <ccoutant@google.com>
239
71b9b91b 240 PR gold/14860
635aa30e
CC
241 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
242 on input_sections_blocker.
243 * layout.cc (Write_sections_task::locks): Unblock
244 input_sections_blocker_.
245 * layout.h (Write_sections_task::Write_sections_task): Add
246 input_sections_blocker.
247 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
248 to DEPENDENCIES.
249 * testsuite/Makefile.in: Regenerate.
250
c0c71592
RÁE
2512014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
252
253 * testsuite/Makefile.am (plugin_test_10): New test.
254 * testsuite/Makefile.in: Regenerate
255 * testsuite/plugin_common_test_2.c (c1): Align to 8.
256 * testsuite/plugin_test_10.sh: New file.
257
6168c2a1
RÁE
2582014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
259
260 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
261 * resolve.cc (Symbol_table::resolve): Don't override common symbols
262 during the replacement phase.
263
3a531937
JY
2642014-09-17 Han Shen <shenhan@google.com>
265 Jing Yu <jingyu@google.com>
266
267 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
268 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
269 * aarch64.cc (Target_aarch64): Add data members
270 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
271 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
272 constructor.
273 (Target_aarch64::do_reloc_symbol_index): New method.
274 (Target_aarch64::do_reloc_addend): New method.
275 (Target_aarch64::add_tlsdesc_info): New method.
276 (Target_aarch64::do_dynsym_value): New method.
277 (Target_aarch64::do_make_data_plt): Add new parameters: got,
278 got_irelative. Pass them to Output_data_plt_aarch64_standard.
279 (Target_aarch64::make_data_plt): Add new parameters: got,
280 got_irelative. Pass them to do_make_data_plt.
281 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
282 (Target_aarch64::Relocate:tls_gd_to_le): New method.
283 (Target_aarch64::Relocate:tls_ie_to_le): New method.
284 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
285 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
286 (Target_aarch64::got_tlsdesc_section): New method.
287 (Target_aarch64::make_local_ifunc_plt_entry): New method.
288 (Target_aarch64::define_tls_base_symbol): New method.
289 (Target_aarch64::reserve_tlsdesc_entries): New method.
290 (Target_aarch64::got_mod_index_entry): New method.
291 (Target_aarch64::rela_tlsdesc_section): New method.
292 (Target_aarch64::rela_irelative_section): New method.
293 (Target_aarch64::Tlsdesc_info): New struct.
294 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
295 relocations and tlsdesc relocations.
296 (Target_aarch64::optimize_tls_reloc): Implement method.
297 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
298 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
299 in constructor.
300 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
301 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
302 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
303 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
304 (Output_data_plt_aarch64::rela_tlsdesc): New method.
305 (Output_data_plt_aarch64::rela_irelative): New method.
306 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
307 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
308 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
309 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
310 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
311 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
312 (Output_data_plt_aarch64_standard): New member variables:
313 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
314 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
315 New parameter: got, got_irelative.
316 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
317 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
318 (Output_data_plt_aarch64::do_write): Replace got_address with
319 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
320 (AArch64_relocate_functions::update_movnz): New method.
321 (AArch64_relocate_functions): Correct format.
322 (AArch64_relocate_functions::movnz): New method.
323 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
324 before the switch. Add new cases to switch.
00cac886 325 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
326 tlsgd tlsdesc cases.
327 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
328 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
329 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
330 Call reloc_name_in_error_message to print unsupported reloc.
331 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
332 make_data_plt.
333 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
334 relocs. Fill in some more dynamic tags.
335 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
336 Skip call tls_get_addr when tlsgd is relaxed.
337 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
338 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
339 tlsdesc->ie relaxation.
340
62661c93
SS
3412014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
342
343 * mips.cc (Target_mips_nacl): New class.
344 (Target_selector_mips_nacl): New class.
345 (target_selector_mips32): Rename from target_selector_mips32be and use
346 Target_selector_mips_nacl instead of Target_selector_mips.
347 (target_selector_mips32el): Rename from target_selector_mips32 and use
348 Target_selector_mips_nacl instead of Target_selector_mips.
349 (target_selector_mips64): Rename from target_selector_mips64be and use
350 Target_selector_mips_nacl instead of Target_selector_mips.
351 (target_selector_mips64el): Rename from target_selector_mips64 and use
352 Target_selector_mips_nacl instead of Target_selector_mips.
353 (Target_mips::mips_info): Add const attribute.
354
54674d38
CC
3552014-09-02 Cary Coutant <ccoutant@google.com>
356
357 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
358 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
359 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
360 (Sized_incr_dynobj::do_section_name): Likewise.
361 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
362 (Sized_incr_dynobj::do_section_name): Likewise.
363 * object.h (Object::section_name): Likewise.
364 (Object::do_section_name): Likewise.
365 (Sized_relobj_file::do_section_name): Likewise.
366 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
367 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
368
9860cbcf
CC
3692014-09-02 Cary Coutant <ccoutant@google.com>
370
371 PR gold/17005
372 * ehframe.cc (Fde::write): Add output_offset parameter.
373 (Cie::write): Likewise.
374 (Eh_frame::set_final_data_size): Account for offset within output
375 section.
376 (Eh_frame::do_sized_write): Likewise.
377 * ehframe.h (Fde::write): Add output_offset parameter.
378 (Cie::write): Likewise.
379 * output.cc (Output_section::Input_section_sort_entry): Remove
380 section_has_name_; add output_section_name parameter. Use
381 output section name for non-input sections.
382 (Output_section::Input_section_sort_entry::section_has_name): Remove.
383 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
384 (Output_section::Input_section_sort_compare): Remove logic for
385 sections without names.
386 (Output_section::Input_section_sort_init_fini_compare): Likewise.
387 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
388 Likewise.
389 (Output_section::Input_section_sort_section_name_compare): Likewise.
390
8e33481e
HS
3912014-08-29 Han Shen <shenhan@google.com>
392 Jing Yu <jingyu@google.com>
393
394 * aarch64-reloc-property.cc
395 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
396 reference reloc property in the table.
397 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
398 3 other entries.
399 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
400 2 new overloaded methods.
401 (Output_data_got_aarch64::do_write): Add code to write out
402 static relocs.
403 (class Output_data_got_aarch64::Static_reloc): New class to wrap
404 static relocs.
405 (Output_data_got_aarch64::static_relocs): New vector to
406 hold static relocs.
407 (Target_aarch64::TCB_SIZE): New const static memeber.
408 (Target_aarch64::tcb_size): New method.
409 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
410 (Target_aarch64::Relocate::relocate_tls): New method.
411 (Target_aarch64::Scan::local): Add code handling new reloc types.
412 (Target_aarch64::Scan::global): Add code handling new reloc types.
413
81233653
ST
4142014-08-13 Sriraman Tallam <tmsriram@google.com>
415
416 * options.h (-no-pie): Add option.
417
9363c7c3
JY
4182014-08-08 Jing Yu <jingyu@google.com>
419 Han Shen <shenhan@google.com>
420
421 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
422 (DEFFILES): add aarch64-reloc.def.
423 (TARGETSOURCES): Add aarch64-reloc-property.cc.
424 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
425 * Makefile.in: Regenerate.
426 * aarch64-reloc-property.cc: New file.
427 * aarch64-reloc-property.h: New file.
428 * aarch64-reloc.def: New file.
429 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
430 with tab to make the format consistent.
431 (Output_data_got_aarch64::symbol_table_): New method.
432 (Target_aarch64::do_plt_address_for_global): New method.
433 (Target_aarch64::do_plt_address_for_local): New method.
434 (Target_aarch64::do_select_as_default_target): New method.
435 (Target_aarch64::do_make_data_plt): New method.
436 (Target_aarch64::make_data_plt): New method.
437 (Output_data_plt_aarch64::has_irelative_section): New method.
438 (Output_data_plt_aarch64::address_for_global): New method.
439 (Output_data_plt_aarch64::address_for_local): New method.
440 (Output_data_plt_aarch64::irelative_rel_): New parameter.
441 (Output_data_plt_aarch64::add_entry): Implement contents.
442 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
443 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
444 the got_pov entry to plt0.
445 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
446 Implement contents.
447 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
448 (AArch64_howto): New struct.
449 (aarch64_howto[]): New static const array.
450 (AArch64_relocate_functions): New class.
451 (Target_aarch64::Scan::get_reference_flags): Remove method.
452 (Target_aarch64::Scan::local): Implement to support a few relocations.
453 (Target_aarch64::Scan::global): Implement to support a few relocations.
454 (Target_aarch64::make_plt_section): Implement contents.
455 (Target_aarch64::make_plt_entry): Implement contents.
456 (Target_aarch64::do_finalize_sections): Implement contents.
457 (Target_aarch64::Relocate::relocate): Implement a few relocations.
458 (Target_aarch64::relocate_section): Implement contents.
459
ad9fe6c1
AM
4602014-08-06 Alan Modra <amodra@gmail.com>
461
462 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
463
7cd4e5b7
AM
4642014-08-06 Alan Modra <amodra@gmail.com>
465
466 PR 13227
467 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
468
5ad9b0a7
ST
4692014-07-21 Sriraman Tallam <tmsriram@google.com>
470
471 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 472 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 473
e051745c
CC
4742014-07-08 Cary Coutant <ccoutant@google.com>
475
476 * expression.cc (struct Expression::Expression_eval_info): Add
477 new fields type_pointer, vis_pointer, and nonvis_pointer.
478 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
479 nonvis_pointer parameters. Adjust all calls.
480 (Symbol_expression::value): Update type, visibility, and nonvis bits
481 in caller.
482 * script.cc (Symbol_assignment::sized_finalize): Update type,
483 visibility, and remaining st_other bits for new symbol.
484 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
485 vis_pointer, and nonvis_pointer parameters.
486 * symtab.h (Symbol::set_type): New method.
487
488 * testsuite/Makefile.am (defsym_test): New test.
489 * testsuite/Makefile.in: Regenerate.
490 * testsuite/defsym_test.c: New file.
491 * testsuite/defsym_test.sh: New file.
492
f35c4853
CC
4932014-07-08 Cary Coutant <ccoutant@google.com>
494
495 PR gold/15639
496 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
497 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
498 (Sized_dynobj::base_read_symbols): ...new method.
499 * object.h (Sized_relobj_file::base_read_symbols): New method.
500 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
501 (Sized_relobj_file::base_read_symbols): ...new method.
502 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
503 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
504 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
505
2900af2d
AM
5062014-07-04 Alan Modra <amodra@gmail.com>
507
508 * po/POTFILES.in: Regenerate.
509
053a4d68
JY
5102014-07-02 Jing Yu <jingyu@google.com>
511
512 * aarch64.cc: New file
513 * Makefile.am (TARGETSOURCES): Add aarch64.cc
514 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
515 * Makefile.in: Regenerate.
516 * configure.tgt: Add entries for aarch64*.
517 * configure.ac: Likewise.
518 * configure: Likewise.
519
7b549045
AM
5202014-06-27 Alan Modra <amodra@gmail.com>
521
522 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
523
cb818dbf
CC
5242014-06-24 Cary Coutant <ccoutant@google.com>
525
526 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
527 sections.
528 (Dwo_file::sized_read_unit_index): Likewise.
529
9810d34d
SS
5302014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
531
532 * mips.cc: New file.
533 * Makefile.am (TARGETSOURCES): Add mips.cc
534 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
535 * configure.tgt: Add entries for mips*.
536 * configure.ac: Likewise.
537 * Makefile.in: Regenerate.
538 * configure: Likewise.
539
9baa787b
CC
5402014-06-09 Cary Coutant <ccoutant@google.com>
541
542 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
543 unit_length is within section bounds.
544
8f89af0a
CC
5452014-06-09 Cary Coutant <ccoutant@google.com>
546
547 PR gold/16980
548 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
549 map.
550
a47622ac
AM
5512014-06-07 Alan Modra <amodra@gmail.com>
552
553 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
554
4320c691
CC
5552014-06-06 Cary Coutant <ccoutant@google.com>
556
557 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
558 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
559 (Dwarf_pubnames_table::read_header): Likewise.
560 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
561 .debug_gnu_pubtypes.
562
270c9937
JB
5632014-06-05 Joel Brobecker <brobecker@adacore.com>
564
565 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
566 * Makefile.in, configure: Regenerate.
567
397998fc
AM
5682014-06-03 Alan Modra <amodra@gmail.com>
569
570 * powerpc.cc (addis_12_2): Define.
571 (Stub_table::do_write): Support fusion on ELFv2 stubs.
572
61f5c66f
AM
5732014-06-03 Alan Modra <amodra@gmail.com>
574
575 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
576 st_other output.
577
f6971787
AM
5782014-06-02 Alan Modra <amodra@gmail.com>
579
580 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
581 Only ignore relocs on ELFv1.
582 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
583
f6fb8322
CC
5842014-05-30 Cary Coutant <ccoutant@google.com>
585
586 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
587 * testsuite/Makefile.in: Regenerate.
588 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
589
c23dd342
L
5902014-05-27 H.J. Lu <hongjiu.lu@intel.com>
591
592 PR gold/16945
593 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
594 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
595
5fe7ffdc
AM
5962014-05-15 Alan Modra <amodra@gmail.com>
597
598 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
599 Compare FDE contents with DW_CFA_nop rather than 0.
600
a82bef93
ST
6012014-05-13 Sriraman Tallam <tmsriram@google.com>
602
603 * symtab.h (may_need_copy_reloc): Remove check for position independent
604 code.
605 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
606 position independence before pc absolute may_need_copy_reloc call.
607 Add check for executable output befor pc relative may_need_copy_reloc
608 call.
609 * i386.cc: Ditto.
610 * arm.cc: Ditto.
611 * sparc.cc: Ditto.
612 * tilegx.cc: Ditto.
613 * powerpc.cc: Add check for no position independence before
614 may_need_copy_reloc calls.
615 * testsuite/pie_copyrelocs_test.cc: New file.
616 * testsuite/pie_copyrelocs_shared_test.cc: New file.
617 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 618 * Makefile.in: Regenerate.
a82bef93 619
53c66605
ML
6202014-05-08 Martin Liška <mliska@suse.cz>
621
622 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
623
57b2284c
CC
6242014-05-06 Cary Coutant <ccoutant@google.com>
625
626 PR gold/16900
627 * i386.cc (Output_data_got_plt_i386): New class.
628 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
629 parameter. Change all callers.
630 (Output_data_plt_i386::layout_): Remove.
631 (Output_data_plt_i386::got_plt_): Change type.
632 (Target_i386::got_plt_): Change type. Change all references.
633 (Target_i386::got_section): Create instance of new class.
634 (Output_data_got_plt_i386::do_write): New function.
635 * x86_64.cc (Output_data_got_plt_x86_64): New class.
636 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
637 parameter. Change all callers.
638 (Output_data_plt_x86_64::layout_): Remove.
639 (Output_data_plt_x86_64::got_plt_): Change type.
640 (Target_x86_64::got_plt_): Change type. Change all references.
641 (Target_x86_64::got_section): Create instance of new class.
642 (Output_data_got_plt_x86_64::do_write): New function.
643 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
644 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
645 class.
646
6b97515d 6472014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 648
6b97515d
CC
649 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
650 if we have pubnames/pubtypes.
651
d1bddd3c
CC
6522014-05-02 Cary Coutant <ccoutant@google.com>
653
5fe7ffdc
AM
654 * defstd.cc (in_segment): Define __ehdr_start here...
655 * layout.cc (Layout::finalize): ...Instead of here. Set the
656 output segment when known.
657 * resolve.cc (Symbol::override_base_with_special): Remember
658 the original binding.
659 * symtab.cc (Symbol::set_output_segment): New function.
660 (Symbol::set_undefined): New function.
661 * symtab.h (Symbol::is_weak_undefined): Check original undef
662 binding.
663 (Symbol::is_strong_undefined): New function.
664 (Symbol::set_output_segment): New function.
665 (Symbol::set_undefined): New function.
666 * target-reloc.h (is_strong_undefined): Remove.
667 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
668 Check for hidden undefs.
669 (relocate_section): Call Symbol::is_strong_undefined.
670
671 * testsuite/Makefile.am (ehdr_start_test_1)
672 (ehdr_start_test_2, ehdr_start_test_3)
673 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
674 * testsuite/Makefile.in: Regenerate.
675 * testsuite/ehdr_start_def.cc: New source file.
676 * testsuite/ehdr_start_test.cc: New source file.
677 * testsuite/ehdr_start_test.t: New linker script.
678 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 679
7849f6d8
CC
6802014-04-23 Cary Coutant <ccoutant@google.com>
681
bf2cc635 682 PR gold/16870
7849f6d8
CC
683 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
684
99fd8cff
CC
6852014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
686
687 * layout.cc (Layout::include_section): Allow a target to decide
688 whether to include a section.
689 * target.h (Target::should_include_section): New function.
690 (Target::do_should_include_section): New function.
691
91f43acd
CC
6922014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
693
694 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
695 inline into ...
696 (Copy_relocs::emit): ... here.
697 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
698 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
699 (Copy_reloc_entry::entries_): Change from private to protected.
700
c4eb27e1
ST
7012014-04-02 Sriraman Tallam <tmsriram@google.com>
702
703 * icf.cc (get_section_contents): Replace copies of reloc
704 vectors with const references.
705
ae447ddd
CC
7062014-04-02 Cary Coutant <ccoutant@google.com>
707
708 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
709 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
710 * configure: Regenerate.
711 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
712 -fno-use-linker-plugin.
713 (LINK1, CXXLINK1): Add it to the link command.
714 * testsuite/Makefile.in: Regenerate.
715
fa47fa92
AM
7162014-03-12 Alan Modra <amodra@gmail.com>
717
718 * Makefile.in: Regenerate.
719
9b12c500
CC
7202014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
721
722 * symtab.h (Symbol::set_nonvis): New function.
723
beacaa96
CC
7242014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
725
726 * symtab.cc (Sized_symbol<32>::init_output_data):
727 Instantiate the template.
728 (Sized_symbol<64>::init_output_data): Likewise.
729
800d9823
CC
7302014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
731
732 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
733 adjust dynamic symbol value.
734 * target.h (Target::adjust_dyn_symbol): New function.
735 (Target::do_adjust_dyn_symbol): New function.
736
918fc1f8 7372014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 738
918fc1f8
CC
739 * output.cc (Output_data_dynamic::Dynamic_entry::write):
740 Get the value of DYNAMIC_CUSTOM dynamic entry.
741 * output.h (Output_data_dynamic::add_custom): New function.
742 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
743 dynamic entry.
744 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
745 * target.h (Target::dynamic_tag_custom_value): New function.
746 (Target::do_dynamic_tag_custom_value): New function.
747
98ff9231
CC
7482014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
749
750 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
751 dynsym indexes.
752 * target.h (Target::has_custom_set_dynsym_indexes): New function.
753 (Target::do_has_custom_set_dynsym_indexes): New function.
754 (Target::set_dynsym_indexes): New function.
755 (Target::do_set_dynsym_indexes): New function.
756
b80eed39
AM
7572014-03-07 Alan Modra <amodra@gmail.com>
758
759 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
760 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
761 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
762 (Powerpc_relocate_functions::has_overflow_bitfield,
763 overflowed): Use the above.
764 (Target_powerpc::Relocate::relocate): Correct overflow checking
765 for a number of relocations. Modify overflow test for 16-bit
766 fields in instructions to signed/unsigned according to whether
767 the field takes a signed or unsigned value.
768
4b95cf5c
AM
7692014-03-05 Alan Modra <amodra@gmail.com>
770
771 Update copyright years.
772
45965137
AM
7732014-03-05 Alan Modra <amodra@gmail.com>
774
775 * powerpc.cc (Target_powerpc::Scan::local, global): Support
776 R_PPC64_ADDR64_LOCAL.
777 (Target_powerpc::Relocate::relocate): Likewise.
778
2c80b753
AM
7792014-03-03 Alan Modra <amodra@gmail.com>
780
781 * dwp.cc (print_version): Update copyright year to current.
782
c1c69e83
AM
7832014-02-10 Alan Modra <amodra@gmail.com>
784
785 * po/gold.pot: Regenerate.
786
dd0c4e70
CC
7872014-02-06 Cary Coutant <ccoutant@google.com>
788
789 Fix problem where -u is ignored when a weak undef is seen.
790
791 * archive.cc (Library_base::should_include_member): Reorder
792 code to check for -u option if a weak undef has already been seen.
793 * testsuite/Makefile.am (weak_undef_test_2): New test case.
794 * testsuite/Makefile.in: Regenerate.
795 * testsuite/weak_undef_file3.cc: New file.
796 * testsuite/weak_undef_file4.cc: New file.
797 * testsuite/weak_undef_test_2.cc: New file.
798
1a221d3d
CC
7992014-02-05 Cary Coutant <ccoutant@google.com>
800
801 Fix issues with gold undefined symbol diagnostics.
802
803 PR binutils/15435
804 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
805 check to here.
806 * target-reloc.h (is_strong_undefined): New function.
807 (relocate_section): Move undef vtable symbol check from here.
808 Check for is_strong_undefined.
809
e889f0a4 8102014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 811
e889f0a4
CC
812 Fix problems with the --dynamic-list option.
813
814 PR gold/13577
815 * options.cc (General_options::parse_dynamic_list):
816 Set have_dynamic_list_.
817 (General_options::General_options): Initialize have_dynamic_list_.
818 (General_options::finalize): Turn off -Bsymbolic and
819 -Bsymbolic-functions if --dynamic-list provided.
820 * options.h (General_options::have_dynamic_list): New function.
821 (General_options::have_dynamic_list_): New data member.
822 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
823 correctly.
5fe7ffdc 824
e889f0a4
CC
825 PR gold/16530
826 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
827 in --dynamic-list, mark it.
5fe7ffdc 828
e889f0a4
CC
829 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
830 (dynamic_list_2): New test case.
831 * testsuite/Makefile.in: Regenerate.
832 * testsuite/dynamic_list_2.cc: New file.
833 * testsuite/dynamic_list_2.t: New file.
834 * testsuite/dynamic_list_lib1.cc: New file.
835 * testsuite/dynamic_list_lib2.cc: New file.
836 * testsuite/gc_dynamic_list_test.c: New file.
837 * testsuite/gc_dynamic_list_test.sh: New file.
838 * testsuite/gc_dynamic_list_test.t: New file.
839
ec673e64
CC
8402014-01-28 Cary Coutant <ccoutant@google.com>
841
842 Add .gdb_index version 7 support.
843
844 * gold/dwarf_reader.cc: include <utility> (for make_pair).
845 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
846 debug sections.
847 (Dwarf_ranges_table::read_ranges_table): Likewise.
848 (Dwarf_pubnames_table::read_section): Check for GNU-style
849 sections, and for compressed debug sections.
850 (Dwarf_pubnames_table::read_header): Compute end address of table.
851 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
852 for end of list by offset, not by offset == 0.
853 (Dwarf_info_reader::do_read_string_table): Check for compressed
854 debug sections.
855 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
856 Initialize new data members.
857 (Dwarf_pubnames_table::next_name): return flag_byte.
858 (Dwarf_pubnames_table::end_of_table_): New data member.
859 (Dwarf_pubnames_table::is_gnu_style_): New data member.
860 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
861 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
862 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
863 read skeleton type unit DIEs.
864 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
865 (Gdb_index::do_write): Write flag_byte.
866 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
867 (Gdb_index::Cu_vector): Store flags along with cu indexes.
868 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
869 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
870
221fd5d5
L
8712014-01-08 H.J. Lu <hongjiu.lu@intel.com>
872
873 * version.cc (print_version): Update copyright year to 2014.
874
6c09fb0b
ILT
8752013-12-19 Dimitry Andric <dimitry@andric.com>
876
877 * stringpool.cc (Stringpool_template::reserve): Add
878 HAVE_UNORDERED_MAP case.
879 * stringpool.cc (Stringpool_template::print_stats): Likewise.
880
8356f2d0
CC
8812013-12-18 Cary Coutant <ccoutant@google.com>
882
883 * configure.ac: Check for <unordered_set> and <unordered_map>.
884 * config.in: Regenerate.
885 * configure: Regenerate.
886 * system.h: Use <unordered_set> and <unordered_map> if available.
887
f2c7d7ee
RM
8882013-12-10 Roland McGrath <mcgrathr@google.com>
889
890 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
891 with $(INSTALL_PROGRAM_ENV).
892 * Makefile.in: Regenerate.
893
6632e8cc
CC
8942013-11-22 Cary Coutant <ccoutant@google.com>
895
896 * configure.ac: Add check for which library is needed for
897 dlopen.
898 * configure: Regenerate.
899
0c075858
CC
9002013-11-22 Cary Coutant <ccoutant@google.com>
901
902 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
903 assembler.
904 * testsuite/Makefile.in: Regenerate.
905
f49fe902
L
9062013-11-17 H.J. Lu <hongjiu.lu@intel.com>
907
908 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
909 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
910 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
911 (Target_x86_64<size>::Scan::local): Likewise.
912 (Target_x86_64<size>::Scan::global): Likewise.
913 (Target_x86_64<size>::Relocate::relocate): Likewise.
914 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
915 Likewise.
916 (Target_x86_64<size>::Scan::check_non_pic(): Handle
917 R_X86_64_PC32_BND.
918
919 * testsuite/Makefile.am (check_PROGRAMS): Add
920 exception_x86_64_bnd_test.
921 (exception_x86_64_bnd_test_SOURCES): New macro.
922 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
923 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
924 (exception_x86_64_bnd_test_LDADD): Likewise.
925 (exception_x86_64_bnd_1.o): New rule.
926 (exception_x86_64_bnd_2.o): Likewise.
927 * testsuite/Makefile.in: Regenerated.
928
9055360d
AM
9292013-11-15 Alan Modra <amodra@gmail.com>
930
931 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
932 accessor.
933 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
934 Only call ppc64_local_entry_offset for 64-bit. Restrict
935 symval_for_branch lookup to ELFv1.
936 (Stub_table::add_plt_call_entry): Use unsigned int off.
937 (Output_data_glink::Address, invalid_address): New.
938 (Output_data_glink::add_eh_frame): Move out of line. Add
939 support for ELFv2.
940 (Output_data_glink::add_global_entry, find_global_entry,
941 global_entry_address): New functions.
942 (Output_data_glink::global_entry_stubs_, end_branch_table_,
943 ge_size): New variables.
944 (Output_data_glink::set_final_data_size): Add global entry
945 stub sizing.
946 (Output_data_glink::do_write): Write global entry stubs.
947 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
948 parameter. Return true for ELFv2. Adjust callers.
949 (Target_powerpc::Scan::local, global): Restrict opd lookup to
950 ELFv1. Similarly for ifunc and dynamic relocation processing
951 specific to ELFv1. Recognize that symbols are defined on
952 their plt entries for ELFv2.
953 (Target_powerpc::symval_for_branch): Assert if called for
954 ELFv2 or ppc32.
955 (Target_powerpc::Relocate::relocate): Use global entry plt
956 stub for symbol value if such exists on ELFv2.
957 (Target_powerpc::Relocate::relocate): Don't call
958 symval_for_branch when ELFv2. Do adjust for local entry
959 offset when ELFv2.
960 (Target_powerpc::do_dynsym_value): Set symbols to global entry
961 plt stub for ELFv2.
962 (Target_powerpc::do_plt_address_for_global): Similarly.
963
cafdd569
CC
9642013-11-14 Cary Coutant <ccoutant@google.com>
965
966 Revert patch -- this did not fix the problem, and there is
967 no race there.
968
969 2013-11-14 Cary Coutant <ccoutant@google.com>
970
971 PR gold/14860
972 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
973 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
974 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
975 updating fde_offsets_.
976 (Eh_frame_hdr::lock_): New data member.
977
94e49e16
CC
9782013-11-14 Cary Coutant <ccoutant@google.com>
979
980 * dwp.cc (Dwo_file_entry): New type.
981 (File_list): Use Dwo_file_entry.
982 (Dwo_file::verify): New function.
983 (Dwo_file::verify_dwo_list): New function.
984 (Dwo_file::sized_verify_dwo_list): New function.
985 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
986 list.
987 (Dwp_options): New enum type.
988 (dwp_options): Add --verify-only.
989 (usage): Likewise.
990 (main): Likewise.
991 * dwp.h (gold_info): Add declaration.
992
7cdd7d57
CC
9932013-11-14 Cary Coutant <ccoutant@google.com>
994
995 PR gold/14860
996 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
997 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
998 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
999 updating fde_offsets_.
1000 (Eh_frame_hdr::lock_): New data member.
1001
1d946cb3
CC
10022013-11-06 Cary Coutant <ccoutant@google.com>
1003
1004 PR gold/15758
1005 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1006 before reloc sections.
1007
4f65b40e
AM
10082013-11-04 Alan Modra <amodra@gmail.com>
1009
1010 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1011 (Symbol::needs_dynamic_reloc): Test new flag.
1012 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1013 (Target_powerpc::Scan::get_reference_flags): Add target param.
1014 Return FUNC_DESC_ABI for 64-bit ELFv1.
1015 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1016 call.
1017 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1018 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1019
908794a9
CC
10202013-10-31 Cary Coutant <ccoutant@google.com>
1021
1022 Restore support for dwp v2 DWARF package file format.
1023
1024 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1025 tu_length parameter. Adjust all callers.
1026 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1027 * dwp.cc: Include dwarf.h.
1028 (Section_bounds): New struct type.
1029 (Unit_set): New struct type.
1030 (Dwo_file::Dwo_file): Initialize new data member.
1031 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1032 Combine and rename to...
1033 (Dwo_file::read_unit_index): ...this.
1034 (Dwo_file::sized_read_compunit_index)
1035 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1036 (Dwo_file::sized_read_unit_index): ...this.
1037 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1038 parameters; add section_id parameter.
1039 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1040 (Dwo_file::add_unit_set): ...this.
1041 (Dwo_file::shndx_map_): Remove.
1042 (Dwo_file::sect_offsets_): New data member.
1043 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1044 (Dwp_output_file::add_section): Rename to...
1045 (Dwp_output_file::add_contribution): ...this.
1046 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1047 (Dwp_output_file::add_tu_set): Likewise.
1048 (Dwp_output_file::Contribution): New type.
1049 (Dwp_output_file::Section::contributions): New data member.
1050 (Dwp_output_file::Cu_or_tu_set): Remove.
1051 (Dwp_output_file::Section::Section): New ctor.
1052 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1053 (Dwp_output_file::Dwp_index::Section_table): New type.
1054 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1055 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1056 parameter.
1057 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1058 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1059 (Dwp_output_file::Dwp_index::section_table): New member function.
1060 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1061 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1062 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1063 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1064 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1065 (Dwp_output_file::Dwp_index::section_table_): New data member.
1066 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1067 (Dwp_output_file::add_output_section): New member function.
1068 (Dwp_output_file::write_new_section): New member function.
1069 (Dwp_output_file::write_contributions): New member function.
1070 (Dwp_output_file::section_id_map_): New data member.
1071 (class Dwo_id_info_reader): Remove.
1072 (class Unit_reader): New class.
1073 (get_dwarf_section_name): New function.
1074 (Dwo_file::read_executable): Adjust initializations of class data.
1075 (Dwo_file::read): Add support for v2 package file format.
1076 (Dwo_file::read_unit_index): Likewise.
1077 (Dwo_file::sized_read_unit_index): Likewise.
1078 (Dwo_file::copy_section): Likewise.
1079 (Dwo_file::add_unit_set): Likewise.
1080 (Dwp_output_file::add_output_section): Likewise.
1081 (Dwp_output_file::add_contribution): Likewise.
1082 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1083 for empty slot.
1084 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1085 file format.
1086 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1087 slot.
1088 (Dwp_output_file::initialize): Remove unused function.
1089 (Dwp_output_file::finalize): Add support for v2 package file format.
1090 (Dwp_output_file::write_index): Likewise.
1091 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1092 function prototype.
1093
2500c017
CC
10942013-10-31 Cary Coutant <ccoutant@google.com>
1095
1096 * configure.ac: Fix check for -fmerge-constants.
1097 * configure.ac: Regenerate.
1098
dd0845d7
RM
10992013-10-30 Roland McGrath <mcgrathr@google.com>
1100
1101 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1102 Correct 9-byte nop sequence to match what the assembler generates.
1103
b4f7960d
AM
11042013-10-30 Alan Modra <amodra@gmail.com>
1105
1106 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1107 ppc64_local_entry_offset, ppc64_local_entry_offset,
1108 do_read_symbols): New functions.
1109 (Powerpc_relobj::e_flags_, st_other_): New vars.
1110 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1111 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1112 (Powerpc_relobj::e_flags_): New var.
1113 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1114 and adjust for ELFv2.
1115 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1116 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1117 (Powerpc_dynobj::do_find_special_sections): Likewise.
1118 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1119 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1120 to ELFv2 local entry.
1121 (Target_powerpc::do_relax): No thread safe barriers needed for
1122 ELFv2.
1123 (Output_data_plt_powerpc::initial_plt_entry_size_,
1124 plt_entry_size): Delete. Replace all uses with
1125 first_plt_entry_offset() and plt_entry_size().
1126 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1127 reserved_size parm. Update callers.
1128 (Output_data_plt_powerpc::entry_count): Update.
1129 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1130 and use Target_powerpc::first_plt_entry_offset().
1131 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1132 rename to plt_entry_size.
1133 (Output_data_plt_powerpc::add_ifunc_entry,
1134 add_local_ifunc_entry): Adjust reloc for ELFv2.
1135 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1136 (glink_eh_frame_fde_64v2): New.
1137 (Stub_table::plt_call_size): Support ELFv2 sizing.
1138 (Output_data_glink::add_eh_frame): Use the new FDE.
1139 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1140 (Stub_table::do_write): Write ELFv2 stubs and glink.
1141 (Target_powerpc::Relocate::relocate): Replaces nop after call
1142 with ld 2,24(1) and adjust local offset destination for ELFv2.
1143
f9c6b907
AM
11442013-10-30 Alan Modra <amodra@gmail.com>
1145
1146 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1147 (Target_powerpc::Scan::global, local): Likewise.
1148 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1149 on all ppc64 @h and @ha relocs.
1150
e84fe78f
AM
11512013-10-14 Alan Modra <amodra@gmail.com>
1152
1153 * output.h (Output_data_got::add_constant): Tidy.
1154 (Output_data_got::add_constant_pair): New function.
1155 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1156 methods used so as to first call reserve_ent().
1157
679e4abf
RM
11582013-10-11 Roland McGrath <mcgrathr@google.com>
1159
44dcb735
RM
1160 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1161 add_got_entry and add_got_entry_pair.
1162
13323c49
RM
1163 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1164 (HAVE_PUBNAMES): Likewise.
1165 * configure: Regenerate.
1166
1496b446
RM
1167 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1168 * testsuite/Makefile.in: Regenerate.
1169
cc84c10b
RM
1170 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1171 Remove const from declaration.
1172 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1173 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1174 * output.h (Output_file_header): Remove const from member target_
1175 and corresponding constructor argument.
1176 * output.cc (Output_file_header::Output_file_header): Update prototype.
1177 (Output_file_header::do_sized_write): Use this->target_ in place
1178 of parameters()->target().
1179
52f66a2c
RM
1180 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1181
2b64b551
RM
1182 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1183 * configure: Regenerate.
1184 * Makefile.in: Regenerate.
1185 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1186 * testsuite/merge_string_literals_2.c: Likewise.
1187 * testsuite/Makefile.am
1188 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1189 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1190 literal -fmerge-constants.
1191 * testsuite/Makefile.in: Regenerate.
1192
43819297
RM
1193 * i386.cc (Target_i386): Remove unused member dynbss_.
1194 * arm.cc (Target_arm): Likewise.
1195 * powerpc.cc (Target_powerpc): Likewise.
1196 * sparc.cc (Target_sparc): Likewise.
1197 * tilegx.cc (Target_tilegx): Likewise.
1198 * x86_64.cc (Target_x86_64): Likewise.
1199 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1200 type_signature_, type_offset_.
1201 * plugin.h (Plugin_hook): Remove unused member layout_.
1202 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1203 mapfile_.
1204 (Read_member): Remove unused members input_objects_, symtab_,
1205 mapfile_, layout_.
1206 (Check_library): Remove unused member symtab_.
1207 * archive.h (Lib_group): Remove unused member lib_.
1208 * archive.cc (Lib_group::Lib_group): Update initializer.
1209 * incremental.h (Incremental_binary): Remove unused member target_.
1210 (Incremental_script_entry): Removed unused member script_.
1211 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1212 * icf.h (Icf): Remove unused member num_tracked_relocs.
1213
39d9ead7
RM
1214 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1215 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1216 its only use.
1217 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1218
679e4abf
RM
1219 * archive.h: Use struct rather than class for forward declaration
1220 of Read_symbols_data.
1221
54de2ea6
CC
12222013-10-07 Cary Coutant <ccoutant@google.com>
1223
1224 PR gold/16010
1225 * testsuite/Makefile.am (icf_test): Fix dependencies.
1226 (icf_safe_test): Likewise.
1227 (icf_safe_so_test): Likewise.
1228 (large_symbol_alignment): Add empty _LDADD rule.
1229 * testsuite/Makefile.in: Regenerate.
1230
b14016f0
L
12312013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1232
1233 PR gold/15927
1234 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1235 relocation for R_X86_64_32 on x32.
1236
eb426534
RM
12372013-08-27 Roland McGrath <mcgrathr@google.com>
1238
1239 * output.cc (Output_segment::set_section_addresses): Take new
1240 Target* argument. If target->isolate_execinstr() and the segment
1241 is executable and starts at a target->abi_pagesize() boundary,
1242 pad its end out to a target->abi_pagesize() boundary with code fill.
1243 * output.h (Output_segment::set_section_addresses): Update decl.
1244 * layout.h (Layout::check_output_data_for_reset_values): Take new
1245 argument RELAX_OUTPUTS.
1246 (Layout): New member relax_output_list_.
1247 (Layout::add_relax_output): New method.
1248 * layout.cc (Layout::Layout): Update constructor.
1249 (Layout::reset_relax_output): New method.
1250 (Layout::clean_up_after_relaxation): Call it.
1251 (Layout::prepare_for_relaxation): Update caller.
1252 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1253 Call reset_relax_output before re-processing segments for
1254 isolate_execinstr case.
1255 (Layout::write_data): Handle relax_output_list_.
1256 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1257 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1258
9aff4b7a
NC
12592013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1260
1261 PR binutils/15834
1262 * object.h: Fix typos.
1263
93f8221c
RM
12642013-08-16 Roland McGrath <mcgrathr@google.com>
1265
1266 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1267 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1268
e44c3715
CC
12692013-08-07 Cary Coutant <ccoutant@google.com>
1270
1271 Revert support for v2 DWP files:
1272
1273 2013-03-01 Cary Coutant <ccoutant@google.com>
1274
1275 Add dwp support for v2 DWARF package file format.
1276 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1277 tu_length parameter. Adjust all callers.
1278 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1279 * dwp.cc: Include dwarf.h.
1280 (Section_bounds): New struct type.
1281 (Unit_set): New struct type.
1282 (Dwo_file::Dwo_file): Initialize new data member.
1283 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1284 Combine and rename to...
1285 (Dwo_file::read_unit_index): ...this.
1286 (Dwo_file::sized_read_compunit_index)
1287 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1288 (Dwo_file::sized_read_unit_index): ...this.
1289 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1290 parameters; add section_id parameter.
1291 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1292 (Dwo_file::add_unit_set): ...this.
1293 (Dwo_file::shndx_map_): Remove.
1294 (Dwo_file::sect_offsets_): New data member.
1295 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1296 (Dwp_output_file::add_section): Rename to...
1297 (Dwp_output_file::add_contribution): ...this.
1298 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1299 (Dwp_output_file::add_tu_set): Likewise.
1300 (Dwp_output_file::Contribution): New type.
1301 (Dwp_output_file::Section::contributions): New data member.
1302 (Dwp_output_file::Cu_or_tu_set): Remove.
1303 (Dwp_output_file::Section::Section): New ctor.
1304 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1305 (Dwp_output_file::Dwp_index::Section_table): New type.
1306 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1307 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1308 parameter.
1309 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1310 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1311 (Dwp_output_file::Dwp_index::section_table): New member function.
1312 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1313 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1314 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1315 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1316 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1317 (Dwp_output_file::Dwp_index::section_table_): New data member.
1318 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1319 (Dwp_output_file::add_output_section): New member function.
1320 (Dwp_output_file::write_new_section): New member function.
1321 (Dwp_output_file::write_contributions): New member function.
1322 (Dwp_output_file::section_id_map_): New data member.
1323 (class Dwo_id_info_reader): Remove.
1324 (class Unit_reader): New class.
1325 (get_dwarf_section_name): New function.
1326 (Dwo_file::read_executable): Adjust initializations of class data.
1327 (Dwo_file::read): Add support for v2 package file format.
1328 (Dwo_file::read_unit_index): Likewise.
1329 (Dwo_file::sized_read_unit_index): Likewise.
1330 (Dwo_file::copy_section): Likewise.
1331 (Dwo_file::add_unit_set): Likewise.
1332 (Dwp_output_file::add_output_section): Likewise.
1333 (Dwp_output_file::add_contribution): Likewise.
1334 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1335 for empty slot.
1336 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1337 file format.
1338 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1339 slot.
1340 (Dwp_output_file::initialize): Remove unused function.
1341 (Dwp_output_file::finalize): Add support for v2 package file format.
1342 (Dwp_output_file::write_index): Likewise.
1343 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1344 function prototype.
1345
c6905c28
CC
13462013-07-31 Cary Coutant <ccoutant@google.com>
1347
1348 * object.cc (Sized_relobj::do_output_section_address): New function.
1349 (Sized_relobj): Instantiate explicitly.
1350 * object.h (Object::output_section_address): New function.
1351 (Object::do_output_section_address): New function.
1352 (Sized_relobj::do_output_section_address): New function.
1353 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1354
13552013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1356 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1357
1358 * parameters.cc (Parameters::entry): Return target-specific entry
1359 symbol name.
1360 * target.h (Target::entry_symbol_name): New function.
1361 (Target_info::entry_symbol_name): New data member.
1362
1363 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1364 * i386.cc (Target_i386::i386_info): Likewise.
1365 (Target_i386_nacl::i386_nacl_info): Likewise.
1366 * sparc.cc (Target_sparc::sparc_info): Likewise.
1367 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1368 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1369 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1370 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1371
234d4ab8
SA
13722013-07-22 Sterling Augustine <saugustine@google.com>
1373
1374 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1375 Convert parameter shndx to local variable. Add parameters symtab
1376 and symtab_size. Scan over section names. Find relocation
1377 section corresponding to current section. Create and initialize
1378 reloc_mapper_ and reloc_type_.
1379 (Dwarf_pubnames_table::read_header): Add assertion. Change
1380 unit_length to off_t. Initialize member unit_length_. Fill in field
1381 cu_offset_.
1382 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1383 Initialize new fields unit_length_ and cu_offset_.
1384 (Dwarf_pubnames_table::read_section): Update prototype.
1385 (Dwarf_pubnames_table::cu_offset): New member function.
1386 (Dwarf_pubnames_table::subsection_size): Likewise.
1387 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1388 New fields.
1389 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1390 member functions public.
1391 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1392 Update comment. Rework logic. Move repeated parts to...
1393 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1394 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1395 pubtypes_table_, and stmt_list_offset.
1396 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1397 Gdb_index::find_pubtype_offset,
1398 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1399 (Gdb_index::pubnames_read): Update prototype and rework logic.
1400 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1401 Forward declare.
1402 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1403 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1404 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1405 Gdb_index::map_pubtable_to_dies):
1406 Declare functions.
1407 (Gdb_index::pubnames_read): Update declaration.
1408 (Gdb_index::Pubname_offset_map): New type.
1409 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1410 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1411 Gdb_index::stmt_list_offset): Declare.
1412 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1413 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1414 Gdb_index::pubtypes_offset_): Remove.
1415
a3ed37d8
RM
14162013-07-19 Roland McGrath <mcgrathr@google.com>
1417
1418 * options.h (General_options): Add -Trodata-segment option.
1419 * parameters.cc (Parameters::check_rodata_segment): New function.
1420 (Parameters::set_target_once): Call it.
1421 * parameters.h (Parameters): Declare it (private member function).
1422 * layout.cc (load_seg_unusable_for_headers): New function, broken
1423 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1424 then validate rodata segment rather than text segment.
1425 (relaxation_loop_body): Call that.
1426 (is_text_segment): New function. Don't admit a non-executable
1427 segment if TARGET->isolate_execinstr().
1428 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1429
eb5b4ded
CC
14302013-07-15 Shawn Landden <shawnlandden@gmail.com>
1431
1432 PR gold/15070
1433 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1434 * nacl.h (Sniff_file::View::View): Request aligned view.
1435
4d5effb9
CC
14362013-07-11 Cary Coutant <ccoutant@google.com>
1437
1438 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1439 correct BRLT entry size.
1440
ba8ca3e7
AM
14412013-07-03 Alan Modra <amodra@gmail.com>
1442
1443 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1444 comment.
1445
267257d2
CC
14462013-07-01 Cary Coutant <ccoutant@google.com>
1447
1448 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1449 reloc_type_.
1450 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1451 (Dwarf_ranges_table::lookup_reloc): New function.
1452 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1453 reloc_type_.
1454 (Dwarf_ranges_table::lookup_reloc): New function.
1455 (Dwarf_ranges_table::reloc_type_): New data member.
1456
06f30c9d
CC
14572013-06-27 Jing Yu <jingyu@google.com>
1458
1459 PR gold/15662
1460 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1461 function.
1462 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1463 (Target_powerpc::do_relax): Call the above.
1464
a2d7bf59
AM
14652013-06-27 Cary Coutant <ccoutant@google.com>
1466
1467 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1468 on garbage collected .opd section.
1469
14702013-06-27 Alan Modra <amodra@gmail.com>
1471
1472 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1473 is non-zero.
1474 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1475 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1476
32364e50
CC
14772013-06-14 Cary Coutant <ccoutant@google.com>
1478
1479 * resolve.cc (Symbol::override_base): Don't override st_type
1480 from plugin placeholder symbols.
1481 (Symbol_table::resolve): Likewise.
1482 (Symbol_table::should_override): Don't complain about TLS mismatch
1483 if the TO symbol is a plugin placeholder.
1484 * testsuite/Makefile.am (plugin_test_tls): New test.
1485 * testsuite/Makefile.in: Regenerate.
1486 * testsuite/plugin_test_tls.sh: New test script.
1487 * testsuite/two_file_test_2_tls.cc: New test source.
1488 * testsuite/two_file_test_tls.cc: New test source.
1489
7fb47cc9
CC
14902013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1491
1492 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1493 the maximum segment alignment is larger than the page size.
1494 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1495 correctly aligns the symbols with large alignemnt.
1496 * testsuite/Makefile.in: Regenerate.
1497 * testsuite/large_symbol_alignment.cc: New file.
1498
6934001a
CC
14992013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1500 Sriraman Tallam <tmsriram@google.com>
1501
1502 * options.h (sort_section): New option.
1503 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1504 Rename from Input_section_sort_section_name_special_ordering_compare.
1505 (Input_section_sort_section_name_compare): New struct.
1506 * output.cc (Output_section::Input_section_sort_section_name_compare::
1507 operator()): New function.
1508 (Output_section::sort_attached_input_sections): Use new sort function
1509 for .text if --sort-section=name is specified.
1510 * layout.cc (Layout::make_output_section):
1511 Add sorting by name when --sort-section=name is specified.
1512 * testsuite/Makefile.am (text_section_grouping): Test option
1513 --sort-section=name.
1514 * testsuite/Makefile.in: Regenerate.
1515 * testsuite/section_sorting_name.cc: New file.
1516 * testsuite/section_sorting_name.sh: New file.
1517
93acabad
CC
15182013-05-21 Cary Coutant <ccoutant@google.com>
1519
1520 * symtab.h (Symbol::is_cxx_vtable): New function.
1521 * target-reloc.h (relocate_section): Check for vtable symbol.
1522 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1523 * testsuite/Makefile.in: Regenerate.
1524 * testsuite/missing_key_func.cc: New test source.
1525 * testsuite/missing_key_func.sh: New test script.
1526
60e8b3fc
CC
15272013-05-21 Cary Coutant <ccoutant@google.com>
1528
2b64b551
RM
1529 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1530 type of enclosing symbol.
1531 (Relocate_info::location): Check symbol type when describing symbol.
1532 * object.h (Symbol_location_info): Remove unused line_number;
1533 add enclosing_symbol_type.
1534 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1535
9df9de2c
CC
15362013-05-13 Cary Coutant <ccoutant@google.com>
1537
2b64b551
RM
1538 * configure.ac: Export DEFAULT_TARGET.
1539 * configure: Regenerate.
1540 * Makefile.in: Regenerate.
1541 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1542 * testsuite/Makefile.in: Regenerate.
1543 * testsuite/debug_msg.sh: Delete duplicate tests.
1544 Don't check undef_int error message match for powerpc where the
1545 source file and line number aren't available.
9df9de2c 1546
bbc5ae17
RM
15472013-05-10 Roland McGrath <mcgrathr@google.com>
1548
1549 * options.h (General_options): Add --rosegment-gap option.
1550 * options.cc (finalize): --rosegment-gap implies --rosegment.
1551 * layout.cc (set_segment_offsets): Let user option override
1552 target->rosegment_gap().
1553
0c6e6c39
RM
15542013-05-10 Roland McGrath <mcgrathr@google.com>
1555
1556 * options.h (General_options): Remove leading space from help
1557 messages for -nostdlib and --rosegment.
1558
cde7cb01
MR
15592013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1560
1561 PR ld/15365
1562 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1563
f31ae5b8
AM
15642013-05-03 Alan Modra <amodra@gmail.com>
1565
1566 * merge.cc (Output_merge_string::do_add_input_section): Correct
1567 scan for number of strings. Rename vars to avoid shadowing.
1568 Include missing terminator in input_size_.
1569
d3a7cd45
L
15702013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1571
1572 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1573 Restore empty string handling.
1574
6ad3daba
CC
15752013-05-01 Cary Coutant <ccoutant@google.com>
1576
1577 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1578 uninitialized warning.
1579
e31908b6
CC
15802013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1581
1582 * output.cc (Output_section::add_merge_input_section): Allow
1583 to merge sections if the alignment is more than character size.
1584 * merge.h (Output_merge_string::Output_merge_string): Remove
1585 assert.
1586 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1587 only not-null strings. Check the alignment of strings.
1588 * stringpool.h
1589 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1590 alignment as the argument.
1591 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1592 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1593 Align non-zero length strings according to the addralign_.
1594 (Stringpool_template<Stringpool_char>::set_string_offsets):
1595 Updating offsets according to the given alignment.
1596 * testsuite/Makefile.am (text_section_grouping): Test if string
1597 literals are getting merged.
1598 * testsuite/Makefile.in: Regenerate.
1599 * testsuite/merge_string_literals_1.c: New file.
1600 * testsuite/merge_string_literals_2.c: Ditto.
1601 * testsuite/merge_string_literals.sh: Ditto.
1602
0e804863
ILT
16032013-04-26 Ian Lance Taylor <iant@google.com>
1604
1605 * target-reloc.h (relocate_section): If the reloc offset is out of
1606 range, pass VIEW as NULL to relocate.relocate.
1607 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1608 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1609 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1610 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1611 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1612 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1613
e7c5ea40
CC
16142013-04-26 Geoff Pike <gpike@chromium.org>
1615
1616 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1617 * layout.cc (Hash_task): New class.
1618 (Layout::queue_build_id_tasks): New function.
1619 (Layout::write_build_id): Handle single-thread portion of build ID
1620 computation. (In some cases, all of it is single-threaded.) Replace
1621 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1622 functionality in fewer lines of code.
1623 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1624 * options.h (General_options): make "--build-id" default to tree
1625 rather than sha1. Add two new options related to --build-id=tree:
1626 --build-id-chunk-size-for-treehash and
1627 --build-id-min-file-size-for-treehash.
1628 * Makefile.am: add testing of --build-id=tree and related new options
1629 (these tests will be invoked by "make check").
1630 * Makefile.in: Regenerate.
1631
49926cd0
AM
16322013-04-25 Alan Modra <amodra@gmail.com>
1633
1634 * configure.tgt: Add powerpcle and powerpc64le.
1635
a4034750
AM
16362013-04-22 Alan Modra <amodra@gmail.com>
1637
1638 PR gold/15355
1639 * layout.cc (Layout::segment_precedes): Allow more than one
1640 segment with the same type and flags.
1641
e79c84aa
CC
16422013-04-15 Cary Coutant <ccoutant@google.com>
1643
1644 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1645 allocate space in file for BSS sections.
1646
2199fbe7
CC
16472013-04-15 Cary Coutant <ccoutant@google.com>
1648
1649 * script-sections.cc (Orphan_output_section): Reset address
1650 to zero after each orphaned section for relocatable links.
1651
502e8a84
CC
16522013-04-15 Cary Coutant <ccoutant@google.com>
1653
a4034750
AM
1654 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1655 section starting address for relocatable link.
1656 * testsuite/Makefile.am (script_test_11): New test.
1657 * testsuite/Makefile.in: Regenerate.
1658 * testsuite/script_test_11.c: New source file.
1659 * testsuite/script_test_11.t: New linker script.
502e8a84 1660
0cfdc767
AM
16612013-04-13 Alan Modra <amodra@gmail.com>
1662
1663 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1664 owner when sections are not adjacent and exceed group size.
1665 (Target_powerpc::group_sections): Handle corner case.
1666 (Target_powerpc::Branch_info::make_stub): Handle case where
1667 stub table doesn't exist due to branches in non-exec sections.
1668 (Target_powerpc::Relocate::relocate): Likewise.
1669
6830ee24
AM
16702013-04-11 Alan Modra <amodra@gmail.com>
1671
1672 PR gold/15354
1673 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1674 .branch_lt to match bfd ld. Adjust comments throughout file.
1675
54a3d865
ILT
16762013-04-04 Ian Lance Taylor <iant@google.com>
1677
1678 GCC PR c++/56840
1679 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1680 sections before checking whether they are included in the link.
1681
9993ba11
ST
16822013-03-29 Sriraman Tallam <tmsriram@google.com>
1683
1684 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1685 object before calling the plugin claim_file handler. Pass the elf
1686 object of the archive to the plugin. Delete the elf object if the
1687 plugin claims the file.
1688
ebacd51e
AM
16892013-03-21 Alan Modra <amodra@gmail.com>
1690
1691 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1692 segment when omagic.
1693
117be58f
AM
16942013-03-21 Alan Modra <amodra@gmail.com>
1695
1696 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1697 comparison warning.
1698 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1699 uninitialized" warning.
1700
32e2b61d
AM
17012013-03-20 Alan Modra <amodra@gmail.com>
1702
1703 * symtab.h (Symbol::clear_version): New function.
1704 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1705 is_needed by weak references. Clear version for symbols defined
1706 in as-needed objects that are not needed.
1707
b3ccdeb5
AM
17082013-03-15 Alan Modra <amodra@gmail.com>
1709
1710 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1711 static and public. Add report_err param. Return false for data refs.
1712 (Target_powerpc::rela_dyn_section): New overloaded function.
1713 (Target_powerpc::plt_, iplt_): Elucidate.
1714 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1715 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1716 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1717 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1718 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1719 push_branch and make_plt_entry for ifunc syms when
1720 reloc_needs_plt_for_ifunc.
1721 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1722 for ifunc unless reloc_needs_plt_for_ifunc.
1723
ad3d8a2f
AM
17242013-03-15 Alan Modra <amodra@gmail.com>
1725
1726 * gc.h (gc_process_relocs): Don't look through function descriptors.
1727 * icf.cc (get_section_contents): Do so here instead.
1728
4d9aa155
AM
17292013-03-13 Alan Modra <amodra@gmail.com>
1730
1731 * powerpc.cc (is_branch_reloc): Forward declare.
1732 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1733 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1734 false for 64-bit, true for 32-bit non-branch relocs.
1735 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1736 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1737 nm output.
1738 (icf_safe_test): Generate linker map file as well as nm output.
1739 (icf_safe_so_test): Likewise.
1740 * testsuite/Makefile.in: Regenerate.
1741 * testsuite/icf_test.sh: Parse linker map file to determine
1742 section folding.
1743 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1744 * testsuite/icf_safe_so_test.sh: Likewise.
1745 (X86_32_or_ARM_specific_safe_fold): Merge into..
1746 (arch_specific_safe_fold): ..this.
1747 (X86_64_specific_safe_fold): Delete unused function.
1748
57420c20
AM
17492013-03-12 Alan Modra <amodra@gmail.com>
1750
1751 * gc.h (gc_process_relocs): Look through function descriptors
1752 to determine shndx, symvalue and addend used by ICF. Tidy
1753 variable duplication.
1754
dc3714f3
AM
17552013-03-11 Alan Modra <amodra@gmail.com>
1756
1757 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1758 * layout.cc (Layout_task_runner::run): ..to here.
1759 * symtab.h (struct Symbol_location): Extract from..
1760 (class Symbol_table): ..here.
1761 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1762 * target.h (class Target): Add function_location and
1763 do_function_location functions.
1764 (class Sized_target): Add do_function_location.
1765 * object.h (class Sized_relobj_file): Move find_shdr..
1766 (class Object): ..to here.
1767 * object.cc: Likewise. Update to suit. Instantiate.
1768 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1769 * powerpc.cc (class Powerpc_dynobj): New.
1770 (Target_powerpc::do_function_location): New function.
1771 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1772 (Powerpc_dynobj::do_read_symbols): New function.
1773 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1774
956b03bb
ILT
17752013-03-08 Ian Lance Taylor <iant@google.com>
1776
1777 * options.cc (General_options::string_to_object_format): Accept
1778 "default".
1779
4bead2d5
AM
17802013-03-08 Alan Modra <amodra@gmail.com>
1781
1782 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1783 pointer to Post_fde.
1784 (struct Post_fde): Move definition to here..
1785 * ehframe.cc (struct Post_fde): ..from here.
1786 (Cie::write): Don't alloc Post_fde.
1787 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1788
02e60bf7
AM
17892013-03-07 Alan Modra <amodra@gmail.com>
1790
1791 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1792 relocation referencing .LC0.
1793 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1794
8343f03a
AM
17952013-03-07 Alan Modra <amodra@gmail.com>
1796
1797 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1798 always_inline. Add assembly for powerpc to avoid GOT.
1799
3366d57c
AM
18002013-03-07 Alan Modra <amodra@gmail.com>
1801
1802 * testsuite/script_test_10.sh: Don't test .bss section
1803 header number.
1804
6c77229c
AM
18052013-03-06 Alan Modra <amodra@gmail.com>
1806
1807 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1808 (Target_powerpc::symval_for_branch): Add symtab param. Update
1809 all callers. Handle folded sections.
1810 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1811 to Powerpc_relobj.
1812 (Global_symbol_visitor_opd::operator()): Likewise.
1813
a39e4af6
AM
18142013-03-04 Alan Modra <amodra@gmail.com>
1815
1816 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1817 * testsuite/Makefile.in: Regenerate.
1818
d5834edb
CC
18192013-03-01 Cary Coutant <ccoutant@google.com>
1820
1821 Add dwp support for v2 DWARF package file format.
1822 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1823 tu_length parameter. Adjust all callers.
1824 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1825 * dwp.cc: Include dwarf.h.
1826 (Section_bounds): New struct type.
1827 (Unit_set): New struct type.
1828 (Dwo_file::Dwo_file): Initialize new data member.
1829 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1830 Combine and rename to...
1831 (Dwo_file::read_unit_index): ...this.
1832 (Dwo_file::sized_read_compunit_index)
1833 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1834 (Dwo_file::sized_read_unit_index): ...this.
1835 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1836 parameters; add section_id parameter.
1837 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1838 (Dwo_file::add_unit_set): ...this.
1839 (Dwo_file::shndx_map_): Remove.
1840 (Dwo_file::sect_offsets_): New data member.
1841 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1842 (Dwp_output_file::add_section): Rename to...
1843 (Dwp_output_file::add_contribution): ...this.
1844 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1845 (Dwp_output_file::add_tu_set): Likewise.
1846 (Dwp_output_file::Contribution): New type.
1847 (Dwp_output_file::Section::contributions): New data member.
1848 (Dwp_output_file::Cu_or_tu_set): Remove.
1849 (Dwp_output_file::Section::Section): New ctor.
1850 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1851 (Dwp_output_file::Dwp_index::Section_table): New type.
1852 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1853 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1854 parameter.
1855 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1856 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1857 (Dwp_output_file::Dwp_index::section_table): New member function.
1858 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1859 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1860 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1861 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1862 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1863 (Dwp_output_file::Dwp_index::section_table_): New data member.
1864 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1865 (Dwp_output_file::add_output_section): New member function.
1866 (Dwp_output_file::write_new_section): New member function.
1867 (Dwp_output_file::write_contributions): New member function.
1868 (Dwp_output_file::section_id_map_): New data member.
1869 (class Dwo_id_info_reader): Remove.
1870 (class Unit_reader): New class.
1871 (get_dwarf_section_name): New function.
1872 (Dwo_file::read_executable): Adjust initializations of class data.
1873 (Dwo_file::read): Add support for v2 package file format.
1874 (Dwo_file::read_unit_index): Likewise.
1875 (Dwo_file::sized_read_unit_index): Likewise.
1876 (Dwo_file::copy_section): Likewise.
1877 (Dwo_file::add_unit_set): Likewise.
1878 (Dwp_output_file::add_output_section): Likewise.
1879 (Dwp_output_file::add_contribution): Likewise.
1880 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1881 for empty slot.
1882 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1883 file format.
1884 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1885 slot.
1886 (Dwp_output_file::initialize): Remove unused function.
1887 (Dwp_output_file::finalize): Add support for v2 package file format.
1888 (Dwp_output_file::write_index): Likewise.
1889 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1890 function prototype.
1891
a68a081d
CC
18922013-03-01 Cary Coutant <ccoutant@google.com>
1893
1894 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1895 function into class definition in header file.
1896 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1897 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1898 New function.
1899 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1900
9d5781f8
AM
19012013-02-28 Alan Modra <amodra@gmail.com>
1902
1903 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1904 * target.cc (Target::do_plt_fde_location): New function.
1905 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1906 accessor function, and constructor param.
1907 (struct Post_fde, Post_fdes): Declare.
1908 (Cie::write): Add post_fdes param.
1909 * ehframe.cc (Fde::write): Use plt_fde_location.
1910 (struct Post_fde): Define.
1911 (Cie::write): Stash FDEs added post merge mapping.
1912 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1913 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1914 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1915 other FDEs.
1916 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1917 (Target_powerpc::has_glink): New function.
1918 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1919 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1920 glink_eh_frame_fde_32, default_fde): New data.
1921 (Stub_table::eh_frame_added_): New var.
1922 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1923 Make const.
1924 (Stub_table::add_eh_frame): New function.
1925 (Output_data_glink::add_eh_frame): New function.
1926 (Target_powerpc::make_glink_section): Call add_eh_frame.
1927
214383dd
ILT
19282013-02-15 Ian Lance Taylor <iant@google.com>
1929
1930 * options.h (DEFINE_uint64_alias): Define.
1931 (class General_options): Add -Ttext-segment as an alias for
1932 -Ttext.
1933
91c2b899
AM
19342013-02-15 Alan Modra <amodra@gmail.com>
1935
1936 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1937 (Stub_table::do_write): ..here, two places.
1938 (Stub_table::plt_call_size): Use it here too.
1939
20e2a8aa
ILT
19402013-02-11 Ian Lance Taylor <iant@google.com>
1941
1942 * descriptors.cc (Descriptors::close_all): New function.
1943 * descriptors.h (class Descriptors): Declare close_all.
1944 (close_all_descriptors): New inline function.
1945 * plugin.cc: Include "descriptors.h".
1946 (Plugin_manager::cleanup): Call close_all_descriptors.
1947
8952bc69
AM
19482013-02-06 Alan Modra <amodra@gmail.com>
1949
1950 * README: Update coding style link.
1951
29bd8b6b
CC
19522013-01-28 Cary Coutant <ccoutant@google.com>
1953
a4034750
AM
1954 * dwp.cc (File_list): New typedef.
1955 (Dwo_name_info_reader): New class.
1956 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1957 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1958 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1959 (Dwo_file::read_executable): New function.
1960 (Dwo_file::read): Move common setup code to ...
1961 (Dwo_file::make_object): ... here.
1962 (dwp_options): Add --exec/-e.
1963 (usage): Likewise.
1964 (main): Likewise.
29bd8b6b 1965
c6ac678d
ST
19662013-01-24 Sriraman Tallam <tmsriram@google.com>
1967
1968 * layout.cc (Layout::layout): Check for option text_reorder.
1969 (Layout::make_output_section): Ditto.
1970 * options.h (text_reorder): New option.
1971 * output.cc (Input_section_sort_compare): Remove special ordering
1972 of section names.
1973 (Output_section::
1974 Input_section_sort_section_name_special_ordering_compare::
1975 operator()): New function.
1976 (Output_section::sort_attached_input_sections): Use new sort function
1977 for .text.
1978 * output.h (Input_section_sort_section_name_special_ordering_compare):
1979 New struct.
1980 * testsuite/Makefile.am (text_section_grouping): Test option
1981 --no-text-reorder
1982 * testsuite/Makefile.in: Regenerate.
1983 * testsuite/text_section_grouping.sh: Check order of functions without
1984 default text reordering.
1985
50701cc1
MF
19862013-01-18 Mike Frysinger <vapier@gentoo.org>
1987
1988 * options.h (General_options): Change default to true for new_dtags.
1989
b1b00fcc
MF
19902013-01-18 Mike Frysinger <vapier@gentoo.org>
1991
1992 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1993 when enable_new_dtags is false. Only add DT_RUNPATH when
1994 enable_new_dtags is true.
1995
ec5b8187
AM
19962013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1997
1998 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1999 used in declaration and definition consistent.
2000 (Target_powerpc::symval_for_branch): Ditto.
2001
a880d4c4
ST
20022013-01-16 Sriraman Tallam <tmsriram@google.com>
2003
2004 * testsuite/plugin_final_layout.cc: Fix comment.
2005
7c381248
ST
20062013-01-16 Sriraman Tallam <tmsriram@google.com>
2007
2008 * layout.cc (Layout::layout): Do not do default sorting for
2009 text sections when section ordering is specified.
2010 (make_output_section): Ditto.
2011 * testsuite/plugin_final_layout.cc: Name the function sections
2012 to catch reordering issues.
2013
e2458743
AM
20142013-01-15 Alan Modra <amodra@gmail.com>
2015
2016 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2017 plt-thread-safe.
2018
431ed302
AM
20192013-01-15 Alan Modra <amodra@gmail.com>
2020
2021 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2022 * testsuite/Makefile.in: Regenerate.
2023
0ec6429b
AM
20242013-01-14 Alan Modra <amodra@gmail.com>
2025
2026 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2027 * testsuite/Makefile.in: Regenerate.
2028
0bf402d5
ILT
20292013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2030
36af3926 2031 PR bfd/14430
0bf402d5
ILT
2032 Fix mingw gold build with plugins enabled
2033 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2034 * configure.ac: Export DLOPEN_LIBS and add headers check.
2035 * plugin.cc: Handle non-dlfcn case.
2036 * Makefile.in: Regenerate.
2037 * config.in: Regenerate.
2038 * configure: Regenerate.
2039 * testsuite/Makefile.in: Regenerate.
2040
9e9143bc
ST
20412013-01-09 Sriraman Tallam <tmsriram@google.com>
2042
2043 * output.h (sort_attached_input_sections): Change to be public.
2044 * script-sections.cc
2045 (Output_section_definition::set_section_addresses): Sort
2046 attached input sections according to section order before linker
2047 script assigns section addresses.
2048 (Orphan_output_section::set_section_addresses): Sort
2049 attached input sections according to section order before linker
2050 script assigns section addresses.
2051 * Makefile.am (final_layout.sh): Use a simple linker script to
2052 check if section ordering still works.
2053 * Makefile.in: Regenerate.
2054
679af368
ILT
20552013-01-09 Ben Cheng <bccheng@google.com>
2056
2057 * arm.cc (Target_arm::attributes_accept_div): New function.
2058 (Target_arm::attributes_forbid_div): New function.
2059 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2060 attribute using the same new functions as what bfd/elf32_arm.c
2061 does.
2062
3136a00e
CC
20632013-01-07 Cary Coutant <ccoutant@google.com>
2064
2065 PR gold/14993
2066 * output.cc (Output_section::add_input_section): For incremental
2067 updates, don't track input sections that are allocated from patch
2068 space.
2069
f2a6224b
L
20702013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2071 Ian Lance Taylor <iant@google.com>
2072
2073 PR gold/14897
2074 * configure.ac (--enable-ld): Removed.
2075 (install_as_default): Set to yes only for --enable-gold=default
2076 or --disable-ld.
2077 * configure: Regenerated.
2078
4f46f626
L
20792013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2080
2081 * options.h (General_options): Add -fuse-ld= for GCC linker
2082 option compatibility.
2083
26e4ef59
CC
20842013-01-04 Cary Coutant <ccoutant@google.com>
2085
2086 * configure.ac: Fix typo restoring CXXFLAGS.
2087 * configure: Regenerate.
2088
3d587466
CC
20892013-01-04 Cary Coutant <ccoutant@google.com>
2090
4f46f626
L
2091 * testsuite/Makefile.am (CXXLINK_S): New macro.
2092 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2093 * testsuite/Makefile.in: Regenerate.
3d587466 2094
44db6695
L
20952013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2096
2097 * version.cc (print_version): Update copyright year to 2013.
2098
edcac0c1
ILT
20992012-12-20 Ian Lance Taylor <iant@google.com>
2100
2101 * layout.cc (Layout::special_ordering_of_input_section): New
2102 function.
2103 (Layout::layout): If input section requires special ordering, must
2104 sort input sections.
2105 (Layout::make_output_section): May sort .text input sections.
2106 (Layout::is_section_name_prefix_grouped): Remove.
2107 * layout.h (class Layout): Declare
2108 special_ordering_of_input_section. Don't declare
2109 is_section_name_prefix_grouped.
2110 * output.cc (Output_section::add_input_section): Revert last
2111 change.
2112 (Output_section::Input_section_sort::match_file_name): Don't crash
2113 if called on output section data.
2114 (Output_section::Input_section_sort_compare): Sort based on
2115 special ordering.
2116 (Output_section::Input_section_sort_section_order_index_compare):
2117 Revert last patch.
2118 (Output_section::sort_attached_input_sections): Likewise.
2119
28f2a4ac
ST
21202012-12-18 Sriraman Tallam <tmsriram@google.com>
2121
edcac0c1 2122 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2123 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2124 * output.cc (Output_section::add_input_section): Check if section
2125 name contains special prefix. Keep input sections to sort such
2126 sections.
2127 (Output_section::Input_section_sort_section_order_index_compare
2128 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2129 (Output_section::sort_attached_input_sections): Add condition to
2130 Input_section_entry constructor call.
28f2a4ac
ST
2131 * testsuite/Makefile.am (text_section_grouping): New test.
2132 * testsuite/Makefile.in: Regenerate.
2133 * testsuite/text_section_grouping.cc: New file.
2134 * testsuite/text_section_grouping.sh: New file.
2135
5bf135a7
NC
21362012-12-17 Nick Clifton <nickc@redhat.com>
2137
2138 * Makefile.am: Add copyright notice.
2139 * NEWS: Likewise.
2140 * README: Likewise.
2141 * configure.ac: Likewise.
2142 * ftruncate.c: Likewise.
2143 * Makefile.in: Regenerate.
2144
59965708
CC
21452012-12-14 Cary Coutant <ccoutant@google.com>
2146
a4034750
AM
2147 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2148 --no-as-needed flag.
2149 (exception_separate_shared_12_test): Likewise.
2150 (incremental_copy_test): Likewise.
2151 * testsuite/Makefile.in: Regenerate.
59965708 2152
2a77e2ab
CC
21532012-12-14 Cary Coutant <ccoutant@google.com>
2154
2155 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2156 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2157
e3deeb9c
AM
21582012-12-12 Alan Modra <amodra@gmail.com>
2159
2160 * powerpc.cc (class Track_tls): New.
2161 (class Relocate, class Scan): Inherit Track_tls.
2162 (Target_powerpc::Scan::local, global): Track tls optimization
2163 and avoid creating plt entry for __tls_get_addr if all uses
2164 are optimized away.
2165 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2166
d8f5a274
AM
21672012-12-12 Alan Modra <amodra@gmail.com>
2168
2169 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2170 Replace no_toc_optimize with toc_optimize.
2171 * output.h (Output_section::input_sections): Provide non-const variant.
2172 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2173 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2174 accessors.
2175 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2176 (class Sort_toc_sections): New.
2177 (Target_powerpc::do_finalize_sections): Sort toc sections.
2178 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2179
4c8a1de1
RM
21802012-12-10 Roland McGrath <mcgrathr@google.com>
2181
2182 * testsuite/binary_unittest.cc (read_all): New function.
2183 (Sized_binary_test): Use it instead of ::read.
2184 * fileread.cc (do_read): Don't assume pread always reads the whole
2185 amount in a single call.
2186
edc27beb
AM
21872012-12-10 Alan Modra <amodra@gmail.com>
2188
2189 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2190 Set EM_PPC64 or EM_PPC here.
2191 (Target_selector_powerpc::do_recognize): Delete.
2192
906b9150
AM
21932012-12-10 Alan Modra <amodra@gmail.com>
2194
2195 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2196 stub_table_.
2197 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2198
418c15ae
RM
21992012-12-07 Roland McGrath <mcgrathr@google.com>
2200
2201 * testsuite/binary_unittest.cc (Sized_binary_test):
2202 Use open_descriptor rather than ::open.
2203
decdd3bc
AM
22042012-12-07 Alan Modra <amodra@gmail.com>
2205
2206 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2207 typedef and invalid_address constant.
2208 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2209 instantiate constants.
2210
db399005
ILT
22112012-12-06 Roland McGrath <mcgrathr@google.com>
2212
2213 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2214 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2215 * aclocal.m4: Regenerate.
2216 * configure: Regenerate.
2217 * Makefile.in: Regenerate.
2218 * testsuite/Makefile.in: Regenerate.
2219
aba6bc71
AM
22202012-12-07 Alan Modra <amodra@gmail.com>
2221
2222 * options.h (General_options): Add no_toc_optimize.
2223 * powerpc.cc (ok_lo_toc_insn): New function.
2224 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2225
9e69ed50
AM
22262012-12-06 Alan Modra <amodra@gmail.com>
2227
2228 * options.h (General_options): Add plt_align, plt_static_chain,
2229 plt_thread_safe. Update stub_group_size help text.
2230 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2231 for new plt_thread_safe_ var.
2232 (use_plt_offset): Correct comments.
2233 (Target_powerpc::do_relax): Look for thread creation symbols to
2234 determine default plt_thread_safe value. Clear plt call stubs
2235 as well as branch stubs each iteration.
2236 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2237 insn constants.
2238 (l, hi, ha, write_insn): Move earlier.
2239 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2240 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2241 plt stubs too.
2242 (Stub_table::update_size): Adjust.
2243 (Stub_table::prev_size, set_prev_size): Delete.
2244 (Stub_table::stub_align): Let --plt-align affect result.
2245 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2246 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2247 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2248 (Stub_table::do_write): Support more stub variants.
2249
f43ba157
AM
22502012-12-04 Alan Modra <amodra@gmail.com>
2251
2252 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2253 (Target_powerpc::do_define_standard_symbols): New function.
2254
34171bc5
AM
22552012-12-03 Alan Modra <amodra@gmail.com>
2256
2257 * output.h: Formatting, whitespace.
2258
dc9589e9 22592012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2260
2261 * layout.h (Layout::get_executable_sections): Declare.
2262 * layout.cc (Layout::get_executable_sections): New function.
2263 * arm.cc (Target_arm::group_sections): Use it.
2264 (Arm_output_section::group_sections): Delete now redundant test.
2265 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2266 param to handle relative relocs.
2267 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2268 (Output_data_reloc::add_absolute): Adjust.
2269 (Output_data_reloc::add_relative): New function.
2270 (Output_data::reset_data_size): New function.
2271 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2272 (Output_section::set_addralign): New function.
2273 (Output_section::checkpoint_set_addralign): New function.
2274 (Output_section::clear_section_offsets_need_adjustment): New function.
2275 (Output_section::input_sections): Make public.
2276 * powerpc.cc (class Output_data_brlt_powerpc): New.
2277 (class Stub_table, class Stub_control): New.
2278 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2279 stub_table_, set_stub_table, stub_table): New vectors and accessor
2280 functions.
2281 (Target_powerpc::do_may_relax, do_relax, push_branch,
2282 new_stub_table, stub_tables, brlt_section, group_sections,
2283 add_branch_lookup_table, find_branch_lookup_table,
2284 write_branch_lookup_table, make_brlt_section): New functions.
2285 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2286 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2287 branch_info_): New vars.
2288 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2289 make call stubs here.
2290 (Output_data_glink): Remove all call stub handling from this class.
2291 (Target_powerpc::Scan::local, global): Save interesting branch
2292 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2293 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2294 functions on final link.
2295 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2296 Handle long branch destinations too.
2297 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2298 do_plt_address_for_local): Adjust lookup of plt call stubs.
2299
627b30b7
AM
23002012-11-30 Alan Modra <amodra@gmail.com>
2301
2302 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2303 relocs against protected symbols when building 32-bit shared libs.
2304
40b469d7
AM
23052012-11-30 Alan Modra <amodra@gmail.com>
2306
2307 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2308 param. Call got_section() to make .got. Update all callers
2309 and their callers and so on.
2310
bb66a627
AM
23112012-11-30 Alan Modra <amodra@gmail.com>
2312
2313 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2314 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2315 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2316 value if it already exists.
2317
d2cf1c6c
L
23182012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2319
2320 PR gold/14858
2321 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2322
edccdf7c
RM
23232012-11-14 Roland McGrath <mcgrathr@google.com>
2324
2325 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2326 than bfc instruction for data sandboxing.
2327
6febeb74
AM
23282012-11-08 Alan Modra <amodra@gmail.com>
2329
2330 * po/POTFILES.in: Regenerate.
2331
0a6f1bf2
AM
23322012-11-05 Alan Modra <amodra@gmail.com>
2333
2334 * configure.ac: Apply 2012-09-10 change to config.in here.
2335 * configure: Regenerate.
2336
26a4e9cb
AM
23372012-11-05 Alan Modra <amodra@gmail.com>
2338
2339 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2340 (struct Opd_ent): Use "Address" rather than "Offset".
2341 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2342 (Target_powerpc::got_section): Make public.
2343 (Target_powerpc::scan_relocs): Move code setting symbols..
2344 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2345 Create _SDA_BASE_ only when referenced.
2346
cc928013
RM
23472012-11-02 Roland McGrath <mcgrathr@google.com>
2348
2349 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2350 from last change.
2351
50ed5eb1
RM
23522012-11-01 Roland McGrath <mcgrathr@google.com>
2353
62fe925a
RM
2354 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2355 for offset_in_output_section parameter.
2356 (Sized_target::relocate_special_relocatable): Likewise.
2357 * arm.cc (Target_arm::relocate_relocs): Likewise.
2358 (Target_arm::relocate_special_relocatable): Likewise.
2359 * i386.cc (Target_i386::relocate_relocs): Likewise.
2360 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2361 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2362 * target-reloc.h (relocate_relocs): Likewise.
2363 * testsuite/testfile.cc (Target_test): Likewise.
2364 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2365 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2366
2367 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2368 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2369
2370 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2371 parameter, which is unused in the [!F_SETFD] case.
2372
50ed5eb1
RM
2373 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2374 SYMNDX to off_t before comparing it to this->data_size().
2375 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2376 * incremental.cc (Output_section_incremental_inputs::do_write):
2377 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2378
2cadc0bf
RM
2379 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2380
3bfcb652
NC
23812012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2382
2383 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2384 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2385 in EABI_VER5.
2386
c1a8d56e
CC
23872012-10-29 Cary Coutant <ccoutant@google.com>
2388
2389 * dwp.cc (usage): Add file and exit status parameters;
2390 add --help and --version options.
2391 (print_version): New function.
2392 (main): Add --help and --version options.
2393
b2490a7b
L
23942012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2395
2396 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2397 final_layout_sequence.txt.
2398 * testsuite/Makefile.in: Regenerated.
2399
aa543512
L
24002012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2401
2402 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2403 COMPILE generated by automake.
2404 (LINK1): Likewise.
2405 (CXXCOMPILE1): Likewise.
2406 (CXXLINK1): Likewise.
2407 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2408 (LINK): Likewise.
2409 (CXXCOMPILE): Likewise.
2410 (CXXLINK): Likewise.
2411 * testsuite/Makefile.in: Regenerated.
2412
d361fafb
L
24132012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2414
2415 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2416 on bad fwrite return.
2417
598c7410
L
24182012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2419
2420 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2421 on val.
2422
35c813e2
CC
24232012-10-23 Cary Coutant <ccoutant@google.com>
2424
2425 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2426 * testsuite/Makefile.in: Regenerate.
2427 * testsuite/dwp_test.h: New source file.
2428 * testsuite/dwp_test_1.cc: New source file.
2429 * testsuite/dwp_test_1.s: New source file.
2430 * testsuite/dwp_test_1.sh: New source file.
2431 * testsuite/dwp_test_1b.cc: New source file.
2432 * testsuite/dwp_test_1b.s: New source file.
2433 * testsuite/dwp_test_2.cc: New source file.
2434 * testsuite/dwp_test_2.s: New source file.
2435 * testsuite/dwp_test_2.sh: New source file.
2436 * testsuite/dwp_test_main.cc: New source file.
2437 * testsuite/dwp_test_main.s: New source file.
2438
77429909
CC
24392012-10-23 Cary Coutant <ccoutant@google.com>
2440
2441 * dwp.h: New header file.
2442 * dwp.cc: New source file.
2443 * gold.h: Move shared declarations to system.h.
2444 * system.h: New header file.
2445 * Makefile.am: Add dwp.
2446 * Makefile.in: Regenerate.
2447
ed5d6712
CC
24482012-10-23 Cary Coutant <ccoutant@google.com>
2449
2450 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2451 Dwarf_info_reader::read_from_pointer.
2452 (Dwarf_pubnames_table::read_header): Likewise.
2453 (Dwarf_pubnames_table::next_name): Likewise.
2454 (Dwarf_die::read_attributes): Likewise.
2455 (Dwarf_die::skip_attributes): Likewise.
2456 (Dwarf_info_reader::read_from_pointer): New function template.
2457 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2458 (Dwarf_pubnames_table): Likewise.
2459 (Dwarf_info_reader::read_from_pointer): New function template.
2460 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2461 Dwarf_pubnames_table ctor.
2462
8787852d
CC
24632012-10-23 Cary Coutant <ccoutant@google.com>
2464
2465 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2466 abbrev_shndx.
2467 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2468 abbrev_shndx_.
2469 (Dwarf_info_reader::set_abbrev_shndx): New method.
2470 (Dwarf_info_reader::abbrev_shndx_): New data member.
2471
9fc236f3
CC
24722012-10-23 Cary Coutant <ccoutant@google.com>
2473
2474 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2475 from object, not parameters.
2476 (Dwarf_info_reader::parse): Likewise.
2477 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2478 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2479 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2480 methods.
2481
effe8365
CC
24822012-10-23 Cary Coutant <ccoutant@google.com>
2483
2484 * fileread.cc (Input_file::Input_file): New constructor.
2485 * fileread.h (class Input_file): Add new constructor.
2486
1698990d
AM
24872012-10-18 Alan Modra <amodra@gmail.com>
2488
2489 PR gold/14727
2490 * object.cc (Relobj::is_section_name_included): Also match
2491 .sdata personality section.
2492
168a4726
AM
24932012-10-18 Alan Modra <amodra@gmail.com>
2494
2495 * target-reloc.h (class Default_comdat_behavior): New, package up..
2496 (get_comdat_behaviour): ..this.
2497 (relocate_section): Add Relocate_comdat_behavior template arg,
2498 adjust code to suit.
2499 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2500 (Target_arm::scan_reloc_section): Likewise.
2501 * i386.cc (Target_i386::relocate_section): Likewise.
2502 * sparc.cc (Target_sparc::relocate_section): Likewise.
2503 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2504 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2505 * powerpc.cc (class Relocate_comdat_behavior): New.
2506 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2507 gold::relocate_section with new template arg.
2508
acc276d8
AM
25092012-10-18 Alan Modra <amodra@gmail.com>
2510
2511 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2512 dynamic relocs for GOT_TPREL got entries, without symbol if
2513 resolving locally.
2514 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2515 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2516 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2517
e10f9870
AM
25182012-10-17 Alan Modra <amodra@gmail.com>
2519
2520 PR gold/14726
2521 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2522
ae034989
ST
25232012-10-16 Sriraman Tallam <tmsriram@google.com>
2524
2525 * layout.cc (Layout::include_section): Keep sections marked
2526 SHF_EXCLUDE when doing relocatable links.
2527
f3a0ed29
AM
25282012-10-16 Alan Modra <amodra@gmail.com>
2529
2530 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2531 (Target_powerpc::do_finalize_sections): Call it.
2532 (Output_data_save_res): New class and supporting functions.
2533 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2534 normal symbols defined in object files.
2535
c6de8ed4
AM
25362012-10-12 Alan Modra <amodra@gmail.com>
2537
2538 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2539 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2540 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2541 section if scan_opd_relocs not yet called.
2542 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2543
03e25981
AM
25442012-10-12 Alan Modra <amodra@gmail.com>
2545
2546 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2547 add_local_ifunc_entry): Revert last change.
2548 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2549
c9824451
AM
25502012-10-05 Alan Modra <amodra@gmail.com>
2551
2552 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2553 do_plt_address_for_global): New functions.
2554 (Output_data_got_powerpc::do_write): Don't segfault when linking
2555 statically.
2556 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2557 add_local_ifunc_entry): Return true on adding entry..
2558 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2559 glink->add_entry call. Remove unused symtab param. Adjust calls.
2560 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2561 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2562 set up symbols here.
2563 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2564 syms here. Do so even when no .iplt. Don't segfault when linking
2565 statically.
2566 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2567 new variants without reloc param.
2568 (Glink_sym_ent::Glink_sym_ent): Likewise.
2569 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2570 reloc when refs will resolve to plt call stub.
2571 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2572 R_PPC_PLTREL24 to resolve locally.
2573 (Target_powerpc::Scan::global): Correct ifunc handling.
2574 (Target_powerpc::Relocate::relocate): Correct local sym glink
2575 lookup. Don't destroy "value" when we have a plt call stub,
2576 and when checking plt call validity.
2577 (Target_powerpc::do_dynsym_value): Simplify.
2578
19fec8c1
AM
25792012-10-05 Alan Modra <amodra@gmail.com>
2580
2581 * i386.cc (Output_data_plt_i386::address_for_global,
2582 address_for_local): Add plt offset to returned value. Adjust uses.
2583 * sparc.cc (Output_data_plt_sparc::address_for_global,
2584 address_for_local): Likewise.
2585 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2586 address_for_local): Likewise.
2587 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2588 address_for_local): Likewise.
2589 * target.h (Target::plt_address_for_global, plt_address_for_local):
2590 Update comment.
2591 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2592 (Output_data_got::Got_entry::write): Nor here.
2593 * output.h: Comment fix.
2594
e867b647
WL
25952012-10-02 Jiong Wang <jiwang@tilera.com>
2596
2597 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2598 global_offset_table_ value for larget got.
2599 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2600
e5d5f5ed
AM
26012012-09-29 Alan Modra <amodra@gmail.com>
2602
2603 * powerpc.cc (Target_powerpc::iplt_): New output section.
2604 (Target_powerpc::iplt_section, make_iplt_section,
2605 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2606 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2607 Target_powerpc::plt_entry_count): Count iplt entries too.
2608 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2609 reloc section in constructor. New params.
2610 (Target_powerpc::make_plt_section): Create reloc section here instead.
2611 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2612 functions.
2613 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2614 (Output_data_glink::add_entry, find_entry): New functions to
2615 deal with local syms.
2616 (Glink_sym_ent): Add support for local syms.
2617 (Output_data_glink::do_write): Handle ifunc plt entries.
2618 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2619 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2620 (Target_powerpc::Relocate::relocate): Likewise.
2621 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2622
ec4dbad3
AM
26232012-09-25 Alan Modra <amodra@gmail.com>
2624
2625 * object.h (Sized_relobj_file::adjust_local_symbol,
2626 do_adjust_local_symbol): New functions.
2627 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2628 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2629 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2630 and irregular opd entry spacing.
2631 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2632 (Global_symbol_visitor_opd): New functor.
2633 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2634 on deleted opd entries.
2635
5c0b3823
WL
26362012-09-15 Jiong Wang <jiwang@tilera.com>
2637
2638 * tilegx.cc: New file.
2639 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2640 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2641 * configure.tgt: Add entries for tilegx*.
2642 * configure.ac: Likewise.
2643 * Makefile.in: Rebuild.
2644 * configure: Likewise.
2645 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2646 tilegx.
2647
bfdfa4cd
AM
26482012-09-13 Alan Modra <amodra@gmail.com>
2649
2650 * target-reloc.h (scan_relocs): Call scan.local for relocs
2651 against symbols in discarded sections. Pass is_discarded
2652 param.
2653 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2654 Add is_discarded param.
2655 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2656 is_discarded to flag opd entry as discarded. Don't emit dyn
2657 relocs on such entries.
2658 (Target_powerpc::Scan::global): Similarly detect and handle
2659 such opd entries.
2660 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2661 opd_ent_. Update all uses.
2662 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2663 (Target_powerpc::relocate_section): Zero out discarded opd
2664 entry relocs.
2665
d77a0555
ILT
26662012-09-12 Ian Lance Taylor <iant@google.com>
2667
2668 PR gold/14570
2669 * output.cc: Rename Output_data_got template parameter from size
2670 to got_size for all functions. Compile all variants of
2671 Output_data_got.
2672 (Output_data_got::Got_entry::write): Correct use of size for
2673 symbol value. Use local_is_tls rather than casting to
2674 Sized_relobj_file.
2675 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2676 (class Sized_relobj_file): Add do_local_is_tls.
2677 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2678
815a1205
AM
26792012-09-11 Alan Modra <amodra@gmail.com>
2680
2681 PR gold/14566
2682 * layout.cc (Layout::set_segment_offsets): When using
2683 common-page-size alignment, ensure we are on a new max-page-size
2684 page.
2685 * output.cc (Output_segment::set_section_addresses): Use
2686 abi_pagesize, not common_pagesize for relro boundary.
2687 (Output_segment::set_offset): Likewise.
2688
bd73a62d
AM
26892012-09-11 Alan Modra <amodra@gmail.com>
2690
2691 * output.h (Output_data_got::add_global_tls, add_local_tls,
2692 add_local_tls_pair): New functions.
2693 (Output_data_got::add_local_pair_with_rel): Remove second
2694 reloc param. Expand comment.
2695 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2696 use_plt_or_tls_offset_, similarly for constructor param.
2697 (Output_data_got::Got_entry::write): Add got_index param.
2698 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2699 add_local_tls_pair): New functions.
2700 (Output_data_got::Got_entry::write): Handle tls symbols
2701 with use_plt_or_tls_offset_ set specially.
2702 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2703 (Output_data_got::do_write): Replace iterator with index, pass
2704 index to entry write function.
2705 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2706 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2707 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2708 call.
2709 * i386.cc (Target_i386::Scan::local): Likewise.
2710 * sparc.cc (Target_sparc::Scan::local): Likewise.
2711 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2712 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2713 do_tls_offset_for_global): New functions.
2714 (Target_powerpc::Scan::local): Correct TLS relocations and got
2715 entry values.
2716 (Target_powerpc::Scan::global): Don't emit unnecessary
2717 dynamic relocations on TLS GOT entries.
2718
00716ab1
AM
27192012-09-10 Matthias Klose <doko@ubuntu.com>
2720
2721 * config.in: Disable sanity check for kfreebsd.
2722
c891b3f9
SA
27232012-09-10 Sterling Augustine <saugustine@google.com>
2724
2725 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2726 (Gdb_index::pubtypes_read): New parameter.
2727 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2728 to calls.
2729 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2730 pubtypes_object_.
2731
e81fea4d
AM
27322012-09-09 Alan Modra <amodra@gmail.com>
2733
2734 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2735 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2736 * gc.h (gc_process_relocs): Call target gc_add_reference.
2737 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2738 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2739 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2740 unnecessary cast.
2741 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2742 to cater for when we don't need code offset. Update use.
2743 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2744 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2745 set_opd_valid): New functions.
2746 (Target_powerpc::do_gc_add_reference): New function.
2747 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2748 stashed refs.
2749 (Target_powerpc::do_gc_mark_symbol): New function.
2750
d2d60eef
CC
27512012-09-06 Cary Coutant <ccoutant@google.com>
2752
2753 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2754 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2755 (Dwarf_die::skip_attributes): Likewise.
2756 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2757 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2758 (main): Call it.
2759 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2760
32ed4573
L
27612012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2762
2763 * testsuite/script_test_3.t: Add .got.plt output section
2764 statement.
2765 * testsuite/script_test_4.t: Likewise.
2766
f4baf0d4
AM
27672012-09-05 Alan Modra <amodra@gmail.com>
2768
2769 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2770 update all uses and lose "enum" when using type.
2771
864a1b56
AM
27722012-09-05 Alan Modra <amodra@gmail.com>
2773
2774 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2775 * configure: Regenerate.
2776 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2777 (plugin_final_layout.stdout): Likewise.
2778 (memory_test): Set page sizes to 0x1000.
2779 * testsuite/Makefile.in: Regenerate.
2780 * testsuite/discard_locals_test.sh: Add FIXME comment.
2781 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2782 * testsuite/pr14265.t: Add .got output section statement.
2783 * testsuite/script_test_2.t: Likewise.
2784 * testsuite/script_test_3.t: Likewise.
2785 * testsuite/script_test_4.t: Likewise.
2786 * testsuite/script_test_5.t: Likewise.
2787 * testsuite/script_test_6.t: Likewise.
2788 * testsuite/script_test_7.t: Likewise.
2789 * testsuite/script_test_9.t: Likewise.
2790
3ea0a085
AM
27912012-09-05 Alan Modra <amodra@gmail.com>
2792
2793 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2794 (Powerpc_relocate_functions::Status): New typedef.
2795 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2796 (Target_powerpc::Scan::local): Handle REL64.
2797 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2798 for REL32 and REL64.
2799 (Target_powerpc::symval_for_branch): New function, extracted from..
2800 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2801 checks. Report overflow errors.
2802
7404fe1b
AM
28032012-09-05 Alan Modra <amodra@gmail.com>
2804
2805 * object.h (Sized_relobj_file::emit_relocs): Delete.
2806 (Sized_relobj_file::emit_relocs_reltype): Delete.
2807 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2808 relocate_relocs for --emit-relocs.
2809 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2810 * output.h: Update comment.
2811 (Output_segment::first_section): New function.
2812 (Output_segment::first_section_load_address): Use first_section.
2813 * output.cc (Output_segment::first_section): New function extracted..
2814 (Output_segment::first_section_load_address): ..from here. Delete.
2815 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2816 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2817 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2818 adjust call to target.h function.
2819 * i386.cc (Target_i386): Likewise.
2820 * sparc.cc (Target_sparc): Likewise.
2821 * x86_64.cc (Target_x86_64): Likewise.
2822 * powerpc.cc (Target_powerpc): Likewise.
2823 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2824 first tls section has section symbol for optimised local dynamic
2825 output relocs.
2826 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2827 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2828 optimised tls code.
2829 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2830 Rename to relocate_relocs. Update error message.
2831
957564c9
AS
28322012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2833
2834 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2835 --just-symbols.
2836
dd93cd0a
AM
28372012-08-31 Alan Modra <amodra@gmail.com>
2838
2839 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2840 (Powerpc_relobj::toc_base_offset): New stub function.
2841 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2842 got_mod_index_offset to tlsld_got_offset. Update all refs.
2843 (Target_powerpc::Relocate::enum skip_tls): New.
2844 (Target_powerpc::call_tls_get_addr_): New var.
2845 (Target_powerpc::is_branch_reloc): Move to file scope.
2846 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2847 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2848 New functions.
2849 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2850 (powerpc_info): Correct common_pagesize for ppc64.
2851 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2852 (Powerpc_relocate_functions): Add overflow check enums and functions.
2853 Add non-shift version of rela, rela_ua. Delete all rel public
2854 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2855 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2856 addr16_ha3, addr14 functions.
2857 (Output_data_got_powerpc::add_constant_pair): New function.
2858 (Output_data_got_powerpc::got_base_offset): Likewise.
2859 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2860 (instruction constants): Sort, add some more.
2861 (Output_data_glink::do_write): Add and use Address typedef. Use
2862 object->toc_base_offset() stub for 64-bit.
2863 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2864 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2865 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2866 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2867 Always treat .opd relocs as against locally defined symbol.
2868 Correct condition for RELATIVE relocs.
2869 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2870 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2871 for 32-bit syms with a plt entry. Correct ppc64 toc base
2872 calculations. Handle TLS relocs, and more. Add overflow
2873 checking and adjust for Powerpc_relocate_functions changes.
2874 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2875 Reinstate --emit-relocs code with FIXME.
2876
a1373b60
AM
28772012-08-30 Alan Modra <amodra@gmail.com>
2878
2879 * layout.cc (Layout::set_segment_offsets): Set p_align to
2880 abi_pagesize, not common_pagesize.
2881 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2882 to determine whether file header can go in segment.
2883
703d02da
AM
28842012-08-30 Alan Modra <amodra@gmail.com>
2885
2886 * output.h (Output_reloc::Output_reloc <output section>): Add
2887 is_relative param. Adjust calls.
2888 (Output_reloc::add_output_section_relative): New functions.
2889 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2890 is_relative.
2891 (Output_reloc::symbol_value): Handle SECTION_CODE.
2892
16164a6b
ST
28932012-08-24 Sriraman Tallam <tmsriram@google.com>
2894
2895 * gold.cc (queue_middle_tasks): Call layout again when unique
2896 segments for sections is desired.
2897 * layout.cc (Layout::Layout): Initialize new members.
2898 (Layout::get_output_section_flags): New function.
2899 (Layout::choose_output_section): Call get_output_section_flags.
2900 (Layout::layout): Make output section for mapping to a unique segment.
2901 (Layout::insert_section_segment_map): New function.
2902 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2903 output sections marked so.
16164a6b
ST
2904 (Layout::segment_precedes): Check for unique segments when sorting.
2905 * layout.h (Layout::Unique_segment_info): New struct.
2906 (Layout::Section_segment_map): New typedef.
2907 (Layout::insert_section_segment_map): New function.
2908 (Layout::get_output_section_flags): New function.
2909 (Layout::is_unique_segment_for_sections_specified): New function.
2910 (Layout::set_unique_segment_for_sections_specified): New function.
2911 (Layout::unique_segment_for_sections_specified_): New member.
2912 (Layout::section_segment_map_): New member.
2913 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2914 Rename is_gc_pass_one to is_pass_one.
2915 Rename is_gc_pass_two to is_pass_two.
2916 Rename is_gc_or_icf to is_two_pass.
2917 Check for which pass based on whether symbols data is present.
2918 Make it two pass when unique segments for sections is desired.
2919 * output.cc (Output_section::Output_section): Initialize new
2920 members.
2921 * output.h (Output_section::is_unique_segment): New function.
2922 (Output_section::set_is_unique_segment): New function.
2923 (Output_section::is_unique_segment_): New member.
2924 (Output_section::extra_segment_flags): New function.
2925 (Output_section::set_extra_segment_flags): New function.
2926 (Output_section::extra_segment_flags_): New member.
2927 (Output_section::segment_alignment): New function.
2928 (Output_section::set_segment_alignment): New function.
2929 (Output_section::segment_alignment_): New member.
2930 (Output_segment::Output_segment): Initialize is_unique_segment_.
2931 (Output_segment::is_unique_segment): New function.
2932 (Output_segment::set_is_unique_segment): New function.
2933 (Output_segment::is_unique_segment_): New member.
2934 * plugin.cc (allow_unique_segment_for_sections): New function.
2935 (unique_segment_for_sections): New function.
2936 (Plugin::load): Add new functions to transfer vector.
2937 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2938 * Makefile.in: Regenerate.
2939 * testsuite/plugin_final_layout.sh: Check if unique segment
2940 functionality works.
2941 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2942 are available.
2943 (allow_unique_segment_for_sections): New global.
2944 (unique_segment_for_sections): New global.
2945 (claim_file_hook): Call allow_unique_segment_for_sections.
2946 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2947
1e2bee4f
CC
29482012-08-22 Cary Coutant <ccoutant@google.com>
2949
2950 * layout.cc (Layout::include_section): Don't assert on GROUP
2951 sections with --emit-relocs.
2952
1d5dfe78
CC
29532012-08-21 Cary Coutant <ccoutant@google.com>
2954
2955 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2956 if --export-dynamic-symbol names an undef symbol.
2957
c9269dff
AM
29582012-08-18 Alan Modra <amodra@gmail.com>
2959
2960 * powerpc.cc: Formatting and white space.
2961 (Powerpc_relobj): Rename got2_section_ to special_.
2962 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2963 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2964 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2965 (Target_powerpc): Add Address typedef and invalid_address. Use
2966 throughout.
2967 (Target_powerpc::is_branch_reloc): New function.
2968 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2969 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2970 for dst_mask, value and addend.
2971 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2972 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2973 (Output_data_glink::do_write): Correct toc base. Don't try to use
2974 uint16_t for 24-bit offset. Use get_output_section_offset and
2975 check return.
2976 (Target_powerpc::Scan::local): Handle more relocs.
2977 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2978 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2979 Plug in toc restoring insn after plt calls. Translate branches
2980 to function descriptor symbols to corresponding entry point.
2981 (Target_powerpc::relocate_for_relocatable): Check return from
2982 get_output_section_offset.
2983 * symtab.h: Comment typo.
2984
b1759dce
ILT
29852012-08-14 Ian Lance Taylor <iant@google.com>
2986
2987 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2988 unsupported_relocal_local to call unsupported_reloc_global.
2989
b9b2ae8b
NC
29902012-08-14 Nick Clifton <nickc@redhat.com>
2991
2992 PR ld/14265
2993 * script-sections.cc (Sections_element::output_section_name): Add
2994 keep return parameter.
2995 (Output_section_element::match_name): Add keep return parameter.
2996 Return the value of the keep_ member.
2997 * script-sections.h (class Output_section): Update
2998 output_section_name prototype.
2999 * layout.cc (Layout::keep_input_section): New public member
3000 function.
3001 (Layout::choose_output_section): Pass keep parameter to
3002 output_section_name.
3003 * layout.h (class Layout): Add keep_input_section.
3004 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3005 sections.
3006 * testsuite/Makefile.am: Add a test.
3007 * testsuite/Makefile.in: Regenerate.
3008 * testsuite/pr14265.c: Source file for the test.
3009 * testsuite/pr14265.t: Linker script for the test.
3010 * testsuite/pr14265.sh: Shell script for the test.
3011
921b5322
AM
30122012-08-14 Alan Modra <amodra@gmail.com>
3013
3014 * target.h (Target::output_section_name): New function.
3015 (Target::do_output_section_name): New function.
3016 * layout.cc (Layout::choose_output_section): Call the above.
3017 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3018
6ce78956
AM
30192012-08-14 Alan Modra <amodra@gmail.com>
3020
3021 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3022 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3023 for replace_constant call.
3024 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3025 (Output_data_glink::do_print_to_mapfile): New function.
3026 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3027 (Target_powerpc::Relocate::relocate): Likewise.
3028
d1a8cabd
AM
30292012-08-14 Alan Modra <amodra@gmail.com>
3030
3031 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3032 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3033 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3034 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3035 all references to shndx_. Handle special case for R_PPC_PLTREL24
3036 here.
3037 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3038 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3039 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3040 here.
3041 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3042 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3043
d83ce4e3
AM
30442012-08-12 Alan Modra <amodra@gmail.com>
3045
3046 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3047 (glink insn constants): Use uint32_t.
3048 (Output_data_glink::add_entry): Use insert, not [] operator.
3049
cf43a2fe
AM
30502012-08-11 Alan Modra <amodra@gmail.com>
3051
3052 * object.h (Sized_relobj_file::find_shdr): New function.
3053 (Sized_relobj_file::find_special_sections): New function.
3054 * object.cc (Sized_relobj_file::find_shdr): New function.
3055 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3056 (Sized_relobj_file::find_special_sections): New function, split out..
3057 (Sized_relobj_file::do_read_symbols): ..from here.
3058 * output.h (Output_data_got::replace_constant): New function.
3059 (Output_data_got::num_entries): New function.
3060 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3061 (Output_data_got::got_offset): Protected rather than private.
3062 (Output_data_got::replace_got_entry): New function.
3063 * output.cc (Output_data_got::replace_got_entry): New function.
3064 * powerpc.cc (class Powerpc_relobj): New.
3065 (class Powerpc_relocate_functions): Delete all psymval variants or
3066 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3067 Implement _ha functions using corresponding _hi function.
3068 (Powerpc_relobj::find_special_sections): New function.
3069 (Target_powerpc::do_make_elf_object): New function.
3070 (class Output_data_got_powerpc): New.
3071 (class Output_data_glink): New.
3072 (class Powerpc_scan_relocatable_reloc): New.
3073 Many more changes througout file.
3074
3c892704
NC
30752012-08-09 Nick Clifton <nickc@redhat.com>
3076
3077 * po/vi.po: Updated Vietnamese translation.
3078
82435b3b
ILT
30792012-08-07 Ian Lance Taylor <iant@google.com>
3080
3081 * layout.cc (Layout::add_target_dynamic_tags): If
3082 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3083 plt_rel.
3084
a6dc81d2
NC
30852012-07-30 Nick Clifton <nickc@redhat.com>
3086
3087 * po/gold.pot: Updated template.
3088 * po/es.po: Updated Spanish translation.
3089
f1415016
CC
30902012-07-18 Cary Coutant <ccoutant@google.com>
3091
3092 PR gold/14344
3093 * configure.ac: Add check for -gpubnames support.
3094 * configure: Regenerate.
3095 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3096 support; force -gno-pubnames.
3097 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3098 support.
3099 (gdb_index_test_4): New test.
3100 * testsuite/Makefile.in: Regenerate.
3101 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3102 * testsuite/gdb_index_test_2.sh: Likewise.
3103 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3104 * testsuite/gdb_index_test_4.sh: New script.
3105 * testsuite/gdb_index_test_comm.sh: New script with common code;
3106 don't look for space after colon.
3107
b7fd7c37
ST
31082012-07-16 Sriraman Tallam <tmsriram@google.com>
3109
3110 * gold.cc (queue_middle_tasks): Update function order only after
3111 deferred objects due to plugins are processed.
3112
1f3212db
ILT
31132012-07-11 Ian Lance Taylor <iant@google.com>
3114
3115 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3116 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3117 (Target_arm::scan_reloc_for_stub): Likewise.
3118 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3119 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3120 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3121 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3122 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3123
81c82a68
ILT
31242012-07-10 Dodji Seketeli <dodji@redhat.com>
3125 Ian Lance Taylor <iant@google.com>
3126
3127 PR gold/14309
3128 * configure.ac: Test whether std::tr1::hash<off_t> works.
3129 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3130 needed.
3131 * output.h (class Output_fill): Add virtual destructor.
3132 * configure, config.in: Rebuild.
3133
eabc84f4
RM
31342012-06-22 Roland McGrath <mcgrathr@google.com>
3135
3136 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3137
370e30b6
RÁE
31382012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3139
3140 * plugin.cc (Plugin::load): Handle position independent executables.
3141
fb1b895d
CC
31422012-06-06 Cary Coutant <ccoutant@google.com>
3143
3144 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3145 add .debug_macro.
3146 (lines_only_debug_sections): Likewise.
3147 (gdb_fast_lookup_sections): New static array.
3148 (is_gdb_debug_section): Rename formal parameter.
3149 (is_lines_only_debug_section): Likewise.
3150 (is_gdb_fast_lookup_section): New function.
3151 (Layout::include_section): Check for ".zdebug_" prefix; pass
3152 section name suffix to is_gdb_debug_section, et al.; check for
3153 fast-lookup sections when building .gdb_index.
3154 * options.h (--strip-debug-gdb): Update GDB version number.
3155
7c0640fa
CC
31562012-06-06 Cary Coutant <ccoutant@google.com>
3157
3158 * configure.ac: Add check for fallocate.
3159 * configure: Regenerate.
3160 * config.in: Regenerate.
3161
3162 * options.h (class General_options): Add --mmap-output-file and
3163 --posix-fallocate options.
3164 * output.cc: (posix_fallocate): Remove; replace with...
3165 (gold_fallocate): New function.
3166 (Output_file::map_no_anonymous): Call gold_fallocate.
3167 (Output_file::map): Check --mmap-output-file option.
3168
2a49eb69
DK
31692012-06-05 Jing Yu <jingyu@google.com>
3170
3171 * gold.h (textdomain): Add do {} to empty while(0).
3172 (bindtextdomain): Likewise.
3173
fad072ac
CC
31742012-06-04 Cary Coutant <ccoutant@google.com>
3175
3176 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3177 has_dynsym_index.
3178
8cc69fb6
ST
31792012-05-25 Sriraman Tallam <tmsriram@google.com>
3180
3181 * symtab.cc (Symbol_table::define_special_symbol):
3182 Initialize *poldsym to prevent uninitialized variable errors.
3183
1be75daa
CC
31842012-05-23 Cary Coutant <ccoutant@google.com>
3185
3186 * layout.cc (Layout::section_name_mapping): Add rules to handle
3187 exact match on .data.rel.ro.local or .data.rel.ro.
3188 (Layout::output_section_name): Check for exact matches.
3189
9b689de0
CC
31902012-05-23 Cary Coutant <ccoutant@google.com>
3191
3192 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3193 more carefully.
3194
b24fdbf5
CC
31952012-05-22 Cary Coutant <ccoutant@google.com>
3196
3197 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3198 object before exporting symbol.
3199
e550e1a2
L
32002012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3201
3202 * testsuite/tls_test.cc: Include "config.h" first.
3203 * testsuite/tls_test_c.c: Likewise.
3204
df7b86aa
NC
32052012-05-17 Daniel Richard G. <skunk@iskunk.org>
3206 Nick Clifton <nickc@redhat.com>
3207
3208 PR 14072
3209 * configure.in: Add check that sysdep.h has been included before
3210 any system header files.
3211 * configure: Regenerate.
3212 * config.in: Regenerate.
3213
1007b503
CC
32142012-05-14 Cary Coutant <ccoutant@google.com>
3215
3216 * layout.cc (Layout::make_output_section): Mark .tdata section
3217 as RELRO.
3218 * testsuite/relro_test.cc: Add a TLS variable.
3219
fd885f3a
L
32202012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3221
3222 PR gold/14091
3223 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3224 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3225 R_X86_64_64.
3226
80f5885c
CC
32272012-05-08 Cary Coutant <ccoutant@google.com>
3228
3229 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3230 (lines_only_debug_sections): Likewise.
3231
2e702c99
RM
32322012-05-02 Roland McGrath <mcgrathr@google.com>
3233
3234 * nacl.cc: New file.
3235 * nacl.h: New file.
3236 * Makefile.am (CCFILES, HFILES): Add them.
3237 * Makefile.in: Regenerate.
3238 * i386.cc (Output_data_plt_i386_nacl): New class.
3239 (Output_data_plt_i386_nacl_exec): New class.
3240 (Output_data_plt_i386_nacl_dyn): New class.
3241 (Target_i386_nacl): New class.
3242 (Target_selector_i386_nacl): New class.
3243 (target_selector_i386): Use it instead of Target_selector_i386.
3244 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3245 (Target_x86_64_nacl): New class.
3246 (Target_selector_x86_64_nacl): New class.
3247 (target_selector_x86_64, target_selector_x32): Use it instead of
3248 Target_selector_x86_64.
3249 * arm.cc (Output_data_plt_arm_nacl): New class.
3250 (Target_arm_nacl): New class.
3251 (Target_selector_arm_nacl): New class.
3252 (target_selector_arm, target_selector_armbe): Use it instead of
3253 Target_selector_arm.
3254
3255 * target-select.cc (select_target): Take new Input_file* and off_t
3256 arguments, pass them on to recognize method of selector.
3257 * object.cc (make_elf_sized_object): Update caller.
3258 * parameters.cc (parameters_force_valid_target): Likewise.
3259 * incremental.cc (make_sized_incremental_binary): Likewise.
3260 * target-select.h: Update decl.
3261 (Target_selector::recognize): Take new Input_file* argument,
3262 pass it on to do_recognize.
3263 (Target_selector::do_recognize): Take new Input_file* argument.
3264 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3265 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3266 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3267 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3268
3269 * target.h (Target::Target_info): New members isolate_execinstr
3270 and rosegment_gap.
3271 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3272 * arm.cc (Target_arm::arm_info): Update initializer.
3273 * i386.cc (Target_i386::i386_info): Likewise.
3274 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3275 * sparc.cc (Target_sparc::sparc_info): Likewise.
3276 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3277 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3278 * layout.cc (Layout::attach_allocated_section_to_segment):
3279 Take new const Target* argument. If target->isolate_execinstr(), act
3280 like --rosegment.
3281 (Layout::find_first_load_seg): Take new const Target* argument;
3282 if target->isolate_execinstr(), reject PF_X segments.
3283 (Layout::relaxation_loop_body): Update caller.
3284 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3285 reset file offset to zero when we hit LOAD_SEG, and then do a second
3286 loop over the segments before LOAD_SEG to reassign offsets after
3287 addresses have been determined. Handle target->rosegment_gap().
3288 (Layout::attach_section_to_segment): Take new const Target* argument;
3289 pass it to attach_allocated_section_to_segment.
3290 (Layout::make_output_section): Update caller.
3291 (Layout::attach_sections_to_segments): Take new const Target* argument;
3292 pass it to attach_section_to_segment.
3293 * gold.cc (queue_middle_tasks): Update caller.
3294 * layout.h (Layout): Update method decls with new arguments.
3295
3296 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3297 Target_info pointer to use.
3298 (Target_arm::do_make_data_plt): New virtual method.
3299 (Target_arm::make_data_plt): New method that calls it.
3300 (Target_arm::make_plt_entry): Use it.
3301 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3302 for the section alignment.
3303 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3304 method.
3305 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3306 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3307 method.
3308 (Output_data_plt_arm::get_plt_entry_size): Call it.
3309 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3310 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3311 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3312 method.
3313 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3314 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3315 method instead of sizeof(plt_entry).
3316 (Output_data_plt_arm::add_entry): Likewise.
3317 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3318 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3319 than static method.
3320 (Target_arm::plt_entry_size): Likewise.
3321 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3322 Move to ...
3323 (Output_data_plt_arm_standard): ... here, new class.
3324 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3325 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3326 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3327
3328 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3329 Take additional argument for the PLT entry size.
3330 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3331 Use get_plt_entry_size method rather than plt_entry_size variable.
3332 (Output_data_plt_x86_64::reserve_slot): Likewise.
3333 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3334 (Output_data_plt_x86_64::add_entry): Likewise.
3335 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3336 (Output_data_plt_x86_64::address_for_global): Likewise.
3337 (Output_data_plt_x86_64::address_for_local): Likewise.
3338 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3339 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3340 Make method non-static.
3341 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3342 method.
3343 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3344 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3345 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3346 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3347 virtual method.
3348 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3349 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3350 virtual method.
3351 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3352 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3353 virtual method.
3354 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3355 (Output_data_plt_x86_64::plt_entry_size)
3356 (Output_data_plt_x86_64::first_plt_entry)
3357 (Output_data_plt_x86_64::plt_entry)
3358 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3359 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3360 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3361 (Output_data_plt_x86_64_standard): ... here, new class.
3362 (Target_x86_64::Target_x86_64): Take optional argument for the
3363 Target_info pointer to use.
3364 (Target_x86_64::do_make_data_plt): New virtual method.
3365 (Target_x86_64::make_data_plt): New method to call it.
3366 (Target_x86_64::init_got_plt_for_update): Use that.
3367 Call this->plt_->add_eh_frame method here.
3368 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3369 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3370 rather than static method.
3371 (Target_x86_64::plt_entry_size): Likewise.
3372 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3373 rather than plt_entry_size variable. Move guts of PLT filling to...
3374 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3375 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3376 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3377
3378 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3379 additional argument for the section alignment.
3380 Don't do add_eh_frame_for_plt here.
3381 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3382 non-static. Use get_plt_entry_size method rather than plt_entry_size
3383 variable.
3384 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3385 method.
3386 (Output_data_plt_i386::get_plt_entry_size): Call it.
3387 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3388 (Output_data_plt_i386::add_eh_frame): New method to call it.
3389 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3390 method.
3391 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3392 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3393 method.
3394 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3395 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3396 method instead of plt_entry_size.
3397 (Output_data_plt_i386::plt_entry_size)
3398 (Output_data_plt_i386::plt_eh_frame_fde_size)
3399 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3400 (Output_data_plt_i386_standard): ... here, new class.
3401 (Output_data_plt_i386_exec): New class.
3402 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3403 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3404 (Output_data_plt_i386::exec_plt_entry): Move to ...
3405 (Output_data_plt_i386_exec::plt_entry): ... here.
3406 (Output_data_plt_i386_dyn): New class.
3407 (Output_data_plt_i386::first_plt_entry): Move to ...
3408 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3409 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3410 (Output_data_plt_i386_dyn::plt_entry): ... here.
3411 (Target_i386::Target_i386): Take optional argument for the Target_info
3412 pointer to use.
3413 (Target_i386::do_make_data_plt): New virtual method.
3414 (Target_i386::make_data_plt): New method to call it.
3415 (Target_i386::make_plt_section): Use that.
3416 Call this->plt_->add_eh_frame method here.
3417 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3418 rather than plt_entry_size variable.
3419 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3420 (Output_data_plt_i386::address_for_local): Likewise.
3421 (Output_data_plt_i386::do_write): Likewise.
3422 Move guts of PLT filling to...
3423 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3424 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3425 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3426 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3427
b9b9f2ee
CC
34282012-05-01 Cary Coutant <ccoutant@google.com>
3429
3430 * dwarf_reader.cc (Dwarf_die::read_attributes)
3431 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3432 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3433 * reduced_debug_output.cc
3434 (Output_reduced_debug_info_section::get_die_end): Remove
3435 DW_FORM_GNU_ref_index. Add default case.
3436
57923f48
MW
34372012-04-26 Mark Wielaard <mjw@redhat.com>
3438
3439 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3440 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3441 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3442 DW_AT_high_pc as offset from DW_AT_low_pc.
3443
3444 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3445 * testsuite/Makefile.in: Regenerate.
3446 * testsuite/gdb_index_test_3.c: New test source file.
3447 * testsuite/gdb_index_test_3.sh: New test source file.
3448
2c54b4f4
ILT
34492012-04-25 Ian Lance Taylor <iant@google.com>
3450
3451 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3452 pointer.
3453 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3454 as a class, not a struct.
3455 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3456 (Target_arm::apply_cortex_a8_workaround): Likewise.
3457 * gc.h: Declare Reloc_types as a struct, not a class.
3458 * object.h: Declare Symbols_data as a struct.
3459 * reloc.h: Declare Read_relocs_data as a struct.
3460 * target.h: Declare Relocate_info as a struct.
3461
a5a5f7a3
DM
34622012-04-24 David S. Miller <davem@davemloft.net>
3463
3464 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3465 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3466 and R_SPARC_WPLT30.
3467
f038d496
CC
34682012-04-24 Cary Coutant <ccoutant@google.com>
3469
3470 * incremental-dump.cc (find_input_containing_global): Replace
3471 magic number with symbolic constant.
3472 (dump_incremental_inputs): Update version number.
3473 * incremental.cc (Output_section_incremental_inputs): Update version
3474 number; import symbolic constants from Incremental_inputs_reader.
3475 (Incremental_inputs::create_data_sections): Align relocations
3476 section correctly for 64-bit targets.
3477 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3478 constants; add padding.
3479 (Output_section_incremental_inputs::write_header): Add assert for
3480 header_size.
3481 (Output_section_incremental_inputs::write_input_files): Add assert
3482 for input_entry_size.
3483 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3484 add assert for object_info_size, input_section_entry_size,
3485 global_sym_entry_size.
3486 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3487 for data structure sizes; use them.
3488 (Incremental_input_entry_reader): Import symbolic constants from
3489 Incremental_inputs_reader; use them.
3490
a4d85145
DM
34912012-04-23 David S. Miller <davem@davemloft.net>
3492
3493 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3494 and elf_flags_set_.
3495 (Target_sparc::Target_sparc): Initialize new fields.
3496 (Target_sparc::do_make_elf_object): New function.
3497 (Target_sparc::do_adjust_elf_header): New function.
3498
1d509098
CC
34992012-04-23 Cary Coutant <ccoutant@google.com>
3500
3501 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3502 CU range table of gdb index.
3503
7ebeff7f
DM
35042012-04-20 David S. Miller <davem@davemloft.net>
3505
3506 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3507 instead of false.
3508
13cf9988
DM
35092012-04-16 David S. Miller <davem@davemloft.net>
3510
2a1079e8
DM
3511 * sparc.cc (Target_sparc::got_address): New function.
3512 (Sparc_relocate_functions::gdop_hix22): New function.
3513 (Sparc_relocate_functions::gdop_lox10): New function.
3514 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3515 relocs.
3516 (Target_sparc::Scan::local): Likewise if the global symbol is not
3517 preemptible and is not IFUNC.
3518 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3519 transformations for local and non-preemptible non-IFUNC global
3520 symbols.
3521
0bc964fc
DM
3522 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3523 writing out 64-bit part of ranges.
3524
661d7a80
DM
3525 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3526 -fpic and -fpie respectively.
3527 * Makefile.in: Regenerate.
3528
8c2bf391
DM
3529 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3530 (Target_sparc::Target_sparc): Initialize new field.
3531 (Target_sparc::do_plt_section_for_global): New function.
3532 (Target_sparc::do_plt_section_for_local): New function.
3533 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3534 (Target_sparc::make_plt_section): New function, broken out of
3535 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3536 (Target_sparc::make_plt_entry): Call make_plt_section.
3537 (Target_sparc::make_local_ifunc_plt_entry): New function.
3538 (Target_sparc::rela_ifunc_section): New function.
3539 (Target_sparc::plt_section): Remove const.
3540 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3541 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3542 and ifunc_count_ fields.
3543 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3544 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3545 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3546 (Output_data_plt_sparc::rela_ifunc): New function.
3547 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3548 (Output_data_plt_sparc::has_ifunc_section): New function.
3549 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3550 (Output_data_plt_sparc::address_for_global): New function.
3551 (Output_data_plt_sparc::address_for_local): New function.
3552 (Output_data_plt_sparc::plt_index_to_offset): New function.
3553 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3554 and entry_count.
3555 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3556 entry_count.
3557 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3558 R_SPARC_JMP_IREL to switch.
3559 (Target_sparc::Scan::check_non_pic): Likewise.
3560 (Target_sparc::Scan::local): Handle IFUNC symbols.
3561 (Target_sparc::Scan::local): Likewise.
3562 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3563 and plt_address_for_local.
3564 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3565 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3566
13cf9988
DM
3567 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3568 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3569 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3570 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3571 global relocs too.
3572 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3573 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3574 calls.
3575 * sparc.cc (Target_sparc::Scan::global): Likewise.
3576 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3577
31821be0
CC
35782012-04-16 Cary Coutant <ccoutant@google.com>
3579
3580 * archive.cc (Library_base::should_include_member): Check for
3581 --export-dynamic-symbol.
3582 * options.h (class General_options): Add --export-dynamic-symbol.
3583 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3584 --export-dynamic-symbol.
3585 (Symbol_table::gc_mark_undef_symbols): Likewise.
3586 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3587
2615994e
DM
35882012-04-12 David S. Miller <davem@davemloft.net>
3589
3590 * sparc.cc (Reloc::wdisp10): New relocation method.
3591 (Reloc::h34): Likewise.
3592 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3593 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3594 R_SPARC_WDISP10.
3595 (Target_sparc::Scan::local): Likewise.
3596 (Target_sparc::Scan::global): Likewise.
3597 (Target_sparc::Relocate::relocate): Likewise.
3598
6782735d
CC
35992012-04-09 Cary Coutant <ccoutant@google.com>
3600
3601 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3602 low_pc == 0.
3603
8c7a0b00
ILT
36042012-04-06 Ian Lance Taylor <iant@google.com>
3605
3606 * timer.cc: #include <unistd.h>.
3607
58797674
RM
36082012-04-06 Roland McGrath <mcgrathr@google.com>
3609
3610 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3611 * config.in: Regenerate.
3612 * configure: Regenerate.
3613
44350750
NC
36142012-04-05 Nick Clifton <nickc@redhat.com>
3615
3616 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3617 (AM_LC_MESSAGES): Add.
3618 * aclocal.m4: Regenerate.
3619 * config.in: Regenerate.
3620 * configure: Regenerate.
3621
c1027032
CC
36222012-03-21 Cary Coutant <ccoutant@google.com>
3623
3624 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3625 * Makefile.in: Regenerate.
3626 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3627 (Sized_elf_reloc_mapper::symbol_section): New function.
3628 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3629 (make_elf_reloc_mapper): New function.
3630 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3631 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3632 (Dwarf_abbrev_table::do_get_abbrev): New function.
3633 (Dwarf_ranges_table::read_ranges_table): New function.
3634 (Dwarf_ranges_table::read_range_list): New function.
3635 (Dwarf_pubnames_table::read_section): New function.
3636 (Dwarf_pubnames_table::read_header): New function.
3637 (Dwarf_pubnames_table::next_name): New function.
3638 (Dwarf_die::Dwarf_die): New function.
3639 (Dwarf_die::read_attributes): New function.
3640 (Dwarf_die::skip_attributes): New function.
3641 (Dwarf_die::set_name): New function.
3642 (Dwarf_die::set_linkage_name): New function.
3643 (Dwarf_die::attribute): New function.
3644 (Dwarf_die::string_attribute): New function.
3645 (Dwarf_die::int_attribute): New function.
3646 (Dwarf_die::uint_attribute): New function.
3647 (Dwarf_die::ref_attribute): New function.
3648 (Dwarf_die::child_offset): New function.
3649 (Dwarf_die::sibling_offset): New function.
3650 (Dwarf_info_reader::check_buffer): New function.
3651 (Dwarf_info_reader::parse): New function.
3652 (Dwarf_info_reader::do_parse): New function.
3653 (Dwarf_info_reader::do_read_string_table): New function.
3654 (Dwarf_info_reader::lookup_reloc): New function.
3655 (Dwarf_info_reader::get_string): New function.
3656 (Dwarf_info_reader::visit_compilation_unit): New function.
3657 (Dwarf_info_reader::visit_type_unit): New function.
3658 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3659 Sized_elf_reloc_mapper.
3660 (Sized_dwarf_line_info::symbol_section): Remove function.
3661 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3662 (Sized_dwarf_line_info::read_line_mappings): Remove object
3663 parameter, adjust callers.
3664 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3665 * dwarf_reader.h: Include <sys/types.h>.
3666 (class Track_relocs): Remove forward declaration.
3667 (class Elf_reloc_mapper): New class.
3668 (class Sized_elf_reloc_mapper): New class.
3669 (class Dwarf_abbrev_table): New class.
3670 (class Dwarf_range_list): New class.
3671 (class Dwarf_ranges_table): New class.
3672 (class Dwarf_pubnames_table): New class.
3673 (class Dwarf_die): New class.
3674 (class Dwarf_info_reader): New class.
3675 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3676 (Sized_dwarf_line_info::symbol_section): Remove member function.
3677 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3678 base class.
3679 * gdb-index.cc: New source file.
3680 * gdb-index.h: New source file.
3681 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3682 and .debug_types sections, call Layout::add_to_gdb_index.
3683 (Sized_relobj_incr::do_section_name): Implement.
3684 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3685 return type; Implement.
3686 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3687 return type.
3688 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3689 parameter list and return type.
3690 (Sized_incr_dynobj::do_section_contents): Likewise.
3691 * layout.cc: Include gdb-index.h.
3692 (Layout::Layout): Initialize gdb_index_data_.
3693 (Layout::init_fixed_output_section): Check for .gdb_index section.
3694 (Layout::add_to_gdb_index): New function. Instantiate.
3695 * layout.h: Add forward declaration for class Gdb_index.
3696 (Layout::add_to_gdb_index): New member function.
3697 (Layout::gdb_index_data_): New data member.
3698 * main.cc: Include gdb-index.h.
3699 (main): Print statistics for gdb index.
3700 * object.cc (Object::section_contents): Move code into
3701 do_section_contents.
3702 (need_decompressed_section): Check for sections needed when building
3703 gdb index.
3704 (build_compressed_section_map): Likewise.
3705 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3706 gdb index.
3707 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3708 sections; call Layout::add_to_gdb_index.
3709 (Sized_relobj_file::do_decompressed_section_contents): Call
3710 do_section_contents directly.
3711 * object.h (Object::do_section_contents): Adjust parameter list and
3712 return type.
3713 (Object::do_decompressed_section_contents): Call do_section_contents
3714 directly.
3715 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3716 return type.
3717 * options.h (class General_options): Add --gdb-index option.
3718 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3719 list and return type.
3720 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3721 * reloc.h (Track_relocs::checkpoint): New function.
3722 (Track_relocs::reset): New function.
3723
3724 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3725 New test cases.
3726 * testsuite/Makefile.in: Regenerate.
3727 * testsuite/gdb_index_test.cc: New test source file.
3728 * testsuite/gdb_index_test_1.sh: New test source file.
3729 * testsuite/gdb_index_test_2.sh: New test source file.
3730
647f1574
DK
37312012-03-19 Doug Kwan <dougkwan@google.com>
3732
3733 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3734 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3735 __exidx_start and __exidx_end. Make symbol table parameter
3736 anonymous as it is not used.
3737 * gold.cc (queue_middle_tasks): Call target hook to define any
3738 target-specific symbols.
3739 * target.h (Target::define_standard_symbols): New method.
3740 (Target::do_define_standard_symbols): Same.
3741 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3742 * testsuite/Makefile.in: Regenerate.
3743 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3744 and __exidx_end.
3745 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3746 relocations are generated for __exidx_start and __exidx_end.
3747
7c6109da
DK
37482012-03-16 Doug Kwan <dougkwan@google.com>
3749
3750 * testsuite/Makefile.am: Disable test initpri3b.
3751 * testsuite/Makefile.in: Regenerate.
3752
7b8957f8
DK
37532012-03-15 Doug Kwan <dougkwan@google.com>
3754
3755 * arm.cc (Target_arm::got_section): Make .got section read-only
3756 if -z now is given.
3757
14dc9ef7
ILT
37582012-03-15 Ian Lance Taylor <iant@google.com>
3759
3760 PR gold/13850
3761 * layout.cc (Layout::make_output_section): Correctly mark
3762 SHT_INIT_ARRAY, et. al., as relro.
3763
fa40b62a
DK
37642012-03-14 Doug Kwan <dougkwan@google.com>
3765
3766 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3767 dynamic relocations for protected symbols in shared objects.
3768
fd325007
ILT
37692012-03-13 Ian Lance Taylor <iant@google.com>
3770
3771 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3772 keep the larger alignment.
3773
e8dd54e1
CC
37742012-03-12 Cary Coutant <ccoutant@google.com>
3775
3776 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3777 handling of DW_LNE_define_file.
3778
feb5f3b0
CC
37792012-03-12 Cary Coutant <ccoutant@google.com>
3780
3781 * reduced_debug_output.cc
3782 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3783 codes to switch.
3784
a1fb4256
CC
37852012-02-29 Cary Coutant <ccoutant@google.com>
3786
3787 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3788
5dd8762a
CC
37892012-02-29 Cary Coutant <ccoutant@google.com>
3790
3791 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3792 Call Object::decompressed_section_contents.
3793 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3794 New dtor.
3795 (Sized_dwarf_line_info::buffer_start_): New data member.
3796 * merge.cc (Output_merge_data::do_add_input_section): Call
3797 Object::decompressed_section_contents.
3798 (Output_merge_string::do_add_input_section): Likewise.
3799 * object.cc (need_decompressed_section): New function.
3800 (build_compressed_section_map): Decompress sections needed later.
3801 (Sized_relobj_file::do_decompressed_section_contents): New function.
3802 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3803 * object.h (Object::decompressed_section_contents): New function.
3804 (Object::discard_decompressed_sections): New function.
3805 (Object::do_decompressed_section_contents): New function.
3806 (Object::do_discard_decompressed_sections): New function.
3807 (Compressed_section_info): New type.
3808 (Compressed_section_map): Include decompressed section contents.
3809 (Sized_relobj_file::do_decompressed_section_contents): New function.
3810 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3811
7b5de7ee
CC
38122012-02-16 Cary Coutant <ccoutant@google.com>
3813
3814 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3815 * testsuite/Makefile.in: Regenerate.
3816
f9fa4a63
CC
38172012-02-14 Cary Coutant <ccoutant@google.com>
3818
3819 * options.cc (General_options::finalize): Disallow -pie and -static.
3820
2c175ebc
DK
38212012-02-03 Doug Kwan <dougkwan@google.com>
3822
3823 * arm.cc (Arm_relocate_functions::abs8,
3824 Arm_relocate_functions::abs16): Use
3825 Bits::has_signed_unsigned_overflow32.
3826 (Arm_relocate_functions::thm_abs8): Correct range of
3827 overflow check.
3828 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3829 in assertions.
3830
90cff06f
DK
38312012-02-02 Doug Kwan <dougkwan@google.com>
3832
3833 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3834 position independent outputs, not just shared objects.
3835
63887f3d
L
38362012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3837
3838 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3839 * configure: Regenerated.
3840
bef2b434
ILT
38412012-01-27 Ian Lance Taylor <iant@google.com>
3842
3843 * reloc.h (Bits): New class with static functions, copied from
3844 namespace utils in arm.cc.
3845 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3846 instead.
3847
c335b55d
L
38482012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3849
3850 * incremental.cc (write_info_blocks): Correct relocation offset.
3851
41194d9f
L
38522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3853
3854 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3855 (Relocate::tls_gd_to_le): Likewise.
3856
1bae613c
L
38572012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3858
3859 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3860
24482ca0
L
38612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3862
3863 * configure.ac: Check if -mcmodel=medium works.
3864 * configure: Regenerated.
3865
c2c7840a
CC
38662012-01-24 Cary Coutant <ccoutant@google.com>
3867
3868 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3869 definition and ...
3870 (read_unsigned_LEB_128_x): ... this new function.
3871 (read_signed_LEB_128): Replaced with inline definition and ...
3872 (read_signed_LEB_128_x): ... this new function.
3873 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3874 (read_unsigned_LEB_128): Add inline definition.
3875 (read_signed_LEB_128_x): New function.
3876 (read_signed_LEB_128): Add inline definition.
3877 * testsuite/Makefile.am (leb128_unittest): New unit test.
3878 * testsuite/Makefile.in: Regenerate.
3879 * testsuite/leb128_unittest.cc: New unit test.
3880
833de760 38812012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3882
3883 PR gold/13617
3884 * i386.cc (Target_i386::do_code_fill): When using a jmp
3885 instruction, pad with nop instructions.
3886 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3887
618d6666
L
38882012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3889
3890 * x86_64.cc (gc_process_relocs): Add typename on types used in
3891 template.
3892 (scan_relocs): Likewise.
3893 (relocate_section): Likewise.
3894 (apply_relocation): Likewise.
3895
3660ff06
L
38962012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3897
3898 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3899 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3900 under x32.
3901
fc51264f
L
39022012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3903
3904 * x86_64.cc: Initial support for x32.
3905
dd74ae06
CC
39062012-01-03 Cary Coutant <ccoutant@google.com>
3907
3908 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3909 Use abstract base class for GOT.
3910 * gold/output.h (class Output_data_got_base): New abstract base class.
3911 (class Output_data_got): Derive from new base class, adjust ctors.
3912 (Output_data_got::reserve_slot): Make virtual; rename to
3913 do_reserve_slot; Adjust callers.
3914 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3915 pointer to abstract base class.
3916 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3917
83896202
ILT
39182011-12-18 Ian Lance Taylor <iant@google.com>
3919
3920 * object.h (Relobj::local_symbol_value): New function.
3921 (Relobj::local_plt_offset): New function.
3922 (Relobj::local_has_got_offset): New function.
3923 (Relobj::local_got_offset): New function.
3924 (Relobj::set_local_got_offset): New function.
3925 (Relobj::do_local_symbol_value): New pure virtual function.
3926 (Relobj::do_local_plt_offset): Likewise.
3927 (Relobj::do_local_has_got_offset): Likewise.
3928 (Relobj::do_local_got_offset): Likewise.
3929 (Relobj::do_set_local_got_offset): Likewise.
3930 (Sized_relobj::do_local_has_got_offset): Rename from
3931 local_has_got_offset.
3932 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3933 (Sized_relobj::do_set_local_got_offset): Rename from
3934 set_local_got_offset.
3935 (Sized_relobj_file::do_local_plt_offset): Rename from
3936 local_plt_offset.
3937 (Sized_relobj_file::do_local_symbol_value): New function.
3938 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3939 local_plt_offset.
3940 * output.cc (Output_data_got::Got_entry::write): Change object to
3941 Relobj. Use local_symbol_value.
3942 (Output_data_got::add_global_with_rel): Change rel_dyn to
3943 Output_data_reloc_generic*. Use add_global_generic.
3944 (Output_data_got::add_global_with_rela): Remove. Change all
3945 callers to use add_global_with_rel.
3946 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3947 Output_data_reloc_generic*. Use add_global_generic.
3948 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3949 callers to use add_global_pair_with_rel.
3950 (Output_data_got::add_local): Change object to Relobj*.
3951 (Output_data_got::add_local_plt): Likewise.
3952 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3953 change rel_dyn to Output_data_reloc_generic*. Use
3954 add_local_generic.
3955 (Output_data_got::add_local_with_rela): Remove. Change all
3956 callers to use all_local_with_rel.
3957 (Output_data_got::add_local_pair_with_rel): Change object to
3958 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3959 add_output_section_generic.
3960 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3961 callers to use add_local_pair_with_rel.
3962 (Output_data_got::reserve_local): Change object to Relobj*.
3963 * output.h: (class Output_data_reloc_generic): Add pure virtual
3964 declarations for add_global_generic, add_local_generic,
3965 add_output_section_generic.
3966 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3967 functions for Output_data_reloc_generic. Update declarations for
3968 changes listed in output.cc.
3969 (class Output_data_got): Change template parameter to got_size.
3970 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3971 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3972 function.
3973 (Sized_relobj_incr::do_local_plt_offset): New function.
3974 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3975 add_global_generic.
3976
76677ad0
CC
39772011-12-17 Cary Coutant <ccoutant@google.com>
3978
3979 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3980 * resolve.cc (Symbol_table::resolve): Likewise.
3981 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3982 arrays.
3983 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3984
8b8dd8d5
ILT
39852011-12-16 Ian Lance Taylor <iant@google.com>
3986
3987 * output.h (Output_data_reloc_generic::add): Only call
3988 add_dynamic_reloc if this is a dynamic reloc section.
3989
d55525b9
L
39902011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3991
3992 PR gold/13505
3993 * target-reloc.h (apply_relocation): Replace <64, false> with
3994 <size, big_endian>.
3995
ff81c7c1
NC
39962011-11-25 Nick Clifton <nickc@redhat.com>
3997
3998 * po/it.po: New Italian translation.
3999
628f39be
SA
40002011-11-17 Sterling Augustine <saugustine@google.com>
4001
4002 * script.cc (script_include_directive): Implement.
4003 (read_script_file): New local variables name and search_path. Update
4004 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4005 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4006 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4007
98ef3ea4
SA
40082011-11-11 Sterling Augustine <saugustine@google.com>
4009
4010 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4011 (file_or_sections_cmd): Likewise.
4012
f4a8b6d7
DK
40132011-11-11 Doug Kwan <dougkwan@google.com>
4014
4015 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4016 if --just-symbols is given.
4017
29ab395d
DK
40182011-11-10 Doug Kwan <dougkwan@google.com>
4019
4020 PR gold/13362
4021 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4022 when processing data relocs.
4023 * reloc.h (Relocate_functions::rel_unaligned): New method.
4024 (Relocate_functions::pcrel_unaligned): Ditto.
4025 (Relocate_functions::rel32_unaligned): Ditto.
4026 (Relocate_functions::pcrel32_unaligned): Ditto.
4027
2c339f71
DK
40282011-11-09 Doug Kwan <dougkwan@google.com>
4029
4030 PR gold/13362
4031 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4032 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4033 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4034 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4035 (Relocate_functions::rel_unaligned): New.
4036 (Relocate_functions::rel32_unaligned): New.
4037 * target-reloc.h (relocate_for_relocatable): Add code to handle
4038 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4039 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4040 arm_unaligned_reloc_r): New targets.
4041 * testsuite/Makefile.in: Regenerate.
4042 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4043 linking.
4044
3f3cddf1
ILT
40452011-11-02 Ian Lance Taylor <iant@google.com>
4046
4047 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4048 NATIVE_LINKER.
4049 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4050 * options.cc (General_options::finalize): Use library search path
4051 from configure script if specified. If not native and no sysroot,
4052 only search TOOLLIBDIR.
4053 * options.h (Search_directory::Search_directory): Change name to
4054 const std::string&.
4055 (General_options::add_to_library_path_with_sysroot): Change arg to
4056 const std::string&.
4057 * configure, Makefile.in, config.in: Rebuild.
4058
a8e2273b
ILT
40592011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4060
4061 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4062 we are working around the ARM1176 Erratum.
4063 * options.h (General_options::fix_arm1176): Add option.
4064 * testsuite/Makefile.am: Add testcases, and keep current ones
4065 working.
4066 * testsuite/Makefile.in: Regenerate.
4067 * testsuite/arm_fix_1176.s: New file.
4068 * testsuite/arm_fix_1176.sh: Likewise.
4069
cd6eab1c
ILT
40702011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4071
4072 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4073 may_use_blx_.
4074 (Target_arm::may_use_blx): Remove method.
4075 (Target_arm::set_may_use_blx): Likewise.
4076 (Target_arm::may_use_v4t_interworking): New method.
4077 (Target_arm::may_use_v5t_interworking): Likewise.
4078 (Target_arm::may_use_blx_): Remove member variable.
4079 (Arm_relocate_functions::arm_branch_common): Check for v5T
4080 interworking.
4081 (Arm_relocate_functions::thumb_branch_common): Likewise.
4082 (Reloc_stub::stub_type_for_reloc): Likewise.
4083 (Target_arm::do_finalize_sections): Correct interworking checks.
4084 * testsuite/Makefile.am: Add new tests.
4085 * testsuite/Makefile.in: Regenerate.
4086 * testsuite/arm_farcall_arm_arm.s: New test.
4087 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4088 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4089 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4090 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4091 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4092 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4093 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4094
286adcf4
CC
40952011-10-31 Cary Coutant <ccoutant@google.com>
4096
4097 PR gold/13023
4098 * expression.cc (Expression::eval_with_dot): Add
4099 is_section_dot_assignment parameter.
4100 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4101 absolute and assigning to dot within a section.
4102 * script-sections.cc
4103 (Output_section_element_assignment::set_section_addresses): Pass
4104 dot_section to set_if_absolute.
4105 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4106 as is_section_dot_assignment flag to eval_with_dot.
4107 (Output_section_element_dot_assignment::set_section_addresses):
4108 Likewise.
4109 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4110 parameter. Also set value if relative to dot_section; set the
4111 symbol's output_section.
4112 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4113 parameter. Adjust all callers.
4114 (Expression::eval_maybe_dot): Likewise.
4115 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4116 Adjust all callers.
4117 * testsuite/script_test_2.t: Test assignment of an absolute value
4118 to dot within an output section element.
4119
9634ed06
CC
41202011-10-31 Cary Coutant <ccoutant@google.com>
4121
4122 * options.h (class General_options): Add --[no-]gnu-unique options.
4123 * symtab.cc (Symbol_table::sized_write_globals): Convert
4124 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4125
de4101c7
CC
41262011-10-31 Cary Coutant <ccoutant@google.com>
4127
4128 PR gold/13359
4129 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4130 unnecessary assertion.
4131 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4132
7257cc92
ST
41332011-10-31 Sriraman Tallam <tmsriram@google.com>
4134
4135 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4136 gc_mark_symbol.
4137 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4138 gc_mark_symbol.
4139 Change to just keep the section associated with symbol.
4140 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4141 they are externally visible and --export-dynamic is turned on.
4142 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4143
bfc34b3f
ILT
41442011-10-19 Ian Lance Taylor <iant@google.com>
4145
4146 PR gold/13163
4147 * script-sections.cc
4148 (Output_section_element_dot_assignment::needs_output_section): New
4149 function.
4150
ea0d8c47
ILT
41512011-10-19 Ian Lance Taylor <iant@google.com>
4152
4153 PR gold/13204
4154 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4155 --section-start option was seen.
4156 * options.h (General_options::any_section_start): New function.
4157
abd242a9
DM
41582011-10-18 David S. Miller <davem@davemloft.net>
4159
4160 PR binutils/13301
4161 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4162 member to track relocation locations that have moved during TLS
4163 reloc optimizations.
4164 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4165 (Target_sparc::Relocate::relocate): Adjust view down by 4
4166 bytes if it matches reloc_adjust_addr_.
4167 (Target_sparc::Relocate::relocate_tls): Always move the
4168 __tls_get_addr call delay slot instruction forward 4 bytes when
4169 performing relaxation.
4170
bab9090f
CC
41712011-10-18 Cary Coutant <ccoutant@google.com>
4172
4173 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4174 (Output_file::map_no_anonymous): Check for non-zero
4175 return code from posix_fallocate.
4176
f7c5b166
CC
41772011-10-17 Cary Coutant <ccoutant@google.com>
4178
4179 PR gold/13245
4180 * plugin.cc (is_visible_from_outside): Check for symbols
4181 referenced from dynamic objects.
4182 * resolve.cc (Symbol_table::resolve): Don't count references
4183 from dynamic objects as references from real ELF files.
4184 * testsuite/plugin_test_2.sh: Adjust expected result.
4185
b490c0bb
CC
41862011-10-17 Cary Coutant <ccoutant@google.com>
4187
4188 * gold.cc: Include timer.h.
4189 (queue_middle_tasks): Stamp time.
4190 (queue_final_tasks): Likewise.
4191 * main.cc (main): Store timer in parameters. Print timers
4192 for each pass.
4193 * parameters.cc (Parameters::Parameters): Initialize timer_.
4194 (Parameters::set_timer): New function.
4195 (set_parameters_timer): New function.
4196 * parameters.h (Parameters::set_timer): New function.
4197 (Parameters::timer): New function.
4198 (Parameters::timer_): New data member.
4199 (set_parameters_timer): New function.
4200 * timer.cc (Timer::stamp): New function.
4201 (Timer::get_pass_time): New function.
4202 * timer.h (Timer::stamp): New function.
4203 (Timer::get_pass_time): New function.
4204 (Timer::pass_times_): New data member.
4205
f475cf7b
CC
42062011-10-17 Cary Coutant <ccoutant@google.com>
4207
4208 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4209 task for members of lib groups.
4210
cdd7e244
CC
42112011-10-17 Cary Coutant <ccoutant@google.com>
4212
4213 PR gold/13288
4f95c8b4 4214 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4215 (File_read::make_view): Move bounds check (replace with assert)...
4216 (File_read::find_or_make_view): ... to here.
4217
dfb45471
CC
42182011-10-12 Cary Coutant <ccoutant@google.com>
4219
4f95c8b4 4220 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4221 ::read returns less than requested size.
4222
53bbcc1b
CC
42232011-10-10 Cary Coutant <ccoutant@google.com>
4224
4f95c8b4 4225 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4226 Initialize defined_count_.
4227 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4228 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4229 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4230 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4231 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4232 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4233 member.
4234 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4235 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4236 Return zeroes instead of internal error.
4237
397b129b
CC
42382011-10-10 Cary Coutant <ccoutant@google.com>
4239
4240 PR gold/13249
4f95c8b4 4241 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4242 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4243 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4244 (Output_reloc::type_): Adjust size of bit field.
4245 (Output_reloc::use_plt_offset_): New bit field.
4246 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4247 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4248 flag. Adjust all callers.
4f95c8b4 4249 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4250 creating RELATIVE relocations.
4251
d5698657
NC
42522011-10-10 Nick Clifton <nickc@redhat.com>
4253
4254 * po/es.po: Updated Spanish translation.
4255 * po/fi.po: Updated Finnish translation.
4256
6a59a5c2
DN
42572011-10-03 Diego Novillo <dnovillo@google.com>
4258
4259 * options.cc (parse_uint): Fix dereference of RETVAL.
4260
f0558624
ST
42612011-09-29 Sriraman Tallam <tmsriram@google.com>
4262
4263 * layout.h (section_order_map_): New member.
4264 (get_section_order_map): New member function.
4265 * output.cc (Output_section::add_input_section): Check for patterns
4266 only when --section-ordering-file is specified.
4267 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4268 output_sections have been formed.
4269 * layout.cc (Layout_Layout): Initialize section_order_map_.
4270 * plugin.cc (update_section_order): Store order in order_map. Do not
4271 update the order.
4272 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4273 * testsuite/Makefile.in: Regenerate.
4274 * testsuite/plugin_section_order.c: New file.
4275 * testsuite/plugin_final_layout.cc: New file.
4276 * testsuite/plugin_final_layout.sh: New file.
4277
a7dac153
CC
42782011-09-29 Cary Coutant <ccoutant@google.com>
4279
4f95c8b4 4280 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4281 Check for NULL.
4f95c8b4 4282 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4283 symbols during incremental update.
4284 (Symbol_table::add_from_dynobj): Likewise.
4285
eebd87a5
ILT
42862011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4287 Ian Lance Taylor <iant@google.com>
4288
4289 * symtab.cc (Symbol_table::define_special_symbol): Always
4290 canonicalize version string.
4291
403a3331
CC
42922011-09-26 Cary Coutant <ccoutant@google.com>
4293
4f95c8b4
CC
4294 * gold.cc (queue_initial_tasks): Move option checks ...
4295 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4296 some options; make others fatal.
4297
235061c2
CC
42982011-09-26 Cary Coutant <ccoutant@google.com>
4299
4300 gcc PR lto/47247
4301 * plugin.cc (get_symbols_v2): New function.
4302 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4303 (is_referenced_from_outside): New function.
4304 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4305 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4306 (get_symbols): Pass version parameter.
4307 (get_symbols_v2): New function.
4308 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4309 parameter.
4310 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4311 (onload): Add LDPT_GET_SYMBOLS_V2.
4312 (all_symbols_read_hook): Use get_symbols_v2; check for
4313 LDPR_PREVAILING_DEF_IRONLY_EXP.
4314 * testsuite/plugin_test_3.sh: Update expected results.
4315
dc87f620
ILT
43162011-09-23 Simon Baldwin <simonb@google.com>
4317
4318 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4319 configuration options.
4320 * configure: Regenerate.
4321 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4322 * Makefile.in: Regenerate.
4323 * testsuite/Makefile.in: Regenerate.
4324
a8279f82
ST
43252011-09-19 Sriraman Tallam <tmsriram@google.com>
4326
4327 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4328
0c9350c8
CC
43292011-09-19 Cary Coutant <ccoutant@google.com>
4330
4331 * incremental.cc (can_incremental_update): Fix typo in comment.
4332 * incremental.h (can_incremental_update): Likewise.
4333
aa06ae28
CC
43342011-09-18 Cary Coutant <ccoutant@google.com>
4335
4336 * incremental.cc (can_incremental_update): New function.
4337 * incremental.h (can_incremental_update): New function.
4338 * layout.cc (Layout::init_fixed_output_section): Call it.
4339 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4340 * object.cc (Sized_relobj_file::do_layout): Call
4341 can_incremental_update.
4342
ebb300b2
CC
43432011-09-13 Cary Coutant <ccoutant@google.com>
4344
4345 * configure.ac: Check for glibc support for gnu_indirect_function
4346 support with static linking, setting automake conditional
4347 IFUNC_STATIC.
4348 * Makefile.in: Regenerate.
4349 * configure: Regenerate.
4350
4351 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4352 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4353 for IFUNC_STATIC.
4354 * testsuite/Makefile.in: Regenerate.
4355
1206d0d5
CC
43562011-09-13 Cary Coutant <ccoutant@google.com>
4357
4358 * incremental.cc (Sized_relobj_incr::do_layout): Call
4359 report_comdat_group for kept comdat sections.
4360 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4361 * testsuite/Makefile.in: Regenerate.
4362 * testsuite/incr_comdat_test_1.cc: New source file.
4363 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4364 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4365 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4366
40b29874
ILT
43672011-09-13 Ian Lance Taylor <iant@google.com>
4368
4369 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4370 variable external_symbols_offset.
4371
1b045aac
ILT
43722011-09-12 Ian Lance Taylor <iant@google.com>
4373
4374 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4375 triggered if object has no symbols.
4376
24c6c55a
DM
43772011-09-09 David S. Miller <davem@davemloft.net>
4378
4379 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4380 (Output_fill_debug_line::do_write): Likewise.
4381
66570254
CC
43822011-08-29 Cary Coutant <ccoutant@google.com>
4383
4384 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4385 casts to match formatting specs.
4386 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4387
8ea8cd50
CC
43882011-08-26 Cary Coutant <ccoutant@google.com>
4389
4390 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4391 remaining hole size when allocating.
4392 (Layout::make_output_section): Set fill methods for debug sections.
4393 * layout.h (Free_list::Free_list_node): Move from private to
4394 public.
4395 (Free_list::set_min_hole_size): New function.
4396 (Free_list::begin, Free_list::end): New functions.
4397 (Free_list::min_hole_): New data member.
4398 * output.cc: Include dwarf.h.
4399 (Output_fill_debug_info::do_minimum_hole_size): New function.
4400 (Output_fill_debug_info::do_write): New function.
4401 (Output_fill_debug_line::do_minimum_hole_size): New function.
4402 (Output_fill_debug_line::do_write): New function.
4403 (Output_section::Output_section): Initialize new data member.
4404 (Output_section::set_final_data_size): Ensure patch space is larger
4405 than minimum hole size.
4406 (Output_section::do_write): Fill holes in debug sections.
4407 * output.h (Output_fill): New class.
4408 (Output_fill_debug_info): New class.
4409 (Output_fill_debug_line): New class.
4410 (Output_section::set_free_space_fill): New function.
4411 (Output_section::free_space_fill_): New data member.
4412 * testsuite/Makefile.am (incremental_test_3): Add
4413 --incremental-patch option.
4414 (incremental_test_4): Likewise.
4415 (incremental_test_5): Likewise.
4416 (incremental_test_6): Likewise.
4417 (incremental_copy_test): Likewise.
4418 (incremental_common_test_1): Likewise.
4419 * testsuite/Makefile.in: Regenerate.
4420
7cf80422
NC
44212011-08-26 Nick Clifton <nickc@redhat.com>
4422
4423 * po/es.po: Updated Spanish translation.
4424
c3f7b0e5
CC
44252011-08-01 Cary Coutant <ccoutant@google.com>
4426
4427 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4428 * gold/testsuite/Makefile.in: Regenerate.
4429 * gold/testsuite/justsyms_exec.c: New source file.
4430 * gold/testsuite/justsyms_lib.c: New source file.
4431
9590bf25
CC
44322011-08-01 Cary Coutant <ccoutant@google.com>
4433
4434 * layout.cc (Layout::set_segment_offsets): Don't realign text
4435 segment if -Ttext was specified.
4436 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4437 file type.
4438 * object.h (Sized_relobj_file::e_type): New function.
4439 (Sized_relobj_file::e_type_): New data member.
4440 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4441 base address for ET_EXEC files.
4442 * target.cc (Target::do_make_elf_object_implementation): Allow
4443 ET_EXEC files with --just-symbols option.
4444
dcd8d12e
CC
44452011-07-28 Cary Coutant <ccoutant@google.com>
4446
4447 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4448 Add thread_number parameter.
4449 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4450 * workqueue-threads.cc
4451 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4452 current thread if its thread number is greater than desired thread
4453 count.
4454 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4455 Add thread_number parameter.
4456 (Workqueue::should_cancel_thread): Likewise.
4457 (Workqueue::find_runnable_or_wait): Pass thread_number to
4458 should_cancel_thread.
4459 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4460 parameter.
4461
804eb480
ST
44622011-07-22 Sriraman Tallam <tmsriram@google.com>
4463
4464 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4465 only after checking if it cannot be forced local.
4466 * symtab.h (is_externally_visible): Check if the symbol is not forced
4467 local.
4468
f1ddb600
ILT
44692011-07-15 Ian Lance Taylor <iant@google.com>
4470
4471 * options.h (class General_options): Add --print-output-format.
4472 Move -EL next to -EB, for better --help output.
4473 * target-select.cc: Include <cstdio>, "options.h", and
4474 "parameters.h".
4475 (Target_selector::do_target_bfd_name): New function.
4476 (print_output_format): New function.
4477 * target-select.h (class Target_selector): Update declarations.
4478 (Target_selector::target_bfd_name): New function.
4479 (print_output_format): Declare.
4480 * main.cc: Include "target-select.h".
4481 (main): Handle --print-output-format.
4482 * gold.cc: Include "target-select.h".
4483 (queue_initial_tasks): Handle --print-output-format when there are
4484 no input files.
4485 * parameters.cc (parameters_force_valid_target): Give a better
4486 error message if -EB/-EL does not match target.
4487 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4488 function.
4489
7d172687
ILT
44902011-07-15 Ian Lance Taylor <iant@google.com>
4491
4492 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4493 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4494 (Output_data_plt_i386::do_write): Write address of .dynamic
4495 section to first entry in .got.plt section.
4496 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4497 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4498 Initialize layout_.
4499 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4500 section to first entry in .got.plt section.
4501 * layout.h (Layout::dynamic_section): New function.
4502
e9552f7e
ST
45032011-07-13 Sriraman Tallam <tmsriram@google.com>
4504
4505 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4506 to claim_file call.
4507 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4508 input_section_position_, and input_section_glob_.
4509 (read_layout_from_file): Call function section_ordering_specified.
4510 * layout.h (is_section_ordering_specified): New function.
4511 (section_ordering_specified): New function.
4512 (section_ordering_specified_): New boolean member.
4513 * main.cc(main): Call load_plugins after layout object is defined.
4514 * output.cc (Output_section::add_input_section): Use
4515 function section_ordering_specified to check if section ordering is
4516 needed.
4517 * output.cc (Output_section::add_relaxed_input_section): Use
4518 function section_ordering_specified to check if section ordering is
4519 needed.
4520 (Output_section::update_section_layout): New function.
4521 (Output_section::sort_attached_input_sections): Check if input section
4522 must be reordered.
4523 * output.h (Output_section::update_section_layout): New function.
4524 * plugin.cc (get_section_count): New function.
4525 (get_section_type): New function.
4526 (get_section_name): New function.
4527 (get_section_contents): New function.
4528 (update_section_order): New function.
58797674 4529 (allow_section_ordering): New function.
e9552f7e
ST
4530 (Plugin::load): Add the new interfaces to the transfer vector.
4531 (Plugin_manager::load_plugins): New parameter.
4532 (Plugin_manager::all_symbols_read): New parameter.
4533 (Plugin_manager::claim_file): New parameter. Save the elf object for
4534 unclaimed objects.
4535 (Plugin_manager::get_elf_object): New function.
4536 (Plugin_manager::get_view): Change to directly use the bool to check
4537 if get_view is called from claim_file_hook.
4538 * plugin.h (input_objects): New function
4539 (Plugin__manager::load_plugins): New parameter.
4540 (Plugin_manager::claim_file): New parameter.
4541 (Plugin_manager::get_elf_object): New function.
4542 (Plugin_manager::in_claim_file_handler): New function.
4543 (Plugin_manager::in_claim_file_handler_): New member.
4544 (layout): New function.
4545 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4546 handler with an extra parameter. Make the elf object before calling
4547 claim_file handler.
4548 * testsuite/plugin_test.c (get_section_count): New function pointer.
4549 (get_section_type): New function pointer.
4550 (get_section_name): New function pointer.
4551 (get_section_contents): New function pointer.
4552 (update_section_order): New function pointer.
4553 (allow_section_ordering): New function pointer.
4554 (onload): Check if the new interfaces exist.
4555
9446efde
ILT
45562011-07-13 Ian Lance Taylor <iant@google.com>
4557
4558 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4559 relro section.
4560 * x86_64.cc (Target_x86_64::got_section): Likewise.
4561 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4562 (relro_now_test_SOURCES): New variable.
4563 (relro_now_test_DEPENDENCIES): New variable.
4564 (relro_now_test_LDFLAGS): New variable.
4565 (relro_now_test_LDADD): New variable.
4566 (relro_now_test.so): New target.
4567 * testsuite/Makefile.in: Rebuild.
4568
07aa62f2
ILT
45692011-07-12 Ian Lance Taylor <iant@google.com>
4570
4571 PR gold/12980
4572 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4573 GLOB_DAT relocation rather than a RELATIVE relocation for a
4574 protected symbol when creating a shared library.
4575 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4576 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4577 * testsuite/protected_main_1.cc (main): Test that protected
4578 function has same address.
4579
e2153196
ILT
45802011-07-11 Ian Lance Taylor <iant@google.com>
4581
4582 PR gold/12979
4583 * options.h (class General_options): Add -Bgroup.
4584 * options.cc (General_options::finalize): If -Bgroup is set,
4585 default to --unresolved-symbols=report-all.
4586 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4587 * target-reloc.h (issue_undefined_symbol_error): Handle
4588 --unresolved-symbols=report-all.
4589
6daf5215
ILT
45902011-07-08 Ian Lance Taylor <iant@google.com>
4591
4592 PR gold/11985
4593 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4594 if linker script discards key sections.
4595 (Layout::create_dynamic_symtab): Likewise.
4596 (Layout::assign_local_dynsym_offsets): Likewise.
4597 (Layout::sized_create_version_sections): Likewise.
4598 (Layout::create_interp): Likewise.
4599 (Layout::finish_dynamic_section): Likewise.
4600 (Layout::set_dynamic_symbol_size): Likewise.
4601
beabb2c6
ILT
46022011-07-08 Ian Lance Taylor <iant@google.com>
4603
4604 PR gold/12386
4605 * options.h (class General_options): Add --unresolved-symbols.
4606 * target-reloc.h (issue_undefined_symbol_error): Check
4607 --unresolved-symbols. Add comments.
4608
9c16daf1
ILT
46092011-07-08 Ian Lance Taylor <iant@google.com>
4610
4611 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4612 expression more complex.
4613
191f1a2d
ILT
46142011-07-08 Ian Lance Taylor <iant@google.com>
4615
4616 PR gold/11317
4617 * target-reloc.h (issue_undefined_symbol_error): New inline
4618 function, broken out of relocate_section.
4619 (relocate_section): Call issue_undefined_symbol_error.
4620 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4621 there is no TLS segment if we are about to issue an undefined
4622 symbol error.
4623 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4624
62855347
ILT
46252011-07-08 Ian Lance Taylor <iant@google.com>
4626
4627 PR gold/12279
4628 * resolve.cc (Symbol_table::should_override): Add fromtype
4629 parameter. Change all callers. Give error when linking together
4630 TLS and non-TLS symbol.
4631 (Symbol_table::should_override_with_special): Add fromtype
4632 parameter. Change all callers.
4633 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4634 there is no TLS segment if we have reported some errors.
4635 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4636
67181c72
ILT
46372011-07-08 Ian Lance Taylor <iant@google.com>
4638
4639 PR gold/12372
4640 * target.h (Target::plt_address_for_global): New function.
4641 (Target::plt_address_for_local): New function.
4642 (Target::plt_section_for_global): Remove.
4643 (Target::plt_section_for_local): Remove.
4644 (Target::do_plt_address_for_global): New virtual function.
4645 (Target::do_plt_address_for_local): New virtual function.
4646 (Target::do_plt_section_for_global): Remove.
4647 (Target::do_plt_section_for_local): Remove.
4648 (Target::register_global_plt_entry): Add Symbol_table and Layout
4649 parameters.
4650 * output.cc (Output_data_got::Got_entry::write): Use
4651 plt_address_for_global and plt_address_for_local.
4652 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4653 address of output section.
4654 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4655 got_irelative_, and irelative_count_ fields. Update
4656 declarations.
4657 (Output_data_plt_i386::has_irelative_section): New function.
4658 (Output_data_plt_i386::entry_count): Add irelative_count_.
4659 (Output_data_plt_i386::set_final_data_size): Likewise.
4660 (class Target_i386): Add got_irelative_ and rel_irelative_
4661 fields. Update declarations.
4662 (Target_i386::Target_i386): Initialize new fields.
4663 (Target_i386::do_plt_address_for_global): New function replacing
4664 do_plt_section_for_global.
4665 (Target_i386::do_plt_address_for_local): New function replacing
4666 do_plt_section_for_local.
4667 (Target_i386::got_section): Create got_irelative_.
4668 (Target_i386::rel_irelative_section): New function.
4669 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4670 fields. Don't define __rel_iplt_{start,end}.
4671 (Output_data_plt_i386::add_entry): Add symtab and layout
4672 parameters. Change all callers. Use different PLT and GOT for
4673 IFUNC symbols.
4674 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4675 layout parameters. Change all callers. Use different PLT and
4676 GOT.
4677 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4678 (Output_data_plt_i386::rel_irelative): New function.
4679 (Output_data_plt_i386::address_for_global): New function.
4680 (Output_data_plt_i386::address_for_local): New function.
4681 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4682 IRELATIVE GOT when changing IFUNC GOT entries.
4683 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4684 reloc.
4685 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4686 if we didn't create an IRELATIVE GOT.
4687 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4688 plt_address_for_local.
4689 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4690 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4691 got_irelative_, and irelative_count_ fields. Update
4692 declarations.
4693 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4694 Initialize new fields. Remove symtab parameter. Change all
4695 callers.
4696 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4697 irelative_count_.
4698 (Output_data_plt_x86_64::has_irelative_section): New function.
4699 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4700 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4701 fields. Update declarations.
4702 (Target_x86_64::Target_x86_64): Initialize new fields.
4703 (Target_x86_64::do_plt_address_for_global): New function replacing
4704 do_plt_section_for_global.
4705 (Target_x86_64::do_plt_address_for_local): New function replacing
4706 do_plt_section_for_local.
4707 (Target_x86_64::got_section): Create got_irelative_.
4708 (Target_x86_64::rela_irelative_section): New function.
4709 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4710 all callers. Don't create __rel_iplt_{start,end}.
4711 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4712 parameters. Change all callers. Use different PLT and GOT for
4713 IFUNC symbols.
4714 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4715 layout parameters. Change all callers. Use different PLT and
4716 GOT.
4717 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4718 parameters. Change all callers. Use different PLT and GOT for
4719 IFUNC symbols.
4720 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4721 (Output_data_plt_x86_64::rela_irelative): New function.
4722 (Output_data_plt_x86_64::address_for_global): New function.
4723 (Output_data_plt_x86_64::address_for_local): New function.
4724 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4725 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4726 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4727 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4728 parameters.
4729 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4730 reloc.
4731 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4732 symbols if we didn't create an IRELATIVE GOT.
4733 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4734 plt_address_for_local.
4735 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4736 * testsuite/ifuncvar1.c: New test file.
4737 * testsuite/ifuncvar2.c: New test file.
4738 * testsuite/ifuncvar3.c: New test file.
4739 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4740 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4741 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4742 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4743 * testsuite/Makefile.in: Rebuild.
4744
33c15b45
CC
47452011-07-07 Cary Coutant <ccoutant@google.com>
4746
4747 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4748 (two_file_test_1_ndebug.o): Likewise.
4749 (two_file_test_1b_ndebug.o): Likewise.
4750 (two_file_test_2_ndebug.o): Likewise.
4751 (two_file_test_main_ndebug.o): Likewise.
4752 (incremental_test_2): Link with no-debug versions.
4753
f48b5fb7
CC
47542011-07-06 Cary Coutant <ccoutant@google.com>
4755
4756 * gold/incremental.cc
4757 (Output_section_incremental_inputs::write_info_blocks): Check for
4758 hidden and internal symbols.
4759
221597a5
CC
47602011-07-06 Cary Coutant <ccoutant@google.com>
4761
4762 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4763 Check disposition for startup file.
4764 (Incremental_inputs::report_command_line): Ignore
4765 --incremental-startup-unchanged option.
4766 * options.cc (General_options::parse_incremental_startup_unchanged):
4767 New function.
4768 (General_options::General_options): Initialize new data member.
4769 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4770 (General_options): Add --incremental-startup-unchanged option.
4771 (General_options::incremental_startup_disposition): New function.
4772 (General_options::incremental_startup_disposition_): New data member.
4773
e24719f6
CC
47742011-07-06 Cary Coutant <ccoutant@google.com>
4775
4776 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4777 input file index to Script_info ctor.
4778 (Sized_incremental_binary::do_file_has_changed): Find the
4779 command-line argument for files named in scripts.
4780 * incremental.h (Script_info::Script_info): New ctor
4781 with input file index.
4782 (Script_info::input_file_index): New function.
4783 (Script_info::input_file_index_): New data member.
4784 (Incremental_binary::get_library): Add const.
4785 (Incremental_binary::get_script_info): Add const.
4786 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4787 * testsuite/Makefile.am (incremental_test_5): New test case.
4788 (incremental_test_6): New test case.
4789 * testsuite/Makefile.in: Regenerate.
4790
8f7c81e8
CC
47912011-07-06 Cary Coutant <ccoutant@google.com>
4792
4793 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4794 debug output when command lines differ.
4795
9fbd3822
CC
47962011-07-06 Cary Coutant <ccoutant@google.com>
4797
4798 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4799 --incremental-patch option.
4800 * layout.cc (Free_list::allocate): Extend allocation beyond original
4801 end if enabled.
4802 (Layout::make_output_section): Mark sections that should get
4803 patch space.
4804 * options.cc (parse_percent): New function.
4805 * options.h (parse_percent): New function.
4806 (DEFINE_percent): New macro.
4807 (General_options): Add --incremental-patch option.
4808 * output.cc (Output_section::Output_section): Initialize new data
4809 members.
4810 (Output_section::add_input_section): Print section name when out
4811 of patch space.
4812 (Output_section::add_output_section_data): Likewise.
4813 (Output_section::set_final_data_size): Add patch space when
4814 doing --incremental-full.
4815 (Output_section::do_reset_address_and_file_offset): Remove patch
4816 space.
4817 (Output_segment::set_section_list_addresses): Print debug output
4818 only if --incremental-update.
4819 * output.h (Output_section::set_is_patch_space_allowed): New function.
4820 (Output_section::is_patch_space_allowed_): New data member.
4821 (Output_section::patch_space_): New data member.
4822 * parameters.cc (Parameters::incremental_full): New function.
4823 * parameters.h (Parameters::incremental_full): New function
4824 * testsuite/Makefile.am (incremental_test_2): Add test for
4825 --incremental-patch option.
4826 * testsuite/Makefile.in: Regenerate.
4827 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4828 (t18): Remove function body.
4829
f6cccc2c
DK
48302011-07-05 Doug Kwan <dougkwan@google.com>
4831
4832 PR gold/12771
4833 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4834 Arm_Address type for relocation result.
4835 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4836 overflow check.
4837 (Arm_relocate_functions::abs32): Use unaligned access.
4838 (Arm_relocate_functions::rel32): Ditto.
4839 (Arm_relocate_functions::prel31): Ditto.
4840 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4841 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4842 static data relocations.
4843 * testsuite/Makefile.in: Regnerate.
4844 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4845
28a13fec
ILT
48462011-07-05 Ian Lance Taylor <iant@google.com>
4847
4848 PR gold/12392
4849 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4850 symbols if necessary.
4851 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4852
24d47b34
ILT
48532011-07-05 Ian Lance Taylor <iant@google.com>
4854
4855 PR gold/12952
4856 * resolve.cc (Symbol::override_base_with_special): Simply override
4857 version with special symbol version, ignoring previous version.
4858
41f9cbbe
ILT
48592011-07-05 Ian Lance Taylor <iant@google.com>
4860
4861 * object.cc (Sized_relobj_file::include_section_group): Add
4862 information to comment about signature location.
4863
886288f1
ILT
48642011-07-02 Ian Lance Taylor <iant@google.com>
4865
4866 PR gold/12957
4867 * options.h (class General_options): Add -f and -F.
4868 * options.cc (General_options::finalize): Fatal error if -f/-F
4869 are used without -shared.
4870 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4871
ae3a6d4f
ILT
48722011-07-02 Ian Lance Taylor <iant@google.com>
4873
4874 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4875
21131061
ILT
48762011-07-01 Ian Lance Taylor <iant@google.com>
4877
4878 PR gold/12525
4879 PR gold/12952
4880 * resolve.cc (Symbol::override_base_with_special): Don't override
4881 the version if the overriding symbol has a different name.
4882 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4883 all callers. If we give an error about an undefined version,
4884 define the base version if necessary.
4885 * dynobj.h (class Versions): Update declaration.
4886 * testsuite/weak_alias_test_5.cc: New file.
4887 * testsuite/weak_alias_test.script: New file.
4888 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4889 and versioned_alias have the right value, and call t2.
4890 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4891 weak_alias_test_5.so.
4892 (weak_alias_test_LDADD): Likewise.
4893 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4894 * testsuite/Makefile.in: Rebuild.
4895
611062c0
ILT
48962011-07-01 Ian Lance Taylor <iant@google.com>
4897
4898 PR gold/12525
4899 * options.h (class General_options): Support -z notext.
4900 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4901 -Wl,-z,notext.
4902 (two_file_shared_nonpic.so): Likewise.
4903 (two_file_shared_mixed.so): Likewise.
4904 (two_file_shared_mixed_1.so): Likewise.
4905 (weak_undef_lib_nonpic.so): Likewise.
4906 (alt/weak_undef_lib_nonpic.so): Likewise.
4907 (tls_test_shared_nonpic.so): Likewise.
4908 * testsuite/Makefile.in: Rebuild.
4909
328c7c2f
ILT
49102011-07-01 Ian Lance Taylor <iant@google.com>
4911
4912 PR gold/12525
4913 * configure.ac: Test whether static linking works, setting
4914 the automake conditional HAVE_STATIC.
4915 * testsuite/Makefile.am: Disable tests using -static if
4916 HAVE_STATIC is not true.
4917 * configure, testsuite/Makefile.in: Rebuild.
4918
02d7cd44
ILT
49192011-07-01 Ian Lance Taylor <iant@google.com>
4920
4921 PR gold/12525
4922 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4923 Assert if we see DW_EH_PE_indirect.
4924 * target.h (Target::ehframe_datarel_base): New function.
4925 (Target::do_ehframe_datarel_base): New target function.
4926 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4927 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4928 function.
4929
07a60597
ILT
49302011-07-01 Ian Lance Taylor <iant@google.com>
4931
4932 PR gold/12571
4933 * options.h (class General_options): Add
4934 --ld-generated-unwind-info.
4935 * ehframe.cc (Fde::write): Add address parameter. Change all
4936 callers. If associated with PLT, fill in address and size.
4937 (Cie::set_output_offset): Only add merge mapping if there is an
4938 object.
4939 (Cie::write): Add address parameter. Change all callers.
4940 (Eh_frame::add_ehframe_for_plt): New function.
4941 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4942 input_offset_ fields into union u_, with new plt field.
4943 (Fde::Fde): Adjust for new union field.
4944 (Fde::Fde) [Output_data version]: New constructor.
4945 (Fde::add_mapping): Only add merge mapping if there is an object.
4946 (class Cie): Update declarations.
4947 (class Eh_frame): Declare add_ehframe_for_plt.
4948 * layout.cc (Layout::layout_eh_frame): Break out code into
4949 make_eh_frame_section, and call it.
4950 (Layout::make_eh_frame_section): New function.
4951 (Layout::add_eh_frame_for_plt): New function.
4952 * layout.h (class Layout): Update declarations.
4953 * merge.cc (Merge_map::add_mapping): Add assertion.
4954 * i386.cc: Include "dwarf.h".
4955 (class Output_data_plt_i386): Make first_plt_entry,
4956 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4957 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4958 and plt_eh_frame_fde.
4959 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4960 boundary. Call add_eh_frame_for_plt if appropriate.
4961 * x86_64.cc: Include "dwarf.h".
4962 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4963 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4964 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4965 and plt_eh_frame_fde.
4966 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4967 appropriate.
4968
14788a3f
ILT
49692011-06-29 Ian Lance Taylor <iant@google.com>
4970
4971 PR gold/12629
4972 * object.cc (Sized_relobj_file::layout_section): Change shdr
4973 parameter to be const.
4974 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4975 out of do_layout.
4976 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4977 appropriate. Call layout_eh_frame_section.
4978 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4979 sections.
4980 * object.h (class Sized_relobj_file): Update declarations.
4981
6c21fce1
ILT
49822011-06-29 Ian Lance Taylor <iant@google.com>
4983
37e41b03 4984 PR gold/12652
6c21fce1
ILT
4985 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4986 modifier.
4987 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4988
4d5e4e62
ILT
49892011-06-29 Ian Lance Taylor <iant@google.com>
4990
4991 PR gold/12675
4992 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4993 SHT_X86_64_UNWIND.
4994 * layout.cc (Layout::layout_eh_frame): Likewise.
4995
886f533a
ILT
49962011-06-29 Ian Lance Taylor <iant@google.com>
4997
4998 PR gold/12695
4999 * layout.cc (Layout::symtab_section_shndx): New function.
5000 * layout.h (class Layout): Declare symtab_section_shndx.
5001 * output.cc (Output_section::write_header): Call it.
5002
f3ae1b28
ILT
50032011-06-29 Ian Lance Taylor <iant@google.com>
5004
5005 PR gold/12818
5006 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5007 symbols which are not used in a relocation.
5008
aecf301f
ILT
50092011-06-28 Ian Lance Taylor <iant@google.com>
5010
5011 PR gold/12898
5012 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5013 script create indistinguishable segments.
5014 (Layout::set_segment_offsets): Use stable_sort when sorting
5015 segments. Pass this to Compare_segments constructor.
5016 * layout.h (class Layout): Make segment_precedes non-static.
5017 (class Compare_segments): Change from struct to class. Add
5018 layout_ field. Add constructor.
5019 * script-sections.cc
5020 (Script_sections::attach_sections_using_phdrs_clause): Rename
5021 local orphan to is_orphan. Don't report failure to put empty
5022 section in segment. On attachment failure, report name of
5023 section, and attach to first PT_LOAD segment.
5024
03ef7571
ILT
50252011-06-28 Ian Lance Taylor <iant@google.com>
5026
5027 PR gold/12934
5028 * target-select.cc (Target_selector::Target_selector): Add
5029 emulation parameter. Change all callers.
5030 (select_target_by_bfd_name): Rename from select_target_by_name.
5031 Change all callers.
5032 (select_target_by_emulation): New function.
5033 (supported_emulation_names): New function.
5034 * target-select.h (class Target_selector): Add emulation_ field.
5035 Update declarations.
5036 (Target_selector::recognize_by_bfd_name): Rename from
5037 recognize_by_name. Change all callers.
5038 (Target_selector::supported_bfd_names): Rename from
5039 supported_names. Change all callers.
5040 (Target_selector::recognize_by_emulation): New function.
5041 (Target_selector::supported_emulations): New function.
5042 (Target_selector::emulation): New function.
5043 (Target_selector::do_recognize_by_bfd_name): Rename from
5044 do_recognize_by_name. Change all callers.
5045 (Target_selector::do_supported_bfd_names): Rename from
5046 do_supported_names. Change all callers.
5047 (Target_selector::do_recognize_by_emulation): New function.
5048 (Target_selector::do_supported_emulations): New function.
5049 (select_target_by_bfd_name): Change name in declaration.
5050 (select_target_by_emulation): Declare.
5051 (supported_emulation_names): Declare.
5052 * parameters.cc (parameters_force_valid_target): Try to find
5053 target based on emulation from -m option.
5054 * options.h (class General_options): Change doc string for -m.
5055 * options.cc (help): Print emulations.
5056 (General_options::parse_V): Likewise.
5057 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5058 Add emulation parameter. Change all callers.
5059
200b2bb9
ILT
50602011-06-28 Ian Lance Taylor <iant@google.com>
5061
5062 * target.h (class Target): Add osabi_ field.
5063 (Target::osabi): New function.
5064 (Target::set_osabi): New function.
5065 (Target::Target): Initialize osabi_.
5066 (Target::do_adjust_elf_header): Make pure virtual.
5067 (Sized_target::do_adjust_elf_header): Declare.
5068 * target.cc (Sized_target::do_adjust_elf_header): New function.
5069 (class Sized_target): Instantiate all versions.
5070 * freebsd.h (class Target_freebsd): Remove.
5071 (Target_selector_freebsd::do_recognize): Call set_osabi on
5072 Target.
5073 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5074 (Target_selector_freebsd::set_osabi): Remove.
5075 * i386.cc (class Target_i386): Inherit from Sized_target rather
5076 than Target_freebsd.
5077 * x86_64.cc (class Target_x86_64): Likewise.
5078
b3ce541e
ILT
50792011-06-28 Ian Lance Taylor <iant@google.com>
5080
5081 * target.h (Target::can_check_for_function_pointers): Rewrite.
5082 Make non-virtual.
5083 (Target::can_icf_inline_merge_sections): Likewise.
5084 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5085 (Target::Target_info): Add can_icf_inline_merge_sections field.
5086 (Target::do_can_check_for_function_pointers): New virtual
5087 function.
5088 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5089 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5090 from can_check_for_function_pointers, move in file.
5091 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5092 section_may_have_icf_unsafe_poineters, move in file.
5093 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5094 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5095 Rename from can_check_for_function_pointers, move in file.
5096 (Target_i386::can_icf_inline_merge_sections): Remove.
5097 (Target_i386::i386_info): Initialize
5098 can_icf_inline_merge_sections.
5099 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5100 Initialize can_icf_inline_merge_sections.
5101 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5102 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5103 Rename from can_check_for_function_pointers, move in file.
5104 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5105 (Target_x86_64::x86_64_info): Initialize
5106 can_icf_inline_merge_sections.
5107 * testsuite/testfile.cc (Target_test::test_target_info):
5108 Likewise.
5109 * icf.cc (get_section_contents): Correct formatting.
5110
6d1c4efb
ILT
51112011-06-27 Ian Lance Taylor <iant@google.com>
5112
5113 * symtab.cc (Symbol::versioned_name): New function.
5114 (Symbol_table::add_to_final_symtab): Use versioned_name when
5115 appropriate.
5116 (Symbol_table::sized_write_symbol): Likewise.
5117 * symtab.h (class Symbol): Declare versioned_name.
5118 * stringpool.h (class Stringpool_template): Add variant of add
5119 which takes a std::basic_string.
5120 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5121 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5122 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5123 (ver_test_12.o): New target.
5124 * testsuite/Makefile.in: Rebuild.
5125
57eb9b50
DK
51262011-06-27 Doug Kwan <dougkwan@google.com>
5127
5128 * arm.cc (Arm_relocate_functions::thm_jump8,
5129 Arm_relocate_functions::thm_jump11): Use a wider signed
5130 type to compute offset.
5131 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5132 arm_thm_jump8.
5133 * testsuite/Makefile.in: Regenerate.
5134 * testsuite/arm_branch_in_range.sh: Check test results of
5135 arm_thm_jump11 and arm_thm_jump8.
5136 * testsuite/arm_thm_jump11.s: New test source file.
5137 * testsuite/arm_thm_jump11.t: New linker script.
5138 * testsuite/arm_thm_jump8.s: New test source file.
5139 * testsuite/arm_thm_jump8.t: New linker script.
5140
487b39df
ILT
51412011-06-24 Ian Lance Taylor <iant@google.com>
5142
5143 * layout.cc: Include "object.h".
5144 (ctors_sections_in_init_array): New static variable.
5145 (Layout::is_ctors_in_init_array): New function.
5146 (Layout::layout): Add entry to ctors_sections_in_init_array if
5147 appropriate.
5148 * layout.h (class Layout): Declare is_ctors_in_init_array.
5149 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5150 is_ctors_reverse_view is set.
5151 (Sized_relobj_file::write_sections): Add layout parameter. Change
5152 all callers. Set is_ctors_reverse_view field of View_size.
5153 (Sized_relobj_file::reverse_words): New function.
5154 * object.h (Sized_relobj_file::View_size): Add
5155 is_ctors_reverse_view field.
5156 (class Sized_relobj_file): Update declarations.
5157 * testsuite/initpri3.c: New test.
5158 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5159 initpri3b.
5160 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5161 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5162 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5163 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5164 * testsuite/Makefile.in: Rebuild.
5165
472076e4
CC
51662011-06-24 Cary Coutant <ccoutant@google.com>
5167
5168 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5169 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5170 (debug_msg_cdebug.err): New targets.
5171 * testsuite/Makefile.in: Regenerate.
5172 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5173 Fix checks for link with shared library.
5174
a60af0db
DK
51752011-06-24 Doug Kwan <dougkwan@google.com>
5176
5177 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5178 skip empty text sections.
5179 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5180
5393d741
ILT
51812011-06-22 Ian Lance Taylor <iant@google.com>
5182
5183 PR gold/12910
5184 * options.h (class General_options): Add --ctors-in-init-array.
5185 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5186 friends as SHT_PROGBITS for merging sections.
5187 (Layout::layout): Remove special handling of .init_array and
5188 friends. Don't sort if doing relocatable link. Sort for .ctors
5189 and .dtors if ctors_in_init_array.
5190 (Layout::make_output_section): Force correct section types for
5191 .init_array and friends. Don't sort if doing relocatable link,
5192 Don't sort .ctors and .dtors if ctors_in_init_array.
5193 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5194 (Layout::output_section_name): Add relobj parameter. Change all
5195 callers. Handle .ctors. and .dtors. in code rather than table.
5196 Handle .ctors and .dtors if ctors_in_init_array.
5197 (Layout::match_file_name): New function, moved from output.cc.
5198 * layout.h (class Layout): Update declarations.
5199 * output.cc: Include "layout.h".
5200 (Input_section_sort_entry::get_priority): New function.
5201 (Input_section_sort_entry::match_file_name): Just call
5202 Layout::match_file_name.
5203 (Output_section::Input_section_sort_init_fini_compare::operator()):
5204 Handle .ctors and .dtors. Sort by explicit priority rather than
5205 by name.
5206 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5207 * testsuite/initpri2.c: New test.
5208 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5209 (check_PROGRAMS): Add initpri2.
5210 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5211 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5212 * configure, testsuite/Makefile.in: Rebuild.
5213
e1f74f98
ILT
52142011-06-19 Ian Lance Taylor <iant@google.com>
5215
5216 PR gold/12880
5217 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5218 .interp section to a PT_INTERP segment even if we have seen a
5219 --dynamic-linker option. Don't do it if we have seen a PHDRS
5220 clause in a linker script.
5221 (Layout::finalize): Don't create a .interp section if we've
5222 already create a PT_INTERP segment.
5223 (Layout::create_interp): Always call choose_output_section (revert
5224 patch of 2011-06-17). Don't create PT_INTERP segment.
5225 * script-sections.cc
5226 (Script_sections::create_note_and_tls_segments): Add a .interp
5227 section to a PT_INTERP segment even if we have seen a
5228 --dynamic-linker option.
5229
766f91bb
ILT
52302011-06-18 Ian Lance Taylor <iant@google.com>
5231
5232 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5233 merely because a non-PT_LOAD segment has a dynamic reloc.
5234
0d212c3a
ILT
52352011-06-18 Ian Lance Taylor <iant@google.com>
5236
5237 * layout.cc (Layout::finish_dynamic_section): Don't create
5238 DT_FLAGS entry if not needed.
5239
911a5072
ILT
52402011-06-18 Ian Lance Taylor <iant@google.com>
5241
5242 PR gold/12745
5243 * layout.cc (Layout::layout_eh_frame): Correct handling of
5244 writable .eh_frame section.
5245
534b4e5f
ILT
52462011-06-17 Ian Lance Taylor <iant@google.com>
5247
5248 PR gold/12893
5249 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5250 symbol is redefined with the exact same object and value.
5251
10b4f102
ILT
52522011-06-17 Ian Lance Taylor <iant@google.com>
5253
5254 PR gold/12880
5255 * layout.h (class Layout): Add interp_segment_ field.
5256 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5257 (Layout::attach_allocated_section_to_segment): If making shared
5258 library, put .interp section in PT_INTERP segment.
5259 (Layout::finalize): Also call create_interp if -dynamic-linker
5260 option was used.
5261 (Layout::create_interp): Assert that there is no PT_INTERP
5262 segment. If not using a SECTIONS clause, use make_output_section.
5263 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5264 * script-sections.cc
5265 (Script_sections::create_note_and_tls_segments): If making shared
5266 library, put .interp section in PT_INTERP segment.
5267
a29b0dad
ILT
52682011-06-17 Ian Lance Taylor <iant@google.com>
5269
e588ea8d
ILT
5270 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5271 when making a shared library.
5272
52732011-06-17 Ian Lance Taylor <iant@google.com>
5274
5275 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5276 parameter. Change all callers. Don't issue warning about PC32
5277 against locally defined symbol.
a29b0dad 5278
9d3b0698
ILT
52792011-06-16 Ian Lance Taylor <iant@google.com>
5280
5281 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5282 occurs in same object.
5283
85b0f90c
AM
52842011-06-14 Alan Modra <amodra@gmail.com>
5285
5286 * po/POTFILES.in: Regenerate.
5287
a94907d9
ILT
52882011-06-09 Ian Lance Taylor <iant@google.com>
5289
5290 * script-sections.cc
5291 (Orphan_output_section::set_section_addresses): For a relocatable
5292 link set address to 0.
5293
4fb3a1c3
CC
52942011-06-09 Cary Coutant <ccoutant@google.com>
5295
5296 PR gold/12804
5297 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5298 used with --compress-debug-sections.
5299 * gold/object.cc (Sized_relobj_file::do_layout): Report
5300 uncompressed size of compressed input sections.
5301
61220854
CC
53022011-06-08 Cary Coutant <ccoutant@google.com>
5303
5304 PR gold/12804
5305 * testsuite/two_file_test_2_v1.cc: Change initialization of
5306 v2 to keep it in .data.
5307
e6455dfb
CC
53082011-06-07 Cary Coutant <ccoutant@google.com>
5309
5310 * common.cc (Symbol_table::do_allocate_commons_list): Call
5311 gold_fallback.
5312 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5313 (Errors::fallback): New function.
5314 (gold_fallback): New function.
5315 * errors.h (Errors::fallback): New function.
5316 * gold.cc (gold_exit): Change status parameter to enum; adjust
5317 all callers.
5318 (queue_initial_tasks): Call gold_fallback.
5319 * gold.h: Include cstdlib.
5320 (Exit_status): New enum type.
5321 (gold_exit): Change status parameter to enum.
5322 (gold_fallback): New function.
5323 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5324 (Layout::create_symtab_sections): Likewise.
5325 (Layout::create_shdrs): Likewise.
5326 * main.cc (main): Adjust call to gold_exit.
5327 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5328 (Output_data_got::add_got_entry_pair): Likewise.
5329 (Output_section::add_input_section): Likewise.
5330 (Output_section::add_output_section_data): Likewise.
5331 (Output_segment::set_section_list_addresses): Likewise.
5332 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5333
fb0e076f
CC
53342011-06-07 Cary Coutant <ccoutant@google.com>
5335
5336 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5337 for incremental links.
5338 * output.cc (Output_segment::set_section_list_addresses): Remove
5339 FIXME and test for TLS or BSS.
5340
a5ee4d5d
CC
53412011-06-07 Cary Coutant <ccoutant@google.com>
5342
5343 * testsuite/Makefile.am: Add incremental_copy_test,
5344 incremental_common_test_1.
5345 * testsuite/Makefile.in: Regenerate.
5346 * testsuite/common_test_1_v1.c: New source file.
5347 * testsuite/common_test_1_v2.c: New source file.
5348 * testsuite/copy_test_v1.cc: New source file.
5349
5146f448
CC
53502011-06-07 Cary Coutant <ccoutant@google.com>
5351
5352 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5353 update, allocate common from bss section's free list.
5354 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5355 linker-defined symbols.
5356 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5357 Skip GOT and PLT entries that are no longer referenced.
5358 (Output_section_incremental_inputs::write_info_blocks): Mark
5359 linker-defined symbols.
5360 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5361 * output.cc (Output_section::allocate): New function.
5362 * output.h (Output_section::allocate): New function.
5363 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5364 linker-defined symbols.
5365 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5366 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5367 (Symbol::init_base_output_data): Likewise.
5368 (Symbol::init_base_output_segment): Likewise.
5369 (Symbol::init_base_constant): Likewise.
5370 (Sized_symbol::init_output_data): Likewise.
5371 (Sized_symbol::init_output_segment): Likewise.
5372 (Sized_symbol::init_constant): Likewise.
5373 (Symbol_table::do_define_in_output_data): Likewise.
5374 (Symbol_table::do_define_in_output_segment): Likewise.
5375 (Symbol_table::do_define_as_constant): Likewise.
5376 * symtab.h (Symbol::is_predefined): New function.
5377 (Symbol::init_base_output_data): Add is_predefined parameter.
5378 (Symbol::init_base_output_segment): Likewise.
5379 (Symbol::init_base_constant): Likewise.
5380 (Symbol::is_predefined_): New data member.
5381 (Sized_symbol::init_output_data): Add is_predefined parameter.
5382 (Sized_symbol::init_output_segment): Likewise.
5383 (Sized_symbol::init_constant): Likewise.
5384 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5385
26d3c67d
CC
53862011-06-07 Cary Coutant <ccoutant@google.com>
5387
5388 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5389 instead of emit_copy_reloc.
5390 (Copy_relocs::emit_copy_reloc): Refactor.
5391 (Copy_relocs::make_copy_reloc): New function.
5392 (Copy_relocs::add_copy_reloc): Remove.
5393 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5394 section.
5395 (Copy_relocs::make_copy_reloc): New function.
5396 (Copy_relocs::add_copy_reloc): Remove.
5397 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5398 unchanged input files.
5399 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5400 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5401 Reserve BSS space for COPY relocations.
5402 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5403 (Output_section_incremental_inputs::write_info_blocks): Record
5404 whether a symbol is copied from a shared object.
5405 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5406 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5407 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5408 (Incremental_input_entry_reader::get_output_symbol_index): Add
5409 is_copy parameter.
5410 (Incremental_binary::emit_copy_relocs): New function.
5411 (Incremental_binary::do_emit_copy_relocs): New function.
5412 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5413 new data member.
5414 (Sized_incremental_binary::add_copy_reloc): New function.
5415 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5416 (Sized_incremental_binary::Copy_reloc): New struct.
5417 (Sized_incremental_binary::Copy_relocs): New typedef.
5418 (Sized_incremental_binary::copy_relocs_): New data member.
5419 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5420 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5421 * target.h (Sized_target::emit_copy_reloc): New function.
5422 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5423
7cdb37d9
CC
54242011-06-02 Cary Coutant <ccoutant@google.com>
5425
5426 PR gold/12163
5427 * gold/archive.cc (Archive::Archive): Initialize new data member.
5428 (Archive::include_all_members): Return if archive has already been
5429 included.
5430 * gold/archive.h (Archive::include_all_members_): New data member.
5431
cc643b88
NC
54322011-06-02 Nick Clifton <nickc@redhat.com>
5433
5434 * dynobj.h: Fix spelling mistake in comment.
5435 * output.cc: Likewise.
5436
f62a3ca7 54372011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5438 Asier Llano
f62a3ca7
DK
5439
5440 PR gold/12826
cc643b88 5441 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5442 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5443 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5444 redundant arm_exidx_test.so.
5445 * testsuite/Makefile.in: Regenerate.
5446 (check_SCRIPTS): Add pr12826.sh
5447 (check_DATA): Add pr12826.stdout
5448 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5449 * testsuite/pr12826.sh: New file.
5450 * testsuite/pr12826_1.s: Ditto.
5451 * testsuite/pr12826_1.s: Ditto.
5452
8dbe1edc
ILT
54532011-05-30 Ian Lance Taylor <iant@google.com>
5454
5455 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5456 sections.
5457
c49875be
ILT
54582011-05-29 Ian Lance Taylor <iant@google.com>
5459
5460 PR gold/12804
5461 * testsuite/Makefile.am: Use different file name for two_file_test
5462 temporary file for each incremental test.
5463 * testsuite/Makefile.in: Rebuild.
5464
69d53f7a
ILT
54652011-05-29 Ian Lance Taylor <iant@google.com>
5466
5467 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5468 binary input file is empty.
5469
41d0ab5f
ILT
54702011-05-27 Ian Lance Taylor <iant@google.com>
5471
5472 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5473 (ver_test_9.so): Likewise.
5474 * testsuite/Makefile.in: Rebuild.
5475
89d8a36b
CC
54762011-05-26 Cary Coutant <ccoutant@google.com>
5477
5478 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5479 * incremental.cc (Incremental_inputs::report_input_section): Fix
5480 comment, indentation.
5481 (Incremental_inputs::report_comdat_group): New function.
5482 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5483 of data for incremental input file entry.
5484 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5485 group count, COMDAT group signatures.
5486 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5487 an unchanged input file.
5488 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5489 Initialize new data member.
5490 (Incremental_object_entry::add_comdat_group): New function.
5491 (Incremental_object_entry::get_comdat_group_count): New function.
5492 (Incremental_object_entry::get_comdat_signature_key): New function.
5493 (Incremental_object_entry::groups_): New data member.
5494 (Incremental_inputs::report_comdat_group): New function.
5495 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5496 data for incremental input file entry.
5497 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5498 (Incremental_input_entry_reader::get_input_section): Adjust size of
5499 data for incremental input file entry.
5500 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5501 (Incremental_input_entry_reader::get_comdat_group_signature): New
5502 function.
5503 * object.cc (Sized_relobj::include_section_group): Report kept
5504 COMDAT groups for incremental links.
5505
1706a06f
ILT
55062011-05-24 David Meyer <pdox@google.com>
5507
5508 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5509 with name parameter. Add found_name parameter.
5510 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5511 * dirsearch.h (class Dirsearch): Update declaration.
5512
a10ae760
ILT
55132011-05-24 Ian Lance Taylor <iant@google.com>
5514
5515 * archive.cc (Library_base::should_include_member): Pull in object
5516 from archive if it defines the entry symbol.
5517 * parameters.cc (Parameters::entry): New function.
5518 * parameters.h (class Parameters): Declare entry.
5519 * output.h (class Output_file_header): Remove entry_ field.
5520 * output.cc (Output_file_header::Output_file_header): Remove entry
5521 parameter. Change all callers.
5522 (Output_file_header::entry): Use parameters->entry.
5523 * gold.cc (queue_middle_tasks): Likewise.
5524 * plugin.cc (Plugin_hook::run): Likewise.
5525
aa92d6ed
CC
55262011-05-24 Cary Coutant <ccoutant@google.com>
5527
5528 * gold.cc (queue_initial_tasks): Pass incremental base filename
5529 to Output_file::open_base_file; don't print error message.
5530 * incremental-dump.cc (main): Adjust call to
5531 Output_file::open_for_modification.
5532 * incremental-dump.cc (main): Likewise.
5533 * incremental.cc (Incremental_inputs::report_command_line):
5534 Ignore --incremental-base option when comparing command lines.
5535 Ignore parameter when given as separate argument.
5536 * options.h (class General_options): Add --incremental-base.
5537 * output.cc (Output_file::Output_file):
5538 (Output_file::open_base_file): Add base_name and writable parameters;
5539 read base file into new file; print error message here.
5540 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5541 callers.
5542 * output.h (Output_file::open_for_modification): Rename to...
5543 (Output_file::open_base_file): ...this; add base_name and
5544 writable parameters; adjust all callers.
5545 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5546 callers.
5547 * testsuite/Makefile.am (incremental_test_4): Test
5548 --incremental-base.
5549 * testsuite/Makefile.in: Regenerate.
5550
2eedd706
CC
55512011-05-24 Cary Coutant <ccoutant@google.com>
5552
5553 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5554 incremental_test_4.
5555 * testsuite/Makefile.in: Regenerate.
5556 * testsuite/two_file_test_1_v1.cc: New test source file.
5557 * testsuite/two_file_test_1b_v1.cc: New test source file.
5558 * testsuite/two_file_test_2_v1.cc: New test source file.
5559
0f1c85a6
CC
55602011-05-24 Cary Coutant <ccoutant@google.com>
5561
5562 * dynobj.h (Dynobj::do_dynobj): New function.
5563 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5564 flag and soname for shared objects.
5565 * incremental.cc (Incremental_inputs::report_object): Make
5566 either Incremental_object_entry or Incremental_dynobj_entry; add
5567 soname to string table.
5568 (Incremental_inputs::report_input_section): Add assertion.
5569 (Output_section_incremental_inputs::set_final_data_size): Adjust
5570 type of input file entry for shared libraries; adjust size of
5571 shared library info entry.
5572 (Output_section_incremental_inputs::write_input_files): Write
5573 as_needed flag for shared libraries.
5574 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5575 of input file entry for shared libraries; write soname.
5576 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5577 soname from incremental info.
5578 * incremental.h (enum Incremental_input_flags): Add
5579 INCREMENTAL_INPUT_AS_NEEDED.
5580 (Incremental_input_entry::Incremental_input_entry): Initialize new
5581 data member.
5582 (Incremental_input_entry::set_as_needed): New function.
5583 (Incremental_input_entry::as_needed): New function.
5584 (Incremental_input_entry::do_dynobj_entry): New function.
5585 (Incremental_input_entry::as_needed_): New data member.
5586 (Incremental_object_entry::Incremental_object_entry): Don't check
5587 for shared library.
5588 (Incremental_object_entry::do_type): Likewise.
5589 (class Incremental_dynobj_entry): New class.
5590 (Incremental_input_entry_reader::as_needed): New function.
5591 (Incremental_input_entry_reader::get_soname): New function.
5592 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5593 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5594 size of shared library info entry.
58797674 5595 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5596 incremental link when adding DT_NEEDED entries.
5597 * object.h (Object::Object): Initialize new data member.
5598 (Object::dynobj): New function.
5599 (Object::set_as_needed): New function.
5600 (Object::as_needed): New function.
5601 (Object::do_dynobj): New function.
5602 (Object::as_needed_): New data member.
5603
6fa2a40b
CC
56042011-05-24 Cary Coutant <ccoutant@google.com>
5605
5606 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5607 info; adjust display of GOT entries.
5608 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5609 vector of input objects; remove file_status_.
5610 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5611 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5612 got_plt reader; call target hooks to reserve GOT entries.
5613 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5614 of input file info header and GOT info entry.
5615 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5616 relocation info.
5617 (Got_plt_view_info::got_descriptor): Remove.
5618 (Got_plt_view_info::sym_index): New data member.
5619 (Got_plt_view_info::input_index): New data member.
5620 (Local_got_offset_visitor::visit): Write input file index.
5621 (Global_got_offset_visitor::visit): Write 0 for input file index.
5622 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5623 with sym_index and input_index.
5624 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5625 incremental info GOT entry; replace got_descriptor with input_index.
5626 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5627 map from input file index to object.
5628 (Sized_relobj_incr::do_layout): Replace direct data member reference
5629 with accessor function.
5630 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5631 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5632 Adjust size of input file info header.
5633 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5634 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5635 (Incremental_input_entry_reader::get_input_section): Adjust size of
5636 input file info header.
5637 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5638 of incremental info GOT entry.
5639 (Incremental_got_plt_reader::get_got_desc): Remove.
5640 (Incremental_got_plt_reader::get_got_symndx): New function.
5641 (Incremental_got_plt_reader::get_got_input_index): New function.
5642 (Sized_incremental_binary::Sized_incremental_binary): Remove
5643 file_status_; add input_objects_.
5644 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5645 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5646 (Sized_incremental_binary::file_is_unchanged): Remove.
5647 (Sized_incremental_binary::set_input_object): New function.
5648 (Sized_incremental_binary::input_object): New function.
5649 (Sized_incremental_binary::file_status_): Remove.
5650 (Sized_incremental_binary::input_objects_): New data member.
5651 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5652 references.
5653 (Sized_relobj_incr::invalid_address): Move to base class.
5654 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5655 class.
5656 (Sized_relobj_incr::do_output_section_offset): Likewise.
5657 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5658 (Sized_relobj_incr::section_offsets_): Likewise.
5659 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5660 function.
5661 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5662 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5663 with accessor function.
5664 (Sized_relobj_file::do_layout): Likewise.
5665 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5666 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5667 (Sized_relobj_file::compute_final_local_value): Replace refs to
5668 section_offsets_ with accessor function.
5669 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5670 * object.h (Relobj::Relobj): Initialize new data members.
5671 (Relobj::add_dyn_reloc): New function.
5672 (Relobj::first_dyn_reloc): New function.
5673 (Relobj::dyn_reloc_count): New function.
5674 (Relobj::first_dyn_reloc_): New data member.
5675 (Relobj::dyn_reloc_count_): New data member.
5676 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5677 references.
5678 (Sized_relobj::Address): New typedef.
5679 (Sized_relobj::invalid_address): Move here from child class.
5680 (Sized_relobj::Sized_relobj): Initialize new data members.
5681 (Sized_relobj::sized_relobj): New function.
5682 (Sized_relobj::is_output_section_offset_invalid): Move here from
5683 child class.
5684 (Sized_relobj::get_output_section_offset): Likewise.
5685 (Sized_relobj::local_has_got_offset): Likewise.
5686 (Sized_relobj::local_got_offset): Likewise.
5687 (Sized_relobj::set_local_got_offset): Likewise.
5688 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5689 (Sized_relobj::clear_got_offsets): New function.
5690 (Sized_relobj::section_offsets): Move here from child class.
5691 (Sized_relobj::do_output_section_offset): Likewise.
5692 (Sized_relobj::do_set_section_offset): Likewise.
5693 (Sized_relobj::Local_got_offsets): Likewise.
5694 (Sized_relobj::local_got_offsets_): Likewise.
5695 (Sized_relobj::section_offsets_): Likewise.
5696 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5697 references.
5698 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5699 class.
5700 (Sized_relobj_file::sized_relobj): New function
5701 (Sized_relobj_file::local_has_got_offset): Move to base class.
5702 (Sized_relobj_file::local_got_offset): Likewise.
5703 (Sized_relobj_file::set_local_got_offset): Likewise.
5704 (Sized_relobj_file::get_output_section_offset): Likewise.
5705 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5706 (Sized_relobj_file::do_output_section_offset): Likewise.
5707 (Sized_relobj_file::do_set_section_offset): Likewise.
5708 (Sized_relobj_file::Local_got_offsets): Likewise.
5709 (Sized_relobj_file::local_got_offsets_): Likewise.
5710 (Sized_relobj_file::section_offsets_): Likewise.
5711 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5712 (all constructors).
5713 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5714 (Output_reloc::get_symbol_index): Likewise.
5715 (Output_reloc::local_section_offset): Likewise.
5716 (Output_reloc::get_address): Likewise.
5717 (Output_reloc::symbol_value): Likewise.
5718 (Output_data_got::reserve_slot): Move to class definition.
5719 (Output_data_got::reserve_local): New function.
5720 (Output_data_got::reserve_slot_for_global): Remove.
5721 (Output_data_got::reserve_global): New function.
5722 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5723 (all constructors, two instantiations).
5724 (Output_reloc::get_relobj): New function (two instantiations).
5725 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5726 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5727 (Output_data_reloc::add_global): Adjust type of relobj.
5728 (Output_data_reloc::add_global_relative): Likewise.
5729 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5730 (Output_data_reloc::add_local): Likewise.
5731 (Output_data_reloc::add_local_relative): Likewise.
5732 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5733 (Output_data_reloc::add_local_section): Likewise.
5734 (Output_data_reloc::add_output_section): Likewise.
5735 (Output_data_reloc::add_absolute): Likewise.
5736 (Output_data_reloc::add_target_specific): Likewise.
5737 (Output_data_got::reserve_slot): Move definition here.
5738 (Output_data_got::reserve_local): New function.
5739 (Output_data_got::reserve_global): New function.
5740 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5741 section_offsets_ with accessor function.
5742 (Sized_relobj_file::write_sections): Likewise.
5743 (Sized_relobj_file::do_relocate_sections): Likewise.
5744 * target.h (Sized_target::reserve_local_got_entry): New function.
5745 (Sized_target::reserve_global_got_entry): New function.
5746 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5747 (Target_x86_64::reserve_global_got_entry): New function.
5748 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5749
4829d394
CC
57502011-05-23 Cary Coutant <ccoutant@google.com>
5751
5752 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5753 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5754 bit when checking got_type.
5755 * incremental.cc (Sized_incremental_binary::setup_readers):
5756 Store symbol table and string table locations; initialize bit vector
5757 of file status flags.
5758 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5759 unchanged files.
5760 (Sized_incremental_binary::do_process_got_plt): New function.
5761 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5762 (Output_section_incremental_inputs::set_final_data_size): Record
5763 file index for each input file.
5764 (Output_section_incremental_inputs::write_got_plt): Store file index
5765 instead of input entry offset for each GOT entry.
5766 * incremental.h
5767 (Incremental_input_entry::Incremental_input_entry): Initialize new
5768 data member.
5769 (Incremental_input_entry::set_offset): Store file index.
5770 (Incremental_input_entry::get_file_index): New function.
5771 (Incremental_input_entry::file_index_): New data member.
5772 (Incremental_binary::process_got_plt): New function.
5773 (Incremental_binary::do_process_got_plt): New function.
5774 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5775 data members.
5776 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5777 (Sized_incremental_binary::set_file_is_unchanged): New function.
5778 (Sized_incremental_binary::file_is_unchanged): New function.
5779 (Sized_incremental_binary::do_process_got_plt): New function.
5780 (Sized_incremental_binary::file_status_): New data member.
5781 (Sized_incremental_binary::main_symtab_loc_): New data member.
5782 (Sized_incremental_binary::main_strtab_loc_): New data member.
5783 * output.cc (Output_data_got::Got_entry::write): Add case
5784 RESERVED_CODE.
5785 (Output_data_got::add_global): Call add_got_entry.
5786 (Output_data_got::add_global_plt): Likewise.
5787 (Output_data_got::add_global_with_rel): Likewise.
5788 (Output_data_got::add_global_with_rela): Likewise.
5789 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5790 (Output_data_got::add_global_pair_with_rela): Likewise.
5791 (Output_data_got::add_local): Call add_got_entry.
5792 (Output_data_got::add_local_plt): Likewise.
5793 (Output_data_got::add_local_with_rel): Likewise.
5794 (Output_data_got::add_local_with_rela): Likewise.
5795 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5796 (Output_data_got::add_local_pair_with_rela): Likewise.
5797 (Output_data_got::reserve_slot): New function.
5798 (Output_data_got::reserve_slot_for_global): New function.
5799 (Output_data_got::add_got_entry): New function.
5800 (Output_data_got::add_got_entry_pair): New function.
5801 (Output_section::add_output_section_data): Edit FIXME.
5802 * output.h
5803 (Output_section_data_build::Output_section_data_build): New
5804 constructor with size parameter.
5805 (Output_data_space::Output_data_space): Likewise.
5806 (Output_data_got::Output_data_got): Initialize new data member; new
5807 constructor with size parameter.
5808 (Output_data_got::add_constant): Call add_got_entry.
5809 (Output_data_got::reserve_slot): New function.
5810 (Output_data_got::reserve_slot_for_global): New function.
5811 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5812 (Output_data_got::add_got_entry): New function.
5813 (Output_data_got::add_got_entry_pair): New function.
5814 (Output_data_got::free_list_): New data member.
5815 * target.h (Sized_target::init_got_plt_for_update): New function.
5816 (Sized_target::register_global_plt_entry): New function.
5817 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5818 Initialize new data member; call init; add constructor with PLT count.
5819 (Output_data_plt_x86_64::init): New function.
5820 (Output_data_plt_x86_64::add_relocation): New function.
5821 (Output_data_plt_x86_64::reserve_slot): New function.
5822 (Output_data_plt_x86_64::free_list_): New data member.
5823 (Target_x86_64::init_got_plt_for_update): New function.
5824 (Target_x86_64::register_global_plt_entry): New function.
5825 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5826 incremental updates.
5827 (Output_data_plt_x86_64::add_relocation): New function.
5828 * testsuite/object_unittest.cc (Object_test): Set default options.
5829
ec69d6da
ILT
58302011-05-16 Ian Lance Taylor <iant@google.com>
5831
5832 * options.h (class General_options): Make -i a synonym for -r.
5833
732e31de
ILT
58342011-05-16 Ian Lance Taylor <iant@google.com>
5835
5836 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5837
403676b5
CC
58382011-05-10 Cary Coutant <ccoutant@google.com>
5839
5840 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5841 strip_all (-s).
5842
5b7b7d6e
ILT
58432011-05-06 Ian Lance Taylor <iant@google.com>
5844
5845 * layout.cc (Layout::layout): If the output section flags change,
5846 update the ordering.
5847
f0f9babf
CC
58482011-04-25 Cary Coutant <ccoutant@google.com>
5849
5850 * incremental-dump.cc (dump_incremental_inputs): Print local
5851 symbol info for each input file.
5852 * incremental.cc
5853 (Output_section_incremental_inputs::set_final_data_size): Add local
5854 symbol info to input file entries in incremental info.
5855 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5856 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5857 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5858 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5859 implementation.
5860 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5861 (Sized_incr_relobj::do_relocate): Write the local symbols.
5862 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5863 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5864 Adjust size of input file header.
5865 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5866 (Incremental_inputs_reader::get_local_symbol_count): New function.
5867 (Incremental_inputs_reader::get_input_section): Adjust size of input
5868 file header.
5869 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5870 (Sized_incr_relobj::This): New typedef.
5871 (Sized_incr_relobj::sym_size): New const data member.
5872 (Sized_incr_relobj::Local_symbol): New struct.
5873 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5874 (Sized_incr_relobj::do_local_symbol_offset): New function.
5875 (Sized_incr_relobj::local_symbol_count_): New data member.
5876 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5877 (Sized_incr_relobj::local_symbol_index_): New data member.
5878 (Sized_incr_relobj::local_symbol_offset_): New data member.
5879 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5880 (Sized_incr_relobj::local_symbols_): New data member.
5881 * object.h (Relobj::output_local_symbol_count): New function.
5882 (Relobj::local_symbol_offset): New function.
5883 (Relobj::do_output_local_symbol_count): New function.
5884 (Relobj::do_local_symbol_offset): New function.
5885 (Sized_relobj::do_output_local_symbol_count): New function.
5886 (Sized_relobj::do_local_symbol_offset): New function.
5887
d0a9ace3
ILT
58882011-04-22 Vladimir Simonov <sv@sw.ru>
5889
5890 * descriptors.cc (set_close_on_exec): New function.
5891 (Descriptors::open): Use set_close_on_exec.
5892 * output.cc (S_ISLNK): Define if not defined.
5893
94a3fc8b
CC
58942011-04-22 Cary Coutant <ccoutant@google.com>
5895
5896 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5897 global symbol map.
5898 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5899 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5900 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5901 relocations.
5902 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5903 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5904 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5905 * incremental.h
5906 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5907 function.
5908 (Incremental_binary::apply_incremental_relocs): New function.
5909 (Incremental_binary::do_apply_incremental_relocs): New function.
5910 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5911 data member.
5912 (Sized_incremental_binary::add_global_symbol): New function.
5913 (Sized_incremental_binary::global_symbol): New function.
5914 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5915 (Sized_incremental_binary::symbol_map_): New data member.
5916 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5917 * target.h (Sized_target::apply_relocation): New function.
5918 * target-reloc.h (apply_relocation): New function.
5919 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5920
c87e4302
DK
59212011-04-22 Doug Kwan <dougkwan@google.com>
5922
5923 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5924 flag of a SHT_ARM_EXIDX section.
2e702c99 5925 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5926 * testsuite/Makefile.in: Regenerate.
5927 * testsuite/arm_exidx_test.s: New file.
5928 * testsuite/arm_exidx_test.sh: Same.
5929
e7782cf6
CC
59302011-04-20 Cary Coutant <ccoutant@google.com>
5931
5932 PR gold/12689
5933 * archive.h (Incremental_archive_entry::Archive_member):
5934 Initialize arg_serial_ (second constructor).
5935
308ecdc7
ILT
59362011-04-17 Ian Lance Taylor <iant@google.com>
5937
5938 * object.cc (Relocate_info::location): Simplify location string.
5939 * errors.cc (Errors::error_at_location): Don't print program
5940 name.
5941 (Errors::warning_at_location): Likewise.
5942 (Errors::undefined_symbol): Likewise.
5943 * testsuite/debug_msg.sh: Update accordingly.
5944
bec5b579
CC
59452011-04-14 Cary Coutant <ccoutant@google.com>
5946
5947 * gold/layout.cc (Layout::symtab_section_offset): New function.
5948 * gold/layout.h (Layout::symtab_section_offset): New function.
5949 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5950
88597d34
ILT
59512011-04-12 Ian Lance Taylor <iant@google.com>
5952
5953 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5954 with MREMAP_MAYMOVE.
5955 * output.h (class Output_file): Add map_is_allocated_ field.
5956 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5957 not available, provide stubs. If mremap is not available, #define
5958 it to gold_mremap.
5959 (MREMAP_MAYMOVE): Define if not defined.
5960 (Output_file::Output_file): Initialize map_is_allocated_.
5961 (Output_file::resize): Check map_is_allocated_.
5962 (Output_file::map_anonymous): If mmap fails, use malloc.
5963 (Output_file::unmap): Don't do anything for an anonymous map.
5964 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5965 is not available, provide stubs.
5966 (File_read::View::~View): Use free rather than delete[].
5967 (File_read::make_view): Use malloc rather than new[]. If mmap
5968 fails, use malloc.
5969 (File_read::find_or_make_view): Use malloc rather than new[].
5970 * gold.h: Remove HAVE_REMAP code.
5971 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5972 exists. Rename mremap to gold_mremap. If mmap is not available
5973 don't do anything.
5974 * configure, config.in: Rebuild.
5975
11e361bc
ILT
59762011-04-11 Ian Lance Taylor <iant@google.com>
5977
5978 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5979 initialize local variable v.
5980
cdc29364
CC
59812011-04-11 Cary Coutant <ccoutant@google.com>
5982
5983 * archive.cc (Archive::include_member): Adjust call to
5984 report_object.
5985 (Add_archive_symbols::run): Track argument serial numbers.
5986 (Lib_group::include_member): Likewise.
5987 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5988 * archive.h (Incremental_archive_entry::Archive_member):
5989 Initialize arg_serial_.
5990 (Archive_member::arg_serial_): New data member.
5991 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5992 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5993 incremental link.
5994 (Sized_dynobj::do_for_all_local_got_entries): New function.
5995 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5996 function.
5997 * fileread.cc (get_mtime): New function.
5998 * fileread.h (get_mtime): New function.
5999 * gold.cc (queue_initial_tasks): Check for incremental update.
6000 (process_incremental_input): New function.
6001 (queue_middle_tasks): Don't force valid target for incremental
6002 update.
6003 * incremental-dump.cc (find_input_containing_global): Adjust
6004 size of symbol info entry.
6005 (dump_incremental_inputs): Dump argument serial number and
6006 in_system_directory flag; bias shndx by 1; print symbol names
6007 when dumping per-file symbol lists; use new symbol info readers.
6008 * incremental.cc
6009 (Output_section_incremental_inputs:update_data_size): New function.
6010 (Sized_incremental_binary::setup_readers): Setup input readers
6011 for each input file; build maps for files added from libraries
6012 and scripts.
6013 (Sized_incremental_binary::check_input_args): New function.
6014 (Sized_incremental_binary::do_check_inputs): Build map of argument
6015 serial numbers to input arguments.
6016 (Sized_incremental_binary::do_file_has_changed): Rename
6017 do_file_is_unchanged to this; compare file modification times.
6018 (Sized_incremental_binary::do_init_layout): New function.
6019 (Sized_incremental_binary::do_reserve_layout): New function.
6020 (Sized_incremental_binary::do_get_input_reader): Remove.
6021 (Sized_incremental_binary::get_symtab_view): New function.
6022 (Incremental_checker::can_incrementally_link_output_file): Remove.
6023 (Incremental_inputs::report_command_line): Exclude --debug options.
6024 (Incremental_inputs::report_archive_begin): Add parameter; track
6025 argument serial numbers; don't put input file entry for archive
6026 before archive members.
6027 (Incremental_inputs::report_archive_end): Put input file entry
6028 for archive after archive members.
6029 (Incremental_inputs::report_object): Add parameter; track argument
6030 serial numbers and in_system_directory flag.
6031 (Incremental_inputs::report_script): Add parameter; track argument
6032 serial numbers.
6033 (Output_section_incremental_inputs::set_final_data_size): Adjust
6034 size of symbol info entry; check for forwarding symbols.
6035 (Output_section_incremental_inputs::write_input_files): Write
6036 in_system_directory flag and argument serial number.
6037 (Output_section_incremental_inputs::write_info_blocks): Map section
6038 indices between incremental info and original input file; store
6039 input section index for each symbol.
6040 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6041 change operator() to visit().
6042 (class Global_got_offset_visitor): Likewise.
6043 (class Global_symbol_visitor_got_plt):
6044 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6045 classes.
6046 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6047 (Sized_incr_relobj::do_read_symbols): New function.
6048 (Sized_incr_relobj::do_layout): New function.
6049 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6050 (Sized_incr_relobj::do_add_symbols): New function.
6051 (Sized_incr_relobj::do_should_include_member): New function.
6052 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6053 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6054 (Sized_incr_relobj::do_section_size): New function.
6055 (Sized_incr_relobj::do_section_name): New function.
6056 (Sized_incr_relobj::do_section_contents): New function.
6057 (Sized_incr_relobj::do_section_flags): New function.
6058 (Sized_incr_relobj::do_section_entsize): New function.
6059 (Sized_incr_relobj::do_section_address): New function.
6060 (Sized_incr_relobj::do_section_type): New function.
6061 (Sized_incr_relobj::do_section_link): New function.
6062 (Sized_incr_relobj::do_section_info): New function.
6063 (Sized_incr_relobj::do_section_addralign): New function.
6064 (Sized_incr_relobj::do_initialize_xindex): New function.
6065 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6066 (Sized_incr_relobj::do_read_relocs): New function.
6067 (Sized_incr_relobj::do_gc_process_relocs): New function.
6068 (Sized_incr_relobj::do_scan_relocs): New function.
6069 (Sized_incr_relobj::do_count_local_symbols): New function.
6070 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6071 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6072 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6073 (Sized_incr_relobj::do_relocate): New function.
6074 (Sized_incr_relobj::do_set_section_offset): New function.
6075 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6076 (Sized_incr_dynobj::do_read_symbols): New function.
6077 (Sized_incr_dynobj::do_layout): New function.
6078 (Sized_incr_dynobj::do_add_symbols): New function.
6079 (Sized_incr_dynobj::do_should_include_member): New function.
6080 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6081 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6082 (Sized_incr_dynobj::do_section_size): New function.
6083 (Sized_incr_dynobj::do_section_name): New function.
6084 (Sized_incr_dynobj::do_section_contents): New function.
6085 (Sized_incr_dynobj::do_section_flags): New function.
6086 (Sized_incr_dynobj::do_section_entsize): New function.
6087 (Sized_incr_dynobj::do_section_address): New function.
6088 (Sized_incr_dynobj::do_section_type): New function.
6089 (Sized_incr_dynobj::do_section_link): New function.
6090 (Sized_incr_dynobj::do_section_info): New function.
6091 (Sized_incr_dynobj::do_section_addralign): New function.
6092 (Sized_incr_dynobj::do_initialize_xindex): New function.
6093 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6094 (make_sized_incremental_object): New function.
6095 (Incremental_library::copy_unused_symbols): New function.
6096 (Incremental_library::do_for_all_unused_symbols): New function.
6097 * incremental.h (enum Incremental_input_flags): New type.
6098 (class Incremental_checker): Remove.
6099 (Incremental_input_entry::Incremental_input_entry): Add argument
6100 serial number.
6101 (Incremental_input_entry::arg_serial): New function.
6102 (Incremental_input_entry::set_is_in_system_directory): New function.
6103 (Incremental_input_entry::is_in_system_directory): New function.
6104 (Incremental_input_entry::arg_serial_): New data member.
6105 (Incremental_input_entry::is_in_system_directory_): New data member.
6106 (class Script_info): Move here from script.h.
6107 (Script_info::Script_info): Add filename parameter.
6108 (Script_info::filename): New function.
6109 (Script_info::filename_): New data member.
6110 (Incremental_script_entry::Incremental_script_entry): Add argument
6111 serial number.
6112 (Incremental_object_entry::Incremental_object_entry): Likewise.
6113 (Incremental_object_entry::add_input_section): Build list of input
6114 sections with map to original shndx.
6115 (Incremental_object_entry::get_input_section_index): New function.
6116 (Incremental_object_entry::shndx_): New data member.
6117 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6118 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6119 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6120 serial number.
6121 (Incremental_inputs::report_archive_begin): Likewise.
6122 (Incremental_inputs::report_object): Likewise.
6123 (Incremental_inputs::report_script): Likewise.
6124 (class Incremental_global_symbol_reader): New class.
6125 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6126 and store flags and input file type.
6127 (Incremental_input_entry_reader::arg_serial): New function.
6128 (Incremental_input_entry_reader::type): Extract type from flags.
6129 (Incremental_input_entry_reader::is_in_system_directory): New function.
6130 (Incremental_input_entry_reader::get_input_section_count): Call
6131 accessor function for type.
6132 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6133 function for type; adjust size of global symbol entry.
6134 (Incremental_input_entry_reader::get_global_symbol_count): Call
6135 accessor function for type.
6136 (Incremental_input_entry_reader::get_object_count): Likewise.
6137 (Incremental_input_entry_reader::get_object_offset): Likewise.
6138 (Incremental_input_entry_reader::get_member_count): Likewise.
6139 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6140 (Incremental_input_entry_reader::get_member_offset): Likewise.
6141 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6142 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6143 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6144 (Incremental_input_entry_reader::get_global_symbol_reader): New
6145 function.
6146 (Incremental_input_entry_reader::get_output_symbol_index): New
6147 function.
6148 (Incremental_input_entry_reader::type_): Remove.
6149 (Incremental_input_entry_reader::flags_): New data member.
6150 (Incremental_inputs_reader::input_file_offset): New function.
6151 (Incremental_inputs_reader::input_file_index): New function.
6152 (Incremental_inputs_reader::input_file): Call input_file_offset.
6153 (Incremental_inputs_reader::input_file_at_offset): New function.
6154 (Incremental_relocs_reader::get_r_type): Reformat.
6155 (Incremental_relocs_reader::get_r_shndx): Reformat.
6156 (Incremental_relocs_reader::get_r_offset): Reformat.
6157 (Incremental_relocs_reader::data): New function.
6158 (Incremental_binary::Incremental_binary): Initialize new data members.
6159 (Incremental_binary::check_inputs): Add cmdline parameter.
6160 (Incremental_binary::file_is_unchanged): Remove.
6161 (Input_reader::arg_serial): New function.
6162 (Input_reader::get_unused_symbol_count): New function.
6163 (Input_reader::get_unused_symbol): New function.
6164 (Input_reader::do_arg_serial): New function.
6165 (Input_reader::do_get_unused_symbol_count): New function.
6166 (Input_reader::do_get_unused_symbol): New function.
6167 (Incremental_binary::input_file_count): New function.
6168 (Incremental_binary::get_input_reader): Change signature to use
6169 index instead of filename.
6170 (Incremental_binary::file_has_changed): New function.
6171 (Incremental_binary::get_input_argument): New function.
6172 (Incremental_binary::get_library): New function.
6173 (Incremental_binary::get_script_info): New function.
6174 (Incremental_binary::init_layout): New function.
6175 (Incremental_binary::reserve_layout): New function.
6176 (Incremental_binary::output_file): New function.
6177 (Incremental_binary::do_check_inputs): New function.
6178 (Incremental_binary::do_file_is_unchanged): Remove.
6179 (Incremental_binary::do_file_has_changed): New function.
6180 (Incremental_binary::do_init_layout): New function.
6181 (Incremental_binary::do_reserve_layout): New function.
6182 (Incremental_binary::do_input_file_count): New function.
6183 (Incremental_binary::do_get_input_reader): Change signature.
6184 (Incremental_binary::input_args_map_): New data member.
6185 (Incremental_binary::library_map_): New data member.
6186 (Incremental_binary::script_map_): New data member.
6187 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6188 new data members.
6189 (Sized_incremental_binary::output_section): New function.
6190 (Sized_incremental_binary::inputs_reader): Add const.
6191 (Sized_incremental_binary::symtab_reader): Add const.
6192 (Sized_incremental_binary::relocs_reader): Add const.
6193 (Sized_incremental_binary::got_plt_reader): Add const.
6194 (Sized_incremental_binary::get_symtab_view): New function.
6195 (Sized_incremental_binary::Inputs_reader): New typedef.
6196 (Sized_incremental_binary::Input_entry_reader): New typedef.
6197 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6198 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6199 (Sized_incremental_binary::do_file_has_changed): New function.
6200 (Sized_incremental_binary::do_init_layout): New function.
6201 (Sized_incremental_binary::do_reserve_layout): New function.
6202 (Sized_input_reader::Inputs_reader): Remove.
6203 (Sized_input_reader::Input_entry_reader): Remove.
6204 (Sized_input_reader::do_arg_serial): New function.
6205 (Sized_input_reader::do_get_unused_symbol_count): New function.
6206 (Sized_input_reader::do_get_unused_symbol): New function.
6207 (Sized_incremental_binary::do_input_file_count): New function.
6208 (Sized_incremental_binary::do_get_input_reader): Change signature;
6209 use index instead of filename.
6210 (Sized_incremental_binary::section_map_): New data member.
6211 (Sized_incremental_binary::input_entry_readers_): New data member.
6212 (class Sized_incr_relobj): New class.
6213 (class Sized_incr_dynobj): New class.
6214 (make_sized_incremental_object): New function.
6215 (class Incremental_library): New class.
6216 * layout.cc (Free_list::num_lists): New static data member.
6217 (Free_list::num_nodes): New static data member.
6218 (Free_list::num_removes): New static data member.
6219 (Free_list::num_remove_visits): New static data member.
6220 (Free_list::num_allocates): New static data member.
6221 (Free_list::num_allocate_visits): New static data member.
6222 (Free_list::init): New function.
6223 (Free_list::remove): New function.
6224 (Free_list::allocate): New function.
6225 (Free_list::dump): New function.
6226 (Free_list::print_stats): New function.
6227 (Layout_task_runner::run): Resize output file for incremental updates.
6228 (Layout::Layout): Initialize new data members.
6229 (Layout::set_incremental_base): New function.
6230 (Layout::init_fixed_output_section): New function.
6231 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6232 incremental updates.
6233 (Layout::create_gold_note): Do not create gold note section for
6234 incremental updates.
6235 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6236 for incremental updates.
6237 (Layout::set_section_offsets): For incremental updates, allocate space
6238 from free list.
6239 (Layout::create_symtab_sections): Layout with offsets relative to
6240 start of section; for incremental updates, allocate space from free
6241 list.
6242 (Layout::create_shdrs): For incremental updates, allocate space from
6243 free list.
6244 (Layout::finish_dynamic_section): For incremental updates, do not
6245 check --as-needed (fixed in subsequent patch).
6246 * layout.h (class Free_list): New class.
6247 (Layout::set_incremental_base): New function.
6248 (Layout::incremental_base): New function.
6249 (Layout::init_fixed_output_section): New function.
6250 (Layout::allocate): New function.
6251 (Layout::incremental_base_): New data member.
6252 (Layout::free_list_): New data member.
6253 * main.cc (main): Print Free_list statistics.
6254 * object.cc (Relobj::finalize_incremental_relocs): Add
6255 clear_counts parameter; clear counts only when clear_counts is set.
6256 (Sized_relobj::Sized_relobj): Initialize new base class.
6257 (Sized_relobj::do_layout): Don't report special sections.
6258 (Sized_relobj::do_for_all_local_got_entries): New function.
6259 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6260 symtab_off to all symbol table offsets.
6261 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6262 * object.h (class Got_offset_list): Move to top of file.
6263 (Object::Object): Allow case where input_file == NULL.
6264 (Object::~Object): Likewise.
6265 (Object::input_file): Assert that input_file != NULL.
6266 (Object::lock): Allow case where input_file == NULL.
6267 (Object::unlock): Likewise.
6268 (Object::is_locked): Likewise.
6269 (Object::token): Likewise.
6270 (Object::release): Likewise.
6271 (Object::is_incremental): New function.
6272 (Object::get_mtime): New function.
6273 (Object::for_all_local_got_entries): New function.
6274 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6275 (Object::set_is_in_system_directory): New function.
6276 (Object::is_in_system_directory): New function.
6277 (Object::do_is_incremental): New function.
6278 (Object::do_get_mtime): New function.
6279 (Object::do_for_all_local_got_entries): New function.
6280 (Object::is_in_system_directory_): New data member.
6281 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6282 (class Sized_relobj_base): New class.
6283 (class Sized_relobj): Derive from Sized_relobj_base.
6284 (class Sized_relobj::Symbols): Redeclare from base class.
6285 (class Sized_relobj::local_got_offset_list): Remove.
6286 (class Sized_relobj::Output_sections): Redeclare from base class.
6287 (class Sized_relobj::do_for_all_local_got_entries): New function.
6288 (class Sized_relobj::write_local_symbols): Add offset parameter.
6289 (class Sized_relobj::local_symbol_offset_): Update comment.
6290 (class Sized_relobj::local_dynsym_offset_): Update comment.
6291 * options.cc (Input_arguments::add_file): Remove const.
6292 * options.h (Input_file_argument::Input_file_argument):
6293 Initialize arg_serial_ (all constructors).
6294 (Input_file_argument::set_arg_serial): New function.
6295 (Input_file_argument::arg_serial): New function.
6296 (Input_file_argument::arg_serial_): New data member.
6297 (Input_arguments::Input_arguments): Initialize file_count_.
6298 (Input_arguments::add_file): Remove const.
6299 (Input_arguments::number_of_input_files): New function.
6300 (Input_arguments::file_count_): New data member.
6301 (Command_line::number_of_input_files): Call
6302 Input_arguments::number_of_input_files.
6303 * output.cc (Output_segment_headers::Output_segment_headers):
6304 Set current size.
6305 (Output_section::Input_section::current_data_size): New function.
6306 (Output_section::Output_section): Initialize new data members.
6307 (Output_section::add_input_section): Don't do merge sections for
6308 an incremental link; allocate space from free list for an
6309 incremental update.
6310 (Output_section::add_output_section_data): Allocate space from
6311 free list for an incremental update.
6312 (Output_section::update_data_size): New function.
6313 (Output_section::set_fixed_layout): New function.
6314 (Output_section::reserve): New function.
6315 (Output_segment::set_section_addresses): Remove const.
6316 (Output_segment::set_section_list_addresses): Remove const; allocate
6317 space from free list for an incremental update.
6318 (Output_segment::set_offset): Adjust size of RELRO segment for an
6319 incremental update.
6320 * output.h (Output_data::current_data_size): Move here from
6321 child classes.
6322 (Output_data::pre_finalize_data_size): New function.
6323 (Output_data::update_data_size): New function.
6324 (Output_section_headers::update_data_size): new function.
6325 (Output_section_data_build::current_data_size): Move to Output_data.
6326 (Output_data_strtab::update_data_size): New function.
6327 (Output_section::current_data_size): Move to Output_data.
6328 (Output_section::set_fixed_layout): New function.
6329 (Output_section::has_fixed_layout): New function.
6330 (Output_section::reserve): New function.
6331 (Output_section::update_data_size): New function.
6332 (Output_section::has_fixed_layout_): New data member.
6333 (Output_section::free_list_): New data member.
6334 (Output_segment::set_section_addresses): Remove const.
6335 (Output_segment::set_section_list_addresses): Remove const.
6336 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6337 New function.
6338 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6339 New function.
6340 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6341 parameter when calling Add_symbols constructor; store argument
6342 serial number for members of a lib group.
6343 (Add_symbols::locks): Allow case where token == NULL.
6344 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6345 (Read_member::~Read_member): New function.
6346 (Read_member::is_runnable): New function.
6347 (Read_member::locks): New function.
6348 (Read_member::run): New function.
6349 (Check_script::~Check_script): New function.
6350 (Check_script::is_runnable): New function.
6351 (Check_script::locks): New function.
6352 (Check_script::run): New function.
6353 (Check_library::~Check_library): New function.
6354 (Check_library::is_runnable): New function.
6355 (Check_library::locks): New function.
6356 (Check_library::run): New function.
6357 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6358 (Add_symbols::library_): New data member.
6359 (class Read_member): New class.
6360 (class Check_script): New class.
6361 (class Check_library): New class.
6362 * reloc.cc (Read_relocs::is_runnable): Allow case where
6363 token == NULL.
6364 (Read_relocs::locks): Likewise.
6365 (Scan_relocs::locks): Likewise.
6366 (Relocate_task::locks): Likewise.
6367 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6368 to clear counters.
6369 (Sized_relobj::incremental_relocs_scan): Fix comment.
6370 (Sized_relobj::do_relocate): Pass output file offset to
6371 write_local_symbols.
6372 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6373 from class declaration.
6374 * script.cc (read_input_script): Allocate Script_info; pass
6375 argument serial number to report_script.
6376 * script.h (class Script_info): Move to incremental.h.
6377 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6378 * symtab.h (Symbol_table::add_from_incrobj): New function.
6379 (Symbol_table::set_file_offset): New function.
6380
b961d0d7
CC
63812011-04-05 Cary Coutant <ccoutant@google.com>
6382
6383 * incremental-dump.cc (dump_incremental_inputs): Change signature
6384 to take a Sized_incremental_binary; change caller. Use readers
6385 in Sized_incremental_binary.
6386 * incremental.cc
6387 (Sized_incremental_binary::find_incremental_inputs_sections):
6388 Rename do_find_incremental_inputs_sections to this.
6389 (Sized_incremental_binary::setup_readers): New function.
6390 (Sized_incremental_binary::do_check_inputs): Check
6391 has_incremental_info_ flag; move setup code to setup_readers;
6392 use input readers.
6393 (Sized_incremental_binary::do_file_is_unchanged): New function.
6394 (Sized_incremental_binary::do_get_input_reader): New function.
6395 * incremental.h (class Incremental_binary): Move to end of file.
6396 (Incremental_binary::file_is_unchanged): New function.
6397 (Incremental_binary::do_file_is_unchanged): New function.
6398 (Incremental_binary::Input_reader): New class.
6399 (Incremental_binary::get_input_reader): New function.
6400 (class Sized_incremental_binary): Move to end of file.
6401 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6402 input section reader classes.
6403 (Sized_incremental_binary::has_incremental_info): New function.
6404 (Sized_incremental_binary::inputs_reader): New function.
6405 (Sized_incremental_binary::symtab_reader): New function.
6406 (Sized_incremental_binary::relocs_reader): New function.
6407 (Sized_incremental_binary::got_plt_reader): New function.
6408 (Sized_incremental_binary::do_file_is_unchanged): New function.
6409 (Sized_incremental_binary::Sized_input_reader): New class.
6410 (Sized_incremental_binary::get_input_reader): New function.
6411 (Sized_incremental_binary::find_incremental_inputs_sections):
6412 Rename do_find_incremental_inputs_sections to this.
6413 (Sized_incremental_binary::setup_readers): New function.
6414 (Sized_incremental_binary::has_incremental_info_): New data member.
6415 (Sized_incremental_binary::inputs_reader_): New data member.
6416 (Sized_incremental_binary::symtab_reader_): New data member.
6417 (Sized_incremental_binary::relocs_reader_): New data member.
6418 (Sized_incremental_binary::got_plt_reader_): New data member.
6419 (Sized_incremental_binary::current_input_file_): New data member.
6420
a869183f
PP
64212011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6422
6423 PR gold/12640
6424 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6425 violation.
6426
64272011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6428
6429 * archive.cc (Archive::include_member): Adjust call to report_object.
6430 (Add_archive_symbols::run): Add script_info to call to
6431 report_archive_begin.
6432 (Lib_group::include_member): Adjust call to report_object.
6433 (Add_lib_group_symbols::run): Adjust call to report_object.
6434 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6435 blocks. Add object count for script input files.
6436 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6437 script_info parameter; change all callers.
6438 (Incremental_inputs::report_object): Add script_info parameter;
6439 change all callers.
6440 (Incremental_inputs::report_script): Store backpointer to
6441 incremental info entry.
6442 (Output_section_incremental_inputs::set_final_data_size): Record
6443 additional information for scripts.
6444 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6445 * incremental.h (Incremental_script_entry::add_object): New function.
6446 (Incremental_script_entry::get_object_count): New function.
6447 (Incremental_script_entry::get_object): New function.
6448 (Incremental_script_entry::objects_): New data member; adjust
6449 constructor.
6450 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6451 (Incremental_inputs::report_object): Add script_info parameter.
6452 (Incremental_inputs_reader::get_object_count): New function.
6453 (Incremental_inputs_reader::get_object_offset): New function.
6454 * options.cc (Input_arguments::add_file): Return reference to
6455 new input argument.
6456 * options.h (Input_argument::set_script_info): New function.
6457 (Input_argument::script_info): New function.
6458 (Input_argument::script_info_): New data member; adjust all
6459 constructors.
6460 (Input_file_group::add_file): Return reference to new input argument.
6461 (Input_file_lib::add_file): Likewise.
6462 (Input_arguments::add_file): Likewise.
6463 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6464 * script.cc (Parser_closure::Parser_closure): Add script_info
6465 parameter; adjust all callers.
6466 (Parser_closure::script_info): New function.
6467 (Parser_closure::script_info_): New data member.
6468 (read_input_script): Report scripts earlier to incremental info.
6469 (script_add_file): Set script_info in Input_argument.
6470 (script_add_library): Likewise.
6471 * script.h (Script_options::Script_info): Rewrite class.
6472
a869183f 64732011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6474
6475 * archive.cc (Library_base::should_include_member): Move
6476 method here from class Archive.
6477 (Archive::Archive): Initialize base class.
6478 (Archive::should_include_member): Move to base class.
6479 (Archive::do_for_all_unused_symbols): New function.
6480 (Add_archive_symbols::run): Remove redundant access to
6481 incremental_inputs.
6482 (Lib_group::Lib_group): Initialize base class.
6483 (Lib_group::do_filename): New function.
6484 (Lib_group::include_member): Pass pointer to Lib_group to
6485 report_object.
6486 (Lib_group::do_for_all_unused_symbols): New function.
6487 (Add_lib_group_symbols::run): Report archive information for
6488 incremental links.
6489 * archive.h (class Library_base): New base class.
6490 (class Archive): Derive from Library_base.
6491 (Archive::filename): Move to base class.
6492 (Archive::set_incremental_info): Likewise.
6493 (Archive::incremental_info): Likewise.
6494 (Archive::Should_include): Likewise.
6495 (Archive::should_include_member): Likewise.
6496 (Archive::Armap_entry): Remove.
6497 (Archive::Unused_symbol_iterator): Remove.
6498 (Archive::unused_symbols_begin): Remove.
6499 (Archive::unused_symbols_end): Remove.
6500 (Archive::do_filename): New function.
6501 (Archive::do_get_mtime): New function.
6502 (Archive::do_for_all_unused_symbols): New function.
6503 (Archive::task_): Move to base class.
6504 (Archive::incremental_info_): Likewise.
6505 (class Lib_group): Derive from Library_base.
6506 (Lib_group::do_filename): New function.
6507 (Lib_group::do_get_mtime): New function.
6508 (Lib_group::do_for_all_unused_symbols): New function.
6509 (Lib_group::task_): Move to base class.
6510 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6511 function.
6512 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6513 function.
6514 * incremental.cc (Incremental_inputs::report_archive_begin):
6515 Use Library_base; call library's get_mtime; add incremental inputs
6516 entry before members.
6517 (class Unused_symbol_visitor): New class.
6518 (Incremental_inputs::report_archive_end): Use Library_base; use
6519 visitor class to record unused symbols; don't add incremental inputs
6520 entry after members.
6521 (Incremental_inputs::report_object): Use Library_base.
6522 * incremental.h
6523 (Incremental_archive_entry::Incremental_archive_entry): Remove
6524 unused Archive parameter.
6525 (Incremental_inputs::report_archive_begin): Use Library_base.
6526 (Incremental_inputs::report_archive_end): Likewise.
6527 (Incremental_inputs::report_object): Likewise.
6528 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6529 function.
6530 * object.h (Object::for_all_global_symbols): New function.
6531 (Object::do_for_all_global_symbols): New function.
6532 (Sized_relobj::do_for_all_global_symbols): New function.
6533 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6534 function.
6535 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6536 function.
6537
61ab3e40
ILT
65382011-03-27 Ian Lance Taylor <iant@google.com>
6539
6540 * archive.cc (Archive::interpret_header): Return -1 if something
6541 goes wrong. Change callers accordingly.
6542
30e1f9e6
CC
65432011-03-25 Cary Coutant <ccoutant@google.com>
6544
6545 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6546 * testsuite/Makefile.in: Regenerate.
6547
9370ce59 65482011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6549
6550 * plugin.cc (get_view): New.
6551 (Plugin::load): Pass get_view to the plugin.
6552 (Plugin_manager::get_view): New.
6553
9312bb0a
ILT
65542011-03-21 Ian Lance Taylor <iant@google.com>
6555
6556 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6557 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6558
7e12ba9e
ST
65592011-03-21 Sriraman Tallam <tmsriram@google.com>
6560
6561 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6562 Change == to -eq.
6563 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6564 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6565 Change == to -eq.
6566 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6567 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6568
fd7a005d
ILT
65692011-03-14 Ian Lance Taylor <iant@google.com>
6570
6571 * script-sections.cc (Sort_output_sections::script_compare):
6572 Rename from is_before, change return type.
6573 (Sort_output_sections::operator()): Adjust accordingly.
6574
ed16fd1b
ILT
65752011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6576
6577 PR gold/12572
6578 * testsuite/odr_violation2.cc: Add comment to make all error line
6579 numbers double digits.
6580 * testsuite/debug_msg.sh: Adjust expected errors.
6581
71ff8986
ILT
65822011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6583
6584 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6585 but mark earlier ones as non-canonical
6586 (offset_to_iterator): Update search target and example
6587 (do_addr2line): Return extra lines in a vector*
6588 (format_file_lineno): Extract from do_addr2line
6589 (one_addr2line): Add vector* out-param
6590 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6591 when a lineno entry appeared last for its instruction
6592 (Dwarf_line_info): Add vector* out-param
6593 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6594 * symtab.cc (Odr_violation_compare): Include the lineno in the
6595 comparison again.
6596 (linenos_from_loc): New. Combine the canonical line for an
6597 address with its other lines.
6598 (True_if_intersect): New. Helper functor to make
6599 std::set_intersection a query.
6600 (detect_odr_violations): Compare sets of lines instead of just
6601 one line for each function. This became less deterministic, but
6602 has fewer false positives.
6603 * symtab.h: Declarations.
6604 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6605 mix an optimized and non-optimized object in the same binary
6606 (odr_violation2.so): Same.
6607 * testsuite/Makefile.in: Regenerate from Makefile.am.
6608 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6609 * testsuite/debug_msg.sh: Update line numbers and add
6610 assertions.
6611 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6612 non-optimized context.
6613 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6614 isn't inlined, and use OdrDerived in an optimized context.
6615 * testsuite/odr_header1.h: Defines OdrDerived, where
6616 optimization will change the
6617 first-instruction-in-the-destructor's file and line number.
6618 * testsuite/odr_header2.h: Defines OdrBase.
6619
a19fefdc
ILT
66202011-03-09 Ian Lance Taylor <iant@google.com>
6621
6622 * fileread.cc (File_read::clear_views): Don't delete the whole
6623 file view.
6624
ecb351e9
ILT
66252011-03-08 Ian Lance Taylor <iant@google.com>
6626
6627 PR gold/12525
6628 * fileread.cc: #include <climits>.
6629 (GOLD_IOV_MAX): Define.
6630 (File_read::read_multiple): Limit number of entries by iov_max.
6631 * fileread.h (class File_read): Always set max_readv_entries to
6632 128.
6633
b821d13c
ILT
66342011-03-07 Ian Lance Taylor <iant@google.com>
6635
6636 PR gold/12525
6637 * options.h (class General_options): Add -dy and -dn.
6638
89243142
CC
66392011-03-02 Cary Coutant <ccoutant@google.com>
6640
6641 * testsuite/script_test_9.t: Add TLS segment.
6642
d0773f31
ILT
66432011-03-02 Simon Baldwin <simonb@google.com>
6644
6645 * configure.ac: Add check for gnu_indirect_function support in
6646 the toolchain building binutils.
6647 * configure: Rebuild.
6648
9370ce59 66492011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6650
6651 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6652 plugin only symbols.
6653 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6654 in plugin files as not needed in the symbol table.
6655
4cf7a849
ST
66562011-02-11 Sriraman Tallam <tmsriram@google.com>
6657
6658 * output.cc (Output_section::add_input_section): Delay fill
6659 generation for section ordering.
6660
b578bd7d
ILT
66612011-02-09 Ian Lance Taylor <iant@google.com>
6662
6663 PR gold/12316
6664 * object.h (class Sized_relobj): Remove clear_local_symbols.
6665 * reloc.cc (Sized_relobj::do_relocate): Don't call
6666 clear_local_symbols.
6667
9370ce59 66682011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6669
6670 * plugin.cc (is_visible_from_outside): Return true for symbols
6671 in the -u option.
6672
55382fb7
ILT
66732011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6674
6675 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6676 filename.
6677
4e271fff
ST
66782011-02-02 Sriraman Tallam <tmsriram@google.com>
6679
6680 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6681 to std::string.
4e271fff 6682 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6683 section_name to be std::string.
4e271fff
ST
6684 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6685
d433c3ac
ILT
66862011-01-25 Ian Lance Taylor <iant@google.com>
6687
6688 * script.cc (script_add_extern): Rewrite to use
6689 add_symbol_reference.
6690
880473a6
DK
66912011-01-25 Doug Kwan <dougkwan@google.com>
6692
d433c3ac 6693 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6694
f30f86fa
ILT
66952011-01-24 Ian Lance Taylor <iant@google.com>
6696
6697 * options.h (class General_options): Accept
6698 --no-detect-odr-violations.
6699
8e51a0b9
ILT
67002011-01-24 Ian Lance Taylor <iant@google.com>
6701
6702 * version.cc (version_string): Bump to 1.11.
6703
0f3b89d8
ILT
67042011-01-24 Ian Lance Taylor <iant@google.com>
6705
6706 * plugin.cc (class Plugin_rescan): Define new class.
6707 (Plugin_manager::claim_file): Set any_claimed_.
6708 (Plugin_manager::save_archive): New function.
6709 (Plugin_manager::save_input_group): New function.
6710 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6711 necessary.
6712 (Plugin_manager::new_undefined_symbol): New function.
6713 (Plugin_manager::rescan): New function.
6714 (Plugin_manager::rescannable_defines): New function.
6715 (Plugin_manager::add_input_file): Set any_added_.
6716 * plugin.h (class Plugin_manager): define new fields rescannable_,
6717 undefined_symbols_, any_claimed_, and any_added_. Declare
6718 Plugin_rescan as friend. Declare new functions.
6719 (Plugin_manager::Rescannable): Define type.
6720 (Plugin_manager::Rescannable_list): Define type.
6721 (Plugin_manager::Undefined_symbol_list): Define type.
6722 (Plugin_manager::Plugin_manager): Initialize new fields.
6723 * archive.cc (Archive::defines_symbol): New function.
6724 (Add_archive_symbols::run): Pass archive to plugins if any.
6725 * archive.h (class Archive): Declare defines_symbol.
6726 * readsyms.cc (Input_group::~Input_group): New function.
6727 (Finish_group::run): Pass input_group to plugins if any.
6728 * readsyms.h (class Input_group): Declare destructor.
6729 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6730 any.
6731
3bb951e5
ILT
67322011-01-10 Ian Lance Taylor <iant@google.com>
6733
6734 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6735 section as relro.
6736 (Layout::set_segment_offsets): Reset increase_relro before calling
6737 set_section_addresses a second time.
6738
0aa45fac
CC
67392011-01-04 Cary Coutant <ccoutant@google.com>
6740
6741 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6742 sections before NOBITS sections.
6743
0db46eb4
L
67442011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6745
6746 * version.cc (print_version): Update copyright to 2011.
6747
829c9745
CC
67482010-12-23 Cary Coutant <ccoutant@google.com>
6749
6750 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6751 of OS to this->add. Add OD parameter to second form of the function.
6752
7500420b
ILT
67532010-12-20 Ian Lance Taylor <iant@google.com>
6754
6755 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6756 second of two consecutive entries with same offset.
6757
f8e9a930
RW
67582010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6759
6760 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6761 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6762 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6763 to avoid unneeded links against $(LDADD).
6764 * testsuite/Makefile.in: Regenerate.
6765
2fbb4320
ILT
67662010-12-15 Ian Lance Taylor <iant@google.com>
6767
6768 PR gold/12324
6769 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6770 for R_X86_64_32 and R_X86_64_PC32.
6771 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6772 ver_matching_def_pic.o.
6773 (ver_matching_def_pic.o): New target.
6774
fedb228d
RW
67752010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6776
6777 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6778 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6779 Move definition before File_read::View member definitions.
6780 (File_read::View::~View): Initialize and hold lock before
6781 updating current_mapped_bytes.
6782
9b547ce6
RW
67832010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6784
6785 * dwarf_reader.cc: Remove outdated comment.
6786 * gold-threads.cc: Fix typo in error message.
6787 * archive.cc: Fix typos in comments.
6788 * archive.h: Likewise.
6789 * arm-reloc-property.cc: Likewise.
6790 * arm-reloc-property.h: Likewise.
6791 * arm-reloc.def: Likewise.
6792 * arm.cc: Likewise.
6793 * attributes.h: Likewise.
6794 * cref.cc: Likewise.
6795 * ehframe.cc: Likewise.
6796 * fileread.h: Likewise.
6797 * gold.h: Likewise.
6798 * i386.cc: Likewise.
6799 * icf.cc: Likewise.
6800 * incremental.h: Likewise.
6801 * int_encoding.cc: Likewise.
6802 * layout.h: Likewise.
6803 * main.cc: Likewise.
6804 * merge.h: Likewise.
6805 * object.cc: Likewise.
6806 * object.h: Likewise.
6807 * options.cc: Likewise.
6808 * readsyms.cc: Likewise.
6809 * reduced_debug_output.cc: Likewise.
6810 * reloc.cc: Likewise.
6811 * script-sections.cc: Likewise.
6812 * sparc.cc: Likewise.
6813 * symtab.h: Likewise.
6814 * target-reloc.h: Likewise.
6815 * target.cc: Likewise.
6816 * target.h: Likewise.
6817 * timer.cc: Likewise.
6818 * timer.h: Likewise.
6819 * x86_64.cc: Likewise.
6820
83e17bd5
CC
68212010-12-09 Cary Coutant <ccoutant@google.com>
6822
6823 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6824 stack.
6825 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6826 parameter; change all callers.
6827 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6828 * options.h (warn_execstack): New option.
6829
017257f8
DK
68302010-12-07 Doug Kwan <dougkwan@google.com>
6831
6832 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6833 like function call relocations.
6834
c20cbc06
ILT
68352010-12-07 Ian Lance Taylor <iant@google.com>
6836
6837 * archive.cc (Archive::get_elf_object_for_member): Permit
6838 punconfigured to be NULL.
6839 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6840 (Archive::include_member): Pass NULL to get_elf_object_for_member
6841 if we searched for the archive and this is the first included
6842 object.
6843
4dbfafcc
ILT
68442010-12-01 Ian Lance Taylor <iant@google.com>
6845
6846 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6847 track_relocs_type_ field.
6848 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6849 Set track_relocs_type_.
6850 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6851 contents when using RELA relocs.
6852 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6853 reloc_map_.
6854 * reloc.cc (Track_relocs::next_addend): New function.
6855 * reloc.h (class Track_relocs): Declare next_addend.
6856
e5e19edd
ILT
68572010-12-01 Ian Lance Taylor <iant@google.com>
6858
6859 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6860 virtual destructor.
6861
9a5ce24c
ILT
68622010-12-01 Ian Lance Taylor <iant@google.com>
6863
6864 * README: Update compilers known to work and fail.
6865
c7791212
NC
68662010-11-23 Matthias Klose <doko@ubuntu.com>
6867
6868 * configure.in: For --enable-gold, handle value `default' instead of
6869 `both*'. Always install ld as ld.bfd, install as ld if gold is
6870 not the default.
6871 * configure: Regenerate.
6872
0ad220c9
DK
68732010-11-18 Doug Kwan <dougkwan@google.com>
6874
6875 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6876 and right_alignment to be zero. Store result alignment only if it is
6877 greater than existing alignment.
6878
ab8056e0
CC
68792010-11-16 Cary Coutant <ccoutant@google.com>
6880
6881 PR gold/12220
6882 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6883 Check for ".zdebug_line".
6884
fd064a5b
CC
68852010-11-16 Doug Kwan <dougkwan@google.com>
6886 Cary Coutant <ccoutant@google.com>
6887
6888 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6889 by reference; adjust all callers.
6890 * output.cc (Output_segment::set_section_addresses): Adjust references
6891 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6892 list is empty.
6893 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6894 end at page boundary.
6895
6fc6ea19
CC
68962010-11-16 Cary Coutant <ccoutant@google.com>
6897
6898 PR gold/12220
6899 * layout.cc (Layout::choose_output_section): Transform names of
6900 compressed sections even when using a script with a SECTIONS clause.
6901 (Layout::output_section_name): Remove code to transform
6902 compressed debug section names.
6903 * output.cc (Output_section::add_input_section): Use uncompressed
6904 section size when tracking input sections.
6905
95a2c8d6
RS
69062010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6907
6908 * symtab.h (Symbol::NON_PIC_REF): Remove.
6909 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6910 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6911 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6912 (Symbol::use_plt_offset): Take a flags argument and pass it
6913 directly to needs_dynamic_reloc. Restrict check for undefined
6914 weak symbols to function calls.
6915 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6916 (Target_arm::Scan::global): Use it.
6917 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6918 (Target_arm::Relocate::relocate): Likewise.
6919 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6920 parameter with an r_type parameter. Use get_reference_flags
6921 to get the flags.
6922 (Target_arm::Relocate::relocate): Update accordingly.
6923 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6924 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6925 (Target_i386::Scan::global): Likewise.
6926 (Target_i386::Relocate::relocate): Likewise.
6927 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6928 parameter with an r_type parameter. Use get_reference_flags
6929 to get the flags.
6930 (Target_i386::Relocate::relocate): Update accordingly.
6931 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6932 (Target_powerpc::Scan::global): Use it.
6933 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6934 (Target_powerpc::Relocate::relocate): Likewise.
6935 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6936 (Target_sparc::Scan::global): Use it.
6937 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6938 (Target_sparc::Relocate::relocate): Likewise.
6939 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6940 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6941 (Target_x86_64::Scan::global): Likewise.
6942 (Target_x86_64::Relocate::relocate): Likewise.
6943
f625ae50
DK
69442010-11-08 Doug Kwan <dougkwan@google.com>
6945 Cary Coutant <ccoutant@google.com>
6946
6947 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6948 (Arm_exidx_merge_section::section_contents_): New data member.
6949 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6950 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6951 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6952 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6953 in parameters instead of calling Object::section_contents without
6954 locking.
6955 (Arm_output_section::group_section): New parameter TASK. Pass it
6956 to callees that need locking objects.
6957 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6958 to lock EXIDX input sections. Fix a formatting issue. Call
6959 Arm_exidx_merged_section::build_contents to create merged section
6960 contents.
6961 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6962 to lock object of stub table owner.
6963 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6964 TEXT_SIZE to initialize data member TEXT_SIZE_.
6965 (Arm_exidx_input_section::addralign): Fix typo in comment.
6966 (Arm_exidx_input_section::text_size): New method.
6967 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6968 that require locking objects. Lock objects before scanning for stubs
6969 and updating local symbols.
6970 (Arm_input_section<big_endian>::init): Copy contents of original
6971 input section.
2e702c99 6972 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6973 original input section instead of calling Object::section_contents
6974 without locking.
6975 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6976 size without calling Object::section_size().
6977 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6978 for size. Allocate a buffer for merged EXIDX entries.
6979 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6980 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6981 building code to Arm_exidx_merged_section::build_contetns. Write
6982 out contetns in buffer instead of building it on the fly.
6983 (Arm_relobj::make_exidx_input_section): Also pass text section size
6984 to Arm_exidx_input_section constructor.
6985 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6986 (Arm_dynobj::do_read_symbols): Fix memory leak.
6987 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6988 * target.h: (class Task): Add forward declaration.
6989 (Target::relax): Add new parameter TASK and pass it to
6990 Target::do_relax().
6991 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6992
5f9bcf58
CC
69932010-11-05 Cary Coutant <ccoutant@google.com>
6994
6995 PR gold/10708
6996 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6997 object when reading from the file.
6998 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6999 second layout pass.
7000 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7001 when reading section contents.
7002 (get_section_contents): Likewise.
7003 (icf::find_identical_sections): Likewise.
7004 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7005 object when reading from the file.
7006 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7007 the object when doing deferred section layout.
7008
e597fa08
NC
70092010-11-03 Nick Clifton <nickc@redhat.com>
7010
7011 PR gold/12001
7012 * script.h (class Symbol_assignment: name): New member. Returns
7013 the name of the symbol.
7014 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7015 Returns true if the given symbol name is on the list of
7016 assignments wating to be processed.
7017 * archive.cc (should_incldue_member): If the symbol is undefined,
7018 check to see if it is on the list of symbols pending assignment.
7019
3f9a3278
ILT
70202010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7021
7022 * script-sections.cc (Script_sections::find_memory_region): Check
7023 for a NULL output section pointer.
7024
d06fb4d1
DK
70252010-10-29 Doug Kwan <dougkwan@google.com>
7026
7027 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7028 Output_section::add_relaxed_input_section.
7029 * output.cc (Output_section::add_relaxed_input_section): Add new
7030 arguments LAYOUT and NAME. Set section order index.
7031 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7032 Copy section order index.
7033 * output.h (Output_section::add_relaxed_input_section): Add new
7034 arguments LAYOUT and NAME.
7035
90e24de5
ILT
70362010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7037
7038 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7039 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7040 * testsuite/Makefile.in: Regenerate.
7041
c9484ea5
DK
70422010-10-20 Doug Kwan <dougkwan@google.com>
7043
7044 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7045 without SHF_LINK_ORDER flags.
7046 * layout.cc (Layout::choose_output_section): Do not filter
7047 SHF_LINK_ORDER flag in a relocatable link.
7048
5bc2f5be
CC
70492010-10-17 Cary Coutant <ccoutant@google.com>
7050
7051 * output.h (Output_segment::set_section_addresses): Change function
7052 signature. Update all callers.
7053 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7054 sections.
7055 (Output_segment::set_section_addresses): Align after last TLS
7056 section. Add padding before last relro section instead of after.
7057
0c91cf04
DK
70582010-10-17 Doug Kwan <dougkwan@google.com>
7059
7060 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7061 GOT output section to be writable.
7062
8c21d9d3
CC
70632010-10-14 Cary Coutant <ccoutant@google.com>
7064
7065 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7066 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7067 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7068 mode.
7069 * incremental.cc (report_command_line): Ignore all forms of
7070 --incremental.
7071 * layout.cc (Layout::Layout): Check parameters for incremental link
7072 mode.
7073 * options.cc (General_options::parse_incremental): New function.
7074 (General_options::parse_no_incremental): New function.
7075 (General_options::parse_incremental_full): New function.
7076 (General_options::parse_incremental_update): New function.
7077 (General_options::incremental_mode_): New data member.
7078 (General_options::finalize): Check incremental_mode_.
7079 * options.h (General_options): Update help text for --incremental.
7080 Add --no-incremental, --incremental-full, --incremental-update.
7081 (General_options::Incremental_mode): New enum type.
7082 (General_options::incremental_mode): New function.
7083 (General_options::incremental_mode_): New data member.
7084 * parameters.cc (Parameters::incremental_mode_): New data member.
7085 (Parameters::set_options): Set incremental_mode_.
7086 (Parameters::set_incremental_full): New function.
7087 (Parameters::incremental): New function.
7088 (Parameters::incremental_update): New function.
7089 (set_parameters_incremental_full): New function.
7090 * parameters.h (Parameters::set_incremental_full): New function.
7091 (Parameters::incremental): New function.
7092 (Parameters::incremental_update): New function.
7093 (Parameters::incremental_mode_): New data member.
7094 (set_parameters_incremental_full): New function.
7095 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7096 incremental link mode.
7097 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7098 (Sized_relobj::do_relocate_sections): Likewise.
7099 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7100 option.
7101 * testsuite/Makefile.in: Regenerate.
7102 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7103
bb32aa18 71042010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7105
7106 * script-sections.h (class Script_sections): Make
7107 Sections_elements typedef public.
7108 * script-sections.cc (class Sort_output_sections): Add elements_
7109 field. Add constructor which sets it; change all callers.
7110 (Sort_output_sections::is_before): New function.
7111 (Sort_output_sections::operator()): Call is_before.
7112 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7113 conditional.
7114 * testsuite/script_test_10.sh: New test. Test script section
7115 order.
7116 * testsuite/script_test_10.t: Likewise.
7117 * testsuite/script_test_10.s: Likewise.
7118 * testsuite/Makefile.am: Wrap the cross linker tests and the
7119 common tests into NATIVE_OR_CROSS_LINKER.
7120 (check_SCRIPTS): Add script_test_10.sh.
7121 (check_DATA): Add script_test_10.stdout.
7122 (script_test_10.o, script_test_10): New targets.
7123 (script_test_10.stdout): New target.
7124 * configure, testsuite/Makefile.in: Regenerate.
7125
3cef7179
ILT
71262010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7127
7128 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7129 error for the deprecated relocations.
7130 (Target_arm::Scan::global): Likewise.
7131 (Target_arm::Relocate::relocate): Likewise.
7132
7411e9a8
RS
71332010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7134
7135 * fileread.cc (Input_file::find_file): Initialize *found_name
7136 and *namep when using the fallback search for case 4.
7137
6a9da32a
CC
71382010-10-11 Cary Coutant <ccoutant@google.com>
7139
7140 * options.h (class General_options): Redefine -z lazy as an alias for
7141 the negation of -z now.
7142
ac897c20
ILT
71432010-10-11 Ian Lance Taylor <iant@google.com>
7144
7145 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7146 binding.
7147
ea5cae92
NC
71482010-10-06 Nick Clifton <nickc@redhat.com>
7149
7150 * script-sections.cc(class Memory_region): Remove
7151 current_lma_offset_ field. Rename current_vma_offset_ to
7152 current_offset_. Add last_section_ field.
7153 (Memory_region::get_current_vma_address): Rename to
7154 get_current_address.
7155 (Memory_region::get_current_lma_address): Delete.
7156 (Memory_region::increment_vma_offset): Rename to
7157 increment_offset.
7158 (Memory_region::increment_lma_offset): Delete.
7159 (Memory_region::attributes_compatible): New method. Returns
7160 true if the provided section is compatible with the region.
7161 (Memory_region::get_last_section): New method. Returns the last
7162 section to use the region.
7163 (Memory_region::set_last_section): New method. Stores the last
7164 section to use the region.
7165 (Script_sections::block_in_region): New method. Returns true if
7166 a block of memory is contained within a region.
7167 (Script_sections::find_memory_region): New method. Locates a
7168 memory region to be used to set a VMA or LMA address.
7169 (Output_section_definition::set_section_addresses): Add code to
7170 check for addresses set by memory regions.
7171 (Output_segment::set_section_addresses): Remove memory region
7172 walking code.
7173 (Script_sections::create_segment): Add a warning if a header
7174 segment is created outside of any region.
7175 * script-sections.h (class Script_sections): Add prototypes for
7176 find_memory_region and block_in_region methods.
7177 * testsuite/memory_test.s: Use .long instead of .word.
7178 * testsuite/memory_test.t: Add some more output sections.
7179 * testsuite/memory_test.sh: Update expected output.
7180
a9bfd952
DK
71812010-10-02 Doug Kwan <dougkwan@google.com>
7182
7183 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7184 defintion to symtab.h
7185 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7186 declaration to defintion.
7187
bacff3ab
NC
71882010-10-01 Nick Clifton <nickc@redhat.com>
7189
7190 * expression.cc (eval): Replace dummy argument with NULL.
7191 (eval_maybe_dot): Check for a NULL result section pointer.
7192 (Symbol_expression::value): Likewise.
7193 (Dot_expression::value): Likewise.
7194 (BINARY_EXPRESSION): Likewise.
7195 (Max_expression::value): Likewise.
7196 (Min_expression::value): Likewise.
7197 (Absolute_expression::value): Likewise.
7198 (Addr_expression::value_from_output_section): Likewise.
7199 (Loaddddr_expression::value_from_output_section): Likewise.
7200 (Segment_start_expression::value): Likewise.
7201 * script-sections.cc
7202 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7203 argument with NULL.
7204 (Sections_elememt_dot_assignment::set_section_addresses):
7205 Likewise.
7206 (Output_data_expression::do_write_to_buffer): Likewise.
7207 (Output_section_definition::finalize_symbols): Likewise.
7208 (Output_section_definition::set_section_addresses): Likewise.
7209
f81bc8b5
DK
72102010-09-30 Doug Kwan <dougkwan@google.com>
7211
7212 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7213
c95e9f27
ST
72142010-09-28 Sriraman Tallam <tmsriram@google.com>
7215
7216 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7217 function.
c95e9f27
ST
7218 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7219 virtual function.
7220 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7221 virtual function.
7222 * icf.cc (get_section_contents): Inline merge sections only when
7223 target allows it.
7224
3cac54d2
RW
72252010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7226
7227 * configure: Regenerate.
7228
2904037a
ILT
72292010-09-17 Ian Lance Taylor <iant@google.com>
7230
7231 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7232 * testsuite/Makefile.am (memory_test.o): New target.
7233 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7234 memory_test.t.
7235 * testsuite/Makefile.in: Rebuild.
2904037a 7236
bca7fb63
DK
72372010-09-17 Doug Kwan <dougkwan@google.com>
7238
7239 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7240 defintion if relocation uses GOT entries of the symbol.
7241 * testsuite/icf_safe_test.sh: Fix test.
7242 * testsuite/icf_safe_so_test.sh: Fix test.
7243
4ef28648
CC
72442010-09-16 Cary Coutant <ccoutant@google.com>
7245
7246 * script_sections.cc (class Memory_region): Remove "NULL" from
7247 vector initializations.
7248
793990de
CC
72492010-09-15 Cary Coutant <ccoutant@google.com>
7250
7251 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7252 Resolve forwarding symbols.
7253
81e015e2
DK
72542010-09-15 Doug Kwan <dougkwan@google.com>
7255
7256 * gold/testsuite/script_test_3.t: Add ARM special sections.
7257 * gold/testsuite/script_test_4.t: Same.
7258 * gold/testsuite/script_test_5.t: Same.
7259 * gold/testsuite/script_test_6.t: Same.
7260 * gold/testsuite/script_test_7.t: Same.
7261 * gold/testsuite/script_test_7.t: Same.
7262 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7263
36171d64
CC
72642010-09-14 Cary Coutant <ccoutant@google.com>
7265
7266 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7267 (Target_x86_64::Relocate::relocate_tls): Replace check for
7268 saw_tls_block_reloc_ with test for executable section.
7269
d89051bd
CC
72702010-09-12 Cary Coutant <ccoutant@google.com>
7271
7272 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7273 position-independent executables to shared libraries need dynamic
7274 relocations.
7275 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7276 position-independent executables.
7277 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7278 * testsuite/Makefile.in: Regenerate.
7279
fca41f0f
NC
72802010-09-10 Nick Clifton <nickc@redhat.com>
7281
7282 PR gold/11997
7283 * testsuite/memory_test.t: Discard any sections that are not
7284 needed.
7285
6695e4b3
L
72862010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7287
7288 PR gold/11996
7289 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7290 "This::" to work around a bug in gcc 4.2.
7291
7292 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7293
0f72bf6f
RÁE
72942010-09-09 Rafael Espindola <espindola@google.com>
7295
7296 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7297 sections with different PF_X flags in the same segment.
7298 (Layout::find_first_load_seg): Search all segments to find the first
7299 one.
7300 * options.h (rosegment): New.
7301
73022010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7303
05a79166 7304 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7305
aa98ff75
DK
73062010-09-08 Doug Kwan <dougkwan@google.com>
7307
7308 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7309 (Arm_relobj::do_relocate_sections): Add new parameter for output
7310 file to match the parent.
7311 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7312 of local symbols instead of input values. Update code to track
7313 changes in gold::relocate_section.
7314 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7315 (Sized_relobj::compute_final_local_value_internal): New methods.
7316 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7317 body into private version of Sized_relobj::compute_final_local_value.
7318 Call the inline method.
7319 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7320 merged symbol value if there is one.
7321 (Symbol_value::has_output_value): New method defintiion.
7322 (Sized_relobj::Compute_final_local_value_status): New enum type.
7323 (Sized_relobj::compute_final_local_value): New methods.
7324 (Sized_relobj::compute_final_local_value_internal): New methods.
7325 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7326 and arm_cortex_a8.sh.
7327 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7328 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7329 New tests.
7330 * Makefile.in: Regenerate.
7331 * testsuite/arm_bl_out_of_range.s: Update test.
7332 * testsuite/thumb_bl_out_of_range.s: Ditto.
7333 * testsuite/thumb_blx_out_of_range.s: Ditto.
7334 * testsuite/arm_branch_out_of_range.sh: New file.
7335 * testsuite/arm_cortex_a8.sh: Ditto.
7336 * testsuite/arm_cortex_a8_b.s: Ditto.
7337 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7338 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7339 * testsuite/arm_cortex_a8_bl.s: Ditto.
7340 * testsuite/arm_cortex_a8_blx.s: Ditto.
7341 * testsuite/arm_cortex_a8_local.s: Ditto.
7342 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7343 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7344
05a79166
L
73452010-09-08 Rafael Espindola <espindola@google.com>
7346
7347 * Makefile.am (memory_test.stdout): Run readelf with -W.
7348 * Makefile.in: Regenerate.
7349 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7350 64 bit output.
7351
33dbc701
RÁE
73522010-09-08 Rafael Espindola <espindola@google.com>
7353
7354 * script-sections.cc (Script_sections::add_memory_region): Convert
7355 field precision to int.
7356 * script.cc (script_set_section_region, script_set_section_region):
7357 Convert field precision to int.
7358
731ca54a
RÁE
73592010-09-08 Rafael Espindola <espindola@google.com>
7360
7361 * arm.cc (do_finalize_sections): Create the __exidx_start and
7362 __exdix_end symbols even when the section is missing.
7363
7f8cd844
NC
73642010-09-08 Nick Clifton <nickc@redhat.com>
7365
7366 * README: Remove claim that MEMORY is not supported.
7367 * expression.cc (script_exp_function_origin)
7368 (script_exp_function_length): Move from here to ...
7369 * script.cc: ... here.
7370 (script_set_section_region, script_add_memory)
7371 (script_parse_memory_attr, script_include_directive): New
7372 functions.
7373 * script-sections.cc
7374 (class Memory_region): New class.
7375 (class Output_section_definition): Add set_memory_region,
7376 set_section_vma, set_section_lma and get_section_name methods.
7377 (class Script_Sections): Add add_memory_region,
7378 find_memory_region, find_memory_region_origin,
7379 find_memory_region_length and set_memory_region methods.
7380 Have set_section_addresses method walk the list of set memory
7381 regions.
7382 Extend the print methos to display memory regions.
7383 * script-sections.h: Add prototypes for new methods.
7384 Add enum for MEMORY region attributes.
7385 * yyscript.y: Add support for parsing MEMORY regions.
7386 * script-c.h: Add prototypes for new functions.
7387 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7388 * testsuite/Makefile.in: Regenerate.
7389 * testsuite/memory_test.sh: New script.
7390 * testsuite/memory_test.s: New assembler source file.
7391 * testsuite/memory_test.t: New linker script.
7392
a4649286
DK
73932010-08-27 Doug Kwan <dougkwan@google.com>
7394
7395 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7396 reference override an existing dynamic weak reference.
7397 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7398 * testsuite/Makefile.in: Regenerate.
7399 * testsuite/dyn_weak_ref.sh: New file.
7400 * testsuite/dyn_weak_ref_1.c: Ditto.
7401 * testsuite/dyn_weak_ref_2.c: Ditto.
7402
b56648ad
ILT
74032010-08-27 Ian Lance Taylor <iant@google.com>
7404
7405 * incremental.h (class Incremental_input_entry): Add virtual
7406 destructor.
7407
809313cb
ILT
74082010-08-27 Ian Lance Taylor <iant@google.com>
7409
7410 * testsuite/start_lib_test_3.c: Mark t3 as used.
7411
11e32464
NC
74122010-08-27 Nick Clifton <nickc@redhat.com>
7413
7414 * options.cc (version_script): Fix small typo in previous
7415 whitespace tidyup.
7416
ca09d69a
NC
74172010-08-25 Nick Clifton <nickc@redhat.com>
7418
7419 * archive.cc: Formatting fixes: Remove whitespace between
7420 typename and following asterisk. Remove whitespace between
7421 function name and opening parenthesis.
7422 * archive.h: Likewise.
7423 * arm.cc: Likewise.
7424 * attributes.cc: Likewise.
7425 * attributes.h: Likewise.
7426 * common.cc: Likewise.
7427 * copy-relocs.cc: Likewise.
7428 * dirsearch.h: Likewise.
7429 * dynobj.cc: Likewise.
7430 * ehframe.cc: Likewise.
7431 * ehframe.h: Likewise.
7432 * expression.cc: Likewise.
7433 * fileread.cc: Likewise.
7434 * fileread.h: Likewise.
7435 * gc.h: Likewise.
7436 * gold-threads.cc: Likewise.
7437 * gold.cc: Likewise.
7438 * i386.cc: Likewise.
7439 * icf.h: Likewise.
7440 * incremental-dump.cc: Likewise.
7441 * incremental.cc: Likewise.
7442 * layout.cc: Likewise.
7443 * layout.h: Likewise.
7444 * main.cc: Likewise.
7445 * merge.cc: Likewise.
7446 * merge.h: Likewise.
7447 * object.cc: Likewise.
7448 * object.h: Likewise.
7449 * options.cc: Likewise.
7450 * options.h: Likewise.
7451 * output.cc: Likewise.
7452 * output.h: Likewise.
7453 * plugin.cc: Likewise.
7454 * plugin.h: Likewise.
7455 * powerpc.cc: Likewise.
7456 * reloc.cc: Likewise.
7457 * script-c.h: Likewise.
7458 * script-sections.cc: Likewise.
7459 * script.cc: Likewise.
7460 * stringpool.cc: Likewise.
7461 * symtab.cc: Likewise.
7462 * symtab.h: Likewise.
7463 * target.cc: Likewise.
7464 * timer.cc: Likewise.
7465 * timer.h: Likewise.
7466 * version.cc: Likewise.
7467 * x86_64.cc: Likewise.
7468
b8fa8750
NC
74692010-08-24 Nick Clifton <nickc@redhat.com>
7470
7471 PR 11899
7472 * layout.cc (segment_precedes): Sort segments by their physical
7473 addresses, if they have been set.
7474
9919d93b
CC
74752010-08-23 Cary Coutant <ccoutant@google.com>
7476
7477 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7478 symbols data.
7479 (Lib_group::include_member): Unlock object after deleting its
7480 symbols data.
7481 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7482 the bug fixed here.
7483
97b4be1c
CC
74842010-08-19 Neil Vachharajani <nvachhar@google.com>
7485 Cary Coutant <ccoutant@google.com>
7486
7487 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7488 constructor, and set_blocker.
7489 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7490 readsyms_blocker_.
7491 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7492 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7493 * testsuite/Makefile.am (start_lib_test): New test case.
7494 * testsuite/Makefile.in: Regenerate.
7495 * testsuite/start_lib_test_main.c: New file.
7496 * testsuite/start_lib_test_1.c: New file.
7497 * testsuite/start_lib_test_2.c: New file.
7498 * testsuite/start_lib_test_3.c: New file.
7499
dd0b1884
ILT
75002010-08-19 Ian Lance Taylor <iant@google.com>
7501
7502 * Makefile.in: Rebuild with automake 1.11.1.
7503 * aclocal.m4: Likewise.
7504 * testsuite/Makefile.in: Likewise.
7505
7223e9ca
ILT
75062010-08-19 Ian Lance Taylor <iant@google.com>
7507
7508 PR 10893
7509 * i386.cc (class Output_data_plt_i386): Update declarations.
7510 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7511 local_ifuncs_ fields.
7512 (Target_i386::do_plt_section_for_global): New function.
7513 (Target_i386::do_plt_section_for_local): New function.
7514 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7515 parameter; change all callers. Initialize global_ifuncs_ and
7516 local_ifuncs_. If doing a static link define __rel_iplt_start and
7517 __rel_iplt_end.
7518 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7519 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7520 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7521 symbols.
7522 (Target_i386::make_plt_section): New function, broken out of
7523 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7524 (Target_i386::make_plt_entry): Call make_plt_section.
7525 (Target_i386::make_local_ifunc_plt_entry): New function.
7526 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7527 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7528 R_386_IRELATIVE to switch.
7529 (Target_i386::Scan::global): Likewise.
7530 (Target_i386::Relocate::relocate): Likewise.
7531 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7532 switch.
7533 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7534 (Target_x86_64::do_plt_section_for_global): New function.
7535 (Target_x86_64::do_plt_section_for_local): New function.
7536 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7537 parameter; change all callers. If doing a static link define
7538 __rela_iplt_start and __rela_iplt_end.
7539 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7540 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7541 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7542 to point to .plt.
7543 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7544 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7545 switch.
7546 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7547 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7548 R_X86_64_IRELATIVE to switch.
7549 (Target_x86_64::Scan::global): Likewise.
7550 (Target_x86_64::Relocate::relocate): Likewise.
7551 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7552 switch.
7553 * target.h (class Target): Add plt_section_for_global and
7554 plt_section_for_local functions. Add do_plt_section_for_global
7555 and do_plt_section_for_local virtual functions.
7556 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7557 clarifying comments.
7558 (Symbol::use_plt_offset): Handle IFUNC symbol.
7559 * object.cc (Sized_relobj::Sized_relobj): Initialize
7560 local_plt_offsets_.
7561 (Sized_relobj::local_has_plt_offset): New function.
7562 (Sized_relobj::local_plt_offset): New function.
7563 (Sized_relobj::set_local_plt_offset): New function.
7564 (Sized_relobj::do_count): Handle IFUNC symbol.
7565 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7566 a bit away from input_shndx_ field. Add set_is_func_symbol and
7567 is_ifunc_symbol functions.
7568 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7569 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7570 local_plt_offsets_ field.
7571 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7572 * output.h (class Output_section_data): Add non-const
7573 output_section function.
7574 (class Output_data_got): Update declarations.
7575 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7576 Add use_plt_offset parameter to global and local constructors.
7577 Change all callers. Change local_sym_index_ field to 31 bits.
7578 Change GSYM_CODE and CONSTANT_CODE accordingly.
7579 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7580 doing a static link don't set sh_link field.
7581 (Output_data_got::Got_entry::write): Use PLT offset if
7582 appropriate.
7583 (Output_data_got::add_global_plt): New function.
7584 (Output_data_got::add_local_plt): New function.
7585 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7586 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7587 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7588 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7589 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7590 IFUNC conditional.
7591 * testsuite/ifunc-sel.h: New file.
7592 * testsuite/ifuncmain1.c: New file.
7593 * testsuite/ifuncmain1vis.c: New file.
7594 * testsuite/ifuncmod1.c: New file.
7595 * testsuite/ifuncdep2.c: New file.
7596 * testsuite/ifuncmain2.c: New file.
7597 * testsuite/ifuncmain3.c: New file.
7598 * testsuite/ifuncmod3.c: New file.
7599 * testsuite/ifuncmain4.c: New file.
7600 * testsuite/ifuncmain5.c: New file.
7601 * testsuite/ifuncmod5.c: New file.
7602 * testsuite/ifuncmain6pie.c: New file.
7603 * testsuite/ifuncmod6.c: New file.
7604 * testsuite/ifuncmain7.c: New file.
7605 * configure, testsuite/Makefile.in: Rebuild.
7606
56f75c03
ILT
76072010-08-18 Ian Lance Taylor <iant@google.com>
7608
7609 * incremental.cc
7610 (Output_section_incremental_inputs::write_input_files): Add cast
7611 to avoid signed/unsigned comparison warning.
7612 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7613
55455f89
CC
76142010-08-12 Cary Coutant <ccoutant@google.com>
7615
7616 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7617
e2054bcb
ILT
76182010-08-13 Ian Lance Taylor <iant@google.com>
7619
7620 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7621
74f67560
DK
76222010-08-12 Cary Coutant <ccoutant@google.com>
7623 Doug Kwan <dougkwan@google.com>
7624
7625 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7626 defintion overrides non-weak undef, remember that the original undef
7627 is not weak.
7628 * symtab.cc (Symbol_table::sized_write_global): For undef without
7629 an original weak binding, set binding to global in output.
7630 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7631 * testsuite/Makefile.in: Regenerate.
7632 * testsuite/strong_ref_weak_def.sh: New file.
7633 * testsuite/strong_ref_weak_def_1.c: Ditto.
7634 * testsuite/strong_ref_weak_def_2.c: Ditto.
7635
d1238d12
CC
76362010-08-12 Cary Coutant <ccoutant@google.com>
7637
7638 * testsuite/incremental_test.sh: Rewrite.
7639 * testsuite/incremental_test_1.c: Rewrite.
7640 * testsuite/incremental_test_2.c: Rewrite.
7641
0e70b911
CC
76422010-08-12 Cary Coutant <ccoutant@google.com>
7643
7644 * arm.cc (Target_arm::got_size): Add const.
7645 (Target_arm::got_entry_count): New function.
7646 (Target_arm::plt_entry_count): New function.
7647 (Target_arm::first_plt_entry_offset): New function.
7648 (Target_arm::plt_entry_size): New function.
7649 (Output_data_plt_arm::entry_count): New function.
7650 (Output_data_plt_arm::first_plt_entry_offset): New function.
7651 (Output_data_plt_arm::get_plt_entry_size): New function.
7652 * i386.cc (Target_i386::got_size): Add const.
7653 (Target_i386::got_entry_count): New function.
7654 (Target_i386::plt_entry_count): New function.
7655 (Target_i386::first_plt_entry_offset): New function.
7656 (Target_i386::plt_entry_size): New function.
7657 (Output_data_plt_i386::entry_count): New function.
7658 (Output_data_plt_i386::first_plt_entry_offset): New function.
7659 (Output_data_plt_i386::get_plt_entry_size): New function.
7660 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7661 find_incremental_inputs_sections. Dump incremental_got_plt section.
7662 * incremental.cc: Include target.h.
7663 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7664 parameter. Adjust all callers. Find incremental_got_plt section.
7665 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7666 section.
7667 (Output_section_incremental_inputs::set_final_data_size): Calculate
7668 size of incremental_got_plt section.
7669 (Output_section_incremental_inputs::do_write): Write the
7670 incremental_got_plt section.
7671 (Got_plt_view_info): New struct.
7672 (Local_got_offset_visitor): New class.
7673 (Global_got_offset_visitor): New class.
7674 (Global_symbol_visitor_got_plt): New class.
7675 (Output_section_incremental_inputs::write_got_plt): New function.
7676 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7677 Add parameter. Adjust all callers.
7678 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7679 (Incremental_inputs::got_plt_section): New function.
7680 (Incremental_inputs::got_plt_section_): New data member.
7681 (Incremental_got_plt_reader): New class.
7682 * layout.cc (Layout::create_incremental_info_sections): Add the
7683 incremental_got_plt section.
7684 * object.h (Got_offset_list::get_list): New function.
7685 (Got offset_list::for_all_got_offsets): New function.
7686 (Sized_relobj::local_got_offset_list): New function.
7687 * powerpc.cc (Target_powerpc::got_size): Add const.
7688 (Target_powerpc::got_entry_count): New function.
7689 (Target_powerpc::plt_entry_count): New function.
7690 (Target_powerpc::first_plt_entry_offset): New function.
7691 (Target_powerpc::plt_entry_size): New function.
7692 (Output_data_plt_powerpc::entry_count): New function.
7693 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7694 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7695 * sparc.cc (Target_sparc::got_size): Add const.
7696 (Target_sparc::got_entry_count): New function.
7697 (Target_sparc::plt_entry_count): New function.
7698 (Target_sparc::first_plt_entry_offset): New function.
7699 (Target_sparc::plt_entry_size): New function.
7700 (Output_data_plt_sparc::entry_count): New function.
7701 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7702 (Output_data_plt_sparc::get_plt_entry_size): New function.
7703 * symtab.h (Symbol::got_offset_list): New function.
7704 (Symbol_table::for_all_symbols): New function.
7705 * target.h (Sized_target::got_entry_count): New function.
7706 (Sized_target::plt_entry_count): New function.
7707 (Sized_target::plt_entry_size): New function.
7708 * x86_64.cc (Target_x86_64::got_size): Add const.
7709 (Target_x86_64::got_entry_count): New function.
7710 (Target_x86_64::plt_entry_count): New function.
7711 (Target_x86_64::first_plt_entry_offset): New function.
7712 (Target_x86_64::plt_entry_size): New function.
7713 (Output_data_plt_x86_64::entry_count): New function.
7714 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7715 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7716
09ec0418
CC
77172010-08-12 Cary Coutant <ccoutant@google.com>
7718
7719 * archive.cc: Include incremental.h.
7720 (Archive::Archive): Initialize incremental_info_.
7721 (Archive::include_member): Record archive members in incremental info.
7722 (Add_archive_symbols::run): Record begin and end of an archive in
7723 incremental info.
7724 (Lib_group::include_member): Record objects in incremental info.
7725 * archive.h (Incremental_archive_entry): Forward declaration.
7726 (Archive::set_incremental_info): New member function.
7727 (Archive::incremental_info): New member function.
7728 (Archive::Unused_symbol_iterator): New class.
7729 (Archive::unused_symbols_begin): New member function.
7730 (Archive::unused_symbols_end): New member function.
7731 (Archive::incremental_info_): New data member.
7732 * incremental-dump.cc (find_input_containing_global): New function.
7733 (dump_incremental_inputs): Dump new incremental info sections.
7734 * incremental.cc: Include symtab.h.
7735 (Output_section_incremental_inputs): New class.
7736 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7737 new incremental info sections.
7738 (Sized_incremental_binary::do_check_inputs): Likewise.
7739 (Incremental_inputs::report_archive): Remove.
7740 (Incremental_inputs::report_archive_begin): New function.
7741 (Incremental_inputs::report_archive_end): New function.
7742 (Incremental_inputs::report_object): New function.
7743 (Incremental_inputs::finalize_inputs): Remove.
7744 (Incremental_inputs::report_input_section): New function.
7745 (Incremental_inputs::report_script): Rewrite.
7746 (Incremental_inputs::finalize): Do nothing but finalize string table.
7747 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7748 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7749 (Incremental_inputs::create_data_sections): New function.
7750 (Incremental_inputs::relocs_entsize): New function.
7751 (Output_section_incremental_inputs::set_final_data_size): New function.
7752 (Output_section_incremental_inputs::do_write): New function.
7753 (Output_section_incremental_inputs::write_header): New function.
7754 (Output_section_incremental_inputs::write_input_files): New function.
7755 (Output_section_incremental_inputs::write_info_blocks): New function.
7756 (Output_section_incremental_inputs::write_symtab): New function.
7757 * incremental.h (Incremental_script_entry): Forward declaration.
7758 (Incremental_object_entry): Forward declaration.
7759 (Incremental_archive_entry): Forward declaration.
7760 (Incremental_inputs): Forward declaration.
7761 (Incremental_inputs_header_data): Remove.
7762 (Incremental_inputs_header): Remove.
7763 (Incremental_inputs_header_write): Remove.
7764 (Incremental_inputs_entry_data): Remove.
7765 (Incremental_inputs_entry): Remove.
7766 (Incremental_inputs_entry_write): Remove.
7767 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7768 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7769 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7770 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7771 Likewise.
7772 (Incremental_input_entry): New class.
7773 (Incremental_script_entry): New class.
7774 (Incremental_object_entry): New class.
7775 (Incremental_archive_entry): New class.
7776 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7777 (Incremental_inputs::report_inputs): Remove.
7778 (Incremental_inputs::report_archive): Remove.
7779 (Incremental_inputs::report_archive_begin): New function.
7780 (Incremental_inputs::report_archive_end): New function.
7781 (Incremental_inputs::report_object): Change prototype.
7782 (Incremental_inputs::report_input_section): New function.
7783 (Incremental_inputs::report_script): Change prototype.
7784 (Incremental_inputs::get_reloc_count): New function.
7785 (Incremental_inputs::set_reloc_count): New function.
7786 (Incremental_inputs::create_data_sections): New function.
7787 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7788 (Incremental_inputs::inputs_section): New function.
7789 (Incremental_inputs::symtab_section): New function.
7790 (Incremental_inputs::relocs_section): New function.
7791 (Incremental_inputs::get_stringpool): Add const.
7792 (Incremental_inputs::command_line): Add const.
7793 (Incremental_inputs::inputs): Remove.
7794 (Incremental_inputs::command_line_key): New function.
7795 (Incremental_inputs::input_file_count): New function.
7796 (Incremental_inputs::input_files): New function.
7797 (Incremental_inputs::relocs_entsize): New function.
7798 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7799 (Incremental_inputs::finalize_inputs): Remove.
7800 (Incremental_inputs::Input_info): Remove.
7801 (Incremental_inputs::lock_): Remove.
7802 (Incremental_inputs::inputs_): Change type.
7803 (Incremental_inputs::inputs_map_): Remove.
7804 (Incremental_inputs::current_object_entry_): New data member.
7805 (Incremental_inputs::inputs_section_): New data member.
7806 (Incremental_inputs::symtab_section_): New data member.
7807 (Incremental_inputs::relocs_section_): New data member.
7808 (Incremental_inputs::reloc_count_): New data member.
7809 (Incremental_inputs_reader): New class.
7810 (Incremental_symtab_reader): New class.
7811 (Incremental_relocs_reader): New class.
7812 * layout.cc (Layout::finalize): Move finalization of incremental info
7813 and creation of incremental info sections to follow finalization of
7814 symbol table. Set offsets for postprocessing sections.
7815 (Layout::create_incremental_info_sections): Call
7816 Incremental_inputs::create_data_sections. Add incremental symtab
7817 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7818 sections to layout after input sections.
7819 * layout.h (struct Timespec): Forward declaration.
7820 (Layout::incremental_inputs): Add const.
7821 (Layout::create_incremental_info_sections): Add parameter.
7822 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7823 * object.cc: Include incremental.h.
7824 (Relobj::finalize_incremental_relocs): New function.
7825 (Sized_relobj::do_layout): Record input sections in incremental info.
7826 * object.h (Object::output_section): New function.
7827 (Object::output_section_offset): Moved from Relobj.
7828 (Object::get_incremental_reloc_base): New function.
7829 (Object::get_incremental_reloc_count): New function.
7830 (Object::do_output_section): New function.
7831 (Object::do_output_section_offset): Moved from Relobj.
7832 (Object::do_get_incremental_reloc_base): New function.
7833 (Object::do_get_incremental_reloc_count): New function.
7834 (Object::Object): Initialize new data members.
7835 (Relobj::output_section): Renamed do_output_section and moved to
7836 protected.
7837 (Relobj::output_section_offset): Moved to Object.
7838 (Relobj::do_get_incremental_reloc_base): New function.
7839 (Relobj::do_get_incremental_reloc_count): New function.
7840 (Relobj::allocate_incremental_reloc_counts): New function.
7841 (Relobj::count_incremental_reloc): New function.
7842 (Relobj::finalize_incremental_relocs): New function.
7843 (Relobj::next_incremental_reloc_index): New function.
7844 (Relobj::reloc_counts_): New data member.
7845 (Relobj::reloc_bases_): New data member.
7846 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7847 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7848 (Sized_relobj::incremental_relocs_scan): New function.
7849 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7850 (Sized_relobj::incremental_relocs_write): New function.
7851 (Sized_relobj::incremental_relocs_write_reltype): New function.
7852 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7853 incremental link.
7854 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7855 archives and object files elsewhere.
7856 (Add_symbols::run): Report object files here.
7857 (Finish_group::run): Report end of archive at end of group.
7858 * reloc.cc: Include layout.h, incremental.h.
7859 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7860 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7861 (Sized_relobj::incremental_relocs_scan): New function.
7862 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7863 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7864 (Sized_relobj::incremental_relocs_write): New function.
7865 (Sized_relobj::incremental_relocs_write_reltype): New function.
7866 * script.cc (read_input_script): Rewrite test for incremental link.
7867 Change call to Incremental_inputs::report_script.
7868 * symtab.h (Symbol_table::first_global_index): New function.
7869 (Symbol_table::output_count): New function.
7870
ce0d1972
DK
78712010-08-12 Doug Kwan <dougkwan@google.com>
7872
7873 * arm.cc (Target_arm::merge_object_attributes): Check command line
7874 options --no-wchar-size-warning and --no-enum-size-warning.
7875 * options.h (General_options): Add ld-compatible options
7876 --no-enum-size-warning and --no-wchar-size-warning.
7877
6e5710ce
ILT
78782010-08-04 Ian Lance Taylor <iant@google.com>
7879
7880 * x86_64.cc (Target_x86_64::Scan::local): Use
7881 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7882 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7883 (Target_x86_64::Scan::global): Likewise.
7884 (Target_x86_64::Relocate::relocate): Likewise.
7885 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7886 Likewise.
7887
fef830db
CC
78882010-08-03 Cary Coutant <ccoutant@google.com>
7889
7890 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7891 to reserve space in merged_strings vector. Keep total input size
7892 for stats.
7893 (Output_merge_string::do_print_merge_stats): Print total input size.
7894 * merge.h (Output_merge_string): Add input_size_ field.
7895 * stringpool.cc (Stringpool_template::string_length): Move
7896 implementations out of Stringpool_template class and place in
7897 stringpool.h.
7898 * stringpool.h (string_length): Move out of Stringpool_template.
7899
1e3811b0
ILT
79002010-08-03 Ian Lance Taylor <iant@google.com>
7901
7902 PR 11712
7903 * layout.cc (relaxation_loop_body): If address of load segment is
7904 set, adjust address to include headers if possible.
7905
7af0c620
ILT
79062010-08-03 Ian Lance Taylor <iant@google.com>
7907
7908 * version.cc (version_string): Bump to 1.10.
7909
22f0da72
ILT
79102010-08-03 Ian Lance Taylor <iant@google.com>
7911
7912 PR 11805
7913 * layout.h (enum Output_section_order): Define.
7914 (class Layout): Update declarations.
7915 * layout.cc (Layout::get_output_section): Add order parameter.
7916 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7917 is_first_non_relro parameters. Change all callers.
7918 (Layout::choose_output_section): Likewise.
7919 (Layout::add_output_section_data): Likewise.
7920 (Layout::make_output_section): Likewise. Set order.
7921 (Layout::default_section_order): New function.
7922 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7923 * output.cc (Output_section::Output_section): Initialize order_.
7924 Don't initialize deleted fields.
7925 (Output_segment::Output_segment): Don't initialize deleted
7926 fields.
7927 (Output_segment::add_output_section_to_load): New function
7928 replacing add_output_section. Change all callers to call this or
7929 add_output_section_to_nonload.
7930 (Output_segment::add_output_section_to_nonload): New function.
7931 (Output_segment::remove_output_section): Rewrite.
7932 (Output_segment::add_initial_output_data): Likewise.
7933 (Output_segment::has_any_data_sections): Likewise.
7934 (Output_segment::is_first_section_relro): Likewise.
7935 (Output_segment::maximum_alignment): Likewise.
7936 (Output_segment::has_dynamic_reloc): New function replacing
7937 dynamic_reloc_count. Change all callers.
7938 (Output_segment::has_dynamic_reloc_list): New function replacing
7939 dynamic_reloc_count_list. Change all callers.
7940 (Output_segment::set_section_addresses): Rewrite.
7941 (Output_segment::set_offset): Rewrite.
7942 (Output_segment::find_first_and_last_list): Remove.
7943 (Output_segment::set_tls_offsets): Rewrite.
7944 (Output_segment::first_section_load_address): Likewise.
7945 (Output_segment::output_section_count): Likewise.
7946 (Output_segment::section_with_lowest_load_address): Likewise.
7947 (Output_segment::write_section_headers): Likewise.
7948 (Output_segment::print_sections_to_map): Likewise.
7949 * output.h (class Output_data): Remove dynamic_reloc_count_
7950 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7951 (Output_data::add_dynamic_reloc): Rewrite.
7952 (Output_data::has_dynamic_reloc): New function.
7953 (Output_data::dynamic_reloc_count): Remove.
7954 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7955 is_last_relro_, is_first_non_relro_, is_interp_,
7956 is_dynamic_linker_section_ fields. Add order and set_order
7957 functions. Remove is_relro_local, set_is_relro_local,
7958 is_last_relro, set_is_last_relro, is_first_non_relro,
7959 set_is_first_non_relro functions, is_interp, set_is_interp,
7960 is_dynamic_linker_section, and set_is_dynamic_linker_section
7961 functions.
7962 (class Output_segment): Change Output_data_list from std::list to
7963 std:;vector. Add output_lists_ field. Remove output_data_ and
7964 output_bss_ fields. Update declarations.
7965
3ff2ccb0
ILT
79662010-08-02 Ian Lance Taylor <iant@google.com>
7967
7968 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7969 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7970 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7971
88a4108b
ILT
79722010-08-02 Ian Lance Taylor <iant@google.com>
7973
7974 PR 11855
7975 * script.cc (Script_options::Script_options): Initialize
7976 symbol_definitions_ and symbol_references_.
7977 (Script_options::add_symbol_assignment): Update
7978 symbol_definitions_ and symbol_references_.
7979 (Script_options::add_symbol_reference): New function.
7980 (script_symbol): New function.
7981 * script.h (class Script_options): Add symbol_definitions_ and
7982 symbol_references_ fields.
7983 (Script_options::referenced_const_iterator): New type.
7984 (Script_options::referenced_begin): New function.
7985 (Script_options::referenced_end): New function.
7986 (Script_options::is_referenced): New function.
7987 (Script_options::any_unreferenced): New function.
7988 * script-c.h (script_symbol): Declare.
7989 * yyscript.y (exp): Call script_symbol.
7990 * symtab.cc: Include "script.h".
7991 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7992 Change all callers. Check symbols referenced by scripts.
7993 (Symbol_table::add_undefined_symbols_from_command_line): Add
7994 layout parameter. Change all callers.
7995 (Symbol_table::do_add_undefined_symbols_from_command_line):
7996 Likewise. Break out loop body. Check symbols referenced by
7997 scripts.
7998 (Symbol_table::add_undefined_symbol_from_command_line): New
7999 function broken out of
8000 do_add_undefined_symbols_from_command_line.
8001 * symtab.h (class Symbol_table): Update declarations.
8002 * archive.cc: Include "layout.h".
8003 (Archive::should_include_member): Add layout parameter. Change
8004 all callers. Check for symbol mentioned in expression.
8005 * archive.h (class Archive): Update declaration.
8006 * object.cc (Sized_relobj::do_should_include_member): Add layout
8007 parameter.
8008 * object.h (Object::should_include_member): Add layout parameter.
8009 Change all callers.
8010 (Object::do_should_include_member): Add layout parameter.
8011 (class Sized_relobj): Update declaration.
8012 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8013 parameter.
8014 * dynobj.h (class Sized_dynobj): Update declaration.
8015 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8016 layout parameter.
8017 * plugin.h (class Sized_pluginobj): Update declaration.
8018
5f1ab67a
ILT
80192010-08-02 Ian Lance Taylor <iant@google.com>
8020
8021 PR 11866
8022 * output.cc (Output_segment::set_offset): Search for the first and
8023 last sections rather than assuming that the list is in order.
8024 (Output_segment::find_first_and_last_list): New function.
8025 * output.h (class Output_segment): Update declarations.
8026 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8027 (relro_strip_test_SOURCES): New variable.
8028 (relro_strip_test_DEPENDENCIES): New variable.
8029 (relro_strip_test_LDFLAGS): New variable.
8030 (relro_strip_test_LDADD): New variable.
8031 (relro_strip_test.so): New target.
8032
a8df5856
ILT
80332010-08-02 Ian Lance Taylor <iant@google.com>
8034
8035 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8036 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8037 (Target_i386::got_tlsdesc_section): New function.
8038 (Target_i386::got_section): Create space for GOT entries for
8039 TLSDESC relocations.
8040 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8041 R_386_TLS_GOTDESC.
8042 (Target_i386::Scan::global): Likewise.
8043 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8044 using TLSDESC GOT.
8045 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8046 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8047 (Target_x86_64::got_tlsdesc_section): New function.
8048 (Target_x86_64::got_section): Create space for GOT entries for
8049 TLSDESC relocations.
8050 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8051 R_386_TLS_GOTDESC.
8052 (Target_x86_64::Scan::global): Likewise.
8053 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8054 using TLSDESC GOT.
8055
0c10a0a6
ILT
80562010-08-02 Ian Lance Taylor <iant@google.com>
8057
8058 * testsuite/final_layout.sh: Use dc to convert from hex to
8059 decimal.
8060
41cbeecc
ST
80612010-07-29 Sriraman Tallam <tmsriram@google.com>
8062
8063 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8064 paramter to the call to gold::gc_process_relocs.
8065 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8066 paramter to the call to gold::gc_process_relocs.
8067 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8068 parameter to the call to gold::gc_process_relocs.
8069 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8070 template parameter to the call to gold::gc_process_relocs.
8071 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8072 paramter to the call to gold::gc_process_relocs.
8073 * gc.h (get_embedded_addend_size): New function.
8074 (gc_process_relocs): Save the size of the reloc for use by ICF.
8075 * icf.cc (get_section_contents): Get the addend from the text section
8076 for SHT_REL relocation sections.
8077 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8078 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8079 * int_encoding.h (read_from_pointer): New overloaded function.
8080 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8081 * testsuite/icf_sht_rel_addend_test.sh: New file.
8082 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8083 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8084
6ea55b82
RW
80852010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8086
8087 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8088 * Makefile.in: Regenerate.
8089 * testsuite/Makefile.in: Regenerate.
8090
9691462b
ILT
80912010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8092
8093 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8094 * gold/testsuite/debug_msg.cc: Likewise.
8095 * gold/testsuite/odr_violation1.cc
8096 * gold/testsuite/odr_violation2.cc
8097
76897331
CC
80982010-07-21 Cary Coutant <ccoutant@google.com>
8099
8100 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8101 string, and length fields.
8102 (Output_merge_string::Merged_strings_list): New type.
8103 (Output_merge_string::Merged_strings_lists): New typedef.
8104 (Output_merge_string): Replace merged_strings_ with
8105 merged_strings_lists_.
8106 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8107 Merged_strings_list per input object and section. Don't store pointer
8108 to the string. Don't store length with each merged string entry.
8109 (Output_merge_string::finalize_merged_data): Loop over list of merged
8110 strings lists. Recompute length of each merged string.
8111
78384e8f
CC
81122010-07-15 Cary Coutant <ccoutant@google.com>
8113
8114 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8115 here.
8116
783659f9
ILT
81172010-07-14 Ian Lance Taylor <iant@google.com>
8118
8119 * descriptors.cc (Descriptors::open): Report correct name in error
8120 message.
8121
131687b4
DK
81222010-07-13 Doug Kwan <dougkwan@google.com>
8123
8124 * arm.cc (Arm_input_section::Arm_input_section): For a
8125 SHT_ARM_EXIDX section, always keeps the input sections.
8126 (Arm_input_section::set_exidx_section_link): New method.
8127 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8128 has_errors_ to false.
8129 (Arm_exidx_input_section::has_errors,
8130 Arm_exidx_input_section::set_has_errors): New methods.
8131 (Arm_exidx_input_section::has_errors_): New data member.
8132 (Arm_relobj::get_exidx_shndx_list): New method.
8133 (Arm_output_section::append_text_sections_to_list): Do not skip
8134 section without SHF_EXECINSTR.
8135 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8136 errors.
2e702c99 8137 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8138 section header. Make error messages more verbose. Check for
8139 a non-executable section linked to an EXIDX section.
8140 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8141 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8142 check that there is no deferred EXIDX section if we exit early.
8143 Instead of not making an EXIDX section in case of an error, make one
8144 and set the has_errors flag of it.
8145 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8146 in a relocatable link.
8147 (Target_arm::do_relax): Look for the EXIDX output section instead of
8148 assuming that it is called .ARM.exidx.
2e702c99 8149 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8150 section list. Do not check for SHF_EXECINSTR section flags but
8151 skip any input section with errors.
8152 * output.cc (Output_section::Output_section): Initialize
8153 always_keeps_input_sections_ to false.
8154 (Output_section::add_input_section): Check for
8155 always_keeps_input_sections_.
8156 * output.h (Output_section::always_keeps_input_sections,
8157 Output_section::set_always_keeps_input_sections): New methods.
8158 (Output_section::always_keeps_input_sections): New data member.
8159
69517287
RÁE
81602010-07-13 Rafael Espindola <espindola@google.com>
8161
8162 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8163 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8164
82742395
ILT
81652010-07-13 Philip Herron <herron.philip@googlemail.com>
8166 Ian Lance Taylor <iant@google.com>
8167
8168 * output.h (Output_section_lookup_maps::add_merge_section):
8169 Correct check of whether value was inserted.
8170 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8171 (Output_section_lookup_maps::add_relaxed_input_section):
8172 Likewise.
8173 * arm.cc (Target_arm::got_section): Remove used local os.
8174 * i386.cc (Target_i386::got_section): Likewise.
8175 * x86_64.cc (Target_x86_64::got_section): Likewise.
8176 * sparc.cc (Target_sparc::got_section): Likewise.
8177 (Target_sparc::relocate): Remove unused local have_got_offset.
8178 * powerpc.cc (Target_powerpc::relocate): Likewise.
8179
f2d707b5
ILT
81802010-07-13 Ian Lance Taylor <iant@google.com>
8181
241531d6
ILT
8182 * compressed_output.cc (zlib_decompress): Fix signature in
8183 !HAVE_ZLIB_H case.
8184
f2d707b5
ILT
8185 * archive.cc (Archive::include_member): Unlock an external member
8186 of a thin archive. Don't bother to delete an object we know is
8187 NULL.
8188
a2e47362
CC
81892010-07-12 Cary Coutant <ccoutant@google.com>
8190
8191 * compressed_output.cc (zlib_decompress): New function.
8192 (get_uncompressed_size): New function.
8193 (decompress_input_section): New function.
8194 * compressed_output.h (get_uncompressed_size): New function.
8195 (decompress_input_section): New function.
8196 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8197 Handle compressed debug sections.
8198 * layout.cc (is_compressed_debug_section): New function.
8199 (Layout::output_section_name): Map compressed section names to
8200 canonical names.
8201 * layout.h (is_compressed_debug_section): New function.
8202 (is_debug_info_section): Recognize compressed debug sections.
8203 * merge.cc: Include compressed_output.h.
8204 (Output_merge_data::do_add_input_section): Handle compressed
8205 debug sections.
8206 (Output_merge_string::do_add_input_section): Handle compressed
8207 debug sections.
8208 * object.cc: Include compressed_output.h.
8209 (Sized_relobj::Sized_relobj): Initialize new data members.
8210 (build_compressed_section_map): New function.
8211 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8212 * object.h (Object::section_is_compressed): New method.
8213 (Object::do_section_is_compressed): New method.
8214 (Sized_relobj::Compressed_section_map): New type.
8215 (Sized_relobj::do_section_is_compressed): New method.
8216 (Sized_relobj::compressed_sections_): New data member.
8217 * output.cc (Output_section::add_input_section): Handle compressed
8218 debug sections.
8219 * reloc.cc: Include compressed_output.h.
8220 (Sized_relobj::write_sections): Handle compressed debug sections.
8221
ce279a62
CC
82222010-07-08 Cary Coutant <ccoutant@google.com>
8223
8224 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8225 weak when resolving to a dynamic def.
8226 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8227 for weak undef/dynamic def cases. Adjust callers.
8228 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8229 undef_binding_weak_.
8230 (Symbol_table::sized_write_globals): Adjust symbol binding.
8231 (Symbol_table::sized_write_symbol): Add binding parameter.
8232 * symtab.h (Symbol::set_undef_binding): New method.
8233 (Symbol::is_undef_binding_weak): New method.
8234 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8235 (Symbol_table::should_override): Add new parameter.
8236 (Symbol_table::sized_write_symbol): Add new parameter.
8237
8238 * testsuite/weak_undef_file1.cc: Add new test case.
8239 * testsuite/weak_undef_file2.cc: Fix header comment.
8240 * testsuite/weak_undef_test.cc: Add new test case.
8241
b2286c10
DK
82422010-06-29 Doug Kwan <dougkwan@google.com>
8243
8244 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8245 Initialize USE_SYMBOL_.
8246 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8247 definition.
8248 (Arm_reloc_property::uses_symbol_): New data member declaration.
8249 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8250 uses symbol value and symbol is undefined but not weakly undefined.
8251
4802450a
RÁE
82522010-06-28 Rafael Espindola <espindola@google.com>
8253
8254 * plugin.cc (Plugin::load): Use dlerror.
8255
e5ca47ba
ILT
82562010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8257
8258 * symtab.cc (detect_odr_violations): When reporting an ODR
8259 violation, report an object where the symbol is defined.
8260
8a75a161
DK
82612010-06-25 Doug Kwan <dougkwan@google.com>
8262
8263 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8264 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8265 definition.
8266 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8267 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8268 target hook to detect function points.
8269 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8270 * icf.h (Icf::check_section_for_function_pointers): Change type of
8271 parameter SECTION_NAME to const reference to std::string. Use
8272 target hook to determine if section may have unsafe pointers.
8273 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8274 method definition.
8275
42218b9f
RÁE
82762010-06-21 Rafael Espindola <espindola@google.com>
8277
8278 * fileread.cc (Input_file::find_fie): New
8279 (Input_file::open): Use Input_file::find_fie.
8280 * fileread.h (Input_file::find_fie): New
8281 * plugin.cc (set_extra_library_path): New.
8282 (Plugin::load): Add set_extra_library_path to the transfer vector.
8283 (Plugin_manager::set_extra_library_path): New.
8284 (Plugin_manager::add_input_file): Use the extra search path if set.
8285 (set_extra_library_path(): New.
8286 * plugin.h (Plugin_manager): Add set_extra_library_path and
8287 extra_search_path_.
8288
a0506cca
CC
82892010-06-19 Cary Coutant <ccoutant@google.com>
8290
8291 * layout.cc (gdb_sections): Add .debug_types.
8292 (lines_only_debug_sections): Likewise.
8293
6508b958
RÁE
82942010-06-18 Rafael Espindola <espindola@google.com>
8295
8296 * plugin.cc (add_input_file,add_input_library)
8297 (Plugin_manager::add_input_file): Make filename arguments const.
8298 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8299 const.
8300
3e235302
DK
83012010-06-16 Doug Kwan <dougkwan@google.com>
8302
8303 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8304 .ARM.attributes section if we have not merged any input
8305 attributes sections.
8306
106e8a6c
DK
83072010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8308
8309 * arm.cc: Allow combining objects with no EABI version
8310 information.
8311
91ff43fe
RÁE
83122010-06-15 Rafael Espindola <espindola@google.com>
8313
8314 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8315
68ed838c
ILT
83162010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8317
8318 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8319 (struct iovec): Correct !HAVE_READV definition.
8320
f3a2388f
CC
83212010-06-10 Cary Coutant <ccoutant@google.com>
8322
8323 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8324 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8325 reloc sections.
8326 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8327
8328 PR 11683
8329 * symtab.h (Symbol::is_placeholder): New member function.
8330 * target-reloc.h (relocate_section): Check for placeholder symbols.
8331
8332 * testsuite/Makefile.am (plugin_test_8): New test.
8333 (plugin_test_9): New test.
8334 * testsuite/Makefile.in: Regenerate.
8335
e1df38aa
NC
83362010-06-09 Nick Clifton <nickc@redhat.com>
8337
8338 * yyscript.y (input_list_element): Allow strings prefixed with
8339 the '-' character. Treat these as libraries.
8340 * script.cc (script_add_library): New function. Adds a library
8341 specified by "-l<name>" found in an input script.
8342 * script-c.h: Add prototype for script_add_library.
8343
25bbe950
DK
83442010-06-07 Doug Kwan <dougkwan@google.com>
8345
8346 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8347 Restrict stub-group size to be within long conditional branch
8348 range when working around cortex-A8 erratum.
8349
0f32ea4c
ILT
83502010-06-07 Damien Diederen <dd@crosstwine.com>
8351
8352 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8353 #ifdef typo.
8354
8fe2a369
ST
83552010-06-03 Sriraman Tallam <tmsriram@google.com>
8356
8357 PR gold/11658
8358 * output.cc
8359 (Output_section::Input_section_sort_entry::compare_section_ordering):
8360 Change to return non-zero correctly.
8361 (Output_section::Input_section_sort_section_order_index_compare
8362 ::operator()): Change to fix ambiguity in comparisons.
8363
6e9ba2ca
ST
83642010-06-01 Sriraman Tallam <tmsriram@google.com>
8365
8366 * gold.h (is_wildcard_string): New function.
8367 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8368 (Layout::layout_eh_frame): Ditto.
8369 (Layout::find_section_order_index): New method.
8370 (Layout::read_layout_from_file): New method.
8371 * layout.h (Layout::find_section_order_index): New method.
8372 (Layout::read_layout_from_file): New method.
8373 (Layout::input_section_position_): New private member.
8374 (Layout::input_section_glob_): New private member.
8375 * main.cc (main): Call read_layout_from_file here.
8376 * options.h (--section-ordering-file): New option.
8377 * output.cc (Output_section::input_section_order_specified_): New
8378 member.
8379 (Output_section::Output_section): Initialize new member.
8380 (Output_section::add_input_section): Add new parameter.
8381 Keep input sections when --section-ordering-file is used.
8382 (Output_section::set_final_data_size): Sort input sections when
8383 section ordering file is specified.
8384 (Output_section::Input_section_sort_entry): Add new parameter.
8385 Check sorting type.
8386 (Output_section::Input_section_sort_entry::compare_section_ordering):
8387 New method.
8388 (Output_section::Input_section_sort_compare::operator()): Change to
8389 consider section_order_index.
8390 (Output_section::Input_section_sort_init_fini_compare::operator()):
8391 Change to consider section_order_index.
8392 (Output_section::Input_section_sort_section_order_index_compare
8393 ::operator()): New method.
8394 (Output_section::sort_attached_input_sections): Change to sort
8395 according to section order when specified.
e1df38aa
NC
8396 (Output_section::add_input_section<32, true>): Add new parameter.
8397 (Output_section::add_input_section<64, true>): Add new parameter.
8398 (Output_section::add_input_section<32, false>): Add new parameter.
8399 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8400 * output.h (Output_section::add_input_section): Add new parameter.
8401 (Output_section::input_section_order_specified): New
8402 method.
8403 (Output_section::set_input_section_order_specified): New method.
8404 (Input_section::Input_section): Initialize section_order_index_.
8405 (Input_section::section_order_index): New method.
8406 (Input_section::set_section_order_index): New method.
8407 (Input_section::section_order_index_): New member.
8408 (Input_section::Input_section_sort_section_order_index_compare): New
8409 struct.
8410 (Output_section::input_section_order_specified_): New member.
8411 * script-sections.cc (is_wildcard_string): Delete and move modified
8412 method to gold.h.
8413 (Output_section_element_input::Output_section_element_input): Modify
8414 call to is_wildcard_string.
8415 (Output_section_element_input::Input_section_pattern
8416 ::Input_section_pattern): Ditto.
8417 (Output_section_element_input::Output_section_element_input): Ditto.
8418 * testsuite/Makefile.am (final_layout): New test case.
8419 * testsuite/Makefile.in: Regenerate.
8420 * testsuite/final_layout.cc: New file.
8421 * testsuite/final_layout.sh: New file.
8422
3537c84b
RÁE
84232010-06-01 Rafael Espindola <espindola@google.com>
8424
8425 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8426
105b6afd
RÁE
84272010-06-01 Rafael Espindola <espindola@google.com>
8428
8429 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8430 visibility of symbols.
8431
29e11421
DK
84322010-05-27 Doug Kwan <dougkwan@google.com>
8433
8434 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8435 from start of output section instead of address for a local symbol
8436 in a merged or relaxed section when doing a relocatable link.
8437
5e0f337e
RÁE
84382010-05-26 Rafael Espindola <espindola@google.com>
8439
703d02da 8440 PR 11604
5e0f337e
RÁE
8441 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8442 adding sections the garbage collector removed.
8443 * gold/testsuite/Makefile.am: Add test.
8444 * gold/testsuite/Makefile.in: Regenerate.
8445 * gold/testsuite/plugin_test_7.sh: New.
8446 * gold/testsuite/plugin_test_7_1.c: New.
8447 * gold/testsuite/plugin_test_7_2.c: New.
8448
f4187277
RÁE
84492010-05-26 Rafael Espindola <espindola@google.com>
8450
8451 * script-sections.cc (Output_section_definition::set_section_addresses):
8452 Check for --section-start.
8453
5c388529
DK
84542010-05-26 Doug Kwan <dougkwan@google.com>
8455
8456 * arm.cc (Arm_scan_relocatable_relocs): New class.
8457 (Target_arm::relocate_special_relocatable): New method.
8458 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8459 (Arm_relocate_functions::thumb_branch_common): Same.
8460 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8461 instead of Default_scan_relocatable_relocs.
8462 * target-reloc.h (relocate_for_relocatable): Let target handle
8463 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8464 * target.h (Sized_target::relocate_special_relocatable): New method.
8465
bca1c3ae
ILT
84662010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8467
8468 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8469
0439c796
DK
84702010-05-23 Doug Kwan <dougkwan@google.com>
8471
8472 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8473 instead of a cast.
8474 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8475 with a direct branch, not a conditional branch, to a stub.
8476 * merge.cc (Output_merge_base::record_input_section): New method
8477 defintion.
8478 (Output_merge_data::do_add_input_section): Record input section if
8479 keeps-input-sections flag is set.
8480 (Output_merge_string::do_add_input_section): Ditto.
8481 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8482 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8483 INPUT_SECTIONS_.
8484 (Output_merge_base::keeps_input_sections,
8485 Output_merge_base::set_keeps_input_sections,
8486 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8487 method definitions.
8488 (Output_merge_base::Input_sections): New type declaration.
8489 (Output_merge_base::input_sections_begin,
8490 Output_merge_base::input_sections_end,
8491 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8492 (Output_merge_base::bool keeps_input_sections_,
8493 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8494 Output_merge_base::input_sections_): New data members.
8495 (Output_merge_data::do_set_keeps_input_sections): New method
8496 defintion.
8497 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8498 * output.cc (Output_section::Input_section::relobj): Move method
8499 defintion from class declaration to here and handle merge sections.
8500 (Output_section::Input_section::shndx): Ditto.
8501 (Output_section::Output_section): Remove initializations of removed
8502 data members and initialize new data member LOOKUP_MAPS_.
8503 (Output_section::add_input_section): Set keeps-input-sections flag
8504 for a newly created merge output section as appropriate. Adjust code
8505 to use Output_section_lookup_maps class.
8506 (Output_section::add_relaxed_input_section): Adjst code for lookup
8507 maps code refactoring.
2e702c99 8508 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8509 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8510 class. If adding input section to a newly created merge output
8511 section fails, remove the new merge section.
8512 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8513 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8514 (Output_section::find_merge_section): Ditto.
0439c796 8515 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8516 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8517 Output_section_lookup_maps class.
8518 (Output_section::get_input_sections): Export merge sections. Adjust
8519 code to use Output_section_lookup_maps class.
8520 (Output_section:::add_script_input_section): Adjust code to use
8521 Output_section_lookup_maps class. Update lookup maps for merge
8522 sections also.
8523 (Output_section::discard_states): Use Output_section_lookup_maps.
8524 (Output_section::restore_states): Same.
8525 * output.h (Merge_section_properties): Move class defintion out of
8526 Output_section.
8527 (Output_section_lookup_maps): New class.
8528 (Output_section::Input_section::is_merge_section): New method
8529 defintion.
8530 (Output_section::Input_section::relobj): Move defintion out of class
8531 defintion. Declare method only.
8532 (Output_section::Input_section::shndx): Ditto.
8533 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8534 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8535 (Output_section::Merge_section_by_properties_map,
8536 Output_section::Output_section_data_by_input_section_map,
8537 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8538 Remove types.
2e702c99 8539 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8540 KEEPS_INPUT_SECTIONS.
8541 (Output_section::build_lookup_maps): New method declaration.
8542 (Output_section::merge_section_map_,
8543 Output_section::merge_section_by_properties_map_,
8544 Output_section::relaxed_input_section_map_,
8545 Output_section::is_relaxed_input_section_map_valid_): Remove data
8546 members.
8547 (Output_section::lookup_maps_): New data member.
8548
76295588
L
85492010-05-21 Doug Kwan <dougkwan@google.com>
8550
8551 PR gold/11619
8552 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8553 avoid a compilation error.
8554
d103a984
RÁE
85552010-05-19 Rafael Espindola <espindola@google.com>
8556
8557 * script-sections.cc (Output_section_definition::allocate_to_segment):
8558 Update the phdrs_list even when the output section is NULL.
8559 * testsuite/Makefile.am: Add test.
8560 * testsuite/Makefile.in: Regenerate.
8561 * testsuite/script_test_9.cc: New.
8562 * testsuite/script_test_9.sh: New.
8563 * testsuite/script_test_9.t: New.
8564
6625d24e
DK
85652010-05-19 Doug Kwan <dougkwan@google.com>
8566
8567 * arm.cc (Arm_input_section::original_size): New method.
8568 (Arm_input_section::do_addralign): Add a cast.
8569 (Arm_input_section::do_output_offset): Remove static cast.
8570 (Arm_input_section::original_addralign,
8571 Arm_input_section::original_size_): Change type to uint32_t.
8572 (Arm_input_section::init): Add safe casts for section alignment
8573 and size.
8574 (Arm_input_section::set_final_data_size): Do not set address and
8575 offset of stub table.
8576 (Arm_output_section::fix_exidx_coverage): Change use of of
8577 Output_section::Simple_input_section to that of
8578 Output_section::Input_section.
8579 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8580 except for the first pass.
8581 * output.cc (Output_section::get_input_sections): Change type of
8582 input_sections to std::list<Input_section>.
8583 (Output_section::add_script_input_section): Rename from
8584 Output_section::add_simple_input_section. Change type of SIS
8585 parameter from Simple_input_section to Input_section.
8586 * output.h (Output_section::Simple_input_section): Remove class.
8587 (Output_section::Input_section): Change class visibility to public.
8588 (Output_section::Input_section::addralign): Use stored alignments
8589 for special input sections if set.
8590 (Output_section::Input_section::set_addralign): New method.
8591 (Output_section::get_input_sections): Change parameter type from
8592 list of Simple_input_section to list of Input_section.
8593 (Output_section::add_script_input_section): Rename from
8594 Output_section::add_simple_input_section. Change first parameter's
8595 type from Simple_input_section to Input_section and remove the
8596 second and third parameters.
8597 * script-sections.cc (Input_section::Input_section_list): Change
8598 type to list of Output_section::Input_section/
8599 (Input_section_info::Input_section_info): Change parameter type of
8600 INPUT_SECTION to Output_section::Input_section.
8601 (Input_section_info::input_section): Change return type.
8602 (Input_section_info::input_section_): Change type to
8603 Output_section::Input_section.
8604 (Output_section_element_input::set_section_addresses): Adjust code
8605 to use Output_section::Input_section instead of
8606 Output_section::Simple_input_section. Adjust code for renaming
8607 of Output_section::add_simple_input_section.
8608 (Orphan_output_section::set_section_addresses): Ditto.
8609
e1e82ea4
RW
86102010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8611
8612 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8613 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8614
91e75c8a
RÁE
86152010-05-18 Rafael Espindola <espindola@google.com>
8616
8617 * options.cc (General_options::finalize): Handle -nostdlib.
8618 * options.h (nostdlib): New option.
8619 * script.cc (script_add_search_dir): Handle -nostdlib.
8620
da59ad79
DK
86212010-05-12 Doug Kwan <dougkwan@google.com>
8622
8623 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8624 attributes section only if there no attributes section after merging.
8625 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8626 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8627 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8628 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8629 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8630 and arm_attr_merge_7.stdout.
8631 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8632 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8633 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8634 arm_attr_merge_7b.o): New rules.
8635 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8636 arm_attr_merge_7
8637 * testsuite/Makefile.in: Regenerate.
8638 * testsuite/arm_attr_merge.sh: New file.
8639 * testsuite/arm_attr_merge_[67][ab].s: Same.
8640
3e01a7fd
NC
86412010-05-05 Nick Clifton <nickc@redhat.com>
8642
8643 * po/es.po: Updated Spanish translation.
8644
7ad2014a
L
86452010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8646
8647 * Makefile.am (install-exec-local): Properly install gold as
8648 default cross linker.
8649 * Makefile.in: Regenerated.
8650
4fda8867
NC
86512010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8652 Nick Clifton <nickc@redhat.com>
8653
8654 * configure.ac (install_as_default): Define and set to false
8655 unless --enable-gold or --enable-gold=both/gold has been
8656 specified.
8657 * configure: Regenerate.
8658
8659 * Makefile.am (install-exec-local): Install the executable as
8660 'ld.gold'. If install_as_default is true then also install it as
8661 'ld'.
8662 * Makefile.in: Regenerated.
8663
bd288ea2
ILT
86642010-04-24 Ian Lance Taylor <iant@google.com>
8665
8666 * layout.cc (Layout::layout_reloc): In relocatable link don't
8667 combine reloc sections for grouped sections.
8668
ef38fd8a
ST
86692010-04-23 Sriraman Tallam <tmsriram@google.com>
8670
8671 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8672 sections that are not ordinary to icf.
8673 * icf.cc (get_section_contents): Handle relocation pointing to section
8674 with no object or shndx information.
8675 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8676 * testsuite/Makefile.in: Regenerate.
8677 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8678 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8679
f6973bdc
ILT
86802010-04-22 Ian Lance Taylor <iant@google.com>
8681
8682 * expression.cc (Expression::Expression_eval_info): Add
8683 result_alignment_pointer field.
8684 (Expression::eval_with_dot): Add result_alignment_pointer
8685 parameter. Change all callers.
8686 (Expression::eval_maybe_dot): Likewise.
8687 (class Binary_expression): Add alignment_pointer parameter to
8688 left_value and right_value. Change all callers.
8689 (BINARY_EXPRESSION): Set result alignment.
8690 (class Trinary_expression): Add alignment_pointer parameter to
8691 arg2_value and arg3_value. Change all callers.
8692 (Trinary_cond::value): Set result alignment.
8693 (Max_expression::value, Min_expression::value): Likewise.
8694 (Align_expression::value): Likewise.
8695 * script-sections.cc (class Sections_element): Add dot_alignment
8696 parameter to set_section_addresses virtual function. Update
8697 instantiations.
8698 (class Output_section_element): Likewise.
8699 (Script_sections::create_segments): Add dot_alignment parameter.
8700 Change all callers.
8701 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8702 (Script_sections::set_phdrs_clause_addresses): Likewise.
8703 * script-sections.h: Update declarations.
8704 * script.h: Update declarations.
8705 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8706 min_p_align.
8707 * testsuite/script_test_3.t: Set large alignment.
8708 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8709 segment has expected alignment.
8710
9c9c98a5
NC
87112010-04-22 Nick Clifton <nickc@redhat.com>
8712
8713 * po/gold.pot: Updated by the Translation project.
8714 * po/vi.po: Updated Vietnamese translation.
8715
2253bfba
L
87162010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8717
8718 * testsuite/Makefile.am (check_PROGRAMS): Add
8719 icf_virtual_function_folding_test.
8720 * testsuite/Makefile.in: Regenerated.
8721
85fdf906
AH
87222010-04-15 Andrew Haley <aph@redhat.com>
8723
8724 * options.h (merge_exidx_entries): New option.
8725 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8726 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8727 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8728 (Target_arm::merge_exidx_entries): New function.
8729 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8730 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8731 to Arm_exidx_fixup constructor.
8732 Add new arg, merge_exidx_entries.
8733 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8734 Arm_output_section::fix_exidx_coverage.
8735
ce97fa81
ST
87362010-04-18 Sriraman Tallam <tmsriram@google.com>
8737
8738 * icf.cc (get_section_contents): Check for preemptible functions.
8739 Ignore addend when appropriate.
8740 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8741 section folded.
8742 (add_from_relobj): Check for section folded.
8743 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8744 * symtab.h (should_add_dynsym_entry): Add new parameter.
8745 * target-reloc.h (scan_relocs): Check for section folded.
8746 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8747 Check reloc types for function pointers in shared objects.
8748 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8749 case.
8750 (icf_preemptible_functions_test): New test case.
8751 (icf_string_merge_test): New test case.
8752 * testsuite.Makefile.in: Regenerate.
8753 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8754 bar_glob. Refactor code.
8755 * testsuite/icf_preemptible_functions_test.cc: New file.
8756 * testsuite/icf_preemptible_functions_test.sh: New file.
8757 * testsuite/icf_string_merge_test.cc: New file.
8758 * testsuite/icf_string_merge_test.sh: New file.
8759 * testsuite/icf_virtual_function_folding_test.cc: New file.
8760 * testsuite/icf_virtual_function_folding_test.sh: New file.
8761
04ceb17c
DK
87622010-04-14 Doug Kwan <dougkwan@google.com>
8763
8764 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8765 for local symbol recounting if we remove a section due to ICF.
8766 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8767 there are no regular objects in input.
8768
153e7da4
DK
87692010-04-13 Doug Kwan <dougkwan@google.com>
8770
8771 * arm.cc (Arm_input_section::set_final_data_size): Compute
8772 accurate final data size instead of using current data size.
8773
4dbd9faf
DK
87742010-04-09 Doug Kwan <dougkwan@google.com>
8775
8776 * layout.cc (Layout::choose_output_section): Handle script section
8777 types.
8778 (Layout::make_output_section_for_script): Add section type parameter.
8779 Handle script section types.
8780 * layout.h (Layout::make_output_section_for_script): Add section
8781 type parameter.
8782 * output.cc (Output_section::Output_section): Initialize data member
8783 is_noload_.
8784 (Output_section::do_reset_address_and_file_offset): Do not set address
8785 to 0 if section is a NOLOAD section.
8786 * output.h (Output_section::is_noload): New method.
8787 (Output_section::set_is_noload): Ditto.
8788 (Output_section::is_noload_): New data member.
8789 * script-c.h (Script_section_type): New enum type.
8790 (struct Parser_output_section_header): Add new file section_type.
8791 * script-sections.cc (Sections_element::output_section_name): Add
8792 parameter for returning script section type.
8793 (Output_section_definition::output_section_name): Ditto.
8794 (Output_section_definition::section_type)P; New method.
8795 (Output_section_definiton::script_section_type_name): Ditto.
8796 (Output_section_definition::script_section_type_): New data member.
8797 (Output_section_definition::Output_section_definition): Initialize
8798 data member Output_section_definition::script_section_type_.
8799 (Output_section_definition::create_sections): Pass script section type
8800 to Layout::make_output_section_for_script.
8801 (Output_section_definition::output_section_name): Return script
8802 section type to caller.
8803 (Output_section_definition::set_section_address): Do not advance
8804 dot value and load address if section type is NOLOAD. Set address
8805 of NOLOAD sections regardless of section flags.
8806 (Output_section_definition::print): Print section type if it is
8807 not SCRIPT_SECTION_TYPE_NONE.
8808 (Output_section_definition::section_type): New method.
8809 (Output_section_definition::script_section_type_name): Ditto.
8810 (Script_sections::output_section_name): Add new parameter
8811 PSECTION_TYPE for returning script section type. Pass it to
8812 section elements. Handle discard sections.
8813 (Sort_output_sections::operator()): Handle NOLOAD sections.
8814 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8815 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8816 returning script section type.
8817 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8818 INFO and NOLOAD.
8819 * yyscript.y (union): Add new field SECTION_TYPE.
8820 (COPY, DSECT, INFO, NOLOAD): New tokens.
8821 (opt_address_and_section_type): Change type to output_section_header.
8822 (section_type): New non-terminal
8823 (section_header): Handle section type.
2253bfba 8824 (opt_address_and_section_type): Return section type value.
4dbd9faf 8825
721ea635
L
88262010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8827
8828 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8829 * testsuite/plugin_common_test_2.c (foo): Likewise.
8830
6bf924b0
DK
88312010-04-08 Doug Kwan <dougkwan@google.com>
8832
8833 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8834 Output_merge_data.
8835 * output.cc (Output_section::add_merge_input_section): Simplify
8836 code and return status of Output_merge_base::add_input_section.
e1df38aa 8837 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8838 returns true.
8839
24af6f92
DK
88402010-04-07 Doug Kwan <dougkwan@google.com>
8841
8842 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8843 if section is marked as containing instructions but has no mapping
8844 symbols.
8845 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8846 correct section index.
8847 (Arm_relobj::find_linked_text_section): Ditto.
8848
00698fc5
CC
88492010-04-07 Cary Coutant <ccoutant@google.com>
8850
8851 * archive.cc (include_member): Destroy Read_symbols_data object before
8852 releasing file.
8853 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8854 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8855 (Read_symbols_data::~Read_symbols_data) New destructor.
8856 (Section_relocs::Section_relocs) New constructor.
8857 (Section_relocs::~Section_relocs) New destructor.
8858 (Read_relocs_data::Read_relocs_data) New constructor.
8859 (Read_relocs_data::~Read_relocs_data) New destructor.
8860 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8861 pointers to NULL after deleting.
8862
7296d933
DK
88632010-04-07 Doug Kwan <dougkwan@google.com>
8864
8865 * arm.cc: Replace "endianity" with "endianness" in comments.
8866 (Arm_exidx_cantunwind): Ditto.
8867 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8868 (Arm_relobj::merge_flags_and_attributes): New method.
8869 (Arm_relobj::merge_flags_and_attributes_): New data member.
8870 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8871 (Arm_relobj::scan_sections_for_stubs): Ditto.
8872 (Arm_relobj::do_read_symbols): Check to see if we really want to
8873 merge processor-specific flags and attributes. Exit early if
8874 an object is empty except for section names and the undefined symbol.
8875 (Target_arm::do_finalize_sections): Move check for ELF format to
8876 Arm_relobj::do_read_symbols. Merge processor specific flags and
8877 attributes from a regular object only when we have determined that
8878 it is aapropriate. Do not create an .ARM.attributes section in
8879 output if there is no regular input object.
8880 (Target_arm::merge_processor_specific_flags): Check
8881 --warn-mismatch before printing any error.
8882 (Target_arm::merge_object_attributes): Ditto.
8883 * gold.cc (queue_middle_tasks): Handle the case in which there is
8884 no regular object in input.
8885 * options.cc (General_options::parse_EB): New method.
8886 (General_options::parse_EL): Same.
8887 (General_options::General_options): Initialize endianness_.
8888 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8889 New options.
8890 (General_options::Endianness): New enum.
8891 (General_options::endianness): New method.
8892 (General_options::endianness_): New data member.
8893 * parameters.cc (Parameters::set_options): Check target endianness.
8894 (Parameters::set_target_once): Ditto.
8895 (Parameters::check_target_endianness): New method.
8896 (parameters_force_valid_target): If either -EL or -EB is specified,
8897 use it to define endianness of default target.
8898 * parameters.h (Parameters::check_target_endianness): New method
8899 declaration.
8900 * target.h (class Target): Change "endianity" to "endianness"
8901 in comments.
8902
efc8d4f2
RW
89032010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8904
8905 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8906 * configure: Regenerate.
8907 * Makefile.in: Regenerate.
8908 * testsuite/Makefile.in: Regenerate.
8909
be234d88
CC
89102010-04-06 Cary Coutant <ccoutant@google.com>
8911
8912 gcc PR lto/42757
8913 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8914 prevailing definitions of common symbols.
8915 * testsuite/plugin_test_6.sh: New test case.
8916 * testsuite/plugin_common_test_1.c: New test case.
8917 * testsuite/plugin_common_test_2.c: New test case.
8918 * testsuite/Makefile.am (plugin_test_6): New test case.
8919 * testsuite/Makefile.in: Regenerate.
8920
bd32c6bd
NC
89212010-04-06 Nick Clifton <nickc@redhat.com>
8922
8923 * po/vi.po: New Vietnamese translation.
8924
323c532f
DK
89252010-03-30 Doug Kwan <dougkwan@google.com>
8926
8927 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8928
4fcd97eb
DK
89292010-03-25 Doug Kwan <dougkwan@google.com>
8930
8931 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8932 to avoid a conversion warning on a 32-bit host.
8933
4ebf39db
ILT
89342010-03-24 Ian Lance Taylor <iant@google.com>
8935
8936 * testsuite/script_test_3.t: Add a TLS segment.
8937 * testsuite/Makefile.am (check_PROGRAMS): Add
8938 tls_phdrs_script_test.
8939 (tls_phdrs_script_test_SOURCES): Define.
8940 (tls_phdrs_script_test_DEPENDENCIES): Define.
8941 (tls_phdrs_script_test_LDFLAGS): Define.
8942 (tls_phdrs_script_test_LDADD): Define.
8943 * testsuite/Makefile.in: Rebuild.
8944
4a599bdd
CC
89452010-03-23 Cary Coutant <ccoutant@google.com>
8946
8947 * fileread.cc (find_or_make_view): Fix comment.
8948
6c93b22c
ILT
89492010-03-23 Ian Lance Taylor <iant@google.com>
8950
8951 * script-sections.cc (class Orphan_section_placement): Define
8952 PLACE_TLS and PLACE_TLS_BSS.
8953 (Orphan_section_placement::Orphan_section_placement): Initialize
8954 new places.
8955 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8956 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8957 (tls_script_test_SOURCES): Define.
8958 (tls_script_test_DEPENDENCIES): Define.
8959 (tls_script_test_LDFLAGS): Define.
8960 (tls_script_test_LDADD): Define.
8961 * testsuite/Makefile.in: Rebuild.
8962
a2c7281b
DK
89632010-03-22 Doug Kwan <dougkwan@google.com>
8964
8965 * arm.cc (Arm_relocate_functions::abs8,
8966 Arm_relocate_functions::abs16): Use correct check for overflow
8967 specified in the ARM ELF specs.
8968 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8969 target of a BLX instruction specially.
8970 (Reloc_stub::stub_type_for_reloc): Ditto.
8971 (Relocate::relocate): Use symbolic names instead of numeric relocation
8972 codes to report error.
8973 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8974 workaround.
8975 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8976 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8977 thumb2_blx_out_of_range.stdout
8978 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8979 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8980 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8981 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8982 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8983 thumb2_blx_in_range, thumb2_blx_in_range.o,
8984 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8985 thumb2_blx_out_of_range.o): New rules.
2e702c99 8986 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8987 thumb2_blx_in_range and thumb2_blx_out_of_range.
8988 * testsuite/Makefile.in: Regenerate.
8989 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8990 * testsuite/thumb_blx_in_range.s: New file.
8991 * testsuite/thumb_blx_out_of_range.s: New file.
8992
b0193076
RÁE
89932010-03-22 Rafael Espindola <espindola@google.com>
8994
8995 * archive.cc (Should_include): Move to archive.h.
8996 (should_include_member): Make it a member of Archive.
8997 (Lib_group): New.
8998 (Add_lib_group_symbols): New.
8999 * archive.h: Include options.h.
9000 (Archive_member): Moved from Archive.
9001 (Should_include): Moved from archive.cc.
9002 (Lib_group): New.
9003 (Add_lib_group_symbols): New.
9004 * dynobj.cc (do_should_include_member): New.
9005 * dynobj.h (do_should_include_member): New.
9006 * gold.cc (queue_initial_tasks): Update call to queue.
9007 * main.cc (main): Print lib group stats.
9008 * object.cc (do_should_include_member): New.
9009 * object.h: Include archive.h.
9010 (Object::should_include_member): New.
9011 (Object::do_should_include_member): New.
9012 (Sized_relobj::do_should_include_member): New.
9013 * options.cc (General_options::parse_start_lib): New.
9014 (General_options::parse_end_lib): New.
9015 (Input_arguments::add_file): Handle lib groups.
9016 (Input_arguments::start_group): Check we are not in a lib.
9017 (Input_arguments::start_lib): New.
9018 (Input_arguments::end_lib): New.
9019 * options.h (General_options): Add start_lib and end_lib.
9020 (Input_argument::lib_): New.
9021 (Input_argument::lib): New.
9022 (Input_argument::is_lib): New.
9023 (Input_file_lib): New.
9024 (Input_arguments::in_lib_): New.
9025 (Input_arguments::in_lib): New.
9026 (Input_arguments::start_lib): New.
9027 (Input_arguments::end_lib_): New.
9028 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9029 in unused members as preempted.
9030 (Sized_pluginobj::do_should_include_member): New.
9031 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9032 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9033 return the blocker.
9034 (Read_symbols::do_whole_lib_group): New.
9035 (Read_symbols::do_lib_group): New.
9036 (Read_symbols::do_read_symbols): Handle lib groups.
9037 (Read_symbols::get_name): Handle lib groups.
9038 * readsyms.h (Read_symbols): Add an archive member pointer.
9039 (Read_symbols::do_whole_lib_group): New.
9040 (Read_symbols::do_lib_group): New.
9041 (Read_symbols::member_): New.
9042 * script.cc (read_input_script): Update call to queue_soon.
9043
d099120c
DK
90442010-03-19 Doug Kwan <dougkwan@google.com>
9045
9046 * arm.cc (Stub_table::Stub_table): Initialize new data members
9047 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9048 (Stub_table::add_reloc_stub): Assign stub offset and update
9049 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9050 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9051 New data members.
2e702c99 9052 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9053 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9054 instead of going over all reloc stubs.
2e702c99 9055 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9056 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9057 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9058 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9059 Stringpool_template::offset_.
9060 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9061 Stringpool_template::offset_ to zero.
9062
1aa37384
DK
90632010-03-15 Doug Kwan <dougkwan@google.com>
9064
9065 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9066 offset_.
9067 (Stringpool_template::new_key_offset): New method.
9068 (Stringpool_template::add_string): Assign offsets when adding new
9069 strings.
9070 (Stringpool_template::set_string_offsets): Do not set string offsets
9071 when not optimizing.
9072 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9073 member size_.
2e702c99
RM
9074 (Chunked_vector::clear): Clear size_.
9075 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9076 (Chunked_vector::size): Return size_.
9077 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9078 (Chunked_vector::size_): New data member.
1aa37384
DK
9079 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9080 (Stringpool_template::new_key_offset): New method declaration.
9081 (Stringpool_template::offset_): New data member.
9082
b672b057
RÁE
90832010-03-15 Rafael Espindola <espindola@google.com>
9084
9085 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9086 Add_symbols' constructor.
9087 * readsyms.h (Add_symbols): Remove the input_group member.
9088
b6848d3c
ILT
90892010-03-10 Ian Lance Taylor <iant@google.com>
9090
9091 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9092 target to ask whether a reference to a symbol requires a stack
9093 split.
9094 * target.h (Target::is_call_to_non_split): New function.
9095 (Target::do_is_call_to_non_split): Declare virtual function.
9096 * target.cc: Include "symtab.h".
9097 (Target::do_is_call_to_non_split): New function.
9098 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9099
a2a5469e
CC
91002010-03-10 Cary Coutant <ccoutant@google.com>
9101
9102 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9103 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9104 (File_read::open[2]): Add whole_file_view_ to list of views.
9105 (File_read::make_view): Remove test of whole_file_view_.
9106 (File_read::find_or_make_view): Create whole_file_view_ if
9107 necessary.
9108 (File_read::clear_views): Replace bool parameter with enum;
9109 adjust all callers. Don't delete views with permanent data;
9110 do delete cached views and views from archives if
9111 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9112 if clearing the corresponding view.
9113 * fileread.h (File_read::Clear_views_mode): New enum.
9114 (File_read::View::is_permanent_view): New method.
9115 (File_read::clear_views): Replace bool parameter
9116 with enum; adjust all callers.
9117 * options.h (General_options): Change keep_files_mapped option;
9118 add map_whole_files.
9119 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9120 releasing the file.
9121 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9122 the file.
9123
8861f32b
DM
91242010-03-10 David S. Miller <davem@davemloft.net>
9125
9126 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9127
d62d0f5f
ST
91282010-03-09 Sriraman Tallam <tmsriram@google.com>
9129
9130 * icf.cc (get_section_contents): Add '@' marker after processing the
9131 merge reloc.
9132
9177756d
DK
91332010-03-08 Doug Kwan <dougkwan@google.com>
9134
9135 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9136 due to a conversion warning.
9137 (Arm_relobj::update_output_local_symbol_count): Check for local
9138 symbol with unset output index.
9139
9e9e071b
ILT
91402010-03-05 Ian Lance Taylor <iant@google.com>
9141
9142 * options.h (class General_options): Add --spare-dynamic-tags.
9143 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9144 --spare-dynamic-tags.
9145
a81ee015
ILT
91462010-03-05 Ian Lance Taylor <iant@google.com>
9147
9148 * incremental.cc: Include "libiberty.h".
9149
44ec90b9
RO
91502010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9151
9152 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9153 function, is_info_ member.
9154 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9155 (Versions::Versions): Update caller.
9156 (Versions::define_base_version): Likewise.
9157 (Versions::add_def): Likewise.
9158
0897ed3b
ST
91592010-03-03 Sriraman Tallam <tmsriram@google.com>
9160
9161 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9162 (Scan::possible_function_pointer_reloc): New function.
9163 (Scan::local_reloc_may_be_function_pointer): Change to call
9164 possible_function_pointer_reloc.
9165 (Scan::global_reloc_may_be_function_pointer): Ditto.
9166 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9167 relocations in ".data.rel.ro._ZTV" section.
9168 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9169 * testsuite/icf_safe_so_test.cc: Ditto.
9170 * testsuite/icf_safe_test.cc: Ditto.
9171 * testsuite/icf_safe_test.sh: Ditto.
9172
d3bbad62
ILT
91732010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9174 Ian Lance Taylor <iant@google.com>
9175
9176 * target-reloc.h (relocate_section): Check the symbol table index
9177 for -1U before setting the local symbol index.
9178 (scan_relocatable_relocs): If copying the relocation, record that
9179 the local symbol is required.
9180 * object.h (Symbol_value::is_output_symtab_index_set): New
9181 function.
9182 (Symbol_value::may_be_discarded_from_output_symtab): New
9183 function.
9184 (Symbol_value::has_output_symtab_entry): New function.
9185 (Symbol_value::needs_output_symtab_entry): Remove.
9186 (Symbol_value::output_symtab_index): Make sure the symbol index is
9187 set.
9188 (Symbol_value::set_output_symtab_index): Make sure the symbol
9189 index is not set. Make sure the new index is valid.
9190 (Symbol_value::set_must_have_output_symtab_entry): New function.
9191 (Symbol_value::has_output_dynsym_entry): New function.
9192 (Symbol_value::set_output_dynsym_index): Make sure the new index
9193 is valid.
9194 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9195 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9196 local symbol if permitted.
9197 (Sized_relobj::do_finalize_local_symbols): Call
9198 is_output_symtab_index_set rather than needs_output_symtab_entry.
9199 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9200 rather than needs_output_symtab_entry. Call
9201 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9202 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9203 is_output_symtab_index_set rather than needs_output_symtab_entry.
9204 * testsuite/discard_locals_relocatable_test.c: New file.
9205 * testsuite/discard_locals_test.sh: Test -r.
9206 * testsuite/Makefile.am (check_DATA): Add
9207 discard_locals_relocatable_test1.syms,
9208 discard_local_relocatable_test2.syms.
9209 (MOSTLYCLEANFILES): Likewise. Also add
9210 discard_locals_relocatable_test1.lout and
9211 discard_locals_relocatable_test2.out.
9212 (discard_locals_relocatable_test1.syms): New target.
9213 (discard_locals_relocatable_test.o): New target.
9214 (discard_locals_relocatable_test1.out): New target.
9215 (discard_locals_relocatable_test2.syms): New target.
9216 (discard_locals_relocatable_test2.out): New target.
9217 (various): Add missing ../ld-new dependencies.
9218 * testsuite/Makefile.in: Rebuild.
9219
7e8ccf26
NC
92202010-03-03 Nick Clifton <nickc@redhat.com>
9221
9222 * po/fi.po: New Finnish translation.
9223
2a0ff005
DK
92242010-03-01 Doug Kwan <dougkwan@google.com>
9225
9226 * layout.cc (Layout::Layout): Force section types of .init_array*,
9227 .preinit_array* and .fini_array* sections.
9228 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9229 Fix check of return value of std::string::find.().
9230 (Output_section::Input_section_sort_compare::operator()): Remove
9231 comment about .init_array.
9232 (Output_section::Input_section_sort_init_fini_compare::operator()):
9233 New method.
9234 (Output_section::sort_attached_input_sections): Handle .init_array
9235 and .fini_array specially.
9236 * output.h (Output_section::Inut_section_sort_compare): Update
9237 comment.
9238 (Output_section::Input_section_sort_init_fini_compare): New struct.
9239
c3e4ae29
DK
92402010-02-26 Doug Kwan <dougkwan@google.com>
9241
9242 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9243 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9244 * testsuite/debug_msg.sh: Avoid matching source line number for
9245 use of global variable undef_int.
9246
2fd9ae7a
DK
92472010-02-26 Doug Kwan <dougkwan@google.com>
9248
9249 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9250 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9251 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9252 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9253 * options.cc (General_options::General_options): Initialize member
9254 fix_v4bx_.
9255 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9256 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9257 and rm_no_fix_v4bx.stdout
9258 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9259 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9260 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9261 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9262 and arm_no_fix_v4bx.
9263 * Makefile.in: Regenerate.
9264 * testsuite/arm_fix_v4bx.s: New file.
9265 * testsuite/arm_fix_v4bx.sh: Ditto.
9266
67ec7d0b
DK
92672010-02-24 Doug Kwan <dougkwan@google.com>
9268
9269 * arm.cc (Target_arm::got_section): Make the .got section the first
9270 non RELRO section in the data segment.
9271 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9272 suffixes of section names.
9273
10165461
DK
92742010-02-24 Doug Kwan <dougkwan@google.com>
9275
9276 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9277 flags and attributes merging if an input file is a binary file.
9278 * fileread.cc (Input_file::open): Record format of original file.
9279 * fileread.h (Input_file::Format): New enum type.
2e702c99 9280 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9281 (Input_file::format): New method definition.
9282 (Input_file::format_):: New data member.
9283
4a54abbb
DK
92842010-02-24 Doug Kwan <dougkwan@google.com>
9285
9286 * arm.cc (Arm_output_data_got): New class.
9287 (ARM_TCB_SIZE): New constant
9288 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9289 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9290 If user uses a script with a SECTIONS clause, issue only a warning
9291 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9292 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9293 garbage collection.
9294 (Target_arm::got_mode_index_entry): Handle static linking.
9295 (Target_arm::Scan::local): Ditto.
9296 (Target_arm::Scan::global): Ditto.
9297 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9298 all incorrectly implemented relocations.
e1df38aa 9299 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9300 Arm_output_section::fix_exidx_coverage.
9301 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9302 from ".ARM.exidx." and ".ARM.extab.".
9303
ca419a6f
ILT
93042010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9305
9306 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9307 section if it does not already exist.
9308 * attributes.cc (Attributes_section_data::Attributes_section_data):
9309 Don't crash if size is zero.
9310
135b9c78
ILT
93112010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9312 Ian Lance Taylor <iant@google.com>
9313
9314 * gold.cc (queue_middle_tasks): If no input files were opened,
9315 exit.
9316 * workqueue.h (Task_function::Task_function): Assert that there is
9317 a blocker.
9318
bb0bfe4f
DK
93192010-02-22 Doug Kwan <dougkwan@google.com>
9320
9321 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9322 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9323 types to avoid warnings due to different uint64_t implementations
9324 on different hosts.
9325
2a2b6d42
DK
93262010-02-21 Doug Kwan <dougkwan@google.com>
9327
9328 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9329 handling of the maximum backward branch offset.
2e702c99 9330 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9331 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9332 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9333 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9334 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9335 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9336 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9337 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9338 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9339 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9340 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9341 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9342 thumb2_bl_out_of_range.o): New rules.
9343 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9344 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9345 thumb2_bl_out_of_range
9346 * testsuite/Makefile.in: Regenerate.
9347 * testsuite/arm_bl_in_range.s: New file.
9348 * testsuite/arm_bl_out_of_range.s: Ditto.
9349 * testsuite/arm_branch_in_range.sh: Ditto.
9350 * testsuite/arm_branch_range.t: Ditto.
9351 * testsuite/thumb2_branch_range.t: Ditto.
9352 * testsuite/thumb_bl_in_range.s: Ditto.
9353 * testsuite/thumb_bl_out_of_range.s: Ditto.
9354 * testsuite/thumb_branch_range.t: Ditto.
9355
b487ad64
ST
93562010-02-20 Sriraman Tallam <tmsriram@google.com>
9357
9358 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9359 Add reloc offset information.
9360 * icf.cc (get_section_contents): Change iterators to point to the new
9361 vectors. Add reloc offset information to the contents.
9362 * icf.h (Icf::Sections_reachable_info): New typedef.
9363 (Icf::Sections_reachable_list): New typedef.
9364 (Icf::Offset_info): New typedef.
9365 (Icf::Reloc_info): New struct typedef.
9366 (Icf::Reloc_info_list): New typedef.
9367 (Icf::symbol_reloc_list): Delete method.
9368 (Icf::addend_reloc_list): Delete method.
9369 (Icf::section_reloc_list): Delete method.
9370 (Icf::reloc_info_list): New method.
9371 (Icf::reloc_info_list_): New member.
9372
f96accdf
DK
93732010-02-19 Doug Kwan <dougkwan@google.com>
9374
9375 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9376 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9377 * arm.cc (Arm_relocation_functions): New forward declaration.
9378 (Target_arm::Target_arm): Initialize new data members
9379 got_mod_index_offset_ and tls_base_symbol_defined_.
9380 (Target_arm::Relocate::relocate_tls): New method.
9381 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9382 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9383 New methods.
2e702c99 9384 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9385 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9386 (Target_arm::got_mod_index_offset_,
9387 Target_arm::tls_base_symbol_defined_): New data members.
9388 (Target_arm::Scan::local, Target::Scan::global,
9389 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9390 relocations.
9391
c8761b9a
DK
93922010-02-18 Doug Kwan <dougkwan@google.com>
9393
9394 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9395 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9396 text section as a parameter becuase some broken tools may not set
9397 the link in section header.
9398 (Target_arm::has_got_section): New method.
9399 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9400 without any mapping symbol as data only. Remove warning.
9401 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9402 link in its section header, try to discover the link by inspecting the
9403 REL31 relocation at the beginning of the section.
9404 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9405 in error message.
9406 (Target_arm::Scan::global): Treat any reference to the symbol
9407 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9408
21bb3914
ST
94092010-02-12 Sriraman Tallam <tmsriram@google.com>
9410
9411 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9412 (Scan::global_reloc_may_be_function_pointer): New function.
9413 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9414 (Scan::global_reloc_may_be_function_pointer): New function.
9415 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9416 (Scan::global_reloc_may_be_function_pointer): New function.
9417 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9418 (Scan::global_reloc_may_be_function_pointer): New function.
9419 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9420 (Scan::global_reloc_may_be_function_pointer): New function.
9421 (Scan::possible_function_pointer_reloc): New function.
9422 (Target_x86_64::can_check_for_function_pointers): New function.
9423 * gc.h (gc_process_relocs): Scan relocation types to determine if
9424 function pointers were taken for targets that support it.
9425 * icf.cc (Icf::find_identical_sections): Include functions for
9426 folding in safe ICF whose pointer is not taken.
9427 * icf.h (Secn_fptr_taken_set): New typedef.
9428 (fptr_section_id_): New member.
9429 (section_has_function_pointers): New function.
9430 (set_section_has_function_pointers): New function.
9431 (check_section_for_function_pointers): New function.
9432 * options.h: Fix comment for safe ICF option.
9433 * target.h (can_check_for_function_pointers): New function.
9434 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9435 Modify icf_safe_test for X86-64.
9436 * testsuite/Makefile.in: Regenerate.
9437 * testsuite/icf_safe_so_test.cc: New file.
9438 * testsuite/icf_safe_so_test.sh: New file.
9439 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9440 (main): Change to take pointer to function kept_func_3.
9441 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9442 folding is done correctly for X86-64.
9443
0da6fa6c
DM
94442010-02-12 David S. Miller <davem@davemloft.net>
9445
9446 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9447 is_symbolless parameter.
9448 (Output_reloc<SHT_REL>::is_symbolless): New.
9449 (Output_reloc<SHT_REL>::is_symbolless_): New.
9450 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9451 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9452 (Output_reloc<SHT_RELA>::is_symbolless): New.
9453 (Output_data_reloc::add_global): Handle is_symbolless.
9454 (Output_data_reloc::add_global_relative): Likewise.
9455 (Output_data_reloc::add_local): Likewise.
9456 (Output_data_reloc::add_local_relative): Likewise.
9457 (Output_data_reloc::add_symbolless_global_addend): New.
9458 (Output_data_reloc::add_symbolless_local_addend): New.
9459 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9460 is_symbolless.
9461 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9462 instead of ->is_relative_
9463 (Output_reloc::write): Likewise.
9464 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9465 (Output_reloc::write_rel): Simplify.
9466
9467 * sparc.cc (Target_sparc::Scan::local): Use
9468 ->add_symbolless_local_addend as needed.
9469 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9470 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9471 based upon relocation offset.
9472
e4782e83
DK
94732010-02-11 Doug Kwan <dougkwan@google.com>
9474
9475 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9476 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9477 beginning of function.
9478 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9479 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9480 parameter is_32bit in calls to should_apply_static_reloc.
9481 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9482 (check_DATA): Add arm_abs_global.stdout.
9483 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9484 arm_abs_global.stdout): New rules.
9485 (MOSTLLYCLEANFILES): Add arm_abs_global
9486 * Makefile.in: Regenerate.
9487 * testsuite/arm_abs_global.s: New file.
9488 * testsuite/arm_abs_global.sh: Ditto.
9489 * testsuite/arm_abs_lib.s: Ditto.
9490
93ceb764
ILT
94912010-02-11 Ian Lance Taylor <iant@google.com>
9492
9493 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9494 Read_relocs task.
9495 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9496 Allocate_commons_task first.
9497 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9498 task, rather than symtab_lock_.
9499 (Gc_process_relocs::~Gc_process_relocs): New function.
9500 (Gc_process_relocs::is_runnable): Check this_blocker_.
9501 (Gc_process_relocs::locks): Use next_blocker_ rather than
9502 blocker_.
9503 (Scan_relocs::~Scan_relocs): New function.
9504 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9505 symtab_lock_.
9506 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9507 next_blocker_.
9508 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9509 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9510 constructor accordingly.
9511 (class Gc_process_relocs): Likewise.
9512 (class Scan_relocs): Likewise.
9513 * common.h (class Allocate_commons_task): Remove symtab_lock_
9514 field, and corresponding constructor parameter.
9515 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9516 symtab_lock_.
9517 (Allocate_commons_task::locks): Likewise.
9518
114dfbe1
ILT
95192010-02-11 Ian Lance Taylor <iant@google.com>
9520
9521 * gold-threads.h (class Once): Define.
9522 (class Initialize_lock): Rewrite as child of Once.
9523 * gold-threads.cc (class Once_initialize): Define.
9524 (once_pointer_control): New static variable.
9525 (once_pointer, once_arg): New static variables.
9526 (c_run_once): New static function.
9527 (Once::Once, Once::run_once, Once::internal_run): New functions.
9528 (class Initialize_lock_once): Remove.
9529 (initialize_lock_control): Remove.
9530 (initialize_lock_pointer): Remove.
9531 (initialize_lock_once): Remove.
9532 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9533 (Initialize_lock::initialize): Rewrite.
9534 (Initialize_lock::do_run_once): New function.
9535 * archive.cc (Archive::interpret_header): Only clear name if it is
9536 not already empty.
9537 * fileread.cc: Include "gold-threads.h"
9538 (file_counts_lock): New static variable.
9539 (file_counts_initialize_lock): Likewise.
9540 (File_read::release): Only increment counts when using --stats.
9541 Use a lock around the increment.
9542 * parameters.cc (class Set_parameters_target_once): Define.
9543 (set_parameters_target_once): New static variable.
9544 (Parameters::Parameters): Move here from parameters.h.
9545 (Parameters::set_target): Rewrite.
9546 (Parameters::set_target_once): New function.
9547 (Parameters::clear_target): Move here and rewrite.
9548 * parameters.h (class Parameters): Update declarations. Add
9549 set_parameters_target_once_ field.
9550 (Parameters::Parameters): Move to parameters.cc.
9551 (Parameters::clear_target): Likewise.
9552 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9553 task.
9554 (Start_group::~Start_group): New function.
9555 (Start_group::is_runnable): New function.
9556 (Start_group::locks, Start_group::run): New functions.
9557 (Finish_group::run): Change saw_undefined to size_t.
9558 * readsyms.h (class Start_group): Define.
9559 (class Finish_group): Change saw_undefined_ field to size_t.
9560 (Finish_group::Finish_group): Remove saw_undefined and
9561 this_blocker parameters. Change all callers.
9562 (Finish_group::set_saw_undefined): New function.
9563 (Finish_group::set_blocker): New function.
9564 * symtab.h (class Symbol_table): Change saw_undefined to return
9565 size_t. Change saw_undefined_ field to size_t.
9566 * target-select.cc (Set_target_once::do_run_once): New function.
9567 (Target_selector::Target_selector): Initialize set_target_once_
9568 field. Don't initialize lock_ and initialize_lock_ fields.
9569 (Target_selector::instantiate_target): Rewrite.
9570 (Target_selector::set_target): New function.
9571 * target-select.h (class Set_target_once): Define.
9572 (class Target_selector): Update declarations. Make
9573 Set_target_once a friend. Remove lock_ and initialize_lock_
9574 fields. Add set_target_once_ field.
9575
fa17a3f4
ILT
95762010-02-10 Ian Lance Taylor <iant@google.com>
9577
9578 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9579 queueing any tasks.
9580 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9581 (queue_middle_tasks): Add all blockers before queueing any tasks.
9582 (queue_final_tasks): Likewise.
9583 * token.h (Task_token::add_blockers): New function.
9584 * object.h (Input_objects::number_of_relobjs): New function.
9585
c7177d31
ILT
95862010-02-10 Ian Lance Taylor <iant@google.com>
9587
5de0e392
ILT
9588 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9589 shared, not if not position independent.
9590 * x86_64.cc (Relocate::relocate_tls): Likewise.
9591 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9592 (tls_pie_pic_test): New target.
9593 * testsuite/Makefile.in: Rebuild.
9594
c7177d31
ILT
9595 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9596 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9597 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9598 * testsuite/Makefile.in: Rebuild.
9599
684b268a
DM
96002010-02-09 David S. Miller <davem@davemloft.net>
9601
9602 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9603 R_SPARC_RELATIVE using ->add_local_relative().
9604 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9605
612a8d3d
DM
9606 * output.h (Output_data_dynamic::add_section_size): New method
9607 that takes two Output_data objects.
9608 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9609 entry param. Handle it in initializers.
9610 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9611 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9612 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9613 arg.
9614 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9615 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9616 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9617 for dynrel_includes_plt.
9618 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9619 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9620 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9621 before .rela.plt
9622 (Target_sparc::do_finalize_sections): Update to pass true for
9623 dynrel_includes_plt.
9624 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9625 output before .rela.plt
9626 (Target_powerpc::do_finalize_sections): Update to pass true for
9627 dynrel_includes_plt when 32-bit.
9628
cb1be87e
DK
96292010-02-08 Doug Kwan <dougkwan@google.com>
9630
9631 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9632 method.
9633 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9634 Arm_relobj::scan_section_for_cortex_a8_stubs,
9635 Arm_relobj::do_relocation_section): Instead of calling
9636 Output_section::output_address, use faster
9637 Arm_relobj::simple_input_section_output_address.
9638
705b5121
DM
96392010-02-08 David S. Miller <davem@davemloft.net>
9640
9641 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9642 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9643 relocation helper function.
9644
024c4466
DM
9645 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9646 just like R_SPARC_GOT{10,13,22}.
9647 (Target_sparc::Scan::local): Likewise.
9648 (Target_sparc::Relocate:relocate): Likewise.
9649
9109c078
ILT
96502010-02-06 Ian Lance Taylor <iant@google.com>
9651
9652 * configure.ac: Rewrite targetobjs duplicate removal code to use
9653 only shell constructs.
9654 * configure: Rebuild.
9655
cf846138
DK
96562010-02-05 Doug Kwan <dougkwan@google.com>
9657
9658 PR 11247
9659 * arm.cc (Arm_relobj::section_is_scannable): New method.
9660 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9661 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9662
6cfaf60b
DK
96632010-02-04 Doug Kwan <dougkwan@google.com>
9664
9665 PR 11247
9666 * arm-reloc-property.cc (cstdio): Include.
9667 * configure.ac (targetobjs): Remove duplicates.
9668 * configure: Regenerate.
9669 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9670 big and little endian version for a given address size.
9671
5c57f1be
DK
96722010-02-03 Doug Kwan <dougkwan@google.com>
9673
9674 * arm-reloc-property.cc
9675 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9676 definition.
9677 * arm-reloc-property.h
9678 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9679 New method definition.
9680 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9681 declaration.
9682 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9683 overflow to N.
9684 (GOT_PREL): Change implemented to Y.
9685 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9686 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9687 (Arm_relocate_functions::movw_abs_nc): Remove method.
9688 (Arm_relocate_functions::movt_abs): Ditto.
9689 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9690 (Arm_relocate_functions::thm_movt_abs): Ditto.
9691 (Arm_relocate_functions::movw_rel_nc): Ditto.
9692 (Arm_relocate_functions::movw_rel): Ditto.
9693 (Arm_relocate_functions::movt_rel): Ditto.
9694 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9695 (Arm_relocate_functions:thm_movw_rel): Ditto.
9696 (Arm_relocate_functions:thm_movt_rel): Ditto.
9697 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9698 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9699 New method definitions.
9700 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9701 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9702 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9703 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9704 (Target_arm::Relocate::relocate): Check for non-static or
9705 unimplemented relocation code and exit early. Change calls to
9706 Target_arm::reloc_uses_thumb_bit and
9707 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9708 instead. Refactor code to handle similar relocations to increase
9709 code sharing. Remove check for unsupported relocation code in switch
9710 statement.
9711 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9712 relocation property table to find out size. Change error message to
9713 print out the name of a relocation code instead of the numeric value.
9714 (Target_arm::scan_reloc_for_stub): Use relocation property table
9715 instead of calling Target_arm::reloc_uses_thumb_bit().
9716
218c5831
DK
97172010-02-02 Doug Kwan <dougkwan@google.com>
9718
9719 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9720 types of relaxed input section.
9721
0d31c79d
DK
97222010-02-02 Doug Kwan <dougkwan@google.com>
9723
9724 * Makefile.am (HFILES): Add arm-reloc-property.h.
9725 (DEFFILES): New.
2e702c99
RM
9726 (TARGETSOURCES): Add arm-reloc-property.cc
9727 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9728 (libgold_a_SOURCES): $(DEFFILES)
9729 * Makefile.in: Regenerate.
9730 * arm-reloc-property.cc: New file.
9731 * arm-reloc-property.h: New file.
9732 * arm-reloc.def: New file.
9733 * arm.cc: Update comments.
9734 (arm-reloc-property.h): New included header.
9735 (arm_reloc_property_table): New global variable.
9736 (Target_arm::do_select_as_default_target): New method definition.
9737 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9738 arm-reloc-property to targ_extra_obj.
9739 * parameters.cc (set_parameters_target): Call
9740 Target::select_as_default_target().
9741 * target.h (Target::select_as_default_target): New method definition.
9742 (Target::do_select_as_default_target): Same.
9743
546c7457
DK
97442010-02-01 Doug Kwan <dougkwan@google.com>
9745
9746 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9747 first_output_text_section_.
9748 (Arm_exidx_fixup::first_output_text_section): New method definition.
9749 (Arm_exidx_fixup::first_output_text_section_): New data member.
9750 (Arm_exidx_fixup::process_exidx_section): Record the first text
9751 output section seen.
9752 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9753 and entsize in output section header.
9754
11b861d5
DK
97552010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9756
9757 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9758 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9759 (Arm_relocate_functions::thm_alu11): New Method.
9760 (Arm_relocate_functions::thm_pc8): New Method.
9761 (Arm_relocate_functions::thm_pc12): New Method.
9762 (Target_arm::Scan::local): Handle the relocations.
9763 (Target_arm::Scan::global): Likewise.
9764 (Target_arm::Relocate::relocate): Likewise.
9765 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9766
c9a2c125
DK
97672010-01-29 Doug Kwan <dougkwan@google.com>
9768
9769 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9770 of relocation types as ld.
9771
1521477a
DK
97722010-01-29 Doug Kwan <dougkwan@google.com>
9773
9774 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9775 to public.
9776 (Arm_relocate_functions::thumb_branch_common): Ditto.
9777 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9778 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9779 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9780 Arm_relocate_functions::jump24): Remove.
9781 (Target_arm::Relocate::relocate): Adjust code to call
9782 Arm_relocation_functions::arm_branch_common and
9783 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9784 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9785
e7eca48c
DK
97862010-01-29 Doug Kwan <dougkwan@google.com>
9787
9788 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9789 output_local_symbol_count_needs_update_.
9790 (Arm_relobj::output_local_symbol_count_needs_update,
9791 Arm_relobj::set_output_local_symbol_count_needs_update,
9792 Arm_relobj::update_output_local_symbol_count): New methods.
9793 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9794 member.
9795 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9796 of pointed function as in a R_ARM_PREL31 relocation.
9797 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9798 for output local symbol count updating.
9799 (Target_arm::do_relax): Update output local symbol counts in objects
9800 if necessary.
9801 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9802
02961d7e
ILT
98032010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9804
9805 * arm.cc: Added support for the ARM relocations:
9806 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9807 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9808 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9809 movw_prel_nc).
9810 (Arm_relocate_functions::movw_rel): New method.
9811 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9812 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9813 thm_movw_prel_nc).
9814 (Arm_relocate_functions::thm_movw_rel): New method.
9815 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9816 thm_movt_prel).
9817 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9818 relocations.
9819 (Target_arm::Scan::global): Likewise.
9820 (Target_arm::Relocate::relocate): Likewise.
9821 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9822 Likewise.
9823
b10d2873
ILT
98242010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9825
9826 * arm.cc: Added support for ARM group relocations.
9827 (Target_arm::reloc_needs_sym_origin): New method.
9828 (Arm_relocate_functions::calc_grp_kn): New method.
9829 (Arm_relocate_functions::calc_grp_residual): New method.
9830 (Arm_relocate_functions::calc_grp_gn): New method.
9831 (Arm_relocate_functions::arm_grp_alu): New Method.
9832 (Arm_relocate_functions::arm_grp_ldr): New Method.
9833 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9834 (Arm_relocate_functions::arm_grp_ldc): New Method.
9835 (Target_arm::Scan::local): Handle the ARM group relocations.
9836 (Target_arm::Scan::global): Likewise.
9837 (Target_arm::Relocate::relocate): Likewise.
9838 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9839 Likewise.
9840
2b328d4e
DK
98412010-01-26 Doug Kwan <dougkwan@google.com>
9842
9843 * arm.cc (set): Include.
9844 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9845 pointer type.
2e702c99 9846 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9847 (Arm_output_section::append_text_sections_to_list): New method.
9848 (Arm_output_section::fix_exidx_coverage): Ditto.
9849 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9850 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9851 Relobj::set_section_offset() instead of
9852 Sized_relobj::invalidate_section_offset().
2e702c99 9853 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9854 parameter for section headers. Ignore relocation sections for
9855 unallocated sections and EXIDX sections.
9856 (Target_arm::fix_exidx_coverage): New method.
9857 (Target_arm::output_section_address_less_than): New type.
9858 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9859 linked text section instead of the EXIDX section.
9860 (Arm_output_section::create_stub_group): Add an assertion to check
9861 that this is not an EXIDX output section.
9862 (Arm_output_section::append_text_sections_to_list): New method.
9863 (Arm_output_section::fix_exidx_coverage): Ditto.
9864 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9865 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9866 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9867 first pass.
9868 (Target_arm::fix_exidx_coverage): New method.
9869 * object.h (Relobj::set_output_section): New method.
9870 (Sized_relobj::invalidate_section_offset): Remove method.
9871 (Sized_relobj::do_invalidate_section_offset): Remove method.
9872 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9873
c7f3c371
DK
98742010-01-25 Doug Kwan <dougkwan@google.com>
9875
9876 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9877 Fix warning due to signed and unsigned comparison on a 32-bit host.
9878
8923b24c
DK
98792010-01-22 Doug Kwan <dougkwan@google.com>
9880
9881 * arm.cc (Target_arm::do_relax): Record an output section for section
9882 offset adjustment it contains any stub table that has changed.
9883 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9884 offsets in an output section if necessary.
9885 * output.cc (Output_section::Output_section): Initialize
9886 section_offsets_need_adjustments_.
9887 (Output_section::add_input_section_for_script): Renamed to
9888 Output_section::add_simple_input_section.
9889 (Output_section::save_states): Add a comment.
9890 (Output_section::discard_states): New method defintion.
9891 (Output_section::adjust_section_offsets): Same.
9892 * output.h (Output_section::add_input_section_for_script): Renamed to
9893 Output_section::add_simple_input_section.
9894 (Output_section::discard_states): New method declaration.
9895 (Output_section::adjust_section_offsets): Same.
9896 (Output_section::section_offsets_need_adjustment,
9897 Output_section::set_section_offsets_need_adjustment): New method
9898 definitions.
9899 (Output_section::section_offsets_need_adjustment_): New data member.
9900 * script-sections.cc
9901 (Output_section_element_input::set_section_address): Adjust code for
9902 renaming of Output_section::add_input_section_for_script.
9903 (Orphan_output_section::set_section_address): Same.
9904
9b2fd367
DK
99052010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9906
9907 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9908 Fix_v4bx enum values .
9909 * gold/options.h (General_options): New option definitions.
9910 (General_options::fix_v4bx): New method.
9911 (General_options::Fix_v4bx): New enum.
9912 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9913 (General_options::parse_fix_v4bx_interworking): New method.
9914
80d0d023
DK
99152010-01-22 Doug Kwan <dougkwan@google.com>
9916
9917 * arm.cc (Arm_exidx_fixup): New class.
9918
af2cdeae
DK
99192010-01-21 Doug Kwan <dougkwan@google.com>
9920
9921 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9922 classes.
9923 (Arm_exidx_section_offset_map): New type.
9924
993d07c1
DK
99252010-01-21 Doug Kwan <dougkwan@google.com>
9926
9927 * arm.cc (Arm_exidx_input_section): New class.
9928 (Arm_relobj::exidx_input_section_by_link,
9929 Arm_relobj::exidx_input_section_by_shndx,
9930 Arm_relobj::make_exidx_input_section): New methods.
9931 (read_arm_attributes_section): Remove.
9932 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9933 information about them.
9934 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9935 to here.
9936
5ac169d4
DK
99372010-01-20 Doug Kwan <dougkwan@google.com>
9938
9939 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9940 Input_section_specifier to Section_id.
9941 (Target_arm::new_arm_input_section: Adjust code for change of key
9942 type.
9943 (Target_arm::find_arm_input_section): Ditto.
9944 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9945 (Section_id): Remove.
9946 (Garbage_collection::Section_id_hash): Remove.
9947 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9948 (Section_id): Remove.
9949 (Icf::Section_id_hash): Remove.
9950 * object.h (Section_id, Const_section_id, Section_id_hash,
9951 Const_section_id_hash): New type definitions.
9952 * output.cc (Output_section::add_relaxed_input_section): Change to
9953 use Const_section_id instead of Input_section_specifier as key type.
9954 (Output_section::add_merge_input_section): Ditto.
9955 (Output_section::build_relaxation_map): Change to use Section_id
9956 instead of Input_section_specifier as key type.
2e702c99 9957 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9958 Ditto.
9959 (Output_section::convert_input_sections_to_relaxed_sections): Change
9960 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9961 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9962 (Output_section::find_relaxed_input_section): Ditto.
9963 * output.h (Input_section_specifier): Remove class.
9964 (Output_section::Output_section_data_by_input_section_map): Change
9965 key type to Const_section_id.
9966 (Output_section::Output_relaxed_input_section_by_input_section_map):
9967 Ditto.
9968 (Output_section::Relaxation_map): Change key type to Section_id.
9969
a2162063
ILT
99702010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9971
9972 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9973 (class Arm_v4bx_stub): New class.
9974 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9975 (Stub_factory::make_arm_v4bx_stub): New method.
9976 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9977 (Stub_table::empty): Handle v4bx stubs.
9978 (Stub_table::add_arm_v4bx_stub): New method.
9979 (Stub_table::find_arm_v4bx_stub): New method.
9980 (Arm_relocate_functions::v4bx): New method.
9981 (Target_arm::fix_v4bx): New method.
9982 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9983 (Stub_table::relocate_stubs): Likewise.
9984 (Stub_table::do_write): Likewise.
9985 (Stub_table::update_data_size_and_addralign): Likewise.
9986 (Stub_table::finalize_stubs): Likewise.
9987 (Target_arm::Scan::local): Likewise.
9988 (Target_arm::Scan::global): Likewise.
9989 (Target_arm::do_finalize_sections): Likewise.
9990 (Target_arm::Relocate::relocate): Likewise.
9991 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9992 Likewise.
9993 (Target_arm::scan_reloc_for_stub): Likewise.
9994 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9995
5696ab0b
ILT
99962010-01-19 Ian Lance Taylor <iant@google.com>
9997
9998 * output.cc (Output_section_headers::do_sized_write): Write large
9999 segment count to sh_info field.
10000 (Output_file_header::do_sized_write): For large segment count,
10001 write PN_XNUM to e_phnum field.
10002
800d0f56
ILT
100032010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10004
10005 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10006 (Arm_relocate_functions::thm_jump8): New function.
10007 (Arm_relocate_functions::thm_jump11): New function.
10008 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10009 R_ARM_THM_JUMP11.
10010 (Target_arm::Scan::global): Likewise.
10011 (Target_arm::Relocate::relocate): Likewise.
10012 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10013 Likewise.
10014
41263c05
DK
100152010-01-14 Doug Kwan <dougkwan@google.com>
10016
10017 * arm.cc (map, utility): Include headers.
10018 (Target_arm::apply_cortex_a8_workaround): New method.
10019 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10020 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10021 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10022 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10023 the --[no-]fix-cortex-a8 command line options.
10024 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10025 (Target_arm::relocate_stub): Use addend in instruction template.
10026 * options.h (DEFINE_bool): Set the user-set flag.
10027 (General_options): Add --[no-]-fix-cortex options.
10028 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10029 : Update fast look-up map after conversion.
41263c05 10030
459e9b03
ST
100312010-01-14 Sriraman Tallam <tmsriram@google.com>
10032
10033 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10034 in the first pass of do_layout.
10035
b521dfe4
DK
100362010-01-13 Doug Kwan <dougkwan@google.com>
10037
10038 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10039 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10040 apparent compiler problem of not folding static constant integral
10041 data members of elfcpp::Elf_sizes<32>.
10042
44272192
DK
100432010-01-13 Doug Kwan <dougkwan@google.com>
10044
10045 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10046 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10047 Arm_relobj::scan_section_for_cortex_a8_erratum,
10048 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10049 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10050 sections to scan for relocation stubs into a new method
10051 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10052 relocation and Cortex-A8 stub scanning.
10053 (Target_arm::do_relax): Force stubs to be after stubbed sections
10054 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10055 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10056 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10057
44b71ece
ILT
100582010-01-12 Ian Lance Taylor <iant@google.com>
10059
10060 * target-reloc.h (visibility_error): New inline function.
10061 (relocate_section): Call visibility_error.
10062 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10063 (MOSTLYCLEANFILES): Likewise.
10064 (protected_4_pic.o, protected_3.err): New targets.
10065 * testsuite/protected_4.cc: New file.
10066
a120bc7f
DK
100672010-01-12 Doug Kwan <dougkwan@google.com>
10068
10069 * arm.cc (Cortex_a8_reloc): New class.
10070 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10071 and cortex_a8_relocs_info_.
10072 (Target_arm::fix_cortex_a8): New method definition.
10073 (Target_arm::Cortex_a8_relocs_info): New type.
10074 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10075 New data member declarations.
10076 (Target_arm::scan_reloc_for_stub): Record information about
10077 relocations for THUMB branches that might be exempted from the
10078 Cortex-A8 workaround.
10079 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10080 at the beginning of a relaxation pass.
10081
20138696
DK
100822010-01-12 Doug Kwan <dougkwan@google.com>
10083
10084 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10085 (Arm_relobj::Mapping_symbol_position,
10086 Arm_reloj::Mapping_symbol_position_less,
10087 Arm_relobj::Mapping_symbols_info): New types.
10088 (Target_arm::is_mapping_symbol_name): New method definition.
10089 (Arm_relobj::do_count_local_symbols): Save information about mapping
10090 symbols.
10091
089d69dc
DK
100922010-01-11 Doug Kwan <dougkwan@google.com>
10093
10094 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10095 Arm_relocate_functions::thumb32_branch_upper,
10096 Arm_relocate_functions::thumb32_branch_lower,
10097 Arm_relocate_functions::thumb32_cond_branch_offset,
10098 Arm_relocate_functions::thumb32_cond_branch_upper,
10099 Arm_relocate_functions::thumb32_cond_branch_lower,
10100 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10101 branch offset encoding.
10102 (Arm_relocate_functions::thumb_branch_common): Use new branch
10103 offset encoding methods to avoid code duplication.
10104 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10105 (Stub_addend_reader::operator()): Use new branch encoding method
10106 to avoid code duplication.
10107
99e5bff2
DK
101082010-01-11 Doug Kwan <dougkwan@google.com>
10109
10110 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10111 (Target_arm::do_finalize_sections): Define special EXIDX section
10112 symbols only if referenced.
10113 * gc.h (Garbage_collection::add_reference): New method.
10114 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10115 code duplication.
10116
98e090bd
ILT
101172010-01-11 Ian Lance Taylor <iant@google.com>
10118
d0a91bd8
ILT
10119 * script.cc (Version_script_info::build_expression_list_lookup):
10120 Change complaing about duplicate wildcard match from error to
10121 warning.
10122
98e090bd
ILT
10123 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10124 of 2009-12-30.
10125 (Version_script_info::Version_script_info): Initialize globs_,
10126 default_version_, default_is_global_, and exact_. Don't
10127 initialize globals_ or locals_.
10128 (Version_script_info::build_lookup_tables): Build local symbols
10129 first.
10130 (Version_script_info::unquote): New function.
10131 (Version_script_info::add_exact_match): New function.
10132 (Version_script_info::build_expression_list_lookup): Remove lookup
10133 parameter. Add is_global parameter. Change all callers. Handle
10134 wildcard pattern specially. Unquote pattern. Call
10135 add_exact_match.
10136 (Version_script_info::get_name_to_match): New function.
10137 (Version_script_info::get_symbol_version): New function.
10138 (Version_script_info::get_symbol_version_helper): Remove.
10139 (Version_script_info::check_unmatched_names): Call unquote.
10140 * script.h (class Version_script_info): Change get_symbol_version
10141 to be non-inline and add is_global parameter; change all callers.
10142 Rewrite symbol_is_local. Update declarations. Define struct
10143 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10144 Remove globals_ and locals_ members. Add exact_, globs_,
10145 default_version_, is_global_.
10146 (Version_script_info::Glob): Remove pattern, add expression and
10147 is_global. Update constructor. Change all callers.
10148 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10149 default version.
10150 (Versions::symbol_section_contents): If a symbol is undefined, or
10151 defined in a dynamic object, set the version index to
10152 VER_NDX_LOCAL.
10153 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10154 symbol_is_local.
10155 (Symbol_table::add_from_pluginobj): Likewise.
10156 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10157
d56962d3
DK
101582010-01-11 Doug Kwan <dougkwan@google.com>
10159
10160 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10161 (incremental_dump_LDADD): Add linking option for libintl.
10162 * Makefile.in: Regenerate.
10163
94e6ee91
L
101642010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10165
10166 PR gold/11144
10167 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10168 instead of -Ds.
10169 * testsuite/Makefile.in: Regenerated.
10170
e96c574b
DK
101712010-01-10 Doug Kwan <dougkwan@google.com>
10172
10173 * options.h (DEFINE_var): Use parentheses around argument varname__
10174 in macro body to avoid any unintended subsequent substitutions.
10175
7198066b
ILT
101762010-01-10 Ian Lance Taylor <iant@google.com>
10177
ba4d53bf
ILT
10178 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10179 candidates before doing symbol resolution.
10180
7198066b
ILT
10181 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10182 ODR candidates if only one is weak.
10183
a2beed37
ILT
101842010-01-08 Ian Lance Taylor <iant@google.com>
10185
10186 * script.cc (Version_script_info::build_expression_list_lookup):
10187 Don't warn about ambiguous version, just record the ambiguity.
10188 (Version_script_info::get_symbol_version_helper): Give error if
10189 version is ambiguous.
10190
2fb7225c
DK
101912010-01-08 Doug Kwan <dougkwan@google.com>
10192
10193 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10194 prev_data_size_ and prev_addralign_. Remove initializer for
10195 deleted data member has_been_changed_.
10196 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10197 to determine if the table is empty.
10198 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10199 Remove.
10200 (Stub_table::add_reloc_stub): Define method in class definition
10201 instead of just declaring it there.
10202 (Stub_table::add_cortex_a8_stub): New method definition.
10203 (Stub_table::update_data_size_and_addralign): Ditto.
10204 (Stub_table::finalize_stubs): Ditto.
10205 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10206 (Stub_table::do_addralign_): Return address alignment in the
10207 (Stub_table::do_reset_address_and_file_offset): Define method in
10208 class definition instead of declaring it there. Set current data
10209 size to be the data size of the previous pass.
10210 (Stub_table::set_final_data_size): Use current data size as the
10211 final data size.
10212 (Stub_table::relocate_stub): Change parameter type of stub from
10213 Reloc_stub pointer to Stub pointer.
10214 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10215 (Stub_table::Cortex_a8_stub_list): New typedef.
10216 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10217 Stub_table::prev_addralign_): New data member.
10218 (Arm_relobj::Arm_relobj): Initialize data member
10219 section_has_cortex_a8_workaround_.
10220 (Arm_relobj::section_has_cortex_a8_workaround,
10221 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10222 definitions.
10223 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10224 declarations.
10225 (Target_arm::relocate_stub): Change parameter type of stub from
10226 Reloc_stub pointer to Stub pointer.
10227 (Insn_template::size, Insn_template::alignment): Handle
10228 THUMB16_SPECIAL_TYPE.
10229 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10230 Stub_table::update_data_size_and_addralign,
10231 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10232 definitions.
10233 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10234 (Stub_table::do_write): Ditto.
10235 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10236
880cd20d
ILT
102372010-01-08 Ian Lance Taylor <iant@google.com>
10238
10239 PR 11108
10240 * symtab.h (class Symbol): Remove fields is_target_special_ and
10241 has_plt_offset_. Add field is_defined_in_discarded_section_.
10242 (Symbol::is_defined_in_discarded_section): New function.
10243 (Symbol::set_is_defined_in_discarded_section): New function.
10244 (Symbol::has_plt_offset): Rewrite.
10245 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10246 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10247 Don't initialize is_target_special_ or has_plt_offset_.
10248 Initialize is_defined_in_discarded_section_.
10249 (Symbol_table::add_from_relobj): If appropriate, set
10250 is_defined_in_discarded_section.
10251 * resolve.cc (Symbol::override_base_with_special): Don't test
10252 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10253 * target-reloc.h (relocate_section): Do special handling for
10254 symbols defined in discarded sections for global symbols as well
10255 as local symbols.
10256
2703e3eb
ILT
102572010-01-08 Ian Lance Taylor <iant@google.com>
10258
10259 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10260 the SHT_SYMTAB case.
10261
339d40a3
ILT
102622010-01-08 Ian Lance Taylor <iant@google.com>
10263
10264 * object.cc (Sized_relobj::do_layout): Don't get confused if
10265 layout_eh_frame returns NULL.
10266
abecea76
ILT
102672010-01-08 Ian Lance Taylor <iant@google.com>
10268
10269 PR 11084
10270 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10271 dynamic symbol table, use the normal symbol table.
10272 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10273 symbol table.
10274
6b7dd3f3
ILT
102752010-01-08 Ian Lance Taylor <iant@google.com>
10276
10277 PR 11072
10278 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10279 sections.
10280
36c50e63
L
102812010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10282
10283 * version.cc (print_version): Change to "Copyright 2010".
10284
e291e7b9
ILT
102852010-01-08 Ian Lance Taylor <iant@google.com>
10286
10287 PR 10287
10288 PR 11063
10289 * i386.cc (class Target_i386): Change return type of plt_section
10290 to be non-const.
10291 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10292 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10293 tls_desc_rel_ field.
10294 (Output_data_plt_i386::rel_tls_desc): New function.
10295 (Target_i386::rel_tls_desc_section): New function.
10296 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10297 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10298 R_386_TLS_DESC reloc in rel_tls_desc_section.
10299 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10300 Define struct Tlsdesc_info.
10301 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10302 (Target_x86_64::do_reloc_symbol_index): New function.
10303 (Target_x86_64::add_tlsdesc_info): New function.
10304 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10305 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10306 tlsdesc_rel_ field.
10307 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10308 all callers.
10309 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10310 (Target_x86_64::rela_tlsdesc_section): New function.
10311 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10312 handling.
10313 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10314 (Target_x86_64::do_reloc_addend): New function.
10315 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10316 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10317 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10318 (Output_reloc::type): New function.
10319 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10320 (Output_reloc::is_target_specific): New function.
10321 (Output_reloc::target_arg): New function.
10322 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10323 absolute relocs and target specific relocs.
10324 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10325 add_target_specific.
10326 (class Output_data_reloc) [SHT_RELA]: Likewise.
10327 * output.cc (Output_reloc::Output_reloc): Add four new versions
10328 for absolute relocs and target specific relocs.
10329 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10330 (Output_reloc::get_symbol_index): Likewise.
10331 (Output_reloc::local_section_offset): Check that local_sym_index_
10332 is not TARGET_CODE or 0.
10333 (Output_reloc::symbol_value): Likewise.
10334 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10335 reloc.
10336 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10337 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10338 functions.
10339 * layout.cc (add_target_dynamic_tags): Use output section for
10340 DT_PLTRELSZ and DT_JMPREL.
10341
3a44184e
ILT
103422010-01-07 Ian Lance Taylor <iant@google.com>
10343
10344 PR 11061
10345 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10346 function.
10347 (class Output_data_reloc_generic): Define.
10348 (class Output_data_reloc_base): Change base class to
10349 Output_data_reloc_generic. Change add() method to call
10350 bump_relative_reloc_count for a relative reloc. Remove
10351 sort_relocs_ field.
10352 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10353 to sort_relocs().
10354 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10355 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10356 appropriate.
10357 * layout.h (class Layout): Update declaration.
10358
ea715a34
ILT
103592010-01-07 Ian Lance Taylor <iant@google.com>
10360
10361 * output.h (class Output_data): Add const version of
10362 output_section and do_output_section.
10363 (class Output_section_data): Add const version of
10364 do_output_section.
10365 (class Output_section): Likewise.
10366 * layout.cc (Layout::add_target_dynamic_tags): New function.
10367 * layout.h (class Layout): Update declarations.
10368 * arm.cc (Target_arm::do_finalize_sections): Use
10369 add_target_dynamic_tags.
10370 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10371 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10372 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10373 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10374
659948a4
ILT
103752010-01-07 Ian Lance Taylor <iant@google.com>
10376
10377 PR 11042
10378 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10379 object as needed.
10380
9d3b86f6
ILT
103812010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10382 Ian Lance Taylor <iant@google.com>
10383
10384 PR 11019
10385 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10386 Xindex::read_symtab_xindex.
10387
bb0d3eb0
DK
103882010-01-07 Doug Kwan <dougkwan@google.com>
10389
10390 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10391 (Insn_template::thumb16_bcond_insn): New method declaration.
10392 (Insn_template): Fix spelling.
10393 (Stub::thumb16_special): New method declaration.
10394 (Stub::do_write): Define virtual method which was previously pure
10395 virtual.
10396 (Stub::do_thumb16_special): New method declaration.
10397 (Stub::do_fixed_endian_write): New template member.
10398 (Reloc_stub::do_write): Remove.
10399 (Reloc_stub::do_fixed_endian_write): Remove.
10400 (Cortex_a8_stub): New class definition.
10401 (Stub_factory::make_cortex_a8_stub): New method definition.
10402 (Stub_factory::Stub_factory): Add missing static storage class
10403 qualifier for elf32_arm_stub_a8_veneer_blx.
10404
ffeef7df
ILT
104052010-01-07 Ian Lance Taylor <iant@google.com>
10406
dc3f80fe
ILT
10407 PR 10980
10408 * options.h (class General_options): Add --warn-unresolved-symbols
10409 and --error-unresolved-symbols.
10410 * errors.cc (Errors::undefined_symbol): Implement
10411 --warn-unresolved-symbols.
10412
ffeef7df
ILT
10413 * options.h (class General_options): Add -z text and -z textoff.
10414 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10415
f1ec9ded
ST
104162010-01-06 Sriraman Tallam <tmsriram@google.com>
10417
10418 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10419 (Garbage_collection::cident_sections): New function.
10420 (Garbage_collection::add_cident_section): New function.
10421 (Garbage_collection::cident_sections_): New member.
10422 (gc_process_relocs): Add references to sections whose names are C
10423 identifiers.
10424 * gold.h (cident_section_start_prefix): New constant.
10425 (cident_section_stop_prefix): New constant.
10426 (is_cident): New function.
10427 * layout.cc (Layout::define_section_symbols): Replace string constants
10428 with the newly defined constants.
10429 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10430 C identifiers.
10431 * testsuite/Makefile.am: Add gc_orphan_section_test.
10432 * testsuite/Makefile.in: Regenerate.
10433 * testsuite/gc_orphan_section_test.cc: New file.
10434 * testsuite/gc_orphan_section_test.sh: New file.
10435
6eda8c29
ILT
104362010-01-06 Ian Lance Taylor <iant@google.com>
10437
b9674e17
ILT
10438 PR 10980
10439 * options.h (class General_options): Add --warn-shared-textrel.
10440 * layout.cc (Layout::finish_dynamic_section): Implement
10441 --warn-shared-textrel.
10442
6eda8c29
ILT
10443 PR 10980
10444 * options.h (class General_options): Add --warn-multiple-gp.
10445
32dcd44e
ILT
104462010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10447
10448 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10449 $(THREADSLIB) and $(LIBDL).
10450 * Makefile.in: Rebuild.
10451
a192ba05
ILT
104522010-01-06 Ian Lance Taylor <iant@google.com>
10453
10454 PR 10980
10455 * options.cc (General_options::parse_section_start): New function.
10456 (General_options::section_start): New function.
10457 (General_options::General_options): Initialize all members.
10458 * options.h: Include <map>
10459 (class General_options): Add --section-start. Add section_starts_
10460 member.
10461 * layout.cc (Layout::attach_allocated_section_to_segment): If
10462 --section-start was used, set the address of the segment. Remove
10463 local sort_sections.
10464 (Layout::relaxation_loop_body): If the address of the load segment
10465 has been set by --section-start, don't use it.
10466 * output.h (Output_segment::update_flags_for_output_section): New
10467 function.
10468 * output.cc (Output_segment::add_output_section): Call
10469 update_flags_for_output_section.
10470
dde3f402
ILT
104712010-01-05 Ian Lance Taylor <iant@google.com>
10472
62dfdd4d
ILT
10473 PR 10980
10474 * options.h (class General_options): Add --undefined-version.
10475 * script.cc (struct Version_expression): Add was_matched_by_symbol
10476 field.
10477 (Version_script_info::matched_symbol): New function.
10478 (Version_script_info::get_symbol_version_helper): Call
10479 matched_symbol.
10480 (Version_script_info::check_unmatched_names): New function.
10481 * script.h (class Version_script_info): Update declarations.
10482 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10483
9c4ae156
ILT
10484 * options.h (class General_options): Use DEFINE_bool_alias for
10485 allow_multiple_definition.
10486 * resolve.cc (Symbol_table::should_override): Don't test
10487 allow_multiple_definition.
10488
dde3f402
ILT
10489 PR 10980
10490 * options.h (class General_options): Add --cref.
10491 * main.cc (main): Print cref table if --cref. Don't close mapfile
10492 until after printing cref table.
10493 * cref.cc: Include "symtab.h".
10494 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10495 (Cref_table_compare::operator()): New function.
10496 (Cref_inputs::gather_cref): New function.
10497 (filecol): New static const.
10498 (Cref_inputs::print_cref): New function.
10499 (Cref::print_cref): New function.
10500 * cref.h: Include <cstdio>.
10501 (class Cref): Update declarations.
10502 * mapfile.h (Mapfile::file): New function.
10503 * object.h (class Object): Define Symbols. Declare virtual
10504 do_get_global_symbols.
10505 (Object::get_global_symbols): New function.
10506 * object.cc (Input_objects::add_object): Pass object to cref_ if
10507 --cref.
10508 (Input_objects::archive_start): Likewise.
10509 (Input_objects::archive_stop): Likewise.
10510 (Input_objects::print_cref): New function.
10511 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10512 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10513 --cref.
10514 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10515 function.
10516 * plugin.h (class Sized_pluginobj): Update declarations.
10517
8781f709
ILT
105182010-01-05 Ian Lance Taylor <iant@google.com>
10519
10520 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10521 to is_default_version. Rename insdef to insdefault.
10522 (Symbol_table::add_from_relobj): Rename def to is_default_version
10523 and local to is_forced_local.
10524 (Symbol_table::add_from_pluginobj): Likewise.
10525 (Symbol_table::add_from_dynobj): Likewise.
10526 (Symbol_table::define_special_symbol): Rename insdef to
10527 insdefault.
10528
fe35d28d
ILT
105292010-01-04 Ian Lance Taylor <iant@google.com>
10530
30bc8c46
ILT
10531 PR 10980
10532 * options.h (class General_options): Add
10533 --allow-multiple-definition and -z muldefs.
10534 * resolve.cc (Symbol_table::should_override): Don't warn about a
10535 multiple symbol definition if --allow-multiple-definition or -z
10536 muldefs.
10537
7eaea549
ILT
10538 PR 10980
10539 * options.h (class General_options): Add --add-needed and
10540 --copy-dt-needed-entries. Tweak --as-needed help entry.
10541 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10542 error if --copy-dt-needed-entries aka --add-needed is used and
10543 would cause a change in behaviour.
10544
fe35d28d
ILT
10545 PR 10980
10546 * options.h (class General_options): Add -G as a short version of
10547 --shared. Add no-op options -assert, -g, and -i.
10548
55a2bb35
ST
105492010-01-04 Sriraman Tallam <tmsriram@google.com>
10550
10551 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10552 check for .text or .gnu.linkonce.t sections.
10553 * icf.cc (Icf::find_identical_sections): Ditto.
10554 Change the detection for mangled function name within the section
10555 name.
10556 * icf.h (is_section_foldable_candidate): New function.
10557
719328e1
ILT
105582009-12-30 Ian Lance Taylor <iant@google.com>
10559
10560 PR 10980
10561 * options.h (class General_options): Permit two dashes with
10562 --retain-symbols-file.
10563
d7bb5745
ILT
105642009-12-30 Ian Lance Taylor <iant@google.com>
10565
403a15dd
ILT
10566 PR 10979
10567 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10568 don't put the file header and segment headers in the text
10569 segment.
10570
eda294df
ILT
10571 PR 10979
10572 * common.cc (Sort_commons::operator()): Stabilize sort when both
10573 entries are NULL.
10574 (Symbol_table::do_allocate_commons_list): When allocating common
10575 symbols, skip a symbol which is no longer common.
10576 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10577 an object before checking its type.
10578 * testsuite/common_test_2.c: New file.
10579 * testsuite/common_test_3.c: New file.
10580 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10581 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10582 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10583 (common_test_2_pic.o, common_test_2.so): New targets.
10584 (common_test_3_pic.o, common_test_3.so): New targets.
10585 * testsuite/Makefile.in: Rebuild.
10586
d7bb5745
ILT
10587 PR 10979
10588 * script.cc (read_input_script): If we see a new SECTIONS clause,
10589 and we have added an input section, give an error.
10590 * layout.h (class Layout): Add have_added_input_section function.
10591 Add have_added_input_section_ field.
10592 * layout.cc (Layout::Layout): Initialize
10593 have_added_input_section_.
10594 (Layout::layout): Set have_added_input_section_.
10595 (Layout::layout_eh_frame): Likewise.
10596
fc59c572
ILT
105972009-12-30 Ian Lance Taylor <iant@google.com>
10598
10599 PR 10931
10600 * options.h (class General_options): Add --sort-common option.
10601 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10602 * common.cc (Sort_common): Add sort_order parameter to
10603 constructor. Add sort_order_ field.
10604 (Sort_commons::operator): Check sort_order_.
10605 (Symbol_table::allocate_commons): Determine the sort order.
10606 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10607 Change all callers.
10608 (Symbol_table::do_allocate_commons_list): Likewise.
10609
1c74fab0
ILT
106102009-12-30 Ian Lance Taylor <iant@google.com>
10611
10612 PR 10916
10613 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10614 symbols from this object, don't change the visibility of an
10615 undefined symbol.
10616 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10617
6affe781
ILT
106182009-12-30 Ian Lance Taylor <iant@google.com>
10619
10620 PR 10861
10621 * script.h (class Version_script_info): Define Language enum.
10622 Update declarations. Define Glob, Exact, and Lookup types. Add
10623 new fields globals_, locals_, and is_finalized_.
10624 * script.cc: Various formatting fixes.
10625 (class Parser_closure): Change language_stack_ from a vector of
10626 std::string to one of Version_script_info::Language. Adjust all
10627 uses accordingly.
10628 (class Lazy_demangler): Remove.
10629 (struct Version_expression): Change language from std::string to
10630 Version_script_info::Language.
10631 (Version_script_info::Version_script_info): New function.
10632 (Version_script_info::~Version_script_info): Don't call clear.
10633 (Version_script_info::finalize): New function.
10634 (Version_script_info::build_lookup_tables): New function.
10635 (Version_script_info::build_expression_list_lookup): New
10636 function.
10637 (Version_script_info::get_symbol_version_helper): Rewrite to use
10638 lookup tables.
10639 (Version_script_info::print_expression_list): Adjust to use
10640 Version_script_info::Language.
10641 (script_push_lex_into_version_mode): Check that the version script
10642 has not been finalized.
10643 (version_script_push_lang): Change language string to
10644 Version_script_info::Language.
10645 * options.cc (Command_line::version_script): New function.
10646 * options.h (class General_options): Add finalize_dynamic_list
10647 function. Change version_script from declaration to definition.
10648 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10649 * testsuite/version_script.map: Remove duplicate def of foo.
10650 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10651 version_script.map.
10652 * testsuite/Makefile.in: Rebuild.
10653
818bf354
ILT
106542009-12-30 Ian Lance Taylor <iant@google.com>
10655
10656 PR 10843
10657 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10658 if the input symbol index is 0, make the output symbol index 0.
10659
ebcc8304
ILT
106602009-12-30 Ian Lance Taylor <iant@google.com>
10661
10662 PR 10670
10663 * options.h (class General_options): Add -x/--discard-all.
10664 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10665 --discard-all. If the local symbol needs a dynamic entry, check
10666 that before handling --discard-locals.
10667
176fe33f
ILT
106682009-12-30 Ian Lance Taylor <iant@google.com>
10669
bb321bb1
ILT
10670 PR 10450
10671 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10672 flags to PF_R.
10673 (Output_segment::add_output_section): Don't change the flags if
10674 the type is PT_TLS.
10675
176fe33f
ILT
10676 PR 10450
10677 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10678 GNU hash table if they need a dynamic value. Otherwise, don't add
10679 them if they are defined in a dynamic object or are forced local.
10680
e8cd95c7
ILT
106812009-12-29 Ian Lance Taylor <iant@google.com>
10682
1b81fb71
ILT
10683 PR 10450
10684 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10685 .gnu.hash table for a 32-bit target.
10686
8d6d383d
ILT
10687 PR 10450
10688 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10689 regular and a dynamic object only needs a dynamic symbol table
10690 entry if it is externally visible.
10691
e785ec03
ILT
10692 PR 10450
10693 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10694 constructor. Add global_offset_table_ field.
10695 (Target_i386::got_section): Set global_offset_table_.
10696 (Target_i386::do_finalize_sections): Set global_offset_table_
10697 size.
10698 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10699 in constructor. Add global_offset_table_ field.
10700 (Target_x86_64::got_section): Set global_offset_table_.
10701 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10702 size.
10703
1a2dff53
ILT
10704 * layout.cc (Layout::Layout): Initialize increase_relro_.
10705 (Layout::get_output_section): Add is_relro, is_last_relro, and
10706 is_first_non_relro parameters. Change all callers.
10707 (Layout::choose_output_section): Likewise.
10708 (Layout::add_output_section_data): Likewise.
10709 (Layout::make_output_section): Likewise.
10710 (Layout::set_segment_offsets): Clear increase_relro when using a
10711 linker script.
10712 * layout.h (class Layout): Add increase_relro method. Add
10713 increase_relro_ field. Update declarations.
10714 * output.cc (Output_section::Output_section): Initialize
10715 is_last_relro_ and is_first_non_relro_.
10716 (Output_segment::add_output_section): Group relro sections is
10717 do_sort is true. Handle is_last_relro and is_first_non_relro.
10718 (Output_segment::maximum_alignment): Remove relro handling.
10719 (Output_segment::set_section_addresses): Add increase_relro
10720 parameter. Change all callers. Add initial alignment to align
10721 relro sections on separate page. Remove old relro handling.
10722 (Output_segment::set_section_list_addresses): Remove in_relro
10723 parameter. Change all callers.
10724 (Output_segment::set_offset): Add increase parameter. Change all
10725 callers. Remove old relro handling.
10726 * output.h (class Output_section): Add new methods: is_last_relro,
10727 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10728 Add is_last_relro_ and is_first_non_relro_ fields.
10729 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10730 Create separate .got.plt section. Call increase_relro.
10731 * x86_64.cc (Target_x86_64::got_section): Likewise.
10732 * testsuite/relro_script_test.t: Add .got.plt.
10733
f0ba79e2
ILT
10734 PR 10450
10735 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10736 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10737 (Layout::finalize): Call set_dynamic_symbol_size.
10738 (Layout::set_dynamic_symbol_size): New function.
10739 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10740 set_dynamic_symbol_size.
10741
e8cd95c7
ILT
10742 PR 10450
10743 * output.h (class Output_section): Add is_entsize_zero_ field.
10744 * output.cc (Output_section::Output_section): Initialize
10745 is_entsize_zero_.
10746 (Output_section::set_entsize): If two different entsizes are
10747 requested, force it to zero.
10748 (Output_section::add_input_section): Set flags for .debug_str
10749 before updating section flags. Set entsize.
10750 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10751 and SHF_STRING if all input sections have those flags.
10752
3e1b9a8a
RÁE
107532009-12-29 Rafael Espindola <espindola@google.com>
10754
10755 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10756 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10757 reporting.
3e1b9a8a 10758
3dcad376
ST
107592009-12-29 Sriraman Tallam <tmsriram@google.com>
10760
10761 * options.cc (General_options::parse_version): Allow -v to exit
10762 without an error if there is nothing to link.
10763
084e2665
ILT
107642009-12-29 Ian Lance Taylor <iant@google.com>
10765
10766 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10767 using a version of gcc before 4.1.
10768 * configure: Rebuild.
10769
250acde3
CD
107702009-12-28 Chris Demetriou <cgd@google.com>
10771
10772 * attributes.cc (Output_attributes_section_data::do_write): Use
10773 std::vector::front rather than std::vector::data.
10774
99fff23b
ILT
107752009-12-28 Ian Lance Taylor <iant@google.com>
10776
10777 * symtab.h (class Symbol_table): Add enum Defined.
10778 * resolve.cc (Symbol_table::should_override): Add defined
10779 parameter. Change all callers. Test whether object is NULL
10780 before calling a method on it.
10781 (Symbol_table::report_resolve_problem): Add defined parameter.
10782 Change all callers.
10783 (Symbol_table::should_override_with_special): Likewise.
10784 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10785 parameter. Change all callers.
10786 (Symbol_table::do_define_in_output_data): Likewise.
10787 (Symbol_table::define_in_output_segment): Likewise.
10788 (Symbol_table::do_define_in_output_segment): Likewise.
10789 (Symbol_table::define_as_constant): Likewise.
10790 (Symbol_table::do_define_as_constant): Likewise.
10791 * script.h (class Symbol_assignment): Add is_defsym parameter to
10792 constructor; change all callers.
10793 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10794 parameter. Change all callers. Add is_defsym_ field.
10795 (class Parser_closure): Add parsing_defsym parameter to
10796 constructor; change all callers. Add parsing_defsym accessor
10797 function. Add parsing_defsym_ field.
10798
556bd683
ILT
107992009-12-28 Ian Lance Taylor <iant@google.com>
10800
10801 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10802 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10803
1782c879
ILT
108042009-12-23 Ian Lance Taylor <iant@google.com>
10805
10806 * i386.cc (Target_i386::do_calls_non_split): Recognize
10807 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10808 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10809 -fsplit-stack prologue when using %r11.
1782c879 10810
329ca2b1
ST
108112009-12-21 Sriraman Tallam <tmsriram@google.com>
10812
10813 * options.cc (General_options::parse_version): Make -v continue and do
10814 the link like GNU ld does.
10815
d675ff46
RÁE
108162009-12-17 Rafael Avila de Espindola <espindola@google.com>
10817
10818 * Makefile.am (CCFILES): Add timer.cc.
10819 (HFILES): Add timer.h.
10820 * configure.ac: Check for sysconf and times.
10821 * main.cc: include timer.h.
10822 (main): Use Timer instead of get_run_time.
10823 * timer.cc: New.
10824 * timer.h: New.
10825 * workqueue.cc: include timer.h.
10826 (Workqueue::find_and_run_task):
10827 Report user, sys and wall time.
10828 * Makefile.in: Regenerate.
10829 * config.in: Regenerate.
10830 * configure: Regenerate.
10831
d6344fb5
DK
108322009-12-16 Doug Kwan <dougkwan@google.com>
10833
10834 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10835 sections.
10836 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10837 relaxed input sections.
10838 * output.cc (Output_section::find_relaxed_input_section): Change
10839 return type to Output_relaxed_input_section pointer. Adjust code
10840 for new type of relaxed_input_section_map_.
10841 * output.h (Output_section::find_relaxed_input_section): Change
10842 return type to Output_relaxed_input_section pointer.
10843 (Output_section::Output_relaxed_input_section_by_input_section_map):
10844 New type.
10845 (Output_section::relaxed_input_section_map_): Change type to
10846 Output_section::Output_relaxed_input_section_by_input_section_map.
10847 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10848 input section.
10849
0e0d5469
ILT
108502009-12-15 Ian Lance Taylor <iant@google.com>
10851
10852 * layout.cc (Layout::create_shstrtab): Only write out after input
10853 sections if we are compressing debug sections.
10854
0649a889
ILT
108552009-12-15 Ian Lance Taylor <iant@google.com>
10856
10857 * archive.cc (Archive::add_symbols): Only look up a symbol without
10858 a version if there is, in fact, a version.
10859
2ea97941
ILT
108602009-12-14 Ian Lance Taylor <iant@google.com>
10861
10862 Revert -Wshadow changes, all changes from:
10863 2009-12-11 Doug Kwan <dougkwan@google.com>
10864 2009-12-11 Nick Clifton <nickc@redhat.com>
10865 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10866
b0eec2cc
DK
108672009-12-11 Doug Kwan <dougkwan@google.com>
10868
10869 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10870 due to -Wshadow.
10871 * attributes.cc (Object_attribute::size): Ditto.
10872 (Attributes_section_data::size): Ditto.
10873 (Attributes_section_data::Attributes_section_data): Ditto.
10874 (Output_attributes_section_data::do_write): Ditto.
10875 * attributes.h (Object_attribute::set_type): Ditto.
10876 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10877
91d6fa6a
NC
108782009-12-11 Nick Clifton <nickc@redhat.com>
10879
10880 * archive.cc: Fix shadowed variable warnings.
10881 * arm.cc: Likewise.
10882 * compressed_output.cc: Likewise.
10883 * compressed_output.h: Likewise.
10884 * configure: Likewise.
10885 * dwarf_reader.cc: Likewise.
10886 * dynobj.cc: Likewise.
10887 * dynobj.h: Likewise.
10888 * ehframe.cc: Likewise.
10889 * ehframe.h: Likewise.
10890 * errors.cc: Likewise.
10891 * expression.cc: Likewise.
10892 * fileread.cc: Likewise.
10893 * fileread.h: Likewise.
10894 * freebsd.h: Likewise.
10895 * i386.cc: Likewise.
10896 * icf.cc: Likewise.
10897 * incremental.h: Likewise.
10898 * layout.cc: Likewise.
10899 * layout.h: Likewise.
10900 * mapfile.cc: Likewise.
10901 * merge.cc: Likewise.
10902 * merge.h: Likewise.
10903 * object.cc: Likewise.
10904 * object.h: Likewise.
10905 * options.h: Likewise.
10906 * output.cc: Likewise.
10907 * output.h: Likewise.
10908 * parameters.cc: Likewise.
10909 * plugin.cc: Likewise.
10910 * powerpc.cc: Likewise.
10911 * reduced_debug_output.cc: Likewise.
10912 * reduced_debug_output.h: Likewise.
10913 * reloc.cc: Likewise.
10914 * reloc.h: Likewise.
10915 * resolve.cc: Likewise.
10916 * script-sections.cc: Likewise.
10917 * script.cc: Likewise.
10918 * script.h: Likewise.
10919 * sparc.cc: Likewise.
10920 * symtab.cc: Likewise.
10921 * symtab.h: Likewise.
10922 * target-select.cc: Likewise.
10923 * target-select.h: Likewise.
10924 * token.h: Likewise.
10925 * workqueue.cc: Likewise.
10926 * workqueue.h: Likewise.
10927 * x86_64.cc: Likewise.
10928
a0351a69
DK
109292009-12-10 Doug Kwan <dougkwan@google.com>
10930
10931 * arm.cc (attributes.h): New include.
10932 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10933 (Arm_relobj::~Arm_relobj): Delete object pointed by
10934 attributes_section_data_.
10935 (Arm_relobj::attributes_section_data): New method definition.
10936 (Arm_relobj::attributes_section_data_): New data member declaration.
10937 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10938 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10939 attributes_section_data_.
10940 (Arm_dynobj::attributes_section_data): New method definition.
10941 (Arm_dynobj::attributes_section_data_): New data member declaration.
10942 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10943 initialization value of may_use_blx_ to false.
2e702c99 10944 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10945 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10946 object attributes to compute results instead of hard-coding.
10947 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10948 Target_arm::get_secondary_compatible_arch,
10949 Target_arm::set_secondary_compatible_arch
10950 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10951 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10952 New method declarations.
10953 (Target_arm::get_aeabi_object_attribute): New method definition.
10954 (Target_arm::attributes_section_data_): New data member declaration.
10955 (read_arm_attributes_section): New template definition.
10956 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10957 (Arm_dynobj::do_read_symbols): Ditto.
10958 (Target_arm::do_finalize_sections): Merge attributes sections from
10959 input. Check for BLX use after attributes section merging.
10960 Fix __exidx_start and __exidx_end visibility. Create an
10961 .ARM.attributes section if necessary.
10962 (Target_arm::get_secondary_compatible_arch,
10963 Target_arm::set_secondary_compatible_arch,
10964 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10965 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10966 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10967 New method definitions.
10968
b59befec
ILT
109692009-12-09 Ian Lance Taylor <iant@google.com>
10970
10971 * plugin.cc (Plugin::load): Don't cast from void* to a function
10972 pointer.
10973
1276bc89
ILT
109742009-12-09 Ian Lance Taylor <iant@google.com>
10975
10976 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10977 information fields.
10978
2f2de248
L
109792009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10980
10981 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10982 Replace two_file_shared_1.so with two_file_shared_2.so.
10983 * testsuite/Makefile.in: Regenerated.
10984
4f787271
DK
109852009-12-08 Doug Kwan <dougkwan@google.com>
10986
10987 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10988 (HFILES): Add attributes.h and int_encoding.h.
10989 * Makefile.in: Regenerate.
10990 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10991 function definitions to int_encoding.cc
10992 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10993 prototypes to int_encoding.h
10994 * reduced_debug_output.cc (int_encoding.h): New include.
10995 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10996 function definitions to int_encoding.cc
10997 (insert_into_vector, read_from_pointer): Move template definitions to
10998 int_encoding.h
10999 * attributes.cc: New file.
11000 * attributes.h: New file.
11001 * int_encoding.cc: New file.
11002 * int_encoding.h: New file.
11003
20b52f1a
RÁE
110042009-12-07 Rafael Avila de Espindola <espindola@google.com>
11005
11006 PR gold/11055
11007 * incremental-dump.cc (dump_incremental_inputs): New.
11008 (main): Use dump_incremental_inputs.
11009
53d7974c
L
110102009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11011
11012 PR gold/10893
11013 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11014 checking elfcpp::STT_FUNC.
11015 (Target_i386::Relocate::relocate): Likewise.
11016 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11017
11018 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11019 symbols from shared libraries into normal FUNC symbols.
11020
11021 * symtab.h (Symbol): Add is_func and use it.
11022
05a352e6
DK
110232009-12-05 Doug Kwan <dougkwan@google.com>
11024
11025 * arm.cc (Target_arm::arm_info): Initialize new fields
11026 attributes_section and attributes_vendor.
11027 * i386.cc (Target_i386::i386_info): Same.
11028 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11029 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11030 fields attributes_section and attributes_vendor.
53d7974c 11031 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11032 * target.h (Target::attributes_section, Target::attributes_vendor,
11033 Target::is_attributes_section, Target::attribute_arg_type,
11034 Target::attributes_order): New method definitions.
11035 (Target::Target_info::attributes_section,
11036 Target::Target_info::attributes_vendor): New fields.
11037 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11038 virtual method definitions.
11039 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11040 attributes_section and attributes_vendor.
11041 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11042
f4e5969c
DK
110432009-12-05 Doug Kwan <dougkwan@google.com>
11044
11045 * arm.cc: Update comments about interworking and stub generation.
11046 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11047 considered as non-PIC.
11048 (Arm_relocate_functions::base_abs): Fix formatting.
11049 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11050 of function to use GOT entry address instead of offset.
11051 (Target_arm::Scan::global): Issue an error if a symbol would need a
11052 PLT does not get one because it is untyped. Remove code to create
11053 dynamic symbols for relative branches.
11054 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11055 takes unsigned integer instead of boolean.
11056
1abce4a6
L
110572009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11058
11059 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11060 (two_file_test_LDADD): Likewise.
11061 (common_test_1_LDADD): Likewise.
11062 (exception_test_LDADD) Likewise.
11063 (weak_test_LDADD): Likewise.
11064 (many_sections_test_LDADD): Likewise.
11065 (initpri1_LDADD): Likewise.
11066 (script_test_1_LDADD): Likewise.
11067 (script_test_2_LDADD): Likewise.
11068 (justsyms_LDADD): Likewise.
11069 (binary_test_LDADD): Likewise.
11070 (large_LDADD): Likewise.
11071 * testsuite/Makefile.in: Regenerated.
11072
adcf2816 110732009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11074
adcf2816
L
11075 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11076 (Symbol_table::override_with_special): Likewise.
11077 (Symbol_table::add_from_object): Likewise.
11078
28e67f5d
RÁE
110792009-12-04 Rafael Avila de Espindola <espindola@google.com>
11080
11081 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11082 Don't set the data_offset twice.
11083
ae10a101
RÁE
110842009-12-04 Rafael Avila de Espindola <espindola@google.com>
11085
11086 * testsuite/Makefile.in: Regenerate.
11087
f59f41f3
DK
110882009-12-03 Doug Kwan <dougkwan@google.com>
11089
11090 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11091 (Target_arm::do_finalize_sections): Add parameter for symbol table
11092 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11093 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11094 parameter for symbol table pointer.
11095 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11096 an additional parameter for a pointer to symbol table.
11097 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11098 parameter for a symbol table pointer.
11099 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11100 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11101 Ditto.
11102 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11103 parameter for a symbol table pointer.
11104
ca55d848
RÁE
111052009-12-03 Rafael Avila de Espindola <espindola@google.com>
11106
11107 * incremental.cc (Incremental_inputs_header)
11108 (Incremental_inputs_header_write, Incremental_inputs_entry)
11109 (Incremental_inputs_entry_write): Move ...
11110 * incremental.h (Incremental_inputs_header)
11111 (Incremental_inputs_header_write, Incremental_inputs_entry)
11112 (Incremental_inputs_entry_write): here.
11113
3aec4f9c
RÁE
111142009-12-02 Rafael Avila de Espindola <espindola@google.com>
11115
11116 * incremental.cc (make_sized_incremental_binary): Set the target.
11117 Error if it is incompatible.
11118 * output.h (Output_file): Add filename method.
11119
9c0ae74d
RÁE
111202009-12-02 Rafael Avila de Espindola <espindola@google.com>
11121
11122 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11123 from the get_* methods.
11124
a45500ae
RÁE
111252009-12-02 Rafael Avila de Espindola <espindola@google.com>
11126
11127 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11128 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11129 Write 0 for the data_offset of scripts.
11130
325e6408
RÁE
111312009-12-02 Rafael Avila de Espindola <espindola@google.com>
11132
11133 * testsuite/Makefile.am: Add the incremental_test.sh test.
11134 * testsuite/incremental_test.sh: New.
11135 * testsuite/incremental_test_1.c: New.
11136 * testsuite/incremental_test_2.c: New.
11137
954c3e2e
RÁE
111382009-12-01 Rafael Avila de Espindola <espindola@google.com>
11139
703d02da 11140 * incremental-dump.cc (main): Fix typos.
954c3e2e 11141
f8086623
RÁE
111422009-11-27 Rafael Avila de Espindola <espindola@google.com>
11143
11144 PR gold/11025
11145 * incremental-dump.cc (main): Use llu to print 64 bit values.
11146
3b0dd6ac
L
111472009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11148 H.J. Lu <hongjiu.lu@intel.com>
11149
11150 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11151 $(LIBDL).
11152 (incremental_dump_LDADD): Likewise.
11153 * Makefile.in: Regenerated.
11154
a6d1ef57 111552009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11156
a6d1ef57
DK
11157 Revert:
11158
11159 2009-11-25 Doug Kwan <dougkwan@google.com>
11160
11161 * arm.cc (Target_arm::Target_arm): Move method definition
11162 outside of class definition. Add code to handle
11163 --target1-rel, --target1-abs and --target2= options.
11164 (Target_arm::get_reloc_reloc_type): Change method to be
11165 non-static and const.
11166 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11167 New data member declaration.
11168 (Target_arm::Scan::local, Target_arm::Scan::global,
11169 Target_arm::Relocate::relocate,
11170 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11171 Adjust call to Target_arm::get_real_reloc_type.
11172 (Target_arm::get_real_reloc_type): Use command line options
11173 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11174 * options.h (--target1-rel, --target1-abs, --target2): New
11175 ARM-only options.
11176
50aeb7d4
DK
111772009-11-25 Doug Kwan <dougkwan@google.com>
11178
11179 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11180 class definition. Add code to handle --target1-rel, --target1-abs
11181 and --target2= options.
11182 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11183 and const.
11184 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11185 member declaration.
11186 (Target_arm::Scan::local, Target_arm::Scan::global,
11187 Target_arm::Relocate::relocate,
11188 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11189 call to Target_arm::get_real_reloc_type.
11190 (Target_arm::get_real_reloc_type): Use command line options to
11191 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11192 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11193 options.
11194
51938283
DK
111952009-11-25 Doug Kwan <dougkwan@google.com>
11196
11197 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11198 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11199 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11200 formatting.
11201 (Arm_relocate_functions::thm_call): Replace body with a call to
11202 Arm_relocate_functions::thumb_branch_common.
11203 (Arm_relocate_functions::thm_jump24,
11204 Arm_relocate_functions::thm_xpc22): New method definitions.
11205 (Arm_relocate_functions::thumb_branch_common): New method definition.
11206 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11207 operator.
11208 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11209 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11210
e2b8f3c4
RÁE
112112009-11-24 Rafael Avila de Espindola <espindola@google.com>
11212
11213 * Makefile.am: Build incremental-dump
11214 * Makefile.in: Regenerate.
11215 * incremental-dump.cc: New.
11216 * incremental.cc (Incremental_inputs_header_data,
11217 Incremental_inputs_entry_data): Move to incremental.h
11218 * incremental.h: (Incremental_inputs_header_data,
11219 Incremental_inputs_entry_data): Move from incremental.cc
11220
bcba9aec
RÁE
112212009-11-24 Rafael Avila de Espindola <espindola@google.com>
11222
11223 * incremental.cc (Incremental_inputs_header,
11224 Incremental_inputs_header_write, Incremental_inputs_entry,
11225 Incremental_inputs_entry_write): Add a typedef with the data type.
11226
7c3afe08
RÁE
112272009-11-24 Rafael Avila de Espindola <espindola@google.com>
11228
11229 * incremental.cc (Incremental_inputs_header,
11230 Incremental_inputs_header_write, Incremental_inputs_entry,
11231 Incremental_inputs_entry_write): Update comment about which
11232 type has the filed descriptions.
11233
d204b6e9
DK
112342009-11-15 Doug Kwan <dougkwan@google.com>
11235
11236 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11237 (Arm_relocate_functions::arm_branch_common): Change method defintion
11238 in class definition to a method declaration and update list of formal
11239 parameters.
11240 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11241 Arm_relocation_functions::jump24): Adjust call to
11242 Arm_relocate_functions::arm_branch_common. Update list of formal
11243 parameters.
11244 (Arm_relocate_functions::xpc25): New method definition.
11245 (Arm_relocate_functions::arm_branch_common): Move method defintion
11246 out from class definition. Use stubs for mode-switching and extending
11247 branch ranges.
11248 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11249 specially. Change code to enable use of stubs in ARM branches.
11250
43d12afe
DK
112512009-11-10 Doug Kwan <dougkwan@google.com>
11252
11253 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11254 in method declaration.
11255 (Target_arm::relocate_stub): New method declaration.
11256 (Target_arm::default_target): Change to return a pointer instead of
11257 a const reference.
11258 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11259 Target_arm::default_target.
11260 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11261 method definition.
11262 (Target_arm::relocate_section): Adjust view.
11263 (Target_arm::relocate_stub): New method definition.
11264
ac33a407
DK
112652009-11-10 Doug Kwan <dougkwan@google.com>
11266
11267 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11268 a format warning.
11269 * incremental.cc (open_incremental_binary): Initialized local
11270 variables to avoid warnings.
11271 * object.cc (make_elf_object): Ditto.
11272 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11273 a format warning.
e1df38aa 11274
88ee28e9
L
11275009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11276
11277 PR gold/10930
11278 * testsuite/plugin_test.c: Include "config.h".
11279
2daedcd6
DK
112802009-11-09 Doug Kwan <dougkwan@google.com>
11281
11282 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11283 (arm_symbol_value): Remove.
11284 (Arm_relocate_functions::arm_branch_common,
11285 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11286 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11287 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11288 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11289 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11290 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11291 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11292 Arm_relocate_functions::thm_mobw_abs_nc,
11293 Arm_relocate_functions::thm_mov_abs,
11294 Arm_relocate_functions::movw_prel_nc,
11295 Arm_relocate_functions::thm_movt_abs,
11296 Arm_relocate_functions::movt_prel,
11297 Arm_relocate_functions::thm_movw_prel_nc,
11298 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11299 (Target_arm::Relocate::relocate): Only decompose address into two
11300 parts if relocation type uses the thumb-bit and pass the actual
11301 bit instead of a flag indicating that the thumb-bit is used. Adjust
11302 calls to methods in Arm_relocate_functions for this change.
11303
1276bc89 113042009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11305
11306 PR 10925
11307 * reloc.cc: Instantiate
11308 Sized_relobj::initialize_input_to_output_maps and
11309 Sized_relobj:free_input_to_output_maps.
11310
e53ad1b5
ILT
113112009-11-06 Ian Lance Taylor <iant@google.com>
11312
11313 PR 10876
11314 * defstd.cc (in_segment): Set only_if_ref true for "end".
11315
eb44217c
DK
113162009-11-06 Doug Kwan <dougkwan@google.com>
11317
11318 * arm.cc (class Reloc_stub): Correct a comment.
11319 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11320 (Target_arm::scan_section_for_stubs): New method declaration.
11321 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11322 Change methods from private to protected.
11323 (Target_arm::do_may_relax): New method definition.
11324 (Target_arm::do_relax, Target_arm::group_sections,
11325 Target_arm::scan_reloc_for_stub,
11326 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11327 (Target_arm::arm_input_section_map_): New data member declaration.
11328 (Target_arm::scan_reloc_for_stub,
11329 Target_arm::scan_reloc_section_for_stubs,
11330 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11331 Target_arm::do_relax): New method definitions.
11332
5d329b7d
ILT
113332009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11334
11335 * configure.ac: Check for (struct stat)::st_mtim
11336 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11337 * config.in: Regenerate.
11338 * configure: Regenerate.
11339
96a0d71b
ILT
113402009-11-05 Ian Lance Taylor <iant@google.com>
11341
11342 PR 10910
11343 * output.cc (Output_segment::add_output_section): Add missing
11344 return statement.
11345
594c8e5e
ILT
113462009-11-04 Ian Lance Taylor <iant@google.com>
11347
11348 PR 10880
11349 * object.h (class Object): Add is_needed and set_is_needed
11350 methods. Add is_needed_ field. Make bool fields into bitfields.
11351 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11352 defined in a dynamic object and referenced by a regular object,
11353 set is_needed for the dynamic object.
11354 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11355 if the file is marked with as_needed and it is not needed.
11356
22b127cc
ILT
113572009-11-04 Ian Lance Taylor <iant@google.com>
11358
11359 PR 10887
11360 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11361 tags if data is discarded by linker script.
11362 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11363 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11364 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11365 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11366
f5c870d2
ILT
113672009-11-04 Ian Lance Taylor <iant@google.com>
11368
11369 * layout.cc (Layout::get_output_section): Add is_interp and
11370 is_dynamic_linker_section parameters. Change all callers.
11371 (Layout::choose_output_section): Likewise.
11372 (Layout::make_output_section): Likewise.
11373 (Layout::add_output_section_data): Add is_dynamic_linker_section
11374 parameter. Change all callers.
11375 * layout.h (class Layout): Update declarations.
11376 * output.h (class Output_section): Add is_interp, set_is_interp,
11377 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11378 Add is_interp_, is_dynamic_linker_section_ fields. Change
11379 generate_code_fills_at_write_ to a bitfield.
11380 * output.cc (Output_section::Output_sections): Initialize new
11381 fields.
11382 (Output_segment::add_output_section): Add do_sort parameter.
11383 Change all callers.
11384
1ae4d23b
ILT
113852009-11-03 Ian Lance Taylor <iant@google.com>
11386
11387 PR 10860
11388 * options.h (class General_options): Add --warn-common.
11389 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11390 merging two common symbols.
11391 (Symbol_table::should_override): Handle --warn-common when merging
11392 a common symbol with a defined symbol. Use report_resolve_problem
11393 for multiple definitions.
11394 (Symbol_table::report_resolve_problem): New function.
11395 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11396
55da9579
DK
113972009-11-03 Doug Kwan <dougkwan@google.com>
11398
11399 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11400 stub_factory_.
11401 (Target_arm::stub_factory): New method definition.
11402 (Target_arm::new_arm_input_section,
11403 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11404 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11405 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11406 New type definitions.
11407 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11408 member declarations.
11409 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11410 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11411 New method definitions.
11412
37a9ac43
ILT
114132009-11-03 Ian Lance Taylor <iant@google.com>
11414
11415 * options.h (class General_options): Add --warn_constructors.
11416
b3d6a3d4
ILT
114172009-11-03 Ian Lance Taylor <iant@google.com>
11418
11419 PR 10893
11420 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11421 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11422
934b01dd
ILT
114232009-11-03 Ian Lance Taylor <iant@google.com>
11424
11425 PR 10895
11426 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11427 --msgid-bugs-address.
11428 (install-pdf): New target.
11429 (install-data_yes): Look up one directory to find mkinstalldirs.
11430
03c1939b
L
114312009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11432
11433 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11434 tree.
11435
ebd95253
DK
114362009-10-30 Doug Kwan <dougkwan@google.com>
11437
11438 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11439
e9bbb538
DK
114402009-10-30 Doug Kwan <dougkwan@google.com>
11441
11442 * arm.cc (Stub_addend_reader): New struct template definition
11443 and partial specializations.
11444 (Stub_addend_reader::operator()): New method definition for a
11445 partially specialized template.
11446
d5b40221
DK
114472009-10-30 Doug Kwan <dougkwan@google.com>
11448
11449 * arm.cc (Arm_relobj::processor_specific_flags): New method
11450 definition.
11451 (Arm_relobj::do_read_symbols): New method declaration.
11452 (Arm_relobj::processor_specific_flags_): New data member declaration.
11453 (Arm_dynobj): New class definition.
11454 (Target_arm::do_finalize_sections): Add input_objects parameter.
11455 (Target_arm::do_adjust_elf_header): New method declaration.
11456 (Target_arm::are_eabi_versions_compatible,
11457 (Target_arm::merge_processor_specific_flags): New method declaration.
11458 (Target_arm::do_make_elf_object): New overloaded method definitions
11459 and declaration.
11460 (Arm_relobj::do_read_symbols): New method definition.
11461 (Arm_dynobj::do_read_symbols): Ditto.
11462 (Target_arm::do_finalize_sections): Add input_objects parameters.
11463 Merge processor-specific flags from all input objects.
11464 (Target_arm::are_eabi_versions_compatible,
11465 Target_arm::merge_processor_specific_flags,
11466 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11467 New method definitions.
11468 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11469 Input_objects pointer type parameter.
11470 * layout.cc (Layout::finalize): Pass input objects to target's.
11471 finalize_sections function.
11472 * output.cc (Output_file_header::do_sized_write): Set ELF file
11473 header's processor-specific flags.
11474 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11475 Input_objects pointer type parameter.
11476 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11477 * target.h (Input_objects): New forward class declaration.
11478 (Target::processor_specific_flags,
11479 Target::are_processor_specific_flags_sect): New method definitions.
11480 (Target::finalize_sections): Add input_objects parameter.
11481 (Target::Target): Initialize processor_specific_flags_ and
11482 are_processor_specific_flags_set_.
11483 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11484 parameter.
11485 (Target::set_processor_specific_flags): New method definition.
11486 (Target::processor_specific_flags_,
11487 Target::are_processor_specific_flags_set_): New data member
11488 declarations.
11489 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11490 Input_objects pointer type parameter.
11491
ebabffbd
DK
114922009-10-30 Doug Kwan <dougkwan@google.com>
11493
11494 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11495
ad0f2072
ILT
114962009-10-28 Ian Lance Taylor <iant@google.com>
11497
11498 * object.h (class Relobj): Drop options parameter from
11499 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11500 do_scan_relocs, do_relocate. Change all callers.
11501 (class Sized_relobj): Drop options parameters from
11502 do_gc_process_relocs, do_scan_relocs, do_relocate,
11503 do_relocate_sections, relocate_sections, emit_relocs_scan,
11504 emit_relocs_scan_reltype. Change all callers.
11505 (struct Relocate_info): Remove options field and all references to
11506 it.
11507 * reloc.h (class Read_relocs): Remove options constructor
11508 parameter and options_ field. Change all callers.
11509 (class Gc_process_relocs, class Scan_relocs): Likewise.
11510 (class Relocate_task): Likewise.
11511 * target-reloc.h (scan_relocs): Remove options parameter. Change
11512 all callers.
11513 (scan_relocatable_relocs): Likewise.
11514 * target.h (class Sized_target): Remove options parameter from
11515 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11516 all callers.
11517 * gc.h (gc_process_relocs): Remove options parameter. Change all
11518 callers.
11519 * arm.cc: Update functions to remove options parameters.
11520 * i386.cc: Likewise.
11521 * powerpc.cc: Likewise.
11522 * sparc.cc: Likewise.
11523 * x86_64.cc: Likewise.
11524 * testsuite/testfile.cc: Likewise.
11525
8ffa3667
DK
115262009-10-28 Doug Kwan <dougkwan@google.com>
11527
11528 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11529 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11530 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11531 New method definitions.
11532
40f36857
CC
115332009-10-28 Cary Coutant <ccoutant@google.com>
11534
11535 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11536 (Plugin::cleanup_done_): New member.
11537 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11538 (Plugin_manager::cleanup_done_): Remove.
11539 (Plugin_manager::add_input_file): Edit error message.
11540 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11541 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11542
2c849493
ILT
115432009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11544
11545 * fileread.cc: (File_read::View::~View): Use the new
11546 data_ownership_ filed.
11547 (File_read::~File_read): Dispose the new whole_file_view_.
11548 (File_read::open): Mmap the whole file if needed.
11549 (File_read::open): Use whole_file_view_ instead of contents_.
11550 (File_read::find_view): Use whole_file_view_ if applicable.
11551 (File_read::do_read): Use whole_file_view_ instead of contents_.
11552 (File_read::make_view): Use whole_file_view_ instead of contents_,
11553 update File_read::View::View call.
11554 (File_read::find_or_make_view): Update File_read::View::View
11555 call.
11556 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11557 remove contents_
11558 (File_read::View::Data_ownership): New enum.
11559 (File_read::View::View): Replace bool mapped_ with Data_ownership
11560 argument.
11561 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11562 (File_read::View::data_ownership_): New field.
11563 (File_read::contents_): Remove (replaced by whole_file_view_).
11564 (File_read::whole_file_view_): New field.
11565 * options.h (class General_options): Add --keep-files-mapped.
11566
24998053
CC
115672009-10-27 Cary Coutant <ccoutant@google.com>
11568
11569 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11570 * testsuite/Makefile.am (plugin_test_5): New test case.
11571 * testsuite/Makefile.in: Regenerate.
11572
72adc4fa
DK
115732009-10-25 Doug Kwan <dougkwan@google.com>
11574
11575 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11576 from private to protected to allow access by child class.
11577 (Sized_relobj::do_relocate_sections): New method declaration.
11578 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11579 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11580 Sized_relobj::relocate_sections. Instantiate template explicitly
11581 for different target sizes and endianity.
11582
07f508a2
DK
115832009-10-24 Doug Kwan <dougkwan@google.com>
11584
11585 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11586 (Arm_input_section::as_arm_input_section): New method.
11587 (Arm_output_section): New class definition.
11588 (Arm_output_section::create_stub_group,
11589 Arm_output_section::group_sections): New method definitions.
11590
10ad9fe5
DK
115912009-10-22 Doug Kwan <dougkwan@google.com>
11592
11593 * arm.cc (Arm_input_section): New class definition.
11594 (Arm_input_section::init, Arm_input_section:do_write,
11595 Arm_input_section::set_final_data_size,
11596 Arm_input_section::do_reset_address_and_file_offset): New method
11597 definitions.
11598
56ee5e00
DK
115992009-10-21 Doug Kwan <dougkwan@google.com>
11600
11601 * arm.cc (Stub_table, Arm_input_section): New forward class
11602 declarations.
11603 (Stub_table): New class defintion.
11604 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11605 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11606 New method definition.
11607
b569affa
DK
116082009-10-21 Doug Kwan <dougkwan@google.com>
11609
11610 * arm.cc: Update copyright comments.
11611 (Target_arm): New forward class template declaration.
11612 (Arm_address): New type.
11613 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11614 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11615 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11616 constants.
11617 (Insn_template): Same.
11618 (DEF_STUBS): New macro.
11619 (Stub_type): New enum type.
11620 (Stub_template): New class definition.
11621 (Stub): Same.
11622 (Reloc_stub): Same.
11623 (Stub_factory): Same.
11624 (Target_arm::Target_arm): Initialize may_use_blx_ and
11625 should_force_pic_veneer_.
11626 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11627 Target_arm::should_force_pic_veneer,
11628 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11629 Target_arm::using_thumb_only, Target_arm:;default_target): New
11630 method defintions.
11631 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11632 New data member declarations.
11633 (Insn_template::size, Insn_template::alignment): New method defintions.
11634 (Stub_template::Stub_template): New method definition.
11635 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11636 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11637 (Stub_factory::Stub_factory): New method definition.
11638 * gold.h (string_hash): New template.
11639 * output.h (Input_section_specifier::hash_value): Use
11640 gold::string_hash.
11641 (Input_section_specifier::string_hash): Remove.
11642 * stringpool.cc (Stringpool_template::string_hash): Use
11643 gold::string_hash.
11644
6c172549
DK
116452009-10-20 Doug Kwan <dougkwan@google.com>
11646
11647 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11648 symbols of relaxed input sections.
11649 * output.h (Output_section::find_relaxed_input_section): Make
11650 method public.
11651
c5617f2f
DK
116522009-10-16 Doug Kwan <dougkwan@google.com>
11653
11654 * dynobj.cc (Versions::Versions): Initialize version_script_.
11655 Only insert base version symbol definition for a shared object
11656 if version script defines any version versions.
11657 (Versions::define_base_version): New method definition.
11658 (Versions::add_def): Check that base version is not needed.
11659 (Versions::add_need): Define base version lazily.
11660 * dynobj.h (Versions::define_base_version): New method declaration.
11661 (Versions::needs_base_version_): New data member declaration.
11662 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11663 (check_DATA): Add no_version_test.stdout.
11664 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11665 New make rules.
11666 * testsuite/Makefile.in: Regenerate.
11667 * testsuite/no_version_test.c: New file.
11668 * testsuite/no_version_test.sh: Ditto.
11669
3c12dcdb
DK
116702009-10-16 Doug Kwan <dougkwan@google.com>
11671
11672 * expression.cc (class Segment_start_expression): New class definition.
11673 (Segment_start_expression::value): New method definition.
11674 (script_exp_function_segment_start): Return a new
11675 Segment_start_expression.
11676 * gold/script-c.h (script_saw_segment_start_expression): New function
11677 prototype.
11678 * script-sections.cc (Script_sections::Script_sections): Initialize
11679 SAW_SEGMENT_START_EXPRESSION_ to false.
11680 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11681 and -Tbbs options to specify section addresses if given in
11682 command line and no SEGMENT_START expression is seen in a script.
11683 * script-sections.h (Script_sections::saw_segment_start_expression,
11684 Script_sections::set_saw_segment_start_expression): New method
11685 definition.
11686 (Script_sections::saw_segment_start_expression_): New data member
11687 declaration.
11688 * script.cc (script_saw_segment_start_expression): New function.
11689 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11690 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11691 script_test_7.sh and script_test_8.sh.
11692 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11693 script_test_8.stdout.
11694 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11695 (script_test_6, script_test_6.stdout, script_test_7,
11696 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11697 * Makefile.in: Regenerate.
11698 * testsuite/script_test_6.sh: New file.
11699 * testsuite/script_test_6.t: Same.
11700 * testsuite/script_test_7.sh: Same.
11701 * testsuite/script_test_7.t: Same.
11702 * testsuite/script_test_8.sh: Same.
11703
64b1ae37
DK
117042009-10-16 Doug Kwan <dougkwan@google.com>
11705
11706 * output.cc (Output_segment::set_section_list_address): Cast
11707 expressions to unsigned long long type to avoid format warnings.
11708
661be1e2
ILT
117092009-10-15 Ian Lance Taylor <iant@google.com>
11710
12edd763 11711 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11712 dot assignment to script_sections_.
12edd763
ILT
11713 * script-sections.cc (Script_sections::add_dot_assignment):
11714 Initialize if necessary.
11715
68b6574b
ILT
11716 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11717 program headers with no load segment if there is a linker script.
11718
661be1e2
ILT
11719 * layout.cc (Layout::set_segment_offsets): Align the file offset
11720 to the segment aligment for -N or -n with no load segment.
11721 * output.cc (Output_segment::add_output_section): Don't crash if
11722 the first section is a TLS section.
11723 (Output_segment::set_section_list_addresses): Print an error
11724 message if the address moves backward in a linker script.
11725 * script-sections.cc
11726 (Output_section_element_input::set_section_addresses): Don't
11727 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11728 (Orphan_output_section::set_section_addresses): Likewise.
11729
f15f61a7
DK
117302009-10-15 Doug Kwan <dougkwan@google.com>
11731
11732 * layout.cc (Layout::finish_dynamic_section): Generate tags
11733 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11734 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11735 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11736
82bb573a
ILT
117372009-10-14 Ian Lance Taylor <iant@google.com>
11738
11739 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11740 fields.
11741 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11742 data_shdr fields of relinfo.
11743 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11744 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11745 R_386_TLS_LDO_32, adjust based on section flags.
11746 (Target_i386::Relocate::fix_up_ldo): Remove.
11747
374ad285
ILT
117482009-10-13 Ian Lance Taylor <iant@google.com>
11749
11750 Add support for -pie.
11751 * options.h (class General_options): Add -pie and
11752 --pic-executable.
11753 (General_options::output_is_position_independent): Test -pie.
11754 (General_options::output_is_executable): Return true if not shared
11755 and not relocatable.
11756 (General_options::output_is_pie): Remove.
11757 * options.cc (General_options::finalize): Reject incompatible uses
11758 of -pie.
11759 * gold.cc (queue_middle_tasks): A -pie link is not static.
11760 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11761 * symtab.cc (Symbol::final_value_is_known): Return false if
11762 output_is_position_independent.
11763 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11764 output_is_position_independent.
11765 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11766 output_is_position_independent.
11767 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11768 output_is_position_independent.
11769 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11770 two_file_pie_test.
11771 (basic_pie_test.o, basic_pie_test): New targets.
11772 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11773 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11774 (two_file_pie_test): New target.
11775 * testsuite/Makefile.in: Rebuild.
11776 * README: Remove note saying that -pie is not supported.
11777
c6585162
ILT
117782009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11779
11780 * options.h (class General_options): Add -init and -fini.
11781 * layout.cc (Layout::finish_dynamic_section): Emit
11782 given init and fini functions.
11783
032ce4e9
ST
117842009-10-13 Sriraman Tallam <tmsriram@google.com>
11785
11786 * gc.h (gc_process_relocs): Check if icf is enabled using new
11787 function.
11788 * gold.cc (queue_initial_tasks): Likewise.
11789 (queue_middle_tasks): Likewise.
11790 * object.cc (do_layout): Likewise.
11791 * symtab.cc (is_section_folded): Likewise.
11792 * main.cc (main): Likewise.
11793 * reloc.cc (Read_relocs::run): Likewise.
11794 (Sized_relobj::do_scan_relocs): Likewise.
11795 * icf.cc (is_function_ctor_or_dtor): New function.
11796 (Icf::find_identical_sections): Check if function is ctor or dtor when
11797 safe icf is chosen.
11798 * options.h (General_options::icf): Change option to be an enum.
11799 (Icf_status): New enum.
11800 (icf_enabled): New method.
11801 (icf_safe_folding): New method.
11802 (set_icf_status): New method.
11803 (icf_status_): New variable.
11804 * (options.cc) (General_options::finalize): Set icf_status_.
11805 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11806 icf_test and icf_keep_unique_test to use the --icf enum flag.
11807 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11808 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11809
f345227a
ST
118102009-10-12 Sriraman Tallam <tmsriram@google.com>
11811
11812 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11813 includes to gc.h and icf.h.
11814 * arm.cc: Include gc.h.
11815 * gold.cc: Likewise.
11816 * i386.cc: Likewise.
11817 * powerpc.cc: Likewise.
11818 * sparc.cc: Likewise.
11819 * x86_64.cc: Likewise.
11820 * gc.h: Include icf.h.
11821
1c7814ed
ILT
118222009-10-11 Ian Lance Taylor <iant@google.com>
11823
11824 * plugin.cc: Include "gold.h" before other header files.
11825
ae3b5189
CD
118262009-10-10 Chris Demetriou <cgd@google.com>
11827
11828 * options.h (Input_file_argument::Input_file_type): New enum.
11829 (Input_file_argument::is_lib_): Replace with...
11830 (Input_file_argument::type_): New member.
11831 (Input_file_argument::Input_file_argument): Take Input_file_type
11832 'type' rather than boolean 'is_lib' as second argument.
11833 (Input_file_argument::is_lib): Use type_.
11834 (Input_file_argument::is_searched_file): New function.
11835 (Input_file_argument::may_need_search): Handle is_searched_file.
11836 * options.cc (General_options::parse_library): Support -l:filename.
11837 (General_options::parse_just_symbols): Update for Input_file_argument
11838 changes.
11839 (Command_line::process): Likewise.
11840 * archive.cc (Archive::get_file_and_offset): Likewise.
11841 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11842 * script.cc (read_script_file, script_add_file): Likewise.
11843 * fileread.cc (Input_file::Input_file): Likewise.
11844 (Input_file::will_search_for): Handle is_searched_file.
11845 (Input_file::open): Likewise.
11846 * readsyms.cc (Read_symbols::get_name): Likewise.
11847 * testsuite/Makefile.am (searched_file_test): New test.
11848 * testsuite/Makefile.in: Regenerate.
11849 * testsuite/searched_file_test.cc: New file.
11850 * testsuite/searched_file_test_lib.cc: New file.
11851
f3048a1d
ILT
118522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11853 Ian Lance Taylor <iant@google.com>
11854
11855 * descriptor.cc: Include <cstdio> and "binary-io.h".
11856 (Descriptors::open): Open the files in binary mode always.
11857 * script.cc (Lex::get_token): Treat \r as whitespace.
11858
d4780e57
ILT
118592009-10-09 Ian Lance Taylor <iant@google.com>
11860
11861 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11862
d9a893b8
ILT
118632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11864 Ian Lance Taylor <iant@google.com>
11865
11866 * configure.ac: Check for readv function also.
11867 * fileread.cc (readv): Define if not HAVE_READV.
11868 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11869 does not exist.
11870 * config.in: Regenerate.
11871 * configure: Regenerate.
11872
c0a62865
DK
118732009-10-09 Doug Kwan <dougkwan@google.com>
11874
11875 * layout.cc (Layout::make_output_section): Call target hook to make
11876 ordinary output section.
11877 (Layout::finalize): Adjust parameter list of call the
11878 Target::may_relax().
11879 * layout.h (class Layout::section_list): New method.
11880 * merge.h (Output_merge_base::entsize): Change visibility to public.
11881 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11882 New methods.
11883 (Output_merge_string::do_is_string): New method.
11884 * object.cc (Sized_relobj::do_setup): renamed from
11885 Sized_relobj::set_up.
11886 * object.h (Sized_relobj::adjust_shndx,
11887 Sized_relobj::initializ_input_to_output_maps,
11888 Sized_relobj::free_input_to_output_maps): Change visibilities to
11889 protected.
11890 (Sized_relobj::setup): Virtualize.
11891 (Sized_relobj::do_setup): New method declaration.
11892 (Sized_relobj::invalidate_section_offset,
11893 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11894 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11895 * options.cc (parse_int): New function.
11896 * options.h (parse_int): New declaration.
11897 (DEFINE_int): New macro.
11898 (stub_group_size): New option.
11899 * output.cc (Output_section::Output_section): Initialize memebers
11900 merge_section_map_, merge_section_by_properties_map_,
11901 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11902 (Output_section::add_input_section): Handled deferred code-fill
11903 generation and remove an old comment.
11904 (Output_section::add_relaxed_input_section): New method definition.
11905 (Output_section::add_merge_input_section): Use merge section by
11906 properties map to speed to search. Update merge section maps
11907 as appropriate.
11908 (Output_section::build_relaxation_map): New method definition.
11909 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11910 Same.
11911 (Output_section::relax_input_section): Renamed to
11912 Output_section::convert_input_sections_to_relaxed_sections and change
11913 interface to take a vector of pointers to relaxed sections.
11914 (Output_section::find_merge_section,
11915 Output_section::find_relaxed_input_section): New method definitions.
11916 (Output_section::is_input_address_mapped,
11917 Output_section::output_offset, Output_section::output_address):
11918 Use output section data maps to speed up searching.
11919 (Output_section::find_starting_output_address): Add comments.
11920 (Output_section::do_write,
11921 Output_section::write_to_postprocessing_buffer): Do code-fill
11922 generation as appropriate.
11923 (Output_section::get_input_sections): Invalidate relaxed input section
11924 map.
11925 (Output_section::restore_states): Adjust type of checkpoint .
11926 Invalidate relaxed input section map.
11927 * output.h (Output_merge_base): New class declaration.
11928 (Input_section_specifier): New class defintion.
11929 (class Output_relaxed_input_section) Change base class to
11930 Output_section_data_build.
11931 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11932 base class initializer.
11933 (Output_section::add_relaxed_input_section): New method declaration.
11934 (Output_section::Input_section): Change visibility to protected.
2e702c99 11935 (Output_section::Input_section::relobj,
c0a62865
DK
11936 Output_section::Input_section::shndx): Handle relaxed input sections.
11937 Output_section::input_sections) Change visibility to protected. Also
11938 define overload to return a non-const pointer.
11939 (Output_section::Merge_section_properties): New class defintion.
11940 (Output_section::Merge_section_by_properties_map,
11941 Output_section::Output_section_data_by_input_section_map,
11942 Output_section::Relaxation_map): New types.
11943 (Output_section::relax_input_section): Rename method to
11944 Output_section::convert_input_sections_to_relaxed_sections and change
11945 interface to take a vector of relaxed section pointers.
11946 (Output_section::find_merge_section,
11947 Output_section::find_relaxed_input_section,
11948 Output_section::build_relaxation_map,
11949 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11950 New method declarations.
11951 (Output_section::merge_section_map_
11952 Output_section::merge_section_by_properties_map_,
11953 Output_section::relaxed_input_section_map_,
11954 Output_section::is_relaxed_input_section_map_valid_,
11955 Output_section::generate_code_fills_at_write_): New data members.
11956 * script-sections.cc
11957 (Output_section_element_input::set_section_addresses): Call
11958 current_data_size and addralign methods of relaxed input sections.
11959 (Orphan_output_section::set_section_addresses): Call current_data_size
11960 and addralign methods of relaxed input sections.
11961 * symtab.cc (Symbol_table::compute_final_value): Extract template
11962 from the body of Symbol_table::sized_finalize_symbol.
11963 (Symbol_table::sized_finalized_symbol): Call
11964 Symbol_table::compute_final_value.
11965 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11966 (Symbol_table::compute_final_value): New templated method declaration.
11967 * target.cc (Target::do_make_output_section): New method defintion.
11968 * target.h (Target::make_output_section): New method declaration.
11969 (Target::relax): Add more parameters for input objects, symbol table
11970 and layout. Adjust call to do_relax.
11971 (Target::do_make_output_section): New method declaration.
11972 (Target::do_relax): Add parameters for input objects, symbol table
11973 and layout.
11974
d446d6c4
ILT
119752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11976
11977 * pread.c: Include stdio.h.
11978
bc06c745
ILT
119792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11980
11981 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11982 defined.
11983
75aea3d0
ILT
119842009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11985
11986 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11987 Change read_shndx type to unsigned int.
11988 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11989 int.
11990 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11991 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11992 Change read_shndx type to unsigned int.
11993 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11994 int.
11995 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11996 * layout.cc (Layout::create_symtab_sections): Cast the result of
11997 local_symcount * symsize to off_t in the gold_assert.
11998
be8fcb75
ILT
119992009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12000
12001 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12002 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12003 R_ARM_BASE_ABS.
12004 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12005 (Arm_relocate_functions::thm_abs5): New function.
12006 (Arm_relocate_functions::abs12): New function.
12007 (Arm_relocate_functions::abs16): New function.
12008 (Arm_relocate_functions::base_abs): New function.
12009 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12010 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12011 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12012 R_ARM_BASE_ABS.
12013 (Scan::global): Likewise.
12014 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12015 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12016 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12017 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12018 R_ARM_BASE_ABS.
12019
c2a122b6
ILT
120202009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12021
12022 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12023 (Arm_relocate_functions::movt_prel): New function.
12024 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12025 (Arm_relocate_functions::thm_movt_prel): New function.
12026 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12027 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12028 (Scan::global, Relocate::relocate): Likewise.
12029 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12030
c4aa1e2d
ILT
120312009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12032
12033 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12034 Incremental_checker.
12035 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12036 unsigned int.
12037 (class Incremental_inputs_header): New class.
12038 (Incremental_inputs_header_writer): Edit comment.
12039 (Incremental_inputs_entry): New class.
12040 (Incremental_inputs_entry_writer): Edit comment.
12041 (Sized_incremental_binary::do_find_incremental_inputs_section):
12042 Add *strtab_shndx parameter, fill it.
12043 (Sized_incremental_binary::do_check_inputs): New method.
12044 (Incremental_checker::can_incrementally_link_output_file): Use
12045 Sized_incremental_binary::check_inputs.
12046 (Incremental_inputs::report_command_line): Save command line in
12047 command_line_.
12048 * incremental.h:
12049 (Incremental_binary::find_incremental_inputs_section): New
12050 method.
12051 (Incremental_binary::do_find_incremental_inputs_section): Add
12052 strtab_shndx parameter.
12053 (Incremental_binary::do_check_inputs): New pure virtual method.
12054 (Sized_incremental_binary::do_check_inputs): Declare.
12055 (Incremental_checker::Incremental_checker): Add incremental_inputs
12056 parameter, use it to initialize incremental_inputs_.
12057 (Incremental_checker::incremental_inputs_): New field.
12058 (Incremental_checker::command_line): New method.
12059 (Incremental_checker::inputs): New method.
12060 (Incremental_checker::command_line_): New field.
12061
c549a694
ILT
120622009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12063
12064 * incremental.cc: Include <cstdarg> and "target-select.h".
12065 (vexplain_no_incremental): New function.
12066 (explain_no_incremental): New function.
12067 (Incremental_binary::error): New method.
12068 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12069 method.
12070 (make_sized_incremental_binary): New function.
12071 (open_incremental_binary): New function.
12072 (can_incrementally_link_file): Add checks if output is ELF and has
12073 inputs section.
12074 * incremental.h: Include "elfcpp_file.h" and "output.h".
12075 (Incremental_binary): New class.
12076 (Sized_incremental_binary): New class.
12077 (open_incremental_binary): Declare.
12078 * object.cc (is_elf_object): Use
12079 elfcpp::Elf_recognizer::is_elf_file.
12080 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12081 * output.h (Output_file::filesize): New method.
12082
fd3c5f0b
ILT
120832009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12084
12085 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12086 New function.
12087 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12088 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12089 function.
12090 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12091 function.
12092 (Arm_relocate_functions::movw_abs_nc): New function.
12093 (Arm_relocate_functions::movt_abs): New function.
12094 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12095 (Arm_relocate_functions::thm_movt_abs): New function.
12096 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12097 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12098 (Scan::global): Likewise.
12099 (Relocate::relocate): Likewise.
12100 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12101
7f5309a5
ILT
121022009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12103
12104 * arm.cc (Arm_relocate_functions::got_prel) New function.
12105 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12106 (Relocate::relocate): Likewise.
12107 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12108
364c7fa5
ILT
121092009-10-06 Ian Lance Taylor <iant@google.com>
12110
12111 * options.h (class General_options): Define
12112 split_stack_adjust_size parameter.
12113 * object.h (class Object): Add uses_split_stack_ and
12114 has_no_split_stack_ fields. Add uses_split_stack and
12115 has_no_split_stack accessor functions. Declare
12116 handle_split_stack_section.
12117 (class Reloc_symbol_changes): Define.
12118 (class Sized_relobj): Define Function_offsets. Declare
12119 split_stack_adjust, split_stack_adjust_reltype, and
12120 find_functions.
12121 * object.cc (Object::handle_split_stack_section): New function.
12122 (Sized_relobj::do_layout): Call handle_split_stack_section.
12123 * dynobj.cc (Sized_dynobj::do_layout): Call
12124 handle_split_stack_section.
12125 * reloc.cc (Sized_relobj::relocate_sections): Call
12126 split_stack_adjust for executable sections in split_stack
12127 objects. Pass reloc_map to relocate_section.
12128 (Sized_relobj::split_stack_adjust): New function.
12129 (Sized_relobj::split_stack_adjust_reltype): New function.
12130 (Sized_relobj::find_functions): New function.
12131 * target-reloc.h: Include "object.h".
12132 (relocate_section): Add reloc_symbol_changes parameter. Change
12133 all callers.
12134 * target.h (class Target): Add calls_non_split method. Declare
12135 do_calls_non_split virtual method. Declare match_view and
12136 set_view_to_nop.
12137 * target.cc: Include "elfcpp.h".
12138 (Target::do_calls_non_split): New function.
12139 (Target::match_view): New function.
12140 (Target::set_view_to_nop): New function.
12141 * gold.cc (queue_middle_tasks): Give an error if mixing
12142 split-stack and non-split-stack objects with -r.
12143 * i386.cc (Target_i386::relocate_section): Add
12144 reloc_symbol_changes parameter.
12145 (Target_i386::do_calls_non_split): New function.
12146 * x86_64.cc (Target_x86_64::relocate_section): Add
12147 reloc_symbol_changes parameter.
12148 (Target_x86_64::do_calls_non_split): New function.
12149 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12150 parameter.
12151 * powerpc.cc (Target_powerpc::relocate_section): Add
12152 reloc_symbol_changes parameter.
12153 * sparc.cc (Target_sparc::relocate_section): Add
12154 reloc_symbol_changes parameter.
12155 * configure.ac: Call AM_CONDITIONAL for the default target.
12156 * configure: Rebuild.
12157 * testsuite/Makefile.am (TEST_AS): New variable.
12158 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12159 (check_DATA): Add split_i386 and split_x86_64 files.
12160 (SPLIT_DEFSYMS): Define.
12161 (split_i386_[1234n].o): New targets.
12162 (split_i386_[124]): New targets.
12163 (split_i386_[1234r].stdout): New targets.
12164 (split_x86_64_[1234n].o): New targets.
12165 (split_x86_64_[124]): New targets.
12166 (split_x86_64_[1234r].stdout): New targets.
12167 (MOSTLYCLEANFILES): Add new executables.
12168 * testsuite/split_i386.sh: New file.
12169 * testsuite/split_x86_64.sh: New file.
12170 * testsuite/split_i386_1.s: New file.
12171 * testsuite/split_i386_2.s: New file.
12172 * testsuite/split_i386_3.s: New file.
12173 * testsuite/split_i386_4.s: New file.
12174 * testsuite/split_i386_n.s: New file.
12175 * testsuite/split_x86_64_1.s: New file.
12176 * testsuite/split_x86_64_2.s: New file.
12177 * testsuite/split_x86_64_3.s: New file.
12178 * testsuite/split_x86_64_4.s: New file.
12179 * testsuite/split_x86_64_n.s: New file.
12180 * testsuite/testfile.cc (Target_test): Update relocation_section
12181 function.
12182 * testsuite/Makefile.in: Rebuild.
12183
e8a9fcda
ILT
121842009-10-06 Ian Lance Taylor <iant@google.com>
12185
12186 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12187 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12188 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12189 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12190 the address on ldo_addrs_.
12191 (Target_i386::Relocate::fix_up_ldo): New function.
12192
e99daf92
ILT
121932009-10-06 Rafael Espindola <espindola@google.com>
12194
12195 * plugin.cc (add_input_library): New.
12196 (Plugin::load): Add add_input_library to tv.
12197 (Plugin_manager::add_input_file): Add the is_lib argument.
12198 (add_input_file): Update call to Plugin_manager::add_input_file.
12199 (add_input_library): New.
12200 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12201
966d4097
DK
122022009-09-30 Doug Kwan <dougkwan@google.com>
12203
12204 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12205 symbol and call Symbol::may_need_copy_reloc to determine if
12206 a copy reloc is needed.
12207 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12208 nocopyreloc is given in command line.
12209 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12210 given in command line.
12211 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12212 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12213 of the removed Target_i386::may_need_copy_reloc.
12214 * options.h (copyreloc): New option with default value false.
12215 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12216 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12217 instead of the removed Target_powerpc::may_need_copy_reloc.
12218 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12219 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12220 instead of the removed Target_sparc::may_need_copy_reloc.
12221 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12222 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12223 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12224 instead of the removed Target_x86_64::may_need_copy_reloc.
12225
029ba973
ILT
122262009-09-30 Ian Lance Taylor <iant@google.com>
12227
12228 * object.h (class Object): Remove target_ field, and target,
12229 sized_target, and set_target methods.
12230 (Object::sized_target): Remove.
12231 (class Sized_relobj): Update declarations. Remove sized_target.
12232 * object.cc (Sized_relobj::setup): Remove target parameter.
12233 Change all callers.
12234 (Input_objects::add_object): Don't do anything with the target.
12235 (make_elf_sized_object): Add punconfigured parameter. Change all
12236 callers. Set or test parameter target.
12237 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12238 Change all callers.
12239 * parameters.cc (Parameters::set_target): Change parameter type to
12240 be non-const.
12241 (Parameters::default_target): Remove.
12242 (set_parameters_target): Change parameter type to be non-const.
12243 (parameters_force_valid_target): New function.
12244 (parameters_clear_target): New function.
12245 * parameters.h (class Parameters): Update declarations. Remove
12246 default_target method. Add sized_target and clear_target
12247 methods. Change target_ to be non-const.
12248 (set_parameters_target): Update declaration.
12249 (parameters_force_valid_target): Declare.
12250 (parameters_clear_target): Declare.
12251 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12252 as NULL if we aren't searching.
12253 (Add_symbols::run): Don't check for compatible target.
12254 * fileread.cc (Input_file::open_binary): Call
12255 parameters_force_valid_target.
12256 * gold.cc (queue_middle_tasks): Likewise.
12257 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12258 set_target on object.
12259 * dynobj.h (class Sized_dynobj): Update declarations.
12260 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12261 make_elf_object returns NULL.
12262 (Archive::include_member): Don't check whether object target is
12263 compatible.
12264 * output.cc (Output_section::add_input_section): Get target from
12265 parameters.
12266 (Output_section::relax_input_section): Likewise.
12267 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12268 parameters.
12269 (Sized_relobj::do_scan_relocs): Likewise.
12270 (Sized_relobj::relocate_sections): Likewise.
12271 * resolve.cc (Symbol_table::resolve): Likewise.
12272 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12273 parameter. Change all callers.
12274 (Symbol_table::add_from_object): Get target from parameters.
12275 (Symbol_table::add_from_relobj): Don't check object target.
12276 (Symbol_table::add_from_dynobj): Likewise.
12277 (Symbol_table::define_special_symbol): Get target from
12278 parameters.
12279 * symtab.h (class Symbol_table): Update declaration.
12280 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12281 parameter. Change all callers. Clear parameter target.
12282 (Binary_test): Test target here.
12283 * testsuite/object_unittest.cc (gold_testsuite): Remove
12284 target_test_pointer parameter. Change all callers.
12285 (Object_test): Test target here.
12286
a6a22b83
ILT
122872009-09-26 Ian Lance Taylor <iant@google.com>
12288
12289 * testsuite/initpri1.c: Don't try to use constructor priorities if
12290 compiling with gcc before 4.3.
12291
6a8f49fe
ILT
122922009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12293
12294 * testsuite/retain_symbols_file_test.sh (check_present): Change
12295 output file name to retain_symbols_file_test.stdout.
12296 (check_absent): Likewise.
12297
8c604651
CS
122982009-09-18 Craig Silverstein <csilvers@google.com>
12299
12300 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12301 * options.cc: Include <cerrno> and <fstream>.
12302 (General_options::finalize): Parse -retain-symbols-file tag.
12303 * options.h: New flag.
12304 (General_options): New method should_retain_symbol, new
12305 variable symbols_to_retain.
12306 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12307 should_retain_symbol map.
12308 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12309 * testsuite/Makefile.in: Regenerate.
12310 * testsuite/retain_symbols_file_test.sh: New file.
12311
ca58b19f
NC
123122009-09-18 Nick Clifton <nickc@redhat.com>
12313
12314 * po/es.po: Updated Spanish translation.
12315
20e6d0d6
DK
123162009-09-17 Doug Kwan <dougkwan@google.com>
12317
12318 * debug.h (DEBUG_RELAXATION): New constant.
12319 (DEBUG_ALL): Add DEBUG_RELAXATION.
12320 (debug_string_to_enum): Add relaxation debug option.
12321 * layout.cc
12322 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12323 Layout::Relaxation_debug_check::read_sections,
12324 Layout::Relaxation_debug_check::read_sections): New method definitions.
12325 (Layout::Layout): Initialize data members
12326 record_output_section_data_from_scrips_,
12327 script_output_section_data_list_ and relaxation_debug_check_.
12328 (Layout::save_segments, Layout::restore_segments,
12329 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12330 Layout::relaxation_loop_body): New method definitions.
12331 (Layout::finalize): Support relaxation. Move section layout code to
12332 Layout::relaxation_loop_body.
12333 (Layout::set_asection_address_from_script): Move code for orphan
12334 section placement out.
12335 (Layout::place_orphan_sections_in_script): New method definition.
12336 * layout.h (Output_segment_headers, Output_file_header):
12337 New forward class declarations.
12338 (Layout::~Layout): Define.
12339 (Layout::new_output_section_data_from_script): New method definition.
12340 (Layout::place_orphan_sections_in_script): New method declaration.
12341 (Layout::Segment_states): New type declaration.
12342 (Layout::save_segments, Layout::restore_segments,
12343 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12344 Layout::relaxation_loop_body): New method declarations.
12345 (Layout::Output_section_data_list): New type declaration.
12346 (Layout::Relaxation_debug_check): New class definition.
12347 (Layout::record_output_section_data_from_script_,
12348 Layout::script_output_section_data_list_, Layout::segment_states_,
12349 Layout::relaxation_debug_check_): New data members.
12350 * output.cc: (Output_section_headers::do_size): New method definition.
12351 (Output_section_headers::Output_section_headers): Move size
12352 computation to Output_section_headers::do_size.
12353 (Output_segment_headers::do_size): New method definition.
e1df38aa 12354 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12355 Output_file_header::do_size and call it.
12356 (Output_file_header::do_size): New method definition.
12357 (Output_data_group::Output_data_group): Adjust call to
12358 Output_section_data.
12359 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12360 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12361 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12362 RELAXED_INPUT_SECTION_CODE.
12363 (Output_section::Output_section): Initialize data member checkpoint_.
12364 (Output_section::~Output_section): Delete checkpoint object pointed
12365 by checkpoint_.
12366 (Output_section::add_input_section): Always add an Input_section if
12367 relaxing.
12368 (Output_section::add_merge_input_section): Add assert.
12369 (Output_section::relax_input_section): New method definition.
12370 (Output_section::set_final_data_size): Set load address to zero for
12371 an unallocated section.
12372 (Output_section::do_address_and_file_offset_have_reset_values):
12373 New method definition.
12374 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12375 Handle relaxed input section.
12376 (Output_section::sort_attached_input_sections): Checkpoint input
12377 section list lazily.
12378 (Output_section::get_input_sections): Change type of input_sections to
12379 list of Simple_input_section pointers. Checkpoint input section list
12380 lazily. Also handle relaxed input sections.
12381 (Output_section::add_input_section_for_script): Take a reference to
12382 a Simple_input_section object instead of Relobj pointer and section
12383 index as parameter. Handle relaxed input sections.
12384 (Output_section::save_states, Output_section::restore_states): New
12385 method definitions.
12386 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12387 (Output_data::is_data_size_fixed): New method definition.
12388 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12389 if it is fixed.
12390 (Output_data::address_and_file_offset_have_reset_values): New method
12391 definition.
12392 (Output_data::do_address_and_file_offset_have_reset_values): New method
12393 definition.
12394 (Output_data::set_data_size): Check that data size is not fixed.
12395 (Output_data::fix_data_size): New method definition.
12396 (Output_data::is_data_size_fixed_): New data member.
12397 (Output_section_headers::set_final_data_size): New method definition.
12398 (Output_section_headers::do_size): New method declaration.
12399 (Output_segment_headers::set_final_data_size): New method definition.
12400 (Output_segment_headers::do_size): New method declaration.
12401 (Output_file_header::set_final_data_size)::New method definition.
12402 (Output_file_header::do_size)::New method declaration.
12403 (Output_section_data::Output_section_data): Add new parameter
12404 is_data_size_fixed and use it to fix data size.
12405 (Output_data_const::Output_data_const): Adjust call to base class
12406 constructor and fix data size.
12407 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12408 base class constructor and fix data size.
12409 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12410 base class constructor and fix data size.
12411 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12412 class constructor and fix data size.
12413 (Output_data_group::set_final_data_size): New method definition.
12414 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12415 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12416 class constructor and fix data size.
12417 (Output_relaxed_input_section): New class definition.
12418 (Output_section::Simple_input_section): New class definition.
12419 (Output_section::get_input_sections): Adjust parameter list.
12420 (Output_section::add_input_section_for_script): Same.
12421 (Output_section::save_states, Output_section::restore_states,
12422 Output_section::do_address_and_file_offset_have_reset_values,
12423 (Output_section::Input_section::Input_section): Handle
12424 RELAXED_INPUT_SECTION_CODE. Add new overload for
12425 Output_relaxed_input_section.
12426 (Output_section::Input_section::is_input_section,
12427 Output_section::Input_section::set_output_section): Handle relaxed
12428 input section.
12429 (Output_section::Input_section::is_relaxed_input_section,
12430 Output_section::Input_section::output_section_data,
12431 Output_section::Input_section::relaxed_input_section): New method
12432 definitions.
12433 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12434 value.
12435 (Output_section::Input_section::u1_): Update comments.
12436 (Output_section::Input_section::u2_): Add new union member poris.
12437 (Output_section::Checkpoint_output_section): New classs definition.
12438 (Output_section::relax_input_section): New method declaration.
12439 (Output_section::checkpoint_): New data member.
12440 (Output_segment): Update comments.
12441 (Output_segment::Output_segment): Un-privatize copy constructor.
12442 (Output_segment::operator=): Un-privatize.
12443 * script-sections.cc (Output_section_element::Input_section_list):
12444 Change element type to Output_section::Simple_input_section.
12445 (Output_section_element_dot_assignment::set_section_addresses):
12446 Register output section data for relaxation clean up.
12447 (Output_data_exression::Output_data_expression): Adjust call to base
12448 constructor to fix data size.
12449 (Output_section_element_data::set_section_addresses): Register
12450 Output_data_expression object for relaxation clean up.
12451 (struct Input_section_info): Replace Relobj pointer and section index
12452 pair with Output_section::Simple_input_section and Convert struct to a
12453 class.
12454 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12455 Input_section_info data member to use accessors.
20e6d0d6
DK
12456 (Output_section_element_input::set_section_addresses): Use layout
12457 parameter. Adjust code to use Output_section::Simple_input_section
12458 and Input_secction_info classes. Register filler for relaxation
12459 clean up.
12460 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12461 and section index pair with Output_section::Simple_input_section
12462 class. Adjust code accordingly.
12463 (Phdrs_element::release_segment): New method definition.
12464 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12465 segment list.
12466 (Script_sections::release_segments): New method definition.
12467 * gold/script-sections.h (Script_sections::release_segments): New
12468 method declaration.
12469 * gold/target.h (Target::may_relax, Target::relax,
12470 Target::do_may_relax, Target::do_relax): New method definitions.
12471
5e445df6
ILT
124722009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12473
12474 * arm.cc (has_signed_unsigned_overflow): New function.
12475 (Arm_relocate_functions::abs8): New function.
12476 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12477 (Target_arm::Scan::global): Likewise.
12478 (Target_arm::relocate::relocate): Likewise.
12479 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12480 Likewise.
12481
8c604651 124822009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12483
12484 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12485 * testsuite/Makefile.in: Regenerate.
12486
1e9cc1c2
NC
124872009-09-11 Nick Clifton <nickc@redhat.com>
12488
12489 * po/gold.pot: Updated by the Translation project.
12490
6a89f575
CC
124912009-09-08 Cary Coutant <ccoutant@google.com>
12492
12493 * output.cc (Output_file::open): Add execute permission to empty file.
12494 * testsuite/Makefile.am (permission_test): New test.
12495 * testsuite/Makefile.in: Regenerate.
12496
fdcac5af
ILT
124972009-09-02 Ian Lance Taylor <iant@google.com>
12498
12499 * output.cc (Output_file::resize): Call map_no_anonymous rather
12500 than map.
12501
44453f85
ILT
125022009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12503
12504 * gold.cc: Include "incremental.h".
12505 (queue_initial_tasks): Call Incremental_checker methods.
12506 * incremental.cc: Include "output.h".
12507 (Incremental_checker::can_incrementally_link_output_file): New
12508 method.
12509 * incremental.h (Incremental_checker): New class.
12510
12511 * output.cc (Output_file::open_for_modification): New method.
12512 (Output_file::map_anonymous): Changed return type to bool. Record
12513 map in base_ field.
12514 (Output_file::map_no_anonymous): New method, broken out of map.
12515 (Output_file::map): Use map_no_anonymous and map_anonymous.
12516 * output.h (class Output_file): Update declarations.
12517
293c1386
CC
125182009-08-24 Cary Coutant <ccoutant@google.com>
12519
12520 * options.h (Command_line::Pre_options): New class.
12521 (Command_line::pre_options): New member.
12522 * options.cc (gold::options::ready_to_register): New variable.
12523 (One_option::register_option): Do nothing if not registering options.
12524 Assert if same short option registered twice.
12525 (General_options::General_options): Turn off option registration when
12526 done constructing.
12527 (Command_line::Pre_options::Pre_options): New constructor.
12528
f773f3d2
CC
125292009-08-24 Cary Coutant <ccoutant@google.com>
12530
06a73cfe
CC
12531 * options.h (General_options::no_keep_memory): Remove incorrect
12532 short option.
f773f3d2 12533
a15af8e2
RW
125342009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12535
12536 * Makefile.am (am__skiplex, am__skipyacc): New.
12537 * Makefile.in: Regenerate.
12538
c462b41b
RW
125392009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12540
14ec8efd
RW
12541 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12542 (INCLUDES): ... this.
12543 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12544 (AM_CPPFLAGS): Renamed from ...
12545 (INCLUDE): ... this.
12546 * Makefile.in, testsuite/Makefile.in: Regenerate.
12547
81ecdfbb
RW
12548 * Makefile.in: Regenerate.
12549 * aclocal.m4: Likewise.
12550 * config.in: Likewise.
12551 * configure: Likewise.
12552 * testsuite/Makefile.in: Likewise.
12553
c462b41b
RW
12554 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12555 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12556 * Makefile.in: Regenerate.
12557 * testsuite/Makefile.in: Regenerate.
12558
2da73f13
CC
125592009-08-19 Cary Coutant <ccoutant@google.com>
12560
12561 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12562 symbols in shared libraries overridden by hidden or internal symbols
12563 in the main program.
12564
2db70501
CD
125652009-08-19 Chris Demetriou <cgd@google.com>
12566
12567 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12568 checking source file names in error messages.
12569
f733487b
DK
125702009-08-18 Doug Kwan <dougkwan@google.com>
12571
12572 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12573 an elcpp::Ehdr as parameter. Adjust call to set_target.
12574 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12575 an elfcpp::Ehdr as parameter.
12576 * object.cc (Object::set_target): Remove the version that looks up
12577 a target and sets it.
12578 (Sized_relobj::setup): Take a Target object instead of
12579 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12580 (make_elf_sized_object): Find target and ask target to
12581 make an ELF object.
12582 * object.h: (Object::set_target): Remove the version that looks up
12583 a target and sets it.
12584 (Sized_relobj::setup): Take a Target object instead of
12585 an elfcpp:Ehdr as parameter.
12586 * target.cc: Include dynobj.h.
12587 (Target::do_make_elf_object_implementation): New.
2e702c99 12588 (Target::do_make_elf_object): New.
f733487b
DK
12589 * target.h (Target::make_elf_object): New template declaration.
12590 (Target::do_make_elf_object): New method declarations.
12591 (Target::do_make_elf_object_implementation): New template declaration.
12592
cc70f101
ILT
125932009-08-14 Ian Lance Taylor <iant@google.com>
12594
12595 * gold.h (FUNCTION_NAME): Define.
12596 (gold_unreachable): Use FUNCTION_NAME.
12597
ef5e0cb1
ST
125982009-08-12 Sriraman Tallam <tmsriram@google.com>
12599
12600 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12601 symbol in the --keep-unique list is not found.
12602
48c187ce
ST
126032009-08-12 Sriraman Tallam <tmsriram@google.com>
12604
12605 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12606 been maked as --keep-unique.
12607 (Icf::unfold_section): New function.
12608 * icf.h (Icf::unfold_section): New function.
12609 * options.h (General_options::keep_unique): New option.
12610 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12611 * testsuite/Makefile.in: Regenerate.
12612 * testsuite/icf_keep_unique_test.sh: New file.
12613 * testsuite/icf_keep_unique_test.cc: New file.
12614
645afe0c
CC
126152009-08-12 Cary Coutant <ccoutant@google.com>
12616
12617 PR 10471
12618 * resolve.cc (Symbol_table::resolve): Check for references from
12619 dynamic objects to hidden and internal symbols.
12620 * testsuite/Makefile.am (hidden_test.sh): New test.
12621 * testsuite/Makefile.in: Regenerate.
12622 * testsuite/hidden_test.sh: New script.
12623 * testsuite/hidden_test_1.c: New test source.
12624 * testsuite/hidden_test_main.c: New test source.
12625
11af873f
DK
126262009-08-11 Doug Kwan <dougkwan@google.com>
12627
12628 * arm.cc: Update comments.
12629 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12630 segment to locate the .ARM.exidx section if present.
12631
b9f7d72d
DK
126322009-08-09 Doug Kwan <dougkwan@google.com>
12633
12634 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12635 patch.
12636
ddd3c53c
ST
126372009-08-07 Sriraman Tallam <tmsriram@google.com>
12638 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12639 compiler warnings.
12640
27721062
ST
126412009-08-06 Sriraman Tallam <tmsriram@google.com>
12642
12643 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12644 valid tls_segment only for non-debug-section relocations.
12645 * testsuite/Makefile.am: Add gc_tls_test.
12646 * testsuite/Makefile.in: Regenerate.
12647 * testsuite/gc_tls_test.cc: New file.
12648 * testsuite/gc_tls_test.sh: New file.
12649
ef15dade 126502009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12651
ef15dade
ST
12652 * icf.cc: New file.
12653 * icf.h: New file.
12654 * Makefile.am (CCFILES): Add icf.cc.
12655 (HFILES): Add icf.h
12656 * Makefile.in: Regenerate.
12657 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12658 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12659 section, symbol and addend information for the relocs.
12660 * gold.cc (queue_middle_tasks): Call identical code folding.
12661 * gold.h: Add defines for multimap.
12662 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12663 to the call of finalize_local_symbols.
12664 * main.cc (main): Create object of class Icf.
12665 * object.cc (Sized_relobj::do_layout): Allow this function to be
12666 called twice during icf.
12667 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12668 to sections marked as identical by icf.
12669 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12670 when available.
12671 (Sized_relobj::do_section_entsize): New function.
12672 * object.h (Object::section_entsize): New function.
12673 (Object::do_section_entsize): New pure virtual function.
12674 (Relobj::finalize_local_symbols): Add new parameter.
12675 (Relobj::do_section_entsize): New function.
12676 * options.h (General_options::icf): New option.
12677 (General_options::icf_iterations): New option.
12678 (General_options::print_icf_sections): New option.
12679 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12680 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12681 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12682 icf.
12683 * symtab.cc (Symbol_table::is_section_folded): New function.
12684 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12685 to sections marked as identical by icf.
12686 * symtab.h (Symbol_table::set_icf): New function.
12687 (Symbol_table::icf): New function.
12688 (Symbol_table::is_section_folded): New function.
12689 (Symbol_table::icf_): New data member.
12690 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12691 * testsuite/Makefile.am: Add commands to build icf_test.
12692 * testsuite/Makefile.in: Regenerate.
12693 * testsuite/icf_test.sh: New file.
12694 * testsuite/icf_test.cc: New file.
12695
c3b65ac4
CD
126962009-07-24 Chris Demetriou <cgd@google.com>
12697
12698 * layout.cc (is_compressible_debug_section): Fix incorrect
12699 comment about compressed section names.
12700
1caf2c51
ILT
127012009-07-20 Ian Lance Taylor <ian@airs.com>
12702
12703 PR 10419
12704 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12705
1ef4d87f
ILT
127062009-07-16 Ian Lance Taylor <iant@google.com>
12707
12708 PR 10400
12709 * layout.h: #include <map>.
12710 (class Kept_section): Change from struct to class. Add accessors
12711 and setters. Add section size to Comdat_group mapping. Change
12712 Comdat_group to std::map. Add is_comdat_ field. Add
12713 linkonce_size field in union.
12714 (class Layout): Update declaration of find_or_add_kept_section.
12715 Don't declare find_kept_object.
12716 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12717 parameter. Add object, shndx, is_comdat, and is_group_name
12718 parameters. Change all callers. Adjust for new Kept_section.
12719 (Layout::find_kept_object): Remove.
12720 * object.cc (Sized_relobj::include_section_group): Update use of
12721 Kept_section. Rename secnum to shndx. Only record
12722 Kept_comdat_section if sections are the same size.
12723 (Sized_relobj::include_linkonce_section): Update use of
12724 Kept_section. Only record Kept_comdat_section if sections are the
12725 same size. Set size of linkonce section.
12726 (Sized_relobj::map_to_kept_section): Update call to
12727 get_kept_comdat_section.
12728 * object.h (class Sized_relobj): Rename fields in
12729 Kept_comdat_section to drop trailing underscores; change object
12730 field to Relobj*. Change Kept_comdat_section_table to store
12731 struct rather than pointer.
12732 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12733 Add kept_object and kept_shndx parameters. Change all callers.
12734 (Sized_relobj::get_kept_comdat_section): Change return type to
12735 bool. Add kept_object and kept_shndx parameters. Change all
12736 callers.
12737 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12738 Layout::find_or_add_kept_section.
12739
37c3b7b0
ILT
127402009-07-09 Ian Lance Taylor <iant@google.com>
12741
12742 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12743 Reserve space in the hash table.
12744
98fa85cb
ILT
127452009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12746
12747 * fileread.cc (File_read::get_mtime): New method.
12748 * fileread.h (Timespec): New structure.
12749 (File_read::get_mtime): New method.
12750 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12751 Renamed from timestamp_nsec.
12752 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12753 Elf_Xword.
e1df38aa 12754 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12755 timestamp_nsec.
e1df38aa 12756 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12757 (Incremental_inputs::report_obejct): Save mtime; style fix.
12758 (Incremental_inputs::report_script): Save mtime; style fix.
12759 (Incremental_inputs::finalize_inputs): Style fix.
12760 (Incremental_inputs::finalize): Style fix.
12761 (Incremental_inputs::create_input_section_data): Store inputs
12762 mtime.
12763 * incremental.h (Incremental_inputs::report_script): Add mtime
12764 argument.
12765 (Incremental_inputs::Input_info::Input_info): Intialize only one
12766 union member.
12767 (Incremental_inputs::Input_info::archive): Move to nameless
12768 union.
12769 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12770 (Incremental_inputs::Input_info::script): Move to nameless union.
12771 (Incremental_inputs::mtime): New field.
12772 * script.cc (read_input_script): Pass file mtime to
12773 Incremental_input.
12774 * script.h (Script_info::inputs): Style fix.
12775
c9d70757
ILT
127762009-07-01 Ian Lance Taylor <ian@airs.com>
12777
12778 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12779 instead of 32.
12780
9c547ec3
ILT
127812009-06-24 Ian Lance Taylor <iant@google.com>
12782
12783 PR 10156
12784 * layout.cc (Layout::choose_output_section): If we find an
12785 existing section, update the flags.
12786 (Layout::create_notes): New function, broken out of
12787 Layout::finalize.
12788 (Layout::finalize): Don't create note sections.
12789 (Layout::create_note): Don't crash if linker script discards
12790 section.
12791 (Layout::create_gold_note): Likewise.
12792 (Layout::create_build_id): Likewise. Don't set
12793 after_input_sections on the section.
12794 (Layout::create_executable_stack_info): Remove target parameter.
12795 Change caller.
12796 * layout.h (class Layout): Declare create_notes. Update
12797 declaration of create_executable_stack_info.
12798 * gold.cc (queue_middle_tasks): Call create_notes.
12799 * output.cc (Output_section::update_flags_for_input_section): Move
12800 here from output.h. If SHF_ALLOC flag is newly set, mark address
12801 invalid.
12802 * output.h (Output_data::mark_address_invalid): New function.
12803 (class Output_section): Only declare, not define,
12804 update_flags_for_input_section. Remove set_flags.
12805
55458500
ILT
128062009-06-24 Ian Lance Taylor <iant@google.com>
12807
12808 * script-sections.cc (Output_section_definition::
12809 set_section_addresses): Rename shadowing local load_address to
12810 laddr.
12811
1307d6cd
ILT
128122009-06-24 Ian Lance Taylor <iant@google.com>
12813
12814 PR 10244
12815 * reloc.cc (relocate_sections): Skip empty relocation sections.
12816
ec3f783e
ILT
128172009-06-23 Ian Lance Taylor <iant@google.com>
12818
12819 PR 10156
12820 * layout.cc (Layout::create_note): Use choose_output_section
12821 rather than make_output_section.
12822
459c9f1c
ILT
128232009-06-23 Ian Lance Taylor <iant@google.com>
12824
12825 PR 10237
12826 * options.cc (General_options::parse_V): Set printed_version_.
12827 (General_options::General_options): Initialize printed_version_.
12828 * options.h (class General_options): Add printed_version_ field.
12829 * gold.cc (queue_initial_tasks): If there are no input files,
12830 don't give a fatal error if we printed the version information.
12831 (queue_middle_tasks): If using -r with a shared object, give a
12832 fatal error rather than an ordinary error.
12833
1518dc8f
ILT
128342009-06-23 Ian Lance Taylor <iant@google.com>
12835
12836 PR 10219
12837 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12838 (Layout::make_output_section): Set have_stabstr_section_ if we see
12839 a .stab*str section.
12840 (Layout::finalize): Call link_stabs_sections.
12841 (Layout::link_stabs_sections): New file.
12842 * layout.h (class Layout): Add have_stabstr_section_ field.
12843 Declare link_stabs_sections.
12844
3d857b98
DK
128452009-06-23 Doug Kwan <dougkwan@google.com>
12846
12847 * Makefile.am (libgold_a_LIBADD): New.
12848 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12849 * Makefile.in: Regenerate.
3d857b98
DK
12850 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12851 * configure: Regenerate.
12852 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12853 * fileread.cc: Include sys/state.h
12854 * gold.h: Declare memmem and strndup if found missing.
12855 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12856
0639a6f6
ILT
128572009-06-23 Ian Lance Taylor <iant@google.com>
12858
12859 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12860 * configure: Rebuild.
12861
8d63875c
ILT
128622009-06-23 Ian Lance Taylor <iant@google.com>
12863
12864 PR 10147
12865 * object.cc (Object::section_contents): Don't try to get a view if
12866 the section has length zero.
12867 (Object::handle_gnu_warning_section): If the section is empty, use
12868 the name of the section as the warning.
12869
f7c8a183
ILT
128702009-06-23 Ian Lance Taylor <iant@google.com>
12871
12872 PR 10133
12873 * stringpool.h (class Stringpool_template): Add optimize_ field.
12874 (Stringpool_template::set_optimize): New function.
12875 * stringpool.cc (Stringpool_template::Stringpool_template):
12876 Initialize optimize_ field.
12877 (Stringpool_template::set_string_offsets): Test local optimize
12878 fild rather than parameter.
12879 * layout.cc (Layout::Layout): Call set_optimize on the section
12880 name stringpool.
12881
e6a307ba
ILT
128822009-06-22 Ian Lance Taylor <iant@google.com>
12883
12884 PR 10030
12885 * yyscript.y: Parse TARGET.
12886 * script.cc (script_set_target): New function.
12887 * script-c.h (script_set_target): Declare.
12888 * options.cc (General_options::string_to_object_format): Rename
12889 from string_to_object_format in anonymous namespace. Change
12890 callers.
12891 * options.h (class General_options): Declare
12892 string_to_object_format.
12893
3ee173de
ILT
128942009-06-22 Ian Lance Taylor <iant@google.com>
12895
12896 * script-sections.cc (Script_sections::create_segments): Don't put
12897 program headers in a PT_LOAD segment if -n or -N.
12898
128992009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12900
12901 PR 10141
12902 * options.h (class General_options): Add -z lazy and -z now. Sort
12903 -z options into alphabetical order.
12904 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12905
cd6739a1 129062009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12907
12908 * layout.cc (Layout::make_output_section): Call
12909 Target::new_output_section.
12910 (Layout::attach_allocated_section_to_segment): Put large section
12911 sections in a separate load segment with the large segment flag
12912 set.
12913 (Layout::segment_precedes): Sort large data segments after other
12914 load segments.
12915 (align_file_offset): New static function.
12916 (Layout::set_segment_offsets): Use align_file_offset.
12917 * output.h (class Output_section): Add is_small_section_ and
12918 is_large_section_ fields.
12919 (Output_section::is_small_section): New function.
12920 (Output_section::set_is_small_section): New function.
12921 (Output_section::is_large_section): New function.
12922 (Output_section::set_is_large_section): New function.
12923 (Output_section::is_large_data_section): New function.
12924 (class Output_segment): Add is_large_data_segment_ field.
12925 (Output_segment::is_large_data_segment): New function.
12926 (Output_segment::set_is_large_data_segment): New function.
12927 * output.cc (Output_section::Output_section): Initialize new
12928 fields.
12929 (Output_segment::Output_segment): Likewise.
12930 (Output_segment::add_output_section): Add assertion that large
12931 data sections always go in large data segments. Force small data
12932 sections to the end of the list of data sections. Force small BSS
12933 sections to the start of the list of BSS sections. For large BSS
12934 sections to the end of the list of BSS sections.
12935 * symtab.h (class Symbol): Declare is_common_shndx.
12936 (Symbol::is_defined): Check Symbol::is_common_shndx.
12937 (Symbol::is_common): Likewise.
12938 (class Symbol_table): Define enum Commons_section_type. Update
12939 declarations. Add small_commons_ and large_commons_ fields.
12940 * symtab.cc (Symbol::is_common_shndx): New function.
12941 (Symbol_table::Symbol_table): Initialize new fields.
12942 (Symbol_table::add_from_object): Put small and large common
12943 symbols in the right list.
12944 (Symbol_table::sized_finalized_symbol): Check
12945 Symbol::is_common_shndx.
12946 (Symbol_table::sized_write_globals): Likewise.
12947 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12948 common symbol lists. Don't call do_allocate_commons_list if the
12949 list is empty.
12950 (Symbol_table::do_allocate_commons_list): Remove is_tls
12951 parameter. Add comons_section_type parameter. Change all
12952 callers. Handle small and large common symbols.
12953 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12954 Symbol::is_common_shndx.
12955 * resolve.cc (symbol_to_bits): Likewise.
12956 * target.h (Target::small_common_shndx): New function.
12957 (Target::small_common_section_flags): New function.
12958 (Target::large_common_shndx): New function.
12959 (Target::large_common_section_flags): New function.
12960 (Target::new_output_section): New function.
12961 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12962 small_common_section_flags, and large_common_section_flags
12963 fields.
12964 (Target::do_new_output_section): New virtual function.
12965 * arm.cc (Target_arm::arm_info): Initialize new fields.
12966 * i386.cc (Target_i386::i386_info): Likewise.
12967 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12968 Likewise.
12969 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12970 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12971 (Target_x86_64::do_new_output_section): New function.
12972 * configure.ac: Define conditional MCMODEL_MEDIUM.
12973 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12974 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12975 (large_LDFLAGS): Define.
12976 * testsuite/large.c: New file.
12977 * testsuite/testfile.cc (Target_test::test_target_info):
12978 Initialize new fields.
12979 * configure, testsuite/Makefile.in: Rebuild.
12980
bb04269c
DK
129812009-06-05 Doug Kwan <dougkwan@google.com>
12982
12983 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12984 * Makefile.in: Regenerate.
bb04269c
DK
12985 * i386.cc (class Target_i386): Define new virtual method to
12986 override do_is_local_label_name in parent.
12987 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12988 local symbols if --discard-locals or -X is given.
12989 * options.h (class General_options): Declare new options
12990 '--discard-locals' and '-X' for discarding locals.
12991 * target.h (class Target): Define new methods is_local_label_name.
12992 Declare new virtual method do_is_local_label_name.
12993 * target.cc: New file.
12994 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12995 (check_SCRIPTS): Add discard_locals_test.sh.
12996 (check_DATA): Add discard_local_tests.syms.
12997 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12998 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12999 * testsuite/Makefile.in: Regenerate.
13000 * testsuite/discard_locals_test.c: New file.
13001 * testsuite/discard_locals_test.sh: Same.
13002
805bb01c
DK
130032009-06-05 Doug Kwan <dougkwan@google.com>
13004
13005 * object.cc (Sized_relobj::Sized_relobj): Initialize
13006 discarded_eh_frame_shndx_ to -1U.
13007 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13008 section.
13009 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13010 a discarded .eh_frame section.
13011 (Sized_relobj::do_finalize_local_symbols): Ditto.
13012 * object.h (class Sized_relobj): Declare new member
13013 discarded_eh_frame_shndx_.
13014 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13015 (local_labels_test.o, local_labels_test): New rules.
13016 * testsuite/Makefile.in: Regenerate.
13017
1dcd334d
DK
130182009-06-04 Doug Kwan <dougkwan@google.com>
13019
13020 * layout.cc (Layout::section_name_mapping): Add mapping for
13021 special ARM sections.
13022
96d49306
DK
130232009-06-03 Doug Kwan <dougkwan@google.com>
13024
13025 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13026 (utils::has_overflow): Same.
13027
dff16297
ILT
130282009-06-03 Ian Lance Taylor <iant@google.com>
13029
13030 * layout.cc (Layout::section_name_mapping): New array, replacing
13031 Layout::linkonce_mapping.
13032 (Layout::section_name_mapping_count): New variable, replacing
13033 Layout::linkonce_mapping_count.
13034 (Layout::linkonce_output_name): Remove.
13035 (Layout::output_section_name): Rewrite.
13036 * layout.h (class Layout): Rename Linkonce_mapping to
13037 Section_name_mapping, linkonce_mapping to section_name_mapping,
13038 linkonce_mapping_count to section_name_mapping_count. Don't
13039 declare linkonce_output_name.
13040
c121c671
DK
130412009-06-03 Doug Kwan <dougkwan@google.com>
13042
13043 * gold/arm.cc (namespace utils): New.
13044 (Target_arm::reloc_is_non_pic): Define new method.
13045 (class Arm_relocate_functions): New.
13046 (Target_arm::Relocate::relocate): Handle relocation types used by
13047 Android.
13048
07800fab
ILT
130492009-06-03 Ian Lance Taylor <iant@google.com>
13050
13051 * arm.cc (Target_arm::scan::global): Use || instead of |.
13052
c121c671
DK
130532009-06-02 Doug Kwan <dougkwan@google.com>
13054
13055 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13056 issued_non_pic_error_.
13057 (class Target_arm::Scan): Declare new method check_non_pic.
13058 Define new method symbol_needs_plt_entry.
13059 Declare new data member issued_non_pic_error_.
13060 (class Target_arm::Relocate): Declare new method
13061 should_apply_static_reloc.
13062 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13063 (Target_arm::Scan::check_non_pic): Define new method.
13064 (Target_arm::Scan::local): Handle a small subset of reloc types used
13065 by Android.
13066 (Target_arm::Scan::local): Same.
13067 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13068
b19b0c6d
ILT
130692009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13070
13071 * incremental.cc (Incremental_inputs::report_command_line): Filter
13072 out --incremental-* options.
13073
94cdfcff
DK
130742009-05-29 Doug Kwan <dougkwan@google.com>
13075
13076 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13077 template class.
13078 (class Target_arm): Update comment.
13079 (Target_arm::Target_arm): Initialize new data members GOT_,
13080 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13081 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13082 and Target_arm::rel_dyn_section.
13083 Declare new_enum Target_arm::Got_type.
13084 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13085 and DYNBSS_.
13086 Update commments for member do_dynsym_value.
13087 (Target_arm::got_size, Target_arm::plt_section,
13088 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13089 new methods inside class defintion.
13090 (Target_arm::got_section): Define new method.
13091 (Target_arm::rel_dyn_section): Same.
13092 (Output_data_plt_arm): New template class.
13093 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13094 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13095 (Output_data_plt_arm::add_entry): Same.
13096 (Output_data_plt_arm::first_plt_entry): Define new
13097 static data member for PLT instruction template.
13098 (Output_data_plt_arm::plt_entry): Same.
13099 (Output_data_plt_arm::do_write): Define new method.
13100 (Target_arm::make_plt_entry): Same.
13101 (Target_arm::do_finalize_sections): Same.
13102 (Target_arm::do_dynsym_value): Same.
13103
4a657b0d
DK
131042009-05-28 Doug Kwan <dougkwan@google.com>
13105
13106 * Makefile.am (TARGETSOURCES): Add arm.cc.
13107 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13108 * Makefile.in: Regenerate.
13109 * arm.cc: New file.
13110 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13111
e7ae8c36
DK
131122009-05-26 Doug Kwan <dougkwan@google.com>
13113
13114 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13115 (General_options::check_excluded_libs): Strip off directories in
13116 archive name before matching like GNU ld does.
13117 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13118 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13119 (exclude_libs_test_LDFLAGS): Add linker option
13120 -Wl,--exclude-libs,libexclude_libs_test_3
13121 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13122 an explicit archive without using -l.
13123 (alt/libexclude_libs_test_3.a): New make rule.
13124 * testsuite/Makefile.in: Regenerate.
13125 * testsuite/exclude_libs_test.c : Declare lib3_default().
13126 (main): Call it.
13127 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13128 * exclude_libs_test_3.c: New file.
13129
f12e7348
NC
131302009-05-26 Nick Clifton <nickc@redhat.com>
13131
13132 * po/id.po: New Indonesian translation.
13133 * po/gold.pot: Updated template file.
13134
4daadc0d
ST
131352009-05-22 Sriraman Tallam <tmsriram@google.com>
13136
e1df38aa 13137 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13138 gc_comdat_test files. Add -Wl,--gc-sections to build
13139 gc_comdat_test.
13140 * testsuite/Makefile.in: Regenerate.
13141 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13142
531813ad
ST
131432009-05-21 Sriraman Tallam <tmsriram@google.com>
13144
13145 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13146 kept comdat section was garbage collected.
13147 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13148 * testsuite/Makefile.in: Regenerate.
13149 * testsuite/gc_comdat_test.sh: New file.
13150 * testsuite/gc_comdat_test_1.cc: New file.
13151 * testsuite/gc_comdat_test_2.cc: New file.
13152
65514900
CC
131532009-05-19 Doug Kwan <dougkwan@google.com>
13154
13155 * archive.cc (Archive::Archive): Move constructor from archive.h
13156 to here. Initialize no_export_.
13157 (Archive::get_elf_object_for_member): Set no_export flag of object.
13158 * archive.h (Archive::Archive): Move constructor body to
13159 archive.cc.
13160 (Archive::no_export): New method.
13161 (Archive::no_export_): New field.
13162 * object.h (Object::Object): Initialize no_export_ to false.
13163 (Object::no_export, Object::set_no_export): New methods.
13164 (Object::no_export_): New field.
13165 * options.cc (General_options::parse_exclude_libs): New method.
13166 (General_options::check_excluded_libs) Same.
13167 * options.h (exclude_libs): New option.
13168 (General_options::check_excluded_libs): New method declaration.
13169 (General_options::excluded_libs_): New field.
13170 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13171 default or protected visibility if an object has no-export flag set.
13172 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13173 (check_SCRIPTS): Add exclude_libs_test.sh.
13174 (check_DATA): Add exclude_libs_test.syms.
13175 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13176 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13177 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13178 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13179 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13180 libexclude_libs_test_2.a): New rules.
13181 * testsuite/Makefile.in: Regenerate.
13182 * testsuite/exclude_libs_test.c: New file.
13183 * testsuite/exclude_libs_test.sh: Ditto.
13184 * testsuite/exclude_libs_test_1.c: Ditto.
13185 * testsuite/exclude_libs_test_2.c: Ditto.
13186
1b77ea50
ILT
131872009-05-15 Ian Lance Taylor <iant@google.com>
13188
13189 * configure.ac: Check for declarations for cases where libiberty.h
13190 checks HAVE_DECL_xxx.
13191 * configure, config.in: Rebuild.
13192
072fe7ce
ILT
131932009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13194
13195 * gold.h (Incremental_argument_list): Remove (invalid) forward
13196 declaration.
13197 * incremental.cc (Incremental_inputs::report_achive): New method.
13198 (Incremental_inputs::report_object): New method.
13199 (Incremental_inputs::report_script): New method.
13200 (Incremental_inputs::finalize_inputs): New method.
13201 (Incremental_inputs::finalize): Call finalize_inputs().
13202 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13203 Create inputs entries.
13204 * incremental.h (Incremental_input_type): New enum.
13205 (Incremental_inputs::Incremental_input): Initialize new fields.
13206 (Incremental_inputs::report_inputs): New method.
13207 (Incremental_inputs::report_achive): New method.
13208 (Incremental_inputs::report_object): New method.
13209 (Incremental_inputs::report_script): New method.
13210 (Incremental_inputs::finalize_inputs): New method.
13211 (Incremental_inputs::Input_info): New struct.
13212 (Incremental_inputs::Input_info_map): New typedef.
13213 (Incremental_inputs::lock_): New field.
13214 (Incremental_inputs::Inputs_): New field.
13215 (Incremental_inputs::Inputs_map): New field.
13216 * main.cc (main): Call Incremental_input::report_inputs.
13217 * options.h (Input_argument_list): Typedef moved from
13218 Input_arguments.
13219 (Input_file_group::Files): Remove, use ::Input_argument_list.
13220 (Input_file_group::Input_argument_list): Remove, use
13221 ::Input_argument_list.
13222 * plugin.cc (Plugin_manager::add_input_file): Add error in
13223 incremental build.
13224 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13225 functions.
13226 * script.cc (read_input_script): Call
13227 Incremental_input::report_script.
13228 * script.h (Script_info): New class.
13229
b0481b0b
ILT
132302009-04-27 Ian Lance Taylor <iant@google.com>
13231
13232 * x86_64.cc (do_adjust_output_section): Set entsize to
13233 plt_entry_size.
13234
b22a5a41 132352009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13236
13237 * output.cc (Output_file::close): After short writes, continue
13238 writing from the correct offset in the buffer being written.
13239
40fde488
CD
132402009-04-23 Chris Demetriou <cgd@google.com>
13241
13242 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13243 * configure: Regenerate.
13244 * config.in: Regenerate.
13245 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13246 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13247
3ce2c28e
ILT
132482009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13249
13250 * incremental.cc (Incremental_inputs_header_data): Renamed from
13251 Incremental_input_header_data.
13252 (Incremental_inputs_header_data::data_size): New field.
13253 (Incremental_inputs_header_data::put_input_file_count): Renamed
13254 from input_file_count.
13255 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13256 from command_line_offset.
13257 (Incremental_inputs_header_data::put_reserved): Renamed from
13258 put_reserved.
13259 (Incremental_inputs_entry_data): Renamed from
13260 Incremental_input_entry_data.
13261 (Incremental_inputs_entry_data::data_size): New field.
13262 (Incremental_inputs::report_command_line): New method.
13263 (Incremental_inputs::finalize): New method.
13264 (Incremental_inputs::create_incremental_inputs_data): New method.
13265 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13266 * incremental.h: New file.
13267 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13268 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13269 incremental builds.
703d02da 13270 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13271 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13272 (Layout::create_incremental_info_sections): New method.
13273 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13274 * main.cc (main): Notify Incremental_input of the command line.
13275
e55bde5e
ILT
132762009-04-01 Ian Lance Taylor <iant@google.com>
13277 Mikolaj Zalewski <mikolajz@google.com>
13278
13279 * gold.h (reserve_unordered_map): Define, three versions, one for
13280 each version of Unordered_map.
13281 * layout.cc (Layout::Layout): Remove options parameter. Add
13282 number_of_input_files parameter. Don't initialize options_.
13283 Initialize number_of_input_files_ and resized_signatures_. Move
13284 sections_are_attached_.
13285 (Layout::layout_group): Reserve space for group_signatures_.
13286 (Layout::find_or_add_kept_section): Change name parameter to be a
13287 reference. Resize signatures_ map when it gets large enough.
13288 (Layout::layout_eh_frame): Use parameters->options() instead of
13289 this->options_.
13290 (Layout::make_output_section): Likewise.
13291 (Layout::attach_allocated_section_to_segment): Likewise.
13292 (Layout::finalize, Layout::create_executable_stack): Likewise.
13293 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13294 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13295 * layout.h (class Layout): Update declarations. Remove options_
13296 field. Add number_of_input_files_ and resized_signatures_
13297 fields. Move sections_are_attached_ field.
13298 * main.cc (main): Pass number of input files to Layout
13299 constructor. Don't pass options.
13300
154b857c
ILT
133012009-03-30 Ian Lance Taylor <iant@google.com>
13302
13303 * ffsll.c (ffsll): Correct implementation.
13304
2f35ab9b
ILT
133052009-03-27 Ian Lance Taylor <iant@google.com>
13306
fd03461a
ILT
13307 * ffsll.c: New file.
13308 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13309 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13310 * ftruncate.c (ftruncate): Declare before definition.
13311 * mremap.c (mremap): Likewise.
13312 * pread.c (pread): Likewise.
13313 * configure, Makefile.in, config.in: Rebuild.
13314
2f35ab9b
ILT
13315 * mremap.c: New file.
13316 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13317 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13318 (mremap): Declare if HAVE_MREMAP is not defined.
13319 * configure, Makefile.in, config.in: Rebuild.
13320
33aea2fd
CC
133212009-03-27 Cary Coutant <ccoutant@google.com>
13322
13323 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13324 position independent.
13325 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13326 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13327
6d479619
CC
133282009-03-24 Cary Coutant <ccoutant@google.com>
13329
13330 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13331 an executable.
13332 (needs_dynamic_reloc): Likewise.
13333
afc06bb8
ILT
133342009-03-24 Ian Lance Taylor <iant@google.com>
13335
13336 * yyscript.y (file_cmd): Recognize EXTERN.
13337 (extern_name_list, extern_name_list_body): New nonterminals.
13338 * script.cc (script_add_extern): Define.
13339 * script-c.h (script_add_extern): Declare.
13340
f6060a4d
ILT
133412009-03-24 Rafael Avila de Espindola <espindola@google.com>
13342
13343 * object.cc (is_elf_object): Define.
13344 * object.h (is_elf_object): Declare.
13345 * archive.cc (Archive::get_elf_object_for_member): Call
13346 is_elf_object.
33aea2fd 13347 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13348
26736d8e
ILT
133492009-03-24 Elliott Hughes <enh@google.com>
13350
13351 * output.cc (Output_file::map_anonymous): Define.
13352 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13353 try an anonymous one. Report the size if the mmap fails.
13354 * output.h (class Output_file): Declare map_anonymous.
13355
22fd9730
ILT
133562009-03-24 Ian Lance Taylor <iant@google.com>
13357
13358 * target-select.cc (instantiate_target): Don't acquire the lock if
13359 the instantiated_target_ field has already been set.
13360
cb010894
ILT
133612009-03-23 Ian Lance Taylor <iant@google.com>
13362
7f055c20
ILT
13363 * gold-threads.h (class Initialize_lock): Define.
13364 * gold-threads.cc (class Initialize_lock_once): Define.
13365 (initialize_lock_control): New static variable.
13366 (initialize_lock_pointer): New static variable.
13367 (initialize_lock_once): New static function.
13368 (Initialize_lock::Initialize_lock): Define.
13369 (Initialize_lock::initialize): Define.
13370 * target-select.h: Include "gold-threads.h".
13371 (class Target_selector): Add lock_ and initialize_lock_ fields.
13372 Don't define instantiate_target, just declare it.
13373 * target-select.cc (Target_selector::Target_selector): Initialize
13374 new fields.
13375 (Target_selector::instantiate_target): Define.
13376 * descriptors.h: Include "gold-threads.h".
13377 (class Descriptors): Add initialize_lock_ field.
13378 * descriptors.cc (Descriptors::Descriptors): Initialize new
13379 field.
13380 (Descriptors::open): Use initialize_lock_ field
13381 * errors.h (class Errors): Add initialize_lock_ field.
13382 * errors.cc (Errors::Errors): Initialize new field.
13383 (Errors::initialize_lock): Use initialize_lock_ field.
13384 * powerpc.cc (class Target_selector_powerpc): Remove
13385 instantiated_target_ field. In do_recognize call
13386 instantiate_target rather than do_instantiate_target. In
13387 do_instantiate_target just allocate a new target.
13388 * sparc.cc (class Target_selector_sparc): Likewise.
13389
36959681
ILT
13390 * freebsd.h: New file.
13391 * i386.cc: Include "freebsd.h".
13392 (Target_i386): Derive from Target_freebsd rather than
13393 Sized_target.
13394 (Target_selector_i386): Derive from Target_selector_freebsd rather
13395 than Target_selector.
13396 * x86_64.cc: Include "freebsd.h".
13397 (Target_x86_64): Derive from Target_freebsd rather than
13398 Sized_target.
13399 (Target_selector_x86_64): Derive from Target_selector_freebsd
13400 rather than Target_selector.
13401 * target.h (class Target): Add adjust_elf_header and
13402 do_adjust_elf_header.
13403 * output.cc (Output_file_header:: do_sized_write): Call target
13404 adjust_elf_header routine.
13405 * configure.tgt: Set targ_osabi.
13406 * configure.ac: Define GOLD_DEFAULT_OSABI.
13407 * parameters.cc (Parameters::default_target): Pass
13408 GOLD_DEFAULT_OSABI to select_target.
13409 * target-select.h (class Target_selector): Make instantiate_target
13410 protected rather than private.
13411 * Makefile.am (HFILES): Add freebsd.h.
13412 * configure, Makefile.in, config.in: Rebuild.
13413
cb010894
ILT
13414 * merge.cc (do_add_input_section): Correct pend value. Change
13415 message about last entry not being null terminated from error to
13416 warning.
13417
0e879927
ILT
134182009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13419
13420 * incremental.cc: New file.
13421 * Makefile.am (CCFILES): Add incremental.cc.
13422 * Makefile.in: Rebuild.
13423
41105937
PP
134242009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13425
13426 * layout.cc (Layout::output_section_name): Preserve names
13427 of '.note.' sections.
e1df38aa 13428
60439920
ILT
134292009-03-19 Ian Lance Taylor <iant@google.com>
13430
13431 * descriptors.cc (Descriptors::open): Check that the options are
13432 valid before using them.
13433
0d371ad3
ILT
134342009-03-18 Ian Lance Taylor <iant@google.com>
13435
13436 * script-sections.h: Include <list>.
13437 (class Script_sections): Change Sections_elements from std::vector
13438 to std::list. Typedef public Elements_iterator. Add
13439 orphan_section_placement_, data_segment_align_start_, and
13440 saw_data_segment_align_ fields. Remove data_segment_align_index_
13441 field.
13442 * script-sections.cc (class Orphan_section_placement): New class.
13443 (class Sections_element): Add virtual functions is_relro and
13444 orphan_section_init. Remove virtual function place_orphan_here.
13445 (class Output_section_definition): Add is_relro and
13446 orphan_section_init. Remove place_orphan_here.
13447 (class Orphan_output_section): Likewise.
13448 (Script_sections::Script_sections): Update for field changes.
13449 (Script_sections::data_segment_align): Set saw_data_segment_align_
13450 and data_segment_align_start_, not data_segment_align_index.
13451 (Script_sections::data_segment_relro_end): Check
13452 saw_data_segment_align_. Use data_segment_align_start_ rather
13453 than data_segment_align_index_.
13454 (Script_sections::place_orphan): Rewrite to use
13455 Orphan_section_placement.
13456
9201d894
ILT
134572009-03-17 Ian Lance Taylor <iant@google.com>
13458
9c5b8369
ILT
13459 * archive.cc (Archive::add_symbols): Check for a version attached
13460 to the symbol name in the archive map.
13461 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13462 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13463 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13464 (ver_test_11.a): New target.
13465 * testsuite/Makefile.in: Rebuild.
13466
9201d894
ILT
13467 * configure.ac: Check for chsize and posix_fallocate. Replace
13468 ftruncate.
13469 * ftruncate.c: New file, from gnulib.
13470 * output.cc (posix_fallocate): Define dummy version if not
13471 HAVE_POSIX_FALLOCATE.
13472 (Output_file::map): Call posix_fallocate rather than lseek and
13473 write.
13474 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13475 * configure, Makefile.in, config.in: Rebuild.
13476
ef4ab7a8 134772009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13478
ef4ab7a8
PP
13479 * layout.h (Layout::create_note): Add section_name parameter.
13480 * layout.cc (Layout::create_note): Likewise.
13481 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13482
8c500701
ILT
134832009-03-17 Ian Lance Taylor <iant@google.com>
13484
e85b18e1
ILT
13485 * descriptors.cc: Include "options.h".
13486 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13487 (Descriptors::open): Always use O_CLOEXEC when opening a new
13488 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13489 then set FD_CLOEXEC.
13490
9efe6174
ILT
13491 * sparc.cc (class Target_sparc): Add has_got_section.
13492 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13493 make sure we have a GOT section.
13494
13495 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13496 (Target_sparc::Scan::local): Likewise.
13497 (Target_sparc::Scan::global): Likewise.
13498 (Target_sparc::Relocate::relocate): Likewise.
13499 (Target_sparc::Relocate::relocate_tls): Likewise.
13500
8c500701
ILT
13501 * symtab.cc (Symbol_table::define_default_version): New function,
13502 broken out of add_from_object.
13503 (Symbol_table::add_from_object): Call define_default_version.
13504 (Symbol_table::define_special_symbol): Add resolve_oldsym
13505 parameter. Change all callers. If the version for a symbol comes
13506 from a version script, resolve it with the symbol with the same
13507 name with no version. Also add the symbol without a version if
13508 appropriate.
13509 (do_define_in_output_data): If resolving with oldsym, don't delete
13510 sym.
13511 (do_define_in_output_segment): Likewise.
13512 (do_define_as_constant): Likewise.
13513 * symtab.h (class Symbol_table): Update declarations.
13514
f1ed28fb
ILT
135152009-03-13 Ian Lance Taylor <iant@google.com>
13516
15f8229b
ILT
13517 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13518 (Read_symbols::requeue): New function.
13519 (Read_symbols::do_read_symbols): If make_elf_object fails because
13520 the target type is not configured, and the file was searched for,
13521 issue a warning and retry with the next directory.
13522 (Add_symbols::run): If the file has an incompatible format, and
13523 it was searched for, requeue the Read_symbols task. On error,
13524 release the object.
13525 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13526 dirindex parameter to constructor. Change all callers. Declare
13527 incompatible_warning and requeue.
13528 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13529 input_argument_ and input_group_ fields. Add them to
13530 constructor. Change all callers.
13531 (class Read_script): Add dirindex_ field. Add it to constructor.
13532 Change all callers.
13533 * archive.cc (Archive::setup): Remove input_objects parameter.
13534 Change all callers.
13535 (Archive::get_file_and_offset): Likewise.
13536 (Archive::read_all_symbols): Likewise.
13537 (Archive::read_symbols): Likewise.
13538 (Archive::get_elf_object_for_member): Remove input_objects
13539 parameter. Add punconfigured parameter. Change all callers.
13540 (Archive::add_symbols): Change return type to bool. Check return
13541 value of include_member.
13542 (Archive::include_all_members): Likewise.
13543 (Archive::include_member): Change return type to bool. Return
13544 false if first included object has incompatible target. Set
13545 included_member_ field.
13546 (Add_archive_symbols::run): If add_symbols returns false, requeue
13547 Read_symbols task.
13548 * archive.h (class Archive): Add included_member_ field.
13549 Initialize it in constructor. Add input_file and searched_for
13550 methods. Update declarations.
13551 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13552 input_argument_ fields. Add them to constructor. Change all
13553 callers.
13554 * script.cc: Include "target-select.h".
13555 (class Parser_closure): Add skip_on_incompatible_target_ and
13556 found_incompatible_target_ fields. Add
13557 skip_on_incompatible_target parameter to constructor. Change all
13558 callers. Add methods skip_on_incompatible_target,
13559 clear_skip_on_incompatible_target, found_incompatible_target, and
13560 set_found_incompatible_target.
13561 (read_input_script): Add dirindex parameter. Change all callers.
13562 If parser finds an incompatible target, requeue Read_symbols
13563 task.
13564 (script_set_symbol): Clear skip_on_incompatible_target in
13565 closure.
13566 (script_add_assertion, script_parse_option): Likewise.
13567 (script_start_sections, script_add_phdr): Likewise.
13568 (script_check_output_format): New function.
13569 * script.h (read_input_script): Update declaration.
13570 * script-c.h (script_check_output_format): Declare.
13571 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13572 (ignore_cmd): Remove OUTPUT_FORMAT.
13573 * fileread.cc (Input_file::Input_file): Add explicit this.
13574 (Input_file::will_search_for): New function.
13575 (Input_file::open): Add pindex parameter. Change all callers.
13576 * fileread.h (class Input_file): Add input_file_argument method.
13577 Declare will_search_for. Update declarations.
13578 * object.cc (make_elf_object): Add punconfigured parameter.
13579 Change all callers.
13580 * object.h (class Object): Make input_file public. Add
13581 searched_for method.
13582 (make_elf_object): Update declaration.
13583 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13584 restart search.
13585 * dirsearch.h (class Dirsearch): Update declaration.
13586 * options.h (class General_options): Add --warn-search-mismatch.
13587 * parameters.cc (Parameters::is_compatible_target): New function.
13588 * parameters.h (class Parameters): Declare is_compatible_target.
13589 * workqueue.cc (Workqueue::add_blocker): New function.
13590 * workqueue.h (class Workqueue): Declare add_blocker.
13591
f1ed28fb
ILT
13592 * fileread.cc (Input_file::open): Remove options parameter.
13593 Change all callers.
13594 (Input_file::open_binary): Likewise.
13595 * script.cc (read_input_script): Likewise.
13596 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13597 options parameter from constructor. Change all callers.
13598 (class Read_script): Likewise.
13599 * fileread.h (class Input_file): Update declarations.
13600 * script.h (read_input_script): Update declaration.
13601
34dd024a
NC
136022009-03-10 Nick Clifton <nickc@redhat.com>
13603
13604 * po/es.po: New Spanish translation.
13605
6d71b17c
CC
136062009-03-06 Cary Coutant <ccoutant@google.com>
13607
13608 * options.cc (parse_short_option): Keep dash_z from registering itself.
13609
031cdbed
ILT
136102009-03-03 Ian Lance Taylor <iant@google.com>
13611
13612 PR 9918
13613 * target-reloc.h (relocate_section): Pass output_section to
13614 relocate.
13615 * i386.cc (Target_i386::should_apply_static_reloc): Add
13616 output_section parameter. Change all callers.
13617 (Target_i386::Relocate::relocate): Add output_section parameter.
13618 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13619 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13620 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13621 * testsuite/two_file_shared.sh: New script.
13622 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13623 (check_DATA): Add two_file_shared.dbg.
13624 (two_file_shared.dbg): New target.
13625 * testsuite/Makefile.in: Rebuild.
13626
15d5fa16
ILT
136272009-03-01 Ian Lance Taylor <iant@google.com>
13628
13629 * configure.ac: Check for byteswap.h.
13630 * configure: Rebuild.
13631 * config.in: Rebuild.
13632
8a4c0b0d
ILT
136332009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13634
13635 * layout.cc (Layout::find_or_add_kept_section): New function.
13636 (Layout::add_comdat): Removed.
13637 * layout.h (struct Kept_section): Move out of class Layout.
13638 Remove trailing underscores from field names. Add group_sections
13639 field. Rename group_ field to is_group. Change all uses.
13640 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13641 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13642 comdat_groups_ field.
13643 (Sized_relobj::include_section_group): Use
13644 find_or_add_kept_section and Kept_section::group_sections.
13645 (Sized_relobj::include_linkonce_section): Likewise.
13646 * object.cc (class Sized_relobj): Don't define Comdat_group or
13647 Comdat_group_table. Remove find_comdat_group and
13648 add_comdat_group. Remove comdat_groups_ field.
13649 * plugin.cc (include_comdat_group): Use
13650 Layout::find_or_add_kept_section.
13651
b4ecf66b
ILT
136522009-02-28 Ian Lance Taylor <iant@google.com>
13653
14359ca0
ILT
13654 * README: --gc-sections and map files are now supported. Document
13655 some build requirements.
13656
b4ecf66b
ILT
13657 PR 6992
13658 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13659 relocatable link set the value of the section symbol to zero.
13660 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13661 relocatable link don't include the section address in the local
13662 symbol value.
13663
0602e05a
ILT
136642009-02-27 Ian Lance Taylor <iant@google.com>
13665
fd9d194f
ILT
13666 PR 6811
13667 * options.h (class Search_directory): Add is_system_directory.
13668 (class General_options): Declare is_in_system_directory.
13669 * options.cc (get_relative_sysroot): Make static.
13670 (get_default_sysroot): Make static.
13671 (General_optoins::is_in_system_directory): New function.
13672 * fileread.cc (Input_file::is_in_system_directory): New function.
13673 * fileread.h (class Input_file): Declare is_in_system_directory.
13674 * object.h (class Object): Add is_in_system_directory.
13675 (class Input_objects): Remove system_library_directory_ field.
13676 * object.cc (Input_objects::add_object): Don't set
13677 system_library_directory_.
13678 (input_objects::found_in_system_library_directory): Remove.
13679 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13680 parameter. Change all callers.
13681 (Symbol_table::sized_write_globals): Likewise.
13682 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13683 Call Object::is_in_system_directory.
13684 * symtab.h (class Symbol_table): Update declarations.
13685
61edd21f
ILT
13686 PR 5990
13687 * descriptors.h (Open_descriptor): Add is_on_stack field.
13688 * descriptors.cc (Descriptors::open): If the descriptor is on the
13689 top of the stack, remove it. Initialize is_on_stack field.
13690 (Descriptors::release): Only add pod to stack if it is not on the
13691 stack already.
13692 (Descriptors::close_some_descriptor): Clear stack_next and
13693 is_on_stack fields.
13694
e29e076a
ILT
13695 PR 7091
13696 * output.cc (Output_section::find_starting_output_address): Rename
13697 from starting_output_address; add PADDR parameter; change return
13698 type.
13699 * output.h (class Output_section): Declare
13700 find_starting_output_address instead of starting_output_address.
13701 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13702 section symbol for which we can't find a merge section.
13703
0602e05a
ILT
13704 PR 9836
13705 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13706 hidden or internal, force the symbol to be local.
13707 * resolve.cc (Symbol::override_visibility): Define.
13708 (Symbol::override_base): Use override_visibility.
13709 (Symbol_table::resolve): Likewise.
13710 (Symbol::override_base_with_special): Likewise.
13711 (Symbol_table::override_with_special): If the visibility is hidden
13712 or internal, force the symbol to be local.
13713 * symtab.h (class Symbol): Add set_visibility and
13714 override_visibility.
13715 * testsuite/ver_test_1.sh: New file.
13716 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13717 (check_DATA): Add ver_test_1.syms.
13718 (ver_test_1.syms): New target.
13719 * testsuite/Makefile.in: Rebuild.
13720
401a9a73
CC
137212009-02-25 Cary Coutant <ccoutant@google.com>
13722
13723 * layout.cc (Layout::choose_output_section): Don't rename sections
13724 when using a linker script that has a SECTIONS clause.
13725 * Makefile.in: Regenerate.
13726
13727 * testsuite/Makefile.am (script_test_5.sh): New test case.
13728 * testsuite/Makefile.in: Regenerate.
13729 * testsuite/script_test_5.cc: New file.
13730 * testsuite/script_test_5.sh: New file.
13731 * testsuite/script_test_5.t: New file.
13732
f488e4b0
CC
137332009-02-13 Rafael Avila de Espindola <espindola@google.com>
13734
13735 * archive.cc (Archive::include_member): Update calls to add_symbols.
13736 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13737 the Layout argument.
13738 * dynobj.h (do_add_symbols): Add the Layout argument.
13739 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13740 Layout argument.
13741 * object.h (Object::add_symbols): Add the Layout argument.
13742 (Object::do_add_symbols): Add the Layout argument.
13743 (Sized_relobj::do_add_symbols): Add the Layout argument.
13744 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13745 Unify the two versions.
13746 (Add_plugin_symbols): Remove.
13747 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13748 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13749 (Add_plugin_symbols): Remove.
13750 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13751 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13752 (Add_symbols::run): Make it work with Pulginobj.
13753
89dd1680
ILT
137542009-02-06 Ian Lance Taylor <iant@google.com>
13755
13756 * object.cc (Sized_relobj::do_layout): Make info message start
13757 with lower case letter.
13758
266d0a74
ILT
137592009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13760
602b464e
ILT
13761 * binary.cc: Fix file comment.
13762
266d0a74
ILT
13763 * options.h (enum Incremental_disposition): Define.
13764 (class General_options): Add new options: --incremental,
13765 --incremental_changed, --incremental_unchanged,
13766 --incremental_unknown. Add incremental_disposition_ and
13767 implicit_incremental_ fields.
13768 (General_options::incremental_disposition): New function.
13769 (class Position_dependent_options): Add incremental_disposition
13770 option.
13771 (Position_dependent_options::copy_from_options): Set incremental
13772 dispositions.
13773 * options.cc (General_options::parse_incremental_changed): New
13774 function.
2e702c99
RM
13775 (General_options::parse_incremental_unchanged): New function.
13776 (General_options::parse_incremental_unknown): New function.
13777 (General_options::General_options): Initialize new fields
266d0a74 13778 incremental_disposition_ and implicit_incremental_.
2e702c99 13779 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13780 without --incremental.
13781
f073bbf7
CD
137822009-02-06 Chris Demetriou <cgd@google.com>
13783
13784 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13785 pointer and to report location as the file name associated with
13786 the symbol.
13787 (gold_undefined_symbol_at_location): New function to replace the
13788 old gold_undefined_symbol functionality.
13789 * target-reloc.h (relocate_section): Update to use
13790 gold_undefined_symbol_at_location.
13791 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13792 Call gold_undefined_symbol function rather than gold_error.
13793 * errors.h (Errors::undefined_symbol): Take location as a
13794 string, rather than calculating it from a relocation.
13795 * errors.cc (Errors::fatal): Print "fatal error:" before the
13796 formatted message.
13797 (Errors::error, Errors::error_at_location): Print "error: "
13798 before the formatted message.
13799 (Errors::undefined_symbol): Take location as a string, rather
13800 than calculating it from a relocation.
13801 (gold_undefined_symbol_at_location): New function akin to
13802 old gold_undefined_symbol, calculates location from relocation.
13803 (gold_undefined_symbol): Change to take only a Symbol pointer
13804 and to report location as the file name associated with the symbol.
13805 * testsuite/debug_msg.sh: Update for changed error messages.
13806 * testsuite/undef_symbol.sh: Likewise.
13807
8e94a90c
ILT
138082009-02-04 Duncan Sands <baldrick@free.fr>
13809
13810 PR 9812
13811 * reduced_debug_output.h
13812 (Output_reduced_debug_abbrev_section::failed): Use format for
13813 gold_warning.
13814 (Output_reduced_debug_info_section::faild): Likewise.
13815
88a0e15b
ILT
138162009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13817
13818 * script.cc (Lazy_demangler): New class.
2e702c99 13819 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13820 symbol only once.
13821
5efc7cd2
CC
138222009-01-29 Cary Coutant <ccoutant@google.com>
13823
13824 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13825 to __tls_get_addr.
13826 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13827
e0ebcf42
ILT
138282009-01-28 Ian Lance Taylor <iant@google.com>
13829
5efc7cd2 13830 * version.cc (version_string): Bump to 1.9.
75fe7426 13831
e0ebcf42
ILT
13832 * gold.h: Include <cstring> and <stdint.h>.
13833 * version.cc: Include <cstdio>.
13834 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13835 warning.
13836 * reduced_debug_output.cc (insert_into_vector): Rename from
13837 Insert_into_vector; change all callers. Use Swap_unaligned to
13838 avoid aliasing issue; remove union since it is unnecessary.
13839
8e2813be 138402009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13841
13842 * Makefile.am (CCFILES): Add gc.cc.
13843 (HFILES): Add gc.h.
13844 * Makefile.in: Regenerate.
13845 * gold.cc (Gc_runner): New class.
13846 (queue_initial_tasks): Call garbage collection related tasks
13847 when corresponding options are invoked.
13848 (queue_middle_gc_tasks): New function.
13849 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13850 processed early before laying out sections during garbage collection.
13851 * gold.h (queue_middle_gc_tasks): New function.
13852 (is_prefix_of): Move from "layout.cc".
13853 * i386.cc (Target_i386::gc_process_relocs): New function.
13854 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13855 * main.cc (main): Create object of class "Garbage_collection".
13856 * object.cc (Relobj::copy_symbols_data): New function.
13857 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13858 (Sized_relobj::do_layout): Allow this function to be called twice
13859 during garbage collection and defer layout of section during the
6d03d481
ST
13860 first call.
13861 * object.h (Relobj::get_symbols_data): New function.
13862 (Relobj::is_section_name_included): New function.
13863 (Relobj::copy_symbols_data): New function.
13864 (Relobj::set_symbols_data): New function.
13865 (Relobj::get_relocs_data): New function.
13866 (Relobj::set_relocs_data): New function.
13867 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13868 (Relobj::gc_process_relocs): New function.
13869 (Relobj::do_gc_process_relocs): New pure virtual function.
13870 (Relobj::sd_): New data member.
13871 (Sized_relobj::is_output_section_offset_invalid): New function.
13872 (Sized_relobj::do_gc_process_relocs): New function.
13873 * options.h (General_options::gc_sections): Modify to not be a no-op.
13874 (General_options::print_gc_sections): New option.
13875 * plugin.cc (Plugin_finish::run): Remove function call to
13876 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13877 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13878 * reloc.cc (Read_relocs::run): Add task to process relocs and
13879 determine unreferenced sections when doing garbage collection.
13880 (Gc_process_relocs): New class.
13881 (Sized_relobj::do_gc_process_relocs): New function.
13882 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13883 sections that are garbage collected.
13884 * reloc.h (Gc_process_relocs): New class.
13885 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13886 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13887 symbols whose corresponding sections are garbage collected.
13888 (Symbol_table::Symbol_table): Add new parameter for the garbage
13889 collection object.
13890 (Symbol_table::gc_mark_undef_symbols): New function.
13891 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13892 (Symbol_table::gc_mark_dyn_syms): New function.
13893 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13894 as garbage.
13895 (Symbol_table::add_from_object): Likewise.
13896 (Symbol_table::add_from_relobj): When building shared objects, do not
13897 treat externally visible symbols as garbage.
13898 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13899 table information for static and relocatable links.
13900 * symtab.h (Symbol_table::set_gc): New function.
13901 (Symbol_table::gc): New function.
13902 (Symbol_table::gc_mark_undef_symbols): New function.
13903 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13904 (Symbol_table::gc_mark_dyn_syms): New function.
13905 (Symbol_table::gc_): New data member.
e1df38aa 13906 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13907 function.
13908 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13909 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13910
3b293544
CF
139112009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13912
13913 * options.h (General_options::gc_sections): Define as a no-op for now.
13914 (General_options::no_keep_memory): Ditto.
13915 (General_options::Bshareable): Define.
13916 * options.cc (General_options::finalize): Honor -Bshareable.
13917
83d22aa8
AS
139182009-01-20 Andreas Schwab <schwab@suse.de>
13919
13920 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13921 read the value in the contents, since we don't use it. Use the
13922 template endianness when writing.
13923 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13924
cd536b21
AS
139252009-01-19 Andreas Schwab <schwab@suse.de>
13926
13927 * configure.tgt (powerpc64-*): Fix targ_obj.
13928
99e9a495
ILT
139292009-01-15 Ian Lance Taylor <iant@google.com>
13930
13931 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13932 local symbols when stripping all symbols.
13933
bbbfea06
CC
139342009-01-14 Cary Coutant <ccoutant@google.com>
13935
99e9a495 13936 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13937
0f7c0701
CC
139382009-01-14 Cary Coutant <ccoutant@google.com>
13939
13940 * archive.cc (Archive::get_elf_object_for_member): Remove call
13941 to File_read::claim_for_plugin.
13942 * descriptors.cc (Descriptors::open): Remove reference to
13943 is_claimed.
13944 (Descriptors::claim_for_plugin): Remove.
13945 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13946 (Descriptors::is_claimed): Remove.
13947 (claim_descriptor_for_plugin): Remove.
13948 * fileread.cc (File_read::claim_for_plugin): Remove.
13949 * fileread.h (File_read::claim_for_plugin): Remove.
13950 (File_read::descriptor): Reopen descriptor if necessary.
13951 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13952 (Plugin_manager::all_symbols_read): Add task parameter. Change
13953 all callers.
13954 (Plugin_manager::get_input_file): New function.
13955 (Plugin_manager::release_input_file): New function.
13956 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13957 corresponding data member.
13958 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13959 and pass to base constructor. Change all callers.
13960 (get_input_file, release_input_file): New functions.
13961 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13962 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13963 (Plugin_manager::all_symbols_read): Add task parameter.
13964 (Plugin_manager::get_input_file): New function.
13965 (Plugin_manager::release_input_file): New function.
13966 (Plugin_manager::task_): New data member.
13967 (Pluginobj::Pluginobj): Add filesize parameter.
13968 (Pluginobj::filename): New function.
13969 (Pluginobj::descriptor): New function.
13970 (Pluginobj::filesize): New function.
13971 (Pluginobj::filesize_): New data member.
13972 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13973 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13974 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13975
13976 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13977 with archive libraries.
13978 * testsuite/Makefile.in: Regenerate.
13979 * testsuite/plugin_test.c (struct sym_info): New type.
13980 (get_input_file, release_input_file): New static variables.
13981 (onload): Capture new transfer vector entries.
13982 (claim_file_hook): Stop reading at end of file according to filesize.
13983 Factor out parsing of readelf output into separate function.
13984 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13985 APIs and get the source file name from the symbol table. Convert
13986 source file name to corresponding object file name. Print info
13987 message when adding new input files.
13988 (parse_readelf_line): New function.
13989 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13990 * testsuite/plugin_test_2.sh: Likewise.
13991 * testsuite/plugin_test_3.sh: Likewise.
13992 * testsuite/plugin_test_4.sh: New test case.
13993
62a6d109
ILT
139942009-01-07 Ian Lance Taylor <iant@google.com>
13995
13996 * version.cc (version_string): Bump to 1.8.
13997
483620e8
CC
139982008-12-23 Cary Coutant <ccoutant@google.com>
13999
14000 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14001 * plugin.cc (Plugin_manager::finish): Rename as
14002 layout_deferred_objects. Move cleanup to separate function.
14003 (Plugin_manager::cleanup): New function.
14004 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14005 separately.
14006 * plugin.h (Plugin_manager::finish): Rename as
14007 layout_deferred_objects.
14008 (Plugin_manager::cleanup): New function.
14009 (Plugin_manager::cleanup_done): New field.
14010
d66a9eb3
CC
140112008-12-23 Cary Coutant <ccoutant@google.com>
14012
14013 * plugin.cc (is_visible_from_outside): New function.
14014 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14015 so we don't return "IR only" status for exported symbols or -r links.
14016
14017 * testsuite/Makefile.am (plugin_test_3): New test case.
14018 * testsuite/Makefile.in: Regenerate.
14019 * testsuite/plugin_test_3.sh: New file.
14020
5995b570
CC
140212008-12-22 Cary Coutant <ccoutant@google.com>
14022
14023 * object.cc (Sized_relobj::layout_section): New function.
14024 (Sized_relobj::do_layout): Defer layout of input sections until after
14025 plugin has provided replacement files.
14026 (Sized_relobj::do_layout_deferred_sections): New function.
14027 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14028 (Relobj::layout_deferred_sections): New function.
14029 (Relobj::do_layout_deferred_sections): New function.
14030 (Sized_relobj::do_layout_deferred_sections): New function.
14031 (Sized_relobj::layout_section): New function.
14032 (Sized_relobj::Deferred_layout): New structure.
14033 (Sized_relobj::deferred_layout_): New field.
14034 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14035 Change all callers. Layout deferred sections.
14036 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14037 references.
14038 (Plugin_hook::run): Move code from do_plugin_hook inline.
14039 (Plugin_hook::do_plugin_hook): Remove.
14040 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14041 (Plugin_manager::finish): Renamed, was cleanup.
14042 (Plugin_manager::should_defer_layout): New function.
14043 (Plugin_manager::add_deferred_layout_object): New function.
14044 (Plugin_manager::Deferred_layout_list): New type.
14045 (Plugin_manager::deferred_layout_objects_): New field.
14046 (Plugin_hook::do_plugin_hook): Remove.
14047
ee769c88
ILT
140482008-12-17 Ian Lance Taylor <iant@google.com>
14049
14050 * options.h (class General_options): Add --no case for
14051 --export-dynamic.
14052
abc8dcba
CC
140532008-12-16 Cary Coutant <ccoutant@google.com>
14054
14055 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14056 vector.
14057 (Plugin_manager::claim_file): Create plugin object even if
14058 plugin did not call the add_symbols callback.
14059 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14060 asking for more symbols than were added.
14061 * testsuite/Makefile.am (plugin_test_1): Add test case with
14062 no global symbols.
14063 (empty.syms): New target.
14064 * testsuite/Makefile.in: Regenerate.
14065 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14066 message. Don't call add_symbols if no globals.
14067 (all_symbols_read_hook): Don't provide replacement for empty
14068 claimed file.
14069
b0074644
ILT
140702008-12-12 Ian Lance Taylor <iant@google.com>
14071
68943102
ILT
14072 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14073 r_type == 0 for a local symbol with r_sym == 0.
14074 (scan_relocatable_relocs): Pass r_sym to
14075 local_non_section_strategy.
14076 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14077 r_sym parameter.
14078
b0074644
ILT
14079 * configure.ac: Update test for TLS descriptors: they are
14080 supported as of glibc 2.9.
14081 * configure: Rebuild.
14082
c2508178
ILT
140832008-12-11 Ian Lance Taylor <iant@google.com>
14084
14085 PR 7091
14086 * target-reloc.h (Default_scan_relocatable_relocs): For each
14087 function, map r_type == 0 to RELOC_DISCARD.
14088
2756a258
CC
140892008-12-10 Cary Coutant <ccoutant@google.com>
14090
14091 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14092 object to override a kept COMDAT group from a plugin object.
14093
bb6f53d3
ILT
140942008-12-09 Ian Lance Taylor <iant@google.com>
14095
fbc558e1
ILT
14096 PR 7088
14097 * yyscript.y (file_cmd): Handle INPUT.
14098
bb6f53d3
ILT
14099 * testsuite/initpri1.c: Change all declarations to be full
14100 prototypes by adding void, to avoid compiler warnings.
14101
4674ecfc
CC
141022008-12-05 Rafael Avila de Espindola <espindola@google.com>
14103
14104 * options.cc (General_options::parse_plugin_opt): New.
14105 (General_options::add_plugin): The argument now is just the filename.
14106 (General_options::add_plugin_option): New.
14107 * options.h (plugin_opt): New.
14108 (add_plugin): Change argument name.
14109 (add_plugin_option): New.
14110 * plugin.cc (Plugin::load): Don't parse the plugin option.
14111 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14112 (Plugin::add_option): New.
14113 (Plugin::args_): Change type.
14114 (Plugin::filename_): New.
14115 (Plugin_manager::add_plugin_option): New.
14116 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14117 * testsuite/Makefile.in: Regenerate.
14118
fd06b4aa
CC
141192008-12-05 Cary Coutant <ccoutant@google.com>
14120
14121 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14122 Handle --strip-lto-sections option.
14123 * options.h (strip_lto_sections): New option.
14124
6c52134c
CC
141252008-12-01 Cary Coutant <ccoutant@google.com>
14126
14127 * plugin.cc (ld_plugin_message): Change format parameter to const.
14128 Fix mismatch between new[] and delete.
14129
a45248e0
CC
141302008-11-14 Cary Coutant <ccoutant@google.com>
14131
14132 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14133 instead of -1U.
14134
c82fbeee
CS
141352008-11-05 Craig Silverstein <csilvers@google.com>
14136
14137 * options.cc (General_options::parse_dynamic_list): New function.
14138 * options.h (General_options): New flags dynamic_list,
14139 dynamic_list_data, dynamic_list_cpp_new, and
14140 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14141 (General_options::in_dynamic_list): New function.
14142 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14143 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14144 (Lex::can_continue_name): Likewise.
14145 (yylex): Likewise.
14146 (read_script_file): New parameter script_options.
14147 (read_dynamic_list): New function.
14148 (Script_options::define_dynamic_list): New function.
14149 (dynamic_list_keyword_parsecodes): New variable.
14150 (dynamic_list_keywords): New variable.
14151 * script.h (Script_options::define_dynamic_list): New function
14152 prototype.
14153 (read_dynamic_list): New function prototype.
14154 * symtab.cc (strprefix): New macro.
14155 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14156 dynamic_list_data, dynamic_list_cpp_new, and
14157 dynamic_list_cpp_typeinfo.
14158 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14159 (dynamic_list_expr): New rule.
14160 (dynamic_list_nodes): Likewise.
14161 (dynamic_list_node): Likewise.
14162 * testsuite/Makefile.am (dynamic_list): New test.
14163 * testsuite/Makefile.in: Regenerated.
14164 * testsuite/dynamic_list.t: New file.
14165 * testsuite/dynamic_list.sh: New file.
14166
e0bb29a5
CS
141672008-11-05 Craig Silverstein <csilvers@google.com>
14168
14169 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14170 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14171 (t11_last): Likewise.
14172 * testsuite/ver_test_6.c (main): Likewise.
14173
4e1e25e0
CC
141742008-10-07 Cary Coutant <ccoutant@google.com>
14175
14176 * options.c (General_options::finalize): Add check for -static and
14177 -shared.
14178 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14179 is not empty.
14180
92f03fcb
CC
141812008-10-02 Cary Coutant <ccoutant@google.com>
14182
14183 * plugin.cc (make_sized_plugin_object): Fix conditional
14184 compilation to work when not all targets are enabled.
14185
fbd8a257
CC
141862008-09-29 Cary Coutant <ccoutant@google.com>
14187
14188 * archive.cc (Archive::get_file_and_offset): Use filename instead
14189 of name to get library path.
14190 (Archive::include_member): Unlock external member of a thin archive.
14191
14192 * testsuite/Makefile.am (TEST_AR): New variable.
14193 (thin_archive_test_1): New test.
14194 (thin_archive_test_2): New test.
81636b3f
CC
14195 * testsuite/Makefile.in: Regenerate.
14196 * testsuite/thin_archive_main.cc: New file.
14197 * testsuite/thin_archive_test_1.cc: New file.
14198 * testsuite/thin_archive_test_2.cc: New file.
14199 * testsuite/thin_archive_test_3.cc: New file.
14200 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14201
eff45813
CC
142022008-09-29 Cary Coutant <ccoutant@google.com>
14203
14204 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14205 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14206 instead of -1U.
14207 (Sized_relobj::do_finalize_local_symbols): Likewise.
14208 (Sized_relobj::map_to_kept_section): Likewise.
14209 * object.h (Sized_relobj::invalid_address): New constant.
14210 (Sized_relobj::do_output_section_offset): Check for invalid_address
14211 and return -1ULL.
14212 * output.cc (Output_reloc::local_section_offset): Use constant
14213 invalid_address instead of -1U.
14214 (Output_reloc::get_address): Likewise.
14215 (Output_section::output_address): Change -1U to -1ULL.
14216 * output.h (Output_reloc::invalid_address): New constant.
14217 * reloc.cc (Sized_relobj::write_sections): Use constant
14218 invalid_address instead of -1U.
14219 (Sized_relobj::relocate_sections): Likewise.
14220 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14221 values for merge sections.
14222 * target-reloc.h (relocate_for_relocatable): Use constant
14223 invalid_address instead of -1U.
14224
89fc3421
CC
142252008-09-19 Cary Coutant <ccoutant@google.com>
14226
14227 Add plugin functionality for link-time optimization (LTO).
14228 * configure.ac (plugins): Add --enable-plugins option.
14229 * configure: Regenerate.
14230 * config.in: Regenerate.
14231 * Makefile.am (LIBDL): New variable.
14232 (CCFILES): Add plugin.cc.
14233 (HFILES): Add plugin.h.
14234 (ldadd_var): Add LIBDL.
14235 * Makefile.in: Regenerate.
14236
14237 * archive.cc: Include "plugin.h".
14238 (Archive::setup): Don't preread archive symbols when using a plugin.
14239 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14240 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14241 files.
14242 (Archive::include_member): Add symbols from plugin objects.
14243 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14244 * descriptors.cc (Descriptors::open): Check for file descriptors
14245 abandoned by plugins.
14246 (Descriptors::claim_for_plugin): New function.
14247 * descriptors.h (Descriptors::claim_for_plugin): New function.
14248 (Open_descriptor::is_claimed): New field.
14249 (claim_descriptor_for_plugin): New function.
14250 * fileread.cc (File_read::claim_for_plugin): New function.
14251 * fileread.h (File_read::claim_for_plugin): New function.
14252 (File_read::descriptor): New function.
14253 * gold.cc: Include "plugin.h".
14254 (queue_initial_tasks): Add task to call plugin hooks for generating
14255 new object files.
14256 * main.cc: Include "plugin.h".
14257 (main): Load plugin libraries.
14258 * object.h (Pluginobj): Declare.
14259 (Object::pluginobj): New function.
14260 (Object::do_pluginobj): New function.
14261 (Object::set_target): New function.
14262 * options.cc: Include "plugin.h".
14263 (General_options::parse_plugin): New function.
14264 (General_options::General_options): Initialize plugins_ field.
14265 (General_options::add_plugin): New function.
14266 * options.h (Plugin_manager): Declare.
14267 (General_options): Add --plugin option.
14268 (General_options::has_plugins): New function.
14269 (General_options::plugins): New function.
14270 (General_options::add_plugin): New function.
14271 (General_options::plugins_): New field.
14272 * plugin.cc: New file.
14273 * plugin.h: New file.
14274 * readsyms.cc: Include "plugin.h".
14275 (Read_symbols::do_read_symbols): Check for archive before checking
14276 for ELF file. Call plugin hooks to claim files.
14277 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14278 from a real object file; force override when processing replacement
14279 files.
14280 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14281 (Symbol::init_base_object): Likewise.
14282 (Symbol::init_base_output_data): Likewise.
14283 (Symbol::init_base_output_segment): Likewise.
14284 (Symbol::init_base_constant): Likewise.
14285 (Symbol::init_base_undefined): Likewise.
14286 (Symbol::output_section): Assert that object is not a plugin.
14287 (Symbol_table::add_from_pluginobj): New function.
14288 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14289 undefined.
14290 (Symbol_table::sized_write_globals): Likewise.
14291 (Symbol_table::add_from_pluginobj): Instantiate template.
14292 * symtab.h (Sized_pluginobj): Declare.
14293 (Symbol::in_real_elf): New function.
14294 (Symbol::set_in_real_elf): New function.
14295 (Symbol::in_real_elf_): New field.
14296 (Symbol_table::add_from_pluginobj): New function.
14297
14298 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14299 (LIBDL): New variable.
14300 (LDADD): Add LIBDL.
14301 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14302 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14303 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14304 (MOSTLYCLEANFILES): Likewise.
14305 * testsuite/Makefile.in: Regenerate.
14306 * testsuite/plugin_test.c: New file.
14307 * testsuite/plugin_test_1.sh: New file.
14308 * testsuite/plugin_test_2.sh: New file.
14309
de31bda5
ILT
143102008-09-16 Ian Lance Taylor <iant@google.com>
14311
9c2d0ef9
ILT
14312 * target-reloc.h (relocate_section): Check whether a symbol is
14313 defined by the ABI before reporting an undefined symbol error.
14314 * target.h (Target::is_defined_by_abi): Make parameter const.
14315 (Target::do_is_defined_by_abi): Likewise.
14316 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14317 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14318 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14319 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14320 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14321 * testsuite/Makefile.in: Rebuild.
14322
de31bda5
ILT
14323 * fileread.cc (make_view): Add casts to avoid warning.
14324
9fa33bee
AO
143252008-09-16 Alexandre Oliva <aoliva@redhat.com>
14326
14327 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14328 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14329
183fd0e3
AO
143302008-09-16 Alexandre Oliva <aoliva@redhat.com>
14331
14332 * options.h (General_options::output_is_executable): New.
14333 (General_options::output_is_pie): New.
14334 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14335 for shared libraries.
14336 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14337
7be8330a
CD
143382008-09-11 Chris Demetriou <cgd@google.com>
14339
14340 * options.h (origin): New -z option.
14341 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14342 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14343 in DT_FLAGS_1.
14344
a9caad02
CC
143452008-09-05 Cary Coutant <ccoutant@google.com>
14346
14347 * fileread.cc (File_read::make_view): Add check for attempt to map
14348 beyond end of file.
14349
ae6dce4d
CC
143502008-09-05 Cary Coutant <ccoutant@google.com>
14351
14352 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14353 explicit instantiations.
14354
d7ab2a47
KVH
143552008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14356
14357 PR gold/6858
14358 * options.cc (General_options::finalize): Allow undefined symbols
14359 in shlibs if linking -shared.
14360
14361 PR gold/6859
14362 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14363 symbols as not needing a dynsym entry.
14364
1e52a9c1
CS
143652008-08-20 Craig Silverstein <csilvers@google.com>
14366
14367 * fileread.cc (File_read::open): Do not lock the file unless it
14368 was successfully opened.
14369
d85c80a3
CC
143702008-08-14 Cary Coutant <ccoutant@google.com>
14371
14372 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14373 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14374 * testsuite/tls_test.cc (struct int128): 128-bit struct
14375 for testing TLS relocs with non-zero addend.
14376 (v12): New TLS variable.
14377 (t12): New test.
14378 (t_last): Add check for v12.
14379 * testsuite/tls_test.h (t12): New function.
14380 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14381
2d924fd9
ILT
143822008-08-13 Ian Lance Taylor <iant@google.com>
14383
14384 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14385 set tls_segment_ or relro_segment_.
14386 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14387 when appropriate.
14388 * output.h (Output_section::clear_is_relro): New function.
14389 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14390 sections specially even when output_data_ is empty.
14391 (Output_segment::maximum_alignment): When first section is relro,
14392 only force alignment for PT_LOAD segments.
14393 * script.cc (script_data_segment_align): New function.
14394 (script_data_segment_relro_end): New function.
14395 * script-c.h (script_data_segment_align): Declare.
14396 (script_data_segment_relro_end): Declare.
14397 * script-sections.h (class Script_sections): Declare
14398 data_segment_align and data_segment_relro_end. Add fields
14399 segment_align_index_ and saw_relro_end_.
14400 * script-sections.cc (class Sections_element): Add set_is_relro
14401 virtual function. Add new bool* parameter to place_orphan_here.
14402 Add get_output_section virtual function.
14403 (class Output_section_definition): Add set_is_relro. Add new
14404 bool* parameter to place_orphan_here. Add get_output_section.
14405 Add is_relro_ field.
14406 (Output_section_definition::Output_section_definition): Initialize
14407 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14408 and is_relro_ fields.
14409 (Output_section_definition::place_orphan_here): Add is_relro
14410 parameter.
14411 (Output_section_definition::set_section_addresses): Set relro for
14412 output section.
14413 (Output_section_definition::alternate_constraint): Likewise.
14414 (class Orphan_output_section): Add new bool* parameter to
14415 place_orphan_here. Add get_output_section.
14416 (Orphan_output_section::place_orphan_here): Add is_relro
14417 parameter.
14418 (Script_sections::Script_sections): Initialize
14419 data_segment_align_index_ and saw_relro_end_.
14420 (Script_sections::data_segment_align): New function.
14421 (Script_sections::data_segment_relro_end): New function.
14422 (Script_sections::place_orphan): Set or clear is_relro.
14423 (Script_sections::set_section_addresses): Force alignment of first
14424 TLS section.
14425 * yyscript.y (exp): Call script_data_segment_align and
14426 script_data_segment_relro_end.
14427 * testsuite/relro_script_test.t: New file.
14428 * testsuite/relro_test.cc (using_script): Declare.
14429 (t1, t2): Test using_script.
14430 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14431 (relro_script_test_SOURCES): Define.
14432 (relro_script_test_DEPENDENCIES): Define.
14433 (relro_script_test_LDFLAGS): Define.
14434 (relro_script_test_LDADD): Define.
14435 (relro_script_test.so): New target.
14436 * testsuite/Makefile.in: Rebuild.
14437
f827c9a9
CC
144382008-08-06 Cary Coutant <ccoutant@google.com>
14439
14440 * archive.cc (Archive::total_archives, Archive::total_members)
14441 (Archive::total_members_loaded): New variables.
14442 (Archive::setup): Add parameter. Add option to preread
14443 archive symbols.
14444 (Archive::read_armap): Add counter.
14445 (Archive::get_file_and_offset): New function.
14446 (Archive::get_elf_object_for_member): New function.
14447 (Archive::read_all_symbols): New function.
14448 (Archive::read_symbols): New function.
14449 (Archive::add_symbols): Add counters.
14450 (Archive::include_all_members): Use armap to find members if it's
14451 already built.
14452 (Archive::include_member): Skip reading symbols if already read.
14453 Factored code into Archive::get_file_and_offset and
14454 Archive::get_elf_object_for_member. Changed call to
14455 Mapfile::report_include_archive_member.
14456 (Archive::print_stats): New function.
14457 * archive.h: Declare Object and Read_symbols_data classes.
14458 (Archive::Archive): Add initializers for new members.
14459 (Archive::setup): Add parameter.
14460 (Archive::print_stats): New function.
14461 (Archive::total_archives, Archive::total_members)
14462 (Archive::total_members_loaded): New variables.
14463 (Archive::get_file_and_offset): New function.
14464 (Archive::get_elf_object_for_member): New function.
14465 (Archive::read_all_symbols): New function.
14466 (Archive::read_symbols): New function.
14467 (Archive::Archive_member): New class.
14468 (Archive::members_): New member.
14469 (Archive::num_members_): New member.
14470 * main.cc: Include archive.h.
14471 (main): Call Archive::print_stats.
14472 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14473 archive parameter; member_name is now the fully-decorated name.
14474 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14475 * options.h: (General_options): Add --preread-archive-symbols option.
14476 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14477 Archive::setup.
14478
de4c45bd
ILT
144792008-08-04 Ian Lance Taylor <iant@google.com>
14480
14481 * symtab.h (Symbol::use_plt_offset): New function.
14482 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14483 * powerpc.cc (Relocate::relocate): Likewise.
14484 * sparc.cc (Relocate::relocate): Likewise.
14485 * x86_64.cc (Relocate::relocate): Likewise.
14486 * testsuite/weak_plt.sh: New test.
14487 * testsuite/weak_plt_main.cc: New test.
14488 * testsuite/weak_plt_shared.cc: New test.
14489 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14490 (check_PROGRAMS): Add weak_plt.
14491 (check_DATA): Add weak_plt_shared.so.
14492 (weak_plt_main_pic.o, weak_plt): New targets.
14493 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14494 * testsuite/Makefile.in: Rebuild.
14495
14496 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14497 gcctestdir/ld.
14498 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14499 * testsuite/Makefile.in: Rebuild.
14500
323ee3f4
AM
145012008-08-04 Alan Modra <amodra@bigpond.net.au>
14502
14503 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14504 * Makefile.in: Regenerate.
14505 * po/POTFILES.in: Regenerate.
14506
7c07ecec
ILT
145072008-07-29 Ian Lance Taylor <iant@google.com>
14508
14509 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14510 symbols before other symbols.
14511 * testsuite/script_test_2.cc (test_addr): Declare.
14512 (test_addr_alias): Declare.
14513 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14514 values.
7c07ecec
ILT
14515 * testsuite/script_test_2.t: Define test_addr_alias and
14516 test_addr.
14517
5778530e
ILT
145182008-07-24 Ian Lance Taylor <iant@google.com>
14519
2a00e4fb
ILT
14520 PR 5990
14521 * descriptors.cc: New file.
14522 * descriptors.h: New file.
14523 * gold-threads.h (class Hold_optional_lock): New class.
14524 * fileread.cc: Include "descriptors.h".
14525 (File_read::~File_read): Release descriptor rather than closing
14526 it.
14527 (File_read::open) [file]: Call open_descriptor rather than open.
14528 Set is_descriptor_opened_.
14529 (File_read::open) [memory]: Assert that descriptor is not open.
14530 (File_read::reopen_descriptor): New function.
14531 (File_read::release): Release descriptor.
14532 (File_read::do_read): Make non-const. Reopen descriptor.
14533 (File_read::read): Make non-const.
14534 (File_read::make_view): Reopen descriptor.
14535 (File_read::do_readv): Likewise.
14536 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14537 Update declarations.
14538 * layout.cc: Include "descriptors.h".
14539 (Layout::create_build_id): Use open_descriptor rather than open.
14540 * output.cc: Include "descriptors.h".
14541 (Output_file::open): Use open_descriptor rather than open.
14542 * archive.cc (Archive::const_iterator): Change Archive to be
14543 non-const.
14544 (Archive::begin, Archive::end): Make non-const.
14545 (Archive::count_members): Likewise.
14546 * archive.h (class Archive): Update declarations.
14547 * object.h (Object::read): Make non-const.
14548 * Makefile.am (CCFILES): Add descriptors.cc.
14549 (HFILES): Add descriptors.h.
14550 * Makefile.in: Rebuild.
14551
801647d1
ILT
14552 PR 6716
14553 * gold.h: Always include <clocale>. Add Solaris workarounds
14554 following code in binutils/sysdep.h.
14555
5edd166e
ILT
14556 PR 6048
14557 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14558 this->eh_frame_hdr_ is NULL before using it.
14559
c89ad728
ILT
14560 * dynobj.cc (Versions::Versions): Update comment.
14561
aa86f06b
ILT
14562 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14563 the base version name.
14564
5778530e
ILT
14565 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14566 array size plus one.
14567 (Stringpool_template::set_string_offsets): Subtract one from key
14568 before using it as an array index.
14569 (Stringpool_template::get_offset_with_length): Likewise.
14570 (Stringpool_template::write_to_buffer): Likewise.
14571 * stringpool.h (Stringpool_template::get_offset_from_key):
14572 Likewise.
14573
057ead22
ILT
145742008-07-23 Ian Lance Taylor <iant@google.com>
14575
7f649c59
ILT
14576 PR 6658
14577 * object.h (Merged_symbol_value::value): Do our best to handle a
14578 negative addend.
14579
057ead22
ILT
14580 PR 6647
14581 * script.cc (Version_script_info::get_versions): Don't add empty
14582 version tag to return value.
14583 (Version_script_info::get_symbol_version_helper): Change return
14584 type to bool. Add pversion parameter. Change all callers.
14585 (script_register_vers_node): Don't require a non-NULL tag.
14586 * script.h (class Version_script_info): Update declarations.
14587 (Version_script_info::get_symbol_version): Change return type to
14588 bool. Add version parameter. Change all callers.
14589 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14590 handling. Handle an empty version from a version script.
14591 (Symbol_table::define_special_symbol): Likewise.
14592 * testsuite/ver_test_10.script: New file.
14593 * testsuite/ver_test_10.sh: New file.
14594 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14595 (check_DATA): Add ver_test_10.syms.
14596 (ver_test_10.syms, ver_test_10.so): New target.
14597 * testsuite/Makefile.in: Rebuild.
14598
58e54ac2
CD
145992008-07-23 Simon Baldwin <simonb@google.com>
14600
14601 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14602 to zero for undefined symbols from dynamic libraries.
14603
95d14cd3
ILT
146042008-07-23 Ian Lance Taylor <iant@google.com>
14605
14606 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14607 Change all callers.
14608 * symtab.h (class Symbol_table): Update declaration.
14609 * testsuite/ver_test_9.cc: New file.
14610 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14611 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14612 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14613 (ver_test_9.so, ver_test_9.o): New targets.
14614 * testsuite/Makefile.in: Rebuild.
14615
92de84a6
ILT
146162008-07-22 Ian Lance Taylor <iant@google.com>
14617
34810851
ILT
14618 * options.h (class General_options): Define --check-sections.
14619 * layout.cc (Layout::set_segment_offsets): Handle
14620 --check-sections.
14621
af6156ef
ILT
14622 * options.h (class General_options): Define -n/--nmagic and
14623 -N/--omagic.
14624 * options.cc (General_options::finalize): For -n/--nmagic or
14625 -N/--omagic, set -static.
14626 * layout.cc (Layout::attach_allocated_section_to_segment): If
14627 -N/--omagic, don't put read-only and read-write sections in
14628 different segments.
14629 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14630 finding a read-only segment.
14631 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14632 don't set the minimum segment alignment to the common page size,
14633 and don't set the file offset to the address modulo the page size.
14634 * script-sections.cc (Script_sections::create_segments): If
14635 -n/--omagic, don't put read-only and read-write sections in
14636 different segments.
14637
92de84a6
ILT
14638 * cref.cc: New file.
14639 * cref.h: New file.
14640 * options.h (class General_options): Add --print-symbol-counts.
14641 * main.cc (main): Issue defined symbol report if requested.
14642 * archive.cc (Archive::interpret_header): Make into a const member
14643 function.
14644 (Archive::add_symbols): Call Input_objects::archive_start and
14645 archive_stop.
14646 (Archive::const_iterator): Define new class.
14647 (Archive::begin, Archive::end): New functions.
14648 (Archive::include_all_members): Rewrite to use iterator.
14649 (Archive::count_members): New function.
14650 * archive.h (class Archive): Update declarations.
14651 (Archive::filename): New function.
14652 * object.cc: Include "cref.h".
14653 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14654 (Sized_relobj::do_get_global_symbol_counts): New function.
14655 (Input_objects::add_object): Add object to cross-referencer.
14656 (Input_objects::archive_start): New function.
14657 (Input_objects::archive_stop): New function.
14658 (Input_objects::print_symbol_counts): New function.
14659 * object.h: Declare Cref and Archive.
14660 (Object::get_global_symbol_counts): New function.
14661 (Object::do_get_global_symbol_counts): New pure virtual function.
14662 (class Sized_relobj): Add defined_count_ field. Update
14663 declarations.
14664 (class Input_objects): Add cref_ field. Update constructor.
14665 Update declarations.
14666 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14667 defined_count_.
14668 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14669 symbol counts.
14670 (Sized_dynobj::do_get_global_symbol_counts): New function.
14671 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14672 defined_count_. Update declarations. Define Symbols typedef.
14673 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14674 parameter. Change all callers.
14675 (Symbol_table::add_from_dynobj): Add sympointers and defined
14676 parameters. Change all callers.
14677 * symtab.h (class Symbol_table): Update declarations.
14678 * Makefile.am (CCFILES): Add cref.cc.
14679 (HFILES): Add cref.h.
14680 * Makefile.in: Rebuild.
14681
3f7c5e1d
CD
146822008-07-22 Simon Baldwin <simonb@google.com>
14683
14684 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14685 to zero when writing undefined symbols.
14686
e0b64032
ILT
146872008-07-22 Ian Lance Taylor <iant@google.com>
14688
14689 * output.cc (Output_section::add_input_section): Don't try to
14690 merge empty merge sections.
14691
096b02cf
CS
146922008-07-21 Craig Silverstein <csilvers@google.com>
14693
14694 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14695 Include symbol version in error message.
cd536b21 14696
1d1f116d
CD
146972008-07-20 Chris Demetriou <cgd@google.com>
14698
cd536b21 14699 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14700 (RANDOM_SEED_CFLAGS): New substituted variable.
14701 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14702 * configure: Rebuild.
14703 * Makefile.in: Likewise.
14704 * testsuite/Makefile.in: Likewise.
14705
a18f591e
ILT
147062008-07-18 Ian Lance Taylor <iant@google.com>
14707
14708 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14709 where we see NAME/NULL and NAME/VERSION as separate symbols.
14710 * testsuite/ver_test_main.cc (main): Call t4.
14711 (t4, t4_2a): Define.
14712 * testsuite/ver_test_2.cc (t4_2): Define.
14713 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14714 * testsuite/ver_test_4.cc (t4_2a): Define.
14715 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14716 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14717
c6e3f6ed
ILT
147182008-07-17 Ian Lance Taylor <iant@google.com>
14719
14720 * dynobj.cc (Versions::add_def): If we give an error about a
14721 missing version, go ahead and create the version anyhow.
14722
ef9beddf
ILT
147232008-07-10 Ian Lance Taylor <iant@google.com>
14724
14725 Handle output sections with more than 0x7fffffff bytes.
14726 * object.h (class Relobj): Change map_to_output_ to
14727 output_sections_, and just keep a section pointer. Change all
14728 uses. Move comdat group support to Sized_relobj.
14729 (Relobj::is_section_specially_mapped): Remove.
14730 (Relobj::output_section): Remove poff parameter. Change all
14731 callers.
14732 (Relobj::output_section_offset): New function.
14733 (Relobj::set_section_offset): Rewrite.
14734 (Relobj::map_to_output): Remove.
14735 (Relobj::output_sections): New function.
14736 (Relobj::do_output_section_offset): New pure virtual function.
14737 (Relobj::do_set_section_offset): Likewise.
14738 (class Sized_relobj): Add section_offsets_ field. Add comdat
14739 group support from Relobj. Update declarations.
14740 (Sized_relobj::get_output_section_offset): New function.
14741 (Sized_relobj::do_output_section_offset): New function.
14742 (Sized_relobj::do_set_section_offset): New function.
14743 * object.cc (Relobj::output_section_address): Remove.
14744 (Sized_relobj::Sized_relobj): Initialize new fields.
14745 (Sized_relobj::include_section_group): Cast find_kept_object to
14746 Sized_relobj.
14747 (Sized_relobj::include_linkonce_section): Likewise.
14748 (Sized_relobj::do_layout): Use separate arrays for output section
14749 and output offset.
14750 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14751 output_sections.
14752 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14753 output_sections and section_offsets.
14754 (Sized_relobj::write_local_symbols): Likewise.
14755 (map_to_kept_section): Compute output address directly.
14756 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14757 output_sections and section_offsets.
14758 (Sized_relobj::write_sections): Likewise.
14759 (Sized_relobj::relocate_sections): Likewise.
14760 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14761 * output.h (class Output_reloc): Update declarations. Change
14762 u2_.relobj to Sized_relobj*.
14763 (class Output_data_reloc): Change add functions to use
14764 Sized_relobj*.
14765 * output.cc (Output_reloc::Output_reloc): Change relobj to
14766 Sized_relobj*.
14767 (Output_reloc::local_section_offset): Change return type to
14768 Elf_Addr. Use get_output_section_offset.
14769 (Output_reloc::get_address): Likewise.
14770 (Output_section::is_input_address_mapped): Don't call
14771 is_section_specially_mapped.
14772 (Output_section::output_offset): Likewise.
14773 (Output_section::output_address): Likewise.
14774 (Output_section::starting_output_address): Likewise.
14775 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14776 parameter to Sized_relobj*.
14777 (Copy_relocs::need_copy_reloc): Likewise.
14778 (Copy_relocs::save): Likewise.
14779 * copy-relocs.h (class Copy_relocs): Update declarations.
14780 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14781 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14782 * target-reloc.h (relocate_for_relocatable): Change
14783 offset_in_output_section type to Elf_Addr. Change code that uses
14784 it as well.
14785 * layout.cc (Layout::layout): Always set *off.
14786 * mapfile.cc (Mapfile::print_input_section): Use
14787 output_section_offset.
14788 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14789 Sized_relobj*.
14790 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14791 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14792 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14793
5cb66f97
ILT
147942008-07-03 Ian Lance Taylor <iant@google.com>
14795
14796 * layout.cc (Layout::include_section): Do not discard unrecognized
14797 SHT_STRTAB sections.
14798
afe47622
CS
147992008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14800
14801 * script.cc (Lex::can_continue_name): Make '?' allowable in
14802 version-script names.
14803 * testsuite/version_script.map: Change glob pattern to use '?'
14804
5adf9721
ILT
148052008-06-30 Manish Singh <yosh@gimp.org>
14806
14807 PR 6585
14808 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14809 Correct typo.
14810
e6fde208
ILT
148112008-06-30 Ian Lance Taylor <iant@google.com>
14812
14813 PR 6660
14814 PR 6682
14815 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14816 versions]: Don't try to read the value in the contents, since we
14817 don't use it. Use the template endianness when writing.
14818
3f2e6a2d
CC
148192008-06-25 Cary Coutant <ccoutant@google.com>
14820
14821 * fileread.cc (File_read::make_view): Assert on zero-length view.
14822 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14823 symbol table when there are no symbols to read.
14824
c43d3a48
CS
148252008-06-23 Craig Silverstein <csilvers@google.com>
14826
14827 * version.cc (version_string): Bump to 1.7
14828
5f494ea0
CS
148292008-06-18 Craig Silverstein <csilvers@google.com>
14830
14831 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14832 constant 0xFFFF to type Valtype.
14833 (Powerpc_relocate_functions::rel16_ha): Likewise.
14834
c42e122e
ILT
148352008-06-17 Ian Lance Taylor <iant@google.com>
14836
f34787f8
ILT
14837 * output.h (Output_section::Input_section): Initialize p2align_ to
14838 zero for Output_section_data constructors.
14839 (Output_section::Input_section::addralign): If not an input
14840 section, return the alignment of the Output_section_data.
14841 * testsuite/copy_test.cc: New file.
14842 * testsuite/copy_test_1.cc: New file.
14843 * testsuite/copy_test_2.cc: New file.
14844 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14845 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14846 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14847 (copy_test_1_pic.o, copy_test_1.so): New targets.
14848 (copy_test_2_pic.o, copy_test_2.so): New targets.
14849 * testsuite/Makefile.in: Rebuild.
14850
c42e122e
ILT
14851 * script-sections.cc (Script_sections::place_orphan): Initialize
14852 local variable exact.
14853
ce3ac18a
DE
148542008-06-13 David Edelsohn <edelsohn@gnu.org>
14855
14856 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14857
42cacb20
DE
148582008-06-12 David Edelsohn <edelsohn@gnu.org>
14859 David S. Miller <davem@davemloft.net>
14860
14861 * powerpc.cc: New file.
14862 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14863 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14864 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14865 * Makefile.in: Rebuild.
14866
7b308235
ILT
148672008-06-09 Ian Lance Taylor <iant@google.com>
14868
14869 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14870 <exception>.
14871 (throwing, orig_terminate): New static variables.
14872 (terminate_handler): New static function.
14873 (t2): Set terminate handler.
14874
f0b886e3
ILT
148752008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14876
14877 PR 6584
cd536b21 14878 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14879 alignment.
14880
3e90f135
CC
148812008-05-30 Cary Coutant <ccoutant@google.com>
14882
14883 * archive.cc (Archive::include_all_members) Correct to step
14884 over symbol table and extended name table in thin archives.
14885
e09ad04a
ILT
148862008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14887
14888 PR 6407
14889 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14890 calculation.
14891
62b01cb5
ILT
148922008-05-28 Caleb Howe <cshowe@google.com>
14893
14894 * reduced_debug_output.cc: New file.
14895 * reduced_debug_output.h: New file.
92de84a6 14896 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14897 * options.cc (General_options::finalize): Add strip_debug_non_line
14898 to the strip heirarchy.
14899 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14900 fields.
14901 * layout.cc: Include "reduced_debug_output.h".
14902 (Layout::Layout): Initialize new fields.
14903 (line_only_debug_sections): New static array.
14904 (is_lines_only_debug_sections): New static inline function.
14905 (Layout::include_section): Handle --strip-debug-non-line.
14906 (Layout::make_output_section): If --strip-debug-non-line, build
14907 new output sections for .debug_abbrev and .debug_info.
14908 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14909 gold. Warn about possible overflow.
14910 (read_signed_LEB_128): Likewise.
14911 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14912 (read_signed_LEB_128): Declare.
14913 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14914 (HFILES): Add reduced_debug_output.h.
14915 * Makefile.in: Rebuild.
14916
7d9e3d98
ILT
149172008-05-21 Ian Lance Taylor <iant@google.com>
14918
14919 * mapfile.cc: New file.
14920 * mapfile.h: New file.
14921 * options.h (class General_options): Add -M/--print-map and -Map.
14922 * options.cc (General_options::finalize): Make -M equivalent to
14923 -Map -.
14924 * main.cc: Include <cstdio> and "mapfile.h".
14925 (main): Open mapfile if requested.
14926 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14927 constructor. Change caller.
14928 (queue_initial_tasks): Add mapfile parameter. Change caller.
14929 (queue_middle_tasks): Likewise.
14930 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14931 declarations.
14932 * archive.cc: Include "mapfile.h".
14933 (Archive::add_symbols): Add mapfile parameter. Change all
14934 callers. Pass mapfile, symbol, and reason to include_member.
14935 (Archive::include_all_members): Add mapfile parameter. Change all
14936 callers.
14937 (Archive::include_member): Add mapfile, sym, and why parameters.
14938 Change all callers. Report inclusion to map file.
14939 * archive.h: Include "fileread.h".
14940 (class Archive): Update declarations.
14941 (Archive::file): New const method.
14942 (class Add_archive_symbols): Add mapfile_ field. Update
14943 constructor. Change all callers.
14944 * readsyms.h (class Read_symbols): Likewise.
14945 (class Finish_group): Likewise.
14946 (class Read_script): Likewise.
14947 * common.cc: Include "mapfile.h".
14948 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14949 all callers.
14950 (Symbol_table::do_allocate_commons): Likewise.
14951 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14952 symbol allocation to mapfile.
14953 * common.h (class Allocate_commons_task): Add mapfile_ field.
14954 Update constructor. Change all callers.
14955 * symtab.h (class Symbol_table): Update declarations.
14956 * layout.cc: Include "mapfile.h".
14957 (Layout_task_runner::run): Print information to mapfile.
14958 (Layout::create_gold_note): Change Output_data_fixed_space to
14959 Output_data_zero_fill.
14960 (Layout::create_build_id): Likewise.
14961 (Layout::print_to_mapfile): New function.
14962 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14963 constructor. Change caller.
14964 (class Layout): Declare print_to_mapfile.
14965 * output.cc (Output_section::Input_section::print_to_mapfile): New
14966 function.
14967 (Output_section::add_input_section): If producing a map, always
14968 add to input_sections_ list.
14969 (Output_section::do_print_to_mapfile): New function.
14970 (Output_segment::print_sections_to_mapfile): New function.
14971 (Output_segment::print_section_list_to_mapfile): New function.
14972 * output.h: Include "mapfile.h".
14973 (Output_data::print_to_mapfile): New function.
14974 (Output_data::do_print_to_mapfile): New virtual function.
14975 (Output_segment_headers::do_print_to_mapfile): New function.
14976 (Output_file_header::do_print_to_mapfile): New function.
14977 (Output_data_const::do_print_to_mapfile): New function.
14978 (class Output_data_const_buffer): Add map_name_ field. Update
14979 constructor. Change all callers. Add do_print_to_mapfile
14980 function.
14981 (class Output_data_fixed_space): Likewise.
14982 (class Output_data_space): Likewise.
14983 (class Output_data_zero_fill): New class.
14984 (Output_data_strtab::do_print_to_mapfile): New function.
14985 (Output_data_reloc_base::do_print_to_mapfile): New function.
14986 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14987 (Output_data_group::do_print_to_mapfile): New function.
14988 (Output_data_got::do_print_to_mapfile): New function.
14989 (Output_data_dynamic::do_print_to_mapfile): New function.
14990 (Output_symtab_xindex::do_print_to_mapfile): New function.
14991 (class Output_section): Declare do_print_to_mapflie. Declare
14992 print_to_mapfile in Input_section.
14993 (class Output_segment): Declare new functions.
14994 * object.h (Sized_relobj::symbol_count): New function.
14995 * script-sections.cc
14996 (Output_section_element_dot_assignment::set_section_addresses):
14997 Change Output_data_fixed_space to Output_data_zero_fill.
14998 (Output_data_expression::do_print_to_mapfile): New function.
14999 * script.cc (read_input_script): Add mapfile parameter. Change
15000 all callers.
15001 * script.h (read_input_script): Update declaration.
15002 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15003 (Eh_frame::do_print_to_mapfile): New function.
15004 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15005 (Output_merge_string::do_print_to_mapfile): New function.
15006 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15007 function.
15008 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15009 function.
15010 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15011 function.
15012 * Makefile.am (CCFILES): Add mapfile.cc.
15013 (HFILES): Add mapfile.h.
15014 * Makefile.in: Rebuild.
15015
9f1d377b
ILT
150162008-05-19 Ian Lance Taylor <iant@google.com>
15017
15018 * options.h (class General_options): Add -z relro.
15019 * layout.cc (Layout::Layout): Initialize relro_segment_.
15020 (Layout::add_output_section_data): Return the output section.
15021 (Layout::make_output_section): Rcognize relro sections and mark
15022 them appropriately.
15023 (Layout::attach_allocated_section_to_segment): Put relro sections
15024 in a PT_GNU_RELRO segment.
15025 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15026 section as relro.
15027 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15028 PT_TLS segments.
15029 (Layout::linkonce_mapping): Map d.rel.ro.local to
15030 .data.rel.ro.local.
15031 (Layout::output_section_name): Us .data.rel.ro.local for any
15032 section which begins with that.
15033 * layout.h (class Layout): Update add_output_section_data
15034 declaration. Add relro_segment_ field.
15035 * output.cc (Output_section::Output_section): Initialize is_relro_
15036 and is_relro_local_ fields.
15037 (Output_segment::add_output_section): Group relro sections.
15038 (Output_segment::is_first_section_relro): New function.
15039 (Output_segment::maximum_alignment): If there is a relro section,
15040 align the segment to the common page size.
15041 (Output_segment::set_section_addresses): Track whether we are
15042 looking at relro sections. If the last section is a relro
15043 section, align to the common page size.
15044 (Output_segment::set_section_list_addresses): Add in_relro
15045 parameter. Change all callers. Align to the page size when
15046 moving from relro to non-relro section.
15047 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15048 segment.
15049 * output.h (class Output_section): Add is_relro_ and
15050 is_relro_local_ fields.
15051 (Output_section::is_relro): New function.
15052 (Output_section::set_is_relro): New function.
15053 (Output_section::is_relro_local): New function.
15054 (Output_section::set_is_relro_local): New function.
15055 (class Output_segment): Update declarations.
15056 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15057 * sparc.cc (Target_sparc::got_section): Likewise.
15058 * x86_64.cc (Target_x86_64::got_section): Likewise.
15059 * testsuite/relro_test_main.cc: New file.
15060 * testsuite/relro_test.cc: New file.
15061 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15062 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15063 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15064 (relro_test.so, relro_test_pic.o): New targets.
15065 * testsuite/Makefile.in: Rebuild.
15066
a984ee1d
ILT
150672008-05-16 Ian Lance Taylor <iant@google.com>
15068
01676dcd
ILT
15069 * output.cc (Output_segment::add_output_section): Remove front
15070 parameter.
15071 * output.h (class Output_segment): Remove
15072 add_initial_output_section and overloaded add_output_section.
15073 Update declaration of remaining add_output_section.
15074 * layout.cc (Layout::create_interp): Call add_output_section
15075 rather than add_initial_output_section.
15076 (Layout::finish_dynamic_section): Likewise.
15077
497897f9
ILT
15078 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15079 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15080 know the dynamic type.
15081 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15082 field. Initialize it in constructor.
15083 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15084 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15085 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15086 reloc.
15087
a984ee1d
ILT
15088 * output.cc (Output_reloc::get_address): Change return type to
15089 Elf_Addr.
15090 * output.h (class Output_reloc): Update get_address declaration.
15091 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15092 for section addresses.
15093
55ba0940
ILT
150942008-05-09 Ian Lance Taylor <iant@google.com>
15095
15096 PR 6493
15097 * gold.cc (gold_nomem): Use return value of write.
15098
75517b77
ILT
150992008-05-08 Ian Lance Taylor <iant@google.com>
15100
15101 * symtab.c (Symbol::init_base_output_data): Add version
15102 parameter. Change all callers.
15103 (Symbol::init_base_output_segment): Likewise.
15104 (Symbol::init_base_constant): Likewise.
15105 (Symbol::init_base_undefined): Likewise.
15106 (Sized_symbol::init_output_data): Likewise.
15107 (Sized_symbol::init_output_segment): Likewise.
15108 (Sized_symbol::init_constant): Likewise.
15109 (Sized_symbol::init_undefined): Likewise.
15110 (Symbol_table::do_define_in_output_data): If the new symbol has a
15111 version, mark it as the default.
15112 (Symbol_table::do_define_in_output_segment): Likewise.
15113 (Symbol_table::do_define_as_constant): Likewise.
15114 * symtab.h (class Symbol): Update declarations.
15115 (class Sized_symbol): Likewise.
15116 * resolve.cc (Symbol::override_version): New function.
c42e122e 15117 (Symbol::override_base): Call override_version.
75517b77
ILT
15118 (Symbol::override_base_with_special): Likewise.
15119 * testsuite/ver_script_8.script: New file.
15120 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15121 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15122 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15123 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15124
f1f70eae
ILT
151252008-05-06 Ian Lance Taylor <iant@google.com>
15126
f3e9c5c5
ILT
15127 PR 6049
15128 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15129 functions.
15130 (class General_options): Remove existing --undefined, and add
15131 --no-undefined instead. Add new --undefined as synonym for -u.
15132 * archive.cc (Archive::add_symbols): Check whether symbol was
15133 named with -u.
15134 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15135 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15136 all uses. Add IS_UNDEFINED. Update declarations to split
15137 different versions of init_base. Declare init_base_undefined.
15138 (Symbol::is_defined): Handle IS_UNDEFINED.
15139 (Symbol::is_undefined): Likewise.
15140 (Symbol::is_weak_undefined): Call is_undefined.
15141 (Symbol::is_absolute): Handle IS_CONSTANT.
15142 (class Sized_symbol): Update declarations to split different
15143 versions of init. Declare init_undefined.
15144 (class Symbol_table): Declare new functions.
15145 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15146 Change all callers.
15147 (Symbol::init_base_output_data): Likewise.
15148 (Symbol::init_base_output_segment): Likewise.
15149 (Symbol::init_base_constant): Likewise.
15150 (Symbol::init_base_undefined): New function.
15151 (Sized_symbol::init_object): Rename from init. Change all
15152 callers.
15153 (Sized_symbol::init_output_data): Likewise.
15154 (Sized_symbol::init_output_segment): Likewise.
15155 (Sized_symbol::init_constant): Likewise.
15156 (Sized_symbol::init_undefined): New function.
15157 (Symbol_table::add_undefined_symbols_from_command_line): New
15158 function.
15159 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15160 function.
15161 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15162 (Symbol::output_section): Likewise.
15163 (Symbol::set_output_section): Likewise.
15164 (Symbol_table::sized_finalize_symbol): Likewise.
15165 (Symbol_table::sized_write_globals): Likewise.
15166 * resolve.cc (Symbol_table::should_override): Likewise.
15167 (Symbol::override_base_with_special): Likewise.
15168
8bdcdf2c
ILT
15169 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15170 symbol, change it to have default visibility.
15171 * testsuite/protected_1.cc: New file.
15172 * testsuite/protected_2.cc: New file.
15173 * testsuite/protected_3.cc: New file.
15174 * testsuite/protected_main_1.cc: New file.
15175 * testsuite/protected_main_2.cc: New file.
15176 * testsuite/protected_main_3.cc: New file.
15177 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15178 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15179 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15180 (protected_1.so): New target.
15181 (protected_1_pic.o, protected_2_pic.o): New targets.
15182 (protected_3_pic.o): New target.
15183 (check_PROGRAMS): Add protected_2.
15184 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15185 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15186 * testsuite/Makefile.in: Rebuild.
15187
2b706932
ILT
15188 * options.h (DEFINE_var): Add set_user_set_##varname__.
15189 (DEFINE_bool_alias): New macro.
15190 (class General_options): Define -Bstatic using DEFINE_bool_alias
15191 rather than DEFINE_special. Add --undefined as an alias for -z
15192 defs.
15193 * options.cc (General_options::parse_Bstatic): Remove.
15194
d82a5bcc
ILT
15195 * options.h (class General_options): Add --fatal-warnings.
15196 * main.cc (main): Implement --fatal-warnings.
15197 * errors.h (Errors::warning_count): New function.
15198
f1f70eae
ILT
15199 * options.h (class General_options): Add -Bsymbolic-functions.
15200 * symtab.h (Symbol::is_preemptible): Check for
15201 -Bsymbolic-functions.
15202
8825ac63
ILT
152032008-05-05 Ian Lance Taylor <iant@google.com>
15204
d98bc257
ILT
15205 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15206 as noVARNAME rather than no-VARNAME.
15207 (class General_options): Add option -z combreloc.
15208 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15209 get_address.
15210 (Output_reloc::sort_before) [SHT_REL]: New function.
15211 (Output_reloc::sort_before) [SHT_RELA]: New function.
15212 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15213 Sort_relocs_comparison.
15214 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15215 parameter. Change all callers.
15216 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15217 sort_relocs parameter. Change all callers.
15218 * output.cc (Output_reloc::get_address): New function, broken out
15219 of write_rel.
15220 (Output_reloc::write_rel): Call it.
15221 (Output_reloc::compare): New function.
15222 (Output_data_reloc_base::do_write): Optionally sort relocs.
15223
60b2b4e7
ILT
15224 * configure.ac: If targ_extra_obj is set, link it in.
15225 * configure.tgt: Initialize all variables.
15226 (x86_64*): Set targ_extra_obj and targ_extra_size.
15227 * configure: Rebuild.
15228
8825ac63
ILT
15229 * object.cc (Sized_relobj::include_section_group): Adjust section
15230 indexes read from group data. Build vector to pass to
15231 layout_group.
15232 * layout.cc (Layout::layout_group): Add flags and shndxes
15233 parameters. Remove contents parameter. Change caller. Update
15234 explicit instantiations.
15235 * layout.h (class Layout): Update layout_group declaration.
15236 * output.cc (Output_data_group::Output_data_group): Add flags and
15237 input_shndxes parameters. Remove contents parameter. Change
15238 caller.
15239 (Output_data_group::do_write): Change input_sections_ to
15240 input_shndxes_.
15241 * output.h (class Output_data_group): Update constructor
15242 declaration. Rename input_sections_ to input_shndxes_.
15243 * testsuite/many_sections_test.cc: Add template.
15244
e94cf127
CC
152452008-04-30 Cary Coutant <ccoutant@google.com>
15246
4418b2d5
CC
15247 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15248
e94cf127
CC
15249 * layout.cc (Layout::include_section): Refactored check for debug
15250 info section.
15251 (Layout::add_comdat): Add new parameters. Change type
15252 of signature parameter. Add object and shndx to signatures table.
15253 (Layout::find_kept_object): New function.
15254 * layout.h: Include <cstring>.
15255 (Layout::is_debug_info_section): New function.
15256 (Layout::add_comdat): Add new parameters.
15257 (Layout::find_kept_object): New function.
15258 (Layout::Kept_section): New struct.
15259 (Layout::Signatures): Change type of map range.
15260 * object.cc (Relobj::output_section_address): New function.
15261 (Sized_relobj::include_section_group): Add new parameters. Change
15262 calls to Layout::add_comdat. Change to build table of kept comdat
15263 groups and table mapping discarded sections to kept sections.
15264 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15265 (Sized_relobj::do_layout): Change calls to include_section_group and
15266 include_linkonce_section.
15267 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15268 value to zero when section is discarded.
15269 (Sized_relobj::map_to_kept_section): New function.
15270 * object.h (Relobj::output_section_address): New function.
15271 (Relobj::Comdat_group): New type.
15272 (Relobj::find_comdat_group): New function.
15273 (Relobj::Comdat_group_table): New type.
15274 (Relobj::Kept_comdat_section): New type.
15275 (Relobj::Kept_comdat_section_table): New type.
15276 (Relobj::add_comdat_group): New function.
15277 (Relobj::set_kept_comdat_section): New function.
15278 (Relobj::get_kept_comdat_section): New function.
15279 (Relobj::comdat_groups_): New field.
15280 (Relobj::kept_comdat_sections_): New field.
15281 (Symbol_value::input_value): Update comment.
15282 (Sized_relobj::map_to_kept_section) New function.
15283 (Sized_relobj::include_linkonce_section): Add new parameter.
15284 * target-reloc.h (Comdat_behavior): New type.
15285 (get_comdat_behavior): New function.
15286 (relocate_section): Add code to map a discarded section to the
15287 corresponding kept section when applying a relocation.
15288
e4e5049b
CS
152892008-04-30 Craig Silverstein <csilvers@google.com>
15290
15291 * dwarf_reader.cc (next_generation_count): New static var.
15292 (Addr2line_cache_entry): New struct.
15293 (addr2line_cache): New static var.
15294 (Dwarf_line_info::one_addr2line): Added caching.
15295 (Dwarf_line_info::clear_addr2line_cache): New function.
15296 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15297 cache-size parameter.
15298 (Dwarf_line_info::one_addr2line_cache): New function.
15299 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15300 new cache-size argument to one_addr2line(), and clear cache.
15301
d09e9154
CC
153022008-04-28 Cary Coutant <ccoutant@google.com>
15303
15304 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15305 R_386_PC8 relocations.
15306
7ef73768
ILT
153072008-04-23 Ian Lance Taylor <iant@google.com>
15308
55438702
ILT
15309 * object.cc (Sized_relobj::include_section_group): Check for
15310 invalid section group.
15311
c165fb93
ILT
15312 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15313 header size.
15314
7ef73768
ILT
15315 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15316 than read for file header.
15317 * archive.cc (Archive::include_member): Likewise.
15318
6194aaab
L
153192008-04-23 Paolo Bonzini <bonzini@gnu.org>
15320
15321 * aclocal.m4: Regenerate.
15322 * configure: Regenerate.
15323
d491d34e
ILT
153242008-04-19 Ian Lance Taylor <iant@google.com>
15325
5ea2bac6
ILT
15326 * version.cc (version_string): Bump to 1.6.
15327
7bc3e21a
ILT
15328 * testsuite/Makefile.am (many_sections_r_test): New target.
15329 (many_sections_r_test_SOURCES): Remove.
15330 (many_sections_r_test_DEPENDENCIES): Remove.
15331 (many_sections_r_test_LDFLAGS): Remove.
15332 (many_sections_r_test_LDADD): Remove.
15333
7fcd3aa9
ILT
15334 * object.cc (Sized_relobj::do_add_symbols): Always pass
15335 local_symbol_count_ to add_from_relobj.
15336
4c94d6ae
ILT
15337 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15338 every thousand variables.
15339 * testsuite/Makefile.in: Rebuild.
15340
d491d34e
ILT
15341 * object.cc (Xindex::initialize_symtab_xindex): New function.
15342 (Xindex::read_symtab_xindex): New function.
15343 (Xindex::sym_xindex_to_shndx): New function.
15344 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15345 available.
15346 (Sized_relobj::do_initialize_xindex): New function.
15347 (Sized_relobj::do_read_symbols): Adjust section links.
15348 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15349 parameter. Change all callers.
15350 (Sized_relobj::include_section_group): Adjust section links and
15351 symbol section indexes.
15352 (Sized_relobj::do_layout): Adjust section links.
15353 (Sized_relobj::do_count_local_symbols): Adjust section links and
15354 symbol section indexes.
15355 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15356 ordinary and special symbols.
15357 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15358 dynsym_xindex parameters. Change all callers. Adjust section
15359 links. Use SHN_XINDEX when needed.
15360 (Sized_relobj::get_symbol_location_info): Adjust section links.
15361 Don't get fooled by special symbols.
15362 * object.h (class Xindex): Define.
15363 (class Object): Add xindex_ parameter. Declare virtual functoin
15364 do_initialize_xindex.
15365 (Object::adjust_sym_shndx): New function.
15366 (Object::set_xindex): New protected function.
15367 (class Symbol_value): Add is_ordinary_shndx_ field.
15368 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15369 (Symbol_value::value): Assert ordinary section.
15370 (Symbol_value::initialize_input_to_output_map): Likewise.
15371 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15372 Change all callers.
15373 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15374 all callers.
15375 (class Sized_relobj): Update declarations.
15376 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15377 parameter. Change all callers.
15378 (Sized_relobj::adjust_shndx): New function.
15379 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15380 field.
15381 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15382 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15383 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15384 (Sized_dynobj::read_dynsym_section): Adjust section links.
15385 (Sized_dynobj::read_dynamic): Likewise.
15386 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15387 section links.
15388 (Sized_dynobj::do_initialize_xindex): New function.
15389 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15390 do_initialize_xindex.
15391 (Sized_dynobj::adjust_shndx): New function.
15392 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15393 dynsym_xindex_ fields.
15394 (Layout::finalize): Add a call to set_section_indexes before
15395 creating the symtab sections.
15396 (Layout::set_section_indexes): Don't do anything if the section
15397 already has a section index.
15398 (Layout::create_symtab_sections): Add shnum parameter. Change
15399 caller. Create .symtab_shndx section if needed.
15400 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15401 caller.
15402 (Layout::allocated_output_section_count): New function.
15403 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15404 needed.
15405 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15406 fields. Update declarations.
15407 (Layout::symtab_xindex): New function.
15408 (Layout::dynsym_xindex): New function.
15409 (class Write_symbols_task): Add layout_ field.
15410 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15411 Change caller.
15412 * output.cc (Output_section_headers::Output_section_headers): Add
15413 shstrtab_section parameter. Change all callers.
15414 (Output_section_headers::do_sized_write): Store overflow values
15415 for section count and section string table section index in
15416 section header zero.
15417 (Output_file_header::do_sized_write): Check for overflow of
15418 section count and section string table section index.
15419 (Output_symtab_xindex::do_write): New function.
15420 (Output_symtab_xindex::endian_do_write): New function.
15421 * output.h (class Output_section_headers): Add shstrtab_section_.
15422 Update declarations.
15423 (class Output_symtab_xindex): Define.
15424 (Output_section::has_out_shndx): New function.
15425 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15426 field.
15427 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15428 Change all callers.
15429 (Sized_symbol::init): Likewise.
15430 (Symbol::output_section): Check for ordinary symbol.
15431 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15432 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15433 callers.
15434 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15435 Change all callers. Simplify handling of symbols from sections
15436 not included in the link.
15437 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15438 distinction.
15439 (Weak_alias_sorter::operator()): Assert that symbols are
15440 ordinary.
15441 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15442 distinction.
15443 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15444 parameters. Change all callers.
15445 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15446 symbol distinction. Use SHN_XINDEX when needed.
15447 (Symbol_table::write_section_symbol): Add symtab_xindex
15448 parameter. Change all callers.
15449 (Symbol_table::sized_write_section_symbol): Likewise. Use
15450 SHN_XINDEX when needed.
15451 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15452 declarations.
15453 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15454 (Symbol::is_defined): Check is_ordinary.
15455 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15456 (Symbol::is_absolute, Symbol::is_common): Likewise.
15457 (class Sized_symbol): Update declarations.
15458 (class Symbol_table): Update declarations.
15459 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15460 parameters. Change all callers.
15461 (Sized_symbol::override): Likewise.
15462 (Symbol_table::override): Likewise.
15463 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15464 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15465 is_ordinary, and orig_st_shndx parameters. Change all callers.
15466 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15467 to be in an ordinary section.
15468 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15469 object and is_ordinary parameters. Change all callers.
15470 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15471 Change all callers. Don't add undefined or non-ordinary symbols
15472 to reloc_map_.
15473 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15474 Change all callers.
15475 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15476 declarations.
15477 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15478 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15479 (Sized_relobj::relocate_sections): Likewise.
15480 * target-reloc.h (scan_relocs): Adjust section symbol index.
15481 (scan_relocatable_relocs): Likewise.
15482 * i386.cc (Scan::local): Check for ordinary symbols.
15483 * sparc.cc (Scan::local): Likewise.
15484 * x86_64.cc (Scan::local): Likewise.
15485 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15486 to symbol_section_and_value.
15487 * testsuite/many_sections_test.cc: New file.
15488 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15489 (check_PROGRAMS): Add many_sections_test.
15490 (many_sections_test_SOURCES): Define.
15491 (many_sections_test_DEPENDENCIES): Define.
15492 (many_sections_test_LDFLAGS): Define.
15493 (BUILT_SOURCES): Add many_sections_define.h.
15494 (many_sections_define.h): New target.
15495 (BUILT_SOURCES): Add many_sections_check.h.
15496 (many_sections_check.h): New target.
15497 (check_PROGRAMS): Add many_sections_r_test.
15498 (many_sections_r_test_SOURCES): Define.
15499 (many_sections_r_test_DEPENDENCIES): Define.
15500 (many_sections_r_test_LDFLAGS): Define.
15501 (many_sections_r_test_LDADD): Define.
15502 (many_sections_r_test.o): New target.
15503 * testsuite/Makefile.in: Rebuild.
15504
c5818ff1
CC
155052008-04-17 Cary Coutant <ccoutant@google.com>
15506
15507 * errors.cc (Errors::info): New function.
15508 (gold_info): New function.
15509 * errors.h (Errors::info): New function.
15510 * gold.h (gold_info): New function.
15511 * object.cc (Input_objects::add_object): Print trace output.
15512 * options.cc (options::parse_set): New function.
15513 (General_options::parse_wrap): Deleted.
15514 (General_options::General_options): Deleted initializer.
15515 * options.h (options::String_set): New typedef.
15516 (options::parse_set): New function.
15517 (DEFINE_set): New macro.
15518 (General_options::wrap): Changed to use DEFINE_set. Changed
15519 callers of any_wrap_symbols and is_wrap_symbol.
15520 (General_options::trace, General_options::trace_symbol):
15521 New options.
15522 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15523 (General_options::wrap_symbols_): Deleted.
15524 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15525
b5be4a7c
DM
155262008-04-17 David S. Miller <davem@davemloft.net>
15527
15528 * options.cc (General_options::parse_V): New function.
15529 * options.h: Add entries for -V and -Qy.
15530
155a0dd7
ILT
155312008-04-17 Ian Lance Taylor <iant@google.com>
15532
15533 * common.cc (Symbol_table::allocate_commons): Remove options
15534 parameter. Change caller.
15535 (Symbol_table::do_allocate_commons): Remove options parameter.
15536 Change caller. Just call do_allocate_commons_list twice.
15537 (Symbol_table::do_allocate_commons_list): New function, broken out
15538 of do_allocate_commons.
15539 * common.h (class Allocate_commons_task): Remove options_ field.
15540 Update constructor.
15541 * symtab.cc (Symbol_table::Symbol_table): Initialize
15542 tls_commons_.
15543 (Symbol_table::add_from_object): Put TLS common symbols on
15544 tls_commons_ list.
15545 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15546 which are IN_OUTPUT_DATA.
15547 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15548 allocate_commons and do_allocate_commons declarations. Declare
15549 do_allocate_commons_list.
15550 * gold.cc (queue_middle_tasks): Update creation of
15551 Allocate_commons_task to not pass options.
15552 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15553 (TLS_TEST_C_FLAGS): New variable.
15554 (tls_test_c_pic.o): New target.
15555 (tls_test_shared.so): Link in tls_test_c_pic.o.
15556 (tls_test_c_pic_ie.o): New target.
15557 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15558 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15559 (tls_test_c.o): New target.
15560 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15561 (tls_pic_test_LDADD): Likewise.
15562 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15563 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15564 (tls_test_c_gnu2.o): New target.
15565 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15566 tls_test_c_gnu2.o.
15567 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15568 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15569 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15570 * testsuite/tls_test.cc: Include "config.h".
15571 (t_last): Call t11_last.
15572 * testsuite/tls_test.h (t11, t11_last): Declare.
15573 * testsuite/tls_test_c.c: New file.
15574 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15575 * configure.ac: Check for OpenMP support.
15576 * configure, config.in, Makefile.in: Rebuild.
15577 * testsuite/Makefile.in: Rebuild.
15578
edfbb029
CC
155792008-04-16 Cary Coutant <ccoutant@google.com>
15580
15581 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15582 (Target_i386::tls_base_symbol_defined_): New field.
15583 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15584 (Target_i386::Scan::global): Likewise.
15585 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15586 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15587 (Target_x86_64::tls_base_symbol_defined_): New field.
15588 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15589 (Target_x86_64::Scan::global): Likewise.
15590
f3c69fca
CC
155912008-04-16 Cary Coutant <ccoutant@google.com>
15592
15593 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15594 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15595 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15596 building shared libraries.
15597 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15598 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15599 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15600 * testsuite/Makefile.in: Rebuild.
15601 * testsuite/weak_undef.h: New file.
15602 * testsuite/weak_undef_file1.cc: Add extra test cases.
15603 * testsuite/weak_undef_file2.cc: Likewise.
15604 * testsuite/weak_undef_test.cc: Likewise.
15605
7c414435
DM
156062008-04-16 David S. Miller <davem@davemloft.net>
15607
32b769e1
DM
15608 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15609 Add issued_non_pic_error_ field. Declare check_non_pic.
15610 (Target_sparc::Scan::check_non_pic): New function.
15611 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15612 (Target_sparc::Scan::global): Likewise.
15613
11936fb1
DM
15614 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15615 * configure: Rebuild.
15616
7c414435
DM
15617 * options.h (DEFINE_enable): New macro.
15618 (new_dtags): New enable option.
15619 (initfirst, interpose, loadfltr, nodefaultlib,
15620 nodelete, nodlopen, nodump): New -z options.
15621 * layout.cc (Layout:finish_dynamic_section): If new
15622 dtags enabled, emit DT_RUNPATH. Also, emit a
15623 DT_FLAGS_1 containing any specified -z flags.
15624
85c7bf8b
ILT
156252008-04-16 Ian Lance Taylor <iant@google.com>
15626
12c0daef
ILT
15627 * copy-relocs.cc: New file.
15628 * copy-relocs.h: New file.
15629 * reloc.cc: Remove Copy_relocs code.
15630 * reloc.h: Likewise.
15631 * reloc-types.h (struct Reloc_types) [both versions]: Add
15632 get_reloc_addend_noerror.
15633 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15634 variants of add_global which take an addend which must be zero.
15635 * i386.cc: Include "copy-relocs.h".
15636 (class Target_i386): Change type of copy_relocs_ to variable,
15637 update initializer.
15638 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15639 Change all callers.
15640 (Target_i386::do_finalize_sections): Change handling of
15641 copy_relocs_.
15642 * sparc.cc: Include "copy-relocs.h".
15643 (class Target_sparc): Change type of copy_relocs_ to variable,
15644 update initializer.
15645 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15646 Change all callers.
15647 (Target_sparc::do_finalize_sections): Change handling of
15648 copy_relocs_.
15649 * x86_64.cc: Include "copy-relocs.h".
15650 (class Target_x86_64): Change type of copy_relocs_ to variable,
15651 update initializer.
15652 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15653 class. Change all callers.
15654 (Target_x86_64::do_finalize_sections): Change handling of
15655 copy_relocs_.
15656 * Makefile.am (CCFILES): Add copy-relocs.cc.
15657 (HFILES): Add copy-relocs.h.
15658
4f4995b6
ILT
15659 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15660
85c7bf8b
ILT
15661 * testsuite/script_test_4.sh: Permit leading zeroes.
15662
4f2a9edd
ILT
156632008-04-15 Ian Lance Taylor <iant@google.com>
15664
e6188289
ILT
15665 * script-sections.cc (Script_sections::create_segments): Use
15666 header_size_adjustment even when there is enough room for the
15667 headers.
15668 * testsuite/script_test_4.sh: New file.
15669 * testsuite/script_test_4.t: New file.
15670 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15671 (check_DATA): Add script_test_4.stdout.
15672 (MOSTLYCLEANFILES): Likewise.
15673 (script_test_4): New target.
15674 (script_test_4.stdout): New target.
15675 * testsuite/Makefile.in: Rebuild.
15676
4f2a9edd
ILT
15677 * sparc.cc: Add definitions for Output_data_plt_sparc class
15678 constants.
15679
f5314dd5
DM
156802008-04-14 David S. Miller <davem@davemloft.net>
15681
15682 * sparc.cc: New file.
15683 * Makefile.am (TARGETSOURCES): Add sparc.cc
15684 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15685 * configure.tgt: Document targ_extra_size and
15686 targ_extra_big_endian. Add entries for sparc-* and
15687 sparc64-*.
15688 * configure.ac: Handle targ_extra_size and
15689 targ_extra_big_endian.
15690 * Makefile.in: Rebuild.
15691 * configure: Likewise.
15692 * po/POTFILES.in: Likewise.
15693 * po/gold.pot: Likewise.
15694
154e0e9a
ILT
156952008-04-14 Ian Lance Taylor <iant@google.com>
15696
15697 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15698 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15699 in the name/type/flags to section mapping. Don't call
15700 allocate_output_section.
15701 (Layout::choose_output_section): Change parameter from adjust_name
15702 to is_input_section. Don't permit input sections after sections
15703 are attached to segments. Don't call allocate_output_section.
15704 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15705 not write_enable_output_section.
15706 (Layout::make_output_section): Don't push to
15707 unattached_section_list_ nor call attach_to_segment. Call
15708 attach_section_to_segment if sections are attached.
15709 (Layout::attach_sections_to_segments): New function.
15710 (Layout::attach_section_to_segment): New function.
15711 (Layout::attach_allocated_section_to_segment): Rename from
15712 attach_to_segment. Remove flags parameter.
15713 (Layout::allocate_output_section): Remove function.
15714 (Layout::write_enable_output_section): Remove function.
15715 * layout.h (class Layout): Update for above changes. Add new
15716 field sections_are_attached_.
15717 * output.h (Output_section::update_flags_for_input_section): New
15718 function.
15719 * output.cc (Output_section::add_input_section): Call
15720 update_flags_for_input_section.
15721 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15722
009a67a2
CC
157232008-04-11 Cary Coutant <ccoutant@google.com>
15724
15725 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15726 thought unnecessary.
15727 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15728
759b1a24
ILT
157292008-04-11 Ian Lance Taylor <iant@google.com>
15730
15731 * output.h (class Output_section_data): Remove inline definition
15732 of set_addralign.
15733 * output.cc (Output_section_data::set_addralign): New function.
15734
c2b45e22
CC
157352008-04-11 Cary Coutant <ccoutant@google.com>
15736
15737 Add support for TLS descriptors for i386 and x86_64.
15738 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15739 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15740 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15741 GOT_TYPE_TLS_DESC.
15742 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15743 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15744 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15745 relocations.
15746 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15747 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15748 Fix problem with initial-exec relocations.
15749 (Target_i386::Relocate::relocate_tls): Likewise.
15750 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15751 relaxation.
15752 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15753 support for section-plus-offset dynamic table entries.
15754 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15755 (Output_data_dynamic::Dynamic_entry): Add support for
15756 section-plus-offset dynamic table entries.
15757 (Output_data_dynamic::Classification): Likewise.
15758 (Output_data_dynamic::classification_): Renamed offset_.
15759 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15760 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15761 (Target_x86_64::make_plt_section): New function.
15762 (Target_x86_64::reserve_tlsdesc_entries): New function.
15763 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15764 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15765 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15766 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15767 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15768 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15769 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15770 add extra PLT entry for TLS descriptors.
15771 (Output_data_plt_x86_64::got_): New field.
15772 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15773 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15774 fields.
15775 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15776 descriptors.
15777 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15778 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15779 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15780 R_386_TLS_DESC_CALL relocations.
15781 (Target_x86_64::Scan::global): Likewise.
15782 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15783 for TLS descriptors.
15784 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15785 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15786 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15787 GD-to-IE relaxation.
15788 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15789 and TLS_DESCRIPTORS.
15790 * Makefile.in: Rebuild.
15791 * configure: Rebuild.
15792 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15793 (tls_test_shared2.so): New target.
15794 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15795 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15796 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15797 (tls_shared_gd_to_ie_test_LDADD): New variable.
15798 (tls_shared_gnu2_gd_to_ie_test): New target.
15799 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15800 New targets.
15801 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15802 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15803 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15804 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15805 (tls_shared_gnu2_test): New target.
15806 (tls_test_gnu2_shared.so): New target.
15807 (tls_shared_gnu2_test_SOURCES): New variable.
15808 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15809 (tls_shared_gnu2_test_LDFLAGS): New variable.
15810 (tls_shared_gnu2_test_LDADD): New variable.
15811 * testsuite/Makefile.in: Rebuild.
15812 * testsuite/Makefile.
15813
83bfb6b7
ILT
158142008-04-11 Ian Lance Taylor <iant@google.com>
15815
15816 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15817 justsyms.t.
15818 * testsuite/Makefile.in: Rebuild.
15819
15820 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15821 long.
15822 * testsuite/script_test_2.cc (main): Adjust test.
15823
706e1f5e
ILT
158242008-04-11 David S. Miller <davem@davemloft.net>
15825 Ian Lance Taylor <iant@google.com>
15826
15827 * options.h (General_options): Add entries for '-Y' and
15828 '-relax'.
15829 * options.cc (General_options:finalize): If -Y was used, add those
15830 entries to the library path instead of the default "/lib" and
15831 "/usr/lib".
15832
7c98e6bb
DM
158332008-04-11 David S. Miller <davem@davemloft.net>
15834
15835 * testsuite/justsyms.t: Start at 0x100.
15836 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15837 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15838 long.
15839 * testsuite/script_test_2.cc: Adjust string and section length
15840 checks.
7c98e6bb 15841
99a37bfd
ILT
158422008-04-09 Ian Lance Taylor <iant@google.com>
15843
2cefc357
ILT
15844 PR gold/5996
15845 * script-sections.cc (Sections_element::allocate_to_segment): Add
15846 orphan parameter.
15847 (Output_section_definition::allocate_to_segment): Likewise.
15848 (Orphan_output_section::allocate_to_segment): Likewise.
15849 (Script_sections::attach_sections_using_phdrs_clause): Don't
15850 propagate non-PT_LOAD segments to orphan sections.
15851 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15852 readelf rather than objdump.
15853 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15854 .interp section and PT_INTERP segment are the same size.
15855 * testsuite/Makefile.in: Rebuild.
15856
99a37bfd
ILT
15857 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15858 aliases for symbols defined in the same object.
15859 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15860 (weak_alias_test_SOURCES): New variable.
15861 (weak_alias_test_DEPENDENCIES): New variable.
15862 (weak_alias_test_LDFLAGS): New variable.
15863 (weak_alias_test_LDADD): New variable.
15864 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15865 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15866 (weak_alias_test_3.o): New target.
15867 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15868 * testsuite/weak_alias_test_main.cc: New file.
15869 * testsuite/weak_alias_test_1.cc: New file.
15870 * testsuite/weak_alias_test_2.cc: New file.
15871 * testsuite/weak_alias_test_3.cc: New file.
15872
780e49c5
ILT
158732008-04-08 Ian Lance Taylor <iant@google.com>
15874
cdb0b8f5
ILT
15875 * options.h (class General_options): Add --noinhibit-exec option.
15876 * main.cc (main): Check --noinhibit-exec.
15877
0864d551
ILT
15878 * options.h (class General_options): Define --wrap as a special
15879 option. Add wrap_symbols_ field.
15880 (General_options::any_wrap_symbols): New function.
15881 (General_options::is_wrap_symbol): New function.
15882 * options.cc (General_options::parse_wrap): New function.
15883 (General_options::General_options): Initialize wrap_symbols_.
15884 * symtab.cc (Symbol_table::wrap_symbol): New function.
15885 (Symbol_table::add_from_object): Handle --wrap.
15886 * symtab.h (class Symbol_table): Declare wrap_symbol.
15887 * target.h (Target::wrap_char): New function.
15888 (Target::Target_info): Add wrap_char field.
15889 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15890 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15891 * testsuite/testfile.cc (Target_test::test_target_info):
15892 Likewise.
15893
789aa6de
ILT
15894 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15895 there is one.
15896
2c38906f
ILT
15897 * layout.h (class Layout): Add added_eh_frame_data_ field.
15898 * layout.cc (Layout::Layout): Initialize new field.
15899 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15900 output section until we find a section we merged successfully.
15901 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15902 that the size be non-zero.
15903
780e49c5
ILT
15904 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15905 qualifier.
15906
7fcd0256
ILT
159072008-04-08 Craig Silverstein <csilvers@google.com>
15908
15909 * configure.ac: Export new conditional variable HAVE_ZLIB.
15910 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15911 on HAVE_ZLIB.
15912 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15913 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15914
6835af53
ILT
159152008-04-07 Ian Lance Taylor <iant@google.com>
15916
e24f324c
ILT
15917 * version.cc (version_string): Set to "1.5".
15918
a036edd8
ILT
15919 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15920 Add issued_non_pic_error_ field. Declare check_non_pic.
15921 (Target_x86_64::Scan::check_non_pic): New function.
15922 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15923 (Target_x86_64::Scan::global): Likewise.
15924
624f8810
ILT
15925 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15926 addend parameter. Change caller. Handle merge sections.
15927 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15928 Address to Addend. Don't add in the result of
15929 local_section_offset, pass down the addend and use the returned
15930 value.
15931 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15932 Update declarations of local_section_offset and symbol_value.
15933 * testsuite/two_file_test_1.cc (t18): New function.
15934 * testsuite/two_file_test_2.cc (f18): New function.
15935 * testsuite/two_file_test_main.cc (main): Call t18.
15936 * testsuite/two_file_test.h (t18, f18): Declare.
15937
6835af53
ILT
15938 * configure.ac: Don't test for objdump, c++filt, or readelf.
15939 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15940 conditionals.
15941 (TEST_READELF): New variable.
15942 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15943 (check_PROGRAMS): Add two_file_strip_test.
15944 (two_file_strip_test): New target.
15945 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15946 (two_file_same_shared_strip_test_SOURCES): New variable.
15947 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15948 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15949 (two_file_same_shared_strip_test_LDADD): New variable.
15950 (two_file_shared_strip.so): New target.
15951 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15952 (ver_test_5.syms, ver_test_7.syms): Likewise.
15953 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15954 (strip_test_3.stdout): Use TEST_OBJDUMP.
15955 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15956
86925eef
CC
159572008-04-04 Cary Coutant <ccoutant@google.com>
15958
15959 * symtab.h (Symbol::is_weak_undefined): New function.
15960 (Symbol::is_strong_undefined): New function.
15961 (Symbol::is_absolute): New function.
15962 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15963 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15964 absolute symbols.
15965 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15966 (weak_undef_test): New target.
15967 * testsuite/Makefile.in: Rebuild.
15968 * testsuite/weak_undef_file1.cc: New file.
15969 * testsuite/weak_undef_file2.cc: New file.
15970 * testsuite/weak_undef_test.cc: New file.
15971
126f3ece
ILT
159722008-04-03 Craig Silverstein <csilvers@google.com>
15973
15974 * compressed_output.h (class Output_compressed_section): Use
15975 unsigned buffer.
15976 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15977 add zlib header.
15978 (zlib_compressed_suffix): Removed.
15979 (Output_compressed_section::set_final_data_size): Use unsigned
15980 buffers.
15981 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15982 Fix linker invocation.
15983 (flagstest_o_specialfile_and_compress_debug_sections):
15984 Likewise.
15985 * testsuite/Makefile.in: Regenerated.
15986
deae2a14
DM
159872008-04-02 David S. Miller <davem@davemloft.net>
15988
15989 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15990 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15991
70752818
ILT
159922008-04-02 Craig Silverstein <csilvers@google.com>
15993
15994 * TODO: New file.
15995
39d0cb0e
ILT
159962008-04-02 Ian Lance Taylor <iant@google.com>
15997
15998 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15999 parameters. Update for new key type to views_. Change all
16000 callers.
16001 (File_read::read): Adjust for byteshift in returned view.
16002 (File_read::add_view): New function, broken out of
16003 find_and_make_view.
16004 (File_read::make_view): New function, broken out of
16005 find_and_make_view.
16006 (File_read::find_or_make_view): Add offset and aligned
16007 parameters. Rewrite accordingly. Change all callers.
16008 (File_read::get_view): Add offset and aligned parameters. Adjust
16009 for byteshift in return value.
16010 (File_read::get_lasting_view): Likewise.
16011 * fileread.h (class File_read): Update declarations.
16012 (class File_read::View): Add byteshift_ field. Add byteshift to
16013 constructor. Add byteshift method.
16014 * archive.h (Archive::clear_uncached_views): New function.
16015 (Archive::get_view): Add aligned parameter. Change all callers.
16016 * object.h (Object::get_view): Add aligned parameter. Change all
16017 callers.
16018 (Object::get_lasting_view): Likewise.
16019
16020 * fileread.cc (File_read::release): Don't call clear_views if
16021 there are multiple objects.
16022 * fileread.h (File_read::clear_uncached_views): New function.
16023 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16024 on the archive.
16025
a1207466
CC
160262008-03-31 Cary Coutant <ccoutant@google.com>
16027
16028 Add thin archive support.
16029 * archive.cc (Archive::armagt): New const.
16030 (Archive::setup): Remove task parameter and calls to unlock.
16031 (Archive::unlock_nested_archives): New function.
16032 (Archive::read_header): Add nested_off parameter. Change
16033 all callers.
16034 (Archive::interpret_header): Likewise.
16035 (Archive::include_all_members): Change to handle thin
16036 archives.
16037 (Archive::include_member): Likewise.
16038 * archive.h (Archive::Archive): Add new parameters and
16039 initializers.
16040 (Archive::armagt): New const.
16041 (Archive::setup): Remove task parameter.
16042 (Archive::unlock_nested_archives): New function.
16043 (Archive::read_header): Add nested_off parameter.
16044 (Archive::interpret_header): Likewise.
16045 (Archive::Nested_archive_table): New typedef.
16046 (Archive::is_thin_archive_): New field.
16047 (Archive::nested_archives_): New field.
16048 (Archive::options_): New field.
16049 (Archive::dirpath_): New field.
16050 (Archive::task_): New field.
16051 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16052 for thin archives. Pass additional parameters to
16053 Archive::Archive. Unlock the archive file after calling
16054 Archive::setup.
cd536b21 16055
479f6503
ILT
160562008-03-29 Ian Lance Taylor <iant@google.com>
16057
686c8caf
ILT
16058 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16059 version symbol to be local.
16060 * testsuite/ver_test_4.sh: New file.
16061 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16062 (check_DATA): Add ver_test_4.syms.
16063 (ver_test_4.syms): New target.
16064 * testsuite/Makefile.in: Rebuild.
16065
ab794b6b
ILT
16066 * output.cc
16067 (Output_section::Input_section_sort_entry::has_priority): New
16068 function.
16069 (Output_section::Input_section_sort_entry::match_file_name): New
16070 function.
16071 (Output_section::Input_section_sort_entry::match_section_name):
16072 Remove.
16073 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16074 Remove.
16075 (Output_section::Input_section_sort_entry::match_section_file):
16076 Remove.
16077 (Output_section::Input_section_sort_compare::operator()): Rewrite
16078 using new Input_section_sort_entry functions. Sort crtbegin and
16079 crtend first. Sort sections with no priority before sections with
16080 a priority.
16081 * testsuite/initpri1.c (d3): Check j != 4.
16082 (cd5): New constructor/destructor function.
16083 (main): Check j != 2.
16084
479f6503
ILT
16085 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16086 new symbol when resolving, don't call set_is_default.
16087 * testsuite/ver_test_7.cc: New file.
16088 * testsuite/ver_test_7.sh: New file.
16089 * testsuite/Makefile.am (ver_test_7.so): New target.
16090 (ver_test_7.o): New target.
16091 (check_SCRIPTS): Add ver_test_7.sh.
16092 (check_DATA): Add ver_test_7.syms.
16093 (ver_test_7.syms): New target.
16094
2fd32231
ILT
160952008-03-28 Ian Lance Taylor <iant@google.com>
16096
16097 * layout.cc (Layout::layout): If we see an input section with a
16098 name that needs sorting, set the must_sort flag for the output
16099 section.
16100 (Layout::make_output_section): If the name of the output section
16101 indicates that it might require sorting, set the may_sort flag.
16102 * output.h (Output_section::may_sort_attached_input_sections): New
16103 function.
16104 (Output_section::set_may_sort_attached_input_sections): New
16105 function.
16106 (Output_section::must_sort_attached_input_sections): New
16107 function.
16108 (Output_section::set_must_sort_attached_input_sections): New
16109 function.
16110 (class Output_section): Declare Input_section_sort_entry. Define
16111 Input_section_sort_compare. Declare
16112 sort_attached_input_sections. Add new fields:
16113 may_sort_attached_input_sections_,
16114 must_sort_attached_input_sections_,
16115 attached_input_sections_are_sorted_.
16116 * output.cc (Output_section::Output_section): Initialize new
16117 fields.
16118 (Output_section::add_input_section): Add an entry to
16119 input_sections_ if may_sort or must_sort are true.
16120 (Output_section::set_final_data_size): Call
16121 sort_attached_input_sections if necessary.
16122 (Output_section::Input_section_sort_entry): Define new class.
16123 (Output_section::Input_section_sort_compare::operator()): New
16124 function.
16125 (Output_section::sort_attached_input_sections): New function.
16126 * configure.ac: Check whether the compiler supports constructor
16127 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16128 * testsuite/initpri1.c: New file.
16129 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16130 CONSTRUCTOR_PRIORITY.
16131 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16132 (initpri1_LDFLAGS): New variable.
16133 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16134
18e6b24e
ILT
161352008-03-27 Ian Lance Taylor <iant@google.com>
16136
49bdd526
ILT
16137 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16138 * testsuite/common_test_1.c: New file.
16139 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16140 (common_test_1_SOURCES): New variable.
16141 (common_test_1_DEPENDENCIES): New variable.
16142 (common_test_1_LDFLAGS): New variable.
16143
18e6b24e
ILT
16144 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16145 and commons_ correctly when NAME/VERSION does not override
16146 NAME/NULL.
16147 * testsuite/ver_test_6.c: New file.
16148 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16149 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16150 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16151
04bf7072
ILT
161522008-03-26 Ian Lance Taylor <iant@google.com>
16153
5871526f
ILT
16154 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16155 of an undefined symbol from a version script.
16156 * testsuite/Makefile.am (ver_test_5.so): New target.
16157 (ver_test_5.o): New target.
16158 (check_SCRIPTS): Add ver_test_5.sh.
16159 (check_DATA): Add ver_test_5.syms.
16160 (ver_test_5.syms): New target.
16161 * testsuite/ver_test_5.cc: New file.
16162 * testsuite/ver_test_5.script: New file.
16163 * testsuite/ver_test_5.sh: New file.
16164 * Makefile.in, testsuite/Makefile.in: Rebuild.
16165
04bf7072
ILT
16166 PR gold/5986
16167 Fix problems building gold with gcc 4.3.0.
16168 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16169 (gold_error_at_location, gold_warning_at_location): Use it.
16170 * configure.ac: Check whether we can compile and use a template
16171 function with a printf attribute.
16172 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16173 when jumping over bytes.
16174 * object.cc: Instantiate Object::read_section_data.
16175 * debug.h: Include <cstring>
16176 * dwarf_reader.cc: Include <algorithm>
16177 * main.cc: Include <cstring>.
16178 * options.cc: Include <cstring>.
16179 * output.cc: Include <cstring>.
16180 * script.cc: Include <cstring>.
16181 * script.h: Include <string>.
16182 * symtab.cc: Include <cstring> and <algorithm>.
16183 * target-select.cc: Include <cstring>.
16184 * version.cc: Include <string>.
16185 * testsuite/testmain.cc: Include <cstdlib>.
16186 * configure, config.in: Rebuild.
16187
874c5b28
ILT
161882008-03-25 Ian Lance Taylor <iant@google.com>
16189
819d6c3a
ILT
16190 * options.cc: Include "../bfd/bfdver.h".
16191 (options::help): Print bug reporting address.
16192
f4b2c6f5
ILT
16193 * version.cc (print_version): Adjust output for current value of
16194 BFD_VERSION_STRING.
16195
16196 * NEWS: New file.
16197
e96caa79
ILT
16198 * options.cc (options::help): Print list of supported targets.
16199 * target-select.h: Include <vector>.
16200 (class Target_selector): Make machine_, size_, and is_big_endian_
16201 fields const. Add bfd_name_ and instantiated_target_ fields.
16202 (Target_selector::Target_selector): Add bfd_name parameter.
16203 (Target_selector::recognize): Make non-virtual, call
16204 do_recognize.
16205 (Target_selector::recognize_by_name): Make non-virtual, call
16206 do_recognize_by_name.
16207 (Target_selector::supported_names): New function.
16208 (Target_selector::bfd_name): New function.
16209 (Target_selector::do_instantiate_target): New pure virtual
16210 function.
16211 (Target_selector::do_recognize): New virtual function.
16212 (Target_selector::do_recognize_by_name): New virtual function.
16213 (Target_selector::instantiate_target): New private function.
16214 (supported_target_names): Declare.
16215 * target-select.cc (Target_selector::Target_selector): Update for
16216 new parameter and fields.
16217 (select_target_by_name): Check that the name matches before
16218 calling recognize_by_name.
16219 (supported_target_names): New function.
16220 * i386.cc (class Target_selector_i386): Update Target_selector
16221 constructor call. Remove recognize and recognize_by_name. Add
16222 do_instantiate_target.
16223 * x86_64.cc (class Target_selector_x86_64): Likewise.
16224 * testsuite/testfile.cc (class Target_selector_test): Update for
16225 changes to Target_selector.
16226
874c5b28
ILT
16227 * README: Rewrite, with some notes on unsupported features.
16228
0a65a3a7
CC
162292008-03-24 Cary Coutant <ccoutant@google.com>
16230
16231 * i386.cc (Target_i386::Got_type): New enum declaration.
16232 (Target_i386::Scan::local): Updated callers of Output_data_got
16233 member functions.
16234 (Target_i386::Scan::global): Likewise.
16235 (Target_i386::Relocate::relocate): Likewise.
16236 (Target_i386::Relocate::relocate_tls): Likewise.
16237 * object.h (Got_offset_list): New class.
16238 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16239 (Sized_relobj::local_got_offset): Likewise.
16240 (Sized_relobj::set_local_got_offset): Likewise.
16241 (Sized_relobj::local_has_tls_got_offset): Removed.
16242 (Sized_relobj::local_tls_got_offset): Removed.
16243 (Sized_relobj::set_local_tls_got_offset): Removed.
16244 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16245 * output.cc (Output_data_got::add_global): Added got_type parameter.
16246 (Output_data_got::add_global_with_rel): Likewise.
16247 (Output_data_got::add_global_with_rela): Likewise.
16248 (Output_data_got::add_global_pair_with_rel): New function.
16249 (Output_data_got::add_global_pair_with_rela): New function.
16250 (Output_data_got::add_local): Added got_type parameter.
16251 (Output_data_got::add_local_with_rel): Likewise.
16252 (Output_data_got::add_local_with_rela): Likewise.
16253 (Output_data_got::add_local_pair_with_rel): New function.
16254 (Output_data_got::add_local_pair_with_rela): New function.
16255 (Output_data_got::add_global_tls): Removed.
16256 (Output_data_got::add_global_tls_with_rel): Removed.
16257 (Output_data_got::add_global_tls_with_rela): Removed.
16258 (Output_data_got::add_local_tls): Removed.
16259 (Output_data_got::add_local_tls_with_rel): Removed.
16260 (Output_data_got::add_local_tls_with_rela): Removed.
16261 * output.h (Output_data_got::add_global): Added got_type parameter.
16262 (Output_data_got::add_global_with_rel): Likewise.
16263 (Output_data_got::add_global_with_rela): Likewise.
16264 (Output_data_got::add_global_pair_with_rel): New function.
16265 (Output_data_got::add_global_pair_with_rela): New function.
16266 (Output_data_got::add_local): Added got_type parameter.
16267 (Output_data_got::add_local_with_rel): Likewise.
16268 (Output_data_got::add_local_with_rela): Likewise.
16269 (Output_data_got::add_local_pair_with_rel): New function.
16270 (Output_data_got::add_local_pair_with_rela): New function.
16271 (Output_data_got::add_global_tls): Removed.
16272 (Output_data_got::add_global_tls_with_rel): Removed.
16273 (Output_data_got::add_global_tls_with_rela): Removed.
16274 (Output_data_got::add_local_tls): Removed.
16275 (Output_data_got::add_local_tls_with_rel): Removed.
16276 (Output_data_got::add_local_tls_with_rela): Removed.
16277 * resolve.cc (Symbol::override_base_with_special): Removed
16278 reference to has_got_offset_ field.
16279 * symtab.cc (Symbol::init_fields): Replaced initialization
16280 of got_offset_ with got_offsets_. Removed initialization
16281 of has_got_offset_
53fcba31 16282 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16283 (Symbol::got_offset): Likewise.
16284 (Symbol::set_got_offset): Likewise.
16285 (Symbol::has_tls_got_offset): Removed.
16286 (Symbol::tls_got_offset): Removed.
16287 (Symbol::set_tls_got_offset): Removed.
16288 (Symbol::got_offset_): Removed.
16289 (Symbol::tls_mod_got_offset_): Removed.
16290 (Symbol::tls_pair_got_offset_): Removed.
16291 (Symbol::got_offsets_): New field.
16292 (Symbol::has_got_offset): Removed.
16293 (Symbol::has_tls_mod_got_offset): Removed.
16294 (Symbol::has_tls_pair_got_offset): Removed.
16295 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16296 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16297 member functions.
16298 (Target_x86_64::Scan::global): Likewise.
16299 (Target_x86_64::Relocate::relocate): Likewise.
16300 (Target_x86_64::Relocate::relocate_tls): Likewise.
16301
bd52eafb
BE
163022008-03-25 Ben Elliston <bje@au.ibm.com>
16303
16304 * yyscript.y: Fix spelling error in comment.
16305
8b105e34
ILT
163062008-03-24 Ian Lance Taylor <iant@google.com>
16307
8ed814a9
ILT
16308 * options.h (class General_options): Define build_id option.
16309 * layout.h (class Layout): Declare write_build_id, create_note,
16310 create_build_id. Add build_id_note_ member.
16311 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16312 "libiberty.h", "md5.h", "sha1.h".
16313 (Layout::Layout): Initialize eh_frame_data_,
16314 eh_frame_hdr_section_, and build_id_note_.
16315 (Layout::finalize): Call create_build_id.
16316 (Layout::create_note): New function, broken out of
16317 Layout::create_gold_note.
16318 (Layout::create_gold_note): Call create_note.
16319 (Layout::create_build_id): New function.
16320 (Layout::write_build_id): New function.
16321 (Close_task_runner::run): Call write_build_id.
16322
8b105e34
ILT
16323 * x86_64.cc: Correct license to GPLv3.
16324
086a1841
ILT
163252008-03-23 Ian Lance Taylor <iant@google.com>
16326
16327 * options.cc: Include "demangle.h".
16328 (parse_optional_string): New function.
16329 (parse_long_option): Handle takes_optional_argument.
16330 (parse_short_option): Update dash_z initializer. Handle
16331 takes_optional_argument.
16332 (General_options::General_options): Initialize do_demangle_.
16333 (General_options::finalize): Set do_demangle_. Handle demangling
16334 style.
16335 * options.h (parse_optional_string): Declare.
16336 (struct One_option): Add optional_arg field. Update constructor.
16337 Update call constructor calls. Add takes_optional_argument
16338 function.
16339 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16340 (DEFINE_optional_string): Define.
16341 (General_options::demangle): Change from DEFINE_bool to
16342 DEFINE_optional_string.
16343 (General_options::no_demangle): New function.
16344 (General_options::do_demangle): New function.
16345 (General_options::set_do_demangle): New function.
16346 (General_options::execstack_status_): Move definition to end of
16347 class definition.
16348 (General_options::static_): Likewise.
16349 (General_options::do_demangle_): New field.
16350 * object.cc (big_endian>::get_symbol_location_info): Call
16351 Options::do_demangle, not Options::demangle.
16352 * symtab.cc (demangle): Likewise.
16353
cbb93e63
ILT
163542008-03-22 Ian Lance Taylor <iant@google.com>
16355
16356 * gold.h: Include <cstddef> and <sys/types.h>
16357 * options.h: Include <cstring>.
16358
ec531623
ILT
163592008-03-21 Ian Lance Taylor <iant@google.com>
16360
16361 * Added source code to GNU binutils.
752937aa 16362\f
4b95cf5c 16363Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16364
16365Copying and distribution of this file, with or without modification,
16366are permitted in any medium without royalty provided the copyright
16367notice and this notice are preserved.
16368
16369Local Variables:
16370mode: change-log
16371left-margin: 8
16372fill-column: 74
16373version-control: never
16374End:
This page took 1.067482 seconds and 4 git commands to generate.