Correct printed year in copyright notices
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
b90efa5b
AM
12015-01-01 Alan Modra <amodra@gmail.com>
2
3 Update year range in copyright notice of all files.
4
f12d1e8a
AM
52014-12-25 Alan Modra <amodra@gmail.com>
6
7 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
8 new enums.
9 (Target_arm::merge_object_attributes, ): Likewise.
10
5c294fee
TG
112014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
12
13 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
14 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
15 AEABI_VFP_args_vfp to check that.
16 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
17 value and replace hardcoded values by enum values.
18
e30880c2
CC
192014-12-22 Cary Coutant <ccoutant@google.com>
20
21 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
22
bd040da1
L
232014-12-20 H.J. Lu <hongjiu.lu@intel.com>
24
25 PR gold/14608
26 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
27 to "return i * i * 3;".
28
e02a4046
CC
292014-12-16 Cary Coutant <ccoutant@google.com>
30
31 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
32 (Mapfile::print_output_data): Use current_data_size() to avoid
33 assert for sections requiring postprocessing; if address is not valid,
34 print 0.
35 (Mapfile::print_output_section): Use current_data_size(); print note
36 that addresses and sizes are before compression.
37
add6016b
L
382014-12-14 H.J. Lu <hongjiu.lu@intel.com>
39
40 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
41 Cast current_group_size to unsigned long when reporting error.
42
0bf32ea9
JY
432014-12-10 Jing Yu <jingyu@google.com>
44
45 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
46 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
47 Update error message.
48 (Target_aarch64::do_relax): Use absolute value of option
49 stub_group_size. Replace local variable with class member
50 stub_group_size_.
51
cbcb23fa
AM
522014-12-04 Alan Modra <amodra@gmail.com>
53
54 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
55 addend of PLTREL24 reloc when not generating a plt stub. Make
56 max_branch_offset an "Address".
fbad6518 57 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
58 (Target_powerpc::Relocate::relocate): Likewise.
59
1611bc4a
AM
602014-12-04 Alan Modra <amodra@gmail.com>
61
62 PR 17670
63 * symtab.cc (Symbol::set_undefined): Remove assertion.
64 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
65 on symbols defined in discarded sections, instead return false.
66 Rearrange params, update all callers.
67 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
68 branches to syms in discarded sections.
69 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
70 undefined and flag as discarded.
71 (Target_powerpc::Relocate::relocate): Localize variable.
72
4759c34e
L
732014-12-03 H.J. Lu <hongjiu.lu@intel.com>
74
75 PR gold/17675
76 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
77 * testsuite/Makefile.in: Regenerated.
78
1f98a074
AM
792014-12-03 Alan Modra <amodra@gmail.com>
80
81 PR 17566
82 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
83 when adding dynamic relocations against section symbols.
84
fb257835
DI
852014-12-01 Dimitry Ivanov <dimitry@google.com>
86
87 * layout.cc (Layout::finish_dynamic_section): When '-z global'
88 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
89 * options.h (General_options): New -z option (global).
90
d8e60314
CC
912014-12-01 Cary Coutant <ccoutant@google.com>
92
93 PR gold/17578
94 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
95 is given.
96 (Layout::create_executable_stack_info): Warn when -z noexecstack is
97 given but some inputs require executable stack.
98
982bbd97
CC
992014-11-26 Cary Coutant <ccoutant@google.com>
100
101 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
102 .debug_str_offsets; strip .debug_gnu_pubnames and
103 .debug_gnu_pubtypes.
104 (lines_only_debug_sections): Strip all four new sections.
105
bb779192
HS
1062014-11-26 Jing Yu <jingyu@google.com>
107
108 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
109 register to be x0 when to relax TLSDESC_LD64_LO12.
110
a3e60ddb
AM
1112014-11-26 Alan Modra <amodra@gmail.com>
112
113 * powerpc.cc (struct Stub_table_owner): New.
114 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
115 unsigned int vector. Update all references.
116 (powerpc_relobj::set_stub_table): Take an unsigned int param
117 rather than a Stub_table. Update callers.
118 (Powerpc_relobj::clear_stub_table): New function.
119 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
120 stub_group_size_ vars.
121 (Target_powerpc::new_stub_table): Delete.
122 (max_branch_delta): New function, extracted from..
123 (Target_powerpc::Relocate::relocate): ..here..
124 (Target_powerpc::Branch_info::make_stub): ..and here. Return
125 status on whether stub created successfully.
126 (Stub_control::Stub_control): Add "no_size_errors" param. Move
127 default sizing to..
128 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
129 reduce on relax failure.
130 (Target_powerpc::group_sections): Add "no_size_errors" param.
131 Use stub_group_size_. Set up group info in a temp vector,
132 before building Stub_table vector. Account for input sections
133 possibly already converted to relaxed sections.
134 (Stub_table::init): Delete. Merge into..
135 (Stub_table::Stub_table): ..here.
136 (Stub_table::can_reach_stub): New function.
137 (Stub_table::add_plt_call_entry): Add "from" parameter and
138 return true iff stub could be reached.
139 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
140 param too.
141 (Stub_table::clear_stubs): Add "all" param.
142
a20605cf
AM
1432014-11-26 Alan Modra <amodra@gmail.com>
144
145 * powerpc.cc (Stub_control::set_output_and_owner): New function.
146 (Target_powerpc::group_sections): Use it.
147
43b64deb
CC
1482014-11-25 Cary Coutant <ccoutant@google.com>
149
150 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
151 (Binary_to_elf::write_symbol): Add st_size parameter.
152 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
153
c924eb67
CC
1542014-11-25 Cary Coutant <ccoutant@google.com>
155
156 PR gold/17639
157 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
158 (Sized_relobj_file::do_layout): Handle deferred sections properly
159 during GC pass 1. Don't add reloc sections to deferred list twice.
160 * object.h (Sized_relobj_file::is_deferred_layout): New function.
161 (Sized_relobj_file::is_deferred_layout_): New data member.
162
9d585188
L
1632014-11-21 H.J. Lu <hongjiu.lu@intel.com>
164
165 PR gold/17619
166 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
167 Check PC-relative offset overflow in PLT entry.
168
3ffaac20
AM
1692014-11-21 Alan Modra <amodra@gmail.com>
170
171 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
172 for undefined weaks.
173
0cfb0717
AM
1742014-11-20 Alan Modra <amodra@gmail.com>
175
176 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
177 from --stub-group-size parameter divided by 1024.
178 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
179 template parameter. Update all uses.
180 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
181 has_stub_value. Set for long branches. Don't report overflow for
182 branch to undefined weak symbols. Print info message on
183 overflowing branch to stub.
184
f9dffbf0
AM
1852014-11-20 Alan Modra <amodra@gmail.com>
186
187 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
188
e88ba8d5
L
1892014-11-13 H.J. Lu <hongjiu.lu@intel.com>
190
191 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
192 entry for R_X86_64_GOTPLT64.
193 (Target_x86_64<size>::Relocate::relocate): Update comments for
194 R_X86_64_GOTPLT64.
195
d37ffe25
ED
1962014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
197
198 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
199 * plugin.h: add lock definition
200
9726c3c1
HS
2012014-10-29 Han Shen <shenhan@google.com>
202 Jing Yu <jingyu@google.com>
203
204 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
205 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
206 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
207 Symbol::TLS_REF.
208 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
209 method.
210 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
211 (Target_aarch64::tls_ld_to_le): New method.
212 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
213 for 64bit targets.
214 (Output_data_plt_aarch64::irelative_rel_): New data member.
215 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
216 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
217 (Output_data_plt_aarch64::add_relocation): New method.
218 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
219 offset. Add got_irelative size to got size.
220 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
221 type string with the new typename.
222 (AArch64_relocate_functions::update_adr): Replace parameter x with
223 immed.
224 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
225 (AArch64_relocate_functions::reloc_common): New method.
226 (AArch64_relocate_funcsions::rela_general): Extract common part out
227 into reloc_common method.
228 (AArch64_relocate_functions::rela_general): Likewise.
229 (AArch64_relocate_functions::pcrela_general): Likewise.
230 (AArch64_relocate_functions::adr): New method.
231 (AArch64_relocate_functions::adrp): Calculate immed before calling
232 update_adr.
233 (AArch64_relocate_functions::adrp): Likewise.
234 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
235 comparing x to 0. Calculate immed from ~x when x < 0.
236 (Target_aarch64::optimize_tls_reloc): Add new cases for
237 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
238 TLSLD_MOVW_DTPREL_G0_NC.
239 (Target_aarch64::possible_function_pointer_reloc): Implement this
240 method.
241 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
242 comment.
243 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
244 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
245 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
246 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
247 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
248 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
249 (Target_aarch64::make_plt_entry): Call add_entry with two more
250 parameters.
251 (Target_aarch64::make_local_ifunc_plt_entry): New method.
252 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
253 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
254 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
255 (Target_aarch64::Relocate::relocate_tls): Add cases for
256 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
257 TLSLD_MOVW_DTPREL_G0_NC.
258 * testsuite/icf_safe_so_test.cc: Correct test comment.
259 * testsuite/icf_safe_test.sh: Add AArch64 arch.
260
80272b8c
AM
2612014-10-22 Alan Modra <amodra@gmail.com>
262
263 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
264 thread_starter.
265
998a69f4
AS
2662014-10-18 Andreas Schwab <schwab@linux-m68k.org>
267
268 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
269
aed56ec5
CC
2702014-10-17 Cary Coutant <ccoutant@google.com>
271
272 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
273 Add "typename" keyword.
274
bb779192 2752014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
276 Jing Yu <jingyu@google.com>
277
278 Patch for gold aarch64 backend to support relaxation.
279 * aarch64-reloc.def: Change format.
280 * aarch64.cc (class Reloc_stub): New class.
281 (class Stub_table): New class.
282 (class AArch64_relobj): New class.
283 (class AArch64_input_section): New class.
284 (class AArch64_output_section): New class.
285 (Target_aarch64::new_stub_table): New method.
286 (Target_aarch64::new_aarch64_input_section): New method.
287 (Target_aarch64::find_aarch64_input_section): New method.
288 (Target_aarch64::scan_section_for_stubs): New method.
289 (Target_aarch64::scan_reloc_section_for_stubs): New method.
290 (Target_aarch64::relocate_stub): New method.
291 (Target_aarch64::current_target): New method.
292 (Target_aarch64::do_make_elf_object): New method.
293 (Target_aarch64::do_may_relax): New method.
294 (Target_aarch64::do_relax): New method.
295 (Target_aarch64::group_sections): New method.
296 (Target_aarch64::scan_reloc_for_stub): New method.
297 (Target_aarch64::do_make_output_section): New method.
298 (Target_aarch64::stub_tables_): New data member.
299 (Target_aarch64::aarch64_input_section_map_): New data member.
300 (AArch64_relocate_functions::maybe_apply_stub): New method.
301
db4c9594
CC
3022014-09-30 Cary Coutant <ccoutant@google.com>
303
304 PR gold/17432
305 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
306
cd6da036
KC
3072014-09-30 Kito Cheng <kito@0xlab.org>
308
309 PR gold/13597
310 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
311 hash table before sysv-style hash table.
312
5f772412
ST
3132014-09-29 Sriraman Tallam <tmsriram@google.com>
314
315 * options.h (--pic-executable): Add negative to alias to -no-pie.
316
5efeedf6
CC
3172014-09-26 Cary Coutant <ccoutant@google.com>
318
319 PR gold/16773
320 * object.cc (Sized_relobj_file): Compute value of section symbols
321 for TLS sections the same as TLS symbols.
322
1707f183
CC
3232014-09-25 Cary Coutant <ccoutant@google.com>
324
325 PR gold/17432
326 * resolve.cc (Symbol_table::resolve): Override common placeholder
327 symbols, but adjust sizes.
328 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
329 symbols to common lists.
330
00cac886
AM
3312014-09-24 Alan Modra <amodra@gmail.com>
332
333 * po/POTFILES.in: Regenerate.
334
635aa30e
CC
3352014-09-23 Taiju Tsuiki <tzik@google.com>
336 Cary Coutant <ccoutant@google.com>
337
71b9b91b 338 PR gold/14860
635aa30e
CC
339 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
340 on input_sections_blocker.
341 * layout.cc (Write_sections_task::locks): Unblock
342 input_sections_blocker_.
343 * layout.h (Write_sections_task::Write_sections_task): Add
344 input_sections_blocker.
345 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
346 to DEPENDENCIES.
347 * testsuite/Makefile.in: Regenerate.
348
c0c71592
RÁE
3492014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
350
351 * testsuite/Makefile.am (plugin_test_10): New test.
352 * testsuite/Makefile.in: Regenerate
353 * testsuite/plugin_common_test_2.c (c1): Align to 8.
354 * testsuite/plugin_test_10.sh: New file.
355
6168c2a1
RÁE
3562014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
357
358 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
359 * resolve.cc (Symbol_table::resolve): Don't override common symbols
360 during the replacement phase.
361
3a531937
JY
3622014-09-17 Han Shen <shenhan@google.com>
363 Jing Yu <jingyu@google.com>
364
365 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
366 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
367 * aarch64.cc (Target_aarch64): Add data members
368 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
369 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
370 constructor.
371 (Target_aarch64::do_reloc_symbol_index): New method.
372 (Target_aarch64::do_reloc_addend): New method.
373 (Target_aarch64::add_tlsdesc_info): New method.
374 (Target_aarch64::do_dynsym_value): New method.
375 (Target_aarch64::do_make_data_plt): Add new parameters: got,
376 got_irelative. Pass them to Output_data_plt_aarch64_standard.
377 (Target_aarch64::make_data_plt): Add new parameters: got,
378 got_irelative. Pass them to do_make_data_plt.
379 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
380 (Target_aarch64::Relocate:tls_gd_to_le): New method.
381 (Target_aarch64::Relocate:tls_ie_to_le): New method.
382 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
383 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
384 (Target_aarch64::got_tlsdesc_section): New method.
385 (Target_aarch64::make_local_ifunc_plt_entry): New method.
386 (Target_aarch64::define_tls_base_symbol): New method.
387 (Target_aarch64::reserve_tlsdesc_entries): New method.
388 (Target_aarch64::got_mod_index_entry): New method.
389 (Target_aarch64::rela_tlsdesc_section): New method.
390 (Target_aarch64::rela_irelative_section): New method.
391 (Target_aarch64::Tlsdesc_info): New struct.
392 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
393 relocations and tlsdesc relocations.
394 (Target_aarch64::optimize_tls_reloc): Implement method.
395 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
396 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
397 in constructor.
398 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
399 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
400 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
401 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
402 (Output_data_plt_aarch64::rela_tlsdesc): New method.
403 (Output_data_plt_aarch64::rela_irelative): New method.
404 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
405 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
406 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
407 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
408 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
409 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
410 (Output_data_plt_aarch64_standard): New member variables:
411 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
412 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
413 New parameter: got, got_irelative.
414 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
415 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
416 (Output_data_plt_aarch64::do_write): Replace got_address with
417 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
418 (AArch64_relocate_functions::update_movnz): New method.
419 (AArch64_relocate_functions): Correct format.
420 (AArch64_relocate_functions::movnz): New method.
421 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
422 before the switch. Add new cases to switch.
00cac886 423 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
424 tlsgd tlsdesc cases.
425 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
426 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
427 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
428 Call reloc_name_in_error_message to print unsupported reloc.
429 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
430 make_data_plt.
431 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
432 relocs. Fill in some more dynamic tags.
433 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
434 Skip call tls_get_addr when tlsgd is relaxed.
435 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
436 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
437 tlsdesc->ie relaxation.
438
62661c93
SS
4392014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
440
441 * mips.cc (Target_mips_nacl): New class.
442 (Target_selector_mips_nacl): New class.
443 (target_selector_mips32): Rename from target_selector_mips32be and use
444 Target_selector_mips_nacl instead of Target_selector_mips.
445 (target_selector_mips32el): Rename from target_selector_mips32 and use
446 Target_selector_mips_nacl instead of Target_selector_mips.
447 (target_selector_mips64): Rename from target_selector_mips64be and use
448 Target_selector_mips_nacl instead of Target_selector_mips.
449 (target_selector_mips64el): Rename from target_selector_mips64 and use
450 Target_selector_mips_nacl instead of Target_selector_mips.
451 (Target_mips::mips_info): Add const attribute.
452
54674d38
CC
4532014-09-02 Cary Coutant <ccoutant@google.com>
454
455 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
456 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
457 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
458 (Sized_incr_dynobj::do_section_name): Likewise.
459 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
460 (Sized_incr_dynobj::do_section_name): Likewise.
461 * object.h (Object::section_name): Likewise.
462 (Object::do_section_name): Likewise.
463 (Sized_relobj_file::do_section_name): Likewise.
464 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
465 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
466
9860cbcf
CC
4672014-09-02 Cary Coutant <ccoutant@google.com>
468
469 PR gold/17005
470 * ehframe.cc (Fde::write): Add output_offset parameter.
471 (Cie::write): Likewise.
472 (Eh_frame::set_final_data_size): Account for offset within output
473 section.
474 (Eh_frame::do_sized_write): Likewise.
475 * ehframe.h (Fde::write): Add output_offset parameter.
476 (Cie::write): Likewise.
477 * output.cc (Output_section::Input_section_sort_entry): Remove
478 section_has_name_; add output_section_name parameter. Use
479 output section name for non-input sections.
480 (Output_section::Input_section_sort_entry::section_has_name): Remove.
481 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
482 (Output_section::Input_section_sort_compare): Remove logic for
483 sections without names.
484 (Output_section::Input_section_sort_init_fini_compare): Likewise.
485 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
486 Likewise.
487 (Output_section::Input_section_sort_section_name_compare): Likewise.
488
8e33481e
HS
4892014-08-29 Han Shen <shenhan@google.com>
490 Jing Yu <jingyu@google.com>
491
492 * aarch64-reloc-property.cc
493 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
494 reference reloc property in the table.
495 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
496 3 other entries.
497 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
498 2 new overloaded methods.
499 (Output_data_got_aarch64::do_write): Add code to write out
500 static relocs.
501 (class Output_data_got_aarch64::Static_reloc): New class to wrap
502 static relocs.
503 (Output_data_got_aarch64::static_relocs): New vector to
504 hold static relocs.
505 (Target_aarch64::TCB_SIZE): New const static memeber.
506 (Target_aarch64::tcb_size): New method.
507 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
508 (Target_aarch64::Relocate::relocate_tls): New method.
509 (Target_aarch64::Scan::local): Add code handling new reloc types.
510 (Target_aarch64::Scan::global): Add code handling new reloc types.
511
81233653
ST
5122014-08-13 Sriraman Tallam <tmsriram@google.com>
513
514 * options.h (-no-pie): Add option.
515
9363c7c3
JY
5162014-08-08 Jing Yu <jingyu@google.com>
517 Han Shen <shenhan@google.com>
518
519 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
520 (DEFFILES): add aarch64-reloc.def.
521 (TARGETSOURCES): Add aarch64-reloc-property.cc.
522 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
523 * Makefile.in: Regenerate.
524 * aarch64-reloc-property.cc: New file.
525 * aarch64-reloc-property.h: New file.
526 * aarch64-reloc.def: New file.
527 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
528 with tab to make the format consistent.
529 (Output_data_got_aarch64::symbol_table_): New method.
530 (Target_aarch64::do_plt_address_for_global): New method.
531 (Target_aarch64::do_plt_address_for_local): New method.
532 (Target_aarch64::do_select_as_default_target): New method.
533 (Target_aarch64::do_make_data_plt): New method.
534 (Target_aarch64::make_data_plt): New method.
535 (Output_data_plt_aarch64::has_irelative_section): New method.
536 (Output_data_plt_aarch64::address_for_global): New method.
537 (Output_data_plt_aarch64::address_for_local): New method.
538 (Output_data_plt_aarch64::irelative_rel_): New parameter.
539 (Output_data_plt_aarch64::add_entry): Implement contents.
540 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
541 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
542 the got_pov entry to plt0.
543 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
544 Implement contents.
545 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
546 (AArch64_howto): New struct.
547 (aarch64_howto[]): New static const array.
548 (AArch64_relocate_functions): New class.
549 (Target_aarch64::Scan::get_reference_flags): Remove method.
550 (Target_aarch64::Scan::local): Implement to support a few relocations.
551 (Target_aarch64::Scan::global): Implement to support a few relocations.
552 (Target_aarch64::make_plt_section): Implement contents.
553 (Target_aarch64::make_plt_entry): Implement contents.
554 (Target_aarch64::do_finalize_sections): Implement contents.
555 (Target_aarch64::Relocate::relocate): Implement a few relocations.
556 (Target_aarch64::relocate_section): Implement contents.
557
ad9fe6c1
AM
5582014-08-06 Alan Modra <amodra@gmail.com>
559
560 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
561
7cd4e5b7
AM
5622014-08-06 Alan Modra <amodra@gmail.com>
563
564 PR 13227
565 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
566
5ad9b0a7
ST
5672014-07-21 Sriraman Tallam <tmsriram@google.com>
568
569 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 570 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 571
e051745c
CC
5722014-07-08 Cary Coutant <ccoutant@google.com>
573
574 * expression.cc (struct Expression::Expression_eval_info): Add
575 new fields type_pointer, vis_pointer, and nonvis_pointer.
576 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
577 nonvis_pointer parameters. Adjust all calls.
578 (Symbol_expression::value): Update type, visibility, and nonvis bits
579 in caller.
580 * script.cc (Symbol_assignment::sized_finalize): Update type,
581 visibility, and remaining st_other bits for new symbol.
582 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
583 vis_pointer, and nonvis_pointer parameters.
584 * symtab.h (Symbol::set_type): New method.
585
586 * testsuite/Makefile.am (defsym_test): New test.
587 * testsuite/Makefile.in: Regenerate.
588 * testsuite/defsym_test.c: New file.
589 * testsuite/defsym_test.sh: New file.
590
f35c4853
CC
5912014-07-08 Cary Coutant <ccoutant@google.com>
592
593 PR gold/15639
594 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
595 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
596 (Sized_dynobj::base_read_symbols): ...new method.
597 * object.h (Sized_relobj_file::base_read_symbols): New method.
598 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
599 (Sized_relobj_file::base_read_symbols): ...new method.
600 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
601 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
602 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
603
2900af2d
AM
6042014-07-04 Alan Modra <amodra@gmail.com>
605
606 * po/POTFILES.in: Regenerate.
607
053a4d68
JY
6082014-07-02 Jing Yu <jingyu@google.com>
609
610 * aarch64.cc: New file
611 * Makefile.am (TARGETSOURCES): Add aarch64.cc
612 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
613 * Makefile.in: Regenerate.
614 * configure.tgt: Add entries for aarch64*.
615 * configure.ac: Likewise.
616 * configure: Likewise.
617
7b549045
AM
6182014-06-27 Alan Modra <amodra@gmail.com>
619
620 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
621
cb818dbf
CC
6222014-06-24 Cary Coutant <ccoutant@google.com>
623
624 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
625 sections.
626 (Dwo_file::sized_read_unit_index): Likewise.
627
9810d34d
SS
6282014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
629
630 * mips.cc: New file.
631 * Makefile.am (TARGETSOURCES): Add mips.cc
632 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
633 * configure.tgt: Add entries for mips*.
634 * configure.ac: Likewise.
635 * Makefile.in: Regenerate.
636 * configure: Likewise.
637
9baa787b
CC
6382014-06-09 Cary Coutant <ccoutant@google.com>
639
640 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
641 unit_length is within section bounds.
642
8f89af0a
CC
6432014-06-09 Cary Coutant <ccoutant@google.com>
644
645 PR gold/16980
646 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
647 map.
648
a47622ac
AM
6492014-06-07 Alan Modra <amodra@gmail.com>
650
651 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
652
4320c691
CC
6532014-06-06 Cary Coutant <ccoutant@google.com>
654
655 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
656 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
657 (Dwarf_pubnames_table::read_header): Likewise.
658 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
659 .debug_gnu_pubtypes.
660
270c9937
JB
6612014-06-05 Joel Brobecker <brobecker@adacore.com>
662
663 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
664 * Makefile.in, configure: Regenerate.
665
397998fc
AM
6662014-06-03 Alan Modra <amodra@gmail.com>
667
668 * powerpc.cc (addis_12_2): Define.
669 (Stub_table::do_write): Support fusion on ELFv2 stubs.
670
61f5c66f
AM
6712014-06-03 Alan Modra <amodra@gmail.com>
672
673 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
674 st_other output.
675
f6971787
AM
6762014-06-02 Alan Modra <amodra@gmail.com>
677
678 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
679 Only ignore relocs on ELFv1.
680 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
681
f6fb8322
CC
6822014-05-30 Cary Coutant <ccoutant@google.com>
683
684 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
685 * testsuite/Makefile.in: Regenerate.
686 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
687
c23dd342
L
6882014-05-27 H.J. Lu <hongjiu.lu@intel.com>
689
690 PR gold/16945
691 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
692 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
693
5fe7ffdc
AM
6942014-05-15 Alan Modra <amodra@gmail.com>
695
696 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
697 Compare FDE contents with DW_CFA_nop rather than 0.
698
a82bef93
ST
6992014-05-13 Sriraman Tallam <tmsriram@google.com>
700
701 * symtab.h (may_need_copy_reloc): Remove check for position independent
702 code.
703 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
704 position independence before pc absolute may_need_copy_reloc call.
705 Add check for executable output befor pc relative may_need_copy_reloc
706 call.
707 * i386.cc: Ditto.
708 * arm.cc: Ditto.
709 * sparc.cc: Ditto.
710 * tilegx.cc: Ditto.
711 * powerpc.cc: Add check for no position independence before
712 may_need_copy_reloc calls.
713 * testsuite/pie_copyrelocs_test.cc: New file.
714 * testsuite/pie_copyrelocs_shared_test.cc: New file.
715 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 716 * Makefile.in: Regenerate.
a82bef93 717
53c66605
ML
7182014-05-08 Martin Liška <mliska@suse.cz>
719
720 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
721
57b2284c
CC
7222014-05-06 Cary Coutant <ccoutant@google.com>
723
724 PR gold/16900
725 * i386.cc (Output_data_got_plt_i386): New class.
726 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
727 parameter. Change all callers.
728 (Output_data_plt_i386::layout_): Remove.
729 (Output_data_plt_i386::got_plt_): Change type.
730 (Target_i386::got_plt_): Change type. Change all references.
731 (Target_i386::got_section): Create instance of new class.
732 (Output_data_got_plt_i386::do_write): New function.
733 * x86_64.cc (Output_data_got_plt_x86_64): New class.
734 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
735 parameter. Change all callers.
736 (Output_data_plt_x86_64::layout_): Remove.
737 (Output_data_plt_x86_64::got_plt_): Change type.
738 (Target_x86_64::got_plt_): Change type. Change all references.
739 (Target_x86_64::got_section): Create instance of new class.
740 (Output_data_got_plt_x86_64::do_write): New function.
741 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
742 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
743 class.
744
6b97515d 7452014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 746
6b97515d
CC
747 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
748 if we have pubnames/pubtypes.
749
d1bddd3c
CC
7502014-05-02 Cary Coutant <ccoutant@google.com>
751
5fe7ffdc
AM
752 * defstd.cc (in_segment): Define __ehdr_start here...
753 * layout.cc (Layout::finalize): ...Instead of here. Set the
754 output segment when known.
755 * resolve.cc (Symbol::override_base_with_special): Remember
756 the original binding.
757 * symtab.cc (Symbol::set_output_segment): New function.
758 (Symbol::set_undefined): New function.
759 * symtab.h (Symbol::is_weak_undefined): Check original undef
760 binding.
761 (Symbol::is_strong_undefined): New function.
762 (Symbol::set_output_segment): New function.
763 (Symbol::set_undefined): New function.
764 * target-reloc.h (is_strong_undefined): Remove.
765 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
766 Check for hidden undefs.
767 (relocate_section): Call Symbol::is_strong_undefined.
768
769 * testsuite/Makefile.am (ehdr_start_test_1)
770 (ehdr_start_test_2, ehdr_start_test_3)
771 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
772 * testsuite/Makefile.in: Regenerate.
773 * testsuite/ehdr_start_def.cc: New source file.
774 * testsuite/ehdr_start_test.cc: New source file.
775 * testsuite/ehdr_start_test.t: New linker script.
776 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 777
7849f6d8
CC
7782014-04-23 Cary Coutant <ccoutant@google.com>
779
bf2cc635 780 PR gold/16870
7849f6d8
CC
781 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
782
99fd8cff
CC
7832014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
784
785 * layout.cc (Layout::include_section): Allow a target to decide
786 whether to include a section.
787 * target.h (Target::should_include_section): New function.
788 (Target::do_should_include_section): New function.
789
91f43acd
CC
7902014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
791
792 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
793 inline into ...
794 (Copy_relocs::emit): ... here.
795 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
796 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
797 (Copy_reloc_entry::entries_): Change from private to protected.
798
c4eb27e1
ST
7992014-04-02 Sriraman Tallam <tmsriram@google.com>
800
801 * icf.cc (get_section_contents): Replace copies of reloc
802 vectors with const references.
803
ae447ddd
CC
8042014-04-02 Cary Coutant <ccoutant@google.com>
805
806 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
807 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
808 * configure: Regenerate.
809 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
810 -fno-use-linker-plugin.
811 (LINK1, CXXLINK1): Add it to the link command.
812 * testsuite/Makefile.in: Regenerate.
813
fa47fa92
AM
8142014-03-12 Alan Modra <amodra@gmail.com>
815
816 * Makefile.in: Regenerate.
817
9b12c500
CC
8182014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
819
820 * symtab.h (Symbol::set_nonvis): New function.
821
beacaa96
CC
8222014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
823
824 * symtab.cc (Sized_symbol<32>::init_output_data):
825 Instantiate the template.
826 (Sized_symbol<64>::init_output_data): Likewise.
827
800d9823
CC
8282014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
829
830 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
831 adjust dynamic symbol value.
832 * target.h (Target::adjust_dyn_symbol): New function.
833 (Target::do_adjust_dyn_symbol): New function.
834
918fc1f8 8352014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 836
918fc1f8
CC
837 * output.cc (Output_data_dynamic::Dynamic_entry::write):
838 Get the value of DYNAMIC_CUSTOM dynamic entry.
839 * output.h (Output_data_dynamic::add_custom): New function.
840 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
841 dynamic entry.
842 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
843 * target.h (Target::dynamic_tag_custom_value): New function.
844 (Target::do_dynamic_tag_custom_value): New function.
845
98ff9231
CC
8462014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
847
848 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
849 dynsym indexes.
850 * target.h (Target::has_custom_set_dynsym_indexes): New function.
851 (Target::do_has_custom_set_dynsym_indexes): New function.
852 (Target::set_dynsym_indexes): New function.
853 (Target::do_set_dynsym_indexes): New function.
854
b80eed39
AM
8552014-03-07 Alan Modra <amodra@gmail.com>
856
857 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
858 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
859 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
860 (Powerpc_relocate_functions::has_overflow_bitfield,
861 overflowed): Use the above.
862 (Target_powerpc::Relocate::relocate): Correct overflow checking
863 for a number of relocations. Modify overflow test for 16-bit
864 fields in instructions to signed/unsigned according to whether
865 the field takes a signed or unsigned value.
866
4b95cf5c
AM
8672014-03-05 Alan Modra <amodra@gmail.com>
868
869 Update copyright years.
870
45965137
AM
8712014-03-05 Alan Modra <amodra@gmail.com>
872
873 * powerpc.cc (Target_powerpc::Scan::local, global): Support
874 R_PPC64_ADDR64_LOCAL.
875 (Target_powerpc::Relocate::relocate): Likewise.
876
2c80b753
AM
8772014-03-03 Alan Modra <amodra@gmail.com>
878
879 * dwp.cc (print_version): Update copyright year to current.
880
c1c69e83
AM
8812014-02-10 Alan Modra <amodra@gmail.com>
882
883 * po/gold.pot: Regenerate.
884
dd0c4e70
CC
8852014-02-06 Cary Coutant <ccoutant@google.com>
886
887 Fix problem where -u is ignored when a weak undef is seen.
888
889 * archive.cc (Library_base::should_include_member): Reorder
890 code to check for -u option if a weak undef has already been seen.
891 * testsuite/Makefile.am (weak_undef_test_2): New test case.
892 * testsuite/Makefile.in: Regenerate.
893 * testsuite/weak_undef_file3.cc: New file.
894 * testsuite/weak_undef_file4.cc: New file.
895 * testsuite/weak_undef_test_2.cc: New file.
896
1a221d3d
CC
8972014-02-05 Cary Coutant <ccoutant@google.com>
898
899 Fix issues with gold undefined symbol diagnostics.
900
901 PR binutils/15435
902 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
903 check to here.
904 * target-reloc.h (is_strong_undefined): New function.
905 (relocate_section): Move undef vtable symbol check from here.
906 Check for is_strong_undefined.
907
e889f0a4 9082014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 909
e889f0a4
CC
910 Fix problems with the --dynamic-list option.
911
912 PR gold/13577
913 * options.cc (General_options::parse_dynamic_list):
914 Set have_dynamic_list_.
915 (General_options::General_options): Initialize have_dynamic_list_.
916 (General_options::finalize): Turn off -Bsymbolic and
917 -Bsymbolic-functions if --dynamic-list provided.
918 * options.h (General_options::have_dynamic_list): New function.
919 (General_options::have_dynamic_list_): New data member.
920 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
921 correctly.
5fe7ffdc 922
e889f0a4
CC
923 PR gold/16530
924 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
925 in --dynamic-list, mark it.
5fe7ffdc 926
e889f0a4
CC
927 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
928 (dynamic_list_2): New test case.
929 * testsuite/Makefile.in: Regenerate.
930 * testsuite/dynamic_list_2.cc: New file.
931 * testsuite/dynamic_list_2.t: New file.
932 * testsuite/dynamic_list_lib1.cc: New file.
933 * testsuite/dynamic_list_lib2.cc: New file.
934 * testsuite/gc_dynamic_list_test.c: New file.
935 * testsuite/gc_dynamic_list_test.sh: New file.
936 * testsuite/gc_dynamic_list_test.t: New file.
937
ec673e64
CC
9382014-01-28 Cary Coutant <ccoutant@google.com>
939
940 Add .gdb_index version 7 support.
941
942 * gold/dwarf_reader.cc: include <utility> (for make_pair).
943 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
944 debug sections.
945 (Dwarf_ranges_table::read_ranges_table): Likewise.
946 (Dwarf_pubnames_table::read_section): Check for GNU-style
947 sections, and for compressed debug sections.
948 (Dwarf_pubnames_table::read_header): Compute end address of table.
949 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
950 for end of list by offset, not by offset == 0.
951 (Dwarf_info_reader::do_read_string_table): Check for compressed
952 debug sections.
953 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
954 Initialize new data members.
955 (Dwarf_pubnames_table::next_name): return flag_byte.
956 (Dwarf_pubnames_table::end_of_table_): New data member.
957 (Dwarf_pubnames_table::is_gnu_style_): New data member.
958 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
959 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
960 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
961 read skeleton type unit DIEs.
962 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
963 (Gdb_index::do_write): Write flag_byte.
964 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
965 (Gdb_index::Cu_vector): Store flags along with cu indexes.
966 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
967 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
968
221fd5d5
L
9692014-01-08 H.J. Lu <hongjiu.lu@intel.com>
970
971 * version.cc (print_version): Update copyright year to 2014.
972
6c09fb0b
ILT
9732013-12-19 Dimitry Andric <dimitry@andric.com>
974
975 * stringpool.cc (Stringpool_template::reserve): Add
976 HAVE_UNORDERED_MAP case.
977 * stringpool.cc (Stringpool_template::print_stats): Likewise.
978
8356f2d0
CC
9792013-12-18 Cary Coutant <ccoutant@google.com>
980
981 * configure.ac: Check for <unordered_set> and <unordered_map>.
982 * config.in: Regenerate.
983 * configure: Regenerate.
984 * system.h: Use <unordered_set> and <unordered_map> if available.
985
f2c7d7ee
RM
9862013-12-10 Roland McGrath <mcgrathr@google.com>
987
988 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
989 with $(INSTALL_PROGRAM_ENV).
990 * Makefile.in: Regenerate.
991
6632e8cc
CC
9922013-11-22 Cary Coutant <ccoutant@google.com>
993
994 * configure.ac: Add check for which library is needed for
995 dlopen.
996 * configure: Regenerate.
997
0c075858
CC
9982013-11-22 Cary Coutant <ccoutant@google.com>
999
1000 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1001 assembler.
1002 * testsuite/Makefile.in: Regenerate.
1003
f49fe902
L
10042013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1005
1006 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1007 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1008 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1009 (Target_x86_64<size>::Scan::local): Likewise.
1010 (Target_x86_64<size>::Scan::global): Likewise.
1011 (Target_x86_64<size>::Relocate::relocate): Likewise.
1012 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1013 Likewise.
1014 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1015 R_X86_64_PC32_BND.
1016
1017 * testsuite/Makefile.am (check_PROGRAMS): Add
1018 exception_x86_64_bnd_test.
1019 (exception_x86_64_bnd_test_SOURCES): New macro.
1020 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1021 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1022 (exception_x86_64_bnd_test_LDADD): Likewise.
1023 (exception_x86_64_bnd_1.o): New rule.
1024 (exception_x86_64_bnd_2.o): Likewise.
1025 * testsuite/Makefile.in: Regenerated.
1026
9055360d
AM
10272013-11-15 Alan Modra <amodra@gmail.com>
1028
1029 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1030 accessor.
1031 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1032 Only call ppc64_local_entry_offset for 64-bit. Restrict
1033 symval_for_branch lookup to ELFv1.
1034 (Stub_table::add_plt_call_entry): Use unsigned int off.
1035 (Output_data_glink::Address, invalid_address): New.
1036 (Output_data_glink::add_eh_frame): Move out of line. Add
1037 support for ELFv2.
1038 (Output_data_glink::add_global_entry, find_global_entry,
1039 global_entry_address): New functions.
1040 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1041 ge_size): New variables.
1042 (Output_data_glink::set_final_data_size): Add global entry
1043 stub sizing.
1044 (Output_data_glink::do_write): Write global entry stubs.
1045 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1046 parameter. Return true for ELFv2. Adjust callers.
1047 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1048 ELFv1. Similarly for ifunc and dynamic relocation processing
1049 specific to ELFv1. Recognize that symbols are defined on
1050 their plt entries for ELFv2.
1051 (Target_powerpc::symval_for_branch): Assert if called for
1052 ELFv2 or ppc32.
1053 (Target_powerpc::Relocate::relocate): Use global entry plt
1054 stub for symbol value if such exists on ELFv2.
1055 (Target_powerpc::Relocate::relocate): Don't call
1056 symval_for_branch when ELFv2. Do adjust for local entry
1057 offset when ELFv2.
1058 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1059 plt stub for ELFv2.
1060 (Target_powerpc::do_plt_address_for_global): Similarly.
1061
cafdd569
CC
10622013-11-14 Cary Coutant <ccoutant@google.com>
1063
1064 Revert patch -- this did not fix the problem, and there is
1065 no race there.
1066
1067 2013-11-14 Cary Coutant <ccoutant@google.com>
1068
1069 PR gold/14860
1070 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1071 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1072 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1073 updating fde_offsets_.
1074 (Eh_frame_hdr::lock_): New data member.
1075
94e49e16
CC
10762013-11-14 Cary Coutant <ccoutant@google.com>
1077
1078 * dwp.cc (Dwo_file_entry): New type.
1079 (File_list): Use Dwo_file_entry.
1080 (Dwo_file::verify): New function.
1081 (Dwo_file::verify_dwo_list): New function.
1082 (Dwo_file::sized_verify_dwo_list): New function.
1083 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1084 list.
1085 (Dwp_options): New enum type.
1086 (dwp_options): Add --verify-only.
1087 (usage): Likewise.
1088 (main): Likewise.
1089 * dwp.h (gold_info): Add declaration.
1090
7cdd7d57
CC
10912013-11-14 Cary Coutant <ccoutant@google.com>
1092
1093 PR gold/14860
1094 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1095 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1096 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1097 updating fde_offsets_.
1098 (Eh_frame_hdr::lock_): New data member.
1099
1d946cb3
CC
11002013-11-06 Cary Coutant <ccoutant@google.com>
1101
1102 PR gold/15758
1103 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1104 before reloc sections.
1105
4f65b40e
AM
11062013-11-04 Alan Modra <amodra@gmail.com>
1107
1108 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1109 (Symbol::needs_dynamic_reloc): Test new flag.
1110 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1111 (Target_powerpc::Scan::get_reference_flags): Add target param.
1112 Return FUNC_DESC_ABI for 64-bit ELFv1.
1113 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1114 call.
1115 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1116 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1117
908794a9
CC
11182013-10-31 Cary Coutant <ccoutant@google.com>
1119
1120 Restore support for dwp v2 DWARF package file format.
1121
1122 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1123 tu_length parameter. Adjust all callers.
1124 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1125 * dwp.cc: Include dwarf.h.
1126 (Section_bounds): New struct type.
1127 (Unit_set): New struct type.
1128 (Dwo_file::Dwo_file): Initialize new data member.
1129 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1130 Combine and rename to...
1131 (Dwo_file::read_unit_index): ...this.
1132 (Dwo_file::sized_read_compunit_index)
1133 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1134 (Dwo_file::sized_read_unit_index): ...this.
1135 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1136 parameters; add section_id parameter.
1137 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1138 (Dwo_file::add_unit_set): ...this.
1139 (Dwo_file::shndx_map_): Remove.
1140 (Dwo_file::sect_offsets_): New data member.
1141 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1142 (Dwp_output_file::add_section): Rename to...
1143 (Dwp_output_file::add_contribution): ...this.
1144 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1145 (Dwp_output_file::add_tu_set): Likewise.
1146 (Dwp_output_file::Contribution): New type.
1147 (Dwp_output_file::Section::contributions): New data member.
1148 (Dwp_output_file::Cu_or_tu_set): Remove.
1149 (Dwp_output_file::Section::Section): New ctor.
1150 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1151 (Dwp_output_file::Dwp_index::Section_table): New type.
1152 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1153 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1154 parameter.
1155 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1156 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1157 (Dwp_output_file::Dwp_index::section_table): New member function.
1158 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1159 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1160 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1161 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1162 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1163 (Dwp_output_file::Dwp_index::section_table_): New data member.
1164 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1165 (Dwp_output_file::add_output_section): New member function.
1166 (Dwp_output_file::write_new_section): New member function.
1167 (Dwp_output_file::write_contributions): New member function.
1168 (Dwp_output_file::section_id_map_): New data member.
1169 (class Dwo_id_info_reader): Remove.
1170 (class Unit_reader): New class.
1171 (get_dwarf_section_name): New function.
1172 (Dwo_file::read_executable): Adjust initializations of class data.
1173 (Dwo_file::read): Add support for v2 package file format.
1174 (Dwo_file::read_unit_index): Likewise.
1175 (Dwo_file::sized_read_unit_index): Likewise.
1176 (Dwo_file::copy_section): Likewise.
1177 (Dwo_file::add_unit_set): Likewise.
1178 (Dwp_output_file::add_output_section): Likewise.
1179 (Dwp_output_file::add_contribution): Likewise.
1180 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1181 for empty slot.
1182 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1183 file format.
1184 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1185 slot.
1186 (Dwp_output_file::initialize): Remove unused function.
1187 (Dwp_output_file::finalize): Add support for v2 package file format.
1188 (Dwp_output_file::write_index): Likewise.
1189 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1190 function prototype.
1191
2500c017
CC
11922013-10-31 Cary Coutant <ccoutant@google.com>
1193
1194 * configure.ac: Fix check for -fmerge-constants.
1195 * configure.ac: Regenerate.
1196
dd0845d7
RM
11972013-10-30 Roland McGrath <mcgrathr@google.com>
1198
1199 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1200 Correct 9-byte nop sequence to match what the assembler generates.
1201
b4f7960d
AM
12022013-10-30 Alan Modra <amodra@gmail.com>
1203
1204 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1205 ppc64_local_entry_offset, ppc64_local_entry_offset,
1206 do_read_symbols): New functions.
1207 (Powerpc_relobj::e_flags_, st_other_): New vars.
1208 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1209 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1210 (Powerpc_relobj::e_flags_): New var.
1211 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1212 and adjust for ELFv2.
1213 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1214 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1215 (Powerpc_dynobj::do_find_special_sections): Likewise.
1216 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1217 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1218 to ELFv2 local entry.
1219 (Target_powerpc::do_relax): No thread safe barriers needed for
1220 ELFv2.
1221 (Output_data_plt_powerpc::initial_plt_entry_size_,
1222 plt_entry_size): Delete. Replace all uses with
1223 first_plt_entry_offset() and plt_entry_size().
1224 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1225 reserved_size parm. Update callers.
1226 (Output_data_plt_powerpc::entry_count): Update.
1227 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1228 and use Target_powerpc::first_plt_entry_offset().
1229 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1230 rename to plt_entry_size.
1231 (Output_data_plt_powerpc::add_ifunc_entry,
1232 add_local_ifunc_entry): Adjust reloc for ELFv2.
1233 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1234 (glink_eh_frame_fde_64v2): New.
1235 (Stub_table::plt_call_size): Support ELFv2 sizing.
1236 (Output_data_glink::add_eh_frame): Use the new FDE.
1237 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1238 (Stub_table::do_write): Write ELFv2 stubs and glink.
1239 (Target_powerpc::Relocate::relocate): Replaces nop after call
1240 with ld 2,24(1) and adjust local offset destination for ELFv2.
1241
f9c6b907
AM
12422013-10-30 Alan Modra <amodra@gmail.com>
1243
1244 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1245 (Target_powerpc::Scan::global, local): Likewise.
1246 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1247 on all ppc64 @h and @ha relocs.
1248
e84fe78f
AM
12492013-10-14 Alan Modra <amodra@gmail.com>
1250
1251 * output.h (Output_data_got::add_constant): Tidy.
1252 (Output_data_got::add_constant_pair): New function.
1253 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1254 methods used so as to first call reserve_ent().
1255
679e4abf
RM
12562013-10-11 Roland McGrath <mcgrathr@google.com>
1257
44dcb735
RM
1258 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1259 add_got_entry and add_got_entry_pair.
1260
13323c49
RM
1261 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1262 (HAVE_PUBNAMES): Likewise.
1263 * configure: Regenerate.
1264
1496b446
RM
1265 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1266 * testsuite/Makefile.in: Regenerate.
1267
cc84c10b
RM
1268 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1269 Remove const from declaration.
1270 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1271 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1272 * output.h (Output_file_header): Remove const from member target_
1273 and corresponding constructor argument.
1274 * output.cc (Output_file_header::Output_file_header): Update prototype.
1275 (Output_file_header::do_sized_write): Use this->target_ in place
1276 of parameters()->target().
1277
52f66a2c
RM
1278 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1279
2b64b551
RM
1280 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1281 * configure: Regenerate.
1282 * Makefile.in: Regenerate.
1283 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1284 * testsuite/merge_string_literals_2.c: Likewise.
1285 * testsuite/Makefile.am
1286 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1287 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1288 literal -fmerge-constants.
1289 * testsuite/Makefile.in: Regenerate.
1290
43819297
RM
1291 * i386.cc (Target_i386): Remove unused member dynbss_.
1292 * arm.cc (Target_arm): Likewise.
1293 * powerpc.cc (Target_powerpc): Likewise.
1294 * sparc.cc (Target_sparc): Likewise.
1295 * tilegx.cc (Target_tilegx): Likewise.
1296 * x86_64.cc (Target_x86_64): Likewise.
1297 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1298 type_signature_, type_offset_.
1299 * plugin.h (Plugin_hook): Remove unused member layout_.
1300 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1301 mapfile_.
1302 (Read_member): Remove unused members input_objects_, symtab_,
1303 mapfile_, layout_.
1304 (Check_library): Remove unused member symtab_.
1305 * archive.h (Lib_group): Remove unused member lib_.
1306 * archive.cc (Lib_group::Lib_group): Update initializer.
1307 * incremental.h (Incremental_binary): Remove unused member target_.
1308 (Incremental_script_entry): Removed unused member script_.
1309 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1310 * icf.h (Icf): Remove unused member num_tracked_relocs.
1311
39d9ead7
RM
1312 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1313 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1314 its only use.
1315 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1316
679e4abf
RM
1317 * archive.h: Use struct rather than class for forward declaration
1318 of Read_symbols_data.
1319
54de2ea6
CC
13202013-10-07 Cary Coutant <ccoutant@google.com>
1321
1322 PR gold/16010
1323 * testsuite/Makefile.am (icf_test): Fix dependencies.
1324 (icf_safe_test): Likewise.
1325 (icf_safe_so_test): Likewise.
1326 (large_symbol_alignment): Add empty _LDADD rule.
1327 * testsuite/Makefile.in: Regenerate.
1328
b14016f0
L
13292013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1330
1331 PR gold/15927
1332 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1333 relocation for R_X86_64_32 on x32.
1334
eb426534
RM
13352013-08-27 Roland McGrath <mcgrathr@google.com>
1336
1337 * output.cc (Output_segment::set_section_addresses): Take new
1338 Target* argument. If target->isolate_execinstr() and the segment
1339 is executable and starts at a target->abi_pagesize() boundary,
1340 pad its end out to a target->abi_pagesize() boundary with code fill.
1341 * output.h (Output_segment::set_section_addresses): Update decl.
1342 * layout.h (Layout::check_output_data_for_reset_values): Take new
1343 argument RELAX_OUTPUTS.
1344 (Layout): New member relax_output_list_.
1345 (Layout::add_relax_output): New method.
1346 * layout.cc (Layout::Layout): Update constructor.
1347 (Layout::reset_relax_output): New method.
1348 (Layout::clean_up_after_relaxation): Call it.
1349 (Layout::prepare_for_relaxation): Update caller.
1350 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1351 Call reset_relax_output before re-processing segments for
1352 isolate_execinstr case.
1353 (Layout::write_data): Handle relax_output_list_.
1354 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1355 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1356
9aff4b7a
NC
13572013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1358
1359 PR binutils/15834
1360 * object.h: Fix typos.
1361
93f8221c
RM
13622013-08-16 Roland McGrath <mcgrathr@google.com>
1363
1364 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1365 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1366
e44c3715
CC
13672013-08-07 Cary Coutant <ccoutant@google.com>
1368
1369 Revert support for v2 DWP files:
1370
1371 2013-03-01 Cary Coutant <ccoutant@google.com>
1372
1373 Add dwp support for v2 DWARF package file format.
1374 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1375 tu_length parameter. Adjust all callers.
1376 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1377 * dwp.cc: Include dwarf.h.
1378 (Section_bounds): New struct type.
1379 (Unit_set): New struct type.
1380 (Dwo_file::Dwo_file): Initialize new data member.
1381 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1382 Combine and rename to...
1383 (Dwo_file::read_unit_index): ...this.
1384 (Dwo_file::sized_read_compunit_index)
1385 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1386 (Dwo_file::sized_read_unit_index): ...this.
1387 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1388 parameters; add section_id parameter.
1389 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1390 (Dwo_file::add_unit_set): ...this.
1391 (Dwo_file::shndx_map_): Remove.
1392 (Dwo_file::sect_offsets_): New data member.
1393 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1394 (Dwp_output_file::add_section): Rename to...
1395 (Dwp_output_file::add_contribution): ...this.
1396 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1397 (Dwp_output_file::add_tu_set): Likewise.
1398 (Dwp_output_file::Contribution): New type.
1399 (Dwp_output_file::Section::contributions): New data member.
1400 (Dwp_output_file::Cu_or_tu_set): Remove.
1401 (Dwp_output_file::Section::Section): New ctor.
1402 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1403 (Dwp_output_file::Dwp_index::Section_table): New type.
1404 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1405 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1406 parameter.
1407 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1408 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1409 (Dwp_output_file::Dwp_index::section_table): New member function.
1410 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1411 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1412 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1413 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1414 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1415 (Dwp_output_file::Dwp_index::section_table_): New data member.
1416 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1417 (Dwp_output_file::add_output_section): New member function.
1418 (Dwp_output_file::write_new_section): New member function.
1419 (Dwp_output_file::write_contributions): New member function.
1420 (Dwp_output_file::section_id_map_): New data member.
1421 (class Dwo_id_info_reader): Remove.
1422 (class Unit_reader): New class.
1423 (get_dwarf_section_name): New function.
1424 (Dwo_file::read_executable): Adjust initializations of class data.
1425 (Dwo_file::read): Add support for v2 package file format.
1426 (Dwo_file::read_unit_index): Likewise.
1427 (Dwo_file::sized_read_unit_index): Likewise.
1428 (Dwo_file::copy_section): Likewise.
1429 (Dwo_file::add_unit_set): Likewise.
1430 (Dwp_output_file::add_output_section): Likewise.
1431 (Dwp_output_file::add_contribution): Likewise.
1432 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1433 for empty slot.
1434 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1435 file format.
1436 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1437 slot.
1438 (Dwp_output_file::initialize): Remove unused function.
1439 (Dwp_output_file::finalize): Add support for v2 package file format.
1440 (Dwp_output_file::write_index): Likewise.
1441 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1442 function prototype.
1443
c6905c28
CC
14442013-07-31 Cary Coutant <ccoutant@google.com>
1445
1446 * object.cc (Sized_relobj::do_output_section_address): New function.
1447 (Sized_relobj): Instantiate explicitly.
1448 * object.h (Object::output_section_address): New function.
1449 (Object::do_output_section_address): New function.
1450 (Sized_relobj::do_output_section_address): New function.
1451 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1452
14532013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1454 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1455
1456 * parameters.cc (Parameters::entry): Return target-specific entry
1457 symbol name.
1458 * target.h (Target::entry_symbol_name): New function.
1459 (Target_info::entry_symbol_name): New data member.
1460
1461 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1462 * i386.cc (Target_i386::i386_info): Likewise.
1463 (Target_i386_nacl::i386_nacl_info): Likewise.
1464 * sparc.cc (Target_sparc::sparc_info): Likewise.
1465 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1466 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1467 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1468 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1469
234d4ab8
SA
14702013-07-22 Sterling Augustine <saugustine@google.com>
1471
1472 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1473 Convert parameter shndx to local variable. Add parameters symtab
1474 and symtab_size. Scan over section names. Find relocation
1475 section corresponding to current section. Create and initialize
1476 reloc_mapper_ and reloc_type_.
1477 (Dwarf_pubnames_table::read_header): Add assertion. Change
1478 unit_length to off_t. Initialize member unit_length_. Fill in field
1479 cu_offset_.
1480 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1481 Initialize new fields unit_length_ and cu_offset_.
1482 (Dwarf_pubnames_table::read_section): Update prototype.
1483 (Dwarf_pubnames_table::cu_offset): New member function.
1484 (Dwarf_pubnames_table::subsection_size): Likewise.
1485 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1486 New fields.
1487 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1488 member functions public.
1489 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1490 Update comment. Rework logic. Move repeated parts to...
1491 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1492 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1493 pubtypes_table_, and stmt_list_offset.
1494 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1495 Gdb_index::find_pubtype_offset,
1496 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1497 (Gdb_index::pubnames_read): Update prototype and rework logic.
1498 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1499 Forward declare.
1500 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1501 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1502 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1503 Gdb_index::map_pubtable_to_dies):
1504 Declare functions.
1505 (Gdb_index::pubnames_read): Update declaration.
1506 (Gdb_index::Pubname_offset_map): New type.
1507 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1508 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1509 Gdb_index::stmt_list_offset): Declare.
1510 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1511 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1512 Gdb_index::pubtypes_offset_): Remove.
1513
a3ed37d8
RM
15142013-07-19 Roland McGrath <mcgrathr@google.com>
1515
1516 * options.h (General_options): Add -Trodata-segment option.
1517 * parameters.cc (Parameters::check_rodata_segment): New function.
1518 (Parameters::set_target_once): Call it.
1519 * parameters.h (Parameters): Declare it (private member function).
1520 * layout.cc (load_seg_unusable_for_headers): New function, broken
1521 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1522 then validate rodata segment rather than text segment.
1523 (relaxation_loop_body): Call that.
1524 (is_text_segment): New function. Don't admit a non-executable
1525 segment if TARGET->isolate_execinstr().
1526 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1527
eb5b4ded
CC
15282013-07-15 Shawn Landden <shawnlandden@gmail.com>
1529
1530 PR gold/15070
1531 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1532 * nacl.h (Sniff_file::View::View): Request aligned view.
1533
4d5effb9
CC
15342013-07-11 Cary Coutant <ccoutant@google.com>
1535
1536 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1537 correct BRLT entry size.
1538
ba8ca3e7
AM
15392013-07-03 Alan Modra <amodra@gmail.com>
1540
1541 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1542 comment.
1543
267257d2
CC
15442013-07-01 Cary Coutant <ccoutant@google.com>
1545
1546 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1547 reloc_type_.
1548 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1549 (Dwarf_ranges_table::lookup_reloc): New function.
1550 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1551 reloc_type_.
1552 (Dwarf_ranges_table::lookup_reloc): New function.
1553 (Dwarf_ranges_table::reloc_type_): New data member.
1554
06f30c9d
CC
15552013-06-27 Jing Yu <jingyu@google.com>
1556
1557 PR gold/15662
1558 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1559 function.
1560 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1561 (Target_powerpc::do_relax): Call the above.
1562
a2d7bf59
AM
15632013-06-27 Cary Coutant <ccoutant@google.com>
1564
1565 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1566 on garbage collected .opd section.
1567
15682013-06-27 Alan Modra <amodra@gmail.com>
1569
1570 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1571 is non-zero.
1572 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1573 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1574
32364e50
CC
15752013-06-14 Cary Coutant <ccoutant@google.com>
1576
1577 * resolve.cc (Symbol::override_base): Don't override st_type
1578 from plugin placeholder symbols.
1579 (Symbol_table::resolve): Likewise.
1580 (Symbol_table::should_override): Don't complain about TLS mismatch
1581 if the TO symbol is a plugin placeholder.
1582 * testsuite/Makefile.am (plugin_test_tls): New test.
1583 * testsuite/Makefile.in: Regenerate.
1584 * testsuite/plugin_test_tls.sh: New test script.
1585 * testsuite/two_file_test_2_tls.cc: New test source.
1586 * testsuite/two_file_test_tls.cc: New test source.
1587
7fb47cc9
CC
15882013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1589
1590 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1591 the maximum segment alignment is larger than the page size.
1592 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1593 correctly aligns the symbols with large alignemnt.
1594 * testsuite/Makefile.in: Regenerate.
1595 * testsuite/large_symbol_alignment.cc: New file.
1596
6934001a
CC
15972013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1598 Sriraman Tallam <tmsriram@google.com>
1599
1600 * options.h (sort_section): New option.
1601 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1602 Rename from Input_section_sort_section_name_special_ordering_compare.
1603 (Input_section_sort_section_name_compare): New struct.
1604 * output.cc (Output_section::Input_section_sort_section_name_compare::
1605 operator()): New function.
1606 (Output_section::sort_attached_input_sections): Use new sort function
1607 for .text if --sort-section=name is specified.
1608 * layout.cc (Layout::make_output_section):
1609 Add sorting by name when --sort-section=name is specified.
1610 * testsuite/Makefile.am (text_section_grouping): Test option
1611 --sort-section=name.
1612 * testsuite/Makefile.in: Regenerate.
1613 * testsuite/section_sorting_name.cc: New file.
1614 * testsuite/section_sorting_name.sh: New file.
1615
93acabad
CC
16162013-05-21 Cary Coutant <ccoutant@google.com>
1617
1618 * symtab.h (Symbol::is_cxx_vtable): New function.
1619 * target-reloc.h (relocate_section): Check for vtable symbol.
1620 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1621 * testsuite/Makefile.in: Regenerate.
1622 * testsuite/missing_key_func.cc: New test source.
1623 * testsuite/missing_key_func.sh: New test script.
1624
60e8b3fc
CC
16252013-05-21 Cary Coutant <ccoutant@google.com>
1626
2b64b551
RM
1627 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1628 type of enclosing symbol.
1629 (Relocate_info::location): Check symbol type when describing symbol.
1630 * object.h (Symbol_location_info): Remove unused line_number;
1631 add enclosing_symbol_type.
1632 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1633
9df9de2c
CC
16342013-05-13 Cary Coutant <ccoutant@google.com>
1635
2b64b551
RM
1636 * configure.ac: Export DEFAULT_TARGET.
1637 * configure: Regenerate.
1638 * Makefile.in: Regenerate.
1639 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1640 * testsuite/Makefile.in: Regenerate.
1641 * testsuite/debug_msg.sh: Delete duplicate tests.
1642 Don't check undef_int error message match for powerpc where the
1643 source file and line number aren't available.
9df9de2c 1644
bbc5ae17
RM
16452013-05-10 Roland McGrath <mcgrathr@google.com>
1646
1647 * options.h (General_options): Add --rosegment-gap option.
1648 * options.cc (finalize): --rosegment-gap implies --rosegment.
1649 * layout.cc (set_segment_offsets): Let user option override
1650 target->rosegment_gap().
1651
0c6e6c39
RM
16522013-05-10 Roland McGrath <mcgrathr@google.com>
1653
1654 * options.h (General_options): Remove leading space from help
1655 messages for -nostdlib and --rosegment.
1656
cde7cb01
MR
16572013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1658
1659 PR ld/15365
1660 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1661
f31ae5b8
AM
16622013-05-03 Alan Modra <amodra@gmail.com>
1663
1664 * merge.cc (Output_merge_string::do_add_input_section): Correct
1665 scan for number of strings. Rename vars to avoid shadowing.
1666 Include missing terminator in input_size_.
1667
d3a7cd45
L
16682013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1669
1670 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1671 Restore empty string handling.
1672
6ad3daba
CC
16732013-05-01 Cary Coutant <ccoutant@google.com>
1674
1675 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1676 uninitialized warning.
1677
e31908b6
CC
16782013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1679
1680 * output.cc (Output_section::add_merge_input_section): Allow
1681 to merge sections if the alignment is more than character size.
1682 * merge.h (Output_merge_string::Output_merge_string): Remove
1683 assert.
1684 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1685 only not-null strings. Check the alignment of strings.
1686 * stringpool.h
1687 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1688 alignment as the argument.
1689 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1690 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1691 Align non-zero length strings according to the addralign_.
1692 (Stringpool_template<Stringpool_char>::set_string_offsets):
1693 Updating offsets according to the given alignment.
1694 * testsuite/Makefile.am (text_section_grouping): Test if string
1695 literals are getting merged.
1696 * testsuite/Makefile.in: Regenerate.
1697 * testsuite/merge_string_literals_1.c: New file.
1698 * testsuite/merge_string_literals_2.c: Ditto.
1699 * testsuite/merge_string_literals.sh: Ditto.
1700
0e804863
ILT
17012013-04-26 Ian Lance Taylor <iant@google.com>
1702
1703 * target-reloc.h (relocate_section): If the reloc offset is out of
1704 range, pass VIEW as NULL to relocate.relocate.
1705 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1706 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1707 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1708 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1709 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1710 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1711
e7c5ea40
CC
17122013-04-26 Geoff Pike <gpike@chromium.org>
1713
1714 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1715 * layout.cc (Hash_task): New class.
1716 (Layout::queue_build_id_tasks): New function.
1717 (Layout::write_build_id): Handle single-thread portion of build ID
1718 computation. (In some cases, all of it is single-threaded.) Replace
1719 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1720 functionality in fewer lines of code.
1721 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1722 * options.h (General_options): make "--build-id" default to tree
1723 rather than sha1. Add two new options related to --build-id=tree:
1724 --build-id-chunk-size-for-treehash and
1725 --build-id-min-file-size-for-treehash.
1726 * Makefile.am: add testing of --build-id=tree and related new options
1727 (these tests will be invoked by "make check").
1728 * Makefile.in: Regenerate.
1729
49926cd0
AM
17302013-04-25 Alan Modra <amodra@gmail.com>
1731
1732 * configure.tgt: Add powerpcle and powerpc64le.
1733
a4034750
AM
17342013-04-22 Alan Modra <amodra@gmail.com>
1735
1736 PR gold/15355
1737 * layout.cc (Layout::segment_precedes): Allow more than one
1738 segment with the same type and flags.
1739
e79c84aa
CC
17402013-04-15 Cary Coutant <ccoutant@google.com>
1741
1742 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1743 allocate space in file for BSS sections.
1744
2199fbe7
CC
17452013-04-15 Cary Coutant <ccoutant@google.com>
1746
1747 * script-sections.cc (Orphan_output_section): Reset address
1748 to zero after each orphaned section for relocatable links.
1749
502e8a84
CC
17502013-04-15 Cary Coutant <ccoutant@google.com>
1751
a4034750
AM
1752 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1753 section starting address for relocatable link.
1754 * testsuite/Makefile.am (script_test_11): New test.
1755 * testsuite/Makefile.in: Regenerate.
1756 * testsuite/script_test_11.c: New source file.
1757 * testsuite/script_test_11.t: New linker script.
502e8a84 1758
0cfdc767
AM
17592013-04-13 Alan Modra <amodra@gmail.com>
1760
1761 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1762 owner when sections are not adjacent and exceed group size.
1763 (Target_powerpc::group_sections): Handle corner case.
1764 (Target_powerpc::Branch_info::make_stub): Handle case where
1765 stub table doesn't exist due to branches in non-exec sections.
1766 (Target_powerpc::Relocate::relocate): Likewise.
1767
6830ee24
AM
17682013-04-11 Alan Modra <amodra@gmail.com>
1769
1770 PR gold/15354
1771 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1772 .branch_lt to match bfd ld. Adjust comments throughout file.
1773
54a3d865
ILT
17742013-04-04 Ian Lance Taylor <iant@google.com>
1775
1776 GCC PR c++/56840
1777 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1778 sections before checking whether they are included in the link.
1779
9993ba11
ST
17802013-03-29 Sriraman Tallam <tmsriram@google.com>
1781
1782 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1783 object before calling the plugin claim_file handler. Pass the elf
1784 object of the archive to the plugin. Delete the elf object if the
1785 plugin claims the file.
1786
ebacd51e
AM
17872013-03-21 Alan Modra <amodra@gmail.com>
1788
1789 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1790 segment when omagic.
1791
117be58f
AM
17922013-03-21 Alan Modra <amodra@gmail.com>
1793
1794 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1795 comparison warning.
1796 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1797 uninitialized" warning.
1798
32e2b61d
AM
17992013-03-20 Alan Modra <amodra@gmail.com>
1800
1801 * symtab.h (Symbol::clear_version): New function.
1802 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1803 is_needed by weak references. Clear version for symbols defined
1804 in as-needed objects that are not needed.
1805
b3ccdeb5
AM
18062013-03-15 Alan Modra <amodra@gmail.com>
1807
1808 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1809 static and public. Add report_err param. Return false for data refs.
1810 (Target_powerpc::rela_dyn_section): New overloaded function.
1811 (Target_powerpc::plt_, iplt_): Elucidate.
1812 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1813 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1814 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1815 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1816 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1817 push_branch and make_plt_entry for ifunc syms when
1818 reloc_needs_plt_for_ifunc.
1819 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1820 for ifunc unless reloc_needs_plt_for_ifunc.
1821
ad3d8a2f
AM
18222013-03-15 Alan Modra <amodra@gmail.com>
1823
1824 * gc.h (gc_process_relocs): Don't look through function descriptors.
1825 * icf.cc (get_section_contents): Do so here instead.
1826
4d9aa155
AM
18272013-03-13 Alan Modra <amodra@gmail.com>
1828
1829 * powerpc.cc (is_branch_reloc): Forward declare.
1830 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1831 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1832 false for 64-bit, true for 32-bit non-branch relocs.
1833 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1834 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1835 nm output.
1836 (icf_safe_test): Generate linker map file as well as nm output.
1837 (icf_safe_so_test): Likewise.
1838 * testsuite/Makefile.in: Regenerate.
1839 * testsuite/icf_test.sh: Parse linker map file to determine
1840 section folding.
1841 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1842 * testsuite/icf_safe_so_test.sh: Likewise.
1843 (X86_32_or_ARM_specific_safe_fold): Merge into..
1844 (arch_specific_safe_fold): ..this.
1845 (X86_64_specific_safe_fold): Delete unused function.
1846
57420c20
AM
18472013-03-12 Alan Modra <amodra@gmail.com>
1848
1849 * gc.h (gc_process_relocs): Look through function descriptors
1850 to determine shndx, symvalue and addend used by ICF. Tidy
1851 variable duplication.
1852
dc3714f3
AM
18532013-03-11 Alan Modra <amodra@gmail.com>
1854
1855 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1856 * layout.cc (Layout_task_runner::run): ..to here.
1857 * symtab.h (struct Symbol_location): Extract from..
1858 (class Symbol_table): ..here.
1859 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1860 * target.h (class Target): Add function_location and
1861 do_function_location functions.
1862 (class Sized_target): Add do_function_location.
1863 * object.h (class Sized_relobj_file): Move find_shdr..
1864 (class Object): ..to here.
1865 * object.cc: Likewise. Update to suit. Instantiate.
1866 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1867 * powerpc.cc (class Powerpc_dynobj): New.
1868 (Target_powerpc::do_function_location): New function.
1869 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1870 (Powerpc_dynobj::do_read_symbols): New function.
1871 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1872
956b03bb
ILT
18732013-03-08 Ian Lance Taylor <iant@google.com>
1874
1875 * options.cc (General_options::string_to_object_format): Accept
1876 "default".
1877
4bead2d5
AM
18782013-03-08 Alan Modra <amodra@gmail.com>
1879
1880 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1881 pointer to Post_fde.
1882 (struct Post_fde): Move definition to here..
1883 * ehframe.cc (struct Post_fde): ..from here.
1884 (Cie::write): Don't alloc Post_fde.
1885 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1886
02e60bf7
AM
18872013-03-07 Alan Modra <amodra@gmail.com>
1888
1889 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1890 relocation referencing .LC0.
1891 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1892
8343f03a
AM
18932013-03-07 Alan Modra <amodra@gmail.com>
1894
1895 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1896 always_inline. Add assembly for powerpc to avoid GOT.
1897
3366d57c
AM
18982013-03-07 Alan Modra <amodra@gmail.com>
1899
1900 * testsuite/script_test_10.sh: Don't test .bss section
1901 header number.
1902
6c77229c
AM
19032013-03-06 Alan Modra <amodra@gmail.com>
1904
1905 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1906 (Target_powerpc::symval_for_branch): Add symtab param. Update
1907 all callers. Handle folded sections.
1908 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1909 to Powerpc_relobj.
1910 (Global_symbol_visitor_opd::operator()): Likewise.
1911
a39e4af6
AM
19122013-03-04 Alan Modra <amodra@gmail.com>
1913
1914 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1915 * testsuite/Makefile.in: Regenerate.
1916
d5834edb
CC
19172013-03-01 Cary Coutant <ccoutant@google.com>
1918
1919 Add dwp support for v2 DWARF package file format.
1920 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1921 tu_length parameter. Adjust all callers.
1922 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1923 * dwp.cc: Include dwarf.h.
1924 (Section_bounds): New struct type.
1925 (Unit_set): New struct type.
1926 (Dwo_file::Dwo_file): Initialize new data member.
1927 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1928 Combine and rename to...
1929 (Dwo_file::read_unit_index): ...this.
1930 (Dwo_file::sized_read_compunit_index)
1931 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1932 (Dwo_file::sized_read_unit_index): ...this.
1933 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1934 parameters; add section_id parameter.
1935 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1936 (Dwo_file::add_unit_set): ...this.
1937 (Dwo_file::shndx_map_): Remove.
1938 (Dwo_file::sect_offsets_): New data member.
1939 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1940 (Dwp_output_file::add_section): Rename to...
1941 (Dwp_output_file::add_contribution): ...this.
1942 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1943 (Dwp_output_file::add_tu_set): Likewise.
1944 (Dwp_output_file::Contribution): New type.
1945 (Dwp_output_file::Section::contributions): New data member.
1946 (Dwp_output_file::Cu_or_tu_set): Remove.
1947 (Dwp_output_file::Section::Section): New ctor.
1948 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1949 (Dwp_output_file::Dwp_index::Section_table): New type.
1950 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1951 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1952 parameter.
1953 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1954 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1955 (Dwp_output_file::Dwp_index::section_table): New member function.
1956 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1957 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1958 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1959 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1960 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1961 (Dwp_output_file::Dwp_index::section_table_): New data member.
1962 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1963 (Dwp_output_file::add_output_section): New member function.
1964 (Dwp_output_file::write_new_section): New member function.
1965 (Dwp_output_file::write_contributions): New member function.
1966 (Dwp_output_file::section_id_map_): New data member.
1967 (class Dwo_id_info_reader): Remove.
1968 (class Unit_reader): New class.
1969 (get_dwarf_section_name): New function.
1970 (Dwo_file::read_executable): Adjust initializations of class data.
1971 (Dwo_file::read): Add support for v2 package file format.
1972 (Dwo_file::read_unit_index): Likewise.
1973 (Dwo_file::sized_read_unit_index): Likewise.
1974 (Dwo_file::copy_section): Likewise.
1975 (Dwo_file::add_unit_set): Likewise.
1976 (Dwp_output_file::add_output_section): Likewise.
1977 (Dwp_output_file::add_contribution): Likewise.
1978 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1979 for empty slot.
1980 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1981 file format.
1982 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1983 slot.
1984 (Dwp_output_file::initialize): Remove unused function.
1985 (Dwp_output_file::finalize): Add support for v2 package file format.
1986 (Dwp_output_file::write_index): Likewise.
1987 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1988 function prototype.
1989
a68a081d
CC
19902013-03-01 Cary Coutant <ccoutant@google.com>
1991
1992 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1993 function into class definition in header file.
1994 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1995 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1996 New function.
1997 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1998
9d5781f8
AM
19992013-02-28 Alan Modra <amodra@gmail.com>
2000
2001 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2002 * target.cc (Target::do_plt_fde_location): New function.
2003 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2004 accessor function, and constructor param.
2005 (struct Post_fde, Post_fdes): Declare.
2006 (Cie::write): Add post_fdes param.
2007 * ehframe.cc (Fde::write): Use plt_fde_location.
2008 (struct Post_fde): Define.
2009 (Cie::write): Stash FDEs added post merge mapping.
2010 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2011 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2012 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2013 other FDEs.
2014 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2015 (Target_powerpc::has_glink): New function.
2016 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2017 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2018 glink_eh_frame_fde_32, default_fde): New data.
2019 (Stub_table::eh_frame_added_): New var.
2020 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2021 Make const.
2022 (Stub_table::add_eh_frame): New function.
2023 (Output_data_glink::add_eh_frame): New function.
2024 (Target_powerpc::make_glink_section): Call add_eh_frame.
2025
214383dd
ILT
20262013-02-15 Ian Lance Taylor <iant@google.com>
2027
2028 * options.h (DEFINE_uint64_alias): Define.
2029 (class General_options): Add -Ttext-segment as an alias for
2030 -Ttext.
2031
91c2b899
AM
20322013-02-15 Alan Modra <amodra@gmail.com>
2033
2034 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2035 (Stub_table::do_write): ..here, two places.
2036 (Stub_table::plt_call_size): Use it here too.
2037
20e2a8aa
ILT
20382013-02-11 Ian Lance Taylor <iant@google.com>
2039
2040 * descriptors.cc (Descriptors::close_all): New function.
2041 * descriptors.h (class Descriptors): Declare close_all.
2042 (close_all_descriptors): New inline function.
2043 * plugin.cc: Include "descriptors.h".
2044 (Plugin_manager::cleanup): Call close_all_descriptors.
2045
8952bc69
AM
20462013-02-06 Alan Modra <amodra@gmail.com>
2047
2048 * README: Update coding style link.
2049
29bd8b6b
CC
20502013-01-28 Cary Coutant <ccoutant@google.com>
2051
a4034750
AM
2052 * dwp.cc (File_list): New typedef.
2053 (Dwo_name_info_reader): New class.
2054 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2055 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2056 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2057 (Dwo_file::read_executable): New function.
2058 (Dwo_file::read): Move common setup code to ...
2059 (Dwo_file::make_object): ... here.
2060 (dwp_options): Add --exec/-e.
2061 (usage): Likewise.
2062 (main): Likewise.
29bd8b6b 2063
c6ac678d
ST
20642013-01-24 Sriraman Tallam <tmsriram@google.com>
2065
2066 * layout.cc (Layout::layout): Check for option text_reorder.
2067 (Layout::make_output_section): Ditto.
2068 * options.h (text_reorder): New option.
2069 * output.cc (Input_section_sort_compare): Remove special ordering
2070 of section names.
2071 (Output_section::
2072 Input_section_sort_section_name_special_ordering_compare::
2073 operator()): New function.
2074 (Output_section::sort_attached_input_sections): Use new sort function
2075 for .text.
2076 * output.h (Input_section_sort_section_name_special_ordering_compare):
2077 New struct.
2078 * testsuite/Makefile.am (text_section_grouping): Test option
2079 --no-text-reorder
2080 * testsuite/Makefile.in: Regenerate.
2081 * testsuite/text_section_grouping.sh: Check order of functions without
2082 default text reordering.
2083
50701cc1
MF
20842013-01-18 Mike Frysinger <vapier@gentoo.org>
2085
2086 * options.h (General_options): Change default to true for new_dtags.
2087
b1b00fcc
MF
20882013-01-18 Mike Frysinger <vapier@gentoo.org>
2089
2090 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2091 when enable_new_dtags is false. Only add DT_RUNPATH when
2092 enable_new_dtags is true.
2093
ec5b8187
AM
20942013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2095
2096 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2097 used in declaration and definition consistent.
2098 (Target_powerpc::symval_for_branch): Ditto.
2099
a880d4c4
ST
21002013-01-16 Sriraman Tallam <tmsriram@google.com>
2101
2102 * testsuite/plugin_final_layout.cc: Fix comment.
2103
7c381248
ST
21042013-01-16 Sriraman Tallam <tmsriram@google.com>
2105
2106 * layout.cc (Layout::layout): Do not do default sorting for
2107 text sections when section ordering is specified.
2108 (make_output_section): Ditto.
2109 * testsuite/plugin_final_layout.cc: Name the function sections
2110 to catch reordering issues.
2111
e2458743
AM
21122013-01-15 Alan Modra <amodra@gmail.com>
2113
2114 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2115 plt-thread-safe.
2116
431ed302
AM
21172013-01-15 Alan Modra <amodra@gmail.com>
2118
2119 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2120 * testsuite/Makefile.in: Regenerate.
2121
0ec6429b
AM
21222013-01-14 Alan Modra <amodra@gmail.com>
2123
2124 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2125 * testsuite/Makefile.in: Regenerate.
2126
0bf402d5
ILT
21272013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2128
36af3926 2129 PR bfd/14430
0bf402d5
ILT
2130 Fix mingw gold build with plugins enabled
2131 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2132 * configure.ac: Export DLOPEN_LIBS and add headers check.
2133 * plugin.cc: Handle non-dlfcn case.
2134 * Makefile.in: Regenerate.
2135 * config.in: Regenerate.
2136 * configure: Regenerate.
2137 * testsuite/Makefile.in: Regenerate.
2138
9e9143bc
ST
21392013-01-09 Sriraman Tallam <tmsriram@google.com>
2140
2141 * output.h (sort_attached_input_sections): Change to be public.
2142 * script-sections.cc
2143 (Output_section_definition::set_section_addresses): Sort
2144 attached input sections according to section order before linker
2145 script assigns section addresses.
2146 (Orphan_output_section::set_section_addresses): Sort
2147 attached input sections according to section order before linker
2148 script assigns section addresses.
2149 * Makefile.am (final_layout.sh): Use a simple linker script to
2150 check if section ordering still works.
2151 * Makefile.in: Regenerate.
2152
679af368
ILT
21532013-01-09 Ben Cheng <bccheng@google.com>
2154
2155 * arm.cc (Target_arm::attributes_accept_div): New function.
2156 (Target_arm::attributes_forbid_div): New function.
2157 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2158 attribute using the same new functions as what bfd/elf32_arm.c
2159 does.
2160
3136a00e
CC
21612013-01-07 Cary Coutant <ccoutant@google.com>
2162
2163 PR gold/14993
2164 * output.cc (Output_section::add_input_section): For incremental
2165 updates, don't track input sections that are allocated from patch
2166 space.
2167
f2a6224b
L
21682013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2169 Ian Lance Taylor <iant@google.com>
2170
2171 PR gold/14897
2172 * configure.ac (--enable-ld): Removed.
2173 (install_as_default): Set to yes only for --enable-gold=default
2174 or --disable-ld.
2175 * configure: Regenerated.
2176
4f46f626
L
21772013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2178
2179 * options.h (General_options): Add -fuse-ld= for GCC linker
2180 option compatibility.
2181
26e4ef59
CC
21822013-01-04 Cary Coutant <ccoutant@google.com>
2183
2184 * configure.ac: Fix typo restoring CXXFLAGS.
2185 * configure: Regenerate.
2186
3d587466
CC
21872013-01-04 Cary Coutant <ccoutant@google.com>
2188
4f46f626
L
2189 * testsuite/Makefile.am (CXXLINK_S): New macro.
2190 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2191 * testsuite/Makefile.in: Regenerate.
3d587466 2192
44db6695
L
21932013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2194
2195 * version.cc (print_version): Update copyright year to 2013.
2196
edcac0c1
ILT
21972012-12-20 Ian Lance Taylor <iant@google.com>
2198
2199 * layout.cc (Layout::special_ordering_of_input_section): New
2200 function.
2201 (Layout::layout): If input section requires special ordering, must
2202 sort input sections.
2203 (Layout::make_output_section): May sort .text input sections.
2204 (Layout::is_section_name_prefix_grouped): Remove.
2205 * layout.h (class Layout): Declare
2206 special_ordering_of_input_section. Don't declare
2207 is_section_name_prefix_grouped.
2208 * output.cc (Output_section::add_input_section): Revert last
2209 change.
2210 (Output_section::Input_section_sort::match_file_name): Don't crash
2211 if called on output section data.
2212 (Output_section::Input_section_sort_compare): Sort based on
2213 special ordering.
2214 (Output_section::Input_section_sort_section_order_index_compare):
2215 Revert last patch.
2216 (Output_section::sort_attached_input_sections): Likewise.
2217
28f2a4ac
ST
22182012-12-18 Sriraman Tallam <tmsriram@google.com>
2219
edcac0c1 2220 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2221 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2222 * output.cc (Output_section::add_input_section): Check if section
2223 name contains special prefix. Keep input sections to sort such
2224 sections.
2225 (Output_section::Input_section_sort_section_order_index_compare
2226 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2227 (Output_section::sort_attached_input_sections): Add condition to
2228 Input_section_entry constructor call.
28f2a4ac
ST
2229 * testsuite/Makefile.am (text_section_grouping): New test.
2230 * testsuite/Makefile.in: Regenerate.
2231 * testsuite/text_section_grouping.cc: New file.
2232 * testsuite/text_section_grouping.sh: New file.
2233
5bf135a7
NC
22342012-12-17 Nick Clifton <nickc@redhat.com>
2235
2236 * Makefile.am: Add copyright notice.
2237 * NEWS: Likewise.
2238 * README: Likewise.
2239 * configure.ac: Likewise.
2240 * ftruncate.c: Likewise.
2241 * Makefile.in: Regenerate.
2242
59965708
CC
22432012-12-14 Cary Coutant <ccoutant@google.com>
2244
a4034750
AM
2245 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2246 --no-as-needed flag.
2247 (exception_separate_shared_12_test): Likewise.
2248 (incremental_copy_test): Likewise.
2249 * testsuite/Makefile.in: Regenerate.
59965708 2250
2a77e2ab
CC
22512012-12-14 Cary Coutant <ccoutant@google.com>
2252
2253 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2254 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2255
e3deeb9c
AM
22562012-12-12 Alan Modra <amodra@gmail.com>
2257
2258 * powerpc.cc (class Track_tls): New.
2259 (class Relocate, class Scan): Inherit Track_tls.
2260 (Target_powerpc::Scan::local, global): Track tls optimization
2261 and avoid creating plt entry for __tls_get_addr if all uses
2262 are optimized away.
2263 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2264
d8f5a274
AM
22652012-12-12 Alan Modra <amodra@gmail.com>
2266
2267 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2268 Replace no_toc_optimize with toc_optimize.
2269 * output.h (Output_section::input_sections): Provide non-const variant.
2270 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2271 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2272 accessors.
2273 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2274 (class Sort_toc_sections): New.
2275 (Target_powerpc::do_finalize_sections): Sort toc sections.
2276 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2277
4c8a1de1
RM
22782012-12-10 Roland McGrath <mcgrathr@google.com>
2279
2280 * testsuite/binary_unittest.cc (read_all): New function.
2281 (Sized_binary_test): Use it instead of ::read.
2282 * fileread.cc (do_read): Don't assume pread always reads the whole
2283 amount in a single call.
2284
edc27beb
AM
22852012-12-10 Alan Modra <amodra@gmail.com>
2286
2287 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2288 Set EM_PPC64 or EM_PPC here.
2289 (Target_selector_powerpc::do_recognize): Delete.
2290
906b9150
AM
22912012-12-10 Alan Modra <amodra@gmail.com>
2292
2293 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2294 stub_table_.
2295 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2296
418c15ae
RM
22972012-12-07 Roland McGrath <mcgrathr@google.com>
2298
2299 * testsuite/binary_unittest.cc (Sized_binary_test):
2300 Use open_descriptor rather than ::open.
2301
decdd3bc
AM
23022012-12-07 Alan Modra <amodra@gmail.com>
2303
2304 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2305 typedef and invalid_address constant.
2306 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2307 instantiate constants.
2308
db399005
ILT
23092012-12-06 Roland McGrath <mcgrathr@google.com>
2310
2311 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2312 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2313 * aclocal.m4: Regenerate.
2314 * configure: Regenerate.
2315 * Makefile.in: Regenerate.
2316 * testsuite/Makefile.in: Regenerate.
2317
aba6bc71
AM
23182012-12-07 Alan Modra <amodra@gmail.com>
2319
2320 * options.h (General_options): Add no_toc_optimize.
2321 * powerpc.cc (ok_lo_toc_insn): New function.
2322 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2323
9e69ed50
AM
23242012-12-06 Alan Modra <amodra@gmail.com>
2325
2326 * options.h (General_options): Add plt_align, plt_static_chain,
2327 plt_thread_safe. Update stub_group_size help text.
2328 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2329 for new plt_thread_safe_ var.
2330 (use_plt_offset): Correct comments.
2331 (Target_powerpc::do_relax): Look for thread creation symbols to
2332 determine default plt_thread_safe value. Clear plt call stubs
2333 as well as branch stubs each iteration.
2334 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2335 insn constants.
2336 (l, hi, ha, write_insn): Move earlier.
2337 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2338 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2339 plt stubs too.
2340 (Stub_table::update_size): Adjust.
2341 (Stub_table::prev_size, set_prev_size): Delete.
2342 (Stub_table::stub_align): Let --plt-align affect result.
2343 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2344 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2345 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2346 (Stub_table::do_write): Support more stub variants.
2347
f43ba157
AM
23482012-12-04 Alan Modra <amodra@gmail.com>
2349
2350 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2351 (Target_powerpc::do_define_standard_symbols): New function.
2352
34171bc5
AM
23532012-12-03 Alan Modra <amodra@gmail.com>
2354
2355 * output.h: Formatting, whitespace.
2356
dc9589e9 23572012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2358
2359 * layout.h (Layout::get_executable_sections): Declare.
2360 * layout.cc (Layout::get_executable_sections): New function.
2361 * arm.cc (Target_arm::group_sections): Use it.
2362 (Arm_output_section::group_sections): Delete now redundant test.
2363 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2364 param to handle relative relocs.
2365 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2366 (Output_data_reloc::add_absolute): Adjust.
2367 (Output_data_reloc::add_relative): New function.
2368 (Output_data::reset_data_size): New function.
2369 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2370 (Output_section::set_addralign): New function.
2371 (Output_section::checkpoint_set_addralign): New function.
2372 (Output_section::clear_section_offsets_need_adjustment): New function.
2373 (Output_section::input_sections): Make public.
2374 * powerpc.cc (class Output_data_brlt_powerpc): New.
2375 (class Stub_table, class Stub_control): New.
2376 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2377 stub_table_, set_stub_table, stub_table): New vectors and accessor
2378 functions.
2379 (Target_powerpc::do_may_relax, do_relax, push_branch,
2380 new_stub_table, stub_tables, brlt_section, group_sections,
2381 add_branch_lookup_table, find_branch_lookup_table,
2382 write_branch_lookup_table, make_brlt_section): New functions.
2383 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2384 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2385 branch_info_): New vars.
2386 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2387 make call stubs here.
2388 (Output_data_glink): Remove all call stub handling from this class.
2389 (Target_powerpc::Scan::local, global): Save interesting branch
2390 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2391 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2392 functions on final link.
2393 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2394 Handle long branch destinations too.
2395 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2396 do_plt_address_for_local): Adjust lookup of plt call stubs.
2397
627b30b7
AM
23982012-11-30 Alan Modra <amodra@gmail.com>
2399
2400 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2401 relocs against protected symbols when building 32-bit shared libs.
2402
40b469d7
AM
24032012-11-30 Alan Modra <amodra@gmail.com>
2404
2405 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2406 param. Call got_section() to make .got. Update all callers
2407 and their callers and so on.
2408
bb66a627
AM
24092012-11-30 Alan Modra <amodra@gmail.com>
2410
2411 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2412 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2413 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2414 value if it already exists.
2415
d2cf1c6c
L
24162012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2417
2418 PR gold/14858
2419 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2420
edccdf7c
RM
24212012-11-14 Roland McGrath <mcgrathr@google.com>
2422
2423 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2424 than bfc instruction for data sandboxing.
2425
6febeb74
AM
24262012-11-08 Alan Modra <amodra@gmail.com>
2427
2428 * po/POTFILES.in: Regenerate.
2429
0a6f1bf2
AM
24302012-11-05 Alan Modra <amodra@gmail.com>
2431
2432 * configure.ac: Apply 2012-09-10 change to config.in here.
2433 * configure: Regenerate.
2434
26a4e9cb
AM
24352012-11-05 Alan Modra <amodra@gmail.com>
2436
2437 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2438 (struct Opd_ent): Use "Address" rather than "Offset".
2439 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2440 (Target_powerpc::got_section): Make public.
2441 (Target_powerpc::scan_relocs): Move code setting symbols..
2442 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2443 Create _SDA_BASE_ only when referenced.
2444
cc928013
RM
24452012-11-02 Roland McGrath <mcgrathr@google.com>
2446
2447 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2448 from last change.
2449
50ed5eb1
RM
24502012-11-01 Roland McGrath <mcgrathr@google.com>
2451
62fe925a
RM
2452 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2453 for offset_in_output_section parameter.
2454 (Sized_target::relocate_special_relocatable): Likewise.
2455 * arm.cc (Target_arm::relocate_relocs): Likewise.
2456 (Target_arm::relocate_special_relocatable): Likewise.
2457 * i386.cc (Target_i386::relocate_relocs): Likewise.
2458 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2459 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2460 * target-reloc.h (relocate_relocs): Likewise.
2461 * testsuite/testfile.cc (Target_test): Likewise.
2462 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2463 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2464
2465 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2466 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2467
2468 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2469 parameter, which is unused in the [!F_SETFD] case.
2470
50ed5eb1
RM
2471 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2472 SYMNDX to off_t before comparing it to this->data_size().
2473 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2474 * incremental.cc (Output_section_incremental_inputs::do_write):
2475 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2476
2cadc0bf
RM
2477 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2478
3bfcb652
NC
24792012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2480
2481 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2482 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2483 in EABI_VER5.
2484
c1a8d56e
CC
24852012-10-29 Cary Coutant <ccoutant@google.com>
2486
2487 * dwp.cc (usage): Add file and exit status parameters;
2488 add --help and --version options.
2489 (print_version): New function.
2490 (main): Add --help and --version options.
2491
b2490a7b
L
24922012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2493
2494 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2495 final_layout_sequence.txt.
2496 * testsuite/Makefile.in: Regenerated.
2497
aa543512
L
24982012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2499
2500 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2501 COMPILE generated by automake.
2502 (LINK1): Likewise.
2503 (CXXCOMPILE1): Likewise.
2504 (CXXLINK1): Likewise.
2505 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2506 (LINK): Likewise.
2507 (CXXCOMPILE): Likewise.
2508 (CXXLINK): Likewise.
2509 * testsuite/Makefile.in: Regenerated.
2510
d361fafb
L
25112012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2512
2513 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2514 on bad fwrite return.
2515
598c7410
L
25162012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2517
2518 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2519 on val.
2520
35c813e2
CC
25212012-10-23 Cary Coutant <ccoutant@google.com>
2522
2523 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2524 * testsuite/Makefile.in: Regenerate.
2525 * testsuite/dwp_test.h: New source file.
2526 * testsuite/dwp_test_1.cc: New source file.
2527 * testsuite/dwp_test_1.s: New source file.
2528 * testsuite/dwp_test_1.sh: New source file.
2529 * testsuite/dwp_test_1b.cc: New source file.
2530 * testsuite/dwp_test_1b.s: New source file.
2531 * testsuite/dwp_test_2.cc: New source file.
2532 * testsuite/dwp_test_2.s: New source file.
2533 * testsuite/dwp_test_2.sh: New source file.
2534 * testsuite/dwp_test_main.cc: New source file.
2535 * testsuite/dwp_test_main.s: New source file.
2536
77429909
CC
25372012-10-23 Cary Coutant <ccoutant@google.com>
2538
2539 * dwp.h: New header file.
2540 * dwp.cc: New source file.
2541 * gold.h: Move shared declarations to system.h.
2542 * system.h: New header file.
2543 * Makefile.am: Add dwp.
2544 * Makefile.in: Regenerate.
2545
ed5d6712
CC
25462012-10-23 Cary Coutant <ccoutant@google.com>
2547
2548 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2549 Dwarf_info_reader::read_from_pointer.
2550 (Dwarf_pubnames_table::read_header): Likewise.
2551 (Dwarf_pubnames_table::next_name): Likewise.
2552 (Dwarf_die::read_attributes): Likewise.
2553 (Dwarf_die::skip_attributes): Likewise.
2554 (Dwarf_info_reader::read_from_pointer): New function template.
2555 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2556 (Dwarf_pubnames_table): Likewise.
2557 (Dwarf_info_reader::read_from_pointer): New function template.
2558 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2559 Dwarf_pubnames_table ctor.
2560
8787852d
CC
25612012-10-23 Cary Coutant <ccoutant@google.com>
2562
2563 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2564 abbrev_shndx.
2565 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2566 abbrev_shndx_.
2567 (Dwarf_info_reader::set_abbrev_shndx): New method.
2568 (Dwarf_info_reader::abbrev_shndx_): New data member.
2569
9fc236f3
CC
25702012-10-23 Cary Coutant <ccoutant@google.com>
2571
2572 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2573 from object, not parameters.
2574 (Dwarf_info_reader::parse): Likewise.
2575 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2576 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2577 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2578 methods.
2579
effe8365
CC
25802012-10-23 Cary Coutant <ccoutant@google.com>
2581
2582 * fileread.cc (Input_file::Input_file): New constructor.
2583 * fileread.h (class Input_file): Add new constructor.
2584
1698990d
AM
25852012-10-18 Alan Modra <amodra@gmail.com>
2586
2587 PR gold/14727
2588 * object.cc (Relobj::is_section_name_included): Also match
2589 .sdata personality section.
2590
168a4726
AM
25912012-10-18 Alan Modra <amodra@gmail.com>
2592
2593 * target-reloc.h (class Default_comdat_behavior): New, package up..
2594 (get_comdat_behaviour): ..this.
2595 (relocate_section): Add Relocate_comdat_behavior template arg,
2596 adjust code to suit.
2597 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2598 (Target_arm::scan_reloc_section): Likewise.
2599 * i386.cc (Target_i386::relocate_section): Likewise.
2600 * sparc.cc (Target_sparc::relocate_section): Likewise.
2601 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2602 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2603 * powerpc.cc (class Relocate_comdat_behavior): New.
2604 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2605 gold::relocate_section with new template arg.
2606
acc276d8
AM
26072012-10-18 Alan Modra <amodra@gmail.com>
2608
2609 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2610 dynamic relocs for GOT_TPREL got entries, without symbol if
2611 resolving locally.
2612 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2613 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2614 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2615
e10f9870
AM
26162012-10-17 Alan Modra <amodra@gmail.com>
2617
2618 PR gold/14726
2619 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2620
ae034989
ST
26212012-10-16 Sriraman Tallam <tmsriram@google.com>
2622
2623 * layout.cc (Layout::include_section): Keep sections marked
2624 SHF_EXCLUDE when doing relocatable links.
2625
f3a0ed29
AM
26262012-10-16 Alan Modra <amodra@gmail.com>
2627
2628 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2629 (Target_powerpc::do_finalize_sections): Call it.
2630 (Output_data_save_res): New class and supporting functions.
2631 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2632 normal symbols defined in object files.
2633
c6de8ed4
AM
26342012-10-12 Alan Modra <amodra@gmail.com>
2635
2636 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2637 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2638 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2639 section if scan_opd_relocs not yet called.
2640 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2641
03e25981
AM
26422012-10-12 Alan Modra <amodra@gmail.com>
2643
2644 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2645 add_local_ifunc_entry): Revert last change.
2646 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2647
c9824451
AM
26482012-10-05 Alan Modra <amodra@gmail.com>
2649
2650 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2651 do_plt_address_for_global): New functions.
2652 (Output_data_got_powerpc::do_write): Don't segfault when linking
2653 statically.
2654 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2655 add_local_ifunc_entry): Return true on adding entry..
2656 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2657 glink->add_entry call. Remove unused symtab param. Adjust calls.
2658 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2659 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2660 set up symbols here.
2661 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2662 syms here. Do so even when no .iplt. Don't segfault when linking
2663 statically.
2664 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2665 new variants without reloc param.
2666 (Glink_sym_ent::Glink_sym_ent): Likewise.
2667 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2668 reloc when refs will resolve to plt call stub.
2669 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2670 R_PPC_PLTREL24 to resolve locally.
2671 (Target_powerpc::Scan::global): Correct ifunc handling.
2672 (Target_powerpc::Relocate::relocate): Correct local sym glink
2673 lookup. Don't destroy "value" when we have a plt call stub,
2674 and when checking plt call validity.
2675 (Target_powerpc::do_dynsym_value): Simplify.
2676
19fec8c1
AM
26772012-10-05 Alan Modra <amodra@gmail.com>
2678
2679 * i386.cc (Output_data_plt_i386::address_for_global,
2680 address_for_local): Add plt offset to returned value. Adjust uses.
2681 * sparc.cc (Output_data_plt_sparc::address_for_global,
2682 address_for_local): Likewise.
2683 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2684 address_for_local): Likewise.
2685 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2686 address_for_local): Likewise.
2687 * target.h (Target::plt_address_for_global, plt_address_for_local):
2688 Update comment.
2689 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2690 (Output_data_got::Got_entry::write): Nor here.
2691 * output.h: Comment fix.
2692
e867b647
WL
26932012-10-02 Jiong Wang <jiwang@tilera.com>
2694
2695 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2696 global_offset_table_ value for larget got.
2697 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2698
e5d5f5ed
AM
26992012-09-29 Alan Modra <amodra@gmail.com>
2700
2701 * powerpc.cc (Target_powerpc::iplt_): New output section.
2702 (Target_powerpc::iplt_section, make_iplt_section,
2703 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2704 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2705 Target_powerpc::plt_entry_count): Count iplt entries too.
2706 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2707 reloc section in constructor. New params.
2708 (Target_powerpc::make_plt_section): Create reloc section here instead.
2709 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2710 functions.
2711 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2712 (Output_data_glink::add_entry, find_entry): New functions to
2713 deal with local syms.
2714 (Glink_sym_ent): Add support for local syms.
2715 (Output_data_glink::do_write): Handle ifunc plt entries.
2716 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2717 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2718 (Target_powerpc::Relocate::relocate): Likewise.
2719 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2720
ec4dbad3
AM
27212012-09-25 Alan Modra <amodra@gmail.com>
2722
2723 * object.h (Sized_relobj_file::adjust_local_symbol,
2724 do_adjust_local_symbol): New functions.
2725 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2726 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2727 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2728 and irregular opd entry spacing.
2729 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2730 (Global_symbol_visitor_opd): New functor.
2731 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2732 on deleted opd entries.
2733
5c0b3823
WL
27342012-09-15 Jiong Wang <jiwang@tilera.com>
2735
2736 * tilegx.cc: New file.
2737 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2738 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2739 * configure.tgt: Add entries for tilegx*.
2740 * configure.ac: Likewise.
2741 * Makefile.in: Rebuild.
2742 * configure: Likewise.
2743 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2744 tilegx.
2745
bfdfa4cd
AM
27462012-09-13 Alan Modra <amodra@gmail.com>
2747
2748 * target-reloc.h (scan_relocs): Call scan.local for relocs
2749 against symbols in discarded sections. Pass is_discarded
2750 param.
2751 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2752 Add is_discarded param.
2753 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2754 is_discarded to flag opd entry as discarded. Don't emit dyn
2755 relocs on such entries.
2756 (Target_powerpc::Scan::global): Similarly detect and handle
2757 such opd entries.
2758 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2759 opd_ent_. Update all uses.
2760 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2761 (Target_powerpc::relocate_section): Zero out discarded opd
2762 entry relocs.
2763
d77a0555
ILT
27642012-09-12 Ian Lance Taylor <iant@google.com>
2765
2766 PR gold/14570
2767 * output.cc: Rename Output_data_got template parameter from size
2768 to got_size for all functions. Compile all variants of
2769 Output_data_got.
2770 (Output_data_got::Got_entry::write): Correct use of size for
2771 symbol value. Use local_is_tls rather than casting to
2772 Sized_relobj_file.
2773 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2774 (class Sized_relobj_file): Add do_local_is_tls.
2775 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2776
815a1205
AM
27772012-09-11 Alan Modra <amodra@gmail.com>
2778
2779 PR gold/14566
2780 * layout.cc (Layout::set_segment_offsets): When using
2781 common-page-size alignment, ensure we are on a new max-page-size
2782 page.
2783 * output.cc (Output_segment::set_section_addresses): Use
2784 abi_pagesize, not common_pagesize for relro boundary.
2785 (Output_segment::set_offset): Likewise.
2786
bd73a62d
AM
27872012-09-11 Alan Modra <amodra@gmail.com>
2788
2789 * output.h (Output_data_got::add_global_tls, add_local_tls,
2790 add_local_tls_pair): New functions.
2791 (Output_data_got::add_local_pair_with_rel): Remove second
2792 reloc param. Expand comment.
2793 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2794 use_plt_or_tls_offset_, similarly for constructor param.
2795 (Output_data_got::Got_entry::write): Add got_index param.
2796 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2797 add_local_tls_pair): New functions.
2798 (Output_data_got::Got_entry::write): Handle tls symbols
2799 with use_plt_or_tls_offset_ set specially.
2800 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2801 (Output_data_got::do_write): Replace iterator with index, pass
2802 index to entry write function.
2803 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2804 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2805 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2806 call.
2807 * i386.cc (Target_i386::Scan::local): Likewise.
2808 * sparc.cc (Target_sparc::Scan::local): Likewise.
2809 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2810 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2811 do_tls_offset_for_global): New functions.
2812 (Target_powerpc::Scan::local): Correct TLS relocations and got
2813 entry values.
2814 (Target_powerpc::Scan::global): Don't emit unnecessary
2815 dynamic relocations on TLS GOT entries.
2816
00716ab1
AM
28172012-09-10 Matthias Klose <doko@ubuntu.com>
2818
2819 * config.in: Disable sanity check for kfreebsd.
2820
c891b3f9
SA
28212012-09-10 Sterling Augustine <saugustine@google.com>
2822
2823 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2824 (Gdb_index::pubtypes_read): New parameter.
2825 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2826 to calls.
2827 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2828 pubtypes_object_.
2829
e81fea4d
AM
28302012-09-09 Alan Modra <amodra@gmail.com>
2831
2832 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2833 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2834 * gc.h (gc_process_relocs): Call target gc_add_reference.
2835 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2836 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2837 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2838 unnecessary cast.
2839 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2840 to cater for when we don't need code offset. Update use.
2841 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2842 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2843 set_opd_valid): New functions.
2844 (Target_powerpc::do_gc_add_reference): New function.
2845 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2846 stashed refs.
2847 (Target_powerpc::do_gc_mark_symbol): New function.
2848
d2d60eef
CC
28492012-09-06 Cary Coutant <ccoutant@google.com>
2850
2851 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2852 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2853 (Dwarf_die::skip_attributes): Likewise.
2854 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2855 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2856 (main): Call it.
2857 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2858
32ed4573
L
28592012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2860
2861 * testsuite/script_test_3.t: Add .got.plt output section
2862 statement.
2863 * testsuite/script_test_4.t: Likewise.
2864
f4baf0d4
AM
28652012-09-05 Alan Modra <amodra@gmail.com>
2866
2867 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2868 update all uses and lose "enum" when using type.
2869
864a1b56
AM
28702012-09-05 Alan Modra <amodra@gmail.com>
2871
2872 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2873 * configure: Regenerate.
2874 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2875 (plugin_final_layout.stdout): Likewise.
2876 (memory_test): Set page sizes to 0x1000.
2877 * testsuite/Makefile.in: Regenerate.
2878 * testsuite/discard_locals_test.sh: Add FIXME comment.
2879 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2880 * testsuite/pr14265.t: Add .got output section statement.
2881 * testsuite/script_test_2.t: Likewise.
2882 * testsuite/script_test_3.t: Likewise.
2883 * testsuite/script_test_4.t: Likewise.
2884 * testsuite/script_test_5.t: Likewise.
2885 * testsuite/script_test_6.t: Likewise.
2886 * testsuite/script_test_7.t: Likewise.
2887 * testsuite/script_test_9.t: Likewise.
2888
3ea0a085
AM
28892012-09-05 Alan Modra <amodra@gmail.com>
2890
2891 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2892 (Powerpc_relocate_functions::Status): New typedef.
2893 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2894 (Target_powerpc::Scan::local): Handle REL64.
2895 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2896 for REL32 and REL64.
2897 (Target_powerpc::symval_for_branch): New function, extracted from..
2898 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2899 checks. Report overflow errors.
2900
7404fe1b
AM
29012012-09-05 Alan Modra <amodra@gmail.com>
2902
2903 * object.h (Sized_relobj_file::emit_relocs): Delete.
2904 (Sized_relobj_file::emit_relocs_reltype): Delete.
2905 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2906 relocate_relocs for --emit-relocs.
2907 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2908 * output.h: Update comment.
2909 (Output_segment::first_section): New function.
2910 (Output_segment::first_section_load_address): Use first_section.
2911 * output.cc (Output_segment::first_section): New function extracted..
2912 (Output_segment::first_section_load_address): ..from here. Delete.
2913 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2914 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2915 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2916 adjust call to target.h function.
2917 * i386.cc (Target_i386): Likewise.
2918 * sparc.cc (Target_sparc): Likewise.
2919 * x86_64.cc (Target_x86_64): Likewise.
2920 * powerpc.cc (Target_powerpc): Likewise.
2921 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2922 first tls section has section symbol for optimised local dynamic
2923 output relocs.
2924 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2925 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2926 optimised tls code.
2927 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2928 Rename to relocate_relocs. Update error message.
2929
957564c9
AS
29302012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2931
2932 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2933 --just-symbols.
2934
dd93cd0a
AM
29352012-08-31 Alan Modra <amodra@gmail.com>
2936
2937 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2938 (Powerpc_relobj::toc_base_offset): New stub function.
2939 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2940 got_mod_index_offset to tlsld_got_offset. Update all refs.
2941 (Target_powerpc::Relocate::enum skip_tls): New.
2942 (Target_powerpc::call_tls_get_addr_): New var.
2943 (Target_powerpc::is_branch_reloc): Move to file scope.
2944 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2945 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2946 New functions.
2947 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2948 (powerpc_info): Correct common_pagesize for ppc64.
2949 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2950 (Powerpc_relocate_functions): Add overflow check enums and functions.
2951 Add non-shift version of rela, rela_ua. Delete all rel public
2952 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2953 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2954 addr16_ha3, addr14 functions.
2955 (Output_data_got_powerpc::add_constant_pair): New function.
2956 (Output_data_got_powerpc::got_base_offset): Likewise.
2957 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2958 (instruction constants): Sort, add some more.
2959 (Output_data_glink::do_write): Add and use Address typedef. Use
2960 object->toc_base_offset() stub for 64-bit.
2961 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2962 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2963 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2964 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2965 Always treat .opd relocs as against locally defined symbol.
2966 Correct condition for RELATIVE relocs.
2967 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2968 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2969 for 32-bit syms with a plt entry. Correct ppc64 toc base
2970 calculations. Handle TLS relocs, and more. Add overflow
2971 checking and adjust for Powerpc_relocate_functions changes.
2972 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2973 Reinstate --emit-relocs code with FIXME.
2974
a1373b60
AM
29752012-08-30 Alan Modra <amodra@gmail.com>
2976
2977 * layout.cc (Layout::set_segment_offsets): Set p_align to
2978 abi_pagesize, not common_pagesize.
2979 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2980 to determine whether file header can go in segment.
2981
703d02da
AM
29822012-08-30 Alan Modra <amodra@gmail.com>
2983
2984 * output.h (Output_reloc::Output_reloc <output section>): Add
2985 is_relative param. Adjust calls.
2986 (Output_reloc::add_output_section_relative): New functions.
2987 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2988 is_relative.
2989 (Output_reloc::symbol_value): Handle SECTION_CODE.
2990
16164a6b
ST
29912012-08-24 Sriraman Tallam <tmsriram@google.com>
2992
2993 * gold.cc (queue_middle_tasks): Call layout again when unique
2994 segments for sections is desired.
2995 * layout.cc (Layout::Layout): Initialize new members.
2996 (Layout::get_output_section_flags): New function.
2997 (Layout::choose_output_section): Call get_output_section_flags.
2998 (Layout::layout): Make output section for mapping to a unique segment.
2999 (Layout::insert_section_segment_map): New function.
3000 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3001 output sections marked so.
16164a6b
ST
3002 (Layout::segment_precedes): Check for unique segments when sorting.
3003 * layout.h (Layout::Unique_segment_info): New struct.
3004 (Layout::Section_segment_map): New typedef.
3005 (Layout::insert_section_segment_map): New function.
3006 (Layout::get_output_section_flags): New function.
3007 (Layout::is_unique_segment_for_sections_specified): New function.
3008 (Layout::set_unique_segment_for_sections_specified): New function.
3009 (Layout::unique_segment_for_sections_specified_): New member.
3010 (Layout::section_segment_map_): New member.
3011 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3012 Rename is_gc_pass_one to is_pass_one.
3013 Rename is_gc_pass_two to is_pass_two.
3014 Rename is_gc_or_icf to is_two_pass.
3015 Check for which pass based on whether symbols data is present.
3016 Make it two pass when unique segments for sections is desired.
3017 * output.cc (Output_section::Output_section): Initialize new
3018 members.
3019 * output.h (Output_section::is_unique_segment): New function.
3020 (Output_section::set_is_unique_segment): New function.
3021 (Output_section::is_unique_segment_): New member.
3022 (Output_section::extra_segment_flags): New function.
3023 (Output_section::set_extra_segment_flags): New function.
3024 (Output_section::extra_segment_flags_): New member.
3025 (Output_section::segment_alignment): New function.
3026 (Output_section::set_segment_alignment): New function.
3027 (Output_section::segment_alignment_): New member.
3028 (Output_segment::Output_segment): Initialize is_unique_segment_.
3029 (Output_segment::is_unique_segment): New function.
3030 (Output_segment::set_is_unique_segment): New function.
3031 (Output_segment::is_unique_segment_): New member.
3032 * plugin.cc (allow_unique_segment_for_sections): New function.
3033 (unique_segment_for_sections): New function.
3034 (Plugin::load): Add new functions to transfer vector.
3035 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3036 * Makefile.in: Regenerate.
3037 * testsuite/plugin_final_layout.sh: Check if unique segment
3038 functionality works.
3039 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3040 are available.
3041 (allow_unique_segment_for_sections): New global.
3042 (unique_segment_for_sections): New global.
3043 (claim_file_hook): Call allow_unique_segment_for_sections.
3044 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3045
1e2bee4f
CC
30462012-08-22 Cary Coutant <ccoutant@google.com>
3047
3048 * layout.cc (Layout::include_section): Don't assert on GROUP
3049 sections with --emit-relocs.
3050
1d5dfe78
CC
30512012-08-21 Cary Coutant <ccoutant@google.com>
3052
3053 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3054 if --export-dynamic-symbol names an undef symbol.
3055
c9269dff
AM
30562012-08-18 Alan Modra <amodra@gmail.com>
3057
3058 * powerpc.cc: Formatting and white space.
3059 (Powerpc_relobj): Rename got2_section_ to special_.
3060 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3061 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3062 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3063 (Target_powerpc): Add Address typedef and invalid_address. Use
3064 throughout.
3065 (Target_powerpc::is_branch_reloc): New function.
3066 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3067 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3068 for dst_mask, value and addend.
3069 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3070 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3071 (Output_data_glink::do_write): Correct toc base. Don't try to use
3072 uint16_t for 24-bit offset. Use get_output_section_offset and
3073 check return.
3074 (Target_powerpc::Scan::local): Handle more relocs.
3075 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3076 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3077 Plug in toc restoring insn after plt calls. Translate branches
3078 to function descriptor symbols to corresponding entry point.
3079 (Target_powerpc::relocate_for_relocatable): Check return from
3080 get_output_section_offset.
3081 * symtab.h: Comment typo.
3082
b1759dce
ILT
30832012-08-14 Ian Lance Taylor <iant@google.com>
3084
3085 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3086 unsupported_relocal_local to call unsupported_reloc_global.
3087
b9b2ae8b
NC
30882012-08-14 Nick Clifton <nickc@redhat.com>
3089
3090 PR ld/14265
3091 * script-sections.cc (Sections_element::output_section_name): Add
3092 keep return parameter.
3093 (Output_section_element::match_name): Add keep return parameter.
3094 Return the value of the keep_ member.
3095 * script-sections.h (class Output_section): Update
3096 output_section_name prototype.
3097 * layout.cc (Layout::keep_input_section): New public member
3098 function.
3099 (Layout::choose_output_section): Pass keep parameter to
3100 output_section_name.
3101 * layout.h (class Layout): Add keep_input_section.
3102 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3103 sections.
3104 * testsuite/Makefile.am: Add a test.
3105 * testsuite/Makefile.in: Regenerate.
3106 * testsuite/pr14265.c: Source file for the test.
3107 * testsuite/pr14265.t: Linker script for the test.
3108 * testsuite/pr14265.sh: Shell script for the test.
3109
921b5322
AM
31102012-08-14 Alan Modra <amodra@gmail.com>
3111
3112 * target.h (Target::output_section_name): New function.
3113 (Target::do_output_section_name): New function.
3114 * layout.cc (Layout::choose_output_section): Call the above.
3115 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3116
6ce78956
AM
31172012-08-14 Alan Modra <amodra@gmail.com>
3118
3119 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3120 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3121 for replace_constant call.
3122 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3123 (Output_data_glink::do_print_to_mapfile): New function.
3124 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3125 (Target_powerpc::Relocate::relocate): Likewise.
3126
d1a8cabd
AM
31272012-08-14 Alan Modra <amodra@gmail.com>
3128
3129 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3130 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3131 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3132 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3133 all references to shndx_. Handle special case for R_PPC_PLTREL24
3134 here.
3135 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3136 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3137 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3138 here.
3139 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3140 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3141
d83ce4e3
AM
31422012-08-12 Alan Modra <amodra@gmail.com>
3143
3144 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3145 (glink insn constants): Use uint32_t.
3146 (Output_data_glink::add_entry): Use insert, not [] operator.
3147
cf43a2fe
AM
31482012-08-11 Alan Modra <amodra@gmail.com>
3149
3150 * object.h (Sized_relobj_file::find_shdr): New function.
3151 (Sized_relobj_file::find_special_sections): New function.
3152 * object.cc (Sized_relobj_file::find_shdr): New function.
3153 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3154 (Sized_relobj_file::find_special_sections): New function, split out..
3155 (Sized_relobj_file::do_read_symbols): ..from here.
3156 * output.h (Output_data_got::replace_constant): New function.
3157 (Output_data_got::num_entries): New function.
3158 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3159 (Output_data_got::got_offset): Protected rather than private.
3160 (Output_data_got::replace_got_entry): New function.
3161 * output.cc (Output_data_got::replace_got_entry): New function.
3162 * powerpc.cc (class Powerpc_relobj): New.
3163 (class Powerpc_relocate_functions): Delete all psymval variants or
3164 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3165 Implement _ha functions using corresponding _hi function.
3166 (Powerpc_relobj::find_special_sections): New function.
3167 (Target_powerpc::do_make_elf_object): New function.
3168 (class Output_data_got_powerpc): New.
3169 (class Output_data_glink): New.
3170 (class Powerpc_scan_relocatable_reloc): New.
3171 Many more changes througout file.
3172
3c892704
NC
31732012-08-09 Nick Clifton <nickc@redhat.com>
3174
3175 * po/vi.po: Updated Vietnamese translation.
3176
82435b3b
ILT
31772012-08-07 Ian Lance Taylor <iant@google.com>
3178
3179 * layout.cc (Layout::add_target_dynamic_tags): If
3180 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3181 plt_rel.
3182
a6dc81d2
NC
31832012-07-30 Nick Clifton <nickc@redhat.com>
3184
3185 * po/gold.pot: Updated template.
3186 * po/es.po: Updated Spanish translation.
3187
f1415016
CC
31882012-07-18 Cary Coutant <ccoutant@google.com>
3189
3190 PR gold/14344
3191 * configure.ac: Add check for -gpubnames support.
3192 * configure: Regenerate.
3193 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3194 support; force -gno-pubnames.
3195 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3196 support.
3197 (gdb_index_test_4): New test.
3198 * testsuite/Makefile.in: Regenerate.
3199 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3200 * testsuite/gdb_index_test_2.sh: Likewise.
3201 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3202 * testsuite/gdb_index_test_4.sh: New script.
3203 * testsuite/gdb_index_test_comm.sh: New script with common code;
3204 don't look for space after colon.
3205
b7fd7c37
ST
32062012-07-16 Sriraman Tallam <tmsriram@google.com>
3207
3208 * gold.cc (queue_middle_tasks): Update function order only after
3209 deferred objects due to plugins are processed.
3210
1f3212db
ILT
32112012-07-11 Ian Lance Taylor <iant@google.com>
3212
3213 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3214 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3215 (Target_arm::scan_reloc_for_stub): Likewise.
3216 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3217 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3218 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3219 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3220 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3221
81c82a68
ILT
32222012-07-10 Dodji Seketeli <dodji@redhat.com>
3223 Ian Lance Taylor <iant@google.com>
3224
3225 PR gold/14309
3226 * configure.ac: Test whether std::tr1::hash<off_t> works.
3227 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3228 needed.
3229 * output.h (class Output_fill): Add virtual destructor.
3230 * configure, config.in: Rebuild.
3231
eabc84f4
RM
32322012-06-22 Roland McGrath <mcgrathr@google.com>
3233
3234 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3235
370e30b6
RÁE
32362012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3237
3238 * plugin.cc (Plugin::load): Handle position independent executables.
3239
fb1b895d
CC
32402012-06-06 Cary Coutant <ccoutant@google.com>
3241
3242 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3243 add .debug_macro.
3244 (lines_only_debug_sections): Likewise.
3245 (gdb_fast_lookup_sections): New static array.
3246 (is_gdb_debug_section): Rename formal parameter.
3247 (is_lines_only_debug_section): Likewise.
3248 (is_gdb_fast_lookup_section): New function.
3249 (Layout::include_section): Check for ".zdebug_" prefix; pass
3250 section name suffix to is_gdb_debug_section, et al.; check for
3251 fast-lookup sections when building .gdb_index.
3252 * options.h (--strip-debug-gdb): Update GDB version number.
3253
7c0640fa
CC
32542012-06-06 Cary Coutant <ccoutant@google.com>
3255
3256 * configure.ac: Add check for fallocate.
3257 * configure: Regenerate.
3258 * config.in: Regenerate.
3259
3260 * options.h (class General_options): Add --mmap-output-file and
3261 --posix-fallocate options.
3262 * output.cc: (posix_fallocate): Remove; replace with...
3263 (gold_fallocate): New function.
3264 (Output_file::map_no_anonymous): Call gold_fallocate.
3265 (Output_file::map): Check --mmap-output-file option.
3266
2a49eb69
DK
32672012-06-05 Jing Yu <jingyu@google.com>
3268
3269 * gold.h (textdomain): Add do {} to empty while(0).
3270 (bindtextdomain): Likewise.
3271
fad072ac
CC
32722012-06-04 Cary Coutant <ccoutant@google.com>
3273
3274 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3275 has_dynsym_index.
3276
8cc69fb6
ST
32772012-05-25 Sriraman Tallam <tmsriram@google.com>
3278
3279 * symtab.cc (Symbol_table::define_special_symbol):
3280 Initialize *poldsym to prevent uninitialized variable errors.
3281
1be75daa
CC
32822012-05-23 Cary Coutant <ccoutant@google.com>
3283
3284 * layout.cc (Layout::section_name_mapping): Add rules to handle
3285 exact match on .data.rel.ro.local or .data.rel.ro.
3286 (Layout::output_section_name): Check for exact matches.
3287
9b689de0
CC
32882012-05-23 Cary Coutant <ccoutant@google.com>
3289
3290 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3291 more carefully.
3292
b24fdbf5
CC
32932012-05-22 Cary Coutant <ccoutant@google.com>
3294
3295 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3296 object before exporting symbol.
3297
e550e1a2
L
32982012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3299
3300 * testsuite/tls_test.cc: Include "config.h" first.
3301 * testsuite/tls_test_c.c: Likewise.
3302
df7b86aa
NC
33032012-05-17 Daniel Richard G. <skunk@iskunk.org>
3304 Nick Clifton <nickc@redhat.com>
3305
3306 PR 14072
3307 * configure.in: Add check that sysdep.h has been included before
3308 any system header files.
3309 * configure: Regenerate.
3310 * config.in: Regenerate.
3311
1007b503
CC
33122012-05-14 Cary Coutant <ccoutant@google.com>
3313
3314 * layout.cc (Layout::make_output_section): Mark .tdata section
3315 as RELRO.
3316 * testsuite/relro_test.cc: Add a TLS variable.
3317
fd885f3a
L
33182012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3319
3320 PR gold/14091
3321 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3322 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3323 R_X86_64_64.
3324
80f5885c
CC
33252012-05-08 Cary Coutant <ccoutant@google.com>
3326
3327 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3328 (lines_only_debug_sections): Likewise.
3329
2e702c99
RM
33302012-05-02 Roland McGrath <mcgrathr@google.com>
3331
3332 * nacl.cc: New file.
3333 * nacl.h: New file.
3334 * Makefile.am (CCFILES, HFILES): Add them.
3335 * Makefile.in: Regenerate.
3336 * i386.cc (Output_data_plt_i386_nacl): New class.
3337 (Output_data_plt_i386_nacl_exec): New class.
3338 (Output_data_plt_i386_nacl_dyn): New class.
3339 (Target_i386_nacl): New class.
3340 (Target_selector_i386_nacl): New class.
3341 (target_selector_i386): Use it instead of Target_selector_i386.
3342 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3343 (Target_x86_64_nacl): New class.
3344 (Target_selector_x86_64_nacl): New class.
3345 (target_selector_x86_64, target_selector_x32): Use it instead of
3346 Target_selector_x86_64.
3347 * arm.cc (Output_data_plt_arm_nacl): New class.
3348 (Target_arm_nacl): New class.
3349 (Target_selector_arm_nacl): New class.
3350 (target_selector_arm, target_selector_armbe): Use it instead of
3351 Target_selector_arm.
3352
3353 * target-select.cc (select_target): Take new Input_file* and off_t
3354 arguments, pass them on to recognize method of selector.
3355 * object.cc (make_elf_sized_object): Update caller.
3356 * parameters.cc (parameters_force_valid_target): Likewise.
3357 * incremental.cc (make_sized_incremental_binary): Likewise.
3358 * target-select.h: Update decl.
3359 (Target_selector::recognize): Take new Input_file* argument,
3360 pass it on to do_recognize.
3361 (Target_selector::do_recognize): Take new Input_file* argument.
3362 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3363 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3364 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3365 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3366
3367 * target.h (Target::Target_info): New members isolate_execinstr
3368 and rosegment_gap.
3369 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3370 * arm.cc (Target_arm::arm_info): Update initializer.
3371 * i386.cc (Target_i386::i386_info): Likewise.
3372 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3373 * sparc.cc (Target_sparc::sparc_info): Likewise.
3374 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3375 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3376 * layout.cc (Layout::attach_allocated_section_to_segment):
3377 Take new const Target* argument. If target->isolate_execinstr(), act
3378 like --rosegment.
3379 (Layout::find_first_load_seg): Take new const Target* argument;
3380 if target->isolate_execinstr(), reject PF_X segments.
3381 (Layout::relaxation_loop_body): Update caller.
3382 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3383 reset file offset to zero when we hit LOAD_SEG, and then do a second
3384 loop over the segments before LOAD_SEG to reassign offsets after
3385 addresses have been determined. Handle target->rosegment_gap().
3386 (Layout::attach_section_to_segment): Take new const Target* argument;
3387 pass it to attach_allocated_section_to_segment.
3388 (Layout::make_output_section): Update caller.
3389 (Layout::attach_sections_to_segments): Take new const Target* argument;
3390 pass it to attach_section_to_segment.
3391 * gold.cc (queue_middle_tasks): Update caller.
3392 * layout.h (Layout): Update method decls with new arguments.
3393
3394 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3395 Target_info pointer to use.
3396 (Target_arm::do_make_data_plt): New virtual method.
3397 (Target_arm::make_data_plt): New method that calls it.
3398 (Target_arm::make_plt_entry): Use it.
3399 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3400 for the section alignment.
3401 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3402 method.
3403 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3404 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3405 method.
3406 (Output_data_plt_arm::get_plt_entry_size): Call it.
3407 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3408 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3409 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3410 method.
3411 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3412 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3413 method instead of sizeof(plt_entry).
3414 (Output_data_plt_arm::add_entry): Likewise.
3415 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3416 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3417 than static method.
3418 (Target_arm::plt_entry_size): Likewise.
3419 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3420 Move to ...
3421 (Output_data_plt_arm_standard): ... here, new class.
3422 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3423 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3424 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3425
3426 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3427 Take additional argument for the PLT entry size.
3428 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3429 Use get_plt_entry_size method rather than plt_entry_size variable.
3430 (Output_data_plt_x86_64::reserve_slot): Likewise.
3431 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3432 (Output_data_plt_x86_64::add_entry): Likewise.
3433 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3434 (Output_data_plt_x86_64::address_for_global): Likewise.
3435 (Output_data_plt_x86_64::address_for_local): Likewise.
3436 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3437 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3438 Make method non-static.
3439 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3440 method.
3441 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3442 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3443 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3444 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3445 virtual method.
3446 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3447 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3448 virtual method.
3449 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3450 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3451 virtual method.
3452 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3453 (Output_data_plt_x86_64::plt_entry_size)
3454 (Output_data_plt_x86_64::first_plt_entry)
3455 (Output_data_plt_x86_64::plt_entry)
3456 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3457 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3458 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3459 (Output_data_plt_x86_64_standard): ... here, new class.
3460 (Target_x86_64::Target_x86_64): Take optional argument for the
3461 Target_info pointer to use.
3462 (Target_x86_64::do_make_data_plt): New virtual method.
3463 (Target_x86_64::make_data_plt): New method to call it.
3464 (Target_x86_64::init_got_plt_for_update): Use that.
3465 Call this->plt_->add_eh_frame method here.
3466 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3467 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3468 rather than static method.
3469 (Target_x86_64::plt_entry_size): Likewise.
3470 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3471 rather than plt_entry_size variable. Move guts of PLT filling to...
3472 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3473 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3474 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3475
3476 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3477 additional argument for the section alignment.
3478 Don't do add_eh_frame_for_plt here.
3479 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3480 non-static. Use get_plt_entry_size method rather than plt_entry_size
3481 variable.
3482 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3483 method.
3484 (Output_data_plt_i386::get_plt_entry_size): Call it.
3485 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3486 (Output_data_plt_i386::add_eh_frame): New method to call it.
3487 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3488 method.
3489 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3490 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3491 method.
3492 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3493 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3494 method instead of plt_entry_size.
3495 (Output_data_plt_i386::plt_entry_size)
3496 (Output_data_plt_i386::plt_eh_frame_fde_size)
3497 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3498 (Output_data_plt_i386_standard): ... here, new class.
3499 (Output_data_plt_i386_exec): New class.
3500 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3501 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3502 (Output_data_plt_i386::exec_plt_entry): Move to ...
3503 (Output_data_plt_i386_exec::plt_entry): ... here.
3504 (Output_data_plt_i386_dyn): New class.
3505 (Output_data_plt_i386::first_plt_entry): Move to ...
3506 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3507 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3508 (Output_data_plt_i386_dyn::plt_entry): ... here.
3509 (Target_i386::Target_i386): Take optional argument for the Target_info
3510 pointer to use.
3511 (Target_i386::do_make_data_plt): New virtual method.
3512 (Target_i386::make_data_plt): New method to call it.
3513 (Target_i386::make_plt_section): Use that.
3514 Call this->plt_->add_eh_frame method here.
3515 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3516 rather than plt_entry_size variable.
3517 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3518 (Output_data_plt_i386::address_for_local): Likewise.
3519 (Output_data_plt_i386::do_write): Likewise.
3520 Move guts of PLT filling to...
3521 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3522 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3523 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3524 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3525
b9b9f2ee
CC
35262012-05-01 Cary Coutant <ccoutant@google.com>
3527
3528 * dwarf_reader.cc (Dwarf_die::read_attributes)
3529 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3530 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3531 * reduced_debug_output.cc
3532 (Output_reduced_debug_info_section::get_die_end): Remove
3533 DW_FORM_GNU_ref_index. Add default case.
3534
57923f48
MW
35352012-04-26 Mark Wielaard <mjw@redhat.com>
3536
3537 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3538 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3539 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3540 DW_AT_high_pc as offset from DW_AT_low_pc.
3541
3542 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3543 * testsuite/Makefile.in: Regenerate.
3544 * testsuite/gdb_index_test_3.c: New test source file.
3545 * testsuite/gdb_index_test_3.sh: New test source file.
3546
2c54b4f4
ILT
35472012-04-25 Ian Lance Taylor <iant@google.com>
3548
3549 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3550 pointer.
3551 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3552 as a class, not a struct.
3553 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3554 (Target_arm::apply_cortex_a8_workaround): Likewise.
3555 * gc.h: Declare Reloc_types as a struct, not a class.
3556 * object.h: Declare Symbols_data as a struct.
3557 * reloc.h: Declare Read_relocs_data as a struct.
3558 * target.h: Declare Relocate_info as a struct.
3559
a5a5f7a3
DM
35602012-04-24 David S. Miller <davem@davemloft.net>
3561
3562 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3563 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3564 and R_SPARC_WPLT30.
3565
f038d496
CC
35662012-04-24 Cary Coutant <ccoutant@google.com>
3567
3568 * incremental-dump.cc (find_input_containing_global): Replace
3569 magic number with symbolic constant.
3570 (dump_incremental_inputs): Update version number.
3571 * incremental.cc (Output_section_incremental_inputs): Update version
3572 number; import symbolic constants from Incremental_inputs_reader.
3573 (Incremental_inputs::create_data_sections): Align relocations
3574 section correctly for 64-bit targets.
3575 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3576 constants; add padding.
3577 (Output_section_incremental_inputs::write_header): Add assert for
3578 header_size.
3579 (Output_section_incremental_inputs::write_input_files): Add assert
3580 for input_entry_size.
3581 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3582 add assert for object_info_size, input_section_entry_size,
3583 global_sym_entry_size.
3584 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3585 for data structure sizes; use them.
3586 (Incremental_input_entry_reader): Import symbolic constants from
3587 Incremental_inputs_reader; use them.
3588
a4d85145
DM
35892012-04-23 David S. Miller <davem@davemloft.net>
3590
3591 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3592 and elf_flags_set_.
3593 (Target_sparc::Target_sparc): Initialize new fields.
3594 (Target_sparc::do_make_elf_object): New function.
3595 (Target_sparc::do_adjust_elf_header): New function.
3596
1d509098
CC
35972012-04-23 Cary Coutant <ccoutant@google.com>
3598
3599 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3600 CU range table of gdb index.
3601
7ebeff7f
DM
36022012-04-20 David S. Miller <davem@davemloft.net>
3603
3604 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3605 instead of false.
3606
13cf9988
DM
36072012-04-16 David S. Miller <davem@davemloft.net>
3608
2a1079e8
DM
3609 * sparc.cc (Target_sparc::got_address): New function.
3610 (Sparc_relocate_functions::gdop_hix22): New function.
3611 (Sparc_relocate_functions::gdop_lox10): New function.
3612 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3613 relocs.
3614 (Target_sparc::Scan::local): Likewise if the global symbol is not
3615 preemptible and is not IFUNC.
3616 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3617 transformations for local and non-preemptible non-IFUNC global
3618 symbols.
3619
0bc964fc
DM
3620 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3621 writing out 64-bit part of ranges.
3622
661d7a80
DM
3623 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3624 -fpic and -fpie respectively.
3625 * Makefile.in: Regenerate.
3626
8c2bf391
DM
3627 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3628 (Target_sparc::Target_sparc): Initialize new field.
3629 (Target_sparc::do_plt_section_for_global): New function.
3630 (Target_sparc::do_plt_section_for_local): New function.
3631 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3632 (Target_sparc::make_plt_section): New function, broken out of
3633 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3634 (Target_sparc::make_plt_entry): Call make_plt_section.
3635 (Target_sparc::make_local_ifunc_plt_entry): New function.
3636 (Target_sparc::rela_ifunc_section): New function.
3637 (Target_sparc::plt_section): Remove const.
3638 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3639 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3640 and ifunc_count_ fields.
3641 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3642 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3643 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3644 (Output_data_plt_sparc::rela_ifunc): New function.
3645 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3646 (Output_data_plt_sparc::has_ifunc_section): New function.
3647 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3648 (Output_data_plt_sparc::address_for_global): New function.
3649 (Output_data_plt_sparc::address_for_local): New function.
3650 (Output_data_plt_sparc::plt_index_to_offset): New function.
3651 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3652 and entry_count.
3653 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3654 entry_count.
3655 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3656 R_SPARC_JMP_IREL to switch.
3657 (Target_sparc::Scan::check_non_pic): Likewise.
3658 (Target_sparc::Scan::local): Handle IFUNC symbols.
3659 (Target_sparc::Scan::local): Likewise.
3660 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3661 and plt_address_for_local.
3662 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3663 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3664
13cf9988
DM
3665 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3666 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3667 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3668 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3669 global relocs too.
3670 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3671 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3672 calls.
3673 * sparc.cc (Target_sparc::Scan::global): Likewise.
3674 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3675
31821be0
CC
36762012-04-16 Cary Coutant <ccoutant@google.com>
3677
3678 * archive.cc (Library_base::should_include_member): Check for
3679 --export-dynamic-symbol.
3680 * options.h (class General_options): Add --export-dynamic-symbol.
3681 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3682 --export-dynamic-symbol.
3683 (Symbol_table::gc_mark_undef_symbols): Likewise.
3684 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3685
2615994e
DM
36862012-04-12 David S. Miller <davem@davemloft.net>
3687
3688 * sparc.cc (Reloc::wdisp10): New relocation method.
3689 (Reloc::h34): Likewise.
3690 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3691 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3692 R_SPARC_WDISP10.
3693 (Target_sparc::Scan::local): Likewise.
3694 (Target_sparc::Scan::global): Likewise.
3695 (Target_sparc::Relocate::relocate): Likewise.
3696
6782735d
CC
36972012-04-09 Cary Coutant <ccoutant@google.com>
3698
3699 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3700 low_pc == 0.
3701
8c7a0b00
ILT
37022012-04-06 Ian Lance Taylor <iant@google.com>
3703
3704 * timer.cc: #include <unistd.h>.
3705
58797674
RM
37062012-04-06 Roland McGrath <mcgrathr@google.com>
3707
3708 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3709 * config.in: Regenerate.
3710 * configure: Regenerate.
3711
44350750
NC
37122012-04-05 Nick Clifton <nickc@redhat.com>
3713
3714 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3715 (AM_LC_MESSAGES): Add.
3716 * aclocal.m4: Regenerate.
3717 * config.in: Regenerate.
3718 * configure: Regenerate.
3719
c1027032
CC
37202012-03-21 Cary Coutant <ccoutant@google.com>
3721
3722 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3723 * Makefile.in: Regenerate.
3724 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3725 (Sized_elf_reloc_mapper::symbol_section): New function.
3726 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3727 (make_elf_reloc_mapper): New function.
3728 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3729 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3730 (Dwarf_abbrev_table::do_get_abbrev): New function.
3731 (Dwarf_ranges_table::read_ranges_table): New function.
3732 (Dwarf_ranges_table::read_range_list): New function.
3733 (Dwarf_pubnames_table::read_section): New function.
3734 (Dwarf_pubnames_table::read_header): New function.
3735 (Dwarf_pubnames_table::next_name): New function.
3736 (Dwarf_die::Dwarf_die): New function.
3737 (Dwarf_die::read_attributes): New function.
3738 (Dwarf_die::skip_attributes): New function.
3739 (Dwarf_die::set_name): New function.
3740 (Dwarf_die::set_linkage_name): New function.
3741 (Dwarf_die::attribute): New function.
3742 (Dwarf_die::string_attribute): New function.
3743 (Dwarf_die::int_attribute): New function.
3744 (Dwarf_die::uint_attribute): New function.
3745 (Dwarf_die::ref_attribute): New function.
3746 (Dwarf_die::child_offset): New function.
3747 (Dwarf_die::sibling_offset): New function.
3748 (Dwarf_info_reader::check_buffer): New function.
3749 (Dwarf_info_reader::parse): New function.
3750 (Dwarf_info_reader::do_parse): New function.
3751 (Dwarf_info_reader::do_read_string_table): New function.
3752 (Dwarf_info_reader::lookup_reloc): New function.
3753 (Dwarf_info_reader::get_string): New function.
3754 (Dwarf_info_reader::visit_compilation_unit): New function.
3755 (Dwarf_info_reader::visit_type_unit): New function.
3756 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3757 Sized_elf_reloc_mapper.
3758 (Sized_dwarf_line_info::symbol_section): Remove function.
3759 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3760 (Sized_dwarf_line_info::read_line_mappings): Remove object
3761 parameter, adjust callers.
3762 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3763 * dwarf_reader.h: Include <sys/types.h>.
3764 (class Track_relocs): Remove forward declaration.
3765 (class Elf_reloc_mapper): New class.
3766 (class Sized_elf_reloc_mapper): New class.
3767 (class Dwarf_abbrev_table): New class.
3768 (class Dwarf_range_list): New class.
3769 (class Dwarf_ranges_table): New class.
3770 (class Dwarf_pubnames_table): New class.
3771 (class Dwarf_die): New class.
3772 (class Dwarf_info_reader): New class.
3773 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3774 (Sized_dwarf_line_info::symbol_section): Remove member function.
3775 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3776 base class.
3777 * gdb-index.cc: New source file.
3778 * gdb-index.h: New source file.
3779 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3780 and .debug_types sections, call Layout::add_to_gdb_index.
3781 (Sized_relobj_incr::do_section_name): Implement.
3782 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3783 return type; Implement.
3784 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3785 return type.
3786 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3787 parameter list and return type.
3788 (Sized_incr_dynobj::do_section_contents): Likewise.
3789 * layout.cc: Include gdb-index.h.
3790 (Layout::Layout): Initialize gdb_index_data_.
3791 (Layout::init_fixed_output_section): Check for .gdb_index section.
3792 (Layout::add_to_gdb_index): New function. Instantiate.
3793 * layout.h: Add forward declaration for class Gdb_index.
3794 (Layout::add_to_gdb_index): New member function.
3795 (Layout::gdb_index_data_): New data member.
3796 * main.cc: Include gdb-index.h.
3797 (main): Print statistics for gdb index.
3798 * object.cc (Object::section_contents): Move code into
3799 do_section_contents.
3800 (need_decompressed_section): Check for sections needed when building
3801 gdb index.
3802 (build_compressed_section_map): Likewise.
3803 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3804 gdb index.
3805 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3806 sections; call Layout::add_to_gdb_index.
3807 (Sized_relobj_file::do_decompressed_section_contents): Call
3808 do_section_contents directly.
3809 * object.h (Object::do_section_contents): Adjust parameter list and
3810 return type.
3811 (Object::do_decompressed_section_contents): Call do_section_contents
3812 directly.
3813 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3814 return type.
3815 * options.h (class General_options): Add --gdb-index option.
3816 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3817 list and return type.
3818 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3819 * reloc.h (Track_relocs::checkpoint): New function.
3820 (Track_relocs::reset): New function.
3821
3822 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3823 New test cases.
3824 * testsuite/Makefile.in: Regenerate.
3825 * testsuite/gdb_index_test.cc: New test source file.
3826 * testsuite/gdb_index_test_1.sh: New test source file.
3827 * testsuite/gdb_index_test_2.sh: New test source file.
3828
647f1574
DK
38292012-03-19 Doug Kwan <dougkwan@google.com>
3830
3831 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3832 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3833 __exidx_start and __exidx_end. Make symbol table parameter
3834 anonymous as it is not used.
3835 * gold.cc (queue_middle_tasks): Call target hook to define any
3836 target-specific symbols.
3837 * target.h (Target::define_standard_symbols): New method.
3838 (Target::do_define_standard_symbols): Same.
3839 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3840 * testsuite/Makefile.in: Regenerate.
3841 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3842 and __exidx_end.
3843 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3844 relocations are generated for __exidx_start and __exidx_end.
3845
7c6109da
DK
38462012-03-16 Doug Kwan <dougkwan@google.com>
3847
3848 * testsuite/Makefile.am: Disable test initpri3b.
3849 * testsuite/Makefile.in: Regenerate.
3850
7b8957f8
DK
38512012-03-15 Doug Kwan <dougkwan@google.com>
3852
3853 * arm.cc (Target_arm::got_section): Make .got section read-only
3854 if -z now is given.
3855
14dc9ef7
ILT
38562012-03-15 Ian Lance Taylor <iant@google.com>
3857
3858 PR gold/13850
3859 * layout.cc (Layout::make_output_section): Correctly mark
3860 SHT_INIT_ARRAY, et. al., as relro.
3861
fa40b62a
DK
38622012-03-14 Doug Kwan <dougkwan@google.com>
3863
3864 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3865 dynamic relocations for protected symbols in shared objects.
3866
fd325007
ILT
38672012-03-13 Ian Lance Taylor <iant@google.com>
3868
3869 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3870 keep the larger alignment.
3871
e8dd54e1
CC
38722012-03-12 Cary Coutant <ccoutant@google.com>
3873
3874 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3875 handling of DW_LNE_define_file.
3876
feb5f3b0
CC
38772012-03-12 Cary Coutant <ccoutant@google.com>
3878
3879 * reduced_debug_output.cc
3880 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3881 codes to switch.
3882
a1fb4256
CC
38832012-02-29 Cary Coutant <ccoutant@google.com>
3884
3885 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3886
5dd8762a
CC
38872012-02-29 Cary Coutant <ccoutant@google.com>
3888
3889 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3890 Call Object::decompressed_section_contents.
3891 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3892 New dtor.
3893 (Sized_dwarf_line_info::buffer_start_): New data member.
3894 * merge.cc (Output_merge_data::do_add_input_section): Call
3895 Object::decompressed_section_contents.
3896 (Output_merge_string::do_add_input_section): Likewise.
3897 * object.cc (need_decompressed_section): New function.
3898 (build_compressed_section_map): Decompress sections needed later.
3899 (Sized_relobj_file::do_decompressed_section_contents): New function.
3900 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3901 * object.h (Object::decompressed_section_contents): New function.
3902 (Object::discard_decompressed_sections): New function.
3903 (Object::do_decompressed_section_contents): New function.
3904 (Object::do_discard_decompressed_sections): New function.
3905 (Compressed_section_info): New type.
3906 (Compressed_section_map): Include decompressed section contents.
3907 (Sized_relobj_file::do_decompressed_section_contents): New function.
3908 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3909
7b5de7ee
CC
39102012-02-16 Cary Coutant <ccoutant@google.com>
3911
3912 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3913 * testsuite/Makefile.in: Regenerate.
3914
f9fa4a63
CC
39152012-02-14 Cary Coutant <ccoutant@google.com>
3916
3917 * options.cc (General_options::finalize): Disallow -pie and -static.
3918
2c175ebc
DK
39192012-02-03 Doug Kwan <dougkwan@google.com>
3920
3921 * arm.cc (Arm_relocate_functions::abs8,
3922 Arm_relocate_functions::abs16): Use
3923 Bits::has_signed_unsigned_overflow32.
3924 (Arm_relocate_functions::thm_abs8): Correct range of
3925 overflow check.
3926 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3927 in assertions.
3928
90cff06f
DK
39292012-02-02 Doug Kwan <dougkwan@google.com>
3930
3931 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3932 position independent outputs, not just shared objects.
3933
63887f3d
L
39342012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3935
3936 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3937 * configure: Regenerated.
3938
bef2b434
ILT
39392012-01-27 Ian Lance Taylor <iant@google.com>
3940
3941 * reloc.h (Bits): New class with static functions, copied from
3942 namespace utils in arm.cc.
3943 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3944 instead.
3945
c335b55d
L
39462012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3947
3948 * incremental.cc (write_info_blocks): Correct relocation offset.
3949
41194d9f
L
39502012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3951
3952 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3953 (Relocate::tls_gd_to_le): Likewise.
3954
1bae613c
L
39552012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3956
3957 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3958
24482ca0
L
39592012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3960
3961 * configure.ac: Check if -mcmodel=medium works.
3962 * configure: Regenerated.
3963
c2c7840a
CC
39642012-01-24 Cary Coutant <ccoutant@google.com>
3965
3966 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3967 definition and ...
3968 (read_unsigned_LEB_128_x): ... this new function.
3969 (read_signed_LEB_128): Replaced with inline definition and ...
3970 (read_signed_LEB_128_x): ... this new function.
3971 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3972 (read_unsigned_LEB_128): Add inline definition.
3973 (read_signed_LEB_128_x): New function.
3974 (read_signed_LEB_128): Add inline definition.
3975 * testsuite/Makefile.am (leb128_unittest): New unit test.
3976 * testsuite/Makefile.in: Regenerate.
3977 * testsuite/leb128_unittest.cc: New unit test.
3978
833de760 39792012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3980
3981 PR gold/13617
3982 * i386.cc (Target_i386::do_code_fill): When using a jmp
3983 instruction, pad with nop instructions.
3984 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3985
618d6666
L
39862012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3987
3988 * x86_64.cc (gc_process_relocs): Add typename on types used in
3989 template.
3990 (scan_relocs): Likewise.
3991 (relocate_section): Likewise.
3992 (apply_relocation): Likewise.
3993
3660ff06
L
39942012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3995
3996 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3997 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3998 under x32.
3999
fc51264f
L
40002012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4001
4002 * x86_64.cc: Initial support for x32.
4003
dd74ae06
CC
40042012-01-03 Cary Coutant <ccoutant@google.com>
4005
4006 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4007 Use abstract base class for GOT.
4008 * gold/output.h (class Output_data_got_base): New abstract base class.
4009 (class Output_data_got): Derive from new base class, adjust ctors.
4010 (Output_data_got::reserve_slot): Make virtual; rename to
4011 do_reserve_slot; Adjust callers.
4012 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4013 pointer to abstract base class.
4014 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4015
83896202
ILT
40162011-12-18 Ian Lance Taylor <iant@google.com>
4017
4018 * object.h (Relobj::local_symbol_value): New function.
4019 (Relobj::local_plt_offset): New function.
4020 (Relobj::local_has_got_offset): New function.
4021 (Relobj::local_got_offset): New function.
4022 (Relobj::set_local_got_offset): New function.
4023 (Relobj::do_local_symbol_value): New pure virtual function.
4024 (Relobj::do_local_plt_offset): Likewise.
4025 (Relobj::do_local_has_got_offset): Likewise.
4026 (Relobj::do_local_got_offset): Likewise.
4027 (Relobj::do_set_local_got_offset): Likewise.
4028 (Sized_relobj::do_local_has_got_offset): Rename from
4029 local_has_got_offset.
4030 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4031 (Sized_relobj::do_set_local_got_offset): Rename from
4032 set_local_got_offset.
4033 (Sized_relobj_file::do_local_plt_offset): Rename from
4034 local_plt_offset.
4035 (Sized_relobj_file::do_local_symbol_value): New function.
4036 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4037 local_plt_offset.
4038 * output.cc (Output_data_got::Got_entry::write): Change object to
4039 Relobj. Use local_symbol_value.
4040 (Output_data_got::add_global_with_rel): Change rel_dyn to
4041 Output_data_reloc_generic*. Use add_global_generic.
4042 (Output_data_got::add_global_with_rela): Remove. Change all
4043 callers to use add_global_with_rel.
4044 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4045 Output_data_reloc_generic*. Use add_global_generic.
4046 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4047 callers to use add_global_pair_with_rel.
4048 (Output_data_got::add_local): Change object to Relobj*.
4049 (Output_data_got::add_local_plt): Likewise.
4050 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4051 change rel_dyn to Output_data_reloc_generic*. Use
4052 add_local_generic.
4053 (Output_data_got::add_local_with_rela): Remove. Change all
4054 callers to use all_local_with_rel.
4055 (Output_data_got::add_local_pair_with_rel): Change object to
4056 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4057 add_output_section_generic.
4058 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4059 callers to use add_local_pair_with_rel.
4060 (Output_data_got::reserve_local): Change object to Relobj*.
4061 * output.h: (class Output_data_reloc_generic): Add pure virtual
4062 declarations for add_global_generic, add_local_generic,
4063 add_output_section_generic.
4064 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4065 functions for Output_data_reloc_generic. Update declarations for
4066 changes listed in output.cc.
4067 (class Output_data_got): Change template parameter to got_size.
4068 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4069 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4070 function.
4071 (Sized_relobj_incr::do_local_plt_offset): New function.
4072 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4073 add_global_generic.
4074
76677ad0
CC
40752011-12-17 Cary Coutant <ccoutant@google.com>
4076
4077 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4078 * resolve.cc (Symbol_table::resolve): Likewise.
4079 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4080 arrays.
4081 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4082
8b8dd8d5
ILT
40832011-12-16 Ian Lance Taylor <iant@google.com>
4084
4085 * output.h (Output_data_reloc_generic::add): Only call
4086 add_dynamic_reloc if this is a dynamic reloc section.
4087
d55525b9
L
40882011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4089
4090 PR gold/13505
4091 * target-reloc.h (apply_relocation): Replace <64, false> with
4092 <size, big_endian>.
4093
ff81c7c1
NC
40942011-11-25 Nick Clifton <nickc@redhat.com>
4095
4096 * po/it.po: New Italian translation.
4097
628f39be
SA
40982011-11-17 Sterling Augustine <saugustine@google.com>
4099
4100 * script.cc (script_include_directive): Implement.
4101 (read_script_file): New local variables name and search_path. Update
4102 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4103 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4104 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4105
98ef3ea4
SA
41062011-11-11 Sterling Augustine <saugustine@google.com>
4107
4108 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4109 (file_or_sections_cmd): Likewise.
4110
f4a8b6d7
DK
41112011-11-11 Doug Kwan <dougkwan@google.com>
4112
4113 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4114 if --just-symbols is given.
4115
29ab395d
DK
41162011-11-10 Doug Kwan <dougkwan@google.com>
4117
4118 PR gold/13362
4119 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4120 when processing data relocs.
4121 * reloc.h (Relocate_functions::rel_unaligned): New method.
4122 (Relocate_functions::pcrel_unaligned): Ditto.
4123 (Relocate_functions::rel32_unaligned): Ditto.
4124 (Relocate_functions::pcrel32_unaligned): Ditto.
4125
2c339f71
DK
41262011-11-09 Doug Kwan <dougkwan@google.com>
4127
4128 PR gold/13362
4129 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4130 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4131 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4132 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4133 (Relocate_functions::rel_unaligned): New.
4134 (Relocate_functions::rel32_unaligned): New.
4135 * target-reloc.h (relocate_for_relocatable): Add code to handle
4136 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4137 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4138 arm_unaligned_reloc_r): New targets.
4139 * testsuite/Makefile.in: Regenerate.
4140 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4141 linking.
4142
3f3cddf1
ILT
41432011-11-02 Ian Lance Taylor <iant@google.com>
4144
4145 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4146 NATIVE_LINKER.
4147 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4148 * options.cc (General_options::finalize): Use library search path
4149 from configure script if specified. If not native and no sysroot,
4150 only search TOOLLIBDIR.
4151 * options.h (Search_directory::Search_directory): Change name to
4152 const std::string&.
4153 (General_options::add_to_library_path_with_sysroot): Change arg to
4154 const std::string&.
4155 * configure, Makefile.in, config.in: Rebuild.
4156
a8e2273b
ILT
41572011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4158
4159 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4160 we are working around the ARM1176 Erratum.
4161 * options.h (General_options::fix_arm1176): Add option.
4162 * testsuite/Makefile.am: Add testcases, and keep current ones
4163 working.
4164 * testsuite/Makefile.in: Regenerate.
4165 * testsuite/arm_fix_1176.s: New file.
4166 * testsuite/arm_fix_1176.sh: Likewise.
4167
cd6eab1c
ILT
41682011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4169
4170 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4171 may_use_blx_.
4172 (Target_arm::may_use_blx): Remove method.
4173 (Target_arm::set_may_use_blx): Likewise.
4174 (Target_arm::may_use_v4t_interworking): New method.
4175 (Target_arm::may_use_v5t_interworking): Likewise.
4176 (Target_arm::may_use_blx_): Remove member variable.
4177 (Arm_relocate_functions::arm_branch_common): Check for v5T
4178 interworking.
4179 (Arm_relocate_functions::thumb_branch_common): Likewise.
4180 (Reloc_stub::stub_type_for_reloc): Likewise.
4181 (Target_arm::do_finalize_sections): Correct interworking checks.
4182 * testsuite/Makefile.am: Add new tests.
4183 * testsuite/Makefile.in: Regenerate.
4184 * testsuite/arm_farcall_arm_arm.s: New test.
4185 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4186 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4187 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4188 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4189 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4190 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4191 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4192
286adcf4
CC
41932011-10-31 Cary Coutant <ccoutant@google.com>
4194
4195 PR gold/13023
4196 * expression.cc (Expression::eval_with_dot): Add
4197 is_section_dot_assignment parameter.
4198 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4199 absolute and assigning to dot within a section.
4200 * script-sections.cc
4201 (Output_section_element_assignment::set_section_addresses): Pass
4202 dot_section to set_if_absolute.
4203 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4204 as is_section_dot_assignment flag to eval_with_dot.
4205 (Output_section_element_dot_assignment::set_section_addresses):
4206 Likewise.
4207 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4208 parameter. Also set value if relative to dot_section; set the
4209 symbol's output_section.
4210 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4211 parameter. Adjust all callers.
4212 (Expression::eval_maybe_dot): Likewise.
4213 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4214 Adjust all callers.
4215 * testsuite/script_test_2.t: Test assignment of an absolute value
4216 to dot within an output section element.
4217
9634ed06
CC
42182011-10-31 Cary Coutant <ccoutant@google.com>
4219
4220 * options.h (class General_options): Add --[no-]gnu-unique options.
4221 * symtab.cc (Symbol_table::sized_write_globals): Convert
4222 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4223
de4101c7
CC
42242011-10-31 Cary Coutant <ccoutant@google.com>
4225
4226 PR gold/13359
4227 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4228 unnecessary assertion.
4229 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4230
7257cc92
ST
42312011-10-31 Sriraman Tallam <tmsriram@google.com>
4232
4233 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4234 gc_mark_symbol.
4235 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4236 gc_mark_symbol.
4237 Change to just keep the section associated with symbol.
4238 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4239 they are externally visible and --export-dynamic is turned on.
4240 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4241
bfc34b3f
ILT
42422011-10-19 Ian Lance Taylor <iant@google.com>
4243
4244 PR gold/13163
4245 * script-sections.cc
4246 (Output_section_element_dot_assignment::needs_output_section): New
4247 function.
4248
ea0d8c47
ILT
42492011-10-19 Ian Lance Taylor <iant@google.com>
4250
4251 PR gold/13204
4252 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4253 --section-start option was seen.
4254 * options.h (General_options::any_section_start): New function.
4255
abd242a9
DM
42562011-10-18 David S. Miller <davem@davemloft.net>
4257
4258 PR binutils/13301
4259 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4260 member to track relocation locations that have moved during TLS
4261 reloc optimizations.
4262 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4263 (Target_sparc::Relocate::relocate): Adjust view down by 4
4264 bytes if it matches reloc_adjust_addr_.
4265 (Target_sparc::Relocate::relocate_tls): Always move the
4266 __tls_get_addr call delay slot instruction forward 4 bytes when
4267 performing relaxation.
4268
bab9090f
CC
42692011-10-18 Cary Coutant <ccoutant@google.com>
4270
4271 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4272 (Output_file::map_no_anonymous): Check for non-zero
4273 return code from posix_fallocate.
4274
f7c5b166
CC
42752011-10-17 Cary Coutant <ccoutant@google.com>
4276
4277 PR gold/13245
4278 * plugin.cc (is_visible_from_outside): Check for symbols
4279 referenced from dynamic objects.
4280 * resolve.cc (Symbol_table::resolve): Don't count references
4281 from dynamic objects as references from real ELF files.
4282 * testsuite/plugin_test_2.sh: Adjust expected result.
4283
b490c0bb
CC
42842011-10-17 Cary Coutant <ccoutant@google.com>
4285
4286 * gold.cc: Include timer.h.
4287 (queue_middle_tasks): Stamp time.
4288 (queue_final_tasks): Likewise.
4289 * main.cc (main): Store timer in parameters. Print timers
4290 for each pass.
4291 * parameters.cc (Parameters::Parameters): Initialize timer_.
4292 (Parameters::set_timer): New function.
4293 (set_parameters_timer): New function.
4294 * parameters.h (Parameters::set_timer): New function.
4295 (Parameters::timer): New function.
4296 (Parameters::timer_): New data member.
4297 (set_parameters_timer): New function.
4298 * timer.cc (Timer::stamp): New function.
4299 (Timer::get_pass_time): New function.
4300 * timer.h (Timer::stamp): New function.
4301 (Timer::get_pass_time): New function.
4302 (Timer::pass_times_): New data member.
4303
f475cf7b
CC
43042011-10-17 Cary Coutant <ccoutant@google.com>
4305
4306 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4307 task for members of lib groups.
4308
cdd7e244
CC
43092011-10-17 Cary Coutant <ccoutant@google.com>
4310
4311 PR gold/13288
4f95c8b4 4312 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4313 (File_read::make_view): Move bounds check (replace with assert)...
4314 (File_read::find_or_make_view): ... to here.
4315
dfb45471
CC
43162011-10-12 Cary Coutant <ccoutant@google.com>
4317
4f95c8b4 4318 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4319 ::read returns less than requested size.
4320
53bbcc1b
CC
43212011-10-10 Cary Coutant <ccoutant@google.com>
4322
4f95c8b4 4323 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4324 Initialize defined_count_.
4325 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4326 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4327 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4328 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4329 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4330 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4331 member.
4332 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4333 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4334 Return zeroes instead of internal error.
4335
397b129b
CC
43362011-10-10 Cary Coutant <ccoutant@google.com>
4337
4338 PR gold/13249
4f95c8b4 4339 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4340 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4341 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4342 (Output_reloc::type_): Adjust size of bit field.
4343 (Output_reloc::use_plt_offset_): New bit field.
4344 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4345 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4346 flag. Adjust all callers.
4f95c8b4 4347 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4348 creating RELATIVE relocations.
4349
d5698657
NC
43502011-10-10 Nick Clifton <nickc@redhat.com>
4351
4352 * po/es.po: Updated Spanish translation.
4353 * po/fi.po: Updated Finnish translation.
4354
6a59a5c2
DN
43552011-10-03 Diego Novillo <dnovillo@google.com>
4356
4357 * options.cc (parse_uint): Fix dereference of RETVAL.
4358
f0558624
ST
43592011-09-29 Sriraman Tallam <tmsriram@google.com>
4360
4361 * layout.h (section_order_map_): New member.
4362 (get_section_order_map): New member function.
4363 * output.cc (Output_section::add_input_section): Check for patterns
4364 only when --section-ordering-file is specified.
4365 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4366 output_sections have been formed.
4367 * layout.cc (Layout_Layout): Initialize section_order_map_.
4368 * plugin.cc (update_section_order): Store order in order_map. Do not
4369 update the order.
4370 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4371 * testsuite/Makefile.in: Regenerate.
4372 * testsuite/plugin_section_order.c: New file.
4373 * testsuite/plugin_final_layout.cc: New file.
4374 * testsuite/plugin_final_layout.sh: New file.
4375
a7dac153
CC
43762011-09-29 Cary Coutant <ccoutant@google.com>
4377
4f95c8b4 4378 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4379 Check for NULL.
4f95c8b4 4380 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4381 symbols during incremental update.
4382 (Symbol_table::add_from_dynobj): Likewise.
4383
eebd87a5
ILT
43842011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4385 Ian Lance Taylor <iant@google.com>
4386
4387 * symtab.cc (Symbol_table::define_special_symbol): Always
4388 canonicalize version string.
4389
403a3331
CC
43902011-09-26 Cary Coutant <ccoutant@google.com>
4391
4f95c8b4
CC
4392 * gold.cc (queue_initial_tasks): Move option checks ...
4393 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4394 some options; make others fatal.
4395
235061c2
CC
43962011-09-26 Cary Coutant <ccoutant@google.com>
4397
4398 gcc PR lto/47247
4399 * plugin.cc (get_symbols_v2): New function.
4400 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4401 (is_referenced_from_outside): New function.
4402 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4403 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4404 (get_symbols): Pass version parameter.
4405 (get_symbols_v2): New function.
4406 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4407 parameter.
4408 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4409 (onload): Add LDPT_GET_SYMBOLS_V2.
4410 (all_symbols_read_hook): Use get_symbols_v2; check for
4411 LDPR_PREVAILING_DEF_IRONLY_EXP.
4412 * testsuite/plugin_test_3.sh: Update expected results.
4413
dc87f620
ILT
44142011-09-23 Simon Baldwin <simonb@google.com>
4415
4416 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4417 configuration options.
4418 * configure: Regenerate.
4419 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4420 * Makefile.in: Regenerate.
4421 * testsuite/Makefile.in: Regenerate.
4422
a8279f82
ST
44232011-09-19 Sriraman Tallam <tmsriram@google.com>
4424
4425 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4426
0c9350c8
CC
44272011-09-19 Cary Coutant <ccoutant@google.com>
4428
4429 * incremental.cc (can_incremental_update): Fix typo in comment.
4430 * incremental.h (can_incremental_update): Likewise.
4431
aa06ae28
CC
44322011-09-18 Cary Coutant <ccoutant@google.com>
4433
4434 * incremental.cc (can_incremental_update): New function.
4435 * incremental.h (can_incremental_update): New function.
4436 * layout.cc (Layout::init_fixed_output_section): Call it.
4437 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4438 * object.cc (Sized_relobj_file::do_layout): Call
4439 can_incremental_update.
4440
ebb300b2
CC
44412011-09-13 Cary Coutant <ccoutant@google.com>
4442
4443 * configure.ac: Check for glibc support for gnu_indirect_function
4444 support with static linking, setting automake conditional
4445 IFUNC_STATIC.
4446 * Makefile.in: Regenerate.
4447 * configure: Regenerate.
4448
4449 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4450 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4451 for IFUNC_STATIC.
4452 * testsuite/Makefile.in: Regenerate.
4453
1206d0d5
CC
44542011-09-13 Cary Coutant <ccoutant@google.com>
4455
4456 * incremental.cc (Sized_relobj_incr::do_layout): Call
4457 report_comdat_group for kept comdat sections.
4458 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4459 * testsuite/Makefile.in: Regenerate.
4460 * testsuite/incr_comdat_test_1.cc: New source file.
4461 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4462 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4463 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4464
40b29874
ILT
44652011-09-13 Ian Lance Taylor <iant@google.com>
4466
4467 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4468 variable external_symbols_offset.
4469
1b045aac
ILT
44702011-09-12 Ian Lance Taylor <iant@google.com>
4471
4472 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4473 triggered if object has no symbols.
4474
24c6c55a
DM
44752011-09-09 David S. Miller <davem@davemloft.net>
4476
4477 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4478 (Output_fill_debug_line::do_write): Likewise.
4479
66570254
CC
44802011-08-29 Cary Coutant <ccoutant@google.com>
4481
4482 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4483 casts to match formatting specs.
4484 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4485
8ea8cd50
CC
44862011-08-26 Cary Coutant <ccoutant@google.com>
4487
4488 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4489 remaining hole size when allocating.
4490 (Layout::make_output_section): Set fill methods for debug sections.
4491 * layout.h (Free_list::Free_list_node): Move from private to
4492 public.
4493 (Free_list::set_min_hole_size): New function.
4494 (Free_list::begin, Free_list::end): New functions.
4495 (Free_list::min_hole_): New data member.
4496 * output.cc: Include dwarf.h.
4497 (Output_fill_debug_info::do_minimum_hole_size): New function.
4498 (Output_fill_debug_info::do_write): New function.
4499 (Output_fill_debug_line::do_minimum_hole_size): New function.
4500 (Output_fill_debug_line::do_write): New function.
4501 (Output_section::Output_section): Initialize new data member.
4502 (Output_section::set_final_data_size): Ensure patch space is larger
4503 than minimum hole size.
4504 (Output_section::do_write): Fill holes in debug sections.
4505 * output.h (Output_fill): New class.
4506 (Output_fill_debug_info): New class.
4507 (Output_fill_debug_line): New class.
4508 (Output_section::set_free_space_fill): New function.
4509 (Output_section::free_space_fill_): New data member.
4510 * testsuite/Makefile.am (incremental_test_3): Add
4511 --incremental-patch option.
4512 (incremental_test_4): Likewise.
4513 (incremental_test_5): Likewise.
4514 (incremental_test_6): Likewise.
4515 (incremental_copy_test): Likewise.
4516 (incremental_common_test_1): Likewise.
4517 * testsuite/Makefile.in: Regenerate.
4518
7cf80422
NC
45192011-08-26 Nick Clifton <nickc@redhat.com>
4520
4521 * po/es.po: Updated Spanish translation.
4522
c3f7b0e5
CC
45232011-08-01 Cary Coutant <ccoutant@google.com>
4524
4525 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4526 * gold/testsuite/Makefile.in: Regenerate.
4527 * gold/testsuite/justsyms_exec.c: New source file.
4528 * gold/testsuite/justsyms_lib.c: New source file.
4529
9590bf25
CC
45302011-08-01 Cary Coutant <ccoutant@google.com>
4531
4532 * layout.cc (Layout::set_segment_offsets): Don't realign text
4533 segment if -Ttext was specified.
4534 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4535 file type.
4536 * object.h (Sized_relobj_file::e_type): New function.
4537 (Sized_relobj_file::e_type_): New data member.
4538 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4539 base address for ET_EXEC files.
4540 * target.cc (Target::do_make_elf_object_implementation): Allow
4541 ET_EXEC files with --just-symbols option.
4542
dcd8d12e
CC
45432011-07-28 Cary Coutant <ccoutant@google.com>
4544
4545 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4546 Add thread_number parameter.
4547 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4548 * workqueue-threads.cc
4549 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4550 current thread if its thread number is greater than desired thread
4551 count.
4552 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4553 Add thread_number parameter.
4554 (Workqueue::should_cancel_thread): Likewise.
4555 (Workqueue::find_runnable_or_wait): Pass thread_number to
4556 should_cancel_thread.
4557 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4558 parameter.
4559
804eb480
ST
45602011-07-22 Sriraman Tallam <tmsriram@google.com>
4561
4562 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4563 only after checking if it cannot be forced local.
4564 * symtab.h (is_externally_visible): Check if the symbol is not forced
4565 local.
4566
f1ddb600
ILT
45672011-07-15 Ian Lance Taylor <iant@google.com>
4568
4569 * options.h (class General_options): Add --print-output-format.
4570 Move -EL next to -EB, for better --help output.
4571 * target-select.cc: Include <cstdio>, "options.h", and
4572 "parameters.h".
4573 (Target_selector::do_target_bfd_name): New function.
4574 (print_output_format): New function.
4575 * target-select.h (class Target_selector): Update declarations.
4576 (Target_selector::target_bfd_name): New function.
4577 (print_output_format): Declare.
4578 * main.cc: Include "target-select.h".
4579 (main): Handle --print-output-format.
4580 * gold.cc: Include "target-select.h".
4581 (queue_initial_tasks): Handle --print-output-format when there are
4582 no input files.
4583 * parameters.cc (parameters_force_valid_target): Give a better
4584 error message if -EB/-EL does not match target.
4585 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4586 function.
4587
7d172687
ILT
45882011-07-15 Ian Lance Taylor <iant@google.com>
4589
4590 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4591 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4592 (Output_data_plt_i386::do_write): Write address of .dynamic
4593 section to first entry in .got.plt section.
4594 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4595 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4596 Initialize layout_.
4597 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4598 section to first entry in .got.plt section.
4599 * layout.h (Layout::dynamic_section): New function.
4600
e9552f7e
ST
46012011-07-13 Sriraman Tallam <tmsriram@google.com>
4602
4603 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4604 to claim_file call.
4605 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4606 input_section_position_, and input_section_glob_.
4607 (read_layout_from_file): Call function section_ordering_specified.
4608 * layout.h (is_section_ordering_specified): New function.
4609 (section_ordering_specified): New function.
4610 (section_ordering_specified_): New boolean member.
4611 * main.cc(main): Call load_plugins after layout object is defined.
4612 * output.cc (Output_section::add_input_section): Use
4613 function section_ordering_specified to check if section ordering is
4614 needed.
4615 * output.cc (Output_section::add_relaxed_input_section): Use
4616 function section_ordering_specified to check if section ordering is
4617 needed.
4618 (Output_section::update_section_layout): New function.
4619 (Output_section::sort_attached_input_sections): Check if input section
4620 must be reordered.
4621 * output.h (Output_section::update_section_layout): New function.
4622 * plugin.cc (get_section_count): New function.
4623 (get_section_type): New function.
4624 (get_section_name): New function.
4625 (get_section_contents): New function.
4626 (update_section_order): New function.
58797674 4627 (allow_section_ordering): New function.
e9552f7e
ST
4628 (Plugin::load): Add the new interfaces to the transfer vector.
4629 (Plugin_manager::load_plugins): New parameter.
4630 (Plugin_manager::all_symbols_read): New parameter.
4631 (Plugin_manager::claim_file): New parameter. Save the elf object for
4632 unclaimed objects.
4633 (Plugin_manager::get_elf_object): New function.
4634 (Plugin_manager::get_view): Change to directly use the bool to check
4635 if get_view is called from claim_file_hook.
4636 * plugin.h (input_objects): New function
4637 (Plugin__manager::load_plugins): New parameter.
4638 (Plugin_manager::claim_file): New parameter.
4639 (Plugin_manager::get_elf_object): New function.
4640 (Plugin_manager::in_claim_file_handler): New function.
4641 (Plugin_manager::in_claim_file_handler_): New member.
4642 (layout): New function.
4643 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4644 handler with an extra parameter. Make the elf object before calling
4645 claim_file handler.
4646 * testsuite/plugin_test.c (get_section_count): New function pointer.
4647 (get_section_type): New function pointer.
4648 (get_section_name): New function pointer.
4649 (get_section_contents): New function pointer.
4650 (update_section_order): New function pointer.
4651 (allow_section_ordering): New function pointer.
4652 (onload): Check if the new interfaces exist.
4653
9446efde
ILT
46542011-07-13 Ian Lance Taylor <iant@google.com>
4655
4656 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4657 relro section.
4658 * x86_64.cc (Target_x86_64::got_section): Likewise.
4659 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4660 (relro_now_test_SOURCES): New variable.
4661 (relro_now_test_DEPENDENCIES): New variable.
4662 (relro_now_test_LDFLAGS): New variable.
4663 (relro_now_test_LDADD): New variable.
4664 (relro_now_test.so): New target.
4665 * testsuite/Makefile.in: Rebuild.
4666
07aa62f2
ILT
46672011-07-12 Ian Lance Taylor <iant@google.com>
4668
4669 PR gold/12980
4670 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4671 GLOB_DAT relocation rather than a RELATIVE relocation for a
4672 protected symbol when creating a shared library.
4673 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4674 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4675 * testsuite/protected_main_1.cc (main): Test that protected
4676 function has same address.
4677
e2153196
ILT
46782011-07-11 Ian Lance Taylor <iant@google.com>
4679
4680 PR gold/12979
4681 * options.h (class General_options): Add -Bgroup.
4682 * options.cc (General_options::finalize): If -Bgroup is set,
4683 default to --unresolved-symbols=report-all.
4684 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4685 * target-reloc.h (issue_undefined_symbol_error): Handle
4686 --unresolved-symbols=report-all.
4687
6daf5215
ILT
46882011-07-08 Ian Lance Taylor <iant@google.com>
4689
4690 PR gold/11985
4691 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4692 if linker script discards key sections.
4693 (Layout::create_dynamic_symtab): Likewise.
4694 (Layout::assign_local_dynsym_offsets): Likewise.
4695 (Layout::sized_create_version_sections): Likewise.
4696 (Layout::create_interp): Likewise.
4697 (Layout::finish_dynamic_section): Likewise.
4698 (Layout::set_dynamic_symbol_size): Likewise.
4699
beabb2c6
ILT
47002011-07-08 Ian Lance Taylor <iant@google.com>
4701
4702 PR gold/12386
4703 * options.h (class General_options): Add --unresolved-symbols.
4704 * target-reloc.h (issue_undefined_symbol_error): Check
4705 --unresolved-symbols. Add comments.
4706
9c16daf1
ILT
47072011-07-08 Ian Lance Taylor <iant@google.com>
4708
4709 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4710 expression more complex.
4711
191f1a2d
ILT
47122011-07-08 Ian Lance Taylor <iant@google.com>
4713
4714 PR gold/11317
4715 * target-reloc.h (issue_undefined_symbol_error): New inline
4716 function, broken out of relocate_section.
4717 (relocate_section): Call issue_undefined_symbol_error.
4718 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4719 there is no TLS segment if we are about to issue an undefined
4720 symbol error.
4721 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4722
62855347
ILT
47232011-07-08 Ian Lance Taylor <iant@google.com>
4724
4725 PR gold/12279
4726 * resolve.cc (Symbol_table::should_override): Add fromtype
4727 parameter. Change all callers. Give error when linking together
4728 TLS and non-TLS symbol.
4729 (Symbol_table::should_override_with_special): Add fromtype
4730 parameter. Change all callers.
4731 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4732 there is no TLS segment if we have reported some errors.
4733 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4734
67181c72
ILT
47352011-07-08 Ian Lance Taylor <iant@google.com>
4736
4737 PR gold/12372
4738 * target.h (Target::plt_address_for_global): New function.
4739 (Target::plt_address_for_local): New function.
4740 (Target::plt_section_for_global): Remove.
4741 (Target::plt_section_for_local): Remove.
4742 (Target::do_plt_address_for_global): New virtual function.
4743 (Target::do_plt_address_for_local): New virtual function.
4744 (Target::do_plt_section_for_global): Remove.
4745 (Target::do_plt_section_for_local): Remove.
4746 (Target::register_global_plt_entry): Add Symbol_table and Layout
4747 parameters.
4748 * output.cc (Output_data_got::Got_entry::write): Use
4749 plt_address_for_global and plt_address_for_local.
4750 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4751 address of output section.
4752 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4753 got_irelative_, and irelative_count_ fields. Update
4754 declarations.
4755 (Output_data_plt_i386::has_irelative_section): New function.
4756 (Output_data_plt_i386::entry_count): Add irelative_count_.
4757 (Output_data_plt_i386::set_final_data_size): Likewise.
4758 (class Target_i386): Add got_irelative_ and rel_irelative_
4759 fields. Update declarations.
4760 (Target_i386::Target_i386): Initialize new fields.
4761 (Target_i386::do_plt_address_for_global): New function replacing
4762 do_plt_section_for_global.
4763 (Target_i386::do_plt_address_for_local): New function replacing
4764 do_plt_section_for_local.
4765 (Target_i386::got_section): Create got_irelative_.
4766 (Target_i386::rel_irelative_section): New function.
4767 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4768 fields. Don't define __rel_iplt_{start,end}.
4769 (Output_data_plt_i386::add_entry): Add symtab and layout
4770 parameters. Change all callers. Use different PLT and GOT for
4771 IFUNC symbols.
4772 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4773 layout parameters. Change all callers. Use different PLT and
4774 GOT.
4775 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4776 (Output_data_plt_i386::rel_irelative): New function.
4777 (Output_data_plt_i386::address_for_global): New function.
4778 (Output_data_plt_i386::address_for_local): New function.
4779 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4780 IRELATIVE GOT when changing IFUNC GOT entries.
4781 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4782 reloc.
4783 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4784 if we didn't create an IRELATIVE GOT.
4785 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4786 plt_address_for_local.
4787 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4788 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4789 got_irelative_, and irelative_count_ fields. Update
4790 declarations.
4791 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4792 Initialize new fields. Remove symtab parameter. Change all
4793 callers.
4794 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4795 irelative_count_.
4796 (Output_data_plt_x86_64::has_irelative_section): New function.
4797 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4798 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4799 fields. Update declarations.
4800 (Target_x86_64::Target_x86_64): Initialize new fields.
4801 (Target_x86_64::do_plt_address_for_global): New function replacing
4802 do_plt_section_for_global.
4803 (Target_x86_64::do_plt_address_for_local): New function replacing
4804 do_plt_section_for_local.
4805 (Target_x86_64::got_section): Create got_irelative_.
4806 (Target_x86_64::rela_irelative_section): New function.
4807 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4808 all callers. Don't create __rel_iplt_{start,end}.
4809 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4810 parameters. Change all callers. Use different PLT and GOT for
4811 IFUNC symbols.
4812 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4813 layout parameters. Change all callers. Use different PLT and
4814 GOT.
4815 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4816 parameters. Change all callers. Use different PLT and GOT for
4817 IFUNC symbols.
4818 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4819 (Output_data_plt_x86_64::rela_irelative): New function.
4820 (Output_data_plt_x86_64::address_for_global): New function.
4821 (Output_data_plt_x86_64::address_for_local): New function.
4822 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4823 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4824 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4825 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4826 parameters.
4827 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4828 reloc.
4829 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4830 symbols if we didn't create an IRELATIVE GOT.
4831 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4832 plt_address_for_local.
4833 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4834 * testsuite/ifuncvar1.c: New test file.
4835 * testsuite/ifuncvar2.c: New test file.
4836 * testsuite/ifuncvar3.c: New test file.
4837 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4838 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4839 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4840 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4841 * testsuite/Makefile.in: Rebuild.
4842
33c15b45
CC
48432011-07-07 Cary Coutant <ccoutant@google.com>
4844
4845 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4846 (two_file_test_1_ndebug.o): Likewise.
4847 (two_file_test_1b_ndebug.o): Likewise.
4848 (two_file_test_2_ndebug.o): Likewise.
4849 (two_file_test_main_ndebug.o): Likewise.
4850 (incremental_test_2): Link with no-debug versions.
4851
f48b5fb7
CC
48522011-07-06 Cary Coutant <ccoutant@google.com>
4853
4854 * gold/incremental.cc
4855 (Output_section_incremental_inputs::write_info_blocks): Check for
4856 hidden and internal symbols.
4857
221597a5
CC
48582011-07-06 Cary Coutant <ccoutant@google.com>
4859
4860 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4861 Check disposition for startup file.
4862 (Incremental_inputs::report_command_line): Ignore
4863 --incremental-startup-unchanged option.
4864 * options.cc (General_options::parse_incremental_startup_unchanged):
4865 New function.
4866 (General_options::General_options): Initialize new data member.
4867 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4868 (General_options): Add --incremental-startup-unchanged option.
4869 (General_options::incremental_startup_disposition): New function.
4870 (General_options::incremental_startup_disposition_): New data member.
4871
e24719f6
CC
48722011-07-06 Cary Coutant <ccoutant@google.com>
4873
4874 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4875 input file index to Script_info ctor.
4876 (Sized_incremental_binary::do_file_has_changed): Find the
4877 command-line argument for files named in scripts.
4878 * incremental.h (Script_info::Script_info): New ctor
4879 with input file index.
4880 (Script_info::input_file_index): New function.
4881 (Script_info::input_file_index_): New data member.
4882 (Incremental_binary::get_library): Add const.
4883 (Incremental_binary::get_script_info): Add const.
4884 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4885 * testsuite/Makefile.am (incremental_test_5): New test case.
4886 (incremental_test_6): New test case.
4887 * testsuite/Makefile.in: Regenerate.
4888
8f7c81e8
CC
48892011-07-06 Cary Coutant <ccoutant@google.com>
4890
4891 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4892 debug output when command lines differ.
4893
9fbd3822
CC
48942011-07-06 Cary Coutant <ccoutant@google.com>
4895
4896 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4897 --incremental-patch option.
4898 * layout.cc (Free_list::allocate): Extend allocation beyond original
4899 end if enabled.
4900 (Layout::make_output_section): Mark sections that should get
4901 patch space.
4902 * options.cc (parse_percent): New function.
4903 * options.h (parse_percent): New function.
4904 (DEFINE_percent): New macro.
4905 (General_options): Add --incremental-patch option.
4906 * output.cc (Output_section::Output_section): Initialize new data
4907 members.
4908 (Output_section::add_input_section): Print section name when out
4909 of patch space.
4910 (Output_section::add_output_section_data): Likewise.
4911 (Output_section::set_final_data_size): Add patch space when
4912 doing --incremental-full.
4913 (Output_section::do_reset_address_and_file_offset): Remove patch
4914 space.
4915 (Output_segment::set_section_list_addresses): Print debug output
4916 only if --incremental-update.
4917 * output.h (Output_section::set_is_patch_space_allowed): New function.
4918 (Output_section::is_patch_space_allowed_): New data member.
4919 (Output_section::patch_space_): New data member.
4920 * parameters.cc (Parameters::incremental_full): New function.
4921 * parameters.h (Parameters::incremental_full): New function
4922 * testsuite/Makefile.am (incremental_test_2): Add test for
4923 --incremental-patch option.
4924 * testsuite/Makefile.in: Regenerate.
4925 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4926 (t18): Remove function body.
4927
f6cccc2c
DK
49282011-07-05 Doug Kwan <dougkwan@google.com>
4929
4930 PR gold/12771
4931 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4932 Arm_Address type for relocation result.
4933 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4934 overflow check.
4935 (Arm_relocate_functions::abs32): Use unaligned access.
4936 (Arm_relocate_functions::rel32): Ditto.
4937 (Arm_relocate_functions::prel31): Ditto.
4938 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4939 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4940 static data relocations.
4941 * testsuite/Makefile.in: Regnerate.
4942 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4943
28a13fec
ILT
49442011-07-05 Ian Lance Taylor <iant@google.com>
4945
4946 PR gold/12392
4947 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4948 symbols if necessary.
4949 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4950
24d47b34
ILT
49512011-07-05 Ian Lance Taylor <iant@google.com>
4952
4953 PR gold/12952
4954 * resolve.cc (Symbol::override_base_with_special): Simply override
4955 version with special symbol version, ignoring previous version.
4956
41f9cbbe
ILT
49572011-07-05 Ian Lance Taylor <iant@google.com>
4958
4959 * object.cc (Sized_relobj_file::include_section_group): Add
4960 information to comment about signature location.
4961
886288f1
ILT
49622011-07-02 Ian Lance Taylor <iant@google.com>
4963
4964 PR gold/12957
4965 * options.h (class General_options): Add -f and -F.
4966 * options.cc (General_options::finalize): Fatal error if -f/-F
4967 are used without -shared.
4968 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4969
ae3a6d4f
ILT
49702011-07-02 Ian Lance Taylor <iant@google.com>
4971
4972 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4973
21131061
ILT
49742011-07-01 Ian Lance Taylor <iant@google.com>
4975
4976 PR gold/12525
4977 PR gold/12952
4978 * resolve.cc (Symbol::override_base_with_special): Don't override
4979 the version if the overriding symbol has a different name.
4980 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4981 all callers. If we give an error about an undefined version,
4982 define the base version if necessary.
4983 * dynobj.h (class Versions): Update declaration.
4984 * testsuite/weak_alias_test_5.cc: New file.
4985 * testsuite/weak_alias_test.script: New file.
4986 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4987 and versioned_alias have the right value, and call t2.
4988 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4989 weak_alias_test_5.so.
4990 (weak_alias_test_LDADD): Likewise.
4991 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4992 * testsuite/Makefile.in: Rebuild.
4993
611062c0
ILT
49942011-07-01 Ian Lance Taylor <iant@google.com>
4995
4996 PR gold/12525
4997 * options.h (class General_options): Support -z notext.
4998 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4999 -Wl,-z,notext.
5000 (two_file_shared_nonpic.so): Likewise.
5001 (two_file_shared_mixed.so): Likewise.
5002 (two_file_shared_mixed_1.so): Likewise.
5003 (weak_undef_lib_nonpic.so): Likewise.
5004 (alt/weak_undef_lib_nonpic.so): Likewise.
5005 (tls_test_shared_nonpic.so): Likewise.
5006 * testsuite/Makefile.in: Rebuild.
5007
328c7c2f
ILT
50082011-07-01 Ian Lance Taylor <iant@google.com>
5009
5010 PR gold/12525
5011 * configure.ac: Test whether static linking works, setting
5012 the automake conditional HAVE_STATIC.
5013 * testsuite/Makefile.am: Disable tests using -static if
5014 HAVE_STATIC is not true.
5015 * configure, testsuite/Makefile.in: Rebuild.
5016
02d7cd44
ILT
50172011-07-01 Ian Lance Taylor <iant@google.com>
5018
5019 PR gold/12525
5020 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5021 Assert if we see DW_EH_PE_indirect.
5022 * target.h (Target::ehframe_datarel_base): New function.
5023 (Target::do_ehframe_datarel_base): New target function.
5024 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5025 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5026 function.
5027
07a60597
ILT
50282011-07-01 Ian Lance Taylor <iant@google.com>
5029
5030 PR gold/12571
5031 * options.h (class General_options): Add
5032 --ld-generated-unwind-info.
5033 * ehframe.cc (Fde::write): Add address parameter. Change all
5034 callers. If associated with PLT, fill in address and size.
5035 (Cie::set_output_offset): Only add merge mapping if there is an
5036 object.
5037 (Cie::write): Add address parameter. Change all callers.
5038 (Eh_frame::add_ehframe_for_plt): New function.
5039 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5040 input_offset_ fields into union u_, with new plt field.
5041 (Fde::Fde): Adjust for new union field.
5042 (Fde::Fde) [Output_data version]: New constructor.
5043 (Fde::add_mapping): Only add merge mapping if there is an object.
5044 (class Cie): Update declarations.
5045 (class Eh_frame): Declare add_ehframe_for_plt.
5046 * layout.cc (Layout::layout_eh_frame): Break out code into
5047 make_eh_frame_section, and call it.
5048 (Layout::make_eh_frame_section): New function.
5049 (Layout::add_eh_frame_for_plt): New function.
5050 * layout.h (class Layout): Update declarations.
5051 * merge.cc (Merge_map::add_mapping): Add assertion.
5052 * i386.cc: Include "dwarf.h".
5053 (class Output_data_plt_i386): Make first_plt_entry,
5054 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5055 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5056 and plt_eh_frame_fde.
5057 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5058 boundary. Call add_eh_frame_for_plt if appropriate.
5059 * x86_64.cc: Include "dwarf.h".
5060 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5061 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5062 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5063 and plt_eh_frame_fde.
5064 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5065 appropriate.
5066
14788a3f
ILT
50672011-06-29 Ian Lance Taylor <iant@google.com>
5068
5069 PR gold/12629
5070 * object.cc (Sized_relobj_file::layout_section): Change shdr
5071 parameter to be const.
5072 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5073 out of do_layout.
5074 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5075 appropriate. Call layout_eh_frame_section.
5076 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5077 sections.
5078 * object.h (class Sized_relobj_file): Update declarations.
5079
6c21fce1
ILT
50802011-06-29 Ian Lance Taylor <iant@google.com>
5081
37e41b03 5082 PR gold/12652
6c21fce1
ILT
5083 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5084 modifier.
5085 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5086
4d5e4e62
ILT
50872011-06-29 Ian Lance Taylor <iant@google.com>
5088
5089 PR gold/12675
5090 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5091 SHT_X86_64_UNWIND.
5092 * layout.cc (Layout::layout_eh_frame): Likewise.
5093
886f533a
ILT
50942011-06-29 Ian Lance Taylor <iant@google.com>
5095
5096 PR gold/12695
5097 * layout.cc (Layout::symtab_section_shndx): New function.
5098 * layout.h (class Layout): Declare symtab_section_shndx.
5099 * output.cc (Output_section::write_header): Call it.
5100
f3ae1b28
ILT
51012011-06-29 Ian Lance Taylor <iant@google.com>
5102
5103 PR gold/12818
5104 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5105 symbols which are not used in a relocation.
5106
aecf301f
ILT
51072011-06-28 Ian Lance Taylor <iant@google.com>
5108
5109 PR gold/12898
5110 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5111 script create indistinguishable segments.
5112 (Layout::set_segment_offsets): Use stable_sort when sorting
5113 segments. Pass this to Compare_segments constructor.
5114 * layout.h (class Layout): Make segment_precedes non-static.
5115 (class Compare_segments): Change from struct to class. Add
5116 layout_ field. Add constructor.
5117 * script-sections.cc
5118 (Script_sections::attach_sections_using_phdrs_clause): Rename
5119 local orphan to is_orphan. Don't report failure to put empty
5120 section in segment. On attachment failure, report name of
5121 section, and attach to first PT_LOAD segment.
5122
03ef7571
ILT
51232011-06-28 Ian Lance Taylor <iant@google.com>
5124
5125 PR gold/12934
5126 * target-select.cc (Target_selector::Target_selector): Add
5127 emulation parameter. Change all callers.
5128 (select_target_by_bfd_name): Rename from select_target_by_name.
5129 Change all callers.
5130 (select_target_by_emulation): New function.
5131 (supported_emulation_names): New function.
5132 * target-select.h (class Target_selector): Add emulation_ field.
5133 Update declarations.
5134 (Target_selector::recognize_by_bfd_name): Rename from
5135 recognize_by_name. Change all callers.
5136 (Target_selector::supported_bfd_names): Rename from
5137 supported_names. Change all callers.
5138 (Target_selector::recognize_by_emulation): New function.
5139 (Target_selector::supported_emulations): New function.
5140 (Target_selector::emulation): New function.
5141 (Target_selector::do_recognize_by_bfd_name): Rename from
5142 do_recognize_by_name. Change all callers.
5143 (Target_selector::do_supported_bfd_names): Rename from
5144 do_supported_names. Change all callers.
5145 (Target_selector::do_recognize_by_emulation): New function.
5146 (Target_selector::do_supported_emulations): New function.
5147 (select_target_by_bfd_name): Change name in declaration.
5148 (select_target_by_emulation): Declare.
5149 (supported_emulation_names): Declare.
5150 * parameters.cc (parameters_force_valid_target): Try to find
5151 target based on emulation from -m option.
5152 * options.h (class General_options): Change doc string for -m.
5153 * options.cc (help): Print emulations.
5154 (General_options::parse_V): Likewise.
5155 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5156 Add emulation parameter. Change all callers.
5157
200b2bb9
ILT
51582011-06-28 Ian Lance Taylor <iant@google.com>
5159
5160 * target.h (class Target): Add osabi_ field.
5161 (Target::osabi): New function.
5162 (Target::set_osabi): New function.
5163 (Target::Target): Initialize osabi_.
5164 (Target::do_adjust_elf_header): Make pure virtual.
5165 (Sized_target::do_adjust_elf_header): Declare.
5166 * target.cc (Sized_target::do_adjust_elf_header): New function.
5167 (class Sized_target): Instantiate all versions.
5168 * freebsd.h (class Target_freebsd): Remove.
5169 (Target_selector_freebsd::do_recognize): Call set_osabi on
5170 Target.
5171 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5172 (Target_selector_freebsd::set_osabi): Remove.
5173 * i386.cc (class Target_i386): Inherit from Sized_target rather
5174 than Target_freebsd.
5175 * x86_64.cc (class Target_x86_64): Likewise.
5176
b3ce541e
ILT
51772011-06-28 Ian Lance Taylor <iant@google.com>
5178
5179 * target.h (Target::can_check_for_function_pointers): Rewrite.
5180 Make non-virtual.
5181 (Target::can_icf_inline_merge_sections): Likewise.
5182 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5183 (Target::Target_info): Add can_icf_inline_merge_sections field.
5184 (Target::do_can_check_for_function_pointers): New virtual
5185 function.
5186 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5187 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5188 from can_check_for_function_pointers, move in file.
5189 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5190 section_may_have_icf_unsafe_poineters, move in file.
5191 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5192 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5193 Rename from can_check_for_function_pointers, move in file.
5194 (Target_i386::can_icf_inline_merge_sections): Remove.
5195 (Target_i386::i386_info): Initialize
5196 can_icf_inline_merge_sections.
5197 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5198 Initialize can_icf_inline_merge_sections.
5199 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5200 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5201 Rename from can_check_for_function_pointers, move in file.
5202 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5203 (Target_x86_64::x86_64_info): Initialize
5204 can_icf_inline_merge_sections.
5205 * testsuite/testfile.cc (Target_test::test_target_info):
5206 Likewise.
5207 * icf.cc (get_section_contents): Correct formatting.
5208
6d1c4efb
ILT
52092011-06-27 Ian Lance Taylor <iant@google.com>
5210
5211 * symtab.cc (Symbol::versioned_name): New function.
5212 (Symbol_table::add_to_final_symtab): Use versioned_name when
5213 appropriate.
5214 (Symbol_table::sized_write_symbol): Likewise.
5215 * symtab.h (class Symbol): Declare versioned_name.
5216 * stringpool.h (class Stringpool_template): Add variant of add
5217 which takes a std::basic_string.
5218 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5219 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5220 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5221 (ver_test_12.o): New target.
5222 * testsuite/Makefile.in: Rebuild.
5223
57eb9b50
DK
52242011-06-27 Doug Kwan <dougkwan@google.com>
5225
5226 * arm.cc (Arm_relocate_functions::thm_jump8,
5227 Arm_relocate_functions::thm_jump11): Use a wider signed
5228 type to compute offset.
5229 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5230 arm_thm_jump8.
5231 * testsuite/Makefile.in: Regenerate.
5232 * testsuite/arm_branch_in_range.sh: Check test results of
5233 arm_thm_jump11 and arm_thm_jump8.
5234 * testsuite/arm_thm_jump11.s: New test source file.
5235 * testsuite/arm_thm_jump11.t: New linker script.
5236 * testsuite/arm_thm_jump8.s: New test source file.
5237 * testsuite/arm_thm_jump8.t: New linker script.
5238
487b39df
ILT
52392011-06-24 Ian Lance Taylor <iant@google.com>
5240
5241 * layout.cc: Include "object.h".
5242 (ctors_sections_in_init_array): New static variable.
5243 (Layout::is_ctors_in_init_array): New function.
5244 (Layout::layout): Add entry to ctors_sections_in_init_array if
5245 appropriate.
5246 * layout.h (class Layout): Declare is_ctors_in_init_array.
5247 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5248 is_ctors_reverse_view is set.
5249 (Sized_relobj_file::write_sections): Add layout parameter. Change
5250 all callers. Set is_ctors_reverse_view field of View_size.
5251 (Sized_relobj_file::reverse_words): New function.
5252 * object.h (Sized_relobj_file::View_size): Add
5253 is_ctors_reverse_view field.
5254 (class Sized_relobj_file): Update declarations.
5255 * testsuite/initpri3.c: New test.
5256 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5257 initpri3b.
5258 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5259 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5260 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5261 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5262 * testsuite/Makefile.in: Rebuild.
5263
472076e4
CC
52642011-06-24 Cary Coutant <ccoutant@google.com>
5265
5266 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5267 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5268 (debug_msg_cdebug.err): New targets.
5269 * testsuite/Makefile.in: Regenerate.
5270 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5271 Fix checks for link with shared library.
5272
a60af0db
DK
52732011-06-24 Doug Kwan <dougkwan@google.com>
5274
5275 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5276 skip empty text sections.
5277 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5278
5393d741
ILT
52792011-06-22 Ian Lance Taylor <iant@google.com>
5280
5281 PR gold/12910
5282 * options.h (class General_options): Add --ctors-in-init-array.
5283 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5284 friends as SHT_PROGBITS for merging sections.
5285 (Layout::layout): Remove special handling of .init_array and
5286 friends. Don't sort if doing relocatable link. Sort for .ctors
5287 and .dtors if ctors_in_init_array.
5288 (Layout::make_output_section): Force correct section types for
5289 .init_array and friends. Don't sort if doing relocatable link,
5290 Don't sort .ctors and .dtors if ctors_in_init_array.
5291 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5292 (Layout::output_section_name): Add relobj parameter. Change all
5293 callers. Handle .ctors. and .dtors. in code rather than table.
5294 Handle .ctors and .dtors if ctors_in_init_array.
5295 (Layout::match_file_name): New function, moved from output.cc.
5296 * layout.h (class Layout): Update declarations.
5297 * output.cc: Include "layout.h".
5298 (Input_section_sort_entry::get_priority): New function.
5299 (Input_section_sort_entry::match_file_name): Just call
5300 Layout::match_file_name.
5301 (Output_section::Input_section_sort_init_fini_compare::operator()):
5302 Handle .ctors and .dtors. Sort by explicit priority rather than
5303 by name.
5304 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5305 * testsuite/initpri2.c: New test.
5306 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5307 (check_PROGRAMS): Add initpri2.
5308 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5309 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5310 * configure, testsuite/Makefile.in: Rebuild.
5311
e1f74f98
ILT
53122011-06-19 Ian Lance Taylor <iant@google.com>
5313
5314 PR gold/12880
5315 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5316 .interp section to a PT_INTERP segment even if we have seen a
5317 --dynamic-linker option. Don't do it if we have seen a PHDRS
5318 clause in a linker script.
5319 (Layout::finalize): Don't create a .interp section if we've
5320 already create a PT_INTERP segment.
5321 (Layout::create_interp): Always call choose_output_section (revert
5322 patch of 2011-06-17). Don't create PT_INTERP segment.
5323 * script-sections.cc
5324 (Script_sections::create_note_and_tls_segments): Add a .interp
5325 section to a PT_INTERP segment even if we have seen a
5326 --dynamic-linker option.
5327
766f91bb
ILT
53282011-06-18 Ian Lance Taylor <iant@google.com>
5329
5330 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5331 merely because a non-PT_LOAD segment has a dynamic reloc.
5332
0d212c3a
ILT
53332011-06-18 Ian Lance Taylor <iant@google.com>
5334
5335 * layout.cc (Layout::finish_dynamic_section): Don't create
5336 DT_FLAGS entry if not needed.
5337
911a5072
ILT
53382011-06-18 Ian Lance Taylor <iant@google.com>
5339
5340 PR gold/12745
5341 * layout.cc (Layout::layout_eh_frame): Correct handling of
5342 writable .eh_frame section.
5343
534b4e5f
ILT
53442011-06-17 Ian Lance Taylor <iant@google.com>
5345
5346 PR gold/12893
5347 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5348 symbol is redefined with the exact same object and value.
5349
10b4f102
ILT
53502011-06-17 Ian Lance Taylor <iant@google.com>
5351
5352 PR gold/12880
5353 * layout.h (class Layout): Add interp_segment_ field.
5354 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5355 (Layout::attach_allocated_section_to_segment): If making shared
5356 library, put .interp section in PT_INTERP segment.
5357 (Layout::finalize): Also call create_interp if -dynamic-linker
5358 option was used.
5359 (Layout::create_interp): Assert that there is no PT_INTERP
5360 segment. If not using a SECTIONS clause, use make_output_section.
5361 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5362 * script-sections.cc
5363 (Script_sections::create_note_and_tls_segments): If making shared
5364 library, put .interp section in PT_INTERP segment.
5365
a29b0dad
ILT
53662011-06-17 Ian Lance Taylor <iant@google.com>
5367
e588ea8d
ILT
5368 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5369 when making a shared library.
5370
53712011-06-17 Ian Lance Taylor <iant@google.com>
5372
5373 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5374 parameter. Change all callers. Don't issue warning about PC32
5375 against locally defined symbol.
a29b0dad 5376
9d3b0698
ILT
53772011-06-16 Ian Lance Taylor <iant@google.com>
5378
5379 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5380 occurs in same object.
5381
85b0f90c
AM
53822011-06-14 Alan Modra <amodra@gmail.com>
5383
5384 * po/POTFILES.in: Regenerate.
5385
a94907d9
ILT
53862011-06-09 Ian Lance Taylor <iant@google.com>
5387
5388 * script-sections.cc
5389 (Orphan_output_section::set_section_addresses): For a relocatable
5390 link set address to 0.
5391
4fb3a1c3
CC
53922011-06-09 Cary Coutant <ccoutant@google.com>
5393
5394 PR gold/12804
5395 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5396 used with --compress-debug-sections.
5397 * gold/object.cc (Sized_relobj_file::do_layout): Report
5398 uncompressed size of compressed input sections.
5399
61220854
CC
54002011-06-08 Cary Coutant <ccoutant@google.com>
5401
5402 PR gold/12804
5403 * testsuite/two_file_test_2_v1.cc: Change initialization of
5404 v2 to keep it in .data.
5405
e6455dfb
CC
54062011-06-07 Cary Coutant <ccoutant@google.com>
5407
5408 * common.cc (Symbol_table::do_allocate_commons_list): Call
5409 gold_fallback.
5410 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5411 (Errors::fallback): New function.
5412 (gold_fallback): New function.
5413 * errors.h (Errors::fallback): New function.
5414 * gold.cc (gold_exit): Change status parameter to enum; adjust
5415 all callers.
5416 (queue_initial_tasks): Call gold_fallback.
5417 * gold.h: Include cstdlib.
5418 (Exit_status): New enum type.
5419 (gold_exit): Change status parameter to enum.
5420 (gold_fallback): New function.
5421 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5422 (Layout::create_symtab_sections): Likewise.
5423 (Layout::create_shdrs): Likewise.
5424 * main.cc (main): Adjust call to gold_exit.
5425 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5426 (Output_data_got::add_got_entry_pair): Likewise.
5427 (Output_section::add_input_section): Likewise.
5428 (Output_section::add_output_section_data): Likewise.
5429 (Output_segment::set_section_list_addresses): Likewise.
5430 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5431
fb0e076f
CC
54322011-06-07 Cary Coutant <ccoutant@google.com>
5433
5434 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5435 for incremental links.
5436 * output.cc (Output_segment::set_section_list_addresses): Remove
5437 FIXME and test for TLS or BSS.
5438
a5ee4d5d
CC
54392011-06-07 Cary Coutant <ccoutant@google.com>
5440
5441 * testsuite/Makefile.am: Add incremental_copy_test,
5442 incremental_common_test_1.
5443 * testsuite/Makefile.in: Regenerate.
5444 * testsuite/common_test_1_v1.c: New source file.
5445 * testsuite/common_test_1_v2.c: New source file.
5446 * testsuite/copy_test_v1.cc: New source file.
5447
5146f448
CC
54482011-06-07 Cary Coutant <ccoutant@google.com>
5449
5450 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5451 update, allocate common from bss section's free list.
5452 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5453 linker-defined symbols.
5454 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5455 Skip GOT and PLT entries that are no longer referenced.
5456 (Output_section_incremental_inputs::write_info_blocks): Mark
5457 linker-defined symbols.
5458 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5459 * output.cc (Output_section::allocate): New function.
5460 * output.h (Output_section::allocate): New function.
5461 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5462 linker-defined symbols.
5463 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5464 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5465 (Symbol::init_base_output_data): Likewise.
5466 (Symbol::init_base_output_segment): Likewise.
5467 (Symbol::init_base_constant): Likewise.
5468 (Sized_symbol::init_output_data): Likewise.
5469 (Sized_symbol::init_output_segment): Likewise.
5470 (Sized_symbol::init_constant): Likewise.
5471 (Symbol_table::do_define_in_output_data): Likewise.
5472 (Symbol_table::do_define_in_output_segment): Likewise.
5473 (Symbol_table::do_define_as_constant): Likewise.
5474 * symtab.h (Symbol::is_predefined): New function.
5475 (Symbol::init_base_output_data): Add is_predefined parameter.
5476 (Symbol::init_base_output_segment): Likewise.
5477 (Symbol::init_base_constant): Likewise.
5478 (Symbol::is_predefined_): New data member.
5479 (Sized_symbol::init_output_data): Add is_predefined parameter.
5480 (Sized_symbol::init_output_segment): Likewise.
5481 (Sized_symbol::init_constant): Likewise.
5482 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5483
26d3c67d
CC
54842011-06-07 Cary Coutant <ccoutant@google.com>
5485
5486 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5487 instead of emit_copy_reloc.
5488 (Copy_relocs::emit_copy_reloc): Refactor.
5489 (Copy_relocs::make_copy_reloc): New function.
5490 (Copy_relocs::add_copy_reloc): Remove.
5491 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5492 section.
5493 (Copy_relocs::make_copy_reloc): New function.
5494 (Copy_relocs::add_copy_reloc): Remove.
5495 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5496 unchanged input files.
5497 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5498 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5499 Reserve BSS space for COPY relocations.
5500 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5501 (Output_section_incremental_inputs::write_info_blocks): Record
5502 whether a symbol is copied from a shared object.
5503 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5504 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5505 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5506 (Incremental_input_entry_reader::get_output_symbol_index): Add
5507 is_copy parameter.
5508 (Incremental_binary::emit_copy_relocs): New function.
5509 (Incremental_binary::do_emit_copy_relocs): New function.
5510 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5511 new data member.
5512 (Sized_incremental_binary::add_copy_reloc): New function.
5513 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5514 (Sized_incremental_binary::Copy_reloc): New struct.
5515 (Sized_incremental_binary::Copy_relocs): New typedef.
5516 (Sized_incremental_binary::copy_relocs_): New data member.
5517 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5518 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5519 * target.h (Sized_target::emit_copy_reloc): New function.
5520 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5521
7cdb37d9
CC
55222011-06-02 Cary Coutant <ccoutant@google.com>
5523
5524 PR gold/12163
5525 * gold/archive.cc (Archive::Archive): Initialize new data member.
5526 (Archive::include_all_members): Return if archive has already been
5527 included.
5528 * gold/archive.h (Archive::include_all_members_): New data member.
5529
cc643b88
NC
55302011-06-02 Nick Clifton <nickc@redhat.com>
5531
5532 * dynobj.h: Fix spelling mistake in comment.
5533 * output.cc: Likewise.
5534
f62a3ca7 55352011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5536 Asier Llano
f62a3ca7
DK
5537
5538 PR gold/12826
cc643b88 5539 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5540 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5541 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5542 redundant arm_exidx_test.so.
5543 * testsuite/Makefile.in: Regenerate.
5544 (check_SCRIPTS): Add pr12826.sh
5545 (check_DATA): Add pr12826.stdout
5546 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5547 * testsuite/pr12826.sh: New file.
5548 * testsuite/pr12826_1.s: Ditto.
5549 * testsuite/pr12826_1.s: Ditto.
5550
8dbe1edc
ILT
55512011-05-30 Ian Lance Taylor <iant@google.com>
5552
5553 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5554 sections.
5555
c49875be
ILT
55562011-05-29 Ian Lance Taylor <iant@google.com>
5557
5558 PR gold/12804
5559 * testsuite/Makefile.am: Use different file name for two_file_test
5560 temporary file for each incremental test.
5561 * testsuite/Makefile.in: Rebuild.
5562
69d53f7a
ILT
55632011-05-29 Ian Lance Taylor <iant@google.com>
5564
5565 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5566 binary input file is empty.
5567
41d0ab5f
ILT
55682011-05-27 Ian Lance Taylor <iant@google.com>
5569
5570 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5571 (ver_test_9.so): Likewise.
5572 * testsuite/Makefile.in: Rebuild.
5573
89d8a36b
CC
55742011-05-26 Cary Coutant <ccoutant@google.com>
5575
5576 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5577 * incremental.cc (Incremental_inputs::report_input_section): Fix
5578 comment, indentation.
5579 (Incremental_inputs::report_comdat_group): New function.
5580 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5581 of data for incremental input file entry.
5582 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5583 group count, COMDAT group signatures.
5584 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5585 an unchanged input file.
5586 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5587 Initialize new data member.
5588 (Incremental_object_entry::add_comdat_group): New function.
5589 (Incremental_object_entry::get_comdat_group_count): New function.
5590 (Incremental_object_entry::get_comdat_signature_key): New function.
5591 (Incremental_object_entry::groups_): New data member.
5592 (Incremental_inputs::report_comdat_group): New function.
5593 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5594 data for incremental input file entry.
5595 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5596 (Incremental_input_entry_reader::get_input_section): Adjust size of
5597 data for incremental input file entry.
5598 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5599 (Incremental_input_entry_reader::get_comdat_group_signature): New
5600 function.
5601 * object.cc (Sized_relobj::include_section_group): Report kept
5602 COMDAT groups for incremental links.
5603
1706a06f
ILT
56042011-05-24 David Meyer <pdox@google.com>
5605
5606 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5607 with name parameter. Add found_name parameter.
5608 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5609 * dirsearch.h (class Dirsearch): Update declaration.
5610
a10ae760
ILT
56112011-05-24 Ian Lance Taylor <iant@google.com>
5612
5613 * archive.cc (Library_base::should_include_member): Pull in object
5614 from archive if it defines the entry symbol.
5615 * parameters.cc (Parameters::entry): New function.
5616 * parameters.h (class Parameters): Declare entry.
5617 * output.h (class Output_file_header): Remove entry_ field.
5618 * output.cc (Output_file_header::Output_file_header): Remove entry
5619 parameter. Change all callers.
5620 (Output_file_header::entry): Use parameters->entry.
5621 * gold.cc (queue_middle_tasks): Likewise.
5622 * plugin.cc (Plugin_hook::run): Likewise.
5623
aa92d6ed
CC
56242011-05-24 Cary Coutant <ccoutant@google.com>
5625
5626 * gold.cc (queue_initial_tasks): Pass incremental base filename
5627 to Output_file::open_base_file; don't print error message.
5628 * incremental-dump.cc (main): Adjust call to
5629 Output_file::open_for_modification.
5630 * incremental-dump.cc (main): Likewise.
5631 * incremental.cc (Incremental_inputs::report_command_line):
5632 Ignore --incremental-base option when comparing command lines.
5633 Ignore parameter when given as separate argument.
5634 * options.h (class General_options): Add --incremental-base.
5635 * output.cc (Output_file::Output_file):
5636 (Output_file::open_base_file): Add base_name and writable parameters;
5637 read base file into new file; print error message here.
5638 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5639 callers.
5640 * output.h (Output_file::open_for_modification): Rename to...
5641 (Output_file::open_base_file): ...this; add base_name and
5642 writable parameters; adjust all callers.
5643 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5644 callers.
5645 * testsuite/Makefile.am (incremental_test_4): Test
5646 --incremental-base.
5647 * testsuite/Makefile.in: Regenerate.
5648
2eedd706
CC
56492011-05-24 Cary Coutant <ccoutant@google.com>
5650
5651 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5652 incremental_test_4.
5653 * testsuite/Makefile.in: Regenerate.
5654 * testsuite/two_file_test_1_v1.cc: New test source file.
5655 * testsuite/two_file_test_1b_v1.cc: New test source file.
5656 * testsuite/two_file_test_2_v1.cc: New test source file.
5657
0f1c85a6
CC
56582011-05-24 Cary Coutant <ccoutant@google.com>
5659
5660 * dynobj.h (Dynobj::do_dynobj): New function.
5661 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5662 flag and soname for shared objects.
5663 * incremental.cc (Incremental_inputs::report_object): Make
5664 either Incremental_object_entry or Incremental_dynobj_entry; add
5665 soname to string table.
5666 (Incremental_inputs::report_input_section): Add assertion.
5667 (Output_section_incremental_inputs::set_final_data_size): Adjust
5668 type of input file entry for shared libraries; adjust size of
5669 shared library info entry.
5670 (Output_section_incremental_inputs::write_input_files): Write
5671 as_needed flag for shared libraries.
5672 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5673 of input file entry for shared libraries; write soname.
5674 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5675 soname from incremental info.
5676 * incremental.h (enum Incremental_input_flags): Add
5677 INCREMENTAL_INPUT_AS_NEEDED.
5678 (Incremental_input_entry::Incremental_input_entry): Initialize new
5679 data member.
5680 (Incremental_input_entry::set_as_needed): New function.
5681 (Incremental_input_entry::as_needed): New function.
5682 (Incremental_input_entry::do_dynobj_entry): New function.
5683 (Incremental_input_entry::as_needed_): New data member.
5684 (Incremental_object_entry::Incremental_object_entry): Don't check
5685 for shared library.
5686 (Incremental_object_entry::do_type): Likewise.
5687 (class Incremental_dynobj_entry): New class.
5688 (Incremental_input_entry_reader::as_needed): New function.
5689 (Incremental_input_entry_reader::get_soname): New function.
5690 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5691 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5692 size of shared library info entry.
58797674 5693 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5694 incremental link when adding DT_NEEDED entries.
5695 * object.h (Object::Object): Initialize new data member.
5696 (Object::dynobj): New function.
5697 (Object::set_as_needed): New function.
5698 (Object::as_needed): New function.
5699 (Object::do_dynobj): New function.
5700 (Object::as_needed_): New data member.
5701
6fa2a40b
CC
57022011-05-24 Cary Coutant <ccoutant@google.com>
5703
5704 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5705 info; adjust display of GOT entries.
5706 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5707 vector of input objects; remove file_status_.
5708 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5709 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5710 got_plt reader; call target hooks to reserve GOT entries.
5711 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5712 of input file info header and GOT info entry.
5713 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5714 relocation info.
5715 (Got_plt_view_info::got_descriptor): Remove.
5716 (Got_plt_view_info::sym_index): New data member.
5717 (Got_plt_view_info::input_index): New data member.
5718 (Local_got_offset_visitor::visit): Write input file index.
5719 (Global_got_offset_visitor::visit): Write 0 for input file index.
5720 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5721 with sym_index and input_index.
5722 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5723 incremental info GOT entry; replace got_descriptor with input_index.
5724 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5725 map from input file index to object.
5726 (Sized_relobj_incr::do_layout): Replace direct data member reference
5727 with accessor function.
5728 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5729 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5730 Adjust size of input file info header.
5731 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5732 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5733 (Incremental_input_entry_reader::get_input_section): Adjust size of
5734 input file info header.
5735 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5736 of incremental info GOT entry.
5737 (Incremental_got_plt_reader::get_got_desc): Remove.
5738 (Incremental_got_plt_reader::get_got_symndx): New function.
5739 (Incremental_got_plt_reader::get_got_input_index): New function.
5740 (Sized_incremental_binary::Sized_incremental_binary): Remove
5741 file_status_; add input_objects_.
5742 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5743 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5744 (Sized_incremental_binary::file_is_unchanged): Remove.
5745 (Sized_incremental_binary::set_input_object): New function.
5746 (Sized_incremental_binary::input_object): New function.
5747 (Sized_incremental_binary::file_status_): Remove.
5748 (Sized_incremental_binary::input_objects_): New data member.
5749 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5750 references.
5751 (Sized_relobj_incr::invalid_address): Move to base class.
5752 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5753 class.
5754 (Sized_relobj_incr::do_output_section_offset): Likewise.
5755 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5756 (Sized_relobj_incr::section_offsets_): Likewise.
5757 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5758 function.
5759 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5760 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5761 with accessor function.
5762 (Sized_relobj_file::do_layout): Likewise.
5763 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5764 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5765 (Sized_relobj_file::compute_final_local_value): Replace refs to
5766 section_offsets_ with accessor function.
5767 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5768 * object.h (Relobj::Relobj): Initialize new data members.
5769 (Relobj::add_dyn_reloc): New function.
5770 (Relobj::first_dyn_reloc): New function.
5771 (Relobj::dyn_reloc_count): New function.
5772 (Relobj::first_dyn_reloc_): New data member.
5773 (Relobj::dyn_reloc_count_): New data member.
5774 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5775 references.
5776 (Sized_relobj::Address): New typedef.
5777 (Sized_relobj::invalid_address): Move here from child class.
5778 (Sized_relobj::Sized_relobj): Initialize new data members.
5779 (Sized_relobj::sized_relobj): New function.
5780 (Sized_relobj::is_output_section_offset_invalid): Move here from
5781 child class.
5782 (Sized_relobj::get_output_section_offset): Likewise.
5783 (Sized_relobj::local_has_got_offset): Likewise.
5784 (Sized_relobj::local_got_offset): Likewise.
5785 (Sized_relobj::set_local_got_offset): Likewise.
5786 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5787 (Sized_relobj::clear_got_offsets): New function.
5788 (Sized_relobj::section_offsets): Move here from child class.
5789 (Sized_relobj::do_output_section_offset): Likewise.
5790 (Sized_relobj::do_set_section_offset): Likewise.
5791 (Sized_relobj::Local_got_offsets): Likewise.
5792 (Sized_relobj::local_got_offsets_): Likewise.
5793 (Sized_relobj::section_offsets_): Likewise.
5794 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5795 references.
5796 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5797 class.
5798 (Sized_relobj_file::sized_relobj): New function
5799 (Sized_relobj_file::local_has_got_offset): Move to base class.
5800 (Sized_relobj_file::local_got_offset): Likewise.
5801 (Sized_relobj_file::set_local_got_offset): Likewise.
5802 (Sized_relobj_file::get_output_section_offset): Likewise.
5803 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5804 (Sized_relobj_file::do_output_section_offset): Likewise.
5805 (Sized_relobj_file::do_set_section_offset): Likewise.
5806 (Sized_relobj_file::Local_got_offsets): Likewise.
5807 (Sized_relobj_file::local_got_offsets_): Likewise.
5808 (Sized_relobj_file::section_offsets_): Likewise.
5809 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5810 (all constructors).
5811 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5812 (Output_reloc::get_symbol_index): Likewise.
5813 (Output_reloc::local_section_offset): Likewise.
5814 (Output_reloc::get_address): Likewise.
5815 (Output_reloc::symbol_value): Likewise.
5816 (Output_data_got::reserve_slot): Move to class definition.
5817 (Output_data_got::reserve_local): New function.
5818 (Output_data_got::reserve_slot_for_global): Remove.
5819 (Output_data_got::reserve_global): New function.
5820 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5821 (all constructors, two instantiations).
5822 (Output_reloc::get_relobj): New function (two instantiations).
5823 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5824 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5825 (Output_data_reloc::add_global): Adjust type of relobj.
5826 (Output_data_reloc::add_global_relative): Likewise.
5827 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5828 (Output_data_reloc::add_local): Likewise.
5829 (Output_data_reloc::add_local_relative): Likewise.
5830 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5831 (Output_data_reloc::add_local_section): Likewise.
5832 (Output_data_reloc::add_output_section): Likewise.
5833 (Output_data_reloc::add_absolute): Likewise.
5834 (Output_data_reloc::add_target_specific): Likewise.
5835 (Output_data_got::reserve_slot): Move definition here.
5836 (Output_data_got::reserve_local): New function.
5837 (Output_data_got::reserve_global): New function.
5838 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5839 section_offsets_ with accessor function.
5840 (Sized_relobj_file::write_sections): Likewise.
5841 (Sized_relobj_file::do_relocate_sections): Likewise.
5842 * target.h (Sized_target::reserve_local_got_entry): New function.
5843 (Sized_target::reserve_global_got_entry): New function.
5844 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5845 (Target_x86_64::reserve_global_got_entry): New function.
5846 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5847
4829d394
CC
58482011-05-23 Cary Coutant <ccoutant@google.com>
5849
5850 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5851 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5852 bit when checking got_type.
5853 * incremental.cc (Sized_incremental_binary::setup_readers):
5854 Store symbol table and string table locations; initialize bit vector
5855 of file status flags.
5856 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5857 unchanged files.
5858 (Sized_incremental_binary::do_process_got_plt): New function.
5859 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5860 (Output_section_incremental_inputs::set_final_data_size): Record
5861 file index for each input file.
5862 (Output_section_incremental_inputs::write_got_plt): Store file index
5863 instead of input entry offset for each GOT entry.
5864 * incremental.h
5865 (Incremental_input_entry::Incremental_input_entry): Initialize new
5866 data member.
5867 (Incremental_input_entry::set_offset): Store file index.
5868 (Incremental_input_entry::get_file_index): New function.
5869 (Incremental_input_entry::file_index_): New data member.
5870 (Incremental_binary::process_got_plt): New function.
5871 (Incremental_binary::do_process_got_plt): New function.
5872 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5873 data members.
5874 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5875 (Sized_incremental_binary::set_file_is_unchanged): New function.
5876 (Sized_incremental_binary::file_is_unchanged): New function.
5877 (Sized_incremental_binary::do_process_got_plt): New function.
5878 (Sized_incremental_binary::file_status_): New data member.
5879 (Sized_incremental_binary::main_symtab_loc_): New data member.
5880 (Sized_incremental_binary::main_strtab_loc_): New data member.
5881 * output.cc (Output_data_got::Got_entry::write): Add case
5882 RESERVED_CODE.
5883 (Output_data_got::add_global): Call add_got_entry.
5884 (Output_data_got::add_global_plt): Likewise.
5885 (Output_data_got::add_global_with_rel): Likewise.
5886 (Output_data_got::add_global_with_rela): Likewise.
5887 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5888 (Output_data_got::add_global_pair_with_rela): Likewise.
5889 (Output_data_got::add_local): Call add_got_entry.
5890 (Output_data_got::add_local_plt): Likewise.
5891 (Output_data_got::add_local_with_rel): Likewise.
5892 (Output_data_got::add_local_with_rela): Likewise.
5893 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5894 (Output_data_got::add_local_pair_with_rela): Likewise.
5895 (Output_data_got::reserve_slot): New function.
5896 (Output_data_got::reserve_slot_for_global): New function.
5897 (Output_data_got::add_got_entry): New function.
5898 (Output_data_got::add_got_entry_pair): New function.
5899 (Output_section::add_output_section_data): Edit FIXME.
5900 * output.h
5901 (Output_section_data_build::Output_section_data_build): New
5902 constructor with size parameter.
5903 (Output_data_space::Output_data_space): Likewise.
5904 (Output_data_got::Output_data_got): Initialize new data member; new
5905 constructor with size parameter.
5906 (Output_data_got::add_constant): Call add_got_entry.
5907 (Output_data_got::reserve_slot): New function.
5908 (Output_data_got::reserve_slot_for_global): New function.
5909 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5910 (Output_data_got::add_got_entry): New function.
5911 (Output_data_got::add_got_entry_pair): New function.
5912 (Output_data_got::free_list_): New data member.
5913 * target.h (Sized_target::init_got_plt_for_update): New function.
5914 (Sized_target::register_global_plt_entry): New function.
5915 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5916 Initialize new data member; call init; add constructor with PLT count.
5917 (Output_data_plt_x86_64::init): New function.
5918 (Output_data_plt_x86_64::add_relocation): New function.
5919 (Output_data_plt_x86_64::reserve_slot): New function.
5920 (Output_data_plt_x86_64::free_list_): New data member.
5921 (Target_x86_64::init_got_plt_for_update): New function.
5922 (Target_x86_64::register_global_plt_entry): New function.
5923 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5924 incremental updates.
5925 (Output_data_plt_x86_64::add_relocation): New function.
5926 * testsuite/object_unittest.cc (Object_test): Set default options.
5927
ec69d6da
ILT
59282011-05-16 Ian Lance Taylor <iant@google.com>
5929
5930 * options.h (class General_options): Make -i a synonym for -r.
5931
732e31de
ILT
59322011-05-16 Ian Lance Taylor <iant@google.com>
5933
5934 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5935
403676b5
CC
59362011-05-10 Cary Coutant <ccoutant@google.com>
5937
5938 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5939 strip_all (-s).
5940
5b7b7d6e
ILT
59412011-05-06 Ian Lance Taylor <iant@google.com>
5942
5943 * layout.cc (Layout::layout): If the output section flags change,
5944 update the ordering.
5945
f0f9babf
CC
59462011-04-25 Cary Coutant <ccoutant@google.com>
5947
5948 * incremental-dump.cc (dump_incremental_inputs): Print local
5949 symbol info for each input file.
5950 * incremental.cc
5951 (Output_section_incremental_inputs::set_final_data_size): Add local
5952 symbol info to input file entries in incremental info.
5953 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5954 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5955 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5956 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5957 implementation.
5958 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5959 (Sized_incr_relobj::do_relocate): Write the local symbols.
5960 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5961 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5962 Adjust size of input file header.
5963 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5964 (Incremental_inputs_reader::get_local_symbol_count): New function.
5965 (Incremental_inputs_reader::get_input_section): Adjust size of input
5966 file header.
5967 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5968 (Sized_incr_relobj::This): New typedef.
5969 (Sized_incr_relobj::sym_size): New const data member.
5970 (Sized_incr_relobj::Local_symbol): New struct.
5971 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5972 (Sized_incr_relobj::do_local_symbol_offset): New function.
5973 (Sized_incr_relobj::local_symbol_count_): New data member.
5974 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5975 (Sized_incr_relobj::local_symbol_index_): New data member.
5976 (Sized_incr_relobj::local_symbol_offset_): New data member.
5977 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5978 (Sized_incr_relobj::local_symbols_): New data member.
5979 * object.h (Relobj::output_local_symbol_count): New function.
5980 (Relobj::local_symbol_offset): New function.
5981 (Relobj::do_output_local_symbol_count): New function.
5982 (Relobj::do_local_symbol_offset): New function.
5983 (Sized_relobj::do_output_local_symbol_count): New function.
5984 (Sized_relobj::do_local_symbol_offset): New function.
5985
d0a9ace3
ILT
59862011-04-22 Vladimir Simonov <sv@sw.ru>
5987
5988 * descriptors.cc (set_close_on_exec): New function.
5989 (Descriptors::open): Use set_close_on_exec.
5990 * output.cc (S_ISLNK): Define if not defined.
5991
94a3fc8b
CC
59922011-04-22 Cary Coutant <ccoutant@google.com>
5993
5994 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5995 global symbol map.
5996 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5997 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5998 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5999 relocations.
6000 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6001 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6002 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6003 * incremental.h
6004 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6005 function.
6006 (Incremental_binary::apply_incremental_relocs): New function.
6007 (Incremental_binary::do_apply_incremental_relocs): New function.
6008 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6009 data member.
6010 (Sized_incremental_binary::add_global_symbol): New function.
6011 (Sized_incremental_binary::global_symbol): New function.
6012 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6013 (Sized_incremental_binary::symbol_map_): New data member.
6014 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6015 * target.h (Sized_target::apply_relocation): New function.
6016 * target-reloc.h (apply_relocation): New function.
6017 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6018
c87e4302
DK
60192011-04-22 Doug Kwan <dougkwan@google.com>
6020
6021 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6022 flag of a SHT_ARM_EXIDX section.
2e702c99 6023 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6024 * testsuite/Makefile.in: Regenerate.
6025 * testsuite/arm_exidx_test.s: New file.
6026 * testsuite/arm_exidx_test.sh: Same.
6027
e7782cf6
CC
60282011-04-20 Cary Coutant <ccoutant@google.com>
6029
6030 PR gold/12689
6031 * archive.h (Incremental_archive_entry::Archive_member):
6032 Initialize arg_serial_ (second constructor).
6033
308ecdc7
ILT
60342011-04-17 Ian Lance Taylor <iant@google.com>
6035
6036 * object.cc (Relocate_info::location): Simplify location string.
6037 * errors.cc (Errors::error_at_location): Don't print program
6038 name.
6039 (Errors::warning_at_location): Likewise.
6040 (Errors::undefined_symbol): Likewise.
6041 * testsuite/debug_msg.sh: Update accordingly.
6042
bec5b579
CC
60432011-04-14 Cary Coutant <ccoutant@google.com>
6044
6045 * gold/layout.cc (Layout::symtab_section_offset): New function.
6046 * gold/layout.h (Layout::symtab_section_offset): New function.
6047 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6048
88597d34
ILT
60492011-04-12 Ian Lance Taylor <iant@google.com>
6050
6051 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6052 with MREMAP_MAYMOVE.
6053 * output.h (class Output_file): Add map_is_allocated_ field.
6054 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6055 not available, provide stubs. If mremap is not available, #define
6056 it to gold_mremap.
6057 (MREMAP_MAYMOVE): Define if not defined.
6058 (Output_file::Output_file): Initialize map_is_allocated_.
6059 (Output_file::resize): Check map_is_allocated_.
6060 (Output_file::map_anonymous): If mmap fails, use malloc.
6061 (Output_file::unmap): Don't do anything for an anonymous map.
6062 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6063 is not available, provide stubs.
6064 (File_read::View::~View): Use free rather than delete[].
6065 (File_read::make_view): Use malloc rather than new[]. If mmap
6066 fails, use malloc.
6067 (File_read::find_or_make_view): Use malloc rather than new[].
6068 * gold.h: Remove HAVE_REMAP code.
6069 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6070 exists. Rename mremap to gold_mremap. If mmap is not available
6071 don't do anything.
6072 * configure, config.in: Rebuild.
6073
11e361bc
ILT
60742011-04-11 Ian Lance Taylor <iant@google.com>
6075
6076 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6077 initialize local variable v.
6078
cdc29364
CC
60792011-04-11 Cary Coutant <ccoutant@google.com>
6080
6081 * archive.cc (Archive::include_member): Adjust call to
6082 report_object.
6083 (Add_archive_symbols::run): Track argument serial numbers.
6084 (Lib_group::include_member): Likewise.
6085 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6086 * archive.h (Incremental_archive_entry::Archive_member):
6087 Initialize arg_serial_.
6088 (Archive_member::arg_serial_): New data member.
6089 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6090 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6091 incremental link.
6092 (Sized_dynobj::do_for_all_local_got_entries): New function.
6093 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6094 function.
6095 * fileread.cc (get_mtime): New function.
6096 * fileread.h (get_mtime): New function.
6097 * gold.cc (queue_initial_tasks): Check for incremental update.
6098 (process_incremental_input): New function.
6099 (queue_middle_tasks): Don't force valid target for incremental
6100 update.
6101 * incremental-dump.cc (find_input_containing_global): Adjust
6102 size of symbol info entry.
6103 (dump_incremental_inputs): Dump argument serial number and
6104 in_system_directory flag; bias shndx by 1; print symbol names
6105 when dumping per-file symbol lists; use new symbol info readers.
6106 * incremental.cc
6107 (Output_section_incremental_inputs:update_data_size): New function.
6108 (Sized_incremental_binary::setup_readers): Setup input readers
6109 for each input file; build maps for files added from libraries
6110 and scripts.
6111 (Sized_incremental_binary::check_input_args): New function.
6112 (Sized_incremental_binary::do_check_inputs): Build map of argument
6113 serial numbers to input arguments.
6114 (Sized_incremental_binary::do_file_has_changed): Rename
6115 do_file_is_unchanged to this; compare file modification times.
6116 (Sized_incremental_binary::do_init_layout): New function.
6117 (Sized_incremental_binary::do_reserve_layout): New function.
6118 (Sized_incremental_binary::do_get_input_reader): Remove.
6119 (Sized_incremental_binary::get_symtab_view): New function.
6120 (Incremental_checker::can_incrementally_link_output_file): Remove.
6121 (Incremental_inputs::report_command_line): Exclude --debug options.
6122 (Incremental_inputs::report_archive_begin): Add parameter; track
6123 argument serial numbers; don't put input file entry for archive
6124 before archive members.
6125 (Incremental_inputs::report_archive_end): Put input file entry
6126 for archive after archive members.
6127 (Incremental_inputs::report_object): Add parameter; track argument
6128 serial numbers and in_system_directory flag.
6129 (Incremental_inputs::report_script): Add parameter; track argument
6130 serial numbers.
6131 (Output_section_incremental_inputs::set_final_data_size): Adjust
6132 size of symbol info entry; check for forwarding symbols.
6133 (Output_section_incremental_inputs::write_input_files): Write
6134 in_system_directory flag and argument serial number.
6135 (Output_section_incremental_inputs::write_info_blocks): Map section
6136 indices between incremental info and original input file; store
6137 input section index for each symbol.
6138 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6139 change operator() to visit().
6140 (class Global_got_offset_visitor): Likewise.
6141 (class Global_symbol_visitor_got_plt):
6142 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6143 classes.
6144 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6145 (Sized_incr_relobj::do_read_symbols): New function.
6146 (Sized_incr_relobj::do_layout): New function.
6147 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6148 (Sized_incr_relobj::do_add_symbols): New function.
6149 (Sized_incr_relobj::do_should_include_member): New function.
6150 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6151 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6152 (Sized_incr_relobj::do_section_size): New function.
6153 (Sized_incr_relobj::do_section_name): New function.
6154 (Sized_incr_relobj::do_section_contents): New function.
6155 (Sized_incr_relobj::do_section_flags): New function.
6156 (Sized_incr_relobj::do_section_entsize): New function.
6157 (Sized_incr_relobj::do_section_address): New function.
6158 (Sized_incr_relobj::do_section_type): New function.
6159 (Sized_incr_relobj::do_section_link): New function.
6160 (Sized_incr_relobj::do_section_info): New function.
6161 (Sized_incr_relobj::do_section_addralign): New function.
6162 (Sized_incr_relobj::do_initialize_xindex): New function.
6163 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6164 (Sized_incr_relobj::do_read_relocs): New function.
6165 (Sized_incr_relobj::do_gc_process_relocs): New function.
6166 (Sized_incr_relobj::do_scan_relocs): New function.
6167 (Sized_incr_relobj::do_count_local_symbols): New function.
6168 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6169 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6170 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6171 (Sized_incr_relobj::do_relocate): New function.
6172 (Sized_incr_relobj::do_set_section_offset): New function.
6173 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6174 (Sized_incr_dynobj::do_read_symbols): New function.
6175 (Sized_incr_dynobj::do_layout): New function.
6176 (Sized_incr_dynobj::do_add_symbols): New function.
6177 (Sized_incr_dynobj::do_should_include_member): New function.
6178 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6179 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6180 (Sized_incr_dynobj::do_section_size): New function.
6181 (Sized_incr_dynobj::do_section_name): New function.
6182 (Sized_incr_dynobj::do_section_contents): New function.
6183 (Sized_incr_dynobj::do_section_flags): New function.
6184 (Sized_incr_dynobj::do_section_entsize): New function.
6185 (Sized_incr_dynobj::do_section_address): New function.
6186 (Sized_incr_dynobj::do_section_type): New function.
6187 (Sized_incr_dynobj::do_section_link): New function.
6188 (Sized_incr_dynobj::do_section_info): New function.
6189 (Sized_incr_dynobj::do_section_addralign): New function.
6190 (Sized_incr_dynobj::do_initialize_xindex): New function.
6191 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6192 (make_sized_incremental_object): New function.
6193 (Incremental_library::copy_unused_symbols): New function.
6194 (Incremental_library::do_for_all_unused_symbols): New function.
6195 * incremental.h (enum Incremental_input_flags): New type.
6196 (class Incremental_checker): Remove.
6197 (Incremental_input_entry::Incremental_input_entry): Add argument
6198 serial number.
6199 (Incremental_input_entry::arg_serial): New function.
6200 (Incremental_input_entry::set_is_in_system_directory): New function.
6201 (Incremental_input_entry::is_in_system_directory): New function.
6202 (Incremental_input_entry::arg_serial_): New data member.
6203 (Incremental_input_entry::is_in_system_directory_): New data member.
6204 (class Script_info): Move here from script.h.
6205 (Script_info::Script_info): Add filename parameter.
6206 (Script_info::filename): New function.
6207 (Script_info::filename_): New data member.
6208 (Incremental_script_entry::Incremental_script_entry): Add argument
6209 serial number.
6210 (Incremental_object_entry::Incremental_object_entry): Likewise.
6211 (Incremental_object_entry::add_input_section): Build list of input
6212 sections with map to original shndx.
6213 (Incremental_object_entry::get_input_section_index): New function.
6214 (Incremental_object_entry::shndx_): New data member.
6215 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6216 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6217 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6218 serial number.
6219 (Incremental_inputs::report_archive_begin): Likewise.
6220 (Incremental_inputs::report_object): Likewise.
6221 (Incremental_inputs::report_script): Likewise.
6222 (class Incremental_global_symbol_reader): New class.
6223 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6224 and store flags and input file type.
6225 (Incremental_input_entry_reader::arg_serial): New function.
6226 (Incremental_input_entry_reader::type): Extract type from flags.
6227 (Incremental_input_entry_reader::is_in_system_directory): New function.
6228 (Incremental_input_entry_reader::get_input_section_count): Call
6229 accessor function for type.
6230 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6231 function for type; adjust size of global symbol entry.
6232 (Incremental_input_entry_reader::get_global_symbol_count): Call
6233 accessor function for type.
6234 (Incremental_input_entry_reader::get_object_count): Likewise.
6235 (Incremental_input_entry_reader::get_object_offset): Likewise.
6236 (Incremental_input_entry_reader::get_member_count): Likewise.
6237 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6238 (Incremental_input_entry_reader::get_member_offset): Likewise.
6239 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6240 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6241 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6242 (Incremental_input_entry_reader::get_global_symbol_reader): New
6243 function.
6244 (Incremental_input_entry_reader::get_output_symbol_index): New
6245 function.
6246 (Incremental_input_entry_reader::type_): Remove.
6247 (Incremental_input_entry_reader::flags_): New data member.
6248 (Incremental_inputs_reader::input_file_offset): New function.
6249 (Incremental_inputs_reader::input_file_index): New function.
6250 (Incremental_inputs_reader::input_file): Call input_file_offset.
6251 (Incremental_inputs_reader::input_file_at_offset): New function.
6252 (Incremental_relocs_reader::get_r_type): Reformat.
6253 (Incremental_relocs_reader::get_r_shndx): Reformat.
6254 (Incremental_relocs_reader::get_r_offset): Reformat.
6255 (Incremental_relocs_reader::data): New function.
6256 (Incremental_binary::Incremental_binary): Initialize new data members.
6257 (Incremental_binary::check_inputs): Add cmdline parameter.
6258 (Incremental_binary::file_is_unchanged): Remove.
6259 (Input_reader::arg_serial): New function.
6260 (Input_reader::get_unused_symbol_count): New function.
6261 (Input_reader::get_unused_symbol): New function.
6262 (Input_reader::do_arg_serial): New function.
6263 (Input_reader::do_get_unused_symbol_count): New function.
6264 (Input_reader::do_get_unused_symbol): New function.
6265 (Incremental_binary::input_file_count): New function.
6266 (Incremental_binary::get_input_reader): Change signature to use
6267 index instead of filename.
6268 (Incremental_binary::file_has_changed): New function.
6269 (Incremental_binary::get_input_argument): New function.
6270 (Incremental_binary::get_library): New function.
6271 (Incremental_binary::get_script_info): New function.
6272 (Incremental_binary::init_layout): New function.
6273 (Incremental_binary::reserve_layout): New function.
6274 (Incremental_binary::output_file): New function.
6275 (Incremental_binary::do_check_inputs): New function.
6276 (Incremental_binary::do_file_is_unchanged): Remove.
6277 (Incremental_binary::do_file_has_changed): New function.
6278 (Incremental_binary::do_init_layout): New function.
6279 (Incremental_binary::do_reserve_layout): New function.
6280 (Incremental_binary::do_input_file_count): New function.
6281 (Incremental_binary::do_get_input_reader): Change signature.
6282 (Incremental_binary::input_args_map_): New data member.
6283 (Incremental_binary::library_map_): New data member.
6284 (Incremental_binary::script_map_): New data member.
6285 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6286 new data members.
6287 (Sized_incremental_binary::output_section): New function.
6288 (Sized_incremental_binary::inputs_reader): Add const.
6289 (Sized_incremental_binary::symtab_reader): Add const.
6290 (Sized_incremental_binary::relocs_reader): Add const.
6291 (Sized_incremental_binary::got_plt_reader): Add const.
6292 (Sized_incremental_binary::get_symtab_view): New function.
6293 (Sized_incremental_binary::Inputs_reader): New typedef.
6294 (Sized_incremental_binary::Input_entry_reader): New typedef.
6295 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6296 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6297 (Sized_incremental_binary::do_file_has_changed): New function.
6298 (Sized_incremental_binary::do_init_layout): New function.
6299 (Sized_incremental_binary::do_reserve_layout): New function.
6300 (Sized_input_reader::Inputs_reader): Remove.
6301 (Sized_input_reader::Input_entry_reader): Remove.
6302 (Sized_input_reader::do_arg_serial): New function.
6303 (Sized_input_reader::do_get_unused_symbol_count): New function.
6304 (Sized_input_reader::do_get_unused_symbol): New function.
6305 (Sized_incremental_binary::do_input_file_count): New function.
6306 (Sized_incremental_binary::do_get_input_reader): Change signature;
6307 use index instead of filename.
6308 (Sized_incremental_binary::section_map_): New data member.
6309 (Sized_incremental_binary::input_entry_readers_): New data member.
6310 (class Sized_incr_relobj): New class.
6311 (class Sized_incr_dynobj): New class.
6312 (make_sized_incremental_object): New function.
6313 (class Incremental_library): New class.
6314 * layout.cc (Free_list::num_lists): New static data member.
6315 (Free_list::num_nodes): New static data member.
6316 (Free_list::num_removes): New static data member.
6317 (Free_list::num_remove_visits): New static data member.
6318 (Free_list::num_allocates): New static data member.
6319 (Free_list::num_allocate_visits): New static data member.
6320 (Free_list::init): New function.
6321 (Free_list::remove): New function.
6322 (Free_list::allocate): New function.
6323 (Free_list::dump): New function.
6324 (Free_list::print_stats): New function.
6325 (Layout_task_runner::run): Resize output file for incremental updates.
6326 (Layout::Layout): Initialize new data members.
6327 (Layout::set_incremental_base): New function.
6328 (Layout::init_fixed_output_section): New function.
6329 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6330 incremental updates.
6331 (Layout::create_gold_note): Do not create gold note section for
6332 incremental updates.
6333 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6334 for incremental updates.
6335 (Layout::set_section_offsets): For incremental updates, allocate space
6336 from free list.
6337 (Layout::create_symtab_sections): Layout with offsets relative to
6338 start of section; for incremental updates, allocate space from free
6339 list.
6340 (Layout::create_shdrs): For incremental updates, allocate space from
6341 free list.
6342 (Layout::finish_dynamic_section): For incremental updates, do not
6343 check --as-needed (fixed in subsequent patch).
6344 * layout.h (class Free_list): New class.
6345 (Layout::set_incremental_base): New function.
6346 (Layout::incremental_base): New function.
6347 (Layout::init_fixed_output_section): New function.
6348 (Layout::allocate): New function.
6349 (Layout::incremental_base_): New data member.
6350 (Layout::free_list_): New data member.
6351 * main.cc (main): Print Free_list statistics.
6352 * object.cc (Relobj::finalize_incremental_relocs): Add
6353 clear_counts parameter; clear counts only when clear_counts is set.
6354 (Sized_relobj::Sized_relobj): Initialize new base class.
6355 (Sized_relobj::do_layout): Don't report special sections.
6356 (Sized_relobj::do_for_all_local_got_entries): New function.
6357 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6358 symtab_off to all symbol table offsets.
6359 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6360 * object.h (class Got_offset_list): Move to top of file.
6361 (Object::Object): Allow case where input_file == NULL.
6362 (Object::~Object): Likewise.
6363 (Object::input_file): Assert that input_file != NULL.
6364 (Object::lock): Allow case where input_file == NULL.
6365 (Object::unlock): Likewise.
6366 (Object::is_locked): Likewise.
6367 (Object::token): Likewise.
6368 (Object::release): Likewise.
6369 (Object::is_incremental): New function.
6370 (Object::get_mtime): New function.
6371 (Object::for_all_local_got_entries): New function.
6372 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6373 (Object::set_is_in_system_directory): New function.
6374 (Object::is_in_system_directory): New function.
6375 (Object::do_is_incremental): New function.
6376 (Object::do_get_mtime): New function.
6377 (Object::do_for_all_local_got_entries): New function.
6378 (Object::is_in_system_directory_): New data member.
6379 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6380 (class Sized_relobj_base): New class.
6381 (class Sized_relobj): Derive from Sized_relobj_base.
6382 (class Sized_relobj::Symbols): Redeclare from base class.
6383 (class Sized_relobj::local_got_offset_list): Remove.
6384 (class Sized_relobj::Output_sections): Redeclare from base class.
6385 (class Sized_relobj::do_for_all_local_got_entries): New function.
6386 (class Sized_relobj::write_local_symbols): Add offset parameter.
6387 (class Sized_relobj::local_symbol_offset_): Update comment.
6388 (class Sized_relobj::local_dynsym_offset_): Update comment.
6389 * options.cc (Input_arguments::add_file): Remove const.
6390 * options.h (Input_file_argument::Input_file_argument):
6391 Initialize arg_serial_ (all constructors).
6392 (Input_file_argument::set_arg_serial): New function.
6393 (Input_file_argument::arg_serial): New function.
6394 (Input_file_argument::arg_serial_): New data member.
6395 (Input_arguments::Input_arguments): Initialize file_count_.
6396 (Input_arguments::add_file): Remove const.
6397 (Input_arguments::number_of_input_files): New function.
6398 (Input_arguments::file_count_): New data member.
6399 (Command_line::number_of_input_files): Call
6400 Input_arguments::number_of_input_files.
6401 * output.cc (Output_segment_headers::Output_segment_headers):
6402 Set current size.
6403 (Output_section::Input_section::current_data_size): New function.
6404 (Output_section::Output_section): Initialize new data members.
6405 (Output_section::add_input_section): Don't do merge sections for
6406 an incremental link; allocate space from free list for an
6407 incremental update.
6408 (Output_section::add_output_section_data): Allocate space from
6409 free list for an incremental update.
6410 (Output_section::update_data_size): New function.
6411 (Output_section::set_fixed_layout): New function.
6412 (Output_section::reserve): New function.
6413 (Output_segment::set_section_addresses): Remove const.
6414 (Output_segment::set_section_list_addresses): Remove const; allocate
6415 space from free list for an incremental update.
6416 (Output_segment::set_offset): Adjust size of RELRO segment for an
6417 incremental update.
6418 * output.h (Output_data::current_data_size): Move here from
6419 child classes.
6420 (Output_data::pre_finalize_data_size): New function.
6421 (Output_data::update_data_size): New function.
6422 (Output_section_headers::update_data_size): new function.
6423 (Output_section_data_build::current_data_size): Move to Output_data.
6424 (Output_data_strtab::update_data_size): New function.
6425 (Output_section::current_data_size): Move to Output_data.
6426 (Output_section::set_fixed_layout): New function.
6427 (Output_section::has_fixed_layout): New function.
6428 (Output_section::reserve): New function.
6429 (Output_section::update_data_size): New function.
6430 (Output_section::has_fixed_layout_): New data member.
6431 (Output_section::free_list_): New data member.
6432 (Output_segment::set_section_addresses): Remove const.
6433 (Output_segment::set_section_list_addresses): Remove const.
6434 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6435 New function.
6436 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6437 New function.
6438 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6439 parameter when calling Add_symbols constructor; store argument
6440 serial number for members of a lib group.
6441 (Add_symbols::locks): Allow case where token == NULL.
6442 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6443 (Read_member::~Read_member): New function.
6444 (Read_member::is_runnable): New function.
6445 (Read_member::locks): New function.
6446 (Read_member::run): New function.
6447 (Check_script::~Check_script): New function.
6448 (Check_script::is_runnable): New function.
6449 (Check_script::locks): New function.
6450 (Check_script::run): New function.
6451 (Check_library::~Check_library): New function.
6452 (Check_library::is_runnable): New function.
6453 (Check_library::locks): New function.
6454 (Check_library::run): New function.
6455 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6456 (Add_symbols::library_): New data member.
6457 (class Read_member): New class.
6458 (class Check_script): New class.
6459 (class Check_library): New class.
6460 * reloc.cc (Read_relocs::is_runnable): Allow case where
6461 token == NULL.
6462 (Read_relocs::locks): Likewise.
6463 (Scan_relocs::locks): Likewise.
6464 (Relocate_task::locks): Likewise.
6465 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6466 to clear counters.
6467 (Sized_relobj::incremental_relocs_scan): Fix comment.
6468 (Sized_relobj::do_relocate): Pass output file offset to
6469 write_local_symbols.
6470 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6471 from class declaration.
6472 * script.cc (read_input_script): Allocate Script_info; pass
6473 argument serial number to report_script.
6474 * script.h (class Script_info): Move to incremental.h.
6475 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6476 * symtab.h (Symbol_table::add_from_incrobj): New function.
6477 (Symbol_table::set_file_offset): New function.
6478
b961d0d7
CC
64792011-04-05 Cary Coutant <ccoutant@google.com>
6480
6481 * incremental-dump.cc (dump_incremental_inputs): Change signature
6482 to take a Sized_incremental_binary; change caller. Use readers
6483 in Sized_incremental_binary.
6484 * incremental.cc
6485 (Sized_incremental_binary::find_incremental_inputs_sections):
6486 Rename do_find_incremental_inputs_sections to this.
6487 (Sized_incremental_binary::setup_readers): New function.
6488 (Sized_incremental_binary::do_check_inputs): Check
6489 has_incremental_info_ flag; move setup code to setup_readers;
6490 use input readers.
6491 (Sized_incremental_binary::do_file_is_unchanged): New function.
6492 (Sized_incremental_binary::do_get_input_reader): New function.
6493 * incremental.h (class Incremental_binary): Move to end of file.
6494 (Incremental_binary::file_is_unchanged): New function.
6495 (Incremental_binary::do_file_is_unchanged): New function.
6496 (Incremental_binary::Input_reader): New class.
6497 (Incremental_binary::get_input_reader): New function.
6498 (class Sized_incremental_binary): Move to end of file.
6499 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6500 input section reader classes.
6501 (Sized_incremental_binary::has_incremental_info): New function.
6502 (Sized_incremental_binary::inputs_reader): New function.
6503 (Sized_incremental_binary::symtab_reader): New function.
6504 (Sized_incremental_binary::relocs_reader): New function.
6505 (Sized_incremental_binary::got_plt_reader): New function.
6506 (Sized_incremental_binary::do_file_is_unchanged): New function.
6507 (Sized_incremental_binary::Sized_input_reader): New class.
6508 (Sized_incremental_binary::get_input_reader): New function.
6509 (Sized_incremental_binary::find_incremental_inputs_sections):
6510 Rename do_find_incremental_inputs_sections to this.
6511 (Sized_incremental_binary::setup_readers): New function.
6512 (Sized_incremental_binary::has_incremental_info_): New data member.
6513 (Sized_incremental_binary::inputs_reader_): New data member.
6514 (Sized_incremental_binary::symtab_reader_): New data member.
6515 (Sized_incremental_binary::relocs_reader_): New data member.
6516 (Sized_incremental_binary::got_plt_reader_): New data member.
6517 (Sized_incremental_binary::current_input_file_): New data member.
6518
a869183f
PP
65192011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6520
6521 PR gold/12640
6522 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6523 violation.
6524
65252011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6526
6527 * archive.cc (Archive::include_member): Adjust call to report_object.
6528 (Add_archive_symbols::run): Add script_info to call to
6529 report_archive_begin.
6530 (Lib_group::include_member): Adjust call to report_object.
6531 (Add_lib_group_symbols::run): Adjust call to report_object.
6532 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6533 blocks. Add object count for script input files.
6534 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6535 script_info parameter; change all callers.
6536 (Incremental_inputs::report_object): Add script_info parameter;
6537 change all callers.
6538 (Incremental_inputs::report_script): Store backpointer to
6539 incremental info entry.
6540 (Output_section_incremental_inputs::set_final_data_size): Record
6541 additional information for scripts.
6542 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6543 * incremental.h (Incremental_script_entry::add_object): New function.
6544 (Incremental_script_entry::get_object_count): New function.
6545 (Incremental_script_entry::get_object): New function.
6546 (Incremental_script_entry::objects_): New data member; adjust
6547 constructor.
6548 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6549 (Incremental_inputs::report_object): Add script_info parameter.
6550 (Incremental_inputs_reader::get_object_count): New function.
6551 (Incremental_inputs_reader::get_object_offset): New function.
6552 * options.cc (Input_arguments::add_file): Return reference to
6553 new input argument.
6554 * options.h (Input_argument::set_script_info): New function.
6555 (Input_argument::script_info): New function.
6556 (Input_argument::script_info_): New data member; adjust all
6557 constructors.
6558 (Input_file_group::add_file): Return reference to new input argument.
6559 (Input_file_lib::add_file): Likewise.
6560 (Input_arguments::add_file): Likewise.
6561 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6562 * script.cc (Parser_closure::Parser_closure): Add script_info
6563 parameter; adjust all callers.
6564 (Parser_closure::script_info): New function.
6565 (Parser_closure::script_info_): New data member.
6566 (read_input_script): Report scripts earlier to incremental info.
6567 (script_add_file): Set script_info in Input_argument.
6568 (script_add_library): Likewise.
6569 * script.h (Script_options::Script_info): Rewrite class.
6570
a869183f 65712011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6572
6573 * archive.cc (Library_base::should_include_member): Move
6574 method here from class Archive.
6575 (Archive::Archive): Initialize base class.
6576 (Archive::should_include_member): Move to base class.
6577 (Archive::do_for_all_unused_symbols): New function.
6578 (Add_archive_symbols::run): Remove redundant access to
6579 incremental_inputs.
6580 (Lib_group::Lib_group): Initialize base class.
6581 (Lib_group::do_filename): New function.
6582 (Lib_group::include_member): Pass pointer to Lib_group to
6583 report_object.
6584 (Lib_group::do_for_all_unused_symbols): New function.
6585 (Add_lib_group_symbols::run): Report archive information for
6586 incremental links.
6587 * archive.h (class Library_base): New base class.
6588 (class Archive): Derive from Library_base.
6589 (Archive::filename): Move to base class.
6590 (Archive::set_incremental_info): Likewise.
6591 (Archive::incremental_info): Likewise.
6592 (Archive::Should_include): Likewise.
6593 (Archive::should_include_member): Likewise.
6594 (Archive::Armap_entry): Remove.
6595 (Archive::Unused_symbol_iterator): Remove.
6596 (Archive::unused_symbols_begin): Remove.
6597 (Archive::unused_symbols_end): Remove.
6598 (Archive::do_filename): New function.
6599 (Archive::do_get_mtime): New function.
6600 (Archive::do_for_all_unused_symbols): New function.
6601 (Archive::task_): Move to base class.
6602 (Archive::incremental_info_): Likewise.
6603 (class Lib_group): Derive from Library_base.
6604 (Lib_group::do_filename): New function.
6605 (Lib_group::do_get_mtime): New function.
6606 (Lib_group::do_for_all_unused_symbols): New function.
6607 (Lib_group::task_): Move to base class.
6608 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6609 function.
6610 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6611 function.
6612 * incremental.cc (Incremental_inputs::report_archive_begin):
6613 Use Library_base; call library's get_mtime; add incremental inputs
6614 entry before members.
6615 (class Unused_symbol_visitor): New class.
6616 (Incremental_inputs::report_archive_end): Use Library_base; use
6617 visitor class to record unused symbols; don't add incremental inputs
6618 entry after members.
6619 (Incremental_inputs::report_object): Use Library_base.
6620 * incremental.h
6621 (Incremental_archive_entry::Incremental_archive_entry): Remove
6622 unused Archive parameter.
6623 (Incremental_inputs::report_archive_begin): Use Library_base.
6624 (Incremental_inputs::report_archive_end): Likewise.
6625 (Incremental_inputs::report_object): Likewise.
6626 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6627 function.
6628 * object.h (Object::for_all_global_symbols): New function.
6629 (Object::do_for_all_global_symbols): New function.
6630 (Sized_relobj::do_for_all_global_symbols): New function.
6631 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6632 function.
6633 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6634 function.
6635
61ab3e40
ILT
66362011-03-27 Ian Lance Taylor <iant@google.com>
6637
6638 * archive.cc (Archive::interpret_header): Return -1 if something
6639 goes wrong. Change callers accordingly.
6640
30e1f9e6
CC
66412011-03-25 Cary Coutant <ccoutant@google.com>
6642
6643 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6644 * testsuite/Makefile.in: Regenerate.
6645
9370ce59 66462011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6647
6648 * plugin.cc (get_view): New.
6649 (Plugin::load): Pass get_view to the plugin.
6650 (Plugin_manager::get_view): New.
6651
9312bb0a
ILT
66522011-03-21 Ian Lance Taylor <iant@google.com>
6653
6654 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6655 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6656
7e12ba9e
ST
66572011-03-21 Sriraman Tallam <tmsriram@google.com>
6658
6659 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6660 Change == to -eq.
6661 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6662 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6663 Change == to -eq.
6664 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6665 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6666
fd7a005d
ILT
66672011-03-14 Ian Lance Taylor <iant@google.com>
6668
6669 * script-sections.cc (Sort_output_sections::script_compare):
6670 Rename from is_before, change return type.
6671 (Sort_output_sections::operator()): Adjust accordingly.
6672
ed16fd1b
ILT
66732011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6674
6675 PR gold/12572
6676 * testsuite/odr_violation2.cc: Add comment to make all error line
6677 numbers double digits.
6678 * testsuite/debug_msg.sh: Adjust expected errors.
6679
71ff8986
ILT
66802011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6681
6682 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6683 but mark earlier ones as non-canonical
6684 (offset_to_iterator): Update search target and example
6685 (do_addr2line): Return extra lines in a vector*
6686 (format_file_lineno): Extract from do_addr2line
6687 (one_addr2line): Add vector* out-param
6688 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6689 when a lineno entry appeared last for its instruction
6690 (Dwarf_line_info): Add vector* out-param
6691 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6692 * symtab.cc (Odr_violation_compare): Include the lineno in the
6693 comparison again.
6694 (linenos_from_loc): New. Combine the canonical line for an
6695 address with its other lines.
6696 (True_if_intersect): New. Helper functor to make
6697 std::set_intersection a query.
6698 (detect_odr_violations): Compare sets of lines instead of just
6699 one line for each function. This became less deterministic, but
6700 has fewer false positives.
6701 * symtab.h: Declarations.
6702 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6703 mix an optimized and non-optimized object in the same binary
6704 (odr_violation2.so): Same.
6705 * testsuite/Makefile.in: Regenerate from Makefile.am.
6706 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6707 * testsuite/debug_msg.sh: Update line numbers and add
6708 assertions.
6709 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6710 non-optimized context.
6711 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6712 isn't inlined, and use OdrDerived in an optimized context.
6713 * testsuite/odr_header1.h: Defines OdrDerived, where
6714 optimization will change the
6715 first-instruction-in-the-destructor's file and line number.
6716 * testsuite/odr_header2.h: Defines OdrBase.
6717
a19fefdc
ILT
67182011-03-09 Ian Lance Taylor <iant@google.com>
6719
6720 * fileread.cc (File_read::clear_views): Don't delete the whole
6721 file view.
6722
ecb351e9
ILT
67232011-03-08 Ian Lance Taylor <iant@google.com>
6724
6725 PR gold/12525
6726 * fileread.cc: #include <climits>.
6727 (GOLD_IOV_MAX): Define.
6728 (File_read::read_multiple): Limit number of entries by iov_max.
6729 * fileread.h (class File_read): Always set max_readv_entries to
6730 128.
6731
b821d13c
ILT
67322011-03-07 Ian Lance Taylor <iant@google.com>
6733
6734 PR gold/12525
6735 * options.h (class General_options): Add -dy and -dn.
6736
89243142
CC
67372011-03-02 Cary Coutant <ccoutant@google.com>
6738
6739 * testsuite/script_test_9.t: Add TLS segment.
6740
d0773f31
ILT
67412011-03-02 Simon Baldwin <simonb@google.com>
6742
6743 * configure.ac: Add check for gnu_indirect_function support in
6744 the toolchain building binutils.
6745 * configure: Rebuild.
6746
9370ce59 67472011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6748
6749 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6750 plugin only symbols.
6751 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6752 in plugin files as not needed in the symbol table.
6753
4cf7a849
ST
67542011-02-11 Sriraman Tallam <tmsriram@google.com>
6755
6756 * output.cc (Output_section::add_input_section): Delay fill
6757 generation for section ordering.
6758
b578bd7d
ILT
67592011-02-09 Ian Lance Taylor <iant@google.com>
6760
6761 PR gold/12316
6762 * object.h (class Sized_relobj): Remove clear_local_symbols.
6763 * reloc.cc (Sized_relobj::do_relocate): Don't call
6764 clear_local_symbols.
6765
9370ce59 67662011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6767
6768 * plugin.cc (is_visible_from_outside): Return true for symbols
6769 in the -u option.
6770
55382fb7
ILT
67712011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6772
6773 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6774 filename.
6775
4e271fff
ST
67762011-02-02 Sriraman Tallam <tmsriram@google.com>
6777
6778 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6779 to std::string.
4e271fff 6780 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6781 section_name to be std::string.
4e271fff
ST
6782 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6783
d433c3ac
ILT
67842011-01-25 Ian Lance Taylor <iant@google.com>
6785
6786 * script.cc (script_add_extern): Rewrite to use
6787 add_symbol_reference.
6788
880473a6
DK
67892011-01-25 Doug Kwan <dougkwan@google.com>
6790
d433c3ac 6791 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6792
f30f86fa
ILT
67932011-01-24 Ian Lance Taylor <iant@google.com>
6794
6795 * options.h (class General_options): Accept
6796 --no-detect-odr-violations.
6797
8e51a0b9
ILT
67982011-01-24 Ian Lance Taylor <iant@google.com>
6799
6800 * version.cc (version_string): Bump to 1.11.
6801
0f3b89d8
ILT
68022011-01-24 Ian Lance Taylor <iant@google.com>
6803
6804 * plugin.cc (class Plugin_rescan): Define new class.
6805 (Plugin_manager::claim_file): Set any_claimed_.
6806 (Plugin_manager::save_archive): New function.
6807 (Plugin_manager::save_input_group): New function.
6808 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6809 necessary.
6810 (Plugin_manager::new_undefined_symbol): New function.
6811 (Plugin_manager::rescan): New function.
6812 (Plugin_manager::rescannable_defines): New function.
6813 (Plugin_manager::add_input_file): Set any_added_.
6814 * plugin.h (class Plugin_manager): define new fields rescannable_,
6815 undefined_symbols_, any_claimed_, and any_added_. Declare
6816 Plugin_rescan as friend. Declare new functions.
6817 (Plugin_manager::Rescannable): Define type.
6818 (Plugin_manager::Rescannable_list): Define type.
6819 (Plugin_manager::Undefined_symbol_list): Define type.
6820 (Plugin_manager::Plugin_manager): Initialize new fields.
6821 * archive.cc (Archive::defines_symbol): New function.
6822 (Add_archive_symbols::run): Pass archive to plugins if any.
6823 * archive.h (class Archive): Declare defines_symbol.
6824 * readsyms.cc (Input_group::~Input_group): New function.
6825 (Finish_group::run): Pass input_group to plugins if any.
6826 * readsyms.h (class Input_group): Declare destructor.
6827 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6828 any.
6829
3bb951e5
ILT
68302011-01-10 Ian Lance Taylor <iant@google.com>
6831
6832 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6833 section as relro.
6834 (Layout::set_segment_offsets): Reset increase_relro before calling
6835 set_section_addresses a second time.
6836
0aa45fac
CC
68372011-01-04 Cary Coutant <ccoutant@google.com>
6838
6839 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6840 sections before NOBITS sections.
6841
0db46eb4
L
68422011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6843
6844 * version.cc (print_version): Update copyright to 2011.
6845
829c9745
CC
68462010-12-23 Cary Coutant <ccoutant@google.com>
6847
6848 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6849 of OS to this->add. Add OD parameter to second form of the function.
6850
7500420b
ILT
68512010-12-20 Ian Lance Taylor <iant@google.com>
6852
6853 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6854 second of two consecutive entries with same offset.
6855
f8e9a930
RW
68562010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6857
6858 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6859 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6860 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6861 to avoid unneeded links against $(LDADD).
6862 * testsuite/Makefile.in: Regenerate.
6863
2fbb4320
ILT
68642010-12-15 Ian Lance Taylor <iant@google.com>
6865
6866 PR gold/12324
6867 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6868 for R_X86_64_32 and R_X86_64_PC32.
6869 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6870 ver_matching_def_pic.o.
6871 (ver_matching_def_pic.o): New target.
6872
fedb228d
RW
68732010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6874
6875 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6876 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6877 Move definition before File_read::View member definitions.
6878 (File_read::View::~View): Initialize and hold lock before
6879 updating current_mapped_bytes.
6880
9b547ce6
RW
68812010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6882
6883 * dwarf_reader.cc: Remove outdated comment.
6884 * gold-threads.cc: Fix typo in error message.
6885 * archive.cc: Fix typos in comments.
6886 * archive.h: Likewise.
6887 * arm-reloc-property.cc: Likewise.
6888 * arm-reloc-property.h: Likewise.
6889 * arm-reloc.def: Likewise.
6890 * arm.cc: Likewise.
6891 * attributes.h: Likewise.
6892 * cref.cc: Likewise.
6893 * ehframe.cc: Likewise.
6894 * fileread.h: Likewise.
6895 * gold.h: Likewise.
6896 * i386.cc: Likewise.
6897 * icf.cc: Likewise.
6898 * incremental.h: Likewise.
6899 * int_encoding.cc: Likewise.
6900 * layout.h: Likewise.
6901 * main.cc: Likewise.
6902 * merge.h: Likewise.
6903 * object.cc: Likewise.
6904 * object.h: Likewise.
6905 * options.cc: Likewise.
6906 * readsyms.cc: Likewise.
6907 * reduced_debug_output.cc: Likewise.
6908 * reloc.cc: Likewise.
6909 * script-sections.cc: Likewise.
6910 * sparc.cc: Likewise.
6911 * symtab.h: Likewise.
6912 * target-reloc.h: Likewise.
6913 * target.cc: Likewise.
6914 * target.h: Likewise.
6915 * timer.cc: Likewise.
6916 * timer.h: Likewise.
6917 * x86_64.cc: Likewise.
6918
83e17bd5
CC
69192010-12-09 Cary Coutant <ccoutant@google.com>
6920
6921 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6922 stack.
6923 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6924 parameter; change all callers.
6925 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6926 * options.h (warn_execstack): New option.
6927
017257f8
DK
69282010-12-07 Doug Kwan <dougkwan@google.com>
6929
6930 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6931 like function call relocations.
6932
c20cbc06
ILT
69332010-12-07 Ian Lance Taylor <iant@google.com>
6934
6935 * archive.cc (Archive::get_elf_object_for_member): Permit
6936 punconfigured to be NULL.
6937 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6938 (Archive::include_member): Pass NULL to get_elf_object_for_member
6939 if we searched for the archive and this is the first included
6940 object.
6941
4dbfafcc
ILT
69422010-12-01 Ian Lance Taylor <iant@google.com>
6943
6944 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6945 track_relocs_type_ field.
6946 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6947 Set track_relocs_type_.
6948 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6949 contents when using RELA relocs.
6950 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6951 reloc_map_.
6952 * reloc.cc (Track_relocs::next_addend): New function.
6953 * reloc.h (class Track_relocs): Declare next_addend.
6954
e5e19edd
ILT
69552010-12-01 Ian Lance Taylor <iant@google.com>
6956
6957 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6958 virtual destructor.
6959
9a5ce24c
ILT
69602010-12-01 Ian Lance Taylor <iant@google.com>
6961
6962 * README: Update compilers known to work and fail.
6963
c7791212
NC
69642010-11-23 Matthias Klose <doko@ubuntu.com>
6965
6966 * configure.in: For --enable-gold, handle value `default' instead of
6967 `both*'. Always install ld as ld.bfd, install as ld if gold is
6968 not the default.
6969 * configure: Regenerate.
6970
0ad220c9
DK
69712010-11-18 Doug Kwan <dougkwan@google.com>
6972
6973 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6974 and right_alignment to be zero. Store result alignment only if it is
6975 greater than existing alignment.
6976
ab8056e0
CC
69772010-11-16 Cary Coutant <ccoutant@google.com>
6978
6979 PR gold/12220
6980 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6981 Check for ".zdebug_line".
6982
fd064a5b
CC
69832010-11-16 Doug Kwan <dougkwan@google.com>
6984 Cary Coutant <ccoutant@google.com>
6985
6986 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6987 by reference; adjust all callers.
6988 * output.cc (Output_segment::set_section_addresses): Adjust references
6989 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6990 list is empty.
6991 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6992 end at page boundary.
6993
6fc6ea19
CC
69942010-11-16 Cary Coutant <ccoutant@google.com>
6995
6996 PR gold/12220
6997 * layout.cc (Layout::choose_output_section): Transform names of
6998 compressed sections even when using a script with a SECTIONS clause.
6999 (Layout::output_section_name): Remove code to transform
7000 compressed debug section names.
7001 * output.cc (Output_section::add_input_section): Use uncompressed
7002 section size when tracking input sections.
7003
95a2c8d6
RS
70042010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7005
7006 * symtab.h (Symbol::NON_PIC_REF): Remove.
7007 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7008 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7009 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7010 (Symbol::use_plt_offset): Take a flags argument and pass it
7011 directly to needs_dynamic_reloc. Restrict check for undefined
7012 weak symbols to function calls.
7013 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7014 (Target_arm::Scan::global): Use it.
7015 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7016 (Target_arm::Relocate::relocate): Likewise.
7017 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7018 parameter with an r_type parameter. Use get_reference_flags
7019 to get the flags.
7020 (Target_arm::Relocate::relocate): Update accordingly.
7021 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7022 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7023 (Target_i386::Scan::global): Likewise.
7024 (Target_i386::Relocate::relocate): Likewise.
7025 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7026 parameter with an r_type parameter. Use get_reference_flags
7027 to get the flags.
7028 (Target_i386::Relocate::relocate): Update accordingly.
7029 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7030 (Target_powerpc::Scan::global): Use it.
7031 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7032 (Target_powerpc::Relocate::relocate): Likewise.
7033 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7034 (Target_sparc::Scan::global): Use it.
7035 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7036 (Target_sparc::Relocate::relocate): Likewise.
7037 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7038 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7039 (Target_x86_64::Scan::global): Likewise.
7040 (Target_x86_64::Relocate::relocate): Likewise.
7041
f625ae50
DK
70422010-11-08 Doug Kwan <dougkwan@google.com>
7043 Cary Coutant <ccoutant@google.com>
7044
7045 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7046 (Arm_exidx_merge_section::section_contents_): New data member.
7047 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7048 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7049 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7050 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7051 in parameters instead of calling Object::section_contents without
7052 locking.
7053 (Arm_output_section::group_section): New parameter TASK. Pass it
7054 to callees that need locking objects.
7055 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7056 to lock EXIDX input sections. Fix a formatting issue. Call
7057 Arm_exidx_merged_section::build_contents to create merged section
7058 contents.
7059 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7060 to lock object of stub table owner.
7061 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7062 TEXT_SIZE to initialize data member TEXT_SIZE_.
7063 (Arm_exidx_input_section::addralign): Fix typo in comment.
7064 (Arm_exidx_input_section::text_size): New method.
7065 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7066 that require locking objects. Lock objects before scanning for stubs
7067 and updating local symbols.
7068 (Arm_input_section<big_endian>::init): Copy contents of original
7069 input section.
2e702c99 7070 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7071 original input section instead of calling Object::section_contents
7072 without locking.
7073 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7074 size without calling Object::section_size().
7075 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7076 for size. Allocate a buffer for merged EXIDX entries.
7077 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7078 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7079 building code to Arm_exidx_merged_section::build_contetns. Write
7080 out contetns in buffer instead of building it on the fly.
7081 (Arm_relobj::make_exidx_input_section): Also pass text section size
7082 to Arm_exidx_input_section constructor.
7083 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7084 (Arm_dynobj::do_read_symbols): Fix memory leak.
7085 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7086 * target.h: (class Task): Add forward declaration.
7087 (Target::relax): Add new parameter TASK and pass it to
7088 Target::do_relax().
7089 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7090
5f9bcf58
CC
70912010-11-05 Cary Coutant <ccoutant@google.com>
7092
7093 PR gold/10708
7094 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7095 object when reading from the file.
7096 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7097 second layout pass.
7098 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7099 when reading section contents.
7100 (get_section_contents): Likewise.
7101 (icf::find_identical_sections): Likewise.
7102 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7103 object when reading from the file.
7104 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7105 the object when doing deferred section layout.
7106
e597fa08
NC
71072010-11-03 Nick Clifton <nickc@redhat.com>
7108
7109 PR gold/12001
7110 * script.h (class Symbol_assignment: name): New member. Returns
7111 the name of the symbol.
7112 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7113 Returns true if the given symbol name is on the list of
7114 assignments wating to be processed.
7115 * archive.cc (should_incldue_member): If the symbol is undefined,
7116 check to see if it is on the list of symbols pending assignment.
7117
3f9a3278
ILT
71182010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7119
7120 * script-sections.cc (Script_sections::find_memory_region): Check
7121 for a NULL output section pointer.
7122
d06fb4d1
DK
71232010-10-29 Doug Kwan <dougkwan@google.com>
7124
7125 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7126 Output_section::add_relaxed_input_section.
7127 * output.cc (Output_section::add_relaxed_input_section): Add new
7128 arguments LAYOUT and NAME. Set section order index.
7129 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7130 Copy section order index.
7131 * output.h (Output_section::add_relaxed_input_section): Add new
7132 arguments LAYOUT and NAME.
7133
90e24de5
ILT
71342010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7135
7136 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7137 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7138 * testsuite/Makefile.in: Regenerate.
7139
c9484ea5
DK
71402010-10-20 Doug Kwan <dougkwan@google.com>
7141
7142 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7143 without SHF_LINK_ORDER flags.
7144 * layout.cc (Layout::choose_output_section): Do not filter
7145 SHF_LINK_ORDER flag in a relocatable link.
7146
5bc2f5be
CC
71472010-10-17 Cary Coutant <ccoutant@google.com>
7148
7149 * output.h (Output_segment::set_section_addresses): Change function
7150 signature. Update all callers.
7151 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7152 sections.
7153 (Output_segment::set_section_addresses): Align after last TLS
7154 section. Add padding before last relro section instead of after.
7155
0c91cf04
DK
71562010-10-17 Doug Kwan <dougkwan@google.com>
7157
7158 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7159 GOT output section to be writable.
7160
8c21d9d3
CC
71612010-10-14 Cary Coutant <ccoutant@google.com>
7162
7163 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7164 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7165 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7166 mode.
7167 * incremental.cc (report_command_line): Ignore all forms of
7168 --incremental.
7169 * layout.cc (Layout::Layout): Check parameters for incremental link
7170 mode.
7171 * options.cc (General_options::parse_incremental): New function.
7172 (General_options::parse_no_incremental): New function.
7173 (General_options::parse_incremental_full): New function.
7174 (General_options::parse_incremental_update): New function.
7175 (General_options::incremental_mode_): New data member.
7176 (General_options::finalize): Check incremental_mode_.
7177 * options.h (General_options): Update help text for --incremental.
7178 Add --no-incremental, --incremental-full, --incremental-update.
7179 (General_options::Incremental_mode): New enum type.
7180 (General_options::incremental_mode): New function.
7181 (General_options::incremental_mode_): New data member.
7182 * parameters.cc (Parameters::incremental_mode_): New data member.
7183 (Parameters::set_options): Set incremental_mode_.
7184 (Parameters::set_incremental_full): New function.
7185 (Parameters::incremental): New function.
7186 (Parameters::incremental_update): New function.
7187 (set_parameters_incremental_full): New function.
7188 * parameters.h (Parameters::set_incremental_full): New function.
7189 (Parameters::incremental): New function.
7190 (Parameters::incremental_update): New function.
7191 (Parameters::incremental_mode_): New data member.
7192 (set_parameters_incremental_full): New function.
7193 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7194 incremental link mode.
7195 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7196 (Sized_relobj::do_relocate_sections): Likewise.
7197 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7198 option.
7199 * testsuite/Makefile.in: Regenerate.
7200 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7201
bb32aa18 72022010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7203
7204 * script-sections.h (class Script_sections): Make
7205 Sections_elements typedef public.
7206 * script-sections.cc (class Sort_output_sections): Add elements_
7207 field. Add constructor which sets it; change all callers.
7208 (Sort_output_sections::is_before): New function.
7209 (Sort_output_sections::operator()): Call is_before.
7210 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7211 conditional.
7212 * testsuite/script_test_10.sh: New test. Test script section
7213 order.
7214 * testsuite/script_test_10.t: Likewise.
7215 * testsuite/script_test_10.s: Likewise.
7216 * testsuite/Makefile.am: Wrap the cross linker tests and the
7217 common tests into NATIVE_OR_CROSS_LINKER.
7218 (check_SCRIPTS): Add script_test_10.sh.
7219 (check_DATA): Add script_test_10.stdout.
7220 (script_test_10.o, script_test_10): New targets.
7221 (script_test_10.stdout): New target.
7222 * configure, testsuite/Makefile.in: Regenerate.
7223
3cef7179
ILT
72242010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7225
7226 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7227 error for the deprecated relocations.
7228 (Target_arm::Scan::global): Likewise.
7229 (Target_arm::Relocate::relocate): Likewise.
7230
7411e9a8
RS
72312010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7232
7233 * fileread.cc (Input_file::find_file): Initialize *found_name
7234 and *namep when using the fallback search for case 4.
7235
6a9da32a
CC
72362010-10-11 Cary Coutant <ccoutant@google.com>
7237
7238 * options.h (class General_options): Redefine -z lazy as an alias for
7239 the negation of -z now.
7240
ac897c20
ILT
72412010-10-11 Ian Lance Taylor <iant@google.com>
7242
7243 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7244 binding.
7245
ea5cae92
NC
72462010-10-06 Nick Clifton <nickc@redhat.com>
7247
7248 * script-sections.cc(class Memory_region): Remove
7249 current_lma_offset_ field. Rename current_vma_offset_ to
7250 current_offset_. Add last_section_ field.
7251 (Memory_region::get_current_vma_address): Rename to
7252 get_current_address.
7253 (Memory_region::get_current_lma_address): Delete.
7254 (Memory_region::increment_vma_offset): Rename to
7255 increment_offset.
7256 (Memory_region::increment_lma_offset): Delete.
7257 (Memory_region::attributes_compatible): New method. Returns
7258 true if the provided section is compatible with the region.
7259 (Memory_region::get_last_section): New method. Returns the last
7260 section to use the region.
7261 (Memory_region::set_last_section): New method. Stores the last
7262 section to use the region.
7263 (Script_sections::block_in_region): New method. Returns true if
7264 a block of memory is contained within a region.
7265 (Script_sections::find_memory_region): New method. Locates a
7266 memory region to be used to set a VMA or LMA address.
7267 (Output_section_definition::set_section_addresses): Add code to
7268 check for addresses set by memory regions.
7269 (Output_segment::set_section_addresses): Remove memory region
7270 walking code.
7271 (Script_sections::create_segment): Add a warning if a header
7272 segment is created outside of any region.
7273 * script-sections.h (class Script_sections): Add prototypes for
7274 find_memory_region and block_in_region methods.
7275 * testsuite/memory_test.s: Use .long instead of .word.
7276 * testsuite/memory_test.t: Add some more output sections.
7277 * testsuite/memory_test.sh: Update expected output.
7278
a9bfd952
DK
72792010-10-02 Doug Kwan <dougkwan@google.com>
7280
7281 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7282 defintion to symtab.h
7283 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7284 declaration to defintion.
7285
bacff3ab
NC
72862010-10-01 Nick Clifton <nickc@redhat.com>
7287
7288 * expression.cc (eval): Replace dummy argument with NULL.
7289 (eval_maybe_dot): Check for a NULL result section pointer.
7290 (Symbol_expression::value): Likewise.
7291 (Dot_expression::value): Likewise.
7292 (BINARY_EXPRESSION): Likewise.
7293 (Max_expression::value): Likewise.
7294 (Min_expression::value): Likewise.
7295 (Absolute_expression::value): Likewise.
7296 (Addr_expression::value_from_output_section): Likewise.
7297 (Loaddddr_expression::value_from_output_section): Likewise.
7298 (Segment_start_expression::value): Likewise.
7299 * script-sections.cc
7300 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7301 argument with NULL.
7302 (Sections_elememt_dot_assignment::set_section_addresses):
7303 Likewise.
7304 (Output_data_expression::do_write_to_buffer): Likewise.
7305 (Output_section_definition::finalize_symbols): Likewise.
7306 (Output_section_definition::set_section_addresses): Likewise.
7307
f81bc8b5
DK
73082010-09-30 Doug Kwan <dougkwan@google.com>
7309
7310 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7311
c95e9f27
ST
73122010-09-28 Sriraman Tallam <tmsriram@google.com>
7313
7314 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7315 function.
c95e9f27
ST
7316 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7317 virtual function.
7318 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7319 virtual function.
7320 * icf.cc (get_section_contents): Inline merge sections only when
7321 target allows it.
7322
3cac54d2
RW
73232010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7324
7325 * configure: Regenerate.
7326
2904037a
ILT
73272010-09-17 Ian Lance Taylor <iant@google.com>
7328
7329 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7330 * testsuite/Makefile.am (memory_test.o): New target.
7331 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7332 memory_test.t.
7333 * testsuite/Makefile.in: Rebuild.
2904037a 7334
bca7fb63
DK
73352010-09-17 Doug Kwan <dougkwan@google.com>
7336
7337 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7338 defintion if relocation uses GOT entries of the symbol.
7339 * testsuite/icf_safe_test.sh: Fix test.
7340 * testsuite/icf_safe_so_test.sh: Fix test.
7341
4ef28648
CC
73422010-09-16 Cary Coutant <ccoutant@google.com>
7343
7344 * script_sections.cc (class Memory_region): Remove "NULL" from
7345 vector initializations.
7346
793990de
CC
73472010-09-15 Cary Coutant <ccoutant@google.com>
7348
7349 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7350 Resolve forwarding symbols.
7351
81e015e2
DK
73522010-09-15 Doug Kwan <dougkwan@google.com>
7353
7354 * gold/testsuite/script_test_3.t: Add ARM special sections.
7355 * gold/testsuite/script_test_4.t: Same.
7356 * gold/testsuite/script_test_5.t: Same.
7357 * gold/testsuite/script_test_6.t: Same.
7358 * gold/testsuite/script_test_7.t: Same.
7359 * gold/testsuite/script_test_7.t: Same.
7360 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7361
36171d64
CC
73622010-09-14 Cary Coutant <ccoutant@google.com>
7363
7364 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7365 (Target_x86_64::Relocate::relocate_tls): Replace check for
7366 saw_tls_block_reloc_ with test for executable section.
7367
d89051bd
CC
73682010-09-12 Cary Coutant <ccoutant@google.com>
7369
7370 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7371 position-independent executables to shared libraries need dynamic
7372 relocations.
7373 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7374 position-independent executables.
7375 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7376 * testsuite/Makefile.in: Regenerate.
7377
fca41f0f
NC
73782010-09-10 Nick Clifton <nickc@redhat.com>
7379
7380 PR gold/11997
7381 * testsuite/memory_test.t: Discard any sections that are not
7382 needed.
7383
6695e4b3
L
73842010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7385
7386 PR gold/11996
7387 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7388 "This::" to work around a bug in gcc 4.2.
7389
7390 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7391
0f72bf6f
RÁE
73922010-09-09 Rafael Espindola <espindola@google.com>
7393
7394 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7395 sections with different PF_X flags in the same segment.
7396 (Layout::find_first_load_seg): Search all segments to find the first
7397 one.
7398 * options.h (rosegment): New.
7399
74002010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7401
05a79166 7402 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7403
aa98ff75
DK
74042010-09-08 Doug Kwan <dougkwan@google.com>
7405
7406 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7407 (Arm_relobj::do_relocate_sections): Add new parameter for output
7408 file to match the parent.
7409 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7410 of local symbols instead of input values. Update code to track
7411 changes in gold::relocate_section.
7412 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7413 (Sized_relobj::compute_final_local_value_internal): New methods.
7414 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7415 body into private version of Sized_relobj::compute_final_local_value.
7416 Call the inline method.
7417 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7418 merged symbol value if there is one.
7419 (Symbol_value::has_output_value): New method defintiion.
7420 (Sized_relobj::Compute_final_local_value_status): New enum type.
7421 (Sized_relobj::compute_final_local_value): New methods.
7422 (Sized_relobj::compute_final_local_value_internal): New methods.
7423 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7424 and arm_cortex_a8.sh.
7425 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7426 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7427 New tests.
7428 * Makefile.in: Regenerate.
7429 * testsuite/arm_bl_out_of_range.s: Update test.
7430 * testsuite/thumb_bl_out_of_range.s: Ditto.
7431 * testsuite/thumb_blx_out_of_range.s: Ditto.
7432 * testsuite/arm_branch_out_of_range.sh: New file.
7433 * testsuite/arm_cortex_a8.sh: Ditto.
7434 * testsuite/arm_cortex_a8_b.s: Ditto.
7435 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7436 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7437 * testsuite/arm_cortex_a8_bl.s: Ditto.
7438 * testsuite/arm_cortex_a8_blx.s: Ditto.
7439 * testsuite/arm_cortex_a8_local.s: Ditto.
7440 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7441 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7442
05a79166
L
74432010-09-08 Rafael Espindola <espindola@google.com>
7444
7445 * Makefile.am (memory_test.stdout): Run readelf with -W.
7446 * Makefile.in: Regenerate.
7447 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7448 64 bit output.
7449
33dbc701
RÁE
74502010-09-08 Rafael Espindola <espindola@google.com>
7451
7452 * script-sections.cc (Script_sections::add_memory_region): Convert
7453 field precision to int.
7454 * script.cc (script_set_section_region, script_set_section_region):
7455 Convert field precision to int.
7456
731ca54a
RÁE
74572010-09-08 Rafael Espindola <espindola@google.com>
7458
7459 * arm.cc (do_finalize_sections): Create the __exidx_start and
7460 __exdix_end symbols even when the section is missing.
7461
7f8cd844
NC
74622010-09-08 Nick Clifton <nickc@redhat.com>
7463
7464 * README: Remove claim that MEMORY is not supported.
7465 * expression.cc (script_exp_function_origin)
7466 (script_exp_function_length): Move from here to ...
7467 * script.cc: ... here.
7468 (script_set_section_region, script_add_memory)
7469 (script_parse_memory_attr, script_include_directive): New
7470 functions.
7471 * script-sections.cc
7472 (class Memory_region): New class.
7473 (class Output_section_definition): Add set_memory_region,
7474 set_section_vma, set_section_lma and get_section_name methods.
7475 (class Script_Sections): Add add_memory_region,
7476 find_memory_region, find_memory_region_origin,
7477 find_memory_region_length and set_memory_region methods.
7478 Have set_section_addresses method walk the list of set memory
7479 regions.
7480 Extend the print methos to display memory regions.
7481 * script-sections.h: Add prototypes for new methods.
7482 Add enum for MEMORY region attributes.
7483 * yyscript.y: Add support for parsing MEMORY regions.
7484 * script-c.h: Add prototypes for new functions.
7485 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7486 * testsuite/Makefile.in: Regenerate.
7487 * testsuite/memory_test.sh: New script.
7488 * testsuite/memory_test.s: New assembler source file.
7489 * testsuite/memory_test.t: New linker script.
7490
a4649286
DK
74912010-08-27 Doug Kwan <dougkwan@google.com>
7492
7493 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7494 reference override an existing dynamic weak reference.
7495 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7496 * testsuite/Makefile.in: Regenerate.
7497 * testsuite/dyn_weak_ref.sh: New file.
7498 * testsuite/dyn_weak_ref_1.c: Ditto.
7499 * testsuite/dyn_weak_ref_2.c: Ditto.
7500
b56648ad
ILT
75012010-08-27 Ian Lance Taylor <iant@google.com>
7502
7503 * incremental.h (class Incremental_input_entry): Add virtual
7504 destructor.
7505
809313cb
ILT
75062010-08-27 Ian Lance Taylor <iant@google.com>
7507
7508 * testsuite/start_lib_test_3.c: Mark t3 as used.
7509
11e32464
NC
75102010-08-27 Nick Clifton <nickc@redhat.com>
7511
7512 * options.cc (version_script): Fix small typo in previous
7513 whitespace tidyup.
7514
ca09d69a
NC
75152010-08-25 Nick Clifton <nickc@redhat.com>
7516
7517 * archive.cc: Formatting fixes: Remove whitespace between
7518 typename and following asterisk. Remove whitespace between
7519 function name and opening parenthesis.
7520 * archive.h: Likewise.
7521 * arm.cc: Likewise.
7522 * attributes.cc: Likewise.
7523 * attributes.h: Likewise.
7524 * common.cc: Likewise.
7525 * copy-relocs.cc: Likewise.
7526 * dirsearch.h: Likewise.
7527 * dynobj.cc: Likewise.
7528 * ehframe.cc: Likewise.
7529 * ehframe.h: Likewise.
7530 * expression.cc: Likewise.
7531 * fileread.cc: Likewise.
7532 * fileread.h: Likewise.
7533 * gc.h: Likewise.
7534 * gold-threads.cc: Likewise.
7535 * gold.cc: Likewise.
7536 * i386.cc: Likewise.
7537 * icf.h: Likewise.
7538 * incremental-dump.cc: Likewise.
7539 * incremental.cc: Likewise.
7540 * layout.cc: Likewise.
7541 * layout.h: Likewise.
7542 * main.cc: Likewise.
7543 * merge.cc: Likewise.
7544 * merge.h: Likewise.
7545 * object.cc: Likewise.
7546 * object.h: Likewise.
7547 * options.cc: Likewise.
7548 * options.h: Likewise.
7549 * output.cc: Likewise.
7550 * output.h: Likewise.
7551 * plugin.cc: Likewise.
7552 * plugin.h: Likewise.
7553 * powerpc.cc: Likewise.
7554 * reloc.cc: Likewise.
7555 * script-c.h: Likewise.
7556 * script-sections.cc: Likewise.
7557 * script.cc: Likewise.
7558 * stringpool.cc: Likewise.
7559 * symtab.cc: Likewise.
7560 * symtab.h: Likewise.
7561 * target.cc: Likewise.
7562 * timer.cc: Likewise.
7563 * timer.h: Likewise.
7564 * version.cc: Likewise.
7565 * x86_64.cc: Likewise.
7566
b8fa8750
NC
75672010-08-24 Nick Clifton <nickc@redhat.com>
7568
7569 PR 11899
7570 * layout.cc (segment_precedes): Sort segments by their physical
7571 addresses, if they have been set.
7572
9919d93b
CC
75732010-08-23 Cary Coutant <ccoutant@google.com>
7574
7575 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7576 symbols data.
7577 (Lib_group::include_member): Unlock object after deleting its
7578 symbols data.
7579 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7580 the bug fixed here.
7581
97b4be1c
CC
75822010-08-19 Neil Vachharajani <nvachhar@google.com>
7583 Cary Coutant <ccoutant@google.com>
7584
7585 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7586 constructor, and set_blocker.
7587 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7588 readsyms_blocker_.
7589 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7590 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7591 * testsuite/Makefile.am (start_lib_test): New test case.
7592 * testsuite/Makefile.in: Regenerate.
7593 * testsuite/start_lib_test_main.c: New file.
7594 * testsuite/start_lib_test_1.c: New file.
7595 * testsuite/start_lib_test_2.c: New file.
7596 * testsuite/start_lib_test_3.c: New file.
7597
dd0b1884
ILT
75982010-08-19 Ian Lance Taylor <iant@google.com>
7599
7600 * Makefile.in: Rebuild with automake 1.11.1.
7601 * aclocal.m4: Likewise.
7602 * testsuite/Makefile.in: Likewise.
7603
7223e9ca
ILT
76042010-08-19 Ian Lance Taylor <iant@google.com>
7605
7606 PR 10893
7607 * i386.cc (class Output_data_plt_i386): Update declarations.
7608 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7609 local_ifuncs_ fields.
7610 (Target_i386::do_plt_section_for_global): New function.
7611 (Target_i386::do_plt_section_for_local): New function.
7612 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7613 parameter; change all callers. Initialize global_ifuncs_ and
7614 local_ifuncs_. If doing a static link define __rel_iplt_start and
7615 __rel_iplt_end.
7616 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7617 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7618 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7619 symbols.
7620 (Target_i386::make_plt_section): New function, broken out of
7621 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7622 (Target_i386::make_plt_entry): Call make_plt_section.
7623 (Target_i386::make_local_ifunc_plt_entry): New function.
7624 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7625 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7626 R_386_IRELATIVE to switch.
7627 (Target_i386::Scan::global): Likewise.
7628 (Target_i386::Relocate::relocate): Likewise.
7629 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7630 switch.
7631 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7632 (Target_x86_64::do_plt_section_for_global): New function.
7633 (Target_x86_64::do_plt_section_for_local): New function.
7634 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7635 parameter; change all callers. If doing a static link define
7636 __rela_iplt_start and __rela_iplt_end.
7637 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7638 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7639 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7640 to point to .plt.
7641 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7642 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7643 switch.
7644 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7645 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7646 R_X86_64_IRELATIVE to switch.
7647 (Target_x86_64::Scan::global): Likewise.
7648 (Target_x86_64::Relocate::relocate): Likewise.
7649 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7650 switch.
7651 * target.h (class Target): Add plt_section_for_global and
7652 plt_section_for_local functions. Add do_plt_section_for_global
7653 and do_plt_section_for_local virtual functions.
7654 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7655 clarifying comments.
7656 (Symbol::use_plt_offset): Handle IFUNC symbol.
7657 * object.cc (Sized_relobj::Sized_relobj): Initialize
7658 local_plt_offsets_.
7659 (Sized_relobj::local_has_plt_offset): New function.
7660 (Sized_relobj::local_plt_offset): New function.
7661 (Sized_relobj::set_local_plt_offset): New function.
7662 (Sized_relobj::do_count): Handle IFUNC symbol.
7663 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7664 a bit away from input_shndx_ field. Add set_is_func_symbol and
7665 is_ifunc_symbol functions.
7666 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7667 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7668 local_plt_offsets_ field.
7669 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7670 * output.h (class Output_section_data): Add non-const
7671 output_section function.
7672 (class Output_data_got): Update declarations.
7673 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7674 Add use_plt_offset parameter to global and local constructors.
7675 Change all callers. Change local_sym_index_ field to 31 bits.
7676 Change GSYM_CODE and CONSTANT_CODE accordingly.
7677 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7678 doing a static link don't set sh_link field.
7679 (Output_data_got::Got_entry::write): Use PLT offset if
7680 appropriate.
7681 (Output_data_got::add_global_plt): New function.
7682 (Output_data_got::add_local_plt): New function.
7683 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7684 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7685 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7686 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7687 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7688 IFUNC conditional.
7689 * testsuite/ifunc-sel.h: New file.
7690 * testsuite/ifuncmain1.c: New file.
7691 * testsuite/ifuncmain1vis.c: New file.
7692 * testsuite/ifuncmod1.c: New file.
7693 * testsuite/ifuncdep2.c: New file.
7694 * testsuite/ifuncmain2.c: New file.
7695 * testsuite/ifuncmain3.c: New file.
7696 * testsuite/ifuncmod3.c: New file.
7697 * testsuite/ifuncmain4.c: New file.
7698 * testsuite/ifuncmain5.c: New file.
7699 * testsuite/ifuncmod5.c: New file.
7700 * testsuite/ifuncmain6pie.c: New file.
7701 * testsuite/ifuncmod6.c: New file.
7702 * testsuite/ifuncmain7.c: New file.
7703 * configure, testsuite/Makefile.in: Rebuild.
7704
56f75c03
ILT
77052010-08-18 Ian Lance Taylor <iant@google.com>
7706
7707 * incremental.cc
7708 (Output_section_incremental_inputs::write_input_files): Add cast
7709 to avoid signed/unsigned comparison warning.
7710 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7711
55455f89
CC
77122010-08-12 Cary Coutant <ccoutant@google.com>
7713
7714 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7715
e2054bcb
ILT
77162010-08-13 Ian Lance Taylor <iant@google.com>
7717
7718 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7719
74f67560
DK
77202010-08-12 Cary Coutant <ccoutant@google.com>
7721 Doug Kwan <dougkwan@google.com>
7722
7723 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7724 defintion overrides non-weak undef, remember that the original undef
7725 is not weak.
7726 * symtab.cc (Symbol_table::sized_write_global): For undef without
7727 an original weak binding, set binding to global in output.
7728 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7729 * testsuite/Makefile.in: Regenerate.
7730 * testsuite/strong_ref_weak_def.sh: New file.
7731 * testsuite/strong_ref_weak_def_1.c: Ditto.
7732 * testsuite/strong_ref_weak_def_2.c: Ditto.
7733
d1238d12
CC
77342010-08-12 Cary Coutant <ccoutant@google.com>
7735
7736 * testsuite/incremental_test.sh: Rewrite.
7737 * testsuite/incremental_test_1.c: Rewrite.
7738 * testsuite/incremental_test_2.c: Rewrite.
7739
0e70b911
CC
77402010-08-12 Cary Coutant <ccoutant@google.com>
7741
7742 * arm.cc (Target_arm::got_size): Add const.
7743 (Target_arm::got_entry_count): New function.
7744 (Target_arm::plt_entry_count): New function.
7745 (Target_arm::first_plt_entry_offset): New function.
7746 (Target_arm::plt_entry_size): New function.
7747 (Output_data_plt_arm::entry_count): New function.
7748 (Output_data_plt_arm::first_plt_entry_offset): New function.
7749 (Output_data_plt_arm::get_plt_entry_size): New function.
7750 * i386.cc (Target_i386::got_size): Add const.
7751 (Target_i386::got_entry_count): New function.
7752 (Target_i386::plt_entry_count): New function.
7753 (Target_i386::first_plt_entry_offset): New function.
7754 (Target_i386::plt_entry_size): New function.
7755 (Output_data_plt_i386::entry_count): New function.
7756 (Output_data_plt_i386::first_plt_entry_offset): New function.
7757 (Output_data_plt_i386::get_plt_entry_size): New function.
7758 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7759 find_incremental_inputs_sections. Dump incremental_got_plt section.
7760 * incremental.cc: Include target.h.
7761 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7762 parameter. Adjust all callers. Find incremental_got_plt section.
7763 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7764 section.
7765 (Output_section_incremental_inputs::set_final_data_size): Calculate
7766 size of incremental_got_plt section.
7767 (Output_section_incremental_inputs::do_write): Write the
7768 incremental_got_plt section.
7769 (Got_plt_view_info): New struct.
7770 (Local_got_offset_visitor): New class.
7771 (Global_got_offset_visitor): New class.
7772 (Global_symbol_visitor_got_plt): New class.
7773 (Output_section_incremental_inputs::write_got_plt): New function.
7774 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7775 Add parameter. Adjust all callers.
7776 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7777 (Incremental_inputs::got_plt_section): New function.
7778 (Incremental_inputs::got_plt_section_): New data member.
7779 (Incremental_got_plt_reader): New class.
7780 * layout.cc (Layout::create_incremental_info_sections): Add the
7781 incremental_got_plt section.
7782 * object.h (Got_offset_list::get_list): New function.
7783 (Got offset_list::for_all_got_offsets): New function.
7784 (Sized_relobj::local_got_offset_list): New function.
7785 * powerpc.cc (Target_powerpc::got_size): Add const.
7786 (Target_powerpc::got_entry_count): New function.
7787 (Target_powerpc::plt_entry_count): New function.
7788 (Target_powerpc::first_plt_entry_offset): New function.
7789 (Target_powerpc::plt_entry_size): New function.
7790 (Output_data_plt_powerpc::entry_count): New function.
7791 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7792 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7793 * sparc.cc (Target_sparc::got_size): Add const.
7794 (Target_sparc::got_entry_count): New function.
7795 (Target_sparc::plt_entry_count): New function.
7796 (Target_sparc::first_plt_entry_offset): New function.
7797 (Target_sparc::plt_entry_size): New function.
7798 (Output_data_plt_sparc::entry_count): New function.
7799 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7800 (Output_data_plt_sparc::get_plt_entry_size): New function.
7801 * symtab.h (Symbol::got_offset_list): New function.
7802 (Symbol_table::for_all_symbols): New function.
7803 * target.h (Sized_target::got_entry_count): New function.
7804 (Sized_target::plt_entry_count): New function.
7805 (Sized_target::plt_entry_size): New function.
7806 * x86_64.cc (Target_x86_64::got_size): Add const.
7807 (Target_x86_64::got_entry_count): New function.
7808 (Target_x86_64::plt_entry_count): New function.
7809 (Target_x86_64::first_plt_entry_offset): New function.
7810 (Target_x86_64::plt_entry_size): New function.
7811 (Output_data_plt_x86_64::entry_count): New function.
7812 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7813 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7814
09ec0418
CC
78152010-08-12 Cary Coutant <ccoutant@google.com>
7816
7817 * archive.cc: Include incremental.h.
7818 (Archive::Archive): Initialize incremental_info_.
7819 (Archive::include_member): Record archive members in incremental info.
7820 (Add_archive_symbols::run): Record begin and end of an archive in
7821 incremental info.
7822 (Lib_group::include_member): Record objects in incremental info.
7823 * archive.h (Incremental_archive_entry): Forward declaration.
7824 (Archive::set_incremental_info): New member function.
7825 (Archive::incremental_info): New member function.
7826 (Archive::Unused_symbol_iterator): New class.
7827 (Archive::unused_symbols_begin): New member function.
7828 (Archive::unused_symbols_end): New member function.
7829 (Archive::incremental_info_): New data member.
7830 * incremental-dump.cc (find_input_containing_global): New function.
7831 (dump_incremental_inputs): Dump new incremental info sections.
7832 * incremental.cc: Include symtab.h.
7833 (Output_section_incremental_inputs): New class.
7834 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7835 new incremental info sections.
7836 (Sized_incremental_binary::do_check_inputs): Likewise.
7837 (Incremental_inputs::report_archive): Remove.
7838 (Incremental_inputs::report_archive_begin): New function.
7839 (Incremental_inputs::report_archive_end): New function.
7840 (Incremental_inputs::report_object): New function.
7841 (Incremental_inputs::finalize_inputs): Remove.
7842 (Incremental_inputs::report_input_section): New function.
7843 (Incremental_inputs::report_script): Rewrite.
7844 (Incremental_inputs::finalize): Do nothing but finalize string table.
7845 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7846 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7847 (Incremental_inputs::create_data_sections): New function.
7848 (Incremental_inputs::relocs_entsize): New function.
7849 (Output_section_incremental_inputs::set_final_data_size): New function.
7850 (Output_section_incremental_inputs::do_write): New function.
7851 (Output_section_incremental_inputs::write_header): New function.
7852 (Output_section_incremental_inputs::write_input_files): New function.
7853 (Output_section_incremental_inputs::write_info_blocks): New function.
7854 (Output_section_incremental_inputs::write_symtab): New function.
7855 * incremental.h (Incremental_script_entry): Forward declaration.
7856 (Incremental_object_entry): Forward declaration.
7857 (Incremental_archive_entry): Forward declaration.
7858 (Incremental_inputs): Forward declaration.
7859 (Incremental_inputs_header_data): Remove.
7860 (Incremental_inputs_header): Remove.
7861 (Incremental_inputs_header_write): Remove.
7862 (Incremental_inputs_entry_data): Remove.
7863 (Incremental_inputs_entry): Remove.
7864 (Incremental_inputs_entry_write): Remove.
7865 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7866 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7867 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7868 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7869 Likewise.
7870 (Incremental_input_entry): New class.
7871 (Incremental_script_entry): New class.
7872 (Incremental_object_entry): New class.
7873 (Incremental_archive_entry): New class.
7874 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7875 (Incremental_inputs::report_inputs): Remove.
7876 (Incremental_inputs::report_archive): Remove.
7877 (Incremental_inputs::report_archive_begin): New function.
7878 (Incremental_inputs::report_archive_end): New function.
7879 (Incremental_inputs::report_object): Change prototype.
7880 (Incremental_inputs::report_input_section): New function.
7881 (Incremental_inputs::report_script): Change prototype.
7882 (Incremental_inputs::get_reloc_count): New function.
7883 (Incremental_inputs::set_reloc_count): New function.
7884 (Incremental_inputs::create_data_sections): New function.
7885 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7886 (Incremental_inputs::inputs_section): New function.
7887 (Incremental_inputs::symtab_section): New function.
7888 (Incremental_inputs::relocs_section): New function.
7889 (Incremental_inputs::get_stringpool): Add const.
7890 (Incremental_inputs::command_line): Add const.
7891 (Incremental_inputs::inputs): Remove.
7892 (Incremental_inputs::command_line_key): New function.
7893 (Incremental_inputs::input_file_count): New function.
7894 (Incremental_inputs::input_files): New function.
7895 (Incremental_inputs::relocs_entsize): New function.
7896 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7897 (Incremental_inputs::finalize_inputs): Remove.
7898 (Incremental_inputs::Input_info): Remove.
7899 (Incremental_inputs::lock_): Remove.
7900 (Incremental_inputs::inputs_): Change type.
7901 (Incremental_inputs::inputs_map_): Remove.
7902 (Incremental_inputs::current_object_entry_): New data member.
7903 (Incremental_inputs::inputs_section_): New data member.
7904 (Incremental_inputs::symtab_section_): New data member.
7905 (Incremental_inputs::relocs_section_): New data member.
7906 (Incremental_inputs::reloc_count_): New data member.
7907 (Incremental_inputs_reader): New class.
7908 (Incremental_symtab_reader): New class.
7909 (Incremental_relocs_reader): New class.
7910 * layout.cc (Layout::finalize): Move finalization of incremental info
7911 and creation of incremental info sections to follow finalization of
7912 symbol table. Set offsets for postprocessing sections.
7913 (Layout::create_incremental_info_sections): Call
7914 Incremental_inputs::create_data_sections. Add incremental symtab
7915 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7916 sections to layout after input sections.
7917 * layout.h (struct Timespec): Forward declaration.
7918 (Layout::incremental_inputs): Add const.
7919 (Layout::create_incremental_info_sections): Add parameter.
7920 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7921 * object.cc: Include incremental.h.
7922 (Relobj::finalize_incremental_relocs): New function.
7923 (Sized_relobj::do_layout): Record input sections in incremental info.
7924 * object.h (Object::output_section): New function.
7925 (Object::output_section_offset): Moved from Relobj.
7926 (Object::get_incremental_reloc_base): New function.
7927 (Object::get_incremental_reloc_count): New function.
7928 (Object::do_output_section): New function.
7929 (Object::do_output_section_offset): Moved from Relobj.
7930 (Object::do_get_incremental_reloc_base): New function.
7931 (Object::do_get_incremental_reloc_count): New function.
7932 (Object::Object): Initialize new data members.
7933 (Relobj::output_section): Renamed do_output_section and moved to
7934 protected.
7935 (Relobj::output_section_offset): Moved to Object.
7936 (Relobj::do_get_incremental_reloc_base): New function.
7937 (Relobj::do_get_incremental_reloc_count): New function.
7938 (Relobj::allocate_incremental_reloc_counts): New function.
7939 (Relobj::count_incremental_reloc): New function.
7940 (Relobj::finalize_incremental_relocs): New function.
7941 (Relobj::next_incremental_reloc_index): New function.
7942 (Relobj::reloc_counts_): New data member.
7943 (Relobj::reloc_bases_): New data member.
7944 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7945 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7946 (Sized_relobj::incremental_relocs_scan): New function.
7947 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7948 (Sized_relobj::incremental_relocs_write): New function.
7949 (Sized_relobj::incremental_relocs_write_reltype): New function.
7950 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7951 incremental link.
7952 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7953 archives and object files elsewhere.
7954 (Add_symbols::run): Report object files here.
7955 (Finish_group::run): Report end of archive at end of group.
7956 * reloc.cc: Include layout.h, incremental.h.
7957 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7958 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7959 (Sized_relobj::incremental_relocs_scan): New function.
7960 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7961 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7962 (Sized_relobj::incremental_relocs_write): New function.
7963 (Sized_relobj::incremental_relocs_write_reltype): New function.
7964 * script.cc (read_input_script): Rewrite test for incremental link.
7965 Change call to Incremental_inputs::report_script.
7966 * symtab.h (Symbol_table::first_global_index): New function.
7967 (Symbol_table::output_count): New function.
7968
ce0d1972
DK
79692010-08-12 Doug Kwan <dougkwan@google.com>
7970
7971 * arm.cc (Target_arm::merge_object_attributes): Check command line
7972 options --no-wchar-size-warning and --no-enum-size-warning.
7973 * options.h (General_options): Add ld-compatible options
7974 --no-enum-size-warning and --no-wchar-size-warning.
7975
6e5710ce
ILT
79762010-08-04 Ian Lance Taylor <iant@google.com>
7977
7978 * x86_64.cc (Target_x86_64::Scan::local): Use
7979 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7980 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7981 (Target_x86_64::Scan::global): Likewise.
7982 (Target_x86_64::Relocate::relocate): Likewise.
7983 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7984 Likewise.
7985
fef830db
CC
79862010-08-03 Cary Coutant <ccoutant@google.com>
7987
7988 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7989 to reserve space in merged_strings vector. Keep total input size
7990 for stats.
7991 (Output_merge_string::do_print_merge_stats): Print total input size.
7992 * merge.h (Output_merge_string): Add input_size_ field.
7993 * stringpool.cc (Stringpool_template::string_length): Move
7994 implementations out of Stringpool_template class and place in
7995 stringpool.h.
7996 * stringpool.h (string_length): Move out of Stringpool_template.
7997
1e3811b0
ILT
79982010-08-03 Ian Lance Taylor <iant@google.com>
7999
8000 PR 11712
8001 * layout.cc (relaxation_loop_body): If address of load segment is
8002 set, adjust address to include headers if possible.
8003
7af0c620
ILT
80042010-08-03 Ian Lance Taylor <iant@google.com>
8005
8006 * version.cc (version_string): Bump to 1.10.
8007
22f0da72
ILT
80082010-08-03 Ian Lance Taylor <iant@google.com>
8009
8010 PR 11805
8011 * layout.h (enum Output_section_order): Define.
8012 (class Layout): Update declarations.
8013 * layout.cc (Layout::get_output_section): Add order parameter.
8014 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8015 is_first_non_relro parameters. Change all callers.
8016 (Layout::choose_output_section): Likewise.
8017 (Layout::add_output_section_data): Likewise.
8018 (Layout::make_output_section): Likewise. Set order.
8019 (Layout::default_section_order): New function.
8020 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8021 * output.cc (Output_section::Output_section): Initialize order_.
8022 Don't initialize deleted fields.
8023 (Output_segment::Output_segment): Don't initialize deleted
8024 fields.
8025 (Output_segment::add_output_section_to_load): New function
8026 replacing add_output_section. Change all callers to call this or
8027 add_output_section_to_nonload.
8028 (Output_segment::add_output_section_to_nonload): New function.
8029 (Output_segment::remove_output_section): Rewrite.
8030 (Output_segment::add_initial_output_data): Likewise.
8031 (Output_segment::has_any_data_sections): Likewise.
8032 (Output_segment::is_first_section_relro): Likewise.
8033 (Output_segment::maximum_alignment): Likewise.
8034 (Output_segment::has_dynamic_reloc): New function replacing
8035 dynamic_reloc_count. Change all callers.
8036 (Output_segment::has_dynamic_reloc_list): New function replacing
8037 dynamic_reloc_count_list. Change all callers.
8038 (Output_segment::set_section_addresses): Rewrite.
8039 (Output_segment::set_offset): Rewrite.
8040 (Output_segment::find_first_and_last_list): Remove.
8041 (Output_segment::set_tls_offsets): Rewrite.
8042 (Output_segment::first_section_load_address): Likewise.
8043 (Output_segment::output_section_count): Likewise.
8044 (Output_segment::section_with_lowest_load_address): Likewise.
8045 (Output_segment::write_section_headers): Likewise.
8046 (Output_segment::print_sections_to_map): Likewise.
8047 * output.h (class Output_data): Remove dynamic_reloc_count_
8048 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8049 (Output_data::add_dynamic_reloc): Rewrite.
8050 (Output_data::has_dynamic_reloc): New function.
8051 (Output_data::dynamic_reloc_count): Remove.
8052 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8053 is_last_relro_, is_first_non_relro_, is_interp_,
8054 is_dynamic_linker_section_ fields. Add order and set_order
8055 functions. Remove is_relro_local, set_is_relro_local,
8056 is_last_relro, set_is_last_relro, is_first_non_relro,
8057 set_is_first_non_relro functions, is_interp, set_is_interp,
8058 is_dynamic_linker_section, and set_is_dynamic_linker_section
8059 functions.
8060 (class Output_segment): Change Output_data_list from std::list to
8061 std:;vector. Add output_lists_ field. Remove output_data_ and
8062 output_bss_ fields. Update declarations.
8063
3ff2ccb0
ILT
80642010-08-02 Ian Lance Taylor <iant@google.com>
8065
8066 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8067 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8068 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8069
88a4108b
ILT
80702010-08-02 Ian Lance Taylor <iant@google.com>
8071
8072 PR 11855
8073 * script.cc (Script_options::Script_options): Initialize
8074 symbol_definitions_ and symbol_references_.
8075 (Script_options::add_symbol_assignment): Update
8076 symbol_definitions_ and symbol_references_.
8077 (Script_options::add_symbol_reference): New function.
8078 (script_symbol): New function.
8079 * script.h (class Script_options): Add symbol_definitions_ and
8080 symbol_references_ fields.
8081 (Script_options::referenced_const_iterator): New type.
8082 (Script_options::referenced_begin): New function.
8083 (Script_options::referenced_end): New function.
8084 (Script_options::is_referenced): New function.
8085 (Script_options::any_unreferenced): New function.
8086 * script-c.h (script_symbol): Declare.
8087 * yyscript.y (exp): Call script_symbol.
8088 * symtab.cc: Include "script.h".
8089 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8090 Change all callers. Check symbols referenced by scripts.
8091 (Symbol_table::add_undefined_symbols_from_command_line): Add
8092 layout parameter. Change all callers.
8093 (Symbol_table::do_add_undefined_symbols_from_command_line):
8094 Likewise. Break out loop body. Check symbols referenced by
8095 scripts.
8096 (Symbol_table::add_undefined_symbol_from_command_line): New
8097 function broken out of
8098 do_add_undefined_symbols_from_command_line.
8099 * symtab.h (class Symbol_table): Update declarations.
8100 * archive.cc: Include "layout.h".
8101 (Archive::should_include_member): Add layout parameter. Change
8102 all callers. Check for symbol mentioned in expression.
8103 * archive.h (class Archive): Update declaration.
8104 * object.cc (Sized_relobj::do_should_include_member): Add layout
8105 parameter.
8106 * object.h (Object::should_include_member): Add layout parameter.
8107 Change all callers.
8108 (Object::do_should_include_member): Add layout parameter.
8109 (class Sized_relobj): Update declaration.
8110 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8111 parameter.
8112 * dynobj.h (class Sized_dynobj): Update declaration.
8113 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8114 layout parameter.
8115 * plugin.h (class Sized_pluginobj): Update declaration.
8116
5f1ab67a
ILT
81172010-08-02 Ian Lance Taylor <iant@google.com>
8118
8119 PR 11866
8120 * output.cc (Output_segment::set_offset): Search for the first and
8121 last sections rather than assuming that the list is in order.
8122 (Output_segment::find_first_and_last_list): New function.
8123 * output.h (class Output_segment): Update declarations.
8124 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8125 (relro_strip_test_SOURCES): New variable.
8126 (relro_strip_test_DEPENDENCIES): New variable.
8127 (relro_strip_test_LDFLAGS): New variable.
8128 (relro_strip_test_LDADD): New variable.
8129 (relro_strip_test.so): New target.
8130
a8df5856
ILT
81312010-08-02 Ian Lance Taylor <iant@google.com>
8132
8133 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8134 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8135 (Target_i386::got_tlsdesc_section): New function.
8136 (Target_i386::got_section): Create space for GOT entries for
8137 TLSDESC relocations.
8138 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8139 R_386_TLS_GOTDESC.
8140 (Target_i386::Scan::global): Likewise.
8141 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8142 using TLSDESC GOT.
8143 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8144 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8145 (Target_x86_64::got_tlsdesc_section): New function.
8146 (Target_x86_64::got_section): Create space for GOT entries for
8147 TLSDESC relocations.
8148 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8149 R_386_TLS_GOTDESC.
8150 (Target_x86_64::Scan::global): Likewise.
8151 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8152 using TLSDESC GOT.
8153
0c10a0a6
ILT
81542010-08-02 Ian Lance Taylor <iant@google.com>
8155
8156 * testsuite/final_layout.sh: Use dc to convert from hex to
8157 decimal.
8158
41cbeecc
ST
81592010-07-29 Sriraman Tallam <tmsriram@google.com>
8160
8161 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8162 paramter to the call to gold::gc_process_relocs.
8163 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8164 paramter to the call to gold::gc_process_relocs.
8165 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8166 parameter to the call to gold::gc_process_relocs.
8167 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8168 template parameter to the call to gold::gc_process_relocs.
8169 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8170 paramter to the call to gold::gc_process_relocs.
8171 * gc.h (get_embedded_addend_size): New function.
8172 (gc_process_relocs): Save the size of the reloc for use by ICF.
8173 * icf.cc (get_section_contents): Get the addend from the text section
8174 for SHT_REL relocation sections.
8175 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8176 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8177 * int_encoding.h (read_from_pointer): New overloaded function.
8178 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8179 * testsuite/icf_sht_rel_addend_test.sh: New file.
8180 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8181 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8182
6ea55b82
RW
81832010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8184
8185 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8186 * Makefile.in: Regenerate.
8187 * testsuite/Makefile.in: Regenerate.
8188
9691462b
ILT
81892010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8190
8191 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8192 * gold/testsuite/debug_msg.cc: Likewise.
8193 * gold/testsuite/odr_violation1.cc
8194 * gold/testsuite/odr_violation2.cc
8195
76897331
CC
81962010-07-21 Cary Coutant <ccoutant@google.com>
8197
8198 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8199 string, and length fields.
8200 (Output_merge_string::Merged_strings_list): New type.
8201 (Output_merge_string::Merged_strings_lists): New typedef.
8202 (Output_merge_string): Replace merged_strings_ with
8203 merged_strings_lists_.
8204 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8205 Merged_strings_list per input object and section. Don't store pointer
8206 to the string. Don't store length with each merged string entry.
8207 (Output_merge_string::finalize_merged_data): Loop over list of merged
8208 strings lists. Recompute length of each merged string.
8209
78384e8f
CC
82102010-07-15 Cary Coutant <ccoutant@google.com>
8211
8212 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8213 here.
8214
783659f9
ILT
82152010-07-14 Ian Lance Taylor <iant@google.com>
8216
8217 * descriptors.cc (Descriptors::open): Report correct name in error
8218 message.
8219
131687b4
DK
82202010-07-13 Doug Kwan <dougkwan@google.com>
8221
8222 * arm.cc (Arm_input_section::Arm_input_section): For a
8223 SHT_ARM_EXIDX section, always keeps the input sections.
8224 (Arm_input_section::set_exidx_section_link): New method.
8225 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8226 has_errors_ to false.
8227 (Arm_exidx_input_section::has_errors,
8228 Arm_exidx_input_section::set_has_errors): New methods.
8229 (Arm_exidx_input_section::has_errors_): New data member.
8230 (Arm_relobj::get_exidx_shndx_list): New method.
8231 (Arm_output_section::append_text_sections_to_list): Do not skip
8232 section without SHF_EXECINSTR.
8233 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8234 errors.
2e702c99 8235 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8236 section header. Make error messages more verbose. Check for
8237 a non-executable section linked to an EXIDX section.
8238 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8239 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8240 check that there is no deferred EXIDX section if we exit early.
8241 Instead of not making an EXIDX section in case of an error, make one
8242 and set the has_errors flag of it.
8243 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8244 in a relocatable link.
8245 (Target_arm::do_relax): Look for the EXIDX output section instead of
8246 assuming that it is called .ARM.exidx.
2e702c99 8247 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8248 section list. Do not check for SHF_EXECINSTR section flags but
8249 skip any input section with errors.
8250 * output.cc (Output_section::Output_section): Initialize
8251 always_keeps_input_sections_ to false.
8252 (Output_section::add_input_section): Check for
8253 always_keeps_input_sections_.
8254 * output.h (Output_section::always_keeps_input_sections,
8255 Output_section::set_always_keeps_input_sections): New methods.
8256 (Output_section::always_keeps_input_sections): New data member.
8257
69517287
RÁE
82582010-07-13 Rafael Espindola <espindola@google.com>
8259
8260 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8261 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8262
82742395
ILT
82632010-07-13 Philip Herron <herron.philip@googlemail.com>
8264 Ian Lance Taylor <iant@google.com>
8265
8266 * output.h (Output_section_lookup_maps::add_merge_section):
8267 Correct check of whether value was inserted.
8268 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8269 (Output_section_lookup_maps::add_relaxed_input_section):
8270 Likewise.
8271 * arm.cc (Target_arm::got_section): Remove used local os.
8272 * i386.cc (Target_i386::got_section): Likewise.
8273 * x86_64.cc (Target_x86_64::got_section): Likewise.
8274 * sparc.cc (Target_sparc::got_section): Likewise.
8275 (Target_sparc::relocate): Remove unused local have_got_offset.
8276 * powerpc.cc (Target_powerpc::relocate): Likewise.
8277
f2d707b5
ILT
82782010-07-13 Ian Lance Taylor <iant@google.com>
8279
241531d6
ILT
8280 * compressed_output.cc (zlib_decompress): Fix signature in
8281 !HAVE_ZLIB_H case.
8282
f2d707b5
ILT
8283 * archive.cc (Archive::include_member): Unlock an external member
8284 of a thin archive. Don't bother to delete an object we know is
8285 NULL.
8286
a2e47362
CC
82872010-07-12 Cary Coutant <ccoutant@google.com>
8288
8289 * compressed_output.cc (zlib_decompress): New function.
8290 (get_uncompressed_size): New function.
8291 (decompress_input_section): New function.
8292 * compressed_output.h (get_uncompressed_size): New function.
8293 (decompress_input_section): New function.
8294 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8295 Handle compressed debug sections.
8296 * layout.cc (is_compressed_debug_section): New function.
8297 (Layout::output_section_name): Map compressed section names to
8298 canonical names.
8299 * layout.h (is_compressed_debug_section): New function.
8300 (is_debug_info_section): Recognize compressed debug sections.
8301 * merge.cc: Include compressed_output.h.
8302 (Output_merge_data::do_add_input_section): Handle compressed
8303 debug sections.
8304 (Output_merge_string::do_add_input_section): Handle compressed
8305 debug sections.
8306 * object.cc: Include compressed_output.h.
8307 (Sized_relobj::Sized_relobj): Initialize new data members.
8308 (build_compressed_section_map): New function.
8309 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8310 * object.h (Object::section_is_compressed): New method.
8311 (Object::do_section_is_compressed): New method.
8312 (Sized_relobj::Compressed_section_map): New type.
8313 (Sized_relobj::do_section_is_compressed): New method.
8314 (Sized_relobj::compressed_sections_): New data member.
8315 * output.cc (Output_section::add_input_section): Handle compressed
8316 debug sections.
8317 * reloc.cc: Include compressed_output.h.
8318 (Sized_relobj::write_sections): Handle compressed debug sections.
8319
ce279a62
CC
83202010-07-08 Cary Coutant <ccoutant@google.com>
8321
8322 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8323 weak when resolving to a dynamic def.
8324 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8325 for weak undef/dynamic def cases. Adjust callers.
8326 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8327 undef_binding_weak_.
8328 (Symbol_table::sized_write_globals): Adjust symbol binding.
8329 (Symbol_table::sized_write_symbol): Add binding parameter.
8330 * symtab.h (Symbol::set_undef_binding): New method.
8331 (Symbol::is_undef_binding_weak): New method.
8332 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8333 (Symbol_table::should_override): Add new parameter.
8334 (Symbol_table::sized_write_symbol): Add new parameter.
8335
8336 * testsuite/weak_undef_file1.cc: Add new test case.
8337 * testsuite/weak_undef_file2.cc: Fix header comment.
8338 * testsuite/weak_undef_test.cc: Add new test case.
8339
b2286c10
DK
83402010-06-29 Doug Kwan <dougkwan@google.com>
8341
8342 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8343 Initialize USE_SYMBOL_.
8344 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8345 definition.
8346 (Arm_reloc_property::uses_symbol_): New data member declaration.
8347 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8348 uses symbol value and symbol is undefined but not weakly undefined.
8349
4802450a
RÁE
83502010-06-28 Rafael Espindola <espindola@google.com>
8351
8352 * plugin.cc (Plugin::load): Use dlerror.
8353
e5ca47ba
ILT
83542010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8355
8356 * symtab.cc (detect_odr_violations): When reporting an ODR
8357 violation, report an object where the symbol is defined.
8358
8a75a161
DK
83592010-06-25 Doug Kwan <dougkwan@google.com>
8360
8361 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8362 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8363 definition.
8364 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8365 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8366 target hook to detect function points.
8367 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8368 * icf.h (Icf::check_section_for_function_pointers): Change type of
8369 parameter SECTION_NAME to const reference to std::string. Use
8370 target hook to determine if section may have unsafe pointers.
8371 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8372 method definition.
8373
42218b9f
RÁE
83742010-06-21 Rafael Espindola <espindola@google.com>
8375
8376 * fileread.cc (Input_file::find_fie): New
8377 (Input_file::open): Use Input_file::find_fie.
8378 * fileread.h (Input_file::find_fie): New
8379 * plugin.cc (set_extra_library_path): New.
8380 (Plugin::load): Add set_extra_library_path to the transfer vector.
8381 (Plugin_manager::set_extra_library_path): New.
8382 (Plugin_manager::add_input_file): Use the extra search path if set.
8383 (set_extra_library_path(): New.
8384 * plugin.h (Plugin_manager): Add set_extra_library_path and
8385 extra_search_path_.
8386
a0506cca
CC
83872010-06-19 Cary Coutant <ccoutant@google.com>
8388
8389 * layout.cc (gdb_sections): Add .debug_types.
8390 (lines_only_debug_sections): Likewise.
8391
6508b958
RÁE
83922010-06-18 Rafael Espindola <espindola@google.com>
8393
8394 * plugin.cc (add_input_file,add_input_library)
8395 (Plugin_manager::add_input_file): Make filename arguments const.
8396 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8397 const.
8398
3e235302
DK
83992010-06-16 Doug Kwan <dougkwan@google.com>
8400
8401 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8402 .ARM.attributes section if we have not merged any input
8403 attributes sections.
8404
106e8a6c
DK
84052010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8406
8407 * arm.cc: Allow combining objects with no EABI version
8408 information.
8409
91ff43fe
RÁE
84102010-06-15 Rafael Espindola <espindola@google.com>
8411
8412 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8413
68ed838c
ILT
84142010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8415
8416 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8417 (struct iovec): Correct !HAVE_READV definition.
8418
f3a2388f
CC
84192010-06-10 Cary Coutant <ccoutant@google.com>
8420
8421 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8422 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8423 reloc sections.
8424 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8425
8426 PR 11683
8427 * symtab.h (Symbol::is_placeholder): New member function.
8428 * target-reloc.h (relocate_section): Check for placeholder symbols.
8429
8430 * testsuite/Makefile.am (plugin_test_8): New test.
8431 (plugin_test_9): New test.
8432 * testsuite/Makefile.in: Regenerate.
8433
e1df38aa
NC
84342010-06-09 Nick Clifton <nickc@redhat.com>
8435
8436 * yyscript.y (input_list_element): Allow strings prefixed with
8437 the '-' character. Treat these as libraries.
8438 * script.cc (script_add_library): New function. Adds a library
8439 specified by "-l<name>" found in an input script.
8440 * script-c.h: Add prototype for script_add_library.
8441
25bbe950
DK
84422010-06-07 Doug Kwan <dougkwan@google.com>
8443
8444 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8445 Restrict stub-group size to be within long conditional branch
8446 range when working around cortex-A8 erratum.
8447
0f32ea4c
ILT
84482010-06-07 Damien Diederen <dd@crosstwine.com>
8449
8450 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8451 #ifdef typo.
8452
8fe2a369
ST
84532010-06-03 Sriraman Tallam <tmsriram@google.com>
8454
8455 PR gold/11658
8456 * output.cc
8457 (Output_section::Input_section_sort_entry::compare_section_ordering):
8458 Change to return non-zero correctly.
8459 (Output_section::Input_section_sort_section_order_index_compare
8460 ::operator()): Change to fix ambiguity in comparisons.
8461
6e9ba2ca
ST
84622010-06-01 Sriraman Tallam <tmsriram@google.com>
8463
8464 * gold.h (is_wildcard_string): New function.
8465 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8466 (Layout::layout_eh_frame): Ditto.
8467 (Layout::find_section_order_index): New method.
8468 (Layout::read_layout_from_file): New method.
8469 * layout.h (Layout::find_section_order_index): New method.
8470 (Layout::read_layout_from_file): New method.
8471 (Layout::input_section_position_): New private member.
8472 (Layout::input_section_glob_): New private member.
8473 * main.cc (main): Call read_layout_from_file here.
8474 * options.h (--section-ordering-file): New option.
8475 * output.cc (Output_section::input_section_order_specified_): New
8476 member.
8477 (Output_section::Output_section): Initialize new member.
8478 (Output_section::add_input_section): Add new parameter.
8479 Keep input sections when --section-ordering-file is used.
8480 (Output_section::set_final_data_size): Sort input sections when
8481 section ordering file is specified.
8482 (Output_section::Input_section_sort_entry): Add new parameter.
8483 Check sorting type.
8484 (Output_section::Input_section_sort_entry::compare_section_ordering):
8485 New method.
8486 (Output_section::Input_section_sort_compare::operator()): Change to
8487 consider section_order_index.
8488 (Output_section::Input_section_sort_init_fini_compare::operator()):
8489 Change to consider section_order_index.
8490 (Output_section::Input_section_sort_section_order_index_compare
8491 ::operator()): New method.
8492 (Output_section::sort_attached_input_sections): Change to sort
8493 according to section order when specified.
e1df38aa
NC
8494 (Output_section::add_input_section<32, true>): Add new parameter.
8495 (Output_section::add_input_section<64, true>): Add new parameter.
8496 (Output_section::add_input_section<32, false>): Add new parameter.
8497 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8498 * output.h (Output_section::add_input_section): Add new parameter.
8499 (Output_section::input_section_order_specified): New
8500 method.
8501 (Output_section::set_input_section_order_specified): New method.
8502 (Input_section::Input_section): Initialize section_order_index_.
8503 (Input_section::section_order_index): New method.
8504 (Input_section::set_section_order_index): New method.
8505 (Input_section::section_order_index_): New member.
8506 (Input_section::Input_section_sort_section_order_index_compare): New
8507 struct.
8508 (Output_section::input_section_order_specified_): New member.
8509 * script-sections.cc (is_wildcard_string): Delete and move modified
8510 method to gold.h.
8511 (Output_section_element_input::Output_section_element_input): Modify
8512 call to is_wildcard_string.
8513 (Output_section_element_input::Input_section_pattern
8514 ::Input_section_pattern): Ditto.
8515 (Output_section_element_input::Output_section_element_input): Ditto.
8516 * testsuite/Makefile.am (final_layout): New test case.
8517 * testsuite/Makefile.in: Regenerate.
8518 * testsuite/final_layout.cc: New file.
8519 * testsuite/final_layout.sh: New file.
8520
3537c84b
RÁE
85212010-06-01 Rafael Espindola <espindola@google.com>
8522
8523 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8524
105b6afd
RÁE
85252010-06-01 Rafael Espindola <espindola@google.com>
8526
8527 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8528 visibility of symbols.
8529
29e11421
DK
85302010-05-27 Doug Kwan <dougkwan@google.com>
8531
8532 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8533 from start of output section instead of address for a local symbol
8534 in a merged or relaxed section when doing a relocatable link.
8535
5e0f337e
RÁE
85362010-05-26 Rafael Espindola <espindola@google.com>
8537
703d02da 8538 PR 11604
5e0f337e
RÁE
8539 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8540 adding sections the garbage collector removed.
8541 * gold/testsuite/Makefile.am: Add test.
8542 * gold/testsuite/Makefile.in: Regenerate.
8543 * gold/testsuite/plugin_test_7.sh: New.
8544 * gold/testsuite/plugin_test_7_1.c: New.
8545 * gold/testsuite/plugin_test_7_2.c: New.
8546
f4187277
RÁE
85472010-05-26 Rafael Espindola <espindola@google.com>
8548
8549 * script-sections.cc (Output_section_definition::set_section_addresses):
8550 Check for --section-start.
8551
5c388529
DK
85522010-05-26 Doug Kwan <dougkwan@google.com>
8553
8554 * arm.cc (Arm_scan_relocatable_relocs): New class.
8555 (Target_arm::relocate_special_relocatable): New method.
8556 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8557 (Arm_relocate_functions::thumb_branch_common): Same.
8558 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8559 instead of Default_scan_relocatable_relocs.
8560 * target-reloc.h (relocate_for_relocatable): Let target handle
8561 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8562 * target.h (Sized_target::relocate_special_relocatable): New method.
8563
bca1c3ae
ILT
85642010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8565
8566 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8567
0439c796
DK
85682010-05-23 Doug Kwan <dougkwan@google.com>
8569
8570 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8571 instead of a cast.
8572 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8573 with a direct branch, not a conditional branch, to a stub.
8574 * merge.cc (Output_merge_base::record_input_section): New method
8575 defintion.
8576 (Output_merge_data::do_add_input_section): Record input section if
8577 keeps-input-sections flag is set.
8578 (Output_merge_string::do_add_input_section): Ditto.
8579 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8580 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8581 INPUT_SECTIONS_.
8582 (Output_merge_base::keeps_input_sections,
8583 Output_merge_base::set_keeps_input_sections,
8584 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8585 method definitions.
8586 (Output_merge_base::Input_sections): New type declaration.
8587 (Output_merge_base::input_sections_begin,
8588 Output_merge_base::input_sections_end,
8589 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8590 (Output_merge_base::bool keeps_input_sections_,
8591 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8592 Output_merge_base::input_sections_): New data members.
8593 (Output_merge_data::do_set_keeps_input_sections): New method
8594 defintion.
8595 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8596 * output.cc (Output_section::Input_section::relobj): Move method
8597 defintion from class declaration to here and handle merge sections.
8598 (Output_section::Input_section::shndx): Ditto.
8599 (Output_section::Output_section): Remove initializations of removed
8600 data members and initialize new data member LOOKUP_MAPS_.
8601 (Output_section::add_input_section): Set keeps-input-sections flag
8602 for a newly created merge output section as appropriate. Adjust code
8603 to use Output_section_lookup_maps class.
8604 (Output_section::add_relaxed_input_section): Adjst code for lookup
8605 maps code refactoring.
2e702c99 8606 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8607 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8608 class. If adding input section to a newly created merge output
8609 section fails, remove the new merge section.
8610 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8611 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8612 (Output_section::find_merge_section): Ditto.
0439c796 8613 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8614 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8615 Output_section_lookup_maps class.
8616 (Output_section::get_input_sections): Export merge sections. Adjust
8617 code to use Output_section_lookup_maps class.
8618 (Output_section:::add_script_input_section): Adjust code to use
8619 Output_section_lookup_maps class. Update lookup maps for merge
8620 sections also.
8621 (Output_section::discard_states): Use Output_section_lookup_maps.
8622 (Output_section::restore_states): Same.
8623 * output.h (Merge_section_properties): Move class defintion out of
8624 Output_section.
8625 (Output_section_lookup_maps): New class.
8626 (Output_section::Input_section::is_merge_section): New method
8627 defintion.
8628 (Output_section::Input_section::relobj): Move defintion out of class
8629 defintion. Declare method only.
8630 (Output_section::Input_section::shndx): Ditto.
8631 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8632 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8633 (Output_section::Merge_section_by_properties_map,
8634 Output_section::Output_section_data_by_input_section_map,
8635 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8636 Remove types.
2e702c99 8637 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8638 KEEPS_INPUT_SECTIONS.
8639 (Output_section::build_lookup_maps): New method declaration.
8640 (Output_section::merge_section_map_,
8641 Output_section::merge_section_by_properties_map_,
8642 Output_section::relaxed_input_section_map_,
8643 Output_section::is_relaxed_input_section_map_valid_): Remove data
8644 members.
8645 (Output_section::lookup_maps_): New data member.
8646
76295588
L
86472010-05-21 Doug Kwan <dougkwan@google.com>
8648
8649 PR gold/11619
8650 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8651 avoid a compilation error.
8652
d103a984
RÁE
86532010-05-19 Rafael Espindola <espindola@google.com>
8654
8655 * script-sections.cc (Output_section_definition::allocate_to_segment):
8656 Update the phdrs_list even when the output section is NULL.
8657 * testsuite/Makefile.am: Add test.
8658 * testsuite/Makefile.in: Regenerate.
8659 * testsuite/script_test_9.cc: New.
8660 * testsuite/script_test_9.sh: New.
8661 * testsuite/script_test_9.t: New.
8662
6625d24e
DK
86632010-05-19 Doug Kwan <dougkwan@google.com>
8664
8665 * arm.cc (Arm_input_section::original_size): New method.
8666 (Arm_input_section::do_addralign): Add a cast.
8667 (Arm_input_section::do_output_offset): Remove static cast.
8668 (Arm_input_section::original_addralign,
8669 Arm_input_section::original_size_): Change type to uint32_t.
8670 (Arm_input_section::init): Add safe casts for section alignment
8671 and size.
8672 (Arm_input_section::set_final_data_size): Do not set address and
8673 offset of stub table.
8674 (Arm_output_section::fix_exidx_coverage): Change use of of
8675 Output_section::Simple_input_section to that of
8676 Output_section::Input_section.
8677 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8678 except for the first pass.
8679 * output.cc (Output_section::get_input_sections): Change type of
8680 input_sections to std::list<Input_section>.
8681 (Output_section::add_script_input_section): Rename from
8682 Output_section::add_simple_input_section. Change type of SIS
8683 parameter from Simple_input_section to Input_section.
8684 * output.h (Output_section::Simple_input_section): Remove class.
8685 (Output_section::Input_section): Change class visibility to public.
8686 (Output_section::Input_section::addralign): Use stored alignments
8687 for special input sections if set.
8688 (Output_section::Input_section::set_addralign): New method.
8689 (Output_section::get_input_sections): Change parameter type from
8690 list of Simple_input_section to list of Input_section.
8691 (Output_section::add_script_input_section): Rename from
8692 Output_section::add_simple_input_section. Change first parameter's
8693 type from Simple_input_section to Input_section and remove the
8694 second and third parameters.
8695 * script-sections.cc (Input_section::Input_section_list): Change
8696 type to list of Output_section::Input_section/
8697 (Input_section_info::Input_section_info): Change parameter type of
8698 INPUT_SECTION to Output_section::Input_section.
8699 (Input_section_info::input_section): Change return type.
8700 (Input_section_info::input_section_): Change type to
8701 Output_section::Input_section.
8702 (Output_section_element_input::set_section_addresses): Adjust code
8703 to use Output_section::Input_section instead of
8704 Output_section::Simple_input_section. Adjust code for renaming
8705 of Output_section::add_simple_input_section.
8706 (Orphan_output_section::set_section_addresses): Ditto.
8707
e1e82ea4
RW
87082010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8709
8710 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8711 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8712
91e75c8a
RÁE
87132010-05-18 Rafael Espindola <espindola@google.com>
8714
8715 * options.cc (General_options::finalize): Handle -nostdlib.
8716 * options.h (nostdlib): New option.
8717 * script.cc (script_add_search_dir): Handle -nostdlib.
8718
da59ad79
DK
87192010-05-12 Doug Kwan <dougkwan@google.com>
8720
8721 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8722 attributes section only if there no attributes section after merging.
8723 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8724 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8725 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8726 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8727 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8728 and arm_attr_merge_7.stdout.
8729 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8730 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8731 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8732 arm_attr_merge_7b.o): New rules.
8733 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8734 arm_attr_merge_7
8735 * testsuite/Makefile.in: Regenerate.
8736 * testsuite/arm_attr_merge.sh: New file.
8737 * testsuite/arm_attr_merge_[67][ab].s: Same.
8738
3e01a7fd
NC
87392010-05-05 Nick Clifton <nickc@redhat.com>
8740
8741 * po/es.po: Updated Spanish translation.
8742
7ad2014a
L
87432010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8744
8745 * Makefile.am (install-exec-local): Properly install gold as
8746 default cross linker.
8747 * Makefile.in: Regenerated.
8748
4fda8867
NC
87492010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8750 Nick Clifton <nickc@redhat.com>
8751
8752 * configure.ac (install_as_default): Define and set to false
8753 unless --enable-gold or --enable-gold=both/gold has been
8754 specified.
8755 * configure: Regenerate.
8756
8757 * Makefile.am (install-exec-local): Install the executable as
8758 'ld.gold'. If install_as_default is true then also install it as
8759 'ld'.
8760 * Makefile.in: Regenerated.
8761
bd288ea2
ILT
87622010-04-24 Ian Lance Taylor <iant@google.com>
8763
8764 * layout.cc (Layout::layout_reloc): In relocatable link don't
8765 combine reloc sections for grouped sections.
8766
ef38fd8a
ST
87672010-04-23 Sriraman Tallam <tmsriram@google.com>
8768
8769 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8770 sections that are not ordinary to icf.
8771 * icf.cc (get_section_contents): Handle relocation pointing to section
8772 with no object or shndx information.
8773 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8774 * testsuite/Makefile.in: Regenerate.
8775 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8776 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8777
f6973bdc
ILT
87782010-04-22 Ian Lance Taylor <iant@google.com>
8779
8780 * expression.cc (Expression::Expression_eval_info): Add
8781 result_alignment_pointer field.
8782 (Expression::eval_with_dot): Add result_alignment_pointer
8783 parameter. Change all callers.
8784 (Expression::eval_maybe_dot): Likewise.
8785 (class Binary_expression): Add alignment_pointer parameter to
8786 left_value and right_value. Change all callers.
8787 (BINARY_EXPRESSION): Set result alignment.
8788 (class Trinary_expression): Add alignment_pointer parameter to
8789 arg2_value and arg3_value. Change all callers.
8790 (Trinary_cond::value): Set result alignment.
8791 (Max_expression::value, Min_expression::value): Likewise.
8792 (Align_expression::value): Likewise.
8793 * script-sections.cc (class Sections_element): Add dot_alignment
8794 parameter to set_section_addresses virtual function. Update
8795 instantiations.
8796 (class Output_section_element): Likewise.
8797 (Script_sections::create_segments): Add dot_alignment parameter.
8798 Change all callers.
8799 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8800 (Script_sections::set_phdrs_clause_addresses): Likewise.
8801 * script-sections.h: Update declarations.
8802 * script.h: Update declarations.
8803 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8804 min_p_align.
8805 * testsuite/script_test_3.t: Set large alignment.
8806 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8807 segment has expected alignment.
8808
9c9c98a5
NC
88092010-04-22 Nick Clifton <nickc@redhat.com>
8810
8811 * po/gold.pot: Updated by the Translation project.
8812 * po/vi.po: Updated Vietnamese translation.
8813
2253bfba
L
88142010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8815
8816 * testsuite/Makefile.am (check_PROGRAMS): Add
8817 icf_virtual_function_folding_test.
8818 * testsuite/Makefile.in: Regenerated.
8819
85fdf906
AH
88202010-04-15 Andrew Haley <aph@redhat.com>
8821
8822 * options.h (merge_exidx_entries): New option.
8823 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8824 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8825 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8826 (Target_arm::merge_exidx_entries): New function.
8827 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8828 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8829 to Arm_exidx_fixup constructor.
8830 Add new arg, merge_exidx_entries.
8831 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8832 Arm_output_section::fix_exidx_coverage.
8833
ce97fa81
ST
88342010-04-18 Sriraman Tallam <tmsriram@google.com>
8835
8836 * icf.cc (get_section_contents): Check for preemptible functions.
8837 Ignore addend when appropriate.
8838 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8839 section folded.
8840 (add_from_relobj): Check for section folded.
8841 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8842 * symtab.h (should_add_dynsym_entry): Add new parameter.
8843 * target-reloc.h (scan_relocs): Check for section folded.
8844 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8845 Check reloc types for function pointers in shared objects.
8846 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8847 case.
8848 (icf_preemptible_functions_test): New test case.
8849 (icf_string_merge_test): New test case.
8850 * testsuite.Makefile.in: Regenerate.
8851 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8852 bar_glob. Refactor code.
8853 * testsuite/icf_preemptible_functions_test.cc: New file.
8854 * testsuite/icf_preemptible_functions_test.sh: New file.
8855 * testsuite/icf_string_merge_test.cc: New file.
8856 * testsuite/icf_string_merge_test.sh: New file.
8857 * testsuite/icf_virtual_function_folding_test.cc: New file.
8858 * testsuite/icf_virtual_function_folding_test.sh: New file.
8859
04ceb17c
DK
88602010-04-14 Doug Kwan <dougkwan@google.com>
8861
8862 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8863 for local symbol recounting if we remove a section due to ICF.
8864 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8865 there are no regular objects in input.
8866
153e7da4
DK
88672010-04-13 Doug Kwan <dougkwan@google.com>
8868
8869 * arm.cc (Arm_input_section::set_final_data_size): Compute
8870 accurate final data size instead of using current data size.
8871
4dbd9faf
DK
88722010-04-09 Doug Kwan <dougkwan@google.com>
8873
8874 * layout.cc (Layout::choose_output_section): Handle script section
8875 types.
8876 (Layout::make_output_section_for_script): Add section type parameter.
8877 Handle script section types.
8878 * layout.h (Layout::make_output_section_for_script): Add section
8879 type parameter.
8880 * output.cc (Output_section::Output_section): Initialize data member
8881 is_noload_.
8882 (Output_section::do_reset_address_and_file_offset): Do not set address
8883 to 0 if section is a NOLOAD section.
8884 * output.h (Output_section::is_noload): New method.
8885 (Output_section::set_is_noload): Ditto.
8886 (Output_section::is_noload_): New data member.
8887 * script-c.h (Script_section_type): New enum type.
8888 (struct Parser_output_section_header): Add new file section_type.
8889 * script-sections.cc (Sections_element::output_section_name): Add
8890 parameter for returning script section type.
8891 (Output_section_definition::output_section_name): Ditto.
8892 (Output_section_definition::section_type)P; New method.
8893 (Output_section_definiton::script_section_type_name): Ditto.
8894 (Output_section_definition::script_section_type_): New data member.
8895 (Output_section_definition::Output_section_definition): Initialize
8896 data member Output_section_definition::script_section_type_.
8897 (Output_section_definition::create_sections): Pass script section type
8898 to Layout::make_output_section_for_script.
8899 (Output_section_definition::output_section_name): Return script
8900 section type to caller.
8901 (Output_section_definition::set_section_address): Do not advance
8902 dot value and load address if section type is NOLOAD. Set address
8903 of NOLOAD sections regardless of section flags.
8904 (Output_section_definition::print): Print section type if it is
8905 not SCRIPT_SECTION_TYPE_NONE.
8906 (Output_section_definition::section_type): New method.
8907 (Output_section_definition::script_section_type_name): Ditto.
8908 (Script_sections::output_section_name): Add new parameter
8909 PSECTION_TYPE for returning script section type. Pass it to
8910 section elements. Handle discard sections.
8911 (Sort_output_sections::operator()): Handle NOLOAD sections.
8912 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8913 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8914 returning script section type.
8915 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8916 INFO and NOLOAD.
8917 * yyscript.y (union): Add new field SECTION_TYPE.
8918 (COPY, DSECT, INFO, NOLOAD): New tokens.
8919 (opt_address_and_section_type): Change type to output_section_header.
8920 (section_type): New non-terminal
8921 (section_header): Handle section type.
2253bfba 8922 (opt_address_and_section_type): Return section type value.
4dbd9faf 8923
721ea635
L
89242010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8925
8926 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8927 * testsuite/plugin_common_test_2.c (foo): Likewise.
8928
6bf924b0
DK
89292010-04-08 Doug Kwan <dougkwan@google.com>
8930
8931 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8932 Output_merge_data.
8933 * output.cc (Output_section::add_merge_input_section): Simplify
8934 code and return status of Output_merge_base::add_input_section.
e1df38aa 8935 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8936 returns true.
8937
24af6f92
DK
89382010-04-07 Doug Kwan <dougkwan@google.com>
8939
8940 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8941 if section is marked as containing instructions but has no mapping
8942 symbols.
8943 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8944 correct section index.
8945 (Arm_relobj::find_linked_text_section): Ditto.
8946
00698fc5
CC
89472010-04-07 Cary Coutant <ccoutant@google.com>
8948
8949 * archive.cc (include_member): Destroy Read_symbols_data object before
8950 releasing file.
8951 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8952 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8953 (Read_symbols_data::~Read_symbols_data) New destructor.
8954 (Section_relocs::Section_relocs) New constructor.
8955 (Section_relocs::~Section_relocs) New destructor.
8956 (Read_relocs_data::Read_relocs_data) New constructor.
8957 (Read_relocs_data::~Read_relocs_data) New destructor.
8958 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8959 pointers to NULL after deleting.
8960
7296d933
DK
89612010-04-07 Doug Kwan <dougkwan@google.com>
8962
8963 * arm.cc: Replace "endianity" with "endianness" in comments.
8964 (Arm_exidx_cantunwind): Ditto.
8965 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8966 (Arm_relobj::merge_flags_and_attributes): New method.
8967 (Arm_relobj::merge_flags_and_attributes_): New data member.
8968 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8969 (Arm_relobj::scan_sections_for_stubs): Ditto.
8970 (Arm_relobj::do_read_symbols): Check to see if we really want to
8971 merge processor-specific flags and attributes. Exit early if
8972 an object is empty except for section names and the undefined symbol.
8973 (Target_arm::do_finalize_sections): Move check for ELF format to
8974 Arm_relobj::do_read_symbols. Merge processor specific flags and
8975 attributes from a regular object only when we have determined that
8976 it is aapropriate. Do not create an .ARM.attributes section in
8977 output if there is no regular input object.
8978 (Target_arm::merge_processor_specific_flags): Check
8979 --warn-mismatch before printing any error.
8980 (Target_arm::merge_object_attributes): Ditto.
8981 * gold.cc (queue_middle_tasks): Handle the case in which there is
8982 no regular object in input.
8983 * options.cc (General_options::parse_EB): New method.
8984 (General_options::parse_EL): Same.
8985 (General_options::General_options): Initialize endianness_.
8986 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8987 New options.
8988 (General_options::Endianness): New enum.
8989 (General_options::endianness): New method.
8990 (General_options::endianness_): New data member.
8991 * parameters.cc (Parameters::set_options): Check target endianness.
8992 (Parameters::set_target_once): Ditto.
8993 (Parameters::check_target_endianness): New method.
8994 (parameters_force_valid_target): If either -EL or -EB is specified,
8995 use it to define endianness of default target.
8996 * parameters.h (Parameters::check_target_endianness): New method
8997 declaration.
8998 * target.h (class Target): Change "endianity" to "endianness"
8999 in comments.
9000
efc8d4f2
RW
90012010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9002
9003 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9004 * configure: Regenerate.
9005 * Makefile.in: Regenerate.
9006 * testsuite/Makefile.in: Regenerate.
9007
be234d88
CC
90082010-04-06 Cary Coutant <ccoutant@google.com>
9009
9010 gcc PR lto/42757
9011 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9012 prevailing definitions of common symbols.
9013 * testsuite/plugin_test_6.sh: New test case.
9014 * testsuite/plugin_common_test_1.c: New test case.
9015 * testsuite/plugin_common_test_2.c: New test case.
9016 * testsuite/Makefile.am (plugin_test_6): New test case.
9017 * testsuite/Makefile.in: Regenerate.
9018
bd32c6bd
NC
90192010-04-06 Nick Clifton <nickc@redhat.com>
9020
9021 * po/vi.po: New Vietnamese translation.
9022
323c532f
DK
90232010-03-30 Doug Kwan <dougkwan@google.com>
9024
9025 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9026
4fcd97eb
DK
90272010-03-25 Doug Kwan <dougkwan@google.com>
9028
9029 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9030 to avoid a conversion warning on a 32-bit host.
9031
4ebf39db
ILT
90322010-03-24 Ian Lance Taylor <iant@google.com>
9033
9034 * testsuite/script_test_3.t: Add a TLS segment.
9035 * testsuite/Makefile.am (check_PROGRAMS): Add
9036 tls_phdrs_script_test.
9037 (tls_phdrs_script_test_SOURCES): Define.
9038 (tls_phdrs_script_test_DEPENDENCIES): Define.
9039 (tls_phdrs_script_test_LDFLAGS): Define.
9040 (tls_phdrs_script_test_LDADD): Define.
9041 * testsuite/Makefile.in: Rebuild.
9042
4a599bdd
CC
90432010-03-23 Cary Coutant <ccoutant@google.com>
9044
9045 * fileread.cc (find_or_make_view): Fix comment.
9046
6c93b22c
ILT
90472010-03-23 Ian Lance Taylor <iant@google.com>
9048
9049 * script-sections.cc (class Orphan_section_placement): Define
9050 PLACE_TLS and PLACE_TLS_BSS.
9051 (Orphan_section_placement::Orphan_section_placement): Initialize
9052 new places.
9053 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9054 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9055 (tls_script_test_SOURCES): Define.
9056 (tls_script_test_DEPENDENCIES): Define.
9057 (tls_script_test_LDFLAGS): Define.
9058 (tls_script_test_LDADD): Define.
9059 * testsuite/Makefile.in: Rebuild.
9060
a2c7281b
DK
90612010-03-22 Doug Kwan <dougkwan@google.com>
9062
9063 * arm.cc (Arm_relocate_functions::abs8,
9064 Arm_relocate_functions::abs16): Use correct check for overflow
9065 specified in the ARM ELF specs.
9066 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9067 target of a BLX instruction specially.
9068 (Reloc_stub::stub_type_for_reloc): Ditto.
9069 (Relocate::relocate): Use symbolic names instead of numeric relocation
9070 codes to report error.
9071 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9072 workaround.
9073 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9074 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9075 thumb2_blx_out_of_range.stdout
9076 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9077 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9078 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9079 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9080 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9081 thumb2_blx_in_range, thumb2_blx_in_range.o,
9082 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9083 thumb2_blx_out_of_range.o): New rules.
2e702c99 9084 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9085 thumb2_blx_in_range and thumb2_blx_out_of_range.
9086 * testsuite/Makefile.in: Regenerate.
9087 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9088 * testsuite/thumb_blx_in_range.s: New file.
9089 * testsuite/thumb_blx_out_of_range.s: New file.
9090
b0193076
RÁE
90912010-03-22 Rafael Espindola <espindola@google.com>
9092
9093 * archive.cc (Should_include): Move to archive.h.
9094 (should_include_member): Make it a member of Archive.
9095 (Lib_group): New.
9096 (Add_lib_group_symbols): New.
9097 * archive.h: Include options.h.
9098 (Archive_member): Moved from Archive.
9099 (Should_include): Moved from archive.cc.
9100 (Lib_group): New.
9101 (Add_lib_group_symbols): New.
9102 * dynobj.cc (do_should_include_member): New.
9103 * dynobj.h (do_should_include_member): New.
9104 * gold.cc (queue_initial_tasks): Update call to queue.
9105 * main.cc (main): Print lib group stats.
9106 * object.cc (do_should_include_member): New.
9107 * object.h: Include archive.h.
9108 (Object::should_include_member): New.
9109 (Object::do_should_include_member): New.
9110 (Sized_relobj::do_should_include_member): New.
9111 * options.cc (General_options::parse_start_lib): New.
9112 (General_options::parse_end_lib): New.
9113 (Input_arguments::add_file): Handle lib groups.
9114 (Input_arguments::start_group): Check we are not in a lib.
9115 (Input_arguments::start_lib): New.
9116 (Input_arguments::end_lib): New.
9117 * options.h (General_options): Add start_lib and end_lib.
9118 (Input_argument::lib_): New.
9119 (Input_argument::lib): New.
9120 (Input_argument::is_lib): New.
9121 (Input_file_lib): New.
9122 (Input_arguments::in_lib_): New.
9123 (Input_arguments::in_lib): New.
9124 (Input_arguments::start_lib): New.
9125 (Input_arguments::end_lib_): New.
9126 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9127 in unused members as preempted.
9128 (Sized_pluginobj::do_should_include_member): New.
9129 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9130 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9131 return the blocker.
9132 (Read_symbols::do_whole_lib_group): New.
9133 (Read_symbols::do_lib_group): New.
9134 (Read_symbols::do_read_symbols): Handle lib groups.
9135 (Read_symbols::get_name): Handle lib groups.
9136 * readsyms.h (Read_symbols): Add an archive member pointer.
9137 (Read_symbols::do_whole_lib_group): New.
9138 (Read_symbols::do_lib_group): New.
9139 (Read_symbols::member_): New.
9140 * script.cc (read_input_script): Update call to queue_soon.
9141
d099120c
DK
91422010-03-19 Doug Kwan <dougkwan@google.com>
9143
9144 * arm.cc (Stub_table::Stub_table): Initialize new data members
9145 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9146 (Stub_table::add_reloc_stub): Assign stub offset and update
9147 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9148 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9149 New data members.
2e702c99 9150 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9151 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9152 instead of going over all reloc stubs.
2e702c99 9153 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9154 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9155 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9156 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9157 Stringpool_template::offset_.
9158 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9159 Stringpool_template::offset_ to zero.
9160
1aa37384
DK
91612010-03-15 Doug Kwan <dougkwan@google.com>
9162
9163 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9164 offset_.
9165 (Stringpool_template::new_key_offset): New method.
9166 (Stringpool_template::add_string): Assign offsets when adding new
9167 strings.
9168 (Stringpool_template::set_string_offsets): Do not set string offsets
9169 when not optimizing.
9170 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9171 member size_.
2e702c99
RM
9172 (Chunked_vector::clear): Clear size_.
9173 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9174 (Chunked_vector::size): Return size_.
9175 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9176 (Chunked_vector::size_): New data member.
1aa37384
DK
9177 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9178 (Stringpool_template::new_key_offset): New method declaration.
9179 (Stringpool_template::offset_): New data member.
9180
b672b057
RÁE
91812010-03-15 Rafael Espindola <espindola@google.com>
9182
9183 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9184 Add_symbols' constructor.
9185 * readsyms.h (Add_symbols): Remove the input_group member.
9186
b6848d3c
ILT
91872010-03-10 Ian Lance Taylor <iant@google.com>
9188
9189 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9190 target to ask whether a reference to a symbol requires a stack
9191 split.
9192 * target.h (Target::is_call_to_non_split): New function.
9193 (Target::do_is_call_to_non_split): Declare virtual function.
9194 * target.cc: Include "symtab.h".
9195 (Target::do_is_call_to_non_split): New function.
9196 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9197
a2a5469e
CC
91982010-03-10 Cary Coutant <ccoutant@google.com>
9199
9200 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9201 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9202 (File_read::open[2]): Add whole_file_view_ to list of views.
9203 (File_read::make_view): Remove test of whole_file_view_.
9204 (File_read::find_or_make_view): Create whole_file_view_ if
9205 necessary.
9206 (File_read::clear_views): Replace bool parameter with enum;
9207 adjust all callers. Don't delete views with permanent data;
9208 do delete cached views and views from archives if
9209 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9210 if clearing the corresponding view.
9211 * fileread.h (File_read::Clear_views_mode): New enum.
9212 (File_read::View::is_permanent_view): New method.
9213 (File_read::clear_views): Replace bool parameter
9214 with enum; adjust all callers.
9215 * options.h (General_options): Change keep_files_mapped option;
9216 add map_whole_files.
9217 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9218 releasing the file.
9219 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9220 the file.
9221
8861f32b
DM
92222010-03-10 David S. Miller <davem@davemloft.net>
9223
9224 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9225
d62d0f5f
ST
92262010-03-09 Sriraman Tallam <tmsriram@google.com>
9227
9228 * icf.cc (get_section_contents): Add '@' marker after processing the
9229 merge reloc.
9230
9177756d
DK
92312010-03-08 Doug Kwan <dougkwan@google.com>
9232
9233 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9234 due to a conversion warning.
9235 (Arm_relobj::update_output_local_symbol_count): Check for local
9236 symbol with unset output index.
9237
9e9e071b
ILT
92382010-03-05 Ian Lance Taylor <iant@google.com>
9239
9240 * options.h (class General_options): Add --spare-dynamic-tags.
9241 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9242 --spare-dynamic-tags.
9243
a81ee015
ILT
92442010-03-05 Ian Lance Taylor <iant@google.com>
9245
9246 * incremental.cc: Include "libiberty.h".
9247
44ec90b9
RO
92482010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9249
9250 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9251 function, is_info_ member.
9252 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9253 (Versions::Versions): Update caller.
9254 (Versions::define_base_version): Likewise.
9255 (Versions::add_def): Likewise.
9256
0897ed3b
ST
92572010-03-03 Sriraman Tallam <tmsriram@google.com>
9258
9259 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9260 (Scan::possible_function_pointer_reloc): New function.
9261 (Scan::local_reloc_may_be_function_pointer): Change to call
9262 possible_function_pointer_reloc.
9263 (Scan::global_reloc_may_be_function_pointer): Ditto.
9264 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9265 relocations in ".data.rel.ro._ZTV" section.
9266 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9267 * testsuite/icf_safe_so_test.cc: Ditto.
9268 * testsuite/icf_safe_test.cc: Ditto.
9269 * testsuite/icf_safe_test.sh: Ditto.
9270
d3bbad62
ILT
92712010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9272 Ian Lance Taylor <iant@google.com>
9273
9274 * target-reloc.h (relocate_section): Check the symbol table index
9275 for -1U before setting the local symbol index.
9276 (scan_relocatable_relocs): If copying the relocation, record that
9277 the local symbol is required.
9278 * object.h (Symbol_value::is_output_symtab_index_set): New
9279 function.
9280 (Symbol_value::may_be_discarded_from_output_symtab): New
9281 function.
9282 (Symbol_value::has_output_symtab_entry): New function.
9283 (Symbol_value::needs_output_symtab_entry): Remove.
9284 (Symbol_value::output_symtab_index): Make sure the symbol index is
9285 set.
9286 (Symbol_value::set_output_symtab_index): Make sure the symbol
9287 index is not set. Make sure the new index is valid.
9288 (Symbol_value::set_must_have_output_symtab_entry): New function.
9289 (Symbol_value::has_output_dynsym_entry): New function.
9290 (Symbol_value::set_output_dynsym_index): Make sure the new index
9291 is valid.
9292 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9293 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9294 local symbol if permitted.
9295 (Sized_relobj::do_finalize_local_symbols): Call
9296 is_output_symtab_index_set rather than needs_output_symtab_entry.
9297 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9298 rather than needs_output_symtab_entry. Call
9299 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9300 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9301 is_output_symtab_index_set rather than needs_output_symtab_entry.
9302 * testsuite/discard_locals_relocatable_test.c: New file.
9303 * testsuite/discard_locals_test.sh: Test -r.
9304 * testsuite/Makefile.am (check_DATA): Add
9305 discard_locals_relocatable_test1.syms,
9306 discard_local_relocatable_test2.syms.
9307 (MOSTLYCLEANFILES): Likewise. Also add
9308 discard_locals_relocatable_test1.lout and
9309 discard_locals_relocatable_test2.out.
9310 (discard_locals_relocatable_test1.syms): New target.
9311 (discard_locals_relocatable_test.o): New target.
9312 (discard_locals_relocatable_test1.out): New target.
9313 (discard_locals_relocatable_test2.syms): New target.
9314 (discard_locals_relocatable_test2.out): New target.
9315 (various): Add missing ../ld-new dependencies.
9316 * testsuite/Makefile.in: Rebuild.
9317
7e8ccf26
NC
93182010-03-03 Nick Clifton <nickc@redhat.com>
9319
9320 * po/fi.po: New Finnish translation.
9321
2a0ff005
DK
93222010-03-01 Doug Kwan <dougkwan@google.com>
9323
9324 * layout.cc (Layout::Layout): Force section types of .init_array*,
9325 .preinit_array* and .fini_array* sections.
9326 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9327 Fix check of return value of std::string::find.().
9328 (Output_section::Input_section_sort_compare::operator()): Remove
9329 comment about .init_array.
9330 (Output_section::Input_section_sort_init_fini_compare::operator()):
9331 New method.
9332 (Output_section::sort_attached_input_sections): Handle .init_array
9333 and .fini_array specially.
9334 * output.h (Output_section::Inut_section_sort_compare): Update
9335 comment.
9336 (Output_section::Input_section_sort_init_fini_compare): New struct.
9337
c3e4ae29
DK
93382010-02-26 Doug Kwan <dougkwan@google.com>
9339
9340 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9341 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9342 * testsuite/debug_msg.sh: Avoid matching source line number for
9343 use of global variable undef_int.
9344
2fd9ae7a
DK
93452010-02-26 Doug Kwan <dougkwan@google.com>
9346
9347 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9348 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9349 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9350 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9351 * options.cc (General_options::General_options): Initialize member
9352 fix_v4bx_.
9353 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9354 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9355 and rm_no_fix_v4bx.stdout
9356 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9357 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9358 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9359 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9360 and arm_no_fix_v4bx.
9361 * Makefile.in: Regenerate.
9362 * testsuite/arm_fix_v4bx.s: New file.
9363 * testsuite/arm_fix_v4bx.sh: Ditto.
9364
67ec7d0b
DK
93652010-02-24 Doug Kwan <dougkwan@google.com>
9366
9367 * arm.cc (Target_arm::got_section): Make the .got section the first
9368 non RELRO section in the data segment.
9369 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9370 suffixes of section names.
9371
10165461
DK
93722010-02-24 Doug Kwan <dougkwan@google.com>
9373
9374 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9375 flags and attributes merging if an input file is a binary file.
9376 * fileread.cc (Input_file::open): Record format of original file.
9377 * fileread.h (Input_file::Format): New enum type.
2e702c99 9378 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9379 (Input_file::format): New method definition.
9380 (Input_file::format_):: New data member.
9381
4a54abbb
DK
93822010-02-24 Doug Kwan <dougkwan@google.com>
9383
9384 * arm.cc (Arm_output_data_got): New class.
9385 (ARM_TCB_SIZE): New constant
9386 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9387 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9388 If user uses a script with a SECTIONS clause, issue only a warning
9389 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9390 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9391 garbage collection.
9392 (Target_arm::got_mode_index_entry): Handle static linking.
9393 (Target_arm::Scan::local): Ditto.
9394 (Target_arm::Scan::global): Ditto.
9395 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9396 all incorrectly implemented relocations.
e1df38aa 9397 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9398 Arm_output_section::fix_exidx_coverage.
9399 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9400 from ".ARM.exidx." and ".ARM.extab.".
9401
ca419a6f
ILT
94022010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9403
9404 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9405 section if it does not already exist.
9406 * attributes.cc (Attributes_section_data::Attributes_section_data):
9407 Don't crash if size is zero.
9408
135b9c78
ILT
94092010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9410 Ian Lance Taylor <iant@google.com>
9411
9412 * gold.cc (queue_middle_tasks): If no input files were opened,
9413 exit.
9414 * workqueue.h (Task_function::Task_function): Assert that there is
9415 a blocker.
9416
bb0bfe4f
DK
94172010-02-22 Doug Kwan <dougkwan@google.com>
9418
9419 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9420 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9421 types to avoid warnings due to different uint64_t implementations
9422 on different hosts.
9423
2a2b6d42
DK
94242010-02-21 Doug Kwan <dougkwan@google.com>
9425
9426 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9427 handling of the maximum backward branch offset.
2e702c99 9428 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9429 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9430 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9431 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9432 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9433 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9434 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9435 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9436 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9437 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9438 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9439 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9440 thumb2_bl_out_of_range.o): New rules.
9441 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9442 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9443 thumb2_bl_out_of_range
9444 * testsuite/Makefile.in: Regenerate.
9445 * testsuite/arm_bl_in_range.s: New file.
9446 * testsuite/arm_bl_out_of_range.s: Ditto.
9447 * testsuite/arm_branch_in_range.sh: Ditto.
9448 * testsuite/arm_branch_range.t: Ditto.
9449 * testsuite/thumb2_branch_range.t: Ditto.
9450 * testsuite/thumb_bl_in_range.s: Ditto.
9451 * testsuite/thumb_bl_out_of_range.s: Ditto.
9452 * testsuite/thumb_branch_range.t: Ditto.
9453
b487ad64
ST
94542010-02-20 Sriraman Tallam <tmsriram@google.com>
9455
9456 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9457 Add reloc offset information.
9458 * icf.cc (get_section_contents): Change iterators to point to the new
9459 vectors. Add reloc offset information to the contents.
9460 * icf.h (Icf::Sections_reachable_info): New typedef.
9461 (Icf::Sections_reachable_list): New typedef.
9462 (Icf::Offset_info): New typedef.
9463 (Icf::Reloc_info): New struct typedef.
9464 (Icf::Reloc_info_list): New typedef.
9465 (Icf::symbol_reloc_list): Delete method.
9466 (Icf::addend_reloc_list): Delete method.
9467 (Icf::section_reloc_list): Delete method.
9468 (Icf::reloc_info_list): New method.
9469 (Icf::reloc_info_list_): New member.
9470
f96accdf
DK
94712010-02-19 Doug Kwan <dougkwan@google.com>
9472
9473 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9474 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9475 * arm.cc (Arm_relocation_functions): New forward declaration.
9476 (Target_arm::Target_arm): Initialize new data members
9477 got_mod_index_offset_ and tls_base_symbol_defined_.
9478 (Target_arm::Relocate::relocate_tls): New method.
9479 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9480 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9481 New methods.
2e702c99 9482 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9483 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9484 (Target_arm::got_mod_index_offset_,
9485 Target_arm::tls_base_symbol_defined_): New data members.
9486 (Target_arm::Scan::local, Target::Scan::global,
9487 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9488 relocations.
9489
c8761b9a
DK
94902010-02-18 Doug Kwan <dougkwan@google.com>
9491
9492 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9493 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9494 text section as a parameter becuase some broken tools may not set
9495 the link in section header.
9496 (Target_arm::has_got_section): New method.
9497 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9498 without any mapping symbol as data only. Remove warning.
9499 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9500 link in its section header, try to discover the link by inspecting the
9501 REL31 relocation at the beginning of the section.
9502 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9503 in error message.
9504 (Target_arm::Scan::global): Treat any reference to the symbol
9505 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9506
21bb3914
ST
95072010-02-12 Sriraman Tallam <tmsriram@google.com>
9508
9509 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9510 (Scan::global_reloc_may_be_function_pointer): New function.
9511 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9512 (Scan::global_reloc_may_be_function_pointer): New function.
9513 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9514 (Scan::global_reloc_may_be_function_pointer): New function.
9515 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9516 (Scan::global_reloc_may_be_function_pointer): New function.
9517 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9518 (Scan::global_reloc_may_be_function_pointer): New function.
9519 (Scan::possible_function_pointer_reloc): New function.
9520 (Target_x86_64::can_check_for_function_pointers): New function.
9521 * gc.h (gc_process_relocs): Scan relocation types to determine if
9522 function pointers were taken for targets that support it.
9523 * icf.cc (Icf::find_identical_sections): Include functions for
9524 folding in safe ICF whose pointer is not taken.
9525 * icf.h (Secn_fptr_taken_set): New typedef.
9526 (fptr_section_id_): New member.
9527 (section_has_function_pointers): New function.
9528 (set_section_has_function_pointers): New function.
9529 (check_section_for_function_pointers): New function.
9530 * options.h: Fix comment for safe ICF option.
9531 * target.h (can_check_for_function_pointers): New function.
9532 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9533 Modify icf_safe_test for X86-64.
9534 * testsuite/Makefile.in: Regenerate.
9535 * testsuite/icf_safe_so_test.cc: New file.
9536 * testsuite/icf_safe_so_test.sh: New file.
9537 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9538 (main): Change to take pointer to function kept_func_3.
9539 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9540 folding is done correctly for X86-64.
9541
0da6fa6c
DM
95422010-02-12 David S. Miller <davem@davemloft.net>
9543
9544 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9545 is_symbolless parameter.
9546 (Output_reloc<SHT_REL>::is_symbolless): New.
9547 (Output_reloc<SHT_REL>::is_symbolless_): New.
9548 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9549 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9550 (Output_reloc<SHT_RELA>::is_symbolless): New.
9551 (Output_data_reloc::add_global): Handle is_symbolless.
9552 (Output_data_reloc::add_global_relative): Likewise.
9553 (Output_data_reloc::add_local): Likewise.
9554 (Output_data_reloc::add_local_relative): Likewise.
9555 (Output_data_reloc::add_symbolless_global_addend): New.
9556 (Output_data_reloc::add_symbolless_local_addend): New.
9557 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9558 is_symbolless.
9559 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9560 instead of ->is_relative_
9561 (Output_reloc::write): Likewise.
9562 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9563 (Output_reloc::write_rel): Simplify.
9564
9565 * sparc.cc (Target_sparc::Scan::local): Use
9566 ->add_symbolless_local_addend as needed.
9567 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9568 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9569 based upon relocation offset.
9570
e4782e83
DK
95712010-02-11 Doug Kwan <dougkwan@google.com>
9572
9573 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9574 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9575 beginning of function.
9576 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9577 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9578 parameter is_32bit in calls to should_apply_static_reloc.
9579 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9580 (check_DATA): Add arm_abs_global.stdout.
9581 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9582 arm_abs_global.stdout): New rules.
9583 (MOSTLLYCLEANFILES): Add arm_abs_global
9584 * Makefile.in: Regenerate.
9585 * testsuite/arm_abs_global.s: New file.
9586 * testsuite/arm_abs_global.sh: Ditto.
9587 * testsuite/arm_abs_lib.s: Ditto.
9588
93ceb764
ILT
95892010-02-11 Ian Lance Taylor <iant@google.com>
9590
9591 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9592 Read_relocs task.
9593 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9594 Allocate_commons_task first.
9595 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9596 task, rather than symtab_lock_.
9597 (Gc_process_relocs::~Gc_process_relocs): New function.
9598 (Gc_process_relocs::is_runnable): Check this_blocker_.
9599 (Gc_process_relocs::locks): Use next_blocker_ rather than
9600 blocker_.
9601 (Scan_relocs::~Scan_relocs): New function.
9602 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9603 symtab_lock_.
9604 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9605 next_blocker_.
9606 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9607 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9608 constructor accordingly.
9609 (class Gc_process_relocs): Likewise.
9610 (class Scan_relocs): Likewise.
9611 * common.h (class Allocate_commons_task): Remove symtab_lock_
9612 field, and corresponding constructor parameter.
9613 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9614 symtab_lock_.
9615 (Allocate_commons_task::locks): Likewise.
9616
114dfbe1
ILT
96172010-02-11 Ian Lance Taylor <iant@google.com>
9618
9619 * gold-threads.h (class Once): Define.
9620 (class Initialize_lock): Rewrite as child of Once.
9621 * gold-threads.cc (class Once_initialize): Define.
9622 (once_pointer_control): New static variable.
9623 (once_pointer, once_arg): New static variables.
9624 (c_run_once): New static function.
9625 (Once::Once, Once::run_once, Once::internal_run): New functions.
9626 (class Initialize_lock_once): Remove.
9627 (initialize_lock_control): Remove.
9628 (initialize_lock_pointer): Remove.
9629 (initialize_lock_once): Remove.
9630 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9631 (Initialize_lock::initialize): Rewrite.
9632 (Initialize_lock::do_run_once): New function.
9633 * archive.cc (Archive::interpret_header): Only clear name if it is
9634 not already empty.
9635 * fileread.cc: Include "gold-threads.h"
9636 (file_counts_lock): New static variable.
9637 (file_counts_initialize_lock): Likewise.
9638 (File_read::release): Only increment counts when using --stats.
9639 Use a lock around the increment.
9640 * parameters.cc (class Set_parameters_target_once): Define.
9641 (set_parameters_target_once): New static variable.
9642 (Parameters::Parameters): Move here from parameters.h.
9643 (Parameters::set_target): Rewrite.
9644 (Parameters::set_target_once): New function.
9645 (Parameters::clear_target): Move here and rewrite.
9646 * parameters.h (class Parameters): Update declarations. Add
9647 set_parameters_target_once_ field.
9648 (Parameters::Parameters): Move to parameters.cc.
9649 (Parameters::clear_target): Likewise.
9650 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9651 task.
9652 (Start_group::~Start_group): New function.
9653 (Start_group::is_runnable): New function.
9654 (Start_group::locks, Start_group::run): New functions.
9655 (Finish_group::run): Change saw_undefined to size_t.
9656 * readsyms.h (class Start_group): Define.
9657 (class Finish_group): Change saw_undefined_ field to size_t.
9658 (Finish_group::Finish_group): Remove saw_undefined and
9659 this_blocker parameters. Change all callers.
9660 (Finish_group::set_saw_undefined): New function.
9661 (Finish_group::set_blocker): New function.
9662 * symtab.h (class Symbol_table): Change saw_undefined to return
9663 size_t. Change saw_undefined_ field to size_t.
9664 * target-select.cc (Set_target_once::do_run_once): New function.
9665 (Target_selector::Target_selector): Initialize set_target_once_
9666 field. Don't initialize lock_ and initialize_lock_ fields.
9667 (Target_selector::instantiate_target): Rewrite.
9668 (Target_selector::set_target): New function.
9669 * target-select.h (class Set_target_once): Define.
9670 (class Target_selector): Update declarations. Make
9671 Set_target_once a friend. Remove lock_ and initialize_lock_
9672 fields. Add set_target_once_ field.
9673
fa17a3f4
ILT
96742010-02-10 Ian Lance Taylor <iant@google.com>
9675
9676 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9677 queueing any tasks.
9678 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9679 (queue_middle_tasks): Add all blockers before queueing any tasks.
9680 (queue_final_tasks): Likewise.
9681 * token.h (Task_token::add_blockers): New function.
9682 * object.h (Input_objects::number_of_relobjs): New function.
9683
c7177d31
ILT
96842010-02-10 Ian Lance Taylor <iant@google.com>
9685
5de0e392
ILT
9686 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9687 shared, not if not position independent.
9688 * x86_64.cc (Relocate::relocate_tls): Likewise.
9689 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9690 (tls_pie_pic_test): New target.
9691 * testsuite/Makefile.in: Rebuild.
9692
c7177d31
ILT
9693 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9694 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9695 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9696 * testsuite/Makefile.in: Rebuild.
9697
684b268a
DM
96982010-02-09 David S. Miller <davem@davemloft.net>
9699
9700 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9701 R_SPARC_RELATIVE using ->add_local_relative().
9702 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9703
612a8d3d
DM
9704 * output.h (Output_data_dynamic::add_section_size): New method
9705 that takes two Output_data objects.
9706 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9707 entry param. Handle it in initializers.
9708 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9709 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9710 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9711 arg.
9712 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9713 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9714 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9715 for dynrel_includes_plt.
9716 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9717 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9718 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9719 before .rela.plt
9720 (Target_sparc::do_finalize_sections): Update to pass true for
9721 dynrel_includes_plt.
9722 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9723 output before .rela.plt
9724 (Target_powerpc::do_finalize_sections): Update to pass true for
9725 dynrel_includes_plt when 32-bit.
9726
cb1be87e
DK
97272010-02-08 Doug Kwan <dougkwan@google.com>
9728
9729 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9730 method.
9731 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9732 Arm_relobj::scan_section_for_cortex_a8_stubs,
9733 Arm_relobj::do_relocation_section): Instead of calling
9734 Output_section::output_address, use faster
9735 Arm_relobj::simple_input_section_output_address.
9736
705b5121
DM
97372010-02-08 David S. Miller <davem@davemloft.net>
9738
9739 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9740 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9741 relocation helper function.
9742
024c4466
DM
9743 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9744 just like R_SPARC_GOT{10,13,22}.
9745 (Target_sparc::Scan::local): Likewise.
9746 (Target_sparc::Relocate:relocate): Likewise.
9747
9109c078
ILT
97482010-02-06 Ian Lance Taylor <iant@google.com>
9749
9750 * configure.ac: Rewrite targetobjs duplicate removal code to use
9751 only shell constructs.
9752 * configure: Rebuild.
9753
cf846138
DK
97542010-02-05 Doug Kwan <dougkwan@google.com>
9755
9756 PR 11247
9757 * arm.cc (Arm_relobj::section_is_scannable): New method.
9758 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9759 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9760
6cfaf60b
DK
97612010-02-04 Doug Kwan <dougkwan@google.com>
9762
9763 PR 11247
9764 * arm-reloc-property.cc (cstdio): Include.
9765 * configure.ac (targetobjs): Remove duplicates.
9766 * configure: Regenerate.
9767 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9768 big and little endian version for a given address size.
9769
5c57f1be
DK
97702010-02-03 Doug Kwan <dougkwan@google.com>
9771
9772 * arm-reloc-property.cc
9773 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9774 definition.
9775 * arm-reloc-property.h
9776 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9777 New method definition.
9778 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9779 declaration.
9780 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9781 overflow to N.
9782 (GOT_PREL): Change implemented to Y.
9783 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9784 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9785 (Arm_relocate_functions::movw_abs_nc): Remove method.
9786 (Arm_relocate_functions::movt_abs): Ditto.
9787 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9788 (Arm_relocate_functions::thm_movt_abs): Ditto.
9789 (Arm_relocate_functions::movw_rel_nc): Ditto.
9790 (Arm_relocate_functions::movw_rel): Ditto.
9791 (Arm_relocate_functions::movt_rel): Ditto.
9792 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9793 (Arm_relocate_functions:thm_movw_rel): Ditto.
9794 (Arm_relocate_functions:thm_movt_rel): Ditto.
9795 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9796 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9797 New method definitions.
9798 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9799 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9800 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9801 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9802 (Target_arm::Relocate::relocate): Check for non-static or
9803 unimplemented relocation code and exit early. Change calls to
9804 Target_arm::reloc_uses_thumb_bit and
9805 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9806 instead. Refactor code to handle similar relocations to increase
9807 code sharing. Remove check for unsupported relocation code in switch
9808 statement.
9809 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9810 relocation property table to find out size. Change error message to
9811 print out the name of a relocation code instead of the numeric value.
9812 (Target_arm::scan_reloc_for_stub): Use relocation property table
9813 instead of calling Target_arm::reloc_uses_thumb_bit().
9814
218c5831
DK
98152010-02-02 Doug Kwan <dougkwan@google.com>
9816
9817 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9818 types of relaxed input section.
9819
0d31c79d
DK
98202010-02-02 Doug Kwan <dougkwan@google.com>
9821
9822 * Makefile.am (HFILES): Add arm-reloc-property.h.
9823 (DEFFILES): New.
2e702c99
RM
9824 (TARGETSOURCES): Add arm-reloc-property.cc
9825 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9826 (libgold_a_SOURCES): $(DEFFILES)
9827 * Makefile.in: Regenerate.
9828 * arm-reloc-property.cc: New file.
9829 * arm-reloc-property.h: New file.
9830 * arm-reloc.def: New file.
9831 * arm.cc: Update comments.
9832 (arm-reloc-property.h): New included header.
9833 (arm_reloc_property_table): New global variable.
9834 (Target_arm::do_select_as_default_target): New method definition.
9835 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9836 arm-reloc-property to targ_extra_obj.
9837 * parameters.cc (set_parameters_target): Call
9838 Target::select_as_default_target().
9839 * target.h (Target::select_as_default_target): New method definition.
9840 (Target::do_select_as_default_target): Same.
9841
546c7457
DK
98422010-02-01 Doug Kwan <dougkwan@google.com>
9843
9844 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9845 first_output_text_section_.
9846 (Arm_exidx_fixup::first_output_text_section): New method definition.
9847 (Arm_exidx_fixup::first_output_text_section_): New data member.
9848 (Arm_exidx_fixup::process_exidx_section): Record the first text
9849 output section seen.
9850 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9851 and entsize in output section header.
9852
11b861d5
DK
98532010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9854
9855 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9856 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9857 (Arm_relocate_functions::thm_alu11): New Method.
9858 (Arm_relocate_functions::thm_pc8): New Method.
9859 (Arm_relocate_functions::thm_pc12): New Method.
9860 (Target_arm::Scan::local): Handle the relocations.
9861 (Target_arm::Scan::global): Likewise.
9862 (Target_arm::Relocate::relocate): Likewise.
9863 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9864
c9a2c125
DK
98652010-01-29 Doug Kwan <dougkwan@google.com>
9866
9867 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9868 of relocation types as ld.
9869
1521477a
DK
98702010-01-29 Doug Kwan <dougkwan@google.com>
9871
9872 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9873 to public.
9874 (Arm_relocate_functions::thumb_branch_common): Ditto.
9875 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9876 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9877 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9878 Arm_relocate_functions::jump24): Remove.
9879 (Target_arm::Relocate::relocate): Adjust code to call
9880 Arm_relocation_functions::arm_branch_common and
9881 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9882 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9883
e7eca48c
DK
98842010-01-29 Doug Kwan <dougkwan@google.com>
9885
9886 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9887 output_local_symbol_count_needs_update_.
9888 (Arm_relobj::output_local_symbol_count_needs_update,
9889 Arm_relobj::set_output_local_symbol_count_needs_update,
9890 Arm_relobj::update_output_local_symbol_count): New methods.
9891 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9892 member.
9893 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9894 of pointed function as in a R_ARM_PREL31 relocation.
9895 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9896 for output local symbol count updating.
9897 (Target_arm::do_relax): Update output local symbol counts in objects
9898 if necessary.
9899 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9900
02961d7e
ILT
99012010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9902
9903 * arm.cc: Added support for the ARM relocations:
9904 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9905 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9906 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9907 movw_prel_nc).
9908 (Arm_relocate_functions::movw_rel): New method.
9909 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9910 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9911 thm_movw_prel_nc).
9912 (Arm_relocate_functions::thm_movw_rel): New method.
9913 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9914 thm_movt_prel).
9915 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9916 relocations.
9917 (Target_arm::Scan::global): Likewise.
9918 (Target_arm::Relocate::relocate): Likewise.
9919 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9920 Likewise.
9921
b10d2873
ILT
99222010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9923
9924 * arm.cc: Added support for ARM group relocations.
9925 (Target_arm::reloc_needs_sym_origin): New method.
9926 (Arm_relocate_functions::calc_grp_kn): New method.
9927 (Arm_relocate_functions::calc_grp_residual): New method.
9928 (Arm_relocate_functions::calc_grp_gn): New method.
9929 (Arm_relocate_functions::arm_grp_alu): New Method.
9930 (Arm_relocate_functions::arm_grp_ldr): New Method.
9931 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9932 (Arm_relocate_functions::arm_grp_ldc): New Method.
9933 (Target_arm::Scan::local): Handle the ARM group relocations.
9934 (Target_arm::Scan::global): Likewise.
9935 (Target_arm::Relocate::relocate): Likewise.
9936 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9937 Likewise.
9938
2b328d4e
DK
99392010-01-26 Doug Kwan <dougkwan@google.com>
9940
9941 * arm.cc (set): Include.
9942 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9943 pointer type.
2e702c99 9944 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9945 (Arm_output_section::append_text_sections_to_list): New method.
9946 (Arm_output_section::fix_exidx_coverage): Ditto.
9947 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9948 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9949 Relobj::set_section_offset() instead of
9950 Sized_relobj::invalidate_section_offset().
2e702c99 9951 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9952 parameter for section headers. Ignore relocation sections for
9953 unallocated sections and EXIDX sections.
9954 (Target_arm::fix_exidx_coverage): New method.
9955 (Target_arm::output_section_address_less_than): New type.
9956 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9957 linked text section instead of the EXIDX section.
9958 (Arm_output_section::create_stub_group): Add an assertion to check
9959 that this is not an EXIDX output section.
9960 (Arm_output_section::append_text_sections_to_list): New method.
9961 (Arm_output_section::fix_exidx_coverage): Ditto.
9962 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9963 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9964 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9965 first pass.
9966 (Target_arm::fix_exidx_coverage): New method.
9967 * object.h (Relobj::set_output_section): New method.
9968 (Sized_relobj::invalidate_section_offset): Remove method.
9969 (Sized_relobj::do_invalidate_section_offset): Remove method.
9970 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9971
c7f3c371
DK
99722010-01-25 Doug Kwan <dougkwan@google.com>
9973
9974 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9975 Fix warning due to signed and unsigned comparison on a 32-bit host.
9976
8923b24c
DK
99772010-01-22 Doug Kwan <dougkwan@google.com>
9978
9979 * arm.cc (Target_arm::do_relax): Record an output section for section
9980 offset adjustment it contains any stub table that has changed.
9981 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9982 offsets in an output section if necessary.
9983 * output.cc (Output_section::Output_section): Initialize
9984 section_offsets_need_adjustments_.
9985 (Output_section::add_input_section_for_script): Renamed to
9986 Output_section::add_simple_input_section.
9987 (Output_section::save_states): Add a comment.
9988 (Output_section::discard_states): New method defintion.
9989 (Output_section::adjust_section_offsets): Same.
9990 * output.h (Output_section::add_input_section_for_script): Renamed to
9991 Output_section::add_simple_input_section.
9992 (Output_section::discard_states): New method declaration.
9993 (Output_section::adjust_section_offsets): Same.
9994 (Output_section::section_offsets_need_adjustment,
9995 Output_section::set_section_offsets_need_adjustment): New method
9996 definitions.
9997 (Output_section::section_offsets_need_adjustment_): New data member.
9998 * script-sections.cc
9999 (Output_section_element_input::set_section_address): Adjust code for
10000 renaming of Output_section::add_input_section_for_script.
10001 (Orphan_output_section::set_section_address): Same.
10002
9b2fd367
DK
100032010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10004
10005 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10006 Fix_v4bx enum values .
10007 * gold/options.h (General_options): New option definitions.
10008 (General_options::fix_v4bx): New method.
10009 (General_options::Fix_v4bx): New enum.
10010 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10011 (General_options::parse_fix_v4bx_interworking): New method.
10012
80d0d023
DK
100132010-01-22 Doug Kwan <dougkwan@google.com>
10014
10015 * arm.cc (Arm_exidx_fixup): New class.
10016
af2cdeae
DK
100172010-01-21 Doug Kwan <dougkwan@google.com>
10018
10019 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10020 classes.
10021 (Arm_exidx_section_offset_map): New type.
10022
993d07c1
DK
100232010-01-21 Doug Kwan <dougkwan@google.com>
10024
10025 * arm.cc (Arm_exidx_input_section): New class.
10026 (Arm_relobj::exidx_input_section_by_link,
10027 Arm_relobj::exidx_input_section_by_shndx,
10028 Arm_relobj::make_exidx_input_section): New methods.
10029 (read_arm_attributes_section): Remove.
10030 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10031 information about them.
10032 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10033 to here.
10034
5ac169d4
DK
100352010-01-20 Doug Kwan <dougkwan@google.com>
10036
10037 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10038 Input_section_specifier to Section_id.
10039 (Target_arm::new_arm_input_section: Adjust code for change of key
10040 type.
10041 (Target_arm::find_arm_input_section): Ditto.
10042 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10043 (Section_id): Remove.
10044 (Garbage_collection::Section_id_hash): Remove.
10045 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10046 (Section_id): Remove.
10047 (Icf::Section_id_hash): Remove.
10048 * object.h (Section_id, Const_section_id, Section_id_hash,
10049 Const_section_id_hash): New type definitions.
10050 * output.cc (Output_section::add_relaxed_input_section): Change to
10051 use Const_section_id instead of Input_section_specifier as key type.
10052 (Output_section::add_merge_input_section): Ditto.
10053 (Output_section::build_relaxation_map): Change to use Section_id
10054 instead of Input_section_specifier as key type.
2e702c99 10055 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10056 Ditto.
10057 (Output_section::convert_input_sections_to_relaxed_sections): Change
10058 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10059 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10060 (Output_section::find_relaxed_input_section): Ditto.
10061 * output.h (Input_section_specifier): Remove class.
10062 (Output_section::Output_section_data_by_input_section_map): Change
10063 key type to Const_section_id.
10064 (Output_section::Output_relaxed_input_section_by_input_section_map):
10065 Ditto.
10066 (Output_section::Relaxation_map): Change key type to Section_id.
10067
a2162063
ILT
100682010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10069
10070 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10071 (class Arm_v4bx_stub): New class.
10072 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10073 (Stub_factory::make_arm_v4bx_stub): New method.
10074 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10075 (Stub_table::empty): Handle v4bx stubs.
10076 (Stub_table::add_arm_v4bx_stub): New method.
10077 (Stub_table::find_arm_v4bx_stub): New method.
10078 (Arm_relocate_functions::v4bx): New method.
10079 (Target_arm::fix_v4bx): New method.
10080 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10081 (Stub_table::relocate_stubs): Likewise.
10082 (Stub_table::do_write): Likewise.
10083 (Stub_table::update_data_size_and_addralign): Likewise.
10084 (Stub_table::finalize_stubs): Likewise.
10085 (Target_arm::Scan::local): Likewise.
10086 (Target_arm::Scan::global): Likewise.
10087 (Target_arm::do_finalize_sections): Likewise.
10088 (Target_arm::Relocate::relocate): Likewise.
10089 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10090 Likewise.
10091 (Target_arm::scan_reloc_for_stub): Likewise.
10092 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10093
5696ab0b
ILT
100942010-01-19 Ian Lance Taylor <iant@google.com>
10095
10096 * output.cc (Output_section_headers::do_sized_write): Write large
10097 segment count to sh_info field.
10098 (Output_file_header::do_sized_write): For large segment count,
10099 write PN_XNUM to e_phnum field.
10100
800d0f56
ILT
101012010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10102
10103 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10104 (Arm_relocate_functions::thm_jump8): New function.
10105 (Arm_relocate_functions::thm_jump11): New function.
10106 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10107 R_ARM_THM_JUMP11.
10108 (Target_arm::Scan::global): Likewise.
10109 (Target_arm::Relocate::relocate): Likewise.
10110 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10111 Likewise.
10112
41263c05
DK
101132010-01-14 Doug Kwan <dougkwan@google.com>
10114
10115 * arm.cc (map, utility): Include headers.
10116 (Target_arm::apply_cortex_a8_workaround): New method.
10117 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10118 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10119 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10120 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10121 the --[no-]fix-cortex-a8 command line options.
10122 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10123 (Target_arm::relocate_stub): Use addend in instruction template.
10124 * options.h (DEFINE_bool): Set the user-set flag.
10125 (General_options): Add --[no-]-fix-cortex options.
10126 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10127 : Update fast look-up map after conversion.
41263c05 10128
459e9b03
ST
101292010-01-14 Sriraman Tallam <tmsriram@google.com>
10130
10131 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10132 in the first pass of do_layout.
10133
b521dfe4
DK
101342010-01-13 Doug Kwan <dougkwan@google.com>
10135
10136 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10137 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10138 apparent compiler problem of not folding static constant integral
10139 data members of elfcpp::Elf_sizes<32>.
10140
44272192
DK
101412010-01-13 Doug Kwan <dougkwan@google.com>
10142
10143 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10144 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10145 Arm_relobj::scan_section_for_cortex_a8_erratum,
10146 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10147 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10148 sections to scan for relocation stubs into a new method
10149 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10150 relocation and Cortex-A8 stub scanning.
10151 (Target_arm::do_relax): Force stubs to be after stubbed sections
10152 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10153 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10154 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10155
44b71ece
ILT
101562010-01-12 Ian Lance Taylor <iant@google.com>
10157
10158 * target-reloc.h (visibility_error): New inline function.
10159 (relocate_section): Call visibility_error.
10160 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10161 (MOSTLYCLEANFILES): Likewise.
10162 (protected_4_pic.o, protected_3.err): New targets.
10163 * testsuite/protected_4.cc: New file.
10164
a120bc7f
DK
101652010-01-12 Doug Kwan <dougkwan@google.com>
10166
10167 * arm.cc (Cortex_a8_reloc): New class.
10168 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10169 and cortex_a8_relocs_info_.
10170 (Target_arm::fix_cortex_a8): New method definition.
10171 (Target_arm::Cortex_a8_relocs_info): New type.
10172 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10173 New data member declarations.
10174 (Target_arm::scan_reloc_for_stub): Record information about
10175 relocations for THUMB branches that might be exempted from the
10176 Cortex-A8 workaround.
10177 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10178 at the beginning of a relaxation pass.
10179
20138696
DK
101802010-01-12 Doug Kwan <dougkwan@google.com>
10181
10182 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10183 (Arm_relobj::Mapping_symbol_position,
10184 Arm_reloj::Mapping_symbol_position_less,
10185 Arm_relobj::Mapping_symbols_info): New types.
10186 (Target_arm::is_mapping_symbol_name): New method definition.
10187 (Arm_relobj::do_count_local_symbols): Save information about mapping
10188 symbols.
10189
089d69dc
DK
101902010-01-11 Doug Kwan <dougkwan@google.com>
10191
10192 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10193 Arm_relocate_functions::thumb32_branch_upper,
10194 Arm_relocate_functions::thumb32_branch_lower,
10195 Arm_relocate_functions::thumb32_cond_branch_offset,
10196 Arm_relocate_functions::thumb32_cond_branch_upper,
10197 Arm_relocate_functions::thumb32_cond_branch_lower,
10198 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10199 branch offset encoding.
10200 (Arm_relocate_functions::thumb_branch_common): Use new branch
10201 offset encoding methods to avoid code duplication.
10202 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10203 (Stub_addend_reader::operator()): Use new branch encoding method
10204 to avoid code duplication.
10205
99e5bff2
DK
102062010-01-11 Doug Kwan <dougkwan@google.com>
10207
10208 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10209 (Target_arm::do_finalize_sections): Define special EXIDX section
10210 symbols only if referenced.
10211 * gc.h (Garbage_collection::add_reference): New method.
10212 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10213 code duplication.
10214
98e090bd
ILT
102152010-01-11 Ian Lance Taylor <iant@google.com>
10216
d0a91bd8
ILT
10217 * script.cc (Version_script_info::build_expression_list_lookup):
10218 Change complaing about duplicate wildcard match from error to
10219 warning.
10220
98e090bd
ILT
10221 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10222 of 2009-12-30.
10223 (Version_script_info::Version_script_info): Initialize globs_,
10224 default_version_, default_is_global_, and exact_. Don't
10225 initialize globals_ or locals_.
10226 (Version_script_info::build_lookup_tables): Build local symbols
10227 first.
10228 (Version_script_info::unquote): New function.
10229 (Version_script_info::add_exact_match): New function.
10230 (Version_script_info::build_expression_list_lookup): Remove lookup
10231 parameter. Add is_global parameter. Change all callers. Handle
10232 wildcard pattern specially. Unquote pattern. Call
10233 add_exact_match.
10234 (Version_script_info::get_name_to_match): New function.
10235 (Version_script_info::get_symbol_version): New function.
10236 (Version_script_info::get_symbol_version_helper): Remove.
10237 (Version_script_info::check_unmatched_names): Call unquote.
10238 * script.h (class Version_script_info): Change get_symbol_version
10239 to be non-inline and add is_global parameter; change all callers.
10240 Rewrite symbol_is_local. Update declarations. Define struct
10241 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10242 Remove globals_ and locals_ members. Add exact_, globs_,
10243 default_version_, is_global_.
10244 (Version_script_info::Glob): Remove pattern, add expression and
10245 is_global. Update constructor. Change all callers.
10246 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10247 default version.
10248 (Versions::symbol_section_contents): If a symbol is undefined, or
10249 defined in a dynamic object, set the version index to
10250 VER_NDX_LOCAL.
10251 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10252 symbol_is_local.
10253 (Symbol_table::add_from_pluginobj): Likewise.
10254 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10255
d56962d3
DK
102562010-01-11 Doug Kwan <dougkwan@google.com>
10257
10258 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10259 (incremental_dump_LDADD): Add linking option for libintl.
10260 * Makefile.in: Regenerate.
10261
94e6ee91
L
102622010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10263
10264 PR gold/11144
10265 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10266 instead of -Ds.
10267 * testsuite/Makefile.in: Regenerated.
10268
e96c574b
DK
102692010-01-10 Doug Kwan <dougkwan@google.com>
10270
10271 * options.h (DEFINE_var): Use parentheses around argument varname__
10272 in macro body to avoid any unintended subsequent substitutions.
10273
7198066b
ILT
102742010-01-10 Ian Lance Taylor <iant@google.com>
10275
ba4d53bf
ILT
10276 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10277 candidates before doing symbol resolution.
10278
7198066b
ILT
10279 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10280 ODR candidates if only one is weak.
10281
a2beed37
ILT
102822010-01-08 Ian Lance Taylor <iant@google.com>
10283
10284 * script.cc (Version_script_info::build_expression_list_lookup):
10285 Don't warn about ambiguous version, just record the ambiguity.
10286 (Version_script_info::get_symbol_version_helper): Give error if
10287 version is ambiguous.
10288
2fb7225c
DK
102892010-01-08 Doug Kwan <dougkwan@google.com>
10290
10291 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10292 prev_data_size_ and prev_addralign_. Remove initializer for
10293 deleted data member has_been_changed_.
10294 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10295 to determine if the table is empty.
10296 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10297 Remove.
10298 (Stub_table::add_reloc_stub): Define method in class definition
10299 instead of just declaring it there.
10300 (Stub_table::add_cortex_a8_stub): New method definition.
10301 (Stub_table::update_data_size_and_addralign): Ditto.
10302 (Stub_table::finalize_stubs): Ditto.
10303 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10304 (Stub_table::do_addralign_): Return address alignment in the
10305 (Stub_table::do_reset_address_and_file_offset): Define method in
10306 class definition instead of declaring it there. Set current data
10307 size to be the data size of the previous pass.
10308 (Stub_table::set_final_data_size): Use current data size as the
10309 final data size.
10310 (Stub_table::relocate_stub): Change parameter type of stub from
10311 Reloc_stub pointer to Stub pointer.
10312 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10313 (Stub_table::Cortex_a8_stub_list): New typedef.
10314 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10315 Stub_table::prev_addralign_): New data member.
10316 (Arm_relobj::Arm_relobj): Initialize data member
10317 section_has_cortex_a8_workaround_.
10318 (Arm_relobj::section_has_cortex_a8_workaround,
10319 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10320 definitions.
10321 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10322 declarations.
10323 (Target_arm::relocate_stub): Change parameter type of stub from
10324 Reloc_stub pointer to Stub pointer.
10325 (Insn_template::size, Insn_template::alignment): Handle
10326 THUMB16_SPECIAL_TYPE.
10327 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10328 Stub_table::update_data_size_and_addralign,
10329 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10330 definitions.
10331 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10332 (Stub_table::do_write): Ditto.
10333 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10334
880cd20d
ILT
103352010-01-08 Ian Lance Taylor <iant@google.com>
10336
10337 PR 11108
10338 * symtab.h (class Symbol): Remove fields is_target_special_ and
10339 has_plt_offset_. Add field is_defined_in_discarded_section_.
10340 (Symbol::is_defined_in_discarded_section): New function.
10341 (Symbol::set_is_defined_in_discarded_section): New function.
10342 (Symbol::has_plt_offset): Rewrite.
10343 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10344 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10345 Don't initialize is_target_special_ or has_plt_offset_.
10346 Initialize is_defined_in_discarded_section_.
10347 (Symbol_table::add_from_relobj): If appropriate, set
10348 is_defined_in_discarded_section.
10349 * resolve.cc (Symbol::override_base_with_special): Don't test
10350 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10351 * target-reloc.h (relocate_section): Do special handling for
10352 symbols defined in discarded sections for global symbols as well
10353 as local symbols.
10354
2703e3eb
ILT
103552010-01-08 Ian Lance Taylor <iant@google.com>
10356
10357 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10358 the SHT_SYMTAB case.
10359
339d40a3
ILT
103602010-01-08 Ian Lance Taylor <iant@google.com>
10361
10362 * object.cc (Sized_relobj::do_layout): Don't get confused if
10363 layout_eh_frame returns NULL.
10364
abecea76
ILT
103652010-01-08 Ian Lance Taylor <iant@google.com>
10366
10367 PR 11084
10368 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10369 dynamic symbol table, use the normal symbol table.
10370 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10371 symbol table.
10372
6b7dd3f3
ILT
103732010-01-08 Ian Lance Taylor <iant@google.com>
10374
10375 PR 11072
10376 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10377 sections.
10378
36c50e63
L
103792010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10380
10381 * version.cc (print_version): Change to "Copyright 2010".
10382
e291e7b9
ILT
103832010-01-08 Ian Lance Taylor <iant@google.com>
10384
10385 PR 10287
10386 PR 11063
10387 * i386.cc (class Target_i386): Change return type of plt_section
10388 to be non-const.
10389 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10390 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10391 tls_desc_rel_ field.
10392 (Output_data_plt_i386::rel_tls_desc): New function.
10393 (Target_i386::rel_tls_desc_section): New function.
10394 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10395 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10396 R_386_TLS_DESC reloc in rel_tls_desc_section.
10397 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10398 Define struct Tlsdesc_info.
10399 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10400 (Target_x86_64::do_reloc_symbol_index): New function.
10401 (Target_x86_64::add_tlsdesc_info): New function.
10402 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10403 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10404 tlsdesc_rel_ field.
10405 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10406 all callers.
10407 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10408 (Target_x86_64::rela_tlsdesc_section): New function.
10409 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10410 handling.
10411 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10412 (Target_x86_64::do_reloc_addend): New function.
10413 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10414 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10415 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10416 (Output_reloc::type): New function.
10417 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10418 (Output_reloc::is_target_specific): New function.
10419 (Output_reloc::target_arg): New function.
10420 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10421 absolute relocs and target specific relocs.
10422 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10423 add_target_specific.
10424 (class Output_data_reloc) [SHT_RELA]: Likewise.
10425 * output.cc (Output_reloc::Output_reloc): Add four new versions
10426 for absolute relocs and target specific relocs.
10427 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10428 (Output_reloc::get_symbol_index): Likewise.
10429 (Output_reloc::local_section_offset): Check that local_sym_index_
10430 is not TARGET_CODE or 0.
10431 (Output_reloc::symbol_value): Likewise.
10432 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10433 reloc.
10434 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10435 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10436 functions.
10437 * layout.cc (add_target_dynamic_tags): Use output section for
10438 DT_PLTRELSZ and DT_JMPREL.
10439
3a44184e
ILT
104402010-01-07 Ian Lance Taylor <iant@google.com>
10441
10442 PR 11061
10443 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10444 function.
10445 (class Output_data_reloc_generic): Define.
10446 (class Output_data_reloc_base): Change base class to
10447 Output_data_reloc_generic. Change add() method to call
10448 bump_relative_reloc_count for a relative reloc. Remove
10449 sort_relocs_ field.
10450 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10451 to sort_relocs().
10452 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10453 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10454 appropriate.
10455 * layout.h (class Layout): Update declaration.
10456
ea715a34
ILT
104572010-01-07 Ian Lance Taylor <iant@google.com>
10458
10459 * output.h (class Output_data): Add const version of
10460 output_section and do_output_section.
10461 (class Output_section_data): Add const version of
10462 do_output_section.
10463 (class Output_section): Likewise.
10464 * layout.cc (Layout::add_target_dynamic_tags): New function.
10465 * layout.h (class Layout): Update declarations.
10466 * arm.cc (Target_arm::do_finalize_sections): Use
10467 add_target_dynamic_tags.
10468 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10469 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10470 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10471 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10472
659948a4
ILT
104732010-01-07 Ian Lance Taylor <iant@google.com>
10474
10475 PR 11042
10476 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10477 object as needed.
10478
9d3b86f6
ILT
104792010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10480 Ian Lance Taylor <iant@google.com>
10481
10482 PR 11019
10483 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10484 Xindex::read_symtab_xindex.
10485
bb0d3eb0
DK
104862010-01-07 Doug Kwan <dougkwan@google.com>
10487
10488 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10489 (Insn_template::thumb16_bcond_insn): New method declaration.
10490 (Insn_template): Fix spelling.
10491 (Stub::thumb16_special): New method declaration.
10492 (Stub::do_write): Define virtual method which was previously pure
10493 virtual.
10494 (Stub::do_thumb16_special): New method declaration.
10495 (Stub::do_fixed_endian_write): New template member.
10496 (Reloc_stub::do_write): Remove.
10497 (Reloc_stub::do_fixed_endian_write): Remove.
10498 (Cortex_a8_stub): New class definition.
10499 (Stub_factory::make_cortex_a8_stub): New method definition.
10500 (Stub_factory::Stub_factory): Add missing static storage class
10501 qualifier for elf32_arm_stub_a8_veneer_blx.
10502
ffeef7df
ILT
105032010-01-07 Ian Lance Taylor <iant@google.com>
10504
dc3f80fe
ILT
10505 PR 10980
10506 * options.h (class General_options): Add --warn-unresolved-symbols
10507 and --error-unresolved-symbols.
10508 * errors.cc (Errors::undefined_symbol): Implement
10509 --warn-unresolved-symbols.
10510
ffeef7df
ILT
10511 * options.h (class General_options): Add -z text and -z textoff.
10512 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10513
f1ec9ded
ST
105142010-01-06 Sriraman Tallam <tmsriram@google.com>
10515
10516 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10517 (Garbage_collection::cident_sections): New function.
10518 (Garbage_collection::add_cident_section): New function.
10519 (Garbage_collection::cident_sections_): New member.
10520 (gc_process_relocs): Add references to sections whose names are C
10521 identifiers.
10522 * gold.h (cident_section_start_prefix): New constant.
10523 (cident_section_stop_prefix): New constant.
10524 (is_cident): New function.
10525 * layout.cc (Layout::define_section_symbols): Replace string constants
10526 with the newly defined constants.
10527 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10528 C identifiers.
10529 * testsuite/Makefile.am: Add gc_orphan_section_test.
10530 * testsuite/Makefile.in: Regenerate.
10531 * testsuite/gc_orphan_section_test.cc: New file.
10532 * testsuite/gc_orphan_section_test.sh: New file.
10533
6eda8c29
ILT
105342010-01-06 Ian Lance Taylor <iant@google.com>
10535
b9674e17
ILT
10536 PR 10980
10537 * options.h (class General_options): Add --warn-shared-textrel.
10538 * layout.cc (Layout::finish_dynamic_section): Implement
10539 --warn-shared-textrel.
10540
6eda8c29
ILT
10541 PR 10980
10542 * options.h (class General_options): Add --warn-multiple-gp.
10543
32dcd44e
ILT
105442010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10545
10546 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10547 $(THREADSLIB) and $(LIBDL).
10548 * Makefile.in: Rebuild.
10549
a192ba05
ILT
105502010-01-06 Ian Lance Taylor <iant@google.com>
10551
10552 PR 10980
10553 * options.cc (General_options::parse_section_start): New function.
10554 (General_options::section_start): New function.
10555 (General_options::General_options): Initialize all members.
10556 * options.h: Include <map>
10557 (class General_options): Add --section-start. Add section_starts_
10558 member.
10559 * layout.cc (Layout::attach_allocated_section_to_segment): If
10560 --section-start was used, set the address of the segment. Remove
10561 local sort_sections.
10562 (Layout::relaxation_loop_body): If the address of the load segment
10563 has been set by --section-start, don't use it.
10564 * output.h (Output_segment::update_flags_for_output_section): New
10565 function.
10566 * output.cc (Output_segment::add_output_section): Call
10567 update_flags_for_output_section.
10568
dde3f402
ILT
105692010-01-05 Ian Lance Taylor <iant@google.com>
10570
62dfdd4d
ILT
10571 PR 10980
10572 * options.h (class General_options): Add --undefined-version.
10573 * script.cc (struct Version_expression): Add was_matched_by_symbol
10574 field.
10575 (Version_script_info::matched_symbol): New function.
10576 (Version_script_info::get_symbol_version_helper): Call
10577 matched_symbol.
10578 (Version_script_info::check_unmatched_names): New function.
10579 * script.h (class Version_script_info): Update declarations.
10580 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10581
9c4ae156
ILT
10582 * options.h (class General_options): Use DEFINE_bool_alias for
10583 allow_multiple_definition.
10584 * resolve.cc (Symbol_table::should_override): Don't test
10585 allow_multiple_definition.
10586
dde3f402
ILT
10587 PR 10980
10588 * options.h (class General_options): Add --cref.
10589 * main.cc (main): Print cref table if --cref. Don't close mapfile
10590 until after printing cref table.
10591 * cref.cc: Include "symtab.h".
10592 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10593 (Cref_table_compare::operator()): New function.
10594 (Cref_inputs::gather_cref): New function.
10595 (filecol): New static const.
10596 (Cref_inputs::print_cref): New function.
10597 (Cref::print_cref): New function.
10598 * cref.h: Include <cstdio>.
10599 (class Cref): Update declarations.
10600 * mapfile.h (Mapfile::file): New function.
10601 * object.h (class Object): Define Symbols. Declare virtual
10602 do_get_global_symbols.
10603 (Object::get_global_symbols): New function.
10604 * object.cc (Input_objects::add_object): Pass object to cref_ if
10605 --cref.
10606 (Input_objects::archive_start): Likewise.
10607 (Input_objects::archive_stop): Likewise.
10608 (Input_objects::print_cref): New function.
10609 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10610 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10611 --cref.
10612 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10613 function.
10614 * plugin.h (class Sized_pluginobj): Update declarations.
10615
8781f709
ILT
106162010-01-05 Ian Lance Taylor <iant@google.com>
10617
10618 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10619 to is_default_version. Rename insdef to insdefault.
10620 (Symbol_table::add_from_relobj): Rename def to is_default_version
10621 and local to is_forced_local.
10622 (Symbol_table::add_from_pluginobj): Likewise.
10623 (Symbol_table::add_from_dynobj): Likewise.
10624 (Symbol_table::define_special_symbol): Rename insdef to
10625 insdefault.
10626
fe35d28d
ILT
106272010-01-04 Ian Lance Taylor <iant@google.com>
10628
30bc8c46
ILT
10629 PR 10980
10630 * options.h (class General_options): Add
10631 --allow-multiple-definition and -z muldefs.
10632 * resolve.cc (Symbol_table::should_override): Don't warn about a
10633 multiple symbol definition if --allow-multiple-definition or -z
10634 muldefs.
10635
7eaea549
ILT
10636 PR 10980
10637 * options.h (class General_options): Add --add-needed and
10638 --copy-dt-needed-entries. Tweak --as-needed help entry.
10639 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10640 error if --copy-dt-needed-entries aka --add-needed is used and
10641 would cause a change in behaviour.
10642
fe35d28d
ILT
10643 PR 10980
10644 * options.h (class General_options): Add -G as a short version of
10645 --shared. Add no-op options -assert, -g, and -i.
10646
55a2bb35
ST
106472010-01-04 Sriraman Tallam <tmsriram@google.com>
10648
10649 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10650 check for .text or .gnu.linkonce.t sections.
10651 * icf.cc (Icf::find_identical_sections): Ditto.
10652 Change the detection for mangled function name within the section
10653 name.
10654 * icf.h (is_section_foldable_candidate): New function.
10655
719328e1
ILT
106562009-12-30 Ian Lance Taylor <iant@google.com>
10657
10658 PR 10980
10659 * options.h (class General_options): Permit two dashes with
10660 --retain-symbols-file.
10661
d7bb5745
ILT
106622009-12-30 Ian Lance Taylor <iant@google.com>
10663
403a15dd
ILT
10664 PR 10979
10665 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10666 don't put the file header and segment headers in the text
10667 segment.
10668
eda294df
ILT
10669 PR 10979
10670 * common.cc (Sort_commons::operator()): Stabilize sort when both
10671 entries are NULL.
10672 (Symbol_table::do_allocate_commons_list): When allocating common
10673 symbols, skip a symbol which is no longer common.
10674 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10675 an object before checking its type.
10676 * testsuite/common_test_2.c: New file.
10677 * testsuite/common_test_3.c: New file.
10678 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10679 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10680 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10681 (common_test_2_pic.o, common_test_2.so): New targets.
10682 (common_test_3_pic.o, common_test_3.so): New targets.
10683 * testsuite/Makefile.in: Rebuild.
10684
d7bb5745
ILT
10685 PR 10979
10686 * script.cc (read_input_script): If we see a new SECTIONS clause,
10687 and we have added an input section, give an error.
10688 * layout.h (class Layout): Add have_added_input_section function.
10689 Add have_added_input_section_ field.
10690 * layout.cc (Layout::Layout): Initialize
10691 have_added_input_section_.
10692 (Layout::layout): Set have_added_input_section_.
10693 (Layout::layout_eh_frame): Likewise.
10694
fc59c572
ILT
106952009-12-30 Ian Lance Taylor <iant@google.com>
10696
10697 PR 10931
10698 * options.h (class General_options): Add --sort-common option.
10699 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10700 * common.cc (Sort_common): Add sort_order parameter to
10701 constructor. Add sort_order_ field.
10702 (Sort_commons::operator): Check sort_order_.
10703 (Symbol_table::allocate_commons): Determine the sort order.
10704 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10705 Change all callers.
10706 (Symbol_table::do_allocate_commons_list): Likewise.
10707
1c74fab0
ILT
107082009-12-30 Ian Lance Taylor <iant@google.com>
10709
10710 PR 10916
10711 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10712 symbols from this object, don't change the visibility of an
10713 undefined symbol.
10714 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10715
6affe781
ILT
107162009-12-30 Ian Lance Taylor <iant@google.com>
10717
10718 PR 10861
10719 * script.h (class Version_script_info): Define Language enum.
10720 Update declarations. Define Glob, Exact, and Lookup types. Add
10721 new fields globals_, locals_, and is_finalized_.
10722 * script.cc: Various formatting fixes.
10723 (class Parser_closure): Change language_stack_ from a vector of
10724 std::string to one of Version_script_info::Language. Adjust all
10725 uses accordingly.
10726 (class Lazy_demangler): Remove.
10727 (struct Version_expression): Change language from std::string to
10728 Version_script_info::Language.
10729 (Version_script_info::Version_script_info): New function.
10730 (Version_script_info::~Version_script_info): Don't call clear.
10731 (Version_script_info::finalize): New function.
10732 (Version_script_info::build_lookup_tables): New function.
10733 (Version_script_info::build_expression_list_lookup): New
10734 function.
10735 (Version_script_info::get_symbol_version_helper): Rewrite to use
10736 lookup tables.
10737 (Version_script_info::print_expression_list): Adjust to use
10738 Version_script_info::Language.
10739 (script_push_lex_into_version_mode): Check that the version script
10740 has not been finalized.
10741 (version_script_push_lang): Change language string to
10742 Version_script_info::Language.
10743 * options.cc (Command_line::version_script): New function.
10744 * options.h (class General_options): Add finalize_dynamic_list
10745 function. Change version_script from declaration to definition.
10746 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10747 * testsuite/version_script.map: Remove duplicate def of foo.
10748 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10749 version_script.map.
10750 * testsuite/Makefile.in: Rebuild.
10751
818bf354
ILT
107522009-12-30 Ian Lance Taylor <iant@google.com>
10753
10754 PR 10843
10755 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10756 if the input symbol index is 0, make the output symbol index 0.
10757
ebcc8304
ILT
107582009-12-30 Ian Lance Taylor <iant@google.com>
10759
10760 PR 10670
10761 * options.h (class General_options): Add -x/--discard-all.
10762 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10763 --discard-all. If the local symbol needs a dynamic entry, check
10764 that before handling --discard-locals.
10765
176fe33f
ILT
107662009-12-30 Ian Lance Taylor <iant@google.com>
10767
bb321bb1
ILT
10768 PR 10450
10769 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10770 flags to PF_R.
10771 (Output_segment::add_output_section): Don't change the flags if
10772 the type is PT_TLS.
10773
176fe33f
ILT
10774 PR 10450
10775 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10776 GNU hash table if they need a dynamic value. Otherwise, don't add
10777 them if they are defined in a dynamic object or are forced local.
10778
e8cd95c7
ILT
107792009-12-29 Ian Lance Taylor <iant@google.com>
10780
1b81fb71
ILT
10781 PR 10450
10782 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10783 .gnu.hash table for a 32-bit target.
10784
8d6d383d
ILT
10785 PR 10450
10786 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10787 regular and a dynamic object only needs a dynamic symbol table
10788 entry if it is externally visible.
10789
e785ec03
ILT
10790 PR 10450
10791 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10792 constructor. Add global_offset_table_ field.
10793 (Target_i386::got_section): Set global_offset_table_.
10794 (Target_i386::do_finalize_sections): Set global_offset_table_
10795 size.
10796 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10797 in constructor. Add global_offset_table_ field.
10798 (Target_x86_64::got_section): Set global_offset_table_.
10799 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10800 size.
10801
1a2dff53
ILT
10802 * layout.cc (Layout::Layout): Initialize increase_relro_.
10803 (Layout::get_output_section): Add is_relro, is_last_relro, and
10804 is_first_non_relro parameters. Change all callers.
10805 (Layout::choose_output_section): Likewise.
10806 (Layout::add_output_section_data): Likewise.
10807 (Layout::make_output_section): Likewise.
10808 (Layout::set_segment_offsets): Clear increase_relro when using a
10809 linker script.
10810 * layout.h (class Layout): Add increase_relro method. Add
10811 increase_relro_ field. Update declarations.
10812 * output.cc (Output_section::Output_section): Initialize
10813 is_last_relro_ and is_first_non_relro_.
10814 (Output_segment::add_output_section): Group relro sections is
10815 do_sort is true. Handle is_last_relro and is_first_non_relro.
10816 (Output_segment::maximum_alignment): Remove relro handling.
10817 (Output_segment::set_section_addresses): Add increase_relro
10818 parameter. Change all callers. Add initial alignment to align
10819 relro sections on separate page. Remove old relro handling.
10820 (Output_segment::set_section_list_addresses): Remove in_relro
10821 parameter. Change all callers.
10822 (Output_segment::set_offset): Add increase parameter. Change all
10823 callers. Remove old relro handling.
10824 * output.h (class Output_section): Add new methods: is_last_relro,
10825 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10826 Add is_last_relro_ and is_first_non_relro_ fields.
10827 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10828 Create separate .got.plt section. Call increase_relro.
10829 * x86_64.cc (Target_x86_64::got_section): Likewise.
10830 * testsuite/relro_script_test.t: Add .got.plt.
10831
f0ba79e2
ILT
10832 PR 10450
10833 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10834 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10835 (Layout::finalize): Call set_dynamic_symbol_size.
10836 (Layout::set_dynamic_symbol_size): New function.
10837 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10838 set_dynamic_symbol_size.
10839
e8cd95c7
ILT
10840 PR 10450
10841 * output.h (class Output_section): Add is_entsize_zero_ field.
10842 * output.cc (Output_section::Output_section): Initialize
10843 is_entsize_zero_.
10844 (Output_section::set_entsize): If two different entsizes are
10845 requested, force it to zero.
10846 (Output_section::add_input_section): Set flags for .debug_str
10847 before updating section flags. Set entsize.
10848 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10849 and SHF_STRING if all input sections have those flags.
10850
3e1b9a8a
RÁE
108512009-12-29 Rafael Espindola <espindola@google.com>
10852
10853 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10854 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10855 reporting.
3e1b9a8a 10856
3dcad376
ST
108572009-12-29 Sriraman Tallam <tmsriram@google.com>
10858
10859 * options.cc (General_options::parse_version): Allow -v to exit
10860 without an error if there is nothing to link.
10861
084e2665
ILT
108622009-12-29 Ian Lance Taylor <iant@google.com>
10863
10864 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10865 using a version of gcc before 4.1.
10866 * configure: Rebuild.
10867
250acde3
CD
108682009-12-28 Chris Demetriou <cgd@google.com>
10869
10870 * attributes.cc (Output_attributes_section_data::do_write): Use
10871 std::vector::front rather than std::vector::data.
10872
99fff23b
ILT
108732009-12-28 Ian Lance Taylor <iant@google.com>
10874
10875 * symtab.h (class Symbol_table): Add enum Defined.
10876 * resolve.cc (Symbol_table::should_override): Add defined
10877 parameter. Change all callers. Test whether object is NULL
10878 before calling a method on it.
10879 (Symbol_table::report_resolve_problem): Add defined parameter.
10880 Change all callers.
10881 (Symbol_table::should_override_with_special): Likewise.
10882 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10883 parameter. Change all callers.
10884 (Symbol_table::do_define_in_output_data): Likewise.
10885 (Symbol_table::define_in_output_segment): Likewise.
10886 (Symbol_table::do_define_in_output_segment): Likewise.
10887 (Symbol_table::define_as_constant): Likewise.
10888 (Symbol_table::do_define_as_constant): Likewise.
10889 * script.h (class Symbol_assignment): Add is_defsym parameter to
10890 constructor; change all callers.
10891 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10892 parameter. Change all callers. Add is_defsym_ field.
10893 (class Parser_closure): Add parsing_defsym parameter to
10894 constructor; change all callers. Add parsing_defsym accessor
10895 function. Add parsing_defsym_ field.
10896
556bd683
ILT
108972009-12-28 Ian Lance Taylor <iant@google.com>
10898
10899 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10900 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10901
1782c879
ILT
109022009-12-23 Ian Lance Taylor <iant@google.com>
10903
10904 * i386.cc (Target_i386::do_calls_non_split): Recognize
10905 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10906 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10907 -fsplit-stack prologue when using %r11.
1782c879 10908
329ca2b1
ST
109092009-12-21 Sriraman Tallam <tmsriram@google.com>
10910
10911 * options.cc (General_options::parse_version): Make -v continue and do
10912 the link like GNU ld does.
10913
d675ff46
RÁE
109142009-12-17 Rafael Avila de Espindola <espindola@google.com>
10915
10916 * Makefile.am (CCFILES): Add timer.cc.
10917 (HFILES): Add timer.h.
10918 * configure.ac: Check for sysconf and times.
10919 * main.cc: include timer.h.
10920 (main): Use Timer instead of get_run_time.
10921 * timer.cc: New.
10922 * timer.h: New.
10923 * workqueue.cc: include timer.h.
10924 (Workqueue::find_and_run_task):
10925 Report user, sys and wall time.
10926 * Makefile.in: Regenerate.
10927 * config.in: Regenerate.
10928 * configure: Regenerate.
10929
d6344fb5
DK
109302009-12-16 Doug Kwan <dougkwan@google.com>
10931
10932 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10933 sections.
10934 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10935 relaxed input sections.
10936 * output.cc (Output_section::find_relaxed_input_section): Change
10937 return type to Output_relaxed_input_section pointer. Adjust code
10938 for new type of relaxed_input_section_map_.
10939 * output.h (Output_section::find_relaxed_input_section): Change
10940 return type to Output_relaxed_input_section pointer.
10941 (Output_section::Output_relaxed_input_section_by_input_section_map):
10942 New type.
10943 (Output_section::relaxed_input_section_map_): Change type to
10944 Output_section::Output_relaxed_input_section_by_input_section_map.
10945 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10946 input section.
10947
0e0d5469
ILT
109482009-12-15 Ian Lance Taylor <iant@google.com>
10949
10950 * layout.cc (Layout::create_shstrtab): Only write out after input
10951 sections if we are compressing debug sections.
10952
0649a889
ILT
109532009-12-15 Ian Lance Taylor <iant@google.com>
10954
10955 * archive.cc (Archive::add_symbols): Only look up a symbol without
10956 a version if there is, in fact, a version.
10957
2ea97941
ILT
109582009-12-14 Ian Lance Taylor <iant@google.com>
10959
10960 Revert -Wshadow changes, all changes from:
10961 2009-12-11 Doug Kwan <dougkwan@google.com>
10962 2009-12-11 Nick Clifton <nickc@redhat.com>
10963 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10964
b0eec2cc
DK
109652009-12-11 Doug Kwan <dougkwan@google.com>
10966
10967 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10968 due to -Wshadow.
10969 * attributes.cc (Object_attribute::size): Ditto.
10970 (Attributes_section_data::size): Ditto.
10971 (Attributes_section_data::Attributes_section_data): Ditto.
10972 (Output_attributes_section_data::do_write): Ditto.
10973 * attributes.h (Object_attribute::set_type): Ditto.
10974 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10975
91d6fa6a
NC
109762009-12-11 Nick Clifton <nickc@redhat.com>
10977
10978 * archive.cc: Fix shadowed variable warnings.
10979 * arm.cc: Likewise.
10980 * compressed_output.cc: Likewise.
10981 * compressed_output.h: Likewise.
10982 * configure: Likewise.
10983 * dwarf_reader.cc: Likewise.
10984 * dynobj.cc: Likewise.
10985 * dynobj.h: Likewise.
10986 * ehframe.cc: Likewise.
10987 * ehframe.h: Likewise.
10988 * errors.cc: Likewise.
10989 * expression.cc: Likewise.
10990 * fileread.cc: Likewise.
10991 * fileread.h: Likewise.
10992 * freebsd.h: Likewise.
10993 * i386.cc: Likewise.
10994 * icf.cc: Likewise.
10995 * incremental.h: Likewise.
10996 * layout.cc: Likewise.
10997 * layout.h: Likewise.
10998 * mapfile.cc: Likewise.
10999 * merge.cc: Likewise.
11000 * merge.h: Likewise.
11001 * object.cc: Likewise.
11002 * object.h: Likewise.
11003 * options.h: Likewise.
11004 * output.cc: Likewise.
11005 * output.h: Likewise.
11006 * parameters.cc: Likewise.
11007 * plugin.cc: Likewise.
11008 * powerpc.cc: Likewise.
11009 * reduced_debug_output.cc: Likewise.
11010 * reduced_debug_output.h: Likewise.
11011 * reloc.cc: Likewise.
11012 * reloc.h: Likewise.
11013 * resolve.cc: Likewise.
11014 * script-sections.cc: Likewise.
11015 * script.cc: Likewise.
11016 * script.h: Likewise.
11017 * sparc.cc: Likewise.
11018 * symtab.cc: Likewise.
11019 * symtab.h: Likewise.
11020 * target-select.cc: Likewise.
11021 * target-select.h: Likewise.
11022 * token.h: Likewise.
11023 * workqueue.cc: Likewise.
11024 * workqueue.h: Likewise.
11025 * x86_64.cc: Likewise.
11026
a0351a69
DK
110272009-12-10 Doug Kwan <dougkwan@google.com>
11028
11029 * arm.cc (attributes.h): New include.
11030 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11031 (Arm_relobj::~Arm_relobj): Delete object pointed by
11032 attributes_section_data_.
11033 (Arm_relobj::attributes_section_data): New method definition.
11034 (Arm_relobj::attributes_section_data_): New data member declaration.
11035 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11036 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11037 attributes_section_data_.
11038 (Arm_dynobj::attributes_section_data): New method definition.
11039 (Arm_dynobj::attributes_section_data_): New data member declaration.
11040 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11041 initialization value of may_use_blx_ to false.
2e702c99 11042 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11043 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11044 object attributes to compute results instead of hard-coding.
11045 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11046 Target_arm::get_secondary_compatible_arch,
11047 Target_arm::set_secondary_compatible_arch
11048 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11049 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11050 New method declarations.
11051 (Target_arm::get_aeabi_object_attribute): New method definition.
11052 (Target_arm::attributes_section_data_): New data member declaration.
11053 (read_arm_attributes_section): New template definition.
11054 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11055 (Arm_dynobj::do_read_symbols): Ditto.
11056 (Target_arm::do_finalize_sections): Merge attributes sections from
11057 input. Check for BLX use after attributes section merging.
11058 Fix __exidx_start and __exidx_end visibility. Create an
11059 .ARM.attributes section if necessary.
11060 (Target_arm::get_secondary_compatible_arch,
11061 Target_arm::set_secondary_compatible_arch,
11062 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11063 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11064 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11065 New method definitions.
11066
b59befec
ILT
110672009-12-09 Ian Lance Taylor <iant@google.com>
11068
11069 * plugin.cc (Plugin::load): Don't cast from void* to a function
11070 pointer.
11071
1276bc89
ILT
110722009-12-09 Ian Lance Taylor <iant@google.com>
11073
11074 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11075 information fields.
11076
2f2de248
L
110772009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11078
11079 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11080 Replace two_file_shared_1.so with two_file_shared_2.so.
11081 * testsuite/Makefile.in: Regenerated.
11082
4f787271
DK
110832009-12-08 Doug Kwan <dougkwan@google.com>
11084
11085 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11086 (HFILES): Add attributes.h and int_encoding.h.
11087 * Makefile.in: Regenerate.
11088 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11089 function definitions to int_encoding.cc
11090 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11091 prototypes to int_encoding.h
11092 * reduced_debug_output.cc (int_encoding.h): New include.
11093 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11094 function definitions to int_encoding.cc
11095 (insert_into_vector, read_from_pointer): Move template definitions to
11096 int_encoding.h
11097 * attributes.cc: New file.
11098 * attributes.h: New file.
11099 * int_encoding.cc: New file.
11100 * int_encoding.h: New file.
11101
20b52f1a
RÁE
111022009-12-07 Rafael Avila de Espindola <espindola@google.com>
11103
11104 PR gold/11055
11105 * incremental-dump.cc (dump_incremental_inputs): New.
11106 (main): Use dump_incremental_inputs.
11107
53d7974c
L
111082009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11109
11110 PR gold/10893
11111 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11112 checking elfcpp::STT_FUNC.
11113 (Target_i386::Relocate::relocate): Likewise.
11114 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11115
11116 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11117 symbols from shared libraries into normal FUNC symbols.
11118
11119 * symtab.h (Symbol): Add is_func and use it.
11120
05a352e6
DK
111212009-12-05 Doug Kwan <dougkwan@google.com>
11122
11123 * arm.cc (Target_arm::arm_info): Initialize new fields
11124 attributes_section and attributes_vendor.
11125 * i386.cc (Target_i386::i386_info): Same.
11126 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11127 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11128 fields attributes_section and attributes_vendor.
53d7974c 11129 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11130 * target.h (Target::attributes_section, Target::attributes_vendor,
11131 Target::is_attributes_section, Target::attribute_arg_type,
11132 Target::attributes_order): New method definitions.
11133 (Target::Target_info::attributes_section,
11134 Target::Target_info::attributes_vendor): New fields.
11135 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11136 virtual method definitions.
11137 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11138 attributes_section and attributes_vendor.
11139 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11140
f4e5969c
DK
111412009-12-05 Doug Kwan <dougkwan@google.com>
11142
11143 * arm.cc: Update comments about interworking and stub generation.
11144 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11145 considered as non-PIC.
11146 (Arm_relocate_functions::base_abs): Fix formatting.
11147 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11148 of function to use GOT entry address instead of offset.
11149 (Target_arm::Scan::global): Issue an error if a symbol would need a
11150 PLT does not get one because it is untyped. Remove code to create
11151 dynamic symbols for relative branches.
11152 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11153 takes unsigned integer instead of boolean.
11154
1abce4a6
L
111552009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11156
11157 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11158 (two_file_test_LDADD): Likewise.
11159 (common_test_1_LDADD): Likewise.
11160 (exception_test_LDADD) Likewise.
11161 (weak_test_LDADD): Likewise.
11162 (many_sections_test_LDADD): Likewise.
11163 (initpri1_LDADD): Likewise.
11164 (script_test_1_LDADD): Likewise.
11165 (script_test_2_LDADD): Likewise.
11166 (justsyms_LDADD): Likewise.
11167 (binary_test_LDADD): Likewise.
11168 (large_LDADD): Likewise.
11169 * testsuite/Makefile.in: Regenerated.
11170
adcf2816 111712009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11172
adcf2816
L
11173 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11174 (Symbol_table::override_with_special): Likewise.
11175 (Symbol_table::add_from_object): Likewise.
11176
28e67f5d
RÁE
111772009-12-04 Rafael Avila de Espindola <espindola@google.com>
11178
11179 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11180 Don't set the data_offset twice.
11181
ae10a101
RÁE
111822009-12-04 Rafael Avila de Espindola <espindola@google.com>
11183
11184 * testsuite/Makefile.in: Regenerate.
11185
f59f41f3
DK
111862009-12-03 Doug Kwan <dougkwan@google.com>
11187
11188 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11189 (Target_arm::do_finalize_sections): Add parameter for symbol table
11190 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11191 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11192 parameter for symbol table pointer.
11193 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11194 an additional parameter for a pointer to symbol table.
11195 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11196 parameter for a symbol table pointer.
11197 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11198 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11199 Ditto.
11200 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11201 parameter for a symbol table pointer.
11202
ca55d848
RÁE
112032009-12-03 Rafael Avila de Espindola <espindola@google.com>
11204
11205 * incremental.cc (Incremental_inputs_header)
11206 (Incremental_inputs_header_write, Incremental_inputs_entry)
11207 (Incremental_inputs_entry_write): Move ...
11208 * incremental.h (Incremental_inputs_header)
11209 (Incremental_inputs_header_write, Incremental_inputs_entry)
11210 (Incremental_inputs_entry_write): here.
11211
3aec4f9c
RÁE
112122009-12-02 Rafael Avila de Espindola <espindola@google.com>
11213
11214 * incremental.cc (make_sized_incremental_binary): Set the target.
11215 Error if it is incompatible.
11216 * output.h (Output_file): Add filename method.
11217
9c0ae74d
RÁE
112182009-12-02 Rafael Avila de Espindola <espindola@google.com>
11219
11220 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11221 from the get_* methods.
11222
a45500ae
RÁE
112232009-12-02 Rafael Avila de Espindola <espindola@google.com>
11224
11225 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11226 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11227 Write 0 for the data_offset of scripts.
11228
325e6408
RÁE
112292009-12-02 Rafael Avila de Espindola <espindola@google.com>
11230
11231 * testsuite/Makefile.am: Add the incremental_test.sh test.
11232 * testsuite/incremental_test.sh: New.
11233 * testsuite/incremental_test_1.c: New.
11234 * testsuite/incremental_test_2.c: New.
11235
954c3e2e
RÁE
112362009-12-01 Rafael Avila de Espindola <espindola@google.com>
11237
703d02da 11238 * incremental-dump.cc (main): Fix typos.
954c3e2e 11239
f8086623
RÁE
112402009-11-27 Rafael Avila de Espindola <espindola@google.com>
11241
11242 PR gold/11025
11243 * incremental-dump.cc (main): Use llu to print 64 bit values.
11244
3b0dd6ac
L
112452009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11246 H.J. Lu <hongjiu.lu@intel.com>
11247
11248 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11249 $(LIBDL).
11250 (incremental_dump_LDADD): Likewise.
11251 * Makefile.in: Regenerated.
11252
a6d1ef57 112532009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11254
a6d1ef57
DK
11255 Revert:
11256
11257 2009-11-25 Doug Kwan <dougkwan@google.com>
11258
11259 * arm.cc (Target_arm::Target_arm): Move method definition
11260 outside of class definition. Add code to handle
11261 --target1-rel, --target1-abs and --target2= options.
11262 (Target_arm::get_reloc_reloc_type): Change method to be
11263 non-static and const.
11264 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11265 New data member declaration.
11266 (Target_arm::Scan::local, Target_arm::Scan::global,
11267 Target_arm::Relocate::relocate,
11268 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11269 Adjust call to Target_arm::get_real_reloc_type.
11270 (Target_arm::get_real_reloc_type): Use command line options
11271 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11272 * options.h (--target1-rel, --target1-abs, --target2): New
11273 ARM-only options.
11274
50aeb7d4
DK
112752009-11-25 Doug Kwan <dougkwan@google.com>
11276
11277 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11278 class definition. Add code to handle --target1-rel, --target1-abs
11279 and --target2= options.
11280 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11281 and const.
11282 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11283 member declaration.
11284 (Target_arm::Scan::local, Target_arm::Scan::global,
11285 Target_arm::Relocate::relocate,
11286 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11287 call to Target_arm::get_real_reloc_type.
11288 (Target_arm::get_real_reloc_type): Use command line options to
11289 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11290 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11291 options.
11292
51938283
DK
112932009-11-25 Doug Kwan <dougkwan@google.com>
11294
11295 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11296 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11297 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11298 formatting.
11299 (Arm_relocate_functions::thm_call): Replace body with a call to
11300 Arm_relocate_functions::thumb_branch_common.
11301 (Arm_relocate_functions::thm_jump24,
11302 Arm_relocate_functions::thm_xpc22): New method definitions.
11303 (Arm_relocate_functions::thumb_branch_common): New method definition.
11304 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11305 operator.
11306 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11307 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11308
e2b8f3c4
RÁE
113092009-11-24 Rafael Avila de Espindola <espindola@google.com>
11310
11311 * Makefile.am: Build incremental-dump
11312 * Makefile.in: Regenerate.
11313 * incremental-dump.cc: New.
11314 * incremental.cc (Incremental_inputs_header_data,
11315 Incremental_inputs_entry_data): Move to incremental.h
11316 * incremental.h: (Incremental_inputs_header_data,
11317 Incremental_inputs_entry_data): Move from incremental.cc
11318
bcba9aec
RÁE
113192009-11-24 Rafael Avila de Espindola <espindola@google.com>
11320
11321 * incremental.cc (Incremental_inputs_header,
11322 Incremental_inputs_header_write, Incremental_inputs_entry,
11323 Incremental_inputs_entry_write): Add a typedef with the data type.
11324
7c3afe08
RÁE
113252009-11-24 Rafael Avila de Espindola <espindola@google.com>
11326
11327 * incremental.cc (Incremental_inputs_header,
11328 Incremental_inputs_header_write, Incremental_inputs_entry,
11329 Incremental_inputs_entry_write): Update comment about which
11330 type has the filed descriptions.
11331
d204b6e9
DK
113322009-11-15 Doug Kwan <dougkwan@google.com>
11333
11334 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11335 (Arm_relocate_functions::arm_branch_common): Change method defintion
11336 in class definition to a method declaration and update list of formal
11337 parameters.
11338 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11339 Arm_relocation_functions::jump24): Adjust call to
11340 Arm_relocate_functions::arm_branch_common. Update list of formal
11341 parameters.
11342 (Arm_relocate_functions::xpc25): New method definition.
11343 (Arm_relocate_functions::arm_branch_common): Move method defintion
11344 out from class definition. Use stubs for mode-switching and extending
11345 branch ranges.
11346 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11347 specially. Change code to enable use of stubs in ARM branches.
11348
43d12afe
DK
113492009-11-10 Doug Kwan <dougkwan@google.com>
11350
11351 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11352 in method declaration.
11353 (Target_arm::relocate_stub): New method declaration.
11354 (Target_arm::default_target): Change to return a pointer instead of
11355 a const reference.
11356 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11357 Target_arm::default_target.
11358 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11359 method definition.
11360 (Target_arm::relocate_section): Adjust view.
11361 (Target_arm::relocate_stub): New method definition.
11362
ac33a407
DK
113632009-11-10 Doug Kwan <dougkwan@google.com>
11364
11365 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11366 a format warning.
11367 * incremental.cc (open_incremental_binary): Initialized local
11368 variables to avoid warnings.
11369 * object.cc (make_elf_object): Ditto.
11370 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11371 a format warning.
e1df38aa 11372
88ee28e9
L
11373009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11374
11375 PR gold/10930
11376 * testsuite/plugin_test.c: Include "config.h".
11377
2daedcd6
DK
113782009-11-09 Doug Kwan <dougkwan@google.com>
11379
11380 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11381 (arm_symbol_value): Remove.
11382 (Arm_relocate_functions::arm_branch_common,
11383 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11384 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11385 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11386 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11387 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11388 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11389 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11390 Arm_relocate_functions::thm_mobw_abs_nc,
11391 Arm_relocate_functions::thm_mov_abs,
11392 Arm_relocate_functions::movw_prel_nc,
11393 Arm_relocate_functions::thm_movt_abs,
11394 Arm_relocate_functions::movt_prel,
11395 Arm_relocate_functions::thm_movw_prel_nc,
11396 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11397 (Target_arm::Relocate::relocate): Only decompose address into two
11398 parts if relocation type uses the thumb-bit and pass the actual
11399 bit instead of a flag indicating that the thumb-bit is used. Adjust
11400 calls to methods in Arm_relocate_functions for this change.
11401
1276bc89 114022009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11403
11404 PR 10925
11405 * reloc.cc: Instantiate
11406 Sized_relobj::initialize_input_to_output_maps and
11407 Sized_relobj:free_input_to_output_maps.
11408
e53ad1b5
ILT
114092009-11-06 Ian Lance Taylor <iant@google.com>
11410
11411 PR 10876
11412 * defstd.cc (in_segment): Set only_if_ref true for "end".
11413
eb44217c
DK
114142009-11-06 Doug Kwan <dougkwan@google.com>
11415
11416 * arm.cc (class Reloc_stub): Correct a comment.
11417 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11418 (Target_arm::scan_section_for_stubs): New method declaration.
11419 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11420 Change methods from private to protected.
11421 (Target_arm::do_may_relax): New method definition.
11422 (Target_arm::do_relax, Target_arm::group_sections,
11423 Target_arm::scan_reloc_for_stub,
11424 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11425 (Target_arm::arm_input_section_map_): New data member declaration.
11426 (Target_arm::scan_reloc_for_stub,
11427 Target_arm::scan_reloc_section_for_stubs,
11428 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11429 Target_arm::do_relax): New method definitions.
11430
5d329b7d
ILT
114312009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11432
11433 * configure.ac: Check for (struct stat)::st_mtim
11434 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11435 * config.in: Regenerate.
11436 * configure: Regenerate.
11437
96a0d71b
ILT
114382009-11-05 Ian Lance Taylor <iant@google.com>
11439
11440 PR 10910
11441 * output.cc (Output_segment::add_output_section): Add missing
11442 return statement.
11443
594c8e5e
ILT
114442009-11-04 Ian Lance Taylor <iant@google.com>
11445
11446 PR 10880
11447 * object.h (class Object): Add is_needed and set_is_needed
11448 methods. Add is_needed_ field. Make bool fields into bitfields.
11449 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11450 defined in a dynamic object and referenced by a regular object,
11451 set is_needed for the dynamic object.
11452 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11453 if the file is marked with as_needed and it is not needed.
11454
22b127cc
ILT
114552009-11-04 Ian Lance Taylor <iant@google.com>
11456
11457 PR 10887
11458 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11459 tags if data is discarded by linker script.
11460 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11461 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11462 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11463 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11464
f5c870d2
ILT
114652009-11-04 Ian Lance Taylor <iant@google.com>
11466
11467 * layout.cc (Layout::get_output_section): Add is_interp and
11468 is_dynamic_linker_section parameters. Change all callers.
11469 (Layout::choose_output_section): Likewise.
11470 (Layout::make_output_section): Likewise.
11471 (Layout::add_output_section_data): Add is_dynamic_linker_section
11472 parameter. Change all callers.
11473 * layout.h (class Layout): Update declarations.
11474 * output.h (class Output_section): Add is_interp, set_is_interp,
11475 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11476 Add is_interp_, is_dynamic_linker_section_ fields. Change
11477 generate_code_fills_at_write_ to a bitfield.
11478 * output.cc (Output_section::Output_sections): Initialize new
11479 fields.
11480 (Output_segment::add_output_section): Add do_sort parameter.
11481 Change all callers.
11482
1ae4d23b
ILT
114832009-11-03 Ian Lance Taylor <iant@google.com>
11484
11485 PR 10860
11486 * options.h (class General_options): Add --warn-common.
11487 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11488 merging two common symbols.
11489 (Symbol_table::should_override): Handle --warn-common when merging
11490 a common symbol with a defined symbol. Use report_resolve_problem
11491 for multiple definitions.
11492 (Symbol_table::report_resolve_problem): New function.
11493 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11494
55da9579
DK
114952009-11-03 Doug Kwan <dougkwan@google.com>
11496
11497 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11498 stub_factory_.
11499 (Target_arm::stub_factory): New method definition.
11500 (Target_arm::new_arm_input_section,
11501 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11502 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11503 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11504 New type definitions.
11505 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11506 member declarations.
11507 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11508 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11509 New method definitions.
11510
37a9ac43
ILT
115112009-11-03 Ian Lance Taylor <iant@google.com>
11512
11513 * options.h (class General_options): Add --warn_constructors.
11514
b3d6a3d4
ILT
115152009-11-03 Ian Lance Taylor <iant@google.com>
11516
11517 PR 10893
11518 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11519 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11520
934b01dd
ILT
115212009-11-03 Ian Lance Taylor <iant@google.com>
11522
11523 PR 10895
11524 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11525 --msgid-bugs-address.
11526 (install-pdf): New target.
11527 (install-data_yes): Look up one directory to find mkinstalldirs.
11528
03c1939b
L
115292009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11530
11531 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11532 tree.
11533
ebd95253
DK
115342009-10-30 Doug Kwan <dougkwan@google.com>
11535
11536 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11537
e9bbb538
DK
115382009-10-30 Doug Kwan <dougkwan@google.com>
11539
11540 * arm.cc (Stub_addend_reader): New struct template definition
11541 and partial specializations.
11542 (Stub_addend_reader::operator()): New method definition for a
11543 partially specialized template.
11544
d5b40221
DK
115452009-10-30 Doug Kwan <dougkwan@google.com>
11546
11547 * arm.cc (Arm_relobj::processor_specific_flags): New method
11548 definition.
11549 (Arm_relobj::do_read_symbols): New method declaration.
11550 (Arm_relobj::processor_specific_flags_): New data member declaration.
11551 (Arm_dynobj): New class definition.
11552 (Target_arm::do_finalize_sections): Add input_objects parameter.
11553 (Target_arm::do_adjust_elf_header): New method declaration.
11554 (Target_arm::are_eabi_versions_compatible,
11555 (Target_arm::merge_processor_specific_flags): New method declaration.
11556 (Target_arm::do_make_elf_object): New overloaded method definitions
11557 and declaration.
11558 (Arm_relobj::do_read_symbols): New method definition.
11559 (Arm_dynobj::do_read_symbols): Ditto.
11560 (Target_arm::do_finalize_sections): Add input_objects parameters.
11561 Merge processor-specific flags from all input objects.
11562 (Target_arm::are_eabi_versions_compatible,
11563 Target_arm::merge_processor_specific_flags,
11564 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11565 New method definitions.
11566 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11567 Input_objects pointer type parameter.
11568 * layout.cc (Layout::finalize): Pass input objects to target's.
11569 finalize_sections function.
11570 * output.cc (Output_file_header::do_sized_write): Set ELF file
11571 header's processor-specific flags.
11572 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11573 Input_objects pointer type parameter.
11574 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11575 * target.h (Input_objects): New forward class declaration.
11576 (Target::processor_specific_flags,
11577 Target::are_processor_specific_flags_sect): New method definitions.
11578 (Target::finalize_sections): Add input_objects parameter.
11579 (Target::Target): Initialize processor_specific_flags_ and
11580 are_processor_specific_flags_set_.
11581 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11582 parameter.
11583 (Target::set_processor_specific_flags): New method definition.
11584 (Target::processor_specific_flags_,
11585 Target::are_processor_specific_flags_set_): New data member
11586 declarations.
11587 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11588 Input_objects pointer type parameter.
11589
ebabffbd
DK
115902009-10-30 Doug Kwan <dougkwan@google.com>
11591
11592 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11593
ad0f2072
ILT
115942009-10-28 Ian Lance Taylor <iant@google.com>
11595
11596 * object.h (class Relobj): Drop options parameter from
11597 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11598 do_scan_relocs, do_relocate. Change all callers.
11599 (class Sized_relobj): Drop options parameters from
11600 do_gc_process_relocs, do_scan_relocs, do_relocate,
11601 do_relocate_sections, relocate_sections, emit_relocs_scan,
11602 emit_relocs_scan_reltype. Change all callers.
11603 (struct Relocate_info): Remove options field and all references to
11604 it.
11605 * reloc.h (class Read_relocs): Remove options constructor
11606 parameter and options_ field. Change all callers.
11607 (class Gc_process_relocs, class Scan_relocs): Likewise.
11608 (class Relocate_task): Likewise.
11609 * target-reloc.h (scan_relocs): Remove options parameter. Change
11610 all callers.
11611 (scan_relocatable_relocs): Likewise.
11612 * target.h (class Sized_target): Remove options parameter from
11613 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11614 all callers.
11615 * gc.h (gc_process_relocs): Remove options parameter. Change all
11616 callers.
11617 * arm.cc: Update functions to remove options parameters.
11618 * i386.cc: Likewise.
11619 * powerpc.cc: Likewise.
11620 * sparc.cc: Likewise.
11621 * x86_64.cc: Likewise.
11622 * testsuite/testfile.cc: Likewise.
11623
8ffa3667
DK
116242009-10-28 Doug Kwan <dougkwan@google.com>
11625
11626 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11627 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11628 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11629 New method definitions.
11630
40f36857
CC
116312009-10-28 Cary Coutant <ccoutant@google.com>
11632
11633 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11634 (Plugin::cleanup_done_): New member.
11635 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11636 (Plugin_manager::cleanup_done_): Remove.
11637 (Plugin_manager::add_input_file): Edit error message.
11638 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11639 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11640
2c849493
ILT
116412009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11642
11643 * fileread.cc: (File_read::View::~View): Use the new
11644 data_ownership_ filed.
11645 (File_read::~File_read): Dispose the new whole_file_view_.
11646 (File_read::open): Mmap the whole file if needed.
11647 (File_read::open): Use whole_file_view_ instead of contents_.
11648 (File_read::find_view): Use whole_file_view_ if applicable.
11649 (File_read::do_read): Use whole_file_view_ instead of contents_.
11650 (File_read::make_view): Use whole_file_view_ instead of contents_,
11651 update File_read::View::View call.
11652 (File_read::find_or_make_view): Update File_read::View::View
11653 call.
11654 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11655 remove contents_
11656 (File_read::View::Data_ownership): New enum.
11657 (File_read::View::View): Replace bool mapped_ with Data_ownership
11658 argument.
11659 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11660 (File_read::View::data_ownership_): New field.
11661 (File_read::contents_): Remove (replaced by whole_file_view_).
11662 (File_read::whole_file_view_): New field.
11663 * options.h (class General_options): Add --keep-files-mapped.
11664
24998053
CC
116652009-10-27 Cary Coutant <ccoutant@google.com>
11666
11667 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11668 * testsuite/Makefile.am (plugin_test_5): New test case.
11669 * testsuite/Makefile.in: Regenerate.
11670
72adc4fa
DK
116712009-10-25 Doug Kwan <dougkwan@google.com>
11672
11673 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11674 from private to protected to allow access by child class.
11675 (Sized_relobj::do_relocate_sections): New method declaration.
11676 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11677 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11678 Sized_relobj::relocate_sections. Instantiate template explicitly
11679 for different target sizes and endianity.
11680
07f508a2
DK
116812009-10-24 Doug Kwan <dougkwan@google.com>
11682
11683 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11684 (Arm_input_section::as_arm_input_section): New method.
11685 (Arm_output_section): New class definition.
11686 (Arm_output_section::create_stub_group,
11687 Arm_output_section::group_sections): New method definitions.
11688
10ad9fe5
DK
116892009-10-22 Doug Kwan <dougkwan@google.com>
11690
11691 * arm.cc (Arm_input_section): New class definition.
11692 (Arm_input_section::init, Arm_input_section:do_write,
11693 Arm_input_section::set_final_data_size,
11694 Arm_input_section::do_reset_address_and_file_offset): New method
11695 definitions.
11696
56ee5e00
DK
116972009-10-21 Doug Kwan <dougkwan@google.com>
11698
11699 * arm.cc (Stub_table, Arm_input_section): New forward class
11700 declarations.
11701 (Stub_table): New class defintion.
11702 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11703 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11704 New method definition.
11705
b569affa
DK
117062009-10-21 Doug Kwan <dougkwan@google.com>
11707
11708 * arm.cc: Update copyright comments.
11709 (Target_arm): New forward class template declaration.
11710 (Arm_address): New type.
11711 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11712 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11713 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11714 constants.
11715 (Insn_template): Same.
11716 (DEF_STUBS): New macro.
11717 (Stub_type): New enum type.
11718 (Stub_template): New class definition.
11719 (Stub): Same.
11720 (Reloc_stub): Same.
11721 (Stub_factory): Same.
11722 (Target_arm::Target_arm): Initialize may_use_blx_ and
11723 should_force_pic_veneer_.
11724 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11725 Target_arm::should_force_pic_veneer,
11726 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11727 Target_arm::using_thumb_only, Target_arm:;default_target): New
11728 method defintions.
11729 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11730 New data member declarations.
11731 (Insn_template::size, Insn_template::alignment): New method defintions.
11732 (Stub_template::Stub_template): New method definition.
11733 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11734 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11735 (Stub_factory::Stub_factory): New method definition.
11736 * gold.h (string_hash): New template.
11737 * output.h (Input_section_specifier::hash_value): Use
11738 gold::string_hash.
11739 (Input_section_specifier::string_hash): Remove.
11740 * stringpool.cc (Stringpool_template::string_hash): Use
11741 gold::string_hash.
11742
6c172549
DK
117432009-10-20 Doug Kwan <dougkwan@google.com>
11744
11745 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11746 symbols of relaxed input sections.
11747 * output.h (Output_section::find_relaxed_input_section): Make
11748 method public.
11749
c5617f2f
DK
117502009-10-16 Doug Kwan <dougkwan@google.com>
11751
11752 * dynobj.cc (Versions::Versions): Initialize version_script_.
11753 Only insert base version symbol definition for a shared object
11754 if version script defines any version versions.
11755 (Versions::define_base_version): New method definition.
11756 (Versions::add_def): Check that base version is not needed.
11757 (Versions::add_need): Define base version lazily.
11758 * dynobj.h (Versions::define_base_version): New method declaration.
11759 (Versions::needs_base_version_): New data member declaration.
11760 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11761 (check_DATA): Add no_version_test.stdout.
11762 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11763 New make rules.
11764 * testsuite/Makefile.in: Regenerate.
11765 * testsuite/no_version_test.c: New file.
11766 * testsuite/no_version_test.sh: Ditto.
11767
3c12dcdb
DK
117682009-10-16 Doug Kwan <dougkwan@google.com>
11769
11770 * expression.cc (class Segment_start_expression): New class definition.
11771 (Segment_start_expression::value): New method definition.
11772 (script_exp_function_segment_start): Return a new
11773 Segment_start_expression.
11774 * gold/script-c.h (script_saw_segment_start_expression): New function
11775 prototype.
11776 * script-sections.cc (Script_sections::Script_sections): Initialize
11777 SAW_SEGMENT_START_EXPRESSION_ to false.
11778 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11779 and -Tbbs options to specify section addresses if given in
11780 command line and no SEGMENT_START expression is seen in a script.
11781 * script-sections.h (Script_sections::saw_segment_start_expression,
11782 Script_sections::set_saw_segment_start_expression): New method
11783 definition.
11784 (Script_sections::saw_segment_start_expression_): New data member
11785 declaration.
11786 * script.cc (script_saw_segment_start_expression): New function.
11787 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11788 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11789 script_test_7.sh and script_test_8.sh.
11790 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11791 script_test_8.stdout.
11792 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11793 (script_test_6, script_test_6.stdout, script_test_7,
11794 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11795 * Makefile.in: Regenerate.
11796 * testsuite/script_test_6.sh: New file.
11797 * testsuite/script_test_6.t: Same.
11798 * testsuite/script_test_7.sh: Same.
11799 * testsuite/script_test_7.t: Same.
11800 * testsuite/script_test_8.sh: Same.
11801
64b1ae37
DK
118022009-10-16 Doug Kwan <dougkwan@google.com>
11803
11804 * output.cc (Output_segment::set_section_list_address): Cast
11805 expressions to unsigned long long type to avoid format warnings.
11806
661be1e2
ILT
118072009-10-15 Ian Lance Taylor <iant@google.com>
11808
12edd763 11809 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11810 dot assignment to script_sections_.
12edd763
ILT
11811 * script-sections.cc (Script_sections::add_dot_assignment):
11812 Initialize if necessary.
11813
68b6574b
ILT
11814 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11815 program headers with no load segment if there is a linker script.
11816
661be1e2
ILT
11817 * layout.cc (Layout::set_segment_offsets): Align the file offset
11818 to the segment aligment for -N or -n with no load segment.
11819 * output.cc (Output_segment::add_output_section): Don't crash if
11820 the first section is a TLS section.
11821 (Output_segment::set_section_list_addresses): Print an error
11822 message if the address moves backward in a linker script.
11823 * script-sections.cc
11824 (Output_section_element_input::set_section_addresses): Don't
11825 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11826 (Orphan_output_section::set_section_addresses): Likewise.
11827
f15f61a7
DK
118282009-10-15 Doug Kwan <dougkwan@google.com>
11829
11830 * layout.cc (Layout::finish_dynamic_section): Generate tags
11831 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11832 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11833 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11834
82bb573a
ILT
118352009-10-14 Ian Lance Taylor <iant@google.com>
11836
11837 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11838 fields.
11839 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11840 data_shdr fields of relinfo.
11841 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11842 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11843 R_386_TLS_LDO_32, adjust based on section flags.
11844 (Target_i386::Relocate::fix_up_ldo): Remove.
11845
374ad285
ILT
118462009-10-13 Ian Lance Taylor <iant@google.com>
11847
11848 Add support for -pie.
11849 * options.h (class General_options): Add -pie and
11850 --pic-executable.
11851 (General_options::output_is_position_independent): Test -pie.
11852 (General_options::output_is_executable): Return true if not shared
11853 and not relocatable.
11854 (General_options::output_is_pie): Remove.
11855 * options.cc (General_options::finalize): Reject incompatible uses
11856 of -pie.
11857 * gold.cc (queue_middle_tasks): A -pie link is not static.
11858 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11859 * symtab.cc (Symbol::final_value_is_known): Return false if
11860 output_is_position_independent.
11861 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11862 output_is_position_independent.
11863 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11864 output_is_position_independent.
11865 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11866 output_is_position_independent.
11867 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11868 two_file_pie_test.
11869 (basic_pie_test.o, basic_pie_test): New targets.
11870 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11871 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11872 (two_file_pie_test): New target.
11873 * testsuite/Makefile.in: Rebuild.
11874 * README: Remove note saying that -pie is not supported.
11875
c6585162
ILT
118762009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11877
11878 * options.h (class General_options): Add -init and -fini.
11879 * layout.cc (Layout::finish_dynamic_section): Emit
11880 given init and fini functions.
11881
032ce4e9
ST
118822009-10-13 Sriraman Tallam <tmsriram@google.com>
11883
11884 * gc.h (gc_process_relocs): Check if icf is enabled using new
11885 function.
11886 * gold.cc (queue_initial_tasks): Likewise.
11887 (queue_middle_tasks): Likewise.
11888 * object.cc (do_layout): Likewise.
11889 * symtab.cc (is_section_folded): Likewise.
11890 * main.cc (main): Likewise.
11891 * reloc.cc (Read_relocs::run): Likewise.
11892 (Sized_relobj::do_scan_relocs): Likewise.
11893 * icf.cc (is_function_ctor_or_dtor): New function.
11894 (Icf::find_identical_sections): Check if function is ctor or dtor when
11895 safe icf is chosen.
11896 * options.h (General_options::icf): Change option to be an enum.
11897 (Icf_status): New enum.
11898 (icf_enabled): New method.
11899 (icf_safe_folding): New method.
11900 (set_icf_status): New method.
11901 (icf_status_): New variable.
11902 * (options.cc) (General_options::finalize): Set icf_status_.
11903 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11904 icf_test and icf_keep_unique_test to use the --icf enum flag.
11905 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11906 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11907
f345227a
ST
119082009-10-12 Sriraman Tallam <tmsriram@google.com>
11909
11910 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11911 includes to gc.h and icf.h.
11912 * arm.cc: Include gc.h.
11913 * gold.cc: Likewise.
11914 * i386.cc: Likewise.
11915 * powerpc.cc: Likewise.
11916 * sparc.cc: Likewise.
11917 * x86_64.cc: Likewise.
11918 * gc.h: Include icf.h.
11919
1c7814ed
ILT
119202009-10-11 Ian Lance Taylor <iant@google.com>
11921
11922 * plugin.cc: Include "gold.h" before other header files.
11923
ae3b5189
CD
119242009-10-10 Chris Demetriou <cgd@google.com>
11925
11926 * options.h (Input_file_argument::Input_file_type): New enum.
11927 (Input_file_argument::is_lib_): Replace with...
11928 (Input_file_argument::type_): New member.
11929 (Input_file_argument::Input_file_argument): Take Input_file_type
11930 'type' rather than boolean 'is_lib' as second argument.
11931 (Input_file_argument::is_lib): Use type_.
11932 (Input_file_argument::is_searched_file): New function.
11933 (Input_file_argument::may_need_search): Handle is_searched_file.
11934 * options.cc (General_options::parse_library): Support -l:filename.
11935 (General_options::parse_just_symbols): Update for Input_file_argument
11936 changes.
11937 (Command_line::process): Likewise.
11938 * archive.cc (Archive::get_file_and_offset): Likewise.
11939 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11940 * script.cc (read_script_file, script_add_file): Likewise.
11941 * fileread.cc (Input_file::Input_file): Likewise.
11942 (Input_file::will_search_for): Handle is_searched_file.
11943 (Input_file::open): Likewise.
11944 * readsyms.cc (Read_symbols::get_name): Likewise.
11945 * testsuite/Makefile.am (searched_file_test): New test.
11946 * testsuite/Makefile.in: Regenerate.
11947 * testsuite/searched_file_test.cc: New file.
11948 * testsuite/searched_file_test_lib.cc: New file.
11949
f3048a1d
ILT
119502009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11951 Ian Lance Taylor <iant@google.com>
11952
11953 * descriptor.cc: Include <cstdio> and "binary-io.h".
11954 (Descriptors::open): Open the files in binary mode always.
11955 * script.cc (Lex::get_token): Treat \r as whitespace.
11956
d4780e57
ILT
119572009-10-09 Ian Lance Taylor <iant@google.com>
11958
11959 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11960
d9a893b8
ILT
119612009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11962 Ian Lance Taylor <iant@google.com>
11963
11964 * configure.ac: Check for readv function also.
11965 * fileread.cc (readv): Define if not HAVE_READV.
11966 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11967 does not exist.
11968 * config.in: Regenerate.
11969 * configure: Regenerate.
11970
c0a62865
DK
119712009-10-09 Doug Kwan <dougkwan@google.com>
11972
11973 * layout.cc (Layout::make_output_section): Call target hook to make
11974 ordinary output section.
11975 (Layout::finalize): Adjust parameter list of call the
11976 Target::may_relax().
11977 * layout.h (class Layout::section_list): New method.
11978 * merge.h (Output_merge_base::entsize): Change visibility to public.
11979 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11980 New methods.
11981 (Output_merge_string::do_is_string): New method.
11982 * object.cc (Sized_relobj::do_setup): renamed from
11983 Sized_relobj::set_up.
11984 * object.h (Sized_relobj::adjust_shndx,
11985 Sized_relobj::initializ_input_to_output_maps,
11986 Sized_relobj::free_input_to_output_maps): Change visibilities to
11987 protected.
11988 (Sized_relobj::setup): Virtualize.
11989 (Sized_relobj::do_setup): New method declaration.
11990 (Sized_relobj::invalidate_section_offset,
11991 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11992 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11993 * options.cc (parse_int): New function.
11994 * options.h (parse_int): New declaration.
11995 (DEFINE_int): New macro.
11996 (stub_group_size): New option.
11997 * output.cc (Output_section::Output_section): Initialize memebers
11998 merge_section_map_, merge_section_by_properties_map_,
11999 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12000 (Output_section::add_input_section): Handled deferred code-fill
12001 generation and remove an old comment.
12002 (Output_section::add_relaxed_input_section): New method definition.
12003 (Output_section::add_merge_input_section): Use merge section by
12004 properties map to speed to search. Update merge section maps
12005 as appropriate.
12006 (Output_section::build_relaxation_map): New method definition.
12007 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12008 Same.
12009 (Output_section::relax_input_section): Renamed to
12010 Output_section::convert_input_sections_to_relaxed_sections and change
12011 interface to take a vector of pointers to relaxed sections.
12012 (Output_section::find_merge_section,
12013 Output_section::find_relaxed_input_section): New method definitions.
12014 (Output_section::is_input_address_mapped,
12015 Output_section::output_offset, Output_section::output_address):
12016 Use output section data maps to speed up searching.
12017 (Output_section::find_starting_output_address): Add comments.
12018 (Output_section::do_write,
12019 Output_section::write_to_postprocessing_buffer): Do code-fill
12020 generation as appropriate.
12021 (Output_section::get_input_sections): Invalidate relaxed input section
12022 map.
12023 (Output_section::restore_states): Adjust type of checkpoint .
12024 Invalidate relaxed input section map.
12025 * output.h (Output_merge_base): New class declaration.
12026 (Input_section_specifier): New class defintion.
12027 (class Output_relaxed_input_section) Change base class to
12028 Output_section_data_build.
12029 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12030 base class initializer.
12031 (Output_section::add_relaxed_input_section): New method declaration.
12032 (Output_section::Input_section): Change visibility to protected.
2e702c99 12033 (Output_section::Input_section::relobj,
c0a62865
DK
12034 Output_section::Input_section::shndx): Handle relaxed input sections.
12035 Output_section::input_sections) Change visibility to protected. Also
12036 define overload to return a non-const pointer.
12037 (Output_section::Merge_section_properties): New class defintion.
12038 (Output_section::Merge_section_by_properties_map,
12039 Output_section::Output_section_data_by_input_section_map,
12040 Output_section::Relaxation_map): New types.
12041 (Output_section::relax_input_section): Rename method to
12042 Output_section::convert_input_sections_to_relaxed_sections and change
12043 interface to take a vector of relaxed section pointers.
12044 (Output_section::find_merge_section,
12045 Output_section::find_relaxed_input_section,
12046 Output_section::build_relaxation_map,
12047 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12048 New method declarations.
12049 (Output_section::merge_section_map_
12050 Output_section::merge_section_by_properties_map_,
12051 Output_section::relaxed_input_section_map_,
12052 Output_section::is_relaxed_input_section_map_valid_,
12053 Output_section::generate_code_fills_at_write_): New data members.
12054 * script-sections.cc
12055 (Output_section_element_input::set_section_addresses): Call
12056 current_data_size and addralign methods of relaxed input sections.
12057 (Orphan_output_section::set_section_addresses): Call current_data_size
12058 and addralign methods of relaxed input sections.
12059 * symtab.cc (Symbol_table::compute_final_value): Extract template
12060 from the body of Symbol_table::sized_finalize_symbol.
12061 (Symbol_table::sized_finalized_symbol): Call
12062 Symbol_table::compute_final_value.
12063 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12064 (Symbol_table::compute_final_value): New templated method declaration.
12065 * target.cc (Target::do_make_output_section): New method defintion.
12066 * target.h (Target::make_output_section): New method declaration.
12067 (Target::relax): Add more parameters for input objects, symbol table
12068 and layout. Adjust call to do_relax.
12069 (Target::do_make_output_section): New method declaration.
12070 (Target::do_relax): Add parameters for input objects, symbol table
12071 and layout.
12072
d446d6c4
ILT
120732009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12074
12075 * pread.c: Include stdio.h.
12076
bc06c745
ILT
120772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12078
12079 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12080 defined.
12081
75aea3d0
ILT
120822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12083
12084 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12085 Change read_shndx type to unsigned int.
12086 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12087 int.
12088 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12089 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12090 Change read_shndx type to unsigned int.
12091 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12092 int.
12093 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12094 * layout.cc (Layout::create_symtab_sections): Cast the result of
12095 local_symcount * symsize to off_t in the gold_assert.
12096
be8fcb75
ILT
120972009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12098
12099 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12100 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12101 R_ARM_BASE_ABS.
12102 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12103 (Arm_relocate_functions::thm_abs5): New function.
12104 (Arm_relocate_functions::abs12): New function.
12105 (Arm_relocate_functions::abs16): New function.
12106 (Arm_relocate_functions::base_abs): New function.
12107 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12108 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12109 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12110 R_ARM_BASE_ABS.
12111 (Scan::global): Likewise.
12112 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12113 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12114 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12115 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12116 R_ARM_BASE_ABS.
12117
c2a122b6
ILT
121182009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12119
12120 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12121 (Arm_relocate_functions::movt_prel): New function.
12122 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12123 (Arm_relocate_functions::thm_movt_prel): New function.
12124 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12125 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12126 (Scan::global, Relocate::relocate): Likewise.
12127 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12128
c4aa1e2d
ILT
121292009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12130
12131 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12132 Incremental_checker.
12133 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12134 unsigned int.
12135 (class Incremental_inputs_header): New class.
12136 (Incremental_inputs_header_writer): Edit comment.
12137 (Incremental_inputs_entry): New class.
12138 (Incremental_inputs_entry_writer): Edit comment.
12139 (Sized_incremental_binary::do_find_incremental_inputs_section):
12140 Add *strtab_shndx parameter, fill it.
12141 (Sized_incremental_binary::do_check_inputs): New method.
12142 (Incremental_checker::can_incrementally_link_output_file): Use
12143 Sized_incremental_binary::check_inputs.
12144 (Incremental_inputs::report_command_line): Save command line in
12145 command_line_.
12146 * incremental.h:
12147 (Incremental_binary::find_incremental_inputs_section): New
12148 method.
12149 (Incremental_binary::do_find_incremental_inputs_section): Add
12150 strtab_shndx parameter.
12151 (Incremental_binary::do_check_inputs): New pure virtual method.
12152 (Sized_incremental_binary::do_check_inputs): Declare.
12153 (Incremental_checker::Incremental_checker): Add incremental_inputs
12154 parameter, use it to initialize incremental_inputs_.
12155 (Incremental_checker::incremental_inputs_): New field.
12156 (Incremental_checker::command_line): New method.
12157 (Incremental_checker::inputs): New method.
12158 (Incremental_checker::command_line_): New field.
12159
c549a694
ILT
121602009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12161
12162 * incremental.cc: Include <cstdarg> and "target-select.h".
12163 (vexplain_no_incremental): New function.
12164 (explain_no_incremental): New function.
12165 (Incremental_binary::error): New method.
12166 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12167 method.
12168 (make_sized_incremental_binary): New function.
12169 (open_incremental_binary): New function.
12170 (can_incrementally_link_file): Add checks if output is ELF and has
12171 inputs section.
12172 * incremental.h: Include "elfcpp_file.h" and "output.h".
12173 (Incremental_binary): New class.
12174 (Sized_incremental_binary): New class.
12175 (open_incremental_binary): Declare.
12176 * object.cc (is_elf_object): Use
12177 elfcpp::Elf_recognizer::is_elf_file.
12178 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12179 * output.h (Output_file::filesize): New method.
12180
fd3c5f0b
ILT
121812009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12182
12183 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12184 New function.
12185 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12186 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12187 function.
12188 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12189 function.
12190 (Arm_relocate_functions::movw_abs_nc): New function.
12191 (Arm_relocate_functions::movt_abs): New function.
12192 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12193 (Arm_relocate_functions::thm_movt_abs): New function.
12194 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12195 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12196 (Scan::global): Likewise.
12197 (Relocate::relocate): Likewise.
12198 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12199
7f5309a5
ILT
122002009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12201
12202 * arm.cc (Arm_relocate_functions::got_prel) New function.
12203 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12204 (Relocate::relocate): Likewise.
12205 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12206
364c7fa5
ILT
122072009-10-06 Ian Lance Taylor <iant@google.com>
12208
12209 * options.h (class General_options): Define
12210 split_stack_adjust_size parameter.
12211 * object.h (class Object): Add uses_split_stack_ and
12212 has_no_split_stack_ fields. Add uses_split_stack and
12213 has_no_split_stack accessor functions. Declare
12214 handle_split_stack_section.
12215 (class Reloc_symbol_changes): Define.
12216 (class Sized_relobj): Define Function_offsets. Declare
12217 split_stack_adjust, split_stack_adjust_reltype, and
12218 find_functions.
12219 * object.cc (Object::handle_split_stack_section): New function.
12220 (Sized_relobj::do_layout): Call handle_split_stack_section.
12221 * dynobj.cc (Sized_dynobj::do_layout): Call
12222 handle_split_stack_section.
12223 * reloc.cc (Sized_relobj::relocate_sections): Call
12224 split_stack_adjust for executable sections in split_stack
12225 objects. Pass reloc_map to relocate_section.
12226 (Sized_relobj::split_stack_adjust): New function.
12227 (Sized_relobj::split_stack_adjust_reltype): New function.
12228 (Sized_relobj::find_functions): New function.
12229 * target-reloc.h: Include "object.h".
12230 (relocate_section): Add reloc_symbol_changes parameter. Change
12231 all callers.
12232 * target.h (class Target): Add calls_non_split method. Declare
12233 do_calls_non_split virtual method. Declare match_view and
12234 set_view_to_nop.
12235 * target.cc: Include "elfcpp.h".
12236 (Target::do_calls_non_split): New function.
12237 (Target::match_view): New function.
12238 (Target::set_view_to_nop): New function.
12239 * gold.cc (queue_middle_tasks): Give an error if mixing
12240 split-stack and non-split-stack objects with -r.
12241 * i386.cc (Target_i386::relocate_section): Add
12242 reloc_symbol_changes parameter.
12243 (Target_i386::do_calls_non_split): New function.
12244 * x86_64.cc (Target_x86_64::relocate_section): Add
12245 reloc_symbol_changes parameter.
12246 (Target_x86_64::do_calls_non_split): New function.
12247 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12248 parameter.
12249 * powerpc.cc (Target_powerpc::relocate_section): Add
12250 reloc_symbol_changes parameter.
12251 * sparc.cc (Target_sparc::relocate_section): Add
12252 reloc_symbol_changes parameter.
12253 * configure.ac: Call AM_CONDITIONAL for the default target.
12254 * configure: Rebuild.
12255 * testsuite/Makefile.am (TEST_AS): New variable.
12256 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12257 (check_DATA): Add split_i386 and split_x86_64 files.
12258 (SPLIT_DEFSYMS): Define.
12259 (split_i386_[1234n].o): New targets.
12260 (split_i386_[124]): New targets.
12261 (split_i386_[1234r].stdout): New targets.
12262 (split_x86_64_[1234n].o): New targets.
12263 (split_x86_64_[124]): New targets.
12264 (split_x86_64_[1234r].stdout): New targets.
12265 (MOSTLYCLEANFILES): Add new executables.
12266 * testsuite/split_i386.sh: New file.
12267 * testsuite/split_x86_64.sh: New file.
12268 * testsuite/split_i386_1.s: New file.
12269 * testsuite/split_i386_2.s: New file.
12270 * testsuite/split_i386_3.s: New file.
12271 * testsuite/split_i386_4.s: New file.
12272 * testsuite/split_i386_n.s: New file.
12273 * testsuite/split_x86_64_1.s: New file.
12274 * testsuite/split_x86_64_2.s: New file.
12275 * testsuite/split_x86_64_3.s: New file.
12276 * testsuite/split_x86_64_4.s: New file.
12277 * testsuite/split_x86_64_n.s: New file.
12278 * testsuite/testfile.cc (Target_test): Update relocation_section
12279 function.
12280 * testsuite/Makefile.in: Rebuild.
12281
e8a9fcda
ILT
122822009-10-06 Ian Lance Taylor <iant@google.com>
12283
12284 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12285 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12286 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12287 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12288 the address on ldo_addrs_.
12289 (Target_i386::Relocate::fix_up_ldo): New function.
12290
e99daf92
ILT
122912009-10-06 Rafael Espindola <espindola@google.com>
12292
12293 * plugin.cc (add_input_library): New.
12294 (Plugin::load): Add add_input_library to tv.
12295 (Plugin_manager::add_input_file): Add the is_lib argument.
12296 (add_input_file): Update call to Plugin_manager::add_input_file.
12297 (add_input_library): New.
12298 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12299
966d4097
DK
123002009-09-30 Doug Kwan <dougkwan@google.com>
12301
12302 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12303 symbol and call Symbol::may_need_copy_reloc to determine if
12304 a copy reloc is needed.
12305 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12306 nocopyreloc is given in command line.
12307 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12308 given in command line.
12309 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12310 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12311 of the removed Target_i386::may_need_copy_reloc.
12312 * options.h (copyreloc): New option with default value false.
12313 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12314 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12315 instead of the removed Target_powerpc::may_need_copy_reloc.
12316 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12317 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12318 instead of the removed Target_sparc::may_need_copy_reloc.
12319 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12320 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12321 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12322 instead of the removed Target_x86_64::may_need_copy_reloc.
12323
029ba973
ILT
123242009-09-30 Ian Lance Taylor <iant@google.com>
12325
12326 * object.h (class Object): Remove target_ field, and target,
12327 sized_target, and set_target methods.
12328 (Object::sized_target): Remove.
12329 (class Sized_relobj): Update declarations. Remove sized_target.
12330 * object.cc (Sized_relobj::setup): Remove target parameter.
12331 Change all callers.
12332 (Input_objects::add_object): Don't do anything with the target.
12333 (make_elf_sized_object): Add punconfigured parameter. Change all
12334 callers. Set or test parameter target.
12335 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12336 Change all callers.
12337 * parameters.cc (Parameters::set_target): Change parameter type to
12338 be non-const.
12339 (Parameters::default_target): Remove.
12340 (set_parameters_target): Change parameter type to be non-const.
12341 (parameters_force_valid_target): New function.
12342 (parameters_clear_target): New function.
12343 * parameters.h (class Parameters): Update declarations. Remove
12344 default_target method. Add sized_target and clear_target
12345 methods. Change target_ to be non-const.
12346 (set_parameters_target): Update declaration.
12347 (parameters_force_valid_target): Declare.
12348 (parameters_clear_target): Declare.
12349 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12350 as NULL if we aren't searching.
12351 (Add_symbols::run): Don't check for compatible target.
12352 * fileread.cc (Input_file::open_binary): Call
12353 parameters_force_valid_target.
12354 * gold.cc (queue_middle_tasks): Likewise.
12355 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12356 set_target on object.
12357 * dynobj.h (class Sized_dynobj): Update declarations.
12358 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12359 make_elf_object returns NULL.
12360 (Archive::include_member): Don't check whether object target is
12361 compatible.
12362 * output.cc (Output_section::add_input_section): Get target from
12363 parameters.
12364 (Output_section::relax_input_section): Likewise.
12365 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12366 parameters.
12367 (Sized_relobj::do_scan_relocs): Likewise.
12368 (Sized_relobj::relocate_sections): Likewise.
12369 * resolve.cc (Symbol_table::resolve): Likewise.
12370 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12371 parameter. Change all callers.
12372 (Symbol_table::add_from_object): Get target from parameters.
12373 (Symbol_table::add_from_relobj): Don't check object target.
12374 (Symbol_table::add_from_dynobj): Likewise.
12375 (Symbol_table::define_special_symbol): Get target from
12376 parameters.
12377 * symtab.h (class Symbol_table): Update declaration.
12378 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12379 parameter. Change all callers. Clear parameter target.
12380 (Binary_test): Test target here.
12381 * testsuite/object_unittest.cc (gold_testsuite): Remove
12382 target_test_pointer parameter. Change all callers.
12383 (Object_test): Test target here.
12384
a6a22b83
ILT
123852009-09-26 Ian Lance Taylor <iant@google.com>
12386
12387 * testsuite/initpri1.c: Don't try to use constructor priorities if
12388 compiling with gcc before 4.3.
12389
6a8f49fe
ILT
123902009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12391
12392 * testsuite/retain_symbols_file_test.sh (check_present): Change
12393 output file name to retain_symbols_file_test.stdout.
12394 (check_absent): Likewise.
12395
8c604651
CS
123962009-09-18 Craig Silverstein <csilvers@google.com>
12397
12398 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12399 * options.cc: Include <cerrno> and <fstream>.
12400 (General_options::finalize): Parse -retain-symbols-file tag.
12401 * options.h: New flag.
12402 (General_options): New method should_retain_symbol, new
12403 variable symbols_to_retain.
12404 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12405 should_retain_symbol map.
12406 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12407 * testsuite/Makefile.in: Regenerate.
12408 * testsuite/retain_symbols_file_test.sh: New file.
12409
ca58b19f
NC
124102009-09-18 Nick Clifton <nickc@redhat.com>
12411
12412 * po/es.po: Updated Spanish translation.
12413
20e6d0d6
DK
124142009-09-17 Doug Kwan <dougkwan@google.com>
12415
12416 * debug.h (DEBUG_RELAXATION): New constant.
12417 (DEBUG_ALL): Add DEBUG_RELAXATION.
12418 (debug_string_to_enum): Add relaxation debug option.
12419 * layout.cc
12420 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12421 Layout::Relaxation_debug_check::read_sections,
12422 Layout::Relaxation_debug_check::read_sections): New method definitions.
12423 (Layout::Layout): Initialize data members
12424 record_output_section_data_from_scrips_,
12425 script_output_section_data_list_ and relaxation_debug_check_.
12426 (Layout::save_segments, Layout::restore_segments,
12427 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12428 Layout::relaxation_loop_body): New method definitions.
12429 (Layout::finalize): Support relaxation. Move section layout code to
12430 Layout::relaxation_loop_body.
12431 (Layout::set_asection_address_from_script): Move code for orphan
12432 section placement out.
12433 (Layout::place_orphan_sections_in_script): New method definition.
12434 * layout.h (Output_segment_headers, Output_file_header):
12435 New forward class declarations.
12436 (Layout::~Layout): Define.
12437 (Layout::new_output_section_data_from_script): New method definition.
12438 (Layout::place_orphan_sections_in_script): New method declaration.
12439 (Layout::Segment_states): New type declaration.
12440 (Layout::save_segments, Layout::restore_segments,
12441 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12442 Layout::relaxation_loop_body): New method declarations.
12443 (Layout::Output_section_data_list): New type declaration.
12444 (Layout::Relaxation_debug_check): New class definition.
12445 (Layout::record_output_section_data_from_script_,
12446 Layout::script_output_section_data_list_, Layout::segment_states_,
12447 Layout::relaxation_debug_check_): New data members.
12448 * output.cc: (Output_section_headers::do_size): New method definition.
12449 (Output_section_headers::Output_section_headers): Move size
12450 computation to Output_section_headers::do_size.
12451 (Output_segment_headers::do_size): New method definition.
e1df38aa 12452 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12453 Output_file_header::do_size and call it.
12454 (Output_file_header::do_size): New method definition.
12455 (Output_data_group::Output_data_group): Adjust call to
12456 Output_section_data.
12457 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12458 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12459 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12460 RELAXED_INPUT_SECTION_CODE.
12461 (Output_section::Output_section): Initialize data member checkpoint_.
12462 (Output_section::~Output_section): Delete checkpoint object pointed
12463 by checkpoint_.
12464 (Output_section::add_input_section): Always add an Input_section if
12465 relaxing.
12466 (Output_section::add_merge_input_section): Add assert.
12467 (Output_section::relax_input_section): New method definition.
12468 (Output_section::set_final_data_size): Set load address to zero for
12469 an unallocated section.
12470 (Output_section::do_address_and_file_offset_have_reset_values):
12471 New method definition.
12472 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12473 Handle relaxed input section.
12474 (Output_section::sort_attached_input_sections): Checkpoint input
12475 section list lazily.
12476 (Output_section::get_input_sections): Change type of input_sections to
12477 list of Simple_input_section pointers. Checkpoint input section list
12478 lazily. Also handle relaxed input sections.
12479 (Output_section::add_input_section_for_script): Take a reference to
12480 a Simple_input_section object instead of Relobj pointer and section
12481 index as parameter. Handle relaxed input sections.
12482 (Output_section::save_states, Output_section::restore_states): New
12483 method definitions.
12484 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12485 (Output_data::is_data_size_fixed): New method definition.
12486 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12487 if it is fixed.
12488 (Output_data::address_and_file_offset_have_reset_values): New method
12489 definition.
12490 (Output_data::do_address_and_file_offset_have_reset_values): New method
12491 definition.
12492 (Output_data::set_data_size): Check that data size is not fixed.
12493 (Output_data::fix_data_size): New method definition.
12494 (Output_data::is_data_size_fixed_): New data member.
12495 (Output_section_headers::set_final_data_size): New method definition.
12496 (Output_section_headers::do_size): New method declaration.
12497 (Output_segment_headers::set_final_data_size): New method definition.
12498 (Output_segment_headers::do_size): New method declaration.
12499 (Output_file_header::set_final_data_size)::New method definition.
12500 (Output_file_header::do_size)::New method declaration.
12501 (Output_section_data::Output_section_data): Add new parameter
12502 is_data_size_fixed and use it to fix data size.
12503 (Output_data_const::Output_data_const): Adjust call to base class
12504 constructor and fix data size.
12505 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12506 base class constructor and fix data size.
12507 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12508 base class constructor and fix data size.
12509 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12510 class constructor and fix data size.
12511 (Output_data_group::set_final_data_size): New method definition.
12512 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12513 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12514 class constructor and fix data size.
12515 (Output_relaxed_input_section): New class definition.
12516 (Output_section::Simple_input_section): New class definition.
12517 (Output_section::get_input_sections): Adjust parameter list.
12518 (Output_section::add_input_section_for_script): Same.
12519 (Output_section::save_states, Output_section::restore_states,
12520 Output_section::do_address_and_file_offset_have_reset_values,
12521 (Output_section::Input_section::Input_section): Handle
12522 RELAXED_INPUT_SECTION_CODE. Add new overload for
12523 Output_relaxed_input_section.
12524 (Output_section::Input_section::is_input_section,
12525 Output_section::Input_section::set_output_section): Handle relaxed
12526 input section.
12527 (Output_section::Input_section::is_relaxed_input_section,
12528 Output_section::Input_section::output_section_data,
12529 Output_section::Input_section::relaxed_input_section): New method
12530 definitions.
12531 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12532 value.
12533 (Output_section::Input_section::u1_): Update comments.
12534 (Output_section::Input_section::u2_): Add new union member poris.
12535 (Output_section::Checkpoint_output_section): New classs definition.
12536 (Output_section::relax_input_section): New method declaration.
12537 (Output_section::checkpoint_): New data member.
12538 (Output_segment): Update comments.
12539 (Output_segment::Output_segment): Un-privatize copy constructor.
12540 (Output_segment::operator=): Un-privatize.
12541 * script-sections.cc (Output_section_element::Input_section_list):
12542 Change element type to Output_section::Simple_input_section.
12543 (Output_section_element_dot_assignment::set_section_addresses):
12544 Register output section data for relaxation clean up.
12545 (Output_data_exression::Output_data_expression): Adjust call to base
12546 constructor to fix data size.
12547 (Output_section_element_data::set_section_addresses): Register
12548 Output_data_expression object for relaxation clean up.
12549 (struct Input_section_info): Replace Relobj pointer and section index
12550 pair with Output_section::Simple_input_section and Convert struct to a
12551 class.
12552 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12553 Input_section_info data member to use accessors.
20e6d0d6
DK
12554 (Output_section_element_input::set_section_addresses): Use layout
12555 parameter. Adjust code to use Output_section::Simple_input_section
12556 and Input_secction_info classes. Register filler for relaxation
12557 clean up.
12558 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12559 and section index pair with Output_section::Simple_input_section
12560 class. Adjust code accordingly.
12561 (Phdrs_element::release_segment): New method definition.
12562 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12563 segment list.
12564 (Script_sections::release_segments): New method definition.
12565 * gold/script-sections.h (Script_sections::release_segments): New
12566 method declaration.
12567 * gold/target.h (Target::may_relax, Target::relax,
12568 Target::do_may_relax, Target::do_relax): New method definitions.
12569
5e445df6
ILT
125702009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12571
12572 * arm.cc (has_signed_unsigned_overflow): New function.
12573 (Arm_relocate_functions::abs8): New function.
12574 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12575 (Target_arm::Scan::global): Likewise.
12576 (Target_arm::relocate::relocate): Likewise.
12577 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12578 Likewise.
12579
8c604651 125802009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12581
12582 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12583 * testsuite/Makefile.in: Regenerate.
12584
1e9cc1c2
NC
125852009-09-11 Nick Clifton <nickc@redhat.com>
12586
12587 * po/gold.pot: Updated by the Translation project.
12588
6a89f575
CC
125892009-09-08 Cary Coutant <ccoutant@google.com>
12590
12591 * output.cc (Output_file::open): Add execute permission to empty file.
12592 * testsuite/Makefile.am (permission_test): New test.
12593 * testsuite/Makefile.in: Regenerate.
12594
fdcac5af
ILT
125952009-09-02 Ian Lance Taylor <iant@google.com>
12596
12597 * output.cc (Output_file::resize): Call map_no_anonymous rather
12598 than map.
12599
44453f85
ILT
126002009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12601
12602 * gold.cc: Include "incremental.h".
12603 (queue_initial_tasks): Call Incremental_checker methods.
12604 * incremental.cc: Include "output.h".
12605 (Incremental_checker::can_incrementally_link_output_file): New
12606 method.
12607 * incremental.h (Incremental_checker): New class.
12608
12609 * output.cc (Output_file::open_for_modification): New method.
12610 (Output_file::map_anonymous): Changed return type to bool. Record
12611 map in base_ field.
12612 (Output_file::map_no_anonymous): New method, broken out of map.
12613 (Output_file::map): Use map_no_anonymous and map_anonymous.
12614 * output.h (class Output_file): Update declarations.
12615
293c1386
CC
126162009-08-24 Cary Coutant <ccoutant@google.com>
12617
12618 * options.h (Command_line::Pre_options): New class.
12619 (Command_line::pre_options): New member.
12620 * options.cc (gold::options::ready_to_register): New variable.
12621 (One_option::register_option): Do nothing if not registering options.
12622 Assert if same short option registered twice.
12623 (General_options::General_options): Turn off option registration when
12624 done constructing.
12625 (Command_line::Pre_options::Pre_options): New constructor.
12626
f773f3d2
CC
126272009-08-24 Cary Coutant <ccoutant@google.com>
12628
06a73cfe
CC
12629 * options.h (General_options::no_keep_memory): Remove incorrect
12630 short option.
f773f3d2 12631
a15af8e2
RW
126322009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12633
12634 * Makefile.am (am__skiplex, am__skipyacc): New.
12635 * Makefile.in: Regenerate.
12636
c462b41b
RW
126372009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12638
14ec8efd
RW
12639 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12640 (INCLUDES): ... this.
12641 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12642 (AM_CPPFLAGS): Renamed from ...
12643 (INCLUDE): ... this.
12644 * Makefile.in, testsuite/Makefile.in: Regenerate.
12645
81ecdfbb
RW
12646 * Makefile.in: Regenerate.
12647 * aclocal.m4: Likewise.
12648 * config.in: Likewise.
12649 * configure: Likewise.
12650 * testsuite/Makefile.in: Likewise.
12651
c462b41b
RW
12652 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12653 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12654 * Makefile.in: Regenerate.
12655 * testsuite/Makefile.in: Regenerate.
12656
2da73f13
CC
126572009-08-19 Cary Coutant <ccoutant@google.com>
12658
12659 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12660 symbols in shared libraries overridden by hidden or internal symbols
12661 in the main program.
12662
2db70501
CD
126632009-08-19 Chris Demetriou <cgd@google.com>
12664
12665 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12666 checking source file names in error messages.
12667
f733487b
DK
126682009-08-18 Doug Kwan <dougkwan@google.com>
12669
12670 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12671 an elcpp::Ehdr as parameter. Adjust call to set_target.
12672 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12673 an elfcpp::Ehdr as parameter.
12674 * object.cc (Object::set_target): Remove the version that looks up
12675 a target and sets it.
12676 (Sized_relobj::setup): Take a Target object instead of
12677 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12678 (make_elf_sized_object): Find target and ask target to
12679 make an ELF object.
12680 * object.h: (Object::set_target): Remove the version that looks up
12681 a target and sets it.
12682 (Sized_relobj::setup): Take a Target object instead of
12683 an elfcpp:Ehdr as parameter.
12684 * target.cc: Include dynobj.h.
12685 (Target::do_make_elf_object_implementation): New.
2e702c99 12686 (Target::do_make_elf_object): New.
f733487b
DK
12687 * target.h (Target::make_elf_object): New template declaration.
12688 (Target::do_make_elf_object): New method declarations.
12689 (Target::do_make_elf_object_implementation): New template declaration.
12690
cc70f101
ILT
126912009-08-14 Ian Lance Taylor <iant@google.com>
12692
12693 * gold.h (FUNCTION_NAME): Define.
12694 (gold_unreachable): Use FUNCTION_NAME.
12695
ef5e0cb1
ST
126962009-08-12 Sriraman Tallam <tmsriram@google.com>
12697
12698 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12699 symbol in the --keep-unique list is not found.
12700
48c187ce
ST
127012009-08-12 Sriraman Tallam <tmsriram@google.com>
12702
12703 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12704 been maked as --keep-unique.
12705 (Icf::unfold_section): New function.
12706 * icf.h (Icf::unfold_section): New function.
12707 * options.h (General_options::keep_unique): New option.
12708 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12709 * testsuite/Makefile.in: Regenerate.
12710 * testsuite/icf_keep_unique_test.sh: New file.
12711 * testsuite/icf_keep_unique_test.cc: New file.
12712
645afe0c
CC
127132009-08-12 Cary Coutant <ccoutant@google.com>
12714
12715 PR 10471
12716 * resolve.cc (Symbol_table::resolve): Check for references from
12717 dynamic objects to hidden and internal symbols.
12718 * testsuite/Makefile.am (hidden_test.sh): New test.
12719 * testsuite/Makefile.in: Regenerate.
12720 * testsuite/hidden_test.sh: New script.
12721 * testsuite/hidden_test_1.c: New test source.
12722 * testsuite/hidden_test_main.c: New test source.
12723
11af873f
DK
127242009-08-11 Doug Kwan <dougkwan@google.com>
12725
12726 * arm.cc: Update comments.
12727 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12728 segment to locate the .ARM.exidx section if present.
12729
b9f7d72d
DK
127302009-08-09 Doug Kwan <dougkwan@google.com>
12731
12732 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12733 patch.
12734
ddd3c53c
ST
127352009-08-07 Sriraman Tallam <tmsriram@google.com>
12736 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12737 compiler warnings.
12738
27721062
ST
127392009-08-06 Sriraman Tallam <tmsriram@google.com>
12740
12741 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12742 valid tls_segment only for non-debug-section relocations.
12743 * testsuite/Makefile.am: Add gc_tls_test.
12744 * testsuite/Makefile.in: Regenerate.
12745 * testsuite/gc_tls_test.cc: New file.
12746 * testsuite/gc_tls_test.sh: New file.
12747
ef15dade 127482009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12749
ef15dade
ST
12750 * icf.cc: New file.
12751 * icf.h: New file.
12752 * Makefile.am (CCFILES): Add icf.cc.
12753 (HFILES): Add icf.h
12754 * Makefile.in: Regenerate.
12755 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12756 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12757 section, symbol and addend information for the relocs.
12758 * gold.cc (queue_middle_tasks): Call identical code folding.
12759 * gold.h: Add defines for multimap.
12760 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12761 to the call of finalize_local_symbols.
12762 * main.cc (main): Create object of class Icf.
12763 * object.cc (Sized_relobj::do_layout): Allow this function to be
12764 called twice during icf.
12765 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12766 to sections marked as identical by icf.
12767 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12768 when available.
12769 (Sized_relobj::do_section_entsize): New function.
12770 * object.h (Object::section_entsize): New function.
12771 (Object::do_section_entsize): New pure virtual function.
12772 (Relobj::finalize_local_symbols): Add new parameter.
12773 (Relobj::do_section_entsize): New function.
12774 * options.h (General_options::icf): New option.
12775 (General_options::icf_iterations): New option.
12776 (General_options::print_icf_sections): New option.
12777 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12778 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12779 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12780 icf.
12781 * symtab.cc (Symbol_table::is_section_folded): New function.
12782 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12783 to sections marked as identical by icf.
12784 * symtab.h (Symbol_table::set_icf): New function.
12785 (Symbol_table::icf): New function.
12786 (Symbol_table::is_section_folded): New function.
12787 (Symbol_table::icf_): New data member.
12788 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12789 * testsuite/Makefile.am: Add commands to build icf_test.
12790 * testsuite/Makefile.in: Regenerate.
12791 * testsuite/icf_test.sh: New file.
12792 * testsuite/icf_test.cc: New file.
12793
c3b65ac4
CD
127942009-07-24 Chris Demetriou <cgd@google.com>
12795
12796 * layout.cc (is_compressible_debug_section): Fix incorrect
12797 comment about compressed section names.
12798
1caf2c51
ILT
127992009-07-20 Ian Lance Taylor <ian@airs.com>
12800
12801 PR 10419
12802 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12803
1ef4d87f
ILT
128042009-07-16 Ian Lance Taylor <iant@google.com>
12805
12806 PR 10400
12807 * layout.h: #include <map>.
12808 (class Kept_section): Change from struct to class. Add accessors
12809 and setters. Add section size to Comdat_group mapping. Change
12810 Comdat_group to std::map. Add is_comdat_ field. Add
12811 linkonce_size field in union.
12812 (class Layout): Update declaration of find_or_add_kept_section.
12813 Don't declare find_kept_object.
12814 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12815 parameter. Add object, shndx, is_comdat, and is_group_name
12816 parameters. Change all callers. Adjust for new Kept_section.
12817 (Layout::find_kept_object): Remove.
12818 * object.cc (Sized_relobj::include_section_group): Update use of
12819 Kept_section. Rename secnum to shndx. Only record
12820 Kept_comdat_section if sections are the same size.
12821 (Sized_relobj::include_linkonce_section): Update use of
12822 Kept_section. Only record Kept_comdat_section if sections are the
12823 same size. Set size of linkonce section.
12824 (Sized_relobj::map_to_kept_section): Update call to
12825 get_kept_comdat_section.
12826 * object.h (class Sized_relobj): Rename fields in
12827 Kept_comdat_section to drop trailing underscores; change object
12828 field to Relobj*. Change Kept_comdat_section_table to store
12829 struct rather than pointer.
12830 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12831 Add kept_object and kept_shndx parameters. Change all callers.
12832 (Sized_relobj::get_kept_comdat_section): Change return type to
12833 bool. Add kept_object and kept_shndx parameters. Change all
12834 callers.
12835 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12836 Layout::find_or_add_kept_section.
12837
37c3b7b0
ILT
128382009-07-09 Ian Lance Taylor <iant@google.com>
12839
12840 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12841 Reserve space in the hash table.
12842
98fa85cb
ILT
128432009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12844
12845 * fileread.cc (File_read::get_mtime): New method.
12846 * fileread.h (Timespec): New structure.
12847 (File_read::get_mtime): New method.
12848 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12849 Renamed from timestamp_nsec.
12850 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12851 Elf_Xword.
e1df38aa 12852 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12853 timestamp_nsec.
e1df38aa 12854 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12855 (Incremental_inputs::report_obejct): Save mtime; style fix.
12856 (Incremental_inputs::report_script): Save mtime; style fix.
12857 (Incremental_inputs::finalize_inputs): Style fix.
12858 (Incremental_inputs::finalize): Style fix.
12859 (Incremental_inputs::create_input_section_data): Store inputs
12860 mtime.
12861 * incremental.h (Incremental_inputs::report_script): Add mtime
12862 argument.
12863 (Incremental_inputs::Input_info::Input_info): Intialize only one
12864 union member.
12865 (Incremental_inputs::Input_info::archive): Move to nameless
12866 union.
12867 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12868 (Incremental_inputs::Input_info::script): Move to nameless union.
12869 (Incremental_inputs::mtime): New field.
12870 * script.cc (read_input_script): Pass file mtime to
12871 Incremental_input.
12872 * script.h (Script_info::inputs): Style fix.
12873
c9d70757
ILT
128742009-07-01 Ian Lance Taylor <ian@airs.com>
12875
12876 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12877 instead of 32.
12878
9c547ec3
ILT
128792009-06-24 Ian Lance Taylor <iant@google.com>
12880
12881 PR 10156
12882 * layout.cc (Layout::choose_output_section): If we find an
12883 existing section, update the flags.
12884 (Layout::create_notes): New function, broken out of
12885 Layout::finalize.
12886 (Layout::finalize): Don't create note sections.
12887 (Layout::create_note): Don't crash if linker script discards
12888 section.
12889 (Layout::create_gold_note): Likewise.
12890 (Layout::create_build_id): Likewise. Don't set
12891 after_input_sections on the section.
12892 (Layout::create_executable_stack_info): Remove target parameter.
12893 Change caller.
12894 * layout.h (class Layout): Declare create_notes. Update
12895 declaration of create_executable_stack_info.
12896 * gold.cc (queue_middle_tasks): Call create_notes.
12897 * output.cc (Output_section::update_flags_for_input_section): Move
12898 here from output.h. If SHF_ALLOC flag is newly set, mark address
12899 invalid.
12900 * output.h (Output_data::mark_address_invalid): New function.
12901 (class Output_section): Only declare, not define,
12902 update_flags_for_input_section. Remove set_flags.
12903
55458500
ILT
129042009-06-24 Ian Lance Taylor <iant@google.com>
12905
12906 * script-sections.cc (Output_section_definition::
12907 set_section_addresses): Rename shadowing local load_address to
12908 laddr.
12909
1307d6cd
ILT
129102009-06-24 Ian Lance Taylor <iant@google.com>
12911
12912 PR 10244
12913 * reloc.cc (relocate_sections): Skip empty relocation sections.
12914
ec3f783e
ILT
129152009-06-23 Ian Lance Taylor <iant@google.com>
12916
12917 PR 10156
12918 * layout.cc (Layout::create_note): Use choose_output_section
12919 rather than make_output_section.
12920
459c9f1c
ILT
129212009-06-23 Ian Lance Taylor <iant@google.com>
12922
12923 PR 10237
12924 * options.cc (General_options::parse_V): Set printed_version_.
12925 (General_options::General_options): Initialize printed_version_.
12926 * options.h (class General_options): Add printed_version_ field.
12927 * gold.cc (queue_initial_tasks): If there are no input files,
12928 don't give a fatal error if we printed the version information.
12929 (queue_middle_tasks): If using -r with a shared object, give a
12930 fatal error rather than an ordinary error.
12931
1518dc8f
ILT
129322009-06-23 Ian Lance Taylor <iant@google.com>
12933
12934 PR 10219
12935 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12936 (Layout::make_output_section): Set have_stabstr_section_ if we see
12937 a .stab*str section.
12938 (Layout::finalize): Call link_stabs_sections.
12939 (Layout::link_stabs_sections): New file.
12940 * layout.h (class Layout): Add have_stabstr_section_ field.
12941 Declare link_stabs_sections.
12942
3d857b98
DK
129432009-06-23 Doug Kwan <dougkwan@google.com>
12944
12945 * Makefile.am (libgold_a_LIBADD): New.
12946 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12947 * Makefile.in: Regenerate.
3d857b98
DK
12948 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12949 * configure: Regenerate.
12950 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12951 * fileread.cc: Include sys/state.h
12952 * gold.h: Declare memmem and strndup if found missing.
12953 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12954
0639a6f6
ILT
129552009-06-23 Ian Lance Taylor <iant@google.com>
12956
12957 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12958 * configure: Rebuild.
12959
8d63875c
ILT
129602009-06-23 Ian Lance Taylor <iant@google.com>
12961
12962 PR 10147
12963 * object.cc (Object::section_contents): Don't try to get a view if
12964 the section has length zero.
12965 (Object::handle_gnu_warning_section): If the section is empty, use
12966 the name of the section as the warning.
12967
f7c8a183
ILT
129682009-06-23 Ian Lance Taylor <iant@google.com>
12969
12970 PR 10133
12971 * stringpool.h (class Stringpool_template): Add optimize_ field.
12972 (Stringpool_template::set_optimize): New function.
12973 * stringpool.cc (Stringpool_template::Stringpool_template):
12974 Initialize optimize_ field.
12975 (Stringpool_template::set_string_offsets): Test local optimize
12976 fild rather than parameter.
12977 * layout.cc (Layout::Layout): Call set_optimize on the section
12978 name stringpool.
12979
e6a307ba
ILT
129802009-06-22 Ian Lance Taylor <iant@google.com>
12981
12982 PR 10030
12983 * yyscript.y: Parse TARGET.
12984 * script.cc (script_set_target): New function.
12985 * script-c.h (script_set_target): Declare.
12986 * options.cc (General_options::string_to_object_format): Rename
12987 from string_to_object_format in anonymous namespace. Change
12988 callers.
12989 * options.h (class General_options): Declare
12990 string_to_object_format.
12991
3ee173de
ILT
129922009-06-22 Ian Lance Taylor <iant@google.com>
12993
12994 * script-sections.cc (Script_sections::create_segments): Don't put
12995 program headers in a PT_LOAD segment if -n or -N.
12996
129972009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12998
12999 PR 10141
13000 * options.h (class General_options): Add -z lazy and -z now. Sort
13001 -z options into alphabetical order.
13002 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13003
cd6739a1 130042009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13005
13006 * layout.cc (Layout::make_output_section): Call
13007 Target::new_output_section.
13008 (Layout::attach_allocated_section_to_segment): Put large section
13009 sections in a separate load segment with the large segment flag
13010 set.
13011 (Layout::segment_precedes): Sort large data segments after other
13012 load segments.
13013 (align_file_offset): New static function.
13014 (Layout::set_segment_offsets): Use align_file_offset.
13015 * output.h (class Output_section): Add is_small_section_ and
13016 is_large_section_ fields.
13017 (Output_section::is_small_section): New function.
13018 (Output_section::set_is_small_section): New function.
13019 (Output_section::is_large_section): New function.
13020 (Output_section::set_is_large_section): New function.
13021 (Output_section::is_large_data_section): New function.
13022 (class Output_segment): Add is_large_data_segment_ field.
13023 (Output_segment::is_large_data_segment): New function.
13024 (Output_segment::set_is_large_data_segment): New function.
13025 * output.cc (Output_section::Output_section): Initialize new
13026 fields.
13027 (Output_segment::Output_segment): Likewise.
13028 (Output_segment::add_output_section): Add assertion that large
13029 data sections always go in large data segments. Force small data
13030 sections to the end of the list of data sections. Force small BSS
13031 sections to the start of the list of BSS sections. For large BSS
13032 sections to the end of the list of BSS sections.
13033 * symtab.h (class Symbol): Declare is_common_shndx.
13034 (Symbol::is_defined): Check Symbol::is_common_shndx.
13035 (Symbol::is_common): Likewise.
13036 (class Symbol_table): Define enum Commons_section_type. Update
13037 declarations. Add small_commons_ and large_commons_ fields.
13038 * symtab.cc (Symbol::is_common_shndx): New function.
13039 (Symbol_table::Symbol_table): Initialize new fields.
13040 (Symbol_table::add_from_object): Put small and large common
13041 symbols in the right list.
13042 (Symbol_table::sized_finalized_symbol): Check
13043 Symbol::is_common_shndx.
13044 (Symbol_table::sized_write_globals): Likewise.
13045 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13046 common symbol lists. Don't call do_allocate_commons_list if the
13047 list is empty.
13048 (Symbol_table::do_allocate_commons_list): Remove is_tls
13049 parameter. Add comons_section_type parameter. Change all
13050 callers. Handle small and large common symbols.
13051 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13052 Symbol::is_common_shndx.
13053 * resolve.cc (symbol_to_bits): Likewise.
13054 * target.h (Target::small_common_shndx): New function.
13055 (Target::small_common_section_flags): New function.
13056 (Target::large_common_shndx): New function.
13057 (Target::large_common_section_flags): New function.
13058 (Target::new_output_section): New function.
13059 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13060 small_common_section_flags, and large_common_section_flags
13061 fields.
13062 (Target::do_new_output_section): New virtual function.
13063 * arm.cc (Target_arm::arm_info): Initialize new fields.
13064 * i386.cc (Target_i386::i386_info): Likewise.
13065 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13066 Likewise.
13067 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13068 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13069 (Target_x86_64::do_new_output_section): New function.
13070 * configure.ac: Define conditional MCMODEL_MEDIUM.
13071 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13072 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13073 (large_LDFLAGS): Define.
13074 * testsuite/large.c: New file.
13075 * testsuite/testfile.cc (Target_test::test_target_info):
13076 Initialize new fields.
13077 * configure, testsuite/Makefile.in: Rebuild.
13078
bb04269c
DK
130792009-06-05 Doug Kwan <dougkwan@google.com>
13080
13081 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13082 * Makefile.in: Regenerate.
bb04269c
DK
13083 * i386.cc (class Target_i386): Define new virtual method to
13084 override do_is_local_label_name in parent.
13085 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13086 local symbols if --discard-locals or -X is given.
13087 * options.h (class General_options): Declare new options
13088 '--discard-locals' and '-X' for discarding locals.
13089 * target.h (class Target): Define new methods is_local_label_name.
13090 Declare new virtual method do_is_local_label_name.
13091 * target.cc: New file.
13092 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13093 (check_SCRIPTS): Add discard_locals_test.sh.
13094 (check_DATA): Add discard_local_tests.syms.
13095 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13096 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13097 * testsuite/Makefile.in: Regenerate.
13098 * testsuite/discard_locals_test.c: New file.
13099 * testsuite/discard_locals_test.sh: Same.
13100
805bb01c
DK
131012009-06-05 Doug Kwan <dougkwan@google.com>
13102
13103 * object.cc (Sized_relobj::Sized_relobj): Initialize
13104 discarded_eh_frame_shndx_ to -1U.
13105 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13106 section.
13107 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13108 a discarded .eh_frame section.
13109 (Sized_relobj::do_finalize_local_symbols): Ditto.
13110 * object.h (class Sized_relobj): Declare new member
13111 discarded_eh_frame_shndx_.
13112 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13113 (local_labels_test.o, local_labels_test): New rules.
13114 * testsuite/Makefile.in: Regenerate.
13115
1dcd334d
DK
131162009-06-04 Doug Kwan <dougkwan@google.com>
13117
13118 * layout.cc (Layout::section_name_mapping): Add mapping for
13119 special ARM sections.
13120
96d49306
DK
131212009-06-03 Doug Kwan <dougkwan@google.com>
13122
13123 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13124 (utils::has_overflow): Same.
13125
dff16297
ILT
131262009-06-03 Ian Lance Taylor <iant@google.com>
13127
13128 * layout.cc (Layout::section_name_mapping): New array, replacing
13129 Layout::linkonce_mapping.
13130 (Layout::section_name_mapping_count): New variable, replacing
13131 Layout::linkonce_mapping_count.
13132 (Layout::linkonce_output_name): Remove.
13133 (Layout::output_section_name): Rewrite.
13134 * layout.h (class Layout): Rename Linkonce_mapping to
13135 Section_name_mapping, linkonce_mapping to section_name_mapping,
13136 linkonce_mapping_count to section_name_mapping_count. Don't
13137 declare linkonce_output_name.
13138
c121c671
DK
131392009-06-03 Doug Kwan <dougkwan@google.com>
13140
13141 * gold/arm.cc (namespace utils): New.
13142 (Target_arm::reloc_is_non_pic): Define new method.
13143 (class Arm_relocate_functions): New.
13144 (Target_arm::Relocate::relocate): Handle relocation types used by
13145 Android.
13146
07800fab
ILT
131472009-06-03 Ian Lance Taylor <iant@google.com>
13148
13149 * arm.cc (Target_arm::scan::global): Use || instead of |.
13150
c121c671
DK
131512009-06-02 Doug Kwan <dougkwan@google.com>
13152
13153 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13154 issued_non_pic_error_.
13155 (class Target_arm::Scan): Declare new method check_non_pic.
13156 Define new method symbol_needs_plt_entry.
13157 Declare new data member issued_non_pic_error_.
13158 (class Target_arm::Relocate): Declare new method
13159 should_apply_static_reloc.
13160 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13161 (Target_arm::Scan::check_non_pic): Define new method.
13162 (Target_arm::Scan::local): Handle a small subset of reloc types used
13163 by Android.
13164 (Target_arm::Scan::local): Same.
13165 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13166
b19b0c6d
ILT
131672009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13168
13169 * incremental.cc (Incremental_inputs::report_command_line): Filter
13170 out --incremental-* options.
13171
94cdfcff
DK
131722009-05-29 Doug Kwan <dougkwan@google.com>
13173
13174 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13175 template class.
13176 (class Target_arm): Update comment.
13177 (Target_arm::Target_arm): Initialize new data members GOT_,
13178 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13179 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13180 and Target_arm::rel_dyn_section.
13181 Declare new_enum Target_arm::Got_type.
13182 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13183 and DYNBSS_.
13184 Update commments for member do_dynsym_value.
13185 (Target_arm::got_size, Target_arm::plt_section,
13186 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13187 new methods inside class defintion.
13188 (Target_arm::got_section): Define new method.
13189 (Target_arm::rel_dyn_section): Same.
13190 (Output_data_plt_arm): New template class.
13191 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13192 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13193 (Output_data_plt_arm::add_entry): Same.
13194 (Output_data_plt_arm::first_plt_entry): Define new
13195 static data member for PLT instruction template.
13196 (Output_data_plt_arm::plt_entry): Same.
13197 (Output_data_plt_arm::do_write): Define new method.
13198 (Target_arm::make_plt_entry): Same.
13199 (Target_arm::do_finalize_sections): Same.
13200 (Target_arm::do_dynsym_value): Same.
13201
4a657b0d
DK
132022009-05-28 Doug Kwan <dougkwan@google.com>
13203
13204 * Makefile.am (TARGETSOURCES): Add arm.cc.
13205 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13206 * Makefile.in: Regenerate.
13207 * arm.cc: New file.
13208 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13209
e7ae8c36
DK
132102009-05-26 Doug Kwan <dougkwan@google.com>
13211
13212 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13213 (General_options::check_excluded_libs): Strip off directories in
13214 archive name before matching like GNU ld does.
13215 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13216 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13217 (exclude_libs_test_LDFLAGS): Add linker option
13218 -Wl,--exclude-libs,libexclude_libs_test_3
13219 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13220 an explicit archive without using -l.
13221 (alt/libexclude_libs_test_3.a): New make rule.
13222 * testsuite/Makefile.in: Regenerate.
13223 * testsuite/exclude_libs_test.c : Declare lib3_default().
13224 (main): Call it.
13225 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13226 * exclude_libs_test_3.c: New file.
13227
f12e7348
NC
132282009-05-26 Nick Clifton <nickc@redhat.com>
13229
13230 * po/id.po: New Indonesian translation.
13231 * po/gold.pot: Updated template file.
13232
4daadc0d
ST
132332009-05-22 Sriraman Tallam <tmsriram@google.com>
13234
e1df38aa 13235 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13236 gc_comdat_test files. Add -Wl,--gc-sections to build
13237 gc_comdat_test.
13238 * testsuite/Makefile.in: Regenerate.
13239 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13240
531813ad
ST
132412009-05-21 Sriraman Tallam <tmsriram@google.com>
13242
13243 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13244 kept comdat section was garbage collected.
13245 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13246 * testsuite/Makefile.in: Regenerate.
13247 * testsuite/gc_comdat_test.sh: New file.
13248 * testsuite/gc_comdat_test_1.cc: New file.
13249 * testsuite/gc_comdat_test_2.cc: New file.
13250
65514900
CC
132512009-05-19 Doug Kwan <dougkwan@google.com>
13252
13253 * archive.cc (Archive::Archive): Move constructor from archive.h
13254 to here. Initialize no_export_.
13255 (Archive::get_elf_object_for_member): Set no_export flag of object.
13256 * archive.h (Archive::Archive): Move constructor body to
13257 archive.cc.
13258 (Archive::no_export): New method.
13259 (Archive::no_export_): New field.
13260 * object.h (Object::Object): Initialize no_export_ to false.
13261 (Object::no_export, Object::set_no_export): New methods.
13262 (Object::no_export_): New field.
13263 * options.cc (General_options::parse_exclude_libs): New method.
13264 (General_options::check_excluded_libs) Same.
13265 * options.h (exclude_libs): New option.
13266 (General_options::check_excluded_libs): New method declaration.
13267 (General_options::excluded_libs_): New field.
13268 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13269 default or protected visibility if an object has no-export flag set.
13270 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13271 (check_SCRIPTS): Add exclude_libs_test.sh.
13272 (check_DATA): Add exclude_libs_test.syms.
13273 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13274 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13275 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13276 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13277 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13278 libexclude_libs_test_2.a): New rules.
13279 * testsuite/Makefile.in: Regenerate.
13280 * testsuite/exclude_libs_test.c: New file.
13281 * testsuite/exclude_libs_test.sh: Ditto.
13282 * testsuite/exclude_libs_test_1.c: Ditto.
13283 * testsuite/exclude_libs_test_2.c: Ditto.
13284
1b77ea50
ILT
132852009-05-15 Ian Lance Taylor <iant@google.com>
13286
13287 * configure.ac: Check for declarations for cases where libiberty.h
13288 checks HAVE_DECL_xxx.
13289 * configure, config.in: Rebuild.
13290
072fe7ce
ILT
132912009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13292
13293 * gold.h (Incremental_argument_list): Remove (invalid) forward
13294 declaration.
13295 * incremental.cc (Incremental_inputs::report_achive): New method.
13296 (Incremental_inputs::report_object): New method.
13297 (Incremental_inputs::report_script): New method.
13298 (Incremental_inputs::finalize_inputs): New method.
13299 (Incremental_inputs::finalize): Call finalize_inputs().
13300 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13301 Create inputs entries.
13302 * incremental.h (Incremental_input_type): New enum.
13303 (Incremental_inputs::Incremental_input): Initialize new fields.
13304 (Incremental_inputs::report_inputs): New method.
13305 (Incremental_inputs::report_achive): New method.
13306 (Incremental_inputs::report_object): New method.
13307 (Incremental_inputs::report_script): New method.
13308 (Incremental_inputs::finalize_inputs): New method.
13309 (Incremental_inputs::Input_info): New struct.
13310 (Incremental_inputs::Input_info_map): New typedef.
13311 (Incremental_inputs::lock_): New field.
13312 (Incremental_inputs::Inputs_): New field.
13313 (Incremental_inputs::Inputs_map): New field.
13314 * main.cc (main): Call Incremental_input::report_inputs.
13315 * options.h (Input_argument_list): Typedef moved from
13316 Input_arguments.
13317 (Input_file_group::Files): Remove, use ::Input_argument_list.
13318 (Input_file_group::Input_argument_list): Remove, use
13319 ::Input_argument_list.
13320 * plugin.cc (Plugin_manager::add_input_file): Add error in
13321 incremental build.
13322 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13323 functions.
13324 * script.cc (read_input_script): Call
13325 Incremental_input::report_script.
13326 * script.h (Script_info): New class.
13327
b0481b0b
ILT
133282009-04-27 Ian Lance Taylor <iant@google.com>
13329
13330 * x86_64.cc (do_adjust_output_section): Set entsize to
13331 plt_entry_size.
13332
b22a5a41 133332009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13334
13335 * output.cc (Output_file::close): After short writes, continue
13336 writing from the correct offset in the buffer being written.
13337
40fde488
CD
133382009-04-23 Chris Demetriou <cgd@google.com>
13339
13340 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13341 * configure: Regenerate.
13342 * config.in: Regenerate.
13343 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13344 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13345
3ce2c28e
ILT
133462009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13347
13348 * incremental.cc (Incremental_inputs_header_data): Renamed from
13349 Incremental_input_header_data.
13350 (Incremental_inputs_header_data::data_size): New field.
13351 (Incremental_inputs_header_data::put_input_file_count): Renamed
13352 from input_file_count.
13353 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13354 from command_line_offset.
13355 (Incremental_inputs_header_data::put_reserved): Renamed from
13356 put_reserved.
13357 (Incremental_inputs_entry_data): Renamed from
13358 Incremental_input_entry_data.
13359 (Incremental_inputs_entry_data::data_size): New field.
13360 (Incremental_inputs::report_command_line): New method.
13361 (Incremental_inputs::finalize): New method.
13362 (Incremental_inputs::create_incremental_inputs_data): New method.
13363 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13364 * incremental.h: New file.
13365 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13366 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13367 incremental builds.
703d02da 13368 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13369 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13370 (Layout::create_incremental_info_sections): New method.
13371 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13372 * main.cc (main): Notify Incremental_input of the command line.
13373
e55bde5e
ILT
133742009-04-01 Ian Lance Taylor <iant@google.com>
13375 Mikolaj Zalewski <mikolajz@google.com>
13376
13377 * gold.h (reserve_unordered_map): Define, three versions, one for
13378 each version of Unordered_map.
13379 * layout.cc (Layout::Layout): Remove options parameter. Add
13380 number_of_input_files parameter. Don't initialize options_.
13381 Initialize number_of_input_files_ and resized_signatures_. Move
13382 sections_are_attached_.
13383 (Layout::layout_group): Reserve space for group_signatures_.
13384 (Layout::find_or_add_kept_section): Change name parameter to be a
13385 reference. Resize signatures_ map when it gets large enough.
13386 (Layout::layout_eh_frame): Use parameters->options() instead of
13387 this->options_.
13388 (Layout::make_output_section): Likewise.
13389 (Layout::attach_allocated_section_to_segment): Likewise.
13390 (Layout::finalize, Layout::create_executable_stack): Likewise.
13391 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13392 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13393 * layout.h (class Layout): Update declarations. Remove options_
13394 field. Add number_of_input_files_ and resized_signatures_
13395 fields. Move sections_are_attached_ field.
13396 * main.cc (main): Pass number of input files to Layout
13397 constructor. Don't pass options.
13398
154b857c
ILT
133992009-03-30 Ian Lance Taylor <iant@google.com>
13400
13401 * ffsll.c (ffsll): Correct implementation.
13402
2f35ab9b
ILT
134032009-03-27 Ian Lance Taylor <iant@google.com>
13404
fd03461a
ILT
13405 * ffsll.c: New file.
13406 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13407 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13408 * ftruncate.c (ftruncate): Declare before definition.
13409 * mremap.c (mremap): Likewise.
13410 * pread.c (pread): Likewise.
13411 * configure, Makefile.in, config.in: Rebuild.
13412
2f35ab9b
ILT
13413 * mremap.c: New file.
13414 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13415 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13416 (mremap): Declare if HAVE_MREMAP is not defined.
13417 * configure, Makefile.in, config.in: Rebuild.
13418
33aea2fd
CC
134192009-03-27 Cary Coutant <ccoutant@google.com>
13420
13421 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13422 position independent.
13423 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13424 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13425
6d479619
CC
134262009-03-24 Cary Coutant <ccoutant@google.com>
13427
13428 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13429 an executable.
13430 (needs_dynamic_reloc): Likewise.
13431
afc06bb8
ILT
134322009-03-24 Ian Lance Taylor <iant@google.com>
13433
13434 * yyscript.y (file_cmd): Recognize EXTERN.
13435 (extern_name_list, extern_name_list_body): New nonterminals.
13436 * script.cc (script_add_extern): Define.
13437 * script-c.h (script_add_extern): Declare.
13438
f6060a4d
ILT
134392009-03-24 Rafael Avila de Espindola <espindola@google.com>
13440
13441 * object.cc (is_elf_object): Define.
13442 * object.h (is_elf_object): Declare.
13443 * archive.cc (Archive::get_elf_object_for_member): Call
13444 is_elf_object.
33aea2fd 13445 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13446
26736d8e
ILT
134472009-03-24 Elliott Hughes <enh@google.com>
13448
13449 * output.cc (Output_file::map_anonymous): Define.
13450 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13451 try an anonymous one. Report the size if the mmap fails.
13452 * output.h (class Output_file): Declare map_anonymous.
13453
22fd9730
ILT
134542009-03-24 Ian Lance Taylor <iant@google.com>
13455
13456 * target-select.cc (instantiate_target): Don't acquire the lock if
13457 the instantiated_target_ field has already been set.
13458
cb010894
ILT
134592009-03-23 Ian Lance Taylor <iant@google.com>
13460
7f055c20
ILT
13461 * gold-threads.h (class Initialize_lock): Define.
13462 * gold-threads.cc (class Initialize_lock_once): Define.
13463 (initialize_lock_control): New static variable.
13464 (initialize_lock_pointer): New static variable.
13465 (initialize_lock_once): New static function.
13466 (Initialize_lock::Initialize_lock): Define.
13467 (Initialize_lock::initialize): Define.
13468 * target-select.h: Include "gold-threads.h".
13469 (class Target_selector): Add lock_ and initialize_lock_ fields.
13470 Don't define instantiate_target, just declare it.
13471 * target-select.cc (Target_selector::Target_selector): Initialize
13472 new fields.
13473 (Target_selector::instantiate_target): Define.
13474 * descriptors.h: Include "gold-threads.h".
13475 (class Descriptors): Add initialize_lock_ field.
13476 * descriptors.cc (Descriptors::Descriptors): Initialize new
13477 field.
13478 (Descriptors::open): Use initialize_lock_ field
13479 * errors.h (class Errors): Add initialize_lock_ field.
13480 * errors.cc (Errors::Errors): Initialize new field.
13481 (Errors::initialize_lock): Use initialize_lock_ field.
13482 * powerpc.cc (class Target_selector_powerpc): Remove
13483 instantiated_target_ field. In do_recognize call
13484 instantiate_target rather than do_instantiate_target. In
13485 do_instantiate_target just allocate a new target.
13486 * sparc.cc (class Target_selector_sparc): Likewise.
13487
36959681
ILT
13488 * freebsd.h: New file.
13489 * i386.cc: Include "freebsd.h".
13490 (Target_i386): Derive from Target_freebsd rather than
13491 Sized_target.
13492 (Target_selector_i386): Derive from Target_selector_freebsd rather
13493 than Target_selector.
13494 * x86_64.cc: Include "freebsd.h".
13495 (Target_x86_64): Derive from Target_freebsd rather than
13496 Sized_target.
13497 (Target_selector_x86_64): Derive from Target_selector_freebsd
13498 rather than Target_selector.
13499 * target.h (class Target): Add adjust_elf_header and
13500 do_adjust_elf_header.
13501 * output.cc (Output_file_header:: do_sized_write): Call target
13502 adjust_elf_header routine.
13503 * configure.tgt: Set targ_osabi.
13504 * configure.ac: Define GOLD_DEFAULT_OSABI.
13505 * parameters.cc (Parameters::default_target): Pass
13506 GOLD_DEFAULT_OSABI to select_target.
13507 * target-select.h (class Target_selector): Make instantiate_target
13508 protected rather than private.
13509 * Makefile.am (HFILES): Add freebsd.h.
13510 * configure, Makefile.in, config.in: Rebuild.
13511
cb010894
ILT
13512 * merge.cc (do_add_input_section): Correct pend value. Change
13513 message about last entry not being null terminated from error to
13514 warning.
13515
0e879927
ILT
135162009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13517
13518 * incremental.cc: New file.
13519 * Makefile.am (CCFILES): Add incremental.cc.
13520 * Makefile.in: Rebuild.
13521
41105937
PP
135222009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13523
13524 * layout.cc (Layout::output_section_name): Preserve names
13525 of '.note.' sections.
e1df38aa 13526
60439920
ILT
135272009-03-19 Ian Lance Taylor <iant@google.com>
13528
13529 * descriptors.cc (Descriptors::open): Check that the options are
13530 valid before using them.
13531
0d371ad3
ILT
135322009-03-18 Ian Lance Taylor <iant@google.com>
13533
13534 * script-sections.h: Include <list>.
13535 (class Script_sections): Change Sections_elements from std::vector
13536 to std::list. Typedef public Elements_iterator. Add
13537 orphan_section_placement_, data_segment_align_start_, and
13538 saw_data_segment_align_ fields. Remove data_segment_align_index_
13539 field.
13540 * script-sections.cc (class Orphan_section_placement): New class.
13541 (class Sections_element): Add virtual functions is_relro and
13542 orphan_section_init. Remove virtual function place_orphan_here.
13543 (class Output_section_definition): Add is_relro and
13544 orphan_section_init. Remove place_orphan_here.
13545 (class Orphan_output_section): Likewise.
13546 (Script_sections::Script_sections): Update for field changes.
13547 (Script_sections::data_segment_align): Set saw_data_segment_align_
13548 and data_segment_align_start_, not data_segment_align_index.
13549 (Script_sections::data_segment_relro_end): Check
13550 saw_data_segment_align_. Use data_segment_align_start_ rather
13551 than data_segment_align_index_.
13552 (Script_sections::place_orphan): Rewrite to use
13553 Orphan_section_placement.
13554
9201d894
ILT
135552009-03-17 Ian Lance Taylor <iant@google.com>
13556
9c5b8369
ILT
13557 * archive.cc (Archive::add_symbols): Check for a version attached
13558 to the symbol name in the archive map.
13559 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13560 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13561 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13562 (ver_test_11.a): New target.
13563 * testsuite/Makefile.in: Rebuild.
13564
9201d894
ILT
13565 * configure.ac: Check for chsize and posix_fallocate. Replace
13566 ftruncate.
13567 * ftruncate.c: New file, from gnulib.
13568 * output.cc (posix_fallocate): Define dummy version if not
13569 HAVE_POSIX_FALLOCATE.
13570 (Output_file::map): Call posix_fallocate rather than lseek and
13571 write.
13572 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13573 * configure, Makefile.in, config.in: Rebuild.
13574
ef4ab7a8 135752009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13576
ef4ab7a8
PP
13577 * layout.h (Layout::create_note): Add section_name parameter.
13578 * layout.cc (Layout::create_note): Likewise.
13579 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13580
8c500701
ILT
135812009-03-17 Ian Lance Taylor <iant@google.com>
13582
e85b18e1
ILT
13583 * descriptors.cc: Include "options.h".
13584 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13585 (Descriptors::open): Always use O_CLOEXEC when opening a new
13586 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13587 then set FD_CLOEXEC.
13588
9efe6174
ILT
13589 * sparc.cc (class Target_sparc): Add has_got_section.
13590 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13591 make sure we have a GOT section.
13592
13593 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13594 (Target_sparc::Scan::local): Likewise.
13595 (Target_sparc::Scan::global): Likewise.
13596 (Target_sparc::Relocate::relocate): Likewise.
13597 (Target_sparc::Relocate::relocate_tls): Likewise.
13598
8c500701
ILT
13599 * symtab.cc (Symbol_table::define_default_version): New function,
13600 broken out of add_from_object.
13601 (Symbol_table::add_from_object): Call define_default_version.
13602 (Symbol_table::define_special_symbol): Add resolve_oldsym
13603 parameter. Change all callers. If the version for a symbol comes
13604 from a version script, resolve it with the symbol with the same
13605 name with no version. Also add the symbol without a version if
13606 appropriate.
13607 (do_define_in_output_data): If resolving with oldsym, don't delete
13608 sym.
13609 (do_define_in_output_segment): Likewise.
13610 (do_define_as_constant): Likewise.
13611 * symtab.h (class Symbol_table): Update declarations.
13612
f1ed28fb
ILT
136132009-03-13 Ian Lance Taylor <iant@google.com>
13614
15f8229b
ILT
13615 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13616 (Read_symbols::requeue): New function.
13617 (Read_symbols::do_read_symbols): If make_elf_object fails because
13618 the target type is not configured, and the file was searched for,
13619 issue a warning and retry with the next directory.
13620 (Add_symbols::run): If the file has an incompatible format, and
13621 it was searched for, requeue the Read_symbols task. On error,
13622 release the object.
13623 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13624 dirindex parameter to constructor. Change all callers. Declare
13625 incompatible_warning and requeue.
13626 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13627 input_argument_ and input_group_ fields. Add them to
13628 constructor. Change all callers.
13629 (class Read_script): Add dirindex_ field. Add it to constructor.
13630 Change all callers.
13631 * archive.cc (Archive::setup): Remove input_objects parameter.
13632 Change all callers.
13633 (Archive::get_file_and_offset): Likewise.
13634 (Archive::read_all_symbols): Likewise.
13635 (Archive::read_symbols): Likewise.
13636 (Archive::get_elf_object_for_member): Remove input_objects
13637 parameter. Add punconfigured parameter. Change all callers.
13638 (Archive::add_symbols): Change return type to bool. Check return
13639 value of include_member.
13640 (Archive::include_all_members): Likewise.
13641 (Archive::include_member): Change return type to bool. Return
13642 false if first included object has incompatible target. Set
13643 included_member_ field.
13644 (Add_archive_symbols::run): If add_symbols returns false, requeue
13645 Read_symbols task.
13646 * archive.h (class Archive): Add included_member_ field.
13647 Initialize it in constructor. Add input_file and searched_for
13648 methods. Update declarations.
13649 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13650 input_argument_ fields. Add them to constructor. Change all
13651 callers.
13652 * script.cc: Include "target-select.h".
13653 (class Parser_closure): Add skip_on_incompatible_target_ and
13654 found_incompatible_target_ fields. Add
13655 skip_on_incompatible_target parameter to constructor. Change all
13656 callers. Add methods skip_on_incompatible_target,
13657 clear_skip_on_incompatible_target, found_incompatible_target, and
13658 set_found_incompatible_target.
13659 (read_input_script): Add dirindex parameter. Change all callers.
13660 If parser finds an incompatible target, requeue Read_symbols
13661 task.
13662 (script_set_symbol): Clear skip_on_incompatible_target in
13663 closure.
13664 (script_add_assertion, script_parse_option): Likewise.
13665 (script_start_sections, script_add_phdr): Likewise.
13666 (script_check_output_format): New function.
13667 * script.h (read_input_script): Update declaration.
13668 * script-c.h (script_check_output_format): Declare.
13669 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13670 (ignore_cmd): Remove OUTPUT_FORMAT.
13671 * fileread.cc (Input_file::Input_file): Add explicit this.
13672 (Input_file::will_search_for): New function.
13673 (Input_file::open): Add pindex parameter. Change all callers.
13674 * fileread.h (class Input_file): Add input_file_argument method.
13675 Declare will_search_for. Update declarations.
13676 * object.cc (make_elf_object): Add punconfigured parameter.
13677 Change all callers.
13678 * object.h (class Object): Make input_file public. Add
13679 searched_for method.
13680 (make_elf_object): Update declaration.
13681 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13682 restart search.
13683 * dirsearch.h (class Dirsearch): Update declaration.
13684 * options.h (class General_options): Add --warn-search-mismatch.
13685 * parameters.cc (Parameters::is_compatible_target): New function.
13686 * parameters.h (class Parameters): Declare is_compatible_target.
13687 * workqueue.cc (Workqueue::add_blocker): New function.
13688 * workqueue.h (class Workqueue): Declare add_blocker.
13689
f1ed28fb
ILT
13690 * fileread.cc (Input_file::open): Remove options parameter.
13691 Change all callers.
13692 (Input_file::open_binary): Likewise.
13693 * script.cc (read_input_script): Likewise.
13694 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13695 options parameter from constructor. Change all callers.
13696 (class Read_script): Likewise.
13697 * fileread.h (class Input_file): Update declarations.
13698 * script.h (read_input_script): Update declaration.
13699
34dd024a
NC
137002009-03-10 Nick Clifton <nickc@redhat.com>
13701
13702 * po/es.po: New Spanish translation.
13703
6d71b17c
CC
137042009-03-06 Cary Coutant <ccoutant@google.com>
13705
13706 * options.cc (parse_short_option): Keep dash_z from registering itself.
13707
031cdbed
ILT
137082009-03-03 Ian Lance Taylor <iant@google.com>
13709
13710 PR 9918
13711 * target-reloc.h (relocate_section): Pass output_section to
13712 relocate.
13713 * i386.cc (Target_i386::should_apply_static_reloc): Add
13714 output_section parameter. Change all callers.
13715 (Target_i386::Relocate::relocate): Add output_section parameter.
13716 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13717 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13718 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13719 * testsuite/two_file_shared.sh: New script.
13720 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13721 (check_DATA): Add two_file_shared.dbg.
13722 (two_file_shared.dbg): New target.
13723 * testsuite/Makefile.in: Rebuild.
13724
15d5fa16
ILT
137252009-03-01 Ian Lance Taylor <iant@google.com>
13726
13727 * configure.ac: Check for byteswap.h.
13728 * configure: Rebuild.
13729 * config.in: Rebuild.
13730
8a4c0b0d
ILT
137312009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13732
13733 * layout.cc (Layout::find_or_add_kept_section): New function.
13734 (Layout::add_comdat): Removed.
13735 * layout.h (struct Kept_section): Move out of class Layout.
13736 Remove trailing underscores from field names. Add group_sections
13737 field. Rename group_ field to is_group. Change all uses.
13738 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13739 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13740 comdat_groups_ field.
13741 (Sized_relobj::include_section_group): Use
13742 find_or_add_kept_section and Kept_section::group_sections.
13743 (Sized_relobj::include_linkonce_section): Likewise.
13744 * object.cc (class Sized_relobj): Don't define Comdat_group or
13745 Comdat_group_table. Remove find_comdat_group and
13746 add_comdat_group. Remove comdat_groups_ field.
13747 * plugin.cc (include_comdat_group): Use
13748 Layout::find_or_add_kept_section.
13749
b4ecf66b
ILT
137502009-02-28 Ian Lance Taylor <iant@google.com>
13751
14359ca0
ILT
13752 * README: --gc-sections and map files are now supported. Document
13753 some build requirements.
13754
b4ecf66b
ILT
13755 PR 6992
13756 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13757 relocatable link set the value of the section symbol to zero.
13758 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13759 relocatable link don't include the section address in the local
13760 symbol value.
13761
0602e05a
ILT
137622009-02-27 Ian Lance Taylor <iant@google.com>
13763
fd9d194f
ILT
13764 PR 6811
13765 * options.h (class Search_directory): Add is_system_directory.
13766 (class General_options): Declare is_in_system_directory.
13767 * options.cc (get_relative_sysroot): Make static.
13768 (get_default_sysroot): Make static.
13769 (General_optoins::is_in_system_directory): New function.
13770 * fileread.cc (Input_file::is_in_system_directory): New function.
13771 * fileread.h (class Input_file): Declare is_in_system_directory.
13772 * object.h (class Object): Add is_in_system_directory.
13773 (class Input_objects): Remove system_library_directory_ field.
13774 * object.cc (Input_objects::add_object): Don't set
13775 system_library_directory_.
13776 (input_objects::found_in_system_library_directory): Remove.
13777 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13778 parameter. Change all callers.
13779 (Symbol_table::sized_write_globals): Likewise.
13780 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13781 Call Object::is_in_system_directory.
13782 * symtab.h (class Symbol_table): Update declarations.
13783
61edd21f
ILT
13784 PR 5990
13785 * descriptors.h (Open_descriptor): Add is_on_stack field.
13786 * descriptors.cc (Descriptors::open): If the descriptor is on the
13787 top of the stack, remove it. Initialize is_on_stack field.
13788 (Descriptors::release): Only add pod to stack if it is not on the
13789 stack already.
13790 (Descriptors::close_some_descriptor): Clear stack_next and
13791 is_on_stack fields.
13792
e29e076a
ILT
13793 PR 7091
13794 * output.cc (Output_section::find_starting_output_address): Rename
13795 from starting_output_address; add PADDR parameter; change return
13796 type.
13797 * output.h (class Output_section): Declare
13798 find_starting_output_address instead of starting_output_address.
13799 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13800 section symbol for which we can't find a merge section.
13801
0602e05a
ILT
13802 PR 9836
13803 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13804 hidden or internal, force the symbol to be local.
13805 * resolve.cc (Symbol::override_visibility): Define.
13806 (Symbol::override_base): Use override_visibility.
13807 (Symbol_table::resolve): Likewise.
13808 (Symbol::override_base_with_special): Likewise.
13809 (Symbol_table::override_with_special): If the visibility is hidden
13810 or internal, force the symbol to be local.
13811 * symtab.h (class Symbol): Add set_visibility and
13812 override_visibility.
13813 * testsuite/ver_test_1.sh: New file.
13814 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13815 (check_DATA): Add ver_test_1.syms.
13816 (ver_test_1.syms): New target.
13817 * testsuite/Makefile.in: Rebuild.
13818
401a9a73
CC
138192009-02-25 Cary Coutant <ccoutant@google.com>
13820
13821 * layout.cc (Layout::choose_output_section): Don't rename sections
13822 when using a linker script that has a SECTIONS clause.
13823 * Makefile.in: Regenerate.
13824
13825 * testsuite/Makefile.am (script_test_5.sh): New test case.
13826 * testsuite/Makefile.in: Regenerate.
13827 * testsuite/script_test_5.cc: New file.
13828 * testsuite/script_test_5.sh: New file.
13829 * testsuite/script_test_5.t: New file.
13830
f488e4b0
CC
138312009-02-13 Rafael Avila de Espindola <espindola@google.com>
13832
13833 * archive.cc (Archive::include_member): Update calls to add_symbols.
13834 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13835 the Layout argument.
13836 * dynobj.h (do_add_symbols): Add the Layout argument.
13837 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13838 Layout argument.
13839 * object.h (Object::add_symbols): Add the Layout argument.
13840 (Object::do_add_symbols): Add the Layout argument.
13841 (Sized_relobj::do_add_symbols): Add the Layout argument.
13842 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13843 Unify the two versions.
13844 (Add_plugin_symbols): Remove.
13845 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13846 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13847 (Add_plugin_symbols): Remove.
13848 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13849 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13850 (Add_symbols::run): Make it work with Pulginobj.
13851
89dd1680
ILT
138522009-02-06 Ian Lance Taylor <iant@google.com>
13853
13854 * object.cc (Sized_relobj::do_layout): Make info message start
13855 with lower case letter.
13856
266d0a74
ILT
138572009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13858
602b464e
ILT
13859 * binary.cc: Fix file comment.
13860
266d0a74
ILT
13861 * options.h (enum Incremental_disposition): Define.
13862 (class General_options): Add new options: --incremental,
13863 --incremental_changed, --incremental_unchanged,
13864 --incremental_unknown. Add incremental_disposition_ and
13865 implicit_incremental_ fields.
13866 (General_options::incremental_disposition): New function.
13867 (class Position_dependent_options): Add incremental_disposition
13868 option.
13869 (Position_dependent_options::copy_from_options): Set incremental
13870 dispositions.
13871 * options.cc (General_options::parse_incremental_changed): New
13872 function.
2e702c99
RM
13873 (General_options::parse_incremental_unchanged): New function.
13874 (General_options::parse_incremental_unknown): New function.
13875 (General_options::General_options): Initialize new fields
266d0a74 13876 incremental_disposition_ and implicit_incremental_.
2e702c99 13877 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13878 without --incremental.
13879
f073bbf7
CD
138802009-02-06 Chris Demetriou <cgd@google.com>
13881
13882 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13883 pointer and to report location as the file name associated with
13884 the symbol.
13885 (gold_undefined_symbol_at_location): New function to replace the
13886 old gold_undefined_symbol functionality.
13887 * target-reloc.h (relocate_section): Update to use
13888 gold_undefined_symbol_at_location.
13889 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13890 Call gold_undefined_symbol function rather than gold_error.
13891 * errors.h (Errors::undefined_symbol): Take location as a
13892 string, rather than calculating it from a relocation.
13893 * errors.cc (Errors::fatal): Print "fatal error:" before the
13894 formatted message.
13895 (Errors::error, Errors::error_at_location): Print "error: "
13896 before the formatted message.
13897 (Errors::undefined_symbol): Take location as a string, rather
13898 than calculating it from a relocation.
13899 (gold_undefined_symbol_at_location): New function akin to
13900 old gold_undefined_symbol, calculates location from relocation.
13901 (gold_undefined_symbol): Change to take only a Symbol pointer
13902 and to report location as the file name associated with the symbol.
13903 * testsuite/debug_msg.sh: Update for changed error messages.
13904 * testsuite/undef_symbol.sh: Likewise.
13905
8e94a90c
ILT
139062009-02-04 Duncan Sands <baldrick@free.fr>
13907
13908 PR 9812
13909 * reduced_debug_output.h
13910 (Output_reduced_debug_abbrev_section::failed): Use format for
13911 gold_warning.
13912 (Output_reduced_debug_info_section::faild): Likewise.
13913
88a0e15b
ILT
139142009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13915
13916 * script.cc (Lazy_demangler): New class.
2e702c99 13917 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13918 symbol only once.
13919
5efc7cd2
CC
139202009-01-29 Cary Coutant <ccoutant@google.com>
13921
13922 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13923 to __tls_get_addr.
13924 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13925
e0ebcf42
ILT
139262009-01-28 Ian Lance Taylor <iant@google.com>
13927
5efc7cd2 13928 * version.cc (version_string): Bump to 1.9.
75fe7426 13929
e0ebcf42
ILT
13930 * gold.h: Include <cstring> and <stdint.h>.
13931 * version.cc: Include <cstdio>.
13932 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13933 warning.
13934 * reduced_debug_output.cc (insert_into_vector): Rename from
13935 Insert_into_vector; change all callers. Use Swap_unaligned to
13936 avoid aliasing issue; remove union since it is unnecessary.
13937
8e2813be 139382009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13939
13940 * Makefile.am (CCFILES): Add gc.cc.
13941 (HFILES): Add gc.h.
13942 * Makefile.in: Regenerate.
13943 * gold.cc (Gc_runner): New class.
13944 (queue_initial_tasks): Call garbage collection related tasks
13945 when corresponding options are invoked.
13946 (queue_middle_gc_tasks): New function.
13947 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13948 processed early before laying out sections during garbage collection.
13949 * gold.h (queue_middle_gc_tasks): New function.
13950 (is_prefix_of): Move from "layout.cc".
13951 * i386.cc (Target_i386::gc_process_relocs): New function.
13952 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13953 * main.cc (main): Create object of class "Garbage_collection".
13954 * object.cc (Relobj::copy_symbols_data): New function.
13955 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13956 (Sized_relobj::do_layout): Allow this function to be called twice
13957 during garbage collection and defer layout of section during the
6d03d481
ST
13958 first call.
13959 * object.h (Relobj::get_symbols_data): New function.
13960 (Relobj::is_section_name_included): New function.
13961 (Relobj::copy_symbols_data): New function.
13962 (Relobj::set_symbols_data): New function.
13963 (Relobj::get_relocs_data): New function.
13964 (Relobj::set_relocs_data): New function.
13965 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13966 (Relobj::gc_process_relocs): New function.
13967 (Relobj::do_gc_process_relocs): New pure virtual function.
13968 (Relobj::sd_): New data member.
13969 (Sized_relobj::is_output_section_offset_invalid): New function.
13970 (Sized_relobj::do_gc_process_relocs): New function.
13971 * options.h (General_options::gc_sections): Modify to not be a no-op.
13972 (General_options::print_gc_sections): New option.
13973 * plugin.cc (Plugin_finish::run): Remove function call to
13974 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13975 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13976 * reloc.cc (Read_relocs::run): Add task to process relocs and
13977 determine unreferenced sections when doing garbage collection.
13978 (Gc_process_relocs): New class.
13979 (Sized_relobj::do_gc_process_relocs): New function.
13980 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13981 sections that are garbage collected.
13982 * reloc.h (Gc_process_relocs): New class.
13983 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13984 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13985 symbols whose corresponding sections are garbage collected.
13986 (Symbol_table::Symbol_table): Add new parameter for the garbage
13987 collection object.
13988 (Symbol_table::gc_mark_undef_symbols): New function.
13989 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13990 (Symbol_table::gc_mark_dyn_syms): New function.
13991 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13992 as garbage.
13993 (Symbol_table::add_from_object): Likewise.
13994 (Symbol_table::add_from_relobj): When building shared objects, do not
13995 treat externally visible symbols as garbage.
13996 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13997 table information for static and relocatable links.
13998 * symtab.h (Symbol_table::set_gc): New function.
13999 (Symbol_table::gc): New function.
14000 (Symbol_table::gc_mark_undef_symbols): New function.
14001 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14002 (Symbol_table::gc_mark_dyn_syms): New function.
14003 (Symbol_table::gc_): New data member.
e1df38aa 14004 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14005 function.
14006 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14007 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14008
3b293544
CF
140092009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14010
14011 * options.h (General_options::gc_sections): Define as a no-op for now.
14012 (General_options::no_keep_memory): Ditto.
14013 (General_options::Bshareable): Define.
14014 * options.cc (General_options::finalize): Honor -Bshareable.
14015
83d22aa8
AS
140162009-01-20 Andreas Schwab <schwab@suse.de>
14017
14018 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14019 read the value in the contents, since we don't use it. Use the
14020 template endianness when writing.
14021 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14022
cd536b21
AS
140232009-01-19 Andreas Schwab <schwab@suse.de>
14024
14025 * configure.tgt (powerpc64-*): Fix targ_obj.
14026
99e9a495
ILT
140272009-01-15 Ian Lance Taylor <iant@google.com>
14028
14029 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14030 local symbols when stripping all symbols.
14031
bbbfea06
CC
140322009-01-14 Cary Coutant <ccoutant@google.com>
14033
99e9a495 14034 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14035
0f7c0701
CC
140362009-01-14 Cary Coutant <ccoutant@google.com>
14037
14038 * archive.cc (Archive::get_elf_object_for_member): Remove call
14039 to File_read::claim_for_plugin.
14040 * descriptors.cc (Descriptors::open): Remove reference to
14041 is_claimed.
14042 (Descriptors::claim_for_plugin): Remove.
14043 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14044 (Descriptors::is_claimed): Remove.
14045 (claim_descriptor_for_plugin): Remove.
14046 * fileread.cc (File_read::claim_for_plugin): Remove.
14047 * fileread.h (File_read::claim_for_plugin): Remove.
14048 (File_read::descriptor): Reopen descriptor if necessary.
14049 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14050 (Plugin_manager::all_symbols_read): Add task parameter. Change
14051 all callers.
14052 (Plugin_manager::get_input_file): New function.
14053 (Plugin_manager::release_input_file): New function.
14054 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14055 corresponding data member.
14056 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14057 and pass to base constructor. Change all callers.
14058 (get_input_file, release_input_file): New functions.
14059 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14060 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14061 (Plugin_manager::all_symbols_read): Add task parameter.
14062 (Plugin_manager::get_input_file): New function.
14063 (Plugin_manager::release_input_file): New function.
14064 (Plugin_manager::task_): New data member.
14065 (Pluginobj::Pluginobj): Add filesize parameter.
14066 (Pluginobj::filename): New function.
14067 (Pluginobj::descriptor): New function.
14068 (Pluginobj::filesize): New function.
14069 (Pluginobj::filesize_): New data member.
14070 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14071 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14072 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14073
14074 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14075 with archive libraries.
14076 * testsuite/Makefile.in: Regenerate.
14077 * testsuite/plugin_test.c (struct sym_info): New type.
14078 (get_input_file, release_input_file): New static variables.
14079 (onload): Capture new transfer vector entries.
14080 (claim_file_hook): Stop reading at end of file according to filesize.
14081 Factor out parsing of readelf output into separate function.
14082 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14083 APIs and get the source file name from the symbol table. Convert
14084 source file name to corresponding object file name. Print info
14085 message when adding new input files.
14086 (parse_readelf_line): New function.
14087 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14088 * testsuite/plugin_test_2.sh: Likewise.
14089 * testsuite/plugin_test_3.sh: Likewise.
14090 * testsuite/plugin_test_4.sh: New test case.
14091
62a6d109
ILT
140922009-01-07 Ian Lance Taylor <iant@google.com>
14093
14094 * version.cc (version_string): Bump to 1.8.
14095
483620e8
CC
140962008-12-23 Cary Coutant <ccoutant@google.com>
14097
14098 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14099 * plugin.cc (Plugin_manager::finish): Rename as
14100 layout_deferred_objects. Move cleanup to separate function.
14101 (Plugin_manager::cleanup): New function.
14102 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14103 separately.
14104 * plugin.h (Plugin_manager::finish): Rename as
14105 layout_deferred_objects.
14106 (Plugin_manager::cleanup): New function.
14107 (Plugin_manager::cleanup_done): New field.
14108
d66a9eb3
CC
141092008-12-23 Cary Coutant <ccoutant@google.com>
14110
14111 * plugin.cc (is_visible_from_outside): New function.
14112 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14113 so we don't return "IR only" status for exported symbols or -r links.
14114
14115 * testsuite/Makefile.am (plugin_test_3): New test case.
14116 * testsuite/Makefile.in: Regenerate.
14117 * testsuite/plugin_test_3.sh: New file.
14118
5995b570
CC
141192008-12-22 Cary Coutant <ccoutant@google.com>
14120
14121 * object.cc (Sized_relobj::layout_section): New function.
14122 (Sized_relobj::do_layout): Defer layout of input sections until after
14123 plugin has provided replacement files.
14124 (Sized_relobj::do_layout_deferred_sections): New function.
14125 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14126 (Relobj::layout_deferred_sections): New function.
14127 (Relobj::do_layout_deferred_sections): New function.
14128 (Sized_relobj::do_layout_deferred_sections): New function.
14129 (Sized_relobj::layout_section): New function.
14130 (Sized_relobj::Deferred_layout): New structure.
14131 (Sized_relobj::deferred_layout_): New field.
14132 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14133 Change all callers. Layout deferred sections.
14134 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14135 references.
14136 (Plugin_hook::run): Move code from do_plugin_hook inline.
14137 (Plugin_hook::do_plugin_hook): Remove.
14138 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14139 (Plugin_manager::finish): Renamed, was cleanup.
14140 (Plugin_manager::should_defer_layout): New function.
14141 (Plugin_manager::add_deferred_layout_object): New function.
14142 (Plugin_manager::Deferred_layout_list): New type.
14143 (Plugin_manager::deferred_layout_objects_): New field.
14144 (Plugin_hook::do_plugin_hook): Remove.
14145
ee769c88
ILT
141462008-12-17 Ian Lance Taylor <iant@google.com>
14147
14148 * options.h (class General_options): Add --no case for
14149 --export-dynamic.
14150
abc8dcba
CC
141512008-12-16 Cary Coutant <ccoutant@google.com>
14152
14153 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14154 vector.
14155 (Plugin_manager::claim_file): Create plugin object even if
14156 plugin did not call the add_symbols callback.
14157 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14158 asking for more symbols than were added.
14159 * testsuite/Makefile.am (plugin_test_1): Add test case with
14160 no global symbols.
14161 (empty.syms): New target.
14162 * testsuite/Makefile.in: Regenerate.
14163 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14164 message. Don't call add_symbols if no globals.
14165 (all_symbols_read_hook): Don't provide replacement for empty
14166 claimed file.
14167
b0074644
ILT
141682008-12-12 Ian Lance Taylor <iant@google.com>
14169
68943102
ILT
14170 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14171 r_type == 0 for a local symbol with r_sym == 0.
14172 (scan_relocatable_relocs): Pass r_sym to
14173 local_non_section_strategy.
14174 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14175 r_sym parameter.
14176
b0074644
ILT
14177 * configure.ac: Update test for TLS descriptors: they are
14178 supported as of glibc 2.9.
14179 * configure: Rebuild.
14180
c2508178
ILT
141812008-12-11 Ian Lance Taylor <iant@google.com>
14182
14183 PR 7091
14184 * target-reloc.h (Default_scan_relocatable_relocs): For each
14185 function, map r_type == 0 to RELOC_DISCARD.
14186
2756a258
CC
141872008-12-10 Cary Coutant <ccoutant@google.com>
14188
14189 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14190 object to override a kept COMDAT group from a plugin object.
14191
bb6f53d3
ILT
141922008-12-09 Ian Lance Taylor <iant@google.com>
14193
fbc558e1
ILT
14194 PR 7088
14195 * yyscript.y (file_cmd): Handle INPUT.
14196
bb6f53d3
ILT
14197 * testsuite/initpri1.c: Change all declarations to be full
14198 prototypes by adding void, to avoid compiler warnings.
14199
4674ecfc
CC
142002008-12-05 Rafael Avila de Espindola <espindola@google.com>
14201
14202 * options.cc (General_options::parse_plugin_opt): New.
14203 (General_options::add_plugin): The argument now is just the filename.
14204 (General_options::add_plugin_option): New.
14205 * options.h (plugin_opt): New.
14206 (add_plugin): Change argument name.
14207 (add_plugin_option): New.
14208 * plugin.cc (Plugin::load): Don't parse the plugin option.
14209 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14210 (Plugin::add_option): New.
14211 (Plugin::args_): Change type.
14212 (Plugin::filename_): New.
14213 (Plugin_manager::add_plugin_option): New.
14214 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14215 * testsuite/Makefile.in: Regenerate.
14216
fd06b4aa
CC
142172008-12-05 Cary Coutant <ccoutant@google.com>
14218
14219 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14220 Handle --strip-lto-sections option.
14221 * options.h (strip_lto_sections): New option.
14222
6c52134c
CC
142232008-12-01 Cary Coutant <ccoutant@google.com>
14224
14225 * plugin.cc (ld_plugin_message): Change format parameter to const.
14226 Fix mismatch between new[] and delete.
14227
a45248e0
CC
142282008-11-14 Cary Coutant <ccoutant@google.com>
14229
14230 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14231 instead of -1U.
14232
c82fbeee
CS
142332008-11-05 Craig Silverstein <csilvers@google.com>
14234
14235 * options.cc (General_options::parse_dynamic_list): New function.
14236 * options.h (General_options): New flags dynamic_list,
14237 dynamic_list_data, dynamic_list_cpp_new, and
14238 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14239 (General_options::in_dynamic_list): New function.
14240 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14241 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14242 (Lex::can_continue_name): Likewise.
14243 (yylex): Likewise.
14244 (read_script_file): New parameter script_options.
14245 (read_dynamic_list): New function.
14246 (Script_options::define_dynamic_list): New function.
14247 (dynamic_list_keyword_parsecodes): New variable.
14248 (dynamic_list_keywords): New variable.
14249 * script.h (Script_options::define_dynamic_list): New function
14250 prototype.
14251 (read_dynamic_list): New function prototype.
14252 * symtab.cc (strprefix): New macro.
14253 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14254 dynamic_list_data, dynamic_list_cpp_new, and
14255 dynamic_list_cpp_typeinfo.
14256 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14257 (dynamic_list_expr): New rule.
14258 (dynamic_list_nodes): Likewise.
14259 (dynamic_list_node): Likewise.
14260 * testsuite/Makefile.am (dynamic_list): New test.
14261 * testsuite/Makefile.in: Regenerated.
14262 * testsuite/dynamic_list.t: New file.
14263 * testsuite/dynamic_list.sh: New file.
14264
e0bb29a5
CS
142652008-11-05 Craig Silverstein <csilvers@google.com>
14266
14267 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14268 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14269 (t11_last): Likewise.
14270 * testsuite/ver_test_6.c (main): Likewise.
14271
4e1e25e0
CC
142722008-10-07 Cary Coutant <ccoutant@google.com>
14273
14274 * options.c (General_options::finalize): Add check for -static and
14275 -shared.
14276 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14277 is not empty.
14278
92f03fcb
CC
142792008-10-02 Cary Coutant <ccoutant@google.com>
14280
14281 * plugin.cc (make_sized_plugin_object): Fix conditional
14282 compilation to work when not all targets are enabled.
14283
fbd8a257
CC
142842008-09-29 Cary Coutant <ccoutant@google.com>
14285
14286 * archive.cc (Archive::get_file_and_offset): Use filename instead
14287 of name to get library path.
14288 (Archive::include_member): Unlock external member of a thin archive.
14289
14290 * testsuite/Makefile.am (TEST_AR): New variable.
14291 (thin_archive_test_1): New test.
14292 (thin_archive_test_2): New test.
81636b3f
CC
14293 * testsuite/Makefile.in: Regenerate.
14294 * testsuite/thin_archive_main.cc: New file.
14295 * testsuite/thin_archive_test_1.cc: New file.
14296 * testsuite/thin_archive_test_2.cc: New file.
14297 * testsuite/thin_archive_test_3.cc: New file.
14298 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14299
eff45813
CC
143002008-09-29 Cary Coutant <ccoutant@google.com>
14301
14302 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14303 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14304 instead of -1U.
14305 (Sized_relobj::do_finalize_local_symbols): Likewise.
14306 (Sized_relobj::map_to_kept_section): Likewise.
14307 * object.h (Sized_relobj::invalid_address): New constant.
14308 (Sized_relobj::do_output_section_offset): Check for invalid_address
14309 and return -1ULL.
14310 * output.cc (Output_reloc::local_section_offset): Use constant
14311 invalid_address instead of -1U.
14312 (Output_reloc::get_address): Likewise.
14313 (Output_section::output_address): Change -1U to -1ULL.
14314 * output.h (Output_reloc::invalid_address): New constant.
14315 * reloc.cc (Sized_relobj::write_sections): Use constant
14316 invalid_address instead of -1U.
14317 (Sized_relobj::relocate_sections): Likewise.
14318 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14319 values for merge sections.
14320 * target-reloc.h (relocate_for_relocatable): Use constant
14321 invalid_address instead of -1U.
14322
89fc3421
CC
143232008-09-19 Cary Coutant <ccoutant@google.com>
14324
14325 Add plugin functionality for link-time optimization (LTO).
14326 * configure.ac (plugins): Add --enable-plugins option.
14327 * configure: Regenerate.
14328 * config.in: Regenerate.
14329 * Makefile.am (LIBDL): New variable.
14330 (CCFILES): Add plugin.cc.
14331 (HFILES): Add plugin.h.
14332 (ldadd_var): Add LIBDL.
14333 * Makefile.in: Regenerate.
14334
14335 * archive.cc: Include "plugin.h".
14336 (Archive::setup): Don't preread archive symbols when using a plugin.
14337 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14338 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14339 files.
14340 (Archive::include_member): Add symbols from plugin objects.
14341 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14342 * descriptors.cc (Descriptors::open): Check for file descriptors
14343 abandoned by plugins.
14344 (Descriptors::claim_for_plugin): New function.
14345 * descriptors.h (Descriptors::claim_for_plugin): New function.
14346 (Open_descriptor::is_claimed): New field.
14347 (claim_descriptor_for_plugin): New function.
14348 * fileread.cc (File_read::claim_for_plugin): New function.
14349 * fileread.h (File_read::claim_for_plugin): New function.
14350 (File_read::descriptor): New function.
14351 * gold.cc: Include "plugin.h".
14352 (queue_initial_tasks): Add task to call plugin hooks for generating
14353 new object files.
14354 * main.cc: Include "plugin.h".
14355 (main): Load plugin libraries.
14356 * object.h (Pluginobj): Declare.
14357 (Object::pluginobj): New function.
14358 (Object::do_pluginobj): New function.
14359 (Object::set_target): New function.
14360 * options.cc: Include "plugin.h".
14361 (General_options::parse_plugin): New function.
14362 (General_options::General_options): Initialize plugins_ field.
14363 (General_options::add_plugin): New function.
14364 * options.h (Plugin_manager): Declare.
14365 (General_options): Add --plugin option.
14366 (General_options::has_plugins): New function.
14367 (General_options::plugins): New function.
14368 (General_options::add_plugin): New function.
14369 (General_options::plugins_): New field.
14370 * plugin.cc: New file.
14371 * plugin.h: New file.
14372 * readsyms.cc: Include "plugin.h".
14373 (Read_symbols::do_read_symbols): Check for archive before checking
14374 for ELF file. Call plugin hooks to claim files.
14375 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14376 from a real object file; force override when processing replacement
14377 files.
14378 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14379 (Symbol::init_base_object): Likewise.
14380 (Symbol::init_base_output_data): Likewise.
14381 (Symbol::init_base_output_segment): Likewise.
14382 (Symbol::init_base_constant): Likewise.
14383 (Symbol::init_base_undefined): Likewise.
14384 (Symbol::output_section): Assert that object is not a plugin.
14385 (Symbol_table::add_from_pluginobj): New function.
14386 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14387 undefined.
14388 (Symbol_table::sized_write_globals): Likewise.
14389 (Symbol_table::add_from_pluginobj): Instantiate template.
14390 * symtab.h (Sized_pluginobj): Declare.
14391 (Symbol::in_real_elf): New function.
14392 (Symbol::set_in_real_elf): New function.
14393 (Symbol::in_real_elf_): New field.
14394 (Symbol_table::add_from_pluginobj): New function.
14395
14396 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14397 (LIBDL): New variable.
14398 (LDADD): Add LIBDL.
14399 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14400 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14401 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14402 (MOSTLYCLEANFILES): Likewise.
14403 * testsuite/Makefile.in: Regenerate.
14404 * testsuite/plugin_test.c: New file.
14405 * testsuite/plugin_test_1.sh: New file.
14406 * testsuite/plugin_test_2.sh: New file.
14407
de31bda5
ILT
144082008-09-16 Ian Lance Taylor <iant@google.com>
14409
9c2d0ef9
ILT
14410 * target-reloc.h (relocate_section): Check whether a symbol is
14411 defined by the ABI before reporting an undefined symbol error.
14412 * target.h (Target::is_defined_by_abi): Make parameter const.
14413 (Target::do_is_defined_by_abi): Likewise.
14414 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14415 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14416 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14417 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14418 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14419 * testsuite/Makefile.in: Rebuild.
14420
de31bda5
ILT
14421 * fileread.cc (make_view): Add casts to avoid warning.
14422
9fa33bee
AO
144232008-09-16 Alexandre Oliva <aoliva@redhat.com>
14424
14425 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14426 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14427
183fd0e3
AO
144282008-09-16 Alexandre Oliva <aoliva@redhat.com>
14429
14430 * options.h (General_options::output_is_executable): New.
14431 (General_options::output_is_pie): New.
14432 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14433 for shared libraries.
14434 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14435
7be8330a
CD
144362008-09-11 Chris Demetriou <cgd@google.com>
14437
14438 * options.h (origin): New -z option.
14439 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14440 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14441 in DT_FLAGS_1.
14442
a9caad02
CC
144432008-09-05 Cary Coutant <ccoutant@google.com>
14444
14445 * fileread.cc (File_read::make_view): Add check for attempt to map
14446 beyond end of file.
14447
ae6dce4d
CC
144482008-09-05 Cary Coutant <ccoutant@google.com>
14449
14450 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14451 explicit instantiations.
14452
d7ab2a47
KVH
144532008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14454
14455 PR gold/6858
14456 * options.cc (General_options::finalize): Allow undefined symbols
14457 in shlibs if linking -shared.
14458
14459 PR gold/6859
14460 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14461 symbols as not needing a dynsym entry.
14462
1e52a9c1
CS
144632008-08-20 Craig Silverstein <csilvers@google.com>
14464
14465 * fileread.cc (File_read::open): Do not lock the file unless it
14466 was successfully opened.
14467
d85c80a3
CC
144682008-08-14 Cary Coutant <ccoutant@google.com>
14469
14470 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14471 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14472 * testsuite/tls_test.cc (struct int128): 128-bit struct
14473 for testing TLS relocs with non-zero addend.
14474 (v12): New TLS variable.
14475 (t12): New test.
14476 (t_last): Add check for v12.
14477 * testsuite/tls_test.h (t12): New function.
14478 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14479
2d924fd9
ILT
144802008-08-13 Ian Lance Taylor <iant@google.com>
14481
14482 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14483 set tls_segment_ or relro_segment_.
14484 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14485 when appropriate.
14486 * output.h (Output_section::clear_is_relro): New function.
14487 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14488 sections specially even when output_data_ is empty.
14489 (Output_segment::maximum_alignment): When first section is relro,
14490 only force alignment for PT_LOAD segments.
14491 * script.cc (script_data_segment_align): New function.
14492 (script_data_segment_relro_end): New function.
14493 * script-c.h (script_data_segment_align): Declare.
14494 (script_data_segment_relro_end): Declare.
14495 * script-sections.h (class Script_sections): Declare
14496 data_segment_align and data_segment_relro_end. Add fields
14497 segment_align_index_ and saw_relro_end_.
14498 * script-sections.cc (class Sections_element): Add set_is_relro
14499 virtual function. Add new bool* parameter to place_orphan_here.
14500 Add get_output_section virtual function.
14501 (class Output_section_definition): Add set_is_relro. Add new
14502 bool* parameter to place_orphan_here. Add get_output_section.
14503 Add is_relro_ field.
14504 (Output_section_definition::Output_section_definition): Initialize
14505 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14506 and is_relro_ fields.
14507 (Output_section_definition::place_orphan_here): Add is_relro
14508 parameter.
14509 (Output_section_definition::set_section_addresses): Set relro for
14510 output section.
14511 (Output_section_definition::alternate_constraint): Likewise.
14512 (class Orphan_output_section): Add new bool* parameter to
14513 place_orphan_here. Add get_output_section.
14514 (Orphan_output_section::place_orphan_here): Add is_relro
14515 parameter.
14516 (Script_sections::Script_sections): Initialize
14517 data_segment_align_index_ and saw_relro_end_.
14518 (Script_sections::data_segment_align): New function.
14519 (Script_sections::data_segment_relro_end): New function.
14520 (Script_sections::place_orphan): Set or clear is_relro.
14521 (Script_sections::set_section_addresses): Force alignment of first
14522 TLS section.
14523 * yyscript.y (exp): Call script_data_segment_align and
14524 script_data_segment_relro_end.
14525 * testsuite/relro_script_test.t: New file.
14526 * testsuite/relro_test.cc (using_script): Declare.
14527 (t1, t2): Test using_script.
14528 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14529 (relro_script_test_SOURCES): Define.
14530 (relro_script_test_DEPENDENCIES): Define.
14531 (relro_script_test_LDFLAGS): Define.
14532 (relro_script_test_LDADD): Define.
14533 (relro_script_test.so): New target.
14534 * testsuite/Makefile.in: Rebuild.
14535
f827c9a9
CC
145362008-08-06 Cary Coutant <ccoutant@google.com>
14537
14538 * archive.cc (Archive::total_archives, Archive::total_members)
14539 (Archive::total_members_loaded): New variables.
14540 (Archive::setup): Add parameter. Add option to preread
14541 archive symbols.
14542 (Archive::read_armap): Add counter.
14543 (Archive::get_file_and_offset): New function.
14544 (Archive::get_elf_object_for_member): New function.
14545 (Archive::read_all_symbols): New function.
14546 (Archive::read_symbols): New function.
14547 (Archive::add_symbols): Add counters.
14548 (Archive::include_all_members): Use armap to find members if it's
14549 already built.
14550 (Archive::include_member): Skip reading symbols if already read.
14551 Factored code into Archive::get_file_and_offset and
14552 Archive::get_elf_object_for_member. Changed call to
14553 Mapfile::report_include_archive_member.
14554 (Archive::print_stats): New function.
14555 * archive.h: Declare Object and Read_symbols_data classes.
14556 (Archive::Archive): Add initializers for new members.
14557 (Archive::setup): Add parameter.
14558 (Archive::print_stats): New function.
14559 (Archive::total_archives, Archive::total_members)
14560 (Archive::total_members_loaded): New variables.
14561 (Archive::get_file_and_offset): New function.
14562 (Archive::get_elf_object_for_member): New function.
14563 (Archive::read_all_symbols): New function.
14564 (Archive::read_symbols): New function.
14565 (Archive::Archive_member): New class.
14566 (Archive::members_): New member.
14567 (Archive::num_members_): New member.
14568 * main.cc: Include archive.h.
14569 (main): Call Archive::print_stats.
14570 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14571 archive parameter; member_name is now the fully-decorated name.
14572 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14573 * options.h: (General_options): Add --preread-archive-symbols option.
14574 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14575 Archive::setup.
14576
de4c45bd
ILT
145772008-08-04 Ian Lance Taylor <iant@google.com>
14578
14579 * symtab.h (Symbol::use_plt_offset): New function.
14580 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14581 * powerpc.cc (Relocate::relocate): Likewise.
14582 * sparc.cc (Relocate::relocate): Likewise.
14583 * x86_64.cc (Relocate::relocate): Likewise.
14584 * testsuite/weak_plt.sh: New test.
14585 * testsuite/weak_plt_main.cc: New test.
14586 * testsuite/weak_plt_shared.cc: New test.
14587 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14588 (check_PROGRAMS): Add weak_plt.
14589 (check_DATA): Add weak_plt_shared.so.
14590 (weak_plt_main_pic.o, weak_plt): New targets.
14591 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14592 * testsuite/Makefile.in: Rebuild.
14593
14594 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14595 gcctestdir/ld.
14596 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14597 * testsuite/Makefile.in: Rebuild.
14598
323ee3f4
AM
145992008-08-04 Alan Modra <amodra@bigpond.net.au>
14600
14601 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14602 * Makefile.in: Regenerate.
14603 * po/POTFILES.in: Regenerate.
14604
7c07ecec
ILT
146052008-07-29 Ian Lance Taylor <iant@google.com>
14606
14607 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14608 symbols before other symbols.
14609 * testsuite/script_test_2.cc (test_addr): Declare.
14610 (test_addr_alias): Declare.
14611 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14612 values.
7c07ecec
ILT
14613 * testsuite/script_test_2.t: Define test_addr_alias and
14614 test_addr.
14615
5778530e
ILT
146162008-07-24 Ian Lance Taylor <iant@google.com>
14617
2a00e4fb
ILT
14618 PR 5990
14619 * descriptors.cc: New file.
14620 * descriptors.h: New file.
14621 * gold-threads.h (class Hold_optional_lock): New class.
14622 * fileread.cc: Include "descriptors.h".
14623 (File_read::~File_read): Release descriptor rather than closing
14624 it.
14625 (File_read::open) [file]: Call open_descriptor rather than open.
14626 Set is_descriptor_opened_.
14627 (File_read::open) [memory]: Assert that descriptor is not open.
14628 (File_read::reopen_descriptor): New function.
14629 (File_read::release): Release descriptor.
14630 (File_read::do_read): Make non-const. Reopen descriptor.
14631 (File_read::read): Make non-const.
14632 (File_read::make_view): Reopen descriptor.
14633 (File_read::do_readv): Likewise.
14634 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14635 Update declarations.
14636 * layout.cc: Include "descriptors.h".
14637 (Layout::create_build_id): Use open_descriptor rather than open.
14638 * output.cc: Include "descriptors.h".
14639 (Output_file::open): Use open_descriptor rather than open.
14640 * archive.cc (Archive::const_iterator): Change Archive to be
14641 non-const.
14642 (Archive::begin, Archive::end): Make non-const.
14643 (Archive::count_members): Likewise.
14644 * archive.h (class Archive): Update declarations.
14645 * object.h (Object::read): Make non-const.
14646 * Makefile.am (CCFILES): Add descriptors.cc.
14647 (HFILES): Add descriptors.h.
14648 * Makefile.in: Rebuild.
14649
801647d1
ILT
14650 PR 6716
14651 * gold.h: Always include <clocale>. Add Solaris workarounds
14652 following code in binutils/sysdep.h.
14653
5edd166e
ILT
14654 PR 6048
14655 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14656 this->eh_frame_hdr_ is NULL before using it.
14657
c89ad728
ILT
14658 * dynobj.cc (Versions::Versions): Update comment.
14659
aa86f06b
ILT
14660 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14661 the base version name.
14662
5778530e
ILT
14663 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14664 array size plus one.
14665 (Stringpool_template::set_string_offsets): Subtract one from key
14666 before using it as an array index.
14667 (Stringpool_template::get_offset_with_length): Likewise.
14668 (Stringpool_template::write_to_buffer): Likewise.
14669 * stringpool.h (Stringpool_template::get_offset_from_key):
14670 Likewise.
14671
057ead22
ILT
146722008-07-23 Ian Lance Taylor <iant@google.com>
14673
7f649c59
ILT
14674 PR 6658
14675 * object.h (Merged_symbol_value::value): Do our best to handle a
14676 negative addend.
14677
057ead22
ILT
14678 PR 6647
14679 * script.cc (Version_script_info::get_versions): Don't add empty
14680 version tag to return value.
14681 (Version_script_info::get_symbol_version_helper): Change return
14682 type to bool. Add pversion parameter. Change all callers.
14683 (script_register_vers_node): Don't require a non-NULL tag.
14684 * script.h (class Version_script_info): Update declarations.
14685 (Version_script_info::get_symbol_version): Change return type to
14686 bool. Add version parameter. Change all callers.
14687 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14688 handling. Handle an empty version from a version script.
14689 (Symbol_table::define_special_symbol): Likewise.
14690 * testsuite/ver_test_10.script: New file.
14691 * testsuite/ver_test_10.sh: New file.
14692 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14693 (check_DATA): Add ver_test_10.syms.
14694 (ver_test_10.syms, ver_test_10.so): New target.
14695 * testsuite/Makefile.in: Rebuild.
14696
58e54ac2
CD
146972008-07-23 Simon Baldwin <simonb@google.com>
14698
14699 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14700 to zero for undefined symbols from dynamic libraries.
14701
95d14cd3
ILT
147022008-07-23 Ian Lance Taylor <iant@google.com>
14703
14704 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14705 Change all callers.
14706 * symtab.h (class Symbol_table): Update declaration.
14707 * testsuite/ver_test_9.cc: New file.
14708 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14709 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14710 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14711 (ver_test_9.so, ver_test_9.o): New targets.
14712 * testsuite/Makefile.in: Rebuild.
14713
92de84a6
ILT
147142008-07-22 Ian Lance Taylor <iant@google.com>
14715
34810851
ILT
14716 * options.h (class General_options): Define --check-sections.
14717 * layout.cc (Layout::set_segment_offsets): Handle
14718 --check-sections.
14719
af6156ef
ILT
14720 * options.h (class General_options): Define -n/--nmagic and
14721 -N/--omagic.
14722 * options.cc (General_options::finalize): For -n/--nmagic or
14723 -N/--omagic, set -static.
14724 * layout.cc (Layout::attach_allocated_section_to_segment): If
14725 -N/--omagic, don't put read-only and read-write sections in
14726 different segments.
14727 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14728 finding a read-only segment.
14729 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14730 don't set the minimum segment alignment to the common page size,
14731 and don't set the file offset to the address modulo the page size.
14732 * script-sections.cc (Script_sections::create_segments): If
14733 -n/--omagic, don't put read-only and read-write sections in
14734 different segments.
14735
92de84a6
ILT
14736 * cref.cc: New file.
14737 * cref.h: New file.
14738 * options.h (class General_options): Add --print-symbol-counts.
14739 * main.cc (main): Issue defined symbol report if requested.
14740 * archive.cc (Archive::interpret_header): Make into a const member
14741 function.
14742 (Archive::add_symbols): Call Input_objects::archive_start and
14743 archive_stop.
14744 (Archive::const_iterator): Define new class.
14745 (Archive::begin, Archive::end): New functions.
14746 (Archive::include_all_members): Rewrite to use iterator.
14747 (Archive::count_members): New function.
14748 * archive.h (class Archive): Update declarations.
14749 (Archive::filename): New function.
14750 * object.cc: Include "cref.h".
14751 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14752 (Sized_relobj::do_get_global_symbol_counts): New function.
14753 (Input_objects::add_object): Add object to cross-referencer.
14754 (Input_objects::archive_start): New function.
14755 (Input_objects::archive_stop): New function.
14756 (Input_objects::print_symbol_counts): New function.
14757 * object.h: Declare Cref and Archive.
14758 (Object::get_global_symbol_counts): New function.
14759 (Object::do_get_global_symbol_counts): New pure virtual function.
14760 (class Sized_relobj): Add defined_count_ field. Update
14761 declarations.
14762 (class Input_objects): Add cref_ field. Update constructor.
14763 Update declarations.
14764 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14765 defined_count_.
14766 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14767 symbol counts.
14768 (Sized_dynobj::do_get_global_symbol_counts): New function.
14769 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14770 defined_count_. Update declarations. Define Symbols typedef.
14771 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14772 parameter. Change all callers.
14773 (Symbol_table::add_from_dynobj): Add sympointers and defined
14774 parameters. Change all callers.
14775 * symtab.h (class Symbol_table): Update declarations.
14776 * Makefile.am (CCFILES): Add cref.cc.
14777 (HFILES): Add cref.h.
14778 * Makefile.in: Rebuild.
14779
3f7c5e1d
CD
147802008-07-22 Simon Baldwin <simonb@google.com>
14781
14782 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14783 to zero when writing undefined symbols.
14784
e0b64032
ILT
147852008-07-22 Ian Lance Taylor <iant@google.com>
14786
14787 * output.cc (Output_section::add_input_section): Don't try to
14788 merge empty merge sections.
14789
096b02cf
CS
147902008-07-21 Craig Silverstein <csilvers@google.com>
14791
14792 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14793 Include symbol version in error message.
cd536b21 14794
1d1f116d
CD
147952008-07-20 Chris Demetriou <cgd@google.com>
14796
cd536b21 14797 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14798 (RANDOM_SEED_CFLAGS): New substituted variable.
14799 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14800 * configure: Rebuild.
14801 * Makefile.in: Likewise.
14802 * testsuite/Makefile.in: Likewise.
14803
a18f591e
ILT
148042008-07-18 Ian Lance Taylor <iant@google.com>
14805
14806 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14807 where we see NAME/NULL and NAME/VERSION as separate symbols.
14808 * testsuite/ver_test_main.cc (main): Call t4.
14809 (t4, t4_2a): Define.
14810 * testsuite/ver_test_2.cc (t4_2): Define.
14811 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14812 * testsuite/ver_test_4.cc (t4_2a): Define.
14813 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14814 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14815
c6e3f6ed
ILT
148162008-07-17 Ian Lance Taylor <iant@google.com>
14817
14818 * dynobj.cc (Versions::add_def): If we give an error about a
14819 missing version, go ahead and create the version anyhow.
14820
ef9beddf
ILT
148212008-07-10 Ian Lance Taylor <iant@google.com>
14822
14823 Handle output sections with more than 0x7fffffff bytes.
14824 * object.h (class Relobj): Change map_to_output_ to
14825 output_sections_, and just keep a section pointer. Change all
14826 uses. Move comdat group support to Sized_relobj.
14827 (Relobj::is_section_specially_mapped): Remove.
14828 (Relobj::output_section): Remove poff parameter. Change all
14829 callers.
14830 (Relobj::output_section_offset): New function.
14831 (Relobj::set_section_offset): Rewrite.
14832 (Relobj::map_to_output): Remove.
14833 (Relobj::output_sections): New function.
14834 (Relobj::do_output_section_offset): New pure virtual function.
14835 (Relobj::do_set_section_offset): Likewise.
14836 (class Sized_relobj): Add section_offsets_ field. Add comdat
14837 group support from Relobj. Update declarations.
14838 (Sized_relobj::get_output_section_offset): New function.
14839 (Sized_relobj::do_output_section_offset): New function.
14840 (Sized_relobj::do_set_section_offset): New function.
14841 * object.cc (Relobj::output_section_address): Remove.
14842 (Sized_relobj::Sized_relobj): Initialize new fields.
14843 (Sized_relobj::include_section_group): Cast find_kept_object to
14844 Sized_relobj.
14845 (Sized_relobj::include_linkonce_section): Likewise.
14846 (Sized_relobj::do_layout): Use separate arrays for output section
14847 and output offset.
14848 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14849 output_sections.
14850 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14851 output_sections and section_offsets.
14852 (Sized_relobj::write_local_symbols): Likewise.
14853 (map_to_kept_section): Compute output address directly.
14854 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14855 output_sections and section_offsets.
14856 (Sized_relobj::write_sections): Likewise.
14857 (Sized_relobj::relocate_sections): Likewise.
14858 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14859 * output.h (class Output_reloc): Update declarations. Change
14860 u2_.relobj to Sized_relobj*.
14861 (class Output_data_reloc): Change add functions to use
14862 Sized_relobj*.
14863 * output.cc (Output_reloc::Output_reloc): Change relobj to
14864 Sized_relobj*.
14865 (Output_reloc::local_section_offset): Change return type to
14866 Elf_Addr. Use get_output_section_offset.
14867 (Output_reloc::get_address): Likewise.
14868 (Output_section::is_input_address_mapped): Don't call
14869 is_section_specially_mapped.
14870 (Output_section::output_offset): Likewise.
14871 (Output_section::output_address): Likewise.
14872 (Output_section::starting_output_address): Likewise.
14873 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14874 parameter to Sized_relobj*.
14875 (Copy_relocs::need_copy_reloc): Likewise.
14876 (Copy_relocs::save): Likewise.
14877 * copy-relocs.h (class Copy_relocs): Update declarations.
14878 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14879 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14880 * target-reloc.h (relocate_for_relocatable): Change
14881 offset_in_output_section type to Elf_Addr. Change code that uses
14882 it as well.
14883 * layout.cc (Layout::layout): Always set *off.
14884 * mapfile.cc (Mapfile::print_input_section): Use
14885 output_section_offset.
14886 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14887 Sized_relobj*.
14888 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14889 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14890 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14891
5cb66f97
ILT
148922008-07-03 Ian Lance Taylor <iant@google.com>
14893
14894 * layout.cc (Layout::include_section): Do not discard unrecognized
14895 SHT_STRTAB sections.
14896
afe47622
CS
148972008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14898
14899 * script.cc (Lex::can_continue_name): Make '?' allowable in
14900 version-script names.
14901 * testsuite/version_script.map: Change glob pattern to use '?'
14902
5adf9721
ILT
149032008-06-30 Manish Singh <yosh@gimp.org>
14904
14905 PR 6585
14906 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14907 Correct typo.
14908
e6fde208
ILT
149092008-06-30 Ian Lance Taylor <iant@google.com>
14910
14911 PR 6660
14912 PR 6682
14913 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14914 versions]: Don't try to read the value in the contents, since we
14915 don't use it. Use the template endianness when writing.
14916
3f2e6a2d
CC
149172008-06-25 Cary Coutant <ccoutant@google.com>
14918
14919 * fileread.cc (File_read::make_view): Assert on zero-length view.
14920 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14921 symbol table when there are no symbols to read.
14922
c43d3a48
CS
149232008-06-23 Craig Silverstein <csilvers@google.com>
14924
14925 * version.cc (version_string): Bump to 1.7
14926
5f494ea0
CS
149272008-06-18 Craig Silverstein <csilvers@google.com>
14928
14929 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14930 constant 0xFFFF to type Valtype.
14931 (Powerpc_relocate_functions::rel16_ha): Likewise.
14932
c42e122e
ILT
149332008-06-17 Ian Lance Taylor <iant@google.com>
14934
f34787f8
ILT
14935 * output.h (Output_section::Input_section): Initialize p2align_ to
14936 zero for Output_section_data constructors.
14937 (Output_section::Input_section::addralign): If not an input
14938 section, return the alignment of the Output_section_data.
14939 * testsuite/copy_test.cc: New file.
14940 * testsuite/copy_test_1.cc: New file.
14941 * testsuite/copy_test_2.cc: New file.
14942 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14943 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14944 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14945 (copy_test_1_pic.o, copy_test_1.so): New targets.
14946 (copy_test_2_pic.o, copy_test_2.so): New targets.
14947 * testsuite/Makefile.in: Rebuild.
14948
c42e122e
ILT
14949 * script-sections.cc (Script_sections::place_orphan): Initialize
14950 local variable exact.
14951
ce3ac18a
DE
149522008-06-13 David Edelsohn <edelsohn@gnu.org>
14953
14954 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14955
42cacb20
DE
149562008-06-12 David Edelsohn <edelsohn@gnu.org>
14957 David S. Miller <davem@davemloft.net>
14958
14959 * powerpc.cc: New file.
14960 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14961 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14962 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14963 * Makefile.in: Rebuild.
14964
7b308235
ILT
149652008-06-09 Ian Lance Taylor <iant@google.com>
14966
14967 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14968 <exception>.
14969 (throwing, orig_terminate): New static variables.
14970 (terminate_handler): New static function.
14971 (t2): Set terminate handler.
14972
f0b886e3
ILT
149732008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14974
14975 PR 6584
cd536b21 14976 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14977 alignment.
14978
3e90f135
CC
149792008-05-30 Cary Coutant <ccoutant@google.com>
14980
14981 * archive.cc (Archive::include_all_members) Correct to step
14982 over symbol table and extended name table in thin archives.
14983
e09ad04a
ILT
149842008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14985
14986 PR 6407
14987 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14988 calculation.
14989
62b01cb5
ILT
149902008-05-28 Caleb Howe <cshowe@google.com>
14991
14992 * reduced_debug_output.cc: New file.
14993 * reduced_debug_output.h: New file.
92de84a6 14994 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14995 * options.cc (General_options::finalize): Add strip_debug_non_line
14996 to the strip heirarchy.
14997 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14998 fields.
14999 * layout.cc: Include "reduced_debug_output.h".
15000 (Layout::Layout): Initialize new fields.
15001 (line_only_debug_sections): New static array.
15002 (is_lines_only_debug_sections): New static inline function.
15003 (Layout::include_section): Handle --strip-debug-non-line.
15004 (Layout::make_output_section): If --strip-debug-non-line, build
15005 new output sections for .debug_abbrev and .debug_info.
15006 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15007 gold. Warn about possible overflow.
15008 (read_signed_LEB_128): Likewise.
15009 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15010 (read_signed_LEB_128): Declare.
15011 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15012 (HFILES): Add reduced_debug_output.h.
15013 * Makefile.in: Rebuild.
15014
7d9e3d98
ILT
150152008-05-21 Ian Lance Taylor <iant@google.com>
15016
15017 * mapfile.cc: New file.
15018 * mapfile.h: New file.
15019 * options.h (class General_options): Add -M/--print-map and -Map.
15020 * options.cc (General_options::finalize): Make -M equivalent to
15021 -Map -.
15022 * main.cc: Include <cstdio> and "mapfile.h".
15023 (main): Open mapfile if requested.
15024 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15025 constructor. Change caller.
15026 (queue_initial_tasks): Add mapfile parameter. Change caller.
15027 (queue_middle_tasks): Likewise.
15028 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15029 declarations.
15030 * archive.cc: Include "mapfile.h".
15031 (Archive::add_symbols): Add mapfile parameter. Change all
15032 callers. Pass mapfile, symbol, and reason to include_member.
15033 (Archive::include_all_members): Add mapfile parameter. Change all
15034 callers.
15035 (Archive::include_member): Add mapfile, sym, and why parameters.
15036 Change all callers. Report inclusion to map file.
15037 * archive.h: Include "fileread.h".
15038 (class Archive): Update declarations.
15039 (Archive::file): New const method.
15040 (class Add_archive_symbols): Add mapfile_ field. Update
15041 constructor. Change all callers.
15042 * readsyms.h (class Read_symbols): Likewise.
15043 (class Finish_group): Likewise.
15044 (class Read_script): Likewise.
15045 * common.cc: Include "mapfile.h".
15046 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15047 all callers.
15048 (Symbol_table::do_allocate_commons): Likewise.
15049 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15050 symbol allocation to mapfile.
15051 * common.h (class Allocate_commons_task): Add mapfile_ field.
15052 Update constructor. Change all callers.
15053 * symtab.h (class Symbol_table): Update declarations.
15054 * layout.cc: Include "mapfile.h".
15055 (Layout_task_runner::run): Print information to mapfile.
15056 (Layout::create_gold_note): Change Output_data_fixed_space to
15057 Output_data_zero_fill.
15058 (Layout::create_build_id): Likewise.
15059 (Layout::print_to_mapfile): New function.
15060 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15061 constructor. Change caller.
15062 (class Layout): Declare print_to_mapfile.
15063 * output.cc (Output_section::Input_section::print_to_mapfile): New
15064 function.
15065 (Output_section::add_input_section): If producing a map, always
15066 add to input_sections_ list.
15067 (Output_section::do_print_to_mapfile): New function.
15068 (Output_segment::print_sections_to_mapfile): New function.
15069 (Output_segment::print_section_list_to_mapfile): New function.
15070 * output.h: Include "mapfile.h".
15071 (Output_data::print_to_mapfile): New function.
15072 (Output_data::do_print_to_mapfile): New virtual function.
15073 (Output_segment_headers::do_print_to_mapfile): New function.
15074 (Output_file_header::do_print_to_mapfile): New function.
15075 (Output_data_const::do_print_to_mapfile): New function.
15076 (class Output_data_const_buffer): Add map_name_ field. Update
15077 constructor. Change all callers. Add do_print_to_mapfile
15078 function.
15079 (class Output_data_fixed_space): Likewise.
15080 (class Output_data_space): Likewise.
15081 (class Output_data_zero_fill): New class.
15082 (Output_data_strtab::do_print_to_mapfile): New function.
15083 (Output_data_reloc_base::do_print_to_mapfile): New function.
15084 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15085 (Output_data_group::do_print_to_mapfile): New function.
15086 (Output_data_got::do_print_to_mapfile): New function.
15087 (Output_data_dynamic::do_print_to_mapfile): New function.
15088 (Output_symtab_xindex::do_print_to_mapfile): New function.
15089 (class Output_section): Declare do_print_to_mapflie. Declare
15090 print_to_mapfile in Input_section.
15091 (class Output_segment): Declare new functions.
15092 * object.h (Sized_relobj::symbol_count): New function.
15093 * script-sections.cc
15094 (Output_section_element_dot_assignment::set_section_addresses):
15095 Change Output_data_fixed_space to Output_data_zero_fill.
15096 (Output_data_expression::do_print_to_mapfile): New function.
15097 * script.cc (read_input_script): Add mapfile parameter. Change
15098 all callers.
15099 * script.h (read_input_script): Update declaration.
15100 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15101 (Eh_frame::do_print_to_mapfile): New function.
15102 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15103 (Output_merge_string::do_print_to_mapfile): New function.
15104 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15105 function.
15106 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15107 function.
15108 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15109 function.
15110 * Makefile.am (CCFILES): Add mapfile.cc.
15111 (HFILES): Add mapfile.h.
15112 * Makefile.in: Rebuild.
15113
9f1d377b
ILT
151142008-05-19 Ian Lance Taylor <iant@google.com>
15115
15116 * options.h (class General_options): Add -z relro.
15117 * layout.cc (Layout::Layout): Initialize relro_segment_.
15118 (Layout::add_output_section_data): Return the output section.
15119 (Layout::make_output_section): Rcognize relro sections and mark
15120 them appropriately.
15121 (Layout::attach_allocated_section_to_segment): Put relro sections
15122 in a PT_GNU_RELRO segment.
15123 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15124 section as relro.
15125 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15126 PT_TLS segments.
15127 (Layout::linkonce_mapping): Map d.rel.ro.local to
15128 .data.rel.ro.local.
15129 (Layout::output_section_name): Us .data.rel.ro.local for any
15130 section which begins with that.
15131 * layout.h (class Layout): Update add_output_section_data
15132 declaration. Add relro_segment_ field.
15133 * output.cc (Output_section::Output_section): Initialize is_relro_
15134 and is_relro_local_ fields.
15135 (Output_segment::add_output_section): Group relro sections.
15136 (Output_segment::is_first_section_relro): New function.
15137 (Output_segment::maximum_alignment): If there is a relro section,
15138 align the segment to the common page size.
15139 (Output_segment::set_section_addresses): Track whether we are
15140 looking at relro sections. If the last section is a relro
15141 section, align to the common page size.
15142 (Output_segment::set_section_list_addresses): Add in_relro
15143 parameter. Change all callers. Align to the page size when
15144 moving from relro to non-relro section.
15145 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15146 segment.
15147 * output.h (class Output_section): Add is_relro_ and
15148 is_relro_local_ fields.
15149 (Output_section::is_relro): New function.
15150 (Output_section::set_is_relro): New function.
15151 (Output_section::is_relro_local): New function.
15152 (Output_section::set_is_relro_local): New function.
15153 (class Output_segment): Update declarations.
15154 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15155 * sparc.cc (Target_sparc::got_section): Likewise.
15156 * x86_64.cc (Target_x86_64::got_section): Likewise.
15157 * testsuite/relro_test_main.cc: New file.
15158 * testsuite/relro_test.cc: New file.
15159 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15160 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15161 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15162 (relro_test.so, relro_test_pic.o): New targets.
15163 * testsuite/Makefile.in: Rebuild.
15164
a984ee1d
ILT
151652008-05-16 Ian Lance Taylor <iant@google.com>
15166
01676dcd
ILT
15167 * output.cc (Output_segment::add_output_section): Remove front
15168 parameter.
15169 * output.h (class Output_segment): Remove
15170 add_initial_output_section and overloaded add_output_section.
15171 Update declaration of remaining add_output_section.
15172 * layout.cc (Layout::create_interp): Call add_output_section
15173 rather than add_initial_output_section.
15174 (Layout::finish_dynamic_section): Likewise.
15175
497897f9
ILT
15176 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15177 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15178 know the dynamic type.
15179 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15180 field. Initialize it in constructor.
15181 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15182 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15183 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15184 reloc.
15185
a984ee1d
ILT
15186 * output.cc (Output_reloc::get_address): Change return type to
15187 Elf_Addr.
15188 * output.h (class Output_reloc): Update get_address declaration.
15189 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15190 for section addresses.
15191
55ba0940
ILT
151922008-05-09 Ian Lance Taylor <iant@google.com>
15193
15194 PR 6493
15195 * gold.cc (gold_nomem): Use return value of write.
15196
75517b77
ILT
151972008-05-08 Ian Lance Taylor <iant@google.com>
15198
15199 * symtab.c (Symbol::init_base_output_data): Add version
15200 parameter. Change all callers.
15201 (Symbol::init_base_output_segment): Likewise.
15202 (Symbol::init_base_constant): Likewise.
15203 (Symbol::init_base_undefined): Likewise.
15204 (Sized_symbol::init_output_data): Likewise.
15205 (Sized_symbol::init_output_segment): Likewise.
15206 (Sized_symbol::init_constant): Likewise.
15207 (Sized_symbol::init_undefined): Likewise.
15208 (Symbol_table::do_define_in_output_data): If the new symbol has a
15209 version, mark it as the default.
15210 (Symbol_table::do_define_in_output_segment): Likewise.
15211 (Symbol_table::do_define_as_constant): Likewise.
15212 * symtab.h (class Symbol): Update declarations.
15213 (class Sized_symbol): Likewise.
15214 * resolve.cc (Symbol::override_version): New function.
c42e122e 15215 (Symbol::override_base): Call override_version.
75517b77
ILT
15216 (Symbol::override_base_with_special): Likewise.
15217 * testsuite/ver_script_8.script: New file.
15218 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15219 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15220 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15221 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15222
f1f70eae
ILT
152232008-05-06 Ian Lance Taylor <iant@google.com>
15224
f3e9c5c5
ILT
15225 PR 6049
15226 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15227 functions.
15228 (class General_options): Remove existing --undefined, and add
15229 --no-undefined instead. Add new --undefined as synonym for -u.
15230 * archive.cc (Archive::add_symbols): Check whether symbol was
15231 named with -u.
15232 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15233 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15234 all uses. Add IS_UNDEFINED. Update declarations to split
15235 different versions of init_base. Declare init_base_undefined.
15236 (Symbol::is_defined): Handle IS_UNDEFINED.
15237 (Symbol::is_undefined): Likewise.
15238 (Symbol::is_weak_undefined): Call is_undefined.
15239 (Symbol::is_absolute): Handle IS_CONSTANT.
15240 (class Sized_symbol): Update declarations to split different
15241 versions of init. Declare init_undefined.
15242 (class Symbol_table): Declare new functions.
15243 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15244 Change all callers.
15245 (Symbol::init_base_output_data): Likewise.
15246 (Symbol::init_base_output_segment): Likewise.
15247 (Symbol::init_base_constant): Likewise.
15248 (Symbol::init_base_undefined): New function.
15249 (Sized_symbol::init_object): Rename from init. Change all
15250 callers.
15251 (Sized_symbol::init_output_data): Likewise.
15252 (Sized_symbol::init_output_segment): Likewise.
15253 (Sized_symbol::init_constant): Likewise.
15254 (Sized_symbol::init_undefined): New function.
15255 (Symbol_table::add_undefined_symbols_from_command_line): New
15256 function.
15257 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15258 function.
15259 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15260 (Symbol::output_section): Likewise.
15261 (Symbol::set_output_section): Likewise.
15262 (Symbol_table::sized_finalize_symbol): Likewise.
15263 (Symbol_table::sized_write_globals): Likewise.
15264 * resolve.cc (Symbol_table::should_override): Likewise.
15265 (Symbol::override_base_with_special): Likewise.
15266
8bdcdf2c
ILT
15267 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15268 symbol, change it to have default visibility.
15269 * testsuite/protected_1.cc: New file.
15270 * testsuite/protected_2.cc: New file.
15271 * testsuite/protected_3.cc: New file.
15272 * testsuite/protected_main_1.cc: New file.
15273 * testsuite/protected_main_2.cc: New file.
15274 * testsuite/protected_main_3.cc: New file.
15275 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15276 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15277 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15278 (protected_1.so): New target.
15279 (protected_1_pic.o, protected_2_pic.o): New targets.
15280 (protected_3_pic.o): New target.
15281 (check_PROGRAMS): Add protected_2.
15282 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15283 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15284 * testsuite/Makefile.in: Rebuild.
15285
2b706932
ILT
15286 * options.h (DEFINE_var): Add set_user_set_##varname__.
15287 (DEFINE_bool_alias): New macro.
15288 (class General_options): Define -Bstatic using DEFINE_bool_alias
15289 rather than DEFINE_special. Add --undefined as an alias for -z
15290 defs.
15291 * options.cc (General_options::parse_Bstatic): Remove.
15292
d82a5bcc
ILT
15293 * options.h (class General_options): Add --fatal-warnings.
15294 * main.cc (main): Implement --fatal-warnings.
15295 * errors.h (Errors::warning_count): New function.
15296
f1f70eae
ILT
15297 * options.h (class General_options): Add -Bsymbolic-functions.
15298 * symtab.h (Symbol::is_preemptible): Check for
15299 -Bsymbolic-functions.
15300
8825ac63
ILT
153012008-05-05 Ian Lance Taylor <iant@google.com>
15302
d98bc257
ILT
15303 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15304 as noVARNAME rather than no-VARNAME.
15305 (class General_options): Add option -z combreloc.
15306 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15307 get_address.
15308 (Output_reloc::sort_before) [SHT_REL]: New function.
15309 (Output_reloc::sort_before) [SHT_RELA]: New function.
15310 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15311 Sort_relocs_comparison.
15312 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15313 parameter. Change all callers.
15314 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15315 sort_relocs parameter. Change all callers.
15316 * output.cc (Output_reloc::get_address): New function, broken out
15317 of write_rel.
15318 (Output_reloc::write_rel): Call it.
15319 (Output_reloc::compare): New function.
15320 (Output_data_reloc_base::do_write): Optionally sort relocs.
15321
60b2b4e7
ILT
15322 * configure.ac: If targ_extra_obj is set, link it in.
15323 * configure.tgt: Initialize all variables.
15324 (x86_64*): Set targ_extra_obj and targ_extra_size.
15325 * configure: Rebuild.
15326
8825ac63
ILT
15327 * object.cc (Sized_relobj::include_section_group): Adjust section
15328 indexes read from group data. Build vector to pass to
15329 layout_group.
15330 * layout.cc (Layout::layout_group): Add flags and shndxes
15331 parameters. Remove contents parameter. Change caller. Update
15332 explicit instantiations.
15333 * layout.h (class Layout): Update layout_group declaration.
15334 * output.cc (Output_data_group::Output_data_group): Add flags and
15335 input_shndxes parameters. Remove contents parameter. Change
15336 caller.
15337 (Output_data_group::do_write): Change input_sections_ to
15338 input_shndxes_.
15339 * output.h (class Output_data_group): Update constructor
15340 declaration. Rename input_sections_ to input_shndxes_.
15341 * testsuite/many_sections_test.cc: Add template.
15342
e94cf127
CC
153432008-04-30 Cary Coutant <ccoutant@google.com>
15344
4418b2d5
CC
15345 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15346
e94cf127
CC
15347 * layout.cc (Layout::include_section): Refactored check for debug
15348 info section.
15349 (Layout::add_comdat): Add new parameters. Change type
15350 of signature parameter. Add object and shndx to signatures table.
15351 (Layout::find_kept_object): New function.
15352 * layout.h: Include <cstring>.
15353 (Layout::is_debug_info_section): New function.
15354 (Layout::add_comdat): Add new parameters.
15355 (Layout::find_kept_object): New function.
15356 (Layout::Kept_section): New struct.
15357 (Layout::Signatures): Change type of map range.
15358 * object.cc (Relobj::output_section_address): New function.
15359 (Sized_relobj::include_section_group): Add new parameters. Change
15360 calls to Layout::add_comdat. Change to build table of kept comdat
15361 groups and table mapping discarded sections to kept sections.
15362 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15363 (Sized_relobj::do_layout): Change calls to include_section_group and
15364 include_linkonce_section.
15365 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15366 value to zero when section is discarded.
15367 (Sized_relobj::map_to_kept_section): New function.
15368 * object.h (Relobj::output_section_address): New function.
15369 (Relobj::Comdat_group): New type.
15370 (Relobj::find_comdat_group): New function.
15371 (Relobj::Comdat_group_table): New type.
15372 (Relobj::Kept_comdat_section): New type.
15373 (Relobj::Kept_comdat_section_table): New type.
15374 (Relobj::add_comdat_group): New function.
15375 (Relobj::set_kept_comdat_section): New function.
15376 (Relobj::get_kept_comdat_section): New function.
15377 (Relobj::comdat_groups_): New field.
15378 (Relobj::kept_comdat_sections_): New field.
15379 (Symbol_value::input_value): Update comment.
15380 (Sized_relobj::map_to_kept_section) New function.
15381 (Sized_relobj::include_linkonce_section): Add new parameter.
15382 * target-reloc.h (Comdat_behavior): New type.
15383 (get_comdat_behavior): New function.
15384 (relocate_section): Add code to map a discarded section to the
15385 corresponding kept section when applying a relocation.
15386
e4e5049b
CS
153872008-04-30 Craig Silverstein <csilvers@google.com>
15388
15389 * dwarf_reader.cc (next_generation_count): New static var.
15390 (Addr2line_cache_entry): New struct.
15391 (addr2line_cache): New static var.
15392 (Dwarf_line_info::one_addr2line): Added caching.
15393 (Dwarf_line_info::clear_addr2line_cache): New function.
15394 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15395 cache-size parameter.
15396 (Dwarf_line_info::one_addr2line_cache): New function.
15397 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15398 new cache-size argument to one_addr2line(), and clear cache.
15399
d09e9154
CC
154002008-04-28 Cary Coutant <ccoutant@google.com>
15401
15402 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15403 R_386_PC8 relocations.
15404
7ef73768
ILT
154052008-04-23 Ian Lance Taylor <iant@google.com>
15406
55438702
ILT
15407 * object.cc (Sized_relobj::include_section_group): Check for
15408 invalid section group.
15409
c165fb93
ILT
15410 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15411 header size.
15412
7ef73768
ILT
15413 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15414 than read for file header.
15415 * archive.cc (Archive::include_member): Likewise.
15416
6194aaab
L
154172008-04-23 Paolo Bonzini <bonzini@gnu.org>
15418
15419 * aclocal.m4: Regenerate.
15420 * configure: Regenerate.
15421
d491d34e
ILT
154222008-04-19 Ian Lance Taylor <iant@google.com>
15423
5ea2bac6
ILT
15424 * version.cc (version_string): Bump to 1.6.
15425
7bc3e21a
ILT
15426 * testsuite/Makefile.am (many_sections_r_test): New target.
15427 (many_sections_r_test_SOURCES): Remove.
15428 (many_sections_r_test_DEPENDENCIES): Remove.
15429 (many_sections_r_test_LDFLAGS): Remove.
15430 (many_sections_r_test_LDADD): Remove.
15431
7fcd3aa9
ILT
15432 * object.cc (Sized_relobj::do_add_symbols): Always pass
15433 local_symbol_count_ to add_from_relobj.
15434
4c94d6ae
ILT
15435 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15436 every thousand variables.
15437 * testsuite/Makefile.in: Rebuild.
15438
d491d34e
ILT
15439 * object.cc (Xindex::initialize_symtab_xindex): New function.
15440 (Xindex::read_symtab_xindex): New function.
15441 (Xindex::sym_xindex_to_shndx): New function.
15442 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15443 available.
15444 (Sized_relobj::do_initialize_xindex): New function.
15445 (Sized_relobj::do_read_symbols): Adjust section links.
15446 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15447 parameter. Change all callers.
15448 (Sized_relobj::include_section_group): Adjust section links and
15449 symbol section indexes.
15450 (Sized_relobj::do_layout): Adjust section links.
15451 (Sized_relobj::do_count_local_symbols): Adjust section links and
15452 symbol section indexes.
15453 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15454 ordinary and special symbols.
15455 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15456 dynsym_xindex parameters. Change all callers. Adjust section
15457 links. Use SHN_XINDEX when needed.
15458 (Sized_relobj::get_symbol_location_info): Adjust section links.
15459 Don't get fooled by special symbols.
15460 * object.h (class Xindex): Define.
15461 (class Object): Add xindex_ parameter. Declare virtual functoin
15462 do_initialize_xindex.
15463 (Object::adjust_sym_shndx): New function.
15464 (Object::set_xindex): New protected function.
15465 (class Symbol_value): Add is_ordinary_shndx_ field.
15466 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15467 (Symbol_value::value): Assert ordinary section.
15468 (Symbol_value::initialize_input_to_output_map): Likewise.
15469 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15470 Change all callers.
15471 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15472 all callers.
15473 (class Sized_relobj): Update declarations.
15474 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15475 parameter. Change all callers.
15476 (Sized_relobj::adjust_shndx): New function.
15477 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15478 field.
15479 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15480 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15481 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15482 (Sized_dynobj::read_dynsym_section): Adjust section links.
15483 (Sized_dynobj::read_dynamic): Likewise.
15484 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15485 section links.
15486 (Sized_dynobj::do_initialize_xindex): New function.
15487 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15488 do_initialize_xindex.
15489 (Sized_dynobj::adjust_shndx): New function.
15490 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15491 dynsym_xindex_ fields.
15492 (Layout::finalize): Add a call to set_section_indexes before
15493 creating the symtab sections.
15494 (Layout::set_section_indexes): Don't do anything if the section
15495 already has a section index.
15496 (Layout::create_symtab_sections): Add shnum parameter. Change
15497 caller. Create .symtab_shndx section if needed.
15498 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15499 caller.
15500 (Layout::allocated_output_section_count): New function.
15501 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15502 needed.
15503 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15504 fields. Update declarations.
15505 (Layout::symtab_xindex): New function.
15506 (Layout::dynsym_xindex): New function.
15507 (class Write_symbols_task): Add layout_ field.
15508 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15509 Change caller.
15510 * output.cc (Output_section_headers::Output_section_headers): Add
15511 shstrtab_section parameter. Change all callers.
15512 (Output_section_headers::do_sized_write): Store overflow values
15513 for section count and section string table section index in
15514 section header zero.
15515 (Output_file_header::do_sized_write): Check for overflow of
15516 section count and section string table section index.
15517 (Output_symtab_xindex::do_write): New function.
15518 (Output_symtab_xindex::endian_do_write): New function.
15519 * output.h (class Output_section_headers): Add shstrtab_section_.
15520 Update declarations.
15521 (class Output_symtab_xindex): Define.
15522 (Output_section::has_out_shndx): New function.
15523 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15524 field.
15525 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15526 Change all callers.
15527 (Sized_symbol::init): Likewise.
15528 (Symbol::output_section): Check for ordinary symbol.
15529 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15530 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15531 callers.
15532 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15533 Change all callers. Simplify handling of symbols from sections
15534 not included in the link.
15535 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15536 distinction.
15537 (Weak_alias_sorter::operator()): Assert that symbols are
15538 ordinary.
15539 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15540 distinction.
15541 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15542 parameters. Change all callers.
15543 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15544 symbol distinction. Use SHN_XINDEX when needed.
15545 (Symbol_table::write_section_symbol): Add symtab_xindex
15546 parameter. Change all callers.
15547 (Symbol_table::sized_write_section_symbol): Likewise. Use
15548 SHN_XINDEX when needed.
15549 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15550 declarations.
15551 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15552 (Symbol::is_defined): Check is_ordinary.
15553 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15554 (Symbol::is_absolute, Symbol::is_common): Likewise.
15555 (class Sized_symbol): Update declarations.
15556 (class Symbol_table): Update declarations.
15557 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15558 parameters. Change all callers.
15559 (Sized_symbol::override): Likewise.
15560 (Symbol_table::override): Likewise.
15561 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15562 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15563 is_ordinary, and orig_st_shndx parameters. Change all callers.
15564 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15565 to be in an ordinary section.
15566 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15567 object and is_ordinary parameters. Change all callers.
15568 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15569 Change all callers. Don't add undefined or non-ordinary symbols
15570 to reloc_map_.
15571 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15572 Change all callers.
15573 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15574 declarations.
15575 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15576 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15577 (Sized_relobj::relocate_sections): Likewise.
15578 * target-reloc.h (scan_relocs): Adjust section symbol index.
15579 (scan_relocatable_relocs): Likewise.
15580 * i386.cc (Scan::local): Check for ordinary symbols.
15581 * sparc.cc (Scan::local): Likewise.
15582 * x86_64.cc (Scan::local): Likewise.
15583 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15584 to symbol_section_and_value.
15585 * testsuite/many_sections_test.cc: New file.
15586 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15587 (check_PROGRAMS): Add many_sections_test.
15588 (many_sections_test_SOURCES): Define.
15589 (many_sections_test_DEPENDENCIES): Define.
15590 (many_sections_test_LDFLAGS): Define.
15591 (BUILT_SOURCES): Add many_sections_define.h.
15592 (many_sections_define.h): New target.
15593 (BUILT_SOURCES): Add many_sections_check.h.
15594 (many_sections_check.h): New target.
15595 (check_PROGRAMS): Add many_sections_r_test.
15596 (many_sections_r_test_SOURCES): Define.
15597 (many_sections_r_test_DEPENDENCIES): Define.
15598 (many_sections_r_test_LDFLAGS): Define.
15599 (many_sections_r_test_LDADD): Define.
15600 (many_sections_r_test.o): New target.
15601 * testsuite/Makefile.in: Rebuild.
15602
c5818ff1
CC
156032008-04-17 Cary Coutant <ccoutant@google.com>
15604
15605 * errors.cc (Errors::info): New function.
15606 (gold_info): New function.
15607 * errors.h (Errors::info): New function.
15608 * gold.h (gold_info): New function.
15609 * object.cc (Input_objects::add_object): Print trace output.
15610 * options.cc (options::parse_set): New function.
15611 (General_options::parse_wrap): Deleted.
15612 (General_options::General_options): Deleted initializer.
15613 * options.h (options::String_set): New typedef.
15614 (options::parse_set): New function.
15615 (DEFINE_set): New macro.
15616 (General_options::wrap): Changed to use DEFINE_set. Changed
15617 callers of any_wrap_symbols and is_wrap_symbol.
15618 (General_options::trace, General_options::trace_symbol):
15619 New options.
15620 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15621 (General_options::wrap_symbols_): Deleted.
15622 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15623
b5be4a7c
DM
156242008-04-17 David S. Miller <davem@davemloft.net>
15625
15626 * options.cc (General_options::parse_V): New function.
15627 * options.h: Add entries for -V and -Qy.
15628
155a0dd7
ILT
156292008-04-17 Ian Lance Taylor <iant@google.com>
15630
15631 * common.cc (Symbol_table::allocate_commons): Remove options
15632 parameter. Change caller.
15633 (Symbol_table::do_allocate_commons): Remove options parameter.
15634 Change caller. Just call do_allocate_commons_list twice.
15635 (Symbol_table::do_allocate_commons_list): New function, broken out
15636 of do_allocate_commons.
15637 * common.h (class Allocate_commons_task): Remove options_ field.
15638 Update constructor.
15639 * symtab.cc (Symbol_table::Symbol_table): Initialize
15640 tls_commons_.
15641 (Symbol_table::add_from_object): Put TLS common symbols on
15642 tls_commons_ list.
15643 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15644 which are IN_OUTPUT_DATA.
15645 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15646 allocate_commons and do_allocate_commons declarations. Declare
15647 do_allocate_commons_list.
15648 * gold.cc (queue_middle_tasks): Update creation of
15649 Allocate_commons_task to not pass options.
15650 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15651 (TLS_TEST_C_FLAGS): New variable.
15652 (tls_test_c_pic.o): New target.
15653 (tls_test_shared.so): Link in tls_test_c_pic.o.
15654 (tls_test_c_pic_ie.o): New target.
15655 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15656 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15657 (tls_test_c.o): New target.
15658 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15659 (tls_pic_test_LDADD): Likewise.
15660 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15661 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15662 (tls_test_c_gnu2.o): New target.
15663 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15664 tls_test_c_gnu2.o.
15665 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15666 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15667 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15668 * testsuite/tls_test.cc: Include "config.h".
15669 (t_last): Call t11_last.
15670 * testsuite/tls_test.h (t11, t11_last): Declare.
15671 * testsuite/tls_test_c.c: New file.
15672 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15673 * configure.ac: Check for OpenMP support.
15674 * configure, config.in, Makefile.in: Rebuild.
15675 * testsuite/Makefile.in: Rebuild.
15676
edfbb029
CC
156772008-04-16 Cary Coutant <ccoutant@google.com>
15678
15679 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15680 (Target_i386::tls_base_symbol_defined_): New field.
15681 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15682 (Target_i386::Scan::global): Likewise.
15683 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15684 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15685 (Target_x86_64::tls_base_symbol_defined_): New field.
15686 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15687 (Target_x86_64::Scan::global): Likewise.
15688
f3c69fca
CC
156892008-04-16 Cary Coutant <ccoutant@google.com>
15690
15691 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15692 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15693 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15694 building shared libraries.
15695 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15696 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15697 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15698 * testsuite/Makefile.in: Rebuild.
15699 * testsuite/weak_undef.h: New file.
15700 * testsuite/weak_undef_file1.cc: Add extra test cases.
15701 * testsuite/weak_undef_file2.cc: Likewise.
15702 * testsuite/weak_undef_test.cc: Likewise.
15703
7c414435
DM
157042008-04-16 David S. Miller <davem@davemloft.net>
15705
32b769e1
DM
15706 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15707 Add issued_non_pic_error_ field. Declare check_non_pic.
15708 (Target_sparc::Scan::check_non_pic): New function.
15709 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15710 (Target_sparc::Scan::global): Likewise.
15711
11936fb1
DM
15712 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15713 * configure: Rebuild.
15714
7c414435
DM
15715 * options.h (DEFINE_enable): New macro.
15716 (new_dtags): New enable option.
15717 (initfirst, interpose, loadfltr, nodefaultlib,
15718 nodelete, nodlopen, nodump): New -z options.
15719 * layout.cc (Layout:finish_dynamic_section): If new
15720 dtags enabled, emit DT_RUNPATH. Also, emit a
15721 DT_FLAGS_1 containing any specified -z flags.
15722
85c7bf8b
ILT
157232008-04-16 Ian Lance Taylor <iant@google.com>
15724
12c0daef
ILT
15725 * copy-relocs.cc: New file.
15726 * copy-relocs.h: New file.
15727 * reloc.cc: Remove Copy_relocs code.
15728 * reloc.h: Likewise.
15729 * reloc-types.h (struct Reloc_types) [both versions]: Add
15730 get_reloc_addend_noerror.
15731 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15732 variants of add_global which take an addend which must be zero.
15733 * i386.cc: Include "copy-relocs.h".
15734 (class Target_i386): Change type of copy_relocs_ to variable,
15735 update initializer.
15736 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15737 Change all callers.
15738 (Target_i386::do_finalize_sections): Change handling of
15739 copy_relocs_.
15740 * sparc.cc: Include "copy-relocs.h".
15741 (class Target_sparc): Change type of copy_relocs_ to variable,
15742 update initializer.
15743 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15744 Change all callers.
15745 (Target_sparc::do_finalize_sections): Change handling of
15746 copy_relocs_.
15747 * x86_64.cc: Include "copy-relocs.h".
15748 (class Target_x86_64): Change type of copy_relocs_ to variable,
15749 update initializer.
15750 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15751 class. Change all callers.
15752 (Target_x86_64::do_finalize_sections): Change handling of
15753 copy_relocs_.
15754 * Makefile.am (CCFILES): Add copy-relocs.cc.
15755 (HFILES): Add copy-relocs.h.
15756
4f4995b6
ILT
15757 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15758
85c7bf8b
ILT
15759 * testsuite/script_test_4.sh: Permit leading zeroes.
15760
4f2a9edd
ILT
157612008-04-15 Ian Lance Taylor <iant@google.com>
15762
e6188289
ILT
15763 * script-sections.cc (Script_sections::create_segments): Use
15764 header_size_adjustment even when there is enough room for the
15765 headers.
15766 * testsuite/script_test_4.sh: New file.
15767 * testsuite/script_test_4.t: New file.
15768 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15769 (check_DATA): Add script_test_4.stdout.
15770 (MOSTLYCLEANFILES): Likewise.
15771 (script_test_4): New target.
15772 (script_test_4.stdout): New target.
15773 * testsuite/Makefile.in: Rebuild.
15774
4f2a9edd
ILT
15775 * sparc.cc: Add definitions for Output_data_plt_sparc class
15776 constants.
15777
f5314dd5
DM
157782008-04-14 David S. Miller <davem@davemloft.net>
15779
15780 * sparc.cc: New file.
15781 * Makefile.am (TARGETSOURCES): Add sparc.cc
15782 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15783 * configure.tgt: Document targ_extra_size and
15784 targ_extra_big_endian. Add entries for sparc-* and
15785 sparc64-*.
15786 * configure.ac: Handle targ_extra_size and
15787 targ_extra_big_endian.
15788 * Makefile.in: Rebuild.
15789 * configure: Likewise.
15790 * po/POTFILES.in: Likewise.
15791 * po/gold.pot: Likewise.
15792
154e0e9a
ILT
157932008-04-14 Ian Lance Taylor <iant@google.com>
15794
15795 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15796 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15797 in the name/type/flags to section mapping. Don't call
15798 allocate_output_section.
15799 (Layout::choose_output_section): Change parameter from adjust_name
15800 to is_input_section. Don't permit input sections after sections
15801 are attached to segments. Don't call allocate_output_section.
15802 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15803 not write_enable_output_section.
15804 (Layout::make_output_section): Don't push to
15805 unattached_section_list_ nor call attach_to_segment. Call
15806 attach_section_to_segment if sections are attached.
15807 (Layout::attach_sections_to_segments): New function.
15808 (Layout::attach_section_to_segment): New function.
15809 (Layout::attach_allocated_section_to_segment): Rename from
15810 attach_to_segment. Remove flags parameter.
15811 (Layout::allocate_output_section): Remove function.
15812 (Layout::write_enable_output_section): Remove function.
15813 * layout.h (class Layout): Update for above changes. Add new
15814 field sections_are_attached_.
15815 * output.h (Output_section::update_flags_for_input_section): New
15816 function.
15817 * output.cc (Output_section::add_input_section): Call
15818 update_flags_for_input_section.
15819 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15820
009a67a2
CC
158212008-04-11 Cary Coutant <ccoutant@google.com>
15822
15823 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15824 thought unnecessary.
15825 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15826
759b1a24
ILT
158272008-04-11 Ian Lance Taylor <iant@google.com>
15828
15829 * output.h (class Output_section_data): Remove inline definition
15830 of set_addralign.
15831 * output.cc (Output_section_data::set_addralign): New function.
15832
c2b45e22
CC
158332008-04-11 Cary Coutant <ccoutant@google.com>
15834
15835 Add support for TLS descriptors for i386 and x86_64.
15836 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15837 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15838 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15839 GOT_TYPE_TLS_DESC.
15840 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15841 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15842 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15843 relocations.
15844 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15845 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15846 Fix problem with initial-exec relocations.
15847 (Target_i386::Relocate::relocate_tls): Likewise.
15848 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15849 relaxation.
15850 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15851 support for section-plus-offset dynamic table entries.
15852 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15853 (Output_data_dynamic::Dynamic_entry): Add support for
15854 section-plus-offset dynamic table entries.
15855 (Output_data_dynamic::Classification): Likewise.
15856 (Output_data_dynamic::classification_): Renamed offset_.
15857 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15858 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15859 (Target_x86_64::make_plt_section): New function.
15860 (Target_x86_64::reserve_tlsdesc_entries): New function.
15861 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15862 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15863 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15864 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15865 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15866 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15867 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15868 add extra PLT entry for TLS descriptors.
15869 (Output_data_plt_x86_64::got_): New field.
15870 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15871 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15872 fields.
15873 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15874 descriptors.
15875 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15876 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15877 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15878 R_386_TLS_DESC_CALL relocations.
15879 (Target_x86_64::Scan::global): Likewise.
15880 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15881 for TLS descriptors.
15882 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15883 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15884 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15885 GD-to-IE relaxation.
15886 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15887 and TLS_DESCRIPTORS.
15888 * Makefile.in: Rebuild.
15889 * configure: Rebuild.
15890 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15891 (tls_test_shared2.so): New target.
15892 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15893 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15894 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15895 (tls_shared_gd_to_ie_test_LDADD): New variable.
15896 (tls_shared_gnu2_gd_to_ie_test): New target.
15897 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15898 New targets.
15899 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15900 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15901 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15902 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15903 (tls_shared_gnu2_test): New target.
15904 (tls_test_gnu2_shared.so): New target.
15905 (tls_shared_gnu2_test_SOURCES): New variable.
15906 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15907 (tls_shared_gnu2_test_LDFLAGS): New variable.
15908 (tls_shared_gnu2_test_LDADD): New variable.
15909 * testsuite/Makefile.in: Rebuild.
15910 * testsuite/Makefile.
15911
83bfb6b7
ILT
159122008-04-11 Ian Lance Taylor <iant@google.com>
15913
15914 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15915 justsyms.t.
15916 * testsuite/Makefile.in: Rebuild.
15917
15918 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15919 long.
15920 * testsuite/script_test_2.cc (main): Adjust test.
15921
706e1f5e
ILT
159222008-04-11 David S. Miller <davem@davemloft.net>
15923 Ian Lance Taylor <iant@google.com>
15924
15925 * options.h (General_options): Add entries for '-Y' and
15926 '-relax'.
15927 * options.cc (General_options:finalize): If -Y was used, add those
15928 entries to the library path instead of the default "/lib" and
15929 "/usr/lib".
15930
7c98e6bb
DM
159312008-04-11 David S. Miller <davem@davemloft.net>
15932
15933 * testsuite/justsyms.t: Start at 0x100.
15934 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15935 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15936 long.
15937 * testsuite/script_test_2.cc: Adjust string and section length
15938 checks.
7c98e6bb 15939
99a37bfd
ILT
159402008-04-09 Ian Lance Taylor <iant@google.com>
15941
2cefc357
ILT
15942 PR gold/5996
15943 * script-sections.cc (Sections_element::allocate_to_segment): Add
15944 orphan parameter.
15945 (Output_section_definition::allocate_to_segment): Likewise.
15946 (Orphan_output_section::allocate_to_segment): Likewise.
15947 (Script_sections::attach_sections_using_phdrs_clause): Don't
15948 propagate non-PT_LOAD segments to orphan sections.
15949 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15950 readelf rather than objdump.
15951 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15952 .interp section and PT_INTERP segment are the same size.
15953 * testsuite/Makefile.in: Rebuild.
15954
99a37bfd
ILT
15955 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15956 aliases for symbols defined in the same object.
15957 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15958 (weak_alias_test_SOURCES): New variable.
15959 (weak_alias_test_DEPENDENCIES): New variable.
15960 (weak_alias_test_LDFLAGS): New variable.
15961 (weak_alias_test_LDADD): New variable.
15962 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15963 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15964 (weak_alias_test_3.o): New target.
15965 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15966 * testsuite/weak_alias_test_main.cc: New file.
15967 * testsuite/weak_alias_test_1.cc: New file.
15968 * testsuite/weak_alias_test_2.cc: New file.
15969 * testsuite/weak_alias_test_3.cc: New file.
15970
780e49c5
ILT
159712008-04-08 Ian Lance Taylor <iant@google.com>
15972
cdb0b8f5
ILT
15973 * options.h (class General_options): Add --noinhibit-exec option.
15974 * main.cc (main): Check --noinhibit-exec.
15975
0864d551
ILT
15976 * options.h (class General_options): Define --wrap as a special
15977 option. Add wrap_symbols_ field.
15978 (General_options::any_wrap_symbols): New function.
15979 (General_options::is_wrap_symbol): New function.
15980 * options.cc (General_options::parse_wrap): New function.
15981 (General_options::General_options): Initialize wrap_symbols_.
15982 * symtab.cc (Symbol_table::wrap_symbol): New function.
15983 (Symbol_table::add_from_object): Handle --wrap.
15984 * symtab.h (class Symbol_table): Declare wrap_symbol.
15985 * target.h (Target::wrap_char): New function.
15986 (Target::Target_info): Add wrap_char field.
15987 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15988 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15989 * testsuite/testfile.cc (Target_test::test_target_info):
15990 Likewise.
15991
789aa6de
ILT
15992 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15993 there is one.
15994
2c38906f
ILT
15995 * layout.h (class Layout): Add added_eh_frame_data_ field.
15996 * layout.cc (Layout::Layout): Initialize new field.
15997 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15998 output section until we find a section we merged successfully.
15999 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16000 that the size be non-zero.
16001
780e49c5
ILT
16002 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16003 qualifier.
16004
7fcd0256
ILT
160052008-04-08 Craig Silverstein <csilvers@google.com>
16006
16007 * configure.ac: Export new conditional variable HAVE_ZLIB.
16008 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16009 on HAVE_ZLIB.
16010 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16011 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16012
6835af53
ILT
160132008-04-07 Ian Lance Taylor <iant@google.com>
16014
e24f324c
ILT
16015 * version.cc (version_string): Set to "1.5".
16016
a036edd8
ILT
16017 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16018 Add issued_non_pic_error_ field. Declare check_non_pic.
16019 (Target_x86_64::Scan::check_non_pic): New function.
16020 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16021 (Target_x86_64::Scan::global): Likewise.
16022
624f8810
ILT
16023 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16024 addend parameter. Change caller. Handle merge sections.
16025 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16026 Address to Addend. Don't add in the result of
16027 local_section_offset, pass down the addend and use the returned
16028 value.
16029 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16030 Update declarations of local_section_offset and symbol_value.
16031 * testsuite/two_file_test_1.cc (t18): New function.
16032 * testsuite/two_file_test_2.cc (f18): New function.
16033 * testsuite/two_file_test_main.cc (main): Call t18.
16034 * testsuite/two_file_test.h (t18, f18): Declare.
16035
6835af53
ILT
16036 * configure.ac: Don't test for objdump, c++filt, or readelf.
16037 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16038 conditionals.
16039 (TEST_READELF): New variable.
16040 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16041 (check_PROGRAMS): Add two_file_strip_test.
16042 (two_file_strip_test): New target.
16043 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16044 (two_file_same_shared_strip_test_SOURCES): New variable.
16045 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16046 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16047 (two_file_same_shared_strip_test_LDADD): New variable.
16048 (two_file_shared_strip.so): New target.
16049 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16050 (ver_test_5.syms, ver_test_7.syms): Likewise.
16051 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16052 (strip_test_3.stdout): Use TEST_OBJDUMP.
16053 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16054
86925eef
CC
160552008-04-04 Cary Coutant <ccoutant@google.com>
16056
16057 * symtab.h (Symbol::is_weak_undefined): New function.
16058 (Symbol::is_strong_undefined): New function.
16059 (Symbol::is_absolute): New function.
16060 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16061 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16062 absolute symbols.
16063 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16064 (weak_undef_test): New target.
16065 * testsuite/Makefile.in: Rebuild.
16066 * testsuite/weak_undef_file1.cc: New file.
16067 * testsuite/weak_undef_file2.cc: New file.
16068 * testsuite/weak_undef_test.cc: New file.
16069
126f3ece
ILT
160702008-04-03 Craig Silverstein <csilvers@google.com>
16071
16072 * compressed_output.h (class Output_compressed_section): Use
16073 unsigned buffer.
16074 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16075 add zlib header.
16076 (zlib_compressed_suffix): Removed.
16077 (Output_compressed_section::set_final_data_size): Use unsigned
16078 buffers.
16079 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16080 Fix linker invocation.
16081 (flagstest_o_specialfile_and_compress_debug_sections):
16082 Likewise.
16083 * testsuite/Makefile.in: Regenerated.
16084
deae2a14
DM
160852008-04-02 David S. Miller <davem@davemloft.net>
16086
16087 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16088 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16089
70752818
ILT
160902008-04-02 Craig Silverstein <csilvers@google.com>
16091
16092 * TODO: New file.
16093
39d0cb0e
ILT
160942008-04-02 Ian Lance Taylor <iant@google.com>
16095
16096 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16097 parameters. Update for new key type to views_. Change all
16098 callers.
16099 (File_read::read): Adjust for byteshift in returned view.
16100 (File_read::add_view): New function, broken out of
16101 find_and_make_view.
16102 (File_read::make_view): New function, broken out of
16103 find_and_make_view.
16104 (File_read::find_or_make_view): Add offset and aligned
16105 parameters. Rewrite accordingly. Change all callers.
16106 (File_read::get_view): Add offset and aligned parameters. Adjust
16107 for byteshift in return value.
16108 (File_read::get_lasting_view): Likewise.
16109 * fileread.h (class File_read): Update declarations.
16110 (class File_read::View): Add byteshift_ field. Add byteshift to
16111 constructor. Add byteshift method.
16112 * archive.h (Archive::clear_uncached_views): New function.
16113 (Archive::get_view): Add aligned parameter. Change all callers.
16114 * object.h (Object::get_view): Add aligned parameter. Change all
16115 callers.
16116 (Object::get_lasting_view): Likewise.
16117
16118 * fileread.cc (File_read::release): Don't call clear_views if
16119 there are multiple objects.
16120 * fileread.h (File_read::clear_uncached_views): New function.
16121 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16122 on the archive.
16123
a1207466
CC
161242008-03-31 Cary Coutant <ccoutant@google.com>
16125
16126 Add thin archive support.
16127 * archive.cc (Archive::armagt): New const.
16128 (Archive::setup): Remove task parameter and calls to unlock.
16129 (Archive::unlock_nested_archives): New function.
16130 (Archive::read_header): Add nested_off parameter. Change
16131 all callers.
16132 (Archive::interpret_header): Likewise.
16133 (Archive::include_all_members): Change to handle thin
16134 archives.
16135 (Archive::include_member): Likewise.
16136 * archive.h (Archive::Archive): Add new parameters and
16137 initializers.
16138 (Archive::armagt): New const.
16139 (Archive::setup): Remove task parameter.
16140 (Archive::unlock_nested_archives): New function.
16141 (Archive::read_header): Add nested_off parameter.
16142 (Archive::interpret_header): Likewise.
16143 (Archive::Nested_archive_table): New typedef.
16144 (Archive::is_thin_archive_): New field.
16145 (Archive::nested_archives_): New field.
16146 (Archive::options_): New field.
16147 (Archive::dirpath_): New field.
16148 (Archive::task_): New field.
16149 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16150 for thin archives. Pass additional parameters to
16151 Archive::Archive. Unlock the archive file after calling
16152 Archive::setup.
cd536b21 16153
479f6503
ILT
161542008-03-29 Ian Lance Taylor <iant@google.com>
16155
686c8caf
ILT
16156 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16157 version symbol to be local.
16158 * testsuite/ver_test_4.sh: New file.
16159 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16160 (check_DATA): Add ver_test_4.syms.
16161 (ver_test_4.syms): New target.
16162 * testsuite/Makefile.in: Rebuild.
16163
ab794b6b
ILT
16164 * output.cc
16165 (Output_section::Input_section_sort_entry::has_priority): New
16166 function.
16167 (Output_section::Input_section_sort_entry::match_file_name): New
16168 function.
16169 (Output_section::Input_section_sort_entry::match_section_name):
16170 Remove.
16171 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16172 Remove.
16173 (Output_section::Input_section_sort_entry::match_section_file):
16174 Remove.
16175 (Output_section::Input_section_sort_compare::operator()): Rewrite
16176 using new Input_section_sort_entry functions. Sort crtbegin and
16177 crtend first. Sort sections with no priority before sections with
16178 a priority.
16179 * testsuite/initpri1.c (d3): Check j != 4.
16180 (cd5): New constructor/destructor function.
16181 (main): Check j != 2.
16182
479f6503
ILT
16183 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16184 new symbol when resolving, don't call set_is_default.
16185 * testsuite/ver_test_7.cc: New file.
16186 * testsuite/ver_test_7.sh: New file.
16187 * testsuite/Makefile.am (ver_test_7.so): New target.
16188 (ver_test_7.o): New target.
16189 (check_SCRIPTS): Add ver_test_7.sh.
16190 (check_DATA): Add ver_test_7.syms.
16191 (ver_test_7.syms): New target.
16192
2fd32231
ILT
161932008-03-28 Ian Lance Taylor <iant@google.com>
16194
16195 * layout.cc (Layout::layout): If we see an input section with a
16196 name that needs sorting, set the must_sort flag for the output
16197 section.
16198 (Layout::make_output_section): If the name of the output section
16199 indicates that it might require sorting, set the may_sort flag.
16200 * output.h (Output_section::may_sort_attached_input_sections): New
16201 function.
16202 (Output_section::set_may_sort_attached_input_sections): New
16203 function.
16204 (Output_section::must_sort_attached_input_sections): New
16205 function.
16206 (Output_section::set_must_sort_attached_input_sections): New
16207 function.
16208 (class Output_section): Declare Input_section_sort_entry. Define
16209 Input_section_sort_compare. Declare
16210 sort_attached_input_sections. Add new fields:
16211 may_sort_attached_input_sections_,
16212 must_sort_attached_input_sections_,
16213 attached_input_sections_are_sorted_.
16214 * output.cc (Output_section::Output_section): Initialize new
16215 fields.
16216 (Output_section::add_input_section): Add an entry to
16217 input_sections_ if may_sort or must_sort are true.
16218 (Output_section::set_final_data_size): Call
16219 sort_attached_input_sections if necessary.
16220 (Output_section::Input_section_sort_entry): Define new class.
16221 (Output_section::Input_section_sort_compare::operator()): New
16222 function.
16223 (Output_section::sort_attached_input_sections): New function.
16224 * configure.ac: Check whether the compiler supports constructor
16225 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16226 * testsuite/initpri1.c: New file.
16227 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16228 CONSTRUCTOR_PRIORITY.
16229 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16230 (initpri1_LDFLAGS): New variable.
16231 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16232
18e6b24e
ILT
162332008-03-27 Ian Lance Taylor <iant@google.com>
16234
49bdd526
ILT
16235 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16236 * testsuite/common_test_1.c: New file.
16237 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16238 (common_test_1_SOURCES): New variable.
16239 (common_test_1_DEPENDENCIES): New variable.
16240 (common_test_1_LDFLAGS): New variable.
16241
18e6b24e
ILT
16242 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16243 and commons_ correctly when NAME/VERSION does not override
16244 NAME/NULL.
16245 * testsuite/ver_test_6.c: New file.
16246 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16247 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16248 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16249
04bf7072
ILT
162502008-03-26 Ian Lance Taylor <iant@google.com>
16251
5871526f
ILT
16252 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16253 of an undefined symbol from a version script.
16254 * testsuite/Makefile.am (ver_test_5.so): New target.
16255 (ver_test_5.o): New target.
16256 (check_SCRIPTS): Add ver_test_5.sh.
16257 (check_DATA): Add ver_test_5.syms.
16258 (ver_test_5.syms): New target.
16259 * testsuite/ver_test_5.cc: New file.
16260 * testsuite/ver_test_5.script: New file.
16261 * testsuite/ver_test_5.sh: New file.
16262 * Makefile.in, testsuite/Makefile.in: Rebuild.
16263
04bf7072
ILT
16264 PR gold/5986
16265 Fix problems building gold with gcc 4.3.0.
16266 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16267 (gold_error_at_location, gold_warning_at_location): Use it.
16268 * configure.ac: Check whether we can compile and use a template
16269 function with a printf attribute.
16270 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16271 when jumping over bytes.
16272 * object.cc: Instantiate Object::read_section_data.
16273 * debug.h: Include <cstring>
16274 * dwarf_reader.cc: Include <algorithm>
16275 * main.cc: Include <cstring>.
16276 * options.cc: Include <cstring>.
16277 * output.cc: Include <cstring>.
16278 * script.cc: Include <cstring>.
16279 * script.h: Include <string>.
16280 * symtab.cc: Include <cstring> and <algorithm>.
16281 * target-select.cc: Include <cstring>.
16282 * version.cc: Include <string>.
16283 * testsuite/testmain.cc: Include <cstdlib>.
16284 * configure, config.in: Rebuild.
16285
874c5b28
ILT
162862008-03-25 Ian Lance Taylor <iant@google.com>
16287
819d6c3a
ILT
16288 * options.cc: Include "../bfd/bfdver.h".
16289 (options::help): Print bug reporting address.
16290
f4b2c6f5
ILT
16291 * version.cc (print_version): Adjust output for current value of
16292 BFD_VERSION_STRING.
16293
16294 * NEWS: New file.
16295
e96caa79
ILT
16296 * options.cc (options::help): Print list of supported targets.
16297 * target-select.h: Include <vector>.
16298 (class Target_selector): Make machine_, size_, and is_big_endian_
16299 fields const. Add bfd_name_ and instantiated_target_ fields.
16300 (Target_selector::Target_selector): Add bfd_name parameter.
16301 (Target_selector::recognize): Make non-virtual, call
16302 do_recognize.
16303 (Target_selector::recognize_by_name): Make non-virtual, call
16304 do_recognize_by_name.
16305 (Target_selector::supported_names): New function.
16306 (Target_selector::bfd_name): New function.
16307 (Target_selector::do_instantiate_target): New pure virtual
16308 function.
16309 (Target_selector::do_recognize): New virtual function.
16310 (Target_selector::do_recognize_by_name): New virtual function.
16311 (Target_selector::instantiate_target): New private function.
16312 (supported_target_names): Declare.
16313 * target-select.cc (Target_selector::Target_selector): Update for
16314 new parameter and fields.
16315 (select_target_by_name): Check that the name matches before
16316 calling recognize_by_name.
16317 (supported_target_names): New function.
16318 * i386.cc (class Target_selector_i386): Update Target_selector
16319 constructor call. Remove recognize and recognize_by_name. Add
16320 do_instantiate_target.
16321 * x86_64.cc (class Target_selector_x86_64): Likewise.
16322 * testsuite/testfile.cc (class Target_selector_test): Update for
16323 changes to Target_selector.
16324
874c5b28
ILT
16325 * README: Rewrite, with some notes on unsupported features.
16326
0a65a3a7
CC
163272008-03-24 Cary Coutant <ccoutant@google.com>
16328
16329 * i386.cc (Target_i386::Got_type): New enum declaration.
16330 (Target_i386::Scan::local): Updated callers of Output_data_got
16331 member functions.
16332 (Target_i386::Scan::global): Likewise.
16333 (Target_i386::Relocate::relocate): Likewise.
16334 (Target_i386::Relocate::relocate_tls): Likewise.
16335 * object.h (Got_offset_list): New class.
16336 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16337 (Sized_relobj::local_got_offset): Likewise.
16338 (Sized_relobj::set_local_got_offset): Likewise.
16339 (Sized_relobj::local_has_tls_got_offset): Removed.
16340 (Sized_relobj::local_tls_got_offset): Removed.
16341 (Sized_relobj::set_local_tls_got_offset): Removed.
16342 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16343 * output.cc (Output_data_got::add_global): Added got_type parameter.
16344 (Output_data_got::add_global_with_rel): Likewise.
16345 (Output_data_got::add_global_with_rela): Likewise.
16346 (Output_data_got::add_global_pair_with_rel): New function.
16347 (Output_data_got::add_global_pair_with_rela): New function.
16348 (Output_data_got::add_local): Added got_type parameter.
16349 (Output_data_got::add_local_with_rel): Likewise.
16350 (Output_data_got::add_local_with_rela): Likewise.
16351 (Output_data_got::add_local_pair_with_rel): New function.
16352 (Output_data_got::add_local_pair_with_rela): New function.
16353 (Output_data_got::add_global_tls): Removed.
16354 (Output_data_got::add_global_tls_with_rel): Removed.
16355 (Output_data_got::add_global_tls_with_rela): Removed.
16356 (Output_data_got::add_local_tls): Removed.
16357 (Output_data_got::add_local_tls_with_rel): Removed.
16358 (Output_data_got::add_local_tls_with_rela): Removed.
16359 * output.h (Output_data_got::add_global): Added got_type parameter.
16360 (Output_data_got::add_global_with_rel): Likewise.
16361 (Output_data_got::add_global_with_rela): Likewise.
16362 (Output_data_got::add_global_pair_with_rel): New function.
16363 (Output_data_got::add_global_pair_with_rela): New function.
16364 (Output_data_got::add_local): Added got_type parameter.
16365 (Output_data_got::add_local_with_rel): Likewise.
16366 (Output_data_got::add_local_with_rela): Likewise.
16367 (Output_data_got::add_local_pair_with_rel): New function.
16368 (Output_data_got::add_local_pair_with_rela): New function.
16369 (Output_data_got::add_global_tls): Removed.
16370 (Output_data_got::add_global_tls_with_rel): Removed.
16371 (Output_data_got::add_global_tls_with_rela): Removed.
16372 (Output_data_got::add_local_tls): Removed.
16373 (Output_data_got::add_local_tls_with_rel): Removed.
16374 (Output_data_got::add_local_tls_with_rela): Removed.
16375 * resolve.cc (Symbol::override_base_with_special): Removed
16376 reference to has_got_offset_ field.
16377 * symtab.cc (Symbol::init_fields): Replaced initialization
16378 of got_offset_ with got_offsets_. Removed initialization
16379 of has_got_offset_
53fcba31 16380 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16381 (Symbol::got_offset): Likewise.
16382 (Symbol::set_got_offset): Likewise.
16383 (Symbol::has_tls_got_offset): Removed.
16384 (Symbol::tls_got_offset): Removed.
16385 (Symbol::set_tls_got_offset): Removed.
16386 (Symbol::got_offset_): Removed.
16387 (Symbol::tls_mod_got_offset_): Removed.
16388 (Symbol::tls_pair_got_offset_): Removed.
16389 (Symbol::got_offsets_): New field.
16390 (Symbol::has_got_offset): Removed.
16391 (Symbol::has_tls_mod_got_offset): Removed.
16392 (Symbol::has_tls_pair_got_offset): Removed.
16393 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16394 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16395 member functions.
16396 (Target_x86_64::Scan::global): Likewise.
16397 (Target_x86_64::Relocate::relocate): Likewise.
16398 (Target_x86_64::Relocate::relocate_tls): Likewise.
16399
bd52eafb
BE
164002008-03-25 Ben Elliston <bje@au.ibm.com>
16401
16402 * yyscript.y: Fix spelling error in comment.
16403
8b105e34
ILT
164042008-03-24 Ian Lance Taylor <iant@google.com>
16405
8ed814a9
ILT
16406 * options.h (class General_options): Define build_id option.
16407 * layout.h (class Layout): Declare write_build_id, create_note,
16408 create_build_id. Add build_id_note_ member.
16409 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16410 "libiberty.h", "md5.h", "sha1.h".
16411 (Layout::Layout): Initialize eh_frame_data_,
16412 eh_frame_hdr_section_, and build_id_note_.
16413 (Layout::finalize): Call create_build_id.
16414 (Layout::create_note): New function, broken out of
16415 Layout::create_gold_note.
16416 (Layout::create_gold_note): Call create_note.
16417 (Layout::create_build_id): New function.
16418 (Layout::write_build_id): New function.
16419 (Close_task_runner::run): Call write_build_id.
16420
8b105e34
ILT
16421 * x86_64.cc: Correct license to GPLv3.
16422
086a1841
ILT
164232008-03-23 Ian Lance Taylor <iant@google.com>
16424
16425 * options.cc: Include "demangle.h".
16426 (parse_optional_string): New function.
16427 (parse_long_option): Handle takes_optional_argument.
16428 (parse_short_option): Update dash_z initializer. Handle
16429 takes_optional_argument.
16430 (General_options::General_options): Initialize do_demangle_.
16431 (General_options::finalize): Set do_demangle_. Handle demangling
16432 style.
16433 * options.h (parse_optional_string): Declare.
16434 (struct One_option): Add optional_arg field. Update constructor.
16435 Update call constructor calls. Add takes_optional_argument
16436 function.
16437 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16438 (DEFINE_optional_string): Define.
16439 (General_options::demangle): Change from DEFINE_bool to
16440 DEFINE_optional_string.
16441 (General_options::no_demangle): New function.
16442 (General_options::do_demangle): New function.
16443 (General_options::set_do_demangle): New function.
16444 (General_options::execstack_status_): Move definition to end of
16445 class definition.
16446 (General_options::static_): Likewise.
16447 (General_options::do_demangle_): New field.
16448 * object.cc (big_endian>::get_symbol_location_info): Call
16449 Options::do_demangle, not Options::demangle.
16450 * symtab.cc (demangle): Likewise.
16451
cbb93e63
ILT
164522008-03-22 Ian Lance Taylor <iant@google.com>
16453
16454 * gold.h: Include <cstddef> and <sys/types.h>
16455 * options.h: Include <cstring>.
16456
ec531623
ILT
164572008-03-21 Ian Lance Taylor <iant@google.com>
16458
16459 * Added source code to GNU binutils.
752937aa 16460\f
b90efa5b 16461Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16462
16463Copying and distribution of this file, with or without modification,
16464are permitted in any medium without royalty provided the copyright
16465notice and this notice are preserved.
16466
16467Local Variables:
16468mode: change-log
16469left-margin: 8
16470fill-column: 74
16471version-control: never
16472End:
This page took 1.084585 seconds and 4 git commands to generate.