cp-namespace.c (cp_lookup_symbol_via_all_imports): New function.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
bd040da1
L
12014-12-20 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/14608
4 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
5 to "return i * i * 3;".
6
e02a4046
CC
72014-12-16 Cary Coutant <ccoutant@google.com>
8
9 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
10 (Mapfile::print_output_data): Use current_data_size() to avoid
11 assert for sections requiring postprocessing; if address is not valid,
12 print 0.
13 (Mapfile::print_output_section): Use current_data_size(); print note
14 that addresses and sizes are before compression.
15
add6016b
L
162014-12-14 H.J. Lu <hongjiu.lu@intel.com>
17
18 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
19 Cast current_group_size to unsigned long when reporting error.
20
0bf32ea9
JY
212014-12-10 Jing Yu <jingyu@google.com>
22
23 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
24 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
25 Update error message.
26 (Target_aarch64::do_relax): Use absolute value of option
27 stub_group_size. Replace local variable with class member
28 stub_group_size_.
29
cbcb23fa
AM
302014-12-04 Alan Modra <amodra@gmail.com>
31
32 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
33 addend of PLTREL24 reloc when not generating a plt stub. Make
34 max_branch_offset an "Address".
fbad6518 35 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
36 (Target_powerpc::Relocate::relocate): Likewise.
37
1611bc4a
AM
382014-12-04 Alan Modra <amodra@gmail.com>
39
40 PR 17670
41 * symtab.cc (Symbol::set_undefined): Remove assertion.
42 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
43 on symbols defined in discarded sections, instead return false.
44 Rearrange params, update all callers.
45 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
46 branches to syms in discarded sections.
47 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
48 undefined and flag as discarded.
49 (Target_powerpc::Relocate::relocate): Localize variable.
50
4759c34e
L
512014-12-03 H.J. Lu <hongjiu.lu@intel.com>
52
53 PR gold/17675
54 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
55 * testsuite/Makefile.in: Regenerated.
56
1f98a074
AM
572014-12-03 Alan Modra <amodra@gmail.com>
58
59 PR 17566
60 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
61 when adding dynamic relocations against section symbols.
62
fb257835
DI
632014-12-01 Dimitry Ivanov <dimitry@google.com>
64
65 * layout.cc (Layout::finish_dynamic_section): When '-z global'
66 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
67 * options.h (General_options): New -z option (global).
68
d8e60314
CC
692014-12-01 Cary Coutant <ccoutant@google.com>
70
71 PR gold/17578
72 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
73 is given.
74 (Layout::create_executable_stack_info): Warn when -z noexecstack is
75 given but some inputs require executable stack.
76
982bbd97
CC
772014-11-26 Cary Coutant <ccoutant@google.com>
78
79 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
80 .debug_str_offsets; strip .debug_gnu_pubnames and
81 .debug_gnu_pubtypes.
82 (lines_only_debug_sections): Strip all four new sections.
83
bb779192
HS
842014-11-26 Jing Yu <jingyu@google.com>
85
86 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
87 register to be x0 when to relax TLSDESC_LD64_LO12.
88
a3e60ddb
AM
892014-11-26 Alan Modra <amodra@gmail.com>
90
91 * powerpc.cc (struct Stub_table_owner): New.
92 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
93 unsigned int vector. Update all references.
94 (powerpc_relobj::set_stub_table): Take an unsigned int param
95 rather than a Stub_table. Update callers.
96 (Powerpc_relobj::clear_stub_table): New function.
97 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
98 stub_group_size_ vars.
99 (Target_powerpc::new_stub_table): Delete.
100 (max_branch_delta): New function, extracted from..
101 (Target_powerpc::Relocate::relocate): ..here..
102 (Target_powerpc::Branch_info::make_stub): ..and here. Return
103 status on whether stub created successfully.
104 (Stub_control::Stub_control): Add "no_size_errors" param. Move
105 default sizing to..
106 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
107 reduce on relax failure.
108 (Target_powerpc::group_sections): Add "no_size_errors" param.
109 Use stub_group_size_. Set up group info in a temp vector,
110 before building Stub_table vector. Account for input sections
111 possibly already converted to relaxed sections.
112 (Stub_table::init): Delete. Merge into..
113 (Stub_table::Stub_table): ..here.
114 (Stub_table::can_reach_stub): New function.
115 (Stub_table::add_plt_call_entry): Add "from" parameter and
116 return true iff stub could be reached.
117 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
118 param too.
119 (Stub_table::clear_stubs): Add "all" param.
120
a20605cf
AM
1212014-11-26 Alan Modra <amodra@gmail.com>
122
123 * powerpc.cc (Stub_control::set_output_and_owner): New function.
124 (Target_powerpc::group_sections): Use it.
125
43b64deb
CC
1262014-11-25 Cary Coutant <ccoutant@google.com>
127
128 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
129 (Binary_to_elf::write_symbol): Add st_size parameter.
130 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
131
c924eb67
CC
1322014-11-25 Cary Coutant <ccoutant@google.com>
133
134 PR gold/17639
135 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
136 (Sized_relobj_file::do_layout): Handle deferred sections properly
137 during GC pass 1. Don't add reloc sections to deferred list twice.
138 * object.h (Sized_relobj_file::is_deferred_layout): New function.
139 (Sized_relobj_file::is_deferred_layout_): New data member.
140
9d585188
L
1412014-11-21 H.J. Lu <hongjiu.lu@intel.com>
142
143 PR gold/17619
144 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
145 Check PC-relative offset overflow in PLT entry.
146
3ffaac20
AM
1472014-11-21 Alan Modra <amodra@gmail.com>
148
149 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
150 for undefined weaks.
151
0cfb0717
AM
1522014-11-20 Alan Modra <amodra@gmail.com>
153
154 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
155 from --stub-group-size parameter divided by 1024.
156 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
157 template parameter. Update all uses.
158 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
159 has_stub_value. Set for long branches. Don't report overflow for
160 branch to undefined weak symbols. Print info message on
161 overflowing branch to stub.
162
f9dffbf0
AM
1632014-11-20 Alan Modra <amodra@gmail.com>
164
165 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
166
e88ba8d5
L
1672014-11-13 H.J. Lu <hongjiu.lu@intel.com>
168
169 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
170 entry for R_X86_64_GOTPLT64.
171 (Target_x86_64<size>::Relocate::relocate): Update comments for
172 R_X86_64_GOTPLT64.
173
d37ffe25
ED
1742014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
175
176 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
177 * plugin.h: add lock definition
178
9726c3c1
HS
1792014-10-29 Han Shen <shenhan@google.com>
180 Jing Yu <jingyu@google.com>
181
182 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
183 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
184 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
185 Symbol::TLS_REF.
186 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
187 method.
188 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
189 (Target_aarch64::tls_ld_to_le): New method.
190 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
191 for 64bit targets.
192 (Output_data_plt_aarch64::irelative_rel_): New data member.
193 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
194 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
195 (Output_data_plt_aarch64::add_relocation): New method.
196 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
197 offset. Add got_irelative size to got size.
198 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
199 type string with the new typename.
200 (AArch64_relocate_functions::update_adr): Replace parameter x with
201 immed.
202 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
203 (AArch64_relocate_functions::reloc_common): New method.
204 (AArch64_relocate_funcsions::rela_general): Extract common part out
205 into reloc_common method.
206 (AArch64_relocate_functions::rela_general): Likewise.
207 (AArch64_relocate_functions::pcrela_general): Likewise.
208 (AArch64_relocate_functions::adr): New method.
209 (AArch64_relocate_functions::adrp): Calculate immed before calling
210 update_adr.
211 (AArch64_relocate_functions::adrp): Likewise.
212 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
213 comparing x to 0. Calculate immed from ~x when x < 0.
214 (Target_aarch64::optimize_tls_reloc): Add new cases for
215 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
216 TLSLD_MOVW_DTPREL_G0_NC.
217 (Target_aarch64::possible_function_pointer_reloc): Implement this
218 method.
219 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
220 comment.
221 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
222 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
223 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
224 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
225 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
226 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
227 (Target_aarch64::make_plt_entry): Call add_entry with two more
228 parameters.
229 (Target_aarch64::make_local_ifunc_plt_entry): New method.
230 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
231 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
232 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
233 (Target_aarch64::Relocate::relocate_tls): Add cases for
234 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
235 TLSLD_MOVW_DTPREL_G0_NC.
236 * testsuite/icf_safe_so_test.cc: Correct test comment.
237 * testsuite/icf_safe_test.sh: Add AArch64 arch.
238
80272b8c
AM
2392014-10-22 Alan Modra <amodra@gmail.com>
240
241 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
242 thread_starter.
243
998a69f4
AS
2442014-10-18 Andreas Schwab <schwab@linux-m68k.org>
245
246 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
247
aed56ec5
CC
2482014-10-17 Cary Coutant <ccoutant@google.com>
249
250 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
251 Add "typename" keyword.
252
bb779192 2532014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
254 Jing Yu <jingyu@google.com>
255
256 Patch for gold aarch64 backend to support relaxation.
257 * aarch64-reloc.def: Change format.
258 * aarch64.cc (class Reloc_stub): New class.
259 (class Stub_table): New class.
260 (class AArch64_relobj): New class.
261 (class AArch64_input_section): New class.
262 (class AArch64_output_section): New class.
263 (Target_aarch64::new_stub_table): New method.
264 (Target_aarch64::new_aarch64_input_section): New method.
265 (Target_aarch64::find_aarch64_input_section): New method.
266 (Target_aarch64::scan_section_for_stubs): New method.
267 (Target_aarch64::scan_reloc_section_for_stubs): New method.
268 (Target_aarch64::relocate_stub): New method.
269 (Target_aarch64::current_target): New method.
270 (Target_aarch64::do_make_elf_object): New method.
271 (Target_aarch64::do_may_relax): New method.
272 (Target_aarch64::do_relax): New method.
273 (Target_aarch64::group_sections): New method.
274 (Target_aarch64::scan_reloc_for_stub): New method.
275 (Target_aarch64::do_make_output_section): New method.
276 (Target_aarch64::stub_tables_): New data member.
277 (Target_aarch64::aarch64_input_section_map_): New data member.
278 (AArch64_relocate_functions::maybe_apply_stub): New method.
279
db4c9594
CC
2802014-09-30 Cary Coutant <ccoutant@google.com>
281
282 PR gold/17432
283 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
284
cd6da036
KC
2852014-09-30 Kito Cheng <kito@0xlab.org>
286
287 PR gold/13597
288 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
289 hash table before sysv-style hash table.
290
5f772412
ST
2912014-09-29 Sriraman Tallam <tmsriram@google.com>
292
293 * options.h (--pic-executable): Add negative to alias to -no-pie.
294
5efeedf6
CC
2952014-09-26 Cary Coutant <ccoutant@google.com>
296
297 PR gold/16773
298 * object.cc (Sized_relobj_file): Compute value of section symbols
299 for TLS sections the same as TLS symbols.
300
1707f183
CC
3012014-09-25 Cary Coutant <ccoutant@google.com>
302
303 PR gold/17432
304 * resolve.cc (Symbol_table::resolve): Override common placeholder
305 symbols, but adjust sizes.
306 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
307 symbols to common lists.
308
00cac886
AM
3092014-09-24 Alan Modra <amodra@gmail.com>
310
311 * po/POTFILES.in: Regenerate.
312
635aa30e
CC
3132014-09-23 Taiju Tsuiki <tzik@google.com>
314 Cary Coutant <ccoutant@google.com>
315
71b9b91b 316 PR gold/14860
635aa30e
CC
317 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
318 on input_sections_blocker.
319 * layout.cc (Write_sections_task::locks): Unblock
320 input_sections_blocker_.
321 * layout.h (Write_sections_task::Write_sections_task): Add
322 input_sections_blocker.
323 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
324 to DEPENDENCIES.
325 * testsuite/Makefile.in: Regenerate.
326
c0c71592
RÁE
3272014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
328
329 * testsuite/Makefile.am (plugin_test_10): New test.
330 * testsuite/Makefile.in: Regenerate
331 * testsuite/plugin_common_test_2.c (c1): Align to 8.
332 * testsuite/plugin_test_10.sh: New file.
333
6168c2a1
RÁE
3342014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
335
336 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
337 * resolve.cc (Symbol_table::resolve): Don't override common symbols
338 during the replacement phase.
339
3a531937
JY
3402014-09-17 Han Shen <shenhan@google.com>
341 Jing Yu <jingyu@google.com>
342
343 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
344 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
345 * aarch64.cc (Target_aarch64): Add data members
346 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
347 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
348 constructor.
349 (Target_aarch64::do_reloc_symbol_index): New method.
350 (Target_aarch64::do_reloc_addend): New method.
351 (Target_aarch64::add_tlsdesc_info): New method.
352 (Target_aarch64::do_dynsym_value): New method.
353 (Target_aarch64::do_make_data_plt): Add new parameters: got,
354 got_irelative. Pass them to Output_data_plt_aarch64_standard.
355 (Target_aarch64::make_data_plt): Add new parameters: got,
356 got_irelative. Pass them to do_make_data_plt.
357 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
358 (Target_aarch64::Relocate:tls_gd_to_le): New method.
359 (Target_aarch64::Relocate:tls_ie_to_le): New method.
360 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
361 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
362 (Target_aarch64::got_tlsdesc_section): New method.
363 (Target_aarch64::make_local_ifunc_plt_entry): New method.
364 (Target_aarch64::define_tls_base_symbol): New method.
365 (Target_aarch64::reserve_tlsdesc_entries): New method.
366 (Target_aarch64::got_mod_index_entry): New method.
367 (Target_aarch64::rela_tlsdesc_section): New method.
368 (Target_aarch64::rela_irelative_section): New method.
369 (Target_aarch64::Tlsdesc_info): New struct.
370 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
371 relocations and tlsdesc relocations.
372 (Target_aarch64::optimize_tls_reloc): Implement method.
373 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
374 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
375 in constructor.
376 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
377 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
378 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
379 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
380 (Output_data_plt_aarch64::rela_tlsdesc): New method.
381 (Output_data_plt_aarch64::rela_irelative): New method.
382 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
383 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
384 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
385 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
386 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
387 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
388 (Output_data_plt_aarch64_standard): New member variables:
389 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
390 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
391 New parameter: got, got_irelative.
392 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
393 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
394 (Output_data_plt_aarch64::do_write): Replace got_address with
395 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
396 (AArch64_relocate_functions::update_movnz): New method.
397 (AArch64_relocate_functions): Correct format.
398 (AArch64_relocate_functions::movnz): New method.
399 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
400 before the switch. Add new cases to switch.
00cac886 401 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
402 tlsgd tlsdesc cases.
403 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
404 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
405 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
406 Call reloc_name_in_error_message to print unsupported reloc.
407 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
408 make_data_plt.
409 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
410 relocs. Fill in some more dynamic tags.
411 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
412 Skip call tls_get_addr when tlsgd is relaxed.
413 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
414 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
415 tlsdesc->ie relaxation.
416
62661c93
SS
4172014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
418
419 * mips.cc (Target_mips_nacl): New class.
420 (Target_selector_mips_nacl): New class.
421 (target_selector_mips32): Rename from target_selector_mips32be and use
422 Target_selector_mips_nacl instead of Target_selector_mips.
423 (target_selector_mips32el): Rename from target_selector_mips32 and use
424 Target_selector_mips_nacl instead of Target_selector_mips.
425 (target_selector_mips64): Rename from target_selector_mips64be and use
426 Target_selector_mips_nacl instead of Target_selector_mips.
427 (target_selector_mips64el): Rename from target_selector_mips64 and use
428 Target_selector_mips_nacl instead of Target_selector_mips.
429 (Target_mips::mips_info): Add const attribute.
430
54674d38
CC
4312014-09-02 Cary Coutant <ccoutant@google.com>
432
433 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
434 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
435 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
436 (Sized_incr_dynobj::do_section_name): Likewise.
437 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
438 (Sized_incr_dynobj::do_section_name): Likewise.
439 * object.h (Object::section_name): Likewise.
440 (Object::do_section_name): Likewise.
441 (Sized_relobj_file::do_section_name): Likewise.
442 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
443 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
444
9860cbcf
CC
4452014-09-02 Cary Coutant <ccoutant@google.com>
446
447 PR gold/17005
448 * ehframe.cc (Fde::write): Add output_offset parameter.
449 (Cie::write): Likewise.
450 (Eh_frame::set_final_data_size): Account for offset within output
451 section.
452 (Eh_frame::do_sized_write): Likewise.
453 * ehframe.h (Fde::write): Add output_offset parameter.
454 (Cie::write): Likewise.
455 * output.cc (Output_section::Input_section_sort_entry): Remove
456 section_has_name_; add output_section_name parameter. Use
457 output section name for non-input sections.
458 (Output_section::Input_section_sort_entry::section_has_name): Remove.
459 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
460 (Output_section::Input_section_sort_compare): Remove logic for
461 sections without names.
462 (Output_section::Input_section_sort_init_fini_compare): Likewise.
463 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
464 Likewise.
465 (Output_section::Input_section_sort_section_name_compare): Likewise.
466
8e33481e
HS
4672014-08-29 Han Shen <shenhan@google.com>
468 Jing Yu <jingyu@google.com>
469
470 * aarch64-reloc-property.cc
471 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
472 reference reloc property in the table.
473 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
474 3 other entries.
475 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
476 2 new overloaded methods.
477 (Output_data_got_aarch64::do_write): Add code to write out
478 static relocs.
479 (class Output_data_got_aarch64::Static_reloc): New class to wrap
480 static relocs.
481 (Output_data_got_aarch64::static_relocs): New vector to
482 hold static relocs.
483 (Target_aarch64::TCB_SIZE): New const static memeber.
484 (Target_aarch64::tcb_size): New method.
485 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
486 (Target_aarch64::Relocate::relocate_tls): New method.
487 (Target_aarch64::Scan::local): Add code handling new reloc types.
488 (Target_aarch64::Scan::global): Add code handling new reloc types.
489
81233653
ST
4902014-08-13 Sriraman Tallam <tmsriram@google.com>
491
492 * options.h (-no-pie): Add option.
493
9363c7c3
JY
4942014-08-08 Jing Yu <jingyu@google.com>
495 Han Shen <shenhan@google.com>
496
497 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
498 (DEFFILES): add aarch64-reloc.def.
499 (TARGETSOURCES): Add aarch64-reloc-property.cc.
500 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
501 * Makefile.in: Regenerate.
502 * aarch64-reloc-property.cc: New file.
503 * aarch64-reloc-property.h: New file.
504 * aarch64-reloc.def: New file.
505 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
506 with tab to make the format consistent.
507 (Output_data_got_aarch64::symbol_table_): New method.
508 (Target_aarch64::do_plt_address_for_global): New method.
509 (Target_aarch64::do_plt_address_for_local): New method.
510 (Target_aarch64::do_select_as_default_target): New method.
511 (Target_aarch64::do_make_data_plt): New method.
512 (Target_aarch64::make_data_plt): New method.
513 (Output_data_plt_aarch64::has_irelative_section): New method.
514 (Output_data_plt_aarch64::address_for_global): New method.
515 (Output_data_plt_aarch64::address_for_local): New method.
516 (Output_data_plt_aarch64::irelative_rel_): New parameter.
517 (Output_data_plt_aarch64::add_entry): Implement contents.
518 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
519 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
520 the got_pov entry to plt0.
521 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
522 Implement contents.
523 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
524 (AArch64_howto): New struct.
525 (aarch64_howto[]): New static const array.
526 (AArch64_relocate_functions): New class.
527 (Target_aarch64::Scan::get_reference_flags): Remove method.
528 (Target_aarch64::Scan::local): Implement to support a few relocations.
529 (Target_aarch64::Scan::global): Implement to support a few relocations.
530 (Target_aarch64::make_plt_section): Implement contents.
531 (Target_aarch64::make_plt_entry): Implement contents.
532 (Target_aarch64::do_finalize_sections): Implement contents.
533 (Target_aarch64::Relocate::relocate): Implement a few relocations.
534 (Target_aarch64::relocate_section): Implement contents.
535
ad9fe6c1
AM
5362014-08-06 Alan Modra <amodra@gmail.com>
537
538 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
539
7cd4e5b7
AM
5402014-08-06 Alan Modra <amodra@gmail.com>
541
542 PR 13227
543 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
544
5ad9b0a7
ST
5452014-07-21 Sriraman Tallam <tmsriram@google.com>
546
547 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 548 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 549
e051745c
CC
5502014-07-08 Cary Coutant <ccoutant@google.com>
551
552 * expression.cc (struct Expression::Expression_eval_info): Add
553 new fields type_pointer, vis_pointer, and nonvis_pointer.
554 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
555 nonvis_pointer parameters. Adjust all calls.
556 (Symbol_expression::value): Update type, visibility, and nonvis bits
557 in caller.
558 * script.cc (Symbol_assignment::sized_finalize): Update type,
559 visibility, and remaining st_other bits for new symbol.
560 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
561 vis_pointer, and nonvis_pointer parameters.
562 * symtab.h (Symbol::set_type): New method.
563
564 * testsuite/Makefile.am (defsym_test): New test.
565 * testsuite/Makefile.in: Regenerate.
566 * testsuite/defsym_test.c: New file.
567 * testsuite/defsym_test.sh: New file.
568
f35c4853
CC
5692014-07-08 Cary Coutant <ccoutant@google.com>
570
571 PR gold/15639
572 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
573 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
574 (Sized_dynobj::base_read_symbols): ...new method.
575 * object.h (Sized_relobj_file::base_read_symbols): New method.
576 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
577 (Sized_relobj_file::base_read_symbols): ...new method.
578 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
579 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
580 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
581
2900af2d
AM
5822014-07-04 Alan Modra <amodra@gmail.com>
583
584 * po/POTFILES.in: Regenerate.
585
053a4d68
JY
5862014-07-02 Jing Yu <jingyu@google.com>
587
588 * aarch64.cc: New file
589 * Makefile.am (TARGETSOURCES): Add aarch64.cc
590 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
591 * Makefile.in: Regenerate.
592 * configure.tgt: Add entries for aarch64*.
593 * configure.ac: Likewise.
594 * configure: Likewise.
595
7b549045
AM
5962014-06-27 Alan Modra <amodra@gmail.com>
597
598 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
599
cb818dbf
CC
6002014-06-24 Cary Coutant <ccoutant@google.com>
601
602 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
603 sections.
604 (Dwo_file::sized_read_unit_index): Likewise.
605
9810d34d
SS
6062014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
607
608 * mips.cc: New file.
609 * Makefile.am (TARGETSOURCES): Add mips.cc
610 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
611 * configure.tgt: Add entries for mips*.
612 * configure.ac: Likewise.
613 * Makefile.in: Regenerate.
614 * configure: Likewise.
615
9baa787b
CC
6162014-06-09 Cary Coutant <ccoutant@google.com>
617
618 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
619 unit_length is within section bounds.
620
8f89af0a
CC
6212014-06-09 Cary Coutant <ccoutant@google.com>
622
623 PR gold/16980
624 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
625 map.
626
a47622ac
AM
6272014-06-07 Alan Modra <amodra@gmail.com>
628
629 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
630
4320c691
CC
6312014-06-06 Cary Coutant <ccoutant@google.com>
632
633 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
634 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
635 (Dwarf_pubnames_table::read_header): Likewise.
636 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
637 .debug_gnu_pubtypes.
638
270c9937
JB
6392014-06-05 Joel Brobecker <brobecker@adacore.com>
640
641 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
642 * Makefile.in, configure: Regenerate.
643
397998fc
AM
6442014-06-03 Alan Modra <amodra@gmail.com>
645
646 * powerpc.cc (addis_12_2): Define.
647 (Stub_table::do_write): Support fusion on ELFv2 stubs.
648
61f5c66f
AM
6492014-06-03 Alan Modra <amodra@gmail.com>
650
651 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
652 st_other output.
653
f6971787
AM
6542014-06-02 Alan Modra <amodra@gmail.com>
655
656 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
657 Only ignore relocs on ELFv1.
658 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
659
f6fb8322
CC
6602014-05-30 Cary Coutant <ccoutant@google.com>
661
662 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
663 * testsuite/Makefile.in: Regenerate.
664 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
665
c23dd342
L
6662014-05-27 H.J. Lu <hongjiu.lu@intel.com>
667
668 PR gold/16945
669 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
670 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
671
5fe7ffdc
AM
6722014-05-15 Alan Modra <amodra@gmail.com>
673
674 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
675 Compare FDE contents with DW_CFA_nop rather than 0.
676
a82bef93
ST
6772014-05-13 Sriraman Tallam <tmsriram@google.com>
678
679 * symtab.h (may_need_copy_reloc): Remove check for position independent
680 code.
681 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
682 position independence before pc absolute may_need_copy_reloc call.
683 Add check for executable output befor pc relative may_need_copy_reloc
684 call.
685 * i386.cc: Ditto.
686 * arm.cc: Ditto.
687 * sparc.cc: Ditto.
688 * tilegx.cc: Ditto.
689 * powerpc.cc: Add check for no position independence before
690 may_need_copy_reloc calls.
691 * testsuite/pie_copyrelocs_test.cc: New file.
692 * testsuite/pie_copyrelocs_shared_test.cc: New file.
693 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 694 * Makefile.in: Regenerate.
a82bef93 695
53c66605
ML
6962014-05-08 Martin Liška <mliska@suse.cz>
697
698 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
699
57b2284c
CC
7002014-05-06 Cary Coutant <ccoutant@google.com>
701
702 PR gold/16900
703 * i386.cc (Output_data_got_plt_i386): New class.
704 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
705 parameter. Change all callers.
706 (Output_data_plt_i386::layout_): Remove.
707 (Output_data_plt_i386::got_plt_): Change type.
708 (Target_i386::got_plt_): Change type. Change all references.
709 (Target_i386::got_section): Create instance of new class.
710 (Output_data_got_plt_i386::do_write): New function.
711 * x86_64.cc (Output_data_got_plt_x86_64): New class.
712 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
713 parameter. Change all callers.
714 (Output_data_plt_x86_64::layout_): Remove.
715 (Output_data_plt_x86_64::got_plt_): Change type.
716 (Target_x86_64::got_plt_): Change type. Change all references.
717 (Target_x86_64::got_section): Create instance of new class.
718 (Output_data_got_plt_x86_64::do_write): New function.
719 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
720 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
721 class.
722
6b97515d 7232014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 724
6b97515d
CC
725 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
726 if we have pubnames/pubtypes.
727
d1bddd3c
CC
7282014-05-02 Cary Coutant <ccoutant@google.com>
729
5fe7ffdc
AM
730 * defstd.cc (in_segment): Define __ehdr_start here...
731 * layout.cc (Layout::finalize): ...Instead of here. Set the
732 output segment when known.
733 * resolve.cc (Symbol::override_base_with_special): Remember
734 the original binding.
735 * symtab.cc (Symbol::set_output_segment): New function.
736 (Symbol::set_undefined): New function.
737 * symtab.h (Symbol::is_weak_undefined): Check original undef
738 binding.
739 (Symbol::is_strong_undefined): New function.
740 (Symbol::set_output_segment): New function.
741 (Symbol::set_undefined): New function.
742 * target-reloc.h (is_strong_undefined): Remove.
743 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
744 Check for hidden undefs.
745 (relocate_section): Call Symbol::is_strong_undefined.
746
747 * testsuite/Makefile.am (ehdr_start_test_1)
748 (ehdr_start_test_2, ehdr_start_test_3)
749 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
750 * testsuite/Makefile.in: Regenerate.
751 * testsuite/ehdr_start_def.cc: New source file.
752 * testsuite/ehdr_start_test.cc: New source file.
753 * testsuite/ehdr_start_test.t: New linker script.
754 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 755
7849f6d8
CC
7562014-04-23 Cary Coutant <ccoutant@google.com>
757
bf2cc635 758 PR gold/16870
7849f6d8
CC
759 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
760
99fd8cff
CC
7612014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
762
763 * layout.cc (Layout::include_section): Allow a target to decide
764 whether to include a section.
765 * target.h (Target::should_include_section): New function.
766 (Target::do_should_include_section): New function.
767
91f43acd
CC
7682014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
769
770 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
771 inline into ...
772 (Copy_relocs::emit): ... here.
773 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
774 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
775 (Copy_reloc_entry::entries_): Change from private to protected.
776
c4eb27e1
ST
7772014-04-02 Sriraman Tallam <tmsriram@google.com>
778
779 * icf.cc (get_section_contents): Replace copies of reloc
780 vectors with const references.
781
ae447ddd
CC
7822014-04-02 Cary Coutant <ccoutant@google.com>
783
784 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
785 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
786 * configure: Regenerate.
787 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
788 -fno-use-linker-plugin.
789 (LINK1, CXXLINK1): Add it to the link command.
790 * testsuite/Makefile.in: Regenerate.
791
fa47fa92
AM
7922014-03-12 Alan Modra <amodra@gmail.com>
793
794 * Makefile.in: Regenerate.
795
9b12c500
CC
7962014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
797
798 * symtab.h (Symbol::set_nonvis): New function.
799
beacaa96
CC
8002014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
801
802 * symtab.cc (Sized_symbol<32>::init_output_data):
803 Instantiate the template.
804 (Sized_symbol<64>::init_output_data): Likewise.
805
800d9823
CC
8062014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
807
808 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
809 adjust dynamic symbol value.
810 * target.h (Target::adjust_dyn_symbol): New function.
811 (Target::do_adjust_dyn_symbol): New function.
812
918fc1f8 8132014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 814
918fc1f8
CC
815 * output.cc (Output_data_dynamic::Dynamic_entry::write):
816 Get the value of DYNAMIC_CUSTOM dynamic entry.
817 * output.h (Output_data_dynamic::add_custom): New function.
818 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
819 dynamic entry.
820 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
821 * target.h (Target::dynamic_tag_custom_value): New function.
822 (Target::do_dynamic_tag_custom_value): New function.
823
98ff9231
CC
8242014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
825
826 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
827 dynsym indexes.
828 * target.h (Target::has_custom_set_dynsym_indexes): New function.
829 (Target::do_has_custom_set_dynsym_indexes): New function.
830 (Target::set_dynsym_indexes): New function.
831 (Target::do_set_dynsym_indexes): New function.
832
b80eed39
AM
8332014-03-07 Alan Modra <amodra@gmail.com>
834
835 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
836 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
837 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
838 (Powerpc_relocate_functions::has_overflow_bitfield,
839 overflowed): Use the above.
840 (Target_powerpc::Relocate::relocate): Correct overflow checking
841 for a number of relocations. Modify overflow test for 16-bit
842 fields in instructions to signed/unsigned according to whether
843 the field takes a signed or unsigned value.
844
4b95cf5c
AM
8452014-03-05 Alan Modra <amodra@gmail.com>
846
847 Update copyright years.
848
45965137
AM
8492014-03-05 Alan Modra <amodra@gmail.com>
850
851 * powerpc.cc (Target_powerpc::Scan::local, global): Support
852 R_PPC64_ADDR64_LOCAL.
853 (Target_powerpc::Relocate::relocate): Likewise.
854
2c80b753
AM
8552014-03-03 Alan Modra <amodra@gmail.com>
856
857 * dwp.cc (print_version): Update copyright year to current.
858
c1c69e83
AM
8592014-02-10 Alan Modra <amodra@gmail.com>
860
861 * po/gold.pot: Regenerate.
862
dd0c4e70
CC
8632014-02-06 Cary Coutant <ccoutant@google.com>
864
865 Fix problem where -u is ignored when a weak undef is seen.
866
867 * archive.cc (Library_base::should_include_member): Reorder
868 code to check for -u option if a weak undef has already been seen.
869 * testsuite/Makefile.am (weak_undef_test_2): New test case.
870 * testsuite/Makefile.in: Regenerate.
871 * testsuite/weak_undef_file3.cc: New file.
872 * testsuite/weak_undef_file4.cc: New file.
873 * testsuite/weak_undef_test_2.cc: New file.
874
1a221d3d
CC
8752014-02-05 Cary Coutant <ccoutant@google.com>
876
877 Fix issues with gold undefined symbol diagnostics.
878
879 PR binutils/15435
880 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
881 check to here.
882 * target-reloc.h (is_strong_undefined): New function.
883 (relocate_section): Move undef vtable symbol check from here.
884 Check for is_strong_undefined.
885
e889f0a4 8862014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 887
e889f0a4
CC
888 Fix problems with the --dynamic-list option.
889
890 PR gold/13577
891 * options.cc (General_options::parse_dynamic_list):
892 Set have_dynamic_list_.
893 (General_options::General_options): Initialize have_dynamic_list_.
894 (General_options::finalize): Turn off -Bsymbolic and
895 -Bsymbolic-functions if --dynamic-list provided.
896 * options.h (General_options::have_dynamic_list): New function.
897 (General_options::have_dynamic_list_): New data member.
898 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
899 correctly.
5fe7ffdc 900
e889f0a4
CC
901 PR gold/16530
902 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
903 in --dynamic-list, mark it.
5fe7ffdc 904
e889f0a4
CC
905 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
906 (dynamic_list_2): New test case.
907 * testsuite/Makefile.in: Regenerate.
908 * testsuite/dynamic_list_2.cc: New file.
909 * testsuite/dynamic_list_2.t: New file.
910 * testsuite/dynamic_list_lib1.cc: New file.
911 * testsuite/dynamic_list_lib2.cc: New file.
912 * testsuite/gc_dynamic_list_test.c: New file.
913 * testsuite/gc_dynamic_list_test.sh: New file.
914 * testsuite/gc_dynamic_list_test.t: New file.
915
ec673e64
CC
9162014-01-28 Cary Coutant <ccoutant@google.com>
917
918 Add .gdb_index version 7 support.
919
920 * gold/dwarf_reader.cc: include <utility> (for make_pair).
921 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
922 debug sections.
923 (Dwarf_ranges_table::read_ranges_table): Likewise.
924 (Dwarf_pubnames_table::read_section): Check for GNU-style
925 sections, and for compressed debug sections.
926 (Dwarf_pubnames_table::read_header): Compute end address of table.
927 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
928 for end of list by offset, not by offset == 0.
929 (Dwarf_info_reader::do_read_string_table): Check for compressed
930 debug sections.
931 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
932 Initialize new data members.
933 (Dwarf_pubnames_table::next_name): return flag_byte.
934 (Dwarf_pubnames_table::end_of_table_): New data member.
935 (Dwarf_pubnames_table::is_gnu_style_): New data member.
936 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
937 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
938 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
939 read skeleton type unit DIEs.
940 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
941 (Gdb_index::do_write): Write flag_byte.
942 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
943 (Gdb_index::Cu_vector): Store flags along with cu indexes.
944 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
945 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
946
221fd5d5
L
9472014-01-08 H.J. Lu <hongjiu.lu@intel.com>
948
949 * version.cc (print_version): Update copyright year to 2014.
950
6c09fb0b
ILT
9512013-12-19 Dimitry Andric <dimitry@andric.com>
952
953 * stringpool.cc (Stringpool_template::reserve): Add
954 HAVE_UNORDERED_MAP case.
955 * stringpool.cc (Stringpool_template::print_stats): Likewise.
956
8356f2d0
CC
9572013-12-18 Cary Coutant <ccoutant@google.com>
958
959 * configure.ac: Check for <unordered_set> and <unordered_map>.
960 * config.in: Regenerate.
961 * configure: Regenerate.
962 * system.h: Use <unordered_set> and <unordered_map> if available.
963
f2c7d7ee
RM
9642013-12-10 Roland McGrath <mcgrathr@google.com>
965
966 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
967 with $(INSTALL_PROGRAM_ENV).
968 * Makefile.in: Regenerate.
969
6632e8cc
CC
9702013-11-22 Cary Coutant <ccoutant@google.com>
971
972 * configure.ac: Add check for which library is needed for
973 dlopen.
974 * configure: Regenerate.
975
0c075858
CC
9762013-11-22 Cary Coutant <ccoutant@google.com>
977
978 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
979 assembler.
980 * testsuite/Makefile.in: Regenerate.
981
f49fe902
L
9822013-11-17 H.J. Lu <hongjiu.lu@intel.com>
983
984 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
985 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
986 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
987 (Target_x86_64<size>::Scan::local): Likewise.
988 (Target_x86_64<size>::Scan::global): Likewise.
989 (Target_x86_64<size>::Relocate::relocate): Likewise.
990 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
991 Likewise.
992 (Target_x86_64<size>::Scan::check_non_pic(): Handle
993 R_X86_64_PC32_BND.
994
995 * testsuite/Makefile.am (check_PROGRAMS): Add
996 exception_x86_64_bnd_test.
997 (exception_x86_64_bnd_test_SOURCES): New macro.
998 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
999 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1000 (exception_x86_64_bnd_test_LDADD): Likewise.
1001 (exception_x86_64_bnd_1.o): New rule.
1002 (exception_x86_64_bnd_2.o): Likewise.
1003 * testsuite/Makefile.in: Regenerated.
1004
9055360d
AM
10052013-11-15 Alan Modra <amodra@gmail.com>
1006
1007 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1008 accessor.
1009 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1010 Only call ppc64_local_entry_offset for 64-bit. Restrict
1011 symval_for_branch lookup to ELFv1.
1012 (Stub_table::add_plt_call_entry): Use unsigned int off.
1013 (Output_data_glink::Address, invalid_address): New.
1014 (Output_data_glink::add_eh_frame): Move out of line. Add
1015 support for ELFv2.
1016 (Output_data_glink::add_global_entry, find_global_entry,
1017 global_entry_address): New functions.
1018 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1019 ge_size): New variables.
1020 (Output_data_glink::set_final_data_size): Add global entry
1021 stub sizing.
1022 (Output_data_glink::do_write): Write global entry stubs.
1023 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1024 parameter. Return true for ELFv2. Adjust callers.
1025 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1026 ELFv1. Similarly for ifunc and dynamic relocation processing
1027 specific to ELFv1. Recognize that symbols are defined on
1028 their plt entries for ELFv2.
1029 (Target_powerpc::symval_for_branch): Assert if called for
1030 ELFv2 or ppc32.
1031 (Target_powerpc::Relocate::relocate): Use global entry plt
1032 stub for symbol value if such exists on ELFv2.
1033 (Target_powerpc::Relocate::relocate): Don't call
1034 symval_for_branch when ELFv2. Do adjust for local entry
1035 offset when ELFv2.
1036 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1037 plt stub for ELFv2.
1038 (Target_powerpc::do_plt_address_for_global): Similarly.
1039
cafdd569
CC
10402013-11-14 Cary Coutant <ccoutant@google.com>
1041
1042 Revert patch -- this did not fix the problem, and there is
1043 no race there.
1044
1045 2013-11-14 Cary Coutant <ccoutant@google.com>
1046
1047 PR gold/14860
1048 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1049 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1050 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1051 updating fde_offsets_.
1052 (Eh_frame_hdr::lock_): New data member.
1053
94e49e16
CC
10542013-11-14 Cary Coutant <ccoutant@google.com>
1055
1056 * dwp.cc (Dwo_file_entry): New type.
1057 (File_list): Use Dwo_file_entry.
1058 (Dwo_file::verify): New function.
1059 (Dwo_file::verify_dwo_list): New function.
1060 (Dwo_file::sized_verify_dwo_list): New function.
1061 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1062 list.
1063 (Dwp_options): New enum type.
1064 (dwp_options): Add --verify-only.
1065 (usage): Likewise.
1066 (main): Likewise.
1067 * dwp.h (gold_info): Add declaration.
1068
7cdd7d57
CC
10692013-11-14 Cary Coutant <ccoutant@google.com>
1070
1071 PR gold/14860
1072 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1073 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1074 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1075 updating fde_offsets_.
1076 (Eh_frame_hdr::lock_): New data member.
1077
1d946cb3
CC
10782013-11-06 Cary Coutant <ccoutant@google.com>
1079
1080 PR gold/15758
1081 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1082 before reloc sections.
1083
4f65b40e
AM
10842013-11-04 Alan Modra <amodra@gmail.com>
1085
1086 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1087 (Symbol::needs_dynamic_reloc): Test new flag.
1088 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1089 (Target_powerpc::Scan::get_reference_flags): Add target param.
1090 Return FUNC_DESC_ABI for 64-bit ELFv1.
1091 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1092 call.
1093 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1094 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1095
908794a9
CC
10962013-10-31 Cary Coutant <ccoutant@google.com>
1097
1098 Restore support for dwp v2 DWARF package file format.
1099
1100 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1101 tu_length parameter. Adjust all callers.
1102 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1103 * dwp.cc: Include dwarf.h.
1104 (Section_bounds): New struct type.
1105 (Unit_set): New struct type.
1106 (Dwo_file::Dwo_file): Initialize new data member.
1107 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1108 Combine and rename to...
1109 (Dwo_file::read_unit_index): ...this.
1110 (Dwo_file::sized_read_compunit_index)
1111 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1112 (Dwo_file::sized_read_unit_index): ...this.
1113 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1114 parameters; add section_id parameter.
1115 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1116 (Dwo_file::add_unit_set): ...this.
1117 (Dwo_file::shndx_map_): Remove.
1118 (Dwo_file::sect_offsets_): New data member.
1119 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1120 (Dwp_output_file::add_section): Rename to...
1121 (Dwp_output_file::add_contribution): ...this.
1122 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1123 (Dwp_output_file::add_tu_set): Likewise.
1124 (Dwp_output_file::Contribution): New type.
1125 (Dwp_output_file::Section::contributions): New data member.
1126 (Dwp_output_file::Cu_or_tu_set): Remove.
1127 (Dwp_output_file::Section::Section): New ctor.
1128 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1129 (Dwp_output_file::Dwp_index::Section_table): New type.
1130 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1131 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1132 parameter.
1133 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1134 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1135 (Dwp_output_file::Dwp_index::section_table): New member function.
1136 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1137 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1138 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1139 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1140 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1141 (Dwp_output_file::Dwp_index::section_table_): New data member.
1142 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1143 (Dwp_output_file::add_output_section): New member function.
1144 (Dwp_output_file::write_new_section): New member function.
1145 (Dwp_output_file::write_contributions): New member function.
1146 (Dwp_output_file::section_id_map_): New data member.
1147 (class Dwo_id_info_reader): Remove.
1148 (class Unit_reader): New class.
1149 (get_dwarf_section_name): New function.
1150 (Dwo_file::read_executable): Adjust initializations of class data.
1151 (Dwo_file::read): Add support for v2 package file format.
1152 (Dwo_file::read_unit_index): Likewise.
1153 (Dwo_file::sized_read_unit_index): Likewise.
1154 (Dwo_file::copy_section): Likewise.
1155 (Dwo_file::add_unit_set): Likewise.
1156 (Dwp_output_file::add_output_section): Likewise.
1157 (Dwp_output_file::add_contribution): Likewise.
1158 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1159 for empty slot.
1160 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1161 file format.
1162 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1163 slot.
1164 (Dwp_output_file::initialize): Remove unused function.
1165 (Dwp_output_file::finalize): Add support for v2 package file format.
1166 (Dwp_output_file::write_index): Likewise.
1167 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1168 function prototype.
1169
2500c017
CC
11702013-10-31 Cary Coutant <ccoutant@google.com>
1171
1172 * configure.ac: Fix check for -fmerge-constants.
1173 * configure.ac: Regenerate.
1174
dd0845d7
RM
11752013-10-30 Roland McGrath <mcgrathr@google.com>
1176
1177 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1178 Correct 9-byte nop sequence to match what the assembler generates.
1179
b4f7960d
AM
11802013-10-30 Alan Modra <amodra@gmail.com>
1181
1182 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1183 ppc64_local_entry_offset, ppc64_local_entry_offset,
1184 do_read_symbols): New functions.
1185 (Powerpc_relobj::e_flags_, st_other_): New vars.
1186 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1187 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1188 (Powerpc_relobj::e_flags_): New var.
1189 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1190 and adjust for ELFv2.
1191 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1192 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1193 (Powerpc_dynobj::do_find_special_sections): Likewise.
1194 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1195 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1196 to ELFv2 local entry.
1197 (Target_powerpc::do_relax): No thread safe barriers needed for
1198 ELFv2.
1199 (Output_data_plt_powerpc::initial_plt_entry_size_,
1200 plt_entry_size): Delete. Replace all uses with
1201 first_plt_entry_offset() and plt_entry_size().
1202 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1203 reserved_size parm. Update callers.
1204 (Output_data_plt_powerpc::entry_count): Update.
1205 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1206 and use Target_powerpc::first_plt_entry_offset().
1207 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1208 rename to plt_entry_size.
1209 (Output_data_plt_powerpc::add_ifunc_entry,
1210 add_local_ifunc_entry): Adjust reloc for ELFv2.
1211 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1212 (glink_eh_frame_fde_64v2): New.
1213 (Stub_table::plt_call_size): Support ELFv2 sizing.
1214 (Output_data_glink::add_eh_frame): Use the new FDE.
1215 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1216 (Stub_table::do_write): Write ELFv2 stubs and glink.
1217 (Target_powerpc::Relocate::relocate): Replaces nop after call
1218 with ld 2,24(1) and adjust local offset destination for ELFv2.
1219
f9c6b907
AM
12202013-10-30 Alan Modra <amodra@gmail.com>
1221
1222 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1223 (Target_powerpc::Scan::global, local): Likewise.
1224 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1225 on all ppc64 @h and @ha relocs.
1226
e84fe78f
AM
12272013-10-14 Alan Modra <amodra@gmail.com>
1228
1229 * output.h (Output_data_got::add_constant): Tidy.
1230 (Output_data_got::add_constant_pair): New function.
1231 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1232 methods used so as to first call reserve_ent().
1233
679e4abf
RM
12342013-10-11 Roland McGrath <mcgrathr@google.com>
1235
44dcb735
RM
1236 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1237 add_got_entry and add_got_entry_pair.
1238
13323c49
RM
1239 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1240 (HAVE_PUBNAMES): Likewise.
1241 * configure: Regenerate.
1242
1496b446
RM
1243 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1244 * testsuite/Makefile.in: Regenerate.
1245
cc84c10b
RM
1246 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1247 Remove const from declaration.
1248 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1249 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1250 * output.h (Output_file_header): Remove const from member target_
1251 and corresponding constructor argument.
1252 * output.cc (Output_file_header::Output_file_header): Update prototype.
1253 (Output_file_header::do_sized_write): Use this->target_ in place
1254 of parameters()->target().
1255
52f66a2c
RM
1256 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1257
2b64b551
RM
1258 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1259 * configure: Regenerate.
1260 * Makefile.in: Regenerate.
1261 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1262 * testsuite/merge_string_literals_2.c: Likewise.
1263 * testsuite/Makefile.am
1264 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1265 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1266 literal -fmerge-constants.
1267 * testsuite/Makefile.in: Regenerate.
1268
43819297
RM
1269 * i386.cc (Target_i386): Remove unused member dynbss_.
1270 * arm.cc (Target_arm): Likewise.
1271 * powerpc.cc (Target_powerpc): Likewise.
1272 * sparc.cc (Target_sparc): Likewise.
1273 * tilegx.cc (Target_tilegx): Likewise.
1274 * x86_64.cc (Target_x86_64): Likewise.
1275 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1276 type_signature_, type_offset_.
1277 * plugin.h (Plugin_hook): Remove unused member layout_.
1278 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1279 mapfile_.
1280 (Read_member): Remove unused members input_objects_, symtab_,
1281 mapfile_, layout_.
1282 (Check_library): Remove unused member symtab_.
1283 * archive.h (Lib_group): Remove unused member lib_.
1284 * archive.cc (Lib_group::Lib_group): Update initializer.
1285 * incremental.h (Incremental_binary): Remove unused member target_.
1286 (Incremental_script_entry): Removed unused member script_.
1287 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1288 * icf.h (Icf): Remove unused member num_tracked_relocs.
1289
39d9ead7
RM
1290 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1291 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1292 its only use.
1293 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1294
679e4abf
RM
1295 * archive.h: Use struct rather than class for forward declaration
1296 of Read_symbols_data.
1297
54de2ea6
CC
12982013-10-07 Cary Coutant <ccoutant@google.com>
1299
1300 PR gold/16010
1301 * testsuite/Makefile.am (icf_test): Fix dependencies.
1302 (icf_safe_test): Likewise.
1303 (icf_safe_so_test): Likewise.
1304 (large_symbol_alignment): Add empty _LDADD rule.
1305 * testsuite/Makefile.in: Regenerate.
1306
b14016f0
L
13072013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1308
1309 PR gold/15927
1310 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1311 relocation for R_X86_64_32 on x32.
1312
eb426534
RM
13132013-08-27 Roland McGrath <mcgrathr@google.com>
1314
1315 * output.cc (Output_segment::set_section_addresses): Take new
1316 Target* argument. If target->isolate_execinstr() and the segment
1317 is executable and starts at a target->abi_pagesize() boundary,
1318 pad its end out to a target->abi_pagesize() boundary with code fill.
1319 * output.h (Output_segment::set_section_addresses): Update decl.
1320 * layout.h (Layout::check_output_data_for_reset_values): Take new
1321 argument RELAX_OUTPUTS.
1322 (Layout): New member relax_output_list_.
1323 (Layout::add_relax_output): New method.
1324 * layout.cc (Layout::Layout): Update constructor.
1325 (Layout::reset_relax_output): New method.
1326 (Layout::clean_up_after_relaxation): Call it.
1327 (Layout::prepare_for_relaxation): Update caller.
1328 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1329 Call reset_relax_output before re-processing segments for
1330 isolate_execinstr case.
1331 (Layout::write_data): Handle relax_output_list_.
1332 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1333 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1334
9aff4b7a
NC
13352013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1336
1337 PR binutils/15834
1338 * object.h: Fix typos.
1339
93f8221c
RM
13402013-08-16 Roland McGrath <mcgrathr@google.com>
1341
1342 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1343 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1344
e44c3715
CC
13452013-08-07 Cary Coutant <ccoutant@google.com>
1346
1347 Revert support for v2 DWP files:
1348
1349 2013-03-01 Cary Coutant <ccoutant@google.com>
1350
1351 Add dwp support for v2 DWARF package file format.
1352 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1353 tu_length parameter. Adjust all callers.
1354 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1355 * dwp.cc: Include dwarf.h.
1356 (Section_bounds): New struct type.
1357 (Unit_set): New struct type.
1358 (Dwo_file::Dwo_file): Initialize new data member.
1359 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1360 Combine and rename to...
1361 (Dwo_file::read_unit_index): ...this.
1362 (Dwo_file::sized_read_compunit_index)
1363 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1364 (Dwo_file::sized_read_unit_index): ...this.
1365 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1366 parameters; add section_id parameter.
1367 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1368 (Dwo_file::add_unit_set): ...this.
1369 (Dwo_file::shndx_map_): Remove.
1370 (Dwo_file::sect_offsets_): New data member.
1371 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1372 (Dwp_output_file::add_section): Rename to...
1373 (Dwp_output_file::add_contribution): ...this.
1374 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1375 (Dwp_output_file::add_tu_set): Likewise.
1376 (Dwp_output_file::Contribution): New type.
1377 (Dwp_output_file::Section::contributions): New data member.
1378 (Dwp_output_file::Cu_or_tu_set): Remove.
1379 (Dwp_output_file::Section::Section): New ctor.
1380 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1381 (Dwp_output_file::Dwp_index::Section_table): New type.
1382 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1383 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1384 parameter.
1385 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1386 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1387 (Dwp_output_file::Dwp_index::section_table): New member function.
1388 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1389 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1390 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1391 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1392 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1393 (Dwp_output_file::Dwp_index::section_table_): New data member.
1394 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1395 (Dwp_output_file::add_output_section): New member function.
1396 (Dwp_output_file::write_new_section): New member function.
1397 (Dwp_output_file::write_contributions): New member function.
1398 (Dwp_output_file::section_id_map_): New data member.
1399 (class Dwo_id_info_reader): Remove.
1400 (class Unit_reader): New class.
1401 (get_dwarf_section_name): New function.
1402 (Dwo_file::read_executable): Adjust initializations of class data.
1403 (Dwo_file::read): Add support for v2 package file format.
1404 (Dwo_file::read_unit_index): Likewise.
1405 (Dwo_file::sized_read_unit_index): Likewise.
1406 (Dwo_file::copy_section): Likewise.
1407 (Dwo_file::add_unit_set): Likewise.
1408 (Dwp_output_file::add_output_section): Likewise.
1409 (Dwp_output_file::add_contribution): Likewise.
1410 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1411 for empty slot.
1412 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1413 file format.
1414 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1415 slot.
1416 (Dwp_output_file::initialize): Remove unused function.
1417 (Dwp_output_file::finalize): Add support for v2 package file format.
1418 (Dwp_output_file::write_index): Likewise.
1419 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1420 function prototype.
1421
c6905c28
CC
14222013-07-31 Cary Coutant <ccoutant@google.com>
1423
1424 * object.cc (Sized_relobj::do_output_section_address): New function.
1425 (Sized_relobj): Instantiate explicitly.
1426 * object.h (Object::output_section_address): New function.
1427 (Object::do_output_section_address): New function.
1428 (Sized_relobj::do_output_section_address): New function.
1429 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1430
14312013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1432 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1433
1434 * parameters.cc (Parameters::entry): Return target-specific entry
1435 symbol name.
1436 * target.h (Target::entry_symbol_name): New function.
1437 (Target_info::entry_symbol_name): New data member.
1438
1439 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1440 * i386.cc (Target_i386::i386_info): Likewise.
1441 (Target_i386_nacl::i386_nacl_info): Likewise.
1442 * sparc.cc (Target_sparc::sparc_info): Likewise.
1443 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1444 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1445 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1446 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1447
234d4ab8
SA
14482013-07-22 Sterling Augustine <saugustine@google.com>
1449
1450 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1451 Convert parameter shndx to local variable. Add parameters symtab
1452 and symtab_size. Scan over section names. Find relocation
1453 section corresponding to current section. Create and initialize
1454 reloc_mapper_ and reloc_type_.
1455 (Dwarf_pubnames_table::read_header): Add assertion. Change
1456 unit_length to off_t. Initialize member unit_length_. Fill in field
1457 cu_offset_.
1458 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1459 Initialize new fields unit_length_ and cu_offset_.
1460 (Dwarf_pubnames_table::read_section): Update prototype.
1461 (Dwarf_pubnames_table::cu_offset): New member function.
1462 (Dwarf_pubnames_table::subsection_size): Likewise.
1463 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1464 New fields.
1465 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1466 member functions public.
1467 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1468 Update comment. Rework logic. Move repeated parts to...
1469 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1470 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1471 pubtypes_table_, and stmt_list_offset.
1472 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1473 Gdb_index::find_pubtype_offset,
1474 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1475 (Gdb_index::pubnames_read): Update prototype and rework logic.
1476 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1477 Forward declare.
1478 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1479 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1480 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1481 Gdb_index::map_pubtable_to_dies):
1482 Declare functions.
1483 (Gdb_index::pubnames_read): Update declaration.
1484 (Gdb_index::Pubname_offset_map): New type.
1485 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1486 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1487 Gdb_index::stmt_list_offset): Declare.
1488 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1489 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1490 Gdb_index::pubtypes_offset_): Remove.
1491
a3ed37d8
RM
14922013-07-19 Roland McGrath <mcgrathr@google.com>
1493
1494 * options.h (General_options): Add -Trodata-segment option.
1495 * parameters.cc (Parameters::check_rodata_segment): New function.
1496 (Parameters::set_target_once): Call it.
1497 * parameters.h (Parameters): Declare it (private member function).
1498 * layout.cc (load_seg_unusable_for_headers): New function, broken
1499 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1500 then validate rodata segment rather than text segment.
1501 (relaxation_loop_body): Call that.
1502 (is_text_segment): New function. Don't admit a non-executable
1503 segment if TARGET->isolate_execinstr().
1504 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1505
eb5b4ded
CC
15062013-07-15 Shawn Landden <shawnlandden@gmail.com>
1507
1508 PR gold/15070
1509 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1510 * nacl.h (Sniff_file::View::View): Request aligned view.
1511
4d5effb9
CC
15122013-07-11 Cary Coutant <ccoutant@google.com>
1513
1514 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1515 correct BRLT entry size.
1516
ba8ca3e7
AM
15172013-07-03 Alan Modra <amodra@gmail.com>
1518
1519 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1520 comment.
1521
267257d2
CC
15222013-07-01 Cary Coutant <ccoutant@google.com>
1523
1524 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1525 reloc_type_.
1526 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1527 (Dwarf_ranges_table::lookup_reloc): New function.
1528 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1529 reloc_type_.
1530 (Dwarf_ranges_table::lookup_reloc): New function.
1531 (Dwarf_ranges_table::reloc_type_): New data member.
1532
06f30c9d
CC
15332013-06-27 Jing Yu <jingyu@google.com>
1534
1535 PR gold/15662
1536 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1537 function.
1538 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1539 (Target_powerpc::do_relax): Call the above.
1540
a2d7bf59
AM
15412013-06-27 Cary Coutant <ccoutant@google.com>
1542
1543 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1544 on garbage collected .opd section.
1545
15462013-06-27 Alan Modra <amodra@gmail.com>
1547
1548 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1549 is non-zero.
1550 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1551 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1552
32364e50
CC
15532013-06-14 Cary Coutant <ccoutant@google.com>
1554
1555 * resolve.cc (Symbol::override_base): Don't override st_type
1556 from plugin placeholder symbols.
1557 (Symbol_table::resolve): Likewise.
1558 (Symbol_table::should_override): Don't complain about TLS mismatch
1559 if the TO symbol is a plugin placeholder.
1560 * testsuite/Makefile.am (plugin_test_tls): New test.
1561 * testsuite/Makefile.in: Regenerate.
1562 * testsuite/plugin_test_tls.sh: New test script.
1563 * testsuite/two_file_test_2_tls.cc: New test source.
1564 * testsuite/two_file_test_tls.cc: New test source.
1565
7fb47cc9
CC
15662013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1567
1568 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1569 the maximum segment alignment is larger than the page size.
1570 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1571 correctly aligns the symbols with large alignemnt.
1572 * testsuite/Makefile.in: Regenerate.
1573 * testsuite/large_symbol_alignment.cc: New file.
1574
6934001a
CC
15752013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1576 Sriraman Tallam <tmsriram@google.com>
1577
1578 * options.h (sort_section): New option.
1579 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1580 Rename from Input_section_sort_section_name_special_ordering_compare.
1581 (Input_section_sort_section_name_compare): New struct.
1582 * output.cc (Output_section::Input_section_sort_section_name_compare::
1583 operator()): New function.
1584 (Output_section::sort_attached_input_sections): Use new sort function
1585 for .text if --sort-section=name is specified.
1586 * layout.cc (Layout::make_output_section):
1587 Add sorting by name when --sort-section=name is specified.
1588 * testsuite/Makefile.am (text_section_grouping): Test option
1589 --sort-section=name.
1590 * testsuite/Makefile.in: Regenerate.
1591 * testsuite/section_sorting_name.cc: New file.
1592 * testsuite/section_sorting_name.sh: New file.
1593
93acabad
CC
15942013-05-21 Cary Coutant <ccoutant@google.com>
1595
1596 * symtab.h (Symbol::is_cxx_vtable): New function.
1597 * target-reloc.h (relocate_section): Check for vtable symbol.
1598 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1599 * testsuite/Makefile.in: Regenerate.
1600 * testsuite/missing_key_func.cc: New test source.
1601 * testsuite/missing_key_func.sh: New test script.
1602
60e8b3fc
CC
16032013-05-21 Cary Coutant <ccoutant@google.com>
1604
2b64b551
RM
1605 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1606 type of enclosing symbol.
1607 (Relocate_info::location): Check symbol type when describing symbol.
1608 * object.h (Symbol_location_info): Remove unused line_number;
1609 add enclosing_symbol_type.
1610 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1611
9df9de2c
CC
16122013-05-13 Cary Coutant <ccoutant@google.com>
1613
2b64b551
RM
1614 * configure.ac: Export DEFAULT_TARGET.
1615 * configure: Regenerate.
1616 * Makefile.in: Regenerate.
1617 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1618 * testsuite/Makefile.in: Regenerate.
1619 * testsuite/debug_msg.sh: Delete duplicate tests.
1620 Don't check undef_int error message match for powerpc where the
1621 source file and line number aren't available.
9df9de2c 1622
bbc5ae17
RM
16232013-05-10 Roland McGrath <mcgrathr@google.com>
1624
1625 * options.h (General_options): Add --rosegment-gap option.
1626 * options.cc (finalize): --rosegment-gap implies --rosegment.
1627 * layout.cc (set_segment_offsets): Let user option override
1628 target->rosegment_gap().
1629
0c6e6c39
RM
16302013-05-10 Roland McGrath <mcgrathr@google.com>
1631
1632 * options.h (General_options): Remove leading space from help
1633 messages for -nostdlib and --rosegment.
1634
cde7cb01
MR
16352013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1636
1637 PR ld/15365
1638 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1639
f31ae5b8
AM
16402013-05-03 Alan Modra <amodra@gmail.com>
1641
1642 * merge.cc (Output_merge_string::do_add_input_section): Correct
1643 scan for number of strings. Rename vars to avoid shadowing.
1644 Include missing terminator in input_size_.
1645
d3a7cd45
L
16462013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1647
1648 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1649 Restore empty string handling.
1650
6ad3daba
CC
16512013-05-01 Cary Coutant <ccoutant@google.com>
1652
1653 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1654 uninitialized warning.
1655
e31908b6
CC
16562013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1657
1658 * output.cc (Output_section::add_merge_input_section): Allow
1659 to merge sections if the alignment is more than character size.
1660 * merge.h (Output_merge_string::Output_merge_string): Remove
1661 assert.
1662 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1663 only not-null strings. Check the alignment of strings.
1664 * stringpool.h
1665 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1666 alignment as the argument.
1667 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1668 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1669 Align non-zero length strings according to the addralign_.
1670 (Stringpool_template<Stringpool_char>::set_string_offsets):
1671 Updating offsets according to the given alignment.
1672 * testsuite/Makefile.am (text_section_grouping): Test if string
1673 literals are getting merged.
1674 * testsuite/Makefile.in: Regenerate.
1675 * testsuite/merge_string_literals_1.c: New file.
1676 * testsuite/merge_string_literals_2.c: Ditto.
1677 * testsuite/merge_string_literals.sh: Ditto.
1678
0e804863
ILT
16792013-04-26 Ian Lance Taylor <iant@google.com>
1680
1681 * target-reloc.h (relocate_section): If the reloc offset is out of
1682 range, pass VIEW as NULL to relocate.relocate.
1683 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1684 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1685 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1686 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1687 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1688 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1689
e7c5ea40
CC
16902013-04-26 Geoff Pike <gpike@chromium.org>
1691
1692 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1693 * layout.cc (Hash_task): New class.
1694 (Layout::queue_build_id_tasks): New function.
1695 (Layout::write_build_id): Handle single-thread portion of build ID
1696 computation. (In some cases, all of it is single-threaded.) Replace
1697 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1698 functionality in fewer lines of code.
1699 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1700 * options.h (General_options): make "--build-id" default to tree
1701 rather than sha1. Add two new options related to --build-id=tree:
1702 --build-id-chunk-size-for-treehash and
1703 --build-id-min-file-size-for-treehash.
1704 * Makefile.am: add testing of --build-id=tree and related new options
1705 (these tests will be invoked by "make check").
1706 * Makefile.in: Regenerate.
1707
49926cd0
AM
17082013-04-25 Alan Modra <amodra@gmail.com>
1709
1710 * configure.tgt: Add powerpcle and powerpc64le.
1711
a4034750
AM
17122013-04-22 Alan Modra <amodra@gmail.com>
1713
1714 PR gold/15355
1715 * layout.cc (Layout::segment_precedes): Allow more than one
1716 segment with the same type and flags.
1717
e79c84aa
CC
17182013-04-15 Cary Coutant <ccoutant@google.com>
1719
1720 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1721 allocate space in file for BSS sections.
1722
2199fbe7
CC
17232013-04-15 Cary Coutant <ccoutant@google.com>
1724
1725 * script-sections.cc (Orphan_output_section): Reset address
1726 to zero after each orphaned section for relocatable links.
1727
502e8a84
CC
17282013-04-15 Cary Coutant <ccoutant@google.com>
1729
a4034750
AM
1730 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1731 section starting address for relocatable link.
1732 * testsuite/Makefile.am (script_test_11): New test.
1733 * testsuite/Makefile.in: Regenerate.
1734 * testsuite/script_test_11.c: New source file.
1735 * testsuite/script_test_11.t: New linker script.
502e8a84 1736
0cfdc767
AM
17372013-04-13 Alan Modra <amodra@gmail.com>
1738
1739 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1740 owner when sections are not adjacent and exceed group size.
1741 (Target_powerpc::group_sections): Handle corner case.
1742 (Target_powerpc::Branch_info::make_stub): Handle case where
1743 stub table doesn't exist due to branches in non-exec sections.
1744 (Target_powerpc::Relocate::relocate): Likewise.
1745
6830ee24
AM
17462013-04-11 Alan Modra <amodra@gmail.com>
1747
1748 PR gold/15354
1749 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1750 .branch_lt to match bfd ld. Adjust comments throughout file.
1751
54a3d865
ILT
17522013-04-04 Ian Lance Taylor <iant@google.com>
1753
1754 GCC PR c++/56840
1755 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1756 sections before checking whether they are included in the link.
1757
9993ba11
ST
17582013-03-29 Sriraman Tallam <tmsriram@google.com>
1759
1760 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1761 object before calling the plugin claim_file handler. Pass the elf
1762 object of the archive to the plugin. Delete the elf object if the
1763 plugin claims the file.
1764
ebacd51e
AM
17652013-03-21 Alan Modra <amodra@gmail.com>
1766
1767 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1768 segment when omagic.
1769
117be58f
AM
17702013-03-21 Alan Modra <amodra@gmail.com>
1771
1772 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1773 comparison warning.
1774 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1775 uninitialized" warning.
1776
32e2b61d
AM
17772013-03-20 Alan Modra <amodra@gmail.com>
1778
1779 * symtab.h (Symbol::clear_version): New function.
1780 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1781 is_needed by weak references. Clear version for symbols defined
1782 in as-needed objects that are not needed.
1783
b3ccdeb5
AM
17842013-03-15 Alan Modra <amodra@gmail.com>
1785
1786 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1787 static and public. Add report_err param. Return false for data refs.
1788 (Target_powerpc::rela_dyn_section): New overloaded function.
1789 (Target_powerpc::plt_, iplt_): Elucidate.
1790 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1791 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1792 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1793 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1794 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1795 push_branch and make_plt_entry for ifunc syms when
1796 reloc_needs_plt_for_ifunc.
1797 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1798 for ifunc unless reloc_needs_plt_for_ifunc.
1799
ad3d8a2f
AM
18002013-03-15 Alan Modra <amodra@gmail.com>
1801
1802 * gc.h (gc_process_relocs): Don't look through function descriptors.
1803 * icf.cc (get_section_contents): Do so here instead.
1804
4d9aa155
AM
18052013-03-13 Alan Modra <amodra@gmail.com>
1806
1807 * powerpc.cc (is_branch_reloc): Forward declare.
1808 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1809 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1810 false for 64-bit, true for 32-bit non-branch relocs.
1811 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1812 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1813 nm output.
1814 (icf_safe_test): Generate linker map file as well as nm output.
1815 (icf_safe_so_test): Likewise.
1816 * testsuite/Makefile.in: Regenerate.
1817 * testsuite/icf_test.sh: Parse linker map file to determine
1818 section folding.
1819 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1820 * testsuite/icf_safe_so_test.sh: Likewise.
1821 (X86_32_or_ARM_specific_safe_fold): Merge into..
1822 (arch_specific_safe_fold): ..this.
1823 (X86_64_specific_safe_fold): Delete unused function.
1824
57420c20
AM
18252013-03-12 Alan Modra <amodra@gmail.com>
1826
1827 * gc.h (gc_process_relocs): Look through function descriptors
1828 to determine shndx, symvalue and addend used by ICF. Tidy
1829 variable duplication.
1830
dc3714f3
AM
18312013-03-11 Alan Modra <amodra@gmail.com>
1832
1833 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1834 * layout.cc (Layout_task_runner::run): ..to here.
1835 * symtab.h (struct Symbol_location): Extract from..
1836 (class Symbol_table): ..here.
1837 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1838 * target.h (class Target): Add function_location and
1839 do_function_location functions.
1840 (class Sized_target): Add do_function_location.
1841 * object.h (class Sized_relobj_file): Move find_shdr..
1842 (class Object): ..to here.
1843 * object.cc: Likewise. Update to suit. Instantiate.
1844 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1845 * powerpc.cc (class Powerpc_dynobj): New.
1846 (Target_powerpc::do_function_location): New function.
1847 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1848 (Powerpc_dynobj::do_read_symbols): New function.
1849 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1850
956b03bb
ILT
18512013-03-08 Ian Lance Taylor <iant@google.com>
1852
1853 * options.cc (General_options::string_to_object_format): Accept
1854 "default".
1855
4bead2d5
AM
18562013-03-08 Alan Modra <amodra@gmail.com>
1857
1858 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1859 pointer to Post_fde.
1860 (struct Post_fde): Move definition to here..
1861 * ehframe.cc (struct Post_fde): ..from here.
1862 (Cie::write): Don't alloc Post_fde.
1863 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1864
02e60bf7
AM
18652013-03-07 Alan Modra <amodra@gmail.com>
1866
1867 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1868 relocation referencing .LC0.
1869 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1870
8343f03a
AM
18712013-03-07 Alan Modra <amodra@gmail.com>
1872
1873 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1874 always_inline. Add assembly for powerpc to avoid GOT.
1875
3366d57c
AM
18762013-03-07 Alan Modra <amodra@gmail.com>
1877
1878 * testsuite/script_test_10.sh: Don't test .bss section
1879 header number.
1880
6c77229c
AM
18812013-03-06 Alan Modra <amodra@gmail.com>
1882
1883 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1884 (Target_powerpc::symval_for_branch): Add symtab param. Update
1885 all callers. Handle folded sections.
1886 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1887 to Powerpc_relobj.
1888 (Global_symbol_visitor_opd::operator()): Likewise.
1889
a39e4af6
AM
18902013-03-04 Alan Modra <amodra@gmail.com>
1891
1892 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1893 * testsuite/Makefile.in: Regenerate.
1894
d5834edb
CC
18952013-03-01 Cary Coutant <ccoutant@google.com>
1896
1897 Add dwp support for v2 DWARF package file format.
1898 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1899 tu_length parameter. Adjust all callers.
1900 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1901 * dwp.cc: Include dwarf.h.
1902 (Section_bounds): New struct type.
1903 (Unit_set): New struct type.
1904 (Dwo_file::Dwo_file): Initialize new data member.
1905 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1906 Combine and rename to...
1907 (Dwo_file::read_unit_index): ...this.
1908 (Dwo_file::sized_read_compunit_index)
1909 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1910 (Dwo_file::sized_read_unit_index): ...this.
1911 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1912 parameters; add section_id parameter.
1913 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1914 (Dwo_file::add_unit_set): ...this.
1915 (Dwo_file::shndx_map_): Remove.
1916 (Dwo_file::sect_offsets_): New data member.
1917 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1918 (Dwp_output_file::add_section): Rename to...
1919 (Dwp_output_file::add_contribution): ...this.
1920 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1921 (Dwp_output_file::add_tu_set): Likewise.
1922 (Dwp_output_file::Contribution): New type.
1923 (Dwp_output_file::Section::contributions): New data member.
1924 (Dwp_output_file::Cu_or_tu_set): Remove.
1925 (Dwp_output_file::Section::Section): New ctor.
1926 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1927 (Dwp_output_file::Dwp_index::Section_table): New type.
1928 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1929 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1930 parameter.
1931 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1932 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1933 (Dwp_output_file::Dwp_index::section_table): New member function.
1934 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1935 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1936 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1937 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1938 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1939 (Dwp_output_file::Dwp_index::section_table_): New data member.
1940 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1941 (Dwp_output_file::add_output_section): New member function.
1942 (Dwp_output_file::write_new_section): New member function.
1943 (Dwp_output_file::write_contributions): New member function.
1944 (Dwp_output_file::section_id_map_): New data member.
1945 (class Dwo_id_info_reader): Remove.
1946 (class Unit_reader): New class.
1947 (get_dwarf_section_name): New function.
1948 (Dwo_file::read_executable): Adjust initializations of class data.
1949 (Dwo_file::read): Add support for v2 package file format.
1950 (Dwo_file::read_unit_index): Likewise.
1951 (Dwo_file::sized_read_unit_index): Likewise.
1952 (Dwo_file::copy_section): Likewise.
1953 (Dwo_file::add_unit_set): Likewise.
1954 (Dwp_output_file::add_output_section): Likewise.
1955 (Dwp_output_file::add_contribution): Likewise.
1956 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1957 for empty slot.
1958 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1959 file format.
1960 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1961 slot.
1962 (Dwp_output_file::initialize): Remove unused function.
1963 (Dwp_output_file::finalize): Add support for v2 package file format.
1964 (Dwp_output_file::write_index): Likewise.
1965 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1966 function prototype.
1967
a68a081d
CC
19682013-03-01 Cary Coutant <ccoutant@google.com>
1969
1970 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1971 function into class definition in header file.
1972 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1973 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1974 New function.
1975 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1976
9d5781f8
AM
19772013-02-28 Alan Modra <amodra@gmail.com>
1978
1979 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1980 * target.cc (Target::do_plt_fde_location): New function.
1981 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1982 accessor function, and constructor param.
1983 (struct Post_fde, Post_fdes): Declare.
1984 (Cie::write): Add post_fdes param.
1985 * ehframe.cc (Fde::write): Use plt_fde_location.
1986 (struct Post_fde): Define.
1987 (Cie::write): Stash FDEs added post merge mapping.
1988 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1989 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1990 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1991 other FDEs.
1992 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1993 (Target_powerpc::has_glink): New function.
1994 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1995 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1996 glink_eh_frame_fde_32, default_fde): New data.
1997 (Stub_table::eh_frame_added_): New var.
1998 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1999 Make const.
2000 (Stub_table::add_eh_frame): New function.
2001 (Output_data_glink::add_eh_frame): New function.
2002 (Target_powerpc::make_glink_section): Call add_eh_frame.
2003
214383dd
ILT
20042013-02-15 Ian Lance Taylor <iant@google.com>
2005
2006 * options.h (DEFINE_uint64_alias): Define.
2007 (class General_options): Add -Ttext-segment as an alias for
2008 -Ttext.
2009
91c2b899
AM
20102013-02-15 Alan Modra <amodra@gmail.com>
2011
2012 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2013 (Stub_table::do_write): ..here, two places.
2014 (Stub_table::plt_call_size): Use it here too.
2015
20e2a8aa
ILT
20162013-02-11 Ian Lance Taylor <iant@google.com>
2017
2018 * descriptors.cc (Descriptors::close_all): New function.
2019 * descriptors.h (class Descriptors): Declare close_all.
2020 (close_all_descriptors): New inline function.
2021 * plugin.cc: Include "descriptors.h".
2022 (Plugin_manager::cleanup): Call close_all_descriptors.
2023
8952bc69
AM
20242013-02-06 Alan Modra <amodra@gmail.com>
2025
2026 * README: Update coding style link.
2027
29bd8b6b
CC
20282013-01-28 Cary Coutant <ccoutant@google.com>
2029
a4034750
AM
2030 * dwp.cc (File_list): New typedef.
2031 (Dwo_name_info_reader): New class.
2032 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2033 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2034 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2035 (Dwo_file::read_executable): New function.
2036 (Dwo_file::read): Move common setup code to ...
2037 (Dwo_file::make_object): ... here.
2038 (dwp_options): Add --exec/-e.
2039 (usage): Likewise.
2040 (main): Likewise.
29bd8b6b 2041
c6ac678d
ST
20422013-01-24 Sriraman Tallam <tmsriram@google.com>
2043
2044 * layout.cc (Layout::layout): Check for option text_reorder.
2045 (Layout::make_output_section): Ditto.
2046 * options.h (text_reorder): New option.
2047 * output.cc (Input_section_sort_compare): Remove special ordering
2048 of section names.
2049 (Output_section::
2050 Input_section_sort_section_name_special_ordering_compare::
2051 operator()): New function.
2052 (Output_section::sort_attached_input_sections): Use new sort function
2053 for .text.
2054 * output.h (Input_section_sort_section_name_special_ordering_compare):
2055 New struct.
2056 * testsuite/Makefile.am (text_section_grouping): Test option
2057 --no-text-reorder
2058 * testsuite/Makefile.in: Regenerate.
2059 * testsuite/text_section_grouping.sh: Check order of functions without
2060 default text reordering.
2061
50701cc1
MF
20622013-01-18 Mike Frysinger <vapier@gentoo.org>
2063
2064 * options.h (General_options): Change default to true for new_dtags.
2065
b1b00fcc
MF
20662013-01-18 Mike Frysinger <vapier@gentoo.org>
2067
2068 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2069 when enable_new_dtags is false. Only add DT_RUNPATH when
2070 enable_new_dtags is true.
2071
ec5b8187
AM
20722013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2073
2074 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2075 used in declaration and definition consistent.
2076 (Target_powerpc::symval_for_branch): Ditto.
2077
a880d4c4
ST
20782013-01-16 Sriraman Tallam <tmsriram@google.com>
2079
2080 * testsuite/plugin_final_layout.cc: Fix comment.
2081
7c381248
ST
20822013-01-16 Sriraman Tallam <tmsriram@google.com>
2083
2084 * layout.cc (Layout::layout): Do not do default sorting for
2085 text sections when section ordering is specified.
2086 (make_output_section): Ditto.
2087 * testsuite/plugin_final_layout.cc: Name the function sections
2088 to catch reordering issues.
2089
e2458743
AM
20902013-01-15 Alan Modra <amodra@gmail.com>
2091
2092 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2093 plt-thread-safe.
2094
431ed302
AM
20952013-01-15 Alan Modra <amodra@gmail.com>
2096
2097 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2098 * testsuite/Makefile.in: Regenerate.
2099
0ec6429b
AM
21002013-01-14 Alan Modra <amodra@gmail.com>
2101
2102 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2103 * testsuite/Makefile.in: Regenerate.
2104
0bf402d5
ILT
21052013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2106
36af3926 2107 PR bfd/14430
0bf402d5
ILT
2108 Fix mingw gold build with plugins enabled
2109 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2110 * configure.ac: Export DLOPEN_LIBS and add headers check.
2111 * plugin.cc: Handle non-dlfcn case.
2112 * Makefile.in: Regenerate.
2113 * config.in: Regenerate.
2114 * configure: Regenerate.
2115 * testsuite/Makefile.in: Regenerate.
2116
9e9143bc
ST
21172013-01-09 Sriraman Tallam <tmsriram@google.com>
2118
2119 * output.h (sort_attached_input_sections): Change to be public.
2120 * script-sections.cc
2121 (Output_section_definition::set_section_addresses): Sort
2122 attached input sections according to section order before linker
2123 script assigns section addresses.
2124 (Orphan_output_section::set_section_addresses): Sort
2125 attached input sections according to section order before linker
2126 script assigns section addresses.
2127 * Makefile.am (final_layout.sh): Use a simple linker script to
2128 check if section ordering still works.
2129 * Makefile.in: Regenerate.
2130
679af368
ILT
21312013-01-09 Ben Cheng <bccheng@google.com>
2132
2133 * arm.cc (Target_arm::attributes_accept_div): New function.
2134 (Target_arm::attributes_forbid_div): New function.
2135 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2136 attribute using the same new functions as what bfd/elf32_arm.c
2137 does.
2138
3136a00e
CC
21392013-01-07 Cary Coutant <ccoutant@google.com>
2140
2141 PR gold/14993
2142 * output.cc (Output_section::add_input_section): For incremental
2143 updates, don't track input sections that are allocated from patch
2144 space.
2145
f2a6224b
L
21462013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2147 Ian Lance Taylor <iant@google.com>
2148
2149 PR gold/14897
2150 * configure.ac (--enable-ld): Removed.
2151 (install_as_default): Set to yes only for --enable-gold=default
2152 or --disable-ld.
2153 * configure: Regenerated.
2154
4f46f626
L
21552013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2156
2157 * options.h (General_options): Add -fuse-ld= for GCC linker
2158 option compatibility.
2159
26e4ef59
CC
21602013-01-04 Cary Coutant <ccoutant@google.com>
2161
2162 * configure.ac: Fix typo restoring CXXFLAGS.
2163 * configure: Regenerate.
2164
3d587466
CC
21652013-01-04 Cary Coutant <ccoutant@google.com>
2166
4f46f626
L
2167 * testsuite/Makefile.am (CXXLINK_S): New macro.
2168 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2169 * testsuite/Makefile.in: Regenerate.
3d587466 2170
44db6695
L
21712013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2172
2173 * version.cc (print_version): Update copyright year to 2013.
2174
edcac0c1
ILT
21752012-12-20 Ian Lance Taylor <iant@google.com>
2176
2177 * layout.cc (Layout::special_ordering_of_input_section): New
2178 function.
2179 (Layout::layout): If input section requires special ordering, must
2180 sort input sections.
2181 (Layout::make_output_section): May sort .text input sections.
2182 (Layout::is_section_name_prefix_grouped): Remove.
2183 * layout.h (class Layout): Declare
2184 special_ordering_of_input_section. Don't declare
2185 is_section_name_prefix_grouped.
2186 * output.cc (Output_section::add_input_section): Revert last
2187 change.
2188 (Output_section::Input_section_sort::match_file_name): Don't crash
2189 if called on output section data.
2190 (Output_section::Input_section_sort_compare): Sort based on
2191 special ordering.
2192 (Output_section::Input_section_sort_section_order_index_compare):
2193 Revert last patch.
2194 (Output_section::sort_attached_input_sections): Likewise.
2195
28f2a4ac
ST
21962012-12-18 Sriraman Tallam <tmsriram@google.com>
2197
edcac0c1 2198 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2199 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2200 * output.cc (Output_section::add_input_section): Check if section
2201 name contains special prefix. Keep input sections to sort such
2202 sections.
2203 (Output_section::Input_section_sort_section_order_index_compare
2204 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2205 (Output_section::sort_attached_input_sections): Add condition to
2206 Input_section_entry constructor call.
28f2a4ac
ST
2207 * testsuite/Makefile.am (text_section_grouping): New test.
2208 * testsuite/Makefile.in: Regenerate.
2209 * testsuite/text_section_grouping.cc: New file.
2210 * testsuite/text_section_grouping.sh: New file.
2211
5bf135a7
NC
22122012-12-17 Nick Clifton <nickc@redhat.com>
2213
2214 * Makefile.am: Add copyright notice.
2215 * NEWS: Likewise.
2216 * README: Likewise.
2217 * configure.ac: Likewise.
2218 * ftruncate.c: Likewise.
2219 * Makefile.in: Regenerate.
2220
59965708
CC
22212012-12-14 Cary Coutant <ccoutant@google.com>
2222
a4034750
AM
2223 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2224 --no-as-needed flag.
2225 (exception_separate_shared_12_test): Likewise.
2226 (incremental_copy_test): Likewise.
2227 * testsuite/Makefile.in: Regenerate.
59965708 2228
2a77e2ab
CC
22292012-12-14 Cary Coutant <ccoutant@google.com>
2230
2231 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2232 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2233
e3deeb9c
AM
22342012-12-12 Alan Modra <amodra@gmail.com>
2235
2236 * powerpc.cc (class Track_tls): New.
2237 (class Relocate, class Scan): Inherit Track_tls.
2238 (Target_powerpc::Scan::local, global): Track tls optimization
2239 and avoid creating plt entry for __tls_get_addr if all uses
2240 are optimized away.
2241 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2242
d8f5a274
AM
22432012-12-12 Alan Modra <amodra@gmail.com>
2244
2245 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2246 Replace no_toc_optimize with toc_optimize.
2247 * output.h (Output_section::input_sections): Provide non-const variant.
2248 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2249 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2250 accessors.
2251 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2252 (class Sort_toc_sections): New.
2253 (Target_powerpc::do_finalize_sections): Sort toc sections.
2254 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2255
4c8a1de1
RM
22562012-12-10 Roland McGrath <mcgrathr@google.com>
2257
2258 * testsuite/binary_unittest.cc (read_all): New function.
2259 (Sized_binary_test): Use it instead of ::read.
2260 * fileread.cc (do_read): Don't assume pread always reads the whole
2261 amount in a single call.
2262
edc27beb
AM
22632012-12-10 Alan Modra <amodra@gmail.com>
2264
2265 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2266 Set EM_PPC64 or EM_PPC here.
2267 (Target_selector_powerpc::do_recognize): Delete.
2268
906b9150
AM
22692012-12-10 Alan Modra <amodra@gmail.com>
2270
2271 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2272 stub_table_.
2273 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2274
418c15ae
RM
22752012-12-07 Roland McGrath <mcgrathr@google.com>
2276
2277 * testsuite/binary_unittest.cc (Sized_binary_test):
2278 Use open_descriptor rather than ::open.
2279
decdd3bc
AM
22802012-12-07 Alan Modra <amodra@gmail.com>
2281
2282 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2283 typedef and invalid_address constant.
2284 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2285 instantiate constants.
2286
db399005
ILT
22872012-12-06 Roland McGrath <mcgrathr@google.com>
2288
2289 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2290 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2291 * aclocal.m4: Regenerate.
2292 * configure: Regenerate.
2293 * Makefile.in: Regenerate.
2294 * testsuite/Makefile.in: Regenerate.
2295
aba6bc71
AM
22962012-12-07 Alan Modra <amodra@gmail.com>
2297
2298 * options.h (General_options): Add no_toc_optimize.
2299 * powerpc.cc (ok_lo_toc_insn): New function.
2300 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2301
9e69ed50
AM
23022012-12-06 Alan Modra <amodra@gmail.com>
2303
2304 * options.h (General_options): Add plt_align, plt_static_chain,
2305 plt_thread_safe. Update stub_group_size help text.
2306 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2307 for new plt_thread_safe_ var.
2308 (use_plt_offset): Correct comments.
2309 (Target_powerpc::do_relax): Look for thread creation symbols to
2310 determine default plt_thread_safe value. Clear plt call stubs
2311 as well as branch stubs each iteration.
2312 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2313 insn constants.
2314 (l, hi, ha, write_insn): Move earlier.
2315 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2316 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2317 plt stubs too.
2318 (Stub_table::update_size): Adjust.
2319 (Stub_table::prev_size, set_prev_size): Delete.
2320 (Stub_table::stub_align): Let --plt-align affect result.
2321 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2322 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2323 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2324 (Stub_table::do_write): Support more stub variants.
2325
f43ba157
AM
23262012-12-04 Alan Modra <amodra@gmail.com>
2327
2328 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2329 (Target_powerpc::do_define_standard_symbols): New function.
2330
34171bc5
AM
23312012-12-03 Alan Modra <amodra@gmail.com>
2332
2333 * output.h: Formatting, whitespace.
2334
dc9589e9 23352012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2336
2337 * layout.h (Layout::get_executable_sections): Declare.
2338 * layout.cc (Layout::get_executable_sections): New function.
2339 * arm.cc (Target_arm::group_sections): Use it.
2340 (Arm_output_section::group_sections): Delete now redundant test.
2341 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2342 param to handle relative relocs.
2343 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2344 (Output_data_reloc::add_absolute): Adjust.
2345 (Output_data_reloc::add_relative): New function.
2346 (Output_data::reset_data_size): New function.
2347 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2348 (Output_section::set_addralign): New function.
2349 (Output_section::checkpoint_set_addralign): New function.
2350 (Output_section::clear_section_offsets_need_adjustment): New function.
2351 (Output_section::input_sections): Make public.
2352 * powerpc.cc (class Output_data_brlt_powerpc): New.
2353 (class Stub_table, class Stub_control): New.
2354 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2355 stub_table_, set_stub_table, stub_table): New vectors and accessor
2356 functions.
2357 (Target_powerpc::do_may_relax, do_relax, push_branch,
2358 new_stub_table, stub_tables, brlt_section, group_sections,
2359 add_branch_lookup_table, find_branch_lookup_table,
2360 write_branch_lookup_table, make_brlt_section): New functions.
2361 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2362 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2363 branch_info_): New vars.
2364 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2365 make call stubs here.
2366 (Output_data_glink): Remove all call stub handling from this class.
2367 (Target_powerpc::Scan::local, global): Save interesting branch
2368 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2369 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2370 functions on final link.
2371 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2372 Handle long branch destinations too.
2373 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2374 do_plt_address_for_local): Adjust lookup of plt call stubs.
2375
627b30b7
AM
23762012-11-30 Alan Modra <amodra@gmail.com>
2377
2378 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2379 relocs against protected symbols when building 32-bit shared libs.
2380
40b469d7
AM
23812012-11-30 Alan Modra <amodra@gmail.com>
2382
2383 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2384 param. Call got_section() to make .got. Update all callers
2385 and their callers and so on.
2386
bb66a627
AM
23872012-11-30 Alan Modra <amodra@gmail.com>
2388
2389 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2390 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2391 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2392 value if it already exists.
2393
d2cf1c6c
L
23942012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2395
2396 PR gold/14858
2397 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2398
edccdf7c
RM
23992012-11-14 Roland McGrath <mcgrathr@google.com>
2400
2401 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2402 than bfc instruction for data sandboxing.
2403
6febeb74
AM
24042012-11-08 Alan Modra <amodra@gmail.com>
2405
2406 * po/POTFILES.in: Regenerate.
2407
0a6f1bf2
AM
24082012-11-05 Alan Modra <amodra@gmail.com>
2409
2410 * configure.ac: Apply 2012-09-10 change to config.in here.
2411 * configure: Regenerate.
2412
26a4e9cb
AM
24132012-11-05 Alan Modra <amodra@gmail.com>
2414
2415 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2416 (struct Opd_ent): Use "Address" rather than "Offset".
2417 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2418 (Target_powerpc::got_section): Make public.
2419 (Target_powerpc::scan_relocs): Move code setting symbols..
2420 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2421 Create _SDA_BASE_ only when referenced.
2422
cc928013
RM
24232012-11-02 Roland McGrath <mcgrathr@google.com>
2424
2425 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2426 from last change.
2427
50ed5eb1
RM
24282012-11-01 Roland McGrath <mcgrathr@google.com>
2429
62fe925a
RM
2430 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2431 for offset_in_output_section parameter.
2432 (Sized_target::relocate_special_relocatable): Likewise.
2433 * arm.cc (Target_arm::relocate_relocs): Likewise.
2434 (Target_arm::relocate_special_relocatable): Likewise.
2435 * i386.cc (Target_i386::relocate_relocs): Likewise.
2436 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2437 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2438 * target-reloc.h (relocate_relocs): Likewise.
2439 * testsuite/testfile.cc (Target_test): Likewise.
2440 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2441 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2442
2443 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2444 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2445
2446 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2447 parameter, which is unused in the [!F_SETFD] case.
2448
50ed5eb1
RM
2449 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2450 SYMNDX to off_t before comparing it to this->data_size().
2451 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2452 * incremental.cc (Output_section_incremental_inputs::do_write):
2453 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2454
2cadc0bf
RM
2455 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2456
3bfcb652
NC
24572012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2458
2459 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2460 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2461 in EABI_VER5.
2462
c1a8d56e
CC
24632012-10-29 Cary Coutant <ccoutant@google.com>
2464
2465 * dwp.cc (usage): Add file and exit status parameters;
2466 add --help and --version options.
2467 (print_version): New function.
2468 (main): Add --help and --version options.
2469
b2490a7b
L
24702012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2471
2472 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2473 final_layout_sequence.txt.
2474 * testsuite/Makefile.in: Regenerated.
2475
aa543512
L
24762012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2477
2478 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2479 COMPILE generated by automake.
2480 (LINK1): Likewise.
2481 (CXXCOMPILE1): Likewise.
2482 (CXXLINK1): Likewise.
2483 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2484 (LINK): Likewise.
2485 (CXXCOMPILE): Likewise.
2486 (CXXLINK): Likewise.
2487 * testsuite/Makefile.in: Regenerated.
2488
d361fafb
L
24892012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2490
2491 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2492 on bad fwrite return.
2493
598c7410
L
24942012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2495
2496 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2497 on val.
2498
35c813e2
CC
24992012-10-23 Cary Coutant <ccoutant@google.com>
2500
2501 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2502 * testsuite/Makefile.in: Regenerate.
2503 * testsuite/dwp_test.h: New source file.
2504 * testsuite/dwp_test_1.cc: New source file.
2505 * testsuite/dwp_test_1.s: New source file.
2506 * testsuite/dwp_test_1.sh: New source file.
2507 * testsuite/dwp_test_1b.cc: New source file.
2508 * testsuite/dwp_test_1b.s: New source file.
2509 * testsuite/dwp_test_2.cc: New source file.
2510 * testsuite/dwp_test_2.s: New source file.
2511 * testsuite/dwp_test_2.sh: New source file.
2512 * testsuite/dwp_test_main.cc: New source file.
2513 * testsuite/dwp_test_main.s: New source file.
2514
77429909
CC
25152012-10-23 Cary Coutant <ccoutant@google.com>
2516
2517 * dwp.h: New header file.
2518 * dwp.cc: New source file.
2519 * gold.h: Move shared declarations to system.h.
2520 * system.h: New header file.
2521 * Makefile.am: Add dwp.
2522 * Makefile.in: Regenerate.
2523
ed5d6712
CC
25242012-10-23 Cary Coutant <ccoutant@google.com>
2525
2526 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2527 Dwarf_info_reader::read_from_pointer.
2528 (Dwarf_pubnames_table::read_header): Likewise.
2529 (Dwarf_pubnames_table::next_name): Likewise.
2530 (Dwarf_die::read_attributes): Likewise.
2531 (Dwarf_die::skip_attributes): Likewise.
2532 (Dwarf_info_reader::read_from_pointer): New function template.
2533 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2534 (Dwarf_pubnames_table): Likewise.
2535 (Dwarf_info_reader::read_from_pointer): New function template.
2536 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2537 Dwarf_pubnames_table ctor.
2538
8787852d
CC
25392012-10-23 Cary Coutant <ccoutant@google.com>
2540
2541 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2542 abbrev_shndx.
2543 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2544 abbrev_shndx_.
2545 (Dwarf_info_reader::set_abbrev_shndx): New method.
2546 (Dwarf_info_reader::abbrev_shndx_): New data member.
2547
9fc236f3
CC
25482012-10-23 Cary Coutant <ccoutant@google.com>
2549
2550 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2551 from object, not parameters.
2552 (Dwarf_info_reader::parse): Likewise.
2553 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2554 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2555 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2556 methods.
2557
effe8365
CC
25582012-10-23 Cary Coutant <ccoutant@google.com>
2559
2560 * fileread.cc (Input_file::Input_file): New constructor.
2561 * fileread.h (class Input_file): Add new constructor.
2562
1698990d
AM
25632012-10-18 Alan Modra <amodra@gmail.com>
2564
2565 PR gold/14727
2566 * object.cc (Relobj::is_section_name_included): Also match
2567 .sdata personality section.
2568
168a4726
AM
25692012-10-18 Alan Modra <amodra@gmail.com>
2570
2571 * target-reloc.h (class Default_comdat_behavior): New, package up..
2572 (get_comdat_behaviour): ..this.
2573 (relocate_section): Add Relocate_comdat_behavior template arg,
2574 adjust code to suit.
2575 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2576 (Target_arm::scan_reloc_section): Likewise.
2577 * i386.cc (Target_i386::relocate_section): Likewise.
2578 * sparc.cc (Target_sparc::relocate_section): Likewise.
2579 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2580 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2581 * powerpc.cc (class Relocate_comdat_behavior): New.
2582 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2583 gold::relocate_section with new template arg.
2584
acc276d8
AM
25852012-10-18 Alan Modra <amodra@gmail.com>
2586
2587 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2588 dynamic relocs for GOT_TPREL got entries, without symbol if
2589 resolving locally.
2590 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2591 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2592 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2593
e10f9870
AM
25942012-10-17 Alan Modra <amodra@gmail.com>
2595
2596 PR gold/14726
2597 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2598
ae034989
ST
25992012-10-16 Sriraman Tallam <tmsriram@google.com>
2600
2601 * layout.cc (Layout::include_section): Keep sections marked
2602 SHF_EXCLUDE when doing relocatable links.
2603
f3a0ed29
AM
26042012-10-16 Alan Modra <amodra@gmail.com>
2605
2606 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2607 (Target_powerpc::do_finalize_sections): Call it.
2608 (Output_data_save_res): New class and supporting functions.
2609 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2610 normal symbols defined in object files.
2611
c6de8ed4
AM
26122012-10-12 Alan Modra <amodra@gmail.com>
2613
2614 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2615 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2616 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2617 section if scan_opd_relocs not yet called.
2618 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2619
03e25981
AM
26202012-10-12 Alan Modra <amodra@gmail.com>
2621
2622 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2623 add_local_ifunc_entry): Revert last change.
2624 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2625
c9824451
AM
26262012-10-05 Alan Modra <amodra@gmail.com>
2627
2628 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2629 do_plt_address_for_global): New functions.
2630 (Output_data_got_powerpc::do_write): Don't segfault when linking
2631 statically.
2632 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2633 add_local_ifunc_entry): Return true on adding entry..
2634 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2635 glink->add_entry call. Remove unused symtab param. Adjust calls.
2636 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2637 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2638 set up symbols here.
2639 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2640 syms here. Do so even when no .iplt. Don't segfault when linking
2641 statically.
2642 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2643 new variants without reloc param.
2644 (Glink_sym_ent::Glink_sym_ent): Likewise.
2645 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2646 reloc when refs will resolve to plt call stub.
2647 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2648 R_PPC_PLTREL24 to resolve locally.
2649 (Target_powerpc::Scan::global): Correct ifunc handling.
2650 (Target_powerpc::Relocate::relocate): Correct local sym glink
2651 lookup. Don't destroy "value" when we have a plt call stub,
2652 and when checking plt call validity.
2653 (Target_powerpc::do_dynsym_value): Simplify.
2654
19fec8c1
AM
26552012-10-05 Alan Modra <amodra@gmail.com>
2656
2657 * i386.cc (Output_data_plt_i386::address_for_global,
2658 address_for_local): Add plt offset to returned value. Adjust uses.
2659 * sparc.cc (Output_data_plt_sparc::address_for_global,
2660 address_for_local): Likewise.
2661 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2662 address_for_local): Likewise.
2663 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2664 address_for_local): Likewise.
2665 * target.h (Target::plt_address_for_global, plt_address_for_local):
2666 Update comment.
2667 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2668 (Output_data_got::Got_entry::write): Nor here.
2669 * output.h: Comment fix.
2670
e867b647
WL
26712012-10-02 Jiong Wang <jiwang@tilera.com>
2672
2673 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2674 global_offset_table_ value for larget got.
2675 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2676
e5d5f5ed
AM
26772012-09-29 Alan Modra <amodra@gmail.com>
2678
2679 * powerpc.cc (Target_powerpc::iplt_): New output section.
2680 (Target_powerpc::iplt_section, make_iplt_section,
2681 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2682 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2683 Target_powerpc::plt_entry_count): Count iplt entries too.
2684 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2685 reloc section in constructor. New params.
2686 (Target_powerpc::make_plt_section): Create reloc section here instead.
2687 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2688 functions.
2689 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2690 (Output_data_glink::add_entry, find_entry): New functions to
2691 deal with local syms.
2692 (Glink_sym_ent): Add support for local syms.
2693 (Output_data_glink::do_write): Handle ifunc plt entries.
2694 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2695 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2696 (Target_powerpc::Relocate::relocate): Likewise.
2697 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2698
ec4dbad3
AM
26992012-09-25 Alan Modra <amodra@gmail.com>
2700
2701 * object.h (Sized_relobj_file::adjust_local_symbol,
2702 do_adjust_local_symbol): New functions.
2703 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2704 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2705 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2706 and irregular opd entry spacing.
2707 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2708 (Global_symbol_visitor_opd): New functor.
2709 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2710 on deleted opd entries.
2711
5c0b3823
WL
27122012-09-15 Jiong Wang <jiwang@tilera.com>
2713
2714 * tilegx.cc: New file.
2715 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2716 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2717 * configure.tgt: Add entries for tilegx*.
2718 * configure.ac: Likewise.
2719 * Makefile.in: Rebuild.
2720 * configure: Likewise.
2721 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2722 tilegx.
2723
bfdfa4cd
AM
27242012-09-13 Alan Modra <amodra@gmail.com>
2725
2726 * target-reloc.h (scan_relocs): Call scan.local for relocs
2727 against symbols in discarded sections. Pass is_discarded
2728 param.
2729 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2730 Add is_discarded param.
2731 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2732 is_discarded to flag opd entry as discarded. Don't emit dyn
2733 relocs on such entries.
2734 (Target_powerpc::Scan::global): Similarly detect and handle
2735 such opd entries.
2736 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2737 opd_ent_. Update all uses.
2738 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2739 (Target_powerpc::relocate_section): Zero out discarded opd
2740 entry relocs.
2741
d77a0555
ILT
27422012-09-12 Ian Lance Taylor <iant@google.com>
2743
2744 PR gold/14570
2745 * output.cc: Rename Output_data_got template parameter from size
2746 to got_size for all functions. Compile all variants of
2747 Output_data_got.
2748 (Output_data_got::Got_entry::write): Correct use of size for
2749 symbol value. Use local_is_tls rather than casting to
2750 Sized_relobj_file.
2751 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2752 (class Sized_relobj_file): Add do_local_is_tls.
2753 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2754
815a1205
AM
27552012-09-11 Alan Modra <amodra@gmail.com>
2756
2757 PR gold/14566
2758 * layout.cc (Layout::set_segment_offsets): When using
2759 common-page-size alignment, ensure we are on a new max-page-size
2760 page.
2761 * output.cc (Output_segment::set_section_addresses): Use
2762 abi_pagesize, not common_pagesize for relro boundary.
2763 (Output_segment::set_offset): Likewise.
2764
bd73a62d
AM
27652012-09-11 Alan Modra <amodra@gmail.com>
2766
2767 * output.h (Output_data_got::add_global_tls, add_local_tls,
2768 add_local_tls_pair): New functions.
2769 (Output_data_got::add_local_pair_with_rel): Remove second
2770 reloc param. Expand comment.
2771 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2772 use_plt_or_tls_offset_, similarly for constructor param.
2773 (Output_data_got::Got_entry::write): Add got_index param.
2774 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2775 add_local_tls_pair): New functions.
2776 (Output_data_got::Got_entry::write): Handle tls symbols
2777 with use_plt_or_tls_offset_ set specially.
2778 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2779 (Output_data_got::do_write): Replace iterator with index, pass
2780 index to entry write function.
2781 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2782 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2783 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2784 call.
2785 * i386.cc (Target_i386::Scan::local): Likewise.
2786 * sparc.cc (Target_sparc::Scan::local): Likewise.
2787 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2788 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2789 do_tls_offset_for_global): New functions.
2790 (Target_powerpc::Scan::local): Correct TLS relocations and got
2791 entry values.
2792 (Target_powerpc::Scan::global): Don't emit unnecessary
2793 dynamic relocations on TLS GOT entries.
2794
00716ab1
AM
27952012-09-10 Matthias Klose <doko@ubuntu.com>
2796
2797 * config.in: Disable sanity check for kfreebsd.
2798
c891b3f9
SA
27992012-09-10 Sterling Augustine <saugustine@google.com>
2800
2801 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2802 (Gdb_index::pubtypes_read): New parameter.
2803 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2804 to calls.
2805 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2806 pubtypes_object_.
2807
e81fea4d
AM
28082012-09-09 Alan Modra <amodra@gmail.com>
2809
2810 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2811 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2812 * gc.h (gc_process_relocs): Call target gc_add_reference.
2813 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2814 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2815 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2816 unnecessary cast.
2817 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2818 to cater for when we don't need code offset. Update use.
2819 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2820 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2821 set_opd_valid): New functions.
2822 (Target_powerpc::do_gc_add_reference): New function.
2823 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2824 stashed refs.
2825 (Target_powerpc::do_gc_mark_symbol): New function.
2826
d2d60eef
CC
28272012-09-06 Cary Coutant <ccoutant@google.com>
2828
2829 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2830 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2831 (Dwarf_die::skip_attributes): Likewise.
2832 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2833 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2834 (main): Call it.
2835 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2836
32ed4573
L
28372012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2838
2839 * testsuite/script_test_3.t: Add .got.plt output section
2840 statement.
2841 * testsuite/script_test_4.t: Likewise.
2842
f4baf0d4
AM
28432012-09-05 Alan Modra <amodra@gmail.com>
2844
2845 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2846 update all uses and lose "enum" when using type.
2847
864a1b56
AM
28482012-09-05 Alan Modra <amodra@gmail.com>
2849
2850 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2851 * configure: Regenerate.
2852 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2853 (plugin_final_layout.stdout): Likewise.
2854 (memory_test): Set page sizes to 0x1000.
2855 * testsuite/Makefile.in: Regenerate.
2856 * testsuite/discard_locals_test.sh: Add FIXME comment.
2857 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2858 * testsuite/pr14265.t: Add .got output section statement.
2859 * testsuite/script_test_2.t: Likewise.
2860 * testsuite/script_test_3.t: Likewise.
2861 * testsuite/script_test_4.t: Likewise.
2862 * testsuite/script_test_5.t: Likewise.
2863 * testsuite/script_test_6.t: Likewise.
2864 * testsuite/script_test_7.t: Likewise.
2865 * testsuite/script_test_9.t: Likewise.
2866
3ea0a085
AM
28672012-09-05 Alan Modra <amodra@gmail.com>
2868
2869 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2870 (Powerpc_relocate_functions::Status): New typedef.
2871 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2872 (Target_powerpc::Scan::local): Handle REL64.
2873 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2874 for REL32 and REL64.
2875 (Target_powerpc::symval_for_branch): New function, extracted from..
2876 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2877 checks. Report overflow errors.
2878
7404fe1b
AM
28792012-09-05 Alan Modra <amodra@gmail.com>
2880
2881 * object.h (Sized_relobj_file::emit_relocs): Delete.
2882 (Sized_relobj_file::emit_relocs_reltype): Delete.
2883 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2884 relocate_relocs for --emit-relocs.
2885 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2886 * output.h: Update comment.
2887 (Output_segment::first_section): New function.
2888 (Output_segment::first_section_load_address): Use first_section.
2889 * output.cc (Output_segment::first_section): New function extracted..
2890 (Output_segment::first_section_load_address): ..from here. Delete.
2891 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2892 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2893 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2894 adjust call to target.h function.
2895 * i386.cc (Target_i386): Likewise.
2896 * sparc.cc (Target_sparc): Likewise.
2897 * x86_64.cc (Target_x86_64): Likewise.
2898 * powerpc.cc (Target_powerpc): Likewise.
2899 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2900 first tls section has section symbol for optimised local dynamic
2901 output relocs.
2902 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2903 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2904 optimised tls code.
2905 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2906 Rename to relocate_relocs. Update error message.
2907
957564c9
AS
29082012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2909
2910 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2911 --just-symbols.
2912
dd93cd0a
AM
29132012-08-31 Alan Modra <amodra@gmail.com>
2914
2915 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2916 (Powerpc_relobj::toc_base_offset): New stub function.
2917 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2918 got_mod_index_offset to tlsld_got_offset. Update all refs.
2919 (Target_powerpc::Relocate::enum skip_tls): New.
2920 (Target_powerpc::call_tls_get_addr_): New var.
2921 (Target_powerpc::is_branch_reloc): Move to file scope.
2922 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2923 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2924 New functions.
2925 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2926 (powerpc_info): Correct common_pagesize for ppc64.
2927 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2928 (Powerpc_relocate_functions): Add overflow check enums and functions.
2929 Add non-shift version of rela, rela_ua. Delete all rel public
2930 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2931 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2932 addr16_ha3, addr14 functions.
2933 (Output_data_got_powerpc::add_constant_pair): New function.
2934 (Output_data_got_powerpc::got_base_offset): Likewise.
2935 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2936 (instruction constants): Sort, add some more.
2937 (Output_data_glink::do_write): Add and use Address typedef. Use
2938 object->toc_base_offset() stub for 64-bit.
2939 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2940 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2941 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2942 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2943 Always treat .opd relocs as against locally defined symbol.
2944 Correct condition for RELATIVE relocs.
2945 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2946 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2947 for 32-bit syms with a plt entry. Correct ppc64 toc base
2948 calculations. Handle TLS relocs, and more. Add overflow
2949 checking and adjust for Powerpc_relocate_functions changes.
2950 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2951 Reinstate --emit-relocs code with FIXME.
2952
a1373b60
AM
29532012-08-30 Alan Modra <amodra@gmail.com>
2954
2955 * layout.cc (Layout::set_segment_offsets): Set p_align to
2956 abi_pagesize, not common_pagesize.
2957 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2958 to determine whether file header can go in segment.
2959
703d02da
AM
29602012-08-30 Alan Modra <amodra@gmail.com>
2961
2962 * output.h (Output_reloc::Output_reloc <output section>): Add
2963 is_relative param. Adjust calls.
2964 (Output_reloc::add_output_section_relative): New functions.
2965 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2966 is_relative.
2967 (Output_reloc::symbol_value): Handle SECTION_CODE.
2968
16164a6b
ST
29692012-08-24 Sriraman Tallam <tmsriram@google.com>
2970
2971 * gold.cc (queue_middle_tasks): Call layout again when unique
2972 segments for sections is desired.
2973 * layout.cc (Layout::Layout): Initialize new members.
2974 (Layout::get_output_section_flags): New function.
2975 (Layout::choose_output_section): Call get_output_section_flags.
2976 (Layout::layout): Make output section for mapping to a unique segment.
2977 (Layout::insert_section_segment_map): New function.
2978 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2979 output sections marked so.
16164a6b
ST
2980 (Layout::segment_precedes): Check for unique segments when sorting.
2981 * layout.h (Layout::Unique_segment_info): New struct.
2982 (Layout::Section_segment_map): New typedef.
2983 (Layout::insert_section_segment_map): New function.
2984 (Layout::get_output_section_flags): New function.
2985 (Layout::is_unique_segment_for_sections_specified): New function.
2986 (Layout::set_unique_segment_for_sections_specified): New function.
2987 (Layout::unique_segment_for_sections_specified_): New member.
2988 (Layout::section_segment_map_): New member.
2989 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2990 Rename is_gc_pass_one to is_pass_one.
2991 Rename is_gc_pass_two to is_pass_two.
2992 Rename is_gc_or_icf to is_two_pass.
2993 Check for which pass based on whether symbols data is present.
2994 Make it two pass when unique segments for sections is desired.
2995 * output.cc (Output_section::Output_section): Initialize new
2996 members.
2997 * output.h (Output_section::is_unique_segment): New function.
2998 (Output_section::set_is_unique_segment): New function.
2999 (Output_section::is_unique_segment_): New member.
3000 (Output_section::extra_segment_flags): New function.
3001 (Output_section::set_extra_segment_flags): New function.
3002 (Output_section::extra_segment_flags_): New member.
3003 (Output_section::segment_alignment): New function.
3004 (Output_section::set_segment_alignment): New function.
3005 (Output_section::segment_alignment_): New member.
3006 (Output_segment::Output_segment): Initialize is_unique_segment_.
3007 (Output_segment::is_unique_segment): New function.
3008 (Output_segment::set_is_unique_segment): New function.
3009 (Output_segment::is_unique_segment_): New member.
3010 * plugin.cc (allow_unique_segment_for_sections): New function.
3011 (unique_segment_for_sections): New function.
3012 (Plugin::load): Add new functions to transfer vector.
3013 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3014 * Makefile.in: Regenerate.
3015 * testsuite/plugin_final_layout.sh: Check if unique segment
3016 functionality works.
3017 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3018 are available.
3019 (allow_unique_segment_for_sections): New global.
3020 (unique_segment_for_sections): New global.
3021 (claim_file_hook): Call allow_unique_segment_for_sections.
3022 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3023
1e2bee4f
CC
30242012-08-22 Cary Coutant <ccoutant@google.com>
3025
3026 * layout.cc (Layout::include_section): Don't assert on GROUP
3027 sections with --emit-relocs.
3028
1d5dfe78
CC
30292012-08-21 Cary Coutant <ccoutant@google.com>
3030
3031 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3032 if --export-dynamic-symbol names an undef symbol.
3033
c9269dff
AM
30342012-08-18 Alan Modra <amodra@gmail.com>
3035
3036 * powerpc.cc: Formatting and white space.
3037 (Powerpc_relobj): Rename got2_section_ to special_.
3038 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3039 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3040 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3041 (Target_powerpc): Add Address typedef and invalid_address. Use
3042 throughout.
3043 (Target_powerpc::is_branch_reloc): New function.
3044 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3045 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3046 for dst_mask, value and addend.
3047 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3048 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3049 (Output_data_glink::do_write): Correct toc base. Don't try to use
3050 uint16_t for 24-bit offset. Use get_output_section_offset and
3051 check return.
3052 (Target_powerpc::Scan::local): Handle more relocs.
3053 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3054 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3055 Plug in toc restoring insn after plt calls. Translate branches
3056 to function descriptor symbols to corresponding entry point.
3057 (Target_powerpc::relocate_for_relocatable): Check return from
3058 get_output_section_offset.
3059 * symtab.h: Comment typo.
3060
b1759dce
ILT
30612012-08-14 Ian Lance Taylor <iant@google.com>
3062
3063 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3064 unsupported_relocal_local to call unsupported_reloc_global.
3065
b9b2ae8b
NC
30662012-08-14 Nick Clifton <nickc@redhat.com>
3067
3068 PR ld/14265
3069 * script-sections.cc (Sections_element::output_section_name): Add
3070 keep return parameter.
3071 (Output_section_element::match_name): Add keep return parameter.
3072 Return the value of the keep_ member.
3073 * script-sections.h (class Output_section): Update
3074 output_section_name prototype.
3075 * layout.cc (Layout::keep_input_section): New public member
3076 function.
3077 (Layout::choose_output_section): Pass keep parameter to
3078 output_section_name.
3079 * layout.h (class Layout): Add keep_input_section.
3080 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3081 sections.
3082 * testsuite/Makefile.am: Add a test.
3083 * testsuite/Makefile.in: Regenerate.
3084 * testsuite/pr14265.c: Source file for the test.
3085 * testsuite/pr14265.t: Linker script for the test.
3086 * testsuite/pr14265.sh: Shell script for the test.
3087
921b5322
AM
30882012-08-14 Alan Modra <amodra@gmail.com>
3089
3090 * target.h (Target::output_section_name): New function.
3091 (Target::do_output_section_name): New function.
3092 * layout.cc (Layout::choose_output_section): Call the above.
3093 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3094
6ce78956
AM
30952012-08-14 Alan Modra <amodra@gmail.com>
3096
3097 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3098 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3099 for replace_constant call.
3100 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3101 (Output_data_glink::do_print_to_mapfile): New function.
3102 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3103 (Target_powerpc::Relocate::relocate): Likewise.
3104
d1a8cabd
AM
31052012-08-14 Alan Modra <amodra@gmail.com>
3106
3107 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3108 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3109 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3110 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3111 all references to shndx_. Handle special case for R_PPC_PLTREL24
3112 here.
3113 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3114 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3115 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3116 here.
3117 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3118 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3119
d83ce4e3
AM
31202012-08-12 Alan Modra <amodra@gmail.com>
3121
3122 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3123 (glink insn constants): Use uint32_t.
3124 (Output_data_glink::add_entry): Use insert, not [] operator.
3125
cf43a2fe
AM
31262012-08-11 Alan Modra <amodra@gmail.com>
3127
3128 * object.h (Sized_relobj_file::find_shdr): New function.
3129 (Sized_relobj_file::find_special_sections): New function.
3130 * object.cc (Sized_relobj_file::find_shdr): New function.
3131 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3132 (Sized_relobj_file::find_special_sections): New function, split out..
3133 (Sized_relobj_file::do_read_symbols): ..from here.
3134 * output.h (Output_data_got::replace_constant): New function.
3135 (Output_data_got::num_entries): New function.
3136 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3137 (Output_data_got::got_offset): Protected rather than private.
3138 (Output_data_got::replace_got_entry): New function.
3139 * output.cc (Output_data_got::replace_got_entry): New function.
3140 * powerpc.cc (class Powerpc_relobj): New.
3141 (class Powerpc_relocate_functions): Delete all psymval variants or
3142 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3143 Implement _ha functions using corresponding _hi function.
3144 (Powerpc_relobj::find_special_sections): New function.
3145 (Target_powerpc::do_make_elf_object): New function.
3146 (class Output_data_got_powerpc): New.
3147 (class Output_data_glink): New.
3148 (class Powerpc_scan_relocatable_reloc): New.
3149 Many more changes througout file.
3150
3c892704
NC
31512012-08-09 Nick Clifton <nickc@redhat.com>
3152
3153 * po/vi.po: Updated Vietnamese translation.
3154
82435b3b
ILT
31552012-08-07 Ian Lance Taylor <iant@google.com>
3156
3157 * layout.cc (Layout::add_target_dynamic_tags): If
3158 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3159 plt_rel.
3160
a6dc81d2
NC
31612012-07-30 Nick Clifton <nickc@redhat.com>
3162
3163 * po/gold.pot: Updated template.
3164 * po/es.po: Updated Spanish translation.
3165
f1415016
CC
31662012-07-18 Cary Coutant <ccoutant@google.com>
3167
3168 PR gold/14344
3169 * configure.ac: Add check for -gpubnames support.
3170 * configure: Regenerate.
3171 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3172 support; force -gno-pubnames.
3173 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3174 support.
3175 (gdb_index_test_4): New test.
3176 * testsuite/Makefile.in: Regenerate.
3177 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3178 * testsuite/gdb_index_test_2.sh: Likewise.
3179 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3180 * testsuite/gdb_index_test_4.sh: New script.
3181 * testsuite/gdb_index_test_comm.sh: New script with common code;
3182 don't look for space after colon.
3183
b7fd7c37
ST
31842012-07-16 Sriraman Tallam <tmsriram@google.com>
3185
3186 * gold.cc (queue_middle_tasks): Update function order only after
3187 deferred objects due to plugins are processed.
3188
1f3212db
ILT
31892012-07-11 Ian Lance Taylor <iant@google.com>
3190
3191 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3192 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3193 (Target_arm::scan_reloc_for_stub): Likewise.
3194 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3195 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3196 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3197 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3198 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3199
81c82a68
ILT
32002012-07-10 Dodji Seketeli <dodji@redhat.com>
3201 Ian Lance Taylor <iant@google.com>
3202
3203 PR gold/14309
3204 * configure.ac: Test whether std::tr1::hash<off_t> works.
3205 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3206 needed.
3207 * output.h (class Output_fill): Add virtual destructor.
3208 * configure, config.in: Rebuild.
3209
eabc84f4
RM
32102012-06-22 Roland McGrath <mcgrathr@google.com>
3211
3212 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3213
370e30b6
RÁE
32142012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3215
3216 * plugin.cc (Plugin::load): Handle position independent executables.
3217
fb1b895d
CC
32182012-06-06 Cary Coutant <ccoutant@google.com>
3219
3220 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3221 add .debug_macro.
3222 (lines_only_debug_sections): Likewise.
3223 (gdb_fast_lookup_sections): New static array.
3224 (is_gdb_debug_section): Rename formal parameter.
3225 (is_lines_only_debug_section): Likewise.
3226 (is_gdb_fast_lookup_section): New function.
3227 (Layout::include_section): Check for ".zdebug_" prefix; pass
3228 section name suffix to is_gdb_debug_section, et al.; check for
3229 fast-lookup sections when building .gdb_index.
3230 * options.h (--strip-debug-gdb): Update GDB version number.
3231
7c0640fa
CC
32322012-06-06 Cary Coutant <ccoutant@google.com>
3233
3234 * configure.ac: Add check for fallocate.
3235 * configure: Regenerate.
3236 * config.in: Regenerate.
3237
3238 * options.h (class General_options): Add --mmap-output-file and
3239 --posix-fallocate options.
3240 * output.cc: (posix_fallocate): Remove; replace with...
3241 (gold_fallocate): New function.
3242 (Output_file::map_no_anonymous): Call gold_fallocate.
3243 (Output_file::map): Check --mmap-output-file option.
3244
2a49eb69
DK
32452012-06-05 Jing Yu <jingyu@google.com>
3246
3247 * gold.h (textdomain): Add do {} to empty while(0).
3248 (bindtextdomain): Likewise.
3249
fad072ac
CC
32502012-06-04 Cary Coutant <ccoutant@google.com>
3251
3252 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3253 has_dynsym_index.
3254
8cc69fb6
ST
32552012-05-25 Sriraman Tallam <tmsriram@google.com>
3256
3257 * symtab.cc (Symbol_table::define_special_symbol):
3258 Initialize *poldsym to prevent uninitialized variable errors.
3259
1be75daa
CC
32602012-05-23 Cary Coutant <ccoutant@google.com>
3261
3262 * layout.cc (Layout::section_name_mapping): Add rules to handle
3263 exact match on .data.rel.ro.local or .data.rel.ro.
3264 (Layout::output_section_name): Check for exact matches.
3265
9b689de0
CC
32662012-05-23 Cary Coutant <ccoutant@google.com>
3267
3268 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3269 more carefully.
3270
b24fdbf5
CC
32712012-05-22 Cary Coutant <ccoutant@google.com>
3272
3273 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3274 object before exporting symbol.
3275
e550e1a2
L
32762012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3277
3278 * testsuite/tls_test.cc: Include "config.h" first.
3279 * testsuite/tls_test_c.c: Likewise.
3280
df7b86aa
NC
32812012-05-17 Daniel Richard G. <skunk@iskunk.org>
3282 Nick Clifton <nickc@redhat.com>
3283
3284 PR 14072
3285 * configure.in: Add check that sysdep.h has been included before
3286 any system header files.
3287 * configure: Regenerate.
3288 * config.in: Regenerate.
3289
1007b503
CC
32902012-05-14 Cary Coutant <ccoutant@google.com>
3291
3292 * layout.cc (Layout::make_output_section): Mark .tdata section
3293 as RELRO.
3294 * testsuite/relro_test.cc: Add a TLS variable.
3295
fd885f3a
L
32962012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3297
3298 PR gold/14091
3299 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3300 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3301 R_X86_64_64.
3302
80f5885c
CC
33032012-05-08 Cary Coutant <ccoutant@google.com>
3304
3305 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3306 (lines_only_debug_sections): Likewise.
3307
2e702c99
RM
33082012-05-02 Roland McGrath <mcgrathr@google.com>
3309
3310 * nacl.cc: New file.
3311 * nacl.h: New file.
3312 * Makefile.am (CCFILES, HFILES): Add them.
3313 * Makefile.in: Regenerate.
3314 * i386.cc (Output_data_plt_i386_nacl): New class.
3315 (Output_data_plt_i386_nacl_exec): New class.
3316 (Output_data_plt_i386_nacl_dyn): New class.
3317 (Target_i386_nacl): New class.
3318 (Target_selector_i386_nacl): New class.
3319 (target_selector_i386): Use it instead of Target_selector_i386.
3320 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3321 (Target_x86_64_nacl): New class.
3322 (Target_selector_x86_64_nacl): New class.
3323 (target_selector_x86_64, target_selector_x32): Use it instead of
3324 Target_selector_x86_64.
3325 * arm.cc (Output_data_plt_arm_nacl): New class.
3326 (Target_arm_nacl): New class.
3327 (Target_selector_arm_nacl): New class.
3328 (target_selector_arm, target_selector_armbe): Use it instead of
3329 Target_selector_arm.
3330
3331 * target-select.cc (select_target): Take new Input_file* and off_t
3332 arguments, pass them on to recognize method of selector.
3333 * object.cc (make_elf_sized_object): Update caller.
3334 * parameters.cc (parameters_force_valid_target): Likewise.
3335 * incremental.cc (make_sized_incremental_binary): Likewise.
3336 * target-select.h: Update decl.
3337 (Target_selector::recognize): Take new Input_file* argument,
3338 pass it on to do_recognize.
3339 (Target_selector::do_recognize): Take new Input_file* argument.
3340 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3341 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3342 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3343 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3344
3345 * target.h (Target::Target_info): New members isolate_execinstr
3346 and rosegment_gap.
3347 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3348 * arm.cc (Target_arm::arm_info): Update initializer.
3349 * i386.cc (Target_i386::i386_info): Likewise.
3350 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3351 * sparc.cc (Target_sparc::sparc_info): Likewise.
3352 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3353 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3354 * layout.cc (Layout::attach_allocated_section_to_segment):
3355 Take new const Target* argument. If target->isolate_execinstr(), act
3356 like --rosegment.
3357 (Layout::find_first_load_seg): Take new const Target* argument;
3358 if target->isolate_execinstr(), reject PF_X segments.
3359 (Layout::relaxation_loop_body): Update caller.
3360 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3361 reset file offset to zero when we hit LOAD_SEG, and then do a second
3362 loop over the segments before LOAD_SEG to reassign offsets after
3363 addresses have been determined. Handle target->rosegment_gap().
3364 (Layout::attach_section_to_segment): Take new const Target* argument;
3365 pass it to attach_allocated_section_to_segment.
3366 (Layout::make_output_section): Update caller.
3367 (Layout::attach_sections_to_segments): Take new const Target* argument;
3368 pass it to attach_section_to_segment.
3369 * gold.cc (queue_middle_tasks): Update caller.
3370 * layout.h (Layout): Update method decls with new arguments.
3371
3372 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3373 Target_info pointer to use.
3374 (Target_arm::do_make_data_plt): New virtual method.
3375 (Target_arm::make_data_plt): New method that calls it.
3376 (Target_arm::make_plt_entry): Use it.
3377 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3378 for the section alignment.
3379 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3380 method.
3381 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3382 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3383 method.
3384 (Output_data_plt_arm::get_plt_entry_size): Call it.
3385 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3386 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3387 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3388 method.
3389 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3390 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3391 method instead of sizeof(plt_entry).
3392 (Output_data_plt_arm::add_entry): Likewise.
3393 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3394 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3395 than static method.
3396 (Target_arm::plt_entry_size): Likewise.
3397 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3398 Move to ...
3399 (Output_data_plt_arm_standard): ... here, new class.
3400 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3401 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3402 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3403
3404 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3405 Take additional argument for the PLT entry size.
3406 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3407 Use get_plt_entry_size method rather than plt_entry_size variable.
3408 (Output_data_plt_x86_64::reserve_slot): Likewise.
3409 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3410 (Output_data_plt_x86_64::add_entry): Likewise.
3411 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3412 (Output_data_plt_x86_64::address_for_global): Likewise.
3413 (Output_data_plt_x86_64::address_for_local): Likewise.
3414 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3415 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3416 Make method non-static.
3417 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3418 method.
3419 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3420 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3421 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3422 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3423 virtual method.
3424 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3425 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3426 virtual method.
3427 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3428 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3429 virtual method.
3430 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3431 (Output_data_plt_x86_64::plt_entry_size)
3432 (Output_data_plt_x86_64::first_plt_entry)
3433 (Output_data_plt_x86_64::plt_entry)
3434 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3435 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3436 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3437 (Output_data_plt_x86_64_standard): ... here, new class.
3438 (Target_x86_64::Target_x86_64): Take optional argument for the
3439 Target_info pointer to use.
3440 (Target_x86_64::do_make_data_plt): New virtual method.
3441 (Target_x86_64::make_data_plt): New method to call it.
3442 (Target_x86_64::init_got_plt_for_update): Use that.
3443 Call this->plt_->add_eh_frame method here.
3444 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3445 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3446 rather than static method.
3447 (Target_x86_64::plt_entry_size): Likewise.
3448 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3449 rather than plt_entry_size variable. Move guts of PLT filling to...
3450 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3451 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3452 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3453
3454 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3455 additional argument for the section alignment.
3456 Don't do add_eh_frame_for_plt here.
3457 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3458 non-static. Use get_plt_entry_size method rather than plt_entry_size
3459 variable.
3460 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3461 method.
3462 (Output_data_plt_i386::get_plt_entry_size): Call it.
3463 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3464 (Output_data_plt_i386::add_eh_frame): New method to call it.
3465 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3466 method.
3467 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3468 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3469 method.
3470 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3471 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3472 method instead of plt_entry_size.
3473 (Output_data_plt_i386::plt_entry_size)
3474 (Output_data_plt_i386::plt_eh_frame_fde_size)
3475 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3476 (Output_data_plt_i386_standard): ... here, new class.
3477 (Output_data_plt_i386_exec): New class.
3478 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3479 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3480 (Output_data_plt_i386::exec_plt_entry): Move to ...
3481 (Output_data_plt_i386_exec::plt_entry): ... here.
3482 (Output_data_plt_i386_dyn): New class.
3483 (Output_data_plt_i386::first_plt_entry): Move to ...
3484 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3485 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3486 (Output_data_plt_i386_dyn::plt_entry): ... here.
3487 (Target_i386::Target_i386): Take optional argument for the Target_info
3488 pointer to use.
3489 (Target_i386::do_make_data_plt): New virtual method.
3490 (Target_i386::make_data_plt): New method to call it.
3491 (Target_i386::make_plt_section): Use that.
3492 Call this->plt_->add_eh_frame method here.
3493 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3494 rather than plt_entry_size variable.
3495 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3496 (Output_data_plt_i386::address_for_local): Likewise.
3497 (Output_data_plt_i386::do_write): Likewise.
3498 Move guts of PLT filling to...
3499 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3500 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3501 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3502 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3503
b9b9f2ee
CC
35042012-05-01 Cary Coutant <ccoutant@google.com>
3505
3506 * dwarf_reader.cc (Dwarf_die::read_attributes)
3507 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3508 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3509 * reduced_debug_output.cc
3510 (Output_reduced_debug_info_section::get_die_end): Remove
3511 DW_FORM_GNU_ref_index. Add default case.
3512
57923f48
MW
35132012-04-26 Mark Wielaard <mjw@redhat.com>
3514
3515 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3516 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3517 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3518 DW_AT_high_pc as offset from DW_AT_low_pc.
3519
3520 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3521 * testsuite/Makefile.in: Regenerate.
3522 * testsuite/gdb_index_test_3.c: New test source file.
3523 * testsuite/gdb_index_test_3.sh: New test source file.
3524
2c54b4f4
ILT
35252012-04-25 Ian Lance Taylor <iant@google.com>
3526
3527 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3528 pointer.
3529 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3530 as a class, not a struct.
3531 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3532 (Target_arm::apply_cortex_a8_workaround): Likewise.
3533 * gc.h: Declare Reloc_types as a struct, not a class.
3534 * object.h: Declare Symbols_data as a struct.
3535 * reloc.h: Declare Read_relocs_data as a struct.
3536 * target.h: Declare Relocate_info as a struct.
3537
a5a5f7a3
DM
35382012-04-24 David S. Miller <davem@davemloft.net>
3539
3540 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3541 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3542 and R_SPARC_WPLT30.
3543
f038d496
CC
35442012-04-24 Cary Coutant <ccoutant@google.com>
3545
3546 * incremental-dump.cc (find_input_containing_global): Replace
3547 magic number with symbolic constant.
3548 (dump_incremental_inputs): Update version number.
3549 * incremental.cc (Output_section_incremental_inputs): Update version
3550 number; import symbolic constants from Incremental_inputs_reader.
3551 (Incremental_inputs::create_data_sections): Align relocations
3552 section correctly for 64-bit targets.
3553 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3554 constants; add padding.
3555 (Output_section_incremental_inputs::write_header): Add assert for
3556 header_size.
3557 (Output_section_incremental_inputs::write_input_files): Add assert
3558 for input_entry_size.
3559 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3560 add assert for object_info_size, input_section_entry_size,
3561 global_sym_entry_size.
3562 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3563 for data structure sizes; use them.
3564 (Incremental_input_entry_reader): Import symbolic constants from
3565 Incremental_inputs_reader; use them.
3566
a4d85145
DM
35672012-04-23 David S. Miller <davem@davemloft.net>
3568
3569 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3570 and elf_flags_set_.
3571 (Target_sparc::Target_sparc): Initialize new fields.
3572 (Target_sparc::do_make_elf_object): New function.
3573 (Target_sparc::do_adjust_elf_header): New function.
3574
1d509098
CC
35752012-04-23 Cary Coutant <ccoutant@google.com>
3576
3577 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3578 CU range table of gdb index.
3579
7ebeff7f
DM
35802012-04-20 David S. Miller <davem@davemloft.net>
3581
3582 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3583 instead of false.
3584
13cf9988
DM
35852012-04-16 David S. Miller <davem@davemloft.net>
3586
2a1079e8
DM
3587 * sparc.cc (Target_sparc::got_address): New function.
3588 (Sparc_relocate_functions::gdop_hix22): New function.
3589 (Sparc_relocate_functions::gdop_lox10): New function.
3590 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3591 relocs.
3592 (Target_sparc::Scan::local): Likewise if the global symbol is not
3593 preemptible and is not IFUNC.
3594 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3595 transformations for local and non-preemptible non-IFUNC global
3596 symbols.
3597
0bc964fc
DM
3598 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3599 writing out 64-bit part of ranges.
3600
661d7a80
DM
3601 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3602 -fpic and -fpie respectively.
3603 * Makefile.in: Regenerate.
3604
8c2bf391
DM
3605 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3606 (Target_sparc::Target_sparc): Initialize new field.
3607 (Target_sparc::do_plt_section_for_global): New function.
3608 (Target_sparc::do_plt_section_for_local): New function.
3609 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3610 (Target_sparc::make_plt_section): New function, broken out of
3611 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3612 (Target_sparc::make_plt_entry): Call make_plt_section.
3613 (Target_sparc::make_local_ifunc_plt_entry): New function.
3614 (Target_sparc::rela_ifunc_section): New function.
3615 (Target_sparc::plt_section): Remove const.
3616 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3617 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3618 and ifunc_count_ fields.
3619 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3620 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3621 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3622 (Output_data_plt_sparc::rela_ifunc): New function.
3623 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3624 (Output_data_plt_sparc::has_ifunc_section): New function.
3625 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3626 (Output_data_plt_sparc::address_for_global): New function.
3627 (Output_data_plt_sparc::address_for_local): New function.
3628 (Output_data_plt_sparc::plt_index_to_offset): New function.
3629 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3630 and entry_count.
3631 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3632 entry_count.
3633 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3634 R_SPARC_JMP_IREL to switch.
3635 (Target_sparc::Scan::check_non_pic): Likewise.
3636 (Target_sparc::Scan::local): Handle IFUNC symbols.
3637 (Target_sparc::Scan::local): Likewise.
3638 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3639 and plt_address_for_local.
3640 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3641 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3642
13cf9988
DM
3643 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3644 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3645 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3646 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3647 global relocs too.
3648 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3649 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3650 calls.
3651 * sparc.cc (Target_sparc::Scan::global): Likewise.
3652 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3653
31821be0
CC
36542012-04-16 Cary Coutant <ccoutant@google.com>
3655
3656 * archive.cc (Library_base::should_include_member): Check for
3657 --export-dynamic-symbol.
3658 * options.h (class General_options): Add --export-dynamic-symbol.
3659 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3660 --export-dynamic-symbol.
3661 (Symbol_table::gc_mark_undef_symbols): Likewise.
3662 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3663
2615994e
DM
36642012-04-12 David S. Miller <davem@davemloft.net>
3665
3666 * sparc.cc (Reloc::wdisp10): New relocation method.
3667 (Reloc::h34): Likewise.
3668 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3669 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3670 R_SPARC_WDISP10.
3671 (Target_sparc::Scan::local): Likewise.
3672 (Target_sparc::Scan::global): Likewise.
3673 (Target_sparc::Relocate::relocate): Likewise.
3674
6782735d
CC
36752012-04-09 Cary Coutant <ccoutant@google.com>
3676
3677 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3678 low_pc == 0.
3679
8c7a0b00
ILT
36802012-04-06 Ian Lance Taylor <iant@google.com>
3681
3682 * timer.cc: #include <unistd.h>.
3683
58797674
RM
36842012-04-06 Roland McGrath <mcgrathr@google.com>
3685
3686 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3687 * config.in: Regenerate.
3688 * configure: Regenerate.
3689
44350750
NC
36902012-04-05 Nick Clifton <nickc@redhat.com>
3691
3692 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3693 (AM_LC_MESSAGES): Add.
3694 * aclocal.m4: Regenerate.
3695 * config.in: Regenerate.
3696 * configure: Regenerate.
3697
c1027032
CC
36982012-03-21 Cary Coutant <ccoutant@google.com>
3699
3700 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3701 * Makefile.in: Regenerate.
3702 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3703 (Sized_elf_reloc_mapper::symbol_section): New function.
3704 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3705 (make_elf_reloc_mapper): New function.
3706 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3707 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3708 (Dwarf_abbrev_table::do_get_abbrev): New function.
3709 (Dwarf_ranges_table::read_ranges_table): New function.
3710 (Dwarf_ranges_table::read_range_list): New function.
3711 (Dwarf_pubnames_table::read_section): New function.
3712 (Dwarf_pubnames_table::read_header): New function.
3713 (Dwarf_pubnames_table::next_name): New function.
3714 (Dwarf_die::Dwarf_die): New function.
3715 (Dwarf_die::read_attributes): New function.
3716 (Dwarf_die::skip_attributes): New function.
3717 (Dwarf_die::set_name): New function.
3718 (Dwarf_die::set_linkage_name): New function.
3719 (Dwarf_die::attribute): New function.
3720 (Dwarf_die::string_attribute): New function.
3721 (Dwarf_die::int_attribute): New function.
3722 (Dwarf_die::uint_attribute): New function.
3723 (Dwarf_die::ref_attribute): New function.
3724 (Dwarf_die::child_offset): New function.
3725 (Dwarf_die::sibling_offset): New function.
3726 (Dwarf_info_reader::check_buffer): New function.
3727 (Dwarf_info_reader::parse): New function.
3728 (Dwarf_info_reader::do_parse): New function.
3729 (Dwarf_info_reader::do_read_string_table): New function.
3730 (Dwarf_info_reader::lookup_reloc): New function.
3731 (Dwarf_info_reader::get_string): New function.
3732 (Dwarf_info_reader::visit_compilation_unit): New function.
3733 (Dwarf_info_reader::visit_type_unit): New function.
3734 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3735 Sized_elf_reloc_mapper.
3736 (Sized_dwarf_line_info::symbol_section): Remove function.
3737 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3738 (Sized_dwarf_line_info::read_line_mappings): Remove object
3739 parameter, adjust callers.
3740 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3741 * dwarf_reader.h: Include <sys/types.h>.
3742 (class Track_relocs): Remove forward declaration.
3743 (class Elf_reloc_mapper): New class.
3744 (class Sized_elf_reloc_mapper): New class.
3745 (class Dwarf_abbrev_table): New class.
3746 (class Dwarf_range_list): New class.
3747 (class Dwarf_ranges_table): New class.
3748 (class Dwarf_pubnames_table): New class.
3749 (class Dwarf_die): New class.
3750 (class Dwarf_info_reader): New class.
3751 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3752 (Sized_dwarf_line_info::symbol_section): Remove member function.
3753 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3754 base class.
3755 * gdb-index.cc: New source file.
3756 * gdb-index.h: New source file.
3757 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3758 and .debug_types sections, call Layout::add_to_gdb_index.
3759 (Sized_relobj_incr::do_section_name): Implement.
3760 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3761 return type; Implement.
3762 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3763 return type.
3764 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3765 parameter list and return type.
3766 (Sized_incr_dynobj::do_section_contents): Likewise.
3767 * layout.cc: Include gdb-index.h.
3768 (Layout::Layout): Initialize gdb_index_data_.
3769 (Layout::init_fixed_output_section): Check for .gdb_index section.
3770 (Layout::add_to_gdb_index): New function. Instantiate.
3771 * layout.h: Add forward declaration for class Gdb_index.
3772 (Layout::add_to_gdb_index): New member function.
3773 (Layout::gdb_index_data_): New data member.
3774 * main.cc: Include gdb-index.h.
3775 (main): Print statistics for gdb index.
3776 * object.cc (Object::section_contents): Move code into
3777 do_section_contents.
3778 (need_decompressed_section): Check for sections needed when building
3779 gdb index.
3780 (build_compressed_section_map): Likewise.
3781 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3782 gdb index.
3783 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3784 sections; call Layout::add_to_gdb_index.
3785 (Sized_relobj_file::do_decompressed_section_contents): Call
3786 do_section_contents directly.
3787 * object.h (Object::do_section_contents): Adjust parameter list and
3788 return type.
3789 (Object::do_decompressed_section_contents): Call do_section_contents
3790 directly.
3791 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3792 return type.
3793 * options.h (class General_options): Add --gdb-index option.
3794 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3795 list and return type.
3796 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3797 * reloc.h (Track_relocs::checkpoint): New function.
3798 (Track_relocs::reset): New function.
3799
3800 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3801 New test cases.
3802 * testsuite/Makefile.in: Regenerate.
3803 * testsuite/gdb_index_test.cc: New test source file.
3804 * testsuite/gdb_index_test_1.sh: New test source file.
3805 * testsuite/gdb_index_test_2.sh: New test source file.
3806
647f1574
DK
38072012-03-19 Doug Kwan <dougkwan@google.com>
3808
3809 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3810 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3811 __exidx_start and __exidx_end. Make symbol table parameter
3812 anonymous as it is not used.
3813 * gold.cc (queue_middle_tasks): Call target hook to define any
3814 target-specific symbols.
3815 * target.h (Target::define_standard_symbols): New method.
3816 (Target::do_define_standard_symbols): Same.
3817 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3818 * testsuite/Makefile.in: Regenerate.
3819 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3820 and __exidx_end.
3821 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3822 relocations are generated for __exidx_start and __exidx_end.
3823
7c6109da
DK
38242012-03-16 Doug Kwan <dougkwan@google.com>
3825
3826 * testsuite/Makefile.am: Disable test initpri3b.
3827 * testsuite/Makefile.in: Regenerate.
3828
7b8957f8
DK
38292012-03-15 Doug Kwan <dougkwan@google.com>
3830
3831 * arm.cc (Target_arm::got_section): Make .got section read-only
3832 if -z now is given.
3833
14dc9ef7
ILT
38342012-03-15 Ian Lance Taylor <iant@google.com>
3835
3836 PR gold/13850
3837 * layout.cc (Layout::make_output_section): Correctly mark
3838 SHT_INIT_ARRAY, et. al., as relro.
3839
fa40b62a
DK
38402012-03-14 Doug Kwan <dougkwan@google.com>
3841
3842 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3843 dynamic relocations for protected symbols in shared objects.
3844
fd325007
ILT
38452012-03-13 Ian Lance Taylor <iant@google.com>
3846
3847 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3848 keep the larger alignment.
3849
e8dd54e1
CC
38502012-03-12 Cary Coutant <ccoutant@google.com>
3851
3852 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3853 handling of DW_LNE_define_file.
3854
feb5f3b0
CC
38552012-03-12 Cary Coutant <ccoutant@google.com>
3856
3857 * reduced_debug_output.cc
3858 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3859 codes to switch.
3860
a1fb4256
CC
38612012-02-29 Cary Coutant <ccoutant@google.com>
3862
3863 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3864
5dd8762a
CC
38652012-02-29 Cary Coutant <ccoutant@google.com>
3866
3867 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3868 Call Object::decompressed_section_contents.
3869 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3870 New dtor.
3871 (Sized_dwarf_line_info::buffer_start_): New data member.
3872 * merge.cc (Output_merge_data::do_add_input_section): Call
3873 Object::decompressed_section_contents.
3874 (Output_merge_string::do_add_input_section): Likewise.
3875 * object.cc (need_decompressed_section): New function.
3876 (build_compressed_section_map): Decompress sections needed later.
3877 (Sized_relobj_file::do_decompressed_section_contents): New function.
3878 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3879 * object.h (Object::decompressed_section_contents): New function.
3880 (Object::discard_decompressed_sections): New function.
3881 (Object::do_decompressed_section_contents): New function.
3882 (Object::do_discard_decompressed_sections): New function.
3883 (Compressed_section_info): New type.
3884 (Compressed_section_map): Include decompressed section contents.
3885 (Sized_relobj_file::do_decompressed_section_contents): New function.
3886 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3887
7b5de7ee
CC
38882012-02-16 Cary Coutant <ccoutant@google.com>
3889
3890 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3891 * testsuite/Makefile.in: Regenerate.
3892
f9fa4a63
CC
38932012-02-14 Cary Coutant <ccoutant@google.com>
3894
3895 * options.cc (General_options::finalize): Disallow -pie and -static.
3896
2c175ebc
DK
38972012-02-03 Doug Kwan <dougkwan@google.com>
3898
3899 * arm.cc (Arm_relocate_functions::abs8,
3900 Arm_relocate_functions::abs16): Use
3901 Bits::has_signed_unsigned_overflow32.
3902 (Arm_relocate_functions::thm_abs8): Correct range of
3903 overflow check.
3904 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3905 in assertions.
3906
90cff06f
DK
39072012-02-02 Doug Kwan <dougkwan@google.com>
3908
3909 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3910 position independent outputs, not just shared objects.
3911
63887f3d
L
39122012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3913
3914 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3915 * configure: Regenerated.
3916
bef2b434
ILT
39172012-01-27 Ian Lance Taylor <iant@google.com>
3918
3919 * reloc.h (Bits): New class with static functions, copied from
3920 namespace utils in arm.cc.
3921 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3922 instead.
3923
c335b55d
L
39242012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3925
3926 * incremental.cc (write_info_blocks): Correct relocation offset.
3927
41194d9f
L
39282012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3929
3930 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3931 (Relocate::tls_gd_to_le): Likewise.
3932
1bae613c
L
39332012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3934
3935 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3936
24482ca0
L
39372012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3938
3939 * configure.ac: Check if -mcmodel=medium works.
3940 * configure: Regenerated.
3941
c2c7840a
CC
39422012-01-24 Cary Coutant <ccoutant@google.com>
3943
3944 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3945 definition and ...
3946 (read_unsigned_LEB_128_x): ... this new function.
3947 (read_signed_LEB_128): Replaced with inline definition and ...
3948 (read_signed_LEB_128_x): ... this new function.
3949 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3950 (read_unsigned_LEB_128): Add inline definition.
3951 (read_signed_LEB_128_x): New function.
3952 (read_signed_LEB_128): Add inline definition.
3953 * testsuite/Makefile.am (leb128_unittest): New unit test.
3954 * testsuite/Makefile.in: Regenerate.
3955 * testsuite/leb128_unittest.cc: New unit test.
3956
833de760 39572012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3958
3959 PR gold/13617
3960 * i386.cc (Target_i386::do_code_fill): When using a jmp
3961 instruction, pad with nop instructions.
3962 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3963
618d6666
L
39642012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3965
3966 * x86_64.cc (gc_process_relocs): Add typename on types used in
3967 template.
3968 (scan_relocs): Likewise.
3969 (relocate_section): Likewise.
3970 (apply_relocation): Likewise.
3971
3660ff06
L
39722012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3973
3974 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3975 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3976 under x32.
3977
fc51264f
L
39782012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3979
3980 * x86_64.cc: Initial support for x32.
3981
dd74ae06
CC
39822012-01-03 Cary Coutant <ccoutant@google.com>
3983
3984 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3985 Use abstract base class for GOT.
3986 * gold/output.h (class Output_data_got_base): New abstract base class.
3987 (class Output_data_got): Derive from new base class, adjust ctors.
3988 (Output_data_got::reserve_slot): Make virtual; rename to
3989 do_reserve_slot; Adjust callers.
3990 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3991 pointer to abstract base class.
3992 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3993
83896202
ILT
39942011-12-18 Ian Lance Taylor <iant@google.com>
3995
3996 * object.h (Relobj::local_symbol_value): New function.
3997 (Relobj::local_plt_offset): New function.
3998 (Relobj::local_has_got_offset): New function.
3999 (Relobj::local_got_offset): New function.
4000 (Relobj::set_local_got_offset): New function.
4001 (Relobj::do_local_symbol_value): New pure virtual function.
4002 (Relobj::do_local_plt_offset): Likewise.
4003 (Relobj::do_local_has_got_offset): Likewise.
4004 (Relobj::do_local_got_offset): Likewise.
4005 (Relobj::do_set_local_got_offset): Likewise.
4006 (Sized_relobj::do_local_has_got_offset): Rename from
4007 local_has_got_offset.
4008 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4009 (Sized_relobj::do_set_local_got_offset): Rename from
4010 set_local_got_offset.
4011 (Sized_relobj_file::do_local_plt_offset): Rename from
4012 local_plt_offset.
4013 (Sized_relobj_file::do_local_symbol_value): New function.
4014 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4015 local_plt_offset.
4016 * output.cc (Output_data_got::Got_entry::write): Change object to
4017 Relobj. Use local_symbol_value.
4018 (Output_data_got::add_global_with_rel): Change rel_dyn to
4019 Output_data_reloc_generic*. Use add_global_generic.
4020 (Output_data_got::add_global_with_rela): Remove. Change all
4021 callers to use add_global_with_rel.
4022 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4023 Output_data_reloc_generic*. Use add_global_generic.
4024 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4025 callers to use add_global_pair_with_rel.
4026 (Output_data_got::add_local): Change object to Relobj*.
4027 (Output_data_got::add_local_plt): Likewise.
4028 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4029 change rel_dyn to Output_data_reloc_generic*. Use
4030 add_local_generic.
4031 (Output_data_got::add_local_with_rela): Remove. Change all
4032 callers to use all_local_with_rel.
4033 (Output_data_got::add_local_pair_with_rel): Change object to
4034 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4035 add_output_section_generic.
4036 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4037 callers to use add_local_pair_with_rel.
4038 (Output_data_got::reserve_local): Change object to Relobj*.
4039 * output.h: (class Output_data_reloc_generic): Add pure virtual
4040 declarations for add_global_generic, add_local_generic,
4041 add_output_section_generic.
4042 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4043 functions for Output_data_reloc_generic. Update declarations for
4044 changes listed in output.cc.
4045 (class Output_data_got): Change template parameter to got_size.
4046 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4047 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4048 function.
4049 (Sized_relobj_incr::do_local_plt_offset): New function.
4050 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4051 add_global_generic.
4052
76677ad0
CC
40532011-12-17 Cary Coutant <ccoutant@google.com>
4054
4055 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4056 * resolve.cc (Symbol_table::resolve): Likewise.
4057 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4058 arrays.
4059 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4060
8b8dd8d5
ILT
40612011-12-16 Ian Lance Taylor <iant@google.com>
4062
4063 * output.h (Output_data_reloc_generic::add): Only call
4064 add_dynamic_reloc if this is a dynamic reloc section.
4065
d55525b9
L
40662011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4067
4068 PR gold/13505
4069 * target-reloc.h (apply_relocation): Replace <64, false> with
4070 <size, big_endian>.
4071
ff81c7c1
NC
40722011-11-25 Nick Clifton <nickc@redhat.com>
4073
4074 * po/it.po: New Italian translation.
4075
628f39be
SA
40762011-11-17 Sterling Augustine <saugustine@google.com>
4077
4078 * script.cc (script_include_directive): Implement.
4079 (read_script_file): New local variables name and search_path. Update
4080 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4081 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4082 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4083
98ef3ea4
SA
40842011-11-11 Sterling Augustine <saugustine@google.com>
4085
4086 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4087 (file_or_sections_cmd): Likewise.
4088
f4a8b6d7
DK
40892011-11-11 Doug Kwan <dougkwan@google.com>
4090
4091 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4092 if --just-symbols is given.
4093
29ab395d
DK
40942011-11-10 Doug Kwan <dougkwan@google.com>
4095
4096 PR gold/13362
4097 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4098 when processing data relocs.
4099 * reloc.h (Relocate_functions::rel_unaligned): New method.
4100 (Relocate_functions::pcrel_unaligned): Ditto.
4101 (Relocate_functions::rel32_unaligned): Ditto.
4102 (Relocate_functions::pcrel32_unaligned): Ditto.
4103
2c339f71
DK
41042011-11-09 Doug Kwan <dougkwan@google.com>
4105
4106 PR gold/13362
4107 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4108 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4109 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4110 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4111 (Relocate_functions::rel_unaligned): New.
4112 (Relocate_functions::rel32_unaligned): New.
4113 * target-reloc.h (relocate_for_relocatable): Add code to handle
4114 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4115 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4116 arm_unaligned_reloc_r): New targets.
4117 * testsuite/Makefile.in: Regenerate.
4118 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4119 linking.
4120
3f3cddf1
ILT
41212011-11-02 Ian Lance Taylor <iant@google.com>
4122
4123 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4124 NATIVE_LINKER.
4125 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4126 * options.cc (General_options::finalize): Use library search path
4127 from configure script if specified. If not native and no sysroot,
4128 only search TOOLLIBDIR.
4129 * options.h (Search_directory::Search_directory): Change name to
4130 const std::string&.
4131 (General_options::add_to_library_path_with_sysroot): Change arg to
4132 const std::string&.
4133 * configure, Makefile.in, config.in: Rebuild.
4134
a8e2273b
ILT
41352011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4136
4137 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4138 we are working around the ARM1176 Erratum.
4139 * options.h (General_options::fix_arm1176): Add option.
4140 * testsuite/Makefile.am: Add testcases, and keep current ones
4141 working.
4142 * testsuite/Makefile.in: Regenerate.
4143 * testsuite/arm_fix_1176.s: New file.
4144 * testsuite/arm_fix_1176.sh: Likewise.
4145
cd6eab1c
ILT
41462011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4147
4148 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4149 may_use_blx_.
4150 (Target_arm::may_use_blx): Remove method.
4151 (Target_arm::set_may_use_blx): Likewise.
4152 (Target_arm::may_use_v4t_interworking): New method.
4153 (Target_arm::may_use_v5t_interworking): Likewise.
4154 (Target_arm::may_use_blx_): Remove member variable.
4155 (Arm_relocate_functions::arm_branch_common): Check for v5T
4156 interworking.
4157 (Arm_relocate_functions::thumb_branch_common): Likewise.
4158 (Reloc_stub::stub_type_for_reloc): Likewise.
4159 (Target_arm::do_finalize_sections): Correct interworking checks.
4160 * testsuite/Makefile.am: Add new tests.
4161 * testsuite/Makefile.in: Regenerate.
4162 * testsuite/arm_farcall_arm_arm.s: New test.
4163 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4164 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4165 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4166 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4167 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4168 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4169 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4170
286adcf4
CC
41712011-10-31 Cary Coutant <ccoutant@google.com>
4172
4173 PR gold/13023
4174 * expression.cc (Expression::eval_with_dot): Add
4175 is_section_dot_assignment parameter.
4176 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4177 absolute and assigning to dot within a section.
4178 * script-sections.cc
4179 (Output_section_element_assignment::set_section_addresses): Pass
4180 dot_section to set_if_absolute.
4181 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4182 as is_section_dot_assignment flag to eval_with_dot.
4183 (Output_section_element_dot_assignment::set_section_addresses):
4184 Likewise.
4185 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4186 parameter. Also set value if relative to dot_section; set the
4187 symbol's output_section.
4188 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4189 parameter. Adjust all callers.
4190 (Expression::eval_maybe_dot): Likewise.
4191 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4192 Adjust all callers.
4193 * testsuite/script_test_2.t: Test assignment of an absolute value
4194 to dot within an output section element.
4195
9634ed06
CC
41962011-10-31 Cary Coutant <ccoutant@google.com>
4197
4198 * options.h (class General_options): Add --[no-]gnu-unique options.
4199 * symtab.cc (Symbol_table::sized_write_globals): Convert
4200 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4201
de4101c7
CC
42022011-10-31 Cary Coutant <ccoutant@google.com>
4203
4204 PR gold/13359
4205 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4206 unnecessary assertion.
4207 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4208
7257cc92
ST
42092011-10-31 Sriraman Tallam <tmsriram@google.com>
4210
4211 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4212 gc_mark_symbol.
4213 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4214 gc_mark_symbol.
4215 Change to just keep the section associated with symbol.
4216 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4217 they are externally visible and --export-dynamic is turned on.
4218 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4219
bfc34b3f
ILT
42202011-10-19 Ian Lance Taylor <iant@google.com>
4221
4222 PR gold/13163
4223 * script-sections.cc
4224 (Output_section_element_dot_assignment::needs_output_section): New
4225 function.
4226
ea0d8c47
ILT
42272011-10-19 Ian Lance Taylor <iant@google.com>
4228
4229 PR gold/13204
4230 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4231 --section-start option was seen.
4232 * options.h (General_options::any_section_start): New function.
4233
abd242a9
DM
42342011-10-18 David S. Miller <davem@davemloft.net>
4235
4236 PR binutils/13301
4237 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4238 member to track relocation locations that have moved during TLS
4239 reloc optimizations.
4240 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4241 (Target_sparc::Relocate::relocate): Adjust view down by 4
4242 bytes if it matches reloc_adjust_addr_.
4243 (Target_sparc::Relocate::relocate_tls): Always move the
4244 __tls_get_addr call delay slot instruction forward 4 bytes when
4245 performing relaxation.
4246
bab9090f
CC
42472011-10-18 Cary Coutant <ccoutant@google.com>
4248
4249 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4250 (Output_file::map_no_anonymous): Check for non-zero
4251 return code from posix_fallocate.
4252
f7c5b166
CC
42532011-10-17 Cary Coutant <ccoutant@google.com>
4254
4255 PR gold/13245
4256 * plugin.cc (is_visible_from_outside): Check for symbols
4257 referenced from dynamic objects.
4258 * resolve.cc (Symbol_table::resolve): Don't count references
4259 from dynamic objects as references from real ELF files.
4260 * testsuite/plugin_test_2.sh: Adjust expected result.
4261
b490c0bb
CC
42622011-10-17 Cary Coutant <ccoutant@google.com>
4263
4264 * gold.cc: Include timer.h.
4265 (queue_middle_tasks): Stamp time.
4266 (queue_final_tasks): Likewise.
4267 * main.cc (main): Store timer in parameters. Print timers
4268 for each pass.
4269 * parameters.cc (Parameters::Parameters): Initialize timer_.
4270 (Parameters::set_timer): New function.
4271 (set_parameters_timer): New function.
4272 * parameters.h (Parameters::set_timer): New function.
4273 (Parameters::timer): New function.
4274 (Parameters::timer_): New data member.
4275 (set_parameters_timer): New function.
4276 * timer.cc (Timer::stamp): New function.
4277 (Timer::get_pass_time): New function.
4278 * timer.h (Timer::stamp): New function.
4279 (Timer::get_pass_time): New function.
4280 (Timer::pass_times_): New data member.
4281
f475cf7b
CC
42822011-10-17 Cary Coutant <ccoutant@google.com>
4283
4284 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4285 task for members of lib groups.
4286
cdd7e244
CC
42872011-10-17 Cary Coutant <ccoutant@google.com>
4288
4289 PR gold/13288
4f95c8b4 4290 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4291 (File_read::make_view): Move bounds check (replace with assert)...
4292 (File_read::find_or_make_view): ... to here.
4293
dfb45471
CC
42942011-10-12 Cary Coutant <ccoutant@google.com>
4295
4f95c8b4 4296 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4297 ::read returns less than requested size.
4298
53bbcc1b
CC
42992011-10-10 Cary Coutant <ccoutant@google.com>
4300
4f95c8b4 4301 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4302 Initialize defined_count_.
4303 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4304 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4305 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4306 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4307 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4308 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4309 member.
4310 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4311 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4312 Return zeroes instead of internal error.
4313
397b129b
CC
43142011-10-10 Cary Coutant <ccoutant@google.com>
4315
4316 PR gold/13249
4f95c8b4 4317 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4318 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4319 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4320 (Output_reloc::type_): Adjust size of bit field.
4321 (Output_reloc::use_plt_offset_): New bit field.
4322 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4323 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4324 flag. Adjust all callers.
4f95c8b4 4325 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4326 creating RELATIVE relocations.
4327
d5698657
NC
43282011-10-10 Nick Clifton <nickc@redhat.com>
4329
4330 * po/es.po: Updated Spanish translation.
4331 * po/fi.po: Updated Finnish translation.
4332
6a59a5c2
DN
43332011-10-03 Diego Novillo <dnovillo@google.com>
4334
4335 * options.cc (parse_uint): Fix dereference of RETVAL.
4336
f0558624
ST
43372011-09-29 Sriraman Tallam <tmsriram@google.com>
4338
4339 * layout.h (section_order_map_): New member.
4340 (get_section_order_map): New member function.
4341 * output.cc (Output_section::add_input_section): Check for patterns
4342 only when --section-ordering-file is specified.
4343 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4344 output_sections have been formed.
4345 * layout.cc (Layout_Layout): Initialize section_order_map_.
4346 * plugin.cc (update_section_order): Store order in order_map. Do not
4347 update the order.
4348 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4349 * testsuite/Makefile.in: Regenerate.
4350 * testsuite/plugin_section_order.c: New file.
4351 * testsuite/plugin_final_layout.cc: New file.
4352 * testsuite/plugin_final_layout.sh: New file.
4353
a7dac153
CC
43542011-09-29 Cary Coutant <ccoutant@google.com>
4355
4f95c8b4 4356 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4357 Check for NULL.
4f95c8b4 4358 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4359 symbols during incremental update.
4360 (Symbol_table::add_from_dynobj): Likewise.
4361
eebd87a5
ILT
43622011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4363 Ian Lance Taylor <iant@google.com>
4364
4365 * symtab.cc (Symbol_table::define_special_symbol): Always
4366 canonicalize version string.
4367
403a3331
CC
43682011-09-26 Cary Coutant <ccoutant@google.com>
4369
4f95c8b4
CC
4370 * gold.cc (queue_initial_tasks): Move option checks ...
4371 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4372 some options; make others fatal.
4373
235061c2
CC
43742011-09-26 Cary Coutant <ccoutant@google.com>
4375
4376 gcc PR lto/47247
4377 * plugin.cc (get_symbols_v2): New function.
4378 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4379 (is_referenced_from_outside): New function.
4380 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4381 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4382 (get_symbols): Pass version parameter.
4383 (get_symbols_v2): New function.
4384 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4385 parameter.
4386 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4387 (onload): Add LDPT_GET_SYMBOLS_V2.
4388 (all_symbols_read_hook): Use get_symbols_v2; check for
4389 LDPR_PREVAILING_DEF_IRONLY_EXP.
4390 * testsuite/plugin_test_3.sh: Update expected results.
4391
dc87f620
ILT
43922011-09-23 Simon Baldwin <simonb@google.com>
4393
4394 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4395 configuration options.
4396 * configure: Regenerate.
4397 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4398 * Makefile.in: Regenerate.
4399 * testsuite/Makefile.in: Regenerate.
4400
a8279f82
ST
44012011-09-19 Sriraman Tallam <tmsriram@google.com>
4402
4403 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4404
0c9350c8
CC
44052011-09-19 Cary Coutant <ccoutant@google.com>
4406
4407 * incremental.cc (can_incremental_update): Fix typo in comment.
4408 * incremental.h (can_incremental_update): Likewise.
4409
aa06ae28
CC
44102011-09-18 Cary Coutant <ccoutant@google.com>
4411
4412 * incremental.cc (can_incremental_update): New function.
4413 * incremental.h (can_incremental_update): New function.
4414 * layout.cc (Layout::init_fixed_output_section): Call it.
4415 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4416 * object.cc (Sized_relobj_file::do_layout): Call
4417 can_incremental_update.
4418
ebb300b2
CC
44192011-09-13 Cary Coutant <ccoutant@google.com>
4420
4421 * configure.ac: Check for glibc support for gnu_indirect_function
4422 support with static linking, setting automake conditional
4423 IFUNC_STATIC.
4424 * Makefile.in: Regenerate.
4425 * configure: Regenerate.
4426
4427 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4428 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4429 for IFUNC_STATIC.
4430 * testsuite/Makefile.in: Regenerate.
4431
1206d0d5
CC
44322011-09-13 Cary Coutant <ccoutant@google.com>
4433
4434 * incremental.cc (Sized_relobj_incr::do_layout): Call
4435 report_comdat_group for kept comdat sections.
4436 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4437 * testsuite/Makefile.in: Regenerate.
4438 * testsuite/incr_comdat_test_1.cc: New source file.
4439 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4440 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4441 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4442
40b29874
ILT
44432011-09-13 Ian Lance Taylor <iant@google.com>
4444
4445 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4446 variable external_symbols_offset.
4447
1b045aac
ILT
44482011-09-12 Ian Lance Taylor <iant@google.com>
4449
4450 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4451 triggered if object has no symbols.
4452
24c6c55a
DM
44532011-09-09 David S. Miller <davem@davemloft.net>
4454
4455 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4456 (Output_fill_debug_line::do_write): Likewise.
4457
66570254
CC
44582011-08-29 Cary Coutant <ccoutant@google.com>
4459
4460 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4461 casts to match formatting specs.
4462 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4463
8ea8cd50
CC
44642011-08-26 Cary Coutant <ccoutant@google.com>
4465
4466 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4467 remaining hole size when allocating.
4468 (Layout::make_output_section): Set fill methods for debug sections.
4469 * layout.h (Free_list::Free_list_node): Move from private to
4470 public.
4471 (Free_list::set_min_hole_size): New function.
4472 (Free_list::begin, Free_list::end): New functions.
4473 (Free_list::min_hole_): New data member.
4474 * output.cc: Include dwarf.h.
4475 (Output_fill_debug_info::do_minimum_hole_size): New function.
4476 (Output_fill_debug_info::do_write): New function.
4477 (Output_fill_debug_line::do_minimum_hole_size): New function.
4478 (Output_fill_debug_line::do_write): New function.
4479 (Output_section::Output_section): Initialize new data member.
4480 (Output_section::set_final_data_size): Ensure patch space is larger
4481 than minimum hole size.
4482 (Output_section::do_write): Fill holes in debug sections.
4483 * output.h (Output_fill): New class.
4484 (Output_fill_debug_info): New class.
4485 (Output_fill_debug_line): New class.
4486 (Output_section::set_free_space_fill): New function.
4487 (Output_section::free_space_fill_): New data member.
4488 * testsuite/Makefile.am (incremental_test_3): Add
4489 --incremental-patch option.
4490 (incremental_test_4): Likewise.
4491 (incremental_test_5): Likewise.
4492 (incremental_test_6): Likewise.
4493 (incremental_copy_test): Likewise.
4494 (incremental_common_test_1): Likewise.
4495 * testsuite/Makefile.in: Regenerate.
4496
7cf80422
NC
44972011-08-26 Nick Clifton <nickc@redhat.com>
4498
4499 * po/es.po: Updated Spanish translation.
4500
c3f7b0e5
CC
45012011-08-01 Cary Coutant <ccoutant@google.com>
4502
4503 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4504 * gold/testsuite/Makefile.in: Regenerate.
4505 * gold/testsuite/justsyms_exec.c: New source file.
4506 * gold/testsuite/justsyms_lib.c: New source file.
4507
9590bf25
CC
45082011-08-01 Cary Coutant <ccoutant@google.com>
4509
4510 * layout.cc (Layout::set_segment_offsets): Don't realign text
4511 segment if -Ttext was specified.
4512 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4513 file type.
4514 * object.h (Sized_relobj_file::e_type): New function.
4515 (Sized_relobj_file::e_type_): New data member.
4516 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4517 base address for ET_EXEC files.
4518 * target.cc (Target::do_make_elf_object_implementation): Allow
4519 ET_EXEC files with --just-symbols option.
4520
dcd8d12e
CC
45212011-07-28 Cary Coutant <ccoutant@google.com>
4522
4523 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4524 Add thread_number parameter.
4525 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4526 * workqueue-threads.cc
4527 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4528 current thread if its thread number is greater than desired thread
4529 count.
4530 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4531 Add thread_number parameter.
4532 (Workqueue::should_cancel_thread): Likewise.
4533 (Workqueue::find_runnable_or_wait): Pass thread_number to
4534 should_cancel_thread.
4535 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4536 parameter.
4537
804eb480
ST
45382011-07-22 Sriraman Tallam <tmsriram@google.com>
4539
4540 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4541 only after checking if it cannot be forced local.
4542 * symtab.h (is_externally_visible): Check if the symbol is not forced
4543 local.
4544
f1ddb600
ILT
45452011-07-15 Ian Lance Taylor <iant@google.com>
4546
4547 * options.h (class General_options): Add --print-output-format.
4548 Move -EL next to -EB, for better --help output.
4549 * target-select.cc: Include <cstdio>, "options.h", and
4550 "parameters.h".
4551 (Target_selector::do_target_bfd_name): New function.
4552 (print_output_format): New function.
4553 * target-select.h (class Target_selector): Update declarations.
4554 (Target_selector::target_bfd_name): New function.
4555 (print_output_format): Declare.
4556 * main.cc: Include "target-select.h".
4557 (main): Handle --print-output-format.
4558 * gold.cc: Include "target-select.h".
4559 (queue_initial_tasks): Handle --print-output-format when there are
4560 no input files.
4561 * parameters.cc (parameters_force_valid_target): Give a better
4562 error message if -EB/-EL does not match target.
4563 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4564 function.
4565
7d172687
ILT
45662011-07-15 Ian Lance Taylor <iant@google.com>
4567
4568 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4569 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4570 (Output_data_plt_i386::do_write): Write address of .dynamic
4571 section to first entry in .got.plt section.
4572 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4573 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4574 Initialize layout_.
4575 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4576 section to first entry in .got.plt section.
4577 * layout.h (Layout::dynamic_section): New function.
4578
e9552f7e
ST
45792011-07-13 Sriraman Tallam <tmsriram@google.com>
4580
4581 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4582 to claim_file call.
4583 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4584 input_section_position_, and input_section_glob_.
4585 (read_layout_from_file): Call function section_ordering_specified.
4586 * layout.h (is_section_ordering_specified): New function.
4587 (section_ordering_specified): New function.
4588 (section_ordering_specified_): New boolean member.
4589 * main.cc(main): Call load_plugins after layout object is defined.
4590 * output.cc (Output_section::add_input_section): Use
4591 function section_ordering_specified to check if section ordering is
4592 needed.
4593 * output.cc (Output_section::add_relaxed_input_section): Use
4594 function section_ordering_specified to check if section ordering is
4595 needed.
4596 (Output_section::update_section_layout): New function.
4597 (Output_section::sort_attached_input_sections): Check if input section
4598 must be reordered.
4599 * output.h (Output_section::update_section_layout): New function.
4600 * plugin.cc (get_section_count): New function.
4601 (get_section_type): New function.
4602 (get_section_name): New function.
4603 (get_section_contents): New function.
4604 (update_section_order): New function.
58797674 4605 (allow_section_ordering): New function.
e9552f7e
ST
4606 (Plugin::load): Add the new interfaces to the transfer vector.
4607 (Plugin_manager::load_plugins): New parameter.
4608 (Plugin_manager::all_symbols_read): New parameter.
4609 (Plugin_manager::claim_file): New parameter. Save the elf object for
4610 unclaimed objects.
4611 (Plugin_manager::get_elf_object): New function.
4612 (Plugin_manager::get_view): Change to directly use the bool to check
4613 if get_view is called from claim_file_hook.
4614 * plugin.h (input_objects): New function
4615 (Plugin__manager::load_plugins): New parameter.
4616 (Plugin_manager::claim_file): New parameter.
4617 (Plugin_manager::get_elf_object): New function.
4618 (Plugin_manager::in_claim_file_handler): New function.
4619 (Plugin_manager::in_claim_file_handler_): New member.
4620 (layout): New function.
4621 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4622 handler with an extra parameter. Make the elf object before calling
4623 claim_file handler.
4624 * testsuite/plugin_test.c (get_section_count): New function pointer.
4625 (get_section_type): New function pointer.
4626 (get_section_name): New function pointer.
4627 (get_section_contents): New function pointer.
4628 (update_section_order): New function pointer.
4629 (allow_section_ordering): New function pointer.
4630 (onload): Check if the new interfaces exist.
4631
9446efde
ILT
46322011-07-13 Ian Lance Taylor <iant@google.com>
4633
4634 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4635 relro section.
4636 * x86_64.cc (Target_x86_64::got_section): Likewise.
4637 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4638 (relro_now_test_SOURCES): New variable.
4639 (relro_now_test_DEPENDENCIES): New variable.
4640 (relro_now_test_LDFLAGS): New variable.
4641 (relro_now_test_LDADD): New variable.
4642 (relro_now_test.so): New target.
4643 * testsuite/Makefile.in: Rebuild.
4644
07aa62f2
ILT
46452011-07-12 Ian Lance Taylor <iant@google.com>
4646
4647 PR gold/12980
4648 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4649 GLOB_DAT relocation rather than a RELATIVE relocation for a
4650 protected symbol when creating a shared library.
4651 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4652 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4653 * testsuite/protected_main_1.cc (main): Test that protected
4654 function has same address.
4655
e2153196
ILT
46562011-07-11 Ian Lance Taylor <iant@google.com>
4657
4658 PR gold/12979
4659 * options.h (class General_options): Add -Bgroup.
4660 * options.cc (General_options::finalize): If -Bgroup is set,
4661 default to --unresolved-symbols=report-all.
4662 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4663 * target-reloc.h (issue_undefined_symbol_error): Handle
4664 --unresolved-symbols=report-all.
4665
6daf5215
ILT
46662011-07-08 Ian Lance Taylor <iant@google.com>
4667
4668 PR gold/11985
4669 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4670 if linker script discards key sections.
4671 (Layout::create_dynamic_symtab): Likewise.
4672 (Layout::assign_local_dynsym_offsets): Likewise.
4673 (Layout::sized_create_version_sections): Likewise.
4674 (Layout::create_interp): Likewise.
4675 (Layout::finish_dynamic_section): Likewise.
4676 (Layout::set_dynamic_symbol_size): Likewise.
4677
beabb2c6
ILT
46782011-07-08 Ian Lance Taylor <iant@google.com>
4679
4680 PR gold/12386
4681 * options.h (class General_options): Add --unresolved-symbols.
4682 * target-reloc.h (issue_undefined_symbol_error): Check
4683 --unresolved-symbols. Add comments.
4684
9c16daf1
ILT
46852011-07-08 Ian Lance Taylor <iant@google.com>
4686
4687 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4688 expression more complex.
4689
191f1a2d
ILT
46902011-07-08 Ian Lance Taylor <iant@google.com>
4691
4692 PR gold/11317
4693 * target-reloc.h (issue_undefined_symbol_error): New inline
4694 function, broken out of relocate_section.
4695 (relocate_section): Call issue_undefined_symbol_error.
4696 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4697 there is no TLS segment if we are about to issue an undefined
4698 symbol error.
4699 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4700
62855347
ILT
47012011-07-08 Ian Lance Taylor <iant@google.com>
4702
4703 PR gold/12279
4704 * resolve.cc (Symbol_table::should_override): Add fromtype
4705 parameter. Change all callers. Give error when linking together
4706 TLS and non-TLS symbol.
4707 (Symbol_table::should_override_with_special): Add fromtype
4708 parameter. Change all callers.
4709 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4710 there is no TLS segment if we have reported some errors.
4711 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4712
67181c72
ILT
47132011-07-08 Ian Lance Taylor <iant@google.com>
4714
4715 PR gold/12372
4716 * target.h (Target::plt_address_for_global): New function.
4717 (Target::plt_address_for_local): New function.
4718 (Target::plt_section_for_global): Remove.
4719 (Target::plt_section_for_local): Remove.
4720 (Target::do_plt_address_for_global): New virtual function.
4721 (Target::do_plt_address_for_local): New virtual function.
4722 (Target::do_plt_section_for_global): Remove.
4723 (Target::do_plt_section_for_local): Remove.
4724 (Target::register_global_plt_entry): Add Symbol_table and Layout
4725 parameters.
4726 * output.cc (Output_data_got::Got_entry::write): Use
4727 plt_address_for_global and plt_address_for_local.
4728 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4729 address of output section.
4730 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4731 got_irelative_, and irelative_count_ fields. Update
4732 declarations.
4733 (Output_data_plt_i386::has_irelative_section): New function.
4734 (Output_data_plt_i386::entry_count): Add irelative_count_.
4735 (Output_data_plt_i386::set_final_data_size): Likewise.
4736 (class Target_i386): Add got_irelative_ and rel_irelative_
4737 fields. Update declarations.
4738 (Target_i386::Target_i386): Initialize new fields.
4739 (Target_i386::do_plt_address_for_global): New function replacing
4740 do_plt_section_for_global.
4741 (Target_i386::do_plt_address_for_local): New function replacing
4742 do_plt_section_for_local.
4743 (Target_i386::got_section): Create got_irelative_.
4744 (Target_i386::rel_irelative_section): New function.
4745 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4746 fields. Don't define __rel_iplt_{start,end}.
4747 (Output_data_plt_i386::add_entry): Add symtab and layout
4748 parameters. Change all callers. Use different PLT and GOT for
4749 IFUNC symbols.
4750 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4751 layout parameters. Change all callers. Use different PLT and
4752 GOT.
4753 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4754 (Output_data_plt_i386::rel_irelative): New function.
4755 (Output_data_plt_i386::address_for_global): New function.
4756 (Output_data_plt_i386::address_for_local): New function.
4757 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4758 IRELATIVE GOT when changing IFUNC GOT entries.
4759 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4760 reloc.
4761 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4762 if we didn't create an IRELATIVE GOT.
4763 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4764 plt_address_for_local.
4765 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4766 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4767 got_irelative_, and irelative_count_ fields. Update
4768 declarations.
4769 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4770 Initialize new fields. Remove symtab parameter. Change all
4771 callers.
4772 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4773 irelative_count_.
4774 (Output_data_plt_x86_64::has_irelative_section): New function.
4775 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4776 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4777 fields. Update declarations.
4778 (Target_x86_64::Target_x86_64): Initialize new fields.
4779 (Target_x86_64::do_plt_address_for_global): New function replacing
4780 do_plt_section_for_global.
4781 (Target_x86_64::do_plt_address_for_local): New function replacing
4782 do_plt_section_for_local.
4783 (Target_x86_64::got_section): Create got_irelative_.
4784 (Target_x86_64::rela_irelative_section): New function.
4785 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4786 all callers. Don't create __rel_iplt_{start,end}.
4787 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4788 parameters. Change all callers. Use different PLT and GOT for
4789 IFUNC symbols.
4790 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4791 layout parameters. Change all callers. Use different PLT and
4792 GOT.
4793 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4794 parameters. Change all callers. Use different PLT and GOT for
4795 IFUNC symbols.
4796 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4797 (Output_data_plt_x86_64::rela_irelative): New function.
4798 (Output_data_plt_x86_64::address_for_global): New function.
4799 (Output_data_plt_x86_64::address_for_local): New function.
4800 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4801 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4802 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4803 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4804 parameters.
4805 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4806 reloc.
4807 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4808 symbols if we didn't create an IRELATIVE GOT.
4809 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4810 plt_address_for_local.
4811 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4812 * testsuite/ifuncvar1.c: New test file.
4813 * testsuite/ifuncvar2.c: New test file.
4814 * testsuite/ifuncvar3.c: New test file.
4815 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4816 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4817 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4818 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4819 * testsuite/Makefile.in: Rebuild.
4820
33c15b45
CC
48212011-07-07 Cary Coutant <ccoutant@google.com>
4822
4823 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4824 (two_file_test_1_ndebug.o): Likewise.
4825 (two_file_test_1b_ndebug.o): Likewise.
4826 (two_file_test_2_ndebug.o): Likewise.
4827 (two_file_test_main_ndebug.o): Likewise.
4828 (incremental_test_2): Link with no-debug versions.
4829
f48b5fb7
CC
48302011-07-06 Cary Coutant <ccoutant@google.com>
4831
4832 * gold/incremental.cc
4833 (Output_section_incremental_inputs::write_info_blocks): Check for
4834 hidden and internal symbols.
4835
221597a5
CC
48362011-07-06 Cary Coutant <ccoutant@google.com>
4837
4838 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4839 Check disposition for startup file.
4840 (Incremental_inputs::report_command_line): Ignore
4841 --incremental-startup-unchanged option.
4842 * options.cc (General_options::parse_incremental_startup_unchanged):
4843 New function.
4844 (General_options::General_options): Initialize new data member.
4845 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4846 (General_options): Add --incremental-startup-unchanged option.
4847 (General_options::incremental_startup_disposition): New function.
4848 (General_options::incremental_startup_disposition_): New data member.
4849
e24719f6
CC
48502011-07-06 Cary Coutant <ccoutant@google.com>
4851
4852 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4853 input file index to Script_info ctor.
4854 (Sized_incremental_binary::do_file_has_changed): Find the
4855 command-line argument for files named in scripts.
4856 * incremental.h (Script_info::Script_info): New ctor
4857 with input file index.
4858 (Script_info::input_file_index): New function.
4859 (Script_info::input_file_index_): New data member.
4860 (Incremental_binary::get_library): Add const.
4861 (Incremental_binary::get_script_info): Add const.
4862 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4863 * testsuite/Makefile.am (incremental_test_5): New test case.
4864 (incremental_test_6): New test case.
4865 * testsuite/Makefile.in: Regenerate.
4866
8f7c81e8
CC
48672011-07-06 Cary Coutant <ccoutant@google.com>
4868
4869 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4870 debug output when command lines differ.
4871
9fbd3822
CC
48722011-07-06 Cary Coutant <ccoutant@google.com>
4873
4874 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4875 --incremental-patch option.
4876 * layout.cc (Free_list::allocate): Extend allocation beyond original
4877 end if enabled.
4878 (Layout::make_output_section): Mark sections that should get
4879 patch space.
4880 * options.cc (parse_percent): New function.
4881 * options.h (parse_percent): New function.
4882 (DEFINE_percent): New macro.
4883 (General_options): Add --incremental-patch option.
4884 * output.cc (Output_section::Output_section): Initialize new data
4885 members.
4886 (Output_section::add_input_section): Print section name when out
4887 of patch space.
4888 (Output_section::add_output_section_data): Likewise.
4889 (Output_section::set_final_data_size): Add patch space when
4890 doing --incremental-full.
4891 (Output_section::do_reset_address_and_file_offset): Remove patch
4892 space.
4893 (Output_segment::set_section_list_addresses): Print debug output
4894 only if --incremental-update.
4895 * output.h (Output_section::set_is_patch_space_allowed): New function.
4896 (Output_section::is_patch_space_allowed_): New data member.
4897 (Output_section::patch_space_): New data member.
4898 * parameters.cc (Parameters::incremental_full): New function.
4899 * parameters.h (Parameters::incremental_full): New function
4900 * testsuite/Makefile.am (incremental_test_2): Add test for
4901 --incremental-patch option.
4902 * testsuite/Makefile.in: Regenerate.
4903 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4904 (t18): Remove function body.
4905
f6cccc2c
DK
49062011-07-05 Doug Kwan <dougkwan@google.com>
4907
4908 PR gold/12771
4909 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4910 Arm_Address type for relocation result.
4911 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4912 overflow check.
4913 (Arm_relocate_functions::abs32): Use unaligned access.
4914 (Arm_relocate_functions::rel32): Ditto.
4915 (Arm_relocate_functions::prel31): Ditto.
4916 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4917 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4918 static data relocations.
4919 * testsuite/Makefile.in: Regnerate.
4920 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4921
28a13fec
ILT
49222011-07-05 Ian Lance Taylor <iant@google.com>
4923
4924 PR gold/12392
4925 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4926 symbols if necessary.
4927 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4928
24d47b34
ILT
49292011-07-05 Ian Lance Taylor <iant@google.com>
4930
4931 PR gold/12952
4932 * resolve.cc (Symbol::override_base_with_special): Simply override
4933 version with special symbol version, ignoring previous version.
4934
41f9cbbe
ILT
49352011-07-05 Ian Lance Taylor <iant@google.com>
4936
4937 * object.cc (Sized_relobj_file::include_section_group): Add
4938 information to comment about signature location.
4939
886288f1
ILT
49402011-07-02 Ian Lance Taylor <iant@google.com>
4941
4942 PR gold/12957
4943 * options.h (class General_options): Add -f and -F.
4944 * options.cc (General_options::finalize): Fatal error if -f/-F
4945 are used without -shared.
4946 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4947
ae3a6d4f
ILT
49482011-07-02 Ian Lance Taylor <iant@google.com>
4949
4950 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4951
21131061
ILT
49522011-07-01 Ian Lance Taylor <iant@google.com>
4953
4954 PR gold/12525
4955 PR gold/12952
4956 * resolve.cc (Symbol::override_base_with_special): Don't override
4957 the version if the overriding symbol has a different name.
4958 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4959 all callers. If we give an error about an undefined version,
4960 define the base version if necessary.
4961 * dynobj.h (class Versions): Update declaration.
4962 * testsuite/weak_alias_test_5.cc: New file.
4963 * testsuite/weak_alias_test.script: New file.
4964 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4965 and versioned_alias have the right value, and call t2.
4966 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4967 weak_alias_test_5.so.
4968 (weak_alias_test_LDADD): Likewise.
4969 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4970 * testsuite/Makefile.in: Rebuild.
4971
611062c0
ILT
49722011-07-01 Ian Lance Taylor <iant@google.com>
4973
4974 PR gold/12525
4975 * options.h (class General_options): Support -z notext.
4976 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4977 -Wl,-z,notext.
4978 (two_file_shared_nonpic.so): Likewise.
4979 (two_file_shared_mixed.so): Likewise.
4980 (two_file_shared_mixed_1.so): Likewise.
4981 (weak_undef_lib_nonpic.so): Likewise.
4982 (alt/weak_undef_lib_nonpic.so): Likewise.
4983 (tls_test_shared_nonpic.so): Likewise.
4984 * testsuite/Makefile.in: Rebuild.
4985
328c7c2f
ILT
49862011-07-01 Ian Lance Taylor <iant@google.com>
4987
4988 PR gold/12525
4989 * configure.ac: Test whether static linking works, setting
4990 the automake conditional HAVE_STATIC.
4991 * testsuite/Makefile.am: Disable tests using -static if
4992 HAVE_STATIC is not true.
4993 * configure, testsuite/Makefile.in: Rebuild.
4994
02d7cd44
ILT
49952011-07-01 Ian Lance Taylor <iant@google.com>
4996
4997 PR gold/12525
4998 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4999 Assert if we see DW_EH_PE_indirect.
5000 * target.h (Target::ehframe_datarel_base): New function.
5001 (Target::do_ehframe_datarel_base): New target function.
5002 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5003 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5004 function.
5005
07a60597
ILT
50062011-07-01 Ian Lance Taylor <iant@google.com>
5007
5008 PR gold/12571
5009 * options.h (class General_options): Add
5010 --ld-generated-unwind-info.
5011 * ehframe.cc (Fde::write): Add address parameter. Change all
5012 callers. If associated with PLT, fill in address and size.
5013 (Cie::set_output_offset): Only add merge mapping if there is an
5014 object.
5015 (Cie::write): Add address parameter. Change all callers.
5016 (Eh_frame::add_ehframe_for_plt): New function.
5017 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5018 input_offset_ fields into union u_, with new plt field.
5019 (Fde::Fde): Adjust for new union field.
5020 (Fde::Fde) [Output_data version]: New constructor.
5021 (Fde::add_mapping): Only add merge mapping if there is an object.
5022 (class Cie): Update declarations.
5023 (class Eh_frame): Declare add_ehframe_for_plt.
5024 * layout.cc (Layout::layout_eh_frame): Break out code into
5025 make_eh_frame_section, and call it.
5026 (Layout::make_eh_frame_section): New function.
5027 (Layout::add_eh_frame_for_plt): New function.
5028 * layout.h (class Layout): Update declarations.
5029 * merge.cc (Merge_map::add_mapping): Add assertion.
5030 * i386.cc: Include "dwarf.h".
5031 (class Output_data_plt_i386): Make first_plt_entry,
5032 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5033 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5034 and plt_eh_frame_fde.
5035 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5036 boundary. Call add_eh_frame_for_plt if appropriate.
5037 * x86_64.cc: Include "dwarf.h".
5038 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5039 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5040 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5041 and plt_eh_frame_fde.
5042 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5043 appropriate.
5044
14788a3f
ILT
50452011-06-29 Ian Lance Taylor <iant@google.com>
5046
5047 PR gold/12629
5048 * object.cc (Sized_relobj_file::layout_section): Change shdr
5049 parameter to be const.
5050 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5051 out of do_layout.
5052 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5053 appropriate. Call layout_eh_frame_section.
5054 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5055 sections.
5056 * object.h (class Sized_relobj_file): Update declarations.
5057
6c21fce1
ILT
50582011-06-29 Ian Lance Taylor <iant@google.com>
5059
37e41b03 5060 PR gold/12652
6c21fce1
ILT
5061 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5062 modifier.
5063 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5064
4d5e4e62
ILT
50652011-06-29 Ian Lance Taylor <iant@google.com>
5066
5067 PR gold/12675
5068 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5069 SHT_X86_64_UNWIND.
5070 * layout.cc (Layout::layout_eh_frame): Likewise.
5071
886f533a
ILT
50722011-06-29 Ian Lance Taylor <iant@google.com>
5073
5074 PR gold/12695
5075 * layout.cc (Layout::symtab_section_shndx): New function.
5076 * layout.h (class Layout): Declare symtab_section_shndx.
5077 * output.cc (Output_section::write_header): Call it.
5078
f3ae1b28
ILT
50792011-06-29 Ian Lance Taylor <iant@google.com>
5080
5081 PR gold/12818
5082 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5083 symbols which are not used in a relocation.
5084
aecf301f
ILT
50852011-06-28 Ian Lance Taylor <iant@google.com>
5086
5087 PR gold/12898
5088 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5089 script create indistinguishable segments.
5090 (Layout::set_segment_offsets): Use stable_sort when sorting
5091 segments. Pass this to Compare_segments constructor.
5092 * layout.h (class Layout): Make segment_precedes non-static.
5093 (class Compare_segments): Change from struct to class. Add
5094 layout_ field. Add constructor.
5095 * script-sections.cc
5096 (Script_sections::attach_sections_using_phdrs_clause): Rename
5097 local orphan to is_orphan. Don't report failure to put empty
5098 section in segment. On attachment failure, report name of
5099 section, and attach to first PT_LOAD segment.
5100
03ef7571
ILT
51012011-06-28 Ian Lance Taylor <iant@google.com>
5102
5103 PR gold/12934
5104 * target-select.cc (Target_selector::Target_selector): Add
5105 emulation parameter. Change all callers.
5106 (select_target_by_bfd_name): Rename from select_target_by_name.
5107 Change all callers.
5108 (select_target_by_emulation): New function.
5109 (supported_emulation_names): New function.
5110 * target-select.h (class Target_selector): Add emulation_ field.
5111 Update declarations.
5112 (Target_selector::recognize_by_bfd_name): Rename from
5113 recognize_by_name. Change all callers.
5114 (Target_selector::supported_bfd_names): Rename from
5115 supported_names. Change all callers.
5116 (Target_selector::recognize_by_emulation): New function.
5117 (Target_selector::supported_emulations): New function.
5118 (Target_selector::emulation): New function.
5119 (Target_selector::do_recognize_by_bfd_name): Rename from
5120 do_recognize_by_name. Change all callers.
5121 (Target_selector::do_supported_bfd_names): Rename from
5122 do_supported_names. Change all callers.
5123 (Target_selector::do_recognize_by_emulation): New function.
5124 (Target_selector::do_supported_emulations): New function.
5125 (select_target_by_bfd_name): Change name in declaration.
5126 (select_target_by_emulation): Declare.
5127 (supported_emulation_names): Declare.
5128 * parameters.cc (parameters_force_valid_target): Try to find
5129 target based on emulation from -m option.
5130 * options.h (class General_options): Change doc string for -m.
5131 * options.cc (help): Print emulations.
5132 (General_options::parse_V): Likewise.
5133 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5134 Add emulation parameter. Change all callers.
5135
200b2bb9
ILT
51362011-06-28 Ian Lance Taylor <iant@google.com>
5137
5138 * target.h (class Target): Add osabi_ field.
5139 (Target::osabi): New function.
5140 (Target::set_osabi): New function.
5141 (Target::Target): Initialize osabi_.
5142 (Target::do_adjust_elf_header): Make pure virtual.
5143 (Sized_target::do_adjust_elf_header): Declare.
5144 * target.cc (Sized_target::do_adjust_elf_header): New function.
5145 (class Sized_target): Instantiate all versions.
5146 * freebsd.h (class Target_freebsd): Remove.
5147 (Target_selector_freebsd::do_recognize): Call set_osabi on
5148 Target.
5149 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5150 (Target_selector_freebsd::set_osabi): Remove.
5151 * i386.cc (class Target_i386): Inherit from Sized_target rather
5152 than Target_freebsd.
5153 * x86_64.cc (class Target_x86_64): Likewise.
5154
b3ce541e
ILT
51552011-06-28 Ian Lance Taylor <iant@google.com>
5156
5157 * target.h (Target::can_check_for_function_pointers): Rewrite.
5158 Make non-virtual.
5159 (Target::can_icf_inline_merge_sections): Likewise.
5160 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5161 (Target::Target_info): Add can_icf_inline_merge_sections field.
5162 (Target::do_can_check_for_function_pointers): New virtual
5163 function.
5164 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5165 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5166 from can_check_for_function_pointers, move in file.
5167 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5168 section_may_have_icf_unsafe_poineters, move in file.
5169 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5170 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5171 Rename from can_check_for_function_pointers, move in file.
5172 (Target_i386::can_icf_inline_merge_sections): Remove.
5173 (Target_i386::i386_info): Initialize
5174 can_icf_inline_merge_sections.
5175 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5176 Initialize can_icf_inline_merge_sections.
5177 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5178 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5179 Rename from can_check_for_function_pointers, move in file.
5180 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5181 (Target_x86_64::x86_64_info): Initialize
5182 can_icf_inline_merge_sections.
5183 * testsuite/testfile.cc (Target_test::test_target_info):
5184 Likewise.
5185 * icf.cc (get_section_contents): Correct formatting.
5186
6d1c4efb
ILT
51872011-06-27 Ian Lance Taylor <iant@google.com>
5188
5189 * symtab.cc (Symbol::versioned_name): New function.
5190 (Symbol_table::add_to_final_symtab): Use versioned_name when
5191 appropriate.
5192 (Symbol_table::sized_write_symbol): Likewise.
5193 * symtab.h (class Symbol): Declare versioned_name.
5194 * stringpool.h (class Stringpool_template): Add variant of add
5195 which takes a std::basic_string.
5196 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5197 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5198 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5199 (ver_test_12.o): New target.
5200 * testsuite/Makefile.in: Rebuild.
5201
57eb9b50
DK
52022011-06-27 Doug Kwan <dougkwan@google.com>
5203
5204 * arm.cc (Arm_relocate_functions::thm_jump8,
5205 Arm_relocate_functions::thm_jump11): Use a wider signed
5206 type to compute offset.
5207 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5208 arm_thm_jump8.
5209 * testsuite/Makefile.in: Regenerate.
5210 * testsuite/arm_branch_in_range.sh: Check test results of
5211 arm_thm_jump11 and arm_thm_jump8.
5212 * testsuite/arm_thm_jump11.s: New test source file.
5213 * testsuite/arm_thm_jump11.t: New linker script.
5214 * testsuite/arm_thm_jump8.s: New test source file.
5215 * testsuite/arm_thm_jump8.t: New linker script.
5216
487b39df
ILT
52172011-06-24 Ian Lance Taylor <iant@google.com>
5218
5219 * layout.cc: Include "object.h".
5220 (ctors_sections_in_init_array): New static variable.
5221 (Layout::is_ctors_in_init_array): New function.
5222 (Layout::layout): Add entry to ctors_sections_in_init_array if
5223 appropriate.
5224 * layout.h (class Layout): Declare is_ctors_in_init_array.
5225 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5226 is_ctors_reverse_view is set.
5227 (Sized_relobj_file::write_sections): Add layout parameter. Change
5228 all callers. Set is_ctors_reverse_view field of View_size.
5229 (Sized_relobj_file::reverse_words): New function.
5230 * object.h (Sized_relobj_file::View_size): Add
5231 is_ctors_reverse_view field.
5232 (class Sized_relobj_file): Update declarations.
5233 * testsuite/initpri3.c: New test.
5234 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5235 initpri3b.
5236 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5237 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5238 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5239 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5240 * testsuite/Makefile.in: Rebuild.
5241
472076e4
CC
52422011-06-24 Cary Coutant <ccoutant@google.com>
5243
5244 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5245 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5246 (debug_msg_cdebug.err): New targets.
5247 * testsuite/Makefile.in: Regenerate.
5248 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5249 Fix checks for link with shared library.
5250
a60af0db
DK
52512011-06-24 Doug Kwan <dougkwan@google.com>
5252
5253 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5254 skip empty text sections.
5255 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5256
5393d741
ILT
52572011-06-22 Ian Lance Taylor <iant@google.com>
5258
5259 PR gold/12910
5260 * options.h (class General_options): Add --ctors-in-init-array.
5261 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5262 friends as SHT_PROGBITS for merging sections.
5263 (Layout::layout): Remove special handling of .init_array and
5264 friends. Don't sort if doing relocatable link. Sort for .ctors
5265 and .dtors if ctors_in_init_array.
5266 (Layout::make_output_section): Force correct section types for
5267 .init_array and friends. Don't sort if doing relocatable link,
5268 Don't sort .ctors and .dtors if ctors_in_init_array.
5269 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5270 (Layout::output_section_name): Add relobj parameter. Change all
5271 callers. Handle .ctors. and .dtors. in code rather than table.
5272 Handle .ctors and .dtors if ctors_in_init_array.
5273 (Layout::match_file_name): New function, moved from output.cc.
5274 * layout.h (class Layout): Update declarations.
5275 * output.cc: Include "layout.h".
5276 (Input_section_sort_entry::get_priority): New function.
5277 (Input_section_sort_entry::match_file_name): Just call
5278 Layout::match_file_name.
5279 (Output_section::Input_section_sort_init_fini_compare::operator()):
5280 Handle .ctors and .dtors. Sort by explicit priority rather than
5281 by name.
5282 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5283 * testsuite/initpri2.c: New test.
5284 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5285 (check_PROGRAMS): Add initpri2.
5286 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5287 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5288 * configure, testsuite/Makefile.in: Rebuild.
5289
e1f74f98
ILT
52902011-06-19 Ian Lance Taylor <iant@google.com>
5291
5292 PR gold/12880
5293 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5294 .interp section to a PT_INTERP segment even if we have seen a
5295 --dynamic-linker option. Don't do it if we have seen a PHDRS
5296 clause in a linker script.
5297 (Layout::finalize): Don't create a .interp section if we've
5298 already create a PT_INTERP segment.
5299 (Layout::create_interp): Always call choose_output_section (revert
5300 patch of 2011-06-17). Don't create PT_INTERP segment.
5301 * script-sections.cc
5302 (Script_sections::create_note_and_tls_segments): Add a .interp
5303 section to a PT_INTERP segment even if we have seen a
5304 --dynamic-linker option.
5305
766f91bb
ILT
53062011-06-18 Ian Lance Taylor <iant@google.com>
5307
5308 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5309 merely because a non-PT_LOAD segment has a dynamic reloc.
5310
0d212c3a
ILT
53112011-06-18 Ian Lance Taylor <iant@google.com>
5312
5313 * layout.cc (Layout::finish_dynamic_section): Don't create
5314 DT_FLAGS entry if not needed.
5315
911a5072
ILT
53162011-06-18 Ian Lance Taylor <iant@google.com>
5317
5318 PR gold/12745
5319 * layout.cc (Layout::layout_eh_frame): Correct handling of
5320 writable .eh_frame section.
5321
534b4e5f
ILT
53222011-06-17 Ian Lance Taylor <iant@google.com>
5323
5324 PR gold/12893
5325 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5326 symbol is redefined with the exact same object and value.
5327
10b4f102
ILT
53282011-06-17 Ian Lance Taylor <iant@google.com>
5329
5330 PR gold/12880
5331 * layout.h (class Layout): Add interp_segment_ field.
5332 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5333 (Layout::attach_allocated_section_to_segment): If making shared
5334 library, put .interp section in PT_INTERP segment.
5335 (Layout::finalize): Also call create_interp if -dynamic-linker
5336 option was used.
5337 (Layout::create_interp): Assert that there is no PT_INTERP
5338 segment. If not using a SECTIONS clause, use make_output_section.
5339 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5340 * script-sections.cc
5341 (Script_sections::create_note_and_tls_segments): If making shared
5342 library, put .interp section in PT_INTERP segment.
5343
a29b0dad
ILT
53442011-06-17 Ian Lance Taylor <iant@google.com>
5345
e588ea8d
ILT
5346 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5347 when making a shared library.
5348
53492011-06-17 Ian Lance Taylor <iant@google.com>
5350
5351 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5352 parameter. Change all callers. Don't issue warning about PC32
5353 against locally defined symbol.
a29b0dad 5354
9d3b0698
ILT
53552011-06-16 Ian Lance Taylor <iant@google.com>
5356
5357 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5358 occurs in same object.
5359
85b0f90c
AM
53602011-06-14 Alan Modra <amodra@gmail.com>
5361
5362 * po/POTFILES.in: Regenerate.
5363
a94907d9
ILT
53642011-06-09 Ian Lance Taylor <iant@google.com>
5365
5366 * script-sections.cc
5367 (Orphan_output_section::set_section_addresses): For a relocatable
5368 link set address to 0.
5369
4fb3a1c3
CC
53702011-06-09 Cary Coutant <ccoutant@google.com>
5371
5372 PR gold/12804
5373 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5374 used with --compress-debug-sections.
5375 * gold/object.cc (Sized_relobj_file::do_layout): Report
5376 uncompressed size of compressed input sections.
5377
61220854
CC
53782011-06-08 Cary Coutant <ccoutant@google.com>
5379
5380 PR gold/12804
5381 * testsuite/two_file_test_2_v1.cc: Change initialization of
5382 v2 to keep it in .data.
5383
e6455dfb
CC
53842011-06-07 Cary Coutant <ccoutant@google.com>
5385
5386 * common.cc (Symbol_table::do_allocate_commons_list): Call
5387 gold_fallback.
5388 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5389 (Errors::fallback): New function.
5390 (gold_fallback): New function.
5391 * errors.h (Errors::fallback): New function.
5392 * gold.cc (gold_exit): Change status parameter to enum; adjust
5393 all callers.
5394 (queue_initial_tasks): Call gold_fallback.
5395 * gold.h: Include cstdlib.
5396 (Exit_status): New enum type.
5397 (gold_exit): Change status parameter to enum.
5398 (gold_fallback): New function.
5399 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5400 (Layout::create_symtab_sections): Likewise.
5401 (Layout::create_shdrs): Likewise.
5402 * main.cc (main): Adjust call to gold_exit.
5403 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5404 (Output_data_got::add_got_entry_pair): Likewise.
5405 (Output_section::add_input_section): Likewise.
5406 (Output_section::add_output_section_data): Likewise.
5407 (Output_segment::set_section_list_addresses): Likewise.
5408 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5409
fb0e076f
CC
54102011-06-07 Cary Coutant <ccoutant@google.com>
5411
5412 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5413 for incremental links.
5414 * output.cc (Output_segment::set_section_list_addresses): Remove
5415 FIXME and test for TLS or BSS.
5416
a5ee4d5d
CC
54172011-06-07 Cary Coutant <ccoutant@google.com>
5418
5419 * testsuite/Makefile.am: Add incremental_copy_test,
5420 incremental_common_test_1.
5421 * testsuite/Makefile.in: Regenerate.
5422 * testsuite/common_test_1_v1.c: New source file.
5423 * testsuite/common_test_1_v2.c: New source file.
5424 * testsuite/copy_test_v1.cc: New source file.
5425
5146f448
CC
54262011-06-07 Cary Coutant <ccoutant@google.com>
5427
5428 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5429 update, allocate common from bss section's free list.
5430 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5431 linker-defined symbols.
5432 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5433 Skip GOT and PLT entries that are no longer referenced.
5434 (Output_section_incremental_inputs::write_info_blocks): Mark
5435 linker-defined symbols.
5436 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5437 * output.cc (Output_section::allocate): New function.
5438 * output.h (Output_section::allocate): New function.
5439 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5440 linker-defined symbols.
5441 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5442 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5443 (Symbol::init_base_output_data): Likewise.
5444 (Symbol::init_base_output_segment): Likewise.
5445 (Symbol::init_base_constant): Likewise.
5446 (Sized_symbol::init_output_data): Likewise.
5447 (Sized_symbol::init_output_segment): Likewise.
5448 (Sized_symbol::init_constant): Likewise.
5449 (Symbol_table::do_define_in_output_data): Likewise.
5450 (Symbol_table::do_define_in_output_segment): Likewise.
5451 (Symbol_table::do_define_as_constant): Likewise.
5452 * symtab.h (Symbol::is_predefined): New function.
5453 (Symbol::init_base_output_data): Add is_predefined parameter.
5454 (Symbol::init_base_output_segment): Likewise.
5455 (Symbol::init_base_constant): Likewise.
5456 (Symbol::is_predefined_): New data member.
5457 (Sized_symbol::init_output_data): Add is_predefined parameter.
5458 (Sized_symbol::init_output_segment): Likewise.
5459 (Sized_symbol::init_constant): Likewise.
5460 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5461
26d3c67d
CC
54622011-06-07 Cary Coutant <ccoutant@google.com>
5463
5464 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5465 instead of emit_copy_reloc.
5466 (Copy_relocs::emit_copy_reloc): Refactor.
5467 (Copy_relocs::make_copy_reloc): New function.
5468 (Copy_relocs::add_copy_reloc): Remove.
5469 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5470 section.
5471 (Copy_relocs::make_copy_reloc): New function.
5472 (Copy_relocs::add_copy_reloc): Remove.
5473 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5474 unchanged input files.
5475 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5476 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5477 Reserve BSS space for COPY relocations.
5478 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5479 (Output_section_incremental_inputs::write_info_blocks): Record
5480 whether a symbol is copied from a shared object.
5481 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5482 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5483 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5484 (Incremental_input_entry_reader::get_output_symbol_index): Add
5485 is_copy parameter.
5486 (Incremental_binary::emit_copy_relocs): New function.
5487 (Incremental_binary::do_emit_copy_relocs): New function.
5488 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5489 new data member.
5490 (Sized_incremental_binary::add_copy_reloc): New function.
5491 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5492 (Sized_incremental_binary::Copy_reloc): New struct.
5493 (Sized_incremental_binary::Copy_relocs): New typedef.
5494 (Sized_incremental_binary::copy_relocs_): New data member.
5495 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5496 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5497 * target.h (Sized_target::emit_copy_reloc): New function.
5498 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5499
7cdb37d9
CC
55002011-06-02 Cary Coutant <ccoutant@google.com>
5501
5502 PR gold/12163
5503 * gold/archive.cc (Archive::Archive): Initialize new data member.
5504 (Archive::include_all_members): Return if archive has already been
5505 included.
5506 * gold/archive.h (Archive::include_all_members_): New data member.
5507
cc643b88
NC
55082011-06-02 Nick Clifton <nickc@redhat.com>
5509
5510 * dynobj.h: Fix spelling mistake in comment.
5511 * output.cc: Likewise.
5512
f62a3ca7 55132011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5514 Asier Llano
f62a3ca7
DK
5515
5516 PR gold/12826
cc643b88 5517 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5518 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5519 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5520 redundant arm_exidx_test.so.
5521 * testsuite/Makefile.in: Regenerate.
5522 (check_SCRIPTS): Add pr12826.sh
5523 (check_DATA): Add pr12826.stdout
5524 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5525 * testsuite/pr12826.sh: New file.
5526 * testsuite/pr12826_1.s: Ditto.
5527 * testsuite/pr12826_1.s: Ditto.
5528
8dbe1edc
ILT
55292011-05-30 Ian Lance Taylor <iant@google.com>
5530
5531 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5532 sections.
5533
c49875be
ILT
55342011-05-29 Ian Lance Taylor <iant@google.com>
5535
5536 PR gold/12804
5537 * testsuite/Makefile.am: Use different file name for two_file_test
5538 temporary file for each incremental test.
5539 * testsuite/Makefile.in: Rebuild.
5540
69d53f7a
ILT
55412011-05-29 Ian Lance Taylor <iant@google.com>
5542
5543 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5544 binary input file is empty.
5545
41d0ab5f
ILT
55462011-05-27 Ian Lance Taylor <iant@google.com>
5547
5548 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5549 (ver_test_9.so): Likewise.
5550 * testsuite/Makefile.in: Rebuild.
5551
89d8a36b
CC
55522011-05-26 Cary Coutant <ccoutant@google.com>
5553
5554 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5555 * incremental.cc (Incremental_inputs::report_input_section): Fix
5556 comment, indentation.
5557 (Incremental_inputs::report_comdat_group): New function.
5558 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5559 of data for incremental input file entry.
5560 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5561 group count, COMDAT group signatures.
5562 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5563 an unchanged input file.
5564 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5565 Initialize new data member.
5566 (Incremental_object_entry::add_comdat_group): New function.
5567 (Incremental_object_entry::get_comdat_group_count): New function.
5568 (Incremental_object_entry::get_comdat_signature_key): New function.
5569 (Incremental_object_entry::groups_): New data member.
5570 (Incremental_inputs::report_comdat_group): New function.
5571 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5572 data for incremental input file entry.
5573 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5574 (Incremental_input_entry_reader::get_input_section): Adjust size of
5575 data for incremental input file entry.
5576 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5577 (Incremental_input_entry_reader::get_comdat_group_signature): New
5578 function.
5579 * object.cc (Sized_relobj::include_section_group): Report kept
5580 COMDAT groups for incremental links.
5581
1706a06f
ILT
55822011-05-24 David Meyer <pdox@google.com>
5583
5584 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5585 with name parameter. Add found_name parameter.
5586 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5587 * dirsearch.h (class Dirsearch): Update declaration.
5588
a10ae760
ILT
55892011-05-24 Ian Lance Taylor <iant@google.com>
5590
5591 * archive.cc (Library_base::should_include_member): Pull in object
5592 from archive if it defines the entry symbol.
5593 * parameters.cc (Parameters::entry): New function.
5594 * parameters.h (class Parameters): Declare entry.
5595 * output.h (class Output_file_header): Remove entry_ field.
5596 * output.cc (Output_file_header::Output_file_header): Remove entry
5597 parameter. Change all callers.
5598 (Output_file_header::entry): Use parameters->entry.
5599 * gold.cc (queue_middle_tasks): Likewise.
5600 * plugin.cc (Plugin_hook::run): Likewise.
5601
aa92d6ed
CC
56022011-05-24 Cary Coutant <ccoutant@google.com>
5603
5604 * gold.cc (queue_initial_tasks): Pass incremental base filename
5605 to Output_file::open_base_file; don't print error message.
5606 * incremental-dump.cc (main): Adjust call to
5607 Output_file::open_for_modification.
5608 * incremental-dump.cc (main): Likewise.
5609 * incremental.cc (Incremental_inputs::report_command_line):
5610 Ignore --incremental-base option when comparing command lines.
5611 Ignore parameter when given as separate argument.
5612 * options.h (class General_options): Add --incremental-base.
5613 * output.cc (Output_file::Output_file):
5614 (Output_file::open_base_file): Add base_name and writable parameters;
5615 read base file into new file; print error message here.
5616 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5617 callers.
5618 * output.h (Output_file::open_for_modification): Rename to...
5619 (Output_file::open_base_file): ...this; add base_name and
5620 writable parameters; adjust all callers.
5621 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5622 callers.
5623 * testsuite/Makefile.am (incremental_test_4): Test
5624 --incremental-base.
5625 * testsuite/Makefile.in: Regenerate.
5626
2eedd706
CC
56272011-05-24 Cary Coutant <ccoutant@google.com>
5628
5629 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5630 incremental_test_4.
5631 * testsuite/Makefile.in: Regenerate.
5632 * testsuite/two_file_test_1_v1.cc: New test source file.
5633 * testsuite/two_file_test_1b_v1.cc: New test source file.
5634 * testsuite/two_file_test_2_v1.cc: New test source file.
5635
0f1c85a6
CC
56362011-05-24 Cary Coutant <ccoutant@google.com>
5637
5638 * dynobj.h (Dynobj::do_dynobj): New function.
5639 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5640 flag and soname for shared objects.
5641 * incremental.cc (Incremental_inputs::report_object): Make
5642 either Incremental_object_entry or Incremental_dynobj_entry; add
5643 soname to string table.
5644 (Incremental_inputs::report_input_section): Add assertion.
5645 (Output_section_incremental_inputs::set_final_data_size): Adjust
5646 type of input file entry for shared libraries; adjust size of
5647 shared library info entry.
5648 (Output_section_incremental_inputs::write_input_files): Write
5649 as_needed flag for shared libraries.
5650 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5651 of input file entry for shared libraries; write soname.
5652 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5653 soname from incremental info.
5654 * incremental.h (enum Incremental_input_flags): Add
5655 INCREMENTAL_INPUT_AS_NEEDED.
5656 (Incremental_input_entry::Incremental_input_entry): Initialize new
5657 data member.
5658 (Incremental_input_entry::set_as_needed): New function.
5659 (Incremental_input_entry::as_needed): New function.
5660 (Incremental_input_entry::do_dynobj_entry): New function.
5661 (Incremental_input_entry::as_needed_): New data member.
5662 (Incremental_object_entry::Incremental_object_entry): Don't check
5663 for shared library.
5664 (Incremental_object_entry::do_type): Likewise.
5665 (class Incremental_dynobj_entry): New class.
5666 (Incremental_input_entry_reader::as_needed): New function.
5667 (Incremental_input_entry_reader::get_soname): New function.
5668 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5669 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5670 size of shared library info entry.
58797674 5671 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5672 incremental link when adding DT_NEEDED entries.
5673 * object.h (Object::Object): Initialize new data member.
5674 (Object::dynobj): New function.
5675 (Object::set_as_needed): New function.
5676 (Object::as_needed): New function.
5677 (Object::do_dynobj): New function.
5678 (Object::as_needed_): New data member.
5679
6fa2a40b
CC
56802011-05-24 Cary Coutant <ccoutant@google.com>
5681
5682 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5683 info; adjust display of GOT entries.
5684 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5685 vector of input objects; remove file_status_.
5686 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5687 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5688 got_plt reader; call target hooks to reserve GOT entries.
5689 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5690 of input file info header and GOT info entry.
5691 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5692 relocation info.
5693 (Got_plt_view_info::got_descriptor): Remove.
5694 (Got_plt_view_info::sym_index): New data member.
5695 (Got_plt_view_info::input_index): New data member.
5696 (Local_got_offset_visitor::visit): Write input file index.
5697 (Global_got_offset_visitor::visit): Write 0 for input file index.
5698 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5699 with sym_index and input_index.
5700 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5701 incremental info GOT entry; replace got_descriptor with input_index.
5702 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5703 map from input file index to object.
5704 (Sized_relobj_incr::do_layout): Replace direct data member reference
5705 with accessor function.
5706 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5707 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5708 Adjust size of input file info header.
5709 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5710 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5711 (Incremental_input_entry_reader::get_input_section): Adjust size of
5712 input file info header.
5713 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5714 of incremental info GOT entry.
5715 (Incremental_got_plt_reader::get_got_desc): Remove.
5716 (Incremental_got_plt_reader::get_got_symndx): New function.
5717 (Incremental_got_plt_reader::get_got_input_index): New function.
5718 (Sized_incremental_binary::Sized_incremental_binary): Remove
5719 file_status_; add input_objects_.
5720 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5721 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5722 (Sized_incremental_binary::file_is_unchanged): Remove.
5723 (Sized_incremental_binary::set_input_object): New function.
5724 (Sized_incremental_binary::input_object): New function.
5725 (Sized_incremental_binary::file_status_): Remove.
5726 (Sized_incremental_binary::input_objects_): New data member.
5727 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5728 references.
5729 (Sized_relobj_incr::invalid_address): Move to base class.
5730 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5731 class.
5732 (Sized_relobj_incr::do_output_section_offset): Likewise.
5733 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5734 (Sized_relobj_incr::section_offsets_): Likewise.
5735 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5736 function.
5737 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5738 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5739 with accessor function.
5740 (Sized_relobj_file::do_layout): Likewise.
5741 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5742 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5743 (Sized_relobj_file::compute_final_local_value): Replace refs to
5744 section_offsets_ with accessor function.
5745 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5746 * object.h (Relobj::Relobj): Initialize new data members.
5747 (Relobj::add_dyn_reloc): New function.
5748 (Relobj::first_dyn_reloc): New function.
5749 (Relobj::dyn_reloc_count): New function.
5750 (Relobj::first_dyn_reloc_): New data member.
5751 (Relobj::dyn_reloc_count_): New data member.
5752 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5753 references.
5754 (Sized_relobj::Address): New typedef.
5755 (Sized_relobj::invalid_address): Move here from child class.
5756 (Sized_relobj::Sized_relobj): Initialize new data members.
5757 (Sized_relobj::sized_relobj): New function.
5758 (Sized_relobj::is_output_section_offset_invalid): Move here from
5759 child class.
5760 (Sized_relobj::get_output_section_offset): Likewise.
5761 (Sized_relobj::local_has_got_offset): Likewise.
5762 (Sized_relobj::local_got_offset): Likewise.
5763 (Sized_relobj::set_local_got_offset): Likewise.
5764 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5765 (Sized_relobj::clear_got_offsets): New function.
5766 (Sized_relobj::section_offsets): Move here from child class.
5767 (Sized_relobj::do_output_section_offset): Likewise.
5768 (Sized_relobj::do_set_section_offset): Likewise.
5769 (Sized_relobj::Local_got_offsets): Likewise.
5770 (Sized_relobj::local_got_offsets_): Likewise.
5771 (Sized_relobj::section_offsets_): Likewise.
5772 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5773 references.
5774 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5775 class.
5776 (Sized_relobj_file::sized_relobj): New function
5777 (Sized_relobj_file::local_has_got_offset): Move to base class.
5778 (Sized_relobj_file::local_got_offset): Likewise.
5779 (Sized_relobj_file::set_local_got_offset): Likewise.
5780 (Sized_relobj_file::get_output_section_offset): Likewise.
5781 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5782 (Sized_relobj_file::do_output_section_offset): Likewise.
5783 (Sized_relobj_file::do_set_section_offset): Likewise.
5784 (Sized_relobj_file::Local_got_offsets): Likewise.
5785 (Sized_relobj_file::local_got_offsets_): Likewise.
5786 (Sized_relobj_file::section_offsets_): Likewise.
5787 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5788 (all constructors).
5789 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5790 (Output_reloc::get_symbol_index): Likewise.
5791 (Output_reloc::local_section_offset): Likewise.
5792 (Output_reloc::get_address): Likewise.
5793 (Output_reloc::symbol_value): Likewise.
5794 (Output_data_got::reserve_slot): Move to class definition.
5795 (Output_data_got::reserve_local): New function.
5796 (Output_data_got::reserve_slot_for_global): Remove.
5797 (Output_data_got::reserve_global): New function.
5798 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5799 (all constructors, two instantiations).
5800 (Output_reloc::get_relobj): New function (two instantiations).
5801 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5802 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5803 (Output_data_reloc::add_global): Adjust type of relobj.
5804 (Output_data_reloc::add_global_relative): Likewise.
5805 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5806 (Output_data_reloc::add_local): Likewise.
5807 (Output_data_reloc::add_local_relative): Likewise.
5808 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5809 (Output_data_reloc::add_local_section): Likewise.
5810 (Output_data_reloc::add_output_section): Likewise.
5811 (Output_data_reloc::add_absolute): Likewise.
5812 (Output_data_reloc::add_target_specific): Likewise.
5813 (Output_data_got::reserve_slot): Move definition here.
5814 (Output_data_got::reserve_local): New function.
5815 (Output_data_got::reserve_global): New function.
5816 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5817 section_offsets_ with accessor function.
5818 (Sized_relobj_file::write_sections): Likewise.
5819 (Sized_relobj_file::do_relocate_sections): Likewise.
5820 * target.h (Sized_target::reserve_local_got_entry): New function.
5821 (Sized_target::reserve_global_got_entry): New function.
5822 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5823 (Target_x86_64::reserve_global_got_entry): New function.
5824 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5825
4829d394
CC
58262011-05-23 Cary Coutant <ccoutant@google.com>
5827
5828 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5829 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5830 bit when checking got_type.
5831 * incremental.cc (Sized_incremental_binary::setup_readers):
5832 Store symbol table and string table locations; initialize bit vector
5833 of file status flags.
5834 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5835 unchanged files.
5836 (Sized_incremental_binary::do_process_got_plt): New function.
5837 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5838 (Output_section_incremental_inputs::set_final_data_size): Record
5839 file index for each input file.
5840 (Output_section_incremental_inputs::write_got_plt): Store file index
5841 instead of input entry offset for each GOT entry.
5842 * incremental.h
5843 (Incremental_input_entry::Incremental_input_entry): Initialize new
5844 data member.
5845 (Incremental_input_entry::set_offset): Store file index.
5846 (Incremental_input_entry::get_file_index): New function.
5847 (Incremental_input_entry::file_index_): New data member.
5848 (Incremental_binary::process_got_plt): New function.
5849 (Incremental_binary::do_process_got_plt): New function.
5850 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5851 data members.
5852 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5853 (Sized_incremental_binary::set_file_is_unchanged): New function.
5854 (Sized_incremental_binary::file_is_unchanged): New function.
5855 (Sized_incremental_binary::do_process_got_plt): New function.
5856 (Sized_incremental_binary::file_status_): New data member.
5857 (Sized_incremental_binary::main_symtab_loc_): New data member.
5858 (Sized_incremental_binary::main_strtab_loc_): New data member.
5859 * output.cc (Output_data_got::Got_entry::write): Add case
5860 RESERVED_CODE.
5861 (Output_data_got::add_global): Call add_got_entry.
5862 (Output_data_got::add_global_plt): Likewise.
5863 (Output_data_got::add_global_with_rel): Likewise.
5864 (Output_data_got::add_global_with_rela): Likewise.
5865 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5866 (Output_data_got::add_global_pair_with_rela): Likewise.
5867 (Output_data_got::add_local): Call add_got_entry.
5868 (Output_data_got::add_local_plt): Likewise.
5869 (Output_data_got::add_local_with_rel): Likewise.
5870 (Output_data_got::add_local_with_rela): Likewise.
5871 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5872 (Output_data_got::add_local_pair_with_rela): Likewise.
5873 (Output_data_got::reserve_slot): New function.
5874 (Output_data_got::reserve_slot_for_global): New function.
5875 (Output_data_got::add_got_entry): New function.
5876 (Output_data_got::add_got_entry_pair): New function.
5877 (Output_section::add_output_section_data): Edit FIXME.
5878 * output.h
5879 (Output_section_data_build::Output_section_data_build): New
5880 constructor with size parameter.
5881 (Output_data_space::Output_data_space): Likewise.
5882 (Output_data_got::Output_data_got): Initialize new data member; new
5883 constructor with size parameter.
5884 (Output_data_got::add_constant): Call add_got_entry.
5885 (Output_data_got::reserve_slot): New function.
5886 (Output_data_got::reserve_slot_for_global): New function.
5887 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5888 (Output_data_got::add_got_entry): New function.
5889 (Output_data_got::add_got_entry_pair): New function.
5890 (Output_data_got::free_list_): New data member.
5891 * target.h (Sized_target::init_got_plt_for_update): New function.
5892 (Sized_target::register_global_plt_entry): New function.
5893 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5894 Initialize new data member; call init; add constructor with PLT count.
5895 (Output_data_plt_x86_64::init): New function.
5896 (Output_data_plt_x86_64::add_relocation): New function.
5897 (Output_data_plt_x86_64::reserve_slot): New function.
5898 (Output_data_plt_x86_64::free_list_): New data member.
5899 (Target_x86_64::init_got_plt_for_update): New function.
5900 (Target_x86_64::register_global_plt_entry): New function.
5901 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5902 incremental updates.
5903 (Output_data_plt_x86_64::add_relocation): New function.
5904 * testsuite/object_unittest.cc (Object_test): Set default options.
5905
ec69d6da
ILT
59062011-05-16 Ian Lance Taylor <iant@google.com>
5907
5908 * options.h (class General_options): Make -i a synonym for -r.
5909
732e31de
ILT
59102011-05-16 Ian Lance Taylor <iant@google.com>
5911
5912 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5913
403676b5
CC
59142011-05-10 Cary Coutant <ccoutant@google.com>
5915
5916 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5917 strip_all (-s).
5918
5b7b7d6e
ILT
59192011-05-06 Ian Lance Taylor <iant@google.com>
5920
5921 * layout.cc (Layout::layout): If the output section flags change,
5922 update the ordering.
5923
f0f9babf
CC
59242011-04-25 Cary Coutant <ccoutant@google.com>
5925
5926 * incremental-dump.cc (dump_incremental_inputs): Print local
5927 symbol info for each input file.
5928 * incremental.cc
5929 (Output_section_incremental_inputs::set_final_data_size): Add local
5930 symbol info to input file entries in incremental info.
5931 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5932 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5933 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5934 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5935 implementation.
5936 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5937 (Sized_incr_relobj::do_relocate): Write the local symbols.
5938 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5939 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5940 Adjust size of input file header.
5941 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5942 (Incremental_inputs_reader::get_local_symbol_count): New function.
5943 (Incremental_inputs_reader::get_input_section): Adjust size of input
5944 file header.
5945 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5946 (Sized_incr_relobj::This): New typedef.
5947 (Sized_incr_relobj::sym_size): New const data member.
5948 (Sized_incr_relobj::Local_symbol): New struct.
5949 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5950 (Sized_incr_relobj::do_local_symbol_offset): New function.
5951 (Sized_incr_relobj::local_symbol_count_): New data member.
5952 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5953 (Sized_incr_relobj::local_symbol_index_): New data member.
5954 (Sized_incr_relobj::local_symbol_offset_): New data member.
5955 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5956 (Sized_incr_relobj::local_symbols_): New data member.
5957 * object.h (Relobj::output_local_symbol_count): New function.
5958 (Relobj::local_symbol_offset): New function.
5959 (Relobj::do_output_local_symbol_count): New function.
5960 (Relobj::do_local_symbol_offset): New function.
5961 (Sized_relobj::do_output_local_symbol_count): New function.
5962 (Sized_relobj::do_local_symbol_offset): New function.
5963
d0a9ace3
ILT
59642011-04-22 Vladimir Simonov <sv@sw.ru>
5965
5966 * descriptors.cc (set_close_on_exec): New function.
5967 (Descriptors::open): Use set_close_on_exec.
5968 * output.cc (S_ISLNK): Define if not defined.
5969
94a3fc8b
CC
59702011-04-22 Cary Coutant <ccoutant@google.com>
5971
5972 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5973 global symbol map.
5974 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5975 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5976 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5977 relocations.
5978 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5979 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5980 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5981 * incremental.h
5982 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5983 function.
5984 (Incremental_binary::apply_incremental_relocs): New function.
5985 (Incremental_binary::do_apply_incremental_relocs): New function.
5986 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5987 data member.
5988 (Sized_incremental_binary::add_global_symbol): New function.
5989 (Sized_incremental_binary::global_symbol): New function.
5990 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5991 (Sized_incremental_binary::symbol_map_): New data member.
5992 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5993 * target.h (Sized_target::apply_relocation): New function.
5994 * target-reloc.h (apply_relocation): New function.
5995 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5996
c87e4302
DK
59972011-04-22 Doug Kwan <dougkwan@google.com>
5998
5999 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6000 flag of a SHT_ARM_EXIDX section.
2e702c99 6001 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6002 * testsuite/Makefile.in: Regenerate.
6003 * testsuite/arm_exidx_test.s: New file.
6004 * testsuite/arm_exidx_test.sh: Same.
6005
e7782cf6
CC
60062011-04-20 Cary Coutant <ccoutant@google.com>
6007
6008 PR gold/12689
6009 * archive.h (Incremental_archive_entry::Archive_member):
6010 Initialize arg_serial_ (second constructor).
6011
308ecdc7
ILT
60122011-04-17 Ian Lance Taylor <iant@google.com>
6013
6014 * object.cc (Relocate_info::location): Simplify location string.
6015 * errors.cc (Errors::error_at_location): Don't print program
6016 name.
6017 (Errors::warning_at_location): Likewise.
6018 (Errors::undefined_symbol): Likewise.
6019 * testsuite/debug_msg.sh: Update accordingly.
6020
bec5b579
CC
60212011-04-14 Cary Coutant <ccoutant@google.com>
6022
6023 * gold/layout.cc (Layout::symtab_section_offset): New function.
6024 * gold/layout.h (Layout::symtab_section_offset): New function.
6025 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6026
88597d34
ILT
60272011-04-12 Ian Lance Taylor <iant@google.com>
6028
6029 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6030 with MREMAP_MAYMOVE.
6031 * output.h (class Output_file): Add map_is_allocated_ field.
6032 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6033 not available, provide stubs. If mremap is not available, #define
6034 it to gold_mremap.
6035 (MREMAP_MAYMOVE): Define if not defined.
6036 (Output_file::Output_file): Initialize map_is_allocated_.
6037 (Output_file::resize): Check map_is_allocated_.
6038 (Output_file::map_anonymous): If mmap fails, use malloc.
6039 (Output_file::unmap): Don't do anything for an anonymous map.
6040 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6041 is not available, provide stubs.
6042 (File_read::View::~View): Use free rather than delete[].
6043 (File_read::make_view): Use malloc rather than new[]. If mmap
6044 fails, use malloc.
6045 (File_read::find_or_make_view): Use malloc rather than new[].
6046 * gold.h: Remove HAVE_REMAP code.
6047 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6048 exists. Rename mremap to gold_mremap. If mmap is not available
6049 don't do anything.
6050 * configure, config.in: Rebuild.
6051
11e361bc
ILT
60522011-04-11 Ian Lance Taylor <iant@google.com>
6053
6054 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6055 initialize local variable v.
6056
cdc29364
CC
60572011-04-11 Cary Coutant <ccoutant@google.com>
6058
6059 * archive.cc (Archive::include_member): Adjust call to
6060 report_object.
6061 (Add_archive_symbols::run): Track argument serial numbers.
6062 (Lib_group::include_member): Likewise.
6063 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6064 * archive.h (Incremental_archive_entry::Archive_member):
6065 Initialize arg_serial_.
6066 (Archive_member::arg_serial_): New data member.
6067 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6068 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6069 incremental link.
6070 (Sized_dynobj::do_for_all_local_got_entries): New function.
6071 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6072 function.
6073 * fileread.cc (get_mtime): New function.
6074 * fileread.h (get_mtime): New function.
6075 * gold.cc (queue_initial_tasks): Check for incremental update.
6076 (process_incremental_input): New function.
6077 (queue_middle_tasks): Don't force valid target for incremental
6078 update.
6079 * incremental-dump.cc (find_input_containing_global): Adjust
6080 size of symbol info entry.
6081 (dump_incremental_inputs): Dump argument serial number and
6082 in_system_directory flag; bias shndx by 1; print symbol names
6083 when dumping per-file symbol lists; use new symbol info readers.
6084 * incremental.cc
6085 (Output_section_incremental_inputs:update_data_size): New function.
6086 (Sized_incremental_binary::setup_readers): Setup input readers
6087 for each input file; build maps for files added from libraries
6088 and scripts.
6089 (Sized_incremental_binary::check_input_args): New function.
6090 (Sized_incremental_binary::do_check_inputs): Build map of argument
6091 serial numbers to input arguments.
6092 (Sized_incremental_binary::do_file_has_changed): Rename
6093 do_file_is_unchanged to this; compare file modification times.
6094 (Sized_incremental_binary::do_init_layout): New function.
6095 (Sized_incremental_binary::do_reserve_layout): New function.
6096 (Sized_incremental_binary::do_get_input_reader): Remove.
6097 (Sized_incremental_binary::get_symtab_view): New function.
6098 (Incremental_checker::can_incrementally_link_output_file): Remove.
6099 (Incremental_inputs::report_command_line): Exclude --debug options.
6100 (Incremental_inputs::report_archive_begin): Add parameter; track
6101 argument serial numbers; don't put input file entry for archive
6102 before archive members.
6103 (Incremental_inputs::report_archive_end): Put input file entry
6104 for archive after archive members.
6105 (Incremental_inputs::report_object): Add parameter; track argument
6106 serial numbers and in_system_directory flag.
6107 (Incremental_inputs::report_script): Add parameter; track argument
6108 serial numbers.
6109 (Output_section_incremental_inputs::set_final_data_size): Adjust
6110 size of symbol info entry; check for forwarding symbols.
6111 (Output_section_incremental_inputs::write_input_files): Write
6112 in_system_directory flag and argument serial number.
6113 (Output_section_incremental_inputs::write_info_blocks): Map section
6114 indices between incremental info and original input file; store
6115 input section index for each symbol.
6116 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6117 change operator() to visit().
6118 (class Global_got_offset_visitor): Likewise.
6119 (class Global_symbol_visitor_got_plt):
6120 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6121 classes.
6122 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6123 (Sized_incr_relobj::do_read_symbols): New function.
6124 (Sized_incr_relobj::do_layout): New function.
6125 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6126 (Sized_incr_relobj::do_add_symbols): New function.
6127 (Sized_incr_relobj::do_should_include_member): New function.
6128 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6129 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6130 (Sized_incr_relobj::do_section_size): New function.
6131 (Sized_incr_relobj::do_section_name): New function.
6132 (Sized_incr_relobj::do_section_contents): New function.
6133 (Sized_incr_relobj::do_section_flags): New function.
6134 (Sized_incr_relobj::do_section_entsize): New function.
6135 (Sized_incr_relobj::do_section_address): New function.
6136 (Sized_incr_relobj::do_section_type): New function.
6137 (Sized_incr_relobj::do_section_link): New function.
6138 (Sized_incr_relobj::do_section_info): New function.
6139 (Sized_incr_relobj::do_section_addralign): New function.
6140 (Sized_incr_relobj::do_initialize_xindex): New function.
6141 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6142 (Sized_incr_relobj::do_read_relocs): New function.
6143 (Sized_incr_relobj::do_gc_process_relocs): New function.
6144 (Sized_incr_relobj::do_scan_relocs): New function.
6145 (Sized_incr_relobj::do_count_local_symbols): New function.
6146 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6147 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6148 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6149 (Sized_incr_relobj::do_relocate): New function.
6150 (Sized_incr_relobj::do_set_section_offset): New function.
6151 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6152 (Sized_incr_dynobj::do_read_symbols): New function.
6153 (Sized_incr_dynobj::do_layout): New function.
6154 (Sized_incr_dynobj::do_add_symbols): New function.
6155 (Sized_incr_dynobj::do_should_include_member): New function.
6156 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6157 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6158 (Sized_incr_dynobj::do_section_size): New function.
6159 (Sized_incr_dynobj::do_section_name): New function.
6160 (Sized_incr_dynobj::do_section_contents): New function.
6161 (Sized_incr_dynobj::do_section_flags): New function.
6162 (Sized_incr_dynobj::do_section_entsize): New function.
6163 (Sized_incr_dynobj::do_section_address): New function.
6164 (Sized_incr_dynobj::do_section_type): New function.
6165 (Sized_incr_dynobj::do_section_link): New function.
6166 (Sized_incr_dynobj::do_section_info): New function.
6167 (Sized_incr_dynobj::do_section_addralign): New function.
6168 (Sized_incr_dynobj::do_initialize_xindex): New function.
6169 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6170 (make_sized_incremental_object): New function.
6171 (Incremental_library::copy_unused_symbols): New function.
6172 (Incremental_library::do_for_all_unused_symbols): New function.
6173 * incremental.h (enum Incremental_input_flags): New type.
6174 (class Incremental_checker): Remove.
6175 (Incremental_input_entry::Incremental_input_entry): Add argument
6176 serial number.
6177 (Incremental_input_entry::arg_serial): New function.
6178 (Incremental_input_entry::set_is_in_system_directory): New function.
6179 (Incremental_input_entry::is_in_system_directory): New function.
6180 (Incremental_input_entry::arg_serial_): New data member.
6181 (Incremental_input_entry::is_in_system_directory_): New data member.
6182 (class Script_info): Move here from script.h.
6183 (Script_info::Script_info): Add filename parameter.
6184 (Script_info::filename): New function.
6185 (Script_info::filename_): New data member.
6186 (Incremental_script_entry::Incremental_script_entry): Add argument
6187 serial number.
6188 (Incremental_object_entry::Incremental_object_entry): Likewise.
6189 (Incremental_object_entry::add_input_section): Build list of input
6190 sections with map to original shndx.
6191 (Incremental_object_entry::get_input_section_index): New function.
6192 (Incremental_object_entry::shndx_): New data member.
6193 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6194 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6195 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6196 serial number.
6197 (Incremental_inputs::report_archive_begin): Likewise.
6198 (Incremental_inputs::report_object): Likewise.
6199 (Incremental_inputs::report_script): Likewise.
6200 (class Incremental_global_symbol_reader): New class.
6201 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6202 and store flags and input file type.
6203 (Incremental_input_entry_reader::arg_serial): New function.
6204 (Incremental_input_entry_reader::type): Extract type from flags.
6205 (Incremental_input_entry_reader::is_in_system_directory): New function.
6206 (Incremental_input_entry_reader::get_input_section_count): Call
6207 accessor function for type.
6208 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6209 function for type; adjust size of global symbol entry.
6210 (Incremental_input_entry_reader::get_global_symbol_count): Call
6211 accessor function for type.
6212 (Incremental_input_entry_reader::get_object_count): Likewise.
6213 (Incremental_input_entry_reader::get_object_offset): Likewise.
6214 (Incremental_input_entry_reader::get_member_count): Likewise.
6215 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6216 (Incremental_input_entry_reader::get_member_offset): Likewise.
6217 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6218 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6219 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6220 (Incremental_input_entry_reader::get_global_symbol_reader): New
6221 function.
6222 (Incremental_input_entry_reader::get_output_symbol_index): New
6223 function.
6224 (Incremental_input_entry_reader::type_): Remove.
6225 (Incremental_input_entry_reader::flags_): New data member.
6226 (Incremental_inputs_reader::input_file_offset): New function.
6227 (Incremental_inputs_reader::input_file_index): New function.
6228 (Incremental_inputs_reader::input_file): Call input_file_offset.
6229 (Incremental_inputs_reader::input_file_at_offset): New function.
6230 (Incremental_relocs_reader::get_r_type): Reformat.
6231 (Incremental_relocs_reader::get_r_shndx): Reformat.
6232 (Incremental_relocs_reader::get_r_offset): Reformat.
6233 (Incremental_relocs_reader::data): New function.
6234 (Incremental_binary::Incremental_binary): Initialize new data members.
6235 (Incremental_binary::check_inputs): Add cmdline parameter.
6236 (Incremental_binary::file_is_unchanged): Remove.
6237 (Input_reader::arg_serial): New function.
6238 (Input_reader::get_unused_symbol_count): New function.
6239 (Input_reader::get_unused_symbol): New function.
6240 (Input_reader::do_arg_serial): New function.
6241 (Input_reader::do_get_unused_symbol_count): New function.
6242 (Input_reader::do_get_unused_symbol): New function.
6243 (Incremental_binary::input_file_count): New function.
6244 (Incremental_binary::get_input_reader): Change signature to use
6245 index instead of filename.
6246 (Incremental_binary::file_has_changed): New function.
6247 (Incremental_binary::get_input_argument): New function.
6248 (Incremental_binary::get_library): New function.
6249 (Incremental_binary::get_script_info): New function.
6250 (Incremental_binary::init_layout): New function.
6251 (Incremental_binary::reserve_layout): New function.
6252 (Incremental_binary::output_file): New function.
6253 (Incremental_binary::do_check_inputs): New function.
6254 (Incremental_binary::do_file_is_unchanged): Remove.
6255 (Incremental_binary::do_file_has_changed): New function.
6256 (Incremental_binary::do_init_layout): New function.
6257 (Incremental_binary::do_reserve_layout): New function.
6258 (Incremental_binary::do_input_file_count): New function.
6259 (Incremental_binary::do_get_input_reader): Change signature.
6260 (Incremental_binary::input_args_map_): New data member.
6261 (Incremental_binary::library_map_): New data member.
6262 (Incremental_binary::script_map_): New data member.
6263 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6264 new data members.
6265 (Sized_incremental_binary::output_section): New function.
6266 (Sized_incremental_binary::inputs_reader): Add const.
6267 (Sized_incremental_binary::symtab_reader): Add const.
6268 (Sized_incremental_binary::relocs_reader): Add const.
6269 (Sized_incremental_binary::got_plt_reader): Add const.
6270 (Sized_incremental_binary::get_symtab_view): New function.
6271 (Sized_incremental_binary::Inputs_reader): New typedef.
6272 (Sized_incremental_binary::Input_entry_reader): New typedef.
6273 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6274 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6275 (Sized_incremental_binary::do_file_has_changed): New function.
6276 (Sized_incremental_binary::do_init_layout): New function.
6277 (Sized_incremental_binary::do_reserve_layout): New function.
6278 (Sized_input_reader::Inputs_reader): Remove.
6279 (Sized_input_reader::Input_entry_reader): Remove.
6280 (Sized_input_reader::do_arg_serial): New function.
6281 (Sized_input_reader::do_get_unused_symbol_count): New function.
6282 (Sized_input_reader::do_get_unused_symbol): New function.
6283 (Sized_incremental_binary::do_input_file_count): New function.
6284 (Sized_incremental_binary::do_get_input_reader): Change signature;
6285 use index instead of filename.
6286 (Sized_incremental_binary::section_map_): New data member.
6287 (Sized_incremental_binary::input_entry_readers_): New data member.
6288 (class Sized_incr_relobj): New class.
6289 (class Sized_incr_dynobj): New class.
6290 (make_sized_incremental_object): New function.
6291 (class Incremental_library): New class.
6292 * layout.cc (Free_list::num_lists): New static data member.
6293 (Free_list::num_nodes): New static data member.
6294 (Free_list::num_removes): New static data member.
6295 (Free_list::num_remove_visits): New static data member.
6296 (Free_list::num_allocates): New static data member.
6297 (Free_list::num_allocate_visits): New static data member.
6298 (Free_list::init): New function.
6299 (Free_list::remove): New function.
6300 (Free_list::allocate): New function.
6301 (Free_list::dump): New function.
6302 (Free_list::print_stats): New function.
6303 (Layout_task_runner::run): Resize output file for incremental updates.
6304 (Layout::Layout): Initialize new data members.
6305 (Layout::set_incremental_base): New function.
6306 (Layout::init_fixed_output_section): New function.
6307 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6308 incremental updates.
6309 (Layout::create_gold_note): Do not create gold note section for
6310 incremental updates.
6311 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6312 for incremental updates.
6313 (Layout::set_section_offsets): For incremental updates, allocate space
6314 from free list.
6315 (Layout::create_symtab_sections): Layout with offsets relative to
6316 start of section; for incremental updates, allocate space from free
6317 list.
6318 (Layout::create_shdrs): For incremental updates, allocate space from
6319 free list.
6320 (Layout::finish_dynamic_section): For incremental updates, do not
6321 check --as-needed (fixed in subsequent patch).
6322 * layout.h (class Free_list): New class.
6323 (Layout::set_incremental_base): New function.
6324 (Layout::incremental_base): New function.
6325 (Layout::init_fixed_output_section): New function.
6326 (Layout::allocate): New function.
6327 (Layout::incremental_base_): New data member.
6328 (Layout::free_list_): New data member.
6329 * main.cc (main): Print Free_list statistics.
6330 * object.cc (Relobj::finalize_incremental_relocs): Add
6331 clear_counts parameter; clear counts only when clear_counts is set.
6332 (Sized_relobj::Sized_relobj): Initialize new base class.
6333 (Sized_relobj::do_layout): Don't report special sections.
6334 (Sized_relobj::do_for_all_local_got_entries): New function.
6335 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6336 symtab_off to all symbol table offsets.
6337 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6338 * object.h (class Got_offset_list): Move to top of file.
6339 (Object::Object): Allow case where input_file == NULL.
6340 (Object::~Object): Likewise.
6341 (Object::input_file): Assert that input_file != NULL.
6342 (Object::lock): Allow case where input_file == NULL.
6343 (Object::unlock): Likewise.
6344 (Object::is_locked): Likewise.
6345 (Object::token): Likewise.
6346 (Object::release): Likewise.
6347 (Object::is_incremental): New function.
6348 (Object::get_mtime): New function.
6349 (Object::for_all_local_got_entries): New function.
6350 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6351 (Object::set_is_in_system_directory): New function.
6352 (Object::is_in_system_directory): New function.
6353 (Object::do_is_incremental): New function.
6354 (Object::do_get_mtime): New function.
6355 (Object::do_for_all_local_got_entries): New function.
6356 (Object::is_in_system_directory_): New data member.
6357 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6358 (class Sized_relobj_base): New class.
6359 (class Sized_relobj): Derive from Sized_relobj_base.
6360 (class Sized_relobj::Symbols): Redeclare from base class.
6361 (class Sized_relobj::local_got_offset_list): Remove.
6362 (class Sized_relobj::Output_sections): Redeclare from base class.
6363 (class Sized_relobj::do_for_all_local_got_entries): New function.
6364 (class Sized_relobj::write_local_symbols): Add offset parameter.
6365 (class Sized_relobj::local_symbol_offset_): Update comment.
6366 (class Sized_relobj::local_dynsym_offset_): Update comment.
6367 * options.cc (Input_arguments::add_file): Remove const.
6368 * options.h (Input_file_argument::Input_file_argument):
6369 Initialize arg_serial_ (all constructors).
6370 (Input_file_argument::set_arg_serial): New function.
6371 (Input_file_argument::arg_serial): New function.
6372 (Input_file_argument::arg_serial_): New data member.
6373 (Input_arguments::Input_arguments): Initialize file_count_.
6374 (Input_arguments::add_file): Remove const.
6375 (Input_arguments::number_of_input_files): New function.
6376 (Input_arguments::file_count_): New data member.
6377 (Command_line::number_of_input_files): Call
6378 Input_arguments::number_of_input_files.
6379 * output.cc (Output_segment_headers::Output_segment_headers):
6380 Set current size.
6381 (Output_section::Input_section::current_data_size): New function.
6382 (Output_section::Output_section): Initialize new data members.
6383 (Output_section::add_input_section): Don't do merge sections for
6384 an incremental link; allocate space from free list for an
6385 incremental update.
6386 (Output_section::add_output_section_data): Allocate space from
6387 free list for an incremental update.
6388 (Output_section::update_data_size): New function.
6389 (Output_section::set_fixed_layout): New function.
6390 (Output_section::reserve): New function.
6391 (Output_segment::set_section_addresses): Remove const.
6392 (Output_segment::set_section_list_addresses): Remove const; allocate
6393 space from free list for an incremental update.
6394 (Output_segment::set_offset): Adjust size of RELRO segment for an
6395 incremental update.
6396 * output.h (Output_data::current_data_size): Move here from
6397 child classes.
6398 (Output_data::pre_finalize_data_size): New function.
6399 (Output_data::update_data_size): New function.
6400 (Output_section_headers::update_data_size): new function.
6401 (Output_section_data_build::current_data_size): Move to Output_data.
6402 (Output_data_strtab::update_data_size): New function.
6403 (Output_section::current_data_size): Move to Output_data.
6404 (Output_section::set_fixed_layout): New function.
6405 (Output_section::has_fixed_layout): New function.
6406 (Output_section::reserve): New function.
6407 (Output_section::update_data_size): New function.
6408 (Output_section::has_fixed_layout_): New data member.
6409 (Output_section::free_list_): New data member.
6410 (Output_segment::set_section_addresses): Remove const.
6411 (Output_segment::set_section_list_addresses): Remove const.
6412 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6413 New function.
6414 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6415 New function.
6416 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6417 parameter when calling Add_symbols constructor; store argument
6418 serial number for members of a lib group.
6419 (Add_symbols::locks): Allow case where token == NULL.
6420 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6421 (Read_member::~Read_member): New function.
6422 (Read_member::is_runnable): New function.
6423 (Read_member::locks): New function.
6424 (Read_member::run): New function.
6425 (Check_script::~Check_script): New function.
6426 (Check_script::is_runnable): New function.
6427 (Check_script::locks): New function.
6428 (Check_script::run): New function.
6429 (Check_library::~Check_library): New function.
6430 (Check_library::is_runnable): New function.
6431 (Check_library::locks): New function.
6432 (Check_library::run): New function.
6433 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6434 (Add_symbols::library_): New data member.
6435 (class Read_member): New class.
6436 (class Check_script): New class.
6437 (class Check_library): New class.
6438 * reloc.cc (Read_relocs::is_runnable): Allow case where
6439 token == NULL.
6440 (Read_relocs::locks): Likewise.
6441 (Scan_relocs::locks): Likewise.
6442 (Relocate_task::locks): Likewise.
6443 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6444 to clear counters.
6445 (Sized_relobj::incremental_relocs_scan): Fix comment.
6446 (Sized_relobj::do_relocate): Pass output file offset to
6447 write_local_symbols.
6448 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6449 from class declaration.
6450 * script.cc (read_input_script): Allocate Script_info; pass
6451 argument serial number to report_script.
6452 * script.h (class Script_info): Move to incremental.h.
6453 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6454 * symtab.h (Symbol_table::add_from_incrobj): New function.
6455 (Symbol_table::set_file_offset): New function.
6456
b961d0d7
CC
64572011-04-05 Cary Coutant <ccoutant@google.com>
6458
6459 * incremental-dump.cc (dump_incremental_inputs): Change signature
6460 to take a Sized_incremental_binary; change caller. Use readers
6461 in Sized_incremental_binary.
6462 * incremental.cc
6463 (Sized_incremental_binary::find_incremental_inputs_sections):
6464 Rename do_find_incremental_inputs_sections to this.
6465 (Sized_incremental_binary::setup_readers): New function.
6466 (Sized_incremental_binary::do_check_inputs): Check
6467 has_incremental_info_ flag; move setup code to setup_readers;
6468 use input readers.
6469 (Sized_incremental_binary::do_file_is_unchanged): New function.
6470 (Sized_incremental_binary::do_get_input_reader): New function.
6471 * incremental.h (class Incremental_binary): Move to end of file.
6472 (Incremental_binary::file_is_unchanged): New function.
6473 (Incremental_binary::do_file_is_unchanged): New function.
6474 (Incremental_binary::Input_reader): New class.
6475 (Incremental_binary::get_input_reader): New function.
6476 (class Sized_incremental_binary): Move to end of file.
6477 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6478 input section reader classes.
6479 (Sized_incremental_binary::has_incremental_info): New function.
6480 (Sized_incremental_binary::inputs_reader): New function.
6481 (Sized_incremental_binary::symtab_reader): New function.
6482 (Sized_incremental_binary::relocs_reader): New function.
6483 (Sized_incremental_binary::got_plt_reader): New function.
6484 (Sized_incremental_binary::do_file_is_unchanged): New function.
6485 (Sized_incremental_binary::Sized_input_reader): New class.
6486 (Sized_incremental_binary::get_input_reader): New function.
6487 (Sized_incremental_binary::find_incremental_inputs_sections):
6488 Rename do_find_incremental_inputs_sections to this.
6489 (Sized_incremental_binary::setup_readers): New function.
6490 (Sized_incremental_binary::has_incremental_info_): New data member.
6491 (Sized_incremental_binary::inputs_reader_): New data member.
6492 (Sized_incremental_binary::symtab_reader_): New data member.
6493 (Sized_incremental_binary::relocs_reader_): New data member.
6494 (Sized_incremental_binary::got_plt_reader_): New data member.
6495 (Sized_incremental_binary::current_input_file_): New data member.
6496
a869183f
PP
64972011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6498
6499 PR gold/12640
6500 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6501 violation.
6502
65032011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6504
6505 * archive.cc (Archive::include_member): Adjust call to report_object.
6506 (Add_archive_symbols::run): Add script_info to call to
6507 report_archive_begin.
6508 (Lib_group::include_member): Adjust call to report_object.
6509 (Add_lib_group_symbols::run): Adjust call to report_object.
6510 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6511 blocks. Add object count for script input files.
6512 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6513 script_info parameter; change all callers.
6514 (Incremental_inputs::report_object): Add script_info parameter;
6515 change all callers.
6516 (Incremental_inputs::report_script): Store backpointer to
6517 incremental info entry.
6518 (Output_section_incremental_inputs::set_final_data_size): Record
6519 additional information for scripts.
6520 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6521 * incremental.h (Incremental_script_entry::add_object): New function.
6522 (Incremental_script_entry::get_object_count): New function.
6523 (Incremental_script_entry::get_object): New function.
6524 (Incremental_script_entry::objects_): New data member; adjust
6525 constructor.
6526 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6527 (Incremental_inputs::report_object): Add script_info parameter.
6528 (Incremental_inputs_reader::get_object_count): New function.
6529 (Incremental_inputs_reader::get_object_offset): New function.
6530 * options.cc (Input_arguments::add_file): Return reference to
6531 new input argument.
6532 * options.h (Input_argument::set_script_info): New function.
6533 (Input_argument::script_info): New function.
6534 (Input_argument::script_info_): New data member; adjust all
6535 constructors.
6536 (Input_file_group::add_file): Return reference to new input argument.
6537 (Input_file_lib::add_file): Likewise.
6538 (Input_arguments::add_file): Likewise.
6539 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6540 * script.cc (Parser_closure::Parser_closure): Add script_info
6541 parameter; adjust all callers.
6542 (Parser_closure::script_info): New function.
6543 (Parser_closure::script_info_): New data member.
6544 (read_input_script): Report scripts earlier to incremental info.
6545 (script_add_file): Set script_info in Input_argument.
6546 (script_add_library): Likewise.
6547 * script.h (Script_options::Script_info): Rewrite class.
6548
a869183f 65492011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6550
6551 * archive.cc (Library_base::should_include_member): Move
6552 method here from class Archive.
6553 (Archive::Archive): Initialize base class.
6554 (Archive::should_include_member): Move to base class.
6555 (Archive::do_for_all_unused_symbols): New function.
6556 (Add_archive_symbols::run): Remove redundant access to
6557 incremental_inputs.
6558 (Lib_group::Lib_group): Initialize base class.
6559 (Lib_group::do_filename): New function.
6560 (Lib_group::include_member): Pass pointer to Lib_group to
6561 report_object.
6562 (Lib_group::do_for_all_unused_symbols): New function.
6563 (Add_lib_group_symbols::run): Report archive information for
6564 incremental links.
6565 * archive.h (class Library_base): New base class.
6566 (class Archive): Derive from Library_base.
6567 (Archive::filename): Move to base class.
6568 (Archive::set_incremental_info): Likewise.
6569 (Archive::incremental_info): Likewise.
6570 (Archive::Should_include): Likewise.
6571 (Archive::should_include_member): Likewise.
6572 (Archive::Armap_entry): Remove.
6573 (Archive::Unused_symbol_iterator): Remove.
6574 (Archive::unused_symbols_begin): Remove.
6575 (Archive::unused_symbols_end): Remove.
6576 (Archive::do_filename): New function.
6577 (Archive::do_get_mtime): New function.
6578 (Archive::do_for_all_unused_symbols): New function.
6579 (Archive::task_): Move to base class.
6580 (Archive::incremental_info_): Likewise.
6581 (class Lib_group): Derive from Library_base.
6582 (Lib_group::do_filename): New function.
6583 (Lib_group::do_get_mtime): New function.
6584 (Lib_group::do_for_all_unused_symbols): New function.
6585 (Lib_group::task_): Move to base class.
6586 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6587 function.
6588 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6589 function.
6590 * incremental.cc (Incremental_inputs::report_archive_begin):
6591 Use Library_base; call library's get_mtime; add incremental inputs
6592 entry before members.
6593 (class Unused_symbol_visitor): New class.
6594 (Incremental_inputs::report_archive_end): Use Library_base; use
6595 visitor class to record unused symbols; don't add incremental inputs
6596 entry after members.
6597 (Incremental_inputs::report_object): Use Library_base.
6598 * incremental.h
6599 (Incremental_archive_entry::Incremental_archive_entry): Remove
6600 unused Archive parameter.
6601 (Incremental_inputs::report_archive_begin): Use Library_base.
6602 (Incremental_inputs::report_archive_end): Likewise.
6603 (Incremental_inputs::report_object): Likewise.
6604 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6605 function.
6606 * object.h (Object::for_all_global_symbols): New function.
6607 (Object::do_for_all_global_symbols): New function.
6608 (Sized_relobj::do_for_all_global_symbols): New function.
6609 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6610 function.
6611 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6612 function.
6613
61ab3e40
ILT
66142011-03-27 Ian Lance Taylor <iant@google.com>
6615
6616 * archive.cc (Archive::interpret_header): Return -1 if something
6617 goes wrong. Change callers accordingly.
6618
30e1f9e6
CC
66192011-03-25 Cary Coutant <ccoutant@google.com>
6620
6621 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6622 * testsuite/Makefile.in: Regenerate.
6623
9370ce59 66242011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6625
6626 * plugin.cc (get_view): New.
6627 (Plugin::load): Pass get_view to the plugin.
6628 (Plugin_manager::get_view): New.
6629
9312bb0a
ILT
66302011-03-21 Ian Lance Taylor <iant@google.com>
6631
6632 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6633 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6634
7e12ba9e
ST
66352011-03-21 Sriraman Tallam <tmsriram@google.com>
6636
6637 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6638 Change == to -eq.
6639 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6640 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6641 Change == to -eq.
6642 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6643 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6644
fd7a005d
ILT
66452011-03-14 Ian Lance Taylor <iant@google.com>
6646
6647 * script-sections.cc (Sort_output_sections::script_compare):
6648 Rename from is_before, change return type.
6649 (Sort_output_sections::operator()): Adjust accordingly.
6650
ed16fd1b
ILT
66512011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6652
6653 PR gold/12572
6654 * testsuite/odr_violation2.cc: Add comment to make all error line
6655 numbers double digits.
6656 * testsuite/debug_msg.sh: Adjust expected errors.
6657
71ff8986
ILT
66582011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6659
6660 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6661 but mark earlier ones as non-canonical
6662 (offset_to_iterator): Update search target and example
6663 (do_addr2line): Return extra lines in a vector*
6664 (format_file_lineno): Extract from do_addr2line
6665 (one_addr2line): Add vector* out-param
6666 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6667 when a lineno entry appeared last for its instruction
6668 (Dwarf_line_info): Add vector* out-param
6669 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6670 * symtab.cc (Odr_violation_compare): Include the lineno in the
6671 comparison again.
6672 (linenos_from_loc): New. Combine the canonical line for an
6673 address with its other lines.
6674 (True_if_intersect): New. Helper functor to make
6675 std::set_intersection a query.
6676 (detect_odr_violations): Compare sets of lines instead of just
6677 one line for each function. This became less deterministic, but
6678 has fewer false positives.
6679 * symtab.h: Declarations.
6680 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6681 mix an optimized and non-optimized object in the same binary
6682 (odr_violation2.so): Same.
6683 * testsuite/Makefile.in: Regenerate from Makefile.am.
6684 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6685 * testsuite/debug_msg.sh: Update line numbers and add
6686 assertions.
6687 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6688 non-optimized context.
6689 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6690 isn't inlined, and use OdrDerived in an optimized context.
6691 * testsuite/odr_header1.h: Defines OdrDerived, where
6692 optimization will change the
6693 first-instruction-in-the-destructor's file and line number.
6694 * testsuite/odr_header2.h: Defines OdrBase.
6695
a19fefdc
ILT
66962011-03-09 Ian Lance Taylor <iant@google.com>
6697
6698 * fileread.cc (File_read::clear_views): Don't delete the whole
6699 file view.
6700
ecb351e9
ILT
67012011-03-08 Ian Lance Taylor <iant@google.com>
6702
6703 PR gold/12525
6704 * fileread.cc: #include <climits>.
6705 (GOLD_IOV_MAX): Define.
6706 (File_read::read_multiple): Limit number of entries by iov_max.
6707 * fileread.h (class File_read): Always set max_readv_entries to
6708 128.
6709
b821d13c
ILT
67102011-03-07 Ian Lance Taylor <iant@google.com>
6711
6712 PR gold/12525
6713 * options.h (class General_options): Add -dy and -dn.
6714
89243142
CC
67152011-03-02 Cary Coutant <ccoutant@google.com>
6716
6717 * testsuite/script_test_9.t: Add TLS segment.
6718
d0773f31
ILT
67192011-03-02 Simon Baldwin <simonb@google.com>
6720
6721 * configure.ac: Add check for gnu_indirect_function support in
6722 the toolchain building binutils.
6723 * configure: Rebuild.
6724
9370ce59 67252011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6726
6727 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6728 plugin only symbols.
6729 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6730 in plugin files as not needed in the symbol table.
6731
4cf7a849
ST
67322011-02-11 Sriraman Tallam <tmsriram@google.com>
6733
6734 * output.cc (Output_section::add_input_section): Delay fill
6735 generation for section ordering.
6736
b578bd7d
ILT
67372011-02-09 Ian Lance Taylor <iant@google.com>
6738
6739 PR gold/12316
6740 * object.h (class Sized_relobj): Remove clear_local_symbols.
6741 * reloc.cc (Sized_relobj::do_relocate): Don't call
6742 clear_local_symbols.
6743
9370ce59 67442011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6745
6746 * plugin.cc (is_visible_from_outside): Return true for symbols
6747 in the -u option.
6748
55382fb7
ILT
67492011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6750
6751 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6752 filename.
6753
4e271fff
ST
67542011-02-02 Sriraman Tallam <tmsriram@google.com>
6755
6756 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6757 to std::string.
4e271fff 6758 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6759 section_name to be std::string.
4e271fff
ST
6760 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6761
d433c3ac
ILT
67622011-01-25 Ian Lance Taylor <iant@google.com>
6763
6764 * script.cc (script_add_extern): Rewrite to use
6765 add_symbol_reference.
6766
880473a6
DK
67672011-01-25 Doug Kwan <dougkwan@google.com>
6768
d433c3ac 6769 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6770
f30f86fa
ILT
67712011-01-24 Ian Lance Taylor <iant@google.com>
6772
6773 * options.h (class General_options): Accept
6774 --no-detect-odr-violations.
6775
8e51a0b9
ILT
67762011-01-24 Ian Lance Taylor <iant@google.com>
6777
6778 * version.cc (version_string): Bump to 1.11.
6779
0f3b89d8
ILT
67802011-01-24 Ian Lance Taylor <iant@google.com>
6781
6782 * plugin.cc (class Plugin_rescan): Define new class.
6783 (Plugin_manager::claim_file): Set any_claimed_.
6784 (Plugin_manager::save_archive): New function.
6785 (Plugin_manager::save_input_group): New function.
6786 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6787 necessary.
6788 (Plugin_manager::new_undefined_symbol): New function.
6789 (Plugin_manager::rescan): New function.
6790 (Plugin_manager::rescannable_defines): New function.
6791 (Plugin_manager::add_input_file): Set any_added_.
6792 * plugin.h (class Plugin_manager): define new fields rescannable_,
6793 undefined_symbols_, any_claimed_, and any_added_. Declare
6794 Plugin_rescan as friend. Declare new functions.
6795 (Plugin_manager::Rescannable): Define type.
6796 (Plugin_manager::Rescannable_list): Define type.
6797 (Plugin_manager::Undefined_symbol_list): Define type.
6798 (Plugin_manager::Plugin_manager): Initialize new fields.
6799 * archive.cc (Archive::defines_symbol): New function.
6800 (Add_archive_symbols::run): Pass archive to plugins if any.
6801 * archive.h (class Archive): Declare defines_symbol.
6802 * readsyms.cc (Input_group::~Input_group): New function.
6803 (Finish_group::run): Pass input_group to plugins if any.
6804 * readsyms.h (class Input_group): Declare destructor.
6805 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6806 any.
6807
3bb951e5
ILT
68082011-01-10 Ian Lance Taylor <iant@google.com>
6809
6810 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6811 section as relro.
6812 (Layout::set_segment_offsets): Reset increase_relro before calling
6813 set_section_addresses a second time.
6814
0aa45fac
CC
68152011-01-04 Cary Coutant <ccoutant@google.com>
6816
6817 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6818 sections before NOBITS sections.
6819
0db46eb4
L
68202011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6821
6822 * version.cc (print_version): Update copyright to 2011.
6823
829c9745
CC
68242010-12-23 Cary Coutant <ccoutant@google.com>
6825
6826 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6827 of OS to this->add. Add OD parameter to second form of the function.
6828
7500420b
ILT
68292010-12-20 Ian Lance Taylor <iant@google.com>
6830
6831 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6832 second of two consecutive entries with same offset.
6833
f8e9a930
RW
68342010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6835
6836 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6837 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6838 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6839 to avoid unneeded links against $(LDADD).
6840 * testsuite/Makefile.in: Regenerate.
6841
2fbb4320
ILT
68422010-12-15 Ian Lance Taylor <iant@google.com>
6843
6844 PR gold/12324
6845 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6846 for R_X86_64_32 and R_X86_64_PC32.
6847 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6848 ver_matching_def_pic.o.
6849 (ver_matching_def_pic.o): New target.
6850
fedb228d
RW
68512010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6852
6853 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6854 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6855 Move definition before File_read::View member definitions.
6856 (File_read::View::~View): Initialize and hold lock before
6857 updating current_mapped_bytes.
6858
9b547ce6
RW
68592010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6860
6861 * dwarf_reader.cc: Remove outdated comment.
6862 * gold-threads.cc: Fix typo in error message.
6863 * archive.cc: Fix typos in comments.
6864 * archive.h: Likewise.
6865 * arm-reloc-property.cc: Likewise.
6866 * arm-reloc-property.h: Likewise.
6867 * arm-reloc.def: Likewise.
6868 * arm.cc: Likewise.
6869 * attributes.h: Likewise.
6870 * cref.cc: Likewise.
6871 * ehframe.cc: Likewise.
6872 * fileread.h: Likewise.
6873 * gold.h: Likewise.
6874 * i386.cc: Likewise.
6875 * icf.cc: Likewise.
6876 * incremental.h: Likewise.
6877 * int_encoding.cc: Likewise.
6878 * layout.h: Likewise.
6879 * main.cc: Likewise.
6880 * merge.h: Likewise.
6881 * object.cc: Likewise.
6882 * object.h: Likewise.
6883 * options.cc: Likewise.
6884 * readsyms.cc: Likewise.
6885 * reduced_debug_output.cc: Likewise.
6886 * reloc.cc: Likewise.
6887 * script-sections.cc: Likewise.
6888 * sparc.cc: Likewise.
6889 * symtab.h: Likewise.
6890 * target-reloc.h: Likewise.
6891 * target.cc: Likewise.
6892 * target.h: Likewise.
6893 * timer.cc: Likewise.
6894 * timer.h: Likewise.
6895 * x86_64.cc: Likewise.
6896
83e17bd5
CC
68972010-12-09 Cary Coutant <ccoutant@google.com>
6898
6899 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6900 stack.
6901 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6902 parameter; change all callers.
6903 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6904 * options.h (warn_execstack): New option.
6905
017257f8
DK
69062010-12-07 Doug Kwan <dougkwan@google.com>
6907
6908 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6909 like function call relocations.
6910
c20cbc06
ILT
69112010-12-07 Ian Lance Taylor <iant@google.com>
6912
6913 * archive.cc (Archive::get_elf_object_for_member): Permit
6914 punconfigured to be NULL.
6915 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6916 (Archive::include_member): Pass NULL to get_elf_object_for_member
6917 if we searched for the archive and this is the first included
6918 object.
6919
4dbfafcc
ILT
69202010-12-01 Ian Lance Taylor <iant@google.com>
6921
6922 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6923 track_relocs_type_ field.
6924 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6925 Set track_relocs_type_.
6926 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6927 contents when using RELA relocs.
6928 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6929 reloc_map_.
6930 * reloc.cc (Track_relocs::next_addend): New function.
6931 * reloc.h (class Track_relocs): Declare next_addend.
6932
e5e19edd
ILT
69332010-12-01 Ian Lance Taylor <iant@google.com>
6934
6935 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6936 virtual destructor.
6937
9a5ce24c
ILT
69382010-12-01 Ian Lance Taylor <iant@google.com>
6939
6940 * README: Update compilers known to work and fail.
6941
c7791212
NC
69422010-11-23 Matthias Klose <doko@ubuntu.com>
6943
6944 * configure.in: For --enable-gold, handle value `default' instead of
6945 `both*'. Always install ld as ld.bfd, install as ld if gold is
6946 not the default.
6947 * configure: Regenerate.
6948
0ad220c9
DK
69492010-11-18 Doug Kwan <dougkwan@google.com>
6950
6951 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6952 and right_alignment to be zero. Store result alignment only if it is
6953 greater than existing alignment.
6954
ab8056e0
CC
69552010-11-16 Cary Coutant <ccoutant@google.com>
6956
6957 PR gold/12220
6958 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6959 Check for ".zdebug_line".
6960
fd064a5b
CC
69612010-11-16 Doug Kwan <dougkwan@google.com>
6962 Cary Coutant <ccoutant@google.com>
6963
6964 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6965 by reference; adjust all callers.
6966 * output.cc (Output_segment::set_section_addresses): Adjust references
6967 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6968 list is empty.
6969 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6970 end at page boundary.
6971
6fc6ea19
CC
69722010-11-16 Cary Coutant <ccoutant@google.com>
6973
6974 PR gold/12220
6975 * layout.cc (Layout::choose_output_section): Transform names of
6976 compressed sections even when using a script with a SECTIONS clause.
6977 (Layout::output_section_name): Remove code to transform
6978 compressed debug section names.
6979 * output.cc (Output_section::add_input_section): Use uncompressed
6980 section size when tracking input sections.
6981
95a2c8d6
RS
69822010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6983
6984 * symtab.h (Symbol::NON_PIC_REF): Remove.
6985 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6986 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6987 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6988 (Symbol::use_plt_offset): Take a flags argument and pass it
6989 directly to needs_dynamic_reloc. Restrict check for undefined
6990 weak symbols to function calls.
6991 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6992 (Target_arm::Scan::global): Use it.
6993 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6994 (Target_arm::Relocate::relocate): Likewise.
6995 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6996 parameter with an r_type parameter. Use get_reference_flags
6997 to get the flags.
6998 (Target_arm::Relocate::relocate): Update accordingly.
6999 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7000 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7001 (Target_i386::Scan::global): Likewise.
7002 (Target_i386::Relocate::relocate): Likewise.
7003 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7004 parameter with an r_type parameter. Use get_reference_flags
7005 to get the flags.
7006 (Target_i386::Relocate::relocate): Update accordingly.
7007 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7008 (Target_powerpc::Scan::global): Use it.
7009 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7010 (Target_powerpc::Relocate::relocate): Likewise.
7011 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7012 (Target_sparc::Scan::global): Use it.
7013 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7014 (Target_sparc::Relocate::relocate): Likewise.
7015 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7016 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7017 (Target_x86_64::Scan::global): Likewise.
7018 (Target_x86_64::Relocate::relocate): Likewise.
7019
f625ae50
DK
70202010-11-08 Doug Kwan <dougkwan@google.com>
7021 Cary Coutant <ccoutant@google.com>
7022
7023 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7024 (Arm_exidx_merge_section::section_contents_): New data member.
7025 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7026 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7027 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7028 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7029 in parameters instead of calling Object::section_contents without
7030 locking.
7031 (Arm_output_section::group_section): New parameter TASK. Pass it
7032 to callees that need locking objects.
7033 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7034 to lock EXIDX input sections. Fix a formatting issue. Call
7035 Arm_exidx_merged_section::build_contents to create merged section
7036 contents.
7037 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7038 to lock object of stub table owner.
7039 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7040 TEXT_SIZE to initialize data member TEXT_SIZE_.
7041 (Arm_exidx_input_section::addralign): Fix typo in comment.
7042 (Arm_exidx_input_section::text_size): New method.
7043 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7044 that require locking objects. Lock objects before scanning for stubs
7045 and updating local symbols.
7046 (Arm_input_section<big_endian>::init): Copy contents of original
7047 input section.
2e702c99 7048 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7049 original input section instead of calling Object::section_contents
7050 without locking.
7051 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7052 size without calling Object::section_size().
7053 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7054 for size. Allocate a buffer for merged EXIDX entries.
7055 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7056 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7057 building code to Arm_exidx_merged_section::build_contetns. Write
7058 out contetns in buffer instead of building it on the fly.
7059 (Arm_relobj::make_exidx_input_section): Also pass text section size
7060 to Arm_exidx_input_section constructor.
7061 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7062 (Arm_dynobj::do_read_symbols): Fix memory leak.
7063 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7064 * target.h: (class Task): Add forward declaration.
7065 (Target::relax): Add new parameter TASK and pass it to
7066 Target::do_relax().
7067 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7068
5f9bcf58
CC
70692010-11-05 Cary Coutant <ccoutant@google.com>
7070
7071 PR gold/10708
7072 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7073 object when reading from the file.
7074 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7075 second layout pass.
7076 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7077 when reading section contents.
7078 (get_section_contents): Likewise.
7079 (icf::find_identical_sections): Likewise.
7080 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7081 object when reading from the file.
7082 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7083 the object when doing deferred section layout.
7084
e597fa08
NC
70852010-11-03 Nick Clifton <nickc@redhat.com>
7086
7087 PR gold/12001
7088 * script.h (class Symbol_assignment: name): New member. Returns
7089 the name of the symbol.
7090 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7091 Returns true if the given symbol name is on the list of
7092 assignments wating to be processed.
7093 * archive.cc (should_incldue_member): If the symbol is undefined,
7094 check to see if it is on the list of symbols pending assignment.
7095
3f9a3278
ILT
70962010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7097
7098 * script-sections.cc (Script_sections::find_memory_region): Check
7099 for a NULL output section pointer.
7100
d06fb4d1
DK
71012010-10-29 Doug Kwan <dougkwan@google.com>
7102
7103 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7104 Output_section::add_relaxed_input_section.
7105 * output.cc (Output_section::add_relaxed_input_section): Add new
7106 arguments LAYOUT and NAME. Set section order index.
7107 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7108 Copy section order index.
7109 * output.h (Output_section::add_relaxed_input_section): Add new
7110 arguments LAYOUT and NAME.
7111
90e24de5
ILT
71122010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7113
7114 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7115 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7116 * testsuite/Makefile.in: Regenerate.
7117
c9484ea5
DK
71182010-10-20 Doug Kwan <dougkwan@google.com>
7119
7120 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7121 without SHF_LINK_ORDER flags.
7122 * layout.cc (Layout::choose_output_section): Do not filter
7123 SHF_LINK_ORDER flag in a relocatable link.
7124
5bc2f5be
CC
71252010-10-17 Cary Coutant <ccoutant@google.com>
7126
7127 * output.h (Output_segment::set_section_addresses): Change function
7128 signature. Update all callers.
7129 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7130 sections.
7131 (Output_segment::set_section_addresses): Align after last TLS
7132 section. Add padding before last relro section instead of after.
7133
0c91cf04
DK
71342010-10-17 Doug Kwan <dougkwan@google.com>
7135
7136 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7137 GOT output section to be writable.
7138
8c21d9d3
CC
71392010-10-14 Cary Coutant <ccoutant@google.com>
7140
7141 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7142 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7143 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7144 mode.
7145 * incremental.cc (report_command_line): Ignore all forms of
7146 --incremental.
7147 * layout.cc (Layout::Layout): Check parameters for incremental link
7148 mode.
7149 * options.cc (General_options::parse_incremental): New function.
7150 (General_options::parse_no_incremental): New function.
7151 (General_options::parse_incremental_full): New function.
7152 (General_options::parse_incremental_update): New function.
7153 (General_options::incremental_mode_): New data member.
7154 (General_options::finalize): Check incremental_mode_.
7155 * options.h (General_options): Update help text for --incremental.
7156 Add --no-incremental, --incremental-full, --incremental-update.
7157 (General_options::Incremental_mode): New enum type.
7158 (General_options::incremental_mode): New function.
7159 (General_options::incremental_mode_): New data member.
7160 * parameters.cc (Parameters::incremental_mode_): New data member.
7161 (Parameters::set_options): Set incremental_mode_.
7162 (Parameters::set_incremental_full): New function.
7163 (Parameters::incremental): New function.
7164 (Parameters::incremental_update): New function.
7165 (set_parameters_incremental_full): New function.
7166 * parameters.h (Parameters::set_incremental_full): New function.
7167 (Parameters::incremental): New function.
7168 (Parameters::incremental_update): New function.
7169 (Parameters::incremental_mode_): New data member.
7170 (set_parameters_incremental_full): New function.
7171 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7172 incremental link mode.
7173 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7174 (Sized_relobj::do_relocate_sections): Likewise.
7175 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7176 option.
7177 * testsuite/Makefile.in: Regenerate.
7178 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7179
bb32aa18 71802010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7181
7182 * script-sections.h (class Script_sections): Make
7183 Sections_elements typedef public.
7184 * script-sections.cc (class Sort_output_sections): Add elements_
7185 field. Add constructor which sets it; change all callers.
7186 (Sort_output_sections::is_before): New function.
7187 (Sort_output_sections::operator()): Call is_before.
7188 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7189 conditional.
7190 * testsuite/script_test_10.sh: New test. Test script section
7191 order.
7192 * testsuite/script_test_10.t: Likewise.
7193 * testsuite/script_test_10.s: Likewise.
7194 * testsuite/Makefile.am: Wrap the cross linker tests and the
7195 common tests into NATIVE_OR_CROSS_LINKER.
7196 (check_SCRIPTS): Add script_test_10.sh.
7197 (check_DATA): Add script_test_10.stdout.
7198 (script_test_10.o, script_test_10): New targets.
7199 (script_test_10.stdout): New target.
7200 * configure, testsuite/Makefile.in: Regenerate.
7201
3cef7179
ILT
72022010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7203
7204 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7205 error for the deprecated relocations.
7206 (Target_arm::Scan::global): Likewise.
7207 (Target_arm::Relocate::relocate): Likewise.
7208
7411e9a8
RS
72092010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7210
7211 * fileread.cc (Input_file::find_file): Initialize *found_name
7212 and *namep when using the fallback search for case 4.
7213
6a9da32a
CC
72142010-10-11 Cary Coutant <ccoutant@google.com>
7215
7216 * options.h (class General_options): Redefine -z lazy as an alias for
7217 the negation of -z now.
7218
ac897c20
ILT
72192010-10-11 Ian Lance Taylor <iant@google.com>
7220
7221 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7222 binding.
7223
ea5cae92
NC
72242010-10-06 Nick Clifton <nickc@redhat.com>
7225
7226 * script-sections.cc(class Memory_region): Remove
7227 current_lma_offset_ field. Rename current_vma_offset_ to
7228 current_offset_. Add last_section_ field.
7229 (Memory_region::get_current_vma_address): Rename to
7230 get_current_address.
7231 (Memory_region::get_current_lma_address): Delete.
7232 (Memory_region::increment_vma_offset): Rename to
7233 increment_offset.
7234 (Memory_region::increment_lma_offset): Delete.
7235 (Memory_region::attributes_compatible): New method. Returns
7236 true if the provided section is compatible with the region.
7237 (Memory_region::get_last_section): New method. Returns the last
7238 section to use the region.
7239 (Memory_region::set_last_section): New method. Stores the last
7240 section to use the region.
7241 (Script_sections::block_in_region): New method. Returns true if
7242 a block of memory is contained within a region.
7243 (Script_sections::find_memory_region): New method. Locates a
7244 memory region to be used to set a VMA or LMA address.
7245 (Output_section_definition::set_section_addresses): Add code to
7246 check for addresses set by memory regions.
7247 (Output_segment::set_section_addresses): Remove memory region
7248 walking code.
7249 (Script_sections::create_segment): Add a warning if a header
7250 segment is created outside of any region.
7251 * script-sections.h (class Script_sections): Add prototypes for
7252 find_memory_region and block_in_region methods.
7253 * testsuite/memory_test.s: Use .long instead of .word.
7254 * testsuite/memory_test.t: Add some more output sections.
7255 * testsuite/memory_test.sh: Update expected output.
7256
a9bfd952
DK
72572010-10-02 Doug Kwan <dougkwan@google.com>
7258
7259 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7260 defintion to symtab.h
7261 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7262 declaration to defintion.
7263
bacff3ab
NC
72642010-10-01 Nick Clifton <nickc@redhat.com>
7265
7266 * expression.cc (eval): Replace dummy argument with NULL.
7267 (eval_maybe_dot): Check for a NULL result section pointer.
7268 (Symbol_expression::value): Likewise.
7269 (Dot_expression::value): Likewise.
7270 (BINARY_EXPRESSION): Likewise.
7271 (Max_expression::value): Likewise.
7272 (Min_expression::value): Likewise.
7273 (Absolute_expression::value): Likewise.
7274 (Addr_expression::value_from_output_section): Likewise.
7275 (Loaddddr_expression::value_from_output_section): Likewise.
7276 (Segment_start_expression::value): Likewise.
7277 * script-sections.cc
7278 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7279 argument with NULL.
7280 (Sections_elememt_dot_assignment::set_section_addresses):
7281 Likewise.
7282 (Output_data_expression::do_write_to_buffer): Likewise.
7283 (Output_section_definition::finalize_symbols): Likewise.
7284 (Output_section_definition::set_section_addresses): Likewise.
7285
f81bc8b5
DK
72862010-09-30 Doug Kwan <dougkwan@google.com>
7287
7288 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7289
c95e9f27
ST
72902010-09-28 Sriraman Tallam <tmsriram@google.com>
7291
7292 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7293 function.
c95e9f27
ST
7294 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7295 virtual function.
7296 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7297 virtual function.
7298 * icf.cc (get_section_contents): Inline merge sections only when
7299 target allows it.
7300
3cac54d2
RW
73012010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7302
7303 * configure: Regenerate.
7304
2904037a
ILT
73052010-09-17 Ian Lance Taylor <iant@google.com>
7306
7307 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7308 * testsuite/Makefile.am (memory_test.o): New target.
7309 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7310 memory_test.t.
7311 * testsuite/Makefile.in: Rebuild.
2904037a 7312
bca7fb63
DK
73132010-09-17 Doug Kwan <dougkwan@google.com>
7314
7315 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7316 defintion if relocation uses GOT entries of the symbol.
7317 * testsuite/icf_safe_test.sh: Fix test.
7318 * testsuite/icf_safe_so_test.sh: Fix test.
7319
4ef28648
CC
73202010-09-16 Cary Coutant <ccoutant@google.com>
7321
7322 * script_sections.cc (class Memory_region): Remove "NULL" from
7323 vector initializations.
7324
793990de
CC
73252010-09-15 Cary Coutant <ccoutant@google.com>
7326
7327 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7328 Resolve forwarding symbols.
7329
81e015e2
DK
73302010-09-15 Doug Kwan <dougkwan@google.com>
7331
7332 * gold/testsuite/script_test_3.t: Add ARM special sections.
7333 * gold/testsuite/script_test_4.t: Same.
7334 * gold/testsuite/script_test_5.t: Same.
7335 * gold/testsuite/script_test_6.t: Same.
7336 * gold/testsuite/script_test_7.t: Same.
7337 * gold/testsuite/script_test_7.t: Same.
7338 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7339
36171d64
CC
73402010-09-14 Cary Coutant <ccoutant@google.com>
7341
7342 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7343 (Target_x86_64::Relocate::relocate_tls): Replace check for
7344 saw_tls_block_reloc_ with test for executable section.
7345
d89051bd
CC
73462010-09-12 Cary Coutant <ccoutant@google.com>
7347
7348 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7349 position-independent executables to shared libraries need dynamic
7350 relocations.
7351 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7352 position-independent executables.
7353 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7354 * testsuite/Makefile.in: Regenerate.
7355
fca41f0f
NC
73562010-09-10 Nick Clifton <nickc@redhat.com>
7357
7358 PR gold/11997
7359 * testsuite/memory_test.t: Discard any sections that are not
7360 needed.
7361
6695e4b3
L
73622010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7363
7364 PR gold/11996
7365 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7366 "This::" to work around a bug in gcc 4.2.
7367
7368 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7369
0f72bf6f
RÁE
73702010-09-09 Rafael Espindola <espindola@google.com>
7371
7372 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7373 sections with different PF_X flags in the same segment.
7374 (Layout::find_first_load_seg): Search all segments to find the first
7375 one.
7376 * options.h (rosegment): New.
7377
73782010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7379
05a79166 7380 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7381
aa98ff75
DK
73822010-09-08 Doug Kwan <dougkwan@google.com>
7383
7384 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7385 (Arm_relobj::do_relocate_sections): Add new parameter for output
7386 file to match the parent.
7387 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7388 of local symbols instead of input values. Update code to track
7389 changes in gold::relocate_section.
7390 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7391 (Sized_relobj::compute_final_local_value_internal): New methods.
7392 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7393 body into private version of Sized_relobj::compute_final_local_value.
7394 Call the inline method.
7395 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7396 merged symbol value if there is one.
7397 (Symbol_value::has_output_value): New method defintiion.
7398 (Sized_relobj::Compute_final_local_value_status): New enum type.
7399 (Sized_relobj::compute_final_local_value): New methods.
7400 (Sized_relobj::compute_final_local_value_internal): New methods.
7401 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7402 and arm_cortex_a8.sh.
7403 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7404 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7405 New tests.
7406 * Makefile.in: Regenerate.
7407 * testsuite/arm_bl_out_of_range.s: Update test.
7408 * testsuite/thumb_bl_out_of_range.s: Ditto.
7409 * testsuite/thumb_blx_out_of_range.s: Ditto.
7410 * testsuite/arm_branch_out_of_range.sh: New file.
7411 * testsuite/arm_cortex_a8.sh: Ditto.
7412 * testsuite/arm_cortex_a8_b.s: Ditto.
7413 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7414 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7415 * testsuite/arm_cortex_a8_bl.s: Ditto.
7416 * testsuite/arm_cortex_a8_blx.s: Ditto.
7417 * testsuite/arm_cortex_a8_local.s: Ditto.
7418 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7419 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7420
05a79166
L
74212010-09-08 Rafael Espindola <espindola@google.com>
7422
7423 * Makefile.am (memory_test.stdout): Run readelf with -W.
7424 * Makefile.in: Regenerate.
7425 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7426 64 bit output.
7427
33dbc701
RÁE
74282010-09-08 Rafael Espindola <espindola@google.com>
7429
7430 * script-sections.cc (Script_sections::add_memory_region): Convert
7431 field precision to int.
7432 * script.cc (script_set_section_region, script_set_section_region):
7433 Convert field precision to int.
7434
731ca54a
RÁE
74352010-09-08 Rafael Espindola <espindola@google.com>
7436
7437 * arm.cc (do_finalize_sections): Create the __exidx_start and
7438 __exdix_end symbols even when the section is missing.
7439
7f8cd844
NC
74402010-09-08 Nick Clifton <nickc@redhat.com>
7441
7442 * README: Remove claim that MEMORY is not supported.
7443 * expression.cc (script_exp_function_origin)
7444 (script_exp_function_length): Move from here to ...
7445 * script.cc: ... here.
7446 (script_set_section_region, script_add_memory)
7447 (script_parse_memory_attr, script_include_directive): New
7448 functions.
7449 * script-sections.cc
7450 (class Memory_region): New class.
7451 (class Output_section_definition): Add set_memory_region,
7452 set_section_vma, set_section_lma and get_section_name methods.
7453 (class Script_Sections): Add add_memory_region,
7454 find_memory_region, find_memory_region_origin,
7455 find_memory_region_length and set_memory_region methods.
7456 Have set_section_addresses method walk the list of set memory
7457 regions.
7458 Extend the print methos to display memory regions.
7459 * script-sections.h: Add prototypes for new methods.
7460 Add enum for MEMORY region attributes.
7461 * yyscript.y: Add support for parsing MEMORY regions.
7462 * script-c.h: Add prototypes for new functions.
7463 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7464 * testsuite/Makefile.in: Regenerate.
7465 * testsuite/memory_test.sh: New script.
7466 * testsuite/memory_test.s: New assembler source file.
7467 * testsuite/memory_test.t: New linker script.
7468
a4649286
DK
74692010-08-27 Doug Kwan <dougkwan@google.com>
7470
7471 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7472 reference override an existing dynamic weak reference.
7473 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7474 * testsuite/Makefile.in: Regenerate.
7475 * testsuite/dyn_weak_ref.sh: New file.
7476 * testsuite/dyn_weak_ref_1.c: Ditto.
7477 * testsuite/dyn_weak_ref_2.c: Ditto.
7478
b56648ad
ILT
74792010-08-27 Ian Lance Taylor <iant@google.com>
7480
7481 * incremental.h (class Incremental_input_entry): Add virtual
7482 destructor.
7483
809313cb
ILT
74842010-08-27 Ian Lance Taylor <iant@google.com>
7485
7486 * testsuite/start_lib_test_3.c: Mark t3 as used.
7487
11e32464
NC
74882010-08-27 Nick Clifton <nickc@redhat.com>
7489
7490 * options.cc (version_script): Fix small typo in previous
7491 whitespace tidyup.
7492
ca09d69a
NC
74932010-08-25 Nick Clifton <nickc@redhat.com>
7494
7495 * archive.cc: Formatting fixes: Remove whitespace between
7496 typename and following asterisk. Remove whitespace between
7497 function name and opening parenthesis.
7498 * archive.h: Likewise.
7499 * arm.cc: Likewise.
7500 * attributes.cc: Likewise.
7501 * attributes.h: Likewise.
7502 * common.cc: Likewise.
7503 * copy-relocs.cc: Likewise.
7504 * dirsearch.h: Likewise.
7505 * dynobj.cc: Likewise.
7506 * ehframe.cc: Likewise.
7507 * ehframe.h: Likewise.
7508 * expression.cc: Likewise.
7509 * fileread.cc: Likewise.
7510 * fileread.h: Likewise.
7511 * gc.h: Likewise.
7512 * gold-threads.cc: Likewise.
7513 * gold.cc: Likewise.
7514 * i386.cc: Likewise.
7515 * icf.h: Likewise.
7516 * incremental-dump.cc: Likewise.
7517 * incremental.cc: Likewise.
7518 * layout.cc: Likewise.
7519 * layout.h: Likewise.
7520 * main.cc: Likewise.
7521 * merge.cc: Likewise.
7522 * merge.h: Likewise.
7523 * object.cc: Likewise.
7524 * object.h: Likewise.
7525 * options.cc: Likewise.
7526 * options.h: Likewise.
7527 * output.cc: Likewise.
7528 * output.h: Likewise.
7529 * plugin.cc: Likewise.
7530 * plugin.h: Likewise.
7531 * powerpc.cc: Likewise.
7532 * reloc.cc: Likewise.
7533 * script-c.h: Likewise.
7534 * script-sections.cc: Likewise.
7535 * script.cc: Likewise.
7536 * stringpool.cc: Likewise.
7537 * symtab.cc: Likewise.
7538 * symtab.h: Likewise.
7539 * target.cc: Likewise.
7540 * timer.cc: Likewise.
7541 * timer.h: Likewise.
7542 * version.cc: Likewise.
7543 * x86_64.cc: Likewise.
7544
b8fa8750
NC
75452010-08-24 Nick Clifton <nickc@redhat.com>
7546
7547 PR 11899
7548 * layout.cc (segment_precedes): Sort segments by their physical
7549 addresses, if they have been set.
7550
9919d93b
CC
75512010-08-23 Cary Coutant <ccoutant@google.com>
7552
7553 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7554 symbols data.
7555 (Lib_group::include_member): Unlock object after deleting its
7556 symbols data.
7557 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7558 the bug fixed here.
7559
97b4be1c
CC
75602010-08-19 Neil Vachharajani <nvachhar@google.com>
7561 Cary Coutant <ccoutant@google.com>
7562
7563 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7564 constructor, and set_blocker.
7565 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7566 readsyms_blocker_.
7567 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7568 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7569 * testsuite/Makefile.am (start_lib_test): New test case.
7570 * testsuite/Makefile.in: Regenerate.
7571 * testsuite/start_lib_test_main.c: New file.
7572 * testsuite/start_lib_test_1.c: New file.
7573 * testsuite/start_lib_test_2.c: New file.
7574 * testsuite/start_lib_test_3.c: New file.
7575
dd0b1884
ILT
75762010-08-19 Ian Lance Taylor <iant@google.com>
7577
7578 * Makefile.in: Rebuild with automake 1.11.1.
7579 * aclocal.m4: Likewise.
7580 * testsuite/Makefile.in: Likewise.
7581
7223e9ca
ILT
75822010-08-19 Ian Lance Taylor <iant@google.com>
7583
7584 PR 10893
7585 * i386.cc (class Output_data_plt_i386): Update declarations.
7586 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7587 local_ifuncs_ fields.
7588 (Target_i386::do_plt_section_for_global): New function.
7589 (Target_i386::do_plt_section_for_local): New function.
7590 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7591 parameter; change all callers. Initialize global_ifuncs_ and
7592 local_ifuncs_. If doing a static link define __rel_iplt_start and
7593 __rel_iplt_end.
7594 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7595 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7596 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7597 symbols.
7598 (Target_i386::make_plt_section): New function, broken out of
7599 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7600 (Target_i386::make_plt_entry): Call make_plt_section.
7601 (Target_i386::make_local_ifunc_plt_entry): New function.
7602 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7603 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7604 R_386_IRELATIVE to switch.
7605 (Target_i386::Scan::global): Likewise.
7606 (Target_i386::Relocate::relocate): Likewise.
7607 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7608 switch.
7609 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7610 (Target_x86_64::do_plt_section_for_global): New function.
7611 (Target_x86_64::do_plt_section_for_local): New function.
7612 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7613 parameter; change all callers. If doing a static link define
7614 __rela_iplt_start and __rela_iplt_end.
7615 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7616 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7617 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7618 to point to .plt.
7619 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7620 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7621 switch.
7622 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7623 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7624 R_X86_64_IRELATIVE to switch.
7625 (Target_x86_64::Scan::global): Likewise.
7626 (Target_x86_64::Relocate::relocate): Likewise.
7627 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7628 switch.
7629 * target.h (class Target): Add plt_section_for_global and
7630 plt_section_for_local functions. Add do_plt_section_for_global
7631 and do_plt_section_for_local virtual functions.
7632 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7633 clarifying comments.
7634 (Symbol::use_plt_offset): Handle IFUNC symbol.
7635 * object.cc (Sized_relobj::Sized_relobj): Initialize
7636 local_plt_offsets_.
7637 (Sized_relobj::local_has_plt_offset): New function.
7638 (Sized_relobj::local_plt_offset): New function.
7639 (Sized_relobj::set_local_plt_offset): New function.
7640 (Sized_relobj::do_count): Handle IFUNC symbol.
7641 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7642 a bit away from input_shndx_ field. Add set_is_func_symbol and
7643 is_ifunc_symbol functions.
7644 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7645 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7646 local_plt_offsets_ field.
7647 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7648 * output.h (class Output_section_data): Add non-const
7649 output_section function.
7650 (class Output_data_got): Update declarations.
7651 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7652 Add use_plt_offset parameter to global and local constructors.
7653 Change all callers. Change local_sym_index_ field to 31 bits.
7654 Change GSYM_CODE and CONSTANT_CODE accordingly.
7655 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7656 doing a static link don't set sh_link field.
7657 (Output_data_got::Got_entry::write): Use PLT offset if
7658 appropriate.
7659 (Output_data_got::add_global_plt): New function.
7660 (Output_data_got::add_local_plt): New function.
7661 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7662 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7663 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7664 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7665 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7666 IFUNC conditional.
7667 * testsuite/ifunc-sel.h: New file.
7668 * testsuite/ifuncmain1.c: New file.
7669 * testsuite/ifuncmain1vis.c: New file.
7670 * testsuite/ifuncmod1.c: New file.
7671 * testsuite/ifuncdep2.c: New file.
7672 * testsuite/ifuncmain2.c: New file.
7673 * testsuite/ifuncmain3.c: New file.
7674 * testsuite/ifuncmod3.c: New file.
7675 * testsuite/ifuncmain4.c: New file.
7676 * testsuite/ifuncmain5.c: New file.
7677 * testsuite/ifuncmod5.c: New file.
7678 * testsuite/ifuncmain6pie.c: New file.
7679 * testsuite/ifuncmod6.c: New file.
7680 * testsuite/ifuncmain7.c: New file.
7681 * configure, testsuite/Makefile.in: Rebuild.
7682
56f75c03
ILT
76832010-08-18 Ian Lance Taylor <iant@google.com>
7684
7685 * incremental.cc
7686 (Output_section_incremental_inputs::write_input_files): Add cast
7687 to avoid signed/unsigned comparison warning.
7688 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7689
55455f89
CC
76902010-08-12 Cary Coutant <ccoutant@google.com>
7691
7692 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7693
e2054bcb
ILT
76942010-08-13 Ian Lance Taylor <iant@google.com>
7695
7696 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7697
74f67560
DK
76982010-08-12 Cary Coutant <ccoutant@google.com>
7699 Doug Kwan <dougkwan@google.com>
7700
7701 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7702 defintion overrides non-weak undef, remember that the original undef
7703 is not weak.
7704 * symtab.cc (Symbol_table::sized_write_global): For undef without
7705 an original weak binding, set binding to global in output.
7706 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7707 * testsuite/Makefile.in: Regenerate.
7708 * testsuite/strong_ref_weak_def.sh: New file.
7709 * testsuite/strong_ref_weak_def_1.c: Ditto.
7710 * testsuite/strong_ref_weak_def_2.c: Ditto.
7711
d1238d12
CC
77122010-08-12 Cary Coutant <ccoutant@google.com>
7713
7714 * testsuite/incremental_test.sh: Rewrite.
7715 * testsuite/incremental_test_1.c: Rewrite.
7716 * testsuite/incremental_test_2.c: Rewrite.
7717
0e70b911
CC
77182010-08-12 Cary Coutant <ccoutant@google.com>
7719
7720 * arm.cc (Target_arm::got_size): Add const.
7721 (Target_arm::got_entry_count): New function.
7722 (Target_arm::plt_entry_count): New function.
7723 (Target_arm::first_plt_entry_offset): New function.
7724 (Target_arm::plt_entry_size): New function.
7725 (Output_data_plt_arm::entry_count): New function.
7726 (Output_data_plt_arm::first_plt_entry_offset): New function.
7727 (Output_data_plt_arm::get_plt_entry_size): New function.
7728 * i386.cc (Target_i386::got_size): Add const.
7729 (Target_i386::got_entry_count): New function.
7730 (Target_i386::plt_entry_count): New function.
7731 (Target_i386::first_plt_entry_offset): New function.
7732 (Target_i386::plt_entry_size): New function.
7733 (Output_data_plt_i386::entry_count): New function.
7734 (Output_data_plt_i386::first_plt_entry_offset): New function.
7735 (Output_data_plt_i386::get_plt_entry_size): New function.
7736 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7737 find_incremental_inputs_sections. Dump incremental_got_plt section.
7738 * incremental.cc: Include target.h.
7739 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7740 parameter. Adjust all callers. Find incremental_got_plt section.
7741 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7742 section.
7743 (Output_section_incremental_inputs::set_final_data_size): Calculate
7744 size of incremental_got_plt section.
7745 (Output_section_incremental_inputs::do_write): Write the
7746 incremental_got_plt section.
7747 (Got_plt_view_info): New struct.
7748 (Local_got_offset_visitor): New class.
7749 (Global_got_offset_visitor): New class.
7750 (Global_symbol_visitor_got_plt): New class.
7751 (Output_section_incremental_inputs::write_got_plt): New function.
7752 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7753 Add parameter. Adjust all callers.
7754 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7755 (Incremental_inputs::got_plt_section): New function.
7756 (Incremental_inputs::got_plt_section_): New data member.
7757 (Incremental_got_plt_reader): New class.
7758 * layout.cc (Layout::create_incremental_info_sections): Add the
7759 incremental_got_plt section.
7760 * object.h (Got_offset_list::get_list): New function.
7761 (Got offset_list::for_all_got_offsets): New function.
7762 (Sized_relobj::local_got_offset_list): New function.
7763 * powerpc.cc (Target_powerpc::got_size): Add const.
7764 (Target_powerpc::got_entry_count): New function.
7765 (Target_powerpc::plt_entry_count): New function.
7766 (Target_powerpc::first_plt_entry_offset): New function.
7767 (Target_powerpc::plt_entry_size): New function.
7768 (Output_data_plt_powerpc::entry_count): New function.
7769 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7770 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7771 * sparc.cc (Target_sparc::got_size): Add const.
7772 (Target_sparc::got_entry_count): New function.
7773 (Target_sparc::plt_entry_count): New function.
7774 (Target_sparc::first_plt_entry_offset): New function.
7775 (Target_sparc::plt_entry_size): New function.
7776 (Output_data_plt_sparc::entry_count): New function.
7777 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7778 (Output_data_plt_sparc::get_plt_entry_size): New function.
7779 * symtab.h (Symbol::got_offset_list): New function.
7780 (Symbol_table::for_all_symbols): New function.
7781 * target.h (Sized_target::got_entry_count): New function.
7782 (Sized_target::plt_entry_count): New function.
7783 (Sized_target::plt_entry_size): New function.
7784 * x86_64.cc (Target_x86_64::got_size): Add const.
7785 (Target_x86_64::got_entry_count): New function.
7786 (Target_x86_64::plt_entry_count): New function.
7787 (Target_x86_64::first_plt_entry_offset): New function.
7788 (Target_x86_64::plt_entry_size): New function.
7789 (Output_data_plt_x86_64::entry_count): New function.
7790 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7791 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7792
09ec0418
CC
77932010-08-12 Cary Coutant <ccoutant@google.com>
7794
7795 * archive.cc: Include incremental.h.
7796 (Archive::Archive): Initialize incremental_info_.
7797 (Archive::include_member): Record archive members in incremental info.
7798 (Add_archive_symbols::run): Record begin and end of an archive in
7799 incremental info.
7800 (Lib_group::include_member): Record objects in incremental info.
7801 * archive.h (Incremental_archive_entry): Forward declaration.
7802 (Archive::set_incremental_info): New member function.
7803 (Archive::incremental_info): New member function.
7804 (Archive::Unused_symbol_iterator): New class.
7805 (Archive::unused_symbols_begin): New member function.
7806 (Archive::unused_symbols_end): New member function.
7807 (Archive::incremental_info_): New data member.
7808 * incremental-dump.cc (find_input_containing_global): New function.
7809 (dump_incremental_inputs): Dump new incremental info sections.
7810 * incremental.cc: Include symtab.h.
7811 (Output_section_incremental_inputs): New class.
7812 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7813 new incremental info sections.
7814 (Sized_incremental_binary::do_check_inputs): Likewise.
7815 (Incremental_inputs::report_archive): Remove.
7816 (Incremental_inputs::report_archive_begin): New function.
7817 (Incremental_inputs::report_archive_end): New function.
7818 (Incremental_inputs::report_object): New function.
7819 (Incremental_inputs::finalize_inputs): Remove.
7820 (Incremental_inputs::report_input_section): New function.
7821 (Incremental_inputs::report_script): Rewrite.
7822 (Incremental_inputs::finalize): Do nothing but finalize string table.
7823 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7824 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7825 (Incremental_inputs::create_data_sections): New function.
7826 (Incremental_inputs::relocs_entsize): New function.
7827 (Output_section_incremental_inputs::set_final_data_size): New function.
7828 (Output_section_incremental_inputs::do_write): New function.
7829 (Output_section_incremental_inputs::write_header): New function.
7830 (Output_section_incremental_inputs::write_input_files): New function.
7831 (Output_section_incremental_inputs::write_info_blocks): New function.
7832 (Output_section_incremental_inputs::write_symtab): New function.
7833 * incremental.h (Incremental_script_entry): Forward declaration.
7834 (Incremental_object_entry): Forward declaration.
7835 (Incremental_archive_entry): Forward declaration.
7836 (Incremental_inputs): Forward declaration.
7837 (Incremental_inputs_header_data): Remove.
7838 (Incremental_inputs_header): Remove.
7839 (Incremental_inputs_header_write): Remove.
7840 (Incremental_inputs_entry_data): Remove.
7841 (Incremental_inputs_entry): Remove.
7842 (Incremental_inputs_entry_write): Remove.
7843 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7844 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7845 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7846 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7847 Likewise.
7848 (Incremental_input_entry): New class.
7849 (Incremental_script_entry): New class.
7850 (Incremental_object_entry): New class.
7851 (Incremental_archive_entry): New class.
7852 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7853 (Incremental_inputs::report_inputs): Remove.
7854 (Incremental_inputs::report_archive): Remove.
7855 (Incremental_inputs::report_archive_begin): New function.
7856 (Incremental_inputs::report_archive_end): New function.
7857 (Incremental_inputs::report_object): Change prototype.
7858 (Incremental_inputs::report_input_section): New function.
7859 (Incremental_inputs::report_script): Change prototype.
7860 (Incremental_inputs::get_reloc_count): New function.
7861 (Incremental_inputs::set_reloc_count): New function.
7862 (Incremental_inputs::create_data_sections): New function.
7863 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7864 (Incremental_inputs::inputs_section): New function.
7865 (Incremental_inputs::symtab_section): New function.
7866 (Incremental_inputs::relocs_section): New function.
7867 (Incremental_inputs::get_stringpool): Add const.
7868 (Incremental_inputs::command_line): Add const.
7869 (Incremental_inputs::inputs): Remove.
7870 (Incremental_inputs::command_line_key): New function.
7871 (Incremental_inputs::input_file_count): New function.
7872 (Incremental_inputs::input_files): New function.
7873 (Incremental_inputs::relocs_entsize): New function.
7874 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7875 (Incremental_inputs::finalize_inputs): Remove.
7876 (Incremental_inputs::Input_info): Remove.
7877 (Incremental_inputs::lock_): Remove.
7878 (Incremental_inputs::inputs_): Change type.
7879 (Incremental_inputs::inputs_map_): Remove.
7880 (Incremental_inputs::current_object_entry_): New data member.
7881 (Incremental_inputs::inputs_section_): New data member.
7882 (Incremental_inputs::symtab_section_): New data member.
7883 (Incremental_inputs::relocs_section_): New data member.
7884 (Incremental_inputs::reloc_count_): New data member.
7885 (Incremental_inputs_reader): New class.
7886 (Incremental_symtab_reader): New class.
7887 (Incremental_relocs_reader): New class.
7888 * layout.cc (Layout::finalize): Move finalization of incremental info
7889 and creation of incremental info sections to follow finalization of
7890 symbol table. Set offsets for postprocessing sections.
7891 (Layout::create_incremental_info_sections): Call
7892 Incremental_inputs::create_data_sections. Add incremental symtab
7893 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7894 sections to layout after input sections.
7895 * layout.h (struct Timespec): Forward declaration.
7896 (Layout::incremental_inputs): Add const.
7897 (Layout::create_incremental_info_sections): Add parameter.
7898 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7899 * object.cc: Include incremental.h.
7900 (Relobj::finalize_incremental_relocs): New function.
7901 (Sized_relobj::do_layout): Record input sections in incremental info.
7902 * object.h (Object::output_section): New function.
7903 (Object::output_section_offset): Moved from Relobj.
7904 (Object::get_incremental_reloc_base): New function.
7905 (Object::get_incremental_reloc_count): New function.
7906 (Object::do_output_section): New function.
7907 (Object::do_output_section_offset): Moved from Relobj.
7908 (Object::do_get_incremental_reloc_base): New function.
7909 (Object::do_get_incremental_reloc_count): New function.
7910 (Object::Object): Initialize new data members.
7911 (Relobj::output_section): Renamed do_output_section and moved to
7912 protected.
7913 (Relobj::output_section_offset): Moved to Object.
7914 (Relobj::do_get_incremental_reloc_base): New function.
7915 (Relobj::do_get_incremental_reloc_count): New function.
7916 (Relobj::allocate_incremental_reloc_counts): New function.
7917 (Relobj::count_incremental_reloc): New function.
7918 (Relobj::finalize_incremental_relocs): New function.
7919 (Relobj::next_incremental_reloc_index): New function.
7920 (Relobj::reloc_counts_): New data member.
7921 (Relobj::reloc_bases_): New data member.
7922 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7923 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7924 (Sized_relobj::incremental_relocs_scan): New function.
7925 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7926 (Sized_relobj::incremental_relocs_write): New function.
7927 (Sized_relobj::incremental_relocs_write_reltype): New function.
7928 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7929 incremental link.
7930 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7931 archives and object files elsewhere.
7932 (Add_symbols::run): Report object files here.
7933 (Finish_group::run): Report end of archive at end of group.
7934 * reloc.cc: Include layout.h, incremental.h.
7935 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7936 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7937 (Sized_relobj::incremental_relocs_scan): New function.
7938 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7939 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7940 (Sized_relobj::incremental_relocs_write): New function.
7941 (Sized_relobj::incremental_relocs_write_reltype): New function.
7942 * script.cc (read_input_script): Rewrite test for incremental link.
7943 Change call to Incremental_inputs::report_script.
7944 * symtab.h (Symbol_table::first_global_index): New function.
7945 (Symbol_table::output_count): New function.
7946
ce0d1972
DK
79472010-08-12 Doug Kwan <dougkwan@google.com>
7948
7949 * arm.cc (Target_arm::merge_object_attributes): Check command line
7950 options --no-wchar-size-warning and --no-enum-size-warning.
7951 * options.h (General_options): Add ld-compatible options
7952 --no-enum-size-warning and --no-wchar-size-warning.
7953
6e5710ce
ILT
79542010-08-04 Ian Lance Taylor <iant@google.com>
7955
7956 * x86_64.cc (Target_x86_64::Scan::local): Use
7957 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7958 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7959 (Target_x86_64::Scan::global): Likewise.
7960 (Target_x86_64::Relocate::relocate): Likewise.
7961 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7962 Likewise.
7963
fef830db
CC
79642010-08-03 Cary Coutant <ccoutant@google.com>
7965
7966 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7967 to reserve space in merged_strings vector. Keep total input size
7968 for stats.
7969 (Output_merge_string::do_print_merge_stats): Print total input size.
7970 * merge.h (Output_merge_string): Add input_size_ field.
7971 * stringpool.cc (Stringpool_template::string_length): Move
7972 implementations out of Stringpool_template class and place in
7973 stringpool.h.
7974 * stringpool.h (string_length): Move out of Stringpool_template.
7975
1e3811b0
ILT
79762010-08-03 Ian Lance Taylor <iant@google.com>
7977
7978 PR 11712
7979 * layout.cc (relaxation_loop_body): If address of load segment is
7980 set, adjust address to include headers if possible.
7981
7af0c620
ILT
79822010-08-03 Ian Lance Taylor <iant@google.com>
7983
7984 * version.cc (version_string): Bump to 1.10.
7985
22f0da72
ILT
79862010-08-03 Ian Lance Taylor <iant@google.com>
7987
7988 PR 11805
7989 * layout.h (enum Output_section_order): Define.
7990 (class Layout): Update declarations.
7991 * layout.cc (Layout::get_output_section): Add order parameter.
7992 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7993 is_first_non_relro parameters. Change all callers.
7994 (Layout::choose_output_section): Likewise.
7995 (Layout::add_output_section_data): Likewise.
7996 (Layout::make_output_section): Likewise. Set order.
7997 (Layout::default_section_order): New function.
7998 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7999 * output.cc (Output_section::Output_section): Initialize order_.
8000 Don't initialize deleted fields.
8001 (Output_segment::Output_segment): Don't initialize deleted
8002 fields.
8003 (Output_segment::add_output_section_to_load): New function
8004 replacing add_output_section. Change all callers to call this or
8005 add_output_section_to_nonload.
8006 (Output_segment::add_output_section_to_nonload): New function.
8007 (Output_segment::remove_output_section): Rewrite.
8008 (Output_segment::add_initial_output_data): Likewise.
8009 (Output_segment::has_any_data_sections): Likewise.
8010 (Output_segment::is_first_section_relro): Likewise.
8011 (Output_segment::maximum_alignment): Likewise.
8012 (Output_segment::has_dynamic_reloc): New function replacing
8013 dynamic_reloc_count. Change all callers.
8014 (Output_segment::has_dynamic_reloc_list): New function replacing
8015 dynamic_reloc_count_list. Change all callers.
8016 (Output_segment::set_section_addresses): Rewrite.
8017 (Output_segment::set_offset): Rewrite.
8018 (Output_segment::find_first_and_last_list): Remove.
8019 (Output_segment::set_tls_offsets): Rewrite.
8020 (Output_segment::first_section_load_address): Likewise.
8021 (Output_segment::output_section_count): Likewise.
8022 (Output_segment::section_with_lowest_load_address): Likewise.
8023 (Output_segment::write_section_headers): Likewise.
8024 (Output_segment::print_sections_to_map): Likewise.
8025 * output.h (class Output_data): Remove dynamic_reloc_count_
8026 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8027 (Output_data::add_dynamic_reloc): Rewrite.
8028 (Output_data::has_dynamic_reloc): New function.
8029 (Output_data::dynamic_reloc_count): Remove.
8030 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8031 is_last_relro_, is_first_non_relro_, is_interp_,
8032 is_dynamic_linker_section_ fields. Add order and set_order
8033 functions. Remove is_relro_local, set_is_relro_local,
8034 is_last_relro, set_is_last_relro, is_first_non_relro,
8035 set_is_first_non_relro functions, is_interp, set_is_interp,
8036 is_dynamic_linker_section, and set_is_dynamic_linker_section
8037 functions.
8038 (class Output_segment): Change Output_data_list from std::list to
8039 std:;vector. Add output_lists_ field. Remove output_data_ and
8040 output_bss_ fields. Update declarations.
8041
3ff2ccb0
ILT
80422010-08-02 Ian Lance Taylor <iant@google.com>
8043
8044 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8045 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8046 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8047
88a4108b
ILT
80482010-08-02 Ian Lance Taylor <iant@google.com>
8049
8050 PR 11855
8051 * script.cc (Script_options::Script_options): Initialize
8052 symbol_definitions_ and symbol_references_.
8053 (Script_options::add_symbol_assignment): Update
8054 symbol_definitions_ and symbol_references_.
8055 (Script_options::add_symbol_reference): New function.
8056 (script_symbol): New function.
8057 * script.h (class Script_options): Add symbol_definitions_ and
8058 symbol_references_ fields.
8059 (Script_options::referenced_const_iterator): New type.
8060 (Script_options::referenced_begin): New function.
8061 (Script_options::referenced_end): New function.
8062 (Script_options::is_referenced): New function.
8063 (Script_options::any_unreferenced): New function.
8064 * script-c.h (script_symbol): Declare.
8065 * yyscript.y (exp): Call script_symbol.
8066 * symtab.cc: Include "script.h".
8067 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8068 Change all callers. Check symbols referenced by scripts.
8069 (Symbol_table::add_undefined_symbols_from_command_line): Add
8070 layout parameter. Change all callers.
8071 (Symbol_table::do_add_undefined_symbols_from_command_line):
8072 Likewise. Break out loop body. Check symbols referenced by
8073 scripts.
8074 (Symbol_table::add_undefined_symbol_from_command_line): New
8075 function broken out of
8076 do_add_undefined_symbols_from_command_line.
8077 * symtab.h (class Symbol_table): Update declarations.
8078 * archive.cc: Include "layout.h".
8079 (Archive::should_include_member): Add layout parameter. Change
8080 all callers. Check for symbol mentioned in expression.
8081 * archive.h (class Archive): Update declaration.
8082 * object.cc (Sized_relobj::do_should_include_member): Add layout
8083 parameter.
8084 * object.h (Object::should_include_member): Add layout parameter.
8085 Change all callers.
8086 (Object::do_should_include_member): Add layout parameter.
8087 (class Sized_relobj): Update declaration.
8088 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8089 parameter.
8090 * dynobj.h (class Sized_dynobj): Update declaration.
8091 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8092 layout parameter.
8093 * plugin.h (class Sized_pluginobj): Update declaration.
8094
5f1ab67a
ILT
80952010-08-02 Ian Lance Taylor <iant@google.com>
8096
8097 PR 11866
8098 * output.cc (Output_segment::set_offset): Search for the first and
8099 last sections rather than assuming that the list is in order.
8100 (Output_segment::find_first_and_last_list): New function.
8101 * output.h (class Output_segment): Update declarations.
8102 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8103 (relro_strip_test_SOURCES): New variable.
8104 (relro_strip_test_DEPENDENCIES): New variable.
8105 (relro_strip_test_LDFLAGS): New variable.
8106 (relro_strip_test_LDADD): New variable.
8107 (relro_strip_test.so): New target.
8108
a8df5856
ILT
81092010-08-02 Ian Lance Taylor <iant@google.com>
8110
8111 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8112 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8113 (Target_i386::got_tlsdesc_section): New function.
8114 (Target_i386::got_section): Create space for GOT entries for
8115 TLSDESC relocations.
8116 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8117 R_386_TLS_GOTDESC.
8118 (Target_i386::Scan::global): Likewise.
8119 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8120 using TLSDESC GOT.
8121 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8122 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8123 (Target_x86_64::got_tlsdesc_section): New function.
8124 (Target_x86_64::got_section): Create space for GOT entries for
8125 TLSDESC relocations.
8126 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8127 R_386_TLS_GOTDESC.
8128 (Target_x86_64::Scan::global): Likewise.
8129 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8130 using TLSDESC GOT.
8131
0c10a0a6
ILT
81322010-08-02 Ian Lance Taylor <iant@google.com>
8133
8134 * testsuite/final_layout.sh: Use dc to convert from hex to
8135 decimal.
8136
41cbeecc
ST
81372010-07-29 Sriraman Tallam <tmsriram@google.com>
8138
8139 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8140 paramter to the call to gold::gc_process_relocs.
8141 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8142 paramter to the call to gold::gc_process_relocs.
8143 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8144 parameter to the call to gold::gc_process_relocs.
8145 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8146 template parameter to the call to gold::gc_process_relocs.
8147 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8148 paramter to the call to gold::gc_process_relocs.
8149 * gc.h (get_embedded_addend_size): New function.
8150 (gc_process_relocs): Save the size of the reloc for use by ICF.
8151 * icf.cc (get_section_contents): Get the addend from the text section
8152 for SHT_REL relocation sections.
8153 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8154 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8155 * int_encoding.h (read_from_pointer): New overloaded function.
8156 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8157 * testsuite/icf_sht_rel_addend_test.sh: New file.
8158 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8159 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8160
6ea55b82
RW
81612010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8162
8163 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8164 * Makefile.in: Regenerate.
8165 * testsuite/Makefile.in: Regenerate.
8166
9691462b
ILT
81672010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8168
8169 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8170 * gold/testsuite/debug_msg.cc: Likewise.
8171 * gold/testsuite/odr_violation1.cc
8172 * gold/testsuite/odr_violation2.cc
8173
76897331
CC
81742010-07-21 Cary Coutant <ccoutant@google.com>
8175
8176 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8177 string, and length fields.
8178 (Output_merge_string::Merged_strings_list): New type.
8179 (Output_merge_string::Merged_strings_lists): New typedef.
8180 (Output_merge_string): Replace merged_strings_ with
8181 merged_strings_lists_.
8182 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8183 Merged_strings_list per input object and section. Don't store pointer
8184 to the string. Don't store length with each merged string entry.
8185 (Output_merge_string::finalize_merged_data): Loop over list of merged
8186 strings lists. Recompute length of each merged string.
8187
78384e8f
CC
81882010-07-15 Cary Coutant <ccoutant@google.com>
8189
8190 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8191 here.
8192
783659f9
ILT
81932010-07-14 Ian Lance Taylor <iant@google.com>
8194
8195 * descriptors.cc (Descriptors::open): Report correct name in error
8196 message.
8197
131687b4
DK
81982010-07-13 Doug Kwan <dougkwan@google.com>
8199
8200 * arm.cc (Arm_input_section::Arm_input_section): For a
8201 SHT_ARM_EXIDX section, always keeps the input sections.
8202 (Arm_input_section::set_exidx_section_link): New method.
8203 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8204 has_errors_ to false.
8205 (Arm_exidx_input_section::has_errors,
8206 Arm_exidx_input_section::set_has_errors): New methods.
8207 (Arm_exidx_input_section::has_errors_): New data member.
8208 (Arm_relobj::get_exidx_shndx_list): New method.
8209 (Arm_output_section::append_text_sections_to_list): Do not skip
8210 section without SHF_EXECINSTR.
8211 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8212 errors.
2e702c99 8213 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8214 section header. Make error messages more verbose. Check for
8215 a non-executable section linked to an EXIDX section.
8216 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8217 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8218 check that there is no deferred EXIDX section if we exit early.
8219 Instead of not making an EXIDX section in case of an error, make one
8220 and set the has_errors flag of it.
8221 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8222 in a relocatable link.
8223 (Target_arm::do_relax): Look for the EXIDX output section instead of
8224 assuming that it is called .ARM.exidx.
2e702c99 8225 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8226 section list. Do not check for SHF_EXECINSTR section flags but
8227 skip any input section with errors.
8228 * output.cc (Output_section::Output_section): Initialize
8229 always_keeps_input_sections_ to false.
8230 (Output_section::add_input_section): Check for
8231 always_keeps_input_sections_.
8232 * output.h (Output_section::always_keeps_input_sections,
8233 Output_section::set_always_keeps_input_sections): New methods.
8234 (Output_section::always_keeps_input_sections): New data member.
8235
69517287
RÁE
82362010-07-13 Rafael Espindola <espindola@google.com>
8237
8238 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8239 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8240
82742395
ILT
82412010-07-13 Philip Herron <herron.philip@googlemail.com>
8242 Ian Lance Taylor <iant@google.com>
8243
8244 * output.h (Output_section_lookup_maps::add_merge_section):
8245 Correct check of whether value was inserted.
8246 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8247 (Output_section_lookup_maps::add_relaxed_input_section):
8248 Likewise.
8249 * arm.cc (Target_arm::got_section): Remove used local os.
8250 * i386.cc (Target_i386::got_section): Likewise.
8251 * x86_64.cc (Target_x86_64::got_section): Likewise.
8252 * sparc.cc (Target_sparc::got_section): Likewise.
8253 (Target_sparc::relocate): Remove unused local have_got_offset.
8254 * powerpc.cc (Target_powerpc::relocate): Likewise.
8255
f2d707b5
ILT
82562010-07-13 Ian Lance Taylor <iant@google.com>
8257
241531d6
ILT
8258 * compressed_output.cc (zlib_decompress): Fix signature in
8259 !HAVE_ZLIB_H case.
8260
f2d707b5
ILT
8261 * archive.cc (Archive::include_member): Unlock an external member
8262 of a thin archive. Don't bother to delete an object we know is
8263 NULL.
8264
a2e47362
CC
82652010-07-12 Cary Coutant <ccoutant@google.com>
8266
8267 * compressed_output.cc (zlib_decompress): New function.
8268 (get_uncompressed_size): New function.
8269 (decompress_input_section): New function.
8270 * compressed_output.h (get_uncompressed_size): New function.
8271 (decompress_input_section): New function.
8272 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8273 Handle compressed debug sections.
8274 * layout.cc (is_compressed_debug_section): New function.
8275 (Layout::output_section_name): Map compressed section names to
8276 canonical names.
8277 * layout.h (is_compressed_debug_section): New function.
8278 (is_debug_info_section): Recognize compressed debug sections.
8279 * merge.cc: Include compressed_output.h.
8280 (Output_merge_data::do_add_input_section): Handle compressed
8281 debug sections.
8282 (Output_merge_string::do_add_input_section): Handle compressed
8283 debug sections.
8284 * object.cc: Include compressed_output.h.
8285 (Sized_relobj::Sized_relobj): Initialize new data members.
8286 (build_compressed_section_map): New function.
8287 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8288 * object.h (Object::section_is_compressed): New method.
8289 (Object::do_section_is_compressed): New method.
8290 (Sized_relobj::Compressed_section_map): New type.
8291 (Sized_relobj::do_section_is_compressed): New method.
8292 (Sized_relobj::compressed_sections_): New data member.
8293 * output.cc (Output_section::add_input_section): Handle compressed
8294 debug sections.
8295 * reloc.cc: Include compressed_output.h.
8296 (Sized_relobj::write_sections): Handle compressed debug sections.
8297
ce279a62
CC
82982010-07-08 Cary Coutant <ccoutant@google.com>
8299
8300 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8301 weak when resolving to a dynamic def.
8302 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8303 for weak undef/dynamic def cases. Adjust callers.
8304 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8305 undef_binding_weak_.
8306 (Symbol_table::sized_write_globals): Adjust symbol binding.
8307 (Symbol_table::sized_write_symbol): Add binding parameter.
8308 * symtab.h (Symbol::set_undef_binding): New method.
8309 (Symbol::is_undef_binding_weak): New method.
8310 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8311 (Symbol_table::should_override): Add new parameter.
8312 (Symbol_table::sized_write_symbol): Add new parameter.
8313
8314 * testsuite/weak_undef_file1.cc: Add new test case.
8315 * testsuite/weak_undef_file2.cc: Fix header comment.
8316 * testsuite/weak_undef_test.cc: Add new test case.
8317
b2286c10
DK
83182010-06-29 Doug Kwan <dougkwan@google.com>
8319
8320 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8321 Initialize USE_SYMBOL_.
8322 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8323 definition.
8324 (Arm_reloc_property::uses_symbol_): New data member declaration.
8325 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8326 uses symbol value and symbol is undefined but not weakly undefined.
8327
4802450a
RÁE
83282010-06-28 Rafael Espindola <espindola@google.com>
8329
8330 * plugin.cc (Plugin::load): Use dlerror.
8331
e5ca47ba
ILT
83322010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8333
8334 * symtab.cc (detect_odr_violations): When reporting an ODR
8335 violation, report an object where the symbol is defined.
8336
8a75a161
DK
83372010-06-25 Doug Kwan <dougkwan@google.com>
8338
8339 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8340 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8341 definition.
8342 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8343 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8344 target hook to detect function points.
8345 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8346 * icf.h (Icf::check_section_for_function_pointers): Change type of
8347 parameter SECTION_NAME to const reference to std::string. Use
8348 target hook to determine if section may have unsafe pointers.
8349 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8350 method definition.
8351
42218b9f
RÁE
83522010-06-21 Rafael Espindola <espindola@google.com>
8353
8354 * fileread.cc (Input_file::find_fie): New
8355 (Input_file::open): Use Input_file::find_fie.
8356 * fileread.h (Input_file::find_fie): New
8357 * plugin.cc (set_extra_library_path): New.
8358 (Plugin::load): Add set_extra_library_path to the transfer vector.
8359 (Plugin_manager::set_extra_library_path): New.
8360 (Plugin_manager::add_input_file): Use the extra search path if set.
8361 (set_extra_library_path(): New.
8362 * plugin.h (Plugin_manager): Add set_extra_library_path and
8363 extra_search_path_.
8364
a0506cca
CC
83652010-06-19 Cary Coutant <ccoutant@google.com>
8366
8367 * layout.cc (gdb_sections): Add .debug_types.
8368 (lines_only_debug_sections): Likewise.
8369
6508b958
RÁE
83702010-06-18 Rafael Espindola <espindola@google.com>
8371
8372 * plugin.cc (add_input_file,add_input_library)
8373 (Plugin_manager::add_input_file): Make filename arguments const.
8374 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8375 const.
8376
3e235302
DK
83772010-06-16 Doug Kwan <dougkwan@google.com>
8378
8379 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8380 .ARM.attributes section if we have not merged any input
8381 attributes sections.
8382
106e8a6c
DK
83832010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8384
8385 * arm.cc: Allow combining objects with no EABI version
8386 information.
8387
91ff43fe
RÁE
83882010-06-15 Rafael Espindola <espindola@google.com>
8389
8390 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8391
68ed838c
ILT
83922010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8393
8394 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8395 (struct iovec): Correct !HAVE_READV definition.
8396
f3a2388f
CC
83972010-06-10 Cary Coutant <ccoutant@google.com>
8398
8399 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8400 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8401 reloc sections.
8402 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8403
8404 PR 11683
8405 * symtab.h (Symbol::is_placeholder): New member function.
8406 * target-reloc.h (relocate_section): Check for placeholder symbols.
8407
8408 * testsuite/Makefile.am (plugin_test_8): New test.
8409 (plugin_test_9): New test.
8410 * testsuite/Makefile.in: Regenerate.
8411
e1df38aa
NC
84122010-06-09 Nick Clifton <nickc@redhat.com>
8413
8414 * yyscript.y (input_list_element): Allow strings prefixed with
8415 the '-' character. Treat these as libraries.
8416 * script.cc (script_add_library): New function. Adds a library
8417 specified by "-l<name>" found in an input script.
8418 * script-c.h: Add prototype for script_add_library.
8419
25bbe950
DK
84202010-06-07 Doug Kwan <dougkwan@google.com>
8421
8422 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8423 Restrict stub-group size to be within long conditional branch
8424 range when working around cortex-A8 erratum.
8425
0f32ea4c
ILT
84262010-06-07 Damien Diederen <dd@crosstwine.com>
8427
8428 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8429 #ifdef typo.
8430
8fe2a369
ST
84312010-06-03 Sriraman Tallam <tmsriram@google.com>
8432
8433 PR gold/11658
8434 * output.cc
8435 (Output_section::Input_section_sort_entry::compare_section_ordering):
8436 Change to return non-zero correctly.
8437 (Output_section::Input_section_sort_section_order_index_compare
8438 ::operator()): Change to fix ambiguity in comparisons.
8439
6e9ba2ca
ST
84402010-06-01 Sriraman Tallam <tmsriram@google.com>
8441
8442 * gold.h (is_wildcard_string): New function.
8443 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8444 (Layout::layout_eh_frame): Ditto.
8445 (Layout::find_section_order_index): New method.
8446 (Layout::read_layout_from_file): New method.
8447 * layout.h (Layout::find_section_order_index): New method.
8448 (Layout::read_layout_from_file): New method.
8449 (Layout::input_section_position_): New private member.
8450 (Layout::input_section_glob_): New private member.
8451 * main.cc (main): Call read_layout_from_file here.
8452 * options.h (--section-ordering-file): New option.
8453 * output.cc (Output_section::input_section_order_specified_): New
8454 member.
8455 (Output_section::Output_section): Initialize new member.
8456 (Output_section::add_input_section): Add new parameter.
8457 Keep input sections when --section-ordering-file is used.
8458 (Output_section::set_final_data_size): Sort input sections when
8459 section ordering file is specified.
8460 (Output_section::Input_section_sort_entry): Add new parameter.
8461 Check sorting type.
8462 (Output_section::Input_section_sort_entry::compare_section_ordering):
8463 New method.
8464 (Output_section::Input_section_sort_compare::operator()): Change to
8465 consider section_order_index.
8466 (Output_section::Input_section_sort_init_fini_compare::operator()):
8467 Change to consider section_order_index.
8468 (Output_section::Input_section_sort_section_order_index_compare
8469 ::operator()): New method.
8470 (Output_section::sort_attached_input_sections): Change to sort
8471 according to section order when specified.
e1df38aa
NC
8472 (Output_section::add_input_section<32, true>): Add new parameter.
8473 (Output_section::add_input_section<64, true>): Add new parameter.
8474 (Output_section::add_input_section<32, false>): Add new parameter.
8475 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8476 * output.h (Output_section::add_input_section): Add new parameter.
8477 (Output_section::input_section_order_specified): New
8478 method.
8479 (Output_section::set_input_section_order_specified): New method.
8480 (Input_section::Input_section): Initialize section_order_index_.
8481 (Input_section::section_order_index): New method.
8482 (Input_section::set_section_order_index): New method.
8483 (Input_section::section_order_index_): New member.
8484 (Input_section::Input_section_sort_section_order_index_compare): New
8485 struct.
8486 (Output_section::input_section_order_specified_): New member.
8487 * script-sections.cc (is_wildcard_string): Delete and move modified
8488 method to gold.h.
8489 (Output_section_element_input::Output_section_element_input): Modify
8490 call to is_wildcard_string.
8491 (Output_section_element_input::Input_section_pattern
8492 ::Input_section_pattern): Ditto.
8493 (Output_section_element_input::Output_section_element_input): Ditto.
8494 * testsuite/Makefile.am (final_layout): New test case.
8495 * testsuite/Makefile.in: Regenerate.
8496 * testsuite/final_layout.cc: New file.
8497 * testsuite/final_layout.sh: New file.
8498
3537c84b
RÁE
84992010-06-01 Rafael Espindola <espindola@google.com>
8500
8501 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8502
105b6afd
RÁE
85032010-06-01 Rafael Espindola <espindola@google.com>
8504
8505 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8506 visibility of symbols.
8507
29e11421
DK
85082010-05-27 Doug Kwan <dougkwan@google.com>
8509
8510 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8511 from start of output section instead of address for a local symbol
8512 in a merged or relaxed section when doing a relocatable link.
8513
5e0f337e
RÁE
85142010-05-26 Rafael Espindola <espindola@google.com>
8515
703d02da 8516 PR 11604
5e0f337e
RÁE
8517 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8518 adding sections the garbage collector removed.
8519 * gold/testsuite/Makefile.am: Add test.
8520 * gold/testsuite/Makefile.in: Regenerate.
8521 * gold/testsuite/plugin_test_7.sh: New.
8522 * gold/testsuite/plugin_test_7_1.c: New.
8523 * gold/testsuite/plugin_test_7_2.c: New.
8524
f4187277
RÁE
85252010-05-26 Rafael Espindola <espindola@google.com>
8526
8527 * script-sections.cc (Output_section_definition::set_section_addresses):
8528 Check for --section-start.
8529
5c388529
DK
85302010-05-26 Doug Kwan <dougkwan@google.com>
8531
8532 * arm.cc (Arm_scan_relocatable_relocs): New class.
8533 (Target_arm::relocate_special_relocatable): New method.
8534 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8535 (Arm_relocate_functions::thumb_branch_common): Same.
8536 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8537 instead of Default_scan_relocatable_relocs.
8538 * target-reloc.h (relocate_for_relocatable): Let target handle
8539 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8540 * target.h (Sized_target::relocate_special_relocatable): New method.
8541
bca1c3ae
ILT
85422010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8543
8544 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8545
0439c796
DK
85462010-05-23 Doug Kwan <dougkwan@google.com>
8547
8548 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8549 instead of a cast.
8550 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8551 with a direct branch, not a conditional branch, to a stub.
8552 * merge.cc (Output_merge_base::record_input_section): New method
8553 defintion.
8554 (Output_merge_data::do_add_input_section): Record input section if
8555 keeps-input-sections flag is set.
8556 (Output_merge_string::do_add_input_section): Ditto.
8557 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8558 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8559 INPUT_SECTIONS_.
8560 (Output_merge_base::keeps_input_sections,
8561 Output_merge_base::set_keeps_input_sections,
8562 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8563 method definitions.
8564 (Output_merge_base::Input_sections): New type declaration.
8565 (Output_merge_base::input_sections_begin,
8566 Output_merge_base::input_sections_end,
8567 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8568 (Output_merge_base::bool keeps_input_sections_,
8569 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8570 Output_merge_base::input_sections_): New data members.
8571 (Output_merge_data::do_set_keeps_input_sections): New method
8572 defintion.
8573 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8574 * output.cc (Output_section::Input_section::relobj): Move method
8575 defintion from class declaration to here and handle merge sections.
8576 (Output_section::Input_section::shndx): Ditto.
8577 (Output_section::Output_section): Remove initializations of removed
8578 data members and initialize new data member LOOKUP_MAPS_.
8579 (Output_section::add_input_section): Set keeps-input-sections flag
8580 for a newly created merge output section as appropriate. Adjust code
8581 to use Output_section_lookup_maps class.
8582 (Output_section::add_relaxed_input_section): Adjst code for lookup
8583 maps code refactoring.
2e702c99 8584 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8585 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8586 class. If adding input section to a newly created merge output
8587 section fails, remove the new merge section.
8588 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8589 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8590 (Output_section::find_merge_section): Ditto.
0439c796 8591 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8592 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8593 Output_section_lookup_maps class.
8594 (Output_section::get_input_sections): Export merge sections. Adjust
8595 code to use Output_section_lookup_maps class.
8596 (Output_section:::add_script_input_section): Adjust code to use
8597 Output_section_lookup_maps class. Update lookup maps for merge
8598 sections also.
8599 (Output_section::discard_states): Use Output_section_lookup_maps.
8600 (Output_section::restore_states): Same.
8601 * output.h (Merge_section_properties): Move class defintion out of
8602 Output_section.
8603 (Output_section_lookup_maps): New class.
8604 (Output_section::Input_section::is_merge_section): New method
8605 defintion.
8606 (Output_section::Input_section::relobj): Move defintion out of class
8607 defintion. Declare method only.
8608 (Output_section::Input_section::shndx): Ditto.
8609 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8610 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8611 (Output_section::Merge_section_by_properties_map,
8612 Output_section::Output_section_data_by_input_section_map,
8613 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8614 Remove types.
2e702c99 8615 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8616 KEEPS_INPUT_SECTIONS.
8617 (Output_section::build_lookup_maps): New method declaration.
8618 (Output_section::merge_section_map_,
8619 Output_section::merge_section_by_properties_map_,
8620 Output_section::relaxed_input_section_map_,
8621 Output_section::is_relaxed_input_section_map_valid_): Remove data
8622 members.
8623 (Output_section::lookup_maps_): New data member.
8624
76295588
L
86252010-05-21 Doug Kwan <dougkwan@google.com>
8626
8627 PR gold/11619
8628 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8629 avoid a compilation error.
8630
d103a984
RÁE
86312010-05-19 Rafael Espindola <espindola@google.com>
8632
8633 * script-sections.cc (Output_section_definition::allocate_to_segment):
8634 Update the phdrs_list even when the output section is NULL.
8635 * testsuite/Makefile.am: Add test.
8636 * testsuite/Makefile.in: Regenerate.
8637 * testsuite/script_test_9.cc: New.
8638 * testsuite/script_test_9.sh: New.
8639 * testsuite/script_test_9.t: New.
8640
6625d24e
DK
86412010-05-19 Doug Kwan <dougkwan@google.com>
8642
8643 * arm.cc (Arm_input_section::original_size): New method.
8644 (Arm_input_section::do_addralign): Add a cast.
8645 (Arm_input_section::do_output_offset): Remove static cast.
8646 (Arm_input_section::original_addralign,
8647 Arm_input_section::original_size_): Change type to uint32_t.
8648 (Arm_input_section::init): Add safe casts for section alignment
8649 and size.
8650 (Arm_input_section::set_final_data_size): Do not set address and
8651 offset of stub table.
8652 (Arm_output_section::fix_exidx_coverage): Change use of of
8653 Output_section::Simple_input_section to that of
8654 Output_section::Input_section.
8655 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8656 except for the first pass.
8657 * output.cc (Output_section::get_input_sections): Change type of
8658 input_sections to std::list<Input_section>.
8659 (Output_section::add_script_input_section): Rename from
8660 Output_section::add_simple_input_section. Change type of SIS
8661 parameter from Simple_input_section to Input_section.
8662 * output.h (Output_section::Simple_input_section): Remove class.
8663 (Output_section::Input_section): Change class visibility to public.
8664 (Output_section::Input_section::addralign): Use stored alignments
8665 for special input sections if set.
8666 (Output_section::Input_section::set_addralign): New method.
8667 (Output_section::get_input_sections): Change parameter type from
8668 list of Simple_input_section to list of Input_section.
8669 (Output_section::add_script_input_section): Rename from
8670 Output_section::add_simple_input_section. Change first parameter's
8671 type from Simple_input_section to Input_section and remove the
8672 second and third parameters.
8673 * script-sections.cc (Input_section::Input_section_list): Change
8674 type to list of Output_section::Input_section/
8675 (Input_section_info::Input_section_info): Change parameter type of
8676 INPUT_SECTION to Output_section::Input_section.
8677 (Input_section_info::input_section): Change return type.
8678 (Input_section_info::input_section_): Change type to
8679 Output_section::Input_section.
8680 (Output_section_element_input::set_section_addresses): Adjust code
8681 to use Output_section::Input_section instead of
8682 Output_section::Simple_input_section. Adjust code for renaming
8683 of Output_section::add_simple_input_section.
8684 (Orphan_output_section::set_section_addresses): Ditto.
8685
e1e82ea4
RW
86862010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8687
8688 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8689 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8690
91e75c8a
RÁE
86912010-05-18 Rafael Espindola <espindola@google.com>
8692
8693 * options.cc (General_options::finalize): Handle -nostdlib.
8694 * options.h (nostdlib): New option.
8695 * script.cc (script_add_search_dir): Handle -nostdlib.
8696
da59ad79
DK
86972010-05-12 Doug Kwan <dougkwan@google.com>
8698
8699 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8700 attributes section only if there no attributes section after merging.
8701 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8702 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8703 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8704 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8705 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8706 and arm_attr_merge_7.stdout.
8707 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8708 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8709 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8710 arm_attr_merge_7b.o): New rules.
8711 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8712 arm_attr_merge_7
8713 * testsuite/Makefile.in: Regenerate.
8714 * testsuite/arm_attr_merge.sh: New file.
8715 * testsuite/arm_attr_merge_[67][ab].s: Same.
8716
3e01a7fd
NC
87172010-05-05 Nick Clifton <nickc@redhat.com>
8718
8719 * po/es.po: Updated Spanish translation.
8720
7ad2014a
L
87212010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8722
8723 * Makefile.am (install-exec-local): Properly install gold as
8724 default cross linker.
8725 * Makefile.in: Regenerated.
8726
4fda8867
NC
87272010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8728 Nick Clifton <nickc@redhat.com>
8729
8730 * configure.ac (install_as_default): Define and set to false
8731 unless --enable-gold or --enable-gold=both/gold has been
8732 specified.
8733 * configure: Regenerate.
8734
8735 * Makefile.am (install-exec-local): Install the executable as
8736 'ld.gold'. If install_as_default is true then also install it as
8737 'ld'.
8738 * Makefile.in: Regenerated.
8739
bd288ea2
ILT
87402010-04-24 Ian Lance Taylor <iant@google.com>
8741
8742 * layout.cc (Layout::layout_reloc): In relocatable link don't
8743 combine reloc sections for grouped sections.
8744
ef38fd8a
ST
87452010-04-23 Sriraman Tallam <tmsriram@google.com>
8746
8747 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8748 sections that are not ordinary to icf.
8749 * icf.cc (get_section_contents): Handle relocation pointing to section
8750 with no object or shndx information.
8751 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8752 * testsuite/Makefile.in: Regenerate.
8753 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8754 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8755
f6973bdc
ILT
87562010-04-22 Ian Lance Taylor <iant@google.com>
8757
8758 * expression.cc (Expression::Expression_eval_info): Add
8759 result_alignment_pointer field.
8760 (Expression::eval_with_dot): Add result_alignment_pointer
8761 parameter. Change all callers.
8762 (Expression::eval_maybe_dot): Likewise.
8763 (class Binary_expression): Add alignment_pointer parameter to
8764 left_value and right_value. Change all callers.
8765 (BINARY_EXPRESSION): Set result alignment.
8766 (class Trinary_expression): Add alignment_pointer parameter to
8767 arg2_value and arg3_value. Change all callers.
8768 (Trinary_cond::value): Set result alignment.
8769 (Max_expression::value, Min_expression::value): Likewise.
8770 (Align_expression::value): Likewise.
8771 * script-sections.cc (class Sections_element): Add dot_alignment
8772 parameter to set_section_addresses virtual function. Update
8773 instantiations.
8774 (class Output_section_element): Likewise.
8775 (Script_sections::create_segments): Add dot_alignment parameter.
8776 Change all callers.
8777 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8778 (Script_sections::set_phdrs_clause_addresses): Likewise.
8779 * script-sections.h: Update declarations.
8780 * script.h: Update declarations.
8781 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8782 min_p_align.
8783 * testsuite/script_test_3.t: Set large alignment.
8784 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8785 segment has expected alignment.
8786
9c9c98a5
NC
87872010-04-22 Nick Clifton <nickc@redhat.com>
8788
8789 * po/gold.pot: Updated by the Translation project.
8790 * po/vi.po: Updated Vietnamese translation.
8791
2253bfba
L
87922010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8793
8794 * testsuite/Makefile.am (check_PROGRAMS): Add
8795 icf_virtual_function_folding_test.
8796 * testsuite/Makefile.in: Regenerated.
8797
85fdf906
AH
87982010-04-15 Andrew Haley <aph@redhat.com>
8799
8800 * options.h (merge_exidx_entries): New option.
8801 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8802 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8803 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8804 (Target_arm::merge_exidx_entries): New function.
8805 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8806 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8807 to Arm_exidx_fixup constructor.
8808 Add new arg, merge_exidx_entries.
8809 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8810 Arm_output_section::fix_exidx_coverage.
8811
ce97fa81
ST
88122010-04-18 Sriraman Tallam <tmsriram@google.com>
8813
8814 * icf.cc (get_section_contents): Check for preemptible functions.
8815 Ignore addend when appropriate.
8816 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8817 section folded.
8818 (add_from_relobj): Check for section folded.
8819 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8820 * symtab.h (should_add_dynsym_entry): Add new parameter.
8821 * target-reloc.h (scan_relocs): Check for section folded.
8822 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8823 Check reloc types for function pointers in shared objects.
8824 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8825 case.
8826 (icf_preemptible_functions_test): New test case.
8827 (icf_string_merge_test): New test case.
8828 * testsuite.Makefile.in: Regenerate.
8829 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8830 bar_glob. Refactor code.
8831 * testsuite/icf_preemptible_functions_test.cc: New file.
8832 * testsuite/icf_preemptible_functions_test.sh: New file.
8833 * testsuite/icf_string_merge_test.cc: New file.
8834 * testsuite/icf_string_merge_test.sh: New file.
8835 * testsuite/icf_virtual_function_folding_test.cc: New file.
8836 * testsuite/icf_virtual_function_folding_test.sh: New file.
8837
04ceb17c
DK
88382010-04-14 Doug Kwan <dougkwan@google.com>
8839
8840 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8841 for local symbol recounting if we remove a section due to ICF.
8842 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8843 there are no regular objects in input.
8844
153e7da4
DK
88452010-04-13 Doug Kwan <dougkwan@google.com>
8846
8847 * arm.cc (Arm_input_section::set_final_data_size): Compute
8848 accurate final data size instead of using current data size.
8849
4dbd9faf
DK
88502010-04-09 Doug Kwan <dougkwan@google.com>
8851
8852 * layout.cc (Layout::choose_output_section): Handle script section
8853 types.
8854 (Layout::make_output_section_for_script): Add section type parameter.
8855 Handle script section types.
8856 * layout.h (Layout::make_output_section_for_script): Add section
8857 type parameter.
8858 * output.cc (Output_section::Output_section): Initialize data member
8859 is_noload_.
8860 (Output_section::do_reset_address_and_file_offset): Do not set address
8861 to 0 if section is a NOLOAD section.
8862 * output.h (Output_section::is_noload): New method.
8863 (Output_section::set_is_noload): Ditto.
8864 (Output_section::is_noload_): New data member.
8865 * script-c.h (Script_section_type): New enum type.
8866 (struct Parser_output_section_header): Add new file section_type.
8867 * script-sections.cc (Sections_element::output_section_name): Add
8868 parameter for returning script section type.
8869 (Output_section_definition::output_section_name): Ditto.
8870 (Output_section_definition::section_type)P; New method.
8871 (Output_section_definiton::script_section_type_name): Ditto.
8872 (Output_section_definition::script_section_type_): New data member.
8873 (Output_section_definition::Output_section_definition): Initialize
8874 data member Output_section_definition::script_section_type_.
8875 (Output_section_definition::create_sections): Pass script section type
8876 to Layout::make_output_section_for_script.
8877 (Output_section_definition::output_section_name): Return script
8878 section type to caller.
8879 (Output_section_definition::set_section_address): Do not advance
8880 dot value and load address if section type is NOLOAD. Set address
8881 of NOLOAD sections regardless of section flags.
8882 (Output_section_definition::print): Print section type if it is
8883 not SCRIPT_SECTION_TYPE_NONE.
8884 (Output_section_definition::section_type): New method.
8885 (Output_section_definition::script_section_type_name): Ditto.
8886 (Script_sections::output_section_name): Add new parameter
8887 PSECTION_TYPE for returning script section type. Pass it to
8888 section elements. Handle discard sections.
8889 (Sort_output_sections::operator()): Handle NOLOAD sections.
8890 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8891 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8892 returning script section type.
8893 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8894 INFO and NOLOAD.
8895 * yyscript.y (union): Add new field SECTION_TYPE.
8896 (COPY, DSECT, INFO, NOLOAD): New tokens.
8897 (opt_address_and_section_type): Change type to output_section_header.
8898 (section_type): New non-terminal
8899 (section_header): Handle section type.
2253bfba 8900 (opt_address_and_section_type): Return section type value.
4dbd9faf 8901
721ea635
L
89022010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8903
8904 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8905 * testsuite/plugin_common_test_2.c (foo): Likewise.
8906
6bf924b0
DK
89072010-04-08 Doug Kwan <dougkwan@google.com>
8908
8909 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8910 Output_merge_data.
8911 * output.cc (Output_section::add_merge_input_section): Simplify
8912 code and return status of Output_merge_base::add_input_section.
e1df38aa 8913 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8914 returns true.
8915
24af6f92
DK
89162010-04-07 Doug Kwan <dougkwan@google.com>
8917
8918 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8919 if section is marked as containing instructions but has no mapping
8920 symbols.
8921 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8922 correct section index.
8923 (Arm_relobj::find_linked_text_section): Ditto.
8924
00698fc5
CC
89252010-04-07 Cary Coutant <ccoutant@google.com>
8926
8927 * archive.cc (include_member): Destroy Read_symbols_data object before
8928 releasing file.
8929 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8930 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8931 (Read_symbols_data::~Read_symbols_data) New destructor.
8932 (Section_relocs::Section_relocs) New constructor.
8933 (Section_relocs::~Section_relocs) New destructor.
8934 (Read_relocs_data::Read_relocs_data) New constructor.
8935 (Read_relocs_data::~Read_relocs_data) New destructor.
8936 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8937 pointers to NULL after deleting.
8938
7296d933
DK
89392010-04-07 Doug Kwan <dougkwan@google.com>
8940
8941 * arm.cc: Replace "endianity" with "endianness" in comments.
8942 (Arm_exidx_cantunwind): Ditto.
8943 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8944 (Arm_relobj::merge_flags_and_attributes): New method.
8945 (Arm_relobj::merge_flags_and_attributes_): New data member.
8946 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8947 (Arm_relobj::scan_sections_for_stubs): Ditto.
8948 (Arm_relobj::do_read_symbols): Check to see if we really want to
8949 merge processor-specific flags and attributes. Exit early if
8950 an object is empty except for section names and the undefined symbol.
8951 (Target_arm::do_finalize_sections): Move check for ELF format to
8952 Arm_relobj::do_read_symbols. Merge processor specific flags and
8953 attributes from a regular object only when we have determined that
8954 it is aapropriate. Do not create an .ARM.attributes section in
8955 output if there is no regular input object.
8956 (Target_arm::merge_processor_specific_flags): Check
8957 --warn-mismatch before printing any error.
8958 (Target_arm::merge_object_attributes): Ditto.
8959 * gold.cc (queue_middle_tasks): Handle the case in which there is
8960 no regular object in input.
8961 * options.cc (General_options::parse_EB): New method.
8962 (General_options::parse_EL): Same.
8963 (General_options::General_options): Initialize endianness_.
8964 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8965 New options.
8966 (General_options::Endianness): New enum.
8967 (General_options::endianness): New method.
8968 (General_options::endianness_): New data member.
8969 * parameters.cc (Parameters::set_options): Check target endianness.
8970 (Parameters::set_target_once): Ditto.
8971 (Parameters::check_target_endianness): New method.
8972 (parameters_force_valid_target): If either -EL or -EB is specified,
8973 use it to define endianness of default target.
8974 * parameters.h (Parameters::check_target_endianness): New method
8975 declaration.
8976 * target.h (class Target): Change "endianity" to "endianness"
8977 in comments.
8978
efc8d4f2
RW
89792010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8980
8981 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8982 * configure: Regenerate.
8983 * Makefile.in: Regenerate.
8984 * testsuite/Makefile.in: Regenerate.
8985
be234d88
CC
89862010-04-06 Cary Coutant <ccoutant@google.com>
8987
8988 gcc PR lto/42757
8989 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8990 prevailing definitions of common symbols.
8991 * testsuite/plugin_test_6.sh: New test case.
8992 * testsuite/plugin_common_test_1.c: New test case.
8993 * testsuite/plugin_common_test_2.c: New test case.
8994 * testsuite/Makefile.am (plugin_test_6): New test case.
8995 * testsuite/Makefile.in: Regenerate.
8996
bd32c6bd
NC
89972010-04-06 Nick Clifton <nickc@redhat.com>
8998
8999 * po/vi.po: New Vietnamese translation.
9000
323c532f
DK
90012010-03-30 Doug Kwan <dougkwan@google.com>
9002
9003 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9004
4fcd97eb
DK
90052010-03-25 Doug Kwan <dougkwan@google.com>
9006
9007 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9008 to avoid a conversion warning on a 32-bit host.
9009
4ebf39db
ILT
90102010-03-24 Ian Lance Taylor <iant@google.com>
9011
9012 * testsuite/script_test_3.t: Add a TLS segment.
9013 * testsuite/Makefile.am (check_PROGRAMS): Add
9014 tls_phdrs_script_test.
9015 (tls_phdrs_script_test_SOURCES): Define.
9016 (tls_phdrs_script_test_DEPENDENCIES): Define.
9017 (tls_phdrs_script_test_LDFLAGS): Define.
9018 (tls_phdrs_script_test_LDADD): Define.
9019 * testsuite/Makefile.in: Rebuild.
9020
4a599bdd
CC
90212010-03-23 Cary Coutant <ccoutant@google.com>
9022
9023 * fileread.cc (find_or_make_view): Fix comment.
9024
6c93b22c
ILT
90252010-03-23 Ian Lance Taylor <iant@google.com>
9026
9027 * script-sections.cc (class Orphan_section_placement): Define
9028 PLACE_TLS and PLACE_TLS_BSS.
9029 (Orphan_section_placement::Orphan_section_placement): Initialize
9030 new places.
9031 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9032 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9033 (tls_script_test_SOURCES): Define.
9034 (tls_script_test_DEPENDENCIES): Define.
9035 (tls_script_test_LDFLAGS): Define.
9036 (tls_script_test_LDADD): Define.
9037 * testsuite/Makefile.in: Rebuild.
9038
a2c7281b
DK
90392010-03-22 Doug Kwan <dougkwan@google.com>
9040
9041 * arm.cc (Arm_relocate_functions::abs8,
9042 Arm_relocate_functions::abs16): Use correct check for overflow
9043 specified in the ARM ELF specs.
9044 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9045 target of a BLX instruction specially.
9046 (Reloc_stub::stub_type_for_reloc): Ditto.
9047 (Relocate::relocate): Use symbolic names instead of numeric relocation
9048 codes to report error.
9049 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9050 workaround.
9051 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9052 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9053 thumb2_blx_out_of_range.stdout
9054 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9055 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9056 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9057 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9058 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9059 thumb2_blx_in_range, thumb2_blx_in_range.o,
9060 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9061 thumb2_blx_out_of_range.o): New rules.
2e702c99 9062 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9063 thumb2_blx_in_range and thumb2_blx_out_of_range.
9064 * testsuite/Makefile.in: Regenerate.
9065 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9066 * testsuite/thumb_blx_in_range.s: New file.
9067 * testsuite/thumb_blx_out_of_range.s: New file.
9068
b0193076
RÁE
90692010-03-22 Rafael Espindola <espindola@google.com>
9070
9071 * archive.cc (Should_include): Move to archive.h.
9072 (should_include_member): Make it a member of Archive.
9073 (Lib_group): New.
9074 (Add_lib_group_symbols): New.
9075 * archive.h: Include options.h.
9076 (Archive_member): Moved from Archive.
9077 (Should_include): Moved from archive.cc.
9078 (Lib_group): New.
9079 (Add_lib_group_symbols): New.
9080 * dynobj.cc (do_should_include_member): New.
9081 * dynobj.h (do_should_include_member): New.
9082 * gold.cc (queue_initial_tasks): Update call to queue.
9083 * main.cc (main): Print lib group stats.
9084 * object.cc (do_should_include_member): New.
9085 * object.h: Include archive.h.
9086 (Object::should_include_member): New.
9087 (Object::do_should_include_member): New.
9088 (Sized_relobj::do_should_include_member): New.
9089 * options.cc (General_options::parse_start_lib): New.
9090 (General_options::parse_end_lib): New.
9091 (Input_arguments::add_file): Handle lib groups.
9092 (Input_arguments::start_group): Check we are not in a lib.
9093 (Input_arguments::start_lib): New.
9094 (Input_arguments::end_lib): New.
9095 * options.h (General_options): Add start_lib and end_lib.
9096 (Input_argument::lib_): New.
9097 (Input_argument::lib): New.
9098 (Input_argument::is_lib): New.
9099 (Input_file_lib): New.
9100 (Input_arguments::in_lib_): New.
9101 (Input_arguments::in_lib): New.
9102 (Input_arguments::start_lib): New.
9103 (Input_arguments::end_lib_): New.
9104 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9105 in unused members as preempted.
9106 (Sized_pluginobj::do_should_include_member): New.
9107 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9108 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9109 return the blocker.
9110 (Read_symbols::do_whole_lib_group): New.
9111 (Read_symbols::do_lib_group): New.
9112 (Read_symbols::do_read_symbols): Handle lib groups.
9113 (Read_symbols::get_name): Handle lib groups.
9114 * readsyms.h (Read_symbols): Add an archive member pointer.
9115 (Read_symbols::do_whole_lib_group): New.
9116 (Read_symbols::do_lib_group): New.
9117 (Read_symbols::member_): New.
9118 * script.cc (read_input_script): Update call to queue_soon.
9119
d099120c
DK
91202010-03-19 Doug Kwan <dougkwan@google.com>
9121
9122 * arm.cc (Stub_table::Stub_table): Initialize new data members
9123 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9124 (Stub_table::add_reloc_stub): Assign stub offset and update
9125 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9126 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9127 New data members.
2e702c99 9128 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9129 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9130 instead of going over all reloc stubs.
2e702c99 9131 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9132 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9133 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9134 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9135 Stringpool_template::offset_.
9136 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9137 Stringpool_template::offset_ to zero.
9138
1aa37384
DK
91392010-03-15 Doug Kwan <dougkwan@google.com>
9140
9141 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9142 offset_.
9143 (Stringpool_template::new_key_offset): New method.
9144 (Stringpool_template::add_string): Assign offsets when adding new
9145 strings.
9146 (Stringpool_template::set_string_offsets): Do not set string offsets
9147 when not optimizing.
9148 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9149 member size_.
2e702c99
RM
9150 (Chunked_vector::clear): Clear size_.
9151 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9152 (Chunked_vector::size): Return size_.
9153 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9154 (Chunked_vector::size_): New data member.
1aa37384
DK
9155 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9156 (Stringpool_template::new_key_offset): New method declaration.
9157 (Stringpool_template::offset_): New data member.
9158
b672b057
RÁE
91592010-03-15 Rafael Espindola <espindola@google.com>
9160
9161 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9162 Add_symbols' constructor.
9163 * readsyms.h (Add_symbols): Remove the input_group member.
9164
b6848d3c
ILT
91652010-03-10 Ian Lance Taylor <iant@google.com>
9166
9167 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9168 target to ask whether a reference to a symbol requires a stack
9169 split.
9170 * target.h (Target::is_call_to_non_split): New function.
9171 (Target::do_is_call_to_non_split): Declare virtual function.
9172 * target.cc: Include "symtab.h".
9173 (Target::do_is_call_to_non_split): New function.
9174 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9175
a2a5469e
CC
91762010-03-10 Cary Coutant <ccoutant@google.com>
9177
9178 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9179 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9180 (File_read::open[2]): Add whole_file_view_ to list of views.
9181 (File_read::make_view): Remove test of whole_file_view_.
9182 (File_read::find_or_make_view): Create whole_file_view_ if
9183 necessary.
9184 (File_read::clear_views): Replace bool parameter with enum;
9185 adjust all callers. Don't delete views with permanent data;
9186 do delete cached views and views from archives if
9187 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9188 if clearing the corresponding view.
9189 * fileread.h (File_read::Clear_views_mode): New enum.
9190 (File_read::View::is_permanent_view): New method.
9191 (File_read::clear_views): Replace bool parameter
9192 with enum; adjust all callers.
9193 * options.h (General_options): Change keep_files_mapped option;
9194 add map_whole_files.
9195 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9196 releasing the file.
9197 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9198 the file.
9199
8861f32b
DM
92002010-03-10 David S. Miller <davem@davemloft.net>
9201
9202 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9203
d62d0f5f
ST
92042010-03-09 Sriraman Tallam <tmsriram@google.com>
9205
9206 * icf.cc (get_section_contents): Add '@' marker after processing the
9207 merge reloc.
9208
9177756d
DK
92092010-03-08 Doug Kwan <dougkwan@google.com>
9210
9211 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9212 due to a conversion warning.
9213 (Arm_relobj::update_output_local_symbol_count): Check for local
9214 symbol with unset output index.
9215
9e9e071b
ILT
92162010-03-05 Ian Lance Taylor <iant@google.com>
9217
9218 * options.h (class General_options): Add --spare-dynamic-tags.
9219 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9220 --spare-dynamic-tags.
9221
a81ee015
ILT
92222010-03-05 Ian Lance Taylor <iant@google.com>
9223
9224 * incremental.cc: Include "libiberty.h".
9225
44ec90b9
RO
92262010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9227
9228 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9229 function, is_info_ member.
9230 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9231 (Versions::Versions): Update caller.
9232 (Versions::define_base_version): Likewise.
9233 (Versions::add_def): Likewise.
9234
0897ed3b
ST
92352010-03-03 Sriraman Tallam <tmsriram@google.com>
9236
9237 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9238 (Scan::possible_function_pointer_reloc): New function.
9239 (Scan::local_reloc_may_be_function_pointer): Change to call
9240 possible_function_pointer_reloc.
9241 (Scan::global_reloc_may_be_function_pointer): Ditto.
9242 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9243 relocations in ".data.rel.ro._ZTV" section.
9244 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9245 * testsuite/icf_safe_so_test.cc: Ditto.
9246 * testsuite/icf_safe_test.cc: Ditto.
9247 * testsuite/icf_safe_test.sh: Ditto.
9248
d3bbad62
ILT
92492010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9250 Ian Lance Taylor <iant@google.com>
9251
9252 * target-reloc.h (relocate_section): Check the symbol table index
9253 for -1U before setting the local symbol index.
9254 (scan_relocatable_relocs): If copying the relocation, record that
9255 the local symbol is required.
9256 * object.h (Symbol_value::is_output_symtab_index_set): New
9257 function.
9258 (Symbol_value::may_be_discarded_from_output_symtab): New
9259 function.
9260 (Symbol_value::has_output_symtab_entry): New function.
9261 (Symbol_value::needs_output_symtab_entry): Remove.
9262 (Symbol_value::output_symtab_index): Make sure the symbol index is
9263 set.
9264 (Symbol_value::set_output_symtab_index): Make sure the symbol
9265 index is not set. Make sure the new index is valid.
9266 (Symbol_value::set_must_have_output_symtab_entry): New function.
9267 (Symbol_value::has_output_dynsym_entry): New function.
9268 (Symbol_value::set_output_dynsym_index): Make sure the new index
9269 is valid.
9270 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9271 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9272 local symbol if permitted.
9273 (Sized_relobj::do_finalize_local_symbols): Call
9274 is_output_symtab_index_set rather than needs_output_symtab_entry.
9275 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9276 rather than needs_output_symtab_entry. Call
9277 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9278 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9279 is_output_symtab_index_set rather than needs_output_symtab_entry.
9280 * testsuite/discard_locals_relocatable_test.c: New file.
9281 * testsuite/discard_locals_test.sh: Test -r.
9282 * testsuite/Makefile.am (check_DATA): Add
9283 discard_locals_relocatable_test1.syms,
9284 discard_local_relocatable_test2.syms.
9285 (MOSTLYCLEANFILES): Likewise. Also add
9286 discard_locals_relocatable_test1.lout and
9287 discard_locals_relocatable_test2.out.
9288 (discard_locals_relocatable_test1.syms): New target.
9289 (discard_locals_relocatable_test.o): New target.
9290 (discard_locals_relocatable_test1.out): New target.
9291 (discard_locals_relocatable_test2.syms): New target.
9292 (discard_locals_relocatable_test2.out): New target.
9293 (various): Add missing ../ld-new dependencies.
9294 * testsuite/Makefile.in: Rebuild.
9295
7e8ccf26
NC
92962010-03-03 Nick Clifton <nickc@redhat.com>
9297
9298 * po/fi.po: New Finnish translation.
9299
2a0ff005
DK
93002010-03-01 Doug Kwan <dougkwan@google.com>
9301
9302 * layout.cc (Layout::Layout): Force section types of .init_array*,
9303 .preinit_array* and .fini_array* sections.
9304 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9305 Fix check of return value of std::string::find.().
9306 (Output_section::Input_section_sort_compare::operator()): Remove
9307 comment about .init_array.
9308 (Output_section::Input_section_sort_init_fini_compare::operator()):
9309 New method.
9310 (Output_section::sort_attached_input_sections): Handle .init_array
9311 and .fini_array specially.
9312 * output.h (Output_section::Inut_section_sort_compare): Update
9313 comment.
9314 (Output_section::Input_section_sort_init_fini_compare): New struct.
9315
c3e4ae29
DK
93162010-02-26 Doug Kwan <dougkwan@google.com>
9317
9318 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9319 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9320 * testsuite/debug_msg.sh: Avoid matching source line number for
9321 use of global variable undef_int.
9322
2fd9ae7a
DK
93232010-02-26 Doug Kwan <dougkwan@google.com>
9324
9325 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9326 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9327 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9328 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9329 * options.cc (General_options::General_options): Initialize member
9330 fix_v4bx_.
9331 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9332 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9333 and rm_no_fix_v4bx.stdout
9334 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9335 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9336 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9337 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9338 and arm_no_fix_v4bx.
9339 * Makefile.in: Regenerate.
9340 * testsuite/arm_fix_v4bx.s: New file.
9341 * testsuite/arm_fix_v4bx.sh: Ditto.
9342
67ec7d0b
DK
93432010-02-24 Doug Kwan <dougkwan@google.com>
9344
9345 * arm.cc (Target_arm::got_section): Make the .got section the first
9346 non RELRO section in the data segment.
9347 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9348 suffixes of section names.
9349
10165461
DK
93502010-02-24 Doug Kwan <dougkwan@google.com>
9351
9352 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9353 flags and attributes merging if an input file is a binary file.
9354 * fileread.cc (Input_file::open): Record format of original file.
9355 * fileread.h (Input_file::Format): New enum type.
2e702c99 9356 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9357 (Input_file::format): New method definition.
9358 (Input_file::format_):: New data member.
9359
4a54abbb
DK
93602010-02-24 Doug Kwan <dougkwan@google.com>
9361
9362 * arm.cc (Arm_output_data_got): New class.
9363 (ARM_TCB_SIZE): New constant
9364 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9365 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9366 If user uses a script with a SECTIONS clause, issue only a warning
9367 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9368 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9369 garbage collection.
9370 (Target_arm::got_mode_index_entry): Handle static linking.
9371 (Target_arm::Scan::local): Ditto.
9372 (Target_arm::Scan::global): Ditto.
9373 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9374 all incorrectly implemented relocations.
e1df38aa 9375 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9376 Arm_output_section::fix_exidx_coverage.
9377 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9378 from ".ARM.exidx." and ".ARM.extab.".
9379
ca419a6f
ILT
93802010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9381
9382 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9383 section if it does not already exist.
9384 * attributes.cc (Attributes_section_data::Attributes_section_data):
9385 Don't crash if size is zero.
9386
135b9c78
ILT
93872010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9388 Ian Lance Taylor <iant@google.com>
9389
9390 * gold.cc (queue_middle_tasks): If no input files were opened,
9391 exit.
9392 * workqueue.h (Task_function::Task_function): Assert that there is
9393 a blocker.
9394
bb0bfe4f
DK
93952010-02-22 Doug Kwan <dougkwan@google.com>
9396
9397 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9398 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9399 types to avoid warnings due to different uint64_t implementations
9400 on different hosts.
9401
2a2b6d42
DK
94022010-02-21 Doug Kwan <dougkwan@google.com>
9403
9404 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9405 handling of the maximum backward branch offset.
2e702c99 9406 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9407 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9408 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9409 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9410 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9411 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9412 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9413 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9414 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9415 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9416 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9417 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9418 thumb2_bl_out_of_range.o): New rules.
9419 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9420 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9421 thumb2_bl_out_of_range
9422 * testsuite/Makefile.in: Regenerate.
9423 * testsuite/arm_bl_in_range.s: New file.
9424 * testsuite/arm_bl_out_of_range.s: Ditto.
9425 * testsuite/arm_branch_in_range.sh: Ditto.
9426 * testsuite/arm_branch_range.t: Ditto.
9427 * testsuite/thumb2_branch_range.t: Ditto.
9428 * testsuite/thumb_bl_in_range.s: Ditto.
9429 * testsuite/thumb_bl_out_of_range.s: Ditto.
9430 * testsuite/thumb_branch_range.t: Ditto.
9431
b487ad64
ST
94322010-02-20 Sriraman Tallam <tmsriram@google.com>
9433
9434 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9435 Add reloc offset information.
9436 * icf.cc (get_section_contents): Change iterators to point to the new
9437 vectors. Add reloc offset information to the contents.
9438 * icf.h (Icf::Sections_reachable_info): New typedef.
9439 (Icf::Sections_reachable_list): New typedef.
9440 (Icf::Offset_info): New typedef.
9441 (Icf::Reloc_info): New struct typedef.
9442 (Icf::Reloc_info_list): New typedef.
9443 (Icf::symbol_reloc_list): Delete method.
9444 (Icf::addend_reloc_list): Delete method.
9445 (Icf::section_reloc_list): Delete method.
9446 (Icf::reloc_info_list): New method.
9447 (Icf::reloc_info_list_): New member.
9448
f96accdf
DK
94492010-02-19 Doug Kwan <dougkwan@google.com>
9450
9451 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9452 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9453 * arm.cc (Arm_relocation_functions): New forward declaration.
9454 (Target_arm::Target_arm): Initialize new data members
9455 got_mod_index_offset_ and tls_base_symbol_defined_.
9456 (Target_arm::Relocate::relocate_tls): New method.
9457 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9458 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9459 New methods.
2e702c99 9460 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9461 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9462 (Target_arm::got_mod_index_offset_,
9463 Target_arm::tls_base_symbol_defined_): New data members.
9464 (Target_arm::Scan::local, Target::Scan::global,
9465 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9466 relocations.
9467
c8761b9a
DK
94682010-02-18 Doug Kwan <dougkwan@google.com>
9469
9470 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9471 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9472 text section as a parameter becuase some broken tools may not set
9473 the link in section header.
9474 (Target_arm::has_got_section): New method.
9475 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9476 without any mapping symbol as data only. Remove warning.
9477 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9478 link in its section header, try to discover the link by inspecting the
9479 REL31 relocation at the beginning of the section.
9480 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9481 in error message.
9482 (Target_arm::Scan::global): Treat any reference to the symbol
9483 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9484
21bb3914
ST
94852010-02-12 Sriraman Tallam <tmsriram@google.com>
9486
9487 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9488 (Scan::global_reloc_may_be_function_pointer): New function.
9489 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9490 (Scan::global_reloc_may_be_function_pointer): New function.
9491 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9492 (Scan::global_reloc_may_be_function_pointer): New function.
9493 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9494 (Scan::global_reloc_may_be_function_pointer): New function.
9495 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9496 (Scan::global_reloc_may_be_function_pointer): New function.
9497 (Scan::possible_function_pointer_reloc): New function.
9498 (Target_x86_64::can_check_for_function_pointers): New function.
9499 * gc.h (gc_process_relocs): Scan relocation types to determine if
9500 function pointers were taken for targets that support it.
9501 * icf.cc (Icf::find_identical_sections): Include functions for
9502 folding in safe ICF whose pointer is not taken.
9503 * icf.h (Secn_fptr_taken_set): New typedef.
9504 (fptr_section_id_): New member.
9505 (section_has_function_pointers): New function.
9506 (set_section_has_function_pointers): New function.
9507 (check_section_for_function_pointers): New function.
9508 * options.h: Fix comment for safe ICF option.
9509 * target.h (can_check_for_function_pointers): New function.
9510 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9511 Modify icf_safe_test for X86-64.
9512 * testsuite/Makefile.in: Regenerate.
9513 * testsuite/icf_safe_so_test.cc: New file.
9514 * testsuite/icf_safe_so_test.sh: New file.
9515 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9516 (main): Change to take pointer to function kept_func_3.
9517 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9518 folding is done correctly for X86-64.
9519
0da6fa6c
DM
95202010-02-12 David S. Miller <davem@davemloft.net>
9521
9522 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9523 is_symbolless parameter.
9524 (Output_reloc<SHT_REL>::is_symbolless): New.
9525 (Output_reloc<SHT_REL>::is_symbolless_): New.
9526 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9527 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9528 (Output_reloc<SHT_RELA>::is_symbolless): New.
9529 (Output_data_reloc::add_global): Handle is_symbolless.
9530 (Output_data_reloc::add_global_relative): Likewise.
9531 (Output_data_reloc::add_local): Likewise.
9532 (Output_data_reloc::add_local_relative): Likewise.
9533 (Output_data_reloc::add_symbolless_global_addend): New.
9534 (Output_data_reloc::add_symbolless_local_addend): New.
9535 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9536 is_symbolless.
9537 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9538 instead of ->is_relative_
9539 (Output_reloc::write): Likewise.
9540 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9541 (Output_reloc::write_rel): Simplify.
9542
9543 * sparc.cc (Target_sparc::Scan::local): Use
9544 ->add_symbolless_local_addend as needed.
9545 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9546 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9547 based upon relocation offset.
9548
e4782e83
DK
95492010-02-11 Doug Kwan <dougkwan@google.com>
9550
9551 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9552 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9553 beginning of function.
9554 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9555 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9556 parameter is_32bit in calls to should_apply_static_reloc.
9557 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9558 (check_DATA): Add arm_abs_global.stdout.
9559 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9560 arm_abs_global.stdout): New rules.
9561 (MOSTLLYCLEANFILES): Add arm_abs_global
9562 * Makefile.in: Regenerate.
9563 * testsuite/arm_abs_global.s: New file.
9564 * testsuite/arm_abs_global.sh: Ditto.
9565 * testsuite/arm_abs_lib.s: Ditto.
9566
93ceb764
ILT
95672010-02-11 Ian Lance Taylor <iant@google.com>
9568
9569 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9570 Read_relocs task.
9571 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9572 Allocate_commons_task first.
9573 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9574 task, rather than symtab_lock_.
9575 (Gc_process_relocs::~Gc_process_relocs): New function.
9576 (Gc_process_relocs::is_runnable): Check this_blocker_.
9577 (Gc_process_relocs::locks): Use next_blocker_ rather than
9578 blocker_.
9579 (Scan_relocs::~Scan_relocs): New function.
9580 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9581 symtab_lock_.
9582 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9583 next_blocker_.
9584 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9585 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9586 constructor accordingly.
9587 (class Gc_process_relocs): Likewise.
9588 (class Scan_relocs): Likewise.
9589 * common.h (class Allocate_commons_task): Remove symtab_lock_
9590 field, and corresponding constructor parameter.
9591 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9592 symtab_lock_.
9593 (Allocate_commons_task::locks): Likewise.
9594
114dfbe1
ILT
95952010-02-11 Ian Lance Taylor <iant@google.com>
9596
9597 * gold-threads.h (class Once): Define.
9598 (class Initialize_lock): Rewrite as child of Once.
9599 * gold-threads.cc (class Once_initialize): Define.
9600 (once_pointer_control): New static variable.
9601 (once_pointer, once_arg): New static variables.
9602 (c_run_once): New static function.
9603 (Once::Once, Once::run_once, Once::internal_run): New functions.
9604 (class Initialize_lock_once): Remove.
9605 (initialize_lock_control): Remove.
9606 (initialize_lock_pointer): Remove.
9607 (initialize_lock_once): Remove.
9608 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9609 (Initialize_lock::initialize): Rewrite.
9610 (Initialize_lock::do_run_once): New function.
9611 * archive.cc (Archive::interpret_header): Only clear name if it is
9612 not already empty.
9613 * fileread.cc: Include "gold-threads.h"
9614 (file_counts_lock): New static variable.
9615 (file_counts_initialize_lock): Likewise.
9616 (File_read::release): Only increment counts when using --stats.
9617 Use a lock around the increment.
9618 * parameters.cc (class Set_parameters_target_once): Define.
9619 (set_parameters_target_once): New static variable.
9620 (Parameters::Parameters): Move here from parameters.h.
9621 (Parameters::set_target): Rewrite.
9622 (Parameters::set_target_once): New function.
9623 (Parameters::clear_target): Move here and rewrite.
9624 * parameters.h (class Parameters): Update declarations. Add
9625 set_parameters_target_once_ field.
9626 (Parameters::Parameters): Move to parameters.cc.
9627 (Parameters::clear_target): Likewise.
9628 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9629 task.
9630 (Start_group::~Start_group): New function.
9631 (Start_group::is_runnable): New function.
9632 (Start_group::locks, Start_group::run): New functions.
9633 (Finish_group::run): Change saw_undefined to size_t.
9634 * readsyms.h (class Start_group): Define.
9635 (class Finish_group): Change saw_undefined_ field to size_t.
9636 (Finish_group::Finish_group): Remove saw_undefined and
9637 this_blocker parameters. Change all callers.
9638 (Finish_group::set_saw_undefined): New function.
9639 (Finish_group::set_blocker): New function.
9640 * symtab.h (class Symbol_table): Change saw_undefined to return
9641 size_t. Change saw_undefined_ field to size_t.
9642 * target-select.cc (Set_target_once::do_run_once): New function.
9643 (Target_selector::Target_selector): Initialize set_target_once_
9644 field. Don't initialize lock_ and initialize_lock_ fields.
9645 (Target_selector::instantiate_target): Rewrite.
9646 (Target_selector::set_target): New function.
9647 * target-select.h (class Set_target_once): Define.
9648 (class Target_selector): Update declarations. Make
9649 Set_target_once a friend. Remove lock_ and initialize_lock_
9650 fields. Add set_target_once_ field.
9651
fa17a3f4
ILT
96522010-02-10 Ian Lance Taylor <iant@google.com>
9653
9654 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9655 queueing any tasks.
9656 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9657 (queue_middle_tasks): Add all blockers before queueing any tasks.
9658 (queue_final_tasks): Likewise.
9659 * token.h (Task_token::add_blockers): New function.
9660 * object.h (Input_objects::number_of_relobjs): New function.
9661
c7177d31
ILT
96622010-02-10 Ian Lance Taylor <iant@google.com>
9663
5de0e392
ILT
9664 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9665 shared, not if not position independent.
9666 * x86_64.cc (Relocate::relocate_tls): Likewise.
9667 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9668 (tls_pie_pic_test): New target.
9669 * testsuite/Makefile.in: Rebuild.
9670
c7177d31
ILT
9671 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9672 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9673 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9674 * testsuite/Makefile.in: Rebuild.
9675
684b268a
DM
96762010-02-09 David S. Miller <davem@davemloft.net>
9677
9678 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9679 R_SPARC_RELATIVE using ->add_local_relative().
9680 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9681
612a8d3d
DM
9682 * output.h (Output_data_dynamic::add_section_size): New method
9683 that takes two Output_data objects.
9684 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9685 entry param. Handle it in initializers.
9686 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9687 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9688 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9689 arg.
9690 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9691 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9692 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9693 for dynrel_includes_plt.
9694 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9695 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9696 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9697 before .rela.plt
9698 (Target_sparc::do_finalize_sections): Update to pass true for
9699 dynrel_includes_plt.
9700 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9701 output before .rela.plt
9702 (Target_powerpc::do_finalize_sections): Update to pass true for
9703 dynrel_includes_plt when 32-bit.
9704
cb1be87e
DK
97052010-02-08 Doug Kwan <dougkwan@google.com>
9706
9707 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9708 method.
9709 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9710 Arm_relobj::scan_section_for_cortex_a8_stubs,
9711 Arm_relobj::do_relocation_section): Instead of calling
9712 Output_section::output_address, use faster
9713 Arm_relobj::simple_input_section_output_address.
9714
705b5121
DM
97152010-02-08 David S. Miller <davem@davemloft.net>
9716
9717 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9718 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9719 relocation helper function.
9720
024c4466
DM
9721 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9722 just like R_SPARC_GOT{10,13,22}.
9723 (Target_sparc::Scan::local): Likewise.
9724 (Target_sparc::Relocate:relocate): Likewise.
9725
9109c078
ILT
97262010-02-06 Ian Lance Taylor <iant@google.com>
9727
9728 * configure.ac: Rewrite targetobjs duplicate removal code to use
9729 only shell constructs.
9730 * configure: Rebuild.
9731
cf846138
DK
97322010-02-05 Doug Kwan <dougkwan@google.com>
9733
9734 PR 11247
9735 * arm.cc (Arm_relobj::section_is_scannable): New method.
9736 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9737 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9738
6cfaf60b
DK
97392010-02-04 Doug Kwan <dougkwan@google.com>
9740
9741 PR 11247
9742 * arm-reloc-property.cc (cstdio): Include.
9743 * configure.ac (targetobjs): Remove duplicates.
9744 * configure: Regenerate.
9745 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9746 big and little endian version for a given address size.
9747
5c57f1be
DK
97482010-02-03 Doug Kwan <dougkwan@google.com>
9749
9750 * arm-reloc-property.cc
9751 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9752 definition.
9753 * arm-reloc-property.h
9754 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9755 New method definition.
9756 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9757 declaration.
9758 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9759 overflow to N.
9760 (GOT_PREL): Change implemented to Y.
9761 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9762 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9763 (Arm_relocate_functions::movw_abs_nc): Remove method.
9764 (Arm_relocate_functions::movt_abs): Ditto.
9765 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9766 (Arm_relocate_functions::thm_movt_abs): Ditto.
9767 (Arm_relocate_functions::movw_rel_nc): Ditto.
9768 (Arm_relocate_functions::movw_rel): Ditto.
9769 (Arm_relocate_functions::movt_rel): Ditto.
9770 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9771 (Arm_relocate_functions:thm_movw_rel): Ditto.
9772 (Arm_relocate_functions:thm_movt_rel): Ditto.
9773 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9774 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9775 New method definitions.
9776 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9777 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9778 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9779 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9780 (Target_arm::Relocate::relocate): Check for non-static or
9781 unimplemented relocation code and exit early. Change calls to
9782 Target_arm::reloc_uses_thumb_bit and
9783 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9784 instead. Refactor code to handle similar relocations to increase
9785 code sharing. Remove check for unsupported relocation code in switch
9786 statement.
9787 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9788 relocation property table to find out size. Change error message to
9789 print out the name of a relocation code instead of the numeric value.
9790 (Target_arm::scan_reloc_for_stub): Use relocation property table
9791 instead of calling Target_arm::reloc_uses_thumb_bit().
9792
218c5831
DK
97932010-02-02 Doug Kwan <dougkwan@google.com>
9794
9795 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9796 types of relaxed input section.
9797
0d31c79d
DK
97982010-02-02 Doug Kwan <dougkwan@google.com>
9799
9800 * Makefile.am (HFILES): Add arm-reloc-property.h.
9801 (DEFFILES): New.
2e702c99
RM
9802 (TARGETSOURCES): Add arm-reloc-property.cc
9803 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9804 (libgold_a_SOURCES): $(DEFFILES)
9805 * Makefile.in: Regenerate.
9806 * arm-reloc-property.cc: New file.
9807 * arm-reloc-property.h: New file.
9808 * arm-reloc.def: New file.
9809 * arm.cc: Update comments.
9810 (arm-reloc-property.h): New included header.
9811 (arm_reloc_property_table): New global variable.
9812 (Target_arm::do_select_as_default_target): New method definition.
9813 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9814 arm-reloc-property to targ_extra_obj.
9815 * parameters.cc (set_parameters_target): Call
9816 Target::select_as_default_target().
9817 * target.h (Target::select_as_default_target): New method definition.
9818 (Target::do_select_as_default_target): Same.
9819
546c7457
DK
98202010-02-01 Doug Kwan <dougkwan@google.com>
9821
9822 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9823 first_output_text_section_.
9824 (Arm_exidx_fixup::first_output_text_section): New method definition.
9825 (Arm_exidx_fixup::first_output_text_section_): New data member.
9826 (Arm_exidx_fixup::process_exidx_section): Record the first text
9827 output section seen.
9828 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9829 and entsize in output section header.
9830
11b861d5
DK
98312010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9832
9833 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9834 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9835 (Arm_relocate_functions::thm_alu11): New Method.
9836 (Arm_relocate_functions::thm_pc8): New Method.
9837 (Arm_relocate_functions::thm_pc12): New Method.
9838 (Target_arm::Scan::local): Handle the relocations.
9839 (Target_arm::Scan::global): Likewise.
9840 (Target_arm::Relocate::relocate): Likewise.
9841 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9842
c9a2c125
DK
98432010-01-29 Doug Kwan <dougkwan@google.com>
9844
9845 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9846 of relocation types as ld.
9847
1521477a
DK
98482010-01-29 Doug Kwan <dougkwan@google.com>
9849
9850 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9851 to public.
9852 (Arm_relocate_functions::thumb_branch_common): Ditto.
9853 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9854 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9855 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9856 Arm_relocate_functions::jump24): Remove.
9857 (Target_arm::Relocate::relocate): Adjust code to call
9858 Arm_relocation_functions::arm_branch_common and
9859 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9860 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9861
e7eca48c
DK
98622010-01-29 Doug Kwan <dougkwan@google.com>
9863
9864 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9865 output_local_symbol_count_needs_update_.
9866 (Arm_relobj::output_local_symbol_count_needs_update,
9867 Arm_relobj::set_output_local_symbol_count_needs_update,
9868 Arm_relobj::update_output_local_symbol_count): New methods.
9869 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9870 member.
9871 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9872 of pointed function as in a R_ARM_PREL31 relocation.
9873 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9874 for output local symbol count updating.
9875 (Target_arm::do_relax): Update output local symbol counts in objects
9876 if necessary.
9877 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9878
02961d7e
ILT
98792010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9880
9881 * arm.cc: Added support for the ARM relocations:
9882 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9883 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9884 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9885 movw_prel_nc).
9886 (Arm_relocate_functions::movw_rel): New method.
9887 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9888 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9889 thm_movw_prel_nc).
9890 (Arm_relocate_functions::thm_movw_rel): New method.
9891 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9892 thm_movt_prel).
9893 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9894 relocations.
9895 (Target_arm::Scan::global): Likewise.
9896 (Target_arm::Relocate::relocate): Likewise.
9897 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9898 Likewise.
9899
b10d2873
ILT
99002010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9901
9902 * arm.cc: Added support for ARM group relocations.
9903 (Target_arm::reloc_needs_sym_origin): New method.
9904 (Arm_relocate_functions::calc_grp_kn): New method.
9905 (Arm_relocate_functions::calc_grp_residual): New method.
9906 (Arm_relocate_functions::calc_grp_gn): New method.
9907 (Arm_relocate_functions::arm_grp_alu): New Method.
9908 (Arm_relocate_functions::arm_grp_ldr): New Method.
9909 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9910 (Arm_relocate_functions::arm_grp_ldc): New Method.
9911 (Target_arm::Scan::local): Handle the ARM group relocations.
9912 (Target_arm::Scan::global): Likewise.
9913 (Target_arm::Relocate::relocate): Likewise.
9914 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9915 Likewise.
9916
2b328d4e
DK
99172010-01-26 Doug Kwan <dougkwan@google.com>
9918
9919 * arm.cc (set): Include.
9920 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9921 pointer type.
2e702c99 9922 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9923 (Arm_output_section::append_text_sections_to_list): New method.
9924 (Arm_output_section::fix_exidx_coverage): Ditto.
9925 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9926 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9927 Relobj::set_section_offset() instead of
9928 Sized_relobj::invalidate_section_offset().
2e702c99 9929 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9930 parameter for section headers. Ignore relocation sections for
9931 unallocated sections and EXIDX sections.
9932 (Target_arm::fix_exidx_coverage): New method.
9933 (Target_arm::output_section_address_less_than): New type.
9934 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9935 linked text section instead of the EXIDX section.
9936 (Arm_output_section::create_stub_group): Add an assertion to check
9937 that this is not an EXIDX output section.
9938 (Arm_output_section::append_text_sections_to_list): New method.
9939 (Arm_output_section::fix_exidx_coverage): Ditto.
9940 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9941 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9942 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9943 first pass.
9944 (Target_arm::fix_exidx_coverage): New method.
9945 * object.h (Relobj::set_output_section): New method.
9946 (Sized_relobj::invalidate_section_offset): Remove method.
9947 (Sized_relobj::do_invalidate_section_offset): Remove method.
9948 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9949
c7f3c371
DK
99502010-01-25 Doug Kwan <dougkwan@google.com>
9951
9952 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9953 Fix warning due to signed and unsigned comparison on a 32-bit host.
9954
8923b24c
DK
99552010-01-22 Doug Kwan <dougkwan@google.com>
9956
9957 * arm.cc (Target_arm::do_relax): Record an output section for section
9958 offset adjustment it contains any stub table that has changed.
9959 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9960 offsets in an output section if necessary.
9961 * output.cc (Output_section::Output_section): Initialize
9962 section_offsets_need_adjustments_.
9963 (Output_section::add_input_section_for_script): Renamed to
9964 Output_section::add_simple_input_section.
9965 (Output_section::save_states): Add a comment.
9966 (Output_section::discard_states): New method defintion.
9967 (Output_section::adjust_section_offsets): Same.
9968 * output.h (Output_section::add_input_section_for_script): Renamed to
9969 Output_section::add_simple_input_section.
9970 (Output_section::discard_states): New method declaration.
9971 (Output_section::adjust_section_offsets): Same.
9972 (Output_section::section_offsets_need_adjustment,
9973 Output_section::set_section_offsets_need_adjustment): New method
9974 definitions.
9975 (Output_section::section_offsets_need_adjustment_): New data member.
9976 * script-sections.cc
9977 (Output_section_element_input::set_section_address): Adjust code for
9978 renaming of Output_section::add_input_section_for_script.
9979 (Orphan_output_section::set_section_address): Same.
9980
9b2fd367
DK
99812010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9982
9983 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9984 Fix_v4bx enum values .
9985 * gold/options.h (General_options): New option definitions.
9986 (General_options::fix_v4bx): New method.
9987 (General_options::Fix_v4bx): New enum.
9988 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9989 (General_options::parse_fix_v4bx_interworking): New method.
9990
80d0d023
DK
99912010-01-22 Doug Kwan <dougkwan@google.com>
9992
9993 * arm.cc (Arm_exidx_fixup): New class.
9994
af2cdeae
DK
99952010-01-21 Doug Kwan <dougkwan@google.com>
9996
9997 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9998 classes.
9999 (Arm_exidx_section_offset_map): New type.
10000
993d07c1
DK
100012010-01-21 Doug Kwan <dougkwan@google.com>
10002
10003 * arm.cc (Arm_exidx_input_section): New class.
10004 (Arm_relobj::exidx_input_section_by_link,
10005 Arm_relobj::exidx_input_section_by_shndx,
10006 Arm_relobj::make_exidx_input_section): New methods.
10007 (read_arm_attributes_section): Remove.
10008 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10009 information about them.
10010 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10011 to here.
10012
5ac169d4
DK
100132010-01-20 Doug Kwan <dougkwan@google.com>
10014
10015 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10016 Input_section_specifier to Section_id.
10017 (Target_arm::new_arm_input_section: Adjust code for change of key
10018 type.
10019 (Target_arm::find_arm_input_section): Ditto.
10020 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10021 (Section_id): Remove.
10022 (Garbage_collection::Section_id_hash): Remove.
10023 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10024 (Section_id): Remove.
10025 (Icf::Section_id_hash): Remove.
10026 * object.h (Section_id, Const_section_id, Section_id_hash,
10027 Const_section_id_hash): New type definitions.
10028 * output.cc (Output_section::add_relaxed_input_section): Change to
10029 use Const_section_id instead of Input_section_specifier as key type.
10030 (Output_section::add_merge_input_section): Ditto.
10031 (Output_section::build_relaxation_map): Change to use Section_id
10032 instead of Input_section_specifier as key type.
2e702c99 10033 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10034 Ditto.
10035 (Output_section::convert_input_sections_to_relaxed_sections): Change
10036 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10037 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10038 (Output_section::find_relaxed_input_section): Ditto.
10039 * output.h (Input_section_specifier): Remove class.
10040 (Output_section::Output_section_data_by_input_section_map): Change
10041 key type to Const_section_id.
10042 (Output_section::Output_relaxed_input_section_by_input_section_map):
10043 Ditto.
10044 (Output_section::Relaxation_map): Change key type to Section_id.
10045
a2162063
ILT
100462010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10047
10048 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10049 (class Arm_v4bx_stub): New class.
10050 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10051 (Stub_factory::make_arm_v4bx_stub): New method.
10052 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10053 (Stub_table::empty): Handle v4bx stubs.
10054 (Stub_table::add_arm_v4bx_stub): New method.
10055 (Stub_table::find_arm_v4bx_stub): New method.
10056 (Arm_relocate_functions::v4bx): New method.
10057 (Target_arm::fix_v4bx): New method.
10058 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10059 (Stub_table::relocate_stubs): Likewise.
10060 (Stub_table::do_write): Likewise.
10061 (Stub_table::update_data_size_and_addralign): Likewise.
10062 (Stub_table::finalize_stubs): Likewise.
10063 (Target_arm::Scan::local): Likewise.
10064 (Target_arm::Scan::global): Likewise.
10065 (Target_arm::do_finalize_sections): Likewise.
10066 (Target_arm::Relocate::relocate): Likewise.
10067 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10068 Likewise.
10069 (Target_arm::scan_reloc_for_stub): Likewise.
10070 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10071
5696ab0b
ILT
100722010-01-19 Ian Lance Taylor <iant@google.com>
10073
10074 * output.cc (Output_section_headers::do_sized_write): Write large
10075 segment count to sh_info field.
10076 (Output_file_header::do_sized_write): For large segment count,
10077 write PN_XNUM to e_phnum field.
10078
800d0f56
ILT
100792010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10080
10081 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10082 (Arm_relocate_functions::thm_jump8): New function.
10083 (Arm_relocate_functions::thm_jump11): New function.
10084 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10085 R_ARM_THM_JUMP11.
10086 (Target_arm::Scan::global): Likewise.
10087 (Target_arm::Relocate::relocate): Likewise.
10088 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10089 Likewise.
10090
41263c05
DK
100912010-01-14 Doug Kwan <dougkwan@google.com>
10092
10093 * arm.cc (map, utility): Include headers.
10094 (Target_arm::apply_cortex_a8_workaround): New method.
10095 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10096 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10097 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10098 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10099 the --[no-]fix-cortex-a8 command line options.
10100 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10101 (Target_arm::relocate_stub): Use addend in instruction template.
10102 * options.h (DEFINE_bool): Set the user-set flag.
10103 (General_options): Add --[no-]-fix-cortex options.
10104 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10105 : Update fast look-up map after conversion.
41263c05 10106
459e9b03
ST
101072010-01-14 Sriraman Tallam <tmsriram@google.com>
10108
10109 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10110 in the first pass of do_layout.
10111
b521dfe4
DK
101122010-01-13 Doug Kwan <dougkwan@google.com>
10113
10114 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10115 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10116 apparent compiler problem of not folding static constant integral
10117 data members of elfcpp::Elf_sizes<32>.
10118
44272192
DK
101192010-01-13 Doug Kwan <dougkwan@google.com>
10120
10121 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10122 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10123 Arm_relobj::scan_section_for_cortex_a8_erratum,
10124 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10125 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10126 sections to scan for relocation stubs into a new method
10127 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10128 relocation and Cortex-A8 stub scanning.
10129 (Target_arm::do_relax): Force stubs to be after stubbed sections
10130 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10131 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10132 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10133
44b71ece
ILT
101342010-01-12 Ian Lance Taylor <iant@google.com>
10135
10136 * target-reloc.h (visibility_error): New inline function.
10137 (relocate_section): Call visibility_error.
10138 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10139 (MOSTLYCLEANFILES): Likewise.
10140 (protected_4_pic.o, protected_3.err): New targets.
10141 * testsuite/protected_4.cc: New file.
10142
a120bc7f
DK
101432010-01-12 Doug Kwan <dougkwan@google.com>
10144
10145 * arm.cc (Cortex_a8_reloc): New class.
10146 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10147 and cortex_a8_relocs_info_.
10148 (Target_arm::fix_cortex_a8): New method definition.
10149 (Target_arm::Cortex_a8_relocs_info): New type.
10150 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10151 New data member declarations.
10152 (Target_arm::scan_reloc_for_stub): Record information about
10153 relocations for THUMB branches that might be exempted from the
10154 Cortex-A8 workaround.
10155 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10156 at the beginning of a relaxation pass.
10157
20138696
DK
101582010-01-12 Doug Kwan <dougkwan@google.com>
10159
10160 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10161 (Arm_relobj::Mapping_symbol_position,
10162 Arm_reloj::Mapping_symbol_position_less,
10163 Arm_relobj::Mapping_symbols_info): New types.
10164 (Target_arm::is_mapping_symbol_name): New method definition.
10165 (Arm_relobj::do_count_local_symbols): Save information about mapping
10166 symbols.
10167
089d69dc
DK
101682010-01-11 Doug Kwan <dougkwan@google.com>
10169
10170 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10171 Arm_relocate_functions::thumb32_branch_upper,
10172 Arm_relocate_functions::thumb32_branch_lower,
10173 Arm_relocate_functions::thumb32_cond_branch_offset,
10174 Arm_relocate_functions::thumb32_cond_branch_upper,
10175 Arm_relocate_functions::thumb32_cond_branch_lower,
10176 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10177 branch offset encoding.
10178 (Arm_relocate_functions::thumb_branch_common): Use new branch
10179 offset encoding methods to avoid code duplication.
10180 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10181 (Stub_addend_reader::operator()): Use new branch encoding method
10182 to avoid code duplication.
10183
99e5bff2
DK
101842010-01-11 Doug Kwan <dougkwan@google.com>
10185
10186 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10187 (Target_arm::do_finalize_sections): Define special EXIDX section
10188 symbols only if referenced.
10189 * gc.h (Garbage_collection::add_reference): New method.
10190 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10191 code duplication.
10192
98e090bd
ILT
101932010-01-11 Ian Lance Taylor <iant@google.com>
10194
d0a91bd8
ILT
10195 * script.cc (Version_script_info::build_expression_list_lookup):
10196 Change complaing about duplicate wildcard match from error to
10197 warning.
10198
98e090bd
ILT
10199 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10200 of 2009-12-30.
10201 (Version_script_info::Version_script_info): Initialize globs_,
10202 default_version_, default_is_global_, and exact_. Don't
10203 initialize globals_ or locals_.
10204 (Version_script_info::build_lookup_tables): Build local symbols
10205 first.
10206 (Version_script_info::unquote): New function.
10207 (Version_script_info::add_exact_match): New function.
10208 (Version_script_info::build_expression_list_lookup): Remove lookup
10209 parameter. Add is_global parameter. Change all callers. Handle
10210 wildcard pattern specially. Unquote pattern. Call
10211 add_exact_match.
10212 (Version_script_info::get_name_to_match): New function.
10213 (Version_script_info::get_symbol_version): New function.
10214 (Version_script_info::get_symbol_version_helper): Remove.
10215 (Version_script_info::check_unmatched_names): Call unquote.
10216 * script.h (class Version_script_info): Change get_symbol_version
10217 to be non-inline and add is_global parameter; change all callers.
10218 Rewrite symbol_is_local. Update declarations. Define struct
10219 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10220 Remove globals_ and locals_ members. Add exact_, globs_,
10221 default_version_, is_global_.
10222 (Version_script_info::Glob): Remove pattern, add expression and
10223 is_global. Update constructor. Change all callers.
10224 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10225 default version.
10226 (Versions::symbol_section_contents): If a symbol is undefined, or
10227 defined in a dynamic object, set the version index to
10228 VER_NDX_LOCAL.
10229 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10230 symbol_is_local.
10231 (Symbol_table::add_from_pluginobj): Likewise.
10232 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10233
d56962d3
DK
102342010-01-11 Doug Kwan <dougkwan@google.com>
10235
10236 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10237 (incremental_dump_LDADD): Add linking option for libintl.
10238 * Makefile.in: Regenerate.
10239
94e6ee91
L
102402010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10241
10242 PR gold/11144
10243 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10244 instead of -Ds.
10245 * testsuite/Makefile.in: Regenerated.
10246
e96c574b
DK
102472010-01-10 Doug Kwan <dougkwan@google.com>
10248
10249 * options.h (DEFINE_var): Use parentheses around argument varname__
10250 in macro body to avoid any unintended subsequent substitutions.
10251
7198066b
ILT
102522010-01-10 Ian Lance Taylor <iant@google.com>
10253
ba4d53bf
ILT
10254 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10255 candidates before doing symbol resolution.
10256
7198066b
ILT
10257 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10258 ODR candidates if only one is weak.
10259
a2beed37
ILT
102602010-01-08 Ian Lance Taylor <iant@google.com>
10261
10262 * script.cc (Version_script_info::build_expression_list_lookup):
10263 Don't warn about ambiguous version, just record the ambiguity.
10264 (Version_script_info::get_symbol_version_helper): Give error if
10265 version is ambiguous.
10266
2fb7225c
DK
102672010-01-08 Doug Kwan <dougkwan@google.com>
10268
10269 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10270 prev_data_size_ and prev_addralign_. Remove initializer for
10271 deleted data member has_been_changed_.
10272 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10273 to determine if the table is empty.
10274 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10275 Remove.
10276 (Stub_table::add_reloc_stub): Define method in class definition
10277 instead of just declaring it there.
10278 (Stub_table::add_cortex_a8_stub): New method definition.
10279 (Stub_table::update_data_size_and_addralign): Ditto.
10280 (Stub_table::finalize_stubs): Ditto.
10281 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10282 (Stub_table::do_addralign_): Return address alignment in the
10283 (Stub_table::do_reset_address_and_file_offset): Define method in
10284 class definition instead of declaring it there. Set current data
10285 size to be the data size of the previous pass.
10286 (Stub_table::set_final_data_size): Use current data size as the
10287 final data size.
10288 (Stub_table::relocate_stub): Change parameter type of stub from
10289 Reloc_stub pointer to Stub pointer.
10290 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10291 (Stub_table::Cortex_a8_stub_list): New typedef.
10292 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10293 Stub_table::prev_addralign_): New data member.
10294 (Arm_relobj::Arm_relobj): Initialize data member
10295 section_has_cortex_a8_workaround_.
10296 (Arm_relobj::section_has_cortex_a8_workaround,
10297 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10298 definitions.
10299 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10300 declarations.
10301 (Target_arm::relocate_stub): Change parameter type of stub from
10302 Reloc_stub pointer to Stub pointer.
10303 (Insn_template::size, Insn_template::alignment): Handle
10304 THUMB16_SPECIAL_TYPE.
10305 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10306 Stub_table::update_data_size_and_addralign,
10307 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10308 definitions.
10309 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10310 (Stub_table::do_write): Ditto.
10311 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10312
880cd20d
ILT
103132010-01-08 Ian Lance Taylor <iant@google.com>
10314
10315 PR 11108
10316 * symtab.h (class Symbol): Remove fields is_target_special_ and
10317 has_plt_offset_. Add field is_defined_in_discarded_section_.
10318 (Symbol::is_defined_in_discarded_section): New function.
10319 (Symbol::set_is_defined_in_discarded_section): New function.
10320 (Symbol::has_plt_offset): Rewrite.
10321 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10322 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10323 Don't initialize is_target_special_ or has_plt_offset_.
10324 Initialize is_defined_in_discarded_section_.
10325 (Symbol_table::add_from_relobj): If appropriate, set
10326 is_defined_in_discarded_section.
10327 * resolve.cc (Symbol::override_base_with_special): Don't test
10328 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10329 * target-reloc.h (relocate_section): Do special handling for
10330 symbols defined in discarded sections for global symbols as well
10331 as local symbols.
10332
2703e3eb
ILT
103332010-01-08 Ian Lance Taylor <iant@google.com>
10334
10335 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10336 the SHT_SYMTAB case.
10337
339d40a3
ILT
103382010-01-08 Ian Lance Taylor <iant@google.com>
10339
10340 * object.cc (Sized_relobj::do_layout): Don't get confused if
10341 layout_eh_frame returns NULL.
10342
abecea76
ILT
103432010-01-08 Ian Lance Taylor <iant@google.com>
10344
10345 PR 11084
10346 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10347 dynamic symbol table, use the normal symbol table.
10348 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10349 symbol table.
10350
6b7dd3f3
ILT
103512010-01-08 Ian Lance Taylor <iant@google.com>
10352
10353 PR 11072
10354 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10355 sections.
10356
36c50e63
L
103572010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10358
10359 * version.cc (print_version): Change to "Copyright 2010".
10360
e291e7b9
ILT
103612010-01-08 Ian Lance Taylor <iant@google.com>
10362
10363 PR 10287
10364 PR 11063
10365 * i386.cc (class Target_i386): Change return type of plt_section
10366 to be non-const.
10367 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10368 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10369 tls_desc_rel_ field.
10370 (Output_data_plt_i386::rel_tls_desc): New function.
10371 (Target_i386::rel_tls_desc_section): New function.
10372 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10373 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10374 R_386_TLS_DESC reloc in rel_tls_desc_section.
10375 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10376 Define struct Tlsdesc_info.
10377 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10378 (Target_x86_64::do_reloc_symbol_index): New function.
10379 (Target_x86_64::add_tlsdesc_info): New function.
10380 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10381 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10382 tlsdesc_rel_ field.
10383 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10384 all callers.
10385 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10386 (Target_x86_64::rela_tlsdesc_section): New function.
10387 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10388 handling.
10389 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10390 (Target_x86_64::do_reloc_addend): New function.
10391 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10392 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10393 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10394 (Output_reloc::type): New function.
10395 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10396 (Output_reloc::is_target_specific): New function.
10397 (Output_reloc::target_arg): New function.
10398 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10399 absolute relocs and target specific relocs.
10400 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10401 add_target_specific.
10402 (class Output_data_reloc) [SHT_RELA]: Likewise.
10403 * output.cc (Output_reloc::Output_reloc): Add four new versions
10404 for absolute relocs and target specific relocs.
10405 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10406 (Output_reloc::get_symbol_index): Likewise.
10407 (Output_reloc::local_section_offset): Check that local_sym_index_
10408 is not TARGET_CODE or 0.
10409 (Output_reloc::symbol_value): Likewise.
10410 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10411 reloc.
10412 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10413 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10414 functions.
10415 * layout.cc (add_target_dynamic_tags): Use output section for
10416 DT_PLTRELSZ and DT_JMPREL.
10417
3a44184e
ILT
104182010-01-07 Ian Lance Taylor <iant@google.com>
10419
10420 PR 11061
10421 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10422 function.
10423 (class Output_data_reloc_generic): Define.
10424 (class Output_data_reloc_base): Change base class to
10425 Output_data_reloc_generic. Change add() method to call
10426 bump_relative_reloc_count for a relative reloc. Remove
10427 sort_relocs_ field.
10428 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10429 to sort_relocs().
10430 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10431 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10432 appropriate.
10433 * layout.h (class Layout): Update declaration.
10434
ea715a34
ILT
104352010-01-07 Ian Lance Taylor <iant@google.com>
10436
10437 * output.h (class Output_data): Add const version of
10438 output_section and do_output_section.
10439 (class Output_section_data): Add const version of
10440 do_output_section.
10441 (class Output_section): Likewise.
10442 * layout.cc (Layout::add_target_dynamic_tags): New function.
10443 * layout.h (class Layout): Update declarations.
10444 * arm.cc (Target_arm::do_finalize_sections): Use
10445 add_target_dynamic_tags.
10446 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10447 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10448 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10449 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10450
659948a4
ILT
104512010-01-07 Ian Lance Taylor <iant@google.com>
10452
10453 PR 11042
10454 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10455 object as needed.
10456
9d3b86f6
ILT
104572010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10458 Ian Lance Taylor <iant@google.com>
10459
10460 PR 11019
10461 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10462 Xindex::read_symtab_xindex.
10463
bb0d3eb0
DK
104642010-01-07 Doug Kwan <dougkwan@google.com>
10465
10466 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10467 (Insn_template::thumb16_bcond_insn): New method declaration.
10468 (Insn_template): Fix spelling.
10469 (Stub::thumb16_special): New method declaration.
10470 (Stub::do_write): Define virtual method which was previously pure
10471 virtual.
10472 (Stub::do_thumb16_special): New method declaration.
10473 (Stub::do_fixed_endian_write): New template member.
10474 (Reloc_stub::do_write): Remove.
10475 (Reloc_stub::do_fixed_endian_write): Remove.
10476 (Cortex_a8_stub): New class definition.
10477 (Stub_factory::make_cortex_a8_stub): New method definition.
10478 (Stub_factory::Stub_factory): Add missing static storage class
10479 qualifier for elf32_arm_stub_a8_veneer_blx.
10480
ffeef7df
ILT
104812010-01-07 Ian Lance Taylor <iant@google.com>
10482
dc3f80fe
ILT
10483 PR 10980
10484 * options.h (class General_options): Add --warn-unresolved-symbols
10485 and --error-unresolved-symbols.
10486 * errors.cc (Errors::undefined_symbol): Implement
10487 --warn-unresolved-symbols.
10488
ffeef7df
ILT
10489 * options.h (class General_options): Add -z text and -z textoff.
10490 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10491
f1ec9ded
ST
104922010-01-06 Sriraman Tallam <tmsriram@google.com>
10493
10494 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10495 (Garbage_collection::cident_sections): New function.
10496 (Garbage_collection::add_cident_section): New function.
10497 (Garbage_collection::cident_sections_): New member.
10498 (gc_process_relocs): Add references to sections whose names are C
10499 identifiers.
10500 * gold.h (cident_section_start_prefix): New constant.
10501 (cident_section_stop_prefix): New constant.
10502 (is_cident): New function.
10503 * layout.cc (Layout::define_section_symbols): Replace string constants
10504 with the newly defined constants.
10505 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10506 C identifiers.
10507 * testsuite/Makefile.am: Add gc_orphan_section_test.
10508 * testsuite/Makefile.in: Regenerate.
10509 * testsuite/gc_orphan_section_test.cc: New file.
10510 * testsuite/gc_orphan_section_test.sh: New file.
10511
6eda8c29
ILT
105122010-01-06 Ian Lance Taylor <iant@google.com>
10513
b9674e17
ILT
10514 PR 10980
10515 * options.h (class General_options): Add --warn-shared-textrel.
10516 * layout.cc (Layout::finish_dynamic_section): Implement
10517 --warn-shared-textrel.
10518
6eda8c29
ILT
10519 PR 10980
10520 * options.h (class General_options): Add --warn-multiple-gp.
10521
32dcd44e
ILT
105222010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10523
10524 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10525 $(THREADSLIB) and $(LIBDL).
10526 * Makefile.in: Rebuild.
10527
a192ba05
ILT
105282010-01-06 Ian Lance Taylor <iant@google.com>
10529
10530 PR 10980
10531 * options.cc (General_options::parse_section_start): New function.
10532 (General_options::section_start): New function.
10533 (General_options::General_options): Initialize all members.
10534 * options.h: Include <map>
10535 (class General_options): Add --section-start. Add section_starts_
10536 member.
10537 * layout.cc (Layout::attach_allocated_section_to_segment): If
10538 --section-start was used, set the address of the segment. Remove
10539 local sort_sections.
10540 (Layout::relaxation_loop_body): If the address of the load segment
10541 has been set by --section-start, don't use it.
10542 * output.h (Output_segment::update_flags_for_output_section): New
10543 function.
10544 * output.cc (Output_segment::add_output_section): Call
10545 update_flags_for_output_section.
10546
dde3f402
ILT
105472010-01-05 Ian Lance Taylor <iant@google.com>
10548
62dfdd4d
ILT
10549 PR 10980
10550 * options.h (class General_options): Add --undefined-version.
10551 * script.cc (struct Version_expression): Add was_matched_by_symbol
10552 field.
10553 (Version_script_info::matched_symbol): New function.
10554 (Version_script_info::get_symbol_version_helper): Call
10555 matched_symbol.
10556 (Version_script_info::check_unmatched_names): New function.
10557 * script.h (class Version_script_info): Update declarations.
10558 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10559
9c4ae156
ILT
10560 * options.h (class General_options): Use DEFINE_bool_alias for
10561 allow_multiple_definition.
10562 * resolve.cc (Symbol_table::should_override): Don't test
10563 allow_multiple_definition.
10564
dde3f402
ILT
10565 PR 10980
10566 * options.h (class General_options): Add --cref.
10567 * main.cc (main): Print cref table if --cref. Don't close mapfile
10568 until after printing cref table.
10569 * cref.cc: Include "symtab.h".
10570 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10571 (Cref_table_compare::operator()): New function.
10572 (Cref_inputs::gather_cref): New function.
10573 (filecol): New static const.
10574 (Cref_inputs::print_cref): New function.
10575 (Cref::print_cref): New function.
10576 * cref.h: Include <cstdio>.
10577 (class Cref): Update declarations.
10578 * mapfile.h (Mapfile::file): New function.
10579 * object.h (class Object): Define Symbols. Declare virtual
10580 do_get_global_symbols.
10581 (Object::get_global_symbols): New function.
10582 * object.cc (Input_objects::add_object): Pass object to cref_ if
10583 --cref.
10584 (Input_objects::archive_start): Likewise.
10585 (Input_objects::archive_stop): Likewise.
10586 (Input_objects::print_cref): New function.
10587 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10588 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10589 --cref.
10590 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10591 function.
10592 * plugin.h (class Sized_pluginobj): Update declarations.
10593
8781f709
ILT
105942010-01-05 Ian Lance Taylor <iant@google.com>
10595
10596 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10597 to is_default_version. Rename insdef to insdefault.
10598 (Symbol_table::add_from_relobj): Rename def to is_default_version
10599 and local to is_forced_local.
10600 (Symbol_table::add_from_pluginobj): Likewise.
10601 (Symbol_table::add_from_dynobj): Likewise.
10602 (Symbol_table::define_special_symbol): Rename insdef to
10603 insdefault.
10604
fe35d28d
ILT
106052010-01-04 Ian Lance Taylor <iant@google.com>
10606
30bc8c46
ILT
10607 PR 10980
10608 * options.h (class General_options): Add
10609 --allow-multiple-definition and -z muldefs.
10610 * resolve.cc (Symbol_table::should_override): Don't warn about a
10611 multiple symbol definition if --allow-multiple-definition or -z
10612 muldefs.
10613
7eaea549
ILT
10614 PR 10980
10615 * options.h (class General_options): Add --add-needed and
10616 --copy-dt-needed-entries. Tweak --as-needed help entry.
10617 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10618 error if --copy-dt-needed-entries aka --add-needed is used and
10619 would cause a change in behaviour.
10620
fe35d28d
ILT
10621 PR 10980
10622 * options.h (class General_options): Add -G as a short version of
10623 --shared. Add no-op options -assert, -g, and -i.
10624
55a2bb35
ST
106252010-01-04 Sriraman Tallam <tmsriram@google.com>
10626
10627 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10628 check for .text or .gnu.linkonce.t sections.
10629 * icf.cc (Icf::find_identical_sections): Ditto.
10630 Change the detection for mangled function name within the section
10631 name.
10632 * icf.h (is_section_foldable_candidate): New function.
10633
719328e1
ILT
106342009-12-30 Ian Lance Taylor <iant@google.com>
10635
10636 PR 10980
10637 * options.h (class General_options): Permit two dashes with
10638 --retain-symbols-file.
10639
d7bb5745
ILT
106402009-12-30 Ian Lance Taylor <iant@google.com>
10641
403a15dd
ILT
10642 PR 10979
10643 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10644 don't put the file header and segment headers in the text
10645 segment.
10646
eda294df
ILT
10647 PR 10979
10648 * common.cc (Sort_commons::operator()): Stabilize sort when both
10649 entries are NULL.
10650 (Symbol_table::do_allocate_commons_list): When allocating common
10651 symbols, skip a symbol which is no longer common.
10652 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10653 an object before checking its type.
10654 * testsuite/common_test_2.c: New file.
10655 * testsuite/common_test_3.c: New file.
10656 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10657 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10658 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10659 (common_test_2_pic.o, common_test_2.so): New targets.
10660 (common_test_3_pic.o, common_test_3.so): New targets.
10661 * testsuite/Makefile.in: Rebuild.
10662
d7bb5745
ILT
10663 PR 10979
10664 * script.cc (read_input_script): If we see a new SECTIONS clause,
10665 and we have added an input section, give an error.
10666 * layout.h (class Layout): Add have_added_input_section function.
10667 Add have_added_input_section_ field.
10668 * layout.cc (Layout::Layout): Initialize
10669 have_added_input_section_.
10670 (Layout::layout): Set have_added_input_section_.
10671 (Layout::layout_eh_frame): Likewise.
10672
fc59c572
ILT
106732009-12-30 Ian Lance Taylor <iant@google.com>
10674
10675 PR 10931
10676 * options.h (class General_options): Add --sort-common option.
10677 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10678 * common.cc (Sort_common): Add sort_order parameter to
10679 constructor. Add sort_order_ field.
10680 (Sort_commons::operator): Check sort_order_.
10681 (Symbol_table::allocate_commons): Determine the sort order.
10682 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10683 Change all callers.
10684 (Symbol_table::do_allocate_commons_list): Likewise.
10685
1c74fab0
ILT
106862009-12-30 Ian Lance Taylor <iant@google.com>
10687
10688 PR 10916
10689 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10690 symbols from this object, don't change the visibility of an
10691 undefined symbol.
10692 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10693
6affe781
ILT
106942009-12-30 Ian Lance Taylor <iant@google.com>
10695
10696 PR 10861
10697 * script.h (class Version_script_info): Define Language enum.
10698 Update declarations. Define Glob, Exact, and Lookup types. Add
10699 new fields globals_, locals_, and is_finalized_.
10700 * script.cc: Various formatting fixes.
10701 (class Parser_closure): Change language_stack_ from a vector of
10702 std::string to one of Version_script_info::Language. Adjust all
10703 uses accordingly.
10704 (class Lazy_demangler): Remove.
10705 (struct Version_expression): Change language from std::string to
10706 Version_script_info::Language.
10707 (Version_script_info::Version_script_info): New function.
10708 (Version_script_info::~Version_script_info): Don't call clear.
10709 (Version_script_info::finalize): New function.
10710 (Version_script_info::build_lookup_tables): New function.
10711 (Version_script_info::build_expression_list_lookup): New
10712 function.
10713 (Version_script_info::get_symbol_version_helper): Rewrite to use
10714 lookup tables.
10715 (Version_script_info::print_expression_list): Adjust to use
10716 Version_script_info::Language.
10717 (script_push_lex_into_version_mode): Check that the version script
10718 has not been finalized.
10719 (version_script_push_lang): Change language string to
10720 Version_script_info::Language.
10721 * options.cc (Command_line::version_script): New function.
10722 * options.h (class General_options): Add finalize_dynamic_list
10723 function. Change version_script from declaration to definition.
10724 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10725 * testsuite/version_script.map: Remove duplicate def of foo.
10726 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10727 version_script.map.
10728 * testsuite/Makefile.in: Rebuild.
10729
818bf354
ILT
107302009-12-30 Ian Lance Taylor <iant@google.com>
10731
10732 PR 10843
10733 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10734 if the input symbol index is 0, make the output symbol index 0.
10735
ebcc8304
ILT
107362009-12-30 Ian Lance Taylor <iant@google.com>
10737
10738 PR 10670
10739 * options.h (class General_options): Add -x/--discard-all.
10740 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10741 --discard-all. If the local symbol needs a dynamic entry, check
10742 that before handling --discard-locals.
10743
176fe33f
ILT
107442009-12-30 Ian Lance Taylor <iant@google.com>
10745
bb321bb1
ILT
10746 PR 10450
10747 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10748 flags to PF_R.
10749 (Output_segment::add_output_section): Don't change the flags if
10750 the type is PT_TLS.
10751
176fe33f
ILT
10752 PR 10450
10753 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10754 GNU hash table if they need a dynamic value. Otherwise, don't add
10755 them if they are defined in a dynamic object or are forced local.
10756
e8cd95c7
ILT
107572009-12-29 Ian Lance Taylor <iant@google.com>
10758
1b81fb71
ILT
10759 PR 10450
10760 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10761 .gnu.hash table for a 32-bit target.
10762
8d6d383d
ILT
10763 PR 10450
10764 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10765 regular and a dynamic object only needs a dynamic symbol table
10766 entry if it is externally visible.
10767
e785ec03
ILT
10768 PR 10450
10769 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10770 constructor. Add global_offset_table_ field.
10771 (Target_i386::got_section): Set global_offset_table_.
10772 (Target_i386::do_finalize_sections): Set global_offset_table_
10773 size.
10774 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10775 in constructor. Add global_offset_table_ field.
10776 (Target_x86_64::got_section): Set global_offset_table_.
10777 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10778 size.
10779
1a2dff53
ILT
10780 * layout.cc (Layout::Layout): Initialize increase_relro_.
10781 (Layout::get_output_section): Add is_relro, is_last_relro, and
10782 is_first_non_relro parameters. Change all callers.
10783 (Layout::choose_output_section): Likewise.
10784 (Layout::add_output_section_data): Likewise.
10785 (Layout::make_output_section): Likewise.
10786 (Layout::set_segment_offsets): Clear increase_relro when using a
10787 linker script.
10788 * layout.h (class Layout): Add increase_relro method. Add
10789 increase_relro_ field. Update declarations.
10790 * output.cc (Output_section::Output_section): Initialize
10791 is_last_relro_ and is_first_non_relro_.
10792 (Output_segment::add_output_section): Group relro sections is
10793 do_sort is true. Handle is_last_relro and is_first_non_relro.
10794 (Output_segment::maximum_alignment): Remove relro handling.
10795 (Output_segment::set_section_addresses): Add increase_relro
10796 parameter. Change all callers. Add initial alignment to align
10797 relro sections on separate page. Remove old relro handling.
10798 (Output_segment::set_section_list_addresses): Remove in_relro
10799 parameter. Change all callers.
10800 (Output_segment::set_offset): Add increase parameter. Change all
10801 callers. Remove old relro handling.
10802 * output.h (class Output_section): Add new methods: is_last_relro,
10803 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10804 Add is_last_relro_ and is_first_non_relro_ fields.
10805 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10806 Create separate .got.plt section. Call increase_relro.
10807 * x86_64.cc (Target_x86_64::got_section): Likewise.
10808 * testsuite/relro_script_test.t: Add .got.plt.
10809
f0ba79e2
ILT
10810 PR 10450
10811 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10812 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10813 (Layout::finalize): Call set_dynamic_symbol_size.
10814 (Layout::set_dynamic_symbol_size): New function.
10815 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10816 set_dynamic_symbol_size.
10817
e8cd95c7
ILT
10818 PR 10450
10819 * output.h (class Output_section): Add is_entsize_zero_ field.
10820 * output.cc (Output_section::Output_section): Initialize
10821 is_entsize_zero_.
10822 (Output_section::set_entsize): If two different entsizes are
10823 requested, force it to zero.
10824 (Output_section::add_input_section): Set flags for .debug_str
10825 before updating section flags. Set entsize.
10826 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10827 and SHF_STRING if all input sections have those flags.
10828
3e1b9a8a
RÁE
108292009-12-29 Rafael Espindola <espindola@google.com>
10830
10831 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10832 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10833 reporting.
3e1b9a8a 10834
3dcad376
ST
108352009-12-29 Sriraman Tallam <tmsriram@google.com>
10836
10837 * options.cc (General_options::parse_version): Allow -v to exit
10838 without an error if there is nothing to link.
10839
084e2665
ILT
108402009-12-29 Ian Lance Taylor <iant@google.com>
10841
10842 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10843 using a version of gcc before 4.1.
10844 * configure: Rebuild.
10845
250acde3
CD
108462009-12-28 Chris Demetriou <cgd@google.com>
10847
10848 * attributes.cc (Output_attributes_section_data::do_write): Use
10849 std::vector::front rather than std::vector::data.
10850
99fff23b
ILT
108512009-12-28 Ian Lance Taylor <iant@google.com>
10852
10853 * symtab.h (class Symbol_table): Add enum Defined.
10854 * resolve.cc (Symbol_table::should_override): Add defined
10855 parameter. Change all callers. Test whether object is NULL
10856 before calling a method on it.
10857 (Symbol_table::report_resolve_problem): Add defined parameter.
10858 Change all callers.
10859 (Symbol_table::should_override_with_special): Likewise.
10860 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10861 parameter. Change all callers.
10862 (Symbol_table::do_define_in_output_data): Likewise.
10863 (Symbol_table::define_in_output_segment): Likewise.
10864 (Symbol_table::do_define_in_output_segment): Likewise.
10865 (Symbol_table::define_as_constant): Likewise.
10866 (Symbol_table::do_define_as_constant): Likewise.
10867 * script.h (class Symbol_assignment): Add is_defsym parameter to
10868 constructor; change all callers.
10869 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10870 parameter. Change all callers. Add is_defsym_ field.
10871 (class Parser_closure): Add parsing_defsym parameter to
10872 constructor; change all callers. Add parsing_defsym accessor
10873 function. Add parsing_defsym_ field.
10874
556bd683
ILT
108752009-12-28 Ian Lance Taylor <iant@google.com>
10876
10877 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10878 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10879
1782c879
ILT
108802009-12-23 Ian Lance Taylor <iant@google.com>
10881
10882 * i386.cc (Target_i386::do_calls_non_split): Recognize
10883 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10884 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10885 -fsplit-stack prologue when using %r11.
1782c879 10886
329ca2b1
ST
108872009-12-21 Sriraman Tallam <tmsriram@google.com>
10888
10889 * options.cc (General_options::parse_version): Make -v continue and do
10890 the link like GNU ld does.
10891
d675ff46
RÁE
108922009-12-17 Rafael Avila de Espindola <espindola@google.com>
10893
10894 * Makefile.am (CCFILES): Add timer.cc.
10895 (HFILES): Add timer.h.
10896 * configure.ac: Check for sysconf and times.
10897 * main.cc: include timer.h.
10898 (main): Use Timer instead of get_run_time.
10899 * timer.cc: New.
10900 * timer.h: New.
10901 * workqueue.cc: include timer.h.
10902 (Workqueue::find_and_run_task):
10903 Report user, sys and wall time.
10904 * Makefile.in: Regenerate.
10905 * config.in: Regenerate.
10906 * configure: Regenerate.
10907
d6344fb5
DK
109082009-12-16 Doug Kwan <dougkwan@google.com>
10909
10910 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10911 sections.
10912 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10913 relaxed input sections.
10914 * output.cc (Output_section::find_relaxed_input_section): Change
10915 return type to Output_relaxed_input_section pointer. Adjust code
10916 for new type of relaxed_input_section_map_.
10917 * output.h (Output_section::find_relaxed_input_section): Change
10918 return type to Output_relaxed_input_section pointer.
10919 (Output_section::Output_relaxed_input_section_by_input_section_map):
10920 New type.
10921 (Output_section::relaxed_input_section_map_): Change type to
10922 Output_section::Output_relaxed_input_section_by_input_section_map.
10923 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10924 input section.
10925
0e0d5469
ILT
109262009-12-15 Ian Lance Taylor <iant@google.com>
10927
10928 * layout.cc (Layout::create_shstrtab): Only write out after input
10929 sections if we are compressing debug sections.
10930
0649a889
ILT
109312009-12-15 Ian Lance Taylor <iant@google.com>
10932
10933 * archive.cc (Archive::add_symbols): Only look up a symbol without
10934 a version if there is, in fact, a version.
10935
2ea97941
ILT
109362009-12-14 Ian Lance Taylor <iant@google.com>
10937
10938 Revert -Wshadow changes, all changes from:
10939 2009-12-11 Doug Kwan <dougkwan@google.com>
10940 2009-12-11 Nick Clifton <nickc@redhat.com>
10941 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10942
b0eec2cc
DK
109432009-12-11 Doug Kwan <dougkwan@google.com>
10944
10945 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10946 due to -Wshadow.
10947 * attributes.cc (Object_attribute::size): Ditto.
10948 (Attributes_section_data::size): Ditto.
10949 (Attributes_section_data::Attributes_section_data): Ditto.
10950 (Output_attributes_section_data::do_write): Ditto.
10951 * attributes.h (Object_attribute::set_type): Ditto.
10952 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10953
91d6fa6a
NC
109542009-12-11 Nick Clifton <nickc@redhat.com>
10955
10956 * archive.cc: Fix shadowed variable warnings.
10957 * arm.cc: Likewise.
10958 * compressed_output.cc: Likewise.
10959 * compressed_output.h: Likewise.
10960 * configure: Likewise.
10961 * dwarf_reader.cc: Likewise.
10962 * dynobj.cc: Likewise.
10963 * dynobj.h: Likewise.
10964 * ehframe.cc: Likewise.
10965 * ehframe.h: Likewise.
10966 * errors.cc: Likewise.
10967 * expression.cc: Likewise.
10968 * fileread.cc: Likewise.
10969 * fileread.h: Likewise.
10970 * freebsd.h: Likewise.
10971 * i386.cc: Likewise.
10972 * icf.cc: Likewise.
10973 * incremental.h: Likewise.
10974 * layout.cc: Likewise.
10975 * layout.h: Likewise.
10976 * mapfile.cc: Likewise.
10977 * merge.cc: Likewise.
10978 * merge.h: Likewise.
10979 * object.cc: Likewise.
10980 * object.h: Likewise.
10981 * options.h: Likewise.
10982 * output.cc: Likewise.
10983 * output.h: Likewise.
10984 * parameters.cc: Likewise.
10985 * plugin.cc: Likewise.
10986 * powerpc.cc: Likewise.
10987 * reduced_debug_output.cc: Likewise.
10988 * reduced_debug_output.h: Likewise.
10989 * reloc.cc: Likewise.
10990 * reloc.h: Likewise.
10991 * resolve.cc: Likewise.
10992 * script-sections.cc: Likewise.
10993 * script.cc: Likewise.
10994 * script.h: Likewise.
10995 * sparc.cc: Likewise.
10996 * symtab.cc: Likewise.
10997 * symtab.h: Likewise.
10998 * target-select.cc: Likewise.
10999 * target-select.h: Likewise.
11000 * token.h: Likewise.
11001 * workqueue.cc: Likewise.
11002 * workqueue.h: Likewise.
11003 * x86_64.cc: Likewise.
11004
a0351a69
DK
110052009-12-10 Doug Kwan <dougkwan@google.com>
11006
11007 * arm.cc (attributes.h): New include.
11008 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11009 (Arm_relobj::~Arm_relobj): Delete object pointed by
11010 attributes_section_data_.
11011 (Arm_relobj::attributes_section_data): New method definition.
11012 (Arm_relobj::attributes_section_data_): New data member declaration.
11013 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11014 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11015 attributes_section_data_.
11016 (Arm_dynobj::attributes_section_data): New method definition.
11017 (Arm_dynobj::attributes_section_data_): New data member declaration.
11018 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11019 initialization value of may_use_blx_ to false.
2e702c99 11020 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11021 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11022 object attributes to compute results instead of hard-coding.
11023 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11024 Target_arm::get_secondary_compatible_arch,
11025 Target_arm::set_secondary_compatible_arch
11026 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11027 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11028 New method declarations.
11029 (Target_arm::get_aeabi_object_attribute): New method definition.
11030 (Target_arm::attributes_section_data_): New data member declaration.
11031 (read_arm_attributes_section): New template definition.
11032 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11033 (Arm_dynobj::do_read_symbols): Ditto.
11034 (Target_arm::do_finalize_sections): Merge attributes sections from
11035 input. Check for BLX use after attributes section merging.
11036 Fix __exidx_start and __exidx_end visibility. Create an
11037 .ARM.attributes section if necessary.
11038 (Target_arm::get_secondary_compatible_arch,
11039 Target_arm::set_secondary_compatible_arch,
11040 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11041 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11042 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11043 New method definitions.
11044
b59befec
ILT
110452009-12-09 Ian Lance Taylor <iant@google.com>
11046
11047 * plugin.cc (Plugin::load): Don't cast from void* to a function
11048 pointer.
11049
1276bc89
ILT
110502009-12-09 Ian Lance Taylor <iant@google.com>
11051
11052 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11053 information fields.
11054
2f2de248
L
110552009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11056
11057 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11058 Replace two_file_shared_1.so with two_file_shared_2.so.
11059 * testsuite/Makefile.in: Regenerated.
11060
4f787271
DK
110612009-12-08 Doug Kwan <dougkwan@google.com>
11062
11063 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11064 (HFILES): Add attributes.h and int_encoding.h.
11065 * Makefile.in: Regenerate.
11066 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11067 function definitions to int_encoding.cc
11068 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11069 prototypes to int_encoding.h
11070 * reduced_debug_output.cc (int_encoding.h): New include.
11071 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11072 function definitions to int_encoding.cc
11073 (insert_into_vector, read_from_pointer): Move template definitions to
11074 int_encoding.h
11075 * attributes.cc: New file.
11076 * attributes.h: New file.
11077 * int_encoding.cc: New file.
11078 * int_encoding.h: New file.
11079
20b52f1a
RÁE
110802009-12-07 Rafael Avila de Espindola <espindola@google.com>
11081
11082 PR gold/11055
11083 * incremental-dump.cc (dump_incremental_inputs): New.
11084 (main): Use dump_incremental_inputs.
11085
53d7974c
L
110862009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11087
11088 PR gold/10893
11089 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11090 checking elfcpp::STT_FUNC.
11091 (Target_i386::Relocate::relocate): Likewise.
11092 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11093
11094 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11095 symbols from shared libraries into normal FUNC symbols.
11096
11097 * symtab.h (Symbol): Add is_func and use it.
11098
05a352e6
DK
110992009-12-05 Doug Kwan <dougkwan@google.com>
11100
11101 * arm.cc (Target_arm::arm_info): Initialize new fields
11102 attributes_section and attributes_vendor.
11103 * i386.cc (Target_i386::i386_info): Same.
11104 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11105 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11106 fields attributes_section and attributes_vendor.
53d7974c 11107 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11108 * target.h (Target::attributes_section, Target::attributes_vendor,
11109 Target::is_attributes_section, Target::attribute_arg_type,
11110 Target::attributes_order): New method definitions.
11111 (Target::Target_info::attributes_section,
11112 Target::Target_info::attributes_vendor): New fields.
11113 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11114 virtual method definitions.
11115 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11116 attributes_section and attributes_vendor.
11117 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11118
f4e5969c
DK
111192009-12-05 Doug Kwan <dougkwan@google.com>
11120
11121 * arm.cc: Update comments about interworking and stub generation.
11122 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11123 considered as non-PIC.
11124 (Arm_relocate_functions::base_abs): Fix formatting.
11125 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11126 of function to use GOT entry address instead of offset.
11127 (Target_arm::Scan::global): Issue an error if a symbol would need a
11128 PLT does not get one because it is untyped. Remove code to create
11129 dynamic symbols for relative branches.
11130 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11131 takes unsigned integer instead of boolean.
11132
1abce4a6
L
111332009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11134
11135 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11136 (two_file_test_LDADD): Likewise.
11137 (common_test_1_LDADD): Likewise.
11138 (exception_test_LDADD) Likewise.
11139 (weak_test_LDADD): Likewise.
11140 (many_sections_test_LDADD): Likewise.
11141 (initpri1_LDADD): Likewise.
11142 (script_test_1_LDADD): Likewise.
11143 (script_test_2_LDADD): Likewise.
11144 (justsyms_LDADD): Likewise.
11145 (binary_test_LDADD): Likewise.
11146 (large_LDADD): Likewise.
11147 * testsuite/Makefile.in: Regenerated.
11148
adcf2816 111492009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11150
adcf2816
L
11151 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11152 (Symbol_table::override_with_special): Likewise.
11153 (Symbol_table::add_from_object): Likewise.
11154
28e67f5d
RÁE
111552009-12-04 Rafael Avila de Espindola <espindola@google.com>
11156
11157 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11158 Don't set the data_offset twice.
11159
ae10a101
RÁE
111602009-12-04 Rafael Avila de Espindola <espindola@google.com>
11161
11162 * testsuite/Makefile.in: Regenerate.
11163
f59f41f3
DK
111642009-12-03 Doug Kwan <dougkwan@google.com>
11165
11166 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11167 (Target_arm::do_finalize_sections): Add parameter for symbol table
11168 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11169 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11170 parameter for symbol table pointer.
11171 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11172 an additional parameter for a pointer to symbol table.
11173 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11174 parameter for a symbol table pointer.
11175 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11176 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11177 Ditto.
11178 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11179 parameter for a symbol table pointer.
11180
ca55d848
RÁE
111812009-12-03 Rafael Avila de Espindola <espindola@google.com>
11182
11183 * incremental.cc (Incremental_inputs_header)
11184 (Incremental_inputs_header_write, Incremental_inputs_entry)
11185 (Incremental_inputs_entry_write): Move ...
11186 * incremental.h (Incremental_inputs_header)
11187 (Incremental_inputs_header_write, Incremental_inputs_entry)
11188 (Incremental_inputs_entry_write): here.
11189
3aec4f9c
RÁE
111902009-12-02 Rafael Avila de Espindola <espindola@google.com>
11191
11192 * incremental.cc (make_sized_incremental_binary): Set the target.
11193 Error if it is incompatible.
11194 * output.h (Output_file): Add filename method.
11195
9c0ae74d
RÁE
111962009-12-02 Rafael Avila de Espindola <espindola@google.com>
11197
11198 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11199 from the get_* methods.
11200
a45500ae
RÁE
112012009-12-02 Rafael Avila de Espindola <espindola@google.com>
11202
11203 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11204 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11205 Write 0 for the data_offset of scripts.
11206
325e6408
RÁE
112072009-12-02 Rafael Avila de Espindola <espindola@google.com>
11208
11209 * testsuite/Makefile.am: Add the incremental_test.sh test.
11210 * testsuite/incremental_test.sh: New.
11211 * testsuite/incremental_test_1.c: New.
11212 * testsuite/incremental_test_2.c: New.
11213
954c3e2e
RÁE
112142009-12-01 Rafael Avila de Espindola <espindola@google.com>
11215
703d02da 11216 * incremental-dump.cc (main): Fix typos.
954c3e2e 11217
f8086623
RÁE
112182009-11-27 Rafael Avila de Espindola <espindola@google.com>
11219
11220 PR gold/11025
11221 * incremental-dump.cc (main): Use llu to print 64 bit values.
11222
3b0dd6ac
L
112232009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11224 H.J. Lu <hongjiu.lu@intel.com>
11225
11226 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11227 $(LIBDL).
11228 (incremental_dump_LDADD): Likewise.
11229 * Makefile.in: Regenerated.
11230
a6d1ef57 112312009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11232
a6d1ef57
DK
11233 Revert:
11234
11235 2009-11-25 Doug Kwan <dougkwan@google.com>
11236
11237 * arm.cc (Target_arm::Target_arm): Move method definition
11238 outside of class definition. Add code to handle
11239 --target1-rel, --target1-abs and --target2= options.
11240 (Target_arm::get_reloc_reloc_type): Change method to be
11241 non-static and const.
11242 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11243 New data member declaration.
11244 (Target_arm::Scan::local, Target_arm::Scan::global,
11245 Target_arm::Relocate::relocate,
11246 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11247 Adjust call to Target_arm::get_real_reloc_type.
11248 (Target_arm::get_real_reloc_type): Use command line options
11249 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11250 * options.h (--target1-rel, --target1-abs, --target2): New
11251 ARM-only options.
11252
50aeb7d4
DK
112532009-11-25 Doug Kwan <dougkwan@google.com>
11254
11255 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11256 class definition. Add code to handle --target1-rel, --target1-abs
11257 and --target2= options.
11258 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11259 and const.
11260 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11261 member declaration.
11262 (Target_arm::Scan::local, Target_arm::Scan::global,
11263 Target_arm::Relocate::relocate,
11264 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11265 call to Target_arm::get_real_reloc_type.
11266 (Target_arm::get_real_reloc_type): Use command line options to
11267 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11268 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11269 options.
11270
51938283
DK
112712009-11-25 Doug Kwan <dougkwan@google.com>
11272
11273 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11274 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11275 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11276 formatting.
11277 (Arm_relocate_functions::thm_call): Replace body with a call to
11278 Arm_relocate_functions::thumb_branch_common.
11279 (Arm_relocate_functions::thm_jump24,
11280 Arm_relocate_functions::thm_xpc22): New method definitions.
11281 (Arm_relocate_functions::thumb_branch_common): New method definition.
11282 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11283 operator.
11284 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11285 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11286
e2b8f3c4
RÁE
112872009-11-24 Rafael Avila de Espindola <espindola@google.com>
11288
11289 * Makefile.am: Build incremental-dump
11290 * Makefile.in: Regenerate.
11291 * incremental-dump.cc: New.
11292 * incremental.cc (Incremental_inputs_header_data,
11293 Incremental_inputs_entry_data): Move to incremental.h
11294 * incremental.h: (Incremental_inputs_header_data,
11295 Incremental_inputs_entry_data): Move from incremental.cc
11296
bcba9aec
RÁE
112972009-11-24 Rafael Avila de Espindola <espindola@google.com>
11298
11299 * incremental.cc (Incremental_inputs_header,
11300 Incremental_inputs_header_write, Incremental_inputs_entry,
11301 Incremental_inputs_entry_write): Add a typedef with the data type.
11302
7c3afe08
RÁE
113032009-11-24 Rafael Avila de Espindola <espindola@google.com>
11304
11305 * incremental.cc (Incremental_inputs_header,
11306 Incremental_inputs_header_write, Incremental_inputs_entry,
11307 Incremental_inputs_entry_write): Update comment about which
11308 type has the filed descriptions.
11309
d204b6e9
DK
113102009-11-15 Doug Kwan <dougkwan@google.com>
11311
11312 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11313 (Arm_relocate_functions::arm_branch_common): Change method defintion
11314 in class definition to a method declaration and update list of formal
11315 parameters.
11316 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11317 Arm_relocation_functions::jump24): Adjust call to
11318 Arm_relocate_functions::arm_branch_common. Update list of formal
11319 parameters.
11320 (Arm_relocate_functions::xpc25): New method definition.
11321 (Arm_relocate_functions::arm_branch_common): Move method defintion
11322 out from class definition. Use stubs for mode-switching and extending
11323 branch ranges.
11324 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11325 specially. Change code to enable use of stubs in ARM branches.
11326
43d12afe
DK
113272009-11-10 Doug Kwan <dougkwan@google.com>
11328
11329 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11330 in method declaration.
11331 (Target_arm::relocate_stub): New method declaration.
11332 (Target_arm::default_target): Change to return a pointer instead of
11333 a const reference.
11334 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11335 Target_arm::default_target.
11336 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11337 method definition.
11338 (Target_arm::relocate_section): Adjust view.
11339 (Target_arm::relocate_stub): New method definition.
11340
ac33a407
DK
113412009-11-10 Doug Kwan <dougkwan@google.com>
11342
11343 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11344 a format warning.
11345 * incremental.cc (open_incremental_binary): Initialized local
11346 variables to avoid warnings.
11347 * object.cc (make_elf_object): Ditto.
11348 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11349 a format warning.
e1df38aa 11350
88ee28e9
L
11351009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11352
11353 PR gold/10930
11354 * testsuite/plugin_test.c: Include "config.h".
11355
2daedcd6
DK
113562009-11-09 Doug Kwan <dougkwan@google.com>
11357
11358 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11359 (arm_symbol_value): Remove.
11360 (Arm_relocate_functions::arm_branch_common,
11361 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11362 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11363 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11364 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11365 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11366 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11367 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11368 Arm_relocate_functions::thm_mobw_abs_nc,
11369 Arm_relocate_functions::thm_mov_abs,
11370 Arm_relocate_functions::movw_prel_nc,
11371 Arm_relocate_functions::thm_movt_abs,
11372 Arm_relocate_functions::movt_prel,
11373 Arm_relocate_functions::thm_movw_prel_nc,
11374 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11375 (Target_arm::Relocate::relocate): Only decompose address into two
11376 parts if relocation type uses the thumb-bit and pass the actual
11377 bit instead of a flag indicating that the thumb-bit is used. Adjust
11378 calls to methods in Arm_relocate_functions for this change.
11379
1276bc89 113802009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11381
11382 PR 10925
11383 * reloc.cc: Instantiate
11384 Sized_relobj::initialize_input_to_output_maps and
11385 Sized_relobj:free_input_to_output_maps.
11386
e53ad1b5
ILT
113872009-11-06 Ian Lance Taylor <iant@google.com>
11388
11389 PR 10876
11390 * defstd.cc (in_segment): Set only_if_ref true for "end".
11391
eb44217c
DK
113922009-11-06 Doug Kwan <dougkwan@google.com>
11393
11394 * arm.cc (class Reloc_stub): Correct a comment.
11395 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11396 (Target_arm::scan_section_for_stubs): New method declaration.
11397 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11398 Change methods from private to protected.
11399 (Target_arm::do_may_relax): New method definition.
11400 (Target_arm::do_relax, Target_arm::group_sections,
11401 Target_arm::scan_reloc_for_stub,
11402 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11403 (Target_arm::arm_input_section_map_): New data member declaration.
11404 (Target_arm::scan_reloc_for_stub,
11405 Target_arm::scan_reloc_section_for_stubs,
11406 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11407 Target_arm::do_relax): New method definitions.
11408
5d329b7d
ILT
114092009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11410
11411 * configure.ac: Check for (struct stat)::st_mtim
11412 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11413 * config.in: Regenerate.
11414 * configure: Regenerate.
11415
96a0d71b
ILT
114162009-11-05 Ian Lance Taylor <iant@google.com>
11417
11418 PR 10910
11419 * output.cc (Output_segment::add_output_section): Add missing
11420 return statement.
11421
594c8e5e
ILT
114222009-11-04 Ian Lance Taylor <iant@google.com>
11423
11424 PR 10880
11425 * object.h (class Object): Add is_needed and set_is_needed
11426 methods. Add is_needed_ field. Make bool fields into bitfields.
11427 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11428 defined in a dynamic object and referenced by a regular object,
11429 set is_needed for the dynamic object.
11430 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11431 if the file is marked with as_needed and it is not needed.
11432
22b127cc
ILT
114332009-11-04 Ian Lance Taylor <iant@google.com>
11434
11435 PR 10887
11436 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11437 tags if data is discarded by linker script.
11438 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11439 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11440 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11441 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11442
f5c870d2
ILT
114432009-11-04 Ian Lance Taylor <iant@google.com>
11444
11445 * layout.cc (Layout::get_output_section): Add is_interp and
11446 is_dynamic_linker_section parameters. Change all callers.
11447 (Layout::choose_output_section): Likewise.
11448 (Layout::make_output_section): Likewise.
11449 (Layout::add_output_section_data): Add is_dynamic_linker_section
11450 parameter. Change all callers.
11451 * layout.h (class Layout): Update declarations.
11452 * output.h (class Output_section): Add is_interp, set_is_interp,
11453 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11454 Add is_interp_, is_dynamic_linker_section_ fields. Change
11455 generate_code_fills_at_write_ to a bitfield.
11456 * output.cc (Output_section::Output_sections): Initialize new
11457 fields.
11458 (Output_segment::add_output_section): Add do_sort parameter.
11459 Change all callers.
11460
1ae4d23b
ILT
114612009-11-03 Ian Lance Taylor <iant@google.com>
11462
11463 PR 10860
11464 * options.h (class General_options): Add --warn-common.
11465 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11466 merging two common symbols.
11467 (Symbol_table::should_override): Handle --warn-common when merging
11468 a common symbol with a defined symbol. Use report_resolve_problem
11469 for multiple definitions.
11470 (Symbol_table::report_resolve_problem): New function.
11471 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11472
55da9579
DK
114732009-11-03 Doug Kwan <dougkwan@google.com>
11474
11475 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11476 stub_factory_.
11477 (Target_arm::stub_factory): New method definition.
11478 (Target_arm::new_arm_input_section,
11479 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11480 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11481 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11482 New type definitions.
11483 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11484 member declarations.
11485 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11486 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11487 New method definitions.
11488
37a9ac43
ILT
114892009-11-03 Ian Lance Taylor <iant@google.com>
11490
11491 * options.h (class General_options): Add --warn_constructors.
11492
b3d6a3d4
ILT
114932009-11-03 Ian Lance Taylor <iant@google.com>
11494
11495 PR 10893
11496 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11497 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11498
934b01dd
ILT
114992009-11-03 Ian Lance Taylor <iant@google.com>
11500
11501 PR 10895
11502 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11503 --msgid-bugs-address.
11504 (install-pdf): New target.
11505 (install-data_yes): Look up one directory to find mkinstalldirs.
11506
03c1939b
L
115072009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11508
11509 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11510 tree.
11511
ebd95253
DK
115122009-10-30 Doug Kwan <dougkwan@google.com>
11513
11514 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11515
e9bbb538
DK
115162009-10-30 Doug Kwan <dougkwan@google.com>
11517
11518 * arm.cc (Stub_addend_reader): New struct template definition
11519 and partial specializations.
11520 (Stub_addend_reader::operator()): New method definition for a
11521 partially specialized template.
11522
d5b40221
DK
115232009-10-30 Doug Kwan <dougkwan@google.com>
11524
11525 * arm.cc (Arm_relobj::processor_specific_flags): New method
11526 definition.
11527 (Arm_relobj::do_read_symbols): New method declaration.
11528 (Arm_relobj::processor_specific_flags_): New data member declaration.
11529 (Arm_dynobj): New class definition.
11530 (Target_arm::do_finalize_sections): Add input_objects parameter.
11531 (Target_arm::do_adjust_elf_header): New method declaration.
11532 (Target_arm::are_eabi_versions_compatible,
11533 (Target_arm::merge_processor_specific_flags): New method declaration.
11534 (Target_arm::do_make_elf_object): New overloaded method definitions
11535 and declaration.
11536 (Arm_relobj::do_read_symbols): New method definition.
11537 (Arm_dynobj::do_read_symbols): Ditto.
11538 (Target_arm::do_finalize_sections): Add input_objects parameters.
11539 Merge processor-specific flags from all input objects.
11540 (Target_arm::are_eabi_versions_compatible,
11541 Target_arm::merge_processor_specific_flags,
11542 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11543 New method definitions.
11544 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11545 Input_objects pointer type parameter.
11546 * layout.cc (Layout::finalize): Pass input objects to target's.
11547 finalize_sections function.
11548 * output.cc (Output_file_header::do_sized_write): Set ELF file
11549 header's processor-specific flags.
11550 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11551 Input_objects pointer type parameter.
11552 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11553 * target.h (Input_objects): New forward class declaration.
11554 (Target::processor_specific_flags,
11555 Target::are_processor_specific_flags_sect): New method definitions.
11556 (Target::finalize_sections): Add input_objects parameter.
11557 (Target::Target): Initialize processor_specific_flags_ and
11558 are_processor_specific_flags_set_.
11559 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11560 parameter.
11561 (Target::set_processor_specific_flags): New method definition.
11562 (Target::processor_specific_flags_,
11563 Target::are_processor_specific_flags_set_): New data member
11564 declarations.
11565 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11566 Input_objects pointer type parameter.
11567
ebabffbd
DK
115682009-10-30 Doug Kwan <dougkwan@google.com>
11569
11570 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11571
ad0f2072
ILT
115722009-10-28 Ian Lance Taylor <iant@google.com>
11573
11574 * object.h (class Relobj): Drop options parameter from
11575 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11576 do_scan_relocs, do_relocate. Change all callers.
11577 (class Sized_relobj): Drop options parameters from
11578 do_gc_process_relocs, do_scan_relocs, do_relocate,
11579 do_relocate_sections, relocate_sections, emit_relocs_scan,
11580 emit_relocs_scan_reltype. Change all callers.
11581 (struct Relocate_info): Remove options field and all references to
11582 it.
11583 * reloc.h (class Read_relocs): Remove options constructor
11584 parameter and options_ field. Change all callers.
11585 (class Gc_process_relocs, class Scan_relocs): Likewise.
11586 (class Relocate_task): Likewise.
11587 * target-reloc.h (scan_relocs): Remove options parameter. Change
11588 all callers.
11589 (scan_relocatable_relocs): Likewise.
11590 * target.h (class Sized_target): Remove options parameter from
11591 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11592 all callers.
11593 * gc.h (gc_process_relocs): Remove options parameter. Change all
11594 callers.
11595 * arm.cc: Update functions to remove options parameters.
11596 * i386.cc: Likewise.
11597 * powerpc.cc: Likewise.
11598 * sparc.cc: Likewise.
11599 * x86_64.cc: Likewise.
11600 * testsuite/testfile.cc: Likewise.
11601
8ffa3667
DK
116022009-10-28 Doug Kwan <dougkwan@google.com>
11603
11604 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11605 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11606 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11607 New method definitions.
11608
40f36857
CC
116092009-10-28 Cary Coutant <ccoutant@google.com>
11610
11611 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11612 (Plugin::cleanup_done_): New member.
11613 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11614 (Plugin_manager::cleanup_done_): Remove.
11615 (Plugin_manager::add_input_file): Edit error message.
11616 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11617 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11618
2c849493
ILT
116192009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11620
11621 * fileread.cc: (File_read::View::~View): Use the new
11622 data_ownership_ filed.
11623 (File_read::~File_read): Dispose the new whole_file_view_.
11624 (File_read::open): Mmap the whole file if needed.
11625 (File_read::open): Use whole_file_view_ instead of contents_.
11626 (File_read::find_view): Use whole_file_view_ if applicable.
11627 (File_read::do_read): Use whole_file_view_ instead of contents_.
11628 (File_read::make_view): Use whole_file_view_ instead of contents_,
11629 update File_read::View::View call.
11630 (File_read::find_or_make_view): Update File_read::View::View
11631 call.
11632 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11633 remove contents_
11634 (File_read::View::Data_ownership): New enum.
11635 (File_read::View::View): Replace bool mapped_ with Data_ownership
11636 argument.
11637 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11638 (File_read::View::data_ownership_): New field.
11639 (File_read::contents_): Remove (replaced by whole_file_view_).
11640 (File_read::whole_file_view_): New field.
11641 * options.h (class General_options): Add --keep-files-mapped.
11642
24998053
CC
116432009-10-27 Cary Coutant <ccoutant@google.com>
11644
11645 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11646 * testsuite/Makefile.am (plugin_test_5): New test case.
11647 * testsuite/Makefile.in: Regenerate.
11648
72adc4fa
DK
116492009-10-25 Doug Kwan <dougkwan@google.com>
11650
11651 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11652 from private to protected to allow access by child class.
11653 (Sized_relobj::do_relocate_sections): New method declaration.
11654 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11655 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11656 Sized_relobj::relocate_sections. Instantiate template explicitly
11657 for different target sizes and endianity.
11658
07f508a2
DK
116592009-10-24 Doug Kwan <dougkwan@google.com>
11660
11661 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11662 (Arm_input_section::as_arm_input_section): New method.
11663 (Arm_output_section): New class definition.
11664 (Arm_output_section::create_stub_group,
11665 Arm_output_section::group_sections): New method definitions.
11666
10ad9fe5
DK
116672009-10-22 Doug Kwan <dougkwan@google.com>
11668
11669 * arm.cc (Arm_input_section): New class definition.
11670 (Arm_input_section::init, Arm_input_section:do_write,
11671 Arm_input_section::set_final_data_size,
11672 Arm_input_section::do_reset_address_and_file_offset): New method
11673 definitions.
11674
56ee5e00
DK
116752009-10-21 Doug Kwan <dougkwan@google.com>
11676
11677 * arm.cc (Stub_table, Arm_input_section): New forward class
11678 declarations.
11679 (Stub_table): New class defintion.
11680 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11681 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11682 New method definition.
11683
b569affa
DK
116842009-10-21 Doug Kwan <dougkwan@google.com>
11685
11686 * arm.cc: Update copyright comments.
11687 (Target_arm): New forward class template declaration.
11688 (Arm_address): New type.
11689 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11690 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11691 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11692 constants.
11693 (Insn_template): Same.
11694 (DEF_STUBS): New macro.
11695 (Stub_type): New enum type.
11696 (Stub_template): New class definition.
11697 (Stub): Same.
11698 (Reloc_stub): Same.
11699 (Stub_factory): Same.
11700 (Target_arm::Target_arm): Initialize may_use_blx_ and
11701 should_force_pic_veneer_.
11702 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11703 Target_arm::should_force_pic_veneer,
11704 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11705 Target_arm::using_thumb_only, Target_arm:;default_target): New
11706 method defintions.
11707 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11708 New data member declarations.
11709 (Insn_template::size, Insn_template::alignment): New method defintions.
11710 (Stub_template::Stub_template): New method definition.
11711 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11712 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11713 (Stub_factory::Stub_factory): New method definition.
11714 * gold.h (string_hash): New template.
11715 * output.h (Input_section_specifier::hash_value): Use
11716 gold::string_hash.
11717 (Input_section_specifier::string_hash): Remove.
11718 * stringpool.cc (Stringpool_template::string_hash): Use
11719 gold::string_hash.
11720
6c172549
DK
117212009-10-20 Doug Kwan <dougkwan@google.com>
11722
11723 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11724 symbols of relaxed input sections.
11725 * output.h (Output_section::find_relaxed_input_section): Make
11726 method public.
11727
c5617f2f
DK
117282009-10-16 Doug Kwan <dougkwan@google.com>
11729
11730 * dynobj.cc (Versions::Versions): Initialize version_script_.
11731 Only insert base version symbol definition for a shared object
11732 if version script defines any version versions.
11733 (Versions::define_base_version): New method definition.
11734 (Versions::add_def): Check that base version is not needed.
11735 (Versions::add_need): Define base version lazily.
11736 * dynobj.h (Versions::define_base_version): New method declaration.
11737 (Versions::needs_base_version_): New data member declaration.
11738 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11739 (check_DATA): Add no_version_test.stdout.
11740 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11741 New make rules.
11742 * testsuite/Makefile.in: Regenerate.
11743 * testsuite/no_version_test.c: New file.
11744 * testsuite/no_version_test.sh: Ditto.
11745
3c12dcdb
DK
117462009-10-16 Doug Kwan <dougkwan@google.com>
11747
11748 * expression.cc (class Segment_start_expression): New class definition.
11749 (Segment_start_expression::value): New method definition.
11750 (script_exp_function_segment_start): Return a new
11751 Segment_start_expression.
11752 * gold/script-c.h (script_saw_segment_start_expression): New function
11753 prototype.
11754 * script-sections.cc (Script_sections::Script_sections): Initialize
11755 SAW_SEGMENT_START_EXPRESSION_ to false.
11756 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11757 and -Tbbs options to specify section addresses if given in
11758 command line and no SEGMENT_START expression is seen in a script.
11759 * script-sections.h (Script_sections::saw_segment_start_expression,
11760 Script_sections::set_saw_segment_start_expression): New method
11761 definition.
11762 (Script_sections::saw_segment_start_expression_): New data member
11763 declaration.
11764 * script.cc (script_saw_segment_start_expression): New function.
11765 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11766 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11767 script_test_7.sh and script_test_8.sh.
11768 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11769 script_test_8.stdout.
11770 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11771 (script_test_6, script_test_6.stdout, script_test_7,
11772 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11773 * Makefile.in: Regenerate.
11774 * testsuite/script_test_6.sh: New file.
11775 * testsuite/script_test_6.t: Same.
11776 * testsuite/script_test_7.sh: Same.
11777 * testsuite/script_test_7.t: Same.
11778 * testsuite/script_test_8.sh: Same.
11779
64b1ae37
DK
117802009-10-16 Doug Kwan <dougkwan@google.com>
11781
11782 * output.cc (Output_segment::set_section_list_address): Cast
11783 expressions to unsigned long long type to avoid format warnings.
11784
661be1e2
ILT
117852009-10-15 Ian Lance Taylor <iant@google.com>
11786
12edd763 11787 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11788 dot assignment to script_sections_.
12edd763
ILT
11789 * script-sections.cc (Script_sections::add_dot_assignment):
11790 Initialize if necessary.
11791
68b6574b
ILT
11792 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11793 program headers with no load segment if there is a linker script.
11794
661be1e2
ILT
11795 * layout.cc (Layout::set_segment_offsets): Align the file offset
11796 to the segment aligment for -N or -n with no load segment.
11797 * output.cc (Output_segment::add_output_section): Don't crash if
11798 the first section is a TLS section.
11799 (Output_segment::set_section_list_addresses): Print an error
11800 message if the address moves backward in a linker script.
11801 * script-sections.cc
11802 (Output_section_element_input::set_section_addresses): Don't
11803 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11804 (Orphan_output_section::set_section_addresses): Likewise.
11805
f15f61a7
DK
118062009-10-15 Doug Kwan <dougkwan@google.com>
11807
11808 * layout.cc (Layout::finish_dynamic_section): Generate tags
11809 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11810 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11811 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11812
82bb573a
ILT
118132009-10-14 Ian Lance Taylor <iant@google.com>
11814
11815 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11816 fields.
11817 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11818 data_shdr fields of relinfo.
11819 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11820 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11821 R_386_TLS_LDO_32, adjust based on section flags.
11822 (Target_i386::Relocate::fix_up_ldo): Remove.
11823
374ad285
ILT
118242009-10-13 Ian Lance Taylor <iant@google.com>
11825
11826 Add support for -pie.
11827 * options.h (class General_options): Add -pie and
11828 --pic-executable.
11829 (General_options::output_is_position_independent): Test -pie.
11830 (General_options::output_is_executable): Return true if not shared
11831 and not relocatable.
11832 (General_options::output_is_pie): Remove.
11833 * options.cc (General_options::finalize): Reject incompatible uses
11834 of -pie.
11835 * gold.cc (queue_middle_tasks): A -pie link is not static.
11836 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11837 * symtab.cc (Symbol::final_value_is_known): Return false if
11838 output_is_position_independent.
11839 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11840 output_is_position_independent.
11841 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11842 output_is_position_independent.
11843 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11844 output_is_position_independent.
11845 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11846 two_file_pie_test.
11847 (basic_pie_test.o, basic_pie_test): New targets.
11848 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11849 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11850 (two_file_pie_test): New target.
11851 * testsuite/Makefile.in: Rebuild.
11852 * README: Remove note saying that -pie is not supported.
11853
c6585162
ILT
118542009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11855
11856 * options.h (class General_options): Add -init and -fini.
11857 * layout.cc (Layout::finish_dynamic_section): Emit
11858 given init and fini functions.
11859
032ce4e9
ST
118602009-10-13 Sriraman Tallam <tmsriram@google.com>
11861
11862 * gc.h (gc_process_relocs): Check if icf is enabled using new
11863 function.
11864 * gold.cc (queue_initial_tasks): Likewise.
11865 (queue_middle_tasks): Likewise.
11866 * object.cc (do_layout): Likewise.
11867 * symtab.cc (is_section_folded): Likewise.
11868 * main.cc (main): Likewise.
11869 * reloc.cc (Read_relocs::run): Likewise.
11870 (Sized_relobj::do_scan_relocs): Likewise.
11871 * icf.cc (is_function_ctor_or_dtor): New function.
11872 (Icf::find_identical_sections): Check if function is ctor or dtor when
11873 safe icf is chosen.
11874 * options.h (General_options::icf): Change option to be an enum.
11875 (Icf_status): New enum.
11876 (icf_enabled): New method.
11877 (icf_safe_folding): New method.
11878 (set_icf_status): New method.
11879 (icf_status_): New variable.
11880 * (options.cc) (General_options::finalize): Set icf_status_.
11881 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11882 icf_test and icf_keep_unique_test to use the --icf enum flag.
11883 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11884 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11885
f345227a
ST
118862009-10-12 Sriraman Tallam <tmsriram@google.com>
11887
11888 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11889 includes to gc.h and icf.h.
11890 * arm.cc: Include gc.h.
11891 * gold.cc: Likewise.
11892 * i386.cc: Likewise.
11893 * powerpc.cc: Likewise.
11894 * sparc.cc: Likewise.
11895 * x86_64.cc: Likewise.
11896 * gc.h: Include icf.h.
11897
1c7814ed
ILT
118982009-10-11 Ian Lance Taylor <iant@google.com>
11899
11900 * plugin.cc: Include "gold.h" before other header files.
11901
ae3b5189
CD
119022009-10-10 Chris Demetriou <cgd@google.com>
11903
11904 * options.h (Input_file_argument::Input_file_type): New enum.
11905 (Input_file_argument::is_lib_): Replace with...
11906 (Input_file_argument::type_): New member.
11907 (Input_file_argument::Input_file_argument): Take Input_file_type
11908 'type' rather than boolean 'is_lib' as second argument.
11909 (Input_file_argument::is_lib): Use type_.
11910 (Input_file_argument::is_searched_file): New function.
11911 (Input_file_argument::may_need_search): Handle is_searched_file.
11912 * options.cc (General_options::parse_library): Support -l:filename.
11913 (General_options::parse_just_symbols): Update for Input_file_argument
11914 changes.
11915 (Command_line::process): Likewise.
11916 * archive.cc (Archive::get_file_and_offset): Likewise.
11917 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11918 * script.cc (read_script_file, script_add_file): Likewise.
11919 * fileread.cc (Input_file::Input_file): Likewise.
11920 (Input_file::will_search_for): Handle is_searched_file.
11921 (Input_file::open): Likewise.
11922 * readsyms.cc (Read_symbols::get_name): Likewise.
11923 * testsuite/Makefile.am (searched_file_test): New test.
11924 * testsuite/Makefile.in: Regenerate.
11925 * testsuite/searched_file_test.cc: New file.
11926 * testsuite/searched_file_test_lib.cc: New file.
11927
f3048a1d
ILT
119282009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11929 Ian Lance Taylor <iant@google.com>
11930
11931 * descriptor.cc: Include <cstdio> and "binary-io.h".
11932 (Descriptors::open): Open the files in binary mode always.
11933 * script.cc (Lex::get_token): Treat \r as whitespace.
11934
d4780e57
ILT
119352009-10-09 Ian Lance Taylor <iant@google.com>
11936
11937 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11938
d9a893b8
ILT
119392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11940 Ian Lance Taylor <iant@google.com>
11941
11942 * configure.ac: Check for readv function also.
11943 * fileread.cc (readv): Define if not HAVE_READV.
11944 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11945 does not exist.
11946 * config.in: Regenerate.
11947 * configure: Regenerate.
11948
c0a62865
DK
119492009-10-09 Doug Kwan <dougkwan@google.com>
11950
11951 * layout.cc (Layout::make_output_section): Call target hook to make
11952 ordinary output section.
11953 (Layout::finalize): Adjust parameter list of call the
11954 Target::may_relax().
11955 * layout.h (class Layout::section_list): New method.
11956 * merge.h (Output_merge_base::entsize): Change visibility to public.
11957 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11958 New methods.
11959 (Output_merge_string::do_is_string): New method.
11960 * object.cc (Sized_relobj::do_setup): renamed from
11961 Sized_relobj::set_up.
11962 * object.h (Sized_relobj::adjust_shndx,
11963 Sized_relobj::initializ_input_to_output_maps,
11964 Sized_relobj::free_input_to_output_maps): Change visibilities to
11965 protected.
11966 (Sized_relobj::setup): Virtualize.
11967 (Sized_relobj::do_setup): New method declaration.
11968 (Sized_relobj::invalidate_section_offset,
11969 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11970 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11971 * options.cc (parse_int): New function.
11972 * options.h (parse_int): New declaration.
11973 (DEFINE_int): New macro.
11974 (stub_group_size): New option.
11975 * output.cc (Output_section::Output_section): Initialize memebers
11976 merge_section_map_, merge_section_by_properties_map_,
11977 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11978 (Output_section::add_input_section): Handled deferred code-fill
11979 generation and remove an old comment.
11980 (Output_section::add_relaxed_input_section): New method definition.
11981 (Output_section::add_merge_input_section): Use merge section by
11982 properties map to speed to search. Update merge section maps
11983 as appropriate.
11984 (Output_section::build_relaxation_map): New method definition.
11985 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11986 Same.
11987 (Output_section::relax_input_section): Renamed to
11988 Output_section::convert_input_sections_to_relaxed_sections and change
11989 interface to take a vector of pointers to relaxed sections.
11990 (Output_section::find_merge_section,
11991 Output_section::find_relaxed_input_section): New method definitions.
11992 (Output_section::is_input_address_mapped,
11993 Output_section::output_offset, Output_section::output_address):
11994 Use output section data maps to speed up searching.
11995 (Output_section::find_starting_output_address): Add comments.
11996 (Output_section::do_write,
11997 Output_section::write_to_postprocessing_buffer): Do code-fill
11998 generation as appropriate.
11999 (Output_section::get_input_sections): Invalidate relaxed input section
12000 map.
12001 (Output_section::restore_states): Adjust type of checkpoint .
12002 Invalidate relaxed input section map.
12003 * output.h (Output_merge_base): New class declaration.
12004 (Input_section_specifier): New class defintion.
12005 (class Output_relaxed_input_section) Change base class to
12006 Output_section_data_build.
12007 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12008 base class initializer.
12009 (Output_section::add_relaxed_input_section): New method declaration.
12010 (Output_section::Input_section): Change visibility to protected.
2e702c99 12011 (Output_section::Input_section::relobj,
c0a62865
DK
12012 Output_section::Input_section::shndx): Handle relaxed input sections.
12013 Output_section::input_sections) Change visibility to protected. Also
12014 define overload to return a non-const pointer.
12015 (Output_section::Merge_section_properties): New class defintion.
12016 (Output_section::Merge_section_by_properties_map,
12017 Output_section::Output_section_data_by_input_section_map,
12018 Output_section::Relaxation_map): New types.
12019 (Output_section::relax_input_section): Rename method to
12020 Output_section::convert_input_sections_to_relaxed_sections and change
12021 interface to take a vector of relaxed section pointers.
12022 (Output_section::find_merge_section,
12023 Output_section::find_relaxed_input_section,
12024 Output_section::build_relaxation_map,
12025 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12026 New method declarations.
12027 (Output_section::merge_section_map_
12028 Output_section::merge_section_by_properties_map_,
12029 Output_section::relaxed_input_section_map_,
12030 Output_section::is_relaxed_input_section_map_valid_,
12031 Output_section::generate_code_fills_at_write_): New data members.
12032 * script-sections.cc
12033 (Output_section_element_input::set_section_addresses): Call
12034 current_data_size and addralign methods of relaxed input sections.
12035 (Orphan_output_section::set_section_addresses): Call current_data_size
12036 and addralign methods of relaxed input sections.
12037 * symtab.cc (Symbol_table::compute_final_value): Extract template
12038 from the body of Symbol_table::sized_finalize_symbol.
12039 (Symbol_table::sized_finalized_symbol): Call
12040 Symbol_table::compute_final_value.
12041 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12042 (Symbol_table::compute_final_value): New templated method declaration.
12043 * target.cc (Target::do_make_output_section): New method defintion.
12044 * target.h (Target::make_output_section): New method declaration.
12045 (Target::relax): Add more parameters for input objects, symbol table
12046 and layout. Adjust call to do_relax.
12047 (Target::do_make_output_section): New method declaration.
12048 (Target::do_relax): Add parameters for input objects, symbol table
12049 and layout.
12050
d446d6c4
ILT
120512009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12052
12053 * pread.c: Include stdio.h.
12054
bc06c745
ILT
120552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12056
12057 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12058 defined.
12059
75aea3d0
ILT
120602009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12061
12062 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12063 Change read_shndx type to unsigned int.
12064 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12065 int.
12066 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12067 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12068 Change read_shndx type to unsigned int.
12069 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12070 int.
12071 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12072 * layout.cc (Layout::create_symtab_sections): Cast the result of
12073 local_symcount * symsize to off_t in the gold_assert.
12074
be8fcb75
ILT
120752009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12076
12077 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12078 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12079 R_ARM_BASE_ABS.
12080 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12081 (Arm_relocate_functions::thm_abs5): New function.
12082 (Arm_relocate_functions::abs12): New function.
12083 (Arm_relocate_functions::abs16): New function.
12084 (Arm_relocate_functions::base_abs): New function.
12085 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12086 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12087 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12088 R_ARM_BASE_ABS.
12089 (Scan::global): Likewise.
12090 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12091 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12092 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12093 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12094 R_ARM_BASE_ABS.
12095
c2a122b6
ILT
120962009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12097
12098 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12099 (Arm_relocate_functions::movt_prel): New function.
12100 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12101 (Arm_relocate_functions::thm_movt_prel): New function.
12102 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12103 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12104 (Scan::global, Relocate::relocate): Likewise.
12105 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12106
c4aa1e2d
ILT
121072009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12108
12109 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12110 Incremental_checker.
12111 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12112 unsigned int.
12113 (class Incremental_inputs_header): New class.
12114 (Incremental_inputs_header_writer): Edit comment.
12115 (Incremental_inputs_entry): New class.
12116 (Incremental_inputs_entry_writer): Edit comment.
12117 (Sized_incremental_binary::do_find_incremental_inputs_section):
12118 Add *strtab_shndx parameter, fill it.
12119 (Sized_incremental_binary::do_check_inputs): New method.
12120 (Incremental_checker::can_incrementally_link_output_file): Use
12121 Sized_incremental_binary::check_inputs.
12122 (Incremental_inputs::report_command_line): Save command line in
12123 command_line_.
12124 * incremental.h:
12125 (Incremental_binary::find_incremental_inputs_section): New
12126 method.
12127 (Incremental_binary::do_find_incremental_inputs_section): Add
12128 strtab_shndx parameter.
12129 (Incremental_binary::do_check_inputs): New pure virtual method.
12130 (Sized_incremental_binary::do_check_inputs): Declare.
12131 (Incremental_checker::Incremental_checker): Add incremental_inputs
12132 parameter, use it to initialize incremental_inputs_.
12133 (Incremental_checker::incremental_inputs_): New field.
12134 (Incremental_checker::command_line): New method.
12135 (Incremental_checker::inputs): New method.
12136 (Incremental_checker::command_line_): New field.
12137
c549a694
ILT
121382009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12139
12140 * incremental.cc: Include <cstdarg> and "target-select.h".
12141 (vexplain_no_incremental): New function.
12142 (explain_no_incremental): New function.
12143 (Incremental_binary::error): New method.
12144 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12145 method.
12146 (make_sized_incremental_binary): New function.
12147 (open_incremental_binary): New function.
12148 (can_incrementally_link_file): Add checks if output is ELF and has
12149 inputs section.
12150 * incremental.h: Include "elfcpp_file.h" and "output.h".
12151 (Incremental_binary): New class.
12152 (Sized_incremental_binary): New class.
12153 (open_incremental_binary): Declare.
12154 * object.cc (is_elf_object): Use
12155 elfcpp::Elf_recognizer::is_elf_file.
12156 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12157 * output.h (Output_file::filesize): New method.
12158
fd3c5f0b
ILT
121592009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12160
12161 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12162 New function.
12163 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12164 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12165 function.
12166 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12167 function.
12168 (Arm_relocate_functions::movw_abs_nc): New function.
12169 (Arm_relocate_functions::movt_abs): New function.
12170 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12171 (Arm_relocate_functions::thm_movt_abs): New function.
12172 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12173 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12174 (Scan::global): Likewise.
12175 (Relocate::relocate): Likewise.
12176 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12177
7f5309a5
ILT
121782009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12179
12180 * arm.cc (Arm_relocate_functions::got_prel) New function.
12181 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12182 (Relocate::relocate): Likewise.
12183 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12184
364c7fa5
ILT
121852009-10-06 Ian Lance Taylor <iant@google.com>
12186
12187 * options.h (class General_options): Define
12188 split_stack_adjust_size parameter.
12189 * object.h (class Object): Add uses_split_stack_ and
12190 has_no_split_stack_ fields. Add uses_split_stack and
12191 has_no_split_stack accessor functions. Declare
12192 handle_split_stack_section.
12193 (class Reloc_symbol_changes): Define.
12194 (class Sized_relobj): Define Function_offsets. Declare
12195 split_stack_adjust, split_stack_adjust_reltype, and
12196 find_functions.
12197 * object.cc (Object::handle_split_stack_section): New function.
12198 (Sized_relobj::do_layout): Call handle_split_stack_section.
12199 * dynobj.cc (Sized_dynobj::do_layout): Call
12200 handle_split_stack_section.
12201 * reloc.cc (Sized_relobj::relocate_sections): Call
12202 split_stack_adjust for executable sections in split_stack
12203 objects. Pass reloc_map to relocate_section.
12204 (Sized_relobj::split_stack_adjust): New function.
12205 (Sized_relobj::split_stack_adjust_reltype): New function.
12206 (Sized_relobj::find_functions): New function.
12207 * target-reloc.h: Include "object.h".
12208 (relocate_section): Add reloc_symbol_changes parameter. Change
12209 all callers.
12210 * target.h (class Target): Add calls_non_split method. Declare
12211 do_calls_non_split virtual method. Declare match_view and
12212 set_view_to_nop.
12213 * target.cc: Include "elfcpp.h".
12214 (Target::do_calls_non_split): New function.
12215 (Target::match_view): New function.
12216 (Target::set_view_to_nop): New function.
12217 * gold.cc (queue_middle_tasks): Give an error if mixing
12218 split-stack and non-split-stack objects with -r.
12219 * i386.cc (Target_i386::relocate_section): Add
12220 reloc_symbol_changes parameter.
12221 (Target_i386::do_calls_non_split): New function.
12222 * x86_64.cc (Target_x86_64::relocate_section): Add
12223 reloc_symbol_changes parameter.
12224 (Target_x86_64::do_calls_non_split): New function.
12225 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12226 parameter.
12227 * powerpc.cc (Target_powerpc::relocate_section): Add
12228 reloc_symbol_changes parameter.
12229 * sparc.cc (Target_sparc::relocate_section): Add
12230 reloc_symbol_changes parameter.
12231 * configure.ac: Call AM_CONDITIONAL for the default target.
12232 * configure: Rebuild.
12233 * testsuite/Makefile.am (TEST_AS): New variable.
12234 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12235 (check_DATA): Add split_i386 and split_x86_64 files.
12236 (SPLIT_DEFSYMS): Define.
12237 (split_i386_[1234n].o): New targets.
12238 (split_i386_[124]): New targets.
12239 (split_i386_[1234r].stdout): New targets.
12240 (split_x86_64_[1234n].o): New targets.
12241 (split_x86_64_[124]): New targets.
12242 (split_x86_64_[1234r].stdout): New targets.
12243 (MOSTLYCLEANFILES): Add new executables.
12244 * testsuite/split_i386.sh: New file.
12245 * testsuite/split_x86_64.sh: New file.
12246 * testsuite/split_i386_1.s: New file.
12247 * testsuite/split_i386_2.s: New file.
12248 * testsuite/split_i386_3.s: New file.
12249 * testsuite/split_i386_4.s: New file.
12250 * testsuite/split_i386_n.s: New file.
12251 * testsuite/split_x86_64_1.s: New file.
12252 * testsuite/split_x86_64_2.s: New file.
12253 * testsuite/split_x86_64_3.s: New file.
12254 * testsuite/split_x86_64_4.s: New file.
12255 * testsuite/split_x86_64_n.s: New file.
12256 * testsuite/testfile.cc (Target_test): Update relocation_section
12257 function.
12258 * testsuite/Makefile.in: Rebuild.
12259
e8a9fcda
ILT
122602009-10-06 Ian Lance Taylor <iant@google.com>
12261
12262 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12263 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12264 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12265 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12266 the address on ldo_addrs_.
12267 (Target_i386::Relocate::fix_up_ldo): New function.
12268
e99daf92
ILT
122692009-10-06 Rafael Espindola <espindola@google.com>
12270
12271 * plugin.cc (add_input_library): New.
12272 (Plugin::load): Add add_input_library to tv.
12273 (Plugin_manager::add_input_file): Add the is_lib argument.
12274 (add_input_file): Update call to Plugin_manager::add_input_file.
12275 (add_input_library): New.
12276 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12277
966d4097
DK
122782009-09-30 Doug Kwan <dougkwan@google.com>
12279
12280 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12281 symbol and call Symbol::may_need_copy_reloc to determine if
12282 a copy reloc is needed.
12283 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12284 nocopyreloc is given in command line.
12285 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12286 given in command line.
12287 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12288 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12289 of the removed Target_i386::may_need_copy_reloc.
12290 * options.h (copyreloc): New option with default value false.
12291 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12292 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12293 instead of the removed Target_powerpc::may_need_copy_reloc.
12294 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12295 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12296 instead of the removed Target_sparc::may_need_copy_reloc.
12297 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12298 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12299 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12300 instead of the removed Target_x86_64::may_need_copy_reloc.
12301
029ba973
ILT
123022009-09-30 Ian Lance Taylor <iant@google.com>
12303
12304 * object.h (class Object): Remove target_ field, and target,
12305 sized_target, and set_target methods.
12306 (Object::sized_target): Remove.
12307 (class Sized_relobj): Update declarations. Remove sized_target.
12308 * object.cc (Sized_relobj::setup): Remove target parameter.
12309 Change all callers.
12310 (Input_objects::add_object): Don't do anything with the target.
12311 (make_elf_sized_object): Add punconfigured parameter. Change all
12312 callers. Set or test parameter target.
12313 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12314 Change all callers.
12315 * parameters.cc (Parameters::set_target): Change parameter type to
12316 be non-const.
12317 (Parameters::default_target): Remove.
12318 (set_parameters_target): Change parameter type to be non-const.
12319 (parameters_force_valid_target): New function.
12320 (parameters_clear_target): New function.
12321 * parameters.h (class Parameters): Update declarations. Remove
12322 default_target method. Add sized_target and clear_target
12323 methods. Change target_ to be non-const.
12324 (set_parameters_target): Update declaration.
12325 (parameters_force_valid_target): Declare.
12326 (parameters_clear_target): Declare.
12327 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12328 as NULL if we aren't searching.
12329 (Add_symbols::run): Don't check for compatible target.
12330 * fileread.cc (Input_file::open_binary): Call
12331 parameters_force_valid_target.
12332 * gold.cc (queue_middle_tasks): Likewise.
12333 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12334 set_target on object.
12335 * dynobj.h (class Sized_dynobj): Update declarations.
12336 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12337 make_elf_object returns NULL.
12338 (Archive::include_member): Don't check whether object target is
12339 compatible.
12340 * output.cc (Output_section::add_input_section): Get target from
12341 parameters.
12342 (Output_section::relax_input_section): Likewise.
12343 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12344 parameters.
12345 (Sized_relobj::do_scan_relocs): Likewise.
12346 (Sized_relobj::relocate_sections): Likewise.
12347 * resolve.cc (Symbol_table::resolve): Likewise.
12348 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12349 parameter. Change all callers.
12350 (Symbol_table::add_from_object): Get target from parameters.
12351 (Symbol_table::add_from_relobj): Don't check object target.
12352 (Symbol_table::add_from_dynobj): Likewise.
12353 (Symbol_table::define_special_symbol): Get target from
12354 parameters.
12355 * symtab.h (class Symbol_table): Update declaration.
12356 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12357 parameter. Change all callers. Clear parameter target.
12358 (Binary_test): Test target here.
12359 * testsuite/object_unittest.cc (gold_testsuite): Remove
12360 target_test_pointer parameter. Change all callers.
12361 (Object_test): Test target here.
12362
a6a22b83
ILT
123632009-09-26 Ian Lance Taylor <iant@google.com>
12364
12365 * testsuite/initpri1.c: Don't try to use constructor priorities if
12366 compiling with gcc before 4.3.
12367
6a8f49fe
ILT
123682009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12369
12370 * testsuite/retain_symbols_file_test.sh (check_present): Change
12371 output file name to retain_symbols_file_test.stdout.
12372 (check_absent): Likewise.
12373
8c604651
CS
123742009-09-18 Craig Silverstein <csilvers@google.com>
12375
12376 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12377 * options.cc: Include <cerrno> and <fstream>.
12378 (General_options::finalize): Parse -retain-symbols-file tag.
12379 * options.h: New flag.
12380 (General_options): New method should_retain_symbol, new
12381 variable symbols_to_retain.
12382 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12383 should_retain_symbol map.
12384 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12385 * testsuite/Makefile.in: Regenerate.
12386 * testsuite/retain_symbols_file_test.sh: New file.
12387
ca58b19f
NC
123882009-09-18 Nick Clifton <nickc@redhat.com>
12389
12390 * po/es.po: Updated Spanish translation.
12391
20e6d0d6
DK
123922009-09-17 Doug Kwan <dougkwan@google.com>
12393
12394 * debug.h (DEBUG_RELAXATION): New constant.
12395 (DEBUG_ALL): Add DEBUG_RELAXATION.
12396 (debug_string_to_enum): Add relaxation debug option.
12397 * layout.cc
12398 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12399 Layout::Relaxation_debug_check::read_sections,
12400 Layout::Relaxation_debug_check::read_sections): New method definitions.
12401 (Layout::Layout): Initialize data members
12402 record_output_section_data_from_scrips_,
12403 script_output_section_data_list_ and relaxation_debug_check_.
12404 (Layout::save_segments, Layout::restore_segments,
12405 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12406 Layout::relaxation_loop_body): New method definitions.
12407 (Layout::finalize): Support relaxation. Move section layout code to
12408 Layout::relaxation_loop_body.
12409 (Layout::set_asection_address_from_script): Move code for orphan
12410 section placement out.
12411 (Layout::place_orphan_sections_in_script): New method definition.
12412 * layout.h (Output_segment_headers, Output_file_header):
12413 New forward class declarations.
12414 (Layout::~Layout): Define.
12415 (Layout::new_output_section_data_from_script): New method definition.
12416 (Layout::place_orphan_sections_in_script): New method declaration.
12417 (Layout::Segment_states): New type declaration.
12418 (Layout::save_segments, Layout::restore_segments,
12419 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12420 Layout::relaxation_loop_body): New method declarations.
12421 (Layout::Output_section_data_list): New type declaration.
12422 (Layout::Relaxation_debug_check): New class definition.
12423 (Layout::record_output_section_data_from_script_,
12424 Layout::script_output_section_data_list_, Layout::segment_states_,
12425 Layout::relaxation_debug_check_): New data members.
12426 * output.cc: (Output_section_headers::do_size): New method definition.
12427 (Output_section_headers::Output_section_headers): Move size
12428 computation to Output_section_headers::do_size.
12429 (Output_segment_headers::do_size): New method definition.
e1df38aa 12430 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12431 Output_file_header::do_size and call it.
12432 (Output_file_header::do_size): New method definition.
12433 (Output_data_group::Output_data_group): Adjust call to
12434 Output_section_data.
12435 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12436 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12437 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12438 RELAXED_INPUT_SECTION_CODE.
12439 (Output_section::Output_section): Initialize data member checkpoint_.
12440 (Output_section::~Output_section): Delete checkpoint object pointed
12441 by checkpoint_.
12442 (Output_section::add_input_section): Always add an Input_section if
12443 relaxing.
12444 (Output_section::add_merge_input_section): Add assert.
12445 (Output_section::relax_input_section): New method definition.
12446 (Output_section::set_final_data_size): Set load address to zero for
12447 an unallocated section.
12448 (Output_section::do_address_and_file_offset_have_reset_values):
12449 New method definition.
12450 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12451 Handle relaxed input section.
12452 (Output_section::sort_attached_input_sections): Checkpoint input
12453 section list lazily.
12454 (Output_section::get_input_sections): Change type of input_sections to
12455 list of Simple_input_section pointers. Checkpoint input section list
12456 lazily. Also handle relaxed input sections.
12457 (Output_section::add_input_section_for_script): Take a reference to
12458 a Simple_input_section object instead of Relobj pointer and section
12459 index as parameter. Handle relaxed input sections.
12460 (Output_section::save_states, Output_section::restore_states): New
12461 method definitions.
12462 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12463 (Output_data::is_data_size_fixed): New method definition.
12464 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12465 if it is fixed.
12466 (Output_data::address_and_file_offset_have_reset_values): New method
12467 definition.
12468 (Output_data::do_address_and_file_offset_have_reset_values): New method
12469 definition.
12470 (Output_data::set_data_size): Check that data size is not fixed.
12471 (Output_data::fix_data_size): New method definition.
12472 (Output_data::is_data_size_fixed_): New data member.
12473 (Output_section_headers::set_final_data_size): New method definition.
12474 (Output_section_headers::do_size): New method declaration.
12475 (Output_segment_headers::set_final_data_size): New method definition.
12476 (Output_segment_headers::do_size): New method declaration.
12477 (Output_file_header::set_final_data_size)::New method definition.
12478 (Output_file_header::do_size)::New method declaration.
12479 (Output_section_data::Output_section_data): Add new parameter
12480 is_data_size_fixed and use it to fix data size.
12481 (Output_data_const::Output_data_const): Adjust call to base class
12482 constructor and fix data size.
12483 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12484 base class constructor and fix data size.
12485 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12486 base class constructor and fix data size.
12487 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12488 class constructor and fix data size.
12489 (Output_data_group::set_final_data_size): New method definition.
12490 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12491 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12492 class constructor and fix data size.
12493 (Output_relaxed_input_section): New class definition.
12494 (Output_section::Simple_input_section): New class definition.
12495 (Output_section::get_input_sections): Adjust parameter list.
12496 (Output_section::add_input_section_for_script): Same.
12497 (Output_section::save_states, Output_section::restore_states,
12498 Output_section::do_address_and_file_offset_have_reset_values,
12499 (Output_section::Input_section::Input_section): Handle
12500 RELAXED_INPUT_SECTION_CODE. Add new overload for
12501 Output_relaxed_input_section.
12502 (Output_section::Input_section::is_input_section,
12503 Output_section::Input_section::set_output_section): Handle relaxed
12504 input section.
12505 (Output_section::Input_section::is_relaxed_input_section,
12506 Output_section::Input_section::output_section_data,
12507 Output_section::Input_section::relaxed_input_section): New method
12508 definitions.
12509 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12510 value.
12511 (Output_section::Input_section::u1_): Update comments.
12512 (Output_section::Input_section::u2_): Add new union member poris.
12513 (Output_section::Checkpoint_output_section): New classs definition.
12514 (Output_section::relax_input_section): New method declaration.
12515 (Output_section::checkpoint_): New data member.
12516 (Output_segment): Update comments.
12517 (Output_segment::Output_segment): Un-privatize copy constructor.
12518 (Output_segment::operator=): Un-privatize.
12519 * script-sections.cc (Output_section_element::Input_section_list):
12520 Change element type to Output_section::Simple_input_section.
12521 (Output_section_element_dot_assignment::set_section_addresses):
12522 Register output section data for relaxation clean up.
12523 (Output_data_exression::Output_data_expression): Adjust call to base
12524 constructor to fix data size.
12525 (Output_section_element_data::set_section_addresses): Register
12526 Output_data_expression object for relaxation clean up.
12527 (struct Input_section_info): Replace Relobj pointer and section index
12528 pair with Output_section::Simple_input_section and Convert struct to a
12529 class.
12530 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12531 Input_section_info data member to use accessors.
20e6d0d6
DK
12532 (Output_section_element_input::set_section_addresses): Use layout
12533 parameter. Adjust code to use Output_section::Simple_input_section
12534 and Input_secction_info classes. Register filler for relaxation
12535 clean up.
12536 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12537 and section index pair with Output_section::Simple_input_section
12538 class. Adjust code accordingly.
12539 (Phdrs_element::release_segment): New method definition.
12540 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12541 segment list.
12542 (Script_sections::release_segments): New method definition.
12543 * gold/script-sections.h (Script_sections::release_segments): New
12544 method declaration.
12545 * gold/target.h (Target::may_relax, Target::relax,
12546 Target::do_may_relax, Target::do_relax): New method definitions.
12547
5e445df6
ILT
125482009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12549
12550 * arm.cc (has_signed_unsigned_overflow): New function.
12551 (Arm_relocate_functions::abs8): New function.
12552 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12553 (Target_arm::Scan::global): Likewise.
12554 (Target_arm::relocate::relocate): Likewise.
12555 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12556 Likewise.
12557
8c604651 125582009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12559
12560 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12561 * testsuite/Makefile.in: Regenerate.
12562
1e9cc1c2
NC
125632009-09-11 Nick Clifton <nickc@redhat.com>
12564
12565 * po/gold.pot: Updated by the Translation project.
12566
6a89f575
CC
125672009-09-08 Cary Coutant <ccoutant@google.com>
12568
12569 * output.cc (Output_file::open): Add execute permission to empty file.
12570 * testsuite/Makefile.am (permission_test): New test.
12571 * testsuite/Makefile.in: Regenerate.
12572
fdcac5af
ILT
125732009-09-02 Ian Lance Taylor <iant@google.com>
12574
12575 * output.cc (Output_file::resize): Call map_no_anonymous rather
12576 than map.
12577
44453f85
ILT
125782009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12579
12580 * gold.cc: Include "incremental.h".
12581 (queue_initial_tasks): Call Incremental_checker methods.
12582 * incremental.cc: Include "output.h".
12583 (Incremental_checker::can_incrementally_link_output_file): New
12584 method.
12585 * incremental.h (Incremental_checker): New class.
12586
12587 * output.cc (Output_file::open_for_modification): New method.
12588 (Output_file::map_anonymous): Changed return type to bool. Record
12589 map in base_ field.
12590 (Output_file::map_no_anonymous): New method, broken out of map.
12591 (Output_file::map): Use map_no_anonymous and map_anonymous.
12592 * output.h (class Output_file): Update declarations.
12593
293c1386
CC
125942009-08-24 Cary Coutant <ccoutant@google.com>
12595
12596 * options.h (Command_line::Pre_options): New class.
12597 (Command_line::pre_options): New member.
12598 * options.cc (gold::options::ready_to_register): New variable.
12599 (One_option::register_option): Do nothing if not registering options.
12600 Assert if same short option registered twice.
12601 (General_options::General_options): Turn off option registration when
12602 done constructing.
12603 (Command_line::Pre_options::Pre_options): New constructor.
12604
f773f3d2
CC
126052009-08-24 Cary Coutant <ccoutant@google.com>
12606
06a73cfe
CC
12607 * options.h (General_options::no_keep_memory): Remove incorrect
12608 short option.
f773f3d2 12609
a15af8e2
RW
126102009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12611
12612 * Makefile.am (am__skiplex, am__skipyacc): New.
12613 * Makefile.in: Regenerate.
12614
c462b41b
RW
126152009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12616
14ec8efd
RW
12617 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12618 (INCLUDES): ... this.
12619 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12620 (AM_CPPFLAGS): Renamed from ...
12621 (INCLUDE): ... this.
12622 * Makefile.in, testsuite/Makefile.in: Regenerate.
12623
81ecdfbb
RW
12624 * Makefile.in: Regenerate.
12625 * aclocal.m4: Likewise.
12626 * config.in: Likewise.
12627 * configure: Likewise.
12628 * testsuite/Makefile.in: Likewise.
12629
c462b41b
RW
12630 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12631 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12632 * Makefile.in: Regenerate.
12633 * testsuite/Makefile.in: Regenerate.
12634
2da73f13
CC
126352009-08-19 Cary Coutant <ccoutant@google.com>
12636
12637 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12638 symbols in shared libraries overridden by hidden or internal symbols
12639 in the main program.
12640
2db70501
CD
126412009-08-19 Chris Demetriou <cgd@google.com>
12642
12643 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12644 checking source file names in error messages.
12645
f733487b
DK
126462009-08-18 Doug Kwan <dougkwan@google.com>
12647
12648 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12649 an elcpp::Ehdr as parameter. Adjust call to set_target.
12650 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12651 an elfcpp::Ehdr as parameter.
12652 * object.cc (Object::set_target): Remove the version that looks up
12653 a target and sets it.
12654 (Sized_relobj::setup): Take a Target object instead of
12655 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12656 (make_elf_sized_object): Find target and ask target to
12657 make an ELF object.
12658 * object.h: (Object::set_target): Remove the version that looks up
12659 a target and sets it.
12660 (Sized_relobj::setup): Take a Target object instead of
12661 an elfcpp:Ehdr as parameter.
12662 * target.cc: Include dynobj.h.
12663 (Target::do_make_elf_object_implementation): New.
2e702c99 12664 (Target::do_make_elf_object): New.
f733487b
DK
12665 * target.h (Target::make_elf_object): New template declaration.
12666 (Target::do_make_elf_object): New method declarations.
12667 (Target::do_make_elf_object_implementation): New template declaration.
12668
cc70f101
ILT
126692009-08-14 Ian Lance Taylor <iant@google.com>
12670
12671 * gold.h (FUNCTION_NAME): Define.
12672 (gold_unreachable): Use FUNCTION_NAME.
12673
ef5e0cb1
ST
126742009-08-12 Sriraman Tallam <tmsriram@google.com>
12675
12676 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12677 symbol in the --keep-unique list is not found.
12678
48c187ce
ST
126792009-08-12 Sriraman Tallam <tmsriram@google.com>
12680
12681 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12682 been maked as --keep-unique.
12683 (Icf::unfold_section): New function.
12684 * icf.h (Icf::unfold_section): New function.
12685 * options.h (General_options::keep_unique): New option.
12686 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12687 * testsuite/Makefile.in: Regenerate.
12688 * testsuite/icf_keep_unique_test.sh: New file.
12689 * testsuite/icf_keep_unique_test.cc: New file.
12690
645afe0c
CC
126912009-08-12 Cary Coutant <ccoutant@google.com>
12692
12693 PR 10471
12694 * resolve.cc (Symbol_table::resolve): Check for references from
12695 dynamic objects to hidden and internal symbols.
12696 * testsuite/Makefile.am (hidden_test.sh): New test.
12697 * testsuite/Makefile.in: Regenerate.
12698 * testsuite/hidden_test.sh: New script.
12699 * testsuite/hidden_test_1.c: New test source.
12700 * testsuite/hidden_test_main.c: New test source.
12701
11af873f
DK
127022009-08-11 Doug Kwan <dougkwan@google.com>
12703
12704 * arm.cc: Update comments.
12705 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12706 segment to locate the .ARM.exidx section if present.
12707
b9f7d72d
DK
127082009-08-09 Doug Kwan <dougkwan@google.com>
12709
12710 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12711 patch.
12712
ddd3c53c
ST
127132009-08-07 Sriraman Tallam <tmsriram@google.com>
12714 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12715 compiler warnings.
12716
27721062
ST
127172009-08-06 Sriraman Tallam <tmsriram@google.com>
12718
12719 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12720 valid tls_segment only for non-debug-section relocations.
12721 * testsuite/Makefile.am: Add gc_tls_test.
12722 * testsuite/Makefile.in: Regenerate.
12723 * testsuite/gc_tls_test.cc: New file.
12724 * testsuite/gc_tls_test.sh: New file.
12725
ef15dade 127262009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12727
ef15dade
ST
12728 * icf.cc: New file.
12729 * icf.h: New file.
12730 * Makefile.am (CCFILES): Add icf.cc.
12731 (HFILES): Add icf.h
12732 * Makefile.in: Regenerate.
12733 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12734 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12735 section, symbol and addend information for the relocs.
12736 * gold.cc (queue_middle_tasks): Call identical code folding.
12737 * gold.h: Add defines for multimap.
12738 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12739 to the call of finalize_local_symbols.
12740 * main.cc (main): Create object of class Icf.
12741 * object.cc (Sized_relobj::do_layout): Allow this function to be
12742 called twice during icf.
12743 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12744 to sections marked as identical by icf.
12745 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12746 when available.
12747 (Sized_relobj::do_section_entsize): New function.
12748 * object.h (Object::section_entsize): New function.
12749 (Object::do_section_entsize): New pure virtual function.
12750 (Relobj::finalize_local_symbols): Add new parameter.
12751 (Relobj::do_section_entsize): New function.
12752 * options.h (General_options::icf): New option.
12753 (General_options::icf_iterations): New option.
12754 (General_options::print_icf_sections): New option.
12755 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12756 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12757 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12758 icf.
12759 * symtab.cc (Symbol_table::is_section_folded): New function.
12760 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12761 to sections marked as identical by icf.
12762 * symtab.h (Symbol_table::set_icf): New function.
12763 (Symbol_table::icf): New function.
12764 (Symbol_table::is_section_folded): New function.
12765 (Symbol_table::icf_): New data member.
12766 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12767 * testsuite/Makefile.am: Add commands to build icf_test.
12768 * testsuite/Makefile.in: Regenerate.
12769 * testsuite/icf_test.sh: New file.
12770 * testsuite/icf_test.cc: New file.
12771
c3b65ac4
CD
127722009-07-24 Chris Demetriou <cgd@google.com>
12773
12774 * layout.cc (is_compressible_debug_section): Fix incorrect
12775 comment about compressed section names.
12776
1caf2c51
ILT
127772009-07-20 Ian Lance Taylor <ian@airs.com>
12778
12779 PR 10419
12780 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12781
1ef4d87f
ILT
127822009-07-16 Ian Lance Taylor <iant@google.com>
12783
12784 PR 10400
12785 * layout.h: #include <map>.
12786 (class Kept_section): Change from struct to class. Add accessors
12787 and setters. Add section size to Comdat_group mapping. Change
12788 Comdat_group to std::map. Add is_comdat_ field. Add
12789 linkonce_size field in union.
12790 (class Layout): Update declaration of find_or_add_kept_section.
12791 Don't declare find_kept_object.
12792 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12793 parameter. Add object, shndx, is_comdat, and is_group_name
12794 parameters. Change all callers. Adjust for new Kept_section.
12795 (Layout::find_kept_object): Remove.
12796 * object.cc (Sized_relobj::include_section_group): Update use of
12797 Kept_section. Rename secnum to shndx. Only record
12798 Kept_comdat_section if sections are the same size.
12799 (Sized_relobj::include_linkonce_section): Update use of
12800 Kept_section. Only record Kept_comdat_section if sections are the
12801 same size. Set size of linkonce section.
12802 (Sized_relobj::map_to_kept_section): Update call to
12803 get_kept_comdat_section.
12804 * object.h (class Sized_relobj): Rename fields in
12805 Kept_comdat_section to drop trailing underscores; change object
12806 field to Relobj*. Change Kept_comdat_section_table to store
12807 struct rather than pointer.
12808 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12809 Add kept_object and kept_shndx parameters. Change all callers.
12810 (Sized_relobj::get_kept_comdat_section): Change return type to
12811 bool. Add kept_object and kept_shndx parameters. Change all
12812 callers.
12813 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12814 Layout::find_or_add_kept_section.
12815
37c3b7b0
ILT
128162009-07-09 Ian Lance Taylor <iant@google.com>
12817
12818 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12819 Reserve space in the hash table.
12820
98fa85cb
ILT
128212009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12822
12823 * fileread.cc (File_read::get_mtime): New method.
12824 * fileread.h (Timespec): New structure.
12825 (File_read::get_mtime): New method.
12826 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12827 Renamed from timestamp_nsec.
12828 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12829 Elf_Xword.
e1df38aa 12830 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12831 timestamp_nsec.
e1df38aa 12832 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12833 (Incremental_inputs::report_obejct): Save mtime; style fix.
12834 (Incremental_inputs::report_script): Save mtime; style fix.
12835 (Incremental_inputs::finalize_inputs): Style fix.
12836 (Incremental_inputs::finalize): Style fix.
12837 (Incremental_inputs::create_input_section_data): Store inputs
12838 mtime.
12839 * incremental.h (Incremental_inputs::report_script): Add mtime
12840 argument.
12841 (Incremental_inputs::Input_info::Input_info): Intialize only one
12842 union member.
12843 (Incremental_inputs::Input_info::archive): Move to nameless
12844 union.
12845 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12846 (Incremental_inputs::Input_info::script): Move to nameless union.
12847 (Incremental_inputs::mtime): New field.
12848 * script.cc (read_input_script): Pass file mtime to
12849 Incremental_input.
12850 * script.h (Script_info::inputs): Style fix.
12851
c9d70757
ILT
128522009-07-01 Ian Lance Taylor <ian@airs.com>
12853
12854 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12855 instead of 32.
12856
9c547ec3
ILT
128572009-06-24 Ian Lance Taylor <iant@google.com>
12858
12859 PR 10156
12860 * layout.cc (Layout::choose_output_section): If we find an
12861 existing section, update the flags.
12862 (Layout::create_notes): New function, broken out of
12863 Layout::finalize.
12864 (Layout::finalize): Don't create note sections.
12865 (Layout::create_note): Don't crash if linker script discards
12866 section.
12867 (Layout::create_gold_note): Likewise.
12868 (Layout::create_build_id): Likewise. Don't set
12869 after_input_sections on the section.
12870 (Layout::create_executable_stack_info): Remove target parameter.
12871 Change caller.
12872 * layout.h (class Layout): Declare create_notes. Update
12873 declaration of create_executable_stack_info.
12874 * gold.cc (queue_middle_tasks): Call create_notes.
12875 * output.cc (Output_section::update_flags_for_input_section): Move
12876 here from output.h. If SHF_ALLOC flag is newly set, mark address
12877 invalid.
12878 * output.h (Output_data::mark_address_invalid): New function.
12879 (class Output_section): Only declare, not define,
12880 update_flags_for_input_section. Remove set_flags.
12881
55458500
ILT
128822009-06-24 Ian Lance Taylor <iant@google.com>
12883
12884 * script-sections.cc (Output_section_definition::
12885 set_section_addresses): Rename shadowing local load_address to
12886 laddr.
12887
1307d6cd
ILT
128882009-06-24 Ian Lance Taylor <iant@google.com>
12889
12890 PR 10244
12891 * reloc.cc (relocate_sections): Skip empty relocation sections.
12892
ec3f783e
ILT
128932009-06-23 Ian Lance Taylor <iant@google.com>
12894
12895 PR 10156
12896 * layout.cc (Layout::create_note): Use choose_output_section
12897 rather than make_output_section.
12898
459c9f1c
ILT
128992009-06-23 Ian Lance Taylor <iant@google.com>
12900
12901 PR 10237
12902 * options.cc (General_options::parse_V): Set printed_version_.
12903 (General_options::General_options): Initialize printed_version_.
12904 * options.h (class General_options): Add printed_version_ field.
12905 * gold.cc (queue_initial_tasks): If there are no input files,
12906 don't give a fatal error if we printed the version information.
12907 (queue_middle_tasks): If using -r with a shared object, give a
12908 fatal error rather than an ordinary error.
12909
1518dc8f
ILT
129102009-06-23 Ian Lance Taylor <iant@google.com>
12911
12912 PR 10219
12913 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12914 (Layout::make_output_section): Set have_stabstr_section_ if we see
12915 a .stab*str section.
12916 (Layout::finalize): Call link_stabs_sections.
12917 (Layout::link_stabs_sections): New file.
12918 * layout.h (class Layout): Add have_stabstr_section_ field.
12919 Declare link_stabs_sections.
12920
3d857b98
DK
129212009-06-23 Doug Kwan <dougkwan@google.com>
12922
12923 * Makefile.am (libgold_a_LIBADD): New.
12924 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12925 * Makefile.in: Regenerate.
3d857b98
DK
12926 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12927 * configure: Regenerate.
12928 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12929 * fileread.cc: Include sys/state.h
12930 * gold.h: Declare memmem and strndup if found missing.
12931 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12932
0639a6f6
ILT
129332009-06-23 Ian Lance Taylor <iant@google.com>
12934
12935 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12936 * configure: Rebuild.
12937
8d63875c
ILT
129382009-06-23 Ian Lance Taylor <iant@google.com>
12939
12940 PR 10147
12941 * object.cc (Object::section_contents): Don't try to get a view if
12942 the section has length zero.
12943 (Object::handle_gnu_warning_section): If the section is empty, use
12944 the name of the section as the warning.
12945
f7c8a183
ILT
129462009-06-23 Ian Lance Taylor <iant@google.com>
12947
12948 PR 10133
12949 * stringpool.h (class Stringpool_template): Add optimize_ field.
12950 (Stringpool_template::set_optimize): New function.
12951 * stringpool.cc (Stringpool_template::Stringpool_template):
12952 Initialize optimize_ field.
12953 (Stringpool_template::set_string_offsets): Test local optimize
12954 fild rather than parameter.
12955 * layout.cc (Layout::Layout): Call set_optimize on the section
12956 name stringpool.
12957
e6a307ba
ILT
129582009-06-22 Ian Lance Taylor <iant@google.com>
12959
12960 PR 10030
12961 * yyscript.y: Parse TARGET.
12962 * script.cc (script_set_target): New function.
12963 * script-c.h (script_set_target): Declare.
12964 * options.cc (General_options::string_to_object_format): Rename
12965 from string_to_object_format in anonymous namespace. Change
12966 callers.
12967 * options.h (class General_options): Declare
12968 string_to_object_format.
12969
3ee173de
ILT
129702009-06-22 Ian Lance Taylor <iant@google.com>
12971
12972 * script-sections.cc (Script_sections::create_segments): Don't put
12973 program headers in a PT_LOAD segment if -n or -N.
12974
129752009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12976
12977 PR 10141
12978 * options.h (class General_options): Add -z lazy and -z now. Sort
12979 -z options into alphabetical order.
12980 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12981
cd6739a1 129822009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12983
12984 * layout.cc (Layout::make_output_section): Call
12985 Target::new_output_section.
12986 (Layout::attach_allocated_section_to_segment): Put large section
12987 sections in a separate load segment with the large segment flag
12988 set.
12989 (Layout::segment_precedes): Sort large data segments after other
12990 load segments.
12991 (align_file_offset): New static function.
12992 (Layout::set_segment_offsets): Use align_file_offset.
12993 * output.h (class Output_section): Add is_small_section_ and
12994 is_large_section_ fields.
12995 (Output_section::is_small_section): New function.
12996 (Output_section::set_is_small_section): New function.
12997 (Output_section::is_large_section): New function.
12998 (Output_section::set_is_large_section): New function.
12999 (Output_section::is_large_data_section): New function.
13000 (class Output_segment): Add is_large_data_segment_ field.
13001 (Output_segment::is_large_data_segment): New function.
13002 (Output_segment::set_is_large_data_segment): New function.
13003 * output.cc (Output_section::Output_section): Initialize new
13004 fields.
13005 (Output_segment::Output_segment): Likewise.
13006 (Output_segment::add_output_section): Add assertion that large
13007 data sections always go in large data segments. Force small data
13008 sections to the end of the list of data sections. Force small BSS
13009 sections to the start of the list of BSS sections. For large BSS
13010 sections to the end of the list of BSS sections.
13011 * symtab.h (class Symbol): Declare is_common_shndx.
13012 (Symbol::is_defined): Check Symbol::is_common_shndx.
13013 (Symbol::is_common): Likewise.
13014 (class Symbol_table): Define enum Commons_section_type. Update
13015 declarations. Add small_commons_ and large_commons_ fields.
13016 * symtab.cc (Symbol::is_common_shndx): New function.
13017 (Symbol_table::Symbol_table): Initialize new fields.
13018 (Symbol_table::add_from_object): Put small and large common
13019 symbols in the right list.
13020 (Symbol_table::sized_finalized_symbol): Check
13021 Symbol::is_common_shndx.
13022 (Symbol_table::sized_write_globals): Likewise.
13023 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13024 common symbol lists. Don't call do_allocate_commons_list if the
13025 list is empty.
13026 (Symbol_table::do_allocate_commons_list): Remove is_tls
13027 parameter. Add comons_section_type parameter. Change all
13028 callers. Handle small and large common symbols.
13029 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13030 Symbol::is_common_shndx.
13031 * resolve.cc (symbol_to_bits): Likewise.
13032 * target.h (Target::small_common_shndx): New function.
13033 (Target::small_common_section_flags): New function.
13034 (Target::large_common_shndx): New function.
13035 (Target::large_common_section_flags): New function.
13036 (Target::new_output_section): New function.
13037 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13038 small_common_section_flags, and large_common_section_flags
13039 fields.
13040 (Target::do_new_output_section): New virtual function.
13041 * arm.cc (Target_arm::arm_info): Initialize new fields.
13042 * i386.cc (Target_i386::i386_info): Likewise.
13043 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13044 Likewise.
13045 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13046 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13047 (Target_x86_64::do_new_output_section): New function.
13048 * configure.ac: Define conditional MCMODEL_MEDIUM.
13049 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13050 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13051 (large_LDFLAGS): Define.
13052 * testsuite/large.c: New file.
13053 * testsuite/testfile.cc (Target_test::test_target_info):
13054 Initialize new fields.
13055 * configure, testsuite/Makefile.in: Rebuild.
13056
bb04269c
DK
130572009-06-05 Doug Kwan <dougkwan@google.com>
13058
13059 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13060 * Makefile.in: Regenerate.
bb04269c
DK
13061 * i386.cc (class Target_i386): Define new virtual method to
13062 override do_is_local_label_name in parent.
13063 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13064 local symbols if --discard-locals or -X is given.
13065 * options.h (class General_options): Declare new options
13066 '--discard-locals' and '-X' for discarding locals.
13067 * target.h (class Target): Define new methods is_local_label_name.
13068 Declare new virtual method do_is_local_label_name.
13069 * target.cc: New file.
13070 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13071 (check_SCRIPTS): Add discard_locals_test.sh.
13072 (check_DATA): Add discard_local_tests.syms.
13073 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13074 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13075 * testsuite/Makefile.in: Regenerate.
13076 * testsuite/discard_locals_test.c: New file.
13077 * testsuite/discard_locals_test.sh: Same.
13078
805bb01c
DK
130792009-06-05 Doug Kwan <dougkwan@google.com>
13080
13081 * object.cc (Sized_relobj::Sized_relobj): Initialize
13082 discarded_eh_frame_shndx_ to -1U.
13083 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13084 section.
13085 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13086 a discarded .eh_frame section.
13087 (Sized_relobj::do_finalize_local_symbols): Ditto.
13088 * object.h (class Sized_relobj): Declare new member
13089 discarded_eh_frame_shndx_.
13090 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13091 (local_labels_test.o, local_labels_test): New rules.
13092 * testsuite/Makefile.in: Regenerate.
13093
1dcd334d
DK
130942009-06-04 Doug Kwan <dougkwan@google.com>
13095
13096 * layout.cc (Layout::section_name_mapping): Add mapping for
13097 special ARM sections.
13098
96d49306
DK
130992009-06-03 Doug Kwan <dougkwan@google.com>
13100
13101 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13102 (utils::has_overflow): Same.
13103
dff16297
ILT
131042009-06-03 Ian Lance Taylor <iant@google.com>
13105
13106 * layout.cc (Layout::section_name_mapping): New array, replacing
13107 Layout::linkonce_mapping.
13108 (Layout::section_name_mapping_count): New variable, replacing
13109 Layout::linkonce_mapping_count.
13110 (Layout::linkonce_output_name): Remove.
13111 (Layout::output_section_name): Rewrite.
13112 * layout.h (class Layout): Rename Linkonce_mapping to
13113 Section_name_mapping, linkonce_mapping to section_name_mapping,
13114 linkonce_mapping_count to section_name_mapping_count. Don't
13115 declare linkonce_output_name.
13116
c121c671
DK
131172009-06-03 Doug Kwan <dougkwan@google.com>
13118
13119 * gold/arm.cc (namespace utils): New.
13120 (Target_arm::reloc_is_non_pic): Define new method.
13121 (class Arm_relocate_functions): New.
13122 (Target_arm::Relocate::relocate): Handle relocation types used by
13123 Android.
13124
07800fab
ILT
131252009-06-03 Ian Lance Taylor <iant@google.com>
13126
13127 * arm.cc (Target_arm::scan::global): Use || instead of |.
13128
c121c671
DK
131292009-06-02 Doug Kwan <dougkwan@google.com>
13130
13131 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13132 issued_non_pic_error_.
13133 (class Target_arm::Scan): Declare new method check_non_pic.
13134 Define new method symbol_needs_plt_entry.
13135 Declare new data member issued_non_pic_error_.
13136 (class Target_arm::Relocate): Declare new method
13137 should_apply_static_reloc.
13138 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13139 (Target_arm::Scan::check_non_pic): Define new method.
13140 (Target_arm::Scan::local): Handle a small subset of reloc types used
13141 by Android.
13142 (Target_arm::Scan::local): Same.
13143 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13144
b19b0c6d
ILT
131452009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13146
13147 * incremental.cc (Incremental_inputs::report_command_line): Filter
13148 out --incremental-* options.
13149
94cdfcff
DK
131502009-05-29 Doug Kwan <dougkwan@google.com>
13151
13152 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13153 template class.
13154 (class Target_arm): Update comment.
13155 (Target_arm::Target_arm): Initialize new data members GOT_,
13156 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13157 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13158 and Target_arm::rel_dyn_section.
13159 Declare new_enum Target_arm::Got_type.
13160 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13161 and DYNBSS_.
13162 Update commments for member do_dynsym_value.
13163 (Target_arm::got_size, Target_arm::plt_section,
13164 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13165 new methods inside class defintion.
13166 (Target_arm::got_section): Define new method.
13167 (Target_arm::rel_dyn_section): Same.
13168 (Output_data_plt_arm): New template class.
13169 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13170 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13171 (Output_data_plt_arm::add_entry): Same.
13172 (Output_data_plt_arm::first_plt_entry): Define new
13173 static data member for PLT instruction template.
13174 (Output_data_plt_arm::plt_entry): Same.
13175 (Output_data_plt_arm::do_write): Define new method.
13176 (Target_arm::make_plt_entry): Same.
13177 (Target_arm::do_finalize_sections): Same.
13178 (Target_arm::do_dynsym_value): Same.
13179
4a657b0d
DK
131802009-05-28 Doug Kwan <dougkwan@google.com>
13181
13182 * Makefile.am (TARGETSOURCES): Add arm.cc.
13183 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13184 * Makefile.in: Regenerate.
13185 * arm.cc: New file.
13186 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13187
e7ae8c36
DK
131882009-05-26 Doug Kwan <dougkwan@google.com>
13189
13190 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13191 (General_options::check_excluded_libs): Strip off directories in
13192 archive name before matching like GNU ld does.
13193 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13194 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13195 (exclude_libs_test_LDFLAGS): Add linker option
13196 -Wl,--exclude-libs,libexclude_libs_test_3
13197 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13198 an explicit archive without using -l.
13199 (alt/libexclude_libs_test_3.a): New make rule.
13200 * testsuite/Makefile.in: Regenerate.
13201 * testsuite/exclude_libs_test.c : Declare lib3_default().
13202 (main): Call it.
13203 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13204 * exclude_libs_test_3.c: New file.
13205
f12e7348
NC
132062009-05-26 Nick Clifton <nickc@redhat.com>
13207
13208 * po/id.po: New Indonesian translation.
13209 * po/gold.pot: Updated template file.
13210
4daadc0d
ST
132112009-05-22 Sriraman Tallam <tmsriram@google.com>
13212
e1df38aa 13213 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13214 gc_comdat_test files. Add -Wl,--gc-sections to build
13215 gc_comdat_test.
13216 * testsuite/Makefile.in: Regenerate.
13217 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13218
531813ad
ST
132192009-05-21 Sriraman Tallam <tmsriram@google.com>
13220
13221 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13222 kept comdat section was garbage collected.
13223 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13224 * testsuite/Makefile.in: Regenerate.
13225 * testsuite/gc_comdat_test.sh: New file.
13226 * testsuite/gc_comdat_test_1.cc: New file.
13227 * testsuite/gc_comdat_test_2.cc: New file.
13228
65514900
CC
132292009-05-19 Doug Kwan <dougkwan@google.com>
13230
13231 * archive.cc (Archive::Archive): Move constructor from archive.h
13232 to here. Initialize no_export_.
13233 (Archive::get_elf_object_for_member): Set no_export flag of object.
13234 * archive.h (Archive::Archive): Move constructor body to
13235 archive.cc.
13236 (Archive::no_export): New method.
13237 (Archive::no_export_): New field.
13238 * object.h (Object::Object): Initialize no_export_ to false.
13239 (Object::no_export, Object::set_no_export): New methods.
13240 (Object::no_export_): New field.
13241 * options.cc (General_options::parse_exclude_libs): New method.
13242 (General_options::check_excluded_libs) Same.
13243 * options.h (exclude_libs): New option.
13244 (General_options::check_excluded_libs): New method declaration.
13245 (General_options::excluded_libs_): New field.
13246 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13247 default or protected visibility if an object has no-export flag set.
13248 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13249 (check_SCRIPTS): Add exclude_libs_test.sh.
13250 (check_DATA): Add exclude_libs_test.syms.
13251 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13252 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13253 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13254 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13255 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13256 libexclude_libs_test_2.a): New rules.
13257 * testsuite/Makefile.in: Regenerate.
13258 * testsuite/exclude_libs_test.c: New file.
13259 * testsuite/exclude_libs_test.sh: Ditto.
13260 * testsuite/exclude_libs_test_1.c: Ditto.
13261 * testsuite/exclude_libs_test_2.c: Ditto.
13262
1b77ea50
ILT
132632009-05-15 Ian Lance Taylor <iant@google.com>
13264
13265 * configure.ac: Check for declarations for cases where libiberty.h
13266 checks HAVE_DECL_xxx.
13267 * configure, config.in: Rebuild.
13268
072fe7ce
ILT
132692009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13270
13271 * gold.h (Incremental_argument_list): Remove (invalid) forward
13272 declaration.
13273 * incremental.cc (Incremental_inputs::report_achive): New method.
13274 (Incremental_inputs::report_object): New method.
13275 (Incremental_inputs::report_script): New method.
13276 (Incremental_inputs::finalize_inputs): New method.
13277 (Incremental_inputs::finalize): Call finalize_inputs().
13278 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13279 Create inputs entries.
13280 * incremental.h (Incremental_input_type): New enum.
13281 (Incremental_inputs::Incremental_input): Initialize new fields.
13282 (Incremental_inputs::report_inputs): New method.
13283 (Incremental_inputs::report_achive): New method.
13284 (Incremental_inputs::report_object): New method.
13285 (Incremental_inputs::report_script): New method.
13286 (Incremental_inputs::finalize_inputs): New method.
13287 (Incremental_inputs::Input_info): New struct.
13288 (Incremental_inputs::Input_info_map): New typedef.
13289 (Incremental_inputs::lock_): New field.
13290 (Incremental_inputs::Inputs_): New field.
13291 (Incremental_inputs::Inputs_map): New field.
13292 * main.cc (main): Call Incremental_input::report_inputs.
13293 * options.h (Input_argument_list): Typedef moved from
13294 Input_arguments.
13295 (Input_file_group::Files): Remove, use ::Input_argument_list.
13296 (Input_file_group::Input_argument_list): Remove, use
13297 ::Input_argument_list.
13298 * plugin.cc (Plugin_manager::add_input_file): Add error in
13299 incremental build.
13300 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13301 functions.
13302 * script.cc (read_input_script): Call
13303 Incremental_input::report_script.
13304 * script.h (Script_info): New class.
13305
b0481b0b
ILT
133062009-04-27 Ian Lance Taylor <iant@google.com>
13307
13308 * x86_64.cc (do_adjust_output_section): Set entsize to
13309 plt_entry_size.
13310
b22a5a41 133112009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13312
13313 * output.cc (Output_file::close): After short writes, continue
13314 writing from the correct offset in the buffer being written.
13315
40fde488
CD
133162009-04-23 Chris Demetriou <cgd@google.com>
13317
13318 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13319 * configure: Regenerate.
13320 * config.in: Regenerate.
13321 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13322 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13323
3ce2c28e
ILT
133242009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13325
13326 * incremental.cc (Incremental_inputs_header_data): Renamed from
13327 Incremental_input_header_data.
13328 (Incremental_inputs_header_data::data_size): New field.
13329 (Incremental_inputs_header_data::put_input_file_count): Renamed
13330 from input_file_count.
13331 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13332 from command_line_offset.
13333 (Incremental_inputs_header_data::put_reserved): Renamed from
13334 put_reserved.
13335 (Incremental_inputs_entry_data): Renamed from
13336 Incremental_input_entry_data.
13337 (Incremental_inputs_entry_data::data_size): New field.
13338 (Incremental_inputs::report_command_line): New method.
13339 (Incremental_inputs::finalize): New method.
13340 (Incremental_inputs::create_incremental_inputs_data): New method.
13341 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13342 * incremental.h: New file.
13343 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13344 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13345 incremental builds.
703d02da 13346 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13347 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13348 (Layout::create_incremental_info_sections): New method.
13349 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13350 * main.cc (main): Notify Incremental_input of the command line.
13351
e55bde5e
ILT
133522009-04-01 Ian Lance Taylor <iant@google.com>
13353 Mikolaj Zalewski <mikolajz@google.com>
13354
13355 * gold.h (reserve_unordered_map): Define, three versions, one for
13356 each version of Unordered_map.
13357 * layout.cc (Layout::Layout): Remove options parameter. Add
13358 number_of_input_files parameter. Don't initialize options_.
13359 Initialize number_of_input_files_ and resized_signatures_. Move
13360 sections_are_attached_.
13361 (Layout::layout_group): Reserve space for group_signatures_.
13362 (Layout::find_or_add_kept_section): Change name parameter to be a
13363 reference. Resize signatures_ map when it gets large enough.
13364 (Layout::layout_eh_frame): Use parameters->options() instead of
13365 this->options_.
13366 (Layout::make_output_section): Likewise.
13367 (Layout::attach_allocated_section_to_segment): Likewise.
13368 (Layout::finalize, Layout::create_executable_stack): Likewise.
13369 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13370 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13371 * layout.h (class Layout): Update declarations. Remove options_
13372 field. Add number_of_input_files_ and resized_signatures_
13373 fields. Move sections_are_attached_ field.
13374 * main.cc (main): Pass number of input files to Layout
13375 constructor. Don't pass options.
13376
154b857c
ILT
133772009-03-30 Ian Lance Taylor <iant@google.com>
13378
13379 * ffsll.c (ffsll): Correct implementation.
13380
2f35ab9b
ILT
133812009-03-27 Ian Lance Taylor <iant@google.com>
13382
fd03461a
ILT
13383 * ffsll.c: New file.
13384 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13385 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13386 * ftruncate.c (ftruncate): Declare before definition.
13387 * mremap.c (mremap): Likewise.
13388 * pread.c (pread): Likewise.
13389 * configure, Makefile.in, config.in: Rebuild.
13390
2f35ab9b
ILT
13391 * mremap.c: New file.
13392 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13393 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13394 (mremap): Declare if HAVE_MREMAP is not defined.
13395 * configure, Makefile.in, config.in: Rebuild.
13396
33aea2fd
CC
133972009-03-27 Cary Coutant <ccoutant@google.com>
13398
13399 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13400 position independent.
13401 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13402 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13403
6d479619
CC
134042009-03-24 Cary Coutant <ccoutant@google.com>
13405
13406 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13407 an executable.
13408 (needs_dynamic_reloc): Likewise.
13409
afc06bb8
ILT
134102009-03-24 Ian Lance Taylor <iant@google.com>
13411
13412 * yyscript.y (file_cmd): Recognize EXTERN.
13413 (extern_name_list, extern_name_list_body): New nonterminals.
13414 * script.cc (script_add_extern): Define.
13415 * script-c.h (script_add_extern): Declare.
13416
f6060a4d
ILT
134172009-03-24 Rafael Avila de Espindola <espindola@google.com>
13418
13419 * object.cc (is_elf_object): Define.
13420 * object.h (is_elf_object): Declare.
13421 * archive.cc (Archive::get_elf_object_for_member): Call
13422 is_elf_object.
33aea2fd 13423 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13424
26736d8e
ILT
134252009-03-24 Elliott Hughes <enh@google.com>
13426
13427 * output.cc (Output_file::map_anonymous): Define.
13428 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13429 try an anonymous one. Report the size if the mmap fails.
13430 * output.h (class Output_file): Declare map_anonymous.
13431
22fd9730
ILT
134322009-03-24 Ian Lance Taylor <iant@google.com>
13433
13434 * target-select.cc (instantiate_target): Don't acquire the lock if
13435 the instantiated_target_ field has already been set.
13436
cb010894
ILT
134372009-03-23 Ian Lance Taylor <iant@google.com>
13438
7f055c20
ILT
13439 * gold-threads.h (class Initialize_lock): Define.
13440 * gold-threads.cc (class Initialize_lock_once): Define.
13441 (initialize_lock_control): New static variable.
13442 (initialize_lock_pointer): New static variable.
13443 (initialize_lock_once): New static function.
13444 (Initialize_lock::Initialize_lock): Define.
13445 (Initialize_lock::initialize): Define.
13446 * target-select.h: Include "gold-threads.h".
13447 (class Target_selector): Add lock_ and initialize_lock_ fields.
13448 Don't define instantiate_target, just declare it.
13449 * target-select.cc (Target_selector::Target_selector): Initialize
13450 new fields.
13451 (Target_selector::instantiate_target): Define.
13452 * descriptors.h: Include "gold-threads.h".
13453 (class Descriptors): Add initialize_lock_ field.
13454 * descriptors.cc (Descriptors::Descriptors): Initialize new
13455 field.
13456 (Descriptors::open): Use initialize_lock_ field
13457 * errors.h (class Errors): Add initialize_lock_ field.
13458 * errors.cc (Errors::Errors): Initialize new field.
13459 (Errors::initialize_lock): Use initialize_lock_ field.
13460 * powerpc.cc (class Target_selector_powerpc): Remove
13461 instantiated_target_ field. In do_recognize call
13462 instantiate_target rather than do_instantiate_target. In
13463 do_instantiate_target just allocate a new target.
13464 * sparc.cc (class Target_selector_sparc): Likewise.
13465
36959681
ILT
13466 * freebsd.h: New file.
13467 * i386.cc: Include "freebsd.h".
13468 (Target_i386): Derive from Target_freebsd rather than
13469 Sized_target.
13470 (Target_selector_i386): Derive from Target_selector_freebsd rather
13471 than Target_selector.
13472 * x86_64.cc: Include "freebsd.h".
13473 (Target_x86_64): Derive from Target_freebsd rather than
13474 Sized_target.
13475 (Target_selector_x86_64): Derive from Target_selector_freebsd
13476 rather than Target_selector.
13477 * target.h (class Target): Add adjust_elf_header and
13478 do_adjust_elf_header.
13479 * output.cc (Output_file_header:: do_sized_write): Call target
13480 adjust_elf_header routine.
13481 * configure.tgt: Set targ_osabi.
13482 * configure.ac: Define GOLD_DEFAULT_OSABI.
13483 * parameters.cc (Parameters::default_target): Pass
13484 GOLD_DEFAULT_OSABI to select_target.
13485 * target-select.h (class Target_selector): Make instantiate_target
13486 protected rather than private.
13487 * Makefile.am (HFILES): Add freebsd.h.
13488 * configure, Makefile.in, config.in: Rebuild.
13489
cb010894
ILT
13490 * merge.cc (do_add_input_section): Correct pend value. Change
13491 message about last entry not being null terminated from error to
13492 warning.
13493
0e879927
ILT
134942009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13495
13496 * incremental.cc: New file.
13497 * Makefile.am (CCFILES): Add incremental.cc.
13498 * Makefile.in: Rebuild.
13499
41105937
PP
135002009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13501
13502 * layout.cc (Layout::output_section_name): Preserve names
13503 of '.note.' sections.
e1df38aa 13504
60439920
ILT
135052009-03-19 Ian Lance Taylor <iant@google.com>
13506
13507 * descriptors.cc (Descriptors::open): Check that the options are
13508 valid before using them.
13509
0d371ad3
ILT
135102009-03-18 Ian Lance Taylor <iant@google.com>
13511
13512 * script-sections.h: Include <list>.
13513 (class Script_sections): Change Sections_elements from std::vector
13514 to std::list. Typedef public Elements_iterator. Add
13515 orphan_section_placement_, data_segment_align_start_, and
13516 saw_data_segment_align_ fields. Remove data_segment_align_index_
13517 field.
13518 * script-sections.cc (class Orphan_section_placement): New class.
13519 (class Sections_element): Add virtual functions is_relro and
13520 orphan_section_init. Remove virtual function place_orphan_here.
13521 (class Output_section_definition): Add is_relro and
13522 orphan_section_init. Remove place_orphan_here.
13523 (class Orphan_output_section): Likewise.
13524 (Script_sections::Script_sections): Update for field changes.
13525 (Script_sections::data_segment_align): Set saw_data_segment_align_
13526 and data_segment_align_start_, not data_segment_align_index.
13527 (Script_sections::data_segment_relro_end): Check
13528 saw_data_segment_align_. Use data_segment_align_start_ rather
13529 than data_segment_align_index_.
13530 (Script_sections::place_orphan): Rewrite to use
13531 Orphan_section_placement.
13532
9201d894
ILT
135332009-03-17 Ian Lance Taylor <iant@google.com>
13534
9c5b8369
ILT
13535 * archive.cc (Archive::add_symbols): Check for a version attached
13536 to the symbol name in the archive map.
13537 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13538 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13539 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13540 (ver_test_11.a): New target.
13541 * testsuite/Makefile.in: Rebuild.
13542
9201d894
ILT
13543 * configure.ac: Check for chsize and posix_fallocate. Replace
13544 ftruncate.
13545 * ftruncate.c: New file, from gnulib.
13546 * output.cc (posix_fallocate): Define dummy version if not
13547 HAVE_POSIX_FALLOCATE.
13548 (Output_file::map): Call posix_fallocate rather than lseek and
13549 write.
13550 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13551 * configure, Makefile.in, config.in: Rebuild.
13552
ef4ab7a8 135532009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13554
ef4ab7a8
PP
13555 * layout.h (Layout::create_note): Add section_name parameter.
13556 * layout.cc (Layout::create_note): Likewise.
13557 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13558
8c500701
ILT
135592009-03-17 Ian Lance Taylor <iant@google.com>
13560
e85b18e1
ILT
13561 * descriptors.cc: Include "options.h".
13562 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13563 (Descriptors::open): Always use O_CLOEXEC when opening a new
13564 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13565 then set FD_CLOEXEC.
13566
9efe6174
ILT
13567 * sparc.cc (class Target_sparc): Add has_got_section.
13568 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13569 make sure we have a GOT section.
13570
13571 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13572 (Target_sparc::Scan::local): Likewise.
13573 (Target_sparc::Scan::global): Likewise.
13574 (Target_sparc::Relocate::relocate): Likewise.
13575 (Target_sparc::Relocate::relocate_tls): Likewise.
13576
8c500701
ILT
13577 * symtab.cc (Symbol_table::define_default_version): New function,
13578 broken out of add_from_object.
13579 (Symbol_table::add_from_object): Call define_default_version.
13580 (Symbol_table::define_special_symbol): Add resolve_oldsym
13581 parameter. Change all callers. If the version for a symbol comes
13582 from a version script, resolve it with the symbol with the same
13583 name with no version. Also add the symbol without a version if
13584 appropriate.
13585 (do_define_in_output_data): If resolving with oldsym, don't delete
13586 sym.
13587 (do_define_in_output_segment): Likewise.
13588 (do_define_as_constant): Likewise.
13589 * symtab.h (class Symbol_table): Update declarations.
13590
f1ed28fb
ILT
135912009-03-13 Ian Lance Taylor <iant@google.com>
13592
15f8229b
ILT
13593 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13594 (Read_symbols::requeue): New function.
13595 (Read_symbols::do_read_symbols): If make_elf_object fails because
13596 the target type is not configured, and the file was searched for,
13597 issue a warning and retry with the next directory.
13598 (Add_symbols::run): If the file has an incompatible format, and
13599 it was searched for, requeue the Read_symbols task. On error,
13600 release the object.
13601 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13602 dirindex parameter to constructor. Change all callers. Declare
13603 incompatible_warning and requeue.
13604 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13605 input_argument_ and input_group_ fields. Add them to
13606 constructor. Change all callers.
13607 (class Read_script): Add dirindex_ field. Add it to constructor.
13608 Change all callers.
13609 * archive.cc (Archive::setup): Remove input_objects parameter.
13610 Change all callers.
13611 (Archive::get_file_and_offset): Likewise.
13612 (Archive::read_all_symbols): Likewise.
13613 (Archive::read_symbols): Likewise.
13614 (Archive::get_elf_object_for_member): Remove input_objects
13615 parameter. Add punconfigured parameter. Change all callers.
13616 (Archive::add_symbols): Change return type to bool. Check return
13617 value of include_member.
13618 (Archive::include_all_members): Likewise.
13619 (Archive::include_member): Change return type to bool. Return
13620 false if first included object has incompatible target. Set
13621 included_member_ field.
13622 (Add_archive_symbols::run): If add_symbols returns false, requeue
13623 Read_symbols task.
13624 * archive.h (class Archive): Add included_member_ field.
13625 Initialize it in constructor. Add input_file and searched_for
13626 methods. Update declarations.
13627 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13628 input_argument_ fields. Add them to constructor. Change all
13629 callers.
13630 * script.cc: Include "target-select.h".
13631 (class Parser_closure): Add skip_on_incompatible_target_ and
13632 found_incompatible_target_ fields. Add
13633 skip_on_incompatible_target parameter to constructor. Change all
13634 callers. Add methods skip_on_incompatible_target,
13635 clear_skip_on_incompatible_target, found_incompatible_target, and
13636 set_found_incompatible_target.
13637 (read_input_script): Add dirindex parameter. Change all callers.
13638 If parser finds an incompatible target, requeue Read_symbols
13639 task.
13640 (script_set_symbol): Clear skip_on_incompatible_target in
13641 closure.
13642 (script_add_assertion, script_parse_option): Likewise.
13643 (script_start_sections, script_add_phdr): Likewise.
13644 (script_check_output_format): New function.
13645 * script.h (read_input_script): Update declaration.
13646 * script-c.h (script_check_output_format): Declare.
13647 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13648 (ignore_cmd): Remove OUTPUT_FORMAT.
13649 * fileread.cc (Input_file::Input_file): Add explicit this.
13650 (Input_file::will_search_for): New function.
13651 (Input_file::open): Add pindex parameter. Change all callers.
13652 * fileread.h (class Input_file): Add input_file_argument method.
13653 Declare will_search_for. Update declarations.
13654 * object.cc (make_elf_object): Add punconfigured parameter.
13655 Change all callers.
13656 * object.h (class Object): Make input_file public. Add
13657 searched_for method.
13658 (make_elf_object): Update declaration.
13659 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13660 restart search.
13661 * dirsearch.h (class Dirsearch): Update declaration.
13662 * options.h (class General_options): Add --warn-search-mismatch.
13663 * parameters.cc (Parameters::is_compatible_target): New function.
13664 * parameters.h (class Parameters): Declare is_compatible_target.
13665 * workqueue.cc (Workqueue::add_blocker): New function.
13666 * workqueue.h (class Workqueue): Declare add_blocker.
13667
f1ed28fb
ILT
13668 * fileread.cc (Input_file::open): Remove options parameter.
13669 Change all callers.
13670 (Input_file::open_binary): Likewise.
13671 * script.cc (read_input_script): Likewise.
13672 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13673 options parameter from constructor. Change all callers.
13674 (class Read_script): Likewise.
13675 * fileread.h (class Input_file): Update declarations.
13676 * script.h (read_input_script): Update declaration.
13677
34dd024a
NC
136782009-03-10 Nick Clifton <nickc@redhat.com>
13679
13680 * po/es.po: New Spanish translation.
13681
6d71b17c
CC
136822009-03-06 Cary Coutant <ccoutant@google.com>
13683
13684 * options.cc (parse_short_option): Keep dash_z from registering itself.
13685
031cdbed
ILT
136862009-03-03 Ian Lance Taylor <iant@google.com>
13687
13688 PR 9918
13689 * target-reloc.h (relocate_section): Pass output_section to
13690 relocate.
13691 * i386.cc (Target_i386::should_apply_static_reloc): Add
13692 output_section parameter. Change all callers.
13693 (Target_i386::Relocate::relocate): Add output_section parameter.
13694 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13695 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13696 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13697 * testsuite/two_file_shared.sh: New script.
13698 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13699 (check_DATA): Add two_file_shared.dbg.
13700 (two_file_shared.dbg): New target.
13701 * testsuite/Makefile.in: Rebuild.
13702
15d5fa16
ILT
137032009-03-01 Ian Lance Taylor <iant@google.com>
13704
13705 * configure.ac: Check for byteswap.h.
13706 * configure: Rebuild.
13707 * config.in: Rebuild.
13708
8a4c0b0d
ILT
137092009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13710
13711 * layout.cc (Layout::find_or_add_kept_section): New function.
13712 (Layout::add_comdat): Removed.
13713 * layout.h (struct Kept_section): Move out of class Layout.
13714 Remove trailing underscores from field names. Add group_sections
13715 field. Rename group_ field to is_group. Change all uses.
13716 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13717 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13718 comdat_groups_ field.
13719 (Sized_relobj::include_section_group): Use
13720 find_or_add_kept_section and Kept_section::group_sections.
13721 (Sized_relobj::include_linkonce_section): Likewise.
13722 * object.cc (class Sized_relobj): Don't define Comdat_group or
13723 Comdat_group_table. Remove find_comdat_group and
13724 add_comdat_group. Remove comdat_groups_ field.
13725 * plugin.cc (include_comdat_group): Use
13726 Layout::find_or_add_kept_section.
13727
b4ecf66b
ILT
137282009-02-28 Ian Lance Taylor <iant@google.com>
13729
14359ca0
ILT
13730 * README: --gc-sections and map files are now supported. Document
13731 some build requirements.
13732
b4ecf66b
ILT
13733 PR 6992
13734 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13735 relocatable link set the value of the section symbol to zero.
13736 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13737 relocatable link don't include the section address in the local
13738 symbol value.
13739
0602e05a
ILT
137402009-02-27 Ian Lance Taylor <iant@google.com>
13741
fd9d194f
ILT
13742 PR 6811
13743 * options.h (class Search_directory): Add is_system_directory.
13744 (class General_options): Declare is_in_system_directory.
13745 * options.cc (get_relative_sysroot): Make static.
13746 (get_default_sysroot): Make static.
13747 (General_optoins::is_in_system_directory): New function.
13748 * fileread.cc (Input_file::is_in_system_directory): New function.
13749 * fileread.h (class Input_file): Declare is_in_system_directory.
13750 * object.h (class Object): Add is_in_system_directory.
13751 (class Input_objects): Remove system_library_directory_ field.
13752 * object.cc (Input_objects::add_object): Don't set
13753 system_library_directory_.
13754 (input_objects::found_in_system_library_directory): Remove.
13755 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13756 parameter. Change all callers.
13757 (Symbol_table::sized_write_globals): Likewise.
13758 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13759 Call Object::is_in_system_directory.
13760 * symtab.h (class Symbol_table): Update declarations.
13761
61edd21f
ILT
13762 PR 5990
13763 * descriptors.h (Open_descriptor): Add is_on_stack field.
13764 * descriptors.cc (Descriptors::open): If the descriptor is on the
13765 top of the stack, remove it. Initialize is_on_stack field.
13766 (Descriptors::release): Only add pod to stack if it is not on the
13767 stack already.
13768 (Descriptors::close_some_descriptor): Clear stack_next and
13769 is_on_stack fields.
13770
e29e076a
ILT
13771 PR 7091
13772 * output.cc (Output_section::find_starting_output_address): Rename
13773 from starting_output_address; add PADDR parameter; change return
13774 type.
13775 * output.h (class Output_section): Declare
13776 find_starting_output_address instead of starting_output_address.
13777 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13778 section symbol for which we can't find a merge section.
13779
0602e05a
ILT
13780 PR 9836
13781 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13782 hidden or internal, force the symbol to be local.
13783 * resolve.cc (Symbol::override_visibility): Define.
13784 (Symbol::override_base): Use override_visibility.
13785 (Symbol_table::resolve): Likewise.
13786 (Symbol::override_base_with_special): Likewise.
13787 (Symbol_table::override_with_special): If the visibility is hidden
13788 or internal, force the symbol to be local.
13789 * symtab.h (class Symbol): Add set_visibility and
13790 override_visibility.
13791 * testsuite/ver_test_1.sh: New file.
13792 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13793 (check_DATA): Add ver_test_1.syms.
13794 (ver_test_1.syms): New target.
13795 * testsuite/Makefile.in: Rebuild.
13796
401a9a73
CC
137972009-02-25 Cary Coutant <ccoutant@google.com>
13798
13799 * layout.cc (Layout::choose_output_section): Don't rename sections
13800 when using a linker script that has a SECTIONS clause.
13801 * Makefile.in: Regenerate.
13802
13803 * testsuite/Makefile.am (script_test_5.sh): New test case.
13804 * testsuite/Makefile.in: Regenerate.
13805 * testsuite/script_test_5.cc: New file.
13806 * testsuite/script_test_5.sh: New file.
13807 * testsuite/script_test_5.t: New file.
13808
f488e4b0
CC
138092009-02-13 Rafael Avila de Espindola <espindola@google.com>
13810
13811 * archive.cc (Archive::include_member): Update calls to add_symbols.
13812 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13813 the Layout argument.
13814 * dynobj.h (do_add_symbols): Add the Layout argument.
13815 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13816 Layout argument.
13817 * object.h (Object::add_symbols): Add the Layout argument.
13818 (Object::do_add_symbols): Add the Layout argument.
13819 (Sized_relobj::do_add_symbols): Add the Layout argument.
13820 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13821 Unify the two versions.
13822 (Add_plugin_symbols): Remove.
13823 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13824 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13825 (Add_plugin_symbols): Remove.
13826 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13827 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13828 (Add_symbols::run): Make it work with Pulginobj.
13829
89dd1680
ILT
138302009-02-06 Ian Lance Taylor <iant@google.com>
13831
13832 * object.cc (Sized_relobj::do_layout): Make info message start
13833 with lower case letter.
13834
266d0a74
ILT
138352009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13836
602b464e
ILT
13837 * binary.cc: Fix file comment.
13838
266d0a74
ILT
13839 * options.h (enum Incremental_disposition): Define.
13840 (class General_options): Add new options: --incremental,
13841 --incremental_changed, --incremental_unchanged,
13842 --incremental_unknown. Add incremental_disposition_ and
13843 implicit_incremental_ fields.
13844 (General_options::incremental_disposition): New function.
13845 (class Position_dependent_options): Add incremental_disposition
13846 option.
13847 (Position_dependent_options::copy_from_options): Set incremental
13848 dispositions.
13849 * options.cc (General_options::parse_incremental_changed): New
13850 function.
2e702c99
RM
13851 (General_options::parse_incremental_unchanged): New function.
13852 (General_options::parse_incremental_unknown): New function.
13853 (General_options::General_options): Initialize new fields
266d0a74 13854 incremental_disposition_ and implicit_incremental_.
2e702c99 13855 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13856 without --incremental.
13857
f073bbf7
CD
138582009-02-06 Chris Demetriou <cgd@google.com>
13859
13860 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13861 pointer and to report location as the file name associated with
13862 the symbol.
13863 (gold_undefined_symbol_at_location): New function to replace the
13864 old gold_undefined_symbol functionality.
13865 * target-reloc.h (relocate_section): Update to use
13866 gold_undefined_symbol_at_location.
13867 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13868 Call gold_undefined_symbol function rather than gold_error.
13869 * errors.h (Errors::undefined_symbol): Take location as a
13870 string, rather than calculating it from a relocation.
13871 * errors.cc (Errors::fatal): Print "fatal error:" before the
13872 formatted message.
13873 (Errors::error, Errors::error_at_location): Print "error: "
13874 before the formatted message.
13875 (Errors::undefined_symbol): Take location as a string, rather
13876 than calculating it from a relocation.
13877 (gold_undefined_symbol_at_location): New function akin to
13878 old gold_undefined_symbol, calculates location from relocation.
13879 (gold_undefined_symbol): Change to take only a Symbol pointer
13880 and to report location as the file name associated with the symbol.
13881 * testsuite/debug_msg.sh: Update for changed error messages.
13882 * testsuite/undef_symbol.sh: Likewise.
13883
8e94a90c
ILT
138842009-02-04 Duncan Sands <baldrick@free.fr>
13885
13886 PR 9812
13887 * reduced_debug_output.h
13888 (Output_reduced_debug_abbrev_section::failed): Use format for
13889 gold_warning.
13890 (Output_reduced_debug_info_section::faild): Likewise.
13891
88a0e15b
ILT
138922009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13893
13894 * script.cc (Lazy_demangler): New class.
2e702c99 13895 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13896 symbol only once.
13897
5efc7cd2
CC
138982009-01-29 Cary Coutant <ccoutant@google.com>
13899
13900 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13901 to __tls_get_addr.
13902 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13903
e0ebcf42
ILT
139042009-01-28 Ian Lance Taylor <iant@google.com>
13905
5efc7cd2 13906 * version.cc (version_string): Bump to 1.9.
75fe7426 13907
e0ebcf42
ILT
13908 * gold.h: Include <cstring> and <stdint.h>.
13909 * version.cc: Include <cstdio>.
13910 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13911 warning.
13912 * reduced_debug_output.cc (insert_into_vector): Rename from
13913 Insert_into_vector; change all callers. Use Swap_unaligned to
13914 avoid aliasing issue; remove union since it is unnecessary.
13915
8e2813be 139162009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13917
13918 * Makefile.am (CCFILES): Add gc.cc.
13919 (HFILES): Add gc.h.
13920 * Makefile.in: Regenerate.
13921 * gold.cc (Gc_runner): New class.
13922 (queue_initial_tasks): Call garbage collection related tasks
13923 when corresponding options are invoked.
13924 (queue_middle_gc_tasks): New function.
13925 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13926 processed early before laying out sections during garbage collection.
13927 * gold.h (queue_middle_gc_tasks): New function.
13928 (is_prefix_of): Move from "layout.cc".
13929 * i386.cc (Target_i386::gc_process_relocs): New function.
13930 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13931 * main.cc (main): Create object of class "Garbage_collection".
13932 * object.cc (Relobj::copy_symbols_data): New function.
13933 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13934 (Sized_relobj::do_layout): Allow this function to be called twice
13935 during garbage collection and defer layout of section during the
6d03d481
ST
13936 first call.
13937 * object.h (Relobj::get_symbols_data): New function.
13938 (Relobj::is_section_name_included): New function.
13939 (Relobj::copy_symbols_data): New function.
13940 (Relobj::set_symbols_data): New function.
13941 (Relobj::get_relocs_data): New function.
13942 (Relobj::set_relocs_data): New function.
13943 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13944 (Relobj::gc_process_relocs): New function.
13945 (Relobj::do_gc_process_relocs): New pure virtual function.
13946 (Relobj::sd_): New data member.
13947 (Sized_relobj::is_output_section_offset_invalid): New function.
13948 (Sized_relobj::do_gc_process_relocs): New function.
13949 * options.h (General_options::gc_sections): Modify to not be a no-op.
13950 (General_options::print_gc_sections): New option.
13951 * plugin.cc (Plugin_finish::run): Remove function call to
13952 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13953 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13954 * reloc.cc (Read_relocs::run): Add task to process relocs and
13955 determine unreferenced sections when doing garbage collection.
13956 (Gc_process_relocs): New class.
13957 (Sized_relobj::do_gc_process_relocs): New function.
13958 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13959 sections that are garbage collected.
13960 * reloc.h (Gc_process_relocs): New class.
13961 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13962 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13963 symbols whose corresponding sections are garbage collected.
13964 (Symbol_table::Symbol_table): Add new parameter for the garbage
13965 collection object.
13966 (Symbol_table::gc_mark_undef_symbols): New function.
13967 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13968 (Symbol_table::gc_mark_dyn_syms): New function.
13969 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13970 as garbage.
13971 (Symbol_table::add_from_object): Likewise.
13972 (Symbol_table::add_from_relobj): When building shared objects, do not
13973 treat externally visible symbols as garbage.
13974 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13975 table information for static and relocatable links.
13976 * symtab.h (Symbol_table::set_gc): New function.
13977 (Symbol_table::gc): New function.
13978 (Symbol_table::gc_mark_undef_symbols): New function.
13979 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13980 (Symbol_table::gc_mark_dyn_syms): New function.
13981 (Symbol_table::gc_): New data member.
e1df38aa 13982 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13983 function.
13984 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13985 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13986
3b293544
CF
139872009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13988
13989 * options.h (General_options::gc_sections): Define as a no-op for now.
13990 (General_options::no_keep_memory): Ditto.
13991 (General_options::Bshareable): Define.
13992 * options.cc (General_options::finalize): Honor -Bshareable.
13993
83d22aa8
AS
139942009-01-20 Andreas Schwab <schwab@suse.de>
13995
13996 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13997 read the value in the contents, since we don't use it. Use the
13998 template endianness when writing.
13999 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14000
cd536b21
AS
140012009-01-19 Andreas Schwab <schwab@suse.de>
14002
14003 * configure.tgt (powerpc64-*): Fix targ_obj.
14004
99e9a495
ILT
140052009-01-15 Ian Lance Taylor <iant@google.com>
14006
14007 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14008 local symbols when stripping all symbols.
14009
bbbfea06
CC
140102009-01-14 Cary Coutant <ccoutant@google.com>
14011
99e9a495 14012 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14013
0f7c0701
CC
140142009-01-14 Cary Coutant <ccoutant@google.com>
14015
14016 * archive.cc (Archive::get_elf_object_for_member): Remove call
14017 to File_read::claim_for_plugin.
14018 * descriptors.cc (Descriptors::open): Remove reference to
14019 is_claimed.
14020 (Descriptors::claim_for_plugin): Remove.
14021 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14022 (Descriptors::is_claimed): Remove.
14023 (claim_descriptor_for_plugin): Remove.
14024 * fileread.cc (File_read::claim_for_plugin): Remove.
14025 * fileread.h (File_read::claim_for_plugin): Remove.
14026 (File_read::descriptor): Reopen descriptor if necessary.
14027 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14028 (Plugin_manager::all_symbols_read): Add task parameter. Change
14029 all callers.
14030 (Plugin_manager::get_input_file): New function.
14031 (Plugin_manager::release_input_file): New function.
14032 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14033 corresponding data member.
14034 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14035 and pass to base constructor. Change all callers.
14036 (get_input_file, release_input_file): New functions.
14037 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14038 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14039 (Plugin_manager::all_symbols_read): Add task parameter.
14040 (Plugin_manager::get_input_file): New function.
14041 (Plugin_manager::release_input_file): New function.
14042 (Plugin_manager::task_): New data member.
14043 (Pluginobj::Pluginobj): Add filesize parameter.
14044 (Pluginobj::filename): New function.
14045 (Pluginobj::descriptor): New function.
14046 (Pluginobj::filesize): New function.
14047 (Pluginobj::filesize_): New data member.
14048 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14049 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14050 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14051
14052 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14053 with archive libraries.
14054 * testsuite/Makefile.in: Regenerate.
14055 * testsuite/plugin_test.c (struct sym_info): New type.
14056 (get_input_file, release_input_file): New static variables.
14057 (onload): Capture new transfer vector entries.
14058 (claim_file_hook): Stop reading at end of file according to filesize.
14059 Factor out parsing of readelf output into separate function.
14060 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14061 APIs and get the source file name from the symbol table. Convert
14062 source file name to corresponding object file name. Print info
14063 message when adding new input files.
14064 (parse_readelf_line): New function.
14065 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14066 * testsuite/plugin_test_2.sh: Likewise.
14067 * testsuite/plugin_test_3.sh: Likewise.
14068 * testsuite/plugin_test_4.sh: New test case.
14069
62a6d109
ILT
140702009-01-07 Ian Lance Taylor <iant@google.com>
14071
14072 * version.cc (version_string): Bump to 1.8.
14073
483620e8
CC
140742008-12-23 Cary Coutant <ccoutant@google.com>
14075
14076 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14077 * plugin.cc (Plugin_manager::finish): Rename as
14078 layout_deferred_objects. Move cleanup to separate function.
14079 (Plugin_manager::cleanup): New function.
14080 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14081 separately.
14082 * plugin.h (Plugin_manager::finish): Rename as
14083 layout_deferred_objects.
14084 (Plugin_manager::cleanup): New function.
14085 (Plugin_manager::cleanup_done): New field.
14086
d66a9eb3
CC
140872008-12-23 Cary Coutant <ccoutant@google.com>
14088
14089 * plugin.cc (is_visible_from_outside): New function.
14090 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14091 so we don't return "IR only" status for exported symbols or -r links.
14092
14093 * testsuite/Makefile.am (plugin_test_3): New test case.
14094 * testsuite/Makefile.in: Regenerate.
14095 * testsuite/plugin_test_3.sh: New file.
14096
5995b570
CC
140972008-12-22 Cary Coutant <ccoutant@google.com>
14098
14099 * object.cc (Sized_relobj::layout_section): New function.
14100 (Sized_relobj::do_layout): Defer layout of input sections until after
14101 plugin has provided replacement files.
14102 (Sized_relobj::do_layout_deferred_sections): New function.
14103 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14104 (Relobj::layout_deferred_sections): New function.
14105 (Relobj::do_layout_deferred_sections): New function.
14106 (Sized_relobj::do_layout_deferred_sections): New function.
14107 (Sized_relobj::layout_section): New function.
14108 (Sized_relobj::Deferred_layout): New structure.
14109 (Sized_relobj::deferred_layout_): New field.
14110 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14111 Change all callers. Layout deferred sections.
14112 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14113 references.
14114 (Plugin_hook::run): Move code from do_plugin_hook inline.
14115 (Plugin_hook::do_plugin_hook): Remove.
14116 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14117 (Plugin_manager::finish): Renamed, was cleanup.
14118 (Plugin_manager::should_defer_layout): New function.
14119 (Plugin_manager::add_deferred_layout_object): New function.
14120 (Plugin_manager::Deferred_layout_list): New type.
14121 (Plugin_manager::deferred_layout_objects_): New field.
14122 (Plugin_hook::do_plugin_hook): Remove.
14123
ee769c88
ILT
141242008-12-17 Ian Lance Taylor <iant@google.com>
14125
14126 * options.h (class General_options): Add --no case for
14127 --export-dynamic.
14128
abc8dcba
CC
141292008-12-16 Cary Coutant <ccoutant@google.com>
14130
14131 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14132 vector.
14133 (Plugin_manager::claim_file): Create plugin object even if
14134 plugin did not call the add_symbols callback.
14135 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14136 asking for more symbols than were added.
14137 * testsuite/Makefile.am (plugin_test_1): Add test case with
14138 no global symbols.
14139 (empty.syms): New target.
14140 * testsuite/Makefile.in: Regenerate.
14141 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14142 message. Don't call add_symbols if no globals.
14143 (all_symbols_read_hook): Don't provide replacement for empty
14144 claimed file.
14145
b0074644
ILT
141462008-12-12 Ian Lance Taylor <iant@google.com>
14147
68943102
ILT
14148 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14149 r_type == 0 for a local symbol with r_sym == 0.
14150 (scan_relocatable_relocs): Pass r_sym to
14151 local_non_section_strategy.
14152 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14153 r_sym parameter.
14154
b0074644
ILT
14155 * configure.ac: Update test for TLS descriptors: they are
14156 supported as of glibc 2.9.
14157 * configure: Rebuild.
14158
c2508178
ILT
141592008-12-11 Ian Lance Taylor <iant@google.com>
14160
14161 PR 7091
14162 * target-reloc.h (Default_scan_relocatable_relocs): For each
14163 function, map r_type == 0 to RELOC_DISCARD.
14164
2756a258
CC
141652008-12-10 Cary Coutant <ccoutant@google.com>
14166
14167 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14168 object to override a kept COMDAT group from a plugin object.
14169
bb6f53d3
ILT
141702008-12-09 Ian Lance Taylor <iant@google.com>
14171
fbc558e1
ILT
14172 PR 7088
14173 * yyscript.y (file_cmd): Handle INPUT.
14174
bb6f53d3
ILT
14175 * testsuite/initpri1.c: Change all declarations to be full
14176 prototypes by adding void, to avoid compiler warnings.
14177
4674ecfc
CC
141782008-12-05 Rafael Avila de Espindola <espindola@google.com>
14179
14180 * options.cc (General_options::parse_plugin_opt): New.
14181 (General_options::add_plugin): The argument now is just the filename.
14182 (General_options::add_plugin_option): New.
14183 * options.h (plugin_opt): New.
14184 (add_plugin): Change argument name.
14185 (add_plugin_option): New.
14186 * plugin.cc (Plugin::load): Don't parse the plugin option.
14187 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14188 (Plugin::add_option): New.
14189 (Plugin::args_): Change type.
14190 (Plugin::filename_): New.
14191 (Plugin_manager::add_plugin_option): New.
14192 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14193 * testsuite/Makefile.in: Regenerate.
14194
fd06b4aa
CC
141952008-12-05 Cary Coutant <ccoutant@google.com>
14196
14197 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14198 Handle --strip-lto-sections option.
14199 * options.h (strip_lto_sections): New option.
14200
6c52134c
CC
142012008-12-01 Cary Coutant <ccoutant@google.com>
14202
14203 * plugin.cc (ld_plugin_message): Change format parameter to const.
14204 Fix mismatch between new[] and delete.
14205
a45248e0
CC
142062008-11-14 Cary Coutant <ccoutant@google.com>
14207
14208 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14209 instead of -1U.
14210
c82fbeee
CS
142112008-11-05 Craig Silverstein <csilvers@google.com>
14212
14213 * options.cc (General_options::parse_dynamic_list): New function.
14214 * options.h (General_options): New flags dynamic_list,
14215 dynamic_list_data, dynamic_list_cpp_new, and
14216 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14217 (General_options::in_dynamic_list): New function.
14218 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14219 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14220 (Lex::can_continue_name): Likewise.
14221 (yylex): Likewise.
14222 (read_script_file): New parameter script_options.
14223 (read_dynamic_list): New function.
14224 (Script_options::define_dynamic_list): New function.
14225 (dynamic_list_keyword_parsecodes): New variable.
14226 (dynamic_list_keywords): New variable.
14227 * script.h (Script_options::define_dynamic_list): New function
14228 prototype.
14229 (read_dynamic_list): New function prototype.
14230 * symtab.cc (strprefix): New macro.
14231 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14232 dynamic_list_data, dynamic_list_cpp_new, and
14233 dynamic_list_cpp_typeinfo.
14234 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14235 (dynamic_list_expr): New rule.
14236 (dynamic_list_nodes): Likewise.
14237 (dynamic_list_node): Likewise.
14238 * testsuite/Makefile.am (dynamic_list): New test.
14239 * testsuite/Makefile.in: Regenerated.
14240 * testsuite/dynamic_list.t: New file.
14241 * testsuite/dynamic_list.sh: New file.
14242
e0bb29a5
CS
142432008-11-05 Craig Silverstein <csilvers@google.com>
14244
14245 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14246 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14247 (t11_last): Likewise.
14248 * testsuite/ver_test_6.c (main): Likewise.
14249
4e1e25e0
CC
142502008-10-07 Cary Coutant <ccoutant@google.com>
14251
14252 * options.c (General_options::finalize): Add check for -static and
14253 -shared.
14254 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14255 is not empty.
14256
92f03fcb
CC
142572008-10-02 Cary Coutant <ccoutant@google.com>
14258
14259 * plugin.cc (make_sized_plugin_object): Fix conditional
14260 compilation to work when not all targets are enabled.
14261
fbd8a257
CC
142622008-09-29 Cary Coutant <ccoutant@google.com>
14263
14264 * archive.cc (Archive::get_file_and_offset): Use filename instead
14265 of name to get library path.
14266 (Archive::include_member): Unlock external member of a thin archive.
14267
14268 * testsuite/Makefile.am (TEST_AR): New variable.
14269 (thin_archive_test_1): New test.
14270 (thin_archive_test_2): New test.
81636b3f
CC
14271 * testsuite/Makefile.in: Regenerate.
14272 * testsuite/thin_archive_main.cc: New file.
14273 * testsuite/thin_archive_test_1.cc: New file.
14274 * testsuite/thin_archive_test_2.cc: New file.
14275 * testsuite/thin_archive_test_3.cc: New file.
14276 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14277
eff45813
CC
142782008-09-29 Cary Coutant <ccoutant@google.com>
14279
14280 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14281 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14282 instead of -1U.
14283 (Sized_relobj::do_finalize_local_symbols): Likewise.
14284 (Sized_relobj::map_to_kept_section): Likewise.
14285 * object.h (Sized_relobj::invalid_address): New constant.
14286 (Sized_relobj::do_output_section_offset): Check for invalid_address
14287 and return -1ULL.
14288 * output.cc (Output_reloc::local_section_offset): Use constant
14289 invalid_address instead of -1U.
14290 (Output_reloc::get_address): Likewise.
14291 (Output_section::output_address): Change -1U to -1ULL.
14292 * output.h (Output_reloc::invalid_address): New constant.
14293 * reloc.cc (Sized_relobj::write_sections): Use constant
14294 invalid_address instead of -1U.
14295 (Sized_relobj::relocate_sections): Likewise.
14296 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14297 values for merge sections.
14298 * target-reloc.h (relocate_for_relocatable): Use constant
14299 invalid_address instead of -1U.
14300
89fc3421
CC
143012008-09-19 Cary Coutant <ccoutant@google.com>
14302
14303 Add plugin functionality for link-time optimization (LTO).
14304 * configure.ac (plugins): Add --enable-plugins option.
14305 * configure: Regenerate.
14306 * config.in: Regenerate.
14307 * Makefile.am (LIBDL): New variable.
14308 (CCFILES): Add plugin.cc.
14309 (HFILES): Add plugin.h.
14310 (ldadd_var): Add LIBDL.
14311 * Makefile.in: Regenerate.
14312
14313 * archive.cc: Include "plugin.h".
14314 (Archive::setup): Don't preread archive symbols when using a plugin.
14315 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14316 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14317 files.
14318 (Archive::include_member): Add symbols from plugin objects.
14319 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14320 * descriptors.cc (Descriptors::open): Check for file descriptors
14321 abandoned by plugins.
14322 (Descriptors::claim_for_plugin): New function.
14323 * descriptors.h (Descriptors::claim_for_plugin): New function.
14324 (Open_descriptor::is_claimed): New field.
14325 (claim_descriptor_for_plugin): New function.
14326 * fileread.cc (File_read::claim_for_plugin): New function.
14327 * fileread.h (File_read::claim_for_plugin): New function.
14328 (File_read::descriptor): New function.
14329 * gold.cc: Include "plugin.h".
14330 (queue_initial_tasks): Add task to call plugin hooks for generating
14331 new object files.
14332 * main.cc: Include "plugin.h".
14333 (main): Load plugin libraries.
14334 * object.h (Pluginobj): Declare.
14335 (Object::pluginobj): New function.
14336 (Object::do_pluginobj): New function.
14337 (Object::set_target): New function.
14338 * options.cc: Include "plugin.h".
14339 (General_options::parse_plugin): New function.
14340 (General_options::General_options): Initialize plugins_ field.
14341 (General_options::add_plugin): New function.
14342 * options.h (Plugin_manager): Declare.
14343 (General_options): Add --plugin option.
14344 (General_options::has_plugins): New function.
14345 (General_options::plugins): New function.
14346 (General_options::add_plugin): New function.
14347 (General_options::plugins_): New field.
14348 * plugin.cc: New file.
14349 * plugin.h: New file.
14350 * readsyms.cc: Include "plugin.h".
14351 (Read_symbols::do_read_symbols): Check for archive before checking
14352 for ELF file. Call plugin hooks to claim files.
14353 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14354 from a real object file; force override when processing replacement
14355 files.
14356 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14357 (Symbol::init_base_object): Likewise.
14358 (Symbol::init_base_output_data): Likewise.
14359 (Symbol::init_base_output_segment): Likewise.
14360 (Symbol::init_base_constant): Likewise.
14361 (Symbol::init_base_undefined): Likewise.
14362 (Symbol::output_section): Assert that object is not a plugin.
14363 (Symbol_table::add_from_pluginobj): New function.
14364 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14365 undefined.
14366 (Symbol_table::sized_write_globals): Likewise.
14367 (Symbol_table::add_from_pluginobj): Instantiate template.
14368 * symtab.h (Sized_pluginobj): Declare.
14369 (Symbol::in_real_elf): New function.
14370 (Symbol::set_in_real_elf): New function.
14371 (Symbol::in_real_elf_): New field.
14372 (Symbol_table::add_from_pluginobj): New function.
14373
14374 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14375 (LIBDL): New variable.
14376 (LDADD): Add LIBDL.
14377 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14378 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14379 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14380 (MOSTLYCLEANFILES): Likewise.
14381 * testsuite/Makefile.in: Regenerate.
14382 * testsuite/plugin_test.c: New file.
14383 * testsuite/plugin_test_1.sh: New file.
14384 * testsuite/plugin_test_2.sh: New file.
14385
de31bda5
ILT
143862008-09-16 Ian Lance Taylor <iant@google.com>
14387
9c2d0ef9
ILT
14388 * target-reloc.h (relocate_section): Check whether a symbol is
14389 defined by the ABI before reporting an undefined symbol error.
14390 * target.h (Target::is_defined_by_abi): Make parameter const.
14391 (Target::do_is_defined_by_abi): Likewise.
14392 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14393 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14394 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14395 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14396 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14397 * testsuite/Makefile.in: Rebuild.
14398
de31bda5
ILT
14399 * fileread.cc (make_view): Add casts to avoid warning.
14400
9fa33bee
AO
144012008-09-16 Alexandre Oliva <aoliva@redhat.com>
14402
14403 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14404 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14405
183fd0e3
AO
144062008-09-16 Alexandre Oliva <aoliva@redhat.com>
14407
14408 * options.h (General_options::output_is_executable): New.
14409 (General_options::output_is_pie): New.
14410 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14411 for shared libraries.
14412 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14413
7be8330a
CD
144142008-09-11 Chris Demetriou <cgd@google.com>
14415
14416 * options.h (origin): New -z option.
14417 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14418 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14419 in DT_FLAGS_1.
14420
a9caad02
CC
144212008-09-05 Cary Coutant <ccoutant@google.com>
14422
14423 * fileread.cc (File_read::make_view): Add check for attempt to map
14424 beyond end of file.
14425
ae6dce4d
CC
144262008-09-05 Cary Coutant <ccoutant@google.com>
14427
14428 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14429 explicit instantiations.
14430
d7ab2a47
KVH
144312008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14432
14433 PR gold/6858
14434 * options.cc (General_options::finalize): Allow undefined symbols
14435 in shlibs if linking -shared.
14436
14437 PR gold/6859
14438 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14439 symbols as not needing a dynsym entry.
14440
1e52a9c1
CS
144412008-08-20 Craig Silverstein <csilvers@google.com>
14442
14443 * fileread.cc (File_read::open): Do not lock the file unless it
14444 was successfully opened.
14445
d85c80a3
CC
144462008-08-14 Cary Coutant <ccoutant@google.com>
14447
14448 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14449 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14450 * testsuite/tls_test.cc (struct int128): 128-bit struct
14451 for testing TLS relocs with non-zero addend.
14452 (v12): New TLS variable.
14453 (t12): New test.
14454 (t_last): Add check for v12.
14455 * testsuite/tls_test.h (t12): New function.
14456 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14457
2d924fd9
ILT
144582008-08-13 Ian Lance Taylor <iant@google.com>
14459
14460 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14461 set tls_segment_ or relro_segment_.
14462 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14463 when appropriate.
14464 * output.h (Output_section::clear_is_relro): New function.
14465 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14466 sections specially even when output_data_ is empty.
14467 (Output_segment::maximum_alignment): When first section is relro,
14468 only force alignment for PT_LOAD segments.
14469 * script.cc (script_data_segment_align): New function.
14470 (script_data_segment_relro_end): New function.
14471 * script-c.h (script_data_segment_align): Declare.
14472 (script_data_segment_relro_end): Declare.
14473 * script-sections.h (class Script_sections): Declare
14474 data_segment_align and data_segment_relro_end. Add fields
14475 segment_align_index_ and saw_relro_end_.
14476 * script-sections.cc (class Sections_element): Add set_is_relro
14477 virtual function. Add new bool* parameter to place_orphan_here.
14478 Add get_output_section virtual function.
14479 (class Output_section_definition): Add set_is_relro. Add new
14480 bool* parameter to place_orphan_here. Add get_output_section.
14481 Add is_relro_ field.
14482 (Output_section_definition::Output_section_definition): Initialize
14483 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14484 and is_relro_ fields.
14485 (Output_section_definition::place_orphan_here): Add is_relro
14486 parameter.
14487 (Output_section_definition::set_section_addresses): Set relro for
14488 output section.
14489 (Output_section_definition::alternate_constraint): Likewise.
14490 (class Orphan_output_section): Add new bool* parameter to
14491 place_orphan_here. Add get_output_section.
14492 (Orphan_output_section::place_orphan_here): Add is_relro
14493 parameter.
14494 (Script_sections::Script_sections): Initialize
14495 data_segment_align_index_ and saw_relro_end_.
14496 (Script_sections::data_segment_align): New function.
14497 (Script_sections::data_segment_relro_end): New function.
14498 (Script_sections::place_orphan): Set or clear is_relro.
14499 (Script_sections::set_section_addresses): Force alignment of first
14500 TLS section.
14501 * yyscript.y (exp): Call script_data_segment_align and
14502 script_data_segment_relro_end.
14503 * testsuite/relro_script_test.t: New file.
14504 * testsuite/relro_test.cc (using_script): Declare.
14505 (t1, t2): Test using_script.
14506 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14507 (relro_script_test_SOURCES): Define.
14508 (relro_script_test_DEPENDENCIES): Define.
14509 (relro_script_test_LDFLAGS): Define.
14510 (relro_script_test_LDADD): Define.
14511 (relro_script_test.so): New target.
14512 * testsuite/Makefile.in: Rebuild.
14513
f827c9a9
CC
145142008-08-06 Cary Coutant <ccoutant@google.com>
14515
14516 * archive.cc (Archive::total_archives, Archive::total_members)
14517 (Archive::total_members_loaded): New variables.
14518 (Archive::setup): Add parameter. Add option to preread
14519 archive symbols.
14520 (Archive::read_armap): Add counter.
14521 (Archive::get_file_and_offset): New function.
14522 (Archive::get_elf_object_for_member): New function.
14523 (Archive::read_all_symbols): New function.
14524 (Archive::read_symbols): New function.
14525 (Archive::add_symbols): Add counters.
14526 (Archive::include_all_members): Use armap to find members if it's
14527 already built.
14528 (Archive::include_member): Skip reading symbols if already read.
14529 Factored code into Archive::get_file_and_offset and
14530 Archive::get_elf_object_for_member. Changed call to
14531 Mapfile::report_include_archive_member.
14532 (Archive::print_stats): New function.
14533 * archive.h: Declare Object and Read_symbols_data classes.
14534 (Archive::Archive): Add initializers for new members.
14535 (Archive::setup): Add parameter.
14536 (Archive::print_stats): New function.
14537 (Archive::total_archives, Archive::total_members)
14538 (Archive::total_members_loaded): New variables.
14539 (Archive::get_file_and_offset): New function.
14540 (Archive::get_elf_object_for_member): New function.
14541 (Archive::read_all_symbols): New function.
14542 (Archive::read_symbols): New function.
14543 (Archive::Archive_member): New class.
14544 (Archive::members_): New member.
14545 (Archive::num_members_): New member.
14546 * main.cc: Include archive.h.
14547 (main): Call Archive::print_stats.
14548 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14549 archive parameter; member_name is now the fully-decorated name.
14550 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14551 * options.h: (General_options): Add --preread-archive-symbols option.
14552 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14553 Archive::setup.
14554
de4c45bd
ILT
145552008-08-04 Ian Lance Taylor <iant@google.com>
14556
14557 * symtab.h (Symbol::use_plt_offset): New function.
14558 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14559 * powerpc.cc (Relocate::relocate): Likewise.
14560 * sparc.cc (Relocate::relocate): Likewise.
14561 * x86_64.cc (Relocate::relocate): Likewise.
14562 * testsuite/weak_plt.sh: New test.
14563 * testsuite/weak_plt_main.cc: New test.
14564 * testsuite/weak_plt_shared.cc: New test.
14565 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14566 (check_PROGRAMS): Add weak_plt.
14567 (check_DATA): Add weak_plt_shared.so.
14568 (weak_plt_main_pic.o, weak_plt): New targets.
14569 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14570 * testsuite/Makefile.in: Rebuild.
14571
14572 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14573 gcctestdir/ld.
14574 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14575 * testsuite/Makefile.in: Rebuild.
14576
323ee3f4
AM
145772008-08-04 Alan Modra <amodra@bigpond.net.au>
14578
14579 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14580 * Makefile.in: Regenerate.
14581 * po/POTFILES.in: Regenerate.
14582
7c07ecec
ILT
145832008-07-29 Ian Lance Taylor <iant@google.com>
14584
14585 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14586 symbols before other symbols.
14587 * testsuite/script_test_2.cc (test_addr): Declare.
14588 (test_addr_alias): Declare.
14589 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14590 values.
7c07ecec
ILT
14591 * testsuite/script_test_2.t: Define test_addr_alias and
14592 test_addr.
14593
5778530e
ILT
145942008-07-24 Ian Lance Taylor <iant@google.com>
14595
2a00e4fb
ILT
14596 PR 5990
14597 * descriptors.cc: New file.
14598 * descriptors.h: New file.
14599 * gold-threads.h (class Hold_optional_lock): New class.
14600 * fileread.cc: Include "descriptors.h".
14601 (File_read::~File_read): Release descriptor rather than closing
14602 it.
14603 (File_read::open) [file]: Call open_descriptor rather than open.
14604 Set is_descriptor_opened_.
14605 (File_read::open) [memory]: Assert that descriptor is not open.
14606 (File_read::reopen_descriptor): New function.
14607 (File_read::release): Release descriptor.
14608 (File_read::do_read): Make non-const. Reopen descriptor.
14609 (File_read::read): Make non-const.
14610 (File_read::make_view): Reopen descriptor.
14611 (File_read::do_readv): Likewise.
14612 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14613 Update declarations.
14614 * layout.cc: Include "descriptors.h".
14615 (Layout::create_build_id): Use open_descriptor rather than open.
14616 * output.cc: Include "descriptors.h".
14617 (Output_file::open): Use open_descriptor rather than open.
14618 * archive.cc (Archive::const_iterator): Change Archive to be
14619 non-const.
14620 (Archive::begin, Archive::end): Make non-const.
14621 (Archive::count_members): Likewise.
14622 * archive.h (class Archive): Update declarations.
14623 * object.h (Object::read): Make non-const.
14624 * Makefile.am (CCFILES): Add descriptors.cc.
14625 (HFILES): Add descriptors.h.
14626 * Makefile.in: Rebuild.
14627
801647d1
ILT
14628 PR 6716
14629 * gold.h: Always include <clocale>. Add Solaris workarounds
14630 following code in binutils/sysdep.h.
14631
5edd166e
ILT
14632 PR 6048
14633 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14634 this->eh_frame_hdr_ is NULL before using it.
14635
c89ad728
ILT
14636 * dynobj.cc (Versions::Versions): Update comment.
14637
aa86f06b
ILT
14638 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14639 the base version name.
14640
5778530e
ILT
14641 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14642 array size plus one.
14643 (Stringpool_template::set_string_offsets): Subtract one from key
14644 before using it as an array index.
14645 (Stringpool_template::get_offset_with_length): Likewise.
14646 (Stringpool_template::write_to_buffer): Likewise.
14647 * stringpool.h (Stringpool_template::get_offset_from_key):
14648 Likewise.
14649
057ead22
ILT
146502008-07-23 Ian Lance Taylor <iant@google.com>
14651
7f649c59
ILT
14652 PR 6658
14653 * object.h (Merged_symbol_value::value): Do our best to handle a
14654 negative addend.
14655
057ead22
ILT
14656 PR 6647
14657 * script.cc (Version_script_info::get_versions): Don't add empty
14658 version tag to return value.
14659 (Version_script_info::get_symbol_version_helper): Change return
14660 type to bool. Add pversion parameter. Change all callers.
14661 (script_register_vers_node): Don't require a non-NULL tag.
14662 * script.h (class Version_script_info): Update declarations.
14663 (Version_script_info::get_symbol_version): Change return type to
14664 bool. Add version parameter. Change all callers.
14665 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14666 handling. Handle an empty version from a version script.
14667 (Symbol_table::define_special_symbol): Likewise.
14668 * testsuite/ver_test_10.script: New file.
14669 * testsuite/ver_test_10.sh: New file.
14670 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14671 (check_DATA): Add ver_test_10.syms.
14672 (ver_test_10.syms, ver_test_10.so): New target.
14673 * testsuite/Makefile.in: Rebuild.
14674
58e54ac2
CD
146752008-07-23 Simon Baldwin <simonb@google.com>
14676
14677 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14678 to zero for undefined symbols from dynamic libraries.
14679
95d14cd3
ILT
146802008-07-23 Ian Lance Taylor <iant@google.com>
14681
14682 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14683 Change all callers.
14684 * symtab.h (class Symbol_table): Update declaration.
14685 * testsuite/ver_test_9.cc: New file.
14686 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14687 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14688 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14689 (ver_test_9.so, ver_test_9.o): New targets.
14690 * testsuite/Makefile.in: Rebuild.
14691
92de84a6
ILT
146922008-07-22 Ian Lance Taylor <iant@google.com>
14693
34810851
ILT
14694 * options.h (class General_options): Define --check-sections.
14695 * layout.cc (Layout::set_segment_offsets): Handle
14696 --check-sections.
14697
af6156ef
ILT
14698 * options.h (class General_options): Define -n/--nmagic and
14699 -N/--omagic.
14700 * options.cc (General_options::finalize): For -n/--nmagic or
14701 -N/--omagic, set -static.
14702 * layout.cc (Layout::attach_allocated_section_to_segment): If
14703 -N/--omagic, don't put read-only and read-write sections in
14704 different segments.
14705 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14706 finding a read-only segment.
14707 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14708 don't set the minimum segment alignment to the common page size,
14709 and don't set the file offset to the address modulo the page size.
14710 * script-sections.cc (Script_sections::create_segments): If
14711 -n/--omagic, don't put read-only and read-write sections in
14712 different segments.
14713
92de84a6
ILT
14714 * cref.cc: New file.
14715 * cref.h: New file.
14716 * options.h (class General_options): Add --print-symbol-counts.
14717 * main.cc (main): Issue defined symbol report if requested.
14718 * archive.cc (Archive::interpret_header): Make into a const member
14719 function.
14720 (Archive::add_symbols): Call Input_objects::archive_start and
14721 archive_stop.
14722 (Archive::const_iterator): Define new class.
14723 (Archive::begin, Archive::end): New functions.
14724 (Archive::include_all_members): Rewrite to use iterator.
14725 (Archive::count_members): New function.
14726 * archive.h (class Archive): Update declarations.
14727 (Archive::filename): New function.
14728 * object.cc: Include "cref.h".
14729 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14730 (Sized_relobj::do_get_global_symbol_counts): New function.
14731 (Input_objects::add_object): Add object to cross-referencer.
14732 (Input_objects::archive_start): New function.
14733 (Input_objects::archive_stop): New function.
14734 (Input_objects::print_symbol_counts): New function.
14735 * object.h: Declare Cref and Archive.
14736 (Object::get_global_symbol_counts): New function.
14737 (Object::do_get_global_symbol_counts): New pure virtual function.
14738 (class Sized_relobj): Add defined_count_ field. Update
14739 declarations.
14740 (class Input_objects): Add cref_ field. Update constructor.
14741 Update declarations.
14742 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14743 defined_count_.
14744 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14745 symbol counts.
14746 (Sized_dynobj::do_get_global_symbol_counts): New function.
14747 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14748 defined_count_. Update declarations. Define Symbols typedef.
14749 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14750 parameter. Change all callers.
14751 (Symbol_table::add_from_dynobj): Add sympointers and defined
14752 parameters. Change all callers.
14753 * symtab.h (class Symbol_table): Update declarations.
14754 * Makefile.am (CCFILES): Add cref.cc.
14755 (HFILES): Add cref.h.
14756 * Makefile.in: Rebuild.
14757
3f7c5e1d
CD
147582008-07-22 Simon Baldwin <simonb@google.com>
14759
14760 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14761 to zero when writing undefined symbols.
14762
e0b64032
ILT
147632008-07-22 Ian Lance Taylor <iant@google.com>
14764
14765 * output.cc (Output_section::add_input_section): Don't try to
14766 merge empty merge sections.
14767
096b02cf
CS
147682008-07-21 Craig Silverstein <csilvers@google.com>
14769
14770 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14771 Include symbol version in error message.
cd536b21 14772
1d1f116d
CD
147732008-07-20 Chris Demetriou <cgd@google.com>
14774
cd536b21 14775 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14776 (RANDOM_SEED_CFLAGS): New substituted variable.
14777 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14778 * configure: Rebuild.
14779 * Makefile.in: Likewise.
14780 * testsuite/Makefile.in: Likewise.
14781
a18f591e
ILT
147822008-07-18 Ian Lance Taylor <iant@google.com>
14783
14784 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14785 where we see NAME/NULL and NAME/VERSION as separate symbols.
14786 * testsuite/ver_test_main.cc (main): Call t4.
14787 (t4, t4_2a): Define.
14788 * testsuite/ver_test_2.cc (t4_2): Define.
14789 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14790 * testsuite/ver_test_4.cc (t4_2a): Define.
14791 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14792 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14793
c6e3f6ed
ILT
147942008-07-17 Ian Lance Taylor <iant@google.com>
14795
14796 * dynobj.cc (Versions::add_def): If we give an error about a
14797 missing version, go ahead and create the version anyhow.
14798
ef9beddf
ILT
147992008-07-10 Ian Lance Taylor <iant@google.com>
14800
14801 Handle output sections with more than 0x7fffffff bytes.
14802 * object.h (class Relobj): Change map_to_output_ to
14803 output_sections_, and just keep a section pointer. Change all
14804 uses. Move comdat group support to Sized_relobj.
14805 (Relobj::is_section_specially_mapped): Remove.
14806 (Relobj::output_section): Remove poff parameter. Change all
14807 callers.
14808 (Relobj::output_section_offset): New function.
14809 (Relobj::set_section_offset): Rewrite.
14810 (Relobj::map_to_output): Remove.
14811 (Relobj::output_sections): New function.
14812 (Relobj::do_output_section_offset): New pure virtual function.
14813 (Relobj::do_set_section_offset): Likewise.
14814 (class Sized_relobj): Add section_offsets_ field. Add comdat
14815 group support from Relobj. Update declarations.
14816 (Sized_relobj::get_output_section_offset): New function.
14817 (Sized_relobj::do_output_section_offset): New function.
14818 (Sized_relobj::do_set_section_offset): New function.
14819 * object.cc (Relobj::output_section_address): Remove.
14820 (Sized_relobj::Sized_relobj): Initialize new fields.
14821 (Sized_relobj::include_section_group): Cast find_kept_object to
14822 Sized_relobj.
14823 (Sized_relobj::include_linkonce_section): Likewise.
14824 (Sized_relobj::do_layout): Use separate arrays for output section
14825 and output offset.
14826 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14827 output_sections.
14828 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14829 output_sections and section_offsets.
14830 (Sized_relobj::write_local_symbols): Likewise.
14831 (map_to_kept_section): Compute output address directly.
14832 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14833 output_sections and section_offsets.
14834 (Sized_relobj::write_sections): Likewise.
14835 (Sized_relobj::relocate_sections): Likewise.
14836 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14837 * output.h (class Output_reloc): Update declarations. Change
14838 u2_.relobj to Sized_relobj*.
14839 (class Output_data_reloc): Change add functions to use
14840 Sized_relobj*.
14841 * output.cc (Output_reloc::Output_reloc): Change relobj to
14842 Sized_relobj*.
14843 (Output_reloc::local_section_offset): Change return type to
14844 Elf_Addr. Use get_output_section_offset.
14845 (Output_reloc::get_address): Likewise.
14846 (Output_section::is_input_address_mapped): Don't call
14847 is_section_specially_mapped.
14848 (Output_section::output_offset): Likewise.
14849 (Output_section::output_address): Likewise.
14850 (Output_section::starting_output_address): Likewise.
14851 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14852 parameter to Sized_relobj*.
14853 (Copy_relocs::need_copy_reloc): Likewise.
14854 (Copy_relocs::save): Likewise.
14855 * copy-relocs.h (class Copy_relocs): Update declarations.
14856 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14857 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14858 * target-reloc.h (relocate_for_relocatable): Change
14859 offset_in_output_section type to Elf_Addr. Change code that uses
14860 it as well.
14861 * layout.cc (Layout::layout): Always set *off.
14862 * mapfile.cc (Mapfile::print_input_section): Use
14863 output_section_offset.
14864 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14865 Sized_relobj*.
14866 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14867 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14868 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14869
5cb66f97
ILT
148702008-07-03 Ian Lance Taylor <iant@google.com>
14871
14872 * layout.cc (Layout::include_section): Do not discard unrecognized
14873 SHT_STRTAB sections.
14874
afe47622
CS
148752008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14876
14877 * script.cc (Lex::can_continue_name): Make '?' allowable in
14878 version-script names.
14879 * testsuite/version_script.map: Change glob pattern to use '?'
14880
5adf9721
ILT
148812008-06-30 Manish Singh <yosh@gimp.org>
14882
14883 PR 6585
14884 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14885 Correct typo.
14886
e6fde208
ILT
148872008-06-30 Ian Lance Taylor <iant@google.com>
14888
14889 PR 6660
14890 PR 6682
14891 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14892 versions]: Don't try to read the value in the contents, since we
14893 don't use it. Use the template endianness when writing.
14894
3f2e6a2d
CC
148952008-06-25 Cary Coutant <ccoutant@google.com>
14896
14897 * fileread.cc (File_read::make_view): Assert on zero-length view.
14898 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14899 symbol table when there are no symbols to read.
14900
c43d3a48
CS
149012008-06-23 Craig Silverstein <csilvers@google.com>
14902
14903 * version.cc (version_string): Bump to 1.7
14904
5f494ea0
CS
149052008-06-18 Craig Silverstein <csilvers@google.com>
14906
14907 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14908 constant 0xFFFF to type Valtype.
14909 (Powerpc_relocate_functions::rel16_ha): Likewise.
14910
c42e122e
ILT
149112008-06-17 Ian Lance Taylor <iant@google.com>
14912
f34787f8
ILT
14913 * output.h (Output_section::Input_section): Initialize p2align_ to
14914 zero for Output_section_data constructors.
14915 (Output_section::Input_section::addralign): If not an input
14916 section, return the alignment of the Output_section_data.
14917 * testsuite/copy_test.cc: New file.
14918 * testsuite/copy_test_1.cc: New file.
14919 * testsuite/copy_test_2.cc: New file.
14920 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14921 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14922 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14923 (copy_test_1_pic.o, copy_test_1.so): New targets.
14924 (copy_test_2_pic.o, copy_test_2.so): New targets.
14925 * testsuite/Makefile.in: Rebuild.
14926
c42e122e
ILT
14927 * script-sections.cc (Script_sections::place_orphan): Initialize
14928 local variable exact.
14929
ce3ac18a
DE
149302008-06-13 David Edelsohn <edelsohn@gnu.org>
14931
14932 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14933
42cacb20
DE
149342008-06-12 David Edelsohn <edelsohn@gnu.org>
14935 David S. Miller <davem@davemloft.net>
14936
14937 * powerpc.cc: New file.
14938 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14939 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14940 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14941 * Makefile.in: Rebuild.
14942
7b308235
ILT
149432008-06-09 Ian Lance Taylor <iant@google.com>
14944
14945 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14946 <exception>.
14947 (throwing, orig_terminate): New static variables.
14948 (terminate_handler): New static function.
14949 (t2): Set terminate handler.
14950
f0b886e3
ILT
149512008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14952
14953 PR 6584
cd536b21 14954 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14955 alignment.
14956
3e90f135
CC
149572008-05-30 Cary Coutant <ccoutant@google.com>
14958
14959 * archive.cc (Archive::include_all_members) Correct to step
14960 over symbol table and extended name table in thin archives.
14961
e09ad04a
ILT
149622008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14963
14964 PR 6407
14965 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14966 calculation.
14967
62b01cb5
ILT
149682008-05-28 Caleb Howe <cshowe@google.com>
14969
14970 * reduced_debug_output.cc: New file.
14971 * reduced_debug_output.h: New file.
92de84a6 14972 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14973 * options.cc (General_options::finalize): Add strip_debug_non_line
14974 to the strip heirarchy.
14975 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14976 fields.
14977 * layout.cc: Include "reduced_debug_output.h".
14978 (Layout::Layout): Initialize new fields.
14979 (line_only_debug_sections): New static array.
14980 (is_lines_only_debug_sections): New static inline function.
14981 (Layout::include_section): Handle --strip-debug-non-line.
14982 (Layout::make_output_section): If --strip-debug-non-line, build
14983 new output sections for .debug_abbrev and .debug_info.
14984 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14985 gold. Warn about possible overflow.
14986 (read_signed_LEB_128): Likewise.
14987 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14988 (read_signed_LEB_128): Declare.
14989 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14990 (HFILES): Add reduced_debug_output.h.
14991 * Makefile.in: Rebuild.
14992
7d9e3d98
ILT
149932008-05-21 Ian Lance Taylor <iant@google.com>
14994
14995 * mapfile.cc: New file.
14996 * mapfile.h: New file.
14997 * options.h (class General_options): Add -M/--print-map and -Map.
14998 * options.cc (General_options::finalize): Make -M equivalent to
14999 -Map -.
15000 * main.cc: Include <cstdio> and "mapfile.h".
15001 (main): Open mapfile if requested.
15002 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15003 constructor. Change caller.
15004 (queue_initial_tasks): Add mapfile parameter. Change caller.
15005 (queue_middle_tasks): Likewise.
15006 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15007 declarations.
15008 * archive.cc: Include "mapfile.h".
15009 (Archive::add_symbols): Add mapfile parameter. Change all
15010 callers. Pass mapfile, symbol, and reason to include_member.
15011 (Archive::include_all_members): Add mapfile parameter. Change all
15012 callers.
15013 (Archive::include_member): Add mapfile, sym, and why parameters.
15014 Change all callers. Report inclusion to map file.
15015 * archive.h: Include "fileread.h".
15016 (class Archive): Update declarations.
15017 (Archive::file): New const method.
15018 (class Add_archive_symbols): Add mapfile_ field. Update
15019 constructor. Change all callers.
15020 * readsyms.h (class Read_symbols): Likewise.
15021 (class Finish_group): Likewise.
15022 (class Read_script): Likewise.
15023 * common.cc: Include "mapfile.h".
15024 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15025 all callers.
15026 (Symbol_table::do_allocate_commons): Likewise.
15027 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15028 symbol allocation to mapfile.
15029 * common.h (class Allocate_commons_task): Add mapfile_ field.
15030 Update constructor. Change all callers.
15031 * symtab.h (class Symbol_table): Update declarations.
15032 * layout.cc: Include "mapfile.h".
15033 (Layout_task_runner::run): Print information to mapfile.
15034 (Layout::create_gold_note): Change Output_data_fixed_space to
15035 Output_data_zero_fill.
15036 (Layout::create_build_id): Likewise.
15037 (Layout::print_to_mapfile): New function.
15038 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15039 constructor. Change caller.
15040 (class Layout): Declare print_to_mapfile.
15041 * output.cc (Output_section::Input_section::print_to_mapfile): New
15042 function.
15043 (Output_section::add_input_section): If producing a map, always
15044 add to input_sections_ list.
15045 (Output_section::do_print_to_mapfile): New function.
15046 (Output_segment::print_sections_to_mapfile): New function.
15047 (Output_segment::print_section_list_to_mapfile): New function.
15048 * output.h: Include "mapfile.h".
15049 (Output_data::print_to_mapfile): New function.
15050 (Output_data::do_print_to_mapfile): New virtual function.
15051 (Output_segment_headers::do_print_to_mapfile): New function.
15052 (Output_file_header::do_print_to_mapfile): New function.
15053 (Output_data_const::do_print_to_mapfile): New function.
15054 (class Output_data_const_buffer): Add map_name_ field. Update
15055 constructor. Change all callers. Add do_print_to_mapfile
15056 function.
15057 (class Output_data_fixed_space): Likewise.
15058 (class Output_data_space): Likewise.
15059 (class Output_data_zero_fill): New class.
15060 (Output_data_strtab::do_print_to_mapfile): New function.
15061 (Output_data_reloc_base::do_print_to_mapfile): New function.
15062 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15063 (Output_data_group::do_print_to_mapfile): New function.
15064 (Output_data_got::do_print_to_mapfile): New function.
15065 (Output_data_dynamic::do_print_to_mapfile): New function.
15066 (Output_symtab_xindex::do_print_to_mapfile): New function.
15067 (class Output_section): Declare do_print_to_mapflie. Declare
15068 print_to_mapfile in Input_section.
15069 (class Output_segment): Declare new functions.
15070 * object.h (Sized_relobj::symbol_count): New function.
15071 * script-sections.cc
15072 (Output_section_element_dot_assignment::set_section_addresses):
15073 Change Output_data_fixed_space to Output_data_zero_fill.
15074 (Output_data_expression::do_print_to_mapfile): New function.
15075 * script.cc (read_input_script): Add mapfile parameter. Change
15076 all callers.
15077 * script.h (read_input_script): Update declaration.
15078 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15079 (Eh_frame::do_print_to_mapfile): New function.
15080 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15081 (Output_merge_string::do_print_to_mapfile): New function.
15082 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15083 function.
15084 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15085 function.
15086 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15087 function.
15088 * Makefile.am (CCFILES): Add mapfile.cc.
15089 (HFILES): Add mapfile.h.
15090 * Makefile.in: Rebuild.
15091
9f1d377b
ILT
150922008-05-19 Ian Lance Taylor <iant@google.com>
15093
15094 * options.h (class General_options): Add -z relro.
15095 * layout.cc (Layout::Layout): Initialize relro_segment_.
15096 (Layout::add_output_section_data): Return the output section.
15097 (Layout::make_output_section): Rcognize relro sections and mark
15098 them appropriately.
15099 (Layout::attach_allocated_section_to_segment): Put relro sections
15100 in a PT_GNU_RELRO segment.
15101 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15102 section as relro.
15103 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15104 PT_TLS segments.
15105 (Layout::linkonce_mapping): Map d.rel.ro.local to
15106 .data.rel.ro.local.
15107 (Layout::output_section_name): Us .data.rel.ro.local for any
15108 section which begins with that.
15109 * layout.h (class Layout): Update add_output_section_data
15110 declaration. Add relro_segment_ field.
15111 * output.cc (Output_section::Output_section): Initialize is_relro_
15112 and is_relro_local_ fields.
15113 (Output_segment::add_output_section): Group relro sections.
15114 (Output_segment::is_first_section_relro): New function.
15115 (Output_segment::maximum_alignment): If there is a relro section,
15116 align the segment to the common page size.
15117 (Output_segment::set_section_addresses): Track whether we are
15118 looking at relro sections. If the last section is a relro
15119 section, align to the common page size.
15120 (Output_segment::set_section_list_addresses): Add in_relro
15121 parameter. Change all callers. Align to the page size when
15122 moving from relro to non-relro section.
15123 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15124 segment.
15125 * output.h (class Output_section): Add is_relro_ and
15126 is_relro_local_ fields.
15127 (Output_section::is_relro): New function.
15128 (Output_section::set_is_relro): New function.
15129 (Output_section::is_relro_local): New function.
15130 (Output_section::set_is_relro_local): New function.
15131 (class Output_segment): Update declarations.
15132 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15133 * sparc.cc (Target_sparc::got_section): Likewise.
15134 * x86_64.cc (Target_x86_64::got_section): Likewise.
15135 * testsuite/relro_test_main.cc: New file.
15136 * testsuite/relro_test.cc: New file.
15137 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15138 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15139 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15140 (relro_test.so, relro_test_pic.o): New targets.
15141 * testsuite/Makefile.in: Rebuild.
15142
a984ee1d
ILT
151432008-05-16 Ian Lance Taylor <iant@google.com>
15144
01676dcd
ILT
15145 * output.cc (Output_segment::add_output_section): Remove front
15146 parameter.
15147 * output.h (class Output_segment): Remove
15148 add_initial_output_section and overloaded add_output_section.
15149 Update declaration of remaining add_output_section.
15150 * layout.cc (Layout::create_interp): Call add_output_section
15151 rather than add_initial_output_section.
15152 (Layout::finish_dynamic_section): Likewise.
15153
497897f9
ILT
15154 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15155 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15156 know the dynamic type.
15157 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15158 field. Initialize it in constructor.
15159 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15160 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15161 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15162 reloc.
15163
a984ee1d
ILT
15164 * output.cc (Output_reloc::get_address): Change return type to
15165 Elf_Addr.
15166 * output.h (class Output_reloc): Update get_address declaration.
15167 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15168 for section addresses.
15169
55ba0940
ILT
151702008-05-09 Ian Lance Taylor <iant@google.com>
15171
15172 PR 6493
15173 * gold.cc (gold_nomem): Use return value of write.
15174
75517b77
ILT
151752008-05-08 Ian Lance Taylor <iant@google.com>
15176
15177 * symtab.c (Symbol::init_base_output_data): Add version
15178 parameter. Change all callers.
15179 (Symbol::init_base_output_segment): Likewise.
15180 (Symbol::init_base_constant): Likewise.
15181 (Symbol::init_base_undefined): Likewise.
15182 (Sized_symbol::init_output_data): Likewise.
15183 (Sized_symbol::init_output_segment): Likewise.
15184 (Sized_symbol::init_constant): Likewise.
15185 (Sized_symbol::init_undefined): Likewise.
15186 (Symbol_table::do_define_in_output_data): If the new symbol has a
15187 version, mark it as the default.
15188 (Symbol_table::do_define_in_output_segment): Likewise.
15189 (Symbol_table::do_define_as_constant): Likewise.
15190 * symtab.h (class Symbol): Update declarations.
15191 (class Sized_symbol): Likewise.
15192 * resolve.cc (Symbol::override_version): New function.
c42e122e 15193 (Symbol::override_base): Call override_version.
75517b77
ILT
15194 (Symbol::override_base_with_special): Likewise.
15195 * testsuite/ver_script_8.script: New file.
15196 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15197 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15198 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15199 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15200
f1f70eae
ILT
152012008-05-06 Ian Lance Taylor <iant@google.com>
15202
f3e9c5c5
ILT
15203 PR 6049
15204 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15205 functions.
15206 (class General_options): Remove existing --undefined, and add
15207 --no-undefined instead. Add new --undefined as synonym for -u.
15208 * archive.cc (Archive::add_symbols): Check whether symbol was
15209 named with -u.
15210 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15211 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15212 all uses. Add IS_UNDEFINED. Update declarations to split
15213 different versions of init_base. Declare init_base_undefined.
15214 (Symbol::is_defined): Handle IS_UNDEFINED.
15215 (Symbol::is_undefined): Likewise.
15216 (Symbol::is_weak_undefined): Call is_undefined.
15217 (Symbol::is_absolute): Handle IS_CONSTANT.
15218 (class Sized_symbol): Update declarations to split different
15219 versions of init. Declare init_undefined.
15220 (class Symbol_table): Declare new functions.
15221 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15222 Change all callers.
15223 (Symbol::init_base_output_data): Likewise.
15224 (Symbol::init_base_output_segment): Likewise.
15225 (Symbol::init_base_constant): Likewise.
15226 (Symbol::init_base_undefined): New function.
15227 (Sized_symbol::init_object): Rename from init. Change all
15228 callers.
15229 (Sized_symbol::init_output_data): Likewise.
15230 (Sized_symbol::init_output_segment): Likewise.
15231 (Sized_symbol::init_constant): Likewise.
15232 (Sized_symbol::init_undefined): New function.
15233 (Symbol_table::add_undefined_symbols_from_command_line): New
15234 function.
15235 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15236 function.
15237 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15238 (Symbol::output_section): Likewise.
15239 (Symbol::set_output_section): Likewise.
15240 (Symbol_table::sized_finalize_symbol): Likewise.
15241 (Symbol_table::sized_write_globals): Likewise.
15242 * resolve.cc (Symbol_table::should_override): Likewise.
15243 (Symbol::override_base_with_special): Likewise.
15244
8bdcdf2c
ILT
15245 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15246 symbol, change it to have default visibility.
15247 * testsuite/protected_1.cc: New file.
15248 * testsuite/protected_2.cc: New file.
15249 * testsuite/protected_3.cc: New file.
15250 * testsuite/protected_main_1.cc: New file.
15251 * testsuite/protected_main_2.cc: New file.
15252 * testsuite/protected_main_3.cc: New file.
15253 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15254 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15255 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15256 (protected_1.so): New target.
15257 (protected_1_pic.o, protected_2_pic.o): New targets.
15258 (protected_3_pic.o): New target.
15259 (check_PROGRAMS): Add protected_2.
15260 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15261 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15262 * testsuite/Makefile.in: Rebuild.
15263
2b706932
ILT
15264 * options.h (DEFINE_var): Add set_user_set_##varname__.
15265 (DEFINE_bool_alias): New macro.
15266 (class General_options): Define -Bstatic using DEFINE_bool_alias
15267 rather than DEFINE_special. Add --undefined as an alias for -z
15268 defs.
15269 * options.cc (General_options::parse_Bstatic): Remove.
15270
d82a5bcc
ILT
15271 * options.h (class General_options): Add --fatal-warnings.
15272 * main.cc (main): Implement --fatal-warnings.
15273 * errors.h (Errors::warning_count): New function.
15274
f1f70eae
ILT
15275 * options.h (class General_options): Add -Bsymbolic-functions.
15276 * symtab.h (Symbol::is_preemptible): Check for
15277 -Bsymbolic-functions.
15278
8825ac63
ILT
152792008-05-05 Ian Lance Taylor <iant@google.com>
15280
d98bc257
ILT
15281 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15282 as noVARNAME rather than no-VARNAME.
15283 (class General_options): Add option -z combreloc.
15284 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15285 get_address.
15286 (Output_reloc::sort_before) [SHT_REL]: New function.
15287 (Output_reloc::sort_before) [SHT_RELA]: New function.
15288 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15289 Sort_relocs_comparison.
15290 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15291 parameter. Change all callers.
15292 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15293 sort_relocs parameter. Change all callers.
15294 * output.cc (Output_reloc::get_address): New function, broken out
15295 of write_rel.
15296 (Output_reloc::write_rel): Call it.
15297 (Output_reloc::compare): New function.
15298 (Output_data_reloc_base::do_write): Optionally sort relocs.
15299
60b2b4e7
ILT
15300 * configure.ac: If targ_extra_obj is set, link it in.
15301 * configure.tgt: Initialize all variables.
15302 (x86_64*): Set targ_extra_obj and targ_extra_size.
15303 * configure: Rebuild.
15304
8825ac63
ILT
15305 * object.cc (Sized_relobj::include_section_group): Adjust section
15306 indexes read from group data. Build vector to pass to
15307 layout_group.
15308 * layout.cc (Layout::layout_group): Add flags and shndxes
15309 parameters. Remove contents parameter. Change caller. Update
15310 explicit instantiations.
15311 * layout.h (class Layout): Update layout_group declaration.
15312 * output.cc (Output_data_group::Output_data_group): Add flags and
15313 input_shndxes parameters. Remove contents parameter. Change
15314 caller.
15315 (Output_data_group::do_write): Change input_sections_ to
15316 input_shndxes_.
15317 * output.h (class Output_data_group): Update constructor
15318 declaration. Rename input_sections_ to input_shndxes_.
15319 * testsuite/many_sections_test.cc: Add template.
15320
e94cf127
CC
153212008-04-30 Cary Coutant <ccoutant@google.com>
15322
4418b2d5
CC
15323 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15324
e94cf127
CC
15325 * layout.cc (Layout::include_section): Refactored check for debug
15326 info section.
15327 (Layout::add_comdat): Add new parameters. Change type
15328 of signature parameter. Add object and shndx to signatures table.
15329 (Layout::find_kept_object): New function.
15330 * layout.h: Include <cstring>.
15331 (Layout::is_debug_info_section): New function.
15332 (Layout::add_comdat): Add new parameters.
15333 (Layout::find_kept_object): New function.
15334 (Layout::Kept_section): New struct.
15335 (Layout::Signatures): Change type of map range.
15336 * object.cc (Relobj::output_section_address): New function.
15337 (Sized_relobj::include_section_group): Add new parameters. Change
15338 calls to Layout::add_comdat. Change to build table of kept comdat
15339 groups and table mapping discarded sections to kept sections.
15340 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15341 (Sized_relobj::do_layout): Change calls to include_section_group and
15342 include_linkonce_section.
15343 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15344 value to zero when section is discarded.
15345 (Sized_relobj::map_to_kept_section): New function.
15346 * object.h (Relobj::output_section_address): New function.
15347 (Relobj::Comdat_group): New type.
15348 (Relobj::find_comdat_group): New function.
15349 (Relobj::Comdat_group_table): New type.
15350 (Relobj::Kept_comdat_section): New type.
15351 (Relobj::Kept_comdat_section_table): New type.
15352 (Relobj::add_comdat_group): New function.
15353 (Relobj::set_kept_comdat_section): New function.
15354 (Relobj::get_kept_comdat_section): New function.
15355 (Relobj::comdat_groups_): New field.
15356 (Relobj::kept_comdat_sections_): New field.
15357 (Symbol_value::input_value): Update comment.
15358 (Sized_relobj::map_to_kept_section) New function.
15359 (Sized_relobj::include_linkonce_section): Add new parameter.
15360 * target-reloc.h (Comdat_behavior): New type.
15361 (get_comdat_behavior): New function.
15362 (relocate_section): Add code to map a discarded section to the
15363 corresponding kept section when applying a relocation.
15364
e4e5049b
CS
153652008-04-30 Craig Silverstein <csilvers@google.com>
15366
15367 * dwarf_reader.cc (next_generation_count): New static var.
15368 (Addr2line_cache_entry): New struct.
15369 (addr2line_cache): New static var.
15370 (Dwarf_line_info::one_addr2line): Added caching.
15371 (Dwarf_line_info::clear_addr2line_cache): New function.
15372 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15373 cache-size parameter.
15374 (Dwarf_line_info::one_addr2line_cache): New function.
15375 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15376 new cache-size argument to one_addr2line(), and clear cache.
15377
d09e9154
CC
153782008-04-28 Cary Coutant <ccoutant@google.com>
15379
15380 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15381 R_386_PC8 relocations.
15382
7ef73768
ILT
153832008-04-23 Ian Lance Taylor <iant@google.com>
15384
55438702
ILT
15385 * object.cc (Sized_relobj::include_section_group): Check for
15386 invalid section group.
15387
c165fb93
ILT
15388 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15389 header size.
15390
7ef73768
ILT
15391 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15392 than read for file header.
15393 * archive.cc (Archive::include_member): Likewise.
15394
6194aaab
L
153952008-04-23 Paolo Bonzini <bonzini@gnu.org>
15396
15397 * aclocal.m4: Regenerate.
15398 * configure: Regenerate.
15399
d491d34e
ILT
154002008-04-19 Ian Lance Taylor <iant@google.com>
15401
5ea2bac6
ILT
15402 * version.cc (version_string): Bump to 1.6.
15403
7bc3e21a
ILT
15404 * testsuite/Makefile.am (many_sections_r_test): New target.
15405 (many_sections_r_test_SOURCES): Remove.
15406 (many_sections_r_test_DEPENDENCIES): Remove.
15407 (many_sections_r_test_LDFLAGS): Remove.
15408 (many_sections_r_test_LDADD): Remove.
15409
7fcd3aa9
ILT
15410 * object.cc (Sized_relobj::do_add_symbols): Always pass
15411 local_symbol_count_ to add_from_relobj.
15412
4c94d6ae
ILT
15413 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15414 every thousand variables.
15415 * testsuite/Makefile.in: Rebuild.
15416
d491d34e
ILT
15417 * object.cc (Xindex::initialize_symtab_xindex): New function.
15418 (Xindex::read_symtab_xindex): New function.
15419 (Xindex::sym_xindex_to_shndx): New function.
15420 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15421 available.
15422 (Sized_relobj::do_initialize_xindex): New function.
15423 (Sized_relobj::do_read_symbols): Adjust section links.
15424 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15425 parameter. Change all callers.
15426 (Sized_relobj::include_section_group): Adjust section links and
15427 symbol section indexes.
15428 (Sized_relobj::do_layout): Adjust section links.
15429 (Sized_relobj::do_count_local_symbols): Adjust section links and
15430 symbol section indexes.
15431 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15432 ordinary and special symbols.
15433 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15434 dynsym_xindex parameters. Change all callers. Adjust section
15435 links. Use SHN_XINDEX when needed.
15436 (Sized_relobj::get_symbol_location_info): Adjust section links.
15437 Don't get fooled by special symbols.
15438 * object.h (class Xindex): Define.
15439 (class Object): Add xindex_ parameter. Declare virtual functoin
15440 do_initialize_xindex.
15441 (Object::adjust_sym_shndx): New function.
15442 (Object::set_xindex): New protected function.
15443 (class Symbol_value): Add is_ordinary_shndx_ field.
15444 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15445 (Symbol_value::value): Assert ordinary section.
15446 (Symbol_value::initialize_input_to_output_map): Likewise.
15447 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15448 Change all callers.
15449 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15450 all callers.
15451 (class Sized_relobj): Update declarations.
15452 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15453 parameter. Change all callers.
15454 (Sized_relobj::adjust_shndx): New function.
15455 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15456 field.
15457 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15458 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15459 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15460 (Sized_dynobj::read_dynsym_section): Adjust section links.
15461 (Sized_dynobj::read_dynamic): Likewise.
15462 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15463 section links.
15464 (Sized_dynobj::do_initialize_xindex): New function.
15465 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15466 do_initialize_xindex.
15467 (Sized_dynobj::adjust_shndx): New function.
15468 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15469 dynsym_xindex_ fields.
15470 (Layout::finalize): Add a call to set_section_indexes before
15471 creating the symtab sections.
15472 (Layout::set_section_indexes): Don't do anything if the section
15473 already has a section index.
15474 (Layout::create_symtab_sections): Add shnum parameter. Change
15475 caller. Create .symtab_shndx section if needed.
15476 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15477 caller.
15478 (Layout::allocated_output_section_count): New function.
15479 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15480 needed.
15481 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15482 fields. Update declarations.
15483 (Layout::symtab_xindex): New function.
15484 (Layout::dynsym_xindex): New function.
15485 (class Write_symbols_task): Add layout_ field.
15486 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15487 Change caller.
15488 * output.cc (Output_section_headers::Output_section_headers): Add
15489 shstrtab_section parameter. Change all callers.
15490 (Output_section_headers::do_sized_write): Store overflow values
15491 for section count and section string table section index in
15492 section header zero.
15493 (Output_file_header::do_sized_write): Check for overflow of
15494 section count and section string table section index.
15495 (Output_symtab_xindex::do_write): New function.
15496 (Output_symtab_xindex::endian_do_write): New function.
15497 * output.h (class Output_section_headers): Add shstrtab_section_.
15498 Update declarations.
15499 (class Output_symtab_xindex): Define.
15500 (Output_section::has_out_shndx): New function.
15501 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15502 field.
15503 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15504 Change all callers.
15505 (Sized_symbol::init): Likewise.
15506 (Symbol::output_section): Check for ordinary symbol.
15507 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15508 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15509 callers.
15510 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15511 Change all callers. Simplify handling of symbols from sections
15512 not included in the link.
15513 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15514 distinction.
15515 (Weak_alias_sorter::operator()): Assert that symbols are
15516 ordinary.
15517 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15518 distinction.
15519 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15520 parameters. Change all callers.
15521 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15522 symbol distinction. Use SHN_XINDEX when needed.
15523 (Symbol_table::write_section_symbol): Add symtab_xindex
15524 parameter. Change all callers.
15525 (Symbol_table::sized_write_section_symbol): Likewise. Use
15526 SHN_XINDEX when needed.
15527 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15528 declarations.
15529 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15530 (Symbol::is_defined): Check is_ordinary.
15531 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15532 (Symbol::is_absolute, Symbol::is_common): Likewise.
15533 (class Sized_symbol): Update declarations.
15534 (class Symbol_table): Update declarations.
15535 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15536 parameters. Change all callers.
15537 (Sized_symbol::override): Likewise.
15538 (Symbol_table::override): Likewise.
15539 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15540 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15541 is_ordinary, and orig_st_shndx parameters. Change all callers.
15542 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15543 to be in an ordinary section.
15544 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15545 object and is_ordinary parameters. Change all callers.
15546 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15547 Change all callers. Don't add undefined or non-ordinary symbols
15548 to reloc_map_.
15549 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15550 Change all callers.
15551 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15552 declarations.
15553 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15554 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15555 (Sized_relobj::relocate_sections): Likewise.
15556 * target-reloc.h (scan_relocs): Adjust section symbol index.
15557 (scan_relocatable_relocs): Likewise.
15558 * i386.cc (Scan::local): Check for ordinary symbols.
15559 * sparc.cc (Scan::local): Likewise.
15560 * x86_64.cc (Scan::local): Likewise.
15561 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15562 to symbol_section_and_value.
15563 * testsuite/many_sections_test.cc: New file.
15564 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15565 (check_PROGRAMS): Add many_sections_test.
15566 (many_sections_test_SOURCES): Define.
15567 (many_sections_test_DEPENDENCIES): Define.
15568 (many_sections_test_LDFLAGS): Define.
15569 (BUILT_SOURCES): Add many_sections_define.h.
15570 (many_sections_define.h): New target.
15571 (BUILT_SOURCES): Add many_sections_check.h.
15572 (many_sections_check.h): New target.
15573 (check_PROGRAMS): Add many_sections_r_test.
15574 (many_sections_r_test_SOURCES): Define.
15575 (many_sections_r_test_DEPENDENCIES): Define.
15576 (many_sections_r_test_LDFLAGS): Define.
15577 (many_sections_r_test_LDADD): Define.
15578 (many_sections_r_test.o): New target.
15579 * testsuite/Makefile.in: Rebuild.
15580
c5818ff1
CC
155812008-04-17 Cary Coutant <ccoutant@google.com>
15582
15583 * errors.cc (Errors::info): New function.
15584 (gold_info): New function.
15585 * errors.h (Errors::info): New function.
15586 * gold.h (gold_info): New function.
15587 * object.cc (Input_objects::add_object): Print trace output.
15588 * options.cc (options::parse_set): New function.
15589 (General_options::parse_wrap): Deleted.
15590 (General_options::General_options): Deleted initializer.
15591 * options.h (options::String_set): New typedef.
15592 (options::parse_set): New function.
15593 (DEFINE_set): New macro.
15594 (General_options::wrap): Changed to use DEFINE_set. Changed
15595 callers of any_wrap_symbols and is_wrap_symbol.
15596 (General_options::trace, General_options::trace_symbol):
15597 New options.
15598 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15599 (General_options::wrap_symbols_): Deleted.
15600 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15601
b5be4a7c
DM
156022008-04-17 David S. Miller <davem@davemloft.net>
15603
15604 * options.cc (General_options::parse_V): New function.
15605 * options.h: Add entries for -V and -Qy.
15606
155a0dd7
ILT
156072008-04-17 Ian Lance Taylor <iant@google.com>
15608
15609 * common.cc (Symbol_table::allocate_commons): Remove options
15610 parameter. Change caller.
15611 (Symbol_table::do_allocate_commons): Remove options parameter.
15612 Change caller. Just call do_allocate_commons_list twice.
15613 (Symbol_table::do_allocate_commons_list): New function, broken out
15614 of do_allocate_commons.
15615 * common.h (class Allocate_commons_task): Remove options_ field.
15616 Update constructor.
15617 * symtab.cc (Symbol_table::Symbol_table): Initialize
15618 tls_commons_.
15619 (Symbol_table::add_from_object): Put TLS common symbols on
15620 tls_commons_ list.
15621 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15622 which are IN_OUTPUT_DATA.
15623 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15624 allocate_commons and do_allocate_commons declarations. Declare
15625 do_allocate_commons_list.
15626 * gold.cc (queue_middle_tasks): Update creation of
15627 Allocate_commons_task to not pass options.
15628 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15629 (TLS_TEST_C_FLAGS): New variable.
15630 (tls_test_c_pic.o): New target.
15631 (tls_test_shared.so): Link in tls_test_c_pic.o.
15632 (tls_test_c_pic_ie.o): New target.
15633 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15634 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15635 (tls_test_c.o): New target.
15636 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15637 (tls_pic_test_LDADD): Likewise.
15638 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15639 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15640 (tls_test_c_gnu2.o): New target.
15641 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15642 tls_test_c_gnu2.o.
15643 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15644 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15645 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15646 * testsuite/tls_test.cc: Include "config.h".
15647 (t_last): Call t11_last.
15648 * testsuite/tls_test.h (t11, t11_last): Declare.
15649 * testsuite/tls_test_c.c: New file.
15650 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15651 * configure.ac: Check for OpenMP support.
15652 * configure, config.in, Makefile.in: Rebuild.
15653 * testsuite/Makefile.in: Rebuild.
15654
edfbb029
CC
156552008-04-16 Cary Coutant <ccoutant@google.com>
15656
15657 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15658 (Target_i386::tls_base_symbol_defined_): New field.
15659 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15660 (Target_i386::Scan::global): Likewise.
15661 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15662 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15663 (Target_x86_64::tls_base_symbol_defined_): New field.
15664 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15665 (Target_x86_64::Scan::global): Likewise.
15666
f3c69fca
CC
156672008-04-16 Cary Coutant <ccoutant@google.com>
15668
15669 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15670 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15671 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15672 building shared libraries.
15673 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15674 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15675 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15676 * testsuite/Makefile.in: Rebuild.
15677 * testsuite/weak_undef.h: New file.
15678 * testsuite/weak_undef_file1.cc: Add extra test cases.
15679 * testsuite/weak_undef_file2.cc: Likewise.
15680 * testsuite/weak_undef_test.cc: Likewise.
15681
7c414435
DM
156822008-04-16 David S. Miller <davem@davemloft.net>
15683
32b769e1
DM
15684 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15685 Add issued_non_pic_error_ field. Declare check_non_pic.
15686 (Target_sparc::Scan::check_non_pic): New function.
15687 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15688 (Target_sparc::Scan::global): Likewise.
15689
11936fb1
DM
15690 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15691 * configure: Rebuild.
15692
7c414435
DM
15693 * options.h (DEFINE_enable): New macro.
15694 (new_dtags): New enable option.
15695 (initfirst, interpose, loadfltr, nodefaultlib,
15696 nodelete, nodlopen, nodump): New -z options.
15697 * layout.cc (Layout:finish_dynamic_section): If new
15698 dtags enabled, emit DT_RUNPATH. Also, emit a
15699 DT_FLAGS_1 containing any specified -z flags.
15700
85c7bf8b
ILT
157012008-04-16 Ian Lance Taylor <iant@google.com>
15702
12c0daef
ILT
15703 * copy-relocs.cc: New file.
15704 * copy-relocs.h: New file.
15705 * reloc.cc: Remove Copy_relocs code.
15706 * reloc.h: Likewise.
15707 * reloc-types.h (struct Reloc_types) [both versions]: Add
15708 get_reloc_addend_noerror.
15709 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15710 variants of add_global which take an addend which must be zero.
15711 * i386.cc: Include "copy-relocs.h".
15712 (class Target_i386): Change type of copy_relocs_ to variable,
15713 update initializer.
15714 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15715 Change all callers.
15716 (Target_i386::do_finalize_sections): Change handling of
15717 copy_relocs_.
15718 * sparc.cc: Include "copy-relocs.h".
15719 (class Target_sparc): Change type of copy_relocs_ to variable,
15720 update initializer.
15721 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15722 Change all callers.
15723 (Target_sparc::do_finalize_sections): Change handling of
15724 copy_relocs_.
15725 * x86_64.cc: Include "copy-relocs.h".
15726 (class Target_x86_64): Change type of copy_relocs_ to variable,
15727 update initializer.
15728 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15729 class. Change all callers.
15730 (Target_x86_64::do_finalize_sections): Change handling of
15731 copy_relocs_.
15732 * Makefile.am (CCFILES): Add copy-relocs.cc.
15733 (HFILES): Add copy-relocs.h.
15734
4f4995b6
ILT
15735 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15736
85c7bf8b
ILT
15737 * testsuite/script_test_4.sh: Permit leading zeroes.
15738
4f2a9edd
ILT
157392008-04-15 Ian Lance Taylor <iant@google.com>
15740
e6188289
ILT
15741 * script-sections.cc (Script_sections::create_segments): Use
15742 header_size_adjustment even when there is enough room for the
15743 headers.
15744 * testsuite/script_test_4.sh: New file.
15745 * testsuite/script_test_4.t: New file.
15746 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15747 (check_DATA): Add script_test_4.stdout.
15748 (MOSTLYCLEANFILES): Likewise.
15749 (script_test_4): New target.
15750 (script_test_4.stdout): New target.
15751 * testsuite/Makefile.in: Rebuild.
15752
4f2a9edd
ILT
15753 * sparc.cc: Add definitions for Output_data_plt_sparc class
15754 constants.
15755
f5314dd5
DM
157562008-04-14 David S. Miller <davem@davemloft.net>
15757
15758 * sparc.cc: New file.
15759 * Makefile.am (TARGETSOURCES): Add sparc.cc
15760 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15761 * configure.tgt: Document targ_extra_size and
15762 targ_extra_big_endian. Add entries for sparc-* and
15763 sparc64-*.
15764 * configure.ac: Handle targ_extra_size and
15765 targ_extra_big_endian.
15766 * Makefile.in: Rebuild.
15767 * configure: Likewise.
15768 * po/POTFILES.in: Likewise.
15769 * po/gold.pot: Likewise.
15770
154e0e9a
ILT
157712008-04-14 Ian Lance Taylor <iant@google.com>
15772
15773 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15774 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15775 in the name/type/flags to section mapping. Don't call
15776 allocate_output_section.
15777 (Layout::choose_output_section): Change parameter from adjust_name
15778 to is_input_section. Don't permit input sections after sections
15779 are attached to segments. Don't call allocate_output_section.
15780 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15781 not write_enable_output_section.
15782 (Layout::make_output_section): Don't push to
15783 unattached_section_list_ nor call attach_to_segment. Call
15784 attach_section_to_segment if sections are attached.
15785 (Layout::attach_sections_to_segments): New function.
15786 (Layout::attach_section_to_segment): New function.
15787 (Layout::attach_allocated_section_to_segment): Rename from
15788 attach_to_segment. Remove flags parameter.
15789 (Layout::allocate_output_section): Remove function.
15790 (Layout::write_enable_output_section): Remove function.
15791 * layout.h (class Layout): Update for above changes. Add new
15792 field sections_are_attached_.
15793 * output.h (Output_section::update_flags_for_input_section): New
15794 function.
15795 * output.cc (Output_section::add_input_section): Call
15796 update_flags_for_input_section.
15797 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15798
009a67a2
CC
157992008-04-11 Cary Coutant <ccoutant@google.com>
15800
15801 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15802 thought unnecessary.
15803 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15804
759b1a24
ILT
158052008-04-11 Ian Lance Taylor <iant@google.com>
15806
15807 * output.h (class Output_section_data): Remove inline definition
15808 of set_addralign.
15809 * output.cc (Output_section_data::set_addralign): New function.
15810
c2b45e22
CC
158112008-04-11 Cary Coutant <ccoutant@google.com>
15812
15813 Add support for TLS descriptors for i386 and x86_64.
15814 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15815 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15816 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15817 GOT_TYPE_TLS_DESC.
15818 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15819 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15820 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15821 relocations.
15822 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15823 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15824 Fix problem with initial-exec relocations.
15825 (Target_i386::Relocate::relocate_tls): Likewise.
15826 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15827 relaxation.
15828 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15829 support for section-plus-offset dynamic table entries.
15830 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15831 (Output_data_dynamic::Dynamic_entry): Add support for
15832 section-plus-offset dynamic table entries.
15833 (Output_data_dynamic::Classification): Likewise.
15834 (Output_data_dynamic::classification_): Renamed offset_.
15835 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15836 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15837 (Target_x86_64::make_plt_section): New function.
15838 (Target_x86_64::reserve_tlsdesc_entries): New function.
15839 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15840 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15841 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15842 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15843 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15844 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15845 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15846 add extra PLT entry for TLS descriptors.
15847 (Output_data_plt_x86_64::got_): New field.
15848 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15849 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15850 fields.
15851 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15852 descriptors.
15853 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15854 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15855 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15856 R_386_TLS_DESC_CALL relocations.
15857 (Target_x86_64::Scan::global): Likewise.
15858 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15859 for TLS descriptors.
15860 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15861 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15862 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15863 GD-to-IE relaxation.
15864 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15865 and TLS_DESCRIPTORS.
15866 * Makefile.in: Rebuild.
15867 * configure: Rebuild.
15868 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15869 (tls_test_shared2.so): New target.
15870 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15871 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15872 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15873 (tls_shared_gd_to_ie_test_LDADD): New variable.
15874 (tls_shared_gnu2_gd_to_ie_test): New target.
15875 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15876 New targets.
15877 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15878 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15879 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15880 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15881 (tls_shared_gnu2_test): New target.
15882 (tls_test_gnu2_shared.so): New target.
15883 (tls_shared_gnu2_test_SOURCES): New variable.
15884 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15885 (tls_shared_gnu2_test_LDFLAGS): New variable.
15886 (tls_shared_gnu2_test_LDADD): New variable.
15887 * testsuite/Makefile.in: Rebuild.
15888 * testsuite/Makefile.
15889
83bfb6b7
ILT
158902008-04-11 Ian Lance Taylor <iant@google.com>
15891
15892 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15893 justsyms.t.
15894 * testsuite/Makefile.in: Rebuild.
15895
15896 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15897 long.
15898 * testsuite/script_test_2.cc (main): Adjust test.
15899
706e1f5e
ILT
159002008-04-11 David S. Miller <davem@davemloft.net>
15901 Ian Lance Taylor <iant@google.com>
15902
15903 * options.h (General_options): Add entries for '-Y' and
15904 '-relax'.
15905 * options.cc (General_options:finalize): If -Y was used, add those
15906 entries to the library path instead of the default "/lib" and
15907 "/usr/lib".
15908
7c98e6bb
DM
159092008-04-11 David S. Miller <davem@davemloft.net>
15910
15911 * testsuite/justsyms.t: Start at 0x100.
15912 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15913 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15914 long.
15915 * testsuite/script_test_2.cc: Adjust string and section length
15916 checks.
7c98e6bb 15917
99a37bfd
ILT
159182008-04-09 Ian Lance Taylor <iant@google.com>
15919
2cefc357
ILT
15920 PR gold/5996
15921 * script-sections.cc (Sections_element::allocate_to_segment): Add
15922 orphan parameter.
15923 (Output_section_definition::allocate_to_segment): Likewise.
15924 (Orphan_output_section::allocate_to_segment): Likewise.
15925 (Script_sections::attach_sections_using_phdrs_clause): Don't
15926 propagate non-PT_LOAD segments to orphan sections.
15927 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15928 readelf rather than objdump.
15929 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15930 .interp section and PT_INTERP segment are the same size.
15931 * testsuite/Makefile.in: Rebuild.
15932
99a37bfd
ILT
15933 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15934 aliases for symbols defined in the same object.
15935 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15936 (weak_alias_test_SOURCES): New variable.
15937 (weak_alias_test_DEPENDENCIES): New variable.
15938 (weak_alias_test_LDFLAGS): New variable.
15939 (weak_alias_test_LDADD): New variable.
15940 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15941 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15942 (weak_alias_test_3.o): New target.
15943 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15944 * testsuite/weak_alias_test_main.cc: New file.
15945 * testsuite/weak_alias_test_1.cc: New file.
15946 * testsuite/weak_alias_test_2.cc: New file.
15947 * testsuite/weak_alias_test_3.cc: New file.
15948
780e49c5
ILT
159492008-04-08 Ian Lance Taylor <iant@google.com>
15950
cdb0b8f5
ILT
15951 * options.h (class General_options): Add --noinhibit-exec option.
15952 * main.cc (main): Check --noinhibit-exec.
15953
0864d551
ILT
15954 * options.h (class General_options): Define --wrap as a special
15955 option. Add wrap_symbols_ field.
15956 (General_options::any_wrap_symbols): New function.
15957 (General_options::is_wrap_symbol): New function.
15958 * options.cc (General_options::parse_wrap): New function.
15959 (General_options::General_options): Initialize wrap_symbols_.
15960 * symtab.cc (Symbol_table::wrap_symbol): New function.
15961 (Symbol_table::add_from_object): Handle --wrap.
15962 * symtab.h (class Symbol_table): Declare wrap_symbol.
15963 * target.h (Target::wrap_char): New function.
15964 (Target::Target_info): Add wrap_char field.
15965 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15966 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15967 * testsuite/testfile.cc (Target_test::test_target_info):
15968 Likewise.
15969
789aa6de
ILT
15970 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15971 there is one.
15972
2c38906f
ILT
15973 * layout.h (class Layout): Add added_eh_frame_data_ field.
15974 * layout.cc (Layout::Layout): Initialize new field.
15975 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15976 output section until we find a section we merged successfully.
15977 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15978 that the size be non-zero.
15979
780e49c5
ILT
15980 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15981 qualifier.
15982
7fcd0256
ILT
159832008-04-08 Craig Silverstein <csilvers@google.com>
15984
15985 * configure.ac: Export new conditional variable HAVE_ZLIB.
15986 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15987 on HAVE_ZLIB.
15988 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15989 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15990
6835af53
ILT
159912008-04-07 Ian Lance Taylor <iant@google.com>
15992
e24f324c
ILT
15993 * version.cc (version_string): Set to "1.5".
15994
a036edd8
ILT
15995 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15996 Add issued_non_pic_error_ field. Declare check_non_pic.
15997 (Target_x86_64::Scan::check_non_pic): New function.
15998 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15999 (Target_x86_64::Scan::global): Likewise.
16000
624f8810
ILT
16001 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16002 addend parameter. Change caller. Handle merge sections.
16003 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16004 Address to Addend. Don't add in the result of
16005 local_section_offset, pass down the addend and use the returned
16006 value.
16007 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16008 Update declarations of local_section_offset and symbol_value.
16009 * testsuite/two_file_test_1.cc (t18): New function.
16010 * testsuite/two_file_test_2.cc (f18): New function.
16011 * testsuite/two_file_test_main.cc (main): Call t18.
16012 * testsuite/two_file_test.h (t18, f18): Declare.
16013
6835af53
ILT
16014 * configure.ac: Don't test for objdump, c++filt, or readelf.
16015 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16016 conditionals.
16017 (TEST_READELF): New variable.
16018 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16019 (check_PROGRAMS): Add two_file_strip_test.
16020 (two_file_strip_test): New target.
16021 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16022 (two_file_same_shared_strip_test_SOURCES): New variable.
16023 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16024 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16025 (two_file_same_shared_strip_test_LDADD): New variable.
16026 (two_file_shared_strip.so): New target.
16027 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16028 (ver_test_5.syms, ver_test_7.syms): Likewise.
16029 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16030 (strip_test_3.stdout): Use TEST_OBJDUMP.
16031 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16032
86925eef
CC
160332008-04-04 Cary Coutant <ccoutant@google.com>
16034
16035 * symtab.h (Symbol::is_weak_undefined): New function.
16036 (Symbol::is_strong_undefined): New function.
16037 (Symbol::is_absolute): New function.
16038 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16039 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16040 absolute symbols.
16041 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16042 (weak_undef_test): New target.
16043 * testsuite/Makefile.in: Rebuild.
16044 * testsuite/weak_undef_file1.cc: New file.
16045 * testsuite/weak_undef_file2.cc: New file.
16046 * testsuite/weak_undef_test.cc: New file.
16047
126f3ece
ILT
160482008-04-03 Craig Silverstein <csilvers@google.com>
16049
16050 * compressed_output.h (class Output_compressed_section): Use
16051 unsigned buffer.
16052 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16053 add zlib header.
16054 (zlib_compressed_suffix): Removed.
16055 (Output_compressed_section::set_final_data_size): Use unsigned
16056 buffers.
16057 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16058 Fix linker invocation.
16059 (flagstest_o_specialfile_and_compress_debug_sections):
16060 Likewise.
16061 * testsuite/Makefile.in: Regenerated.
16062
deae2a14
DM
160632008-04-02 David S. Miller <davem@davemloft.net>
16064
16065 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16066 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16067
70752818
ILT
160682008-04-02 Craig Silverstein <csilvers@google.com>
16069
16070 * TODO: New file.
16071
39d0cb0e
ILT
160722008-04-02 Ian Lance Taylor <iant@google.com>
16073
16074 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16075 parameters. Update for new key type to views_. Change all
16076 callers.
16077 (File_read::read): Adjust for byteshift in returned view.
16078 (File_read::add_view): New function, broken out of
16079 find_and_make_view.
16080 (File_read::make_view): New function, broken out of
16081 find_and_make_view.
16082 (File_read::find_or_make_view): Add offset and aligned
16083 parameters. Rewrite accordingly. Change all callers.
16084 (File_read::get_view): Add offset and aligned parameters. Adjust
16085 for byteshift in return value.
16086 (File_read::get_lasting_view): Likewise.
16087 * fileread.h (class File_read): Update declarations.
16088 (class File_read::View): Add byteshift_ field. Add byteshift to
16089 constructor. Add byteshift method.
16090 * archive.h (Archive::clear_uncached_views): New function.
16091 (Archive::get_view): Add aligned parameter. Change all callers.
16092 * object.h (Object::get_view): Add aligned parameter. Change all
16093 callers.
16094 (Object::get_lasting_view): Likewise.
16095
16096 * fileread.cc (File_read::release): Don't call clear_views if
16097 there are multiple objects.
16098 * fileread.h (File_read::clear_uncached_views): New function.
16099 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16100 on the archive.
16101
a1207466
CC
161022008-03-31 Cary Coutant <ccoutant@google.com>
16103
16104 Add thin archive support.
16105 * archive.cc (Archive::armagt): New const.
16106 (Archive::setup): Remove task parameter and calls to unlock.
16107 (Archive::unlock_nested_archives): New function.
16108 (Archive::read_header): Add nested_off parameter. Change
16109 all callers.
16110 (Archive::interpret_header): Likewise.
16111 (Archive::include_all_members): Change to handle thin
16112 archives.
16113 (Archive::include_member): Likewise.
16114 * archive.h (Archive::Archive): Add new parameters and
16115 initializers.
16116 (Archive::armagt): New const.
16117 (Archive::setup): Remove task parameter.
16118 (Archive::unlock_nested_archives): New function.
16119 (Archive::read_header): Add nested_off parameter.
16120 (Archive::interpret_header): Likewise.
16121 (Archive::Nested_archive_table): New typedef.
16122 (Archive::is_thin_archive_): New field.
16123 (Archive::nested_archives_): New field.
16124 (Archive::options_): New field.
16125 (Archive::dirpath_): New field.
16126 (Archive::task_): New field.
16127 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16128 for thin archives. Pass additional parameters to
16129 Archive::Archive. Unlock the archive file after calling
16130 Archive::setup.
cd536b21 16131
479f6503
ILT
161322008-03-29 Ian Lance Taylor <iant@google.com>
16133
686c8caf
ILT
16134 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16135 version symbol to be local.
16136 * testsuite/ver_test_4.sh: New file.
16137 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16138 (check_DATA): Add ver_test_4.syms.
16139 (ver_test_4.syms): New target.
16140 * testsuite/Makefile.in: Rebuild.
16141
ab794b6b
ILT
16142 * output.cc
16143 (Output_section::Input_section_sort_entry::has_priority): New
16144 function.
16145 (Output_section::Input_section_sort_entry::match_file_name): New
16146 function.
16147 (Output_section::Input_section_sort_entry::match_section_name):
16148 Remove.
16149 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16150 Remove.
16151 (Output_section::Input_section_sort_entry::match_section_file):
16152 Remove.
16153 (Output_section::Input_section_sort_compare::operator()): Rewrite
16154 using new Input_section_sort_entry functions. Sort crtbegin and
16155 crtend first. Sort sections with no priority before sections with
16156 a priority.
16157 * testsuite/initpri1.c (d3): Check j != 4.
16158 (cd5): New constructor/destructor function.
16159 (main): Check j != 2.
16160
479f6503
ILT
16161 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16162 new symbol when resolving, don't call set_is_default.
16163 * testsuite/ver_test_7.cc: New file.
16164 * testsuite/ver_test_7.sh: New file.
16165 * testsuite/Makefile.am (ver_test_7.so): New target.
16166 (ver_test_7.o): New target.
16167 (check_SCRIPTS): Add ver_test_7.sh.
16168 (check_DATA): Add ver_test_7.syms.
16169 (ver_test_7.syms): New target.
16170
2fd32231
ILT
161712008-03-28 Ian Lance Taylor <iant@google.com>
16172
16173 * layout.cc (Layout::layout): If we see an input section with a
16174 name that needs sorting, set the must_sort flag for the output
16175 section.
16176 (Layout::make_output_section): If the name of the output section
16177 indicates that it might require sorting, set the may_sort flag.
16178 * output.h (Output_section::may_sort_attached_input_sections): New
16179 function.
16180 (Output_section::set_may_sort_attached_input_sections): New
16181 function.
16182 (Output_section::must_sort_attached_input_sections): New
16183 function.
16184 (Output_section::set_must_sort_attached_input_sections): New
16185 function.
16186 (class Output_section): Declare Input_section_sort_entry. Define
16187 Input_section_sort_compare. Declare
16188 sort_attached_input_sections. Add new fields:
16189 may_sort_attached_input_sections_,
16190 must_sort_attached_input_sections_,
16191 attached_input_sections_are_sorted_.
16192 * output.cc (Output_section::Output_section): Initialize new
16193 fields.
16194 (Output_section::add_input_section): Add an entry to
16195 input_sections_ if may_sort or must_sort are true.
16196 (Output_section::set_final_data_size): Call
16197 sort_attached_input_sections if necessary.
16198 (Output_section::Input_section_sort_entry): Define new class.
16199 (Output_section::Input_section_sort_compare::operator()): New
16200 function.
16201 (Output_section::sort_attached_input_sections): New function.
16202 * configure.ac: Check whether the compiler supports constructor
16203 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16204 * testsuite/initpri1.c: New file.
16205 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16206 CONSTRUCTOR_PRIORITY.
16207 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16208 (initpri1_LDFLAGS): New variable.
16209 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16210
18e6b24e
ILT
162112008-03-27 Ian Lance Taylor <iant@google.com>
16212
49bdd526
ILT
16213 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16214 * testsuite/common_test_1.c: New file.
16215 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16216 (common_test_1_SOURCES): New variable.
16217 (common_test_1_DEPENDENCIES): New variable.
16218 (common_test_1_LDFLAGS): New variable.
16219
18e6b24e
ILT
16220 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16221 and commons_ correctly when NAME/VERSION does not override
16222 NAME/NULL.
16223 * testsuite/ver_test_6.c: New file.
16224 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16225 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16226 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16227
04bf7072
ILT
162282008-03-26 Ian Lance Taylor <iant@google.com>
16229
5871526f
ILT
16230 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16231 of an undefined symbol from a version script.
16232 * testsuite/Makefile.am (ver_test_5.so): New target.
16233 (ver_test_5.o): New target.
16234 (check_SCRIPTS): Add ver_test_5.sh.
16235 (check_DATA): Add ver_test_5.syms.
16236 (ver_test_5.syms): New target.
16237 * testsuite/ver_test_5.cc: New file.
16238 * testsuite/ver_test_5.script: New file.
16239 * testsuite/ver_test_5.sh: New file.
16240 * Makefile.in, testsuite/Makefile.in: Rebuild.
16241
04bf7072
ILT
16242 PR gold/5986
16243 Fix problems building gold with gcc 4.3.0.
16244 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16245 (gold_error_at_location, gold_warning_at_location): Use it.
16246 * configure.ac: Check whether we can compile and use a template
16247 function with a printf attribute.
16248 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16249 when jumping over bytes.
16250 * object.cc: Instantiate Object::read_section_data.
16251 * debug.h: Include <cstring>
16252 * dwarf_reader.cc: Include <algorithm>
16253 * main.cc: Include <cstring>.
16254 * options.cc: Include <cstring>.
16255 * output.cc: Include <cstring>.
16256 * script.cc: Include <cstring>.
16257 * script.h: Include <string>.
16258 * symtab.cc: Include <cstring> and <algorithm>.
16259 * target-select.cc: Include <cstring>.
16260 * version.cc: Include <string>.
16261 * testsuite/testmain.cc: Include <cstdlib>.
16262 * configure, config.in: Rebuild.
16263
874c5b28
ILT
162642008-03-25 Ian Lance Taylor <iant@google.com>
16265
819d6c3a
ILT
16266 * options.cc: Include "../bfd/bfdver.h".
16267 (options::help): Print bug reporting address.
16268
f4b2c6f5
ILT
16269 * version.cc (print_version): Adjust output for current value of
16270 BFD_VERSION_STRING.
16271
16272 * NEWS: New file.
16273
e96caa79
ILT
16274 * options.cc (options::help): Print list of supported targets.
16275 * target-select.h: Include <vector>.
16276 (class Target_selector): Make machine_, size_, and is_big_endian_
16277 fields const. Add bfd_name_ and instantiated_target_ fields.
16278 (Target_selector::Target_selector): Add bfd_name parameter.
16279 (Target_selector::recognize): Make non-virtual, call
16280 do_recognize.
16281 (Target_selector::recognize_by_name): Make non-virtual, call
16282 do_recognize_by_name.
16283 (Target_selector::supported_names): New function.
16284 (Target_selector::bfd_name): New function.
16285 (Target_selector::do_instantiate_target): New pure virtual
16286 function.
16287 (Target_selector::do_recognize): New virtual function.
16288 (Target_selector::do_recognize_by_name): New virtual function.
16289 (Target_selector::instantiate_target): New private function.
16290 (supported_target_names): Declare.
16291 * target-select.cc (Target_selector::Target_selector): Update for
16292 new parameter and fields.
16293 (select_target_by_name): Check that the name matches before
16294 calling recognize_by_name.
16295 (supported_target_names): New function.
16296 * i386.cc (class Target_selector_i386): Update Target_selector
16297 constructor call. Remove recognize and recognize_by_name. Add
16298 do_instantiate_target.
16299 * x86_64.cc (class Target_selector_x86_64): Likewise.
16300 * testsuite/testfile.cc (class Target_selector_test): Update for
16301 changes to Target_selector.
16302
874c5b28
ILT
16303 * README: Rewrite, with some notes on unsupported features.
16304
0a65a3a7
CC
163052008-03-24 Cary Coutant <ccoutant@google.com>
16306
16307 * i386.cc (Target_i386::Got_type): New enum declaration.
16308 (Target_i386::Scan::local): Updated callers of Output_data_got
16309 member functions.
16310 (Target_i386::Scan::global): Likewise.
16311 (Target_i386::Relocate::relocate): Likewise.
16312 (Target_i386::Relocate::relocate_tls): Likewise.
16313 * object.h (Got_offset_list): New class.
16314 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16315 (Sized_relobj::local_got_offset): Likewise.
16316 (Sized_relobj::set_local_got_offset): Likewise.
16317 (Sized_relobj::local_has_tls_got_offset): Removed.
16318 (Sized_relobj::local_tls_got_offset): Removed.
16319 (Sized_relobj::set_local_tls_got_offset): Removed.
16320 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16321 * output.cc (Output_data_got::add_global): Added got_type parameter.
16322 (Output_data_got::add_global_with_rel): Likewise.
16323 (Output_data_got::add_global_with_rela): Likewise.
16324 (Output_data_got::add_global_pair_with_rel): New function.
16325 (Output_data_got::add_global_pair_with_rela): New function.
16326 (Output_data_got::add_local): Added got_type parameter.
16327 (Output_data_got::add_local_with_rel): Likewise.
16328 (Output_data_got::add_local_with_rela): Likewise.
16329 (Output_data_got::add_local_pair_with_rel): New function.
16330 (Output_data_got::add_local_pair_with_rela): New function.
16331 (Output_data_got::add_global_tls): Removed.
16332 (Output_data_got::add_global_tls_with_rel): Removed.
16333 (Output_data_got::add_global_tls_with_rela): Removed.
16334 (Output_data_got::add_local_tls): Removed.
16335 (Output_data_got::add_local_tls_with_rel): Removed.
16336 (Output_data_got::add_local_tls_with_rela): Removed.
16337 * output.h (Output_data_got::add_global): Added got_type parameter.
16338 (Output_data_got::add_global_with_rel): Likewise.
16339 (Output_data_got::add_global_with_rela): Likewise.
16340 (Output_data_got::add_global_pair_with_rel): New function.
16341 (Output_data_got::add_global_pair_with_rela): New function.
16342 (Output_data_got::add_local): Added got_type parameter.
16343 (Output_data_got::add_local_with_rel): Likewise.
16344 (Output_data_got::add_local_with_rela): Likewise.
16345 (Output_data_got::add_local_pair_with_rel): New function.
16346 (Output_data_got::add_local_pair_with_rela): New function.
16347 (Output_data_got::add_global_tls): Removed.
16348 (Output_data_got::add_global_tls_with_rel): Removed.
16349 (Output_data_got::add_global_tls_with_rela): Removed.
16350 (Output_data_got::add_local_tls): Removed.
16351 (Output_data_got::add_local_tls_with_rel): Removed.
16352 (Output_data_got::add_local_tls_with_rela): Removed.
16353 * resolve.cc (Symbol::override_base_with_special): Removed
16354 reference to has_got_offset_ field.
16355 * symtab.cc (Symbol::init_fields): Replaced initialization
16356 of got_offset_ with got_offsets_. Removed initialization
16357 of has_got_offset_
53fcba31 16358 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16359 (Symbol::got_offset): Likewise.
16360 (Symbol::set_got_offset): Likewise.
16361 (Symbol::has_tls_got_offset): Removed.
16362 (Symbol::tls_got_offset): Removed.
16363 (Symbol::set_tls_got_offset): Removed.
16364 (Symbol::got_offset_): Removed.
16365 (Symbol::tls_mod_got_offset_): Removed.
16366 (Symbol::tls_pair_got_offset_): Removed.
16367 (Symbol::got_offsets_): New field.
16368 (Symbol::has_got_offset): Removed.
16369 (Symbol::has_tls_mod_got_offset): Removed.
16370 (Symbol::has_tls_pair_got_offset): Removed.
16371 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16372 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16373 member functions.
16374 (Target_x86_64::Scan::global): Likewise.
16375 (Target_x86_64::Relocate::relocate): Likewise.
16376 (Target_x86_64::Relocate::relocate_tls): Likewise.
16377
bd52eafb
BE
163782008-03-25 Ben Elliston <bje@au.ibm.com>
16379
16380 * yyscript.y: Fix spelling error in comment.
16381
8b105e34
ILT
163822008-03-24 Ian Lance Taylor <iant@google.com>
16383
8ed814a9
ILT
16384 * options.h (class General_options): Define build_id option.
16385 * layout.h (class Layout): Declare write_build_id, create_note,
16386 create_build_id. Add build_id_note_ member.
16387 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16388 "libiberty.h", "md5.h", "sha1.h".
16389 (Layout::Layout): Initialize eh_frame_data_,
16390 eh_frame_hdr_section_, and build_id_note_.
16391 (Layout::finalize): Call create_build_id.
16392 (Layout::create_note): New function, broken out of
16393 Layout::create_gold_note.
16394 (Layout::create_gold_note): Call create_note.
16395 (Layout::create_build_id): New function.
16396 (Layout::write_build_id): New function.
16397 (Close_task_runner::run): Call write_build_id.
16398
8b105e34
ILT
16399 * x86_64.cc: Correct license to GPLv3.
16400
086a1841
ILT
164012008-03-23 Ian Lance Taylor <iant@google.com>
16402
16403 * options.cc: Include "demangle.h".
16404 (parse_optional_string): New function.
16405 (parse_long_option): Handle takes_optional_argument.
16406 (parse_short_option): Update dash_z initializer. Handle
16407 takes_optional_argument.
16408 (General_options::General_options): Initialize do_demangle_.
16409 (General_options::finalize): Set do_demangle_. Handle demangling
16410 style.
16411 * options.h (parse_optional_string): Declare.
16412 (struct One_option): Add optional_arg field. Update constructor.
16413 Update call constructor calls. Add takes_optional_argument
16414 function.
16415 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16416 (DEFINE_optional_string): Define.
16417 (General_options::demangle): Change from DEFINE_bool to
16418 DEFINE_optional_string.
16419 (General_options::no_demangle): New function.
16420 (General_options::do_demangle): New function.
16421 (General_options::set_do_demangle): New function.
16422 (General_options::execstack_status_): Move definition to end of
16423 class definition.
16424 (General_options::static_): Likewise.
16425 (General_options::do_demangle_): New field.
16426 * object.cc (big_endian>::get_symbol_location_info): Call
16427 Options::do_demangle, not Options::demangle.
16428 * symtab.cc (demangle): Likewise.
16429
cbb93e63
ILT
164302008-03-22 Ian Lance Taylor <iant@google.com>
16431
16432 * gold.h: Include <cstddef> and <sys/types.h>
16433 * options.h: Include <cstring>.
16434
ec531623
ILT
164352008-03-21 Ian Lance Taylor <iant@google.com>
16436
16437 * Added source code to GNU binutils.
752937aa 16438\f
4b95cf5c 16439Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16440
16441Copying and distribution of this file, with or without modification,
16442are permitted in any medium without royalty provided the copyright
16443notice and this notice are preserved.
16444
16445Local Variables:
16446mode: change-log
16447left-margin: 8
16448fill-column: 74
16449version-control: never
16450End:
This page took 1.061623 seconds and 4 git commands to generate.