MIPS: Add support for microMIPS Linux signal trampolines
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
4759c34e
L
12014-12-03 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/17675
4 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
5 * testsuite/Makefile.in: Regenerated.
6
1f98a074
AM
72014-12-03 Alan Modra <amodra@gmail.com>
8
9 PR 17566
10 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
11 when adding dynamic relocations against section symbols.
12
fb257835
DI
132014-12-01 Dimitry Ivanov <dimitry@google.com>
14
15 * layout.cc (Layout::finish_dynamic_section): When '-z global'
16 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
17 * options.h (General_options): New -z option (global).
18
d8e60314
CC
192014-12-01 Cary Coutant <ccoutant@google.com>
20
21 PR gold/17578
22 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
23 is given.
24 (Layout::create_executable_stack_info): Warn when -z noexecstack is
25 given but some inputs require executable stack.
26
982bbd97
CC
272014-11-26 Cary Coutant <ccoutant@google.com>
28
29 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
30 .debug_str_offsets; strip .debug_gnu_pubnames and
31 .debug_gnu_pubtypes.
32 (lines_only_debug_sections): Strip all four new sections.
33
bb779192
HS
342014-11-26 Jing Yu <jingyu@google.com>
35
36 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
37 register to be x0 when to relax TLSDESC_LD64_LO12.
38
a3e60ddb
AM
392014-11-26 Alan Modra <amodra@gmail.com>
40
41 * powerpc.cc (struct Stub_table_owner): New.
42 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
43 unsigned int vector. Update all references.
44 (powerpc_relobj::set_stub_table): Take an unsigned int param
45 rather than a Stub_table. Update callers.
46 (Powerpc_relobj::clear_stub_table): New function.
47 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
48 stub_group_size_ vars.
49 (Target_powerpc::new_stub_table): Delete.
50 (max_branch_delta): New function, extracted from..
51 (Target_powerpc::Relocate::relocate): ..here..
52 (Target_powerpc::Branch_info::make_stub): ..and here. Return
53 status on whether stub created successfully.
54 (Stub_control::Stub_control): Add "no_size_errors" param. Move
55 default sizing to..
56 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
57 reduce on relax failure.
58 (Target_powerpc::group_sections): Add "no_size_errors" param.
59 Use stub_group_size_. Set up group info in a temp vector,
60 before building Stub_table vector. Account for input sections
61 possibly already converted to relaxed sections.
62 (Stub_table::init): Delete. Merge into..
63 (Stub_table::Stub_table): ..here.
64 (Stub_table::can_reach_stub): New function.
65 (Stub_table::add_plt_call_entry): Add "from" parameter and
66 return true iff stub could be reached.
67 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
68 param too.
69 (Stub_table::clear_stubs): Add "all" param.
70
a20605cf
AM
712014-11-26 Alan Modra <amodra@gmail.com>
72
73 * powerpc.cc (Stub_control::set_output_and_owner): New function.
74 (Target_powerpc::group_sections): Use it.
75
43b64deb
CC
762014-11-25 Cary Coutant <ccoutant@google.com>
77
78 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
79 (Binary_to_elf::write_symbol): Add st_size parameter.
80 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
81
c924eb67
CC
822014-11-25 Cary Coutant <ccoutant@google.com>
83
84 PR gold/17639
85 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
86 (Sized_relobj_file::do_layout): Handle deferred sections properly
87 during GC pass 1. Don't add reloc sections to deferred list twice.
88 * object.h (Sized_relobj_file::is_deferred_layout): New function.
89 (Sized_relobj_file::is_deferred_layout_): New data member.
90
9d585188
L
912014-11-21 H.J. Lu <hongjiu.lu@intel.com>
92
93 PR gold/17619
94 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
95 Check PC-relative offset overflow in PLT entry.
96
3ffaac20
AM
972014-11-21 Alan Modra <amodra@gmail.com>
98
99 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
100 for undefined weaks.
101
0cfb0717
AM
1022014-11-20 Alan Modra <amodra@gmail.com>
103
104 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
105 from --stub-group-size parameter divided by 1024.
106 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
107 template parameter. Update all uses.
108 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
109 has_stub_value. Set for long branches. Don't report overflow for
110 branch to undefined weak symbols. Print info message on
111 overflowing branch to stub.
112
f9dffbf0
AM
1132014-11-20 Alan Modra <amodra@gmail.com>
114
115 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
116
e88ba8d5
L
1172014-11-13 H.J. Lu <hongjiu.lu@intel.com>
118
119 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
120 entry for R_X86_64_GOTPLT64.
121 (Target_x86_64<size>::Relocate::relocate): Update comments for
122 R_X86_64_GOTPLT64.
123
d37ffe25
ED
1242014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
125
126 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
127 * plugin.h: add lock definition
128
9726c3c1
HS
1292014-10-29 Han Shen <shenhan@google.com>
130 Jing Yu <jingyu@google.com>
131
132 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
133 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
134 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
135 Symbol::TLS_REF.
136 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
137 method.
138 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
139 (Target_aarch64::tls_ld_to_le): New method.
140 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
141 for 64bit targets.
142 (Output_data_plt_aarch64::irelative_rel_): New data member.
143 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
144 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
145 (Output_data_plt_aarch64::add_relocation): New method.
146 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
147 offset. Add got_irelative size to got size.
148 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
149 type string with the new typename.
150 (AArch64_relocate_functions::update_adr): Replace parameter x with
151 immed.
152 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
153 (AArch64_relocate_functions::reloc_common): New method.
154 (AArch64_relocate_funcsions::rela_general): Extract common part out
155 into reloc_common method.
156 (AArch64_relocate_functions::rela_general): Likewise.
157 (AArch64_relocate_functions::pcrela_general): Likewise.
158 (AArch64_relocate_functions::adr): New method.
159 (AArch64_relocate_functions::adrp): Calculate immed before calling
160 update_adr.
161 (AArch64_relocate_functions::adrp): Likewise.
162 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
163 comparing x to 0. Calculate immed from ~x when x < 0.
164 (Target_aarch64::optimize_tls_reloc): Add new cases for
165 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
166 TLSLD_MOVW_DTPREL_G0_NC.
167 (Target_aarch64::possible_function_pointer_reloc): Implement this
168 method.
169 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
170 comment.
171 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
172 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
173 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
174 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
175 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
176 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
177 (Target_aarch64::make_plt_entry): Call add_entry with two more
178 parameters.
179 (Target_aarch64::make_local_ifunc_plt_entry): New method.
180 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
181 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
182 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
183 (Target_aarch64::Relocate::relocate_tls): Add cases for
184 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
185 TLSLD_MOVW_DTPREL_G0_NC.
186 * testsuite/icf_safe_so_test.cc: Correct test comment.
187 * testsuite/icf_safe_test.sh: Add AArch64 arch.
188
80272b8c
AM
1892014-10-22 Alan Modra <amodra@gmail.com>
190
191 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
192 thread_starter.
193
998a69f4
AS
1942014-10-18 Andreas Schwab <schwab@linux-m68k.org>
195
196 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
197
aed56ec5
CC
1982014-10-17 Cary Coutant <ccoutant@google.com>
199
200 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
201 Add "typename" keyword.
202
bb779192 2032014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
204 Jing Yu <jingyu@google.com>
205
206 Patch for gold aarch64 backend to support relaxation.
207 * aarch64-reloc.def: Change format.
208 * aarch64.cc (class Reloc_stub): New class.
209 (class Stub_table): New class.
210 (class AArch64_relobj): New class.
211 (class AArch64_input_section): New class.
212 (class AArch64_output_section): New class.
213 (Target_aarch64::new_stub_table): New method.
214 (Target_aarch64::new_aarch64_input_section): New method.
215 (Target_aarch64::find_aarch64_input_section): New method.
216 (Target_aarch64::scan_section_for_stubs): New method.
217 (Target_aarch64::scan_reloc_section_for_stubs): New method.
218 (Target_aarch64::relocate_stub): New method.
219 (Target_aarch64::current_target): New method.
220 (Target_aarch64::do_make_elf_object): New method.
221 (Target_aarch64::do_may_relax): New method.
222 (Target_aarch64::do_relax): New method.
223 (Target_aarch64::group_sections): New method.
224 (Target_aarch64::scan_reloc_for_stub): New method.
225 (Target_aarch64::do_make_output_section): New method.
226 (Target_aarch64::stub_tables_): New data member.
227 (Target_aarch64::aarch64_input_section_map_): New data member.
228 (AArch64_relocate_functions::maybe_apply_stub): New method.
229
db4c9594
CC
2302014-09-30 Cary Coutant <ccoutant@google.com>
231
232 PR gold/17432
233 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
234
cd6da036
KC
2352014-09-30 Kito Cheng <kito@0xlab.org>
236
237 PR gold/13597
238 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
239 hash table before sysv-style hash table.
240
5f772412
ST
2412014-09-29 Sriraman Tallam <tmsriram@google.com>
242
243 * options.h (--pic-executable): Add negative to alias to -no-pie.
244
5efeedf6
CC
2452014-09-26 Cary Coutant <ccoutant@google.com>
246
247 PR gold/16773
248 * object.cc (Sized_relobj_file): Compute value of section symbols
249 for TLS sections the same as TLS symbols.
250
1707f183
CC
2512014-09-25 Cary Coutant <ccoutant@google.com>
252
253 PR gold/17432
254 * resolve.cc (Symbol_table::resolve): Override common placeholder
255 symbols, but adjust sizes.
256 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
257 symbols to common lists.
258
00cac886
AM
2592014-09-24 Alan Modra <amodra@gmail.com>
260
261 * po/POTFILES.in: Regenerate.
262
635aa30e
CC
2632014-09-23 Taiju Tsuiki <tzik@google.com>
264 Cary Coutant <ccoutant@google.com>
265
71b9b91b 266 PR gold/14860
635aa30e
CC
267 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
268 on input_sections_blocker.
269 * layout.cc (Write_sections_task::locks): Unblock
270 input_sections_blocker_.
271 * layout.h (Write_sections_task::Write_sections_task): Add
272 input_sections_blocker.
273 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
274 to DEPENDENCIES.
275 * testsuite/Makefile.in: Regenerate.
276
c0c71592
RÁE
2772014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
278
279 * testsuite/Makefile.am (plugin_test_10): New test.
280 * testsuite/Makefile.in: Regenerate
281 * testsuite/plugin_common_test_2.c (c1): Align to 8.
282 * testsuite/plugin_test_10.sh: New file.
283
6168c2a1
RÁE
2842014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
285
286 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
287 * resolve.cc (Symbol_table::resolve): Don't override common symbols
288 during the replacement phase.
289
3a531937
JY
2902014-09-17 Han Shen <shenhan@google.com>
291 Jing Yu <jingyu@google.com>
292
293 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
294 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
295 * aarch64.cc (Target_aarch64): Add data members
296 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
297 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
298 constructor.
299 (Target_aarch64::do_reloc_symbol_index): New method.
300 (Target_aarch64::do_reloc_addend): New method.
301 (Target_aarch64::add_tlsdesc_info): New method.
302 (Target_aarch64::do_dynsym_value): New method.
303 (Target_aarch64::do_make_data_plt): Add new parameters: got,
304 got_irelative. Pass them to Output_data_plt_aarch64_standard.
305 (Target_aarch64::make_data_plt): Add new parameters: got,
306 got_irelative. Pass them to do_make_data_plt.
307 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
308 (Target_aarch64::Relocate:tls_gd_to_le): New method.
309 (Target_aarch64::Relocate:tls_ie_to_le): New method.
310 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
311 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
312 (Target_aarch64::got_tlsdesc_section): New method.
313 (Target_aarch64::make_local_ifunc_plt_entry): New method.
314 (Target_aarch64::define_tls_base_symbol): New method.
315 (Target_aarch64::reserve_tlsdesc_entries): New method.
316 (Target_aarch64::got_mod_index_entry): New method.
317 (Target_aarch64::rela_tlsdesc_section): New method.
318 (Target_aarch64::rela_irelative_section): New method.
319 (Target_aarch64::Tlsdesc_info): New struct.
320 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
321 relocations and tlsdesc relocations.
322 (Target_aarch64::optimize_tls_reloc): Implement method.
323 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
324 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
325 in constructor.
326 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
327 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
328 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
329 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
330 (Output_data_plt_aarch64::rela_tlsdesc): New method.
331 (Output_data_plt_aarch64::rela_irelative): New method.
332 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
333 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
334 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
335 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
336 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
337 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
338 (Output_data_plt_aarch64_standard): New member variables:
339 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
340 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
341 New parameter: got, got_irelative.
342 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
343 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
344 (Output_data_plt_aarch64::do_write): Replace got_address with
345 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
346 (AArch64_relocate_functions::update_movnz): New method.
347 (AArch64_relocate_functions): Correct format.
348 (AArch64_relocate_functions::movnz): New method.
349 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
350 before the switch. Add new cases to switch.
00cac886 351 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
352 tlsgd tlsdesc cases.
353 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
354 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
355 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
356 Call reloc_name_in_error_message to print unsupported reloc.
357 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
358 make_data_plt.
359 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
360 relocs. Fill in some more dynamic tags.
361 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
362 Skip call tls_get_addr when tlsgd is relaxed.
363 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
364 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
365 tlsdesc->ie relaxation.
366
62661c93
SS
3672014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
368
369 * mips.cc (Target_mips_nacl): New class.
370 (Target_selector_mips_nacl): New class.
371 (target_selector_mips32): Rename from target_selector_mips32be and use
372 Target_selector_mips_nacl instead of Target_selector_mips.
373 (target_selector_mips32el): Rename from target_selector_mips32 and use
374 Target_selector_mips_nacl instead of Target_selector_mips.
375 (target_selector_mips64): Rename from target_selector_mips64be and use
376 Target_selector_mips_nacl instead of Target_selector_mips.
377 (target_selector_mips64el): Rename from target_selector_mips64 and use
378 Target_selector_mips_nacl instead of Target_selector_mips.
379 (Target_mips::mips_info): Add const attribute.
380
54674d38
CC
3812014-09-02 Cary Coutant <ccoutant@google.com>
382
383 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
384 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
385 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
386 (Sized_incr_dynobj::do_section_name): Likewise.
387 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
388 (Sized_incr_dynobj::do_section_name): Likewise.
389 * object.h (Object::section_name): Likewise.
390 (Object::do_section_name): Likewise.
391 (Sized_relobj_file::do_section_name): Likewise.
392 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
393 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
394
9860cbcf
CC
3952014-09-02 Cary Coutant <ccoutant@google.com>
396
397 PR gold/17005
398 * ehframe.cc (Fde::write): Add output_offset parameter.
399 (Cie::write): Likewise.
400 (Eh_frame::set_final_data_size): Account for offset within output
401 section.
402 (Eh_frame::do_sized_write): Likewise.
403 * ehframe.h (Fde::write): Add output_offset parameter.
404 (Cie::write): Likewise.
405 * output.cc (Output_section::Input_section_sort_entry): Remove
406 section_has_name_; add output_section_name parameter. Use
407 output section name for non-input sections.
408 (Output_section::Input_section_sort_entry::section_has_name): Remove.
409 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
410 (Output_section::Input_section_sort_compare): Remove logic for
411 sections without names.
412 (Output_section::Input_section_sort_init_fini_compare): Likewise.
413 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
414 Likewise.
415 (Output_section::Input_section_sort_section_name_compare): Likewise.
416
8e33481e
HS
4172014-08-29 Han Shen <shenhan@google.com>
418 Jing Yu <jingyu@google.com>
419
420 * aarch64-reloc-property.cc
421 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
422 reference reloc property in the table.
423 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
424 3 other entries.
425 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
426 2 new overloaded methods.
427 (Output_data_got_aarch64::do_write): Add code to write out
428 static relocs.
429 (class Output_data_got_aarch64::Static_reloc): New class to wrap
430 static relocs.
431 (Output_data_got_aarch64::static_relocs): New vector to
432 hold static relocs.
433 (Target_aarch64::TCB_SIZE): New const static memeber.
434 (Target_aarch64::tcb_size): New method.
435 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
436 (Target_aarch64::Relocate::relocate_tls): New method.
437 (Target_aarch64::Scan::local): Add code handling new reloc types.
438 (Target_aarch64::Scan::global): Add code handling new reloc types.
439
81233653
ST
4402014-08-13 Sriraman Tallam <tmsriram@google.com>
441
442 * options.h (-no-pie): Add option.
443
9363c7c3
JY
4442014-08-08 Jing Yu <jingyu@google.com>
445 Han Shen <shenhan@google.com>
446
447 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
448 (DEFFILES): add aarch64-reloc.def.
449 (TARGETSOURCES): Add aarch64-reloc-property.cc.
450 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
451 * Makefile.in: Regenerate.
452 * aarch64-reloc-property.cc: New file.
453 * aarch64-reloc-property.h: New file.
454 * aarch64-reloc.def: New file.
455 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
456 with tab to make the format consistent.
457 (Output_data_got_aarch64::symbol_table_): New method.
458 (Target_aarch64::do_plt_address_for_global): New method.
459 (Target_aarch64::do_plt_address_for_local): New method.
460 (Target_aarch64::do_select_as_default_target): New method.
461 (Target_aarch64::do_make_data_plt): New method.
462 (Target_aarch64::make_data_plt): New method.
463 (Output_data_plt_aarch64::has_irelative_section): New method.
464 (Output_data_plt_aarch64::address_for_global): New method.
465 (Output_data_plt_aarch64::address_for_local): New method.
466 (Output_data_plt_aarch64::irelative_rel_): New parameter.
467 (Output_data_plt_aarch64::add_entry): Implement contents.
468 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
469 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
470 the got_pov entry to plt0.
471 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
472 Implement contents.
473 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
474 (AArch64_howto): New struct.
475 (aarch64_howto[]): New static const array.
476 (AArch64_relocate_functions): New class.
477 (Target_aarch64::Scan::get_reference_flags): Remove method.
478 (Target_aarch64::Scan::local): Implement to support a few relocations.
479 (Target_aarch64::Scan::global): Implement to support a few relocations.
480 (Target_aarch64::make_plt_section): Implement contents.
481 (Target_aarch64::make_plt_entry): Implement contents.
482 (Target_aarch64::do_finalize_sections): Implement contents.
483 (Target_aarch64::Relocate::relocate): Implement a few relocations.
484 (Target_aarch64::relocate_section): Implement contents.
485
ad9fe6c1
AM
4862014-08-06 Alan Modra <amodra@gmail.com>
487
488 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
489
7cd4e5b7
AM
4902014-08-06 Alan Modra <amodra@gmail.com>
491
492 PR 13227
493 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
494
5ad9b0a7
ST
4952014-07-21 Sriraman Tallam <tmsriram@google.com>
496
497 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 498 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 499
e051745c
CC
5002014-07-08 Cary Coutant <ccoutant@google.com>
501
502 * expression.cc (struct Expression::Expression_eval_info): Add
503 new fields type_pointer, vis_pointer, and nonvis_pointer.
504 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
505 nonvis_pointer parameters. Adjust all calls.
506 (Symbol_expression::value): Update type, visibility, and nonvis bits
507 in caller.
508 * script.cc (Symbol_assignment::sized_finalize): Update type,
509 visibility, and remaining st_other bits for new symbol.
510 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
511 vis_pointer, and nonvis_pointer parameters.
512 * symtab.h (Symbol::set_type): New method.
513
514 * testsuite/Makefile.am (defsym_test): New test.
515 * testsuite/Makefile.in: Regenerate.
516 * testsuite/defsym_test.c: New file.
517 * testsuite/defsym_test.sh: New file.
518
f35c4853
CC
5192014-07-08 Cary Coutant <ccoutant@google.com>
520
521 PR gold/15639
522 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
523 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
524 (Sized_dynobj::base_read_symbols): ...new method.
525 * object.h (Sized_relobj_file::base_read_symbols): New method.
526 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
527 (Sized_relobj_file::base_read_symbols): ...new method.
528 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
529 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
530 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
531
2900af2d
AM
5322014-07-04 Alan Modra <amodra@gmail.com>
533
534 * po/POTFILES.in: Regenerate.
535
053a4d68
JY
5362014-07-02 Jing Yu <jingyu@google.com>
537
538 * aarch64.cc: New file
539 * Makefile.am (TARGETSOURCES): Add aarch64.cc
540 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
541 * Makefile.in: Regenerate.
542 * configure.tgt: Add entries for aarch64*.
543 * configure.ac: Likewise.
544 * configure: Likewise.
545
7b549045
AM
5462014-06-27 Alan Modra <amodra@gmail.com>
547
548 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
549
cb818dbf
CC
5502014-06-24 Cary Coutant <ccoutant@google.com>
551
552 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
553 sections.
554 (Dwo_file::sized_read_unit_index): Likewise.
555
9810d34d
SS
5562014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
557
558 * mips.cc: New file.
559 * Makefile.am (TARGETSOURCES): Add mips.cc
560 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
561 * configure.tgt: Add entries for mips*.
562 * configure.ac: Likewise.
563 * Makefile.in: Regenerate.
564 * configure: Likewise.
565
9baa787b
CC
5662014-06-09 Cary Coutant <ccoutant@google.com>
567
568 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
569 unit_length is within section bounds.
570
8f89af0a
CC
5712014-06-09 Cary Coutant <ccoutant@google.com>
572
573 PR gold/16980
574 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
575 map.
576
a47622ac
AM
5772014-06-07 Alan Modra <amodra@gmail.com>
578
579 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
580
4320c691
CC
5812014-06-06 Cary Coutant <ccoutant@google.com>
582
583 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
584 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
585 (Dwarf_pubnames_table::read_header): Likewise.
586 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
587 .debug_gnu_pubtypes.
588
270c9937
JB
5892014-06-05 Joel Brobecker <brobecker@adacore.com>
590
591 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
592 * Makefile.in, configure: Regenerate.
593
397998fc
AM
5942014-06-03 Alan Modra <amodra@gmail.com>
595
596 * powerpc.cc (addis_12_2): Define.
597 (Stub_table::do_write): Support fusion on ELFv2 stubs.
598
61f5c66f
AM
5992014-06-03 Alan Modra <amodra@gmail.com>
600
601 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
602 st_other output.
603
f6971787
AM
6042014-06-02 Alan Modra <amodra@gmail.com>
605
606 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
607 Only ignore relocs on ELFv1.
608 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
609
f6fb8322
CC
6102014-05-30 Cary Coutant <ccoutant@google.com>
611
612 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
613 * testsuite/Makefile.in: Regenerate.
614 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
615
c23dd342
L
6162014-05-27 H.J. Lu <hongjiu.lu@intel.com>
617
618 PR gold/16945
619 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
620 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
621
5fe7ffdc
AM
6222014-05-15 Alan Modra <amodra@gmail.com>
623
624 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
625 Compare FDE contents with DW_CFA_nop rather than 0.
626
a82bef93
ST
6272014-05-13 Sriraman Tallam <tmsriram@google.com>
628
629 * symtab.h (may_need_copy_reloc): Remove check for position independent
630 code.
631 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
632 position independence before pc absolute may_need_copy_reloc call.
633 Add check for executable output befor pc relative may_need_copy_reloc
634 call.
635 * i386.cc: Ditto.
636 * arm.cc: Ditto.
637 * sparc.cc: Ditto.
638 * tilegx.cc: Ditto.
639 * powerpc.cc: Add check for no position independence before
640 may_need_copy_reloc calls.
641 * testsuite/pie_copyrelocs_test.cc: New file.
642 * testsuite/pie_copyrelocs_shared_test.cc: New file.
643 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 644 * Makefile.in: Regenerate.
a82bef93 645
53c66605
ML
6462014-05-08 Martin Liška <mliska@suse.cz>
647
648 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
649
57b2284c
CC
6502014-05-06 Cary Coutant <ccoutant@google.com>
651
652 PR gold/16900
653 * i386.cc (Output_data_got_plt_i386): New class.
654 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
655 parameter. Change all callers.
656 (Output_data_plt_i386::layout_): Remove.
657 (Output_data_plt_i386::got_plt_): Change type.
658 (Target_i386::got_plt_): Change type. Change all references.
659 (Target_i386::got_section): Create instance of new class.
660 (Output_data_got_plt_i386::do_write): New function.
661 * x86_64.cc (Output_data_got_plt_x86_64): New class.
662 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
663 parameter. Change all callers.
664 (Output_data_plt_x86_64::layout_): Remove.
665 (Output_data_plt_x86_64::got_plt_): Change type.
666 (Target_x86_64::got_plt_): Change type. Change all references.
667 (Target_x86_64::got_section): Create instance of new class.
668 (Output_data_got_plt_x86_64::do_write): New function.
669 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
670 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
671 class.
672
6b97515d 6732014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 674
6b97515d
CC
675 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
676 if we have pubnames/pubtypes.
677
d1bddd3c
CC
6782014-05-02 Cary Coutant <ccoutant@google.com>
679
5fe7ffdc
AM
680 * defstd.cc (in_segment): Define __ehdr_start here...
681 * layout.cc (Layout::finalize): ...Instead of here. Set the
682 output segment when known.
683 * resolve.cc (Symbol::override_base_with_special): Remember
684 the original binding.
685 * symtab.cc (Symbol::set_output_segment): New function.
686 (Symbol::set_undefined): New function.
687 * symtab.h (Symbol::is_weak_undefined): Check original undef
688 binding.
689 (Symbol::is_strong_undefined): New function.
690 (Symbol::set_output_segment): New function.
691 (Symbol::set_undefined): New function.
692 * target-reloc.h (is_strong_undefined): Remove.
693 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
694 Check for hidden undefs.
695 (relocate_section): Call Symbol::is_strong_undefined.
696
697 * testsuite/Makefile.am (ehdr_start_test_1)
698 (ehdr_start_test_2, ehdr_start_test_3)
699 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
700 * testsuite/Makefile.in: Regenerate.
701 * testsuite/ehdr_start_def.cc: New source file.
702 * testsuite/ehdr_start_test.cc: New source file.
703 * testsuite/ehdr_start_test.t: New linker script.
704 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 705
7849f6d8
CC
7062014-04-23 Cary Coutant <ccoutant@google.com>
707
bf2cc635 708 PR gold/16870
7849f6d8
CC
709 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
710
99fd8cff
CC
7112014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
712
713 * layout.cc (Layout::include_section): Allow a target to decide
714 whether to include a section.
715 * target.h (Target::should_include_section): New function.
716 (Target::do_should_include_section): New function.
717
91f43acd
CC
7182014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
719
720 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
721 inline into ...
722 (Copy_relocs::emit): ... here.
723 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
724 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
725 (Copy_reloc_entry::entries_): Change from private to protected.
726
c4eb27e1
ST
7272014-04-02 Sriraman Tallam <tmsriram@google.com>
728
729 * icf.cc (get_section_contents): Replace copies of reloc
730 vectors with const references.
731
ae447ddd
CC
7322014-04-02 Cary Coutant <ccoutant@google.com>
733
734 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
735 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
736 * configure: Regenerate.
737 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
738 -fno-use-linker-plugin.
739 (LINK1, CXXLINK1): Add it to the link command.
740 * testsuite/Makefile.in: Regenerate.
741
fa47fa92
AM
7422014-03-12 Alan Modra <amodra@gmail.com>
743
744 * Makefile.in: Regenerate.
745
9b12c500
CC
7462014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
747
748 * symtab.h (Symbol::set_nonvis): New function.
749
beacaa96
CC
7502014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
751
752 * symtab.cc (Sized_symbol<32>::init_output_data):
753 Instantiate the template.
754 (Sized_symbol<64>::init_output_data): Likewise.
755
800d9823
CC
7562014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
757
758 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
759 adjust dynamic symbol value.
760 * target.h (Target::adjust_dyn_symbol): New function.
761 (Target::do_adjust_dyn_symbol): New function.
762
918fc1f8 7632014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 764
918fc1f8
CC
765 * output.cc (Output_data_dynamic::Dynamic_entry::write):
766 Get the value of DYNAMIC_CUSTOM dynamic entry.
767 * output.h (Output_data_dynamic::add_custom): New function.
768 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
769 dynamic entry.
770 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
771 * target.h (Target::dynamic_tag_custom_value): New function.
772 (Target::do_dynamic_tag_custom_value): New function.
773
98ff9231
CC
7742014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
775
776 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
777 dynsym indexes.
778 * target.h (Target::has_custom_set_dynsym_indexes): New function.
779 (Target::do_has_custom_set_dynsym_indexes): New function.
780 (Target::set_dynsym_indexes): New function.
781 (Target::do_set_dynsym_indexes): New function.
782
b80eed39
AM
7832014-03-07 Alan Modra <amodra@gmail.com>
784
785 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
786 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
787 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
788 (Powerpc_relocate_functions::has_overflow_bitfield,
789 overflowed): Use the above.
790 (Target_powerpc::Relocate::relocate): Correct overflow checking
791 for a number of relocations. Modify overflow test for 16-bit
792 fields in instructions to signed/unsigned according to whether
793 the field takes a signed or unsigned value.
794
4b95cf5c
AM
7952014-03-05 Alan Modra <amodra@gmail.com>
796
797 Update copyright years.
798
45965137
AM
7992014-03-05 Alan Modra <amodra@gmail.com>
800
801 * powerpc.cc (Target_powerpc::Scan::local, global): Support
802 R_PPC64_ADDR64_LOCAL.
803 (Target_powerpc::Relocate::relocate): Likewise.
804
2c80b753
AM
8052014-03-03 Alan Modra <amodra@gmail.com>
806
807 * dwp.cc (print_version): Update copyright year to current.
808
c1c69e83
AM
8092014-02-10 Alan Modra <amodra@gmail.com>
810
811 * po/gold.pot: Regenerate.
812
dd0c4e70
CC
8132014-02-06 Cary Coutant <ccoutant@google.com>
814
815 Fix problem where -u is ignored when a weak undef is seen.
816
817 * archive.cc (Library_base::should_include_member): Reorder
818 code to check for -u option if a weak undef has already been seen.
819 * testsuite/Makefile.am (weak_undef_test_2): New test case.
820 * testsuite/Makefile.in: Regenerate.
821 * testsuite/weak_undef_file3.cc: New file.
822 * testsuite/weak_undef_file4.cc: New file.
823 * testsuite/weak_undef_test_2.cc: New file.
824
1a221d3d
CC
8252014-02-05 Cary Coutant <ccoutant@google.com>
826
827 Fix issues with gold undefined symbol diagnostics.
828
829 PR binutils/15435
830 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
831 check to here.
832 * target-reloc.h (is_strong_undefined): New function.
833 (relocate_section): Move undef vtable symbol check from here.
834 Check for is_strong_undefined.
835
e889f0a4 8362014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 837
e889f0a4
CC
838 Fix problems with the --dynamic-list option.
839
840 PR gold/13577
841 * options.cc (General_options::parse_dynamic_list):
842 Set have_dynamic_list_.
843 (General_options::General_options): Initialize have_dynamic_list_.
844 (General_options::finalize): Turn off -Bsymbolic and
845 -Bsymbolic-functions if --dynamic-list provided.
846 * options.h (General_options::have_dynamic_list): New function.
847 (General_options::have_dynamic_list_): New data member.
848 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
849 correctly.
5fe7ffdc 850
e889f0a4
CC
851 PR gold/16530
852 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
853 in --dynamic-list, mark it.
5fe7ffdc 854
e889f0a4
CC
855 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
856 (dynamic_list_2): New test case.
857 * testsuite/Makefile.in: Regenerate.
858 * testsuite/dynamic_list_2.cc: New file.
859 * testsuite/dynamic_list_2.t: New file.
860 * testsuite/dynamic_list_lib1.cc: New file.
861 * testsuite/dynamic_list_lib2.cc: New file.
862 * testsuite/gc_dynamic_list_test.c: New file.
863 * testsuite/gc_dynamic_list_test.sh: New file.
864 * testsuite/gc_dynamic_list_test.t: New file.
865
ec673e64
CC
8662014-01-28 Cary Coutant <ccoutant@google.com>
867
868 Add .gdb_index version 7 support.
869
870 * gold/dwarf_reader.cc: include <utility> (for make_pair).
871 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
872 debug sections.
873 (Dwarf_ranges_table::read_ranges_table): Likewise.
874 (Dwarf_pubnames_table::read_section): Check for GNU-style
875 sections, and for compressed debug sections.
876 (Dwarf_pubnames_table::read_header): Compute end address of table.
877 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
878 for end of list by offset, not by offset == 0.
879 (Dwarf_info_reader::do_read_string_table): Check for compressed
880 debug sections.
881 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
882 Initialize new data members.
883 (Dwarf_pubnames_table::next_name): return flag_byte.
884 (Dwarf_pubnames_table::end_of_table_): New data member.
885 (Dwarf_pubnames_table::is_gnu_style_): New data member.
886 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
887 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
888 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
889 read skeleton type unit DIEs.
890 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
891 (Gdb_index::do_write): Write flag_byte.
892 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
893 (Gdb_index::Cu_vector): Store flags along with cu indexes.
894 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
895 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
896
221fd5d5
L
8972014-01-08 H.J. Lu <hongjiu.lu@intel.com>
898
899 * version.cc (print_version): Update copyright year to 2014.
900
6c09fb0b
ILT
9012013-12-19 Dimitry Andric <dimitry@andric.com>
902
903 * stringpool.cc (Stringpool_template::reserve): Add
904 HAVE_UNORDERED_MAP case.
905 * stringpool.cc (Stringpool_template::print_stats): Likewise.
906
8356f2d0
CC
9072013-12-18 Cary Coutant <ccoutant@google.com>
908
909 * configure.ac: Check for <unordered_set> and <unordered_map>.
910 * config.in: Regenerate.
911 * configure: Regenerate.
912 * system.h: Use <unordered_set> and <unordered_map> if available.
913
f2c7d7ee
RM
9142013-12-10 Roland McGrath <mcgrathr@google.com>
915
916 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
917 with $(INSTALL_PROGRAM_ENV).
918 * Makefile.in: Regenerate.
919
6632e8cc
CC
9202013-11-22 Cary Coutant <ccoutant@google.com>
921
922 * configure.ac: Add check for which library is needed for
923 dlopen.
924 * configure: Regenerate.
925
0c075858
CC
9262013-11-22 Cary Coutant <ccoutant@google.com>
927
928 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
929 assembler.
930 * testsuite/Makefile.in: Regenerate.
931
f49fe902
L
9322013-11-17 H.J. Lu <hongjiu.lu@intel.com>
933
934 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
935 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
936 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
937 (Target_x86_64<size>::Scan::local): Likewise.
938 (Target_x86_64<size>::Scan::global): Likewise.
939 (Target_x86_64<size>::Relocate::relocate): Likewise.
940 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
941 Likewise.
942 (Target_x86_64<size>::Scan::check_non_pic(): Handle
943 R_X86_64_PC32_BND.
944
945 * testsuite/Makefile.am (check_PROGRAMS): Add
946 exception_x86_64_bnd_test.
947 (exception_x86_64_bnd_test_SOURCES): New macro.
948 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
949 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
950 (exception_x86_64_bnd_test_LDADD): Likewise.
951 (exception_x86_64_bnd_1.o): New rule.
952 (exception_x86_64_bnd_2.o): Likewise.
953 * testsuite/Makefile.in: Regenerated.
954
9055360d
AM
9552013-11-15 Alan Modra <amodra@gmail.com>
956
957 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
958 accessor.
959 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
960 Only call ppc64_local_entry_offset for 64-bit. Restrict
961 symval_for_branch lookup to ELFv1.
962 (Stub_table::add_plt_call_entry): Use unsigned int off.
963 (Output_data_glink::Address, invalid_address): New.
964 (Output_data_glink::add_eh_frame): Move out of line. Add
965 support for ELFv2.
966 (Output_data_glink::add_global_entry, find_global_entry,
967 global_entry_address): New functions.
968 (Output_data_glink::global_entry_stubs_, end_branch_table_,
969 ge_size): New variables.
970 (Output_data_glink::set_final_data_size): Add global entry
971 stub sizing.
972 (Output_data_glink::do_write): Write global entry stubs.
973 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
974 parameter. Return true for ELFv2. Adjust callers.
975 (Target_powerpc::Scan::local, global): Restrict opd lookup to
976 ELFv1. Similarly for ifunc and dynamic relocation processing
977 specific to ELFv1. Recognize that symbols are defined on
978 their plt entries for ELFv2.
979 (Target_powerpc::symval_for_branch): Assert if called for
980 ELFv2 or ppc32.
981 (Target_powerpc::Relocate::relocate): Use global entry plt
982 stub for symbol value if such exists on ELFv2.
983 (Target_powerpc::Relocate::relocate): Don't call
984 symval_for_branch when ELFv2. Do adjust for local entry
985 offset when ELFv2.
986 (Target_powerpc::do_dynsym_value): Set symbols to global entry
987 plt stub for ELFv2.
988 (Target_powerpc::do_plt_address_for_global): Similarly.
989
cafdd569
CC
9902013-11-14 Cary Coutant <ccoutant@google.com>
991
992 Revert patch -- this did not fix the problem, and there is
993 no race there.
994
995 2013-11-14 Cary Coutant <ccoutant@google.com>
996
997 PR gold/14860
998 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
999 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1000 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1001 updating fde_offsets_.
1002 (Eh_frame_hdr::lock_): New data member.
1003
94e49e16
CC
10042013-11-14 Cary Coutant <ccoutant@google.com>
1005
1006 * dwp.cc (Dwo_file_entry): New type.
1007 (File_list): Use Dwo_file_entry.
1008 (Dwo_file::verify): New function.
1009 (Dwo_file::verify_dwo_list): New function.
1010 (Dwo_file::sized_verify_dwo_list): New function.
1011 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1012 list.
1013 (Dwp_options): New enum type.
1014 (dwp_options): Add --verify-only.
1015 (usage): Likewise.
1016 (main): Likewise.
1017 * dwp.h (gold_info): Add declaration.
1018
7cdd7d57
CC
10192013-11-14 Cary Coutant <ccoutant@google.com>
1020
1021 PR gold/14860
1022 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1023 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1024 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1025 updating fde_offsets_.
1026 (Eh_frame_hdr::lock_): New data member.
1027
1d946cb3
CC
10282013-11-06 Cary Coutant <ccoutant@google.com>
1029
1030 PR gold/15758
1031 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1032 before reloc sections.
1033
4f65b40e
AM
10342013-11-04 Alan Modra <amodra@gmail.com>
1035
1036 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1037 (Symbol::needs_dynamic_reloc): Test new flag.
1038 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1039 (Target_powerpc::Scan::get_reference_flags): Add target param.
1040 Return FUNC_DESC_ABI for 64-bit ELFv1.
1041 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1042 call.
1043 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1044 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1045
908794a9
CC
10462013-10-31 Cary Coutant <ccoutant@google.com>
1047
1048 Restore support for dwp v2 DWARF package file format.
1049
1050 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1051 tu_length parameter. Adjust all callers.
1052 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1053 * dwp.cc: Include dwarf.h.
1054 (Section_bounds): New struct type.
1055 (Unit_set): New struct type.
1056 (Dwo_file::Dwo_file): Initialize new data member.
1057 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1058 Combine and rename to...
1059 (Dwo_file::read_unit_index): ...this.
1060 (Dwo_file::sized_read_compunit_index)
1061 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1062 (Dwo_file::sized_read_unit_index): ...this.
1063 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1064 parameters; add section_id parameter.
1065 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1066 (Dwo_file::add_unit_set): ...this.
1067 (Dwo_file::shndx_map_): Remove.
1068 (Dwo_file::sect_offsets_): New data member.
1069 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1070 (Dwp_output_file::add_section): Rename to...
1071 (Dwp_output_file::add_contribution): ...this.
1072 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1073 (Dwp_output_file::add_tu_set): Likewise.
1074 (Dwp_output_file::Contribution): New type.
1075 (Dwp_output_file::Section::contributions): New data member.
1076 (Dwp_output_file::Cu_or_tu_set): Remove.
1077 (Dwp_output_file::Section::Section): New ctor.
1078 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1079 (Dwp_output_file::Dwp_index::Section_table): New type.
1080 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1081 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1082 parameter.
1083 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1084 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1085 (Dwp_output_file::Dwp_index::section_table): New member function.
1086 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1087 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1088 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1089 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1090 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1091 (Dwp_output_file::Dwp_index::section_table_): New data member.
1092 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1093 (Dwp_output_file::add_output_section): New member function.
1094 (Dwp_output_file::write_new_section): New member function.
1095 (Dwp_output_file::write_contributions): New member function.
1096 (Dwp_output_file::section_id_map_): New data member.
1097 (class Dwo_id_info_reader): Remove.
1098 (class Unit_reader): New class.
1099 (get_dwarf_section_name): New function.
1100 (Dwo_file::read_executable): Adjust initializations of class data.
1101 (Dwo_file::read): Add support for v2 package file format.
1102 (Dwo_file::read_unit_index): Likewise.
1103 (Dwo_file::sized_read_unit_index): Likewise.
1104 (Dwo_file::copy_section): Likewise.
1105 (Dwo_file::add_unit_set): Likewise.
1106 (Dwp_output_file::add_output_section): Likewise.
1107 (Dwp_output_file::add_contribution): Likewise.
1108 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1109 for empty slot.
1110 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1111 file format.
1112 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1113 slot.
1114 (Dwp_output_file::initialize): Remove unused function.
1115 (Dwp_output_file::finalize): Add support for v2 package file format.
1116 (Dwp_output_file::write_index): Likewise.
1117 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1118 function prototype.
1119
2500c017
CC
11202013-10-31 Cary Coutant <ccoutant@google.com>
1121
1122 * configure.ac: Fix check for -fmerge-constants.
1123 * configure.ac: Regenerate.
1124
dd0845d7
RM
11252013-10-30 Roland McGrath <mcgrathr@google.com>
1126
1127 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1128 Correct 9-byte nop sequence to match what the assembler generates.
1129
b4f7960d
AM
11302013-10-30 Alan Modra <amodra@gmail.com>
1131
1132 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1133 ppc64_local_entry_offset, ppc64_local_entry_offset,
1134 do_read_symbols): New functions.
1135 (Powerpc_relobj::e_flags_, st_other_): New vars.
1136 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1137 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1138 (Powerpc_relobj::e_flags_): New var.
1139 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1140 and adjust for ELFv2.
1141 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1142 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1143 (Powerpc_dynobj::do_find_special_sections): Likewise.
1144 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1145 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1146 to ELFv2 local entry.
1147 (Target_powerpc::do_relax): No thread safe barriers needed for
1148 ELFv2.
1149 (Output_data_plt_powerpc::initial_plt_entry_size_,
1150 plt_entry_size): Delete. Replace all uses with
1151 first_plt_entry_offset() and plt_entry_size().
1152 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1153 reserved_size parm. Update callers.
1154 (Output_data_plt_powerpc::entry_count): Update.
1155 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1156 and use Target_powerpc::first_plt_entry_offset().
1157 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1158 rename to plt_entry_size.
1159 (Output_data_plt_powerpc::add_ifunc_entry,
1160 add_local_ifunc_entry): Adjust reloc for ELFv2.
1161 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1162 (glink_eh_frame_fde_64v2): New.
1163 (Stub_table::plt_call_size): Support ELFv2 sizing.
1164 (Output_data_glink::add_eh_frame): Use the new FDE.
1165 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1166 (Stub_table::do_write): Write ELFv2 stubs and glink.
1167 (Target_powerpc::Relocate::relocate): Replaces nop after call
1168 with ld 2,24(1) and adjust local offset destination for ELFv2.
1169
f9c6b907
AM
11702013-10-30 Alan Modra <amodra@gmail.com>
1171
1172 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1173 (Target_powerpc::Scan::global, local): Likewise.
1174 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1175 on all ppc64 @h and @ha relocs.
1176
e84fe78f
AM
11772013-10-14 Alan Modra <amodra@gmail.com>
1178
1179 * output.h (Output_data_got::add_constant): Tidy.
1180 (Output_data_got::add_constant_pair): New function.
1181 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1182 methods used so as to first call reserve_ent().
1183
679e4abf
RM
11842013-10-11 Roland McGrath <mcgrathr@google.com>
1185
44dcb735
RM
1186 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1187 add_got_entry and add_got_entry_pair.
1188
13323c49
RM
1189 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1190 (HAVE_PUBNAMES): Likewise.
1191 * configure: Regenerate.
1192
1496b446
RM
1193 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1194 * testsuite/Makefile.in: Regenerate.
1195
cc84c10b
RM
1196 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1197 Remove const from declaration.
1198 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1199 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1200 * output.h (Output_file_header): Remove const from member target_
1201 and corresponding constructor argument.
1202 * output.cc (Output_file_header::Output_file_header): Update prototype.
1203 (Output_file_header::do_sized_write): Use this->target_ in place
1204 of parameters()->target().
1205
52f66a2c
RM
1206 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1207
2b64b551
RM
1208 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1209 * configure: Regenerate.
1210 * Makefile.in: Regenerate.
1211 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1212 * testsuite/merge_string_literals_2.c: Likewise.
1213 * testsuite/Makefile.am
1214 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1215 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1216 literal -fmerge-constants.
1217 * testsuite/Makefile.in: Regenerate.
1218
43819297
RM
1219 * i386.cc (Target_i386): Remove unused member dynbss_.
1220 * arm.cc (Target_arm): Likewise.
1221 * powerpc.cc (Target_powerpc): Likewise.
1222 * sparc.cc (Target_sparc): Likewise.
1223 * tilegx.cc (Target_tilegx): Likewise.
1224 * x86_64.cc (Target_x86_64): Likewise.
1225 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1226 type_signature_, type_offset_.
1227 * plugin.h (Plugin_hook): Remove unused member layout_.
1228 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1229 mapfile_.
1230 (Read_member): Remove unused members input_objects_, symtab_,
1231 mapfile_, layout_.
1232 (Check_library): Remove unused member symtab_.
1233 * archive.h (Lib_group): Remove unused member lib_.
1234 * archive.cc (Lib_group::Lib_group): Update initializer.
1235 * incremental.h (Incremental_binary): Remove unused member target_.
1236 (Incremental_script_entry): Removed unused member script_.
1237 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1238 * icf.h (Icf): Remove unused member num_tracked_relocs.
1239
39d9ead7
RM
1240 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1241 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1242 its only use.
1243 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1244
679e4abf
RM
1245 * archive.h: Use struct rather than class for forward declaration
1246 of Read_symbols_data.
1247
54de2ea6
CC
12482013-10-07 Cary Coutant <ccoutant@google.com>
1249
1250 PR gold/16010
1251 * testsuite/Makefile.am (icf_test): Fix dependencies.
1252 (icf_safe_test): Likewise.
1253 (icf_safe_so_test): Likewise.
1254 (large_symbol_alignment): Add empty _LDADD rule.
1255 * testsuite/Makefile.in: Regenerate.
1256
b14016f0
L
12572013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1258
1259 PR gold/15927
1260 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1261 relocation for R_X86_64_32 on x32.
1262
eb426534
RM
12632013-08-27 Roland McGrath <mcgrathr@google.com>
1264
1265 * output.cc (Output_segment::set_section_addresses): Take new
1266 Target* argument. If target->isolate_execinstr() and the segment
1267 is executable and starts at a target->abi_pagesize() boundary,
1268 pad its end out to a target->abi_pagesize() boundary with code fill.
1269 * output.h (Output_segment::set_section_addresses): Update decl.
1270 * layout.h (Layout::check_output_data_for_reset_values): Take new
1271 argument RELAX_OUTPUTS.
1272 (Layout): New member relax_output_list_.
1273 (Layout::add_relax_output): New method.
1274 * layout.cc (Layout::Layout): Update constructor.
1275 (Layout::reset_relax_output): New method.
1276 (Layout::clean_up_after_relaxation): Call it.
1277 (Layout::prepare_for_relaxation): Update caller.
1278 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1279 Call reset_relax_output before re-processing segments for
1280 isolate_execinstr case.
1281 (Layout::write_data): Handle relax_output_list_.
1282 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1283 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1284
9aff4b7a
NC
12852013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1286
1287 PR binutils/15834
1288 * object.h: Fix typos.
1289
93f8221c
RM
12902013-08-16 Roland McGrath <mcgrathr@google.com>
1291
1292 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1293 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1294
e44c3715
CC
12952013-08-07 Cary Coutant <ccoutant@google.com>
1296
1297 Revert support for v2 DWP files:
1298
1299 2013-03-01 Cary Coutant <ccoutant@google.com>
1300
1301 Add dwp support for v2 DWARF package file format.
1302 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1303 tu_length parameter. Adjust all callers.
1304 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1305 * dwp.cc: Include dwarf.h.
1306 (Section_bounds): New struct type.
1307 (Unit_set): New struct type.
1308 (Dwo_file::Dwo_file): Initialize new data member.
1309 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1310 Combine and rename to...
1311 (Dwo_file::read_unit_index): ...this.
1312 (Dwo_file::sized_read_compunit_index)
1313 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1314 (Dwo_file::sized_read_unit_index): ...this.
1315 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1316 parameters; add section_id parameter.
1317 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1318 (Dwo_file::add_unit_set): ...this.
1319 (Dwo_file::shndx_map_): Remove.
1320 (Dwo_file::sect_offsets_): New data member.
1321 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1322 (Dwp_output_file::add_section): Rename to...
1323 (Dwp_output_file::add_contribution): ...this.
1324 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1325 (Dwp_output_file::add_tu_set): Likewise.
1326 (Dwp_output_file::Contribution): New type.
1327 (Dwp_output_file::Section::contributions): New data member.
1328 (Dwp_output_file::Cu_or_tu_set): Remove.
1329 (Dwp_output_file::Section::Section): New ctor.
1330 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1331 (Dwp_output_file::Dwp_index::Section_table): New type.
1332 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1333 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1334 parameter.
1335 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1336 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1337 (Dwp_output_file::Dwp_index::section_table): New member function.
1338 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1339 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1340 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1341 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1342 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1343 (Dwp_output_file::Dwp_index::section_table_): New data member.
1344 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1345 (Dwp_output_file::add_output_section): New member function.
1346 (Dwp_output_file::write_new_section): New member function.
1347 (Dwp_output_file::write_contributions): New member function.
1348 (Dwp_output_file::section_id_map_): New data member.
1349 (class Dwo_id_info_reader): Remove.
1350 (class Unit_reader): New class.
1351 (get_dwarf_section_name): New function.
1352 (Dwo_file::read_executable): Adjust initializations of class data.
1353 (Dwo_file::read): Add support for v2 package file format.
1354 (Dwo_file::read_unit_index): Likewise.
1355 (Dwo_file::sized_read_unit_index): Likewise.
1356 (Dwo_file::copy_section): Likewise.
1357 (Dwo_file::add_unit_set): Likewise.
1358 (Dwp_output_file::add_output_section): Likewise.
1359 (Dwp_output_file::add_contribution): Likewise.
1360 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1361 for empty slot.
1362 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1363 file format.
1364 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1365 slot.
1366 (Dwp_output_file::initialize): Remove unused function.
1367 (Dwp_output_file::finalize): Add support for v2 package file format.
1368 (Dwp_output_file::write_index): Likewise.
1369 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1370 function prototype.
1371
c6905c28
CC
13722013-07-31 Cary Coutant <ccoutant@google.com>
1373
1374 * object.cc (Sized_relobj::do_output_section_address): New function.
1375 (Sized_relobj): Instantiate explicitly.
1376 * object.h (Object::output_section_address): New function.
1377 (Object::do_output_section_address): New function.
1378 (Sized_relobj::do_output_section_address): New function.
1379 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1380
13812013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1382 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1383
1384 * parameters.cc (Parameters::entry): Return target-specific entry
1385 symbol name.
1386 * target.h (Target::entry_symbol_name): New function.
1387 (Target_info::entry_symbol_name): New data member.
1388
1389 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1390 * i386.cc (Target_i386::i386_info): Likewise.
1391 (Target_i386_nacl::i386_nacl_info): Likewise.
1392 * sparc.cc (Target_sparc::sparc_info): Likewise.
1393 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1394 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1395 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1396 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1397
234d4ab8
SA
13982013-07-22 Sterling Augustine <saugustine@google.com>
1399
1400 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1401 Convert parameter shndx to local variable. Add parameters symtab
1402 and symtab_size. Scan over section names. Find relocation
1403 section corresponding to current section. Create and initialize
1404 reloc_mapper_ and reloc_type_.
1405 (Dwarf_pubnames_table::read_header): Add assertion. Change
1406 unit_length to off_t. Initialize member unit_length_. Fill in field
1407 cu_offset_.
1408 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1409 Initialize new fields unit_length_ and cu_offset_.
1410 (Dwarf_pubnames_table::read_section): Update prototype.
1411 (Dwarf_pubnames_table::cu_offset): New member function.
1412 (Dwarf_pubnames_table::subsection_size): Likewise.
1413 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1414 New fields.
1415 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1416 member functions public.
1417 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1418 Update comment. Rework logic. Move repeated parts to...
1419 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1420 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1421 pubtypes_table_, and stmt_list_offset.
1422 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1423 Gdb_index::find_pubtype_offset,
1424 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1425 (Gdb_index::pubnames_read): Update prototype and rework logic.
1426 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1427 Forward declare.
1428 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1429 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1430 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1431 Gdb_index::map_pubtable_to_dies):
1432 Declare functions.
1433 (Gdb_index::pubnames_read): Update declaration.
1434 (Gdb_index::Pubname_offset_map): New type.
1435 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1436 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1437 Gdb_index::stmt_list_offset): Declare.
1438 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1439 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1440 Gdb_index::pubtypes_offset_): Remove.
1441
a3ed37d8
RM
14422013-07-19 Roland McGrath <mcgrathr@google.com>
1443
1444 * options.h (General_options): Add -Trodata-segment option.
1445 * parameters.cc (Parameters::check_rodata_segment): New function.
1446 (Parameters::set_target_once): Call it.
1447 * parameters.h (Parameters): Declare it (private member function).
1448 * layout.cc (load_seg_unusable_for_headers): New function, broken
1449 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1450 then validate rodata segment rather than text segment.
1451 (relaxation_loop_body): Call that.
1452 (is_text_segment): New function. Don't admit a non-executable
1453 segment if TARGET->isolate_execinstr().
1454 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1455
eb5b4ded
CC
14562013-07-15 Shawn Landden <shawnlandden@gmail.com>
1457
1458 PR gold/15070
1459 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1460 * nacl.h (Sniff_file::View::View): Request aligned view.
1461
4d5effb9
CC
14622013-07-11 Cary Coutant <ccoutant@google.com>
1463
1464 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1465 correct BRLT entry size.
1466
ba8ca3e7
AM
14672013-07-03 Alan Modra <amodra@gmail.com>
1468
1469 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1470 comment.
1471
267257d2
CC
14722013-07-01 Cary Coutant <ccoutant@google.com>
1473
1474 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1475 reloc_type_.
1476 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1477 (Dwarf_ranges_table::lookup_reloc): New function.
1478 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1479 reloc_type_.
1480 (Dwarf_ranges_table::lookup_reloc): New function.
1481 (Dwarf_ranges_table::reloc_type_): New data member.
1482
06f30c9d
CC
14832013-06-27 Jing Yu <jingyu@google.com>
1484
1485 PR gold/15662
1486 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1487 function.
1488 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1489 (Target_powerpc::do_relax): Call the above.
1490
a2d7bf59
AM
14912013-06-27 Cary Coutant <ccoutant@google.com>
1492
1493 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1494 on garbage collected .opd section.
1495
14962013-06-27 Alan Modra <amodra@gmail.com>
1497
1498 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1499 is non-zero.
1500 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1501 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1502
32364e50
CC
15032013-06-14 Cary Coutant <ccoutant@google.com>
1504
1505 * resolve.cc (Symbol::override_base): Don't override st_type
1506 from plugin placeholder symbols.
1507 (Symbol_table::resolve): Likewise.
1508 (Symbol_table::should_override): Don't complain about TLS mismatch
1509 if the TO symbol is a plugin placeholder.
1510 * testsuite/Makefile.am (plugin_test_tls): New test.
1511 * testsuite/Makefile.in: Regenerate.
1512 * testsuite/plugin_test_tls.sh: New test script.
1513 * testsuite/two_file_test_2_tls.cc: New test source.
1514 * testsuite/two_file_test_tls.cc: New test source.
1515
7fb47cc9
CC
15162013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1517
1518 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1519 the maximum segment alignment is larger than the page size.
1520 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1521 correctly aligns the symbols with large alignemnt.
1522 * testsuite/Makefile.in: Regenerate.
1523 * testsuite/large_symbol_alignment.cc: New file.
1524
6934001a
CC
15252013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1526 Sriraman Tallam <tmsriram@google.com>
1527
1528 * options.h (sort_section): New option.
1529 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1530 Rename from Input_section_sort_section_name_special_ordering_compare.
1531 (Input_section_sort_section_name_compare): New struct.
1532 * output.cc (Output_section::Input_section_sort_section_name_compare::
1533 operator()): New function.
1534 (Output_section::sort_attached_input_sections): Use new sort function
1535 for .text if --sort-section=name is specified.
1536 * layout.cc (Layout::make_output_section):
1537 Add sorting by name when --sort-section=name is specified.
1538 * testsuite/Makefile.am (text_section_grouping): Test option
1539 --sort-section=name.
1540 * testsuite/Makefile.in: Regenerate.
1541 * testsuite/section_sorting_name.cc: New file.
1542 * testsuite/section_sorting_name.sh: New file.
1543
93acabad
CC
15442013-05-21 Cary Coutant <ccoutant@google.com>
1545
1546 * symtab.h (Symbol::is_cxx_vtable): New function.
1547 * target-reloc.h (relocate_section): Check for vtable symbol.
1548 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1549 * testsuite/Makefile.in: Regenerate.
1550 * testsuite/missing_key_func.cc: New test source.
1551 * testsuite/missing_key_func.sh: New test script.
1552
60e8b3fc
CC
15532013-05-21 Cary Coutant <ccoutant@google.com>
1554
2b64b551
RM
1555 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1556 type of enclosing symbol.
1557 (Relocate_info::location): Check symbol type when describing symbol.
1558 * object.h (Symbol_location_info): Remove unused line_number;
1559 add enclosing_symbol_type.
1560 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1561
9df9de2c
CC
15622013-05-13 Cary Coutant <ccoutant@google.com>
1563
2b64b551
RM
1564 * configure.ac: Export DEFAULT_TARGET.
1565 * configure: Regenerate.
1566 * Makefile.in: Regenerate.
1567 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1568 * testsuite/Makefile.in: Regenerate.
1569 * testsuite/debug_msg.sh: Delete duplicate tests.
1570 Don't check undef_int error message match for powerpc where the
1571 source file and line number aren't available.
9df9de2c 1572
bbc5ae17
RM
15732013-05-10 Roland McGrath <mcgrathr@google.com>
1574
1575 * options.h (General_options): Add --rosegment-gap option.
1576 * options.cc (finalize): --rosegment-gap implies --rosegment.
1577 * layout.cc (set_segment_offsets): Let user option override
1578 target->rosegment_gap().
1579
0c6e6c39
RM
15802013-05-10 Roland McGrath <mcgrathr@google.com>
1581
1582 * options.h (General_options): Remove leading space from help
1583 messages for -nostdlib and --rosegment.
1584
cde7cb01
MR
15852013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1586
1587 PR ld/15365
1588 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1589
f31ae5b8
AM
15902013-05-03 Alan Modra <amodra@gmail.com>
1591
1592 * merge.cc (Output_merge_string::do_add_input_section): Correct
1593 scan for number of strings. Rename vars to avoid shadowing.
1594 Include missing terminator in input_size_.
1595
d3a7cd45
L
15962013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1597
1598 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1599 Restore empty string handling.
1600
6ad3daba
CC
16012013-05-01 Cary Coutant <ccoutant@google.com>
1602
1603 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1604 uninitialized warning.
1605
e31908b6
CC
16062013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1607
1608 * output.cc (Output_section::add_merge_input_section): Allow
1609 to merge sections if the alignment is more than character size.
1610 * merge.h (Output_merge_string::Output_merge_string): Remove
1611 assert.
1612 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1613 only not-null strings. Check the alignment of strings.
1614 * stringpool.h
1615 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1616 alignment as the argument.
1617 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1618 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1619 Align non-zero length strings according to the addralign_.
1620 (Stringpool_template<Stringpool_char>::set_string_offsets):
1621 Updating offsets according to the given alignment.
1622 * testsuite/Makefile.am (text_section_grouping): Test if string
1623 literals are getting merged.
1624 * testsuite/Makefile.in: Regenerate.
1625 * testsuite/merge_string_literals_1.c: New file.
1626 * testsuite/merge_string_literals_2.c: Ditto.
1627 * testsuite/merge_string_literals.sh: Ditto.
1628
0e804863
ILT
16292013-04-26 Ian Lance Taylor <iant@google.com>
1630
1631 * target-reloc.h (relocate_section): If the reloc offset is out of
1632 range, pass VIEW as NULL to relocate.relocate.
1633 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1634 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1635 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1636 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1637 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1638 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1639
e7c5ea40
CC
16402013-04-26 Geoff Pike <gpike@chromium.org>
1641
1642 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1643 * layout.cc (Hash_task): New class.
1644 (Layout::queue_build_id_tasks): New function.
1645 (Layout::write_build_id): Handle single-thread portion of build ID
1646 computation. (In some cases, all of it is single-threaded.) Replace
1647 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1648 functionality in fewer lines of code.
1649 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1650 * options.h (General_options): make "--build-id" default to tree
1651 rather than sha1. Add two new options related to --build-id=tree:
1652 --build-id-chunk-size-for-treehash and
1653 --build-id-min-file-size-for-treehash.
1654 * Makefile.am: add testing of --build-id=tree and related new options
1655 (these tests will be invoked by "make check").
1656 * Makefile.in: Regenerate.
1657
49926cd0
AM
16582013-04-25 Alan Modra <amodra@gmail.com>
1659
1660 * configure.tgt: Add powerpcle and powerpc64le.
1661
a4034750
AM
16622013-04-22 Alan Modra <amodra@gmail.com>
1663
1664 PR gold/15355
1665 * layout.cc (Layout::segment_precedes): Allow more than one
1666 segment with the same type and flags.
1667
e79c84aa
CC
16682013-04-15 Cary Coutant <ccoutant@google.com>
1669
1670 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1671 allocate space in file for BSS sections.
1672
2199fbe7
CC
16732013-04-15 Cary Coutant <ccoutant@google.com>
1674
1675 * script-sections.cc (Orphan_output_section): Reset address
1676 to zero after each orphaned section for relocatable links.
1677
502e8a84
CC
16782013-04-15 Cary Coutant <ccoutant@google.com>
1679
a4034750
AM
1680 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1681 section starting address for relocatable link.
1682 * testsuite/Makefile.am (script_test_11): New test.
1683 * testsuite/Makefile.in: Regenerate.
1684 * testsuite/script_test_11.c: New source file.
1685 * testsuite/script_test_11.t: New linker script.
502e8a84 1686
0cfdc767
AM
16872013-04-13 Alan Modra <amodra@gmail.com>
1688
1689 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1690 owner when sections are not adjacent and exceed group size.
1691 (Target_powerpc::group_sections): Handle corner case.
1692 (Target_powerpc::Branch_info::make_stub): Handle case where
1693 stub table doesn't exist due to branches in non-exec sections.
1694 (Target_powerpc::Relocate::relocate): Likewise.
1695
6830ee24
AM
16962013-04-11 Alan Modra <amodra@gmail.com>
1697
1698 PR gold/15354
1699 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1700 .branch_lt to match bfd ld. Adjust comments throughout file.
1701
54a3d865
ILT
17022013-04-04 Ian Lance Taylor <iant@google.com>
1703
1704 GCC PR c++/56840
1705 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1706 sections before checking whether they are included in the link.
1707
9993ba11
ST
17082013-03-29 Sriraman Tallam <tmsriram@google.com>
1709
1710 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1711 object before calling the plugin claim_file handler. Pass the elf
1712 object of the archive to the plugin. Delete the elf object if the
1713 plugin claims the file.
1714
ebacd51e
AM
17152013-03-21 Alan Modra <amodra@gmail.com>
1716
1717 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1718 segment when omagic.
1719
117be58f
AM
17202013-03-21 Alan Modra <amodra@gmail.com>
1721
1722 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1723 comparison warning.
1724 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1725 uninitialized" warning.
1726
32e2b61d
AM
17272013-03-20 Alan Modra <amodra@gmail.com>
1728
1729 * symtab.h (Symbol::clear_version): New function.
1730 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1731 is_needed by weak references. Clear version for symbols defined
1732 in as-needed objects that are not needed.
1733
b3ccdeb5
AM
17342013-03-15 Alan Modra <amodra@gmail.com>
1735
1736 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1737 static and public. Add report_err param. Return false for data refs.
1738 (Target_powerpc::rela_dyn_section): New overloaded function.
1739 (Target_powerpc::plt_, iplt_): Elucidate.
1740 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1741 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1742 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1743 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1744 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1745 push_branch and make_plt_entry for ifunc syms when
1746 reloc_needs_plt_for_ifunc.
1747 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1748 for ifunc unless reloc_needs_plt_for_ifunc.
1749
ad3d8a2f
AM
17502013-03-15 Alan Modra <amodra@gmail.com>
1751
1752 * gc.h (gc_process_relocs): Don't look through function descriptors.
1753 * icf.cc (get_section_contents): Do so here instead.
1754
4d9aa155
AM
17552013-03-13 Alan Modra <amodra@gmail.com>
1756
1757 * powerpc.cc (is_branch_reloc): Forward declare.
1758 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1759 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1760 false for 64-bit, true for 32-bit non-branch relocs.
1761 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1762 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1763 nm output.
1764 (icf_safe_test): Generate linker map file as well as nm output.
1765 (icf_safe_so_test): Likewise.
1766 * testsuite/Makefile.in: Regenerate.
1767 * testsuite/icf_test.sh: Parse linker map file to determine
1768 section folding.
1769 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1770 * testsuite/icf_safe_so_test.sh: Likewise.
1771 (X86_32_or_ARM_specific_safe_fold): Merge into..
1772 (arch_specific_safe_fold): ..this.
1773 (X86_64_specific_safe_fold): Delete unused function.
1774
57420c20
AM
17752013-03-12 Alan Modra <amodra@gmail.com>
1776
1777 * gc.h (gc_process_relocs): Look through function descriptors
1778 to determine shndx, symvalue and addend used by ICF. Tidy
1779 variable duplication.
1780
dc3714f3
AM
17812013-03-11 Alan Modra <amodra@gmail.com>
1782
1783 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1784 * layout.cc (Layout_task_runner::run): ..to here.
1785 * symtab.h (struct Symbol_location): Extract from..
1786 (class Symbol_table): ..here.
1787 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1788 * target.h (class Target): Add function_location and
1789 do_function_location functions.
1790 (class Sized_target): Add do_function_location.
1791 * object.h (class Sized_relobj_file): Move find_shdr..
1792 (class Object): ..to here.
1793 * object.cc: Likewise. Update to suit. Instantiate.
1794 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1795 * powerpc.cc (class Powerpc_dynobj): New.
1796 (Target_powerpc::do_function_location): New function.
1797 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1798 (Powerpc_dynobj::do_read_symbols): New function.
1799 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1800
956b03bb
ILT
18012013-03-08 Ian Lance Taylor <iant@google.com>
1802
1803 * options.cc (General_options::string_to_object_format): Accept
1804 "default".
1805
4bead2d5
AM
18062013-03-08 Alan Modra <amodra@gmail.com>
1807
1808 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1809 pointer to Post_fde.
1810 (struct Post_fde): Move definition to here..
1811 * ehframe.cc (struct Post_fde): ..from here.
1812 (Cie::write): Don't alloc Post_fde.
1813 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1814
02e60bf7
AM
18152013-03-07 Alan Modra <amodra@gmail.com>
1816
1817 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1818 relocation referencing .LC0.
1819 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1820
8343f03a
AM
18212013-03-07 Alan Modra <amodra@gmail.com>
1822
1823 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1824 always_inline. Add assembly for powerpc to avoid GOT.
1825
3366d57c
AM
18262013-03-07 Alan Modra <amodra@gmail.com>
1827
1828 * testsuite/script_test_10.sh: Don't test .bss section
1829 header number.
1830
6c77229c
AM
18312013-03-06 Alan Modra <amodra@gmail.com>
1832
1833 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1834 (Target_powerpc::symval_for_branch): Add symtab param. Update
1835 all callers. Handle folded sections.
1836 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1837 to Powerpc_relobj.
1838 (Global_symbol_visitor_opd::operator()): Likewise.
1839
a39e4af6
AM
18402013-03-04 Alan Modra <amodra@gmail.com>
1841
1842 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1843 * testsuite/Makefile.in: Regenerate.
1844
d5834edb
CC
18452013-03-01 Cary Coutant <ccoutant@google.com>
1846
1847 Add dwp support for v2 DWARF package file format.
1848 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1849 tu_length parameter. Adjust all callers.
1850 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1851 * dwp.cc: Include dwarf.h.
1852 (Section_bounds): New struct type.
1853 (Unit_set): New struct type.
1854 (Dwo_file::Dwo_file): Initialize new data member.
1855 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1856 Combine and rename to...
1857 (Dwo_file::read_unit_index): ...this.
1858 (Dwo_file::sized_read_compunit_index)
1859 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1860 (Dwo_file::sized_read_unit_index): ...this.
1861 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1862 parameters; add section_id parameter.
1863 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1864 (Dwo_file::add_unit_set): ...this.
1865 (Dwo_file::shndx_map_): Remove.
1866 (Dwo_file::sect_offsets_): New data member.
1867 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1868 (Dwp_output_file::add_section): Rename to...
1869 (Dwp_output_file::add_contribution): ...this.
1870 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1871 (Dwp_output_file::add_tu_set): Likewise.
1872 (Dwp_output_file::Contribution): New type.
1873 (Dwp_output_file::Section::contributions): New data member.
1874 (Dwp_output_file::Cu_or_tu_set): Remove.
1875 (Dwp_output_file::Section::Section): New ctor.
1876 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1877 (Dwp_output_file::Dwp_index::Section_table): New type.
1878 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1879 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1880 parameter.
1881 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1882 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1883 (Dwp_output_file::Dwp_index::section_table): New member function.
1884 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1885 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1886 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1887 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1888 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1889 (Dwp_output_file::Dwp_index::section_table_): New data member.
1890 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1891 (Dwp_output_file::add_output_section): New member function.
1892 (Dwp_output_file::write_new_section): New member function.
1893 (Dwp_output_file::write_contributions): New member function.
1894 (Dwp_output_file::section_id_map_): New data member.
1895 (class Dwo_id_info_reader): Remove.
1896 (class Unit_reader): New class.
1897 (get_dwarf_section_name): New function.
1898 (Dwo_file::read_executable): Adjust initializations of class data.
1899 (Dwo_file::read): Add support for v2 package file format.
1900 (Dwo_file::read_unit_index): Likewise.
1901 (Dwo_file::sized_read_unit_index): Likewise.
1902 (Dwo_file::copy_section): Likewise.
1903 (Dwo_file::add_unit_set): Likewise.
1904 (Dwp_output_file::add_output_section): Likewise.
1905 (Dwp_output_file::add_contribution): Likewise.
1906 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1907 for empty slot.
1908 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1909 file format.
1910 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1911 slot.
1912 (Dwp_output_file::initialize): Remove unused function.
1913 (Dwp_output_file::finalize): Add support for v2 package file format.
1914 (Dwp_output_file::write_index): Likewise.
1915 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1916 function prototype.
1917
a68a081d
CC
19182013-03-01 Cary Coutant <ccoutant@google.com>
1919
1920 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1921 function into class definition in header file.
1922 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1923 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1924 New function.
1925 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1926
9d5781f8
AM
19272013-02-28 Alan Modra <amodra@gmail.com>
1928
1929 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1930 * target.cc (Target::do_plt_fde_location): New function.
1931 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1932 accessor function, and constructor param.
1933 (struct Post_fde, Post_fdes): Declare.
1934 (Cie::write): Add post_fdes param.
1935 * ehframe.cc (Fde::write): Use plt_fde_location.
1936 (struct Post_fde): Define.
1937 (Cie::write): Stash FDEs added post merge mapping.
1938 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1939 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1940 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1941 other FDEs.
1942 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1943 (Target_powerpc::has_glink): New function.
1944 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1945 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1946 glink_eh_frame_fde_32, default_fde): New data.
1947 (Stub_table::eh_frame_added_): New var.
1948 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1949 Make const.
1950 (Stub_table::add_eh_frame): New function.
1951 (Output_data_glink::add_eh_frame): New function.
1952 (Target_powerpc::make_glink_section): Call add_eh_frame.
1953
214383dd
ILT
19542013-02-15 Ian Lance Taylor <iant@google.com>
1955
1956 * options.h (DEFINE_uint64_alias): Define.
1957 (class General_options): Add -Ttext-segment as an alias for
1958 -Ttext.
1959
91c2b899
AM
19602013-02-15 Alan Modra <amodra@gmail.com>
1961
1962 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1963 (Stub_table::do_write): ..here, two places.
1964 (Stub_table::plt_call_size): Use it here too.
1965
20e2a8aa
ILT
19662013-02-11 Ian Lance Taylor <iant@google.com>
1967
1968 * descriptors.cc (Descriptors::close_all): New function.
1969 * descriptors.h (class Descriptors): Declare close_all.
1970 (close_all_descriptors): New inline function.
1971 * plugin.cc: Include "descriptors.h".
1972 (Plugin_manager::cleanup): Call close_all_descriptors.
1973
8952bc69
AM
19742013-02-06 Alan Modra <amodra@gmail.com>
1975
1976 * README: Update coding style link.
1977
29bd8b6b
CC
19782013-01-28 Cary Coutant <ccoutant@google.com>
1979
a4034750
AM
1980 * dwp.cc (File_list): New typedef.
1981 (Dwo_name_info_reader): New class.
1982 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1983 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1984 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1985 (Dwo_file::read_executable): New function.
1986 (Dwo_file::read): Move common setup code to ...
1987 (Dwo_file::make_object): ... here.
1988 (dwp_options): Add --exec/-e.
1989 (usage): Likewise.
1990 (main): Likewise.
29bd8b6b 1991
c6ac678d
ST
19922013-01-24 Sriraman Tallam <tmsriram@google.com>
1993
1994 * layout.cc (Layout::layout): Check for option text_reorder.
1995 (Layout::make_output_section): Ditto.
1996 * options.h (text_reorder): New option.
1997 * output.cc (Input_section_sort_compare): Remove special ordering
1998 of section names.
1999 (Output_section::
2000 Input_section_sort_section_name_special_ordering_compare::
2001 operator()): New function.
2002 (Output_section::sort_attached_input_sections): Use new sort function
2003 for .text.
2004 * output.h (Input_section_sort_section_name_special_ordering_compare):
2005 New struct.
2006 * testsuite/Makefile.am (text_section_grouping): Test option
2007 --no-text-reorder
2008 * testsuite/Makefile.in: Regenerate.
2009 * testsuite/text_section_grouping.sh: Check order of functions without
2010 default text reordering.
2011
50701cc1
MF
20122013-01-18 Mike Frysinger <vapier@gentoo.org>
2013
2014 * options.h (General_options): Change default to true for new_dtags.
2015
b1b00fcc
MF
20162013-01-18 Mike Frysinger <vapier@gentoo.org>
2017
2018 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2019 when enable_new_dtags is false. Only add DT_RUNPATH when
2020 enable_new_dtags is true.
2021
ec5b8187
AM
20222013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2023
2024 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2025 used in declaration and definition consistent.
2026 (Target_powerpc::symval_for_branch): Ditto.
2027
a880d4c4
ST
20282013-01-16 Sriraman Tallam <tmsriram@google.com>
2029
2030 * testsuite/plugin_final_layout.cc: Fix comment.
2031
7c381248
ST
20322013-01-16 Sriraman Tallam <tmsriram@google.com>
2033
2034 * layout.cc (Layout::layout): Do not do default sorting for
2035 text sections when section ordering is specified.
2036 (make_output_section): Ditto.
2037 * testsuite/plugin_final_layout.cc: Name the function sections
2038 to catch reordering issues.
2039
e2458743
AM
20402013-01-15 Alan Modra <amodra@gmail.com>
2041
2042 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2043 plt-thread-safe.
2044
431ed302
AM
20452013-01-15 Alan Modra <amodra@gmail.com>
2046
2047 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2048 * testsuite/Makefile.in: Regenerate.
2049
0ec6429b
AM
20502013-01-14 Alan Modra <amodra@gmail.com>
2051
2052 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2053 * testsuite/Makefile.in: Regenerate.
2054
0bf402d5
ILT
20552013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2056
36af3926 2057 PR bfd/14430
0bf402d5
ILT
2058 Fix mingw gold build with plugins enabled
2059 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2060 * configure.ac: Export DLOPEN_LIBS and add headers check.
2061 * plugin.cc: Handle non-dlfcn case.
2062 * Makefile.in: Regenerate.
2063 * config.in: Regenerate.
2064 * configure: Regenerate.
2065 * testsuite/Makefile.in: Regenerate.
2066
9e9143bc
ST
20672013-01-09 Sriraman Tallam <tmsriram@google.com>
2068
2069 * output.h (sort_attached_input_sections): Change to be public.
2070 * script-sections.cc
2071 (Output_section_definition::set_section_addresses): Sort
2072 attached input sections according to section order before linker
2073 script assigns section addresses.
2074 (Orphan_output_section::set_section_addresses): Sort
2075 attached input sections according to section order before linker
2076 script assigns section addresses.
2077 * Makefile.am (final_layout.sh): Use a simple linker script to
2078 check if section ordering still works.
2079 * Makefile.in: Regenerate.
2080
679af368
ILT
20812013-01-09 Ben Cheng <bccheng@google.com>
2082
2083 * arm.cc (Target_arm::attributes_accept_div): New function.
2084 (Target_arm::attributes_forbid_div): New function.
2085 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2086 attribute using the same new functions as what bfd/elf32_arm.c
2087 does.
2088
3136a00e
CC
20892013-01-07 Cary Coutant <ccoutant@google.com>
2090
2091 PR gold/14993
2092 * output.cc (Output_section::add_input_section): For incremental
2093 updates, don't track input sections that are allocated from patch
2094 space.
2095
f2a6224b
L
20962013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2097 Ian Lance Taylor <iant@google.com>
2098
2099 PR gold/14897
2100 * configure.ac (--enable-ld): Removed.
2101 (install_as_default): Set to yes only for --enable-gold=default
2102 or --disable-ld.
2103 * configure: Regenerated.
2104
4f46f626
L
21052013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2106
2107 * options.h (General_options): Add -fuse-ld= for GCC linker
2108 option compatibility.
2109
26e4ef59
CC
21102013-01-04 Cary Coutant <ccoutant@google.com>
2111
2112 * configure.ac: Fix typo restoring CXXFLAGS.
2113 * configure: Regenerate.
2114
3d587466
CC
21152013-01-04 Cary Coutant <ccoutant@google.com>
2116
4f46f626
L
2117 * testsuite/Makefile.am (CXXLINK_S): New macro.
2118 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2119 * testsuite/Makefile.in: Regenerate.
3d587466 2120
44db6695
L
21212013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2122
2123 * version.cc (print_version): Update copyright year to 2013.
2124
edcac0c1
ILT
21252012-12-20 Ian Lance Taylor <iant@google.com>
2126
2127 * layout.cc (Layout::special_ordering_of_input_section): New
2128 function.
2129 (Layout::layout): If input section requires special ordering, must
2130 sort input sections.
2131 (Layout::make_output_section): May sort .text input sections.
2132 (Layout::is_section_name_prefix_grouped): Remove.
2133 * layout.h (class Layout): Declare
2134 special_ordering_of_input_section. Don't declare
2135 is_section_name_prefix_grouped.
2136 * output.cc (Output_section::add_input_section): Revert last
2137 change.
2138 (Output_section::Input_section_sort::match_file_name): Don't crash
2139 if called on output section data.
2140 (Output_section::Input_section_sort_compare): Sort based on
2141 special ordering.
2142 (Output_section::Input_section_sort_section_order_index_compare):
2143 Revert last patch.
2144 (Output_section::sort_attached_input_sections): Likewise.
2145
28f2a4ac
ST
21462012-12-18 Sriraman Tallam <tmsriram@google.com>
2147
edcac0c1 2148 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2149 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2150 * output.cc (Output_section::add_input_section): Check if section
2151 name contains special prefix. Keep input sections to sort such
2152 sections.
2153 (Output_section::Input_section_sort_section_order_index_compare
2154 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2155 (Output_section::sort_attached_input_sections): Add condition to
2156 Input_section_entry constructor call.
28f2a4ac
ST
2157 * testsuite/Makefile.am (text_section_grouping): New test.
2158 * testsuite/Makefile.in: Regenerate.
2159 * testsuite/text_section_grouping.cc: New file.
2160 * testsuite/text_section_grouping.sh: New file.
2161
5bf135a7
NC
21622012-12-17 Nick Clifton <nickc@redhat.com>
2163
2164 * Makefile.am: Add copyright notice.
2165 * NEWS: Likewise.
2166 * README: Likewise.
2167 * configure.ac: Likewise.
2168 * ftruncate.c: Likewise.
2169 * Makefile.in: Regenerate.
2170
59965708
CC
21712012-12-14 Cary Coutant <ccoutant@google.com>
2172
a4034750
AM
2173 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2174 --no-as-needed flag.
2175 (exception_separate_shared_12_test): Likewise.
2176 (incremental_copy_test): Likewise.
2177 * testsuite/Makefile.in: Regenerate.
59965708 2178
2a77e2ab
CC
21792012-12-14 Cary Coutant <ccoutant@google.com>
2180
2181 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2182 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2183
e3deeb9c
AM
21842012-12-12 Alan Modra <amodra@gmail.com>
2185
2186 * powerpc.cc (class Track_tls): New.
2187 (class Relocate, class Scan): Inherit Track_tls.
2188 (Target_powerpc::Scan::local, global): Track tls optimization
2189 and avoid creating plt entry for __tls_get_addr if all uses
2190 are optimized away.
2191 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2192
d8f5a274
AM
21932012-12-12 Alan Modra <amodra@gmail.com>
2194
2195 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2196 Replace no_toc_optimize with toc_optimize.
2197 * output.h (Output_section::input_sections): Provide non-const variant.
2198 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2199 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2200 accessors.
2201 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2202 (class Sort_toc_sections): New.
2203 (Target_powerpc::do_finalize_sections): Sort toc sections.
2204 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2205
4c8a1de1
RM
22062012-12-10 Roland McGrath <mcgrathr@google.com>
2207
2208 * testsuite/binary_unittest.cc (read_all): New function.
2209 (Sized_binary_test): Use it instead of ::read.
2210 * fileread.cc (do_read): Don't assume pread always reads the whole
2211 amount in a single call.
2212
edc27beb
AM
22132012-12-10 Alan Modra <amodra@gmail.com>
2214
2215 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2216 Set EM_PPC64 or EM_PPC here.
2217 (Target_selector_powerpc::do_recognize): Delete.
2218
906b9150
AM
22192012-12-10 Alan Modra <amodra@gmail.com>
2220
2221 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2222 stub_table_.
2223 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2224
418c15ae
RM
22252012-12-07 Roland McGrath <mcgrathr@google.com>
2226
2227 * testsuite/binary_unittest.cc (Sized_binary_test):
2228 Use open_descriptor rather than ::open.
2229
decdd3bc
AM
22302012-12-07 Alan Modra <amodra@gmail.com>
2231
2232 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2233 typedef and invalid_address constant.
2234 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2235 instantiate constants.
2236
db399005
ILT
22372012-12-06 Roland McGrath <mcgrathr@google.com>
2238
2239 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2240 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2241 * aclocal.m4: Regenerate.
2242 * configure: Regenerate.
2243 * Makefile.in: Regenerate.
2244 * testsuite/Makefile.in: Regenerate.
2245
aba6bc71
AM
22462012-12-07 Alan Modra <amodra@gmail.com>
2247
2248 * options.h (General_options): Add no_toc_optimize.
2249 * powerpc.cc (ok_lo_toc_insn): New function.
2250 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2251
9e69ed50
AM
22522012-12-06 Alan Modra <amodra@gmail.com>
2253
2254 * options.h (General_options): Add plt_align, plt_static_chain,
2255 plt_thread_safe. Update stub_group_size help text.
2256 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2257 for new plt_thread_safe_ var.
2258 (use_plt_offset): Correct comments.
2259 (Target_powerpc::do_relax): Look for thread creation symbols to
2260 determine default plt_thread_safe value. Clear plt call stubs
2261 as well as branch stubs each iteration.
2262 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2263 insn constants.
2264 (l, hi, ha, write_insn): Move earlier.
2265 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2266 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2267 plt stubs too.
2268 (Stub_table::update_size): Adjust.
2269 (Stub_table::prev_size, set_prev_size): Delete.
2270 (Stub_table::stub_align): Let --plt-align affect result.
2271 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2272 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2273 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2274 (Stub_table::do_write): Support more stub variants.
2275
f43ba157
AM
22762012-12-04 Alan Modra <amodra@gmail.com>
2277
2278 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2279 (Target_powerpc::do_define_standard_symbols): New function.
2280
34171bc5
AM
22812012-12-03 Alan Modra <amodra@gmail.com>
2282
2283 * output.h: Formatting, whitespace.
2284
dc9589e9 22852012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2286
2287 * layout.h (Layout::get_executable_sections): Declare.
2288 * layout.cc (Layout::get_executable_sections): New function.
2289 * arm.cc (Target_arm::group_sections): Use it.
2290 (Arm_output_section::group_sections): Delete now redundant test.
2291 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2292 param to handle relative relocs.
2293 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2294 (Output_data_reloc::add_absolute): Adjust.
2295 (Output_data_reloc::add_relative): New function.
2296 (Output_data::reset_data_size): New function.
2297 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2298 (Output_section::set_addralign): New function.
2299 (Output_section::checkpoint_set_addralign): New function.
2300 (Output_section::clear_section_offsets_need_adjustment): New function.
2301 (Output_section::input_sections): Make public.
2302 * powerpc.cc (class Output_data_brlt_powerpc): New.
2303 (class Stub_table, class Stub_control): New.
2304 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2305 stub_table_, set_stub_table, stub_table): New vectors and accessor
2306 functions.
2307 (Target_powerpc::do_may_relax, do_relax, push_branch,
2308 new_stub_table, stub_tables, brlt_section, group_sections,
2309 add_branch_lookup_table, find_branch_lookup_table,
2310 write_branch_lookup_table, make_brlt_section): New functions.
2311 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2312 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2313 branch_info_): New vars.
2314 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2315 make call stubs here.
2316 (Output_data_glink): Remove all call stub handling from this class.
2317 (Target_powerpc::Scan::local, global): Save interesting branch
2318 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2319 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2320 functions on final link.
2321 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2322 Handle long branch destinations too.
2323 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2324 do_plt_address_for_local): Adjust lookup of plt call stubs.
2325
627b30b7
AM
23262012-11-30 Alan Modra <amodra@gmail.com>
2327
2328 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2329 relocs against protected symbols when building 32-bit shared libs.
2330
40b469d7
AM
23312012-11-30 Alan Modra <amodra@gmail.com>
2332
2333 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2334 param. Call got_section() to make .got. Update all callers
2335 and their callers and so on.
2336
bb66a627
AM
23372012-11-30 Alan Modra <amodra@gmail.com>
2338
2339 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2340 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2341 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2342 value if it already exists.
2343
d2cf1c6c
L
23442012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2345
2346 PR gold/14858
2347 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2348
edccdf7c
RM
23492012-11-14 Roland McGrath <mcgrathr@google.com>
2350
2351 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2352 than bfc instruction for data sandboxing.
2353
6febeb74
AM
23542012-11-08 Alan Modra <amodra@gmail.com>
2355
2356 * po/POTFILES.in: Regenerate.
2357
0a6f1bf2
AM
23582012-11-05 Alan Modra <amodra@gmail.com>
2359
2360 * configure.ac: Apply 2012-09-10 change to config.in here.
2361 * configure: Regenerate.
2362
26a4e9cb
AM
23632012-11-05 Alan Modra <amodra@gmail.com>
2364
2365 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2366 (struct Opd_ent): Use "Address" rather than "Offset".
2367 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2368 (Target_powerpc::got_section): Make public.
2369 (Target_powerpc::scan_relocs): Move code setting symbols..
2370 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2371 Create _SDA_BASE_ only when referenced.
2372
cc928013
RM
23732012-11-02 Roland McGrath <mcgrathr@google.com>
2374
2375 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2376 from last change.
2377
50ed5eb1
RM
23782012-11-01 Roland McGrath <mcgrathr@google.com>
2379
62fe925a
RM
2380 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2381 for offset_in_output_section parameter.
2382 (Sized_target::relocate_special_relocatable): Likewise.
2383 * arm.cc (Target_arm::relocate_relocs): Likewise.
2384 (Target_arm::relocate_special_relocatable): Likewise.
2385 * i386.cc (Target_i386::relocate_relocs): Likewise.
2386 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2387 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2388 * target-reloc.h (relocate_relocs): Likewise.
2389 * testsuite/testfile.cc (Target_test): Likewise.
2390 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2391 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2392
2393 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2394 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2395
2396 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2397 parameter, which is unused in the [!F_SETFD] case.
2398
50ed5eb1
RM
2399 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2400 SYMNDX to off_t before comparing it to this->data_size().
2401 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2402 * incremental.cc (Output_section_incremental_inputs::do_write):
2403 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2404
2cadc0bf
RM
2405 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2406
3bfcb652
NC
24072012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2408
2409 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2410 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2411 in EABI_VER5.
2412
c1a8d56e
CC
24132012-10-29 Cary Coutant <ccoutant@google.com>
2414
2415 * dwp.cc (usage): Add file and exit status parameters;
2416 add --help and --version options.
2417 (print_version): New function.
2418 (main): Add --help and --version options.
2419
b2490a7b
L
24202012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2421
2422 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2423 final_layout_sequence.txt.
2424 * testsuite/Makefile.in: Regenerated.
2425
aa543512
L
24262012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2427
2428 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2429 COMPILE generated by automake.
2430 (LINK1): Likewise.
2431 (CXXCOMPILE1): Likewise.
2432 (CXXLINK1): Likewise.
2433 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2434 (LINK): Likewise.
2435 (CXXCOMPILE): Likewise.
2436 (CXXLINK): Likewise.
2437 * testsuite/Makefile.in: Regenerated.
2438
d361fafb
L
24392012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2440
2441 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2442 on bad fwrite return.
2443
598c7410
L
24442012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2445
2446 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2447 on val.
2448
35c813e2
CC
24492012-10-23 Cary Coutant <ccoutant@google.com>
2450
2451 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2452 * testsuite/Makefile.in: Regenerate.
2453 * testsuite/dwp_test.h: New source file.
2454 * testsuite/dwp_test_1.cc: New source file.
2455 * testsuite/dwp_test_1.s: New source file.
2456 * testsuite/dwp_test_1.sh: New source file.
2457 * testsuite/dwp_test_1b.cc: New source file.
2458 * testsuite/dwp_test_1b.s: New source file.
2459 * testsuite/dwp_test_2.cc: New source file.
2460 * testsuite/dwp_test_2.s: New source file.
2461 * testsuite/dwp_test_2.sh: New source file.
2462 * testsuite/dwp_test_main.cc: New source file.
2463 * testsuite/dwp_test_main.s: New source file.
2464
77429909
CC
24652012-10-23 Cary Coutant <ccoutant@google.com>
2466
2467 * dwp.h: New header file.
2468 * dwp.cc: New source file.
2469 * gold.h: Move shared declarations to system.h.
2470 * system.h: New header file.
2471 * Makefile.am: Add dwp.
2472 * Makefile.in: Regenerate.
2473
ed5d6712
CC
24742012-10-23 Cary Coutant <ccoutant@google.com>
2475
2476 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2477 Dwarf_info_reader::read_from_pointer.
2478 (Dwarf_pubnames_table::read_header): Likewise.
2479 (Dwarf_pubnames_table::next_name): Likewise.
2480 (Dwarf_die::read_attributes): Likewise.
2481 (Dwarf_die::skip_attributes): Likewise.
2482 (Dwarf_info_reader::read_from_pointer): New function template.
2483 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2484 (Dwarf_pubnames_table): Likewise.
2485 (Dwarf_info_reader::read_from_pointer): New function template.
2486 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2487 Dwarf_pubnames_table ctor.
2488
8787852d
CC
24892012-10-23 Cary Coutant <ccoutant@google.com>
2490
2491 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2492 abbrev_shndx.
2493 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2494 abbrev_shndx_.
2495 (Dwarf_info_reader::set_abbrev_shndx): New method.
2496 (Dwarf_info_reader::abbrev_shndx_): New data member.
2497
9fc236f3
CC
24982012-10-23 Cary Coutant <ccoutant@google.com>
2499
2500 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2501 from object, not parameters.
2502 (Dwarf_info_reader::parse): Likewise.
2503 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2504 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2505 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2506 methods.
2507
effe8365
CC
25082012-10-23 Cary Coutant <ccoutant@google.com>
2509
2510 * fileread.cc (Input_file::Input_file): New constructor.
2511 * fileread.h (class Input_file): Add new constructor.
2512
1698990d
AM
25132012-10-18 Alan Modra <amodra@gmail.com>
2514
2515 PR gold/14727
2516 * object.cc (Relobj::is_section_name_included): Also match
2517 .sdata personality section.
2518
168a4726
AM
25192012-10-18 Alan Modra <amodra@gmail.com>
2520
2521 * target-reloc.h (class Default_comdat_behavior): New, package up..
2522 (get_comdat_behaviour): ..this.
2523 (relocate_section): Add Relocate_comdat_behavior template arg,
2524 adjust code to suit.
2525 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2526 (Target_arm::scan_reloc_section): Likewise.
2527 * i386.cc (Target_i386::relocate_section): Likewise.
2528 * sparc.cc (Target_sparc::relocate_section): Likewise.
2529 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2530 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2531 * powerpc.cc (class Relocate_comdat_behavior): New.
2532 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2533 gold::relocate_section with new template arg.
2534
acc276d8
AM
25352012-10-18 Alan Modra <amodra@gmail.com>
2536
2537 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2538 dynamic relocs for GOT_TPREL got entries, without symbol if
2539 resolving locally.
2540 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2541 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2542 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2543
e10f9870
AM
25442012-10-17 Alan Modra <amodra@gmail.com>
2545
2546 PR gold/14726
2547 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2548
ae034989
ST
25492012-10-16 Sriraman Tallam <tmsriram@google.com>
2550
2551 * layout.cc (Layout::include_section): Keep sections marked
2552 SHF_EXCLUDE when doing relocatable links.
2553
f3a0ed29
AM
25542012-10-16 Alan Modra <amodra@gmail.com>
2555
2556 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2557 (Target_powerpc::do_finalize_sections): Call it.
2558 (Output_data_save_res): New class and supporting functions.
2559 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2560 normal symbols defined in object files.
2561
c6de8ed4
AM
25622012-10-12 Alan Modra <amodra@gmail.com>
2563
2564 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2565 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2566 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2567 section if scan_opd_relocs not yet called.
2568 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2569
03e25981
AM
25702012-10-12 Alan Modra <amodra@gmail.com>
2571
2572 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2573 add_local_ifunc_entry): Revert last change.
2574 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2575
c9824451
AM
25762012-10-05 Alan Modra <amodra@gmail.com>
2577
2578 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2579 do_plt_address_for_global): New functions.
2580 (Output_data_got_powerpc::do_write): Don't segfault when linking
2581 statically.
2582 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2583 add_local_ifunc_entry): Return true on adding entry..
2584 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2585 glink->add_entry call. Remove unused symtab param. Adjust calls.
2586 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2587 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2588 set up symbols here.
2589 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2590 syms here. Do so even when no .iplt. Don't segfault when linking
2591 statically.
2592 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2593 new variants without reloc param.
2594 (Glink_sym_ent::Glink_sym_ent): Likewise.
2595 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2596 reloc when refs will resolve to plt call stub.
2597 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2598 R_PPC_PLTREL24 to resolve locally.
2599 (Target_powerpc::Scan::global): Correct ifunc handling.
2600 (Target_powerpc::Relocate::relocate): Correct local sym glink
2601 lookup. Don't destroy "value" when we have a plt call stub,
2602 and when checking plt call validity.
2603 (Target_powerpc::do_dynsym_value): Simplify.
2604
19fec8c1
AM
26052012-10-05 Alan Modra <amodra@gmail.com>
2606
2607 * i386.cc (Output_data_plt_i386::address_for_global,
2608 address_for_local): Add plt offset to returned value. Adjust uses.
2609 * sparc.cc (Output_data_plt_sparc::address_for_global,
2610 address_for_local): Likewise.
2611 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2612 address_for_local): Likewise.
2613 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2614 address_for_local): Likewise.
2615 * target.h (Target::plt_address_for_global, plt_address_for_local):
2616 Update comment.
2617 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2618 (Output_data_got::Got_entry::write): Nor here.
2619 * output.h: Comment fix.
2620
e867b647
WL
26212012-10-02 Jiong Wang <jiwang@tilera.com>
2622
2623 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2624 global_offset_table_ value for larget got.
2625 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2626
e5d5f5ed
AM
26272012-09-29 Alan Modra <amodra@gmail.com>
2628
2629 * powerpc.cc (Target_powerpc::iplt_): New output section.
2630 (Target_powerpc::iplt_section, make_iplt_section,
2631 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2632 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2633 Target_powerpc::plt_entry_count): Count iplt entries too.
2634 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2635 reloc section in constructor. New params.
2636 (Target_powerpc::make_plt_section): Create reloc section here instead.
2637 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2638 functions.
2639 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2640 (Output_data_glink::add_entry, find_entry): New functions to
2641 deal with local syms.
2642 (Glink_sym_ent): Add support for local syms.
2643 (Output_data_glink::do_write): Handle ifunc plt entries.
2644 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2645 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2646 (Target_powerpc::Relocate::relocate): Likewise.
2647 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2648
ec4dbad3
AM
26492012-09-25 Alan Modra <amodra@gmail.com>
2650
2651 * object.h (Sized_relobj_file::adjust_local_symbol,
2652 do_adjust_local_symbol): New functions.
2653 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2654 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2655 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2656 and irregular opd entry spacing.
2657 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2658 (Global_symbol_visitor_opd): New functor.
2659 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2660 on deleted opd entries.
2661
5c0b3823
WL
26622012-09-15 Jiong Wang <jiwang@tilera.com>
2663
2664 * tilegx.cc: New file.
2665 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2666 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2667 * configure.tgt: Add entries for tilegx*.
2668 * configure.ac: Likewise.
2669 * Makefile.in: Rebuild.
2670 * configure: Likewise.
2671 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2672 tilegx.
2673
bfdfa4cd
AM
26742012-09-13 Alan Modra <amodra@gmail.com>
2675
2676 * target-reloc.h (scan_relocs): Call scan.local for relocs
2677 against symbols in discarded sections. Pass is_discarded
2678 param.
2679 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2680 Add is_discarded param.
2681 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2682 is_discarded to flag opd entry as discarded. Don't emit dyn
2683 relocs on such entries.
2684 (Target_powerpc::Scan::global): Similarly detect and handle
2685 such opd entries.
2686 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2687 opd_ent_. Update all uses.
2688 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2689 (Target_powerpc::relocate_section): Zero out discarded opd
2690 entry relocs.
2691
d77a0555
ILT
26922012-09-12 Ian Lance Taylor <iant@google.com>
2693
2694 PR gold/14570
2695 * output.cc: Rename Output_data_got template parameter from size
2696 to got_size for all functions. Compile all variants of
2697 Output_data_got.
2698 (Output_data_got::Got_entry::write): Correct use of size for
2699 symbol value. Use local_is_tls rather than casting to
2700 Sized_relobj_file.
2701 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2702 (class Sized_relobj_file): Add do_local_is_tls.
2703 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2704
815a1205
AM
27052012-09-11 Alan Modra <amodra@gmail.com>
2706
2707 PR gold/14566
2708 * layout.cc (Layout::set_segment_offsets): When using
2709 common-page-size alignment, ensure we are on a new max-page-size
2710 page.
2711 * output.cc (Output_segment::set_section_addresses): Use
2712 abi_pagesize, not common_pagesize for relro boundary.
2713 (Output_segment::set_offset): Likewise.
2714
bd73a62d
AM
27152012-09-11 Alan Modra <amodra@gmail.com>
2716
2717 * output.h (Output_data_got::add_global_tls, add_local_tls,
2718 add_local_tls_pair): New functions.
2719 (Output_data_got::add_local_pair_with_rel): Remove second
2720 reloc param. Expand comment.
2721 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2722 use_plt_or_tls_offset_, similarly for constructor param.
2723 (Output_data_got::Got_entry::write): Add got_index param.
2724 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2725 add_local_tls_pair): New functions.
2726 (Output_data_got::Got_entry::write): Handle tls symbols
2727 with use_plt_or_tls_offset_ set specially.
2728 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2729 (Output_data_got::do_write): Replace iterator with index, pass
2730 index to entry write function.
2731 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2732 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2733 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2734 call.
2735 * i386.cc (Target_i386::Scan::local): Likewise.
2736 * sparc.cc (Target_sparc::Scan::local): Likewise.
2737 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2738 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2739 do_tls_offset_for_global): New functions.
2740 (Target_powerpc::Scan::local): Correct TLS relocations and got
2741 entry values.
2742 (Target_powerpc::Scan::global): Don't emit unnecessary
2743 dynamic relocations on TLS GOT entries.
2744
00716ab1
AM
27452012-09-10 Matthias Klose <doko@ubuntu.com>
2746
2747 * config.in: Disable sanity check for kfreebsd.
2748
c891b3f9
SA
27492012-09-10 Sterling Augustine <saugustine@google.com>
2750
2751 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2752 (Gdb_index::pubtypes_read): New parameter.
2753 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2754 to calls.
2755 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2756 pubtypes_object_.
2757
e81fea4d
AM
27582012-09-09 Alan Modra <amodra@gmail.com>
2759
2760 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2761 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2762 * gc.h (gc_process_relocs): Call target gc_add_reference.
2763 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2764 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2765 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2766 unnecessary cast.
2767 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2768 to cater for when we don't need code offset. Update use.
2769 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2770 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2771 set_opd_valid): New functions.
2772 (Target_powerpc::do_gc_add_reference): New function.
2773 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2774 stashed refs.
2775 (Target_powerpc::do_gc_mark_symbol): New function.
2776
d2d60eef
CC
27772012-09-06 Cary Coutant <ccoutant@google.com>
2778
2779 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2780 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2781 (Dwarf_die::skip_attributes): Likewise.
2782 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2783 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2784 (main): Call it.
2785 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2786
32ed4573
L
27872012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2788
2789 * testsuite/script_test_3.t: Add .got.plt output section
2790 statement.
2791 * testsuite/script_test_4.t: Likewise.
2792
f4baf0d4
AM
27932012-09-05 Alan Modra <amodra@gmail.com>
2794
2795 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2796 update all uses and lose "enum" when using type.
2797
864a1b56
AM
27982012-09-05 Alan Modra <amodra@gmail.com>
2799
2800 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2801 * configure: Regenerate.
2802 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2803 (plugin_final_layout.stdout): Likewise.
2804 (memory_test): Set page sizes to 0x1000.
2805 * testsuite/Makefile.in: Regenerate.
2806 * testsuite/discard_locals_test.sh: Add FIXME comment.
2807 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2808 * testsuite/pr14265.t: Add .got output section statement.
2809 * testsuite/script_test_2.t: Likewise.
2810 * testsuite/script_test_3.t: Likewise.
2811 * testsuite/script_test_4.t: Likewise.
2812 * testsuite/script_test_5.t: Likewise.
2813 * testsuite/script_test_6.t: Likewise.
2814 * testsuite/script_test_7.t: Likewise.
2815 * testsuite/script_test_9.t: Likewise.
2816
3ea0a085
AM
28172012-09-05 Alan Modra <amodra@gmail.com>
2818
2819 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2820 (Powerpc_relocate_functions::Status): New typedef.
2821 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2822 (Target_powerpc::Scan::local): Handle REL64.
2823 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2824 for REL32 and REL64.
2825 (Target_powerpc::symval_for_branch): New function, extracted from..
2826 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2827 checks. Report overflow errors.
2828
7404fe1b
AM
28292012-09-05 Alan Modra <amodra@gmail.com>
2830
2831 * object.h (Sized_relobj_file::emit_relocs): Delete.
2832 (Sized_relobj_file::emit_relocs_reltype): Delete.
2833 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2834 relocate_relocs for --emit-relocs.
2835 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2836 * output.h: Update comment.
2837 (Output_segment::first_section): New function.
2838 (Output_segment::first_section_load_address): Use first_section.
2839 * output.cc (Output_segment::first_section): New function extracted..
2840 (Output_segment::first_section_load_address): ..from here. Delete.
2841 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2842 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2843 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2844 adjust call to target.h function.
2845 * i386.cc (Target_i386): Likewise.
2846 * sparc.cc (Target_sparc): Likewise.
2847 * x86_64.cc (Target_x86_64): Likewise.
2848 * powerpc.cc (Target_powerpc): Likewise.
2849 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2850 first tls section has section symbol for optimised local dynamic
2851 output relocs.
2852 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2853 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2854 optimised tls code.
2855 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2856 Rename to relocate_relocs. Update error message.
2857
957564c9
AS
28582012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2859
2860 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2861 --just-symbols.
2862
dd93cd0a
AM
28632012-08-31 Alan Modra <amodra@gmail.com>
2864
2865 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2866 (Powerpc_relobj::toc_base_offset): New stub function.
2867 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2868 got_mod_index_offset to tlsld_got_offset. Update all refs.
2869 (Target_powerpc::Relocate::enum skip_tls): New.
2870 (Target_powerpc::call_tls_get_addr_): New var.
2871 (Target_powerpc::is_branch_reloc): Move to file scope.
2872 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2873 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2874 New functions.
2875 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2876 (powerpc_info): Correct common_pagesize for ppc64.
2877 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2878 (Powerpc_relocate_functions): Add overflow check enums and functions.
2879 Add non-shift version of rela, rela_ua. Delete all rel public
2880 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2881 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2882 addr16_ha3, addr14 functions.
2883 (Output_data_got_powerpc::add_constant_pair): New function.
2884 (Output_data_got_powerpc::got_base_offset): Likewise.
2885 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2886 (instruction constants): Sort, add some more.
2887 (Output_data_glink::do_write): Add and use Address typedef. Use
2888 object->toc_base_offset() stub for 64-bit.
2889 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2890 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2891 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2892 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2893 Always treat .opd relocs as against locally defined symbol.
2894 Correct condition for RELATIVE relocs.
2895 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2896 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2897 for 32-bit syms with a plt entry. Correct ppc64 toc base
2898 calculations. Handle TLS relocs, and more. Add overflow
2899 checking and adjust for Powerpc_relocate_functions changes.
2900 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2901 Reinstate --emit-relocs code with FIXME.
2902
a1373b60
AM
29032012-08-30 Alan Modra <amodra@gmail.com>
2904
2905 * layout.cc (Layout::set_segment_offsets): Set p_align to
2906 abi_pagesize, not common_pagesize.
2907 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2908 to determine whether file header can go in segment.
2909
703d02da
AM
29102012-08-30 Alan Modra <amodra@gmail.com>
2911
2912 * output.h (Output_reloc::Output_reloc <output section>): Add
2913 is_relative param. Adjust calls.
2914 (Output_reloc::add_output_section_relative): New functions.
2915 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2916 is_relative.
2917 (Output_reloc::symbol_value): Handle SECTION_CODE.
2918
16164a6b
ST
29192012-08-24 Sriraman Tallam <tmsriram@google.com>
2920
2921 * gold.cc (queue_middle_tasks): Call layout again when unique
2922 segments for sections is desired.
2923 * layout.cc (Layout::Layout): Initialize new members.
2924 (Layout::get_output_section_flags): New function.
2925 (Layout::choose_output_section): Call get_output_section_flags.
2926 (Layout::layout): Make output section for mapping to a unique segment.
2927 (Layout::insert_section_segment_map): New function.
2928 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2929 output sections marked so.
16164a6b
ST
2930 (Layout::segment_precedes): Check for unique segments when sorting.
2931 * layout.h (Layout::Unique_segment_info): New struct.
2932 (Layout::Section_segment_map): New typedef.
2933 (Layout::insert_section_segment_map): New function.
2934 (Layout::get_output_section_flags): New function.
2935 (Layout::is_unique_segment_for_sections_specified): New function.
2936 (Layout::set_unique_segment_for_sections_specified): New function.
2937 (Layout::unique_segment_for_sections_specified_): New member.
2938 (Layout::section_segment_map_): New member.
2939 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2940 Rename is_gc_pass_one to is_pass_one.
2941 Rename is_gc_pass_two to is_pass_two.
2942 Rename is_gc_or_icf to is_two_pass.
2943 Check for which pass based on whether symbols data is present.
2944 Make it two pass when unique segments for sections is desired.
2945 * output.cc (Output_section::Output_section): Initialize new
2946 members.
2947 * output.h (Output_section::is_unique_segment): New function.
2948 (Output_section::set_is_unique_segment): New function.
2949 (Output_section::is_unique_segment_): New member.
2950 (Output_section::extra_segment_flags): New function.
2951 (Output_section::set_extra_segment_flags): New function.
2952 (Output_section::extra_segment_flags_): New member.
2953 (Output_section::segment_alignment): New function.
2954 (Output_section::set_segment_alignment): New function.
2955 (Output_section::segment_alignment_): New member.
2956 (Output_segment::Output_segment): Initialize is_unique_segment_.
2957 (Output_segment::is_unique_segment): New function.
2958 (Output_segment::set_is_unique_segment): New function.
2959 (Output_segment::is_unique_segment_): New member.
2960 * plugin.cc (allow_unique_segment_for_sections): New function.
2961 (unique_segment_for_sections): New function.
2962 (Plugin::load): Add new functions to transfer vector.
2963 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2964 * Makefile.in: Regenerate.
2965 * testsuite/plugin_final_layout.sh: Check if unique segment
2966 functionality works.
2967 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2968 are available.
2969 (allow_unique_segment_for_sections): New global.
2970 (unique_segment_for_sections): New global.
2971 (claim_file_hook): Call allow_unique_segment_for_sections.
2972 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2973
1e2bee4f
CC
29742012-08-22 Cary Coutant <ccoutant@google.com>
2975
2976 * layout.cc (Layout::include_section): Don't assert on GROUP
2977 sections with --emit-relocs.
2978
1d5dfe78
CC
29792012-08-21 Cary Coutant <ccoutant@google.com>
2980
2981 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2982 if --export-dynamic-symbol names an undef symbol.
2983
c9269dff
AM
29842012-08-18 Alan Modra <amodra@gmail.com>
2985
2986 * powerpc.cc: Formatting and white space.
2987 (Powerpc_relobj): Rename got2_section_ to special_.
2988 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2989 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2990 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2991 (Target_powerpc): Add Address typedef and invalid_address. Use
2992 throughout.
2993 (Target_powerpc::is_branch_reloc): New function.
2994 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2995 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2996 for dst_mask, value and addend.
2997 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2998 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2999 (Output_data_glink::do_write): Correct toc base. Don't try to use
3000 uint16_t for 24-bit offset. Use get_output_section_offset and
3001 check return.
3002 (Target_powerpc::Scan::local): Handle more relocs.
3003 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3004 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3005 Plug in toc restoring insn after plt calls. Translate branches
3006 to function descriptor symbols to corresponding entry point.
3007 (Target_powerpc::relocate_for_relocatable): Check return from
3008 get_output_section_offset.
3009 * symtab.h: Comment typo.
3010
b1759dce
ILT
30112012-08-14 Ian Lance Taylor <iant@google.com>
3012
3013 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3014 unsupported_relocal_local to call unsupported_reloc_global.
3015
b9b2ae8b
NC
30162012-08-14 Nick Clifton <nickc@redhat.com>
3017
3018 PR ld/14265
3019 * script-sections.cc (Sections_element::output_section_name): Add
3020 keep return parameter.
3021 (Output_section_element::match_name): Add keep return parameter.
3022 Return the value of the keep_ member.
3023 * script-sections.h (class Output_section): Update
3024 output_section_name prototype.
3025 * layout.cc (Layout::keep_input_section): New public member
3026 function.
3027 (Layout::choose_output_section): Pass keep parameter to
3028 output_section_name.
3029 * layout.h (class Layout): Add keep_input_section.
3030 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3031 sections.
3032 * testsuite/Makefile.am: Add a test.
3033 * testsuite/Makefile.in: Regenerate.
3034 * testsuite/pr14265.c: Source file for the test.
3035 * testsuite/pr14265.t: Linker script for the test.
3036 * testsuite/pr14265.sh: Shell script for the test.
3037
921b5322
AM
30382012-08-14 Alan Modra <amodra@gmail.com>
3039
3040 * target.h (Target::output_section_name): New function.
3041 (Target::do_output_section_name): New function.
3042 * layout.cc (Layout::choose_output_section): Call the above.
3043 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3044
6ce78956
AM
30452012-08-14 Alan Modra <amodra@gmail.com>
3046
3047 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3048 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3049 for replace_constant call.
3050 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3051 (Output_data_glink::do_print_to_mapfile): New function.
3052 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3053 (Target_powerpc::Relocate::relocate): Likewise.
3054
d1a8cabd
AM
30552012-08-14 Alan Modra <amodra@gmail.com>
3056
3057 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3058 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3059 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3060 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3061 all references to shndx_. Handle special case for R_PPC_PLTREL24
3062 here.
3063 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3064 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3065 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3066 here.
3067 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3068 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3069
d83ce4e3
AM
30702012-08-12 Alan Modra <amodra@gmail.com>
3071
3072 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3073 (glink insn constants): Use uint32_t.
3074 (Output_data_glink::add_entry): Use insert, not [] operator.
3075
cf43a2fe
AM
30762012-08-11 Alan Modra <amodra@gmail.com>
3077
3078 * object.h (Sized_relobj_file::find_shdr): New function.
3079 (Sized_relobj_file::find_special_sections): New function.
3080 * object.cc (Sized_relobj_file::find_shdr): New function.
3081 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3082 (Sized_relobj_file::find_special_sections): New function, split out..
3083 (Sized_relobj_file::do_read_symbols): ..from here.
3084 * output.h (Output_data_got::replace_constant): New function.
3085 (Output_data_got::num_entries): New function.
3086 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3087 (Output_data_got::got_offset): Protected rather than private.
3088 (Output_data_got::replace_got_entry): New function.
3089 * output.cc (Output_data_got::replace_got_entry): New function.
3090 * powerpc.cc (class Powerpc_relobj): New.
3091 (class Powerpc_relocate_functions): Delete all psymval variants or
3092 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3093 Implement _ha functions using corresponding _hi function.
3094 (Powerpc_relobj::find_special_sections): New function.
3095 (Target_powerpc::do_make_elf_object): New function.
3096 (class Output_data_got_powerpc): New.
3097 (class Output_data_glink): New.
3098 (class Powerpc_scan_relocatable_reloc): New.
3099 Many more changes througout file.
3100
3c892704
NC
31012012-08-09 Nick Clifton <nickc@redhat.com>
3102
3103 * po/vi.po: Updated Vietnamese translation.
3104
82435b3b
ILT
31052012-08-07 Ian Lance Taylor <iant@google.com>
3106
3107 * layout.cc (Layout::add_target_dynamic_tags): If
3108 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3109 plt_rel.
3110
a6dc81d2
NC
31112012-07-30 Nick Clifton <nickc@redhat.com>
3112
3113 * po/gold.pot: Updated template.
3114 * po/es.po: Updated Spanish translation.
3115
f1415016
CC
31162012-07-18 Cary Coutant <ccoutant@google.com>
3117
3118 PR gold/14344
3119 * configure.ac: Add check for -gpubnames support.
3120 * configure: Regenerate.
3121 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3122 support; force -gno-pubnames.
3123 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3124 support.
3125 (gdb_index_test_4): New test.
3126 * testsuite/Makefile.in: Regenerate.
3127 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3128 * testsuite/gdb_index_test_2.sh: Likewise.
3129 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3130 * testsuite/gdb_index_test_4.sh: New script.
3131 * testsuite/gdb_index_test_comm.sh: New script with common code;
3132 don't look for space after colon.
3133
b7fd7c37
ST
31342012-07-16 Sriraman Tallam <tmsriram@google.com>
3135
3136 * gold.cc (queue_middle_tasks): Update function order only after
3137 deferred objects due to plugins are processed.
3138
1f3212db
ILT
31392012-07-11 Ian Lance Taylor <iant@google.com>
3140
3141 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3142 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3143 (Target_arm::scan_reloc_for_stub): Likewise.
3144 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3145 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3146 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3147 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3148 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3149
81c82a68
ILT
31502012-07-10 Dodji Seketeli <dodji@redhat.com>
3151 Ian Lance Taylor <iant@google.com>
3152
3153 PR gold/14309
3154 * configure.ac: Test whether std::tr1::hash<off_t> works.
3155 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3156 needed.
3157 * output.h (class Output_fill): Add virtual destructor.
3158 * configure, config.in: Rebuild.
3159
eabc84f4
RM
31602012-06-22 Roland McGrath <mcgrathr@google.com>
3161
3162 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3163
370e30b6
RÁE
31642012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3165
3166 * plugin.cc (Plugin::load): Handle position independent executables.
3167
fb1b895d
CC
31682012-06-06 Cary Coutant <ccoutant@google.com>
3169
3170 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3171 add .debug_macro.
3172 (lines_only_debug_sections): Likewise.
3173 (gdb_fast_lookup_sections): New static array.
3174 (is_gdb_debug_section): Rename formal parameter.
3175 (is_lines_only_debug_section): Likewise.
3176 (is_gdb_fast_lookup_section): New function.
3177 (Layout::include_section): Check for ".zdebug_" prefix; pass
3178 section name suffix to is_gdb_debug_section, et al.; check for
3179 fast-lookup sections when building .gdb_index.
3180 * options.h (--strip-debug-gdb): Update GDB version number.
3181
7c0640fa
CC
31822012-06-06 Cary Coutant <ccoutant@google.com>
3183
3184 * configure.ac: Add check for fallocate.
3185 * configure: Regenerate.
3186 * config.in: Regenerate.
3187
3188 * options.h (class General_options): Add --mmap-output-file and
3189 --posix-fallocate options.
3190 * output.cc: (posix_fallocate): Remove; replace with...
3191 (gold_fallocate): New function.
3192 (Output_file::map_no_anonymous): Call gold_fallocate.
3193 (Output_file::map): Check --mmap-output-file option.
3194
2a49eb69
DK
31952012-06-05 Jing Yu <jingyu@google.com>
3196
3197 * gold.h (textdomain): Add do {} to empty while(0).
3198 (bindtextdomain): Likewise.
3199
fad072ac
CC
32002012-06-04 Cary Coutant <ccoutant@google.com>
3201
3202 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3203 has_dynsym_index.
3204
8cc69fb6
ST
32052012-05-25 Sriraman Tallam <tmsriram@google.com>
3206
3207 * symtab.cc (Symbol_table::define_special_symbol):
3208 Initialize *poldsym to prevent uninitialized variable errors.
3209
1be75daa
CC
32102012-05-23 Cary Coutant <ccoutant@google.com>
3211
3212 * layout.cc (Layout::section_name_mapping): Add rules to handle
3213 exact match on .data.rel.ro.local or .data.rel.ro.
3214 (Layout::output_section_name): Check for exact matches.
3215
9b689de0
CC
32162012-05-23 Cary Coutant <ccoutant@google.com>
3217
3218 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3219 more carefully.
3220
b24fdbf5
CC
32212012-05-22 Cary Coutant <ccoutant@google.com>
3222
3223 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3224 object before exporting symbol.
3225
e550e1a2
L
32262012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3227
3228 * testsuite/tls_test.cc: Include "config.h" first.
3229 * testsuite/tls_test_c.c: Likewise.
3230
df7b86aa
NC
32312012-05-17 Daniel Richard G. <skunk@iskunk.org>
3232 Nick Clifton <nickc@redhat.com>
3233
3234 PR 14072
3235 * configure.in: Add check that sysdep.h has been included before
3236 any system header files.
3237 * configure: Regenerate.
3238 * config.in: Regenerate.
3239
1007b503
CC
32402012-05-14 Cary Coutant <ccoutant@google.com>
3241
3242 * layout.cc (Layout::make_output_section): Mark .tdata section
3243 as RELRO.
3244 * testsuite/relro_test.cc: Add a TLS variable.
3245
fd885f3a
L
32462012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3247
3248 PR gold/14091
3249 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3250 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3251 R_X86_64_64.
3252
80f5885c
CC
32532012-05-08 Cary Coutant <ccoutant@google.com>
3254
3255 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3256 (lines_only_debug_sections): Likewise.
3257
2e702c99
RM
32582012-05-02 Roland McGrath <mcgrathr@google.com>
3259
3260 * nacl.cc: New file.
3261 * nacl.h: New file.
3262 * Makefile.am (CCFILES, HFILES): Add them.
3263 * Makefile.in: Regenerate.
3264 * i386.cc (Output_data_plt_i386_nacl): New class.
3265 (Output_data_plt_i386_nacl_exec): New class.
3266 (Output_data_plt_i386_nacl_dyn): New class.
3267 (Target_i386_nacl): New class.
3268 (Target_selector_i386_nacl): New class.
3269 (target_selector_i386): Use it instead of Target_selector_i386.
3270 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3271 (Target_x86_64_nacl): New class.
3272 (Target_selector_x86_64_nacl): New class.
3273 (target_selector_x86_64, target_selector_x32): Use it instead of
3274 Target_selector_x86_64.
3275 * arm.cc (Output_data_plt_arm_nacl): New class.
3276 (Target_arm_nacl): New class.
3277 (Target_selector_arm_nacl): New class.
3278 (target_selector_arm, target_selector_armbe): Use it instead of
3279 Target_selector_arm.
3280
3281 * target-select.cc (select_target): Take new Input_file* and off_t
3282 arguments, pass them on to recognize method of selector.
3283 * object.cc (make_elf_sized_object): Update caller.
3284 * parameters.cc (parameters_force_valid_target): Likewise.
3285 * incremental.cc (make_sized_incremental_binary): Likewise.
3286 * target-select.h: Update decl.
3287 (Target_selector::recognize): Take new Input_file* argument,
3288 pass it on to do_recognize.
3289 (Target_selector::do_recognize): Take new Input_file* argument.
3290 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3291 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3292 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3293 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3294
3295 * target.h (Target::Target_info): New members isolate_execinstr
3296 and rosegment_gap.
3297 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3298 * arm.cc (Target_arm::arm_info): Update initializer.
3299 * i386.cc (Target_i386::i386_info): Likewise.
3300 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3301 * sparc.cc (Target_sparc::sparc_info): Likewise.
3302 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3303 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3304 * layout.cc (Layout::attach_allocated_section_to_segment):
3305 Take new const Target* argument. If target->isolate_execinstr(), act
3306 like --rosegment.
3307 (Layout::find_first_load_seg): Take new const Target* argument;
3308 if target->isolate_execinstr(), reject PF_X segments.
3309 (Layout::relaxation_loop_body): Update caller.
3310 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3311 reset file offset to zero when we hit LOAD_SEG, and then do a second
3312 loop over the segments before LOAD_SEG to reassign offsets after
3313 addresses have been determined. Handle target->rosegment_gap().
3314 (Layout::attach_section_to_segment): Take new const Target* argument;
3315 pass it to attach_allocated_section_to_segment.
3316 (Layout::make_output_section): Update caller.
3317 (Layout::attach_sections_to_segments): Take new const Target* argument;
3318 pass it to attach_section_to_segment.
3319 * gold.cc (queue_middle_tasks): Update caller.
3320 * layout.h (Layout): Update method decls with new arguments.
3321
3322 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3323 Target_info pointer to use.
3324 (Target_arm::do_make_data_plt): New virtual method.
3325 (Target_arm::make_data_plt): New method that calls it.
3326 (Target_arm::make_plt_entry): Use it.
3327 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3328 for the section alignment.
3329 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3330 method.
3331 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3332 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3333 method.
3334 (Output_data_plt_arm::get_plt_entry_size): Call it.
3335 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3336 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3337 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3338 method.
3339 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3340 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3341 method instead of sizeof(plt_entry).
3342 (Output_data_plt_arm::add_entry): Likewise.
3343 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3344 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3345 than static method.
3346 (Target_arm::plt_entry_size): Likewise.
3347 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3348 Move to ...
3349 (Output_data_plt_arm_standard): ... here, new class.
3350 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3351 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3352 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3353
3354 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3355 Take additional argument for the PLT entry size.
3356 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3357 Use get_plt_entry_size method rather than plt_entry_size variable.
3358 (Output_data_plt_x86_64::reserve_slot): Likewise.
3359 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3360 (Output_data_plt_x86_64::add_entry): Likewise.
3361 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3362 (Output_data_plt_x86_64::address_for_global): Likewise.
3363 (Output_data_plt_x86_64::address_for_local): Likewise.
3364 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3365 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3366 Make method non-static.
3367 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3368 method.
3369 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3370 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3371 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3372 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3373 virtual method.
3374 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3375 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3376 virtual method.
3377 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3378 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3379 virtual method.
3380 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3381 (Output_data_plt_x86_64::plt_entry_size)
3382 (Output_data_plt_x86_64::first_plt_entry)
3383 (Output_data_plt_x86_64::plt_entry)
3384 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3385 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3386 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3387 (Output_data_plt_x86_64_standard): ... here, new class.
3388 (Target_x86_64::Target_x86_64): Take optional argument for the
3389 Target_info pointer to use.
3390 (Target_x86_64::do_make_data_plt): New virtual method.
3391 (Target_x86_64::make_data_plt): New method to call it.
3392 (Target_x86_64::init_got_plt_for_update): Use that.
3393 Call this->plt_->add_eh_frame method here.
3394 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3395 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3396 rather than static method.
3397 (Target_x86_64::plt_entry_size): Likewise.
3398 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3399 rather than plt_entry_size variable. Move guts of PLT filling to...
3400 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3401 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3402 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3403
3404 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3405 additional argument for the section alignment.
3406 Don't do add_eh_frame_for_plt here.
3407 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3408 non-static. Use get_plt_entry_size method rather than plt_entry_size
3409 variable.
3410 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3411 method.
3412 (Output_data_plt_i386::get_plt_entry_size): Call it.
3413 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3414 (Output_data_plt_i386::add_eh_frame): New method to call it.
3415 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3416 method.
3417 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3418 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3419 method.
3420 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3421 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3422 method instead of plt_entry_size.
3423 (Output_data_plt_i386::plt_entry_size)
3424 (Output_data_plt_i386::plt_eh_frame_fde_size)
3425 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3426 (Output_data_plt_i386_standard): ... here, new class.
3427 (Output_data_plt_i386_exec): New class.
3428 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3429 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3430 (Output_data_plt_i386::exec_plt_entry): Move to ...
3431 (Output_data_plt_i386_exec::plt_entry): ... here.
3432 (Output_data_plt_i386_dyn): New class.
3433 (Output_data_plt_i386::first_plt_entry): Move to ...
3434 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3435 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3436 (Output_data_plt_i386_dyn::plt_entry): ... here.
3437 (Target_i386::Target_i386): Take optional argument for the Target_info
3438 pointer to use.
3439 (Target_i386::do_make_data_plt): New virtual method.
3440 (Target_i386::make_data_plt): New method to call it.
3441 (Target_i386::make_plt_section): Use that.
3442 Call this->plt_->add_eh_frame method here.
3443 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3444 rather than plt_entry_size variable.
3445 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3446 (Output_data_plt_i386::address_for_local): Likewise.
3447 (Output_data_plt_i386::do_write): Likewise.
3448 Move guts of PLT filling to...
3449 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3450 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3451 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3452 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3453
b9b9f2ee
CC
34542012-05-01 Cary Coutant <ccoutant@google.com>
3455
3456 * dwarf_reader.cc (Dwarf_die::read_attributes)
3457 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3458 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3459 * reduced_debug_output.cc
3460 (Output_reduced_debug_info_section::get_die_end): Remove
3461 DW_FORM_GNU_ref_index. Add default case.
3462
57923f48
MW
34632012-04-26 Mark Wielaard <mjw@redhat.com>
3464
3465 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3466 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3467 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3468 DW_AT_high_pc as offset from DW_AT_low_pc.
3469
3470 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3471 * testsuite/Makefile.in: Regenerate.
3472 * testsuite/gdb_index_test_3.c: New test source file.
3473 * testsuite/gdb_index_test_3.sh: New test source file.
3474
2c54b4f4
ILT
34752012-04-25 Ian Lance Taylor <iant@google.com>
3476
3477 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3478 pointer.
3479 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3480 as a class, not a struct.
3481 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3482 (Target_arm::apply_cortex_a8_workaround): Likewise.
3483 * gc.h: Declare Reloc_types as a struct, not a class.
3484 * object.h: Declare Symbols_data as a struct.
3485 * reloc.h: Declare Read_relocs_data as a struct.
3486 * target.h: Declare Relocate_info as a struct.
3487
a5a5f7a3
DM
34882012-04-24 David S. Miller <davem@davemloft.net>
3489
3490 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3491 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3492 and R_SPARC_WPLT30.
3493
f038d496
CC
34942012-04-24 Cary Coutant <ccoutant@google.com>
3495
3496 * incremental-dump.cc (find_input_containing_global): Replace
3497 magic number with symbolic constant.
3498 (dump_incremental_inputs): Update version number.
3499 * incremental.cc (Output_section_incremental_inputs): Update version
3500 number; import symbolic constants from Incremental_inputs_reader.
3501 (Incremental_inputs::create_data_sections): Align relocations
3502 section correctly for 64-bit targets.
3503 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3504 constants; add padding.
3505 (Output_section_incremental_inputs::write_header): Add assert for
3506 header_size.
3507 (Output_section_incremental_inputs::write_input_files): Add assert
3508 for input_entry_size.
3509 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3510 add assert for object_info_size, input_section_entry_size,
3511 global_sym_entry_size.
3512 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3513 for data structure sizes; use them.
3514 (Incremental_input_entry_reader): Import symbolic constants from
3515 Incremental_inputs_reader; use them.
3516
a4d85145
DM
35172012-04-23 David S. Miller <davem@davemloft.net>
3518
3519 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3520 and elf_flags_set_.
3521 (Target_sparc::Target_sparc): Initialize new fields.
3522 (Target_sparc::do_make_elf_object): New function.
3523 (Target_sparc::do_adjust_elf_header): New function.
3524
1d509098
CC
35252012-04-23 Cary Coutant <ccoutant@google.com>
3526
3527 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3528 CU range table of gdb index.
3529
7ebeff7f
DM
35302012-04-20 David S. Miller <davem@davemloft.net>
3531
3532 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3533 instead of false.
3534
13cf9988
DM
35352012-04-16 David S. Miller <davem@davemloft.net>
3536
2a1079e8
DM
3537 * sparc.cc (Target_sparc::got_address): New function.
3538 (Sparc_relocate_functions::gdop_hix22): New function.
3539 (Sparc_relocate_functions::gdop_lox10): New function.
3540 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3541 relocs.
3542 (Target_sparc::Scan::local): Likewise if the global symbol is not
3543 preemptible and is not IFUNC.
3544 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3545 transformations for local and non-preemptible non-IFUNC global
3546 symbols.
3547
0bc964fc
DM
3548 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3549 writing out 64-bit part of ranges.
3550
661d7a80
DM
3551 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3552 -fpic and -fpie respectively.
3553 * Makefile.in: Regenerate.
3554
8c2bf391
DM
3555 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3556 (Target_sparc::Target_sparc): Initialize new field.
3557 (Target_sparc::do_plt_section_for_global): New function.
3558 (Target_sparc::do_plt_section_for_local): New function.
3559 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3560 (Target_sparc::make_plt_section): New function, broken out of
3561 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3562 (Target_sparc::make_plt_entry): Call make_plt_section.
3563 (Target_sparc::make_local_ifunc_plt_entry): New function.
3564 (Target_sparc::rela_ifunc_section): New function.
3565 (Target_sparc::plt_section): Remove const.
3566 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3567 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3568 and ifunc_count_ fields.
3569 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3570 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3571 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3572 (Output_data_plt_sparc::rela_ifunc): New function.
3573 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3574 (Output_data_plt_sparc::has_ifunc_section): New function.
3575 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3576 (Output_data_plt_sparc::address_for_global): New function.
3577 (Output_data_plt_sparc::address_for_local): New function.
3578 (Output_data_plt_sparc::plt_index_to_offset): New function.
3579 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3580 and entry_count.
3581 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3582 entry_count.
3583 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3584 R_SPARC_JMP_IREL to switch.
3585 (Target_sparc::Scan::check_non_pic): Likewise.
3586 (Target_sparc::Scan::local): Handle IFUNC symbols.
3587 (Target_sparc::Scan::local): Likewise.
3588 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3589 and plt_address_for_local.
3590 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3591 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3592
13cf9988
DM
3593 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3594 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3595 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3596 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3597 global relocs too.
3598 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3599 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3600 calls.
3601 * sparc.cc (Target_sparc::Scan::global): Likewise.
3602 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3603
31821be0
CC
36042012-04-16 Cary Coutant <ccoutant@google.com>
3605
3606 * archive.cc (Library_base::should_include_member): Check for
3607 --export-dynamic-symbol.
3608 * options.h (class General_options): Add --export-dynamic-symbol.
3609 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3610 --export-dynamic-symbol.
3611 (Symbol_table::gc_mark_undef_symbols): Likewise.
3612 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3613
2615994e
DM
36142012-04-12 David S. Miller <davem@davemloft.net>
3615
3616 * sparc.cc (Reloc::wdisp10): New relocation method.
3617 (Reloc::h34): Likewise.
3618 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3619 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3620 R_SPARC_WDISP10.
3621 (Target_sparc::Scan::local): Likewise.
3622 (Target_sparc::Scan::global): Likewise.
3623 (Target_sparc::Relocate::relocate): Likewise.
3624
6782735d
CC
36252012-04-09 Cary Coutant <ccoutant@google.com>
3626
3627 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3628 low_pc == 0.
3629
8c7a0b00
ILT
36302012-04-06 Ian Lance Taylor <iant@google.com>
3631
3632 * timer.cc: #include <unistd.h>.
3633
58797674
RM
36342012-04-06 Roland McGrath <mcgrathr@google.com>
3635
3636 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3637 * config.in: Regenerate.
3638 * configure: Regenerate.
3639
44350750
NC
36402012-04-05 Nick Clifton <nickc@redhat.com>
3641
3642 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3643 (AM_LC_MESSAGES): Add.
3644 * aclocal.m4: Regenerate.
3645 * config.in: Regenerate.
3646 * configure: Regenerate.
3647
c1027032
CC
36482012-03-21 Cary Coutant <ccoutant@google.com>
3649
3650 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3651 * Makefile.in: Regenerate.
3652 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3653 (Sized_elf_reloc_mapper::symbol_section): New function.
3654 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3655 (make_elf_reloc_mapper): New function.
3656 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3657 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3658 (Dwarf_abbrev_table::do_get_abbrev): New function.
3659 (Dwarf_ranges_table::read_ranges_table): New function.
3660 (Dwarf_ranges_table::read_range_list): New function.
3661 (Dwarf_pubnames_table::read_section): New function.
3662 (Dwarf_pubnames_table::read_header): New function.
3663 (Dwarf_pubnames_table::next_name): New function.
3664 (Dwarf_die::Dwarf_die): New function.
3665 (Dwarf_die::read_attributes): New function.
3666 (Dwarf_die::skip_attributes): New function.
3667 (Dwarf_die::set_name): New function.
3668 (Dwarf_die::set_linkage_name): New function.
3669 (Dwarf_die::attribute): New function.
3670 (Dwarf_die::string_attribute): New function.
3671 (Dwarf_die::int_attribute): New function.
3672 (Dwarf_die::uint_attribute): New function.
3673 (Dwarf_die::ref_attribute): New function.
3674 (Dwarf_die::child_offset): New function.
3675 (Dwarf_die::sibling_offset): New function.
3676 (Dwarf_info_reader::check_buffer): New function.
3677 (Dwarf_info_reader::parse): New function.
3678 (Dwarf_info_reader::do_parse): New function.
3679 (Dwarf_info_reader::do_read_string_table): New function.
3680 (Dwarf_info_reader::lookup_reloc): New function.
3681 (Dwarf_info_reader::get_string): New function.
3682 (Dwarf_info_reader::visit_compilation_unit): New function.
3683 (Dwarf_info_reader::visit_type_unit): New function.
3684 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3685 Sized_elf_reloc_mapper.
3686 (Sized_dwarf_line_info::symbol_section): Remove function.
3687 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3688 (Sized_dwarf_line_info::read_line_mappings): Remove object
3689 parameter, adjust callers.
3690 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3691 * dwarf_reader.h: Include <sys/types.h>.
3692 (class Track_relocs): Remove forward declaration.
3693 (class Elf_reloc_mapper): New class.
3694 (class Sized_elf_reloc_mapper): New class.
3695 (class Dwarf_abbrev_table): New class.
3696 (class Dwarf_range_list): New class.
3697 (class Dwarf_ranges_table): New class.
3698 (class Dwarf_pubnames_table): New class.
3699 (class Dwarf_die): New class.
3700 (class Dwarf_info_reader): New class.
3701 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3702 (Sized_dwarf_line_info::symbol_section): Remove member function.
3703 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3704 base class.
3705 * gdb-index.cc: New source file.
3706 * gdb-index.h: New source file.
3707 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3708 and .debug_types sections, call Layout::add_to_gdb_index.
3709 (Sized_relobj_incr::do_section_name): Implement.
3710 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3711 return type; Implement.
3712 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3713 return type.
3714 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3715 parameter list and return type.
3716 (Sized_incr_dynobj::do_section_contents): Likewise.
3717 * layout.cc: Include gdb-index.h.
3718 (Layout::Layout): Initialize gdb_index_data_.
3719 (Layout::init_fixed_output_section): Check for .gdb_index section.
3720 (Layout::add_to_gdb_index): New function. Instantiate.
3721 * layout.h: Add forward declaration for class Gdb_index.
3722 (Layout::add_to_gdb_index): New member function.
3723 (Layout::gdb_index_data_): New data member.
3724 * main.cc: Include gdb-index.h.
3725 (main): Print statistics for gdb index.
3726 * object.cc (Object::section_contents): Move code into
3727 do_section_contents.
3728 (need_decompressed_section): Check for sections needed when building
3729 gdb index.
3730 (build_compressed_section_map): Likewise.
3731 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3732 gdb index.
3733 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3734 sections; call Layout::add_to_gdb_index.
3735 (Sized_relobj_file::do_decompressed_section_contents): Call
3736 do_section_contents directly.
3737 * object.h (Object::do_section_contents): Adjust parameter list and
3738 return type.
3739 (Object::do_decompressed_section_contents): Call do_section_contents
3740 directly.
3741 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3742 return type.
3743 * options.h (class General_options): Add --gdb-index option.
3744 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3745 list and return type.
3746 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3747 * reloc.h (Track_relocs::checkpoint): New function.
3748 (Track_relocs::reset): New function.
3749
3750 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3751 New test cases.
3752 * testsuite/Makefile.in: Regenerate.
3753 * testsuite/gdb_index_test.cc: New test source file.
3754 * testsuite/gdb_index_test_1.sh: New test source file.
3755 * testsuite/gdb_index_test_2.sh: New test source file.
3756
647f1574
DK
37572012-03-19 Doug Kwan <dougkwan@google.com>
3758
3759 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3760 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3761 __exidx_start and __exidx_end. Make symbol table parameter
3762 anonymous as it is not used.
3763 * gold.cc (queue_middle_tasks): Call target hook to define any
3764 target-specific symbols.
3765 * target.h (Target::define_standard_symbols): New method.
3766 (Target::do_define_standard_symbols): Same.
3767 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3768 * testsuite/Makefile.in: Regenerate.
3769 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3770 and __exidx_end.
3771 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3772 relocations are generated for __exidx_start and __exidx_end.
3773
7c6109da
DK
37742012-03-16 Doug Kwan <dougkwan@google.com>
3775
3776 * testsuite/Makefile.am: Disable test initpri3b.
3777 * testsuite/Makefile.in: Regenerate.
3778
7b8957f8
DK
37792012-03-15 Doug Kwan <dougkwan@google.com>
3780
3781 * arm.cc (Target_arm::got_section): Make .got section read-only
3782 if -z now is given.
3783
14dc9ef7
ILT
37842012-03-15 Ian Lance Taylor <iant@google.com>
3785
3786 PR gold/13850
3787 * layout.cc (Layout::make_output_section): Correctly mark
3788 SHT_INIT_ARRAY, et. al., as relro.
3789
fa40b62a
DK
37902012-03-14 Doug Kwan <dougkwan@google.com>
3791
3792 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3793 dynamic relocations for protected symbols in shared objects.
3794
fd325007
ILT
37952012-03-13 Ian Lance Taylor <iant@google.com>
3796
3797 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3798 keep the larger alignment.
3799
e8dd54e1
CC
38002012-03-12 Cary Coutant <ccoutant@google.com>
3801
3802 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3803 handling of DW_LNE_define_file.
3804
feb5f3b0
CC
38052012-03-12 Cary Coutant <ccoutant@google.com>
3806
3807 * reduced_debug_output.cc
3808 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3809 codes to switch.
3810
a1fb4256
CC
38112012-02-29 Cary Coutant <ccoutant@google.com>
3812
3813 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3814
5dd8762a
CC
38152012-02-29 Cary Coutant <ccoutant@google.com>
3816
3817 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3818 Call Object::decompressed_section_contents.
3819 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3820 New dtor.
3821 (Sized_dwarf_line_info::buffer_start_): New data member.
3822 * merge.cc (Output_merge_data::do_add_input_section): Call
3823 Object::decompressed_section_contents.
3824 (Output_merge_string::do_add_input_section): Likewise.
3825 * object.cc (need_decompressed_section): New function.
3826 (build_compressed_section_map): Decompress sections needed later.
3827 (Sized_relobj_file::do_decompressed_section_contents): New function.
3828 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3829 * object.h (Object::decompressed_section_contents): New function.
3830 (Object::discard_decompressed_sections): New function.
3831 (Object::do_decompressed_section_contents): New function.
3832 (Object::do_discard_decompressed_sections): New function.
3833 (Compressed_section_info): New type.
3834 (Compressed_section_map): Include decompressed section contents.
3835 (Sized_relobj_file::do_decompressed_section_contents): New function.
3836 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3837
7b5de7ee
CC
38382012-02-16 Cary Coutant <ccoutant@google.com>
3839
3840 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3841 * testsuite/Makefile.in: Regenerate.
3842
f9fa4a63
CC
38432012-02-14 Cary Coutant <ccoutant@google.com>
3844
3845 * options.cc (General_options::finalize): Disallow -pie and -static.
3846
2c175ebc
DK
38472012-02-03 Doug Kwan <dougkwan@google.com>
3848
3849 * arm.cc (Arm_relocate_functions::abs8,
3850 Arm_relocate_functions::abs16): Use
3851 Bits::has_signed_unsigned_overflow32.
3852 (Arm_relocate_functions::thm_abs8): Correct range of
3853 overflow check.
3854 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3855 in assertions.
3856
90cff06f
DK
38572012-02-02 Doug Kwan <dougkwan@google.com>
3858
3859 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3860 position independent outputs, not just shared objects.
3861
63887f3d
L
38622012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3863
3864 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3865 * configure: Regenerated.
3866
bef2b434
ILT
38672012-01-27 Ian Lance Taylor <iant@google.com>
3868
3869 * reloc.h (Bits): New class with static functions, copied from
3870 namespace utils in arm.cc.
3871 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3872 instead.
3873
c335b55d
L
38742012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3875
3876 * incremental.cc (write_info_blocks): Correct relocation offset.
3877
41194d9f
L
38782012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3879
3880 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3881 (Relocate::tls_gd_to_le): Likewise.
3882
1bae613c
L
38832012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3884
3885 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3886
24482ca0
L
38872012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3888
3889 * configure.ac: Check if -mcmodel=medium works.
3890 * configure: Regenerated.
3891
c2c7840a
CC
38922012-01-24 Cary Coutant <ccoutant@google.com>
3893
3894 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3895 definition and ...
3896 (read_unsigned_LEB_128_x): ... this new function.
3897 (read_signed_LEB_128): Replaced with inline definition and ...
3898 (read_signed_LEB_128_x): ... this new function.
3899 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3900 (read_unsigned_LEB_128): Add inline definition.
3901 (read_signed_LEB_128_x): New function.
3902 (read_signed_LEB_128): Add inline definition.
3903 * testsuite/Makefile.am (leb128_unittest): New unit test.
3904 * testsuite/Makefile.in: Regenerate.
3905 * testsuite/leb128_unittest.cc: New unit test.
3906
833de760 39072012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3908
3909 PR gold/13617
3910 * i386.cc (Target_i386::do_code_fill): When using a jmp
3911 instruction, pad with nop instructions.
3912 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3913
618d6666
L
39142012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3915
3916 * x86_64.cc (gc_process_relocs): Add typename on types used in
3917 template.
3918 (scan_relocs): Likewise.
3919 (relocate_section): Likewise.
3920 (apply_relocation): Likewise.
3921
3660ff06
L
39222012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3923
3924 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3925 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3926 under x32.
3927
fc51264f
L
39282012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3929
3930 * x86_64.cc: Initial support for x32.
3931
dd74ae06
CC
39322012-01-03 Cary Coutant <ccoutant@google.com>
3933
3934 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3935 Use abstract base class for GOT.
3936 * gold/output.h (class Output_data_got_base): New abstract base class.
3937 (class Output_data_got): Derive from new base class, adjust ctors.
3938 (Output_data_got::reserve_slot): Make virtual; rename to
3939 do_reserve_slot; Adjust callers.
3940 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3941 pointer to abstract base class.
3942 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3943
83896202
ILT
39442011-12-18 Ian Lance Taylor <iant@google.com>
3945
3946 * object.h (Relobj::local_symbol_value): New function.
3947 (Relobj::local_plt_offset): New function.
3948 (Relobj::local_has_got_offset): New function.
3949 (Relobj::local_got_offset): New function.
3950 (Relobj::set_local_got_offset): New function.
3951 (Relobj::do_local_symbol_value): New pure virtual function.
3952 (Relobj::do_local_plt_offset): Likewise.
3953 (Relobj::do_local_has_got_offset): Likewise.
3954 (Relobj::do_local_got_offset): Likewise.
3955 (Relobj::do_set_local_got_offset): Likewise.
3956 (Sized_relobj::do_local_has_got_offset): Rename from
3957 local_has_got_offset.
3958 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3959 (Sized_relobj::do_set_local_got_offset): Rename from
3960 set_local_got_offset.
3961 (Sized_relobj_file::do_local_plt_offset): Rename from
3962 local_plt_offset.
3963 (Sized_relobj_file::do_local_symbol_value): New function.
3964 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3965 local_plt_offset.
3966 * output.cc (Output_data_got::Got_entry::write): Change object to
3967 Relobj. Use local_symbol_value.
3968 (Output_data_got::add_global_with_rel): Change rel_dyn to
3969 Output_data_reloc_generic*. Use add_global_generic.
3970 (Output_data_got::add_global_with_rela): Remove. Change all
3971 callers to use add_global_with_rel.
3972 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3973 Output_data_reloc_generic*. Use add_global_generic.
3974 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3975 callers to use add_global_pair_with_rel.
3976 (Output_data_got::add_local): Change object to Relobj*.
3977 (Output_data_got::add_local_plt): Likewise.
3978 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3979 change rel_dyn to Output_data_reloc_generic*. Use
3980 add_local_generic.
3981 (Output_data_got::add_local_with_rela): Remove. Change all
3982 callers to use all_local_with_rel.
3983 (Output_data_got::add_local_pair_with_rel): Change object to
3984 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3985 add_output_section_generic.
3986 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3987 callers to use add_local_pair_with_rel.
3988 (Output_data_got::reserve_local): Change object to Relobj*.
3989 * output.h: (class Output_data_reloc_generic): Add pure virtual
3990 declarations for add_global_generic, add_local_generic,
3991 add_output_section_generic.
3992 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3993 functions for Output_data_reloc_generic. Update declarations for
3994 changes listed in output.cc.
3995 (class Output_data_got): Change template parameter to got_size.
3996 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3997 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3998 function.
3999 (Sized_relobj_incr::do_local_plt_offset): New function.
4000 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4001 add_global_generic.
4002
76677ad0
CC
40032011-12-17 Cary Coutant <ccoutant@google.com>
4004
4005 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4006 * resolve.cc (Symbol_table::resolve): Likewise.
4007 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4008 arrays.
4009 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4010
8b8dd8d5
ILT
40112011-12-16 Ian Lance Taylor <iant@google.com>
4012
4013 * output.h (Output_data_reloc_generic::add): Only call
4014 add_dynamic_reloc if this is a dynamic reloc section.
4015
d55525b9
L
40162011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4017
4018 PR gold/13505
4019 * target-reloc.h (apply_relocation): Replace <64, false> with
4020 <size, big_endian>.
4021
ff81c7c1
NC
40222011-11-25 Nick Clifton <nickc@redhat.com>
4023
4024 * po/it.po: New Italian translation.
4025
628f39be
SA
40262011-11-17 Sterling Augustine <saugustine@google.com>
4027
4028 * script.cc (script_include_directive): Implement.
4029 (read_script_file): New local variables name and search_path. Update
4030 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4031 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4032 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4033
98ef3ea4
SA
40342011-11-11 Sterling Augustine <saugustine@google.com>
4035
4036 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4037 (file_or_sections_cmd): Likewise.
4038
f4a8b6d7
DK
40392011-11-11 Doug Kwan <dougkwan@google.com>
4040
4041 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4042 if --just-symbols is given.
4043
29ab395d
DK
40442011-11-10 Doug Kwan <dougkwan@google.com>
4045
4046 PR gold/13362
4047 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4048 when processing data relocs.
4049 * reloc.h (Relocate_functions::rel_unaligned): New method.
4050 (Relocate_functions::pcrel_unaligned): Ditto.
4051 (Relocate_functions::rel32_unaligned): Ditto.
4052 (Relocate_functions::pcrel32_unaligned): Ditto.
4053
2c339f71
DK
40542011-11-09 Doug Kwan <dougkwan@google.com>
4055
4056 PR gold/13362
4057 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4058 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4059 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4060 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4061 (Relocate_functions::rel_unaligned): New.
4062 (Relocate_functions::rel32_unaligned): New.
4063 * target-reloc.h (relocate_for_relocatable): Add code to handle
4064 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4065 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4066 arm_unaligned_reloc_r): New targets.
4067 * testsuite/Makefile.in: Regenerate.
4068 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4069 linking.
4070
3f3cddf1
ILT
40712011-11-02 Ian Lance Taylor <iant@google.com>
4072
4073 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4074 NATIVE_LINKER.
4075 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4076 * options.cc (General_options::finalize): Use library search path
4077 from configure script if specified. If not native and no sysroot,
4078 only search TOOLLIBDIR.
4079 * options.h (Search_directory::Search_directory): Change name to
4080 const std::string&.
4081 (General_options::add_to_library_path_with_sysroot): Change arg to
4082 const std::string&.
4083 * configure, Makefile.in, config.in: Rebuild.
4084
a8e2273b
ILT
40852011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4086
4087 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4088 we are working around the ARM1176 Erratum.
4089 * options.h (General_options::fix_arm1176): Add option.
4090 * testsuite/Makefile.am: Add testcases, and keep current ones
4091 working.
4092 * testsuite/Makefile.in: Regenerate.
4093 * testsuite/arm_fix_1176.s: New file.
4094 * testsuite/arm_fix_1176.sh: Likewise.
4095
cd6eab1c
ILT
40962011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4097
4098 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4099 may_use_blx_.
4100 (Target_arm::may_use_blx): Remove method.
4101 (Target_arm::set_may_use_blx): Likewise.
4102 (Target_arm::may_use_v4t_interworking): New method.
4103 (Target_arm::may_use_v5t_interworking): Likewise.
4104 (Target_arm::may_use_blx_): Remove member variable.
4105 (Arm_relocate_functions::arm_branch_common): Check for v5T
4106 interworking.
4107 (Arm_relocate_functions::thumb_branch_common): Likewise.
4108 (Reloc_stub::stub_type_for_reloc): Likewise.
4109 (Target_arm::do_finalize_sections): Correct interworking checks.
4110 * testsuite/Makefile.am: Add new tests.
4111 * testsuite/Makefile.in: Regenerate.
4112 * testsuite/arm_farcall_arm_arm.s: New test.
4113 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4114 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4115 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4116 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4117 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4118 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4119 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4120
286adcf4
CC
41212011-10-31 Cary Coutant <ccoutant@google.com>
4122
4123 PR gold/13023
4124 * expression.cc (Expression::eval_with_dot): Add
4125 is_section_dot_assignment parameter.
4126 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4127 absolute and assigning to dot within a section.
4128 * script-sections.cc
4129 (Output_section_element_assignment::set_section_addresses): Pass
4130 dot_section to set_if_absolute.
4131 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4132 as is_section_dot_assignment flag to eval_with_dot.
4133 (Output_section_element_dot_assignment::set_section_addresses):
4134 Likewise.
4135 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4136 parameter. Also set value if relative to dot_section; set the
4137 symbol's output_section.
4138 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4139 parameter. Adjust all callers.
4140 (Expression::eval_maybe_dot): Likewise.
4141 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4142 Adjust all callers.
4143 * testsuite/script_test_2.t: Test assignment of an absolute value
4144 to dot within an output section element.
4145
9634ed06
CC
41462011-10-31 Cary Coutant <ccoutant@google.com>
4147
4148 * options.h (class General_options): Add --[no-]gnu-unique options.
4149 * symtab.cc (Symbol_table::sized_write_globals): Convert
4150 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4151
de4101c7
CC
41522011-10-31 Cary Coutant <ccoutant@google.com>
4153
4154 PR gold/13359
4155 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4156 unnecessary assertion.
4157 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4158
7257cc92
ST
41592011-10-31 Sriraman Tallam <tmsriram@google.com>
4160
4161 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4162 gc_mark_symbol.
4163 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4164 gc_mark_symbol.
4165 Change to just keep the section associated with symbol.
4166 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4167 they are externally visible and --export-dynamic is turned on.
4168 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4169
bfc34b3f
ILT
41702011-10-19 Ian Lance Taylor <iant@google.com>
4171
4172 PR gold/13163
4173 * script-sections.cc
4174 (Output_section_element_dot_assignment::needs_output_section): New
4175 function.
4176
ea0d8c47
ILT
41772011-10-19 Ian Lance Taylor <iant@google.com>
4178
4179 PR gold/13204
4180 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4181 --section-start option was seen.
4182 * options.h (General_options::any_section_start): New function.
4183
abd242a9
DM
41842011-10-18 David S. Miller <davem@davemloft.net>
4185
4186 PR binutils/13301
4187 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4188 member to track relocation locations that have moved during TLS
4189 reloc optimizations.
4190 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4191 (Target_sparc::Relocate::relocate): Adjust view down by 4
4192 bytes if it matches reloc_adjust_addr_.
4193 (Target_sparc::Relocate::relocate_tls): Always move the
4194 __tls_get_addr call delay slot instruction forward 4 bytes when
4195 performing relaxation.
4196
bab9090f
CC
41972011-10-18 Cary Coutant <ccoutant@google.com>
4198
4199 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4200 (Output_file::map_no_anonymous): Check for non-zero
4201 return code from posix_fallocate.
4202
f7c5b166
CC
42032011-10-17 Cary Coutant <ccoutant@google.com>
4204
4205 PR gold/13245
4206 * plugin.cc (is_visible_from_outside): Check for symbols
4207 referenced from dynamic objects.
4208 * resolve.cc (Symbol_table::resolve): Don't count references
4209 from dynamic objects as references from real ELF files.
4210 * testsuite/plugin_test_2.sh: Adjust expected result.
4211
b490c0bb
CC
42122011-10-17 Cary Coutant <ccoutant@google.com>
4213
4214 * gold.cc: Include timer.h.
4215 (queue_middle_tasks): Stamp time.
4216 (queue_final_tasks): Likewise.
4217 * main.cc (main): Store timer in parameters. Print timers
4218 for each pass.
4219 * parameters.cc (Parameters::Parameters): Initialize timer_.
4220 (Parameters::set_timer): New function.
4221 (set_parameters_timer): New function.
4222 * parameters.h (Parameters::set_timer): New function.
4223 (Parameters::timer): New function.
4224 (Parameters::timer_): New data member.
4225 (set_parameters_timer): New function.
4226 * timer.cc (Timer::stamp): New function.
4227 (Timer::get_pass_time): New function.
4228 * timer.h (Timer::stamp): New function.
4229 (Timer::get_pass_time): New function.
4230 (Timer::pass_times_): New data member.
4231
f475cf7b
CC
42322011-10-17 Cary Coutant <ccoutant@google.com>
4233
4234 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4235 task for members of lib groups.
4236
cdd7e244
CC
42372011-10-17 Cary Coutant <ccoutant@google.com>
4238
4239 PR gold/13288
4f95c8b4 4240 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4241 (File_read::make_view): Move bounds check (replace with assert)...
4242 (File_read::find_or_make_view): ... to here.
4243
dfb45471
CC
42442011-10-12 Cary Coutant <ccoutant@google.com>
4245
4f95c8b4 4246 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4247 ::read returns less than requested size.
4248
53bbcc1b
CC
42492011-10-10 Cary Coutant <ccoutant@google.com>
4250
4f95c8b4 4251 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4252 Initialize defined_count_.
4253 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4254 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4255 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4256 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4257 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4258 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4259 member.
4260 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4261 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4262 Return zeroes instead of internal error.
4263
397b129b
CC
42642011-10-10 Cary Coutant <ccoutant@google.com>
4265
4266 PR gold/13249
4f95c8b4 4267 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4268 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4269 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4270 (Output_reloc::type_): Adjust size of bit field.
4271 (Output_reloc::use_plt_offset_): New bit field.
4272 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4273 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4274 flag. Adjust all callers.
4f95c8b4 4275 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4276 creating RELATIVE relocations.
4277
d5698657
NC
42782011-10-10 Nick Clifton <nickc@redhat.com>
4279
4280 * po/es.po: Updated Spanish translation.
4281 * po/fi.po: Updated Finnish translation.
4282
6a59a5c2
DN
42832011-10-03 Diego Novillo <dnovillo@google.com>
4284
4285 * options.cc (parse_uint): Fix dereference of RETVAL.
4286
f0558624
ST
42872011-09-29 Sriraman Tallam <tmsriram@google.com>
4288
4289 * layout.h (section_order_map_): New member.
4290 (get_section_order_map): New member function.
4291 * output.cc (Output_section::add_input_section): Check for patterns
4292 only when --section-ordering-file is specified.
4293 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4294 output_sections have been formed.
4295 * layout.cc (Layout_Layout): Initialize section_order_map_.
4296 * plugin.cc (update_section_order): Store order in order_map. Do not
4297 update the order.
4298 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4299 * testsuite/Makefile.in: Regenerate.
4300 * testsuite/plugin_section_order.c: New file.
4301 * testsuite/plugin_final_layout.cc: New file.
4302 * testsuite/plugin_final_layout.sh: New file.
4303
a7dac153
CC
43042011-09-29 Cary Coutant <ccoutant@google.com>
4305
4f95c8b4 4306 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4307 Check for NULL.
4f95c8b4 4308 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4309 symbols during incremental update.
4310 (Symbol_table::add_from_dynobj): Likewise.
4311
eebd87a5
ILT
43122011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4313 Ian Lance Taylor <iant@google.com>
4314
4315 * symtab.cc (Symbol_table::define_special_symbol): Always
4316 canonicalize version string.
4317
403a3331
CC
43182011-09-26 Cary Coutant <ccoutant@google.com>
4319
4f95c8b4
CC
4320 * gold.cc (queue_initial_tasks): Move option checks ...
4321 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4322 some options; make others fatal.
4323
235061c2
CC
43242011-09-26 Cary Coutant <ccoutant@google.com>
4325
4326 gcc PR lto/47247
4327 * plugin.cc (get_symbols_v2): New function.
4328 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4329 (is_referenced_from_outside): New function.
4330 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4331 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4332 (get_symbols): Pass version parameter.
4333 (get_symbols_v2): New function.
4334 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4335 parameter.
4336 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4337 (onload): Add LDPT_GET_SYMBOLS_V2.
4338 (all_symbols_read_hook): Use get_symbols_v2; check for
4339 LDPR_PREVAILING_DEF_IRONLY_EXP.
4340 * testsuite/plugin_test_3.sh: Update expected results.
4341
dc87f620
ILT
43422011-09-23 Simon Baldwin <simonb@google.com>
4343
4344 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4345 configuration options.
4346 * configure: Regenerate.
4347 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4348 * Makefile.in: Regenerate.
4349 * testsuite/Makefile.in: Regenerate.
4350
a8279f82
ST
43512011-09-19 Sriraman Tallam <tmsriram@google.com>
4352
4353 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4354
0c9350c8
CC
43552011-09-19 Cary Coutant <ccoutant@google.com>
4356
4357 * incremental.cc (can_incremental_update): Fix typo in comment.
4358 * incremental.h (can_incremental_update): Likewise.
4359
aa06ae28
CC
43602011-09-18 Cary Coutant <ccoutant@google.com>
4361
4362 * incremental.cc (can_incremental_update): New function.
4363 * incremental.h (can_incremental_update): New function.
4364 * layout.cc (Layout::init_fixed_output_section): Call it.
4365 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4366 * object.cc (Sized_relobj_file::do_layout): Call
4367 can_incremental_update.
4368
ebb300b2
CC
43692011-09-13 Cary Coutant <ccoutant@google.com>
4370
4371 * configure.ac: Check for glibc support for gnu_indirect_function
4372 support with static linking, setting automake conditional
4373 IFUNC_STATIC.
4374 * Makefile.in: Regenerate.
4375 * configure: Regenerate.
4376
4377 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4378 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4379 for IFUNC_STATIC.
4380 * testsuite/Makefile.in: Regenerate.
4381
1206d0d5
CC
43822011-09-13 Cary Coutant <ccoutant@google.com>
4383
4384 * incremental.cc (Sized_relobj_incr::do_layout): Call
4385 report_comdat_group for kept comdat sections.
4386 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4387 * testsuite/Makefile.in: Regenerate.
4388 * testsuite/incr_comdat_test_1.cc: New source file.
4389 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4390 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4391 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4392
40b29874
ILT
43932011-09-13 Ian Lance Taylor <iant@google.com>
4394
4395 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4396 variable external_symbols_offset.
4397
1b045aac
ILT
43982011-09-12 Ian Lance Taylor <iant@google.com>
4399
4400 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4401 triggered if object has no symbols.
4402
24c6c55a
DM
44032011-09-09 David S. Miller <davem@davemloft.net>
4404
4405 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4406 (Output_fill_debug_line::do_write): Likewise.
4407
66570254
CC
44082011-08-29 Cary Coutant <ccoutant@google.com>
4409
4410 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4411 casts to match formatting specs.
4412 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4413
8ea8cd50
CC
44142011-08-26 Cary Coutant <ccoutant@google.com>
4415
4416 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4417 remaining hole size when allocating.
4418 (Layout::make_output_section): Set fill methods for debug sections.
4419 * layout.h (Free_list::Free_list_node): Move from private to
4420 public.
4421 (Free_list::set_min_hole_size): New function.
4422 (Free_list::begin, Free_list::end): New functions.
4423 (Free_list::min_hole_): New data member.
4424 * output.cc: Include dwarf.h.
4425 (Output_fill_debug_info::do_minimum_hole_size): New function.
4426 (Output_fill_debug_info::do_write): New function.
4427 (Output_fill_debug_line::do_minimum_hole_size): New function.
4428 (Output_fill_debug_line::do_write): New function.
4429 (Output_section::Output_section): Initialize new data member.
4430 (Output_section::set_final_data_size): Ensure patch space is larger
4431 than minimum hole size.
4432 (Output_section::do_write): Fill holes in debug sections.
4433 * output.h (Output_fill): New class.
4434 (Output_fill_debug_info): New class.
4435 (Output_fill_debug_line): New class.
4436 (Output_section::set_free_space_fill): New function.
4437 (Output_section::free_space_fill_): New data member.
4438 * testsuite/Makefile.am (incremental_test_3): Add
4439 --incremental-patch option.
4440 (incremental_test_4): Likewise.
4441 (incremental_test_5): Likewise.
4442 (incremental_test_6): Likewise.
4443 (incremental_copy_test): Likewise.
4444 (incremental_common_test_1): Likewise.
4445 * testsuite/Makefile.in: Regenerate.
4446
7cf80422
NC
44472011-08-26 Nick Clifton <nickc@redhat.com>
4448
4449 * po/es.po: Updated Spanish translation.
4450
c3f7b0e5
CC
44512011-08-01 Cary Coutant <ccoutant@google.com>
4452
4453 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4454 * gold/testsuite/Makefile.in: Regenerate.
4455 * gold/testsuite/justsyms_exec.c: New source file.
4456 * gold/testsuite/justsyms_lib.c: New source file.
4457
9590bf25
CC
44582011-08-01 Cary Coutant <ccoutant@google.com>
4459
4460 * layout.cc (Layout::set_segment_offsets): Don't realign text
4461 segment if -Ttext was specified.
4462 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4463 file type.
4464 * object.h (Sized_relobj_file::e_type): New function.
4465 (Sized_relobj_file::e_type_): New data member.
4466 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4467 base address for ET_EXEC files.
4468 * target.cc (Target::do_make_elf_object_implementation): Allow
4469 ET_EXEC files with --just-symbols option.
4470
dcd8d12e
CC
44712011-07-28 Cary Coutant <ccoutant@google.com>
4472
4473 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4474 Add thread_number parameter.
4475 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4476 * workqueue-threads.cc
4477 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4478 current thread if its thread number is greater than desired thread
4479 count.
4480 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4481 Add thread_number parameter.
4482 (Workqueue::should_cancel_thread): Likewise.
4483 (Workqueue::find_runnable_or_wait): Pass thread_number to
4484 should_cancel_thread.
4485 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4486 parameter.
4487
804eb480
ST
44882011-07-22 Sriraman Tallam <tmsriram@google.com>
4489
4490 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4491 only after checking if it cannot be forced local.
4492 * symtab.h (is_externally_visible): Check if the symbol is not forced
4493 local.
4494
f1ddb600
ILT
44952011-07-15 Ian Lance Taylor <iant@google.com>
4496
4497 * options.h (class General_options): Add --print-output-format.
4498 Move -EL next to -EB, for better --help output.
4499 * target-select.cc: Include <cstdio>, "options.h", and
4500 "parameters.h".
4501 (Target_selector::do_target_bfd_name): New function.
4502 (print_output_format): New function.
4503 * target-select.h (class Target_selector): Update declarations.
4504 (Target_selector::target_bfd_name): New function.
4505 (print_output_format): Declare.
4506 * main.cc: Include "target-select.h".
4507 (main): Handle --print-output-format.
4508 * gold.cc: Include "target-select.h".
4509 (queue_initial_tasks): Handle --print-output-format when there are
4510 no input files.
4511 * parameters.cc (parameters_force_valid_target): Give a better
4512 error message if -EB/-EL does not match target.
4513 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4514 function.
4515
7d172687
ILT
45162011-07-15 Ian Lance Taylor <iant@google.com>
4517
4518 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4519 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4520 (Output_data_plt_i386::do_write): Write address of .dynamic
4521 section to first entry in .got.plt section.
4522 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4523 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4524 Initialize layout_.
4525 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4526 section to first entry in .got.plt section.
4527 * layout.h (Layout::dynamic_section): New function.
4528
e9552f7e
ST
45292011-07-13 Sriraman Tallam <tmsriram@google.com>
4530
4531 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4532 to claim_file call.
4533 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4534 input_section_position_, and input_section_glob_.
4535 (read_layout_from_file): Call function section_ordering_specified.
4536 * layout.h (is_section_ordering_specified): New function.
4537 (section_ordering_specified): New function.
4538 (section_ordering_specified_): New boolean member.
4539 * main.cc(main): Call load_plugins after layout object is defined.
4540 * output.cc (Output_section::add_input_section): Use
4541 function section_ordering_specified to check if section ordering is
4542 needed.
4543 * output.cc (Output_section::add_relaxed_input_section): Use
4544 function section_ordering_specified to check if section ordering is
4545 needed.
4546 (Output_section::update_section_layout): New function.
4547 (Output_section::sort_attached_input_sections): Check if input section
4548 must be reordered.
4549 * output.h (Output_section::update_section_layout): New function.
4550 * plugin.cc (get_section_count): New function.
4551 (get_section_type): New function.
4552 (get_section_name): New function.
4553 (get_section_contents): New function.
4554 (update_section_order): New function.
58797674 4555 (allow_section_ordering): New function.
e9552f7e
ST
4556 (Plugin::load): Add the new interfaces to the transfer vector.
4557 (Plugin_manager::load_plugins): New parameter.
4558 (Plugin_manager::all_symbols_read): New parameter.
4559 (Plugin_manager::claim_file): New parameter. Save the elf object for
4560 unclaimed objects.
4561 (Plugin_manager::get_elf_object): New function.
4562 (Plugin_manager::get_view): Change to directly use the bool to check
4563 if get_view is called from claim_file_hook.
4564 * plugin.h (input_objects): New function
4565 (Plugin__manager::load_plugins): New parameter.
4566 (Plugin_manager::claim_file): New parameter.
4567 (Plugin_manager::get_elf_object): New function.
4568 (Plugin_manager::in_claim_file_handler): New function.
4569 (Plugin_manager::in_claim_file_handler_): New member.
4570 (layout): New function.
4571 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4572 handler with an extra parameter. Make the elf object before calling
4573 claim_file handler.
4574 * testsuite/plugin_test.c (get_section_count): New function pointer.
4575 (get_section_type): New function pointer.
4576 (get_section_name): New function pointer.
4577 (get_section_contents): New function pointer.
4578 (update_section_order): New function pointer.
4579 (allow_section_ordering): New function pointer.
4580 (onload): Check if the new interfaces exist.
4581
9446efde
ILT
45822011-07-13 Ian Lance Taylor <iant@google.com>
4583
4584 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4585 relro section.
4586 * x86_64.cc (Target_x86_64::got_section): Likewise.
4587 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4588 (relro_now_test_SOURCES): New variable.
4589 (relro_now_test_DEPENDENCIES): New variable.
4590 (relro_now_test_LDFLAGS): New variable.
4591 (relro_now_test_LDADD): New variable.
4592 (relro_now_test.so): New target.
4593 * testsuite/Makefile.in: Rebuild.
4594
07aa62f2
ILT
45952011-07-12 Ian Lance Taylor <iant@google.com>
4596
4597 PR gold/12980
4598 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4599 GLOB_DAT relocation rather than a RELATIVE relocation for a
4600 protected symbol when creating a shared library.
4601 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4602 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4603 * testsuite/protected_main_1.cc (main): Test that protected
4604 function has same address.
4605
e2153196
ILT
46062011-07-11 Ian Lance Taylor <iant@google.com>
4607
4608 PR gold/12979
4609 * options.h (class General_options): Add -Bgroup.
4610 * options.cc (General_options::finalize): If -Bgroup is set,
4611 default to --unresolved-symbols=report-all.
4612 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4613 * target-reloc.h (issue_undefined_symbol_error): Handle
4614 --unresolved-symbols=report-all.
4615
6daf5215
ILT
46162011-07-08 Ian Lance Taylor <iant@google.com>
4617
4618 PR gold/11985
4619 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4620 if linker script discards key sections.
4621 (Layout::create_dynamic_symtab): Likewise.
4622 (Layout::assign_local_dynsym_offsets): Likewise.
4623 (Layout::sized_create_version_sections): Likewise.
4624 (Layout::create_interp): Likewise.
4625 (Layout::finish_dynamic_section): Likewise.
4626 (Layout::set_dynamic_symbol_size): Likewise.
4627
beabb2c6
ILT
46282011-07-08 Ian Lance Taylor <iant@google.com>
4629
4630 PR gold/12386
4631 * options.h (class General_options): Add --unresolved-symbols.
4632 * target-reloc.h (issue_undefined_symbol_error): Check
4633 --unresolved-symbols. Add comments.
4634
9c16daf1
ILT
46352011-07-08 Ian Lance Taylor <iant@google.com>
4636
4637 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4638 expression more complex.
4639
191f1a2d
ILT
46402011-07-08 Ian Lance Taylor <iant@google.com>
4641
4642 PR gold/11317
4643 * target-reloc.h (issue_undefined_symbol_error): New inline
4644 function, broken out of relocate_section.
4645 (relocate_section): Call issue_undefined_symbol_error.
4646 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4647 there is no TLS segment if we are about to issue an undefined
4648 symbol error.
4649 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4650
62855347
ILT
46512011-07-08 Ian Lance Taylor <iant@google.com>
4652
4653 PR gold/12279
4654 * resolve.cc (Symbol_table::should_override): Add fromtype
4655 parameter. Change all callers. Give error when linking together
4656 TLS and non-TLS symbol.
4657 (Symbol_table::should_override_with_special): Add fromtype
4658 parameter. Change all callers.
4659 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4660 there is no TLS segment if we have reported some errors.
4661 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4662
67181c72
ILT
46632011-07-08 Ian Lance Taylor <iant@google.com>
4664
4665 PR gold/12372
4666 * target.h (Target::plt_address_for_global): New function.
4667 (Target::plt_address_for_local): New function.
4668 (Target::plt_section_for_global): Remove.
4669 (Target::plt_section_for_local): Remove.
4670 (Target::do_plt_address_for_global): New virtual function.
4671 (Target::do_plt_address_for_local): New virtual function.
4672 (Target::do_plt_section_for_global): Remove.
4673 (Target::do_plt_section_for_local): Remove.
4674 (Target::register_global_plt_entry): Add Symbol_table and Layout
4675 parameters.
4676 * output.cc (Output_data_got::Got_entry::write): Use
4677 plt_address_for_global and plt_address_for_local.
4678 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4679 address of output section.
4680 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4681 got_irelative_, and irelative_count_ fields. Update
4682 declarations.
4683 (Output_data_plt_i386::has_irelative_section): New function.
4684 (Output_data_plt_i386::entry_count): Add irelative_count_.
4685 (Output_data_plt_i386::set_final_data_size): Likewise.
4686 (class Target_i386): Add got_irelative_ and rel_irelative_
4687 fields. Update declarations.
4688 (Target_i386::Target_i386): Initialize new fields.
4689 (Target_i386::do_plt_address_for_global): New function replacing
4690 do_plt_section_for_global.
4691 (Target_i386::do_plt_address_for_local): New function replacing
4692 do_plt_section_for_local.
4693 (Target_i386::got_section): Create got_irelative_.
4694 (Target_i386::rel_irelative_section): New function.
4695 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4696 fields. Don't define __rel_iplt_{start,end}.
4697 (Output_data_plt_i386::add_entry): Add symtab and layout
4698 parameters. Change all callers. Use different PLT and GOT for
4699 IFUNC symbols.
4700 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4701 layout parameters. Change all callers. Use different PLT and
4702 GOT.
4703 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4704 (Output_data_plt_i386::rel_irelative): New function.
4705 (Output_data_plt_i386::address_for_global): New function.
4706 (Output_data_plt_i386::address_for_local): New function.
4707 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4708 IRELATIVE GOT when changing IFUNC GOT entries.
4709 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4710 reloc.
4711 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4712 if we didn't create an IRELATIVE GOT.
4713 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4714 plt_address_for_local.
4715 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4716 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4717 got_irelative_, and irelative_count_ fields. Update
4718 declarations.
4719 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4720 Initialize new fields. Remove symtab parameter. Change all
4721 callers.
4722 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4723 irelative_count_.
4724 (Output_data_plt_x86_64::has_irelative_section): New function.
4725 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4726 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4727 fields. Update declarations.
4728 (Target_x86_64::Target_x86_64): Initialize new fields.
4729 (Target_x86_64::do_plt_address_for_global): New function replacing
4730 do_plt_section_for_global.
4731 (Target_x86_64::do_plt_address_for_local): New function replacing
4732 do_plt_section_for_local.
4733 (Target_x86_64::got_section): Create got_irelative_.
4734 (Target_x86_64::rela_irelative_section): New function.
4735 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4736 all callers. Don't create __rel_iplt_{start,end}.
4737 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4738 parameters. Change all callers. Use different PLT and GOT for
4739 IFUNC symbols.
4740 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4741 layout parameters. Change all callers. Use different PLT and
4742 GOT.
4743 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4744 parameters. Change all callers. Use different PLT and GOT for
4745 IFUNC symbols.
4746 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4747 (Output_data_plt_x86_64::rela_irelative): New function.
4748 (Output_data_plt_x86_64::address_for_global): New function.
4749 (Output_data_plt_x86_64::address_for_local): New function.
4750 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4751 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4752 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4753 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4754 parameters.
4755 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4756 reloc.
4757 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4758 symbols if we didn't create an IRELATIVE GOT.
4759 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4760 plt_address_for_local.
4761 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4762 * testsuite/ifuncvar1.c: New test file.
4763 * testsuite/ifuncvar2.c: New test file.
4764 * testsuite/ifuncvar3.c: New test file.
4765 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4766 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4767 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4768 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4769 * testsuite/Makefile.in: Rebuild.
4770
33c15b45
CC
47712011-07-07 Cary Coutant <ccoutant@google.com>
4772
4773 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4774 (two_file_test_1_ndebug.o): Likewise.
4775 (two_file_test_1b_ndebug.o): Likewise.
4776 (two_file_test_2_ndebug.o): Likewise.
4777 (two_file_test_main_ndebug.o): Likewise.
4778 (incremental_test_2): Link with no-debug versions.
4779
f48b5fb7
CC
47802011-07-06 Cary Coutant <ccoutant@google.com>
4781
4782 * gold/incremental.cc
4783 (Output_section_incremental_inputs::write_info_blocks): Check for
4784 hidden and internal symbols.
4785
221597a5
CC
47862011-07-06 Cary Coutant <ccoutant@google.com>
4787
4788 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4789 Check disposition for startup file.
4790 (Incremental_inputs::report_command_line): Ignore
4791 --incremental-startup-unchanged option.
4792 * options.cc (General_options::parse_incremental_startup_unchanged):
4793 New function.
4794 (General_options::General_options): Initialize new data member.
4795 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4796 (General_options): Add --incremental-startup-unchanged option.
4797 (General_options::incremental_startup_disposition): New function.
4798 (General_options::incremental_startup_disposition_): New data member.
4799
e24719f6
CC
48002011-07-06 Cary Coutant <ccoutant@google.com>
4801
4802 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4803 input file index to Script_info ctor.
4804 (Sized_incremental_binary::do_file_has_changed): Find the
4805 command-line argument for files named in scripts.
4806 * incremental.h (Script_info::Script_info): New ctor
4807 with input file index.
4808 (Script_info::input_file_index): New function.
4809 (Script_info::input_file_index_): New data member.
4810 (Incremental_binary::get_library): Add const.
4811 (Incremental_binary::get_script_info): Add const.
4812 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4813 * testsuite/Makefile.am (incremental_test_5): New test case.
4814 (incremental_test_6): New test case.
4815 * testsuite/Makefile.in: Regenerate.
4816
8f7c81e8
CC
48172011-07-06 Cary Coutant <ccoutant@google.com>
4818
4819 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4820 debug output when command lines differ.
4821
9fbd3822
CC
48222011-07-06 Cary Coutant <ccoutant@google.com>
4823
4824 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4825 --incremental-patch option.
4826 * layout.cc (Free_list::allocate): Extend allocation beyond original
4827 end if enabled.
4828 (Layout::make_output_section): Mark sections that should get
4829 patch space.
4830 * options.cc (parse_percent): New function.
4831 * options.h (parse_percent): New function.
4832 (DEFINE_percent): New macro.
4833 (General_options): Add --incremental-patch option.
4834 * output.cc (Output_section::Output_section): Initialize new data
4835 members.
4836 (Output_section::add_input_section): Print section name when out
4837 of patch space.
4838 (Output_section::add_output_section_data): Likewise.
4839 (Output_section::set_final_data_size): Add patch space when
4840 doing --incremental-full.
4841 (Output_section::do_reset_address_and_file_offset): Remove patch
4842 space.
4843 (Output_segment::set_section_list_addresses): Print debug output
4844 only if --incremental-update.
4845 * output.h (Output_section::set_is_patch_space_allowed): New function.
4846 (Output_section::is_patch_space_allowed_): New data member.
4847 (Output_section::patch_space_): New data member.
4848 * parameters.cc (Parameters::incremental_full): New function.
4849 * parameters.h (Parameters::incremental_full): New function
4850 * testsuite/Makefile.am (incremental_test_2): Add test for
4851 --incremental-patch option.
4852 * testsuite/Makefile.in: Regenerate.
4853 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4854 (t18): Remove function body.
4855
f6cccc2c
DK
48562011-07-05 Doug Kwan <dougkwan@google.com>
4857
4858 PR gold/12771
4859 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4860 Arm_Address type for relocation result.
4861 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4862 overflow check.
4863 (Arm_relocate_functions::abs32): Use unaligned access.
4864 (Arm_relocate_functions::rel32): Ditto.
4865 (Arm_relocate_functions::prel31): Ditto.
4866 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4867 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4868 static data relocations.
4869 * testsuite/Makefile.in: Regnerate.
4870 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4871
28a13fec
ILT
48722011-07-05 Ian Lance Taylor <iant@google.com>
4873
4874 PR gold/12392
4875 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4876 symbols if necessary.
4877 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4878
24d47b34
ILT
48792011-07-05 Ian Lance Taylor <iant@google.com>
4880
4881 PR gold/12952
4882 * resolve.cc (Symbol::override_base_with_special): Simply override
4883 version with special symbol version, ignoring previous version.
4884
41f9cbbe
ILT
48852011-07-05 Ian Lance Taylor <iant@google.com>
4886
4887 * object.cc (Sized_relobj_file::include_section_group): Add
4888 information to comment about signature location.
4889
886288f1
ILT
48902011-07-02 Ian Lance Taylor <iant@google.com>
4891
4892 PR gold/12957
4893 * options.h (class General_options): Add -f and -F.
4894 * options.cc (General_options::finalize): Fatal error if -f/-F
4895 are used without -shared.
4896 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4897
ae3a6d4f
ILT
48982011-07-02 Ian Lance Taylor <iant@google.com>
4899
4900 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4901
21131061
ILT
49022011-07-01 Ian Lance Taylor <iant@google.com>
4903
4904 PR gold/12525
4905 PR gold/12952
4906 * resolve.cc (Symbol::override_base_with_special): Don't override
4907 the version if the overriding symbol has a different name.
4908 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4909 all callers. If we give an error about an undefined version,
4910 define the base version if necessary.
4911 * dynobj.h (class Versions): Update declaration.
4912 * testsuite/weak_alias_test_5.cc: New file.
4913 * testsuite/weak_alias_test.script: New file.
4914 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4915 and versioned_alias have the right value, and call t2.
4916 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4917 weak_alias_test_5.so.
4918 (weak_alias_test_LDADD): Likewise.
4919 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4920 * testsuite/Makefile.in: Rebuild.
4921
611062c0
ILT
49222011-07-01 Ian Lance Taylor <iant@google.com>
4923
4924 PR gold/12525
4925 * options.h (class General_options): Support -z notext.
4926 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4927 -Wl,-z,notext.
4928 (two_file_shared_nonpic.so): Likewise.
4929 (two_file_shared_mixed.so): Likewise.
4930 (two_file_shared_mixed_1.so): Likewise.
4931 (weak_undef_lib_nonpic.so): Likewise.
4932 (alt/weak_undef_lib_nonpic.so): Likewise.
4933 (tls_test_shared_nonpic.so): Likewise.
4934 * testsuite/Makefile.in: Rebuild.
4935
328c7c2f
ILT
49362011-07-01 Ian Lance Taylor <iant@google.com>
4937
4938 PR gold/12525
4939 * configure.ac: Test whether static linking works, setting
4940 the automake conditional HAVE_STATIC.
4941 * testsuite/Makefile.am: Disable tests using -static if
4942 HAVE_STATIC is not true.
4943 * configure, testsuite/Makefile.in: Rebuild.
4944
02d7cd44
ILT
49452011-07-01 Ian Lance Taylor <iant@google.com>
4946
4947 PR gold/12525
4948 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4949 Assert if we see DW_EH_PE_indirect.
4950 * target.h (Target::ehframe_datarel_base): New function.
4951 (Target::do_ehframe_datarel_base): New target function.
4952 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4953 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4954 function.
4955
07a60597
ILT
49562011-07-01 Ian Lance Taylor <iant@google.com>
4957
4958 PR gold/12571
4959 * options.h (class General_options): Add
4960 --ld-generated-unwind-info.
4961 * ehframe.cc (Fde::write): Add address parameter. Change all
4962 callers. If associated with PLT, fill in address and size.
4963 (Cie::set_output_offset): Only add merge mapping if there is an
4964 object.
4965 (Cie::write): Add address parameter. Change all callers.
4966 (Eh_frame::add_ehframe_for_plt): New function.
4967 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4968 input_offset_ fields into union u_, with new plt field.
4969 (Fde::Fde): Adjust for new union field.
4970 (Fde::Fde) [Output_data version]: New constructor.
4971 (Fde::add_mapping): Only add merge mapping if there is an object.
4972 (class Cie): Update declarations.
4973 (class Eh_frame): Declare add_ehframe_for_plt.
4974 * layout.cc (Layout::layout_eh_frame): Break out code into
4975 make_eh_frame_section, and call it.
4976 (Layout::make_eh_frame_section): New function.
4977 (Layout::add_eh_frame_for_plt): New function.
4978 * layout.h (class Layout): Update declarations.
4979 * merge.cc (Merge_map::add_mapping): Add assertion.
4980 * i386.cc: Include "dwarf.h".
4981 (class Output_data_plt_i386): Make first_plt_entry,
4982 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4983 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4984 and plt_eh_frame_fde.
4985 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4986 boundary. Call add_eh_frame_for_plt if appropriate.
4987 * x86_64.cc: Include "dwarf.h".
4988 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4989 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4990 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4991 and plt_eh_frame_fde.
4992 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4993 appropriate.
4994
14788a3f
ILT
49952011-06-29 Ian Lance Taylor <iant@google.com>
4996
4997 PR gold/12629
4998 * object.cc (Sized_relobj_file::layout_section): Change shdr
4999 parameter to be const.
5000 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5001 out of do_layout.
5002 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5003 appropriate. Call layout_eh_frame_section.
5004 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5005 sections.
5006 * object.h (class Sized_relobj_file): Update declarations.
5007
6c21fce1
ILT
50082011-06-29 Ian Lance Taylor <iant@google.com>
5009
37e41b03 5010 PR gold/12652
6c21fce1
ILT
5011 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5012 modifier.
5013 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5014
4d5e4e62
ILT
50152011-06-29 Ian Lance Taylor <iant@google.com>
5016
5017 PR gold/12675
5018 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5019 SHT_X86_64_UNWIND.
5020 * layout.cc (Layout::layout_eh_frame): Likewise.
5021
886f533a
ILT
50222011-06-29 Ian Lance Taylor <iant@google.com>
5023
5024 PR gold/12695
5025 * layout.cc (Layout::symtab_section_shndx): New function.
5026 * layout.h (class Layout): Declare symtab_section_shndx.
5027 * output.cc (Output_section::write_header): Call it.
5028
f3ae1b28
ILT
50292011-06-29 Ian Lance Taylor <iant@google.com>
5030
5031 PR gold/12818
5032 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5033 symbols which are not used in a relocation.
5034
aecf301f
ILT
50352011-06-28 Ian Lance Taylor <iant@google.com>
5036
5037 PR gold/12898
5038 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5039 script create indistinguishable segments.
5040 (Layout::set_segment_offsets): Use stable_sort when sorting
5041 segments. Pass this to Compare_segments constructor.
5042 * layout.h (class Layout): Make segment_precedes non-static.
5043 (class Compare_segments): Change from struct to class. Add
5044 layout_ field. Add constructor.
5045 * script-sections.cc
5046 (Script_sections::attach_sections_using_phdrs_clause): Rename
5047 local orphan to is_orphan. Don't report failure to put empty
5048 section in segment. On attachment failure, report name of
5049 section, and attach to first PT_LOAD segment.
5050
03ef7571
ILT
50512011-06-28 Ian Lance Taylor <iant@google.com>
5052
5053 PR gold/12934
5054 * target-select.cc (Target_selector::Target_selector): Add
5055 emulation parameter. Change all callers.
5056 (select_target_by_bfd_name): Rename from select_target_by_name.
5057 Change all callers.
5058 (select_target_by_emulation): New function.
5059 (supported_emulation_names): New function.
5060 * target-select.h (class Target_selector): Add emulation_ field.
5061 Update declarations.
5062 (Target_selector::recognize_by_bfd_name): Rename from
5063 recognize_by_name. Change all callers.
5064 (Target_selector::supported_bfd_names): Rename from
5065 supported_names. Change all callers.
5066 (Target_selector::recognize_by_emulation): New function.
5067 (Target_selector::supported_emulations): New function.
5068 (Target_selector::emulation): New function.
5069 (Target_selector::do_recognize_by_bfd_name): Rename from
5070 do_recognize_by_name. Change all callers.
5071 (Target_selector::do_supported_bfd_names): Rename from
5072 do_supported_names. Change all callers.
5073 (Target_selector::do_recognize_by_emulation): New function.
5074 (Target_selector::do_supported_emulations): New function.
5075 (select_target_by_bfd_name): Change name in declaration.
5076 (select_target_by_emulation): Declare.
5077 (supported_emulation_names): Declare.
5078 * parameters.cc (parameters_force_valid_target): Try to find
5079 target based on emulation from -m option.
5080 * options.h (class General_options): Change doc string for -m.
5081 * options.cc (help): Print emulations.
5082 (General_options::parse_V): Likewise.
5083 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5084 Add emulation parameter. Change all callers.
5085
200b2bb9
ILT
50862011-06-28 Ian Lance Taylor <iant@google.com>
5087
5088 * target.h (class Target): Add osabi_ field.
5089 (Target::osabi): New function.
5090 (Target::set_osabi): New function.
5091 (Target::Target): Initialize osabi_.
5092 (Target::do_adjust_elf_header): Make pure virtual.
5093 (Sized_target::do_adjust_elf_header): Declare.
5094 * target.cc (Sized_target::do_adjust_elf_header): New function.
5095 (class Sized_target): Instantiate all versions.
5096 * freebsd.h (class Target_freebsd): Remove.
5097 (Target_selector_freebsd::do_recognize): Call set_osabi on
5098 Target.
5099 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5100 (Target_selector_freebsd::set_osabi): Remove.
5101 * i386.cc (class Target_i386): Inherit from Sized_target rather
5102 than Target_freebsd.
5103 * x86_64.cc (class Target_x86_64): Likewise.
5104
b3ce541e
ILT
51052011-06-28 Ian Lance Taylor <iant@google.com>
5106
5107 * target.h (Target::can_check_for_function_pointers): Rewrite.
5108 Make non-virtual.
5109 (Target::can_icf_inline_merge_sections): Likewise.
5110 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5111 (Target::Target_info): Add can_icf_inline_merge_sections field.
5112 (Target::do_can_check_for_function_pointers): New virtual
5113 function.
5114 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5115 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5116 from can_check_for_function_pointers, move in file.
5117 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5118 section_may_have_icf_unsafe_poineters, move in file.
5119 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5120 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5121 Rename from can_check_for_function_pointers, move in file.
5122 (Target_i386::can_icf_inline_merge_sections): Remove.
5123 (Target_i386::i386_info): Initialize
5124 can_icf_inline_merge_sections.
5125 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5126 Initialize can_icf_inline_merge_sections.
5127 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5128 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5129 Rename from can_check_for_function_pointers, move in file.
5130 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5131 (Target_x86_64::x86_64_info): Initialize
5132 can_icf_inline_merge_sections.
5133 * testsuite/testfile.cc (Target_test::test_target_info):
5134 Likewise.
5135 * icf.cc (get_section_contents): Correct formatting.
5136
6d1c4efb
ILT
51372011-06-27 Ian Lance Taylor <iant@google.com>
5138
5139 * symtab.cc (Symbol::versioned_name): New function.
5140 (Symbol_table::add_to_final_symtab): Use versioned_name when
5141 appropriate.
5142 (Symbol_table::sized_write_symbol): Likewise.
5143 * symtab.h (class Symbol): Declare versioned_name.
5144 * stringpool.h (class Stringpool_template): Add variant of add
5145 which takes a std::basic_string.
5146 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5147 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5148 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5149 (ver_test_12.o): New target.
5150 * testsuite/Makefile.in: Rebuild.
5151
57eb9b50
DK
51522011-06-27 Doug Kwan <dougkwan@google.com>
5153
5154 * arm.cc (Arm_relocate_functions::thm_jump8,
5155 Arm_relocate_functions::thm_jump11): Use a wider signed
5156 type to compute offset.
5157 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5158 arm_thm_jump8.
5159 * testsuite/Makefile.in: Regenerate.
5160 * testsuite/arm_branch_in_range.sh: Check test results of
5161 arm_thm_jump11 and arm_thm_jump8.
5162 * testsuite/arm_thm_jump11.s: New test source file.
5163 * testsuite/arm_thm_jump11.t: New linker script.
5164 * testsuite/arm_thm_jump8.s: New test source file.
5165 * testsuite/arm_thm_jump8.t: New linker script.
5166
487b39df
ILT
51672011-06-24 Ian Lance Taylor <iant@google.com>
5168
5169 * layout.cc: Include "object.h".
5170 (ctors_sections_in_init_array): New static variable.
5171 (Layout::is_ctors_in_init_array): New function.
5172 (Layout::layout): Add entry to ctors_sections_in_init_array if
5173 appropriate.
5174 * layout.h (class Layout): Declare is_ctors_in_init_array.
5175 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5176 is_ctors_reverse_view is set.
5177 (Sized_relobj_file::write_sections): Add layout parameter. Change
5178 all callers. Set is_ctors_reverse_view field of View_size.
5179 (Sized_relobj_file::reverse_words): New function.
5180 * object.h (Sized_relobj_file::View_size): Add
5181 is_ctors_reverse_view field.
5182 (class Sized_relobj_file): Update declarations.
5183 * testsuite/initpri3.c: New test.
5184 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5185 initpri3b.
5186 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5187 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5188 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5189 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5190 * testsuite/Makefile.in: Rebuild.
5191
472076e4
CC
51922011-06-24 Cary Coutant <ccoutant@google.com>
5193
5194 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5195 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5196 (debug_msg_cdebug.err): New targets.
5197 * testsuite/Makefile.in: Regenerate.
5198 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5199 Fix checks for link with shared library.
5200
a60af0db
DK
52012011-06-24 Doug Kwan <dougkwan@google.com>
5202
5203 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5204 skip empty text sections.
5205 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5206
5393d741
ILT
52072011-06-22 Ian Lance Taylor <iant@google.com>
5208
5209 PR gold/12910
5210 * options.h (class General_options): Add --ctors-in-init-array.
5211 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5212 friends as SHT_PROGBITS for merging sections.
5213 (Layout::layout): Remove special handling of .init_array and
5214 friends. Don't sort if doing relocatable link. Sort for .ctors
5215 and .dtors if ctors_in_init_array.
5216 (Layout::make_output_section): Force correct section types for
5217 .init_array and friends. Don't sort if doing relocatable link,
5218 Don't sort .ctors and .dtors if ctors_in_init_array.
5219 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5220 (Layout::output_section_name): Add relobj parameter. Change all
5221 callers. Handle .ctors. and .dtors. in code rather than table.
5222 Handle .ctors and .dtors if ctors_in_init_array.
5223 (Layout::match_file_name): New function, moved from output.cc.
5224 * layout.h (class Layout): Update declarations.
5225 * output.cc: Include "layout.h".
5226 (Input_section_sort_entry::get_priority): New function.
5227 (Input_section_sort_entry::match_file_name): Just call
5228 Layout::match_file_name.
5229 (Output_section::Input_section_sort_init_fini_compare::operator()):
5230 Handle .ctors and .dtors. Sort by explicit priority rather than
5231 by name.
5232 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5233 * testsuite/initpri2.c: New test.
5234 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5235 (check_PROGRAMS): Add initpri2.
5236 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5237 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5238 * configure, testsuite/Makefile.in: Rebuild.
5239
e1f74f98
ILT
52402011-06-19 Ian Lance Taylor <iant@google.com>
5241
5242 PR gold/12880
5243 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5244 .interp section to a PT_INTERP segment even if we have seen a
5245 --dynamic-linker option. Don't do it if we have seen a PHDRS
5246 clause in a linker script.
5247 (Layout::finalize): Don't create a .interp section if we've
5248 already create a PT_INTERP segment.
5249 (Layout::create_interp): Always call choose_output_section (revert
5250 patch of 2011-06-17). Don't create PT_INTERP segment.
5251 * script-sections.cc
5252 (Script_sections::create_note_and_tls_segments): Add a .interp
5253 section to a PT_INTERP segment even if we have seen a
5254 --dynamic-linker option.
5255
766f91bb
ILT
52562011-06-18 Ian Lance Taylor <iant@google.com>
5257
5258 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5259 merely because a non-PT_LOAD segment has a dynamic reloc.
5260
0d212c3a
ILT
52612011-06-18 Ian Lance Taylor <iant@google.com>
5262
5263 * layout.cc (Layout::finish_dynamic_section): Don't create
5264 DT_FLAGS entry if not needed.
5265
911a5072
ILT
52662011-06-18 Ian Lance Taylor <iant@google.com>
5267
5268 PR gold/12745
5269 * layout.cc (Layout::layout_eh_frame): Correct handling of
5270 writable .eh_frame section.
5271
534b4e5f
ILT
52722011-06-17 Ian Lance Taylor <iant@google.com>
5273
5274 PR gold/12893
5275 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5276 symbol is redefined with the exact same object and value.
5277
10b4f102
ILT
52782011-06-17 Ian Lance Taylor <iant@google.com>
5279
5280 PR gold/12880
5281 * layout.h (class Layout): Add interp_segment_ field.
5282 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5283 (Layout::attach_allocated_section_to_segment): If making shared
5284 library, put .interp section in PT_INTERP segment.
5285 (Layout::finalize): Also call create_interp if -dynamic-linker
5286 option was used.
5287 (Layout::create_interp): Assert that there is no PT_INTERP
5288 segment. If not using a SECTIONS clause, use make_output_section.
5289 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5290 * script-sections.cc
5291 (Script_sections::create_note_and_tls_segments): If making shared
5292 library, put .interp section in PT_INTERP segment.
5293
a29b0dad
ILT
52942011-06-17 Ian Lance Taylor <iant@google.com>
5295
e588ea8d
ILT
5296 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5297 when making a shared library.
5298
52992011-06-17 Ian Lance Taylor <iant@google.com>
5300
5301 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5302 parameter. Change all callers. Don't issue warning about PC32
5303 against locally defined symbol.
a29b0dad 5304
9d3b0698
ILT
53052011-06-16 Ian Lance Taylor <iant@google.com>
5306
5307 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5308 occurs in same object.
5309
85b0f90c
AM
53102011-06-14 Alan Modra <amodra@gmail.com>
5311
5312 * po/POTFILES.in: Regenerate.
5313
a94907d9
ILT
53142011-06-09 Ian Lance Taylor <iant@google.com>
5315
5316 * script-sections.cc
5317 (Orphan_output_section::set_section_addresses): For a relocatable
5318 link set address to 0.
5319
4fb3a1c3
CC
53202011-06-09 Cary Coutant <ccoutant@google.com>
5321
5322 PR gold/12804
5323 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5324 used with --compress-debug-sections.
5325 * gold/object.cc (Sized_relobj_file::do_layout): Report
5326 uncompressed size of compressed input sections.
5327
61220854
CC
53282011-06-08 Cary Coutant <ccoutant@google.com>
5329
5330 PR gold/12804
5331 * testsuite/two_file_test_2_v1.cc: Change initialization of
5332 v2 to keep it in .data.
5333
e6455dfb
CC
53342011-06-07 Cary Coutant <ccoutant@google.com>
5335
5336 * common.cc (Symbol_table::do_allocate_commons_list): Call
5337 gold_fallback.
5338 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5339 (Errors::fallback): New function.
5340 (gold_fallback): New function.
5341 * errors.h (Errors::fallback): New function.
5342 * gold.cc (gold_exit): Change status parameter to enum; adjust
5343 all callers.
5344 (queue_initial_tasks): Call gold_fallback.
5345 * gold.h: Include cstdlib.
5346 (Exit_status): New enum type.
5347 (gold_exit): Change status parameter to enum.
5348 (gold_fallback): New function.
5349 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5350 (Layout::create_symtab_sections): Likewise.
5351 (Layout::create_shdrs): Likewise.
5352 * main.cc (main): Adjust call to gold_exit.
5353 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5354 (Output_data_got::add_got_entry_pair): Likewise.
5355 (Output_section::add_input_section): Likewise.
5356 (Output_section::add_output_section_data): Likewise.
5357 (Output_segment::set_section_list_addresses): Likewise.
5358 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5359
fb0e076f
CC
53602011-06-07 Cary Coutant <ccoutant@google.com>
5361
5362 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5363 for incremental links.
5364 * output.cc (Output_segment::set_section_list_addresses): Remove
5365 FIXME and test for TLS or BSS.
5366
a5ee4d5d
CC
53672011-06-07 Cary Coutant <ccoutant@google.com>
5368
5369 * testsuite/Makefile.am: Add incremental_copy_test,
5370 incremental_common_test_1.
5371 * testsuite/Makefile.in: Regenerate.
5372 * testsuite/common_test_1_v1.c: New source file.
5373 * testsuite/common_test_1_v2.c: New source file.
5374 * testsuite/copy_test_v1.cc: New source file.
5375
5146f448
CC
53762011-06-07 Cary Coutant <ccoutant@google.com>
5377
5378 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5379 update, allocate common from bss section's free list.
5380 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5381 linker-defined symbols.
5382 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5383 Skip GOT and PLT entries that are no longer referenced.
5384 (Output_section_incremental_inputs::write_info_blocks): Mark
5385 linker-defined symbols.
5386 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5387 * output.cc (Output_section::allocate): New function.
5388 * output.h (Output_section::allocate): New function.
5389 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5390 linker-defined symbols.
5391 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5392 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5393 (Symbol::init_base_output_data): Likewise.
5394 (Symbol::init_base_output_segment): Likewise.
5395 (Symbol::init_base_constant): Likewise.
5396 (Sized_symbol::init_output_data): Likewise.
5397 (Sized_symbol::init_output_segment): Likewise.
5398 (Sized_symbol::init_constant): Likewise.
5399 (Symbol_table::do_define_in_output_data): Likewise.
5400 (Symbol_table::do_define_in_output_segment): Likewise.
5401 (Symbol_table::do_define_as_constant): Likewise.
5402 * symtab.h (Symbol::is_predefined): New function.
5403 (Symbol::init_base_output_data): Add is_predefined parameter.
5404 (Symbol::init_base_output_segment): Likewise.
5405 (Symbol::init_base_constant): Likewise.
5406 (Symbol::is_predefined_): New data member.
5407 (Sized_symbol::init_output_data): Add is_predefined parameter.
5408 (Sized_symbol::init_output_segment): Likewise.
5409 (Sized_symbol::init_constant): Likewise.
5410 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5411
26d3c67d
CC
54122011-06-07 Cary Coutant <ccoutant@google.com>
5413
5414 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5415 instead of emit_copy_reloc.
5416 (Copy_relocs::emit_copy_reloc): Refactor.
5417 (Copy_relocs::make_copy_reloc): New function.
5418 (Copy_relocs::add_copy_reloc): Remove.
5419 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5420 section.
5421 (Copy_relocs::make_copy_reloc): New function.
5422 (Copy_relocs::add_copy_reloc): Remove.
5423 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5424 unchanged input files.
5425 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5426 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5427 Reserve BSS space for COPY relocations.
5428 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5429 (Output_section_incremental_inputs::write_info_blocks): Record
5430 whether a symbol is copied from a shared object.
5431 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5432 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5433 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5434 (Incremental_input_entry_reader::get_output_symbol_index): Add
5435 is_copy parameter.
5436 (Incremental_binary::emit_copy_relocs): New function.
5437 (Incremental_binary::do_emit_copy_relocs): New function.
5438 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5439 new data member.
5440 (Sized_incremental_binary::add_copy_reloc): New function.
5441 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5442 (Sized_incremental_binary::Copy_reloc): New struct.
5443 (Sized_incremental_binary::Copy_relocs): New typedef.
5444 (Sized_incremental_binary::copy_relocs_): New data member.
5445 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5446 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5447 * target.h (Sized_target::emit_copy_reloc): New function.
5448 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5449
7cdb37d9
CC
54502011-06-02 Cary Coutant <ccoutant@google.com>
5451
5452 PR gold/12163
5453 * gold/archive.cc (Archive::Archive): Initialize new data member.
5454 (Archive::include_all_members): Return if archive has already been
5455 included.
5456 * gold/archive.h (Archive::include_all_members_): New data member.
5457
cc643b88
NC
54582011-06-02 Nick Clifton <nickc@redhat.com>
5459
5460 * dynobj.h: Fix spelling mistake in comment.
5461 * output.cc: Likewise.
5462
f62a3ca7 54632011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5464 Asier Llano
f62a3ca7
DK
5465
5466 PR gold/12826
cc643b88 5467 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5468 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5469 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5470 redundant arm_exidx_test.so.
5471 * testsuite/Makefile.in: Regenerate.
5472 (check_SCRIPTS): Add pr12826.sh
5473 (check_DATA): Add pr12826.stdout
5474 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5475 * testsuite/pr12826.sh: New file.
5476 * testsuite/pr12826_1.s: Ditto.
5477 * testsuite/pr12826_1.s: Ditto.
5478
8dbe1edc
ILT
54792011-05-30 Ian Lance Taylor <iant@google.com>
5480
5481 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5482 sections.
5483
c49875be
ILT
54842011-05-29 Ian Lance Taylor <iant@google.com>
5485
5486 PR gold/12804
5487 * testsuite/Makefile.am: Use different file name for two_file_test
5488 temporary file for each incremental test.
5489 * testsuite/Makefile.in: Rebuild.
5490
69d53f7a
ILT
54912011-05-29 Ian Lance Taylor <iant@google.com>
5492
5493 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5494 binary input file is empty.
5495
41d0ab5f
ILT
54962011-05-27 Ian Lance Taylor <iant@google.com>
5497
5498 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5499 (ver_test_9.so): Likewise.
5500 * testsuite/Makefile.in: Rebuild.
5501
89d8a36b
CC
55022011-05-26 Cary Coutant <ccoutant@google.com>
5503
5504 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5505 * incremental.cc (Incremental_inputs::report_input_section): Fix
5506 comment, indentation.
5507 (Incremental_inputs::report_comdat_group): New function.
5508 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5509 of data for incremental input file entry.
5510 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5511 group count, COMDAT group signatures.
5512 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5513 an unchanged input file.
5514 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5515 Initialize new data member.
5516 (Incremental_object_entry::add_comdat_group): New function.
5517 (Incremental_object_entry::get_comdat_group_count): New function.
5518 (Incremental_object_entry::get_comdat_signature_key): New function.
5519 (Incremental_object_entry::groups_): New data member.
5520 (Incremental_inputs::report_comdat_group): New function.
5521 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5522 data for incremental input file entry.
5523 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5524 (Incremental_input_entry_reader::get_input_section): Adjust size of
5525 data for incremental input file entry.
5526 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5527 (Incremental_input_entry_reader::get_comdat_group_signature): New
5528 function.
5529 * object.cc (Sized_relobj::include_section_group): Report kept
5530 COMDAT groups for incremental links.
5531
1706a06f
ILT
55322011-05-24 David Meyer <pdox@google.com>
5533
5534 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5535 with name parameter. Add found_name parameter.
5536 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5537 * dirsearch.h (class Dirsearch): Update declaration.
5538
a10ae760
ILT
55392011-05-24 Ian Lance Taylor <iant@google.com>
5540
5541 * archive.cc (Library_base::should_include_member): Pull in object
5542 from archive if it defines the entry symbol.
5543 * parameters.cc (Parameters::entry): New function.
5544 * parameters.h (class Parameters): Declare entry.
5545 * output.h (class Output_file_header): Remove entry_ field.
5546 * output.cc (Output_file_header::Output_file_header): Remove entry
5547 parameter. Change all callers.
5548 (Output_file_header::entry): Use parameters->entry.
5549 * gold.cc (queue_middle_tasks): Likewise.
5550 * plugin.cc (Plugin_hook::run): Likewise.
5551
aa92d6ed
CC
55522011-05-24 Cary Coutant <ccoutant@google.com>
5553
5554 * gold.cc (queue_initial_tasks): Pass incremental base filename
5555 to Output_file::open_base_file; don't print error message.
5556 * incremental-dump.cc (main): Adjust call to
5557 Output_file::open_for_modification.
5558 * incremental-dump.cc (main): Likewise.
5559 * incremental.cc (Incremental_inputs::report_command_line):
5560 Ignore --incremental-base option when comparing command lines.
5561 Ignore parameter when given as separate argument.
5562 * options.h (class General_options): Add --incremental-base.
5563 * output.cc (Output_file::Output_file):
5564 (Output_file::open_base_file): Add base_name and writable parameters;
5565 read base file into new file; print error message here.
5566 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5567 callers.
5568 * output.h (Output_file::open_for_modification): Rename to...
5569 (Output_file::open_base_file): ...this; add base_name and
5570 writable parameters; adjust all callers.
5571 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5572 callers.
5573 * testsuite/Makefile.am (incremental_test_4): Test
5574 --incremental-base.
5575 * testsuite/Makefile.in: Regenerate.
5576
2eedd706
CC
55772011-05-24 Cary Coutant <ccoutant@google.com>
5578
5579 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5580 incremental_test_4.
5581 * testsuite/Makefile.in: Regenerate.
5582 * testsuite/two_file_test_1_v1.cc: New test source file.
5583 * testsuite/two_file_test_1b_v1.cc: New test source file.
5584 * testsuite/two_file_test_2_v1.cc: New test source file.
5585
0f1c85a6
CC
55862011-05-24 Cary Coutant <ccoutant@google.com>
5587
5588 * dynobj.h (Dynobj::do_dynobj): New function.
5589 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5590 flag and soname for shared objects.
5591 * incremental.cc (Incremental_inputs::report_object): Make
5592 either Incremental_object_entry or Incremental_dynobj_entry; add
5593 soname to string table.
5594 (Incremental_inputs::report_input_section): Add assertion.
5595 (Output_section_incremental_inputs::set_final_data_size): Adjust
5596 type of input file entry for shared libraries; adjust size of
5597 shared library info entry.
5598 (Output_section_incremental_inputs::write_input_files): Write
5599 as_needed flag for shared libraries.
5600 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5601 of input file entry for shared libraries; write soname.
5602 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5603 soname from incremental info.
5604 * incremental.h (enum Incremental_input_flags): Add
5605 INCREMENTAL_INPUT_AS_NEEDED.
5606 (Incremental_input_entry::Incremental_input_entry): Initialize new
5607 data member.
5608 (Incremental_input_entry::set_as_needed): New function.
5609 (Incremental_input_entry::as_needed): New function.
5610 (Incremental_input_entry::do_dynobj_entry): New function.
5611 (Incremental_input_entry::as_needed_): New data member.
5612 (Incremental_object_entry::Incremental_object_entry): Don't check
5613 for shared library.
5614 (Incremental_object_entry::do_type): Likewise.
5615 (class Incremental_dynobj_entry): New class.
5616 (Incremental_input_entry_reader::as_needed): New function.
5617 (Incremental_input_entry_reader::get_soname): New function.
5618 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5619 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5620 size of shared library info entry.
58797674 5621 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5622 incremental link when adding DT_NEEDED entries.
5623 * object.h (Object::Object): Initialize new data member.
5624 (Object::dynobj): New function.
5625 (Object::set_as_needed): New function.
5626 (Object::as_needed): New function.
5627 (Object::do_dynobj): New function.
5628 (Object::as_needed_): New data member.
5629
6fa2a40b
CC
56302011-05-24 Cary Coutant <ccoutant@google.com>
5631
5632 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5633 info; adjust display of GOT entries.
5634 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5635 vector of input objects; remove file_status_.
5636 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5637 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5638 got_plt reader; call target hooks to reserve GOT entries.
5639 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5640 of input file info header and GOT info entry.
5641 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5642 relocation info.
5643 (Got_plt_view_info::got_descriptor): Remove.
5644 (Got_plt_view_info::sym_index): New data member.
5645 (Got_plt_view_info::input_index): New data member.
5646 (Local_got_offset_visitor::visit): Write input file index.
5647 (Global_got_offset_visitor::visit): Write 0 for input file index.
5648 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5649 with sym_index and input_index.
5650 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5651 incremental info GOT entry; replace got_descriptor with input_index.
5652 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5653 map from input file index to object.
5654 (Sized_relobj_incr::do_layout): Replace direct data member reference
5655 with accessor function.
5656 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5657 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5658 Adjust size of input file info header.
5659 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5660 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5661 (Incremental_input_entry_reader::get_input_section): Adjust size of
5662 input file info header.
5663 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5664 of incremental info GOT entry.
5665 (Incremental_got_plt_reader::get_got_desc): Remove.
5666 (Incremental_got_plt_reader::get_got_symndx): New function.
5667 (Incremental_got_plt_reader::get_got_input_index): New function.
5668 (Sized_incremental_binary::Sized_incremental_binary): Remove
5669 file_status_; add input_objects_.
5670 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5671 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5672 (Sized_incremental_binary::file_is_unchanged): Remove.
5673 (Sized_incremental_binary::set_input_object): New function.
5674 (Sized_incremental_binary::input_object): New function.
5675 (Sized_incremental_binary::file_status_): Remove.
5676 (Sized_incremental_binary::input_objects_): New data member.
5677 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5678 references.
5679 (Sized_relobj_incr::invalid_address): Move to base class.
5680 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5681 class.
5682 (Sized_relobj_incr::do_output_section_offset): Likewise.
5683 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5684 (Sized_relobj_incr::section_offsets_): Likewise.
5685 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5686 function.
5687 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5688 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5689 with accessor function.
5690 (Sized_relobj_file::do_layout): Likewise.
5691 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5692 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5693 (Sized_relobj_file::compute_final_local_value): Replace refs to
5694 section_offsets_ with accessor function.
5695 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5696 * object.h (Relobj::Relobj): Initialize new data members.
5697 (Relobj::add_dyn_reloc): New function.
5698 (Relobj::first_dyn_reloc): New function.
5699 (Relobj::dyn_reloc_count): New function.
5700 (Relobj::first_dyn_reloc_): New data member.
5701 (Relobj::dyn_reloc_count_): New data member.
5702 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5703 references.
5704 (Sized_relobj::Address): New typedef.
5705 (Sized_relobj::invalid_address): Move here from child class.
5706 (Sized_relobj::Sized_relobj): Initialize new data members.
5707 (Sized_relobj::sized_relobj): New function.
5708 (Sized_relobj::is_output_section_offset_invalid): Move here from
5709 child class.
5710 (Sized_relobj::get_output_section_offset): Likewise.
5711 (Sized_relobj::local_has_got_offset): Likewise.
5712 (Sized_relobj::local_got_offset): Likewise.
5713 (Sized_relobj::set_local_got_offset): Likewise.
5714 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5715 (Sized_relobj::clear_got_offsets): New function.
5716 (Sized_relobj::section_offsets): Move here from child class.
5717 (Sized_relobj::do_output_section_offset): Likewise.
5718 (Sized_relobj::do_set_section_offset): Likewise.
5719 (Sized_relobj::Local_got_offsets): Likewise.
5720 (Sized_relobj::local_got_offsets_): Likewise.
5721 (Sized_relobj::section_offsets_): Likewise.
5722 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5723 references.
5724 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5725 class.
5726 (Sized_relobj_file::sized_relobj): New function
5727 (Sized_relobj_file::local_has_got_offset): Move to base class.
5728 (Sized_relobj_file::local_got_offset): Likewise.
5729 (Sized_relobj_file::set_local_got_offset): Likewise.
5730 (Sized_relobj_file::get_output_section_offset): Likewise.
5731 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5732 (Sized_relobj_file::do_output_section_offset): Likewise.
5733 (Sized_relobj_file::do_set_section_offset): Likewise.
5734 (Sized_relobj_file::Local_got_offsets): Likewise.
5735 (Sized_relobj_file::local_got_offsets_): Likewise.
5736 (Sized_relobj_file::section_offsets_): Likewise.
5737 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5738 (all constructors).
5739 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5740 (Output_reloc::get_symbol_index): Likewise.
5741 (Output_reloc::local_section_offset): Likewise.
5742 (Output_reloc::get_address): Likewise.
5743 (Output_reloc::symbol_value): Likewise.
5744 (Output_data_got::reserve_slot): Move to class definition.
5745 (Output_data_got::reserve_local): New function.
5746 (Output_data_got::reserve_slot_for_global): Remove.
5747 (Output_data_got::reserve_global): New function.
5748 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5749 (all constructors, two instantiations).
5750 (Output_reloc::get_relobj): New function (two instantiations).
5751 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5752 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5753 (Output_data_reloc::add_global): Adjust type of relobj.
5754 (Output_data_reloc::add_global_relative): Likewise.
5755 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5756 (Output_data_reloc::add_local): Likewise.
5757 (Output_data_reloc::add_local_relative): Likewise.
5758 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5759 (Output_data_reloc::add_local_section): Likewise.
5760 (Output_data_reloc::add_output_section): Likewise.
5761 (Output_data_reloc::add_absolute): Likewise.
5762 (Output_data_reloc::add_target_specific): Likewise.
5763 (Output_data_got::reserve_slot): Move definition here.
5764 (Output_data_got::reserve_local): New function.
5765 (Output_data_got::reserve_global): New function.
5766 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5767 section_offsets_ with accessor function.
5768 (Sized_relobj_file::write_sections): Likewise.
5769 (Sized_relobj_file::do_relocate_sections): Likewise.
5770 * target.h (Sized_target::reserve_local_got_entry): New function.
5771 (Sized_target::reserve_global_got_entry): New function.
5772 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5773 (Target_x86_64::reserve_global_got_entry): New function.
5774 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5775
4829d394
CC
57762011-05-23 Cary Coutant <ccoutant@google.com>
5777
5778 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5779 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5780 bit when checking got_type.
5781 * incremental.cc (Sized_incremental_binary::setup_readers):
5782 Store symbol table and string table locations; initialize bit vector
5783 of file status flags.
5784 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5785 unchanged files.
5786 (Sized_incremental_binary::do_process_got_plt): New function.
5787 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5788 (Output_section_incremental_inputs::set_final_data_size): Record
5789 file index for each input file.
5790 (Output_section_incremental_inputs::write_got_plt): Store file index
5791 instead of input entry offset for each GOT entry.
5792 * incremental.h
5793 (Incremental_input_entry::Incremental_input_entry): Initialize new
5794 data member.
5795 (Incremental_input_entry::set_offset): Store file index.
5796 (Incremental_input_entry::get_file_index): New function.
5797 (Incremental_input_entry::file_index_): New data member.
5798 (Incremental_binary::process_got_plt): New function.
5799 (Incremental_binary::do_process_got_plt): New function.
5800 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5801 data members.
5802 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5803 (Sized_incremental_binary::set_file_is_unchanged): New function.
5804 (Sized_incremental_binary::file_is_unchanged): New function.
5805 (Sized_incremental_binary::do_process_got_plt): New function.
5806 (Sized_incremental_binary::file_status_): New data member.
5807 (Sized_incremental_binary::main_symtab_loc_): New data member.
5808 (Sized_incremental_binary::main_strtab_loc_): New data member.
5809 * output.cc (Output_data_got::Got_entry::write): Add case
5810 RESERVED_CODE.
5811 (Output_data_got::add_global): Call add_got_entry.
5812 (Output_data_got::add_global_plt): Likewise.
5813 (Output_data_got::add_global_with_rel): Likewise.
5814 (Output_data_got::add_global_with_rela): Likewise.
5815 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5816 (Output_data_got::add_global_pair_with_rela): Likewise.
5817 (Output_data_got::add_local): Call add_got_entry.
5818 (Output_data_got::add_local_plt): Likewise.
5819 (Output_data_got::add_local_with_rel): Likewise.
5820 (Output_data_got::add_local_with_rela): Likewise.
5821 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5822 (Output_data_got::add_local_pair_with_rela): Likewise.
5823 (Output_data_got::reserve_slot): New function.
5824 (Output_data_got::reserve_slot_for_global): New function.
5825 (Output_data_got::add_got_entry): New function.
5826 (Output_data_got::add_got_entry_pair): New function.
5827 (Output_section::add_output_section_data): Edit FIXME.
5828 * output.h
5829 (Output_section_data_build::Output_section_data_build): New
5830 constructor with size parameter.
5831 (Output_data_space::Output_data_space): Likewise.
5832 (Output_data_got::Output_data_got): Initialize new data member; new
5833 constructor with size parameter.
5834 (Output_data_got::add_constant): Call add_got_entry.
5835 (Output_data_got::reserve_slot): New function.
5836 (Output_data_got::reserve_slot_for_global): New function.
5837 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5838 (Output_data_got::add_got_entry): New function.
5839 (Output_data_got::add_got_entry_pair): New function.
5840 (Output_data_got::free_list_): New data member.
5841 * target.h (Sized_target::init_got_plt_for_update): New function.
5842 (Sized_target::register_global_plt_entry): New function.
5843 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5844 Initialize new data member; call init; add constructor with PLT count.
5845 (Output_data_plt_x86_64::init): New function.
5846 (Output_data_plt_x86_64::add_relocation): New function.
5847 (Output_data_plt_x86_64::reserve_slot): New function.
5848 (Output_data_plt_x86_64::free_list_): New data member.
5849 (Target_x86_64::init_got_plt_for_update): New function.
5850 (Target_x86_64::register_global_plt_entry): New function.
5851 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5852 incremental updates.
5853 (Output_data_plt_x86_64::add_relocation): New function.
5854 * testsuite/object_unittest.cc (Object_test): Set default options.
5855
ec69d6da
ILT
58562011-05-16 Ian Lance Taylor <iant@google.com>
5857
5858 * options.h (class General_options): Make -i a synonym for -r.
5859
732e31de
ILT
58602011-05-16 Ian Lance Taylor <iant@google.com>
5861
5862 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5863
403676b5
CC
58642011-05-10 Cary Coutant <ccoutant@google.com>
5865
5866 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5867 strip_all (-s).
5868
5b7b7d6e
ILT
58692011-05-06 Ian Lance Taylor <iant@google.com>
5870
5871 * layout.cc (Layout::layout): If the output section flags change,
5872 update the ordering.
5873
f0f9babf
CC
58742011-04-25 Cary Coutant <ccoutant@google.com>
5875
5876 * incremental-dump.cc (dump_incremental_inputs): Print local
5877 symbol info for each input file.
5878 * incremental.cc
5879 (Output_section_incremental_inputs::set_final_data_size): Add local
5880 symbol info to input file entries in incremental info.
5881 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5882 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5883 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5884 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5885 implementation.
5886 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5887 (Sized_incr_relobj::do_relocate): Write the local symbols.
5888 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5889 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5890 Adjust size of input file header.
5891 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5892 (Incremental_inputs_reader::get_local_symbol_count): New function.
5893 (Incremental_inputs_reader::get_input_section): Adjust size of input
5894 file header.
5895 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5896 (Sized_incr_relobj::This): New typedef.
5897 (Sized_incr_relobj::sym_size): New const data member.
5898 (Sized_incr_relobj::Local_symbol): New struct.
5899 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5900 (Sized_incr_relobj::do_local_symbol_offset): New function.
5901 (Sized_incr_relobj::local_symbol_count_): New data member.
5902 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5903 (Sized_incr_relobj::local_symbol_index_): New data member.
5904 (Sized_incr_relobj::local_symbol_offset_): New data member.
5905 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5906 (Sized_incr_relobj::local_symbols_): New data member.
5907 * object.h (Relobj::output_local_symbol_count): New function.
5908 (Relobj::local_symbol_offset): New function.
5909 (Relobj::do_output_local_symbol_count): New function.
5910 (Relobj::do_local_symbol_offset): New function.
5911 (Sized_relobj::do_output_local_symbol_count): New function.
5912 (Sized_relobj::do_local_symbol_offset): New function.
5913
d0a9ace3
ILT
59142011-04-22 Vladimir Simonov <sv@sw.ru>
5915
5916 * descriptors.cc (set_close_on_exec): New function.
5917 (Descriptors::open): Use set_close_on_exec.
5918 * output.cc (S_ISLNK): Define if not defined.
5919
94a3fc8b
CC
59202011-04-22 Cary Coutant <ccoutant@google.com>
5921
5922 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5923 global symbol map.
5924 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5925 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5926 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5927 relocations.
5928 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5929 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5930 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5931 * incremental.h
5932 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5933 function.
5934 (Incremental_binary::apply_incremental_relocs): New function.
5935 (Incremental_binary::do_apply_incremental_relocs): New function.
5936 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5937 data member.
5938 (Sized_incremental_binary::add_global_symbol): New function.
5939 (Sized_incremental_binary::global_symbol): New function.
5940 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5941 (Sized_incremental_binary::symbol_map_): New data member.
5942 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5943 * target.h (Sized_target::apply_relocation): New function.
5944 * target-reloc.h (apply_relocation): New function.
5945 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5946
c87e4302
DK
59472011-04-22 Doug Kwan <dougkwan@google.com>
5948
5949 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5950 flag of a SHT_ARM_EXIDX section.
2e702c99 5951 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5952 * testsuite/Makefile.in: Regenerate.
5953 * testsuite/arm_exidx_test.s: New file.
5954 * testsuite/arm_exidx_test.sh: Same.
5955
e7782cf6
CC
59562011-04-20 Cary Coutant <ccoutant@google.com>
5957
5958 PR gold/12689
5959 * archive.h (Incremental_archive_entry::Archive_member):
5960 Initialize arg_serial_ (second constructor).
5961
308ecdc7
ILT
59622011-04-17 Ian Lance Taylor <iant@google.com>
5963
5964 * object.cc (Relocate_info::location): Simplify location string.
5965 * errors.cc (Errors::error_at_location): Don't print program
5966 name.
5967 (Errors::warning_at_location): Likewise.
5968 (Errors::undefined_symbol): Likewise.
5969 * testsuite/debug_msg.sh: Update accordingly.
5970
bec5b579
CC
59712011-04-14 Cary Coutant <ccoutant@google.com>
5972
5973 * gold/layout.cc (Layout::symtab_section_offset): New function.
5974 * gold/layout.h (Layout::symtab_section_offset): New function.
5975 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5976
88597d34
ILT
59772011-04-12 Ian Lance Taylor <iant@google.com>
5978
5979 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5980 with MREMAP_MAYMOVE.
5981 * output.h (class Output_file): Add map_is_allocated_ field.
5982 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5983 not available, provide stubs. If mremap is not available, #define
5984 it to gold_mremap.
5985 (MREMAP_MAYMOVE): Define if not defined.
5986 (Output_file::Output_file): Initialize map_is_allocated_.
5987 (Output_file::resize): Check map_is_allocated_.
5988 (Output_file::map_anonymous): If mmap fails, use malloc.
5989 (Output_file::unmap): Don't do anything for an anonymous map.
5990 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5991 is not available, provide stubs.
5992 (File_read::View::~View): Use free rather than delete[].
5993 (File_read::make_view): Use malloc rather than new[]. If mmap
5994 fails, use malloc.
5995 (File_read::find_or_make_view): Use malloc rather than new[].
5996 * gold.h: Remove HAVE_REMAP code.
5997 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5998 exists. Rename mremap to gold_mremap. If mmap is not available
5999 don't do anything.
6000 * configure, config.in: Rebuild.
6001
11e361bc
ILT
60022011-04-11 Ian Lance Taylor <iant@google.com>
6003
6004 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6005 initialize local variable v.
6006
cdc29364
CC
60072011-04-11 Cary Coutant <ccoutant@google.com>
6008
6009 * archive.cc (Archive::include_member): Adjust call to
6010 report_object.
6011 (Add_archive_symbols::run): Track argument serial numbers.
6012 (Lib_group::include_member): Likewise.
6013 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6014 * archive.h (Incremental_archive_entry::Archive_member):
6015 Initialize arg_serial_.
6016 (Archive_member::arg_serial_): New data member.
6017 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6018 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6019 incremental link.
6020 (Sized_dynobj::do_for_all_local_got_entries): New function.
6021 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6022 function.
6023 * fileread.cc (get_mtime): New function.
6024 * fileread.h (get_mtime): New function.
6025 * gold.cc (queue_initial_tasks): Check for incremental update.
6026 (process_incremental_input): New function.
6027 (queue_middle_tasks): Don't force valid target for incremental
6028 update.
6029 * incremental-dump.cc (find_input_containing_global): Adjust
6030 size of symbol info entry.
6031 (dump_incremental_inputs): Dump argument serial number and
6032 in_system_directory flag; bias shndx by 1; print symbol names
6033 when dumping per-file symbol lists; use new symbol info readers.
6034 * incremental.cc
6035 (Output_section_incremental_inputs:update_data_size): New function.
6036 (Sized_incremental_binary::setup_readers): Setup input readers
6037 for each input file; build maps for files added from libraries
6038 and scripts.
6039 (Sized_incremental_binary::check_input_args): New function.
6040 (Sized_incremental_binary::do_check_inputs): Build map of argument
6041 serial numbers to input arguments.
6042 (Sized_incremental_binary::do_file_has_changed): Rename
6043 do_file_is_unchanged to this; compare file modification times.
6044 (Sized_incremental_binary::do_init_layout): New function.
6045 (Sized_incremental_binary::do_reserve_layout): New function.
6046 (Sized_incremental_binary::do_get_input_reader): Remove.
6047 (Sized_incremental_binary::get_symtab_view): New function.
6048 (Incremental_checker::can_incrementally_link_output_file): Remove.
6049 (Incremental_inputs::report_command_line): Exclude --debug options.
6050 (Incremental_inputs::report_archive_begin): Add parameter; track
6051 argument serial numbers; don't put input file entry for archive
6052 before archive members.
6053 (Incremental_inputs::report_archive_end): Put input file entry
6054 for archive after archive members.
6055 (Incremental_inputs::report_object): Add parameter; track argument
6056 serial numbers and in_system_directory flag.
6057 (Incremental_inputs::report_script): Add parameter; track argument
6058 serial numbers.
6059 (Output_section_incremental_inputs::set_final_data_size): Adjust
6060 size of symbol info entry; check for forwarding symbols.
6061 (Output_section_incremental_inputs::write_input_files): Write
6062 in_system_directory flag and argument serial number.
6063 (Output_section_incremental_inputs::write_info_blocks): Map section
6064 indices between incremental info and original input file; store
6065 input section index for each symbol.
6066 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6067 change operator() to visit().
6068 (class Global_got_offset_visitor): Likewise.
6069 (class Global_symbol_visitor_got_plt):
6070 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6071 classes.
6072 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6073 (Sized_incr_relobj::do_read_symbols): New function.
6074 (Sized_incr_relobj::do_layout): New function.
6075 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6076 (Sized_incr_relobj::do_add_symbols): New function.
6077 (Sized_incr_relobj::do_should_include_member): New function.
6078 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6079 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6080 (Sized_incr_relobj::do_section_size): New function.
6081 (Sized_incr_relobj::do_section_name): New function.
6082 (Sized_incr_relobj::do_section_contents): New function.
6083 (Sized_incr_relobj::do_section_flags): New function.
6084 (Sized_incr_relobj::do_section_entsize): New function.
6085 (Sized_incr_relobj::do_section_address): New function.
6086 (Sized_incr_relobj::do_section_type): New function.
6087 (Sized_incr_relobj::do_section_link): New function.
6088 (Sized_incr_relobj::do_section_info): New function.
6089 (Sized_incr_relobj::do_section_addralign): New function.
6090 (Sized_incr_relobj::do_initialize_xindex): New function.
6091 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6092 (Sized_incr_relobj::do_read_relocs): New function.
6093 (Sized_incr_relobj::do_gc_process_relocs): New function.
6094 (Sized_incr_relobj::do_scan_relocs): New function.
6095 (Sized_incr_relobj::do_count_local_symbols): New function.
6096 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6097 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6098 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6099 (Sized_incr_relobj::do_relocate): New function.
6100 (Sized_incr_relobj::do_set_section_offset): New function.
6101 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6102 (Sized_incr_dynobj::do_read_symbols): New function.
6103 (Sized_incr_dynobj::do_layout): New function.
6104 (Sized_incr_dynobj::do_add_symbols): New function.
6105 (Sized_incr_dynobj::do_should_include_member): New function.
6106 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6107 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6108 (Sized_incr_dynobj::do_section_size): New function.
6109 (Sized_incr_dynobj::do_section_name): New function.
6110 (Sized_incr_dynobj::do_section_contents): New function.
6111 (Sized_incr_dynobj::do_section_flags): New function.
6112 (Sized_incr_dynobj::do_section_entsize): New function.
6113 (Sized_incr_dynobj::do_section_address): New function.
6114 (Sized_incr_dynobj::do_section_type): New function.
6115 (Sized_incr_dynobj::do_section_link): New function.
6116 (Sized_incr_dynobj::do_section_info): New function.
6117 (Sized_incr_dynobj::do_section_addralign): New function.
6118 (Sized_incr_dynobj::do_initialize_xindex): New function.
6119 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6120 (make_sized_incremental_object): New function.
6121 (Incremental_library::copy_unused_symbols): New function.
6122 (Incremental_library::do_for_all_unused_symbols): New function.
6123 * incremental.h (enum Incremental_input_flags): New type.
6124 (class Incremental_checker): Remove.
6125 (Incremental_input_entry::Incremental_input_entry): Add argument
6126 serial number.
6127 (Incremental_input_entry::arg_serial): New function.
6128 (Incremental_input_entry::set_is_in_system_directory): New function.
6129 (Incremental_input_entry::is_in_system_directory): New function.
6130 (Incremental_input_entry::arg_serial_): New data member.
6131 (Incremental_input_entry::is_in_system_directory_): New data member.
6132 (class Script_info): Move here from script.h.
6133 (Script_info::Script_info): Add filename parameter.
6134 (Script_info::filename): New function.
6135 (Script_info::filename_): New data member.
6136 (Incremental_script_entry::Incremental_script_entry): Add argument
6137 serial number.
6138 (Incremental_object_entry::Incremental_object_entry): Likewise.
6139 (Incremental_object_entry::add_input_section): Build list of input
6140 sections with map to original shndx.
6141 (Incremental_object_entry::get_input_section_index): New function.
6142 (Incremental_object_entry::shndx_): New data member.
6143 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6144 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6145 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6146 serial number.
6147 (Incremental_inputs::report_archive_begin): Likewise.
6148 (Incremental_inputs::report_object): Likewise.
6149 (Incremental_inputs::report_script): Likewise.
6150 (class Incremental_global_symbol_reader): New class.
6151 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6152 and store flags and input file type.
6153 (Incremental_input_entry_reader::arg_serial): New function.
6154 (Incremental_input_entry_reader::type): Extract type from flags.
6155 (Incremental_input_entry_reader::is_in_system_directory): New function.
6156 (Incremental_input_entry_reader::get_input_section_count): Call
6157 accessor function for type.
6158 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6159 function for type; adjust size of global symbol entry.
6160 (Incremental_input_entry_reader::get_global_symbol_count): Call
6161 accessor function for type.
6162 (Incremental_input_entry_reader::get_object_count): Likewise.
6163 (Incremental_input_entry_reader::get_object_offset): Likewise.
6164 (Incremental_input_entry_reader::get_member_count): Likewise.
6165 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6166 (Incremental_input_entry_reader::get_member_offset): Likewise.
6167 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6168 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6169 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6170 (Incremental_input_entry_reader::get_global_symbol_reader): New
6171 function.
6172 (Incremental_input_entry_reader::get_output_symbol_index): New
6173 function.
6174 (Incremental_input_entry_reader::type_): Remove.
6175 (Incremental_input_entry_reader::flags_): New data member.
6176 (Incremental_inputs_reader::input_file_offset): New function.
6177 (Incremental_inputs_reader::input_file_index): New function.
6178 (Incremental_inputs_reader::input_file): Call input_file_offset.
6179 (Incremental_inputs_reader::input_file_at_offset): New function.
6180 (Incremental_relocs_reader::get_r_type): Reformat.
6181 (Incremental_relocs_reader::get_r_shndx): Reformat.
6182 (Incremental_relocs_reader::get_r_offset): Reformat.
6183 (Incremental_relocs_reader::data): New function.
6184 (Incremental_binary::Incremental_binary): Initialize new data members.
6185 (Incremental_binary::check_inputs): Add cmdline parameter.
6186 (Incremental_binary::file_is_unchanged): Remove.
6187 (Input_reader::arg_serial): New function.
6188 (Input_reader::get_unused_symbol_count): New function.
6189 (Input_reader::get_unused_symbol): New function.
6190 (Input_reader::do_arg_serial): New function.
6191 (Input_reader::do_get_unused_symbol_count): New function.
6192 (Input_reader::do_get_unused_symbol): New function.
6193 (Incremental_binary::input_file_count): New function.
6194 (Incremental_binary::get_input_reader): Change signature to use
6195 index instead of filename.
6196 (Incremental_binary::file_has_changed): New function.
6197 (Incremental_binary::get_input_argument): New function.
6198 (Incremental_binary::get_library): New function.
6199 (Incremental_binary::get_script_info): New function.
6200 (Incremental_binary::init_layout): New function.
6201 (Incremental_binary::reserve_layout): New function.
6202 (Incremental_binary::output_file): New function.
6203 (Incremental_binary::do_check_inputs): New function.
6204 (Incremental_binary::do_file_is_unchanged): Remove.
6205 (Incremental_binary::do_file_has_changed): New function.
6206 (Incremental_binary::do_init_layout): New function.
6207 (Incremental_binary::do_reserve_layout): New function.
6208 (Incremental_binary::do_input_file_count): New function.
6209 (Incremental_binary::do_get_input_reader): Change signature.
6210 (Incremental_binary::input_args_map_): New data member.
6211 (Incremental_binary::library_map_): New data member.
6212 (Incremental_binary::script_map_): New data member.
6213 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6214 new data members.
6215 (Sized_incremental_binary::output_section): New function.
6216 (Sized_incremental_binary::inputs_reader): Add const.
6217 (Sized_incremental_binary::symtab_reader): Add const.
6218 (Sized_incremental_binary::relocs_reader): Add const.
6219 (Sized_incremental_binary::got_plt_reader): Add const.
6220 (Sized_incremental_binary::get_symtab_view): New function.
6221 (Sized_incremental_binary::Inputs_reader): New typedef.
6222 (Sized_incremental_binary::Input_entry_reader): New typedef.
6223 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6224 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6225 (Sized_incremental_binary::do_file_has_changed): New function.
6226 (Sized_incremental_binary::do_init_layout): New function.
6227 (Sized_incremental_binary::do_reserve_layout): New function.
6228 (Sized_input_reader::Inputs_reader): Remove.
6229 (Sized_input_reader::Input_entry_reader): Remove.
6230 (Sized_input_reader::do_arg_serial): New function.
6231 (Sized_input_reader::do_get_unused_symbol_count): New function.
6232 (Sized_input_reader::do_get_unused_symbol): New function.
6233 (Sized_incremental_binary::do_input_file_count): New function.
6234 (Sized_incremental_binary::do_get_input_reader): Change signature;
6235 use index instead of filename.
6236 (Sized_incremental_binary::section_map_): New data member.
6237 (Sized_incremental_binary::input_entry_readers_): New data member.
6238 (class Sized_incr_relobj): New class.
6239 (class Sized_incr_dynobj): New class.
6240 (make_sized_incremental_object): New function.
6241 (class Incremental_library): New class.
6242 * layout.cc (Free_list::num_lists): New static data member.
6243 (Free_list::num_nodes): New static data member.
6244 (Free_list::num_removes): New static data member.
6245 (Free_list::num_remove_visits): New static data member.
6246 (Free_list::num_allocates): New static data member.
6247 (Free_list::num_allocate_visits): New static data member.
6248 (Free_list::init): New function.
6249 (Free_list::remove): New function.
6250 (Free_list::allocate): New function.
6251 (Free_list::dump): New function.
6252 (Free_list::print_stats): New function.
6253 (Layout_task_runner::run): Resize output file for incremental updates.
6254 (Layout::Layout): Initialize new data members.
6255 (Layout::set_incremental_base): New function.
6256 (Layout::init_fixed_output_section): New function.
6257 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6258 incremental updates.
6259 (Layout::create_gold_note): Do not create gold note section for
6260 incremental updates.
6261 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6262 for incremental updates.
6263 (Layout::set_section_offsets): For incremental updates, allocate space
6264 from free list.
6265 (Layout::create_symtab_sections): Layout with offsets relative to
6266 start of section; for incremental updates, allocate space from free
6267 list.
6268 (Layout::create_shdrs): For incremental updates, allocate space from
6269 free list.
6270 (Layout::finish_dynamic_section): For incremental updates, do not
6271 check --as-needed (fixed in subsequent patch).
6272 * layout.h (class Free_list): New class.
6273 (Layout::set_incremental_base): New function.
6274 (Layout::incremental_base): New function.
6275 (Layout::init_fixed_output_section): New function.
6276 (Layout::allocate): New function.
6277 (Layout::incremental_base_): New data member.
6278 (Layout::free_list_): New data member.
6279 * main.cc (main): Print Free_list statistics.
6280 * object.cc (Relobj::finalize_incremental_relocs): Add
6281 clear_counts parameter; clear counts only when clear_counts is set.
6282 (Sized_relobj::Sized_relobj): Initialize new base class.
6283 (Sized_relobj::do_layout): Don't report special sections.
6284 (Sized_relobj::do_for_all_local_got_entries): New function.
6285 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6286 symtab_off to all symbol table offsets.
6287 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6288 * object.h (class Got_offset_list): Move to top of file.
6289 (Object::Object): Allow case where input_file == NULL.
6290 (Object::~Object): Likewise.
6291 (Object::input_file): Assert that input_file != NULL.
6292 (Object::lock): Allow case where input_file == NULL.
6293 (Object::unlock): Likewise.
6294 (Object::is_locked): Likewise.
6295 (Object::token): Likewise.
6296 (Object::release): Likewise.
6297 (Object::is_incremental): New function.
6298 (Object::get_mtime): New function.
6299 (Object::for_all_local_got_entries): New function.
6300 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6301 (Object::set_is_in_system_directory): New function.
6302 (Object::is_in_system_directory): New function.
6303 (Object::do_is_incremental): New function.
6304 (Object::do_get_mtime): New function.
6305 (Object::do_for_all_local_got_entries): New function.
6306 (Object::is_in_system_directory_): New data member.
6307 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6308 (class Sized_relobj_base): New class.
6309 (class Sized_relobj): Derive from Sized_relobj_base.
6310 (class Sized_relobj::Symbols): Redeclare from base class.
6311 (class Sized_relobj::local_got_offset_list): Remove.
6312 (class Sized_relobj::Output_sections): Redeclare from base class.
6313 (class Sized_relobj::do_for_all_local_got_entries): New function.
6314 (class Sized_relobj::write_local_symbols): Add offset parameter.
6315 (class Sized_relobj::local_symbol_offset_): Update comment.
6316 (class Sized_relobj::local_dynsym_offset_): Update comment.
6317 * options.cc (Input_arguments::add_file): Remove const.
6318 * options.h (Input_file_argument::Input_file_argument):
6319 Initialize arg_serial_ (all constructors).
6320 (Input_file_argument::set_arg_serial): New function.
6321 (Input_file_argument::arg_serial): New function.
6322 (Input_file_argument::arg_serial_): New data member.
6323 (Input_arguments::Input_arguments): Initialize file_count_.
6324 (Input_arguments::add_file): Remove const.
6325 (Input_arguments::number_of_input_files): New function.
6326 (Input_arguments::file_count_): New data member.
6327 (Command_line::number_of_input_files): Call
6328 Input_arguments::number_of_input_files.
6329 * output.cc (Output_segment_headers::Output_segment_headers):
6330 Set current size.
6331 (Output_section::Input_section::current_data_size): New function.
6332 (Output_section::Output_section): Initialize new data members.
6333 (Output_section::add_input_section): Don't do merge sections for
6334 an incremental link; allocate space from free list for an
6335 incremental update.
6336 (Output_section::add_output_section_data): Allocate space from
6337 free list for an incremental update.
6338 (Output_section::update_data_size): New function.
6339 (Output_section::set_fixed_layout): New function.
6340 (Output_section::reserve): New function.
6341 (Output_segment::set_section_addresses): Remove const.
6342 (Output_segment::set_section_list_addresses): Remove const; allocate
6343 space from free list for an incremental update.
6344 (Output_segment::set_offset): Adjust size of RELRO segment for an
6345 incremental update.
6346 * output.h (Output_data::current_data_size): Move here from
6347 child classes.
6348 (Output_data::pre_finalize_data_size): New function.
6349 (Output_data::update_data_size): New function.
6350 (Output_section_headers::update_data_size): new function.
6351 (Output_section_data_build::current_data_size): Move to Output_data.
6352 (Output_data_strtab::update_data_size): New function.
6353 (Output_section::current_data_size): Move to Output_data.
6354 (Output_section::set_fixed_layout): New function.
6355 (Output_section::has_fixed_layout): New function.
6356 (Output_section::reserve): New function.
6357 (Output_section::update_data_size): New function.
6358 (Output_section::has_fixed_layout_): New data member.
6359 (Output_section::free_list_): New data member.
6360 (Output_segment::set_section_addresses): Remove const.
6361 (Output_segment::set_section_list_addresses): Remove const.
6362 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6363 New function.
6364 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6365 New function.
6366 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6367 parameter when calling Add_symbols constructor; store argument
6368 serial number for members of a lib group.
6369 (Add_symbols::locks): Allow case where token == NULL.
6370 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6371 (Read_member::~Read_member): New function.
6372 (Read_member::is_runnable): New function.
6373 (Read_member::locks): New function.
6374 (Read_member::run): New function.
6375 (Check_script::~Check_script): New function.
6376 (Check_script::is_runnable): New function.
6377 (Check_script::locks): New function.
6378 (Check_script::run): New function.
6379 (Check_library::~Check_library): New function.
6380 (Check_library::is_runnable): New function.
6381 (Check_library::locks): New function.
6382 (Check_library::run): New function.
6383 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6384 (Add_symbols::library_): New data member.
6385 (class Read_member): New class.
6386 (class Check_script): New class.
6387 (class Check_library): New class.
6388 * reloc.cc (Read_relocs::is_runnable): Allow case where
6389 token == NULL.
6390 (Read_relocs::locks): Likewise.
6391 (Scan_relocs::locks): Likewise.
6392 (Relocate_task::locks): Likewise.
6393 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6394 to clear counters.
6395 (Sized_relobj::incremental_relocs_scan): Fix comment.
6396 (Sized_relobj::do_relocate): Pass output file offset to
6397 write_local_symbols.
6398 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6399 from class declaration.
6400 * script.cc (read_input_script): Allocate Script_info; pass
6401 argument serial number to report_script.
6402 * script.h (class Script_info): Move to incremental.h.
6403 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6404 * symtab.h (Symbol_table::add_from_incrobj): New function.
6405 (Symbol_table::set_file_offset): New function.
6406
b961d0d7
CC
64072011-04-05 Cary Coutant <ccoutant@google.com>
6408
6409 * incremental-dump.cc (dump_incremental_inputs): Change signature
6410 to take a Sized_incremental_binary; change caller. Use readers
6411 in Sized_incremental_binary.
6412 * incremental.cc
6413 (Sized_incremental_binary::find_incremental_inputs_sections):
6414 Rename do_find_incremental_inputs_sections to this.
6415 (Sized_incremental_binary::setup_readers): New function.
6416 (Sized_incremental_binary::do_check_inputs): Check
6417 has_incremental_info_ flag; move setup code to setup_readers;
6418 use input readers.
6419 (Sized_incremental_binary::do_file_is_unchanged): New function.
6420 (Sized_incremental_binary::do_get_input_reader): New function.
6421 * incremental.h (class Incremental_binary): Move to end of file.
6422 (Incremental_binary::file_is_unchanged): New function.
6423 (Incremental_binary::do_file_is_unchanged): New function.
6424 (Incremental_binary::Input_reader): New class.
6425 (Incremental_binary::get_input_reader): New function.
6426 (class Sized_incremental_binary): Move to end of file.
6427 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6428 input section reader classes.
6429 (Sized_incremental_binary::has_incremental_info): New function.
6430 (Sized_incremental_binary::inputs_reader): New function.
6431 (Sized_incremental_binary::symtab_reader): New function.
6432 (Sized_incremental_binary::relocs_reader): New function.
6433 (Sized_incremental_binary::got_plt_reader): New function.
6434 (Sized_incremental_binary::do_file_is_unchanged): New function.
6435 (Sized_incremental_binary::Sized_input_reader): New class.
6436 (Sized_incremental_binary::get_input_reader): New function.
6437 (Sized_incremental_binary::find_incremental_inputs_sections):
6438 Rename do_find_incremental_inputs_sections to this.
6439 (Sized_incremental_binary::setup_readers): New function.
6440 (Sized_incremental_binary::has_incremental_info_): New data member.
6441 (Sized_incremental_binary::inputs_reader_): New data member.
6442 (Sized_incremental_binary::symtab_reader_): New data member.
6443 (Sized_incremental_binary::relocs_reader_): New data member.
6444 (Sized_incremental_binary::got_plt_reader_): New data member.
6445 (Sized_incremental_binary::current_input_file_): New data member.
6446
a869183f
PP
64472011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6448
6449 PR gold/12640
6450 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6451 violation.
6452
64532011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6454
6455 * archive.cc (Archive::include_member): Adjust call to report_object.
6456 (Add_archive_symbols::run): Add script_info to call to
6457 report_archive_begin.
6458 (Lib_group::include_member): Adjust call to report_object.
6459 (Add_lib_group_symbols::run): Adjust call to report_object.
6460 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6461 blocks. Add object count for script input files.
6462 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6463 script_info parameter; change all callers.
6464 (Incremental_inputs::report_object): Add script_info parameter;
6465 change all callers.
6466 (Incremental_inputs::report_script): Store backpointer to
6467 incremental info entry.
6468 (Output_section_incremental_inputs::set_final_data_size): Record
6469 additional information for scripts.
6470 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6471 * incremental.h (Incremental_script_entry::add_object): New function.
6472 (Incremental_script_entry::get_object_count): New function.
6473 (Incremental_script_entry::get_object): New function.
6474 (Incremental_script_entry::objects_): New data member; adjust
6475 constructor.
6476 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6477 (Incremental_inputs::report_object): Add script_info parameter.
6478 (Incremental_inputs_reader::get_object_count): New function.
6479 (Incremental_inputs_reader::get_object_offset): New function.
6480 * options.cc (Input_arguments::add_file): Return reference to
6481 new input argument.
6482 * options.h (Input_argument::set_script_info): New function.
6483 (Input_argument::script_info): New function.
6484 (Input_argument::script_info_): New data member; adjust all
6485 constructors.
6486 (Input_file_group::add_file): Return reference to new input argument.
6487 (Input_file_lib::add_file): Likewise.
6488 (Input_arguments::add_file): Likewise.
6489 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6490 * script.cc (Parser_closure::Parser_closure): Add script_info
6491 parameter; adjust all callers.
6492 (Parser_closure::script_info): New function.
6493 (Parser_closure::script_info_): New data member.
6494 (read_input_script): Report scripts earlier to incremental info.
6495 (script_add_file): Set script_info in Input_argument.
6496 (script_add_library): Likewise.
6497 * script.h (Script_options::Script_info): Rewrite class.
6498
a869183f 64992011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6500
6501 * archive.cc (Library_base::should_include_member): Move
6502 method here from class Archive.
6503 (Archive::Archive): Initialize base class.
6504 (Archive::should_include_member): Move to base class.
6505 (Archive::do_for_all_unused_symbols): New function.
6506 (Add_archive_symbols::run): Remove redundant access to
6507 incremental_inputs.
6508 (Lib_group::Lib_group): Initialize base class.
6509 (Lib_group::do_filename): New function.
6510 (Lib_group::include_member): Pass pointer to Lib_group to
6511 report_object.
6512 (Lib_group::do_for_all_unused_symbols): New function.
6513 (Add_lib_group_symbols::run): Report archive information for
6514 incremental links.
6515 * archive.h (class Library_base): New base class.
6516 (class Archive): Derive from Library_base.
6517 (Archive::filename): Move to base class.
6518 (Archive::set_incremental_info): Likewise.
6519 (Archive::incremental_info): Likewise.
6520 (Archive::Should_include): Likewise.
6521 (Archive::should_include_member): Likewise.
6522 (Archive::Armap_entry): Remove.
6523 (Archive::Unused_symbol_iterator): Remove.
6524 (Archive::unused_symbols_begin): Remove.
6525 (Archive::unused_symbols_end): Remove.
6526 (Archive::do_filename): New function.
6527 (Archive::do_get_mtime): New function.
6528 (Archive::do_for_all_unused_symbols): New function.
6529 (Archive::task_): Move to base class.
6530 (Archive::incremental_info_): Likewise.
6531 (class Lib_group): Derive from Library_base.
6532 (Lib_group::do_filename): New function.
6533 (Lib_group::do_get_mtime): New function.
6534 (Lib_group::do_for_all_unused_symbols): New function.
6535 (Lib_group::task_): Move to base class.
6536 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6537 function.
6538 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6539 function.
6540 * incremental.cc (Incremental_inputs::report_archive_begin):
6541 Use Library_base; call library's get_mtime; add incremental inputs
6542 entry before members.
6543 (class Unused_symbol_visitor): New class.
6544 (Incremental_inputs::report_archive_end): Use Library_base; use
6545 visitor class to record unused symbols; don't add incremental inputs
6546 entry after members.
6547 (Incremental_inputs::report_object): Use Library_base.
6548 * incremental.h
6549 (Incremental_archive_entry::Incremental_archive_entry): Remove
6550 unused Archive parameter.
6551 (Incremental_inputs::report_archive_begin): Use Library_base.
6552 (Incremental_inputs::report_archive_end): Likewise.
6553 (Incremental_inputs::report_object): Likewise.
6554 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6555 function.
6556 * object.h (Object::for_all_global_symbols): New function.
6557 (Object::do_for_all_global_symbols): New function.
6558 (Sized_relobj::do_for_all_global_symbols): New function.
6559 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6560 function.
6561 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6562 function.
6563
61ab3e40
ILT
65642011-03-27 Ian Lance Taylor <iant@google.com>
6565
6566 * archive.cc (Archive::interpret_header): Return -1 if something
6567 goes wrong. Change callers accordingly.
6568
30e1f9e6
CC
65692011-03-25 Cary Coutant <ccoutant@google.com>
6570
6571 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6572 * testsuite/Makefile.in: Regenerate.
6573
9370ce59 65742011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6575
6576 * plugin.cc (get_view): New.
6577 (Plugin::load): Pass get_view to the plugin.
6578 (Plugin_manager::get_view): New.
6579
9312bb0a
ILT
65802011-03-21 Ian Lance Taylor <iant@google.com>
6581
6582 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6583 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6584
7e12ba9e
ST
65852011-03-21 Sriraman Tallam <tmsriram@google.com>
6586
6587 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6588 Change == to -eq.
6589 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6590 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6591 Change == to -eq.
6592 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6593 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6594
fd7a005d
ILT
65952011-03-14 Ian Lance Taylor <iant@google.com>
6596
6597 * script-sections.cc (Sort_output_sections::script_compare):
6598 Rename from is_before, change return type.
6599 (Sort_output_sections::operator()): Adjust accordingly.
6600
ed16fd1b
ILT
66012011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6602
6603 PR gold/12572
6604 * testsuite/odr_violation2.cc: Add comment to make all error line
6605 numbers double digits.
6606 * testsuite/debug_msg.sh: Adjust expected errors.
6607
71ff8986
ILT
66082011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6609
6610 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6611 but mark earlier ones as non-canonical
6612 (offset_to_iterator): Update search target and example
6613 (do_addr2line): Return extra lines in a vector*
6614 (format_file_lineno): Extract from do_addr2line
6615 (one_addr2line): Add vector* out-param
6616 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6617 when a lineno entry appeared last for its instruction
6618 (Dwarf_line_info): Add vector* out-param
6619 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6620 * symtab.cc (Odr_violation_compare): Include the lineno in the
6621 comparison again.
6622 (linenos_from_loc): New. Combine the canonical line for an
6623 address with its other lines.
6624 (True_if_intersect): New. Helper functor to make
6625 std::set_intersection a query.
6626 (detect_odr_violations): Compare sets of lines instead of just
6627 one line for each function. This became less deterministic, but
6628 has fewer false positives.
6629 * symtab.h: Declarations.
6630 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6631 mix an optimized and non-optimized object in the same binary
6632 (odr_violation2.so): Same.
6633 * testsuite/Makefile.in: Regenerate from Makefile.am.
6634 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6635 * testsuite/debug_msg.sh: Update line numbers and add
6636 assertions.
6637 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6638 non-optimized context.
6639 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6640 isn't inlined, and use OdrDerived in an optimized context.
6641 * testsuite/odr_header1.h: Defines OdrDerived, where
6642 optimization will change the
6643 first-instruction-in-the-destructor's file and line number.
6644 * testsuite/odr_header2.h: Defines OdrBase.
6645
a19fefdc
ILT
66462011-03-09 Ian Lance Taylor <iant@google.com>
6647
6648 * fileread.cc (File_read::clear_views): Don't delete the whole
6649 file view.
6650
ecb351e9
ILT
66512011-03-08 Ian Lance Taylor <iant@google.com>
6652
6653 PR gold/12525
6654 * fileread.cc: #include <climits>.
6655 (GOLD_IOV_MAX): Define.
6656 (File_read::read_multiple): Limit number of entries by iov_max.
6657 * fileread.h (class File_read): Always set max_readv_entries to
6658 128.
6659
b821d13c
ILT
66602011-03-07 Ian Lance Taylor <iant@google.com>
6661
6662 PR gold/12525
6663 * options.h (class General_options): Add -dy and -dn.
6664
89243142
CC
66652011-03-02 Cary Coutant <ccoutant@google.com>
6666
6667 * testsuite/script_test_9.t: Add TLS segment.
6668
d0773f31
ILT
66692011-03-02 Simon Baldwin <simonb@google.com>
6670
6671 * configure.ac: Add check for gnu_indirect_function support in
6672 the toolchain building binutils.
6673 * configure: Rebuild.
6674
9370ce59 66752011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6676
6677 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6678 plugin only symbols.
6679 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6680 in plugin files as not needed in the symbol table.
6681
4cf7a849
ST
66822011-02-11 Sriraman Tallam <tmsriram@google.com>
6683
6684 * output.cc (Output_section::add_input_section): Delay fill
6685 generation for section ordering.
6686
b578bd7d
ILT
66872011-02-09 Ian Lance Taylor <iant@google.com>
6688
6689 PR gold/12316
6690 * object.h (class Sized_relobj): Remove clear_local_symbols.
6691 * reloc.cc (Sized_relobj::do_relocate): Don't call
6692 clear_local_symbols.
6693
9370ce59 66942011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6695
6696 * plugin.cc (is_visible_from_outside): Return true for symbols
6697 in the -u option.
6698
55382fb7
ILT
66992011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6700
6701 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6702 filename.
6703
4e271fff
ST
67042011-02-02 Sriraman Tallam <tmsriram@google.com>
6705
6706 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6707 to std::string.
4e271fff 6708 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6709 section_name to be std::string.
4e271fff
ST
6710 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6711
d433c3ac
ILT
67122011-01-25 Ian Lance Taylor <iant@google.com>
6713
6714 * script.cc (script_add_extern): Rewrite to use
6715 add_symbol_reference.
6716
880473a6
DK
67172011-01-25 Doug Kwan <dougkwan@google.com>
6718
d433c3ac 6719 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6720
f30f86fa
ILT
67212011-01-24 Ian Lance Taylor <iant@google.com>
6722
6723 * options.h (class General_options): Accept
6724 --no-detect-odr-violations.
6725
8e51a0b9
ILT
67262011-01-24 Ian Lance Taylor <iant@google.com>
6727
6728 * version.cc (version_string): Bump to 1.11.
6729
0f3b89d8
ILT
67302011-01-24 Ian Lance Taylor <iant@google.com>
6731
6732 * plugin.cc (class Plugin_rescan): Define new class.
6733 (Plugin_manager::claim_file): Set any_claimed_.
6734 (Plugin_manager::save_archive): New function.
6735 (Plugin_manager::save_input_group): New function.
6736 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6737 necessary.
6738 (Plugin_manager::new_undefined_symbol): New function.
6739 (Plugin_manager::rescan): New function.
6740 (Plugin_manager::rescannable_defines): New function.
6741 (Plugin_manager::add_input_file): Set any_added_.
6742 * plugin.h (class Plugin_manager): define new fields rescannable_,
6743 undefined_symbols_, any_claimed_, and any_added_. Declare
6744 Plugin_rescan as friend. Declare new functions.
6745 (Plugin_manager::Rescannable): Define type.
6746 (Plugin_manager::Rescannable_list): Define type.
6747 (Plugin_manager::Undefined_symbol_list): Define type.
6748 (Plugin_manager::Plugin_manager): Initialize new fields.
6749 * archive.cc (Archive::defines_symbol): New function.
6750 (Add_archive_symbols::run): Pass archive to plugins if any.
6751 * archive.h (class Archive): Declare defines_symbol.
6752 * readsyms.cc (Input_group::~Input_group): New function.
6753 (Finish_group::run): Pass input_group to plugins if any.
6754 * readsyms.h (class Input_group): Declare destructor.
6755 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6756 any.
6757
3bb951e5
ILT
67582011-01-10 Ian Lance Taylor <iant@google.com>
6759
6760 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6761 section as relro.
6762 (Layout::set_segment_offsets): Reset increase_relro before calling
6763 set_section_addresses a second time.
6764
0aa45fac
CC
67652011-01-04 Cary Coutant <ccoutant@google.com>
6766
6767 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6768 sections before NOBITS sections.
6769
0db46eb4
L
67702011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6771
6772 * version.cc (print_version): Update copyright to 2011.
6773
829c9745
CC
67742010-12-23 Cary Coutant <ccoutant@google.com>
6775
6776 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6777 of OS to this->add. Add OD parameter to second form of the function.
6778
7500420b
ILT
67792010-12-20 Ian Lance Taylor <iant@google.com>
6780
6781 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6782 second of two consecutive entries with same offset.
6783
f8e9a930
RW
67842010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6785
6786 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6787 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6788 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6789 to avoid unneeded links against $(LDADD).
6790 * testsuite/Makefile.in: Regenerate.
6791
2fbb4320
ILT
67922010-12-15 Ian Lance Taylor <iant@google.com>
6793
6794 PR gold/12324
6795 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6796 for R_X86_64_32 and R_X86_64_PC32.
6797 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6798 ver_matching_def_pic.o.
6799 (ver_matching_def_pic.o): New target.
6800
fedb228d
RW
68012010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6802
6803 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6804 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6805 Move definition before File_read::View member definitions.
6806 (File_read::View::~View): Initialize and hold lock before
6807 updating current_mapped_bytes.
6808
9b547ce6
RW
68092010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6810
6811 * dwarf_reader.cc: Remove outdated comment.
6812 * gold-threads.cc: Fix typo in error message.
6813 * archive.cc: Fix typos in comments.
6814 * archive.h: Likewise.
6815 * arm-reloc-property.cc: Likewise.
6816 * arm-reloc-property.h: Likewise.
6817 * arm-reloc.def: Likewise.
6818 * arm.cc: Likewise.
6819 * attributes.h: Likewise.
6820 * cref.cc: Likewise.
6821 * ehframe.cc: Likewise.
6822 * fileread.h: Likewise.
6823 * gold.h: Likewise.
6824 * i386.cc: Likewise.
6825 * icf.cc: Likewise.
6826 * incremental.h: Likewise.
6827 * int_encoding.cc: Likewise.
6828 * layout.h: Likewise.
6829 * main.cc: Likewise.
6830 * merge.h: Likewise.
6831 * object.cc: Likewise.
6832 * object.h: Likewise.
6833 * options.cc: Likewise.
6834 * readsyms.cc: Likewise.
6835 * reduced_debug_output.cc: Likewise.
6836 * reloc.cc: Likewise.
6837 * script-sections.cc: Likewise.
6838 * sparc.cc: Likewise.
6839 * symtab.h: Likewise.
6840 * target-reloc.h: Likewise.
6841 * target.cc: Likewise.
6842 * target.h: Likewise.
6843 * timer.cc: Likewise.
6844 * timer.h: Likewise.
6845 * x86_64.cc: Likewise.
6846
83e17bd5
CC
68472010-12-09 Cary Coutant <ccoutant@google.com>
6848
6849 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6850 stack.
6851 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6852 parameter; change all callers.
6853 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6854 * options.h (warn_execstack): New option.
6855
017257f8
DK
68562010-12-07 Doug Kwan <dougkwan@google.com>
6857
6858 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6859 like function call relocations.
6860
c20cbc06
ILT
68612010-12-07 Ian Lance Taylor <iant@google.com>
6862
6863 * archive.cc (Archive::get_elf_object_for_member): Permit
6864 punconfigured to be NULL.
6865 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6866 (Archive::include_member): Pass NULL to get_elf_object_for_member
6867 if we searched for the archive and this is the first included
6868 object.
6869
4dbfafcc
ILT
68702010-12-01 Ian Lance Taylor <iant@google.com>
6871
6872 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6873 track_relocs_type_ field.
6874 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6875 Set track_relocs_type_.
6876 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6877 contents when using RELA relocs.
6878 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6879 reloc_map_.
6880 * reloc.cc (Track_relocs::next_addend): New function.
6881 * reloc.h (class Track_relocs): Declare next_addend.
6882
e5e19edd
ILT
68832010-12-01 Ian Lance Taylor <iant@google.com>
6884
6885 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6886 virtual destructor.
6887
9a5ce24c
ILT
68882010-12-01 Ian Lance Taylor <iant@google.com>
6889
6890 * README: Update compilers known to work and fail.
6891
c7791212
NC
68922010-11-23 Matthias Klose <doko@ubuntu.com>
6893
6894 * configure.in: For --enable-gold, handle value `default' instead of
6895 `both*'. Always install ld as ld.bfd, install as ld if gold is
6896 not the default.
6897 * configure: Regenerate.
6898
0ad220c9
DK
68992010-11-18 Doug Kwan <dougkwan@google.com>
6900
6901 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6902 and right_alignment to be zero. Store result alignment only if it is
6903 greater than existing alignment.
6904
ab8056e0
CC
69052010-11-16 Cary Coutant <ccoutant@google.com>
6906
6907 PR gold/12220
6908 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6909 Check for ".zdebug_line".
6910
fd064a5b
CC
69112010-11-16 Doug Kwan <dougkwan@google.com>
6912 Cary Coutant <ccoutant@google.com>
6913
6914 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6915 by reference; adjust all callers.
6916 * output.cc (Output_segment::set_section_addresses): Adjust references
6917 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6918 list is empty.
6919 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6920 end at page boundary.
6921
6fc6ea19
CC
69222010-11-16 Cary Coutant <ccoutant@google.com>
6923
6924 PR gold/12220
6925 * layout.cc (Layout::choose_output_section): Transform names of
6926 compressed sections even when using a script with a SECTIONS clause.
6927 (Layout::output_section_name): Remove code to transform
6928 compressed debug section names.
6929 * output.cc (Output_section::add_input_section): Use uncompressed
6930 section size when tracking input sections.
6931
95a2c8d6
RS
69322010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6933
6934 * symtab.h (Symbol::NON_PIC_REF): Remove.
6935 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6936 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6937 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6938 (Symbol::use_plt_offset): Take a flags argument and pass it
6939 directly to needs_dynamic_reloc. Restrict check for undefined
6940 weak symbols to function calls.
6941 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6942 (Target_arm::Scan::global): Use it.
6943 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6944 (Target_arm::Relocate::relocate): Likewise.
6945 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6946 parameter with an r_type parameter. Use get_reference_flags
6947 to get the flags.
6948 (Target_arm::Relocate::relocate): Update accordingly.
6949 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6950 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6951 (Target_i386::Scan::global): Likewise.
6952 (Target_i386::Relocate::relocate): Likewise.
6953 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6954 parameter with an r_type parameter. Use get_reference_flags
6955 to get the flags.
6956 (Target_i386::Relocate::relocate): Update accordingly.
6957 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6958 (Target_powerpc::Scan::global): Use it.
6959 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6960 (Target_powerpc::Relocate::relocate): Likewise.
6961 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6962 (Target_sparc::Scan::global): Use it.
6963 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6964 (Target_sparc::Relocate::relocate): Likewise.
6965 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6966 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6967 (Target_x86_64::Scan::global): Likewise.
6968 (Target_x86_64::Relocate::relocate): Likewise.
6969
f625ae50
DK
69702010-11-08 Doug Kwan <dougkwan@google.com>
6971 Cary Coutant <ccoutant@google.com>
6972
6973 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6974 (Arm_exidx_merge_section::section_contents_): New data member.
6975 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6976 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6977 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6978 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6979 in parameters instead of calling Object::section_contents without
6980 locking.
6981 (Arm_output_section::group_section): New parameter TASK. Pass it
6982 to callees that need locking objects.
6983 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6984 to lock EXIDX input sections. Fix a formatting issue. Call
6985 Arm_exidx_merged_section::build_contents to create merged section
6986 contents.
6987 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6988 to lock object of stub table owner.
6989 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6990 TEXT_SIZE to initialize data member TEXT_SIZE_.
6991 (Arm_exidx_input_section::addralign): Fix typo in comment.
6992 (Arm_exidx_input_section::text_size): New method.
6993 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6994 that require locking objects. Lock objects before scanning for stubs
6995 and updating local symbols.
6996 (Arm_input_section<big_endian>::init): Copy contents of original
6997 input section.
2e702c99 6998 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6999 original input section instead of calling Object::section_contents
7000 without locking.
7001 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7002 size without calling Object::section_size().
7003 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7004 for size. Allocate a buffer for merged EXIDX entries.
7005 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7006 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7007 building code to Arm_exidx_merged_section::build_contetns. Write
7008 out contetns in buffer instead of building it on the fly.
7009 (Arm_relobj::make_exidx_input_section): Also pass text section size
7010 to Arm_exidx_input_section constructor.
7011 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7012 (Arm_dynobj::do_read_symbols): Fix memory leak.
7013 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7014 * target.h: (class Task): Add forward declaration.
7015 (Target::relax): Add new parameter TASK and pass it to
7016 Target::do_relax().
7017 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7018
5f9bcf58
CC
70192010-11-05 Cary Coutant <ccoutant@google.com>
7020
7021 PR gold/10708
7022 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7023 object when reading from the file.
7024 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7025 second layout pass.
7026 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7027 when reading section contents.
7028 (get_section_contents): Likewise.
7029 (icf::find_identical_sections): Likewise.
7030 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7031 object when reading from the file.
7032 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7033 the object when doing deferred section layout.
7034
e597fa08
NC
70352010-11-03 Nick Clifton <nickc@redhat.com>
7036
7037 PR gold/12001
7038 * script.h (class Symbol_assignment: name): New member. Returns
7039 the name of the symbol.
7040 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7041 Returns true if the given symbol name is on the list of
7042 assignments wating to be processed.
7043 * archive.cc (should_incldue_member): If the symbol is undefined,
7044 check to see if it is on the list of symbols pending assignment.
7045
3f9a3278
ILT
70462010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7047
7048 * script-sections.cc (Script_sections::find_memory_region): Check
7049 for a NULL output section pointer.
7050
d06fb4d1
DK
70512010-10-29 Doug Kwan <dougkwan@google.com>
7052
7053 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7054 Output_section::add_relaxed_input_section.
7055 * output.cc (Output_section::add_relaxed_input_section): Add new
7056 arguments LAYOUT and NAME. Set section order index.
7057 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7058 Copy section order index.
7059 * output.h (Output_section::add_relaxed_input_section): Add new
7060 arguments LAYOUT and NAME.
7061
90e24de5
ILT
70622010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7063
7064 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7065 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7066 * testsuite/Makefile.in: Regenerate.
7067
c9484ea5
DK
70682010-10-20 Doug Kwan <dougkwan@google.com>
7069
7070 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7071 without SHF_LINK_ORDER flags.
7072 * layout.cc (Layout::choose_output_section): Do not filter
7073 SHF_LINK_ORDER flag in a relocatable link.
7074
5bc2f5be
CC
70752010-10-17 Cary Coutant <ccoutant@google.com>
7076
7077 * output.h (Output_segment::set_section_addresses): Change function
7078 signature. Update all callers.
7079 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7080 sections.
7081 (Output_segment::set_section_addresses): Align after last TLS
7082 section. Add padding before last relro section instead of after.
7083
0c91cf04
DK
70842010-10-17 Doug Kwan <dougkwan@google.com>
7085
7086 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7087 GOT output section to be writable.
7088
8c21d9d3
CC
70892010-10-14 Cary Coutant <ccoutant@google.com>
7090
7091 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7092 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7093 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7094 mode.
7095 * incremental.cc (report_command_line): Ignore all forms of
7096 --incremental.
7097 * layout.cc (Layout::Layout): Check parameters for incremental link
7098 mode.
7099 * options.cc (General_options::parse_incremental): New function.
7100 (General_options::parse_no_incremental): New function.
7101 (General_options::parse_incremental_full): New function.
7102 (General_options::parse_incremental_update): New function.
7103 (General_options::incremental_mode_): New data member.
7104 (General_options::finalize): Check incremental_mode_.
7105 * options.h (General_options): Update help text for --incremental.
7106 Add --no-incremental, --incremental-full, --incremental-update.
7107 (General_options::Incremental_mode): New enum type.
7108 (General_options::incremental_mode): New function.
7109 (General_options::incremental_mode_): New data member.
7110 * parameters.cc (Parameters::incremental_mode_): New data member.
7111 (Parameters::set_options): Set incremental_mode_.
7112 (Parameters::set_incremental_full): New function.
7113 (Parameters::incremental): New function.
7114 (Parameters::incremental_update): New function.
7115 (set_parameters_incremental_full): New function.
7116 * parameters.h (Parameters::set_incremental_full): New function.
7117 (Parameters::incremental): New function.
7118 (Parameters::incremental_update): New function.
7119 (Parameters::incremental_mode_): New data member.
7120 (set_parameters_incremental_full): New function.
7121 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7122 incremental link mode.
7123 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7124 (Sized_relobj::do_relocate_sections): Likewise.
7125 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7126 option.
7127 * testsuite/Makefile.in: Regenerate.
7128 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7129
bb32aa18 71302010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7131
7132 * script-sections.h (class Script_sections): Make
7133 Sections_elements typedef public.
7134 * script-sections.cc (class Sort_output_sections): Add elements_
7135 field. Add constructor which sets it; change all callers.
7136 (Sort_output_sections::is_before): New function.
7137 (Sort_output_sections::operator()): Call is_before.
7138 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7139 conditional.
7140 * testsuite/script_test_10.sh: New test. Test script section
7141 order.
7142 * testsuite/script_test_10.t: Likewise.
7143 * testsuite/script_test_10.s: Likewise.
7144 * testsuite/Makefile.am: Wrap the cross linker tests and the
7145 common tests into NATIVE_OR_CROSS_LINKER.
7146 (check_SCRIPTS): Add script_test_10.sh.
7147 (check_DATA): Add script_test_10.stdout.
7148 (script_test_10.o, script_test_10): New targets.
7149 (script_test_10.stdout): New target.
7150 * configure, testsuite/Makefile.in: Regenerate.
7151
3cef7179
ILT
71522010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7153
7154 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7155 error for the deprecated relocations.
7156 (Target_arm::Scan::global): Likewise.
7157 (Target_arm::Relocate::relocate): Likewise.
7158
7411e9a8
RS
71592010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7160
7161 * fileread.cc (Input_file::find_file): Initialize *found_name
7162 and *namep when using the fallback search for case 4.
7163
6a9da32a
CC
71642010-10-11 Cary Coutant <ccoutant@google.com>
7165
7166 * options.h (class General_options): Redefine -z lazy as an alias for
7167 the negation of -z now.
7168
ac897c20
ILT
71692010-10-11 Ian Lance Taylor <iant@google.com>
7170
7171 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7172 binding.
7173
ea5cae92
NC
71742010-10-06 Nick Clifton <nickc@redhat.com>
7175
7176 * script-sections.cc(class Memory_region): Remove
7177 current_lma_offset_ field. Rename current_vma_offset_ to
7178 current_offset_. Add last_section_ field.
7179 (Memory_region::get_current_vma_address): Rename to
7180 get_current_address.
7181 (Memory_region::get_current_lma_address): Delete.
7182 (Memory_region::increment_vma_offset): Rename to
7183 increment_offset.
7184 (Memory_region::increment_lma_offset): Delete.
7185 (Memory_region::attributes_compatible): New method. Returns
7186 true if the provided section is compatible with the region.
7187 (Memory_region::get_last_section): New method. Returns the last
7188 section to use the region.
7189 (Memory_region::set_last_section): New method. Stores the last
7190 section to use the region.
7191 (Script_sections::block_in_region): New method. Returns true if
7192 a block of memory is contained within a region.
7193 (Script_sections::find_memory_region): New method. Locates a
7194 memory region to be used to set a VMA or LMA address.
7195 (Output_section_definition::set_section_addresses): Add code to
7196 check for addresses set by memory regions.
7197 (Output_segment::set_section_addresses): Remove memory region
7198 walking code.
7199 (Script_sections::create_segment): Add a warning if a header
7200 segment is created outside of any region.
7201 * script-sections.h (class Script_sections): Add prototypes for
7202 find_memory_region and block_in_region methods.
7203 * testsuite/memory_test.s: Use .long instead of .word.
7204 * testsuite/memory_test.t: Add some more output sections.
7205 * testsuite/memory_test.sh: Update expected output.
7206
a9bfd952
DK
72072010-10-02 Doug Kwan <dougkwan@google.com>
7208
7209 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7210 defintion to symtab.h
7211 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7212 declaration to defintion.
7213
bacff3ab
NC
72142010-10-01 Nick Clifton <nickc@redhat.com>
7215
7216 * expression.cc (eval): Replace dummy argument with NULL.
7217 (eval_maybe_dot): Check for a NULL result section pointer.
7218 (Symbol_expression::value): Likewise.
7219 (Dot_expression::value): Likewise.
7220 (BINARY_EXPRESSION): Likewise.
7221 (Max_expression::value): Likewise.
7222 (Min_expression::value): Likewise.
7223 (Absolute_expression::value): Likewise.
7224 (Addr_expression::value_from_output_section): Likewise.
7225 (Loaddddr_expression::value_from_output_section): Likewise.
7226 (Segment_start_expression::value): Likewise.
7227 * script-sections.cc
7228 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7229 argument with NULL.
7230 (Sections_elememt_dot_assignment::set_section_addresses):
7231 Likewise.
7232 (Output_data_expression::do_write_to_buffer): Likewise.
7233 (Output_section_definition::finalize_symbols): Likewise.
7234 (Output_section_definition::set_section_addresses): Likewise.
7235
f81bc8b5
DK
72362010-09-30 Doug Kwan <dougkwan@google.com>
7237
7238 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7239
c95e9f27
ST
72402010-09-28 Sriraman Tallam <tmsriram@google.com>
7241
7242 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7243 function.
c95e9f27
ST
7244 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7245 virtual function.
7246 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7247 virtual function.
7248 * icf.cc (get_section_contents): Inline merge sections only when
7249 target allows it.
7250
3cac54d2
RW
72512010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7252
7253 * configure: Regenerate.
7254
2904037a
ILT
72552010-09-17 Ian Lance Taylor <iant@google.com>
7256
7257 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7258 * testsuite/Makefile.am (memory_test.o): New target.
7259 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7260 memory_test.t.
7261 * testsuite/Makefile.in: Rebuild.
2904037a 7262
bca7fb63
DK
72632010-09-17 Doug Kwan <dougkwan@google.com>
7264
7265 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7266 defintion if relocation uses GOT entries of the symbol.
7267 * testsuite/icf_safe_test.sh: Fix test.
7268 * testsuite/icf_safe_so_test.sh: Fix test.
7269
4ef28648
CC
72702010-09-16 Cary Coutant <ccoutant@google.com>
7271
7272 * script_sections.cc (class Memory_region): Remove "NULL" from
7273 vector initializations.
7274
793990de
CC
72752010-09-15 Cary Coutant <ccoutant@google.com>
7276
7277 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7278 Resolve forwarding symbols.
7279
81e015e2
DK
72802010-09-15 Doug Kwan <dougkwan@google.com>
7281
7282 * gold/testsuite/script_test_3.t: Add ARM special sections.
7283 * gold/testsuite/script_test_4.t: Same.
7284 * gold/testsuite/script_test_5.t: Same.
7285 * gold/testsuite/script_test_6.t: Same.
7286 * gold/testsuite/script_test_7.t: Same.
7287 * gold/testsuite/script_test_7.t: Same.
7288 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7289
36171d64
CC
72902010-09-14 Cary Coutant <ccoutant@google.com>
7291
7292 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7293 (Target_x86_64::Relocate::relocate_tls): Replace check for
7294 saw_tls_block_reloc_ with test for executable section.
7295
d89051bd
CC
72962010-09-12 Cary Coutant <ccoutant@google.com>
7297
7298 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7299 position-independent executables to shared libraries need dynamic
7300 relocations.
7301 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7302 position-independent executables.
7303 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7304 * testsuite/Makefile.in: Regenerate.
7305
fca41f0f
NC
73062010-09-10 Nick Clifton <nickc@redhat.com>
7307
7308 PR gold/11997
7309 * testsuite/memory_test.t: Discard any sections that are not
7310 needed.
7311
6695e4b3
L
73122010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7313
7314 PR gold/11996
7315 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7316 "This::" to work around a bug in gcc 4.2.
7317
7318 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7319
0f72bf6f
RÁE
73202010-09-09 Rafael Espindola <espindola@google.com>
7321
7322 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7323 sections with different PF_X flags in the same segment.
7324 (Layout::find_first_load_seg): Search all segments to find the first
7325 one.
7326 * options.h (rosegment): New.
7327
73282010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7329
05a79166 7330 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7331
aa98ff75
DK
73322010-09-08 Doug Kwan <dougkwan@google.com>
7333
7334 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7335 (Arm_relobj::do_relocate_sections): Add new parameter for output
7336 file to match the parent.
7337 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7338 of local symbols instead of input values. Update code to track
7339 changes in gold::relocate_section.
7340 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7341 (Sized_relobj::compute_final_local_value_internal): New methods.
7342 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7343 body into private version of Sized_relobj::compute_final_local_value.
7344 Call the inline method.
7345 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7346 merged symbol value if there is one.
7347 (Symbol_value::has_output_value): New method defintiion.
7348 (Sized_relobj::Compute_final_local_value_status): New enum type.
7349 (Sized_relobj::compute_final_local_value): New methods.
7350 (Sized_relobj::compute_final_local_value_internal): New methods.
7351 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7352 and arm_cortex_a8.sh.
7353 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7354 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7355 New tests.
7356 * Makefile.in: Regenerate.
7357 * testsuite/arm_bl_out_of_range.s: Update test.
7358 * testsuite/thumb_bl_out_of_range.s: Ditto.
7359 * testsuite/thumb_blx_out_of_range.s: Ditto.
7360 * testsuite/arm_branch_out_of_range.sh: New file.
7361 * testsuite/arm_cortex_a8.sh: Ditto.
7362 * testsuite/arm_cortex_a8_b.s: Ditto.
7363 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7364 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7365 * testsuite/arm_cortex_a8_bl.s: Ditto.
7366 * testsuite/arm_cortex_a8_blx.s: Ditto.
7367 * testsuite/arm_cortex_a8_local.s: Ditto.
7368 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7369 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7370
05a79166
L
73712010-09-08 Rafael Espindola <espindola@google.com>
7372
7373 * Makefile.am (memory_test.stdout): Run readelf with -W.
7374 * Makefile.in: Regenerate.
7375 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7376 64 bit output.
7377
33dbc701
RÁE
73782010-09-08 Rafael Espindola <espindola@google.com>
7379
7380 * script-sections.cc (Script_sections::add_memory_region): Convert
7381 field precision to int.
7382 * script.cc (script_set_section_region, script_set_section_region):
7383 Convert field precision to int.
7384
731ca54a
RÁE
73852010-09-08 Rafael Espindola <espindola@google.com>
7386
7387 * arm.cc (do_finalize_sections): Create the __exidx_start and
7388 __exdix_end symbols even when the section is missing.
7389
7f8cd844
NC
73902010-09-08 Nick Clifton <nickc@redhat.com>
7391
7392 * README: Remove claim that MEMORY is not supported.
7393 * expression.cc (script_exp_function_origin)
7394 (script_exp_function_length): Move from here to ...
7395 * script.cc: ... here.
7396 (script_set_section_region, script_add_memory)
7397 (script_parse_memory_attr, script_include_directive): New
7398 functions.
7399 * script-sections.cc
7400 (class Memory_region): New class.
7401 (class Output_section_definition): Add set_memory_region,
7402 set_section_vma, set_section_lma and get_section_name methods.
7403 (class Script_Sections): Add add_memory_region,
7404 find_memory_region, find_memory_region_origin,
7405 find_memory_region_length and set_memory_region methods.
7406 Have set_section_addresses method walk the list of set memory
7407 regions.
7408 Extend the print methos to display memory regions.
7409 * script-sections.h: Add prototypes for new methods.
7410 Add enum for MEMORY region attributes.
7411 * yyscript.y: Add support for parsing MEMORY regions.
7412 * script-c.h: Add prototypes for new functions.
7413 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7414 * testsuite/Makefile.in: Regenerate.
7415 * testsuite/memory_test.sh: New script.
7416 * testsuite/memory_test.s: New assembler source file.
7417 * testsuite/memory_test.t: New linker script.
7418
a4649286
DK
74192010-08-27 Doug Kwan <dougkwan@google.com>
7420
7421 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7422 reference override an existing dynamic weak reference.
7423 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7424 * testsuite/Makefile.in: Regenerate.
7425 * testsuite/dyn_weak_ref.sh: New file.
7426 * testsuite/dyn_weak_ref_1.c: Ditto.
7427 * testsuite/dyn_weak_ref_2.c: Ditto.
7428
b56648ad
ILT
74292010-08-27 Ian Lance Taylor <iant@google.com>
7430
7431 * incremental.h (class Incremental_input_entry): Add virtual
7432 destructor.
7433
809313cb
ILT
74342010-08-27 Ian Lance Taylor <iant@google.com>
7435
7436 * testsuite/start_lib_test_3.c: Mark t3 as used.
7437
11e32464
NC
74382010-08-27 Nick Clifton <nickc@redhat.com>
7439
7440 * options.cc (version_script): Fix small typo in previous
7441 whitespace tidyup.
7442
ca09d69a
NC
74432010-08-25 Nick Clifton <nickc@redhat.com>
7444
7445 * archive.cc: Formatting fixes: Remove whitespace between
7446 typename and following asterisk. Remove whitespace between
7447 function name and opening parenthesis.
7448 * archive.h: Likewise.
7449 * arm.cc: Likewise.
7450 * attributes.cc: Likewise.
7451 * attributes.h: Likewise.
7452 * common.cc: Likewise.
7453 * copy-relocs.cc: Likewise.
7454 * dirsearch.h: Likewise.
7455 * dynobj.cc: Likewise.
7456 * ehframe.cc: Likewise.
7457 * ehframe.h: Likewise.
7458 * expression.cc: Likewise.
7459 * fileread.cc: Likewise.
7460 * fileread.h: Likewise.
7461 * gc.h: Likewise.
7462 * gold-threads.cc: Likewise.
7463 * gold.cc: Likewise.
7464 * i386.cc: Likewise.
7465 * icf.h: Likewise.
7466 * incremental-dump.cc: Likewise.
7467 * incremental.cc: Likewise.
7468 * layout.cc: Likewise.
7469 * layout.h: Likewise.
7470 * main.cc: Likewise.
7471 * merge.cc: Likewise.
7472 * merge.h: Likewise.
7473 * object.cc: Likewise.
7474 * object.h: Likewise.
7475 * options.cc: Likewise.
7476 * options.h: Likewise.
7477 * output.cc: Likewise.
7478 * output.h: Likewise.
7479 * plugin.cc: Likewise.
7480 * plugin.h: Likewise.
7481 * powerpc.cc: Likewise.
7482 * reloc.cc: Likewise.
7483 * script-c.h: Likewise.
7484 * script-sections.cc: Likewise.
7485 * script.cc: Likewise.
7486 * stringpool.cc: Likewise.
7487 * symtab.cc: Likewise.
7488 * symtab.h: Likewise.
7489 * target.cc: Likewise.
7490 * timer.cc: Likewise.
7491 * timer.h: Likewise.
7492 * version.cc: Likewise.
7493 * x86_64.cc: Likewise.
7494
b8fa8750
NC
74952010-08-24 Nick Clifton <nickc@redhat.com>
7496
7497 PR 11899
7498 * layout.cc (segment_precedes): Sort segments by their physical
7499 addresses, if they have been set.
7500
9919d93b
CC
75012010-08-23 Cary Coutant <ccoutant@google.com>
7502
7503 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7504 symbols data.
7505 (Lib_group::include_member): Unlock object after deleting its
7506 symbols data.
7507 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7508 the bug fixed here.
7509
97b4be1c
CC
75102010-08-19 Neil Vachharajani <nvachhar@google.com>
7511 Cary Coutant <ccoutant@google.com>
7512
7513 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7514 constructor, and set_blocker.
7515 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7516 readsyms_blocker_.
7517 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7518 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7519 * testsuite/Makefile.am (start_lib_test): New test case.
7520 * testsuite/Makefile.in: Regenerate.
7521 * testsuite/start_lib_test_main.c: New file.
7522 * testsuite/start_lib_test_1.c: New file.
7523 * testsuite/start_lib_test_2.c: New file.
7524 * testsuite/start_lib_test_3.c: New file.
7525
dd0b1884
ILT
75262010-08-19 Ian Lance Taylor <iant@google.com>
7527
7528 * Makefile.in: Rebuild with automake 1.11.1.
7529 * aclocal.m4: Likewise.
7530 * testsuite/Makefile.in: Likewise.
7531
7223e9ca
ILT
75322010-08-19 Ian Lance Taylor <iant@google.com>
7533
7534 PR 10893
7535 * i386.cc (class Output_data_plt_i386): Update declarations.
7536 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7537 local_ifuncs_ fields.
7538 (Target_i386::do_plt_section_for_global): New function.
7539 (Target_i386::do_plt_section_for_local): New function.
7540 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7541 parameter; change all callers. Initialize global_ifuncs_ and
7542 local_ifuncs_. If doing a static link define __rel_iplt_start and
7543 __rel_iplt_end.
7544 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7545 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7546 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7547 symbols.
7548 (Target_i386::make_plt_section): New function, broken out of
7549 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7550 (Target_i386::make_plt_entry): Call make_plt_section.
7551 (Target_i386::make_local_ifunc_plt_entry): New function.
7552 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7553 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7554 R_386_IRELATIVE to switch.
7555 (Target_i386::Scan::global): Likewise.
7556 (Target_i386::Relocate::relocate): Likewise.
7557 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7558 switch.
7559 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7560 (Target_x86_64::do_plt_section_for_global): New function.
7561 (Target_x86_64::do_plt_section_for_local): New function.
7562 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7563 parameter; change all callers. If doing a static link define
7564 __rela_iplt_start and __rela_iplt_end.
7565 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7566 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7567 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7568 to point to .plt.
7569 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7570 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7571 switch.
7572 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7573 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7574 R_X86_64_IRELATIVE to switch.
7575 (Target_x86_64::Scan::global): Likewise.
7576 (Target_x86_64::Relocate::relocate): Likewise.
7577 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7578 switch.
7579 * target.h (class Target): Add plt_section_for_global and
7580 plt_section_for_local functions. Add do_plt_section_for_global
7581 and do_plt_section_for_local virtual functions.
7582 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7583 clarifying comments.
7584 (Symbol::use_plt_offset): Handle IFUNC symbol.
7585 * object.cc (Sized_relobj::Sized_relobj): Initialize
7586 local_plt_offsets_.
7587 (Sized_relobj::local_has_plt_offset): New function.
7588 (Sized_relobj::local_plt_offset): New function.
7589 (Sized_relobj::set_local_plt_offset): New function.
7590 (Sized_relobj::do_count): Handle IFUNC symbol.
7591 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7592 a bit away from input_shndx_ field. Add set_is_func_symbol and
7593 is_ifunc_symbol functions.
7594 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7595 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7596 local_plt_offsets_ field.
7597 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7598 * output.h (class Output_section_data): Add non-const
7599 output_section function.
7600 (class Output_data_got): Update declarations.
7601 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7602 Add use_plt_offset parameter to global and local constructors.
7603 Change all callers. Change local_sym_index_ field to 31 bits.
7604 Change GSYM_CODE and CONSTANT_CODE accordingly.
7605 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7606 doing a static link don't set sh_link field.
7607 (Output_data_got::Got_entry::write): Use PLT offset if
7608 appropriate.
7609 (Output_data_got::add_global_plt): New function.
7610 (Output_data_got::add_local_plt): New function.
7611 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7612 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7613 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7614 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7615 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7616 IFUNC conditional.
7617 * testsuite/ifunc-sel.h: New file.
7618 * testsuite/ifuncmain1.c: New file.
7619 * testsuite/ifuncmain1vis.c: New file.
7620 * testsuite/ifuncmod1.c: New file.
7621 * testsuite/ifuncdep2.c: New file.
7622 * testsuite/ifuncmain2.c: New file.
7623 * testsuite/ifuncmain3.c: New file.
7624 * testsuite/ifuncmod3.c: New file.
7625 * testsuite/ifuncmain4.c: New file.
7626 * testsuite/ifuncmain5.c: New file.
7627 * testsuite/ifuncmod5.c: New file.
7628 * testsuite/ifuncmain6pie.c: New file.
7629 * testsuite/ifuncmod6.c: New file.
7630 * testsuite/ifuncmain7.c: New file.
7631 * configure, testsuite/Makefile.in: Rebuild.
7632
56f75c03
ILT
76332010-08-18 Ian Lance Taylor <iant@google.com>
7634
7635 * incremental.cc
7636 (Output_section_incremental_inputs::write_input_files): Add cast
7637 to avoid signed/unsigned comparison warning.
7638 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7639
55455f89
CC
76402010-08-12 Cary Coutant <ccoutant@google.com>
7641
7642 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7643
e2054bcb
ILT
76442010-08-13 Ian Lance Taylor <iant@google.com>
7645
7646 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7647
74f67560
DK
76482010-08-12 Cary Coutant <ccoutant@google.com>
7649 Doug Kwan <dougkwan@google.com>
7650
7651 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7652 defintion overrides non-weak undef, remember that the original undef
7653 is not weak.
7654 * symtab.cc (Symbol_table::sized_write_global): For undef without
7655 an original weak binding, set binding to global in output.
7656 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7657 * testsuite/Makefile.in: Regenerate.
7658 * testsuite/strong_ref_weak_def.sh: New file.
7659 * testsuite/strong_ref_weak_def_1.c: Ditto.
7660 * testsuite/strong_ref_weak_def_2.c: Ditto.
7661
d1238d12
CC
76622010-08-12 Cary Coutant <ccoutant@google.com>
7663
7664 * testsuite/incremental_test.sh: Rewrite.
7665 * testsuite/incremental_test_1.c: Rewrite.
7666 * testsuite/incremental_test_2.c: Rewrite.
7667
0e70b911
CC
76682010-08-12 Cary Coutant <ccoutant@google.com>
7669
7670 * arm.cc (Target_arm::got_size): Add const.
7671 (Target_arm::got_entry_count): New function.
7672 (Target_arm::plt_entry_count): New function.
7673 (Target_arm::first_plt_entry_offset): New function.
7674 (Target_arm::plt_entry_size): New function.
7675 (Output_data_plt_arm::entry_count): New function.
7676 (Output_data_plt_arm::first_plt_entry_offset): New function.
7677 (Output_data_plt_arm::get_plt_entry_size): New function.
7678 * i386.cc (Target_i386::got_size): Add const.
7679 (Target_i386::got_entry_count): New function.
7680 (Target_i386::plt_entry_count): New function.
7681 (Target_i386::first_plt_entry_offset): New function.
7682 (Target_i386::plt_entry_size): New function.
7683 (Output_data_plt_i386::entry_count): New function.
7684 (Output_data_plt_i386::first_plt_entry_offset): New function.
7685 (Output_data_plt_i386::get_plt_entry_size): New function.
7686 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7687 find_incremental_inputs_sections. Dump incremental_got_plt section.
7688 * incremental.cc: Include target.h.
7689 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7690 parameter. Adjust all callers. Find incremental_got_plt section.
7691 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7692 section.
7693 (Output_section_incremental_inputs::set_final_data_size): Calculate
7694 size of incremental_got_plt section.
7695 (Output_section_incremental_inputs::do_write): Write the
7696 incremental_got_plt section.
7697 (Got_plt_view_info): New struct.
7698 (Local_got_offset_visitor): New class.
7699 (Global_got_offset_visitor): New class.
7700 (Global_symbol_visitor_got_plt): New class.
7701 (Output_section_incremental_inputs::write_got_plt): New function.
7702 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7703 Add parameter. Adjust all callers.
7704 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7705 (Incremental_inputs::got_plt_section): New function.
7706 (Incremental_inputs::got_plt_section_): New data member.
7707 (Incremental_got_plt_reader): New class.
7708 * layout.cc (Layout::create_incremental_info_sections): Add the
7709 incremental_got_plt section.
7710 * object.h (Got_offset_list::get_list): New function.
7711 (Got offset_list::for_all_got_offsets): New function.
7712 (Sized_relobj::local_got_offset_list): New function.
7713 * powerpc.cc (Target_powerpc::got_size): Add const.
7714 (Target_powerpc::got_entry_count): New function.
7715 (Target_powerpc::plt_entry_count): New function.
7716 (Target_powerpc::first_plt_entry_offset): New function.
7717 (Target_powerpc::plt_entry_size): New function.
7718 (Output_data_plt_powerpc::entry_count): New function.
7719 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7720 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7721 * sparc.cc (Target_sparc::got_size): Add const.
7722 (Target_sparc::got_entry_count): New function.
7723 (Target_sparc::plt_entry_count): New function.
7724 (Target_sparc::first_plt_entry_offset): New function.
7725 (Target_sparc::plt_entry_size): New function.
7726 (Output_data_plt_sparc::entry_count): New function.
7727 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7728 (Output_data_plt_sparc::get_plt_entry_size): New function.
7729 * symtab.h (Symbol::got_offset_list): New function.
7730 (Symbol_table::for_all_symbols): New function.
7731 * target.h (Sized_target::got_entry_count): New function.
7732 (Sized_target::plt_entry_count): New function.
7733 (Sized_target::plt_entry_size): New function.
7734 * x86_64.cc (Target_x86_64::got_size): Add const.
7735 (Target_x86_64::got_entry_count): New function.
7736 (Target_x86_64::plt_entry_count): New function.
7737 (Target_x86_64::first_plt_entry_offset): New function.
7738 (Target_x86_64::plt_entry_size): New function.
7739 (Output_data_plt_x86_64::entry_count): New function.
7740 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7741 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7742
09ec0418
CC
77432010-08-12 Cary Coutant <ccoutant@google.com>
7744
7745 * archive.cc: Include incremental.h.
7746 (Archive::Archive): Initialize incremental_info_.
7747 (Archive::include_member): Record archive members in incremental info.
7748 (Add_archive_symbols::run): Record begin and end of an archive in
7749 incremental info.
7750 (Lib_group::include_member): Record objects in incremental info.
7751 * archive.h (Incremental_archive_entry): Forward declaration.
7752 (Archive::set_incremental_info): New member function.
7753 (Archive::incremental_info): New member function.
7754 (Archive::Unused_symbol_iterator): New class.
7755 (Archive::unused_symbols_begin): New member function.
7756 (Archive::unused_symbols_end): New member function.
7757 (Archive::incremental_info_): New data member.
7758 * incremental-dump.cc (find_input_containing_global): New function.
7759 (dump_incremental_inputs): Dump new incremental info sections.
7760 * incremental.cc: Include symtab.h.
7761 (Output_section_incremental_inputs): New class.
7762 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7763 new incremental info sections.
7764 (Sized_incremental_binary::do_check_inputs): Likewise.
7765 (Incremental_inputs::report_archive): Remove.
7766 (Incremental_inputs::report_archive_begin): New function.
7767 (Incremental_inputs::report_archive_end): New function.
7768 (Incremental_inputs::report_object): New function.
7769 (Incremental_inputs::finalize_inputs): Remove.
7770 (Incremental_inputs::report_input_section): New function.
7771 (Incremental_inputs::report_script): Rewrite.
7772 (Incremental_inputs::finalize): Do nothing but finalize string table.
7773 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7774 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7775 (Incremental_inputs::create_data_sections): New function.
7776 (Incremental_inputs::relocs_entsize): New function.
7777 (Output_section_incremental_inputs::set_final_data_size): New function.
7778 (Output_section_incremental_inputs::do_write): New function.
7779 (Output_section_incremental_inputs::write_header): New function.
7780 (Output_section_incremental_inputs::write_input_files): New function.
7781 (Output_section_incremental_inputs::write_info_blocks): New function.
7782 (Output_section_incremental_inputs::write_symtab): New function.
7783 * incremental.h (Incremental_script_entry): Forward declaration.
7784 (Incremental_object_entry): Forward declaration.
7785 (Incremental_archive_entry): Forward declaration.
7786 (Incremental_inputs): Forward declaration.
7787 (Incremental_inputs_header_data): Remove.
7788 (Incremental_inputs_header): Remove.
7789 (Incremental_inputs_header_write): Remove.
7790 (Incremental_inputs_entry_data): Remove.
7791 (Incremental_inputs_entry): Remove.
7792 (Incremental_inputs_entry_write): Remove.
7793 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7794 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7795 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7796 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7797 Likewise.
7798 (Incremental_input_entry): New class.
7799 (Incremental_script_entry): New class.
7800 (Incremental_object_entry): New class.
7801 (Incremental_archive_entry): New class.
7802 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7803 (Incremental_inputs::report_inputs): Remove.
7804 (Incremental_inputs::report_archive): Remove.
7805 (Incremental_inputs::report_archive_begin): New function.
7806 (Incremental_inputs::report_archive_end): New function.
7807 (Incremental_inputs::report_object): Change prototype.
7808 (Incremental_inputs::report_input_section): New function.
7809 (Incremental_inputs::report_script): Change prototype.
7810 (Incremental_inputs::get_reloc_count): New function.
7811 (Incremental_inputs::set_reloc_count): New function.
7812 (Incremental_inputs::create_data_sections): New function.
7813 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7814 (Incremental_inputs::inputs_section): New function.
7815 (Incremental_inputs::symtab_section): New function.
7816 (Incremental_inputs::relocs_section): New function.
7817 (Incremental_inputs::get_stringpool): Add const.
7818 (Incremental_inputs::command_line): Add const.
7819 (Incremental_inputs::inputs): Remove.
7820 (Incremental_inputs::command_line_key): New function.
7821 (Incremental_inputs::input_file_count): New function.
7822 (Incremental_inputs::input_files): New function.
7823 (Incremental_inputs::relocs_entsize): New function.
7824 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7825 (Incremental_inputs::finalize_inputs): Remove.
7826 (Incremental_inputs::Input_info): Remove.
7827 (Incremental_inputs::lock_): Remove.
7828 (Incremental_inputs::inputs_): Change type.
7829 (Incremental_inputs::inputs_map_): Remove.
7830 (Incremental_inputs::current_object_entry_): New data member.
7831 (Incremental_inputs::inputs_section_): New data member.
7832 (Incremental_inputs::symtab_section_): New data member.
7833 (Incremental_inputs::relocs_section_): New data member.
7834 (Incremental_inputs::reloc_count_): New data member.
7835 (Incremental_inputs_reader): New class.
7836 (Incremental_symtab_reader): New class.
7837 (Incremental_relocs_reader): New class.
7838 * layout.cc (Layout::finalize): Move finalization of incremental info
7839 and creation of incremental info sections to follow finalization of
7840 symbol table. Set offsets for postprocessing sections.
7841 (Layout::create_incremental_info_sections): Call
7842 Incremental_inputs::create_data_sections. Add incremental symtab
7843 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7844 sections to layout after input sections.
7845 * layout.h (struct Timespec): Forward declaration.
7846 (Layout::incremental_inputs): Add const.
7847 (Layout::create_incremental_info_sections): Add parameter.
7848 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7849 * object.cc: Include incremental.h.
7850 (Relobj::finalize_incremental_relocs): New function.
7851 (Sized_relobj::do_layout): Record input sections in incremental info.
7852 * object.h (Object::output_section): New function.
7853 (Object::output_section_offset): Moved from Relobj.
7854 (Object::get_incremental_reloc_base): New function.
7855 (Object::get_incremental_reloc_count): New function.
7856 (Object::do_output_section): New function.
7857 (Object::do_output_section_offset): Moved from Relobj.
7858 (Object::do_get_incremental_reloc_base): New function.
7859 (Object::do_get_incremental_reloc_count): New function.
7860 (Object::Object): Initialize new data members.
7861 (Relobj::output_section): Renamed do_output_section and moved to
7862 protected.
7863 (Relobj::output_section_offset): Moved to Object.
7864 (Relobj::do_get_incremental_reloc_base): New function.
7865 (Relobj::do_get_incremental_reloc_count): New function.
7866 (Relobj::allocate_incremental_reloc_counts): New function.
7867 (Relobj::count_incremental_reloc): New function.
7868 (Relobj::finalize_incremental_relocs): New function.
7869 (Relobj::next_incremental_reloc_index): New function.
7870 (Relobj::reloc_counts_): New data member.
7871 (Relobj::reloc_bases_): New data member.
7872 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7873 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7874 (Sized_relobj::incremental_relocs_scan): New function.
7875 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7876 (Sized_relobj::incremental_relocs_write): New function.
7877 (Sized_relobj::incremental_relocs_write_reltype): New function.
7878 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7879 incremental link.
7880 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7881 archives and object files elsewhere.
7882 (Add_symbols::run): Report object files here.
7883 (Finish_group::run): Report end of archive at end of group.
7884 * reloc.cc: Include layout.h, incremental.h.
7885 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7886 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7887 (Sized_relobj::incremental_relocs_scan): New function.
7888 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7889 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7890 (Sized_relobj::incremental_relocs_write): New function.
7891 (Sized_relobj::incremental_relocs_write_reltype): New function.
7892 * script.cc (read_input_script): Rewrite test for incremental link.
7893 Change call to Incremental_inputs::report_script.
7894 * symtab.h (Symbol_table::first_global_index): New function.
7895 (Symbol_table::output_count): New function.
7896
ce0d1972
DK
78972010-08-12 Doug Kwan <dougkwan@google.com>
7898
7899 * arm.cc (Target_arm::merge_object_attributes): Check command line
7900 options --no-wchar-size-warning and --no-enum-size-warning.
7901 * options.h (General_options): Add ld-compatible options
7902 --no-enum-size-warning and --no-wchar-size-warning.
7903
6e5710ce
ILT
79042010-08-04 Ian Lance Taylor <iant@google.com>
7905
7906 * x86_64.cc (Target_x86_64::Scan::local): Use
7907 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7908 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7909 (Target_x86_64::Scan::global): Likewise.
7910 (Target_x86_64::Relocate::relocate): Likewise.
7911 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7912 Likewise.
7913
fef830db
CC
79142010-08-03 Cary Coutant <ccoutant@google.com>
7915
7916 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7917 to reserve space in merged_strings vector. Keep total input size
7918 for stats.
7919 (Output_merge_string::do_print_merge_stats): Print total input size.
7920 * merge.h (Output_merge_string): Add input_size_ field.
7921 * stringpool.cc (Stringpool_template::string_length): Move
7922 implementations out of Stringpool_template class and place in
7923 stringpool.h.
7924 * stringpool.h (string_length): Move out of Stringpool_template.
7925
1e3811b0
ILT
79262010-08-03 Ian Lance Taylor <iant@google.com>
7927
7928 PR 11712
7929 * layout.cc (relaxation_loop_body): If address of load segment is
7930 set, adjust address to include headers if possible.
7931
7af0c620
ILT
79322010-08-03 Ian Lance Taylor <iant@google.com>
7933
7934 * version.cc (version_string): Bump to 1.10.
7935
22f0da72
ILT
79362010-08-03 Ian Lance Taylor <iant@google.com>
7937
7938 PR 11805
7939 * layout.h (enum Output_section_order): Define.
7940 (class Layout): Update declarations.
7941 * layout.cc (Layout::get_output_section): Add order parameter.
7942 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7943 is_first_non_relro parameters. Change all callers.
7944 (Layout::choose_output_section): Likewise.
7945 (Layout::add_output_section_data): Likewise.
7946 (Layout::make_output_section): Likewise. Set order.
7947 (Layout::default_section_order): New function.
7948 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7949 * output.cc (Output_section::Output_section): Initialize order_.
7950 Don't initialize deleted fields.
7951 (Output_segment::Output_segment): Don't initialize deleted
7952 fields.
7953 (Output_segment::add_output_section_to_load): New function
7954 replacing add_output_section. Change all callers to call this or
7955 add_output_section_to_nonload.
7956 (Output_segment::add_output_section_to_nonload): New function.
7957 (Output_segment::remove_output_section): Rewrite.
7958 (Output_segment::add_initial_output_data): Likewise.
7959 (Output_segment::has_any_data_sections): Likewise.
7960 (Output_segment::is_first_section_relro): Likewise.
7961 (Output_segment::maximum_alignment): Likewise.
7962 (Output_segment::has_dynamic_reloc): New function replacing
7963 dynamic_reloc_count. Change all callers.
7964 (Output_segment::has_dynamic_reloc_list): New function replacing
7965 dynamic_reloc_count_list. Change all callers.
7966 (Output_segment::set_section_addresses): Rewrite.
7967 (Output_segment::set_offset): Rewrite.
7968 (Output_segment::find_first_and_last_list): Remove.
7969 (Output_segment::set_tls_offsets): Rewrite.
7970 (Output_segment::first_section_load_address): Likewise.
7971 (Output_segment::output_section_count): Likewise.
7972 (Output_segment::section_with_lowest_load_address): Likewise.
7973 (Output_segment::write_section_headers): Likewise.
7974 (Output_segment::print_sections_to_map): Likewise.
7975 * output.h (class Output_data): Remove dynamic_reloc_count_
7976 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7977 (Output_data::add_dynamic_reloc): Rewrite.
7978 (Output_data::has_dynamic_reloc): New function.
7979 (Output_data::dynamic_reloc_count): Remove.
7980 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7981 is_last_relro_, is_first_non_relro_, is_interp_,
7982 is_dynamic_linker_section_ fields. Add order and set_order
7983 functions. Remove is_relro_local, set_is_relro_local,
7984 is_last_relro, set_is_last_relro, is_first_non_relro,
7985 set_is_first_non_relro functions, is_interp, set_is_interp,
7986 is_dynamic_linker_section, and set_is_dynamic_linker_section
7987 functions.
7988 (class Output_segment): Change Output_data_list from std::list to
7989 std:;vector. Add output_lists_ field. Remove output_data_ and
7990 output_bss_ fields. Update declarations.
7991
3ff2ccb0
ILT
79922010-08-02 Ian Lance Taylor <iant@google.com>
7993
7994 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7995 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7996 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7997
88a4108b
ILT
79982010-08-02 Ian Lance Taylor <iant@google.com>
7999
8000 PR 11855
8001 * script.cc (Script_options::Script_options): Initialize
8002 symbol_definitions_ and symbol_references_.
8003 (Script_options::add_symbol_assignment): Update
8004 symbol_definitions_ and symbol_references_.
8005 (Script_options::add_symbol_reference): New function.
8006 (script_symbol): New function.
8007 * script.h (class Script_options): Add symbol_definitions_ and
8008 symbol_references_ fields.
8009 (Script_options::referenced_const_iterator): New type.
8010 (Script_options::referenced_begin): New function.
8011 (Script_options::referenced_end): New function.
8012 (Script_options::is_referenced): New function.
8013 (Script_options::any_unreferenced): New function.
8014 * script-c.h (script_symbol): Declare.
8015 * yyscript.y (exp): Call script_symbol.
8016 * symtab.cc: Include "script.h".
8017 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8018 Change all callers. Check symbols referenced by scripts.
8019 (Symbol_table::add_undefined_symbols_from_command_line): Add
8020 layout parameter. Change all callers.
8021 (Symbol_table::do_add_undefined_symbols_from_command_line):
8022 Likewise. Break out loop body. Check symbols referenced by
8023 scripts.
8024 (Symbol_table::add_undefined_symbol_from_command_line): New
8025 function broken out of
8026 do_add_undefined_symbols_from_command_line.
8027 * symtab.h (class Symbol_table): Update declarations.
8028 * archive.cc: Include "layout.h".
8029 (Archive::should_include_member): Add layout parameter. Change
8030 all callers. Check for symbol mentioned in expression.
8031 * archive.h (class Archive): Update declaration.
8032 * object.cc (Sized_relobj::do_should_include_member): Add layout
8033 parameter.
8034 * object.h (Object::should_include_member): Add layout parameter.
8035 Change all callers.
8036 (Object::do_should_include_member): Add layout parameter.
8037 (class Sized_relobj): Update declaration.
8038 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8039 parameter.
8040 * dynobj.h (class Sized_dynobj): Update declaration.
8041 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8042 layout parameter.
8043 * plugin.h (class Sized_pluginobj): Update declaration.
8044
5f1ab67a
ILT
80452010-08-02 Ian Lance Taylor <iant@google.com>
8046
8047 PR 11866
8048 * output.cc (Output_segment::set_offset): Search for the first and
8049 last sections rather than assuming that the list is in order.
8050 (Output_segment::find_first_and_last_list): New function.
8051 * output.h (class Output_segment): Update declarations.
8052 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8053 (relro_strip_test_SOURCES): New variable.
8054 (relro_strip_test_DEPENDENCIES): New variable.
8055 (relro_strip_test_LDFLAGS): New variable.
8056 (relro_strip_test_LDADD): New variable.
8057 (relro_strip_test.so): New target.
8058
a8df5856
ILT
80592010-08-02 Ian Lance Taylor <iant@google.com>
8060
8061 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8062 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8063 (Target_i386::got_tlsdesc_section): New function.
8064 (Target_i386::got_section): Create space for GOT entries for
8065 TLSDESC relocations.
8066 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8067 R_386_TLS_GOTDESC.
8068 (Target_i386::Scan::global): Likewise.
8069 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8070 using TLSDESC GOT.
8071 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8072 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8073 (Target_x86_64::got_tlsdesc_section): New function.
8074 (Target_x86_64::got_section): Create space for GOT entries for
8075 TLSDESC relocations.
8076 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8077 R_386_TLS_GOTDESC.
8078 (Target_x86_64::Scan::global): Likewise.
8079 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8080 using TLSDESC GOT.
8081
0c10a0a6
ILT
80822010-08-02 Ian Lance Taylor <iant@google.com>
8083
8084 * testsuite/final_layout.sh: Use dc to convert from hex to
8085 decimal.
8086
41cbeecc
ST
80872010-07-29 Sriraman Tallam <tmsriram@google.com>
8088
8089 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8090 paramter to the call to gold::gc_process_relocs.
8091 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8092 paramter to the call to gold::gc_process_relocs.
8093 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8094 parameter to the call to gold::gc_process_relocs.
8095 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8096 template parameter to the call to gold::gc_process_relocs.
8097 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8098 paramter to the call to gold::gc_process_relocs.
8099 * gc.h (get_embedded_addend_size): New function.
8100 (gc_process_relocs): Save the size of the reloc for use by ICF.
8101 * icf.cc (get_section_contents): Get the addend from the text section
8102 for SHT_REL relocation sections.
8103 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8104 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8105 * int_encoding.h (read_from_pointer): New overloaded function.
8106 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8107 * testsuite/icf_sht_rel_addend_test.sh: New file.
8108 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8109 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8110
6ea55b82
RW
81112010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8112
8113 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8114 * Makefile.in: Regenerate.
8115 * testsuite/Makefile.in: Regenerate.
8116
9691462b
ILT
81172010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8118
8119 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8120 * gold/testsuite/debug_msg.cc: Likewise.
8121 * gold/testsuite/odr_violation1.cc
8122 * gold/testsuite/odr_violation2.cc
8123
76897331
CC
81242010-07-21 Cary Coutant <ccoutant@google.com>
8125
8126 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8127 string, and length fields.
8128 (Output_merge_string::Merged_strings_list): New type.
8129 (Output_merge_string::Merged_strings_lists): New typedef.
8130 (Output_merge_string): Replace merged_strings_ with
8131 merged_strings_lists_.
8132 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8133 Merged_strings_list per input object and section. Don't store pointer
8134 to the string. Don't store length with each merged string entry.
8135 (Output_merge_string::finalize_merged_data): Loop over list of merged
8136 strings lists. Recompute length of each merged string.
8137
78384e8f
CC
81382010-07-15 Cary Coutant <ccoutant@google.com>
8139
8140 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8141 here.
8142
783659f9
ILT
81432010-07-14 Ian Lance Taylor <iant@google.com>
8144
8145 * descriptors.cc (Descriptors::open): Report correct name in error
8146 message.
8147
131687b4
DK
81482010-07-13 Doug Kwan <dougkwan@google.com>
8149
8150 * arm.cc (Arm_input_section::Arm_input_section): For a
8151 SHT_ARM_EXIDX section, always keeps the input sections.
8152 (Arm_input_section::set_exidx_section_link): New method.
8153 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8154 has_errors_ to false.
8155 (Arm_exidx_input_section::has_errors,
8156 Arm_exidx_input_section::set_has_errors): New methods.
8157 (Arm_exidx_input_section::has_errors_): New data member.
8158 (Arm_relobj::get_exidx_shndx_list): New method.
8159 (Arm_output_section::append_text_sections_to_list): Do not skip
8160 section without SHF_EXECINSTR.
8161 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8162 errors.
2e702c99 8163 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8164 section header. Make error messages more verbose. Check for
8165 a non-executable section linked to an EXIDX section.
8166 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8167 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8168 check that there is no deferred EXIDX section if we exit early.
8169 Instead of not making an EXIDX section in case of an error, make one
8170 and set the has_errors flag of it.
8171 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8172 in a relocatable link.
8173 (Target_arm::do_relax): Look for the EXIDX output section instead of
8174 assuming that it is called .ARM.exidx.
2e702c99 8175 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8176 section list. Do not check for SHF_EXECINSTR section flags but
8177 skip any input section with errors.
8178 * output.cc (Output_section::Output_section): Initialize
8179 always_keeps_input_sections_ to false.
8180 (Output_section::add_input_section): Check for
8181 always_keeps_input_sections_.
8182 * output.h (Output_section::always_keeps_input_sections,
8183 Output_section::set_always_keeps_input_sections): New methods.
8184 (Output_section::always_keeps_input_sections): New data member.
8185
69517287
RÁE
81862010-07-13 Rafael Espindola <espindola@google.com>
8187
8188 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8189 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8190
82742395
ILT
81912010-07-13 Philip Herron <herron.philip@googlemail.com>
8192 Ian Lance Taylor <iant@google.com>
8193
8194 * output.h (Output_section_lookup_maps::add_merge_section):
8195 Correct check of whether value was inserted.
8196 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8197 (Output_section_lookup_maps::add_relaxed_input_section):
8198 Likewise.
8199 * arm.cc (Target_arm::got_section): Remove used local os.
8200 * i386.cc (Target_i386::got_section): Likewise.
8201 * x86_64.cc (Target_x86_64::got_section): Likewise.
8202 * sparc.cc (Target_sparc::got_section): Likewise.
8203 (Target_sparc::relocate): Remove unused local have_got_offset.
8204 * powerpc.cc (Target_powerpc::relocate): Likewise.
8205
f2d707b5
ILT
82062010-07-13 Ian Lance Taylor <iant@google.com>
8207
241531d6
ILT
8208 * compressed_output.cc (zlib_decompress): Fix signature in
8209 !HAVE_ZLIB_H case.
8210
f2d707b5
ILT
8211 * archive.cc (Archive::include_member): Unlock an external member
8212 of a thin archive. Don't bother to delete an object we know is
8213 NULL.
8214
a2e47362
CC
82152010-07-12 Cary Coutant <ccoutant@google.com>
8216
8217 * compressed_output.cc (zlib_decompress): New function.
8218 (get_uncompressed_size): New function.
8219 (decompress_input_section): New function.
8220 * compressed_output.h (get_uncompressed_size): New function.
8221 (decompress_input_section): New function.
8222 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8223 Handle compressed debug sections.
8224 * layout.cc (is_compressed_debug_section): New function.
8225 (Layout::output_section_name): Map compressed section names to
8226 canonical names.
8227 * layout.h (is_compressed_debug_section): New function.
8228 (is_debug_info_section): Recognize compressed debug sections.
8229 * merge.cc: Include compressed_output.h.
8230 (Output_merge_data::do_add_input_section): Handle compressed
8231 debug sections.
8232 (Output_merge_string::do_add_input_section): Handle compressed
8233 debug sections.
8234 * object.cc: Include compressed_output.h.
8235 (Sized_relobj::Sized_relobj): Initialize new data members.
8236 (build_compressed_section_map): New function.
8237 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8238 * object.h (Object::section_is_compressed): New method.
8239 (Object::do_section_is_compressed): New method.
8240 (Sized_relobj::Compressed_section_map): New type.
8241 (Sized_relobj::do_section_is_compressed): New method.
8242 (Sized_relobj::compressed_sections_): New data member.
8243 * output.cc (Output_section::add_input_section): Handle compressed
8244 debug sections.
8245 * reloc.cc: Include compressed_output.h.
8246 (Sized_relobj::write_sections): Handle compressed debug sections.
8247
ce279a62
CC
82482010-07-08 Cary Coutant <ccoutant@google.com>
8249
8250 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8251 weak when resolving to a dynamic def.
8252 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8253 for weak undef/dynamic def cases. Adjust callers.
8254 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8255 undef_binding_weak_.
8256 (Symbol_table::sized_write_globals): Adjust symbol binding.
8257 (Symbol_table::sized_write_symbol): Add binding parameter.
8258 * symtab.h (Symbol::set_undef_binding): New method.
8259 (Symbol::is_undef_binding_weak): New method.
8260 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8261 (Symbol_table::should_override): Add new parameter.
8262 (Symbol_table::sized_write_symbol): Add new parameter.
8263
8264 * testsuite/weak_undef_file1.cc: Add new test case.
8265 * testsuite/weak_undef_file2.cc: Fix header comment.
8266 * testsuite/weak_undef_test.cc: Add new test case.
8267
b2286c10
DK
82682010-06-29 Doug Kwan <dougkwan@google.com>
8269
8270 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8271 Initialize USE_SYMBOL_.
8272 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8273 definition.
8274 (Arm_reloc_property::uses_symbol_): New data member declaration.
8275 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8276 uses symbol value and symbol is undefined but not weakly undefined.
8277
4802450a
RÁE
82782010-06-28 Rafael Espindola <espindola@google.com>
8279
8280 * plugin.cc (Plugin::load): Use dlerror.
8281
e5ca47ba
ILT
82822010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8283
8284 * symtab.cc (detect_odr_violations): When reporting an ODR
8285 violation, report an object where the symbol is defined.
8286
8a75a161
DK
82872010-06-25 Doug Kwan <dougkwan@google.com>
8288
8289 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8290 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8291 definition.
8292 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8293 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8294 target hook to detect function points.
8295 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8296 * icf.h (Icf::check_section_for_function_pointers): Change type of
8297 parameter SECTION_NAME to const reference to std::string. Use
8298 target hook to determine if section may have unsafe pointers.
8299 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8300 method definition.
8301
42218b9f
RÁE
83022010-06-21 Rafael Espindola <espindola@google.com>
8303
8304 * fileread.cc (Input_file::find_fie): New
8305 (Input_file::open): Use Input_file::find_fie.
8306 * fileread.h (Input_file::find_fie): New
8307 * plugin.cc (set_extra_library_path): New.
8308 (Plugin::load): Add set_extra_library_path to the transfer vector.
8309 (Plugin_manager::set_extra_library_path): New.
8310 (Plugin_manager::add_input_file): Use the extra search path if set.
8311 (set_extra_library_path(): New.
8312 * plugin.h (Plugin_manager): Add set_extra_library_path and
8313 extra_search_path_.
8314
a0506cca
CC
83152010-06-19 Cary Coutant <ccoutant@google.com>
8316
8317 * layout.cc (gdb_sections): Add .debug_types.
8318 (lines_only_debug_sections): Likewise.
8319
6508b958
RÁE
83202010-06-18 Rafael Espindola <espindola@google.com>
8321
8322 * plugin.cc (add_input_file,add_input_library)
8323 (Plugin_manager::add_input_file): Make filename arguments const.
8324 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8325 const.
8326
3e235302
DK
83272010-06-16 Doug Kwan <dougkwan@google.com>
8328
8329 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8330 .ARM.attributes section if we have not merged any input
8331 attributes sections.
8332
106e8a6c
DK
83332010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8334
8335 * arm.cc: Allow combining objects with no EABI version
8336 information.
8337
91ff43fe
RÁE
83382010-06-15 Rafael Espindola <espindola@google.com>
8339
8340 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8341
68ed838c
ILT
83422010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8343
8344 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8345 (struct iovec): Correct !HAVE_READV definition.
8346
f3a2388f
CC
83472010-06-10 Cary Coutant <ccoutant@google.com>
8348
8349 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8350 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8351 reloc sections.
8352 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8353
8354 PR 11683
8355 * symtab.h (Symbol::is_placeholder): New member function.
8356 * target-reloc.h (relocate_section): Check for placeholder symbols.
8357
8358 * testsuite/Makefile.am (plugin_test_8): New test.
8359 (plugin_test_9): New test.
8360 * testsuite/Makefile.in: Regenerate.
8361
e1df38aa
NC
83622010-06-09 Nick Clifton <nickc@redhat.com>
8363
8364 * yyscript.y (input_list_element): Allow strings prefixed with
8365 the '-' character. Treat these as libraries.
8366 * script.cc (script_add_library): New function. Adds a library
8367 specified by "-l<name>" found in an input script.
8368 * script-c.h: Add prototype for script_add_library.
8369
25bbe950
DK
83702010-06-07 Doug Kwan <dougkwan@google.com>
8371
8372 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8373 Restrict stub-group size to be within long conditional branch
8374 range when working around cortex-A8 erratum.
8375
0f32ea4c
ILT
83762010-06-07 Damien Diederen <dd@crosstwine.com>
8377
8378 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8379 #ifdef typo.
8380
8fe2a369
ST
83812010-06-03 Sriraman Tallam <tmsriram@google.com>
8382
8383 PR gold/11658
8384 * output.cc
8385 (Output_section::Input_section_sort_entry::compare_section_ordering):
8386 Change to return non-zero correctly.
8387 (Output_section::Input_section_sort_section_order_index_compare
8388 ::operator()): Change to fix ambiguity in comparisons.
8389
6e9ba2ca
ST
83902010-06-01 Sriraman Tallam <tmsriram@google.com>
8391
8392 * gold.h (is_wildcard_string): New function.
8393 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8394 (Layout::layout_eh_frame): Ditto.
8395 (Layout::find_section_order_index): New method.
8396 (Layout::read_layout_from_file): New method.
8397 * layout.h (Layout::find_section_order_index): New method.
8398 (Layout::read_layout_from_file): New method.
8399 (Layout::input_section_position_): New private member.
8400 (Layout::input_section_glob_): New private member.
8401 * main.cc (main): Call read_layout_from_file here.
8402 * options.h (--section-ordering-file): New option.
8403 * output.cc (Output_section::input_section_order_specified_): New
8404 member.
8405 (Output_section::Output_section): Initialize new member.
8406 (Output_section::add_input_section): Add new parameter.
8407 Keep input sections when --section-ordering-file is used.
8408 (Output_section::set_final_data_size): Sort input sections when
8409 section ordering file is specified.
8410 (Output_section::Input_section_sort_entry): Add new parameter.
8411 Check sorting type.
8412 (Output_section::Input_section_sort_entry::compare_section_ordering):
8413 New method.
8414 (Output_section::Input_section_sort_compare::operator()): Change to
8415 consider section_order_index.
8416 (Output_section::Input_section_sort_init_fini_compare::operator()):
8417 Change to consider section_order_index.
8418 (Output_section::Input_section_sort_section_order_index_compare
8419 ::operator()): New method.
8420 (Output_section::sort_attached_input_sections): Change to sort
8421 according to section order when specified.
e1df38aa
NC
8422 (Output_section::add_input_section<32, true>): Add new parameter.
8423 (Output_section::add_input_section<64, true>): Add new parameter.
8424 (Output_section::add_input_section<32, false>): Add new parameter.
8425 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8426 * output.h (Output_section::add_input_section): Add new parameter.
8427 (Output_section::input_section_order_specified): New
8428 method.
8429 (Output_section::set_input_section_order_specified): New method.
8430 (Input_section::Input_section): Initialize section_order_index_.
8431 (Input_section::section_order_index): New method.
8432 (Input_section::set_section_order_index): New method.
8433 (Input_section::section_order_index_): New member.
8434 (Input_section::Input_section_sort_section_order_index_compare): New
8435 struct.
8436 (Output_section::input_section_order_specified_): New member.
8437 * script-sections.cc (is_wildcard_string): Delete and move modified
8438 method to gold.h.
8439 (Output_section_element_input::Output_section_element_input): Modify
8440 call to is_wildcard_string.
8441 (Output_section_element_input::Input_section_pattern
8442 ::Input_section_pattern): Ditto.
8443 (Output_section_element_input::Output_section_element_input): Ditto.
8444 * testsuite/Makefile.am (final_layout): New test case.
8445 * testsuite/Makefile.in: Regenerate.
8446 * testsuite/final_layout.cc: New file.
8447 * testsuite/final_layout.sh: New file.
8448
3537c84b
RÁE
84492010-06-01 Rafael Espindola <espindola@google.com>
8450
8451 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8452
105b6afd
RÁE
84532010-06-01 Rafael Espindola <espindola@google.com>
8454
8455 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8456 visibility of symbols.
8457
29e11421
DK
84582010-05-27 Doug Kwan <dougkwan@google.com>
8459
8460 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8461 from start of output section instead of address for a local symbol
8462 in a merged or relaxed section when doing a relocatable link.
8463
5e0f337e
RÁE
84642010-05-26 Rafael Espindola <espindola@google.com>
8465
703d02da 8466 PR 11604
5e0f337e
RÁE
8467 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8468 adding sections the garbage collector removed.
8469 * gold/testsuite/Makefile.am: Add test.
8470 * gold/testsuite/Makefile.in: Regenerate.
8471 * gold/testsuite/plugin_test_7.sh: New.
8472 * gold/testsuite/plugin_test_7_1.c: New.
8473 * gold/testsuite/plugin_test_7_2.c: New.
8474
f4187277
RÁE
84752010-05-26 Rafael Espindola <espindola@google.com>
8476
8477 * script-sections.cc (Output_section_definition::set_section_addresses):
8478 Check for --section-start.
8479
5c388529
DK
84802010-05-26 Doug Kwan <dougkwan@google.com>
8481
8482 * arm.cc (Arm_scan_relocatable_relocs): New class.
8483 (Target_arm::relocate_special_relocatable): New method.
8484 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8485 (Arm_relocate_functions::thumb_branch_common): Same.
8486 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8487 instead of Default_scan_relocatable_relocs.
8488 * target-reloc.h (relocate_for_relocatable): Let target handle
8489 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8490 * target.h (Sized_target::relocate_special_relocatable): New method.
8491
bca1c3ae
ILT
84922010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8493
8494 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8495
0439c796
DK
84962010-05-23 Doug Kwan <dougkwan@google.com>
8497
8498 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8499 instead of a cast.
8500 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8501 with a direct branch, not a conditional branch, to a stub.
8502 * merge.cc (Output_merge_base::record_input_section): New method
8503 defintion.
8504 (Output_merge_data::do_add_input_section): Record input section if
8505 keeps-input-sections flag is set.
8506 (Output_merge_string::do_add_input_section): Ditto.
8507 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8508 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8509 INPUT_SECTIONS_.
8510 (Output_merge_base::keeps_input_sections,
8511 Output_merge_base::set_keeps_input_sections,
8512 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8513 method definitions.
8514 (Output_merge_base::Input_sections): New type declaration.
8515 (Output_merge_base::input_sections_begin,
8516 Output_merge_base::input_sections_end,
8517 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8518 (Output_merge_base::bool keeps_input_sections_,
8519 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8520 Output_merge_base::input_sections_): New data members.
8521 (Output_merge_data::do_set_keeps_input_sections): New method
8522 defintion.
8523 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8524 * output.cc (Output_section::Input_section::relobj): Move method
8525 defintion from class declaration to here and handle merge sections.
8526 (Output_section::Input_section::shndx): Ditto.
8527 (Output_section::Output_section): Remove initializations of removed
8528 data members and initialize new data member LOOKUP_MAPS_.
8529 (Output_section::add_input_section): Set keeps-input-sections flag
8530 for a newly created merge output section as appropriate. Adjust code
8531 to use Output_section_lookup_maps class.
8532 (Output_section::add_relaxed_input_section): Adjst code for lookup
8533 maps code refactoring.
2e702c99 8534 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8535 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8536 class. If adding input section to a newly created merge output
8537 section fails, remove the new merge section.
8538 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8539 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8540 (Output_section::find_merge_section): Ditto.
0439c796 8541 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8542 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8543 Output_section_lookup_maps class.
8544 (Output_section::get_input_sections): Export merge sections. Adjust
8545 code to use Output_section_lookup_maps class.
8546 (Output_section:::add_script_input_section): Adjust code to use
8547 Output_section_lookup_maps class. Update lookup maps for merge
8548 sections also.
8549 (Output_section::discard_states): Use Output_section_lookup_maps.
8550 (Output_section::restore_states): Same.
8551 * output.h (Merge_section_properties): Move class defintion out of
8552 Output_section.
8553 (Output_section_lookup_maps): New class.
8554 (Output_section::Input_section::is_merge_section): New method
8555 defintion.
8556 (Output_section::Input_section::relobj): Move defintion out of class
8557 defintion. Declare method only.
8558 (Output_section::Input_section::shndx): Ditto.
8559 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8560 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8561 (Output_section::Merge_section_by_properties_map,
8562 Output_section::Output_section_data_by_input_section_map,
8563 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8564 Remove types.
2e702c99 8565 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8566 KEEPS_INPUT_SECTIONS.
8567 (Output_section::build_lookup_maps): New method declaration.
8568 (Output_section::merge_section_map_,
8569 Output_section::merge_section_by_properties_map_,
8570 Output_section::relaxed_input_section_map_,
8571 Output_section::is_relaxed_input_section_map_valid_): Remove data
8572 members.
8573 (Output_section::lookup_maps_): New data member.
8574
76295588
L
85752010-05-21 Doug Kwan <dougkwan@google.com>
8576
8577 PR gold/11619
8578 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8579 avoid a compilation error.
8580
d103a984
RÁE
85812010-05-19 Rafael Espindola <espindola@google.com>
8582
8583 * script-sections.cc (Output_section_definition::allocate_to_segment):
8584 Update the phdrs_list even when the output section is NULL.
8585 * testsuite/Makefile.am: Add test.
8586 * testsuite/Makefile.in: Regenerate.
8587 * testsuite/script_test_9.cc: New.
8588 * testsuite/script_test_9.sh: New.
8589 * testsuite/script_test_9.t: New.
8590
6625d24e
DK
85912010-05-19 Doug Kwan <dougkwan@google.com>
8592
8593 * arm.cc (Arm_input_section::original_size): New method.
8594 (Arm_input_section::do_addralign): Add a cast.
8595 (Arm_input_section::do_output_offset): Remove static cast.
8596 (Arm_input_section::original_addralign,
8597 Arm_input_section::original_size_): Change type to uint32_t.
8598 (Arm_input_section::init): Add safe casts for section alignment
8599 and size.
8600 (Arm_input_section::set_final_data_size): Do not set address and
8601 offset of stub table.
8602 (Arm_output_section::fix_exidx_coverage): Change use of of
8603 Output_section::Simple_input_section to that of
8604 Output_section::Input_section.
8605 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8606 except for the first pass.
8607 * output.cc (Output_section::get_input_sections): Change type of
8608 input_sections to std::list<Input_section>.
8609 (Output_section::add_script_input_section): Rename from
8610 Output_section::add_simple_input_section. Change type of SIS
8611 parameter from Simple_input_section to Input_section.
8612 * output.h (Output_section::Simple_input_section): Remove class.
8613 (Output_section::Input_section): Change class visibility to public.
8614 (Output_section::Input_section::addralign): Use stored alignments
8615 for special input sections if set.
8616 (Output_section::Input_section::set_addralign): New method.
8617 (Output_section::get_input_sections): Change parameter type from
8618 list of Simple_input_section to list of Input_section.
8619 (Output_section::add_script_input_section): Rename from
8620 Output_section::add_simple_input_section. Change first parameter's
8621 type from Simple_input_section to Input_section and remove the
8622 second and third parameters.
8623 * script-sections.cc (Input_section::Input_section_list): Change
8624 type to list of Output_section::Input_section/
8625 (Input_section_info::Input_section_info): Change parameter type of
8626 INPUT_SECTION to Output_section::Input_section.
8627 (Input_section_info::input_section): Change return type.
8628 (Input_section_info::input_section_): Change type to
8629 Output_section::Input_section.
8630 (Output_section_element_input::set_section_addresses): Adjust code
8631 to use Output_section::Input_section instead of
8632 Output_section::Simple_input_section. Adjust code for renaming
8633 of Output_section::add_simple_input_section.
8634 (Orphan_output_section::set_section_addresses): Ditto.
8635
e1e82ea4
RW
86362010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8637
8638 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8639 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8640
91e75c8a
RÁE
86412010-05-18 Rafael Espindola <espindola@google.com>
8642
8643 * options.cc (General_options::finalize): Handle -nostdlib.
8644 * options.h (nostdlib): New option.
8645 * script.cc (script_add_search_dir): Handle -nostdlib.
8646
da59ad79
DK
86472010-05-12 Doug Kwan <dougkwan@google.com>
8648
8649 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8650 attributes section only if there no attributes section after merging.
8651 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8652 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8653 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8654 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8655 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8656 and arm_attr_merge_7.stdout.
8657 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8658 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8659 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8660 arm_attr_merge_7b.o): New rules.
8661 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8662 arm_attr_merge_7
8663 * testsuite/Makefile.in: Regenerate.
8664 * testsuite/arm_attr_merge.sh: New file.
8665 * testsuite/arm_attr_merge_[67][ab].s: Same.
8666
3e01a7fd
NC
86672010-05-05 Nick Clifton <nickc@redhat.com>
8668
8669 * po/es.po: Updated Spanish translation.
8670
7ad2014a
L
86712010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8672
8673 * Makefile.am (install-exec-local): Properly install gold as
8674 default cross linker.
8675 * Makefile.in: Regenerated.
8676
4fda8867
NC
86772010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8678 Nick Clifton <nickc@redhat.com>
8679
8680 * configure.ac (install_as_default): Define and set to false
8681 unless --enable-gold or --enable-gold=both/gold has been
8682 specified.
8683 * configure: Regenerate.
8684
8685 * Makefile.am (install-exec-local): Install the executable as
8686 'ld.gold'. If install_as_default is true then also install it as
8687 'ld'.
8688 * Makefile.in: Regenerated.
8689
bd288ea2
ILT
86902010-04-24 Ian Lance Taylor <iant@google.com>
8691
8692 * layout.cc (Layout::layout_reloc): In relocatable link don't
8693 combine reloc sections for grouped sections.
8694
ef38fd8a
ST
86952010-04-23 Sriraman Tallam <tmsriram@google.com>
8696
8697 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8698 sections that are not ordinary to icf.
8699 * icf.cc (get_section_contents): Handle relocation pointing to section
8700 with no object or shndx information.
8701 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8702 * testsuite/Makefile.in: Regenerate.
8703 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8704 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8705
f6973bdc
ILT
87062010-04-22 Ian Lance Taylor <iant@google.com>
8707
8708 * expression.cc (Expression::Expression_eval_info): Add
8709 result_alignment_pointer field.
8710 (Expression::eval_with_dot): Add result_alignment_pointer
8711 parameter. Change all callers.
8712 (Expression::eval_maybe_dot): Likewise.
8713 (class Binary_expression): Add alignment_pointer parameter to
8714 left_value and right_value. Change all callers.
8715 (BINARY_EXPRESSION): Set result alignment.
8716 (class Trinary_expression): Add alignment_pointer parameter to
8717 arg2_value and arg3_value. Change all callers.
8718 (Trinary_cond::value): Set result alignment.
8719 (Max_expression::value, Min_expression::value): Likewise.
8720 (Align_expression::value): Likewise.
8721 * script-sections.cc (class Sections_element): Add dot_alignment
8722 parameter to set_section_addresses virtual function. Update
8723 instantiations.
8724 (class Output_section_element): Likewise.
8725 (Script_sections::create_segments): Add dot_alignment parameter.
8726 Change all callers.
8727 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8728 (Script_sections::set_phdrs_clause_addresses): Likewise.
8729 * script-sections.h: Update declarations.
8730 * script.h: Update declarations.
8731 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8732 min_p_align.
8733 * testsuite/script_test_3.t: Set large alignment.
8734 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8735 segment has expected alignment.
8736
9c9c98a5
NC
87372010-04-22 Nick Clifton <nickc@redhat.com>
8738
8739 * po/gold.pot: Updated by the Translation project.
8740 * po/vi.po: Updated Vietnamese translation.
8741
2253bfba
L
87422010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8743
8744 * testsuite/Makefile.am (check_PROGRAMS): Add
8745 icf_virtual_function_folding_test.
8746 * testsuite/Makefile.in: Regenerated.
8747
85fdf906
AH
87482010-04-15 Andrew Haley <aph@redhat.com>
8749
8750 * options.h (merge_exidx_entries): New option.
8751 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8752 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8753 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8754 (Target_arm::merge_exidx_entries): New function.
8755 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8756 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8757 to Arm_exidx_fixup constructor.
8758 Add new arg, merge_exidx_entries.
8759 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8760 Arm_output_section::fix_exidx_coverage.
8761
ce97fa81
ST
87622010-04-18 Sriraman Tallam <tmsriram@google.com>
8763
8764 * icf.cc (get_section_contents): Check for preemptible functions.
8765 Ignore addend when appropriate.
8766 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8767 section folded.
8768 (add_from_relobj): Check for section folded.
8769 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8770 * symtab.h (should_add_dynsym_entry): Add new parameter.
8771 * target-reloc.h (scan_relocs): Check for section folded.
8772 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8773 Check reloc types for function pointers in shared objects.
8774 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8775 case.
8776 (icf_preemptible_functions_test): New test case.
8777 (icf_string_merge_test): New test case.
8778 * testsuite.Makefile.in: Regenerate.
8779 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8780 bar_glob. Refactor code.
8781 * testsuite/icf_preemptible_functions_test.cc: New file.
8782 * testsuite/icf_preemptible_functions_test.sh: New file.
8783 * testsuite/icf_string_merge_test.cc: New file.
8784 * testsuite/icf_string_merge_test.sh: New file.
8785 * testsuite/icf_virtual_function_folding_test.cc: New file.
8786 * testsuite/icf_virtual_function_folding_test.sh: New file.
8787
04ceb17c
DK
87882010-04-14 Doug Kwan <dougkwan@google.com>
8789
8790 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8791 for local symbol recounting if we remove a section due to ICF.
8792 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8793 there are no regular objects in input.
8794
153e7da4
DK
87952010-04-13 Doug Kwan <dougkwan@google.com>
8796
8797 * arm.cc (Arm_input_section::set_final_data_size): Compute
8798 accurate final data size instead of using current data size.
8799
4dbd9faf
DK
88002010-04-09 Doug Kwan <dougkwan@google.com>
8801
8802 * layout.cc (Layout::choose_output_section): Handle script section
8803 types.
8804 (Layout::make_output_section_for_script): Add section type parameter.
8805 Handle script section types.
8806 * layout.h (Layout::make_output_section_for_script): Add section
8807 type parameter.
8808 * output.cc (Output_section::Output_section): Initialize data member
8809 is_noload_.
8810 (Output_section::do_reset_address_and_file_offset): Do not set address
8811 to 0 if section is a NOLOAD section.
8812 * output.h (Output_section::is_noload): New method.
8813 (Output_section::set_is_noload): Ditto.
8814 (Output_section::is_noload_): New data member.
8815 * script-c.h (Script_section_type): New enum type.
8816 (struct Parser_output_section_header): Add new file section_type.
8817 * script-sections.cc (Sections_element::output_section_name): Add
8818 parameter for returning script section type.
8819 (Output_section_definition::output_section_name): Ditto.
8820 (Output_section_definition::section_type)P; New method.
8821 (Output_section_definiton::script_section_type_name): Ditto.
8822 (Output_section_definition::script_section_type_): New data member.
8823 (Output_section_definition::Output_section_definition): Initialize
8824 data member Output_section_definition::script_section_type_.
8825 (Output_section_definition::create_sections): Pass script section type
8826 to Layout::make_output_section_for_script.
8827 (Output_section_definition::output_section_name): Return script
8828 section type to caller.
8829 (Output_section_definition::set_section_address): Do not advance
8830 dot value and load address if section type is NOLOAD. Set address
8831 of NOLOAD sections regardless of section flags.
8832 (Output_section_definition::print): Print section type if it is
8833 not SCRIPT_SECTION_TYPE_NONE.
8834 (Output_section_definition::section_type): New method.
8835 (Output_section_definition::script_section_type_name): Ditto.
8836 (Script_sections::output_section_name): Add new parameter
8837 PSECTION_TYPE for returning script section type. Pass it to
8838 section elements. Handle discard sections.
8839 (Sort_output_sections::operator()): Handle NOLOAD sections.
8840 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8841 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8842 returning script section type.
8843 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8844 INFO and NOLOAD.
8845 * yyscript.y (union): Add new field SECTION_TYPE.
8846 (COPY, DSECT, INFO, NOLOAD): New tokens.
8847 (opt_address_and_section_type): Change type to output_section_header.
8848 (section_type): New non-terminal
8849 (section_header): Handle section type.
2253bfba 8850 (opt_address_and_section_type): Return section type value.
4dbd9faf 8851
721ea635
L
88522010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8853
8854 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8855 * testsuite/plugin_common_test_2.c (foo): Likewise.
8856
6bf924b0
DK
88572010-04-08 Doug Kwan <dougkwan@google.com>
8858
8859 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8860 Output_merge_data.
8861 * output.cc (Output_section::add_merge_input_section): Simplify
8862 code and return status of Output_merge_base::add_input_section.
e1df38aa 8863 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8864 returns true.
8865
24af6f92
DK
88662010-04-07 Doug Kwan <dougkwan@google.com>
8867
8868 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8869 if section is marked as containing instructions but has no mapping
8870 symbols.
8871 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8872 correct section index.
8873 (Arm_relobj::find_linked_text_section): Ditto.
8874
00698fc5
CC
88752010-04-07 Cary Coutant <ccoutant@google.com>
8876
8877 * archive.cc (include_member): Destroy Read_symbols_data object before
8878 releasing file.
8879 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8880 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8881 (Read_symbols_data::~Read_symbols_data) New destructor.
8882 (Section_relocs::Section_relocs) New constructor.
8883 (Section_relocs::~Section_relocs) New destructor.
8884 (Read_relocs_data::Read_relocs_data) New constructor.
8885 (Read_relocs_data::~Read_relocs_data) New destructor.
8886 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8887 pointers to NULL after deleting.
8888
7296d933
DK
88892010-04-07 Doug Kwan <dougkwan@google.com>
8890
8891 * arm.cc: Replace "endianity" with "endianness" in comments.
8892 (Arm_exidx_cantunwind): Ditto.
8893 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8894 (Arm_relobj::merge_flags_and_attributes): New method.
8895 (Arm_relobj::merge_flags_and_attributes_): New data member.
8896 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8897 (Arm_relobj::scan_sections_for_stubs): Ditto.
8898 (Arm_relobj::do_read_symbols): Check to see if we really want to
8899 merge processor-specific flags and attributes. Exit early if
8900 an object is empty except for section names and the undefined symbol.
8901 (Target_arm::do_finalize_sections): Move check for ELF format to
8902 Arm_relobj::do_read_symbols. Merge processor specific flags and
8903 attributes from a regular object only when we have determined that
8904 it is aapropriate. Do not create an .ARM.attributes section in
8905 output if there is no regular input object.
8906 (Target_arm::merge_processor_specific_flags): Check
8907 --warn-mismatch before printing any error.
8908 (Target_arm::merge_object_attributes): Ditto.
8909 * gold.cc (queue_middle_tasks): Handle the case in which there is
8910 no regular object in input.
8911 * options.cc (General_options::parse_EB): New method.
8912 (General_options::parse_EL): Same.
8913 (General_options::General_options): Initialize endianness_.
8914 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8915 New options.
8916 (General_options::Endianness): New enum.
8917 (General_options::endianness): New method.
8918 (General_options::endianness_): New data member.
8919 * parameters.cc (Parameters::set_options): Check target endianness.
8920 (Parameters::set_target_once): Ditto.
8921 (Parameters::check_target_endianness): New method.
8922 (parameters_force_valid_target): If either -EL or -EB is specified,
8923 use it to define endianness of default target.
8924 * parameters.h (Parameters::check_target_endianness): New method
8925 declaration.
8926 * target.h (class Target): Change "endianity" to "endianness"
8927 in comments.
8928
efc8d4f2
RW
89292010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8930
8931 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8932 * configure: Regenerate.
8933 * Makefile.in: Regenerate.
8934 * testsuite/Makefile.in: Regenerate.
8935
be234d88
CC
89362010-04-06 Cary Coutant <ccoutant@google.com>
8937
8938 gcc PR lto/42757
8939 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8940 prevailing definitions of common symbols.
8941 * testsuite/plugin_test_6.sh: New test case.
8942 * testsuite/plugin_common_test_1.c: New test case.
8943 * testsuite/plugin_common_test_2.c: New test case.
8944 * testsuite/Makefile.am (plugin_test_6): New test case.
8945 * testsuite/Makefile.in: Regenerate.
8946
bd32c6bd
NC
89472010-04-06 Nick Clifton <nickc@redhat.com>
8948
8949 * po/vi.po: New Vietnamese translation.
8950
323c532f
DK
89512010-03-30 Doug Kwan <dougkwan@google.com>
8952
8953 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8954
4fcd97eb
DK
89552010-03-25 Doug Kwan <dougkwan@google.com>
8956
8957 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8958 to avoid a conversion warning on a 32-bit host.
8959
4ebf39db
ILT
89602010-03-24 Ian Lance Taylor <iant@google.com>
8961
8962 * testsuite/script_test_3.t: Add a TLS segment.
8963 * testsuite/Makefile.am (check_PROGRAMS): Add
8964 tls_phdrs_script_test.
8965 (tls_phdrs_script_test_SOURCES): Define.
8966 (tls_phdrs_script_test_DEPENDENCIES): Define.
8967 (tls_phdrs_script_test_LDFLAGS): Define.
8968 (tls_phdrs_script_test_LDADD): Define.
8969 * testsuite/Makefile.in: Rebuild.
8970
4a599bdd
CC
89712010-03-23 Cary Coutant <ccoutant@google.com>
8972
8973 * fileread.cc (find_or_make_view): Fix comment.
8974
6c93b22c
ILT
89752010-03-23 Ian Lance Taylor <iant@google.com>
8976
8977 * script-sections.cc (class Orphan_section_placement): Define
8978 PLACE_TLS and PLACE_TLS_BSS.
8979 (Orphan_section_placement::Orphan_section_placement): Initialize
8980 new places.
8981 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8982 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8983 (tls_script_test_SOURCES): Define.
8984 (tls_script_test_DEPENDENCIES): Define.
8985 (tls_script_test_LDFLAGS): Define.
8986 (tls_script_test_LDADD): Define.
8987 * testsuite/Makefile.in: Rebuild.
8988
a2c7281b
DK
89892010-03-22 Doug Kwan <dougkwan@google.com>
8990
8991 * arm.cc (Arm_relocate_functions::abs8,
8992 Arm_relocate_functions::abs16): Use correct check for overflow
8993 specified in the ARM ELF specs.
8994 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8995 target of a BLX instruction specially.
8996 (Reloc_stub::stub_type_for_reloc): Ditto.
8997 (Relocate::relocate): Use symbolic names instead of numeric relocation
8998 codes to report error.
8999 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9000 workaround.
9001 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9002 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9003 thumb2_blx_out_of_range.stdout
9004 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9005 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9006 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9007 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9008 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9009 thumb2_blx_in_range, thumb2_blx_in_range.o,
9010 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9011 thumb2_blx_out_of_range.o): New rules.
2e702c99 9012 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9013 thumb2_blx_in_range and thumb2_blx_out_of_range.
9014 * testsuite/Makefile.in: Regenerate.
9015 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9016 * testsuite/thumb_blx_in_range.s: New file.
9017 * testsuite/thumb_blx_out_of_range.s: New file.
9018
b0193076
RÁE
90192010-03-22 Rafael Espindola <espindola@google.com>
9020
9021 * archive.cc (Should_include): Move to archive.h.
9022 (should_include_member): Make it a member of Archive.
9023 (Lib_group): New.
9024 (Add_lib_group_symbols): New.
9025 * archive.h: Include options.h.
9026 (Archive_member): Moved from Archive.
9027 (Should_include): Moved from archive.cc.
9028 (Lib_group): New.
9029 (Add_lib_group_symbols): New.
9030 * dynobj.cc (do_should_include_member): New.
9031 * dynobj.h (do_should_include_member): New.
9032 * gold.cc (queue_initial_tasks): Update call to queue.
9033 * main.cc (main): Print lib group stats.
9034 * object.cc (do_should_include_member): New.
9035 * object.h: Include archive.h.
9036 (Object::should_include_member): New.
9037 (Object::do_should_include_member): New.
9038 (Sized_relobj::do_should_include_member): New.
9039 * options.cc (General_options::parse_start_lib): New.
9040 (General_options::parse_end_lib): New.
9041 (Input_arguments::add_file): Handle lib groups.
9042 (Input_arguments::start_group): Check we are not in a lib.
9043 (Input_arguments::start_lib): New.
9044 (Input_arguments::end_lib): New.
9045 * options.h (General_options): Add start_lib and end_lib.
9046 (Input_argument::lib_): New.
9047 (Input_argument::lib): New.
9048 (Input_argument::is_lib): New.
9049 (Input_file_lib): New.
9050 (Input_arguments::in_lib_): New.
9051 (Input_arguments::in_lib): New.
9052 (Input_arguments::start_lib): New.
9053 (Input_arguments::end_lib_): New.
9054 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9055 in unused members as preempted.
9056 (Sized_pluginobj::do_should_include_member): New.
9057 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9058 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9059 return the blocker.
9060 (Read_symbols::do_whole_lib_group): New.
9061 (Read_symbols::do_lib_group): New.
9062 (Read_symbols::do_read_symbols): Handle lib groups.
9063 (Read_symbols::get_name): Handle lib groups.
9064 * readsyms.h (Read_symbols): Add an archive member pointer.
9065 (Read_symbols::do_whole_lib_group): New.
9066 (Read_symbols::do_lib_group): New.
9067 (Read_symbols::member_): New.
9068 * script.cc (read_input_script): Update call to queue_soon.
9069
d099120c
DK
90702010-03-19 Doug Kwan <dougkwan@google.com>
9071
9072 * arm.cc (Stub_table::Stub_table): Initialize new data members
9073 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9074 (Stub_table::add_reloc_stub): Assign stub offset and update
9075 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9076 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9077 New data members.
2e702c99 9078 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9079 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9080 instead of going over all reloc stubs.
2e702c99 9081 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9082 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9083 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9084 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9085 Stringpool_template::offset_.
9086 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9087 Stringpool_template::offset_ to zero.
9088
1aa37384
DK
90892010-03-15 Doug Kwan <dougkwan@google.com>
9090
9091 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9092 offset_.
9093 (Stringpool_template::new_key_offset): New method.
9094 (Stringpool_template::add_string): Assign offsets when adding new
9095 strings.
9096 (Stringpool_template::set_string_offsets): Do not set string offsets
9097 when not optimizing.
9098 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9099 member size_.
2e702c99
RM
9100 (Chunked_vector::clear): Clear size_.
9101 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9102 (Chunked_vector::size): Return size_.
9103 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9104 (Chunked_vector::size_): New data member.
1aa37384
DK
9105 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9106 (Stringpool_template::new_key_offset): New method declaration.
9107 (Stringpool_template::offset_): New data member.
9108
b672b057
RÁE
91092010-03-15 Rafael Espindola <espindola@google.com>
9110
9111 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9112 Add_symbols' constructor.
9113 * readsyms.h (Add_symbols): Remove the input_group member.
9114
b6848d3c
ILT
91152010-03-10 Ian Lance Taylor <iant@google.com>
9116
9117 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9118 target to ask whether a reference to a symbol requires a stack
9119 split.
9120 * target.h (Target::is_call_to_non_split): New function.
9121 (Target::do_is_call_to_non_split): Declare virtual function.
9122 * target.cc: Include "symtab.h".
9123 (Target::do_is_call_to_non_split): New function.
9124 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9125
a2a5469e
CC
91262010-03-10 Cary Coutant <ccoutant@google.com>
9127
9128 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9129 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9130 (File_read::open[2]): Add whole_file_view_ to list of views.
9131 (File_read::make_view): Remove test of whole_file_view_.
9132 (File_read::find_or_make_view): Create whole_file_view_ if
9133 necessary.
9134 (File_read::clear_views): Replace bool parameter with enum;
9135 adjust all callers. Don't delete views with permanent data;
9136 do delete cached views and views from archives if
9137 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9138 if clearing the corresponding view.
9139 * fileread.h (File_read::Clear_views_mode): New enum.
9140 (File_read::View::is_permanent_view): New method.
9141 (File_read::clear_views): Replace bool parameter
9142 with enum; adjust all callers.
9143 * options.h (General_options): Change keep_files_mapped option;
9144 add map_whole_files.
9145 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9146 releasing the file.
9147 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9148 the file.
9149
8861f32b
DM
91502010-03-10 David S. Miller <davem@davemloft.net>
9151
9152 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9153
d62d0f5f
ST
91542010-03-09 Sriraman Tallam <tmsriram@google.com>
9155
9156 * icf.cc (get_section_contents): Add '@' marker after processing the
9157 merge reloc.
9158
9177756d
DK
91592010-03-08 Doug Kwan <dougkwan@google.com>
9160
9161 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9162 due to a conversion warning.
9163 (Arm_relobj::update_output_local_symbol_count): Check for local
9164 symbol with unset output index.
9165
9e9e071b
ILT
91662010-03-05 Ian Lance Taylor <iant@google.com>
9167
9168 * options.h (class General_options): Add --spare-dynamic-tags.
9169 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9170 --spare-dynamic-tags.
9171
a81ee015
ILT
91722010-03-05 Ian Lance Taylor <iant@google.com>
9173
9174 * incremental.cc: Include "libiberty.h".
9175
44ec90b9
RO
91762010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9177
9178 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9179 function, is_info_ member.
9180 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9181 (Versions::Versions): Update caller.
9182 (Versions::define_base_version): Likewise.
9183 (Versions::add_def): Likewise.
9184
0897ed3b
ST
91852010-03-03 Sriraman Tallam <tmsriram@google.com>
9186
9187 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9188 (Scan::possible_function_pointer_reloc): New function.
9189 (Scan::local_reloc_may_be_function_pointer): Change to call
9190 possible_function_pointer_reloc.
9191 (Scan::global_reloc_may_be_function_pointer): Ditto.
9192 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9193 relocations in ".data.rel.ro._ZTV" section.
9194 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9195 * testsuite/icf_safe_so_test.cc: Ditto.
9196 * testsuite/icf_safe_test.cc: Ditto.
9197 * testsuite/icf_safe_test.sh: Ditto.
9198
d3bbad62
ILT
91992010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9200 Ian Lance Taylor <iant@google.com>
9201
9202 * target-reloc.h (relocate_section): Check the symbol table index
9203 for -1U before setting the local symbol index.
9204 (scan_relocatable_relocs): If copying the relocation, record that
9205 the local symbol is required.
9206 * object.h (Symbol_value::is_output_symtab_index_set): New
9207 function.
9208 (Symbol_value::may_be_discarded_from_output_symtab): New
9209 function.
9210 (Symbol_value::has_output_symtab_entry): New function.
9211 (Symbol_value::needs_output_symtab_entry): Remove.
9212 (Symbol_value::output_symtab_index): Make sure the symbol index is
9213 set.
9214 (Symbol_value::set_output_symtab_index): Make sure the symbol
9215 index is not set. Make sure the new index is valid.
9216 (Symbol_value::set_must_have_output_symtab_entry): New function.
9217 (Symbol_value::has_output_dynsym_entry): New function.
9218 (Symbol_value::set_output_dynsym_index): Make sure the new index
9219 is valid.
9220 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9221 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9222 local symbol if permitted.
9223 (Sized_relobj::do_finalize_local_symbols): Call
9224 is_output_symtab_index_set rather than needs_output_symtab_entry.
9225 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9226 rather than needs_output_symtab_entry. Call
9227 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9228 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9229 is_output_symtab_index_set rather than needs_output_symtab_entry.
9230 * testsuite/discard_locals_relocatable_test.c: New file.
9231 * testsuite/discard_locals_test.sh: Test -r.
9232 * testsuite/Makefile.am (check_DATA): Add
9233 discard_locals_relocatable_test1.syms,
9234 discard_local_relocatable_test2.syms.
9235 (MOSTLYCLEANFILES): Likewise. Also add
9236 discard_locals_relocatable_test1.lout and
9237 discard_locals_relocatable_test2.out.
9238 (discard_locals_relocatable_test1.syms): New target.
9239 (discard_locals_relocatable_test.o): New target.
9240 (discard_locals_relocatable_test1.out): New target.
9241 (discard_locals_relocatable_test2.syms): New target.
9242 (discard_locals_relocatable_test2.out): New target.
9243 (various): Add missing ../ld-new dependencies.
9244 * testsuite/Makefile.in: Rebuild.
9245
7e8ccf26
NC
92462010-03-03 Nick Clifton <nickc@redhat.com>
9247
9248 * po/fi.po: New Finnish translation.
9249
2a0ff005
DK
92502010-03-01 Doug Kwan <dougkwan@google.com>
9251
9252 * layout.cc (Layout::Layout): Force section types of .init_array*,
9253 .preinit_array* and .fini_array* sections.
9254 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9255 Fix check of return value of std::string::find.().
9256 (Output_section::Input_section_sort_compare::operator()): Remove
9257 comment about .init_array.
9258 (Output_section::Input_section_sort_init_fini_compare::operator()):
9259 New method.
9260 (Output_section::sort_attached_input_sections): Handle .init_array
9261 and .fini_array specially.
9262 * output.h (Output_section::Inut_section_sort_compare): Update
9263 comment.
9264 (Output_section::Input_section_sort_init_fini_compare): New struct.
9265
c3e4ae29
DK
92662010-02-26 Doug Kwan <dougkwan@google.com>
9267
9268 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9269 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9270 * testsuite/debug_msg.sh: Avoid matching source line number for
9271 use of global variable undef_int.
9272
2fd9ae7a
DK
92732010-02-26 Doug Kwan <dougkwan@google.com>
9274
9275 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9276 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9277 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9278 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9279 * options.cc (General_options::General_options): Initialize member
9280 fix_v4bx_.
9281 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9282 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9283 and rm_no_fix_v4bx.stdout
9284 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9285 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9286 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9287 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9288 and arm_no_fix_v4bx.
9289 * Makefile.in: Regenerate.
9290 * testsuite/arm_fix_v4bx.s: New file.
9291 * testsuite/arm_fix_v4bx.sh: Ditto.
9292
67ec7d0b
DK
92932010-02-24 Doug Kwan <dougkwan@google.com>
9294
9295 * arm.cc (Target_arm::got_section): Make the .got section the first
9296 non RELRO section in the data segment.
9297 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9298 suffixes of section names.
9299
10165461
DK
93002010-02-24 Doug Kwan <dougkwan@google.com>
9301
9302 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9303 flags and attributes merging if an input file is a binary file.
9304 * fileread.cc (Input_file::open): Record format of original file.
9305 * fileread.h (Input_file::Format): New enum type.
2e702c99 9306 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9307 (Input_file::format): New method definition.
9308 (Input_file::format_):: New data member.
9309
4a54abbb
DK
93102010-02-24 Doug Kwan <dougkwan@google.com>
9311
9312 * arm.cc (Arm_output_data_got): New class.
9313 (ARM_TCB_SIZE): New constant
9314 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9315 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9316 If user uses a script with a SECTIONS clause, issue only a warning
9317 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9318 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9319 garbage collection.
9320 (Target_arm::got_mode_index_entry): Handle static linking.
9321 (Target_arm::Scan::local): Ditto.
9322 (Target_arm::Scan::global): Ditto.
9323 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9324 all incorrectly implemented relocations.
e1df38aa 9325 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9326 Arm_output_section::fix_exidx_coverage.
9327 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9328 from ".ARM.exidx." and ".ARM.extab.".
9329
ca419a6f
ILT
93302010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9331
9332 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9333 section if it does not already exist.
9334 * attributes.cc (Attributes_section_data::Attributes_section_data):
9335 Don't crash if size is zero.
9336
135b9c78
ILT
93372010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9338 Ian Lance Taylor <iant@google.com>
9339
9340 * gold.cc (queue_middle_tasks): If no input files were opened,
9341 exit.
9342 * workqueue.h (Task_function::Task_function): Assert that there is
9343 a blocker.
9344
bb0bfe4f
DK
93452010-02-22 Doug Kwan <dougkwan@google.com>
9346
9347 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9348 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9349 types to avoid warnings due to different uint64_t implementations
9350 on different hosts.
9351
2a2b6d42
DK
93522010-02-21 Doug Kwan <dougkwan@google.com>
9353
9354 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9355 handling of the maximum backward branch offset.
2e702c99 9356 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9357 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9358 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9359 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9360 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9361 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9362 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9363 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9364 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9365 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9366 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9367 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9368 thumb2_bl_out_of_range.o): New rules.
9369 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9370 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9371 thumb2_bl_out_of_range
9372 * testsuite/Makefile.in: Regenerate.
9373 * testsuite/arm_bl_in_range.s: New file.
9374 * testsuite/arm_bl_out_of_range.s: Ditto.
9375 * testsuite/arm_branch_in_range.sh: Ditto.
9376 * testsuite/arm_branch_range.t: Ditto.
9377 * testsuite/thumb2_branch_range.t: Ditto.
9378 * testsuite/thumb_bl_in_range.s: Ditto.
9379 * testsuite/thumb_bl_out_of_range.s: Ditto.
9380 * testsuite/thumb_branch_range.t: Ditto.
9381
b487ad64
ST
93822010-02-20 Sriraman Tallam <tmsriram@google.com>
9383
9384 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9385 Add reloc offset information.
9386 * icf.cc (get_section_contents): Change iterators to point to the new
9387 vectors. Add reloc offset information to the contents.
9388 * icf.h (Icf::Sections_reachable_info): New typedef.
9389 (Icf::Sections_reachable_list): New typedef.
9390 (Icf::Offset_info): New typedef.
9391 (Icf::Reloc_info): New struct typedef.
9392 (Icf::Reloc_info_list): New typedef.
9393 (Icf::symbol_reloc_list): Delete method.
9394 (Icf::addend_reloc_list): Delete method.
9395 (Icf::section_reloc_list): Delete method.
9396 (Icf::reloc_info_list): New method.
9397 (Icf::reloc_info_list_): New member.
9398
f96accdf
DK
93992010-02-19 Doug Kwan <dougkwan@google.com>
9400
9401 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9402 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9403 * arm.cc (Arm_relocation_functions): New forward declaration.
9404 (Target_arm::Target_arm): Initialize new data members
9405 got_mod_index_offset_ and tls_base_symbol_defined_.
9406 (Target_arm::Relocate::relocate_tls): New method.
9407 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9408 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9409 New methods.
2e702c99 9410 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9411 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9412 (Target_arm::got_mod_index_offset_,
9413 Target_arm::tls_base_symbol_defined_): New data members.
9414 (Target_arm::Scan::local, Target::Scan::global,
9415 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9416 relocations.
9417
c8761b9a
DK
94182010-02-18 Doug Kwan <dougkwan@google.com>
9419
9420 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9421 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9422 text section as a parameter becuase some broken tools may not set
9423 the link in section header.
9424 (Target_arm::has_got_section): New method.
9425 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9426 without any mapping symbol as data only. Remove warning.
9427 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9428 link in its section header, try to discover the link by inspecting the
9429 REL31 relocation at the beginning of the section.
9430 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9431 in error message.
9432 (Target_arm::Scan::global): Treat any reference to the symbol
9433 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9434
21bb3914
ST
94352010-02-12 Sriraman Tallam <tmsriram@google.com>
9436
9437 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9438 (Scan::global_reloc_may_be_function_pointer): New function.
9439 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9440 (Scan::global_reloc_may_be_function_pointer): New function.
9441 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9442 (Scan::global_reloc_may_be_function_pointer): New function.
9443 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9444 (Scan::global_reloc_may_be_function_pointer): New function.
9445 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9446 (Scan::global_reloc_may_be_function_pointer): New function.
9447 (Scan::possible_function_pointer_reloc): New function.
9448 (Target_x86_64::can_check_for_function_pointers): New function.
9449 * gc.h (gc_process_relocs): Scan relocation types to determine if
9450 function pointers were taken for targets that support it.
9451 * icf.cc (Icf::find_identical_sections): Include functions for
9452 folding in safe ICF whose pointer is not taken.
9453 * icf.h (Secn_fptr_taken_set): New typedef.
9454 (fptr_section_id_): New member.
9455 (section_has_function_pointers): New function.
9456 (set_section_has_function_pointers): New function.
9457 (check_section_for_function_pointers): New function.
9458 * options.h: Fix comment for safe ICF option.
9459 * target.h (can_check_for_function_pointers): New function.
9460 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9461 Modify icf_safe_test for X86-64.
9462 * testsuite/Makefile.in: Regenerate.
9463 * testsuite/icf_safe_so_test.cc: New file.
9464 * testsuite/icf_safe_so_test.sh: New file.
9465 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9466 (main): Change to take pointer to function kept_func_3.
9467 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9468 folding is done correctly for X86-64.
9469
0da6fa6c
DM
94702010-02-12 David S. Miller <davem@davemloft.net>
9471
9472 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9473 is_symbolless parameter.
9474 (Output_reloc<SHT_REL>::is_symbolless): New.
9475 (Output_reloc<SHT_REL>::is_symbolless_): New.
9476 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9477 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9478 (Output_reloc<SHT_RELA>::is_symbolless): New.
9479 (Output_data_reloc::add_global): Handle is_symbolless.
9480 (Output_data_reloc::add_global_relative): Likewise.
9481 (Output_data_reloc::add_local): Likewise.
9482 (Output_data_reloc::add_local_relative): Likewise.
9483 (Output_data_reloc::add_symbolless_global_addend): New.
9484 (Output_data_reloc::add_symbolless_local_addend): New.
9485 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9486 is_symbolless.
9487 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9488 instead of ->is_relative_
9489 (Output_reloc::write): Likewise.
9490 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9491 (Output_reloc::write_rel): Simplify.
9492
9493 * sparc.cc (Target_sparc::Scan::local): Use
9494 ->add_symbolless_local_addend as needed.
9495 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9496 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9497 based upon relocation offset.
9498
e4782e83
DK
94992010-02-11 Doug Kwan <dougkwan@google.com>
9500
9501 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9502 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9503 beginning of function.
9504 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9505 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9506 parameter is_32bit in calls to should_apply_static_reloc.
9507 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9508 (check_DATA): Add arm_abs_global.stdout.
9509 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9510 arm_abs_global.stdout): New rules.
9511 (MOSTLLYCLEANFILES): Add arm_abs_global
9512 * Makefile.in: Regenerate.
9513 * testsuite/arm_abs_global.s: New file.
9514 * testsuite/arm_abs_global.sh: Ditto.
9515 * testsuite/arm_abs_lib.s: Ditto.
9516
93ceb764
ILT
95172010-02-11 Ian Lance Taylor <iant@google.com>
9518
9519 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9520 Read_relocs task.
9521 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9522 Allocate_commons_task first.
9523 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9524 task, rather than symtab_lock_.
9525 (Gc_process_relocs::~Gc_process_relocs): New function.
9526 (Gc_process_relocs::is_runnable): Check this_blocker_.
9527 (Gc_process_relocs::locks): Use next_blocker_ rather than
9528 blocker_.
9529 (Scan_relocs::~Scan_relocs): New function.
9530 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9531 symtab_lock_.
9532 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9533 next_blocker_.
9534 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9535 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9536 constructor accordingly.
9537 (class Gc_process_relocs): Likewise.
9538 (class Scan_relocs): Likewise.
9539 * common.h (class Allocate_commons_task): Remove symtab_lock_
9540 field, and corresponding constructor parameter.
9541 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9542 symtab_lock_.
9543 (Allocate_commons_task::locks): Likewise.
9544
114dfbe1
ILT
95452010-02-11 Ian Lance Taylor <iant@google.com>
9546
9547 * gold-threads.h (class Once): Define.
9548 (class Initialize_lock): Rewrite as child of Once.
9549 * gold-threads.cc (class Once_initialize): Define.
9550 (once_pointer_control): New static variable.
9551 (once_pointer, once_arg): New static variables.
9552 (c_run_once): New static function.
9553 (Once::Once, Once::run_once, Once::internal_run): New functions.
9554 (class Initialize_lock_once): Remove.
9555 (initialize_lock_control): Remove.
9556 (initialize_lock_pointer): Remove.
9557 (initialize_lock_once): Remove.
9558 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9559 (Initialize_lock::initialize): Rewrite.
9560 (Initialize_lock::do_run_once): New function.
9561 * archive.cc (Archive::interpret_header): Only clear name if it is
9562 not already empty.
9563 * fileread.cc: Include "gold-threads.h"
9564 (file_counts_lock): New static variable.
9565 (file_counts_initialize_lock): Likewise.
9566 (File_read::release): Only increment counts when using --stats.
9567 Use a lock around the increment.
9568 * parameters.cc (class Set_parameters_target_once): Define.
9569 (set_parameters_target_once): New static variable.
9570 (Parameters::Parameters): Move here from parameters.h.
9571 (Parameters::set_target): Rewrite.
9572 (Parameters::set_target_once): New function.
9573 (Parameters::clear_target): Move here and rewrite.
9574 * parameters.h (class Parameters): Update declarations. Add
9575 set_parameters_target_once_ field.
9576 (Parameters::Parameters): Move to parameters.cc.
9577 (Parameters::clear_target): Likewise.
9578 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9579 task.
9580 (Start_group::~Start_group): New function.
9581 (Start_group::is_runnable): New function.
9582 (Start_group::locks, Start_group::run): New functions.
9583 (Finish_group::run): Change saw_undefined to size_t.
9584 * readsyms.h (class Start_group): Define.
9585 (class Finish_group): Change saw_undefined_ field to size_t.
9586 (Finish_group::Finish_group): Remove saw_undefined and
9587 this_blocker parameters. Change all callers.
9588 (Finish_group::set_saw_undefined): New function.
9589 (Finish_group::set_blocker): New function.
9590 * symtab.h (class Symbol_table): Change saw_undefined to return
9591 size_t. Change saw_undefined_ field to size_t.
9592 * target-select.cc (Set_target_once::do_run_once): New function.
9593 (Target_selector::Target_selector): Initialize set_target_once_
9594 field. Don't initialize lock_ and initialize_lock_ fields.
9595 (Target_selector::instantiate_target): Rewrite.
9596 (Target_selector::set_target): New function.
9597 * target-select.h (class Set_target_once): Define.
9598 (class Target_selector): Update declarations. Make
9599 Set_target_once a friend. Remove lock_ and initialize_lock_
9600 fields. Add set_target_once_ field.
9601
fa17a3f4
ILT
96022010-02-10 Ian Lance Taylor <iant@google.com>
9603
9604 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9605 queueing any tasks.
9606 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9607 (queue_middle_tasks): Add all blockers before queueing any tasks.
9608 (queue_final_tasks): Likewise.
9609 * token.h (Task_token::add_blockers): New function.
9610 * object.h (Input_objects::number_of_relobjs): New function.
9611
c7177d31
ILT
96122010-02-10 Ian Lance Taylor <iant@google.com>
9613
5de0e392
ILT
9614 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9615 shared, not if not position independent.
9616 * x86_64.cc (Relocate::relocate_tls): Likewise.
9617 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9618 (tls_pie_pic_test): New target.
9619 * testsuite/Makefile.in: Rebuild.
9620
c7177d31
ILT
9621 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9622 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9623 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9624 * testsuite/Makefile.in: Rebuild.
9625
684b268a
DM
96262010-02-09 David S. Miller <davem@davemloft.net>
9627
9628 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9629 R_SPARC_RELATIVE using ->add_local_relative().
9630 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9631
612a8d3d
DM
9632 * output.h (Output_data_dynamic::add_section_size): New method
9633 that takes two Output_data objects.
9634 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9635 entry param. Handle it in initializers.
9636 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9637 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9638 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9639 arg.
9640 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9641 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9642 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9643 for dynrel_includes_plt.
9644 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9645 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9646 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9647 before .rela.plt
9648 (Target_sparc::do_finalize_sections): Update to pass true for
9649 dynrel_includes_plt.
9650 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9651 output before .rela.plt
9652 (Target_powerpc::do_finalize_sections): Update to pass true for
9653 dynrel_includes_plt when 32-bit.
9654
cb1be87e
DK
96552010-02-08 Doug Kwan <dougkwan@google.com>
9656
9657 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9658 method.
9659 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9660 Arm_relobj::scan_section_for_cortex_a8_stubs,
9661 Arm_relobj::do_relocation_section): Instead of calling
9662 Output_section::output_address, use faster
9663 Arm_relobj::simple_input_section_output_address.
9664
705b5121
DM
96652010-02-08 David S. Miller <davem@davemloft.net>
9666
9667 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9668 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9669 relocation helper function.
9670
024c4466
DM
9671 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9672 just like R_SPARC_GOT{10,13,22}.
9673 (Target_sparc::Scan::local): Likewise.
9674 (Target_sparc::Relocate:relocate): Likewise.
9675
9109c078
ILT
96762010-02-06 Ian Lance Taylor <iant@google.com>
9677
9678 * configure.ac: Rewrite targetobjs duplicate removal code to use
9679 only shell constructs.
9680 * configure: Rebuild.
9681
cf846138
DK
96822010-02-05 Doug Kwan <dougkwan@google.com>
9683
9684 PR 11247
9685 * arm.cc (Arm_relobj::section_is_scannable): New method.
9686 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9687 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9688
6cfaf60b
DK
96892010-02-04 Doug Kwan <dougkwan@google.com>
9690
9691 PR 11247
9692 * arm-reloc-property.cc (cstdio): Include.
9693 * configure.ac (targetobjs): Remove duplicates.
9694 * configure: Regenerate.
9695 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9696 big and little endian version for a given address size.
9697
5c57f1be
DK
96982010-02-03 Doug Kwan <dougkwan@google.com>
9699
9700 * arm-reloc-property.cc
9701 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9702 definition.
9703 * arm-reloc-property.h
9704 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9705 New method definition.
9706 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9707 declaration.
9708 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9709 overflow to N.
9710 (GOT_PREL): Change implemented to Y.
9711 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9712 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9713 (Arm_relocate_functions::movw_abs_nc): Remove method.
9714 (Arm_relocate_functions::movt_abs): Ditto.
9715 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9716 (Arm_relocate_functions::thm_movt_abs): Ditto.
9717 (Arm_relocate_functions::movw_rel_nc): Ditto.
9718 (Arm_relocate_functions::movw_rel): Ditto.
9719 (Arm_relocate_functions::movt_rel): Ditto.
9720 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9721 (Arm_relocate_functions:thm_movw_rel): Ditto.
9722 (Arm_relocate_functions:thm_movt_rel): Ditto.
9723 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9724 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9725 New method definitions.
9726 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9727 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9728 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9729 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9730 (Target_arm::Relocate::relocate): Check for non-static or
9731 unimplemented relocation code and exit early. Change calls to
9732 Target_arm::reloc_uses_thumb_bit and
9733 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9734 instead. Refactor code to handle similar relocations to increase
9735 code sharing. Remove check for unsupported relocation code in switch
9736 statement.
9737 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9738 relocation property table to find out size. Change error message to
9739 print out the name of a relocation code instead of the numeric value.
9740 (Target_arm::scan_reloc_for_stub): Use relocation property table
9741 instead of calling Target_arm::reloc_uses_thumb_bit().
9742
218c5831
DK
97432010-02-02 Doug Kwan <dougkwan@google.com>
9744
9745 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9746 types of relaxed input section.
9747
0d31c79d
DK
97482010-02-02 Doug Kwan <dougkwan@google.com>
9749
9750 * Makefile.am (HFILES): Add arm-reloc-property.h.
9751 (DEFFILES): New.
2e702c99
RM
9752 (TARGETSOURCES): Add arm-reloc-property.cc
9753 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9754 (libgold_a_SOURCES): $(DEFFILES)
9755 * Makefile.in: Regenerate.
9756 * arm-reloc-property.cc: New file.
9757 * arm-reloc-property.h: New file.
9758 * arm-reloc.def: New file.
9759 * arm.cc: Update comments.
9760 (arm-reloc-property.h): New included header.
9761 (arm_reloc_property_table): New global variable.
9762 (Target_arm::do_select_as_default_target): New method definition.
9763 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9764 arm-reloc-property to targ_extra_obj.
9765 * parameters.cc (set_parameters_target): Call
9766 Target::select_as_default_target().
9767 * target.h (Target::select_as_default_target): New method definition.
9768 (Target::do_select_as_default_target): Same.
9769
546c7457
DK
97702010-02-01 Doug Kwan <dougkwan@google.com>
9771
9772 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9773 first_output_text_section_.
9774 (Arm_exidx_fixup::first_output_text_section): New method definition.
9775 (Arm_exidx_fixup::first_output_text_section_): New data member.
9776 (Arm_exidx_fixup::process_exidx_section): Record the first text
9777 output section seen.
9778 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9779 and entsize in output section header.
9780
11b861d5
DK
97812010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9782
9783 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9784 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9785 (Arm_relocate_functions::thm_alu11): New Method.
9786 (Arm_relocate_functions::thm_pc8): New Method.
9787 (Arm_relocate_functions::thm_pc12): New Method.
9788 (Target_arm::Scan::local): Handle the relocations.
9789 (Target_arm::Scan::global): Likewise.
9790 (Target_arm::Relocate::relocate): Likewise.
9791 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9792
c9a2c125
DK
97932010-01-29 Doug Kwan <dougkwan@google.com>
9794
9795 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9796 of relocation types as ld.
9797
1521477a
DK
97982010-01-29 Doug Kwan <dougkwan@google.com>
9799
9800 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9801 to public.
9802 (Arm_relocate_functions::thumb_branch_common): Ditto.
9803 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9804 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9805 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9806 Arm_relocate_functions::jump24): Remove.
9807 (Target_arm::Relocate::relocate): Adjust code to call
9808 Arm_relocation_functions::arm_branch_common and
9809 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9810 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9811
e7eca48c
DK
98122010-01-29 Doug Kwan <dougkwan@google.com>
9813
9814 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9815 output_local_symbol_count_needs_update_.
9816 (Arm_relobj::output_local_symbol_count_needs_update,
9817 Arm_relobj::set_output_local_symbol_count_needs_update,
9818 Arm_relobj::update_output_local_symbol_count): New methods.
9819 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9820 member.
9821 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9822 of pointed function as in a R_ARM_PREL31 relocation.
9823 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9824 for output local symbol count updating.
9825 (Target_arm::do_relax): Update output local symbol counts in objects
9826 if necessary.
9827 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9828
02961d7e
ILT
98292010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9830
9831 * arm.cc: Added support for the ARM relocations:
9832 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9833 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9834 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9835 movw_prel_nc).
9836 (Arm_relocate_functions::movw_rel): New method.
9837 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9838 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9839 thm_movw_prel_nc).
9840 (Arm_relocate_functions::thm_movw_rel): New method.
9841 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9842 thm_movt_prel).
9843 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9844 relocations.
9845 (Target_arm::Scan::global): Likewise.
9846 (Target_arm::Relocate::relocate): Likewise.
9847 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9848 Likewise.
9849
b10d2873
ILT
98502010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9851
9852 * arm.cc: Added support for ARM group relocations.
9853 (Target_arm::reloc_needs_sym_origin): New method.
9854 (Arm_relocate_functions::calc_grp_kn): New method.
9855 (Arm_relocate_functions::calc_grp_residual): New method.
9856 (Arm_relocate_functions::calc_grp_gn): New method.
9857 (Arm_relocate_functions::arm_grp_alu): New Method.
9858 (Arm_relocate_functions::arm_grp_ldr): New Method.
9859 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9860 (Arm_relocate_functions::arm_grp_ldc): New Method.
9861 (Target_arm::Scan::local): Handle the ARM group relocations.
9862 (Target_arm::Scan::global): Likewise.
9863 (Target_arm::Relocate::relocate): Likewise.
9864 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9865 Likewise.
9866
2b328d4e
DK
98672010-01-26 Doug Kwan <dougkwan@google.com>
9868
9869 * arm.cc (set): Include.
9870 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9871 pointer type.
2e702c99 9872 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9873 (Arm_output_section::append_text_sections_to_list): New method.
9874 (Arm_output_section::fix_exidx_coverage): Ditto.
9875 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9876 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9877 Relobj::set_section_offset() instead of
9878 Sized_relobj::invalidate_section_offset().
2e702c99 9879 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9880 parameter for section headers. Ignore relocation sections for
9881 unallocated sections and EXIDX sections.
9882 (Target_arm::fix_exidx_coverage): New method.
9883 (Target_arm::output_section_address_less_than): New type.
9884 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9885 linked text section instead of the EXIDX section.
9886 (Arm_output_section::create_stub_group): Add an assertion to check
9887 that this is not an EXIDX output section.
9888 (Arm_output_section::append_text_sections_to_list): New method.
9889 (Arm_output_section::fix_exidx_coverage): Ditto.
9890 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9891 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9892 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9893 first pass.
9894 (Target_arm::fix_exidx_coverage): New method.
9895 * object.h (Relobj::set_output_section): New method.
9896 (Sized_relobj::invalidate_section_offset): Remove method.
9897 (Sized_relobj::do_invalidate_section_offset): Remove method.
9898 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9899
c7f3c371
DK
99002010-01-25 Doug Kwan <dougkwan@google.com>
9901
9902 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9903 Fix warning due to signed and unsigned comparison on a 32-bit host.
9904
8923b24c
DK
99052010-01-22 Doug Kwan <dougkwan@google.com>
9906
9907 * arm.cc (Target_arm::do_relax): Record an output section for section
9908 offset adjustment it contains any stub table that has changed.
9909 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9910 offsets in an output section if necessary.
9911 * output.cc (Output_section::Output_section): Initialize
9912 section_offsets_need_adjustments_.
9913 (Output_section::add_input_section_for_script): Renamed to
9914 Output_section::add_simple_input_section.
9915 (Output_section::save_states): Add a comment.
9916 (Output_section::discard_states): New method defintion.
9917 (Output_section::adjust_section_offsets): Same.
9918 * output.h (Output_section::add_input_section_for_script): Renamed to
9919 Output_section::add_simple_input_section.
9920 (Output_section::discard_states): New method declaration.
9921 (Output_section::adjust_section_offsets): Same.
9922 (Output_section::section_offsets_need_adjustment,
9923 Output_section::set_section_offsets_need_adjustment): New method
9924 definitions.
9925 (Output_section::section_offsets_need_adjustment_): New data member.
9926 * script-sections.cc
9927 (Output_section_element_input::set_section_address): Adjust code for
9928 renaming of Output_section::add_input_section_for_script.
9929 (Orphan_output_section::set_section_address): Same.
9930
9b2fd367
DK
99312010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9932
9933 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9934 Fix_v4bx enum values .
9935 * gold/options.h (General_options): New option definitions.
9936 (General_options::fix_v4bx): New method.
9937 (General_options::Fix_v4bx): New enum.
9938 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9939 (General_options::parse_fix_v4bx_interworking): New method.
9940
80d0d023
DK
99412010-01-22 Doug Kwan <dougkwan@google.com>
9942
9943 * arm.cc (Arm_exidx_fixup): New class.
9944
af2cdeae
DK
99452010-01-21 Doug Kwan <dougkwan@google.com>
9946
9947 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9948 classes.
9949 (Arm_exidx_section_offset_map): New type.
9950
993d07c1
DK
99512010-01-21 Doug Kwan <dougkwan@google.com>
9952
9953 * arm.cc (Arm_exidx_input_section): New class.
9954 (Arm_relobj::exidx_input_section_by_link,
9955 Arm_relobj::exidx_input_section_by_shndx,
9956 Arm_relobj::make_exidx_input_section): New methods.
9957 (read_arm_attributes_section): Remove.
9958 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9959 information about them.
9960 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9961 to here.
9962
5ac169d4
DK
99632010-01-20 Doug Kwan <dougkwan@google.com>
9964
9965 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9966 Input_section_specifier to Section_id.
9967 (Target_arm::new_arm_input_section: Adjust code for change of key
9968 type.
9969 (Target_arm::find_arm_input_section): Ditto.
9970 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9971 (Section_id): Remove.
9972 (Garbage_collection::Section_id_hash): Remove.
9973 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9974 (Section_id): Remove.
9975 (Icf::Section_id_hash): Remove.
9976 * object.h (Section_id, Const_section_id, Section_id_hash,
9977 Const_section_id_hash): New type definitions.
9978 * output.cc (Output_section::add_relaxed_input_section): Change to
9979 use Const_section_id instead of Input_section_specifier as key type.
9980 (Output_section::add_merge_input_section): Ditto.
9981 (Output_section::build_relaxation_map): Change to use Section_id
9982 instead of Input_section_specifier as key type.
2e702c99 9983 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9984 Ditto.
9985 (Output_section::convert_input_sections_to_relaxed_sections): Change
9986 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9987 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9988 (Output_section::find_relaxed_input_section): Ditto.
9989 * output.h (Input_section_specifier): Remove class.
9990 (Output_section::Output_section_data_by_input_section_map): Change
9991 key type to Const_section_id.
9992 (Output_section::Output_relaxed_input_section_by_input_section_map):
9993 Ditto.
9994 (Output_section::Relaxation_map): Change key type to Section_id.
9995
a2162063
ILT
99962010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9997
9998 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9999 (class Arm_v4bx_stub): New class.
10000 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10001 (Stub_factory::make_arm_v4bx_stub): New method.
10002 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10003 (Stub_table::empty): Handle v4bx stubs.
10004 (Stub_table::add_arm_v4bx_stub): New method.
10005 (Stub_table::find_arm_v4bx_stub): New method.
10006 (Arm_relocate_functions::v4bx): New method.
10007 (Target_arm::fix_v4bx): New method.
10008 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10009 (Stub_table::relocate_stubs): Likewise.
10010 (Stub_table::do_write): Likewise.
10011 (Stub_table::update_data_size_and_addralign): Likewise.
10012 (Stub_table::finalize_stubs): Likewise.
10013 (Target_arm::Scan::local): Likewise.
10014 (Target_arm::Scan::global): Likewise.
10015 (Target_arm::do_finalize_sections): Likewise.
10016 (Target_arm::Relocate::relocate): Likewise.
10017 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10018 Likewise.
10019 (Target_arm::scan_reloc_for_stub): Likewise.
10020 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10021
5696ab0b
ILT
100222010-01-19 Ian Lance Taylor <iant@google.com>
10023
10024 * output.cc (Output_section_headers::do_sized_write): Write large
10025 segment count to sh_info field.
10026 (Output_file_header::do_sized_write): For large segment count,
10027 write PN_XNUM to e_phnum field.
10028
800d0f56
ILT
100292010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10030
10031 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10032 (Arm_relocate_functions::thm_jump8): New function.
10033 (Arm_relocate_functions::thm_jump11): New function.
10034 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10035 R_ARM_THM_JUMP11.
10036 (Target_arm::Scan::global): Likewise.
10037 (Target_arm::Relocate::relocate): Likewise.
10038 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10039 Likewise.
10040
41263c05
DK
100412010-01-14 Doug Kwan <dougkwan@google.com>
10042
10043 * arm.cc (map, utility): Include headers.
10044 (Target_arm::apply_cortex_a8_workaround): New method.
10045 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10046 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10047 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10048 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10049 the --[no-]fix-cortex-a8 command line options.
10050 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10051 (Target_arm::relocate_stub): Use addend in instruction template.
10052 * options.h (DEFINE_bool): Set the user-set flag.
10053 (General_options): Add --[no-]-fix-cortex options.
10054 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10055 : Update fast look-up map after conversion.
41263c05 10056
459e9b03
ST
100572010-01-14 Sriraman Tallam <tmsriram@google.com>
10058
10059 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10060 in the first pass of do_layout.
10061
b521dfe4
DK
100622010-01-13 Doug Kwan <dougkwan@google.com>
10063
10064 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10065 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10066 apparent compiler problem of not folding static constant integral
10067 data members of elfcpp::Elf_sizes<32>.
10068
44272192
DK
100692010-01-13 Doug Kwan <dougkwan@google.com>
10070
10071 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10072 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10073 Arm_relobj::scan_section_for_cortex_a8_erratum,
10074 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10075 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10076 sections to scan for relocation stubs into a new method
10077 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10078 relocation and Cortex-A8 stub scanning.
10079 (Target_arm::do_relax): Force stubs to be after stubbed sections
10080 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10081 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10082 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10083
44b71ece
ILT
100842010-01-12 Ian Lance Taylor <iant@google.com>
10085
10086 * target-reloc.h (visibility_error): New inline function.
10087 (relocate_section): Call visibility_error.
10088 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10089 (MOSTLYCLEANFILES): Likewise.
10090 (protected_4_pic.o, protected_3.err): New targets.
10091 * testsuite/protected_4.cc: New file.
10092
a120bc7f
DK
100932010-01-12 Doug Kwan <dougkwan@google.com>
10094
10095 * arm.cc (Cortex_a8_reloc): New class.
10096 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10097 and cortex_a8_relocs_info_.
10098 (Target_arm::fix_cortex_a8): New method definition.
10099 (Target_arm::Cortex_a8_relocs_info): New type.
10100 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10101 New data member declarations.
10102 (Target_arm::scan_reloc_for_stub): Record information about
10103 relocations for THUMB branches that might be exempted from the
10104 Cortex-A8 workaround.
10105 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10106 at the beginning of a relaxation pass.
10107
20138696
DK
101082010-01-12 Doug Kwan <dougkwan@google.com>
10109
10110 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10111 (Arm_relobj::Mapping_symbol_position,
10112 Arm_reloj::Mapping_symbol_position_less,
10113 Arm_relobj::Mapping_symbols_info): New types.
10114 (Target_arm::is_mapping_symbol_name): New method definition.
10115 (Arm_relobj::do_count_local_symbols): Save information about mapping
10116 symbols.
10117
089d69dc
DK
101182010-01-11 Doug Kwan <dougkwan@google.com>
10119
10120 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10121 Arm_relocate_functions::thumb32_branch_upper,
10122 Arm_relocate_functions::thumb32_branch_lower,
10123 Arm_relocate_functions::thumb32_cond_branch_offset,
10124 Arm_relocate_functions::thumb32_cond_branch_upper,
10125 Arm_relocate_functions::thumb32_cond_branch_lower,
10126 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10127 branch offset encoding.
10128 (Arm_relocate_functions::thumb_branch_common): Use new branch
10129 offset encoding methods to avoid code duplication.
10130 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10131 (Stub_addend_reader::operator()): Use new branch encoding method
10132 to avoid code duplication.
10133
99e5bff2
DK
101342010-01-11 Doug Kwan <dougkwan@google.com>
10135
10136 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10137 (Target_arm::do_finalize_sections): Define special EXIDX section
10138 symbols only if referenced.
10139 * gc.h (Garbage_collection::add_reference): New method.
10140 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10141 code duplication.
10142
98e090bd
ILT
101432010-01-11 Ian Lance Taylor <iant@google.com>
10144
d0a91bd8
ILT
10145 * script.cc (Version_script_info::build_expression_list_lookup):
10146 Change complaing about duplicate wildcard match from error to
10147 warning.
10148
98e090bd
ILT
10149 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10150 of 2009-12-30.
10151 (Version_script_info::Version_script_info): Initialize globs_,
10152 default_version_, default_is_global_, and exact_. Don't
10153 initialize globals_ or locals_.
10154 (Version_script_info::build_lookup_tables): Build local symbols
10155 first.
10156 (Version_script_info::unquote): New function.
10157 (Version_script_info::add_exact_match): New function.
10158 (Version_script_info::build_expression_list_lookup): Remove lookup
10159 parameter. Add is_global parameter. Change all callers. Handle
10160 wildcard pattern specially. Unquote pattern. Call
10161 add_exact_match.
10162 (Version_script_info::get_name_to_match): New function.
10163 (Version_script_info::get_symbol_version): New function.
10164 (Version_script_info::get_symbol_version_helper): Remove.
10165 (Version_script_info::check_unmatched_names): Call unquote.
10166 * script.h (class Version_script_info): Change get_symbol_version
10167 to be non-inline and add is_global parameter; change all callers.
10168 Rewrite symbol_is_local. Update declarations. Define struct
10169 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10170 Remove globals_ and locals_ members. Add exact_, globs_,
10171 default_version_, is_global_.
10172 (Version_script_info::Glob): Remove pattern, add expression and
10173 is_global. Update constructor. Change all callers.
10174 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10175 default version.
10176 (Versions::symbol_section_contents): If a symbol is undefined, or
10177 defined in a dynamic object, set the version index to
10178 VER_NDX_LOCAL.
10179 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10180 symbol_is_local.
10181 (Symbol_table::add_from_pluginobj): Likewise.
10182 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10183
d56962d3
DK
101842010-01-11 Doug Kwan <dougkwan@google.com>
10185
10186 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10187 (incremental_dump_LDADD): Add linking option for libintl.
10188 * Makefile.in: Regenerate.
10189
94e6ee91
L
101902010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10191
10192 PR gold/11144
10193 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10194 instead of -Ds.
10195 * testsuite/Makefile.in: Regenerated.
10196
e96c574b
DK
101972010-01-10 Doug Kwan <dougkwan@google.com>
10198
10199 * options.h (DEFINE_var): Use parentheses around argument varname__
10200 in macro body to avoid any unintended subsequent substitutions.
10201
7198066b
ILT
102022010-01-10 Ian Lance Taylor <iant@google.com>
10203
ba4d53bf
ILT
10204 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10205 candidates before doing symbol resolution.
10206
7198066b
ILT
10207 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10208 ODR candidates if only one is weak.
10209
a2beed37
ILT
102102010-01-08 Ian Lance Taylor <iant@google.com>
10211
10212 * script.cc (Version_script_info::build_expression_list_lookup):
10213 Don't warn about ambiguous version, just record the ambiguity.
10214 (Version_script_info::get_symbol_version_helper): Give error if
10215 version is ambiguous.
10216
2fb7225c
DK
102172010-01-08 Doug Kwan <dougkwan@google.com>
10218
10219 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10220 prev_data_size_ and prev_addralign_. Remove initializer for
10221 deleted data member has_been_changed_.
10222 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10223 to determine if the table is empty.
10224 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10225 Remove.
10226 (Stub_table::add_reloc_stub): Define method in class definition
10227 instead of just declaring it there.
10228 (Stub_table::add_cortex_a8_stub): New method definition.
10229 (Stub_table::update_data_size_and_addralign): Ditto.
10230 (Stub_table::finalize_stubs): Ditto.
10231 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10232 (Stub_table::do_addralign_): Return address alignment in the
10233 (Stub_table::do_reset_address_and_file_offset): Define method in
10234 class definition instead of declaring it there. Set current data
10235 size to be the data size of the previous pass.
10236 (Stub_table::set_final_data_size): Use current data size as the
10237 final data size.
10238 (Stub_table::relocate_stub): Change parameter type of stub from
10239 Reloc_stub pointer to Stub pointer.
10240 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10241 (Stub_table::Cortex_a8_stub_list): New typedef.
10242 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10243 Stub_table::prev_addralign_): New data member.
10244 (Arm_relobj::Arm_relobj): Initialize data member
10245 section_has_cortex_a8_workaround_.
10246 (Arm_relobj::section_has_cortex_a8_workaround,
10247 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10248 definitions.
10249 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10250 declarations.
10251 (Target_arm::relocate_stub): Change parameter type of stub from
10252 Reloc_stub pointer to Stub pointer.
10253 (Insn_template::size, Insn_template::alignment): Handle
10254 THUMB16_SPECIAL_TYPE.
10255 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10256 Stub_table::update_data_size_and_addralign,
10257 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10258 definitions.
10259 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10260 (Stub_table::do_write): Ditto.
10261 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10262
880cd20d
ILT
102632010-01-08 Ian Lance Taylor <iant@google.com>
10264
10265 PR 11108
10266 * symtab.h (class Symbol): Remove fields is_target_special_ and
10267 has_plt_offset_. Add field is_defined_in_discarded_section_.
10268 (Symbol::is_defined_in_discarded_section): New function.
10269 (Symbol::set_is_defined_in_discarded_section): New function.
10270 (Symbol::has_plt_offset): Rewrite.
10271 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10272 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10273 Don't initialize is_target_special_ or has_plt_offset_.
10274 Initialize is_defined_in_discarded_section_.
10275 (Symbol_table::add_from_relobj): If appropriate, set
10276 is_defined_in_discarded_section.
10277 * resolve.cc (Symbol::override_base_with_special): Don't test
10278 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10279 * target-reloc.h (relocate_section): Do special handling for
10280 symbols defined in discarded sections for global symbols as well
10281 as local symbols.
10282
2703e3eb
ILT
102832010-01-08 Ian Lance Taylor <iant@google.com>
10284
10285 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10286 the SHT_SYMTAB case.
10287
339d40a3
ILT
102882010-01-08 Ian Lance Taylor <iant@google.com>
10289
10290 * object.cc (Sized_relobj::do_layout): Don't get confused if
10291 layout_eh_frame returns NULL.
10292
abecea76
ILT
102932010-01-08 Ian Lance Taylor <iant@google.com>
10294
10295 PR 11084
10296 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10297 dynamic symbol table, use the normal symbol table.
10298 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10299 symbol table.
10300
6b7dd3f3
ILT
103012010-01-08 Ian Lance Taylor <iant@google.com>
10302
10303 PR 11072
10304 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10305 sections.
10306
36c50e63
L
103072010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10308
10309 * version.cc (print_version): Change to "Copyright 2010".
10310
e291e7b9
ILT
103112010-01-08 Ian Lance Taylor <iant@google.com>
10312
10313 PR 10287
10314 PR 11063
10315 * i386.cc (class Target_i386): Change return type of plt_section
10316 to be non-const.
10317 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10318 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10319 tls_desc_rel_ field.
10320 (Output_data_plt_i386::rel_tls_desc): New function.
10321 (Target_i386::rel_tls_desc_section): New function.
10322 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10323 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10324 R_386_TLS_DESC reloc in rel_tls_desc_section.
10325 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10326 Define struct Tlsdesc_info.
10327 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10328 (Target_x86_64::do_reloc_symbol_index): New function.
10329 (Target_x86_64::add_tlsdesc_info): New function.
10330 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10331 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10332 tlsdesc_rel_ field.
10333 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10334 all callers.
10335 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10336 (Target_x86_64::rela_tlsdesc_section): New function.
10337 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10338 handling.
10339 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10340 (Target_x86_64::do_reloc_addend): New function.
10341 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10342 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10343 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10344 (Output_reloc::type): New function.
10345 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10346 (Output_reloc::is_target_specific): New function.
10347 (Output_reloc::target_arg): New function.
10348 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10349 absolute relocs and target specific relocs.
10350 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10351 add_target_specific.
10352 (class Output_data_reloc) [SHT_RELA]: Likewise.
10353 * output.cc (Output_reloc::Output_reloc): Add four new versions
10354 for absolute relocs and target specific relocs.
10355 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10356 (Output_reloc::get_symbol_index): Likewise.
10357 (Output_reloc::local_section_offset): Check that local_sym_index_
10358 is not TARGET_CODE or 0.
10359 (Output_reloc::symbol_value): Likewise.
10360 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10361 reloc.
10362 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10363 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10364 functions.
10365 * layout.cc (add_target_dynamic_tags): Use output section for
10366 DT_PLTRELSZ and DT_JMPREL.
10367
3a44184e
ILT
103682010-01-07 Ian Lance Taylor <iant@google.com>
10369
10370 PR 11061
10371 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10372 function.
10373 (class Output_data_reloc_generic): Define.
10374 (class Output_data_reloc_base): Change base class to
10375 Output_data_reloc_generic. Change add() method to call
10376 bump_relative_reloc_count for a relative reloc. Remove
10377 sort_relocs_ field.
10378 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10379 to sort_relocs().
10380 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10381 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10382 appropriate.
10383 * layout.h (class Layout): Update declaration.
10384
ea715a34
ILT
103852010-01-07 Ian Lance Taylor <iant@google.com>
10386
10387 * output.h (class Output_data): Add const version of
10388 output_section and do_output_section.
10389 (class Output_section_data): Add const version of
10390 do_output_section.
10391 (class Output_section): Likewise.
10392 * layout.cc (Layout::add_target_dynamic_tags): New function.
10393 * layout.h (class Layout): Update declarations.
10394 * arm.cc (Target_arm::do_finalize_sections): Use
10395 add_target_dynamic_tags.
10396 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10397 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10398 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10399 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10400
659948a4
ILT
104012010-01-07 Ian Lance Taylor <iant@google.com>
10402
10403 PR 11042
10404 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10405 object as needed.
10406
9d3b86f6
ILT
104072010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10408 Ian Lance Taylor <iant@google.com>
10409
10410 PR 11019
10411 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10412 Xindex::read_symtab_xindex.
10413
bb0d3eb0
DK
104142010-01-07 Doug Kwan <dougkwan@google.com>
10415
10416 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10417 (Insn_template::thumb16_bcond_insn): New method declaration.
10418 (Insn_template): Fix spelling.
10419 (Stub::thumb16_special): New method declaration.
10420 (Stub::do_write): Define virtual method which was previously pure
10421 virtual.
10422 (Stub::do_thumb16_special): New method declaration.
10423 (Stub::do_fixed_endian_write): New template member.
10424 (Reloc_stub::do_write): Remove.
10425 (Reloc_stub::do_fixed_endian_write): Remove.
10426 (Cortex_a8_stub): New class definition.
10427 (Stub_factory::make_cortex_a8_stub): New method definition.
10428 (Stub_factory::Stub_factory): Add missing static storage class
10429 qualifier for elf32_arm_stub_a8_veneer_blx.
10430
ffeef7df
ILT
104312010-01-07 Ian Lance Taylor <iant@google.com>
10432
dc3f80fe
ILT
10433 PR 10980
10434 * options.h (class General_options): Add --warn-unresolved-symbols
10435 and --error-unresolved-symbols.
10436 * errors.cc (Errors::undefined_symbol): Implement
10437 --warn-unresolved-symbols.
10438
ffeef7df
ILT
10439 * options.h (class General_options): Add -z text and -z textoff.
10440 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10441
f1ec9ded
ST
104422010-01-06 Sriraman Tallam <tmsriram@google.com>
10443
10444 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10445 (Garbage_collection::cident_sections): New function.
10446 (Garbage_collection::add_cident_section): New function.
10447 (Garbage_collection::cident_sections_): New member.
10448 (gc_process_relocs): Add references to sections whose names are C
10449 identifiers.
10450 * gold.h (cident_section_start_prefix): New constant.
10451 (cident_section_stop_prefix): New constant.
10452 (is_cident): New function.
10453 * layout.cc (Layout::define_section_symbols): Replace string constants
10454 with the newly defined constants.
10455 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10456 C identifiers.
10457 * testsuite/Makefile.am: Add gc_orphan_section_test.
10458 * testsuite/Makefile.in: Regenerate.
10459 * testsuite/gc_orphan_section_test.cc: New file.
10460 * testsuite/gc_orphan_section_test.sh: New file.
10461
6eda8c29
ILT
104622010-01-06 Ian Lance Taylor <iant@google.com>
10463
b9674e17
ILT
10464 PR 10980
10465 * options.h (class General_options): Add --warn-shared-textrel.
10466 * layout.cc (Layout::finish_dynamic_section): Implement
10467 --warn-shared-textrel.
10468
6eda8c29
ILT
10469 PR 10980
10470 * options.h (class General_options): Add --warn-multiple-gp.
10471
32dcd44e
ILT
104722010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10473
10474 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10475 $(THREADSLIB) and $(LIBDL).
10476 * Makefile.in: Rebuild.
10477
a192ba05
ILT
104782010-01-06 Ian Lance Taylor <iant@google.com>
10479
10480 PR 10980
10481 * options.cc (General_options::parse_section_start): New function.
10482 (General_options::section_start): New function.
10483 (General_options::General_options): Initialize all members.
10484 * options.h: Include <map>
10485 (class General_options): Add --section-start. Add section_starts_
10486 member.
10487 * layout.cc (Layout::attach_allocated_section_to_segment): If
10488 --section-start was used, set the address of the segment. Remove
10489 local sort_sections.
10490 (Layout::relaxation_loop_body): If the address of the load segment
10491 has been set by --section-start, don't use it.
10492 * output.h (Output_segment::update_flags_for_output_section): New
10493 function.
10494 * output.cc (Output_segment::add_output_section): Call
10495 update_flags_for_output_section.
10496
dde3f402
ILT
104972010-01-05 Ian Lance Taylor <iant@google.com>
10498
62dfdd4d
ILT
10499 PR 10980
10500 * options.h (class General_options): Add --undefined-version.
10501 * script.cc (struct Version_expression): Add was_matched_by_symbol
10502 field.
10503 (Version_script_info::matched_symbol): New function.
10504 (Version_script_info::get_symbol_version_helper): Call
10505 matched_symbol.
10506 (Version_script_info::check_unmatched_names): New function.
10507 * script.h (class Version_script_info): Update declarations.
10508 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10509
9c4ae156
ILT
10510 * options.h (class General_options): Use DEFINE_bool_alias for
10511 allow_multiple_definition.
10512 * resolve.cc (Symbol_table::should_override): Don't test
10513 allow_multiple_definition.
10514
dde3f402
ILT
10515 PR 10980
10516 * options.h (class General_options): Add --cref.
10517 * main.cc (main): Print cref table if --cref. Don't close mapfile
10518 until after printing cref table.
10519 * cref.cc: Include "symtab.h".
10520 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10521 (Cref_table_compare::operator()): New function.
10522 (Cref_inputs::gather_cref): New function.
10523 (filecol): New static const.
10524 (Cref_inputs::print_cref): New function.
10525 (Cref::print_cref): New function.
10526 * cref.h: Include <cstdio>.
10527 (class Cref): Update declarations.
10528 * mapfile.h (Mapfile::file): New function.
10529 * object.h (class Object): Define Symbols. Declare virtual
10530 do_get_global_symbols.
10531 (Object::get_global_symbols): New function.
10532 * object.cc (Input_objects::add_object): Pass object to cref_ if
10533 --cref.
10534 (Input_objects::archive_start): Likewise.
10535 (Input_objects::archive_stop): Likewise.
10536 (Input_objects::print_cref): New function.
10537 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10538 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10539 --cref.
10540 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10541 function.
10542 * plugin.h (class Sized_pluginobj): Update declarations.
10543
8781f709
ILT
105442010-01-05 Ian Lance Taylor <iant@google.com>
10545
10546 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10547 to is_default_version. Rename insdef to insdefault.
10548 (Symbol_table::add_from_relobj): Rename def to is_default_version
10549 and local to is_forced_local.
10550 (Symbol_table::add_from_pluginobj): Likewise.
10551 (Symbol_table::add_from_dynobj): Likewise.
10552 (Symbol_table::define_special_symbol): Rename insdef to
10553 insdefault.
10554
fe35d28d
ILT
105552010-01-04 Ian Lance Taylor <iant@google.com>
10556
30bc8c46
ILT
10557 PR 10980
10558 * options.h (class General_options): Add
10559 --allow-multiple-definition and -z muldefs.
10560 * resolve.cc (Symbol_table::should_override): Don't warn about a
10561 multiple symbol definition if --allow-multiple-definition or -z
10562 muldefs.
10563
7eaea549
ILT
10564 PR 10980
10565 * options.h (class General_options): Add --add-needed and
10566 --copy-dt-needed-entries. Tweak --as-needed help entry.
10567 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10568 error if --copy-dt-needed-entries aka --add-needed is used and
10569 would cause a change in behaviour.
10570
fe35d28d
ILT
10571 PR 10980
10572 * options.h (class General_options): Add -G as a short version of
10573 --shared. Add no-op options -assert, -g, and -i.
10574
55a2bb35
ST
105752010-01-04 Sriraman Tallam <tmsriram@google.com>
10576
10577 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10578 check for .text or .gnu.linkonce.t sections.
10579 * icf.cc (Icf::find_identical_sections): Ditto.
10580 Change the detection for mangled function name within the section
10581 name.
10582 * icf.h (is_section_foldable_candidate): New function.
10583
719328e1
ILT
105842009-12-30 Ian Lance Taylor <iant@google.com>
10585
10586 PR 10980
10587 * options.h (class General_options): Permit two dashes with
10588 --retain-symbols-file.
10589
d7bb5745
ILT
105902009-12-30 Ian Lance Taylor <iant@google.com>
10591
403a15dd
ILT
10592 PR 10979
10593 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10594 don't put the file header and segment headers in the text
10595 segment.
10596
eda294df
ILT
10597 PR 10979
10598 * common.cc (Sort_commons::operator()): Stabilize sort when both
10599 entries are NULL.
10600 (Symbol_table::do_allocate_commons_list): When allocating common
10601 symbols, skip a symbol which is no longer common.
10602 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10603 an object before checking its type.
10604 * testsuite/common_test_2.c: New file.
10605 * testsuite/common_test_3.c: New file.
10606 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10607 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10608 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10609 (common_test_2_pic.o, common_test_2.so): New targets.
10610 (common_test_3_pic.o, common_test_3.so): New targets.
10611 * testsuite/Makefile.in: Rebuild.
10612
d7bb5745
ILT
10613 PR 10979
10614 * script.cc (read_input_script): If we see a new SECTIONS clause,
10615 and we have added an input section, give an error.
10616 * layout.h (class Layout): Add have_added_input_section function.
10617 Add have_added_input_section_ field.
10618 * layout.cc (Layout::Layout): Initialize
10619 have_added_input_section_.
10620 (Layout::layout): Set have_added_input_section_.
10621 (Layout::layout_eh_frame): Likewise.
10622
fc59c572
ILT
106232009-12-30 Ian Lance Taylor <iant@google.com>
10624
10625 PR 10931
10626 * options.h (class General_options): Add --sort-common option.
10627 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10628 * common.cc (Sort_common): Add sort_order parameter to
10629 constructor. Add sort_order_ field.
10630 (Sort_commons::operator): Check sort_order_.
10631 (Symbol_table::allocate_commons): Determine the sort order.
10632 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10633 Change all callers.
10634 (Symbol_table::do_allocate_commons_list): Likewise.
10635
1c74fab0
ILT
106362009-12-30 Ian Lance Taylor <iant@google.com>
10637
10638 PR 10916
10639 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10640 symbols from this object, don't change the visibility of an
10641 undefined symbol.
10642 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10643
6affe781
ILT
106442009-12-30 Ian Lance Taylor <iant@google.com>
10645
10646 PR 10861
10647 * script.h (class Version_script_info): Define Language enum.
10648 Update declarations. Define Glob, Exact, and Lookup types. Add
10649 new fields globals_, locals_, and is_finalized_.
10650 * script.cc: Various formatting fixes.
10651 (class Parser_closure): Change language_stack_ from a vector of
10652 std::string to one of Version_script_info::Language. Adjust all
10653 uses accordingly.
10654 (class Lazy_demangler): Remove.
10655 (struct Version_expression): Change language from std::string to
10656 Version_script_info::Language.
10657 (Version_script_info::Version_script_info): New function.
10658 (Version_script_info::~Version_script_info): Don't call clear.
10659 (Version_script_info::finalize): New function.
10660 (Version_script_info::build_lookup_tables): New function.
10661 (Version_script_info::build_expression_list_lookup): New
10662 function.
10663 (Version_script_info::get_symbol_version_helper): Rewrite to use
10664 lookup tables.
10665 (Version_script_info::print_expression_list): Adjust to use
10666 Version_script_info::Language.
10667 (script_push_lex_into_version_mode): Check that the version script
10668 has not been finalized.
10669 (version_script_push_lang): Change language string to
10670 Version_script_info::Language.
10671 * options.cc (Command_line::version_script): New function.
10672 * options.h (class General_options): Add finalize_dynamic_list
10673 function. Change version_script from declaration to definition.
10674 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10675 * testsuite/version_script.map: Remove duplicate def of foo.
10676 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10677 version_script.map.
10678 * testsuite/Makefile.in: Rebuild.
10679
818bf354
ILT
106802009-12-30 Ian Lance Taylor <iant@google.com>
10681
10682 PR 10843
10683 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10684 if the input symbol index is 0, make the output symbol index 0.
10685
ebcc8304
ILT
106862009-12-30 Ian Lance Taylor <iant@google.com>
10687
10688 PR 10670
10689 * options.h (class General_options): Add -x/--discard-all.
10690 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10691 --discard-all. If the local symbol needs a dynamic entry, check
10692 that before handling --discard-locals.
10693
176fe33f
ILT
106942009-12-30 Ian Lance Taylor <iant@google.com>
10695
bb321bb1
ILT
10696 PR 10450
10697 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10698 flags to PF_R.
10699 (Output_segment::add_output_section): Don't change the flags if
10700 the type is PT_TLS.
10701
176fe33f
ILT
10702 PR 10450
10703 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10704 GNU hash table if they need a dynamic value. Otherwise, don't add
10705 them if they are defined in a dynamic object or are forced local.
10706
e8cd95c7
ILT
107072009-12-29 Ian Lance Taylor <iant@google.com>
10708
1b81fb71
ILT
10709 PR 10450
10710 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10711 .gnu.hash table for a 32-bit target.
10712
8d6d383d
ILT
10713 PR 10450
10714 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10715 regular and a dynamic object only needs a dynamic symbol table
10716 entry if it is externally visible.
10717
e785ec03
ILT
10718 PR 10450
10719 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10720 constructor. Add global_offset_table_ field.
10721 (Target_i386::got_section): Set global_offset_table_.
10722 (Target_i386::do_finalize_sections): Set global_offset_table_
10723 size.
10724 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10725 in constructor. Add global_offset_table_ field.
10726 (Target_x86_64::got_section): Set global_offset_table_.
10727 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10728 size.
10729
1a2dff53
ILT
10730 * layout.cc (Layout::Layout): Initialize increase_relro_.
10731 (Layout::get_output_section): Add is_relro, is_last_relro, and
10732 is_first_non_relro parameters. Change all callers.
10733 (Layout::choose_output_section): Likewise.
10734 (Layout::add_output_section_data): Likewise.
10735 (Layout::make_output_section): Likewise.
10736 (Layout::set_segment_offsets): Clear increase_relro when using a
10737 linker script.
10738 * layout.h (class Layout): Add increase_relro method. Add
10739 increase_relro_ field. Update declarations.
10740 * output.cc (Output_section::Output_section): Initialize
10741 is_last_relro_ and is_first_non_relro_.
10742 (Output_segment::add_output_section): Group relro sections is
10743 do_sort is true. Handle is_last_relro and is_first_non_relro.
10744 (Output_segment::maximum_alignment): Remove relro handling.
10745 (Output_segment::set_section_addresses): Add increase_relro
10746 parameter. Change all callers. Add initial alignment to align
10747 relro sections on separate page. Remove old relro handling.
10748 (Output_segment::set_section_list_addresses): Remove in_relro
10749 parameter. Change all callers.
10750 (Output_segment::set_offset): Add increase parameter. Change all
10751 callers. Remove old relro handling.
10752 * output.h (class Output_section): Add new methods: is_last_relro,
10753 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10754 Add is_last_relro_ and is_first_non_relro_ fields.
10755 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10756 Create separate .got.plt section. Call increase_relro.
10757 * x86_64.cc (Target_x86_64::got_section): Likewise.
10758 * testsuite/relro_script_test.t: Add .got.plt.
10759
f0ba79e2
ILT
10760 PR 10450
10761 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10762 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10763 (Layout::finalize): Call set_dynamic_symbol_size.
10764 (Layout::set_dynamic_symbol_size): New function.
10765 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10766 set_dynamic_symbol_size.
10767
e8cd95c7
ILT
10768 PR 10450
10769 * output.h (class Output_section): Add is_entsize_zero_ field.
10770 * output.cc (Output_section::Output_section): Initialize
10771 is_entsize_zero_.
10772 (Output_section::set_entsize): If two different entsizes are
10773 requested, force it to zero.
10774 (Output_section::add_input_section): Set flags for .debug_str
10775 before updating section flags. Set entsize.
10776 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10777 and SHF_STRING if all input sections have those flags.
10778
3e1b9a8a
RÁE
107792009-12-29 Rafael Espindola <espindola@google.com>
10780
10781 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10782 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10783 reporting.
3e1b9a8a 10784
3dcad376
ST
107852009-12-29 Sriraman Tallam <tmsriram@google.com>
10786
10787 * options.cc (General_options::parse_version): Allow -v to exit
10788 without an error if there is nothing to link.
10789
084e2665
ILT
107902009-12-29 Ian Lance Taylor <iant@google.com>
10791
10792 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10793 using a version of gcc before 4.1.
10794 * configure: Rebuild.
10795
250acde3
CD
107962009-12-28 Chris Demetriou <cgd@google.com>
10797
10798 * attributes.cc (Output_attributes_section_data::do_write): Use
10799 std::vector::front rather than std::vector::data.
10800
99fff23b
ILT
108012009-12-28 Ian Lance Taylor <iant@google.com>
10802
10803 * symtab.h (class Symbol_table): Add enum Defined.
10804 * resolve.cc (Symbol_table::should_override): Add defined
10805 parameter. Change all callers. Test whether object is NULL
10806 before calling a method on it.
10807 (Symbol_table::report_resolve_problem): Add defined parameter.
10808 Change all callers.
10809 (Symbol_table::should_override_with_special): Likewise.
10810 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10811 parameter. Change all callers.
10812 (Symbol_table::do_define_in_output_data): Likewise.
10813 (Symbol_table::define_in_output_segment): Likewise.
10814 (Symbol_table::do_define_in_output_segment): Likewise.
10815 (Symbol_table::define_as_constant): Likewise.
10816 (Symbol_table::do_define_as_constant): Likewise.
10817 * script.h (class Symbol_assignment): Add is_defsym parameter to
10818 constructor; change all callers.
10819 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10820 parameter. Change all callers. Add is_defsym_ field.
10821 (class Parser_closure): Add parsing_defsym parameter to
10822 constructor; change all callers. Add parsing_defsym accessor
10823 function. Add parsing_defsym_ field.
10824
556bd683
ILT
108252009-12-28 Ian Lance Taylor <iant@google.com>
10826
10827 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10828 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10829
1782c879
ILT
108302009-12-23 Ian Lance Taylor <iant@google.com>
10831
10832 * i386.cc (Target_i386::do_calls_non_split): Recognize
10833 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10834 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10835 -fsplit-stack prologue when using %r11.
1782c879 10836
329ca2b1
ST
108372009-12-21 Sriraman Tallam <tmsriram@google.com>
10838
10839 * options.cc (General_options::parse_version): Make -v continue and do
10840 the link like GNU ld does.
10841
d675ff46
RÁE
108422009-12-17 Rafael Avila de Espindola <espindola@google.com>
10843
10844 * Makefile.am (CCFILES): Add timer.cc.
10845 (HFILES): Add timer.h.
10846 * configure.ac: Check for sysconf and times.
10847 * main.cc: include timer.h.
10848 (main): Use Timer instead of get_run_time.
10849 * timer.cc: New.
10850 * timer.h: New.
10851 * workqueue.cc: include timer.h.
10852 (Workqueue::find_and_run_task):
10853 Report user, sys and wall time.
10854 * Makefile.in: Regenerate.
10855 * config.in: Regenerate.
10856 * configure: Regenerate.
10857
d6344fb5
DK
108582009-12-16 Doug Kwan <dougkwan@google.com>
10859
10860 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10861 sections.
10862 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10863 relaxed input sections.
10864 * output.cc (Output_section::find_relaxed_input_section): Change
10865 return type to Output_relaxed_input_section pointer. Adjust code
10866 for new type of relaxed_input_section_map_.
10867 * output.h (Output_section::find_relaxed_input_section): Change
10868 return type to Output_relaxed_input_section pointer.
10869 (Output_section::Output_relaxed_input_section_by_input_section_map):
10870 New type.
10871 (Output_section::relaxed_input_section_map_): Change type to
10872 Output_section::Output_relaxed_input_section_by_input_section_map.
10873 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10874 input section.
10875
0e0d5469
ILT
108762009-12-15 Ian Lance Taylor <iant@google.com>
10877
10878 * layout.cc (Layout::create_shstrtab): Only write out after input
10879 sections if we are compressing debug sections.
10880
0649a889
ILT
108812009-12-15 Ian Lance Taylor <iant@google.com>
10882
10883 * archive.cc (Archive::add_symbols): Only look up a symbol without
10884 a version if there is, in fact, a version.
10885
2ea97941
ILT
108862009-12-14 Ian Lance Taylor <iant@google.com>
10887
10888 Revert -Wshadow changes, all changes from:
10889 2009-12-11 Doug Kwan <dougkwan@google.com>
10890 2009-12-11 Nick Clifton <nickc@redhat.com>
10891 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10892
b0eec2cc
DK
108932009-12-11 Doug Kwan <dougkwan@google.com>
10894
10895 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10896 due to -Wshadow.
10897 * attributes.cc (Object_attribute::size): Ditto.
10898 (Attributes_section_data::size): Ditto.
10899 (Attributes_section_data::Attributes_section_data): Ditto.
10900 (Output_attributes_section_data::do_write): Ditto.
10901 * attributes.h (Object_attribute::set_type): Ditto.
10902 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10903
91d6fa6a
NC
109042009-12-11 Nick Clifton <nickc@redhat.com>
10905
10906 * archive.cc: Fix shadowed variable warnings.
10907 * arm.cc: Likewise.
10908 * compressed_output.cc: Likewise.
10909 * compressed_output.h: Likewise.
10910 * configure: Likewise.
10911 * dwarf_reader.cc: Likewise.
10912 * dynobj.cc: Likewise.
10913 * dynobj.h: Likewise.
10914 * ehframe.cc: Likewise.
10915 * ehframe.h: Likewise.
10916 * errors.cc: Likewise.
10917 * expression.cc: Likewise.
10918 * fileread.cc: Likewise.
10919 * fileread.h: Likewise.
10920 * freebsd.h: Likewise.
10921 * i386.cc: Likewise.
10922 * icf.cc: Likewise.
10923 * incremental.h: Likewise.
10924 * layout.cc: Likewise.
10925 * layout.h: Likewise.
10926 * mapfile.cc: Likewise.
10927 * merge.cc: Likewise.
10928 * merge.h: Likewise.
10929 * object.cc: Likewise.
10930 * object.h: Likewise.
10931 * options.h: Likewise.
10932 * output.cc: Likewise.
10933 * output.h: Likewise.
10934 * parameters.cc: Likewise.
10935 * plugin.cc: Likewise.
10936 * powerpc.cc: Likewise.
10937 * reduced_debug_output.cc: Likewise.
10938 * reduced_debug_output.h: Likewise.
10939 * reloc.cc: Likewise.
10940 * reloc.h: Likewise.
10941 * resolve.cc: Likewise.
10942 * script-sections.cc: Likewise.
10943 * script.cc: Likewise.
10944 * script.h: Likewise.
10945 * sparc.cc: Likewise.
10946 * symtab.cc: Likewise.
10947 * symtab.h: Likewise.
10948 * target-select.cc: Likewise.
10949 * target-select.h: Likewise.
10950 * token.h: Likewise.
10951 * workqueue.cc: Likewise.
10952 * workqueue.h: Likewise.
10953 * x86_64.cc: Likewise.
10954
a0351a69
DK
109552009-12-10 Doug Kwan <dougkwan@google.com>
10956
10957 * arm.cc (attributes.h): New include.
10958 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10959 (Arm_relobj::~Arm_relobj): Delete object pointed by
10960 attributes_section_data_.
10961 (Arm_relobj::attributes_section_data): New method definition.
10962 (Arm_relobj::attributes_section_data_): New data member declaration.
10963 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10964 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10965 attributes_section_data_.
10966 (Arm_dynobj::attributes_section_data): New method definition.
10967 (Arm_dynobj::attributes_section_data_): New data member declaration.
10968 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10969 initialization value of may_use_blx_ to false.
2e702c99 10970 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10971 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10972 object attributes to compute results instead of hard-coding.
10973 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10974 Target_arm::get_secondary_compatible_arch,
10975 Target_arm::set_secondary_compatible_arch
10976 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10977 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10978 New method declarations.
10979 (Target_arm::get_aeabi_object_attribute): New method definition.
10980 (Target_arm::attributes_section_data_): New data member declaration.
10981 (read_arm_attributes_section): New template definition.
10982 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10983 (Arm_dynobj::do_read_symbols): Ditto.
10984 (Target_arm::do_finalize_sections): Merge attributes sections from
10985 input. Check for BLX use after attributes section merging.
10986 Fix __exidx_start and __exidx_end visibility. Create an
10987 .ARM.attributes section if necessary.
10988 (Target_arm::get_secondary_compatible_arch,
10989 Target_arm::set_secondary_compatible_arch,
10990 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10991 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10992 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10993 New method definitions.
10994
b59befec
ILT
109952009-12-09 Ian Lance Taylor <iant@google.com>
10996
10997 * plugin.cc (Plugin::load): Don't cast from void* to a function
10998 pointer.
10999
1276bc89
ILT
110002009-12-09 Ian Lance Taylor <iant@google.com>
11001
11002 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11003 information fields.
11004
2f2de248
L
110052009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11006
11007 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11008 Replace two_file_shared_1.so with two_file_shared_2.so.
11009 * testsuite/Makefile.in: Regenerated.
11010
4f787271
DK
110112009-12-08 Doug Kwan <dougkwan@google.com>
11012
11013 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11014 (HFILES): Add attributes.h and int_encoding.h.
11015 * Makefile.in: Regenerate.
11016 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11017 function definitions to int_encoding.cc
11018 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11019 prototypes to int_encoding.h
11020 * reduced_debug_output.cc (int_encoding.h): New include.
11021 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11022 function definitions to int_encoding.cc
11023 (insert_into_vector, read_from_pointer): Move template definitions to
11024 int_encoding.h
11025 * attributes.cc: New file.
11026 * attributes.h: New file.
11027 * int_encoding.cc: New file.
11028 * int_encoding.h: New file.
11029
20b52f1a
RÁE
110302009-12-07 Rafael Avila de Espindola <espindola@google.com>
11031
11032 PR gold/11055
11033 * incremental-dump.cc (dump_incremental_inputs): New.
11034 (main): Use dump_incremental_inputs.
11035
53d7974c
L
110362009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11037
11038 PR gold/10893
11039 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11040 checking elfcpp::STT_FUNC.
11041 (Target_i386::Relocate::relocate): Likewise.
11042 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11043
11044 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11045 symbols from shared libraries into normal FUNC symbols.
11046
11047 * symtab.h (Symbol): Add is_func and use it.
11048
05a352e6
DK
110492009-12-05 Doug Kwan <dougkwan@google.com>
11050
11051 * arm.cc (Target_arm::arm_info): Initialize new fields
11052 attributes_section and attributes_vendor.
11053 * i386.cc (Target_i386::i386_info): Same.
11054 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11055 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11056 fields attributes_section and attributes_vendor.
53d7974c 11057 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11058 * target.h (Target::attributes_section, Target::attributes_vendor,
11059 Target::is_attributes_section, Target::attribute_arg_type,
11060 Target::attributes_order): New method definitions.
11061 (Target::Target_info::attributes_section,
11062 Target::Target_info::attributes_vendor): New fields.
11063 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11064 virtual method definitions.
11065 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11066 attributes_section and attributes_vendor.
11067 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11068
f4e5969c
DK
110692009-12-05 Doug Kwan <dougkwan@google.com>
11070
11071 * arm.cc: Update comments about interworking and stub generation.
11072 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11073 considered as non-PIC.
11074 (Arm_relocate_functions::base_abs): Fix formatting.
11075 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11076 of function to use GOT entry address instead of offset.
11077 (Target_arm::Scan::global): Issue an error if a symbol would need a
11078 PLT does not get one because it is untyped. Remove code to create
11079 dynamic symbols for relative branches.
11080 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11081 takes unsigned integer instead of boolean.
11082
1abce4a6
L
110832009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11084
11085 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11086 (two_file_test_LDADD): Likewise.
11087 (common_test_1_LDADD): Likewise.
11088 (exception_test_LDADD) Likewise.
11089 (weak_test_LDADD): Likewise.
11090 (many_sections_test_LDADD): Likewise.
11091 (initpri1_LDADD): Likewise.
11092 (script_test_1_LDADD): Likewise.
11093 (script_test_2_LDADD): Likewise.
11094 (justsyms_LDADD): Likewise.
11095 (binary_test_LDADD): Likewise.
11096 (large_LDADD): Likewise.
11097 * testsuite/Makefile.in: Regenerated.
11098
adcf2816 110992009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11100
adcf2816
L
11101 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11102 (Symbol_table::override_with_special): Likewise.
11103 (Symbol_table::add_from_object): Likewise.
11104
28e67f5d
RÁE
111052009-12-04 Rafael Avila de Espindola <espindola@google.com>
11106
11107 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11108 Don't set the data_offset twice.
11109
ae10a101
RÁE
111102009-12-04 Rafael Avila de Espindola <espindola@google.com>
11111
11112 * testsuite/Makefile.in: Regenerate.
11113
f59f41f3
DK
111142009-12-03 Doug Kwan <dougkwan@google.com>
11115
11116 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11117 (Target_arm::do_finalize_sections): Add parameter for symbol table
11118 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11119 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11120 parameter for symbol table pointer.
11121 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11122 an additional parameter for a pointer to symbol table.
11123 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11124 parameter for a symbol table pointer.
11125 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11126 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11127 Ditto.
11128 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11129 parameter for a symbol table pointer.
11130
ca55d848
RÁE
111312009-12-03 Rafael Avila de Espindola <espindola@google.com>
11132
11133 * incremental.cc (Incremental_inputs_header)
11134 (Incremental_inputs_header_write, Incremental_inputs_entry)
11135 (Incremental_inputs_entry_write): Move ...
11136 * incremental.h (Incremental_inputs_header)
11137 (Incremental_inputs_header_write, Incremental_inputs_entry)
11138 (Incremental_inputs_entry_write): here.
11139
3aec4f9c
RÁE
111402009-12-02 Rafael Avila de Espindola <espindola@google.com>
11141
11142 * incremental.cc (make_sized_incremental_binary): Set the target.
11143 Error if it is incompatible.
11144 * output.h (Output_file): Add filename method.
11145
9c0ae74d
RÁE
111462009-12-02 Rafael Avila de Espindola <espindola@google.com>
11147
11148 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11149 from the get_* methods.
11150
a45500ae
RÁE
111512009-12-02 Rafael Avila de Espindola <espindola@google.com>
11152
11153 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11154 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11155 Write 0 for the data_offset of scripts.
11156
325e6408
RÁE
111572009-12-02 Rafael Avila de Espindola <espindola@google.com>
11158
11159 * testsuite/Makefile.am: Add the incremental_test.sh test.
11160 * testsuite/incremental_test.sh: New.
11161 * testsuite/incremental_test_1.c: New.
11162 * testsuite/incremental_test_2.c: New.
11163
954c3e2e
RÁE
111642009-12-01 Rafael Avila de Espindola <espindola@google.com>
11165
703d02da 11166 * incremental-dump.cc (main): Fix typos.
954c3e2e 11167
f8086623
RÁE
111682009-11-27 Rafael Avila de Espindola <espindola@google.com>
11169
11170 PR gold/11025
11171 * incremental-dump.cc (main): Use llu to print 64 bit values.
11172
3b0dd6ac
L
111732009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11174 H.J. Lu <hongjiu.lu@intel.com>
11175
11176 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11177 $(LIBDL).
11178 (incremental_dump_LDADD): Likewise.
11179 * Makefile.in: Regenerated.
11180
a6d1ef57 111812009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11182
a6d1ef57
DK
11183 Revert:
11184
11185 2009-11-25 Doug Kwan <dougkwan@google.com>
11186
11187 * arm.cc (Target_arm::Target_arm): Move method definition
11188 outside of class definition. Add code to handle
11189 --target1-rel, --target1-abs and --target2= options.
11190 (Target_arm::get_reloc_reloc_type): Change method to be
11191 non-static and const.
11192 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11193 New data member declaration.
11194 (Target_arm::Scan::local, Target_arm::Scan::global,
11195 Target_arm::Relocate::relocate,
11196 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11197 Adjust call to Target_arm::get_real_reloc_type.
11198 (Target_arm::get_real_reloc_type): Use command line options
11199 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11200 * options.h (--target1-rel, --target1-abs, --target2): New
11201 ARM-only options.
11202
50aeb7d4
DK
112032009-11-25 Doug Kwan <dougkwan@google.com>
11204
11205 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11206 class definition. Add code to handle --target1-rel, --target1-abs
11207 and --target2= options.
11208 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11209 and const.
11210 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11211 member declaration.
11212 (Target_arm::Scan::local, Target_arm::Scan::global,
11213 Target_arm::Relocate::relocate,
11214 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11215 call to Target_arm::get_real_reloc_type.
11216 (Target_arm::get_real_reloc_type): Use command line options to
11217 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11218 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11219 options.
11220
51938283
DK
112212009-11-25 Doug Kwan <dougkwan@google.com>
11222
11223 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11224 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11225 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11226 formatting.
11227 (Arm_relocate_functions::thm_call): Replace body with a call to
11228 Arm_relocate_functions::thumb_branch_common.
11229 (Arm_relocate_functions::thm_jump24,
11230 Arm_relocate_functions::thm_xpc22): New method definitions.
11231 (Arm_relocate_functions::thumb_branch_common): New method definition.
11232 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11233 operator.
11234 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11235 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11236
e2b8f3c4
RÁE
112372009-11-24 Rafael Avila de Espindola <espindola@google.com>
11238
11239 * Makefile.am: Build incremental-dump
11240 * Makefile.in: Regenerate.
11241 * incremental-dump.cc: New.
11242 * incremental.cc (Incremental_inputs_header_data,
11243 Incremental_inputs_entry_data): Move to incremental.h
11244 * incremental.h: (Incremental_inputs_header_data,
11245 Incremental_inputs_entry_data): Move from incremental.cc
11246
bcba9aec
RÁE
112472009-11-24 Rafael Avila de Espindola <espindola@google.com>
11248
11249 * incremental.cc (Incremental_inputs_header,
11250 Incremental_inputs_header_write, Incremental_inputs_entry,
11251 Incremental_inputs_entry_write): Add a typedef with the data type.
11252
7c3afe08
RÁE
112532009-11-24 Rafael Avila de Espindola <espindola@google.com>
11254
11255 * incremental.cc (Incremental_inputs_header,
11256 Incremental_inputs_header_write, Incremental_inputs_entry,
11257 Incremental_inputs_entry_write): Update comment about which
11258 type has the filed descriptions.
11259
d204b6e9
DK
112602009-11-15 Doug Kwan <dougkwan@google.com>
11261
11262 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11263 (Arm_relocate_functions::arm_branch_common): Change method defintion
11264 in class definition to a method declaration and update list of formal
11265 parameters.
11266 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11267 Arm_relocation_functions::jump24): Adjust call to
11268 Arm_relocate_functions::arm_branch_common. Update list of formal
11269 parameters.
11270 (Arm_relocate_functions::xpc25): New method definition.
11271 (Arm_relocate_functions::arm_branch_common): Move method defintion
11272 out from class definition. Use stubs for mode-switching and extending
11273 branch ranges.
11274 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11275 specially. Change code to enable use of stubs in ARM branches.
11276
43d12afe
DK
112772009-11-10 Doug Kwan <dougkwan@google.com>
11278
11279 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11280 in method declaration.
11281 (Target_arm::relocate_stub): New method declaration.
11282 (Target_arm::default_target): Change to return a pointer instead of
11283 a const reference.
11284 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11285 Target_arm::default_target.
11286 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11287 method definition.
11288 (Target_arm::relocate_section): Adjust view.
11289 (Target_arm::relocate_stub): New method definition.
11290
ac33a407
DK
112912009-11-10 Doug Kwan <dougkwan@google.com>
11292
11293 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11294 a format warning.
11295 * incremental.cc (open_incremental_binary): Initialized local
11296 variables to avoid warnings.
11297 * object.cc (make_elf_object): Ditto.
11298 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11299 a format warning.
e1df38aa 11300
88ee28e9
L
11301009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11302
11303 PR gold/10930
11304 * testsuite/plugin_test.c: Include "config.h".
11305
2daedcd6
DK
113062009-11-09 Doug Kwan <dougkwan@google.com>
11307
11308 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11309 (arm_symbol_value): Remove.
11310 (Arm_relocate_functions::arm_branch_common,
11311 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11312 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11313 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11314 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11315 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11316 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11317 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11318 Arm_relocate_functions::thm_mobw_abs_nc,
11319 Arm_relocate_functions::thm_mov_abs,
11320 Arm_relocate_functions::movw_prel_nc,
11321 Arm_relocate_functions::thm_movt_abs,
11322 Arm_relocate_functions::movt_prel,
11323 Arm_relocate_functions::thm_movw_prel_nc,
11324 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11325 (Target_arm::Relocate::relocate): Only decompose address into two
11326 parts if relocation type uses the thumb-bit and pass the actual
11327 bit instead of a flag indicating that the thumb-bit is used. Adjust
11328 calls to methods in Arm_relocate_functions for this change.
11329
1276bc89 113302009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11331
11332 PR 10925
11333 * reloc.cc: Instantiate
11334 Sized_relobj::initialize_input_to_output_maps and
11335 Sized_relobj:free_input_to_output_maps.
11336
e53ad1b5
ILT
113372009-11-06 Ian Lance Taylor <iant@google.com>
11338
11339 PR 10876
11340 * defstd.cc (in_segment): Set only_if_ref true for "end".
11341
eb44217c
DK
113422009-11-06 Doug Kwan <dougkwan@google.com>
11343
11344 * arm.cc (class Reloc_stub): Correct a comment.
11345 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11346 (Target_arm::scan_section_for_stubs): New method declaration.
11347 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11348 Change methods from private to protected.
11349 (Target_arm::do_may_relax): New method definition.
11350 (Target_arm::do_relax, Target_arm::group_sections,
11351 Target_arm::scan_reloc_for_stub,
11352 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11353 (Target_arm::arm_input_section_map_): New data member declaration.
11354 (Target_arm::scan_reloc_for_stub,
11355 Target_arm::scan_reloc_section_for_stubs,
11356 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11357 Target_arm::do_relax): New method definitions.
11358
5d329b7d
ILT
113592009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11360
11361 * configure.ac: Check for (struct stat)::st_mtim
11362 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11363 * config.in: Regenerate.
11364 * configure: Regenerate.
11365
96a0d71b
ILT
113662009-11-05 Ian Lance Taylor <iant@google.com>
11367
11368 PR 10910
11369 * output.cc (Output_segment::add_output_section): Add missing
11370 return statement.
11371
594c8e5e
ILT
113722009-11-04 Ian Lance Taylor <iant@google.com>
11373
11374 PR 10880
11375 * object.h (class Object): Add is_needed and set_is_needed
11376 methods. Add is_needed_ field. Make bool fields into bitfields.
11377 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11378 defined in a dynamic object and referenced by a regular object,
11379 set is_needed for the dynamic object.
11380 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11381 if the file is marked with as_needed and it is not needed.
11382
22b127cc
ILT
113832009-11-04 Ian Lance Taylor <iant@google.com>
11384
11385 PR 10887
11386 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11387 tags if data is discarded by linker script.
11388 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11389 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11390 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11391 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11392
f5c870d2
ILT
113932009-11-04 Ian Lance Taylor <iant@google.com>
11394
11395 * layout.cc (Layout::get_output_section): Add is_interp and
11396 is_dynamic_linker_section parameters. Change all callers.
11397 (Layout::choose_output_section): Likewise.
11398 (Layout::make_output_section): Likewise.
11399 (Layout::add_output_section_data): Add is_dynamic_linker_section
11400 parameter. Change all callers.
11401 * layout.h (class Layout): Update declarations.
11402 * output.h (class Output_section): Add is_interp, set_is_interp,
11403 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11404 Add is_interp_, is_dynamic_linker_section_ fields. Change
11405 generate_code_fills_at_write_ to a bitfield.
11406 * output.cc (Output_section::Output_sections): Initialize new
11407 fields.
11408 (Output_segment::add_output_section): Add do_sort parameter.
11409 Change all callers.
11410
1ae4d23b
ILT
114112009-11-03 Ian Lance Taylor <iant@google.com>
11412
11413 PR 10860
11414 * options.h (class General_options): Add --warn-common.
11415 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11416 merging two common symbols.
11417 (Symbol_table::should_override): Handle --warn-common when merging
11418 a common symbol with a defined symbol. Use report_resolve_problem
11419 for multiple definitions.
11420 (Symbol_table::report_resolve_problem): New function.
11421 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11422
55da9579
DK
114232009-11-03 Doug Kwan <dougkwan@google.com>
11424
11425 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11426 stub_factory_.
11427 (Target_arm::stub_factory): New method definition.
11428 (Target_arm::new_arm_input_section,
11429 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11430 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11431 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11432 New type definitions.
11433 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11434 member declarations.
11435 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11436 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11437 New method definitions.
11438
37a9ac43
ILT
114392009-11-03 Ian Lance Taylor <iant@google.com>
11440
11441 * options.h (class General_options): Add --warn_constructors.
11442
b3d6a3d4
ILT
114432009-11-03 Ian Lance Taylor <iant@google.com>
11444
11445 PR 10893
11446 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11447 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11448
934b01dd
ILT
114492009-11-03 Ian Lance Taylor <iant@google.com>
11450
11451 PR 10895
11452 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11453 --msgid-bugs-address.
11454 (install-pdf): New target.
11455 (install-data_yes): Look up one directory to find mkinstalldirs.
11456
03c1939b
L
114572009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11458
11459 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11460 tree.
11461
ebd95253
DK
114622009-10-30 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11465
e9bbb538
DK
114662009-10-30 Doug Kwan <dougkwan@google.com>
11467
11468 * arm.cc (Stub_addend_reader): New struct template definition
11469 and partial specializations.
11470 (Stub_addend_reader::operator()): New method definition for a
11471 partially specialized template.
11472
d5b40221
DK
114732009-10-30 Doug Kwan <dougkwan@google.com>
11474
11475 * arm.cc (Arm_relobj::processor_specific_flags): New method
11476 definition.
11477 (Arm_relobj::do_read_symbols): New method declaration.
11478 (Arm_relobj::processor_specific_flags_): New data member declaration.
11479 (Arm_dynobj): New class definition.
11480 (Target_arm::do_finalize_sections): Add input_objects parameter.
11481 (Target_arm::do_adjust_elf_header): New method declaration.
11482 (Target_arm::are_eabi_versions_compatible,
11483 (Target_arm::merge_processor_specific_flags): New method declaration.
11484 (Target_arm::do_make_elf_object): New overloaded method definitions
11485 and declaration.
11486 (Arm_relobj::do_read_symbols): New method definition.
11487 (Arm_dynobj::do_read_symbols): Ditto.
11488 (Target_arm::do_finalize_sections): Add input_objects parameters.
11489 Merge processor-specific flags from all input objects.
11490 (Target_arm::are_eabi_versions_compatible,
11491 Target_arm::merge_processor_specific_flags,
11492 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11493 New method definitions.
11494 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11495 Input_objects pointer type parameter.
11496 * layout.cc (Layout::finalize): Pass input objects to target's.
11497 finalize_sections function.
11498 * output.cc (Output_file_header::do_sized_write): Set ELF file
11499 header's processor-specific flags.
11500 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11501 Input_objects pointer type parameter.
11502 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11503 * target.h (Input_objects): New forward class declaration.
11504 (Target::processor_specific_flags,
11505 Target::are_processor_specific_flags_sect): New method definitions.
11506 (Target::finalize_sections): Add input_objects parameter.
11507 (Target::Target): Initialize processor_specific_flags_ and
11508 are_processor_specific_flags_set_.
11509 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11510 parameter.
11511 (Target::set_processor_specific_flags): New method definition.
11512 (Target::processor_specific_flags_,
11513 Target::are_processor_specific_flags_set_): New data member
11514 declarations.
11515 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11516 Input_objects pointer type parameter.
11517
ebabffbd
DK
115182009-10-30 Doug Kwan <dougkwan@google.com>
11519
11520 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11521
ad0f2072
ILT
115222009-10-28 Ian Lance Taylor <iant@google.com>
11523
11524 * object.h (class Relobj): Drop options parameter from
11525 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11526 do_scan_relocs, do_relocate. Change all callers.
11527 (class Sized_relobj): Drop options parameters from
11528 do_gc_process_relocs, do_scan_relocs, do_relocate,
11529 do_relocate_sections, relocate_sections, emit_relocs_scan,
11530 emit_relocs_scan_reltype. Change all callers.
11531 (struct Relocate_info): Remove options field and all references to
11532 it.
11533 * reloc.h (class Read_relocs): Remove options constructor
11534 parameter and options_ field. Change all callers.
11535 (class Gc_process_relocs, class Scan_relocs): Likewise.
11536 (class Relocate_task): Likewise.
11537 * target-reloc.h (scan_relocs): Remove options parameter. Change
11538 all callers.
11539 (scan_relocatable_relocs): Likewise.
11540 * target.h (class Sized_target): Remove options parameter from
11541 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11542 all callers.
11543 * gc.h (gc_process_relocs): Remove options parameter. Change all
11544 callers.
11545 * arm.cc: Update functions to remove options parameters.
11546 * i386.cc: Likewise.
11547 * powerpc.cc: Likewise.
11548 * sparc.cc: Likewise.
11549 * x86_64.cc: Likewise.
11550 * testsuite/testfile.cc: Likewise.
11551
8ffa3667
DK
115522009-10-28 Doug Kwan <dougkwan@google.com>
11553
11554 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11555 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11556 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11557 New method definitions.
11558
40f36857
CC
115592009-10-28 Cary Coutant <ccoutant@google.com>
11560
11561 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11562 (Plugin::cleanup_done_): New member.
11563 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11564 (Plugin_manager::cleanup_done_): Remove.
11565 (Plugin_manager::add_input_file): Edit error message.
11566 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11567 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11568
2c849493
ILT
115692009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11570
11571 * fileread.cc: (File_read::View::~View): Use the new
11572 data_ownership_ filed.
11573 (File_read::~File_read): Dispose the new whole_file_view_.
11574 (File_read::open): Mmap the whole file if needed.
11575 (File_read::open): Use whole_file_view_ instead of contents_.
11576 (File_read::find_view): Use whole_file_view_ if applicable.
11577 (File_read::do_read): Use whole_file_view_ instead of contents_.
11578 (File_read::make_view): Use whole_file_view_ instead of contents_,
11579 update File_read::View::View call.
11580 (File_read::find_or_make_view): Update File_read::View::View
11581 call.
11582 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11583 remove contents_
11584 (File_read::View::Data_ownership): New enum.
11585 (File_read::View::View): Replace bool mapped_ with Data_ownership
11586 argument.
11587 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11588 (File_read::View::data_ownership_): New field.
11589 (File_read::contents_): Remove (replaced by whole_file_view_).
11590 (File_read::whole_file_view_): New field.
11591 * options.h (class General_options): Add --keep-files-mapped.
11592
24998053
CC
115932009-10-27 Cary Coutant <ccoutant@google.com>
11594
11595 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11596 * testsuite/Makefile.am (plugin_test_5): New test case.
11597 * testsuite/Makefile.in: Regenerate.
11598
72adc4fa
DK
115992009-10-25 Doug Kwan <dougkwan@google.com>
11600
11601 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11602 from private to protected to allow access by child class.
11603 (Sized_relobj::do_relocate_sections): New method declaration.
11604 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11605 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11606 Sized_relobj::relocate_sections. Instantiate template explicitly
11607 for different target sizes and endianity.
11608
07f508a2
DK
116092009-10-24 Doug Kwan <dougkwan@google.com>
11610
11611 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11612 (Arm_input_section::as_arm_input_section): New method.
11613 (Arm_output_section): New class definition.
11614 (Arm_output_section::create_stub_group,
11615 Arm_output_section::group_sections): New method definitions.
11616
10ad9fe5
DK
116172009-10-22 Doug Kwan <dougkwan@google.com>
11618
11619 * arm.cc (Arm_input_section): New class definition.
11620 (Arm_input_section::init, Arm_input_section:do_write,
11621 Arm_input_section::set_final_data_size,
11622 Arm_input_section::do_reset_address_and_file_offset): New method
11623 definitions.
11624
56ee5e00
DK
116252009-10-21 Doug Kwan <dougkwan@google.com>
11626
11627 * arm.cc (Stub_table, Arm_input_section): New forward class
11628 declarations.
11629 (Stub_table): New class defintion.
11630 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11631 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11632 New method definition.
11633
b569affa
DK
116342009-10-21 Doug Kwan <dougkwan@google.com>
11635
11636 * arm.cc: Update copyright comments.
11637 (Target_arm): New forward class template declaration.
11638 (Arm_address): New type.
11639 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11640 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11641 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11642 constants.
11643 (Insn_template): Same.
11644 (DEF_STUBS): New macro.
11645 (Stub_type): New enum type.
11646 (Stub_template): New class definition.
11647 (Stub): Same.
11648 (Reloc_stub): Same.
11649 (Stub_factory): Same.
11650 (Target_arm::Target_arm): Initialize may_use_blx_ and
11651 should_force_pic_veneer_.
11652 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11653 Target_arm::should_force_pic_veneer,
11654 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11655 Target_arm::using_thumb_only, Target_arm:;default_target): New
11656 method defintions.
11657 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11658 New data member declarations.
11659 (Insn_template::size, Insn_template::alignment): New method defintions.
11660 (Stub_template::Stub_template): New method definition.
11661 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11662 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11663 (Stub_factory::Stub_factory): New method definition.
11664 * gold.h (string_hash): New template.
11665 * output.h (Input_section_specifier::hash_value): Use
11666 gold::string_hash.
11667 (Input_section_specifier::string_hash): Remove.
11668 * stringpool.cc (Stringpool_template::string_hash): Use
11669 gold::string_hash.
11670
6c172549
DK
116712009-10-20 Doug Kwan <dougkwan@google.com>
11672
11673 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11674 symbols of relaxed input sections.
11675 * output.h (Output_section::find_relaxed_input_section): Make
11676 method public.
11677
c5617f2f
DK
116782009-10-16 Doug Kwan <dougkwan@google.com>
11679
11680 * dynobj.cc (Versions::Versions): Initialize version_script_.
11681 Only insert base version symbol definition for a shared object
11682 if version script defines any version versions.
11683 (Versions::define_base_version): New method definition.
11684 (Versions::add_def): Check that base version is not needed.
11685 (Versions::add_need): Define base version lazily.
11686 * dynobj.h (Versions::define_base_version): New method declaration.
11687 (Versions::needs_base_version_): New data member declaration.
11688 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11689 (check_DATA): Add no_version_test.stdout.
11690 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11691 New make rules.
11692 * testsuite/Makefile.in: Regenerate.
11693 * testsuite/no_version_test.c: New file.
11694 * testsuite/no_version_test.sh: Ditto.
11695
3c12dcdb
DK
116962009-10-16 Doug Kwan <dougkwan@google.com>
11697
11698 * expression.cc (class Segment_start_expression): New class definition.
11699 (Segment_start_expression::value): New method definition.
11700 (script_exp_function_segment_start): Return a new
11701 Segment_start_expression.
11702 * gold/script-c.h (script_saw_segment_start_expression): New function
11703 prototype.
11704 * script-sections.cc (Script_sections::Script_sections): Initialize
11705 SAW_SEGMENT_START_EXPRESSION_ to false.
11706 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11707 and -Tbbs options to specify section addresses if given in
11708 command line and no SEGMENT_START expression is seen in a script.
11709 * script-sections.h (Script_sections::saw_segment_start_expression,
11710 Script_sections::set_saw_segment_start_expression): New method
11711 definition.
11712 (Script_sections::saw_segment_start_expression_): New data member
11713 declaration.
11714 * script.cc (script_saw_segment_start_expression): New function.
11715 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11716 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11717 script_test_7.sh and script_test_8.sh.
11718 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11719 script_test_8.stdout.
11720 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11721 (script_test_6, script_test_6.stdout, script_test_7,
11722 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11723 * Makefile.in: Regenerate.
11724 * testsuite/script_test_6.sh: New file.
11725 * testsuite/script_test_6.t: Same.
11726 * testsuite/script_test_7.sh: Same.
11727 * testsuite/script_test_7.t: Same.
11728 * testsuite/script_test_8.sh: Same.
11729
64b1ae37
DK
117302009-10-16 Doug Kwan <dougkwan@google.com>
11731
11732 * output.cc (Output_segment::set_section_list_address): Cast
11733 expressions to unsigned long long type to avoid format warnings.
11734
661be1e2
ILT
117352009-10-15 Ian Lance Taylor <iant@google.com>
11736
12edd763 11737 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11738 dot assignment to script_sections_.
12edd763
ILT
11739 * script-sections.cc (Script_sections::add_dot_assignment):
11740 Initialize if necessary.
11741
68b6574b
ILT
11742 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11743 program headers with no load segment if there is a linker script.
11744
661be1e2
ILT
11745 * layout.cc (Layout::set_segment_offsets): Align the file offset
11746 to the segment aligment for -N or -n with no load segment.
11747 * output.cc (Output_segment::add_output_section): Don't crash if
11748 the first section is a TLS section.
11749 (Output_segment::set_section_list_addresses): Print an error
11750 message if the address moves backward in a linker script.
11751 * script-sections.cc
11752 (Output_section_element_input::set_section_addresses): Don't
11753 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11754 (Orphan_output_section::set_section_addresses): Likewise.
11755
f15f61a7
DK
117562009-10-15 Doug Kwan <dougkwan@google.com>
11757
11758 * layout.cc (Layout::finish_dynamic_section): Generate tags
11759 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11760 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11761 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11762
82bb573a
ILT
117632009-10-14 Ian Lance Taylor <iant@google.com>
11764
11765 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11766 fields.
11767 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11768 data_shdr fields of relinfo.
11769 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11770 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11771 R_386_TLS_LDO_32, adjust based on section flags.
11772 (Target_i386::Relocate::fix_up_ldo): Remove.
11773
374ad285
ILT
117742009-10-13 Ian Lance Taylor <iant@google.com>
11775
11776 Add support for -pie.
11777 * options.h (class General_options): Add -pie and
11778 --pic-executable.
11779 (General_options::output_is_position_independent): Test -pie.
11780 (General_options::output_is_executable): Return true if not shared
11781 and not relocatable.
11782 (General_options::output_is_pie): Remove.
11783 * options.cc (General_options::finalize): Reject incompatible uses
11784 of -pie.
11785 * gold.cc (queue_middle_tasks): A -pie link is not static.
11786 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11787 * symtab.cc (Symbol::final_value_is_known): Return false if
11788 output_is_position_independent.
11789 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11790 output_is_position_independent.
11791 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11792 output_is_position_independent.
11793 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11794 output_is_position_independent.
11795 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11796 two_file_pie_test.
11797 (basic_pie_test.o, basic_pie_test): New targets.
11798 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11799 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11800 (two_file_pie_test): New target.
11801 * testsuite/Makefile.in: Rebuild.
11802 * README: Remove note saying that -pie is not supported.
11803
c6585162
ILT
118042009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11805
11806 * options.h (class General_options): Add -init and -fini.
11807 * layout.cc (Layout::finish_dynamic_section): Emit
11808 given init and fini functions.
11809
032ce4e9
ST
118102009-10-13 Sriraman Tallam <tmsriram@google.com>
11811
11812 * gc.h (gc_process_relocs): Check if icf is enabled using new
11813 function.
11814 * gold.cc (queue_initial_tasks): Likewise.
11815 (queue_middle_tasks): Likewise.
11816 * object.cc (do_layout): Likewise.
11817 * symtab.cc (is_section_folded): Likewise.
11818 * main.cc (main): Likewise.
11819 * reloc.cc (Read_relocs::run): Likewise.
11820 (Sized_relobj::do_scan_relocs): Likewise.
11821 * icf.cc (is_function_ctor_or_dtor): New function.
11822 (Icf::find_identical_sections): Check if function is ctor or dtor when
11823 safe icf is chosen.
11824 * options.h (General_options::icf): Change option to be an enum.
11825 (Icf_status): New enum.
11826 (icf_enabled): New method.
11827 (icf_safe_folding): New method.
11828 (set_icf_status): New method.
11829 (icf_status_): New variable.
11830 * (options.cc) (General_options::finalize): Set icf_status_.
11831 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11832 icf_test and icf_keep_unique_test to use the --icf enum flag.
11833 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11834 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11835
f345227a
ST
118362009-10-12 Sriraman Tallam <tmsriram@google.com>
11837
11838 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11839 includes to gc.h and icf.h.
11840 * arm.cc: Include gc.h.
11841 * gold.cc: Likewise.
11842 * i386.cc: Likewise.
11843 * powerpc.cc: Likewise.
11844 * sparc.cc: Likewise.
11845 * x86_64.cc: Likewise.
11846 * gc.h: Include icf.h.
11847
1c7814ed
ILT
118482009-10-11 Ian Lance Taylor <iant@google.com>
11849
11850 * plugin.cc: Include "gold.h" before other header files.
11851
ae3b5189
CD
118522009-10-10 Chris Demetriou <cgd@google.com>
11853
11854 * options.h (Input_file_argument::Input_file_type): New enum.
11855 (Input_file_argument::is_lib_): Replace with...
11856 (Input_file_argument::type_): New member.
11857 (Input_file_argument::Input_file_argument): Take Input_file_type
11858 'type' rather than boolean 'is_lib' as second argument.
11859 (Input_file_argument::is_lib): Use type_.
11860 (Input_file_argument::is_searched_file): New function.
11861 (Input_file_argument::may_need_search): Handle is_searched_file.
11862 * options.cc (General_options::parse_library): Support -l:filename.
11863 (General_options::parse_just_symbols): Update for Input_file_argument
11864 changes.
11865 (Command_line::process): Likewise.
11866 * archive.cc (Archive::get_file_and_offset): Likewise.
11867 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11868 * script.cc (read_script_file, script_add_file): Likewise.
11869 * fileread.cc (Input_file::Input_file): Likewise.
11870 (Input_file::will_search_for): Handle is_searched_file.
11871 (Input_file::open): Likewise.
11872 * readsyms.cc (Read_symbols::get_name): Likewise.
11873 * testsuite/Makefile.am (searched_file_test): New test.
11874 * testsuite/Makefile.in: Regenerate.
11875 * testsuite/searched_file_test.cc: New file.
11876 * testsuite/searched_file_test_lib.cc: New file.
11877
f3048a1d
ILT
118782009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11879 Ian Lance Taylor <iant@google.com>
11880
11881 * descriptor.cc: Include <cstdio> and "binary-io.h".
11882 (Descriptors::open): Open the files in binary mode always.
11883 * script.cc (Lex::get_token): Treat \r as whitespace.
11884
d4780e57
ILT
118852009-10-09 Ian Lance Taylor <iant@google.com>
11886
11887 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11888
d9a893b8
ILT
118892009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11890 Ian Lance Taylor <iant@google.com>
11891
11892 * configure.ac: Check for readv function also.
11893 * fileread.cc (readv): Define if not HAVE_READV.
11894 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11895 does not exist.
11896 * config.in: Regenerate.
11897 * configure: Regenerate.
11898
c0a62865
DK
118992009-10-09 Doug Kwan <dougkwan@google.com>
11900
11901 * layout.cc (Layout::make_output_section): Call target hook to make
11902 ordinary output section.
11903 (Layout::finalize): Adjust parameter list of call the
11904 Target::may_relax().
11905 * layout.h (class Layout::section_list): New method.
11906 * merge.h (Output_merge_base::entsize): Change visibility to public.
11907 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11908 New methods.
11909 (Output_merge_string::do_is_string): New method.
11910 * object.cc (Sized_relobj::do_setup): renamed from
11911 Sized_relobj::set_up.
11912 * object.h (Sized_relobj::adjust_shndx,
11913 Sized_relobj::initializ_input_to_output_maps,
11914 Sized_relobj::free_input_to_output_maps): Change visibilities to
11915 protected.
11916 (Sized_relobj::setup): Virtualize.
11917 (Sized_relobj::do_setup): New method declaration.
11918 (Sized_relobj::invalidate_section_offset,
11919 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11920 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11921 * options.cc (parse_int): New function.
11922 * options.h (parse_int): New declaration.
11923 (DEFINE_int): New macro.
11924 (stub_group_size): New option.
11925 * output.cc (Output_section::Output_section): Initialize memebers
11926 merge_section_map_, merge_section_by_properties_map_,
11927 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11928 (Output_section::add_input_section): Handled deferred code-fill
11929 generation and remove an old comment.
11930 (Output_section::add_relaxed_input_section): New method definition.
11931 (Output_section::add_merge_input_section): Use merge section by
11932 properties map to speed to search. Update merge section maps
11933 as appropriate.
11934 (Output_section::build_relaxation_map): New method definition.
11935 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11936 Same.
11937 (Output_section::relax_input_section): Renamed to
11938 Output_section::convert_input_sections_to_relaxed_sections and change
11939 interface to take a vector of pointers to relaxed sections.
11940 (Output_section::find_merge_section,
11941 Output_section::find_relaxed_input_section): New method definitions.
11942 (Output_section::is_input_address_mapped,
11943 Output_section::output_offset, Output_section::output_address):
11944 Use output section data maps to speed up searching.
11945 (Output_section::find_starting_output_address): Add comments.
11946 (Output_section::do_write,
11947 Output_section::write_to_postprocessing_buffer): Do code-fill
11948 generation as appropriate.
11949 (Output_section::get_input_sections): Invalidate relaxed input section
11950 map.
11951 (Output_section::restore_states): Adjust type of checkpoint .
11952 Invalidate relaxed input section map.
11953 * output.h (Output_merge_base): New class declaration.
11954 (Input_section_specifier): New class defintion.
11955 (class Output_relaxed_input_section) Change base class to
11956 Output_section_data_build.
11957 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11958 base class initializer.
11959 (Output_section::add_relaxed_input_section): New method declaration.
11960 (Output_section::Input_section): Change visibility to protected.
2e702c99 11961 (Output_section::Input_section::relobj,
c0a62865
DK
11962 Output_section::Input_section::shndx): Handle relaxed input sections.
11963 Output_section::input_sections) Change visibility to protected. Also
11964 define overload to return a non-const pointer.
11965 (Output_section::Merge_section_properties): New class defintion.
11966 (Output_section::Merge_section_by_properties_map,
11967 Output_section::Output_section_data_by_input_section_map,
11968 Output_section::Relaxation_map): New types.
11969 (Output_section::relax_input_section): Rename method to
11970 Output_section::convert_input_sections_to_relaxed_sections and change
11971 interface to take a vector of relaxed section pointers.
11972 (Output_section::find_merge_section,
11973 Output_section::find_relaxed_input_section,
11974 Output_section::build_relaxation_map,
11975 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11976 New method declarations.
11977 (Output_section::merge_section_map_
11978 Output_section::merge_section_by_properties_map_,
11979 Output_section::relaxed_input_section_map_,
11980 Output_section::is_relaxed_input_section_map_valid_,
11981 Output_section::generate_code_fills_at_write_): New data members.
11982 * script-sections.cc
11983 (Output_section_element_input::set_section_addresses): Call
11984 current_data_size and addralign methods of relaxed input sections.
11985 (Orphan_output_section::set_section_addresses): Call current_data_size
11986 and addralign methods of relaxed input sections.
11987 * symtab.cc (Symbol_table::compute_final_value): Extract template
11988 from the body of Symbol_table::sized_finalize_symbol.
11989 (Symbol_table::sized_finalized_symbol): Call
11990 Symbol_table::compute_final_value.
11991 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11992 (Symbol_table::compute_final_value): New templated method declaration.
11993 * target.cc (Target::do_make_output_section): New method defintion.
11994 * target.h (Target::make_output_section): New method declaration.
11995 (Target::relax): Add more parameters for input objects, symbol table
11996 and layout. Adjust call to do_relax.
11997 (Target::do_make_output_section): New method declaration.
11998 (Target::do_relax): Add parameters for input objects, symbol table
11999 and layout.
12000
d446d6c4
ILT
120012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12002
12003 * pread.c: Include stdio.h.
12004
bc06c745
ILT
120052009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12006
12007 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12008 defined.
12009
75aea3d0
ILT
120102009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12011
12012 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12013 Change read_shndx type to unsigned int.
12014 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12015 int.
12016 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12017 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12018 Change read_shndx type to unsigned int.
12019 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12020 int.
12021 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12022 * layout.cc (Layout::create_symtab_sections): Cast the result of
12023 local_symcount * symsize to off_t in the gold_assert.
12024
be8fcb75
ILT
120252009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12026
12027 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12028 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12029 R_ARM_BASE_ABS.
12030 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12031 (Arm_relocate_functions::thm_abs5): New function.
12032 (Arm_relocate_functions::abs12): New function.
12033 (Arm_relocate_functions::abs16): New function.
12034 (Arm_relocate_functions::base_abs): New function.
12035 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12036 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12037 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12038 R_ARM_BASE_ABS.
12039 (Scan::global): Likewise.
12040 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12041 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12042 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12043 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12044 R_ARM_BASE_ABS.
12045
c2a122b6
ILT
120462009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12047
12048 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12049 (Arm_relocate_functions::movt_prel): New function.
12050 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12051 (Arm_relocate_functions::thm_movt_prel): New function.
12052 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12053 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12054 (Scan::global, Relocate::relocate): Likewise.
12055 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12056
c4aa1e2d
ILT
120572009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12058
12059 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12060 Incremental_checker.
12061 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12062 unsigned int.
12063 (class Incremental_inputs_header): New class.
12064 (Incremental_inputs_header_writer): Edit comment.
12065 (Incremental_inputs_entry): New class.
12066 (Incremental_inputs_entry_writer): Edit comment.
12067 (Sized_incremental_binary::do_find_incremental_inputs_section):
12068 Add *strtab_shndx parameter, fill it.
12069 (Sized_incremental_binary::do_check_inputs): New method.
12070 (Incremental_checker::can_incrementally_link_output_file): Use
12071 Sized_incremental_binary::check_inputs.
12072 (Incremental_inputs::report_command_line): Save command line in
12073 command_line_.
12074 * incremental.h:
12075 (Incremental_binary::find_incremental_inputs_section): New
12076 method.
12077 (Incremental_binary::do_find_incremental_inputs_section): Add
12078 strtab_shndx parameter.
12079 (Incremental_binary::do_check_inputs): New pure virtual method.
12080 (Sized_incremental_binary::do_check_inputs): Declare.
12081 (Incremental_checker::Incremental_checker): Add incremental_inputs
12082 parameter, use it to initialize incremental_inputs_.
12083 (Incremental_checker::incremental_inputs_): New field.
12084 (Incremental_checker::command_line): New method.
12085 (Incremental_checker::inputs): New method.
12086 (Incremental_checker::command_line_): New field.
12087
c549a694
ILT
120882009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12089
12090 * incremental.cc: Include <cstdarg> and "target-select.h".
12091 (vexplain_no_incremental): New function.
12092 (explain_no_incremental): New function.
12093 (Incremental_binary::error): New method.
12094 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12095 method.
12096 (make_sized_incremental_binary): New function.
12097 (open_incremental_binary): New function.
12098 (can_incrementally_link_file): Add checks if output is ELF and has
12099 inputs section.
12100 * incremental.h: Include "elfcpp_file.h" and "output.h".
12101 (Incremental_binary): New class.
12102 (Sized_incremental_binary): New class.
12103 (open_incremental_binary): Declare.
12104 * object.cc (is_elf_object): Use
12105 elfcpp::Elf_recognizer::is_elf_file.
12106 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12107 * output.h (Output_file::filesize): New method.
12108
fd3c5f0b
ILT
121092009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12110
12111 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12112 New function.
12113 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12114 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12115 function.
12116 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12117 function.
12118 (Arm_relocate_functions::movw_abs_nc): New function.
12119 (Arm_relocate_functions::movt_abs): New function.
12120 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12121 (Arm_relocate_functions::thm_movt_abs): New function.
12122 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12123 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12124 (Scan::global): Likewise.
12125 (Relocate::relocate): Likewise.
12126 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12127
7f5309a5
ILT
121282009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12129
12130 * arm.cc (Arm_relocate_functions::got_prel) New function.
12131 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12132 (Relocate::relocate): Likewise.
12133 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12134
364c7fa5
ILT
121352009-10-06 Ian Lance Taylor <iant@google.com>
12136
12137 * options.h (class General_options): Define
12138 split_stack_adjust_size parameter.
12139 * object.h (class Object): Add uses_split_stack_ and
12140 has_no_split_stack_ fields. Add uses_split_stack and
12141 has_no_split_stack accessor functions. Declare
12142 handle_split_stack_section.
12143 (class Reloc_symbol_changes): Define.
12144 (class Sized_relobj): Define Function_offsets. Declare
12145 split_stack_adjust, split_stack_adjust_reltype, and
12146 find_functions.
12147 * object.cc (Object::handle_split_stack_section): New function.
12148 (Sized_relobj::do_layout): Call handle_split_stack_section.
12149 * dynobj.cc (Sized_dynobj::do_layout): Call
12150 handle_split_stack_section.
12151 * reloc.cc (Sized_relobj::relocate_sections): Call
12152 split_stack_adjust for executable sections in split_stack
12153 objects. Pass reloc_map to relocate_section.
12154 (Sized_relobj::split_stack_adjust): New function.
12155 (Sized_relobj::split_stack_adjust_reltype): New function.
12156 (Sized_relobj::find_functions): New function.
12157 * target-reloc.h: Include "object.h".
12158 (relocate_section): Add reloc_symbol_changes parameter. Change
12159 all callers.
12160 * target.h (class Target): Add calls_non_split method. Declare
12161 do_calls_non_split virtual method. Declare match_view and
12162 set_view_to_nop.
12163 * target.cc: Include "elfcpp.h".
12164 (Target::do_calls_non_split): New function.
12165 (Target::match_view): New function.
12166 (Target::set_view_to_nop): New function.
12167 * gold.cc (queue_middle_tasks): Give an error if mixing
12168 split-stack and non-split-stack objects with -r.
12169 * i386.cc (Target_i386::relocate_section): Add
12170 reloc_symbol_changes parameter.
12171 (Target_i386::do_calls_non_split): New function.
12172 * x86_64.cc (Target_x86_64::relocate_section): Add
12173 reloc_symbol_changes parameter.
12174 (Target_x86_64::do_calls_non_split): New function.
12175 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12176 parameter.
12177 * powerpc.cc (Target_powerpc::relocate_section): Add
12178 reloc_symbol_changes parameter.
12179 * sparc.cc (Target_sparc::relocate_section): Add
12180 reloc_symbol_changes parameter.
12181 * configure.ac: Call AM_CONDITIONAL for the default target.
12182 * configure: Rebuild.
12183 * testsuite/Makefile.am (TEST_AS): New variable.
12184 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12185 (check_DATA): Add split_i386 and split_x86_64 files.
12186 (SPLIT_DEFSYMS): Define.
12187 (split_i386_[1234n].o): New targets.
12188 (split_i386_[124]): New targets.
12189 (split_i386_[1234r].stdout): New targets.
12190 (split_x86_64_[1234n].o): New targets.
12191 (split_x86_64_[124]): New targets.
12192 (split_x86_64_[1234r].stdout): New targets.
12193 (MOSTLYCLEANFILES): Add new executables.
12194 * testsuite/split_i386.sh: New file.
12195 * testsuite/split_x86_64.sh: New file.
12196 * testsuite/split_i386_1.s: New file.
12197 * testsuite/split_i386_2.s: New file.
12198 * testsuite/split_i386_3.s: New file.
12199 * testsuite/split_i386_4.s: New file.
12200 * testsuite/split_i386_n.s: New file.
12201 * testsuite/split_x86_64_1.s: New file.
12202 * testsuite/split_x86_64_2.s: New file.
12203 * testsuite/split_x86_64_3.s: New file.
12204 * testsuite/split_x86_64_4.s: New file.
12205 * testsuite/split_x86_64_n.s: New file.
12206 * testsuite/testfile.cc (Target_test): Update relocation_section
12207 function.
12208 * testsuite/Makefile.in: Rebuild.
12209
e8a9fcda
ILT
122102009-10-06 Ian Lance Taylor <iant@google.com>
12211
12212 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12213 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12214 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12215 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12216 the address on ldo_addrs_.
12217 (Target_i386::Relocate::fix_up_ldo): New function.
12218
e99daf92
ILT
122192009-10-06 Rafael Espindola <espindola@google.com>
12220
12221 * plugin.cc (add_input_library): New.
12222 (Plugin::load): Add add_input_library to tv.
12223 (Plugin_manager::add_input_file): Add the is_lib argument.
12224 (add_input_file): Update call to Plugin_manager::add_input_file.
12225 (add_input_library): New.
12226 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12227
966d4097
DK
122282009-09-30 Doug Kwan <dougkwan@google.com>
12229
12230 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12231 symbol and call Symbol::may_need_copy_reloc to determine if
12232 a copy reloc is needed.
12233 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12234 nocopyreloc is given in command line.
12235 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12236 given in command line.
12237 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12238 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12239 of the removed Target_i386::may_need_copy_reloc.
12240 * options.h (copyreloc): New option with default value false.
12241 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12242 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12243 instead of the removed Target_powerpc::may_need_copy_reloc.
12244 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12245 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12246 instead of the removed Target_sparc::may_need_copy_reloc.
12247 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12248 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12249 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12250 instead of the removed Target_x86_64::may_need_copy_reloc.
12251
029ba973
ILT
122522009-09-30 Ian Lance Taylor <iant@google.com>
12253
12254 * object.h (class Object): Remove target_ field, and target,
12255 sized_target, and set_target methods.
12256 (Object::sized_target): Remove.
12257 (class Sized_relobj): Update declarations. Remove sized_target.
12258 * object.cc (Sized_relobj::setup): Remove target parameter.
12259 Change all callers.
12260 (Input_objects::add_object): Don't do anything with the target.
12261 (make_elf_sized_object): Add punconfigured parameter. Change all
12262 callers. Set or test parameter target.
12263 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12264 Change all callers.
12265 * parameters.cc (Parameters::set_target): Change parameter type to
12266 be non-const.
12267 (Parameters::default_target): Remove.
12268 (set_parameters_target): Change parameter type to be non-const.
12269 (parameters_force_valid_target): New function.
12270 (parameters_clear_target): New function.
12271 * parameters.h (class Parameters): Update declarations. Remove
12272 default_target method. Add sized_target and clear_target
12273 methods. Change target_ to be non-const.
12274 (set_parameters_target): Update declaration.
12275 (parameters_force_valid_target): Declare.
12276 (parameters_clear_target): Declare.
12277 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12278 as NULL if we aren't searching.
12279 (Add_symbols::run): Don't check for compatible target.
12280 * fileread.cc (Input_file::open_binary): Call
12281 parameters_force_valid_target.
12282 * gold.cc (queue_middle_tasks): Likewise.
12283 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12284 set_target on object.
12285 * dynobj.h (class Sized_dynobj): Update declarations.
12286 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12287 make_elf_object returns NULL.
12288 (Archive::include_member): Don't check whether object target is
12289 compatible.
12290 * output.cc (Output_section::add_input_section): Get target from
12291 parameters.
12292 (Output_section::relax_input_section): Likewise.
12293 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12294 parameters.
12295 (Sized_relobj::do_scan_relocs): Likewise.
12296 (Sized_relobj::relocate_sections): Likewise.
12297 * resolve.cc (Symbol_table::resolve): Likewise.
12298 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12299 parameter. Change all callers.
12300 (Symbol_table::add_from_object): Get target from parameters.
12301 (Symbol_table::add_from_relobj): Don't check object target.
12302 (Symbol_table::add_from_dynobj): Likewise.
12303 (Symbol_table::define_special_symbol): Get target from
12304 parameters.
12305 * symtab.h (class Symbol_table): Update declaration.
12306 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12307 parameter. Change all callers. Clear parameter target.
12308 (Binary_test): Test target here.
12309 * testsuite/object_unittest.cc (gold_testsuite): Remove
12310 target_test_pointer parameter. Change all callers.
12311 (Object_test): Test target here.
12312
a6a22b83
ILT
123132009-09-26 Ian Lance Taylor <iant@google.com>
12314
12315 * testsuite/initpri1.c: Don't try to use constructor priorities if
12316 compiling with gcc before 4.3.
12317
6a8f49fe
ILT
123182009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12319
12320 * testsuite/retain_symbols_file_test.sh (check_present): Change
12321 output file name to retain_symbols_file_test.stdout.
12322 (check_absent): Likewise.
12323
8c604651
CS
123242009-09-18 Craig Silverstein <csilvers@google.com>
12325
12326 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12327 * options.cc: Include <cerrno> and <fstream>.
12328 (General_options::finalize): Parse -retain-symbols-file tag.
12329 * options.h: New flag.
12330 (General_options): New method should_retain_symbol, new
12331 variable symbols_to_retain.
12332 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12333 should_retain_symbol map.
12334 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12335 * testsuite/Makefile.in: Regenerate.
12336 * testsuite/retain_symbols_file_test.sh: New file.
12337
ca58b19f
NC
123382009-09-18 Nick Clifton <nickc@redhat.com>
12339
12340 * po/es.po: Updated Spanish translation.
12341
20e6d0d6
DK
123422009-09-17 Doug Kwan <dougkwan@google.com>
12343
12344 * debug.h (DEBUG_RELAXATION): New constant.
12345 (DEBUG_ALL): Add DEBUG_RELAXATION.
12346 (debug_string_to_enum): Add relaxation debug option.
12347 * layout.cc
12348 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12349 Layout::Relaxation_debug_check::read_sections,
12350 Layout::Relaxation_debug_check::read_sections): New method definitions.
12351 (Layout::Layout): Initialize data members
12352 record_output_section_data_from_scrips_,
12353 script_output_section_data_list_ and relaxation_debug_check_.
12354 (Layout::save_segments, Layout::restore_segments,
12355 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12356 Layout::relaxation_loop_body): New method definitions.
12357 (Layout::finalize): Support relaxation. Move section layout code to
12358 Layout::relaxation_loop_body.
12359 (Layout::set_asection_address_from_script): Move code for orphan
12360 section placement out.
12361 (Layout::place_orphan_sections_in_script): New method definition.
12362 * layout.h (Output_segment_headers, Output_file_header):
12363 New forward class declarations.
12364 (Layout::~Layout): Define.
12365 (Layout::new_output_section_data_from_script): New method definition.
12366 (Layout::place_orphan_sections_in_script): New method declaration.
12367 (Layout::Segment_states): New type declaration.
12368 (Layout::save_segments, Layout::restore_segments,
12369 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12370 Layout::relaxation_loop_body): New method declarations.
12371 (Layout::Output_section_data_list): New type declaration.
12372 (Layout::Relaxation_debug_check): New class definition.
12373 (Layout::record_output_section_data_from_script_,
12374 Layout::script_output_section_data_list_, Layout::segment_states_,
12375 Layout::relaxation_debug_check_): New data members.
12376 * output.cc: (Output_section_headers::do_size): New method definition.
12377 (Output_section_headers::Output_section_headers): Move size
12378 computation to Output_section_headers::do_size.
12379 (Output_segment_headers::do_size): New method definition.
e1df38aa 12380 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12381 Output_file_header::do_size and call it.
12382 (Output_file_header::do_size): New method definition.
12383 (Output_data_group::Output_data_group): Adjust call to
12384 Output_section_data.
12385 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12386 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12387 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12388 RELAXED_INPUT_SECTION_CODE.
12389 (Output_section::Output_section): Initialize data member checkpoint_.
12390 (Output_section::~Output_section): Delete checkpoint object pointed
12391 by checkpoint_.
12392 (Output_section::add_input_section): Always add an Input_section if
12393 relaxing.
12394 (Output_section::add_merge_input_section): Add assert.
12395 (Output_section::relax_input_section): New method definition.
12396 (Output_section::set_final_data_size): Set load address to zero for
12397 an unallocated section.
12398 (Output_section::do_address_and_file_offset_have_reset_values):
12399 New method definition.
12400 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12401 Handle relaxed input section.
12402 (Output_section::sort_attached_input_sections): Checkpoint input
12403 section list lazily.
12404 (Output_section::get_input_sections): Change type of input_sections to
12405 list of Simple_input_section pointers. Checkpoint input section list
12406 lazily. Also handle relaxed input sections.
12407 (Output_section::add_input_section_for_script): Take a reference to
12408 a Simple_input_section object instead of Relobj pointer and section
12409 index as parameter. Handle relaxed input sections.
12410 (Output_section::save_states, Output_section::restore_states): New
12411 method definitions.
12412 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12413 (Output_data::is_data_size_fixed): New method definition.
12414 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12415 if it is fixed.
12416 (Output_data::address_and_file_offset_have_reset_values): New method
12417 definition.
12418 (Output_data::do_address_and_file_offset_have_reset_values): New method
12419 definition.
12420 (Output_data::set_data_size): Check that data size is not fixed.
12421 (Output_data::fix_data_size): New method definition.
12422 (Output_data::is_data_size_fixed_): New data member.
12423 (Output_section_headers::set_final_data_size): New method definition.
12424 (Output_section_headers::do_size): New method declaration.
12425 (Output_segment_headers::set_final_data_size): New method definition.
12426 (Output_segment_headers::do_size): New method declaration.
12427 (Output_file_header::set_final_data_size)::New method definition.
12428 (Output_file_header::do_size)::New method declaration.
12429 (Output_section_data::Output_section_data): Add new parameter
12430 is_data_size_fixed and use it to fix data size.
12431 (Output_data_const::Output_data_const): Adjust call to base class
12432 constructor and fix data size.
12433 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12434 base class constructor and fix data size.
12435 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12436 base class constructor and fix data size.
12437 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12438 class constructor and fix data size.
12439 (Output_data_group::set_final_data_size): New method definition.
12440 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12441 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12442 class constructor and fix data size.
12443 (Output_relaxed_input_section): New class definition.
12444 (Output_section::Simple_input_section): New class definition.
12445 (Output_section::get_input_sections): Adjust parameter list.
12446 (Output_section::add_input_section_for_script): Same.
12447 (Output_section::save_states, Output_section::restore_states,
12448 Output_section::do_address_and_file_offset_have_reset_values,
12449 (Output_section::Input_section::Input_section): Handle
12450 RELAXED_INPUT_SECTION_CODE. Add new overload for
12451 Output_relaxed_input_section.
12452 (Output_section::Input_section::is_input_section,
12453 Output_section::Input_section::set_output_section): Handle relaxed
12454 input section.
12455 (Output_section::Input_section::is_relaxed_input_section,
12456 Output_section::Input_section::output_section_data,
12457 Output_section::Input_section::relaxed_input_section): New method
12458 definitions.
12459 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12460 value.
12461 (Output_section::Input_section::u1_): Update comments.
12462 (Output_section::Input_section::u2_): Add new union member poris.
12463 (Output_section::Checkpoint_output_section): New classs definition.
12464 (Output_section::relax_input_section): New method declaration.
12465 (Output_section::checkpoint_): New data member.
12466 (Output_segment): Update comments.
12467 (Output_segment::Output_segment): Un-privatize copy constructor.
12468 (Output_segment::operator=): Un-privatize.
12469 * script-sections.cc (Output_section_element::Input_section_list):
12470 Change element type to Output_section::Simple_input_section.
12471 (Output_section_element_dot_assignment::set_section_addresses):
12472 Register output section data for relaxation clean up.
12473 (Output_data_exression::Output_data_expression): Adjust call to base
12474 constructor to fix data size.
12475 (Output_section_element_data::set_section_addresses): Register
12476 Output_data_expression object for relaxation clean up.
12477 (struct Input_section_info): Replace Relobj pointer and section index
12478 pair with Output_section::Simple_input_section and Convert struct to a
12479 class.
12480 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12481 Input_section_info data member to use accessors.
20e6d0d6
DK
12482 (Output_section_element_input::set_section_addresses): Use layout
12483 parameter. Adjust code to use Output_section::Simple_input_section
12484 and Input_secction_info classes. Register filler for relaxation
12485 clean up.
12486 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12487 and section index pair with Output_section::Simple_input_section
12488 class. Adjust code accordingly.
12489 (Phdrs_element::release_segment): New method definition.
12490 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12491 segment list.
12492 (Script_sections::release_segments): New method definition.
12493 * gold/script-sections.h (Script_sections::release_segments): New
12494 method declaration.
12495 * gold/target.h (Target::may_relax, Target::relax,
12496 Target::do_may_relax, Target::do_relax): New method definitions.
12497
5e445df6
ILT
124982009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12499
12500 * arm.cc (has_signed_unsigned_overflow): New function.
12501 (Arm_relocate_functions::abs8): New function.
12502 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12503 (Target_arm::Scan::global): Likewise.
12504 (Target_arm::relocate::relocate): Likewise.
12505 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12506 Likewise.
12507
8c604651 125082009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12509
12510 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12511 * testsuite/Makefile.in: Regenerate.
12512
1e9cc1c2
NC
125132009-09-11 Nick Clifton <nickc@redhat.com>
12514
12515 * po/gold.pot: Updated by the Translation project.
12516
6a89f575
CC
125172009-09-08 Cary Coutant <ccoutant@google.com>
12518
12519 * output.cc (Output_file::open): Add execute permission to empty file.
12520 * testsuite/Makefile.am (permission_test): New test.
12521 * testsuite/Makefile.in: Regenerate.
12522
fdcac5af
ILT
125232009-09-02 Ian Lance Taylor <iant@google.com>
12524
12525 * output.cc (Output_file::resize): Call map_no_anonymous rather
12526 than map.
12527
44453f85
ILT
125282009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12529
12530 * gold.cc: Include "incremental.h".
12531 (queue_initial_tasks): Call Incremental_checker methods.
12532 * incremental.cc: Include "output.h".
12533 (Incremental_checker::can_incrementally_link_output_file): New
12534 method.
12535 * incremental.h (Incremental_checker): New class.
12536
12537 * output.cc (Output_file::open_for_modification): New method.
12538 (Output_file::map_anonymous): Changed return type to bool. Record
12539 map in base_ field.
12540 (Output_file::map_no_anonymous): New method, broken out of map.
12541 (Output_file::map): Use map_no_anonymous and map_anonymous.
12542 * output.h (class Output_file): Update declarations.
12543
293c1386
CC
125442009-08-24 Cary Coutant <ccoutant@google.com>
12545
12546 * options.h (Command_line::Pre_options): New class.
12547 (Command_line::pre_options): New member.
12548 * options.cc (gold::options::ready_to_register): New variable.
12549 (One_option::register_option): Do nothing if not registering options.
12550 Assert if same short option registered twice.
12551 (General_options::General_options): Turn off option registration when
12552 done constructing.
12553 (Command_line::Pre_options::Pre_options): New constructor.
12554
f773f3d2
CC
125552009-08-24 Cary Coutant <ccoutant@google.com>
12556
06a73cfe
CC
12557 * options.h (General_options::no_keep_memory): Remove incorrect
12558 short option.
f773f3d2 12559
a15af8e2
RW
125602009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12561
12562 * Makefile.am (am__skiplex, am__skipyacc): New.
12563 * Makefile.in: Regenerate.
12564
c462b41b
RW
125652009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12566
14ec8efd
RW
12567 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12568 (INCLUDES): ... this.
12569 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12570 (AM_CPPFLAGS): Renamed from ...
12571 (INCLUDE): ... this.
12572 * Makefile.in, testsuite/Makefile.in: Regenerate.
12573
81ecdfbb
RW
12574 * Makefile.in: Regenerate.
12575 * aclocal.m4: Likewise.
12576 * config.in: Likewise.
12577 * configure: Likewise.
12578 * testsuite/Makefile.in: Likewise.
12579
c462b41b
RW
12580 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12581 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12582 * Makefile.in: Regenerate.
12583 * testsuite/Makefile.in: Regenerate.
12584
2da73f13
CC
125852009-08-19 Cary Coutant <ccoutant@google.com>
12586
12587 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12588 symbols in shared libraries overridden by hidden or internal symbols
12589 in the main program.
12590
2db70501
CD
125912009-08-19 Chris Demetriou <cgd@google.com>
12592
12593 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12594 checking source file names in error messages.
12595
f733487b
DK
125962009-08-18 Doug Kwan <dougkwan@google.com>
12597
12598 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12599 an elcpp::Ehdr as parameter. Adjust call to set_target.
12600 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12601 an elfcpp::Ehdr as parameter.
12602 * object.cc (Object::set_target): Remove the version that looks up
12603 a target and sets it.
12604 (Sized_relobj::setup): Take a Target object instead of
12605 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12606 (make_elf_sized_object): Find target and ask target to
12607 make an ELF object.
12608 * object.h: (Object::set_target): Remove the version that looks up
12609 a target and sets it.
12610 (Sized_relobj::setup): Take a Target object instead of
12611 an elfcpp:Ehdr as parameter.
12612 * target.cc: Include dynobj.h.
12613 (Target::do_make_elf_object_implementation): New.
2e702c99 12614 (Target::do_make_elf_object): New.
f733487b
DK
12615 * target.h (Target::make_elf_object): New template declaration.
12616 (Target::do_make_elf_object): New method declarations.
12617 (Target::do_make_elf_object_implementation): New template declaration.
12618
cc70f101
ILT
126192009-08-14 Ian Lance Taylor <iant@google.com>
12620
12621 * gold.h (FUNCTION_NAME): Define.
12622 (gold_unreachable): Use FUNCTION_NAME.
12623
ef5e0cb1
ST
126242009-08-12 Sriraman Tallam <tmsriram@google.com>
12625
12626 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12627 symbol in the --keep-unique list is not found.
12628
48c187ce
ST
126292009-08-12 Sriraman Tallam <tmsriram@google.com>
12630
12631 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12632 been maked as --keep-unique.
12633 (Icf::unfold_section): New function.
12634 * icf.h (Icf::unfold_section): New function.
12635 * options.h (General_options::keep_unique): New option.
12636 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12637 * testsuite/Makefile.in: Regenerate.
12638 * testsuite/icf_keep_unique_test.sh: New file.
12639 * testsuite/icf_keep_unique_test.cc: New file.
12640
645afe0c
CC
126412009-08-12 Cary Coutant <ccoutant@google.com>
12642
12643 PR 10471
12644 * resolve.cc (Symbol_table::resolve): Check for references from
12645 dynamic objects to hidden and internal symbols.
12646 * testsuite/Makefile.am (hidden_test.sh): New test.
12647 * testsuite/Makefile.in: Regenerate.
12648 * testsuite/hidden_test.sh: New script.
12649 * testsuite/hidden_test_1.c: New test source.
12650 * testsuite/hidden_test_main.c: New test source.
12651
11af873f
DK
126522009-08-11 Doug Kwan <dougkwan@google.com>
12653
12654 * arm.cc: Update comments.
12655 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12656 segment to locate the .ARM.exidx section if present.
12657
b9f7d72d
DK
126582009-08-09 Doug Kwan <dougkwan@google.com>
12659
12660 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12661 patch.
12662
ddd3c53c
ST
126632009-08-07 Sriraman Tallam <tmsriram@google.com>
12664 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12665 compiler warnings.
12666
27721062
ST
126672009-08-06 Sriraman Tallam <tmsriram@google.com>
12668
12669 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12670 valid tls_segment only for non-debug-section relocations.
12671 * testsuite/Makefile.am: Add gc_tls_test.
12672 * testsuite/Makefile.in: Regenerate.
12673 * testsuite/gc_tls_test.cc: New file.
12674 * testsuite/gc_tls_test.sh: New file.
12675
ef15dade 126762009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12677
ef15dade
ST
12678 * icf.cc: New file.
12679 * icf.h: New file.
12680 * Makefile.am (CCFILES): Add icf.cc.
12681 (HFILES): Add icf.h
12682 * Makefile.in: Regenerate.
12683 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12684 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12685 section, symbol and addend information for the relocs.
12686 * gold.cc (queue_middle_tasks): Call identical code folding.
12687 * gold.h: Add defines for multimap.
12688 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12689 to the call of finalize_local_symbols.
12690 * main.cc (main): Create object of class Icf.
12691 * object.cc (Sized_relobj::do_layout): Allow this function to be
12692 called twice during icf.
12693 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12694 to sections marked as identical by icf.
12695 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12696 when available.
12697 (Sized_relobj::do_section_entsize): New function.
12698 * object.h (Object::section_entsize): New function.
12699 (Object::do_section_entsize): New pure virtual function.
12700 (Relobj::finalize_local_symbols): Add new parameter.
12701 (Relobj::do_section_entsize): New function.
12702 * options.h (General_options::icf): New option.
12703 (General_options::icf_iterations): New option.
12704 (General_options::print_icf_sections): New option.
12705 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12706 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12707 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12708 icf.
12709 * symtab.cc (Symbol_table::is_section_folded): New function.
12710 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12711 to sections marked as identical by icf.
12712 * symtab.h (Symbol_table::set_icf): New function.
12713 (Symbol_table::icf): New function.
12714 (Symbol_table::is_section_folded): New function.
12715 (Symbol_table::icf_): New data member.
12716 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12717 * testsuite/Makefile.am: Add commands to build icf_test.
12718 * testsuite/Makefile.in: Regenerate.
12719 * testsuite/icf_test.sh: New file.
12720 * testsuite/icf_test.cc: New file.
12721
c3b65ac4
CD
127222009-07-24 Chris Demetriou <cgd@google.com>
12723
12724 * layout.cc (is_compressible_debug_section): Fix incorrect
12725 comment about compressed section names.
12726
1caf2c51
ILT
127272009-07-20 Ian Lance Taylor <ian@airs.com>
12728
12729 PR 10419
12730 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12731
1ef4d87f
ILT
127322009-07-16 Ian Lance Taylor <iant@google.com>
12733
12734 PR 10400
12735 * layout.h: #include <map>.
12736 (class Kept_section): Change from struct to class. Add accessors
12737 and setters. Add section size to Comdat_group mapping. Change
12738 Comdat_group to std::map. Add is_comdat_ field. Add
12739 linkonce_size field in union.
12740 (class Layout): Update declaration of find_or_add_kept_section.
12741 Don't declare find_kept_object.
12742 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12743 parameter. Add object, shndx, is_comdat, and is_group_name
12744 parameters. Change all callers. Adjust for new Kept_section.
12745 (Layout::find_kept_object): Remove.
12746 * object.cc (Sized_relobj::include_section_group): Update use of
12747 Kept_section. Rename secnum to shndx. Only record
12748 Kept_comdat_section if sections are the same size.
12749 (Sized_relobj::include_linkonce_section): Update use of
12750 Kept_section. Only record Kept_comdat_section if sections are the
12751 same size. Set size of linkonce section.
12752 (Sized_relobj::map_to_kept_section): Update call to
12753 get_kept_comdat_section.
12754 * object.h (class Sized_relobj): Rename fields in
12755 Kept_comdat_section to drop trailing underscores; change object
12756 field to Relobj*. Change Kept_comdat_section_table to store
12757 struct rather than pointer.
12758 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12759 Add kept_object and kept_shndx parameters. Change all callers.
12760 (Sized_relobj::get_kept_comdat_section): Change return type to
12761 bool. Add kept_object and kept_shndx parameters. Change all
12762 callers.
12763 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12764 Layout::find_or_add_kept_section.
12765
37c3b7b0
ILT
127662009-07-09 Ian Lance Taylor <iant@google.com>
12767
12768 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12769 Reserve space in the hash table.
12770
98fa85cb
ILT
127712009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12772
12773 * fileread.cc (File_read::get_mtime): New method.
12774 * fileread.h (Timespec): New structure.
12775 (File_read::get_mtime): New method.
12776 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12777 Renamed from timestamp_nsec.
12778 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12779 Elf_Xword.
e1df38aa 12780 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12781 timestamp_nsec.
e1df38aa 12782 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12783 (Incremental_inputs::report_obejct): Save mtime; style fix.
12784 (Incremental_inputs::report_script): Save mtime; style fix.
12785 (Incremental_inputs::finalize_inputs): Style fix.
12786 (Incremental_inputs::finalize): Style fix.
12787 (Incremental_inputs::create_input_section_data): Store inputs
12788 mtime.
12789 * incremental.h (Incremental_inputs::report_script): Add mtime
12790 argument.
12791 (Incremental_inputs::Input_info::Input_info): Intialize only one
12792 union member.
12793 (Incremental_inputs::Input_info::archive): Move to nameless
12794 union.
12795 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12796 (Incremental_inputs::Input_info::script): Move to nameless union.
12797 (Incremental_inputs::mtime): New field.
12798 * script.cc (read_input_script): Pass file mtime to
12799 Incremental_input.
12800 * script.h (Script_info::inputs): Style fix.
12801
c9d70757
ILT
128022009-07-01 Ian Lance Taylor <ian@airs.com>
12803
12804 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12805 instead of 32.
12806
9c547ec3
ILT
128072009-06-24 Ian Lance Taylor <iant@google.com>
12808
12809 PR 10156
12810 * layout.cc (Layout::choose_output_section): If we find an
12811 existing section, update the flags.
12812 (Layout::create_notes): New function, broken out of
12813 Layout::finalize.
12814 (Layout::finalize): Don't create note sections.
12815 (Layout::create_note): Don't crash if linker script discards
12816 section.
12817 (Layout::create_gold_note): Likewise.
12818 (Layout::create_build_id): Likewise. Don't set
12819 after_input_sections on the section.
12820 (Layout::create_executable_stack_info): Remove target parameter.
12821 Change caller.
12822 * layout.h (class Layout): Declare create_notes. Update
12823 declaration of create_executable_stack_info.
12824 * gold.cc (queue_middle_tasks): Call create_notes.
12825 * output.cc (Output_section::update_flags_for_input_section): Move
12826 here from output.h. If SHF_ALLOC flag is newly set, mark address
12827 invalid.
12828 * output.h (Output_data::mark_address_invalid): New function.
12829 (class Output_section): Only declare, not define,
12830 update_flags_for_input_section. Remove set_flags.
12831
55458500
ILT
128322009-06-24 Ian Lance Taylor <iant@google.com>
12833
12834 * script-sections.cc (Output_section_definition::
12835 set_section_addresses): Rename shadowing local load_address to
12836 laddr.
12837
1307d6cd
ILT
128382009-06-24 Ian Lance Taylor <iant@google.com>
12839
12840 PR 10244
12841 * reloc.cc (relocate_sections): Skip empty relocation sections.
12842
ec3f783e
ILT
128432009-06-23 Ian Lance Taylor <iant@google.com>
12844
12845 PR 10156
12846 * layout.cc (Layout::create_note): Use choose_output_section
12847 rather than make_output_section.
12848
459c9f1c
ILT
128492009-06-23 Ian Lance Taylor <iant@google.com>
12850
12851 PR 10237
12852 * options.cc (General_options::parse_V): Set printed_version_.
12853 (General_options::General_options): Initialize printed_version_.
12854 * options.h (class General_options): Add printed_version_ field.
12855 * gold.cc (queue_initial_tasks): If there are no input files,
12856 don't give a fatal error if we printed the version information.
12857 (queue_middle_tasks): If using -r with a shared object, give a
12858 fatal error rather than an ordinary error.
12859
1518dc8f
ILT
128602009-06-23 Ian Lance Taylor <iant@google.com>
12861
12862 PR 10219
12863 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12864 (Layout::make_output_section): Set have_stabstr_section_ if we see
12865 a .stab*str section.
12866 (Layout::finalize): Call link_stabs_sections.
12867 (Layout::link_stabs_sections): New file.
12868 * layout.h (class Layout): Add have_stabstr_section_ field.
12869 Declare link_stabs_sections.
12870
3d857b98
DK
128712009-06-23 Doug Kwan <dougkwan@google.com>
12872
12873 * Makefile.am (libgold_a_LIBADD): New.
12874 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12875 * Makefile.in: Regenerate.
3d857b98
DK
12876 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12877 * configure: Regenerate.
12878 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12879 * fileread.cc: Include sys/state.h
12880 * gold.h: Declare memmem and strndup if found missing.
12881 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12882
0639a6f6
ILT
128832009-06-23 Ian Lance Taylor <iant@google.com>
12884
12885 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12886 * configure: Rebuild.
12887
8d63875c
ILT
128882009-06-23 Ian Lance Taylor <iant@google.com>
12889
12890 PR 10147
12891 * object.cc (Object::section_contents): Don't try to get a view if
12892 the section has length zero.
12893 (Object::handle_gnu_warning_section): If the section is empty, use
12894 the name of the section as the warning.
12895
f7c8a183
ILT
128962009-06-23 Ian Lance Taylor <iant@google.com>
12897
12898 PR 10133
12899 * stringpool.h (class Stringpool_template): Add optimize_ field.
12900 (Stringpool_template::set_optimize): New function.
12901 * stringpool.cc (Stringpool_template::Stringpool_template):
12902 Initialize optimize_ field.
12903 (Stringpool_template::set_string_offsets): Test local optimize
12904 fild rather than parameter.
12905 * layout.cc (Layout::Layout): Call set_optimize on the section
12906 name stringpool.
12907
e6a307ba
ILT
129082009-06-22 Ian Lance Taylor <iant@google.com>
12909
12910 PR 10030
12911 * yyscript.y: Parse TARGET.
12912 * script.cc (script_set_target): New function.
12913 * script-c.h (script_set_target): Declare.
12914 * options.cc (General_options::string_to_object_format): Rename
12915 from string_to_object_format in anonymous namespace. Change
12916 callers.
12917 * options.h (class General_options): Declare
12918 string_to_object_format.
12919
3ee173de
ILT
129202009-06-22 Ian Lance Taylor <iant@google.com>
12921
12922 * script-sections.cc (Script_sections::create_segments): Don't put
12923 program headers in a PT_LOAD segment if -n or -N.
12924
129252009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12926
12927 PR 10141
12928 * options.h (class General_options): Add -z lazy and -z now. Sort
12929 -z options into alphabetical order.
12930 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12931
cd6739a1 129322009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12933
12934 * layout.cc (Layout::make_output_section): Call
12935 Target::new_output_section.
12936 (Layout::attach_allocated_section_to_segment): Put large section
12937 sections in a separate load segment with the large segment flag
12938 set.
12939 (Layout::segment_precedes): Sort large data segments after other
12940 load segments.
12941 (align_file_offset): New static function.
12942 (Layout::set_segment_offsets): Use align_file_offset.
12943 * output.h (class Output_section): Add is_small_section_ and
12944 is_large_section_ fields.
12945 (Output_section::is_small_section): New function.
12946 (Output_section::set_is_small_section): New function.
12947 (Output_section::is_large_section): New function.
12948 (Output_section::set_is_large_section): New function.
12949 (Output_section::is_large_data_section): New function.
12950 (class Output_segment): Add is_large_data_segment_ field.
12951 (Output_segment::is_large_data_segment): New function.
12952 (Output_segment::set_is_large_data_segment): New function.
12953 * output.cc (Output_section::Output_section): Initialize new
12954 fields.
12955 (Output_segment::Output_segment): Likewise.
12956 (Output_segment::add_output_section): Add assertion that large
12957 data sections always go in large data segments. Force small data
12958 sections to the end of the list of data sections. Force small BSS
12959 sections to the start of the list of BSS sections. For large BSS
12960 sections to the end of the list of BSS sections.
12961 * symtab.h (class Symbol): Declare is_common_shndx.
12962 (Symbol::is_defined): Check Symbol::is_common_shndx.
12963 (Symbol::is_common): Likewise.
12964 (class Symbol_table): Define enum Commons_section_type. Update
12965 declarations. Add small_commons_ and large_commons_ fields.
12966 * symtab.cc (Symbol::is_common_shndx): New function.
12967 (Symbol_table::Symbol_table): Initialize new fields.
12968 (Symbol_table::add_from_object): Put small and large common
12969 symbols in the right list.
12970 (Symbol_table::sized_finalized_symbol): Check
12971 Symbol::is_common_shndx.
12972 (Symbol_table::sized_write_globals): Likewise.
12973 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12974 common symbol lists. Don't call do_allocate_commons_list if the
12975 list is empty.
12976 (Symbol_table::do_allocate_commons_list): Remove is_tls
12977 parameter. Add comons_section_type parameter. Change all
12978 callers. Handle small and large common symbols.
12979 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12980 Symbol::is_common_shndx.
12981 * resolve.cc (symbol_to_bits): Likewise.
12982 * target.h (Target::small_common_shndx): New function.
12983 (Target::small_common_section_flags): New function.
12984 (Target::large_common_shndx): New function.
12985 (Target::large_common_section_flags): New function.
12986 (Target::new_output_section): New function.
12987 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12988 small_common_section_flags, and large_common_section_flags
12989 fields.
12990 (Target::do_new_output_section): New virtual function.
12991 * arm.cc (Target_arm::arm_info): Initialize new fields.
12992 * i386.cc (Target_i386::i386_info): Likewise.
12993 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12994 Likewise.
12995 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12996 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12997 (Target_x86_64::do_new_output_section): New function.
12998 * configure.ac: Define conditional MCMODEL_MEDIUM.
12999 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13000 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13001 (large_LDFLAGS): Define.
13002 * testsuite/large.c: New file.
13003 * testsuite/testfile.cc (Target_test::test_target_info):
13004 Initialize new fields.
13005 * configure, testsuite/Makefile.in: Rebuild.
13006
bb04269c
DK
130072009-06-05 Doug Kwan <dougkwan@google.com>
13008
13009 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13010 * Makefile.in: Regenerate.
bb04269c
DK
13011 * i386.cc (class Target_i386): Define new virtual method to
13012 override do_is_local_label_name in parent.
13013 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13014 local symbols if --discard-locals or -X is given.
13015 * options.h (class General_options): Declare new options
13016 '--discard-locals' and '-X' for discarding locals.
13017 * target.h (class Target): Define new methods is_local_label_name.
13018 Declare new virtual method do_is_local_label_name.
13019 * target.cc: New file.
13020 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13021 (check_SCRIPTS): Add discard_locals_test.sh.
13022 (check_DATA): Add discard_local_tests.syms.
13023 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13024 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13025 * testsuite/Makefile.in: Regenerate.
13026 * testsuite/discard_locals_test.c: New file.
13027 * testsuite/discard_locals_test.sh: Same.
13028
805bb01c
DK
130292009-06-05 Doug Kwan <dougkwan@google.com>
13030
13031 * object.cc (Sized_relobj::Sized_relobj): Initialize
13032 discarded_eh_frame_shndx_ to -1U.
13033 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13034 section.
13035 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13036 a discarded .eh_frame section.
13037 (Sized_relobj::do_finalize_local_symbols): Ditto.
13038 * object.h (class Sized_relobj): Declare new member
13039 discarded_eh_frame_shndx_.
13040 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13041 (local_labels_test.o, local_labels_test): New rules.
13042 * testsuite/Makefile.in: Regenerate.
13043
1dcd334d
DK
130442009-06-04 Doug Kwan <dougkwan@google.com>
13045
13046 * layout.cc (Layout::section_name_mapping): Add mapping for
13047 special ARM sections.
13048
96d49306
DK
130492009-06-03 Doug Kwan <dougkwan@google.com>
13050
13051 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13052 (utils::has_overflow): Same.
13053
dff16297
ILT
130542009-06-03 Ian Lance Taylor <iant@google.com>
13055
13056 * layout.cc (Layout::section_name_mapping): New array, replacing
13057 Layout::linkonce_mapping.
13058 (Layout::section_name_mapping_count): New variable, replacing
13059 Layout::linkonce_mapping_count.
13060 (Layout::linkonce_output_name): Remove.
13061 (Layout::output_section_name): Rewrite.
13062 * layout.h (class Layout): Rename Linkonce_mapping to
13063 Section_name_mapping, linkonce_mapping to section_name_mapping,
13064 linkonce_mapping_count to section_name_mapping_count. Don't
13065 declare linkonce_output_name.
13066
c121c671
DK
130672009-06-03 Doug Kwan <dougkwan@google.com>
13068
13069 * gold/arm.cc (namespace utils): New.
13070 (Target_arm::reloc_is_non_pic): Define new method.
13071 (class Arm_relocate_functions): New.
13072 (Target_arm::Relocate::relocate): Handle relocation types used by
13073 Android.
13074
07800fab
ILT
130752009-06-03 Ian Lance Taylor <iant@google.com>
13076
13077 * arm.cc (Target_arm::scan::global): Use || instead of |.
13078
c121c671
DK
130792009-06-02 Doug Kwan <dougkwan@google.com>
13080
13081 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13082 issued_non_pic_error_.
13083 (class Target_arm::Scan): Declare new method check_non_pic.
13084 Define new method symbol_needs_plt_entry.
13085 Declare new data member issued_non_pic_error_.
13086 (class Target_arm::Relocate): Declare new method
13087 should_apply_static_reloc.
13088 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13089 (Target_arm::Scan::check_non_pic): Define new method.
13090 (Target_arm::Scan::local): Handle a small subset of reloc types used
13091 by Android.
13092 (Target_arm::Scan::local): Same.
13093 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13094
b19b0c6d
ILT
130952009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13096
13097 * incremental.cc (Incremental_inputs::report_command_line): Filter
13098 out --incremental-* options.
13099
94cdfcff
DK
131002009-05-29 Doug Kwan <dougkwan@google.com>
13101
13102 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13103 template class.
13104 (class Target_arm): Update comment.
13105 (Target_arm::Target_arm): Initialize new data members GOT_,
13106 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13107 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13108 and Target_arm::rel_dyn_section.
13109 Declare new_enum Target_arm::Got_type.
13110 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13111 and DYNBSS_.
13112 Update commments for member do_dynsym_value.
13113 (Target_arm::got_size, Target_arm::plt_section,
13114 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13115 new methods inside class defintion.
13116 (Target_arm::got_section): Define new method.
13117 (Target_arm::rel_dyn_section): Same.
13118 (Output_data_plt_arm): New template class.
13119 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13120 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13121 (Output_data_plt_arm::add_entry): Same.
13122 (Output_data_plt_arm::first_plt_entry): Define new
13123 static data member for PLT instruction template.
13124 (Output_data_plt_arm::plt_entry): Same.
13125 (Output_data_plt_arm::do_write): Define new method.
13126 (Target_arm::make_plt_entry): Same.
13127 (Target_arm::do_finalize_sections): Same.
13128 (Target_arm::do_dynsym_value): Same.
13129
4a657b0d
DK
131302009-05-28 Doug Kwan <dougkwan@google.com>
13131
13132 * Makefile.am (TARGETSOURCES): Add arm.cc.
13133 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13134 * Makefile.in: Regenerate.
13135 * arm.cc: New file.
13136 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13137
e7ae8c36
DK
131382009-05-26 Doug Kwan <dougkwan@google.com>
13139
13140 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13141 (General_options::check_excluded_libs): Strip off directories in
13142 archive name before matching like GNU ld does.
13143 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13144 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13145 (exclude_libs_test_LDFLAGS): Add linker option
13146 -Wl,--exclude-libs,libexclude_libs_test_3
13147 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13148 an explicit archive without using -l.
13149 (alt/libexclude_libs_test_3.a): New make rule.
13150 * testsuite/Makefile.in: Regenerate.
13151 * testsuite/exclude_libs_test.c : Declare lib3_default().
13152 (main): Call it.
13153 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13154 * exclude_libs_test_3.c: New file.
13155
f12e7348
NC
131562009-05-26 Nick Clifton <nickc@redhat.com>
13157
13158 * po/id.po: New Indonesian translation.
13159 * po/gold.pot: Updated template file.
13160
4daadc0d
ST
131612009-05-22 Sriraman Tallam <tmsriram@google.com>
13162
e1df38aa 13163 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13164 gc_comdat_test files. Add -Wl,--gc-sections to build
13165 gc_comdat_test.
13166 * testsuite/Makefile.in: Regenerate.
13167 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13168
531813ad
ST
131692009-05-21 Sriraman Tallam <tmsriram@google.com>
13170
13171 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13172 kept comdat section was garbage collected.
13173 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13174 * testsuite/Makefile.in: Regenerate.
13175 * testsuite/gc_comdat_test.sh: New file.
13176 * testsuite/gc_comdat_test_1.cc: New file.
13177 * testsuite/gc_comdat_test_2.cc: New file.
13178
65514900
CC
131792009-05-19 Doug Kwan <dougkwan@google.com>
13180
13181 * archive.cc (Archive::Archive): Move constructor from archive.h
13182 to here. Initialize no_export_.
13183 (Archive::get_elf_object_for_member): Set no_export flag of object.
13184 * archive.h (Archive::Archive): Move constructor body to
13185 archive.cc.
13186 (Archive::no_export): New method.
13187 (Archive::no_export_): New field.
13188 * object.h (Object::Object): Initialize no_export_ to false.
13189 (Object::no_export, Object::set_no_export): New methods.
13190 (Object::no_export_): New field.
13191 * options.cc (General_options::parse_exclude_libs): New method.
13192 (General_options::check_excluded_libs) Same.
13193 * options.h (exclude_libs): New option.
13194 (General_options::check_excluded_libs): New method declaration.
13195 (General_options::excluded_libs_): New field.
13196 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13197 default or protected visibility if an object has no-export flag set.
13198 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13199 (check_SCRIPTS): Add exclude_libs_test.sh.
13200 (check_DATA): Add exclude_libs_test.syms.
13201 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13202 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13203 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13204 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13205 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13206 libexclude_libs_test_2.a): New rules.
13207 * testsuite/Makefile.in: Regenerate.
13208 * testsuite/exclude_libs_test.c: New file.
13209 * testsuite/exclude_libs_test.sh: Ditto.
13210 * testsuite/exclude_libs_test_1.c: Ditto.
13211 * testsuite/exclude_libs_test_2.c: Ditto.
13212
1b77ea50
ILT
132132009-05-15 Ian Lance Taylor <iant@google.com>
13214
13215 * configure.ac: Check for declarations for cases where libiberty.h
13216 checks HAVE_DECL_xxx.
13217 * configure, config.in: Rebuild.
13218
072fe7ce
ILT
132192009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13220
13221 * gold.h (Incremental_argument_list): Remove (invalid) forward
13222 declaration.
13223 * incremental.cc (Incremental_inputs::report_achive): New method.
13224 (Incremental_inputs::report_object): New method.
13225 (Incremental_inputs::report_script): New method.
13226 (Incremental_inputs::finalize_inputs): New method.
13227 (Incremental_inputs::finalize): Call finalize_inputs().
13228 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13229 Create inputs entries.
13230 * incremental.h (Incremental_input_type): New enum.
13231 (Incremental_inputs::Incremental_input): Initialize new fields.
13232 (Incremental_inputs::report_inputs): New method.
13233 (Incremental_inputs::report_achive): New method.
13234 (Incremental_inputs::report_object): New method.
13235 (Incremental_inputs::report_script): New method.
13236 (Incremental_inputs::finalize_inputs): New method.
13237 (Incremental_inputs::Input_info): New struct.
13238 (Incremental_inputs::Input_info_map): New typedef.
13239 (Incremental_inputs::lock_): New field.
13240 (Incremental_inputs::Inputs_): New field.
13241 (Incremental_inputs::Inputs_map): New field.
13242 * main.cc (main): Call Incremental_input::report_inputs.
13243 * options.h (Input_argument_list): Typedef moved from
13244 Input_arguments.
13245 (Input_file_group::Files): Remove, use ::Input_argument_list.
13246 (Input_file_group::Input_argument_list): Remove, use
13247 ::Input_argument_list.
13248 * plugin.cc (Plugin_manager::add_input_file): Add error in
13249 incremental build.
13250 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13251 functions.
13252 * script.cc (read_input_script): Call
13253 Incremental_input::report_script.
13254 * script.h (Script_info): New class.
13255
b0481b0b
ILT
132562009-04-27 Ian Lance Taylor <iant@google.com>
13257
13258 * x86_64.cc (do_adjust_output_section): Set entsize to
13259 plt_entry_size.
13260
b22a5a41 132612009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13262
13263 * output.cc (Output_file::close): After short writes, continue
13264 writing from the correct offset in the buffer being written.
13265
40fde488
CD
132662009-04-23 Chris Demetriou <cgd@google.com>
13267
13268 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13269 * configure: Regenerate.
13270 * config.in: Regenerate.
13271 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13272 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13273
3ce2c28e
ILT
132742009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13275
13276 * incremental.cc (Incremental_inputs_header_data): Renamed from
13277 Incremental_input_header_data.
13278 (Incremental_inputs_header_data::data_size): New field.
13279 (Incremental_inputs_header_data::put_input_file_count): Renamed
13280 from input_file_count.
13281 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13282 from command_line_offset.
13283 (Incremental_inputs_header_data::put_reserved): Renamed from
13284 put_reserved.
13285 (Incremental_inputs_entry_data): Renamed from
13286 Incremental_input_entry_data.
13287 (Incremental_inputs_entry_data::data_size): New field.
13288 (Incremental_inputs::report_command_line): New method.
13289 (Incremental_inputs::finalize): New method.
13290 (Incremental_inputs::create_incremental_inputs_data): New method.
13291 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13292 * incremental.h: New file.
13293 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13294 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13295 incremental builds.
703d02da 13296 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13297 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13298 (Layout::create_incremental_info_sections): New method.
13299 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13300 * main.cc (main): Notify Incremental_input of the command line.
13301
e55bde5e
ILT
133022009-04-01 Ian Lance Taylor <iant@google.com>
13303 Mikolaj Zalewski <mikolajz@google.com>
13304
13305 * gold.h (reserve_unordered_map): Define, three versions, one for
13306 each version of Unordered_map.
13307 * layout.cc (Layout::Layout): Remove options parameter. Add
13308 number_of_input_files parameter. Don't initialize options_.
13309 Initialize number_of_input_files_ and resized_signatures_. Move
13310 sections_are_attached_.
13311 (Layout::layout_group): Reserve space for group_signatures_.
13312 (Layout::find_or_add_kept_section): Change name parameter to be a
13313 reference. Resize signatures_ map when it gets large enough.
13314 (Layout::layout_eh_frame): Use parameters->options() instead of
13315 this->options_.
13316 (Layout::make_output_section): Likewise.
13317 (Layout::attach_allocated_section_to_segment): Likewise.
13318 (Layout::finalize, Layout::create_executable_stack): Likewise.
13319 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13320 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13321 * layout.h (class Layout): Update declarations. Remove options_
13322 field. Add number_of_input_files_ and resized_signatures_
13323 fields. Move sections_are_attached_ field.
13324 * main.cc (main): Pass number of input files to Layout
13325 constructor. Don't pass options.
13326
154b857c
ILT
133272009-03-30 Ian Lance Taylor <iant@google.com>
13328
13329 * ffsll.c (ffsll): Correct implementation.
13330
2f35ab9b
ILT
133312009-03-27 Ian Lance Taylor <iant@google.com>
13332
fd03461a
ILT
13333 * ffsll.c: New file.
13334 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13335 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13336 * ftruncate.c (ftruncate): Declare before definition.
13337 * mremap.c (mremap): Likewise.
13338 * pread.c (pread): Likewise.
13339 * configure, Makefile.in, config.in: Rebuild.
13340
2f35ab9b
ILT
13341 * mremap.c: New file.
13342 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13343 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13344 (mremap): Declare if HAVE_MREMAP is not defined.
13345 * configure, Makefile.in, config.in: Rebuild.
13346
33aea2fd
CC
133472009-03-27 Cary Coutant <ccoutant@google.com>
13348
13349 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13350 position independent.
13351 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13352 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13353
6d479619
CC
133542009-03-24 Cary Coutant <ccoutant@google.com>
13355
13356 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13357 an executable.
13358 (needs_dynamic_reloc): Likewise.
13359
afc06bb8
ILT
133602009-03-24 Ian Lance Taylor <iant@google.com>
13361
13362 * yyscript.y (file_cmd): Recognize EXTERN.
13363 (extern_name_list, extern_name_list_body): New nonterminals.
13364 * script.cc (script_add_extern): Define.
13365 * script-c.h (script_add_extern): Declare.
13366
f6060a4d
ILT
133672009-03-24 Rafael Avila de Espindola <espindola@google.com>
13368
13369 * object.cc (is_elf_object): Define.
13370 * object.h (is_elf_object): Declare.
13371 * archive.cc (Archive::get_elf_object_for_member): Call
13372 is_elf_object.
33aea2fd 13373 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13374
26736d8e
ILT
133752009-03-24 Elliott Hughes <enh@google.com>
13376
13377 * output.cc (Output_file::map_anonymous): Define.
13378 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13379 try an anonymous one. Report the size if the mmap fails.
13380 * output.h (class Output_file): Declare map_anonymous.
13381
22fd9730
ILT
133822009-03-24 Ian Lance Taylor <iant@google.com>
13383
13384 * target-select.cc (instantiate_target): Don't acquire the lock if
13385 the instantiated_target_ field has already been set.
13386
cb010894
ILT
133872009-03-23 Ian Lance Taylor <iant@google.com>
13388
7f055c20
ILT
13389 * gold-threads.h (class Initialize_lock): Define.
13390 * gold-threads.cc (class Initialize_lock_once): Define.
13391 (initialize_lock_control): New static variable.
13392 (initialize_lock_pointer): New static variable.
13393 (initialize_lock_once): New static function.
13394 (Initialize_lock::Initialize_lock): Define.
13395 (Initialize_lock::initialize): Define.
13396 * target-select.h: Include "gold-threads.h".
13397 (class Target_selector): Add lock_ and initialize_lock_ fields.
13398 Don't define instantiate_target, just declare it.
13399 * target-select.cc (Target_selector::Target_selector): Initialize
13400 new fields.
13401 (Target_selector::instantiate_target): Define.
13402 * descriptors.h: Include "gold-threads.h".
13403 (class Descriptors): Add initialize_lock_ field.
13404 * descriptors.cc (Descriptors::Descriptors): Initialize new
13405 field.
13406 (Descriptors::open): Use initialize_lock_ field
13407 * errors.h (class Errors): Add initialize_lock_ field.
13408 * errors.cc (Errors::Errors): Initialize new field.
13409 (Errors::initialize_lock): Use initialize_lock_ field.
13410 * powerpc.cc (class Target_selector_powerpc): Remove
13411 instantiated_target_ field. In do_recognize call
13412 instantiate_target rather than do_instantiate_target. In
13413 do_instantiate_target just allocate a new target.
13414 * sparc.cc (class Target_selector_sparc): Likewise.
13415
36959681
ILT
13416 * freebsd.h: New file.
13417 * i386.cc: Include "freebsd.h".
13418 (Target_i386): Derive from Target_freebsd rather than
13419 Sized_target.
13420 (Target_selector_i386): Derive from Target_selector_freebsd rather
13421 than Target_selector.
13422 * x86_64.cc: Include "freebsd.h".
13423 (Target_x86_64): Derive from Target_freebsd rather than
13424 Sized_target.
13425 (Target_selector_x86_64): Derive from Target_selector_freebsd
13426 rather than Target_selector.
13427 * target.h (class Target): Add adjust_elf_header and
13428 do_adjust_elf_header.
13429 * output.cc (Output_file_header:: do_sized_write): Call target
13430 adjust_elf_header routine.
13431 * configure.tgt: Set targ_osabi.
13432 * configure.ac: Define GOLD_DEFAULT_OSABI.
13433 * parameters.cc (Parameters::default_target): Pass
13434 GOLD_DEFAULT_OSABI to select_target.
13435 * target-select.h (class Target_selector): Make instantiate_target
13436 protected rather than private.
13437 * Makefile.am (HFILES): Add freebsd.h.
13438 * configure, Makefile.in, config.in: Rebuild.
13439
cb010894
ILT
13440 * merge.cc (do_add_input_section): Correct pend value. Change
13441 message about last entry not being null terminated from error to
13442 warning.
13443
0e879927
ILT
134442009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13445
13446 * incremental.cc: New file.
13447 * Makefile.am (CCFILES): Add incremental.cc.
13448 * Makefile.in: Rebuild.
13449
41105937
PP
134502009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13451
13452 * layout.cc (Layout::output_section_name): Preserve names
13453 of '.note.' sections.
e1df38aa 13454
60439920
ILT
134552009-03-19 Ian Lance Taylor <iant@google.com>
13456
13457 * descriptors.cc (Descriptors::open): Check that the options are
13458 valid before using them.
13459
0d371ad3
ILT
134602009-03-18 Ian Lance Taylor <iant@google.com>
13461
13462 * script-sections.h: Include <list>.
13463 (class Script_sections): Change Sections_elements from std::vector
13464 to std::list. Typedef public Elements_iterator. Add
13465 orphan_section_placement_, data_segment_align_start_, and
13466 saw_data_segment_align_ fields. Remove data_segment_align_index_
13467 field.
13468 * script-sections.cc (class Orphan_section_placement): New class.
13469 (class Sections_element): Add virtual functions is_relro and
13470 orphan_section_init. Remove virtual function place_orphan_here.
13471 (class Output_section_definition): Add is_relro and
13472 orphan_section_init. Remove place_orphan_here.
13473 (class Orphan_output_section): Likewise.
13474 (Script_sections::Script_sections): Update for field changes.
13475 (Script_sections::data_segment_align): Set saw_data_segment_align_
13476 and data_segment_align_start_, not data_segment_align_index.
13477 (Script_sections::data_segment_relro_end): Check
13478 saw_data_segment_align_. Use data_segment_align_start_ rather
13479 than data_segment_align_index_.
13480 (Script_sections::place_orphan): Rewrite to use
13481 Orphan_section_placement.
13482
9201d894
ILT
134832009-03-17 Ian Lance Taylor <iant@google.com>
13484
9c5b8369
ILT
13485 * archive.cc (Archive::add_symbols): Check for a version attached
13486 to the symbol name in the archive map.
13487 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13488 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13489 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13490 (ver_test_11.a): New target.
13491 * testsuite/Makefile.in: Rebuild.
13492
9201d894
ILT
13493 * configure.ac: Check for chsize and posix_fallocate. Replace
13494 ftruncate.
13495 * ftruncate.c: New file, from gnulib.
13496 * output.cc (posix_fallocate): Define dummy version if not
13497 HAVE_POSIX_FALLOCATE.
13498 (Output_file::map): Call posix_fallocate rather than lseek and
13499 write.
13500 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13501 * configure, Makefile.in, config.in: Rebuild.
13502
ef4ab7a8 135032009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13504
ef4ab7a8
PP
13505 * layout.h (Layout::create_note): Add section_name parameter.
13506 * layout.cc (Layout::create_note): Likewise.
13507 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13508
8c500701
ILT
135092009-03-17 Ian Lance Taylor <iant@google.com>
13510
e85b18e1
ILT
13511 * descriptors.cc: Include "options.h".
13512 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13513 (Descriptors::open): Always use O_CLOEXEC when opening a new
13514 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13515 then set FD_CLOEXEC.
13516
9efe6174
ILT
13517 * sparc.cc (class Target_sparc): Add has_got_section.
13518 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13519 make sure we have a GOT section.
13520
13521 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13522 (Target_sparc::Scan::local): Likewise.
13523 (Target_sparc::Scan::global): Likewise.
13524 (Target_sparc::Relocate::relocate): Likewise.
13525 (Target_sparc::Relocate::relocate_tls): Likewise.
13526
8c500701
ILT
13527 * symtab.cc (Symbol_table::define_default_version): New function,
13528 broken out of add_from_object.
13529 (Symbol_table::add_from_object): Call define_default_version.
13530 (Symbol_table::define_special_symbol): Add resolve_oldsym
13531 parameter. Change all callers. If the version for a symbol comes
13532 from a version script, resolve it with the symbol with the same
13533 name with no version. Also add the symbol without a version if
13534 appropriate.
13535 (do_define_in_output_data): If resolving with oldsym, don't delete
13536 sym.
13537 (do_define_in_output_segment): Likewise.
13538 (do_define_as_constant): Likewise.
13539 * symtab.h (class Symbol_table): Update declarations.
13540
f1ed28fb
ILT
135412009-03-13 Ian Lance Taylor <iant@google.com>
13542
15f8229b
ILT
13543 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13544 (Read_symbols::requeue): New function.
13545 (Read_symbols::do_read_symbols): If make_elf_object fails because
13546 the target type is not configured, and the file was searched for,
13547 issue a warning and retry with the next directory.
13548 (Add_symbols::run): If the file has an incompatible format, and
13549 it was searched for, requeue the Read_symbols task. On error,
13550 release the object.
13551 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13552 dirindex parameter to constructor. Change all callers. Declare
13553 incompatible_warning and requeue.
13554 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13555 input_argument_ and input_group_ fields. Add them to
13556 constructor. Change all callers.
13557 (class Read_script): Add dirindex_ field. Add it to constructor.
13558 Change all callers.
13559 * archive.cc (Archive::setup): Remove input_objects parameter.
13560 Change all callers.
13561 (Archive::get_file_and_offset): Likewise.
13562 (Archive::read_all_symbols): Likewise.
13563 (Archive::read_symbols): Likewise.
13564 (Archive::get_elf_object_for_member): Remove input_objects
13565 parameter. Add punconfigured parameter. Change all callers.
13566 (Archive::add_symbols): Change return type to bool. Check return
13567 value of include_member.
13568 (Archive::include_all_members): Likewise.
13569 (Archive::include_member): Change return type to bool. Return
13570 false if first included object has incompatible target. Set
13571 included_member_ field.
13572 (Add_archive_symbols::run): If add_symbols returns false, requeue
13573 Read_symbols task.
13574 * archive.h (class Archive): Add included_member_ field.
13575 Initialize it in constructor. Add input_file and searched_for
13576 methods. Update declarations.
13577 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13578 input_argument_ fields. Add them to constructor. Change all
13579 callers.
13580 * script.cc: Include "target-select.h".
13581 (class Parser_closure): Add skip_on_incompatible_target_ and
13582 found_incompatible_target_ fields. Add
13583 skip_on_incompatible_target parameter to constructor. Change all
13584 callers. Add methods skip_on_incompatible_target,
13585 clear_skip_on_incompatible_target, found_incompatible_target, and
13586 set_found_incompatible_target.
13587 (read_input_script): Add dirindex parameter. Change all callers.
13588 If parser finds an incompatible target, requeue Read_symbols
13589 task.
13590 (script_set_symbol): Clear skip_on_incompatible_target in
13591 closure.
13592 (script_add_assertion, script_parse_option): Likewise.
13593 (script_start_sections, script_add_phdr): Likewise.
13594 (script_check_output_format): New function.
13595 * script.h (read_input_script): Update declaration.
13596 * script-c.h (script_check_output_format): Declare.
13597 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13598 (ignore_cmd): Remove OUTPUT_FORMAT.
13599 * fileread.cc (Input_file::Input_file): Add explicit this.
13600 (Input_file::will_search_for): New function.
13601 (Input_file::open): Add pindex parameter. Change all callers.
13602 * fileread.h (class Input_file): Add input_file_argument method.
13603 Declare will_search_for. Update declarations.
13604 * object.cc (make_elf_object): Add punconfigured parameter.
13605 Change all callers.
13606 * object.h (class Object): Make input_file public. Add
13607 searched_for method.
13608 (make_elf_object): Update declaration.
13609 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13610 restart search.
13611 * dirsearch.h (class Dirsearch): Update declaration.
13612 * options.h (class General_options): Add --warn-search-mismatch.
13613 * parameters.cc (Parameters::is_compatible_target): New function.
13614 * parameters.h (class Parameters): Declare is_compatible_target.
13615 * workqueue.cc (Workqueue::add_blocker): New function.
13616 * workqueue.h (class Workqueue): Declare add_blocker.
13617
f1ed28fb
ILT
13618 * fileread.cc (Input_file::open): Remove options parameter.
13619 Change all callers.
13620 (Input_file::open_binary): Likewise.
13621 * script.cc (read_input_script): Likewise.
13622 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13623 options parameter from constructor. Change all callers.
13624 (class Read_script): Likewise.
13625 * fileread.h (class Input_file): Update declarations.
13626 * script.h (read_input_script): Update declaration.
13627
34dd024a
NC
136282009-03-10 Nick Clifton <nickc@redhat.com>
13629
13630 * po/es.po: New Spanish translation.
13631
6d71b17c
CC
136322009-03-06 Cary Coutant <ccoutant@google.com>
13633
13634 * options.cc (parse_short_option): Keep dash_z from registering itself.
13635
031cdbed
ILT
136362009-03-03 Ian Lance Taylor <iant@google.com>
13637
13638 PR 9918
13639 * target-reloc.h (relocate_section): Pass output_section to
13640 relocate.
13641 * i386.cc (Target_i386::should_apply_static_reloc): Add
13642 output_section parameter. Change all callers.
13643 (Target_i386::Relocate::relocate): Add output_section parameter.
13644 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13645 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13646 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13647 * testsuite/two_file_shared.sh: New script.
13648 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13649 (check_DATA): Add two_file_shared.dbg.
13650 (two_file_shared.dbg): New target.
13651 * testsuite/Makefile.in: Rebuild.
13652
15d5fa16
ILT
136532009-03-01 Ian Lance Taylor <iant@google.com>
13654
13655 * configure.ac: Check for byteswap.h.
13656 * configure: Rebuild.
13657 * config.in: Rebuild.
13658
8a4c0b0d
ILT
136592009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13660
13661 * layout.cc (Layout::find_or_add_kept_section): New function.
13662 (Layout::add_comdat): Removed.
13663 * layout.h (struct Kept_section): Move out of class Layout.
13664 Remove trailing underscores from field names. Add group_sections
13665 field. Rename group_ field to is_group. Change all uses.
13666 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13667 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13668 comdat_groups_ field.
13669 (Sized_relobj::include_section_group): Use
13670 find_or_add_kept_section and Kept_section::group_sections.
13671 (Sized_relobj::include_linkonce_section): Likewise.
13672 * object.cc (class Sized_relobj): Don't define Comdat_group or
13673 Comdat_group_table. Remove find_comdat_group and
13674 add_comdat_group. Remove comdat_groups_ field.
13675 * plugin.cc (include_comdat_group): Use
13676 Layout::find_or_add_kept_section.
13677
b4ecf66b
ILT
136782009-02-28 Ian Lance Taylor <iant@google.com>
13679
14359ca0
ILT
13680 * README: --gc-sections and map files are now supported. Document
13681 some build requirements.
13682
b4ecf66b
ILT
13683 PR 6992
13684 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13685 relocatable link set the value of the section symbol to zero.
13686 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13687 relocatable link don't include the section address in the local
13688 symbol value.
13689
0602e05a
ILT
136902009-02-27 Ian Lance Taylor <iant@google.com>
13691
fd9d194f
ILT
13692 PR 6811
13693 * options.h (class Search_directory): Add is_system_directory.
13694 (class General_options): Declare is_in_system_directory.
13695 * options.cc (get_relative_sysroot): Make static.
13696 (get_default_sysroot): Make static.
13697 (General_optoins::is_in_system_directory): New function.
13698 * fileread.cc (Input_file::is_in_system_directory): New function.
13699 * fileread.h (class Input_file): Declare is_in_system_directory.
13700 * object.h (class Object): Add is_in_system_directory.
13701 (class Input_objects): Remove system_library_directory_ field.
13702 * object.cc (Input_objects::add_object): Don't set
13703 system_library_directory_.
13704 (input_objects::found_in_system_library_directory): Remove.
13705 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13706 parameter. Change all callers.
13707 (Symbol_table::sized_write_globals): Likewise.
13708 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13709 Call Object::is_in_system_directory.
13710 * symtab.h (class Symbol_table): Update declarations.
13711
61edd21f
ILT
13712 PR 5990
13713 * descriptors.h (Open_descriptor): Add is_on_stack field.
13714 * descriptors.cc (Descriptors::open): If the descriptor is on the
13715 top of the stack, remove it. Initialize is_on_stack field.
13716 (Descriptors::release): Only add pod to stack if it is not on the
13717 stack already.
13718 (Descriptors::close_some_descriptor): Clear stack_next and
13719 is_on_stack fields.
13720
e29e076a
ILT
13721 PR 7091
13722 * output.cc (Output_section::find_starting_output_address): Rename
13723 from starting_output_address; add PADDR parameter; change return
13724 type.
13725 * output.h (class Output_section): Declare
13726 find_starting_output_address instead of starting_output_address.
13727 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13728 section symbol for which we can't find a merge section.
13729
0602e05a
ILT
13730 PR 9836
13731 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13732 hidden or internal, force the symbol to be local.
13733 * resolve.cc (Symbol::override_visibility): Define.
13734 (Symbol::override_base): Use override_visibility.
13735 (Symbol_table::resolve): Likewise.
13736 (Symbol::override_base_with_special): Likewise.
13737 (Symbol_table::override_with_special): If the visibility is hidden
13738 or internal, force the symbol to be local.
13739 * symtab.h (class Symbol): Add set_visibility and
13740 override_visibility.
13741 * testsuite/ver_test_1.sh: New file.
13742 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13743 (check_DATA): Add ver_test_1.syms.
13744 (ver_test_1.syms): New target.
13745 * testsuite/Makefile.in: Rebuild.
13746
401a9a73
CC
137472009-02-25 Cary Coutant <ccoutant@google.com>
13748
13749 * layout.cc (Layout::choose_output_section): Don't rename sections
13750 when using a linker script that has a SECTIONS clause.
13751 * Makefile.in: Regenerate.
13752
13753 * testsuite/Makefile.am (script_test_5.sh): New test case.
13754 * testsuite/Makefile.in: Regenerate.
13755 * testsuite/script_test_5.cc: New file.
13756 * testsuite/script_test_5.sh: New file.
13757 * testsuite/script_test_5.t: New file.
13758
f488e4b0
CC
137592009-02-13 Rafael Avila de Espindola <espindola@google.com>
13760
13761 * archive.cc (Archive::include_member): Update calls to add_symbols.
13762 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13763 the Layout argument.
13764 * dynobj.h (do_add_symbols): Add the Layout argument.
13765 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13766 Layout argument.
13767 * object.h (Object::add_symbols): Add the Layout argument.
13768 (Object::do_add_symbols): Add the Layout argument.
13769 (Sized_relobj::do_add_symbols): Add the Layout argument.
13770 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13771 Unify the two versions.
13772 (Add_plugin_symbols): Remove.
13773 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13774 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13775 (Add_plugin_symbols): Remove.
13776 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13777 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13778 (Add_symbols::run): Make it work with Pulginobj.
13779
89dd1680
ILT
137802009-02-06 Ian Lance Taylor <iant@google.com>
13781
13782 * object.cc (Sized_relobj::do_layout): Make info message start
13783 with lower case letter.
13784
266d0a74
ILT
137852009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13786
602b464e
ILT
13787 * binary.cc: Fix file comment.
13788
266d0a74
ILT
13789 * options.h (enum Incremental_disposition): Define.
13790 (class General_options): Add new options: --incremental,
13791 --incremental_changed, --incremental_unchanged,
13792 --incremental_unknown. Add incremental_disposition_ and
13793 implicit_incremental_ fields.
13794 (General_options::incremental_disposition): New function.
13795 (class Position_dependent_options): Add incremental_disposition
13796 option.
13797 (Position_dependent_options::copy_from_options): Set incremental
13798 dispositions.
13799 * options.cc (General_options::parse_incremental_changed): New
13800 function.
2e702c99
RM
13801 (General_options::parse_incremental_unchanged): New function.
13802 (General_options::parse_incremental_unknown): New function.
13803 (General_options::General_options): Initialize new fields
266d0a74 13804 incremental_disposition_ and implicit_incremental_.
2e702c99 13805 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13806 without --incremental.
13807
f073bbf7
CD
138082009-02-06 Chris Demetriou <cgd@google.com>
13809
13810 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13811 pointer and to report location as the file name associated with
13812 the symbol.
13813 (gold_undefined_symbol_at_location): New function to replace the
13814 old gold_undefined_symbol functionality.
13815 * target-reloc.h (relocate_section): Update to use
13816 gold_undefined_symbol_at_location.
13817 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13818 Call gold_undefined_symbol function rather than gold_error.
13819 * errors.h (Errors::undefined_symbol): Take location as a
13820 string, rather than calculating it from a relocation.
13821 * errors.cc (Errors::fatal): Print "fatal error:" before the
13822 formatted message.
13823 (Errors::error, Errors::error_at_location): Print "error: "
13824 before the formatted message.
13825 (Errors::undefined_symbol): Take location as a string, rather
13826 than calculating it from a relocation.
13827 (gold_undefined_symbol_at_location): New function akin to
13828 old gold_undefined_symbol, calculates location from relocation.
13829 (gold_undefined_symbol): Change to take only a Symbol pointer
13830 and to report location as the file name associated with the symbol.
13831 * testsuite/debug_msg.sh: Update for changed error messages.
13832 * testsuite/undef_symbol.sh: Likewise.
13833
8e94a90c
ILT
138342009-02-04 Duncan Sands <baldrick@free.fr>
13835
13836 PR 9812
13837 * reduced_debug_output.h
13838 (Output_reduced_debug_abbrev_section::failed): Use format for
13839 gold_warning.
13840 (Output_reduced_debug_info_section::faild): Likewise.
13841
88a0e15b
ILT
138422009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13843
13844 * script.cc (Lazy_demangler): New class.
2e702c99 13845 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13846 symbol only once.
13847
5efc7cd2
CC
138482009-01-29 Cary Coutant <ccoutant@google.com>
13849
13850 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13851 to __tls_get_addr.
13852 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13853
e0ebcf42
ILT
138542009-01-28 Ian Lance Taylor <iant@google.com>
13855
5efc7cd2 13856 * version.cc (version_string): Bump to 1.9.
75fe7426 13857
e0ebcf42
ILT
13858 * gold.h: Include <cstring> and <stdint.h>.
13859 * version.cc: Include <cstdio>.
13860 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13861 warning.
13862 * reduced_debug_output.cc (insert_into_vector): Rename from
13863 Insert_into_vector; change all callers. Use Swap_unaligned to
13864 avoid aliasing issue; remove union since it is unnecessary.
13865
8e2813be 138662009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13867
13868 * Makefile.am (CCFILES): Add gc.cc.
13869 (HFILES): Add gc.h.
13870 * Makefile.in: Regenerate.
13871 * gold.cc (Gc_runner): New class.
13872 (queue_initial_tasks): Call garbage collection related tasks
13873 when corresponding options are invoked.
13874 (queue_middle_gc_tasks): New function.
13875 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13876 processed early before laying out sections during garbage collection.
13877 * gold.h (queue_middle_gc_tasks): New function.
13878 (is_prefix_of): Move from "layout.cc".
13879 * i386.cc (Target_i386::gc_process_relocs): New function.
13880 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13881 * main.cc (main): Create object of class "Garbage_collection".
13882 * object.cc (Relobj::copy_symbols_data): New function.
13883 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13884 (Sized_relobj::do_layout): Allow this function to be called twice
13885 during garbage collection and defer layout of section during the
6d03d481
ST
13886 first call.
13887 * object.h (Relobj::get_symbols_data): New function.
13888 (Relobj::is_section_name_included): New function.
13889 (Relobj::copy_symbols_data): New function.
13890 (Relobj::set_symbols_data): New function.
13891 (Relobj::get_relocs_data): New function.
13892 (Relobj::set_relocs_data): New function.
13893 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13894 (Relobj::gc_process_relocs): New function.
13895 (Relobj::do_gc_process_relocs): New pure virtual function.
13896 (Relobj::sd_): New data member.
13897 (Sized_relobj::is_output_section_offset_invalid): New function.
13898 (Sized_relobj::do_gc_process_relocs): New function.
13899 * options.h (General_options::gc_sections): Modify to not be a no-op.
13900 (General_options::print_gc_sections): New option.
13901 * plugin.cc (Plugin_finish::run): Remove function call to
13902 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13903 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13904 * reloc.cc (Read_relocs::run): Add task to process relocs and
13905 determine unreferenced sections when doing garbage collection.
13906 (Gc_process_relocs): New class.
13907 (Sized_relobj::do_gc_process_relocs): New function.
13908 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13909 sections that are garbage collected.
13910 * reloc.h (Gc_process_relocs): New class.
13911 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13912 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13913 symbols whose corresponding sections are garbage collected.
13914 (Symbol_table::Symbol_table): Add new parameter for the garbage
13915 collection object.
13916 (Symbol_table::gc_mark_undef_symbols): New function.
13917 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13918 (Symbol_table::gc_mark_dyn_syms): New function.
13919 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13920 as garbage.
13921 (Symbol_table::add_from_object): Likewise.
13922 (Symbol_table::add_from_relobj): When building shared objects, do not
13923 treat externally visible symbols as garbage.
13924 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13925 table information for static and relocatable links.
13926 * symtab.h (Symbol_table::set_gc): New function.
13927 (Symbol_table::gc): New function.
13928 (Symbol_table::gc_mark_undef_symbols): New function.
13929 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13930 (Symbol_table::gc_mark_dyn_syms): New function.
13931 (Symbol_table::gc_): New data member.
e1df38aa 13932 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13933 function.
13934 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13935 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13936
3b293544
CF
139372009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13938
13939 * options.h (General_options::gc_sections): Define as a no-op for now.
13940 (General_options::no_keep_memory): Ditto.
13941 (General_options::Bshareable): Define.
13942 * options.cc (General_options::finalize): Honor -Bshareable.
13943
83d22aa8
AS
139442009-01-20 Andreas Schwab <schwab@suse.de>
13945
13946 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13947 read the value in the contents, since we don't use it. Use the
13948 template endianness when writing.
13949 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13950
cd536b21
AS
139512009-01-19 Andreas Schwab <schwab@suse.de>
13952
13953 * configure.tgt (powerpc64-*): Fix targ_obj.
13954
99e9a495
ILT
139552009-01-15 Ian Lance Taylor <iant@google.com>
13956
13957 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13958 local symbols when stripping all symbols.
13959
bbbfea06
CC
139602009-01-14 Cary Coutant <ccoutant@google.com>
13961
99e9a495 13962 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13963
0f7c0701
CC
139642009-01-14 Cary Coutant <ccoutant@google.com>
13965
13966 * archive.cc (Archive::get_elf_object_for_member): Remove call
13967 to File_read::claim_for_plugin.
13968 * descriptors.cc (Descriptors::open): Remove reference to
13969 is_claimed.
13970 (Descriptors::claim_for_plugin): Remove.
13971 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13972 (Descriptors::is_claimed): Remove.
13973 (claim_descriptor_for_plugin): Remove.
13974 * fileread.cc (File_read::claim_for_plugin): Remove.
13975 * fileread.h (File_read::claim_for_plugin): Remove.
13976 (File_read::descriptor): Reopen descriptor if necessary.
13977 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13978 (Plugin_manager::all_symbols_read): Add task parameter. Change
13979 all callers.
13980 (Plugin_manager::get_input_file): New function.
13981 (Plugin_manager::release_input_file): New function.
13982 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13983 corresponding data member.
13984 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13985 and pass to base constructor. Change all callers.
13986 (get_input_file, release_input_file): New functions.
13987 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13988 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13989 (Plugin_manager::all_symbols_read): Add task parameter.
13990 (Plugin_manager::get_input_file): New function.
13991 (Plugin_manager::release_input_file): New function.
13992 (Plugin_manager::task_): New data member.
13993 (Pluginobj::Pluginobj): Add filesize parameter.
13994 (Pluginobj::filename): New function.
13995 (Pluginobj::descriptor): New function.
13996 (Pluginobj::filesize): New function.
13997 (Pluginobj::filesize_): New data member.
13998 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13999 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14000 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14001
14002 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14003 with archive libraries.
14004 * testsuite/Makefile.in: Regenerate.
14005 * testsuite/plugin_test.c (struct sym_info): New type.
14006 (get_input_file, release_input_file): New static variables.
14007 (onload): Capture new transfer vector entries.
14008 (claim_file_hook): Stop reading at end of file according to filesize.
14009 Factor out parsing of readelf output into separate function.
14010 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14011 APIs and get the source file name from the symbol table. Convert
14012 source file name to corresponding object file name. Print info
14013 message when adding new input files.
14014 (parse_readelf_line): New function.
14015 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14016 * testsuite/plugin_test_2.sh: Likewise.
14017 * testsuite/plugin_test_3.sh: Likewise.
14018 * testsuite/plugin_test_4.sh: New test case.
14019
62a6d109
ILT
140202009-01-07 Ian Lance Taylor <iant@google.com>
14021
14022 * version.cc (version_string): Bump to 1.8.
14023
483620e8
CC
140242008-12-23 Cary Coutant <ccoutant@google.com>
14025
14026 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14027 * plugin.cc (Plugin_manager::finish): Rename as
14028 layout_deferred_objects. Move cleanup to separate function.
14029 (Plugin_manager::cleanup): New function.
14030 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14031 separately.
14032 * plugin.h (Plugin_manager::finish): Rename as
14033 layout_deferred_objects.
14034 (Plugin_manager::cleanup): New function.
14035 (Plugin_manager::cleanup_done): New field.
14036
d66a9eb3
CC
140372008-12-23 Cary Coutant <ccoutant@google.com>
14038
14039 * plugin.cc (is_visible_from_outside): New function.
14040 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14041 so we don't return "IR only" status for exported symbols or -r links.
14042
14043 * testsuite/Makefile.am (plugin_test_3): New test case.
14044 * testsuite/Makefile.in: Regenerate.
14045 * testsuite/plugin_test_3.sh: New file.
14046
5995b570
CC
140472008-12-22 Cary Coutant <ccoutant@google.com>
14048
14049 * object.cc (Sized_relobj::layout_section): New function.
14050 (Sized_relobj::do_layout): Defer layout of input sections until after
14051 plugin has provided replacement files.
14052 (Sized_relobj::do_layout_deferred_sections): New function.
14053 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14054 (Relobj::layout_deferred_sections): New function.
14055 (Relobj::do_layout_deferred_sections): New function.
14056 (Sized_relobj::do_layout_deferred_sections): New function.
14057 (Sized_relobj::layout_section): New function.
14058 (Sized_relobj::Deferred_layout): New structure.
14059 (Sized_relobj::deferred_layout_): New field.
14060 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14061 Change all callers. Layout deferred sections.
14062 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14063 references.
14064 (Plugin_hook::run): Move code from do_plugin_hook inline.
14065 (Plugin_hook::do_plugin_hook): Remove.
14066 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14067 (Plugin_manager::finish): Renamed, was cleanup.
14068 (Plugin_manager::should_defer_layout): New function.
14069 (Plugin_manager::add_deferred_layout_object): New function.
14070 (Plugin_manager::Deferred_layout_list): New type.
14071 (Plugin_manager::deferred_layout_objects_): New field.
14072 (Plugin_hook::do_plugin_hook): Remove.
14073
ee769c88
ILT
140742008-12-17 Ian Lance Taylor <iant@google.com>
14075
14076 * options.h (class General_options): Add --no case for
14077 --export-dynamic.
14078
abc8dcba
CC
140792008-12-16 Cary Coutant <ccoutant@google.com>
14080
14081 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14082 vector.
14083 (Plugin_manager::claim_file): Create plugin object even if
14084 plugin did not call the add_symbols callback.
14085 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14086 asking for more symbols than were added.
14087 * testsuite/Makefile.am (plugin_test_1): Add test case with
14088 no global symbols.
14089 (empty.syms): New target.
14090 * testsuite/Makefile.in: Regenerate.
14091 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14092 message. Don't call add_symbols if no globals.
14093 (all_symbols_read_hook): Don't provide replacement for empty
14094 claimed file.
14095
b0074644
ILT
140962008-12-12 Ian Lance Taylor <iant@google.com>
14097
68943102
ILT
14098 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14099 r_type == 0 for a local symbol with r_sym == 0.
14100 (scan_relocatable_relocs): Pass r_sym to
14101 local_non_section_strategy.
14102 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14103 r_sym parameter.
14104
b0074644
ILT
14105 * configure.ac: Update test for TLS descriptors: they are
14106 supported as of glibc 2.9.
14107 * configure: Rebuild.
14108
c2508178
ILT
141092008-12-11 Ian Lance Taylor <iant@google.com>
14110
14111 PR 7091
14112 * target-reloc.h (Default_scan_relocatable_relocs): For each
14113 function, map r_type == 0 to RELOC_DISCARD.
14114
2756a258
CC
141152008-12-10 Cary Coutant <ccoutant@google.com>
14116
14117 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14118 object to override a kept COMDAT group from a plugin object.
14119
bb6f53d3
ILT
141202008-12-09 Ian Lance Taylor <iant@google.com>
14121
fbc558e1
ILT
14122 PR 7088
14123 * yyscript.y (file_cmd): Handle INPUT.
14124
bb6f53d3
ILT
14125 * testsuite/initpri1.c: Change all declarations to be full
14126 prototypes by adding void, to avoid compiler warnings.
14127
4674ecfc
CC
141282008-12-05 Rafael Avila de Espindola <espindola@google.com>
14129
14130 * options.cc (General_options::parse_plugin_opt): New.
14131 (General_options::add_plugin): The argument now is just the filename.
14132 (General_options::add_plugin_option): New.
14133 * options.h (plugin_opt): New.
14134 (add_plugin): Change argument name.
14135 (add_plugin_option): New.
14136 * plugin.cc (Plugin::load): Don't parse the plugin option.
14137 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14138 (Plugin::add_option): New.
14139 (Plugin::args_): Change type.
14140 (Plugin::filename_): New.
14141 (Plugin_manager::add_plugin_option): New.
14142 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14143 * testsuite/Makefile.in: Regenerate.
14144
fd06b4aa
CC
141452008-12-05 Cary Coutant <ccoutant@google.com>
14146
14147 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14148 Handle --strip-lto-sections option.
14149 * options.h (strip_lto_sections): New option.
14150
6c52134c
CC
141512008-12-01 Cary Coutant <ccoutant@google.com>
14152
14153 * plugin.cc (ld_plugin_message): Change format parameter to const.
14154 Fix mismatch between new[] and delete.
14155
a45248e0
CC
141562008-11-14 Cary Coutant <ccoutant@google.com>
14157
14158 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14159 instead of -1U.
14160
c82fbeee
CS
141612008-11-05 Craig Silverstein <csilvers@google.com>
14162
14163 * options.cc (General_options::parse_dynamic_list): New function.
14164 * options.h (General_options): New flags dynamic_list,
14165 dynamic_list_data, dynamic_list_cpp_new, and
14166 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14167 (General_options::in_dynamic_list): New function.
14168 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14169 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14170 (Lex::can_continue_name): Likewise.
14171 (yylex): Likewise.
14172 (read_script_file): New parameter script_options.
14173 (read_dynamic_list): New function.
14174 (Script_options::define_dynamic_list): New function.
14175 (dynamic_list_keyword_parsecodes): New variable.
14176 (dynamic_list_keywords): New variable.
14177 * script.h (Script_options::define_dynamic_list): New function
14178 prototype.
14179 (read_dynamic_list): New function prototype.
14180 * symtab.cc (strprefix): New macro.
14181 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14182 dynamic_list_data, dynamic_list_cpp_new, and
14183 dynamic_list_cpp_typeinfo.
14184 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14185 (dynamic_list_expr): New rule.
14186 (dynamic_list_nodes): Likewise.
14187 (dynamic_list_node): Likewise.
14188 * testsuite/Makefile.am (dynamic_list): New test.
14189 * testsuite/Makefile.in: Regenerated.
14190 * testsuite/dynamic_list.t: New file.
14191 * testsuite/dynamic_list.sh: New file.
14192
e0bb29a5
CS
141932008-11-05 Craig Silverstein <csilvers@google.com>
14194
14195 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14196 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14197 (t11_last): Likewise.
14198 * testsuite/ver_test_6.c (main): Likewise.
14199
4e1e25e0
CC
142002008-10-07 Cary Coutant <ccoutant@google.com>
14201
14202 * options.c (General_options::finalize): Add check for -static and
14203 -shared.
14204 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14205 is not empty.
14206
92f03fcb
CC
142072008-10-02 Cary Coutant <ccoutant@google.com>
14208
14209 * plugin.cc (make_sized_plugin_object): Fix conditional
14210 compilation to work when not all targets are enabled.
14211
fbd8a257
CC
142122008-09-29 Cary Coutant <ccoutant@google.com>
14213
14214 * archive.cc (Archive::get_file_and_offset): Use filename instead
14215 of name to get library path.
14216 (Archive::include_member): Unlock external member of a thin archive.
14217
14218 * testsuite/Makefile.am (TEST_AR): New variable.
14219 (thin_archive_test_1): New test.
14220 (thin_archive_test_2): New test.
81636b3f
CC
14221 * testsuite/Makefile.in: Regenerate.
14222 * testsuite/thin_archive_main.cc: New file.
14223 * testsuite/thin_archive_test_1.cc: New file.
14224 * testsuite/thin_archive_test_2.cc: New file.
14225 * testsuite/thin_archive_test_3.cc: New file.
14226 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14227
eff45813
CC
142282008-09-29 Cary Coutant <ccoutant@google.com>
14229
14230 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14231 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14232 instead of -1U.
14233 (Sized_relobj::do_finalize_local_symbols): Likewise.
14234 (Sized_relobj::map_to_kept_section): Likewise.
14235 * object.h (Sized_relobj::invalid_address): New constant.
14236 (Sized_relobj::do_output_section_offset): Check for invalid_address
14237 and return -1ULL.
14238 * output.cc (Output_reloc::local_section_offset): Use constant
14239 invalid_address instead of -1U.
14240 (Output_reloc::get_address): Likewise.
14241 (Output_section::output_address): Change -1U to -1ULL.
14242 * output.h (Output_reloc::invalid_address): New constant.
14243 * reloc.cc (Sized_relobj::write_sections): Use constant
14244 invalid_address instead of -1U.
14245 (Sized_relobj::relocate_sections): Likewise.
14246 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14247 values for merge sections.
14248 * target-reloc.h (relocate_for_relocatable): Use constant
14249 invalid_address instead of -1U.
14250
89fc3421
CC
142512008-09-19 Cary Coutant <ccoutant@google.com>
14252
14253 Add plugin functionality for link-time optimization (LTO).
14254 * configure.ac (plugins): Add --enable-plugins option.
14255 * configure: Regenerate.
14256 * config.in: Regenerate.
14257 * Makefile.am (LIBDL): New variable.
14258 (CCFILES): Add plugin.cc.
14259 (HFILES): Add plugin.h.
14260 (ldadd_var): Add LIBDL.
14261 * Makefile.in: Regenerate.
14262
14263 * archive.cc: Include "plugin.h".
14264 (Archive::setup): Don't preread archive symbols when using a plugin.
14265 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14266 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14267 files.
14268 (Archive::include_member): Add symbols from plugin objects.
14269 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14270 * descriptors.cc (Descriptors::open): Check for file descriptors
14271 abandoned by plugins.
14272 (Descriptors::claim_for_plugin): New function.
14273 * descriptors.h (Descriptors::claim_for_plugin): New function.
14274 (Open_descriptor::is_claimed): New field.
14275 (claim_descriptor_for_plugin): New function.
14276 * fileread.cc (File_read::claim_for_plugin): New function.
14277 * fileread.h (File_read::claim_for_plugin): New function.
14278 (File_read::descriptor): New function.
14279 * gold.cc: Include "plugin.h".
14280 (queue_initial_tasks): Add task to call plugin hooks for generating
14281 new object files.
14282 * main.cc: Include "plugin.h".
14283 (main): Load plugin libraries.
14284 * object.h (Pluginobj): Declare.
14285 (Object::pluginobj): New function.
14286 (Object::do_pluginobj): New function.
14287 (Object::set_target): New function.
14288 * options.cc: Include "plugin.h".
14289 (General_options::parse_plugin): New function.
14290 (General_options::General_options): Initialize plugins_ field.
14291 (General_options::add_plugin): New function.
14292 * options.h (Plugin_manager): Declare.
14293 (General_options): Add --plugin option.
14294 (General_options::has_plugins): New function.
14295 (General_options::plugins): New function.
14296 (General_options::add_plugin): New function.
14297 (General_options::plugins_): New field.
14298 * plugin.cc: New file.
14299 * plugin.h: New file.
14300 * readsyms.cc: Include "plugin.h".
14301 (Read_symbols::do_read_symbols): Check for archive before checking
14302 for ELF file. Call plugin hooks to claim files.
14303 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14304 from a real object file; force override when processing replacement
14305 files.
14306 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14307 (Symbol::init_base_object): Likewise.
14308 (Symbol::init_base_output_data): Likewise.
14309 (Symbol::init_base_output_segment): Likewise.
14310 (Symbol::init_base_constant): Likewise.
14311 (Symbol::init_base_undefined): Likewise.
14312 (Symbol::output_section): Assert that object is not a plugin.
14313 (Symbol_table::add_from_pluginobj): New function.
14314 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14315 undefined.
14316 (Symbol_table::sized_write_globals): Likewise.
14317 (Symbol_table::add_from_pluginobj): Instantiate template.
14318 * symtab.h (Sized_pluginobj): Declare.
14319 (Symbol::in_real_elf): New function.
14320 (Symbol::set_in_real_elf): New function.
14321 (Symbol::in_real_elf_): New field.
14322 (Symbol_table::add_from_pluginobj): New function.
14323
14324 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14325 (LIBDL): New variable.
14326 (LDADD): Add LIBDL.
14327 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14328 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14329 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14330 (MOSTLYCLEANFILES): Likewise.
14331 * testsuite/Makefile.in: Regenerate.
14332 * testsuite/plugin_test.c: New file.
14333 * testsuite/plugin_test_1.sh: New file.
14334 * testsuite/plugin_test_2.sh: New file.
14335
de31bda5
ILT
143362008-09-16 Ian Lance Taylor <iant@google.com>
14337
9c2d0ef9
ILT
14338 * target-reloc.h (relocate_section): Check whether a symbol is
14339 defined by the ABI before reporting an undefined symbol error.
14340 * target.h (Target::is_defined_by_abi): Make parameter const.
14341 (Target::do_is_defined_by_abi): Likewise.
14342 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14343 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14344 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14345 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14346 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14347 * testsuite/Makefile.in: Rebuild.
14348
de31bda5
ILT
14349 * fileread.cc (make_view): Add casts to avoid warning.
14350
9fa33bee
AO
143512008-09-16 Alexandre Oliva <aoliva@redhat.com>
14352
14353 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14354 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14355
183fd0e3
AO
143562008-09-16 Alexandre Oliva <aoliva@redhat.com>
14357
14358 * options.h (General_options::output_is_executable): New.
14359 (General_options::output_is_pie): New.
14360 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14361 for shared libraries.
14362 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14363
7be8330a
CD
143642008-09-11 Chris Demetriou <cgd@google.com>
14365
14366 * options.h (origin): New -z option.
14367 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14368 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14369 in DT_FLAGS_1.
14370
a9caad02
CC
143712008-09-05 Cary Coutant <ccoutant@google.com>
14372
14373 * fileread.cc (File_read::make_view): Add check for attempt to map
14374 beyond end of file.
14375
ae6dce4d
CC
143762008-09-05 Cary Coutant <ccoutant@google.com>
14377
14378 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14379 explicit instantiations.
14380
d7ab2a47
KVH
143812008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14382
14383 PR gold/6858
14384 * options.cc (General_options::finalize): Allow undefined symbols
14385 in shlibs if linking -shared.
14386
14387 PR gold/6859
14388 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14389 symbols as not needing a dynsym entry.
14390
1e52a9c1
CS
143912008-08-20 Craig Silverstein <csilvers@google.com>
14392
14393 * fileread.cc (File_read::open): Do not lock the file unless it
14394 was successfully opened.
14395
d85c80a3
CC
143962008-08-14 Cary Coutant <ccoutant@google.com>
14397
14398 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14399 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14400 * testsuite/tls_test.cc (struct int128): 128-bit struct
14401 for testing TLS relocs with non-zero addend.
14402 (v12): New TLS variable.
14403 (t12): New test.
14404 (t_last): Add check for v12.
14405 * testsuite/tls_test.h (t12): New function.
14406 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14407
2d924fd9
ILT
144082008-08-13 Ian Lance Taylor <iant@google.com>
14409
14410 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14411 set tls_segment_ or relro_segment_.
14412 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14413 when appropriate.
14414 * output.h (Output_section::clear_is_relro): New function.
14415 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14416 sections specially even when output_data_ is empty.
14417 (Output_segment::maximum_alignment): When first section is relro,
14418 only force alignment for PT_LOAD segments.
14419 * script.cc (script_data_segment_align): New function.
14420 (script_data_segment_relro_end): New function.
14421 * script-c.h (script_data_segment_align): Declare.
14422 (script_data_segment_relro_end): Declare.
14423 * script-sections.h (class Script_sections): Declare
14424 data_segment_align and data_segment_relro_end. Add fields
14425 segment_align_index_ and saw_relro_end_.
14426 * script-sections.cc (class Sections_element): Add set_is_relro
14427 virtual function. Add new bool* parameter to place_orphan_here.
14428 Add get_output_section virtual function.
14429 (class Output_section_definition): Add set_is_relro. Add new
14430 bool* parameter to place_orphan_here. Add get_output_section.
14431 Add is_relro_ field.
14432 (Output_section_definition::Output_section_definition): Initialize
14433 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14434 and is_relro_ fields.
14435 (Output_section_definition::place_orphan_here): Add is_relro
14436 parameter.
14437 (Output_section_definition::set_section_addresses): Set relro for
14438 output section.
14439 (Output_section_definition::alternate_constraint): Likewise.
14440 (class Orphan_output_section): Add new bool* parameter to
14441 place_orphan_here. Add get_output_section.
14442 (Orphan_output_section::place_orphan_here): Add is_relro
14443 parameter.
14444 (Script_sections::Script_sections): Initialize
14445 data_segment_align_index_ and saw_relro_end_.
14446 (Script_sections::data_segment_align): New function.
14447 (Script_sections::data_segment_relro_end): New function.
14448 (Script_sections::place_orphan): Set or clear is_relro.
14449 (Script_sections::set_section_addresses): Force alignment of first
14450 TLS section.
14451 * yyscript.y (exp): Call script_data_segment_align and
14452 script_data_segment_relro_end.
14453 * testsuite/relro_script_test.t: New file.
14454 * testsuite/relro_test.cc (using_script): Declare.
14455 (t1, t2): Test using_script.
14456 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14457 (relro_script_test_SOURCES): Define.
14458 (relro_script_test_DEPENDENCIES): Define.
14459 (relro_script_test_LDFLAGS): Define.
14460 (relro_script_test_LDADD): Define.
14461 (relro_script_test.so): New target.
14462 * testsuite/Makefile.in: Rebuild.
14463
f827c9a9
CC
144642008-08-06 Cary Coutant <ccoutant@google.com>
14465
14466 * archive.cc (Archive::total_archives, Archive::total_members)
14467 (Archive::total_members_loaded): New variables.
14468 (Archive::setup): Add parameter. Add option to preread
14469 archive symbols.
14470 (Archive::read_armap): Add counter.
14471 (Archive::get_file_and_offset): New function.
14472 (Archive::get_elf_object_for_member): New function.
14473 (Archive::read_all_symbols): New function.
14474 (Archive::read_symbols): New function.
14475 (Archive::add_symbols): Add counters.
14476 (Archive::include_all_members): Use armap to find members if it's
14477 already built.
14478 (Archive::include_member): Skip reading symbols if already read.
14479 Factored code into Archive::get_file_and_offset and
14480 Archive::get_elf_object_for_member. Changed call to
14481 Mapfile::report_include_archive_member.
14482 (Archive::print_stats): New function.
14483 * archive.h: Declare Object and Read_symbols_data classes.
14484 (Archive::Archive): Add initializers for new members.
14485 (Archive::setup): Add parameter.
14486 (Archive::print_stats): New function.
14487 (Archive::total_archives, Archive::total_members)
14488 (Archive::total_members_loaded): New variables.
14489 (Archive::get_file_and_offset): New function.
14490 (Archive::get_elf_object_for_member): New function.
14491 (Archive::read_all_symbols): New function.
14492 (Archive::read_symbols): New function.
14493 (Archive::Archive_member): New class.
14494 (Archive::members_): New member.
14495 (Archive::num_members_): New member.
14496 * main.cc: Include archive.h.
14497 (main): Call Archive::print_stats.
14498 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14499 archive parameter; member_name is now the fully-decorated name.
14500 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14501 * options.h: (General_options): Add --preread-archive-symbols option.
14502 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14503 Archive::setup.
14504
de4c45bd
ILT
145052008-08-04 Ian Lance Taylor <iant@google.com>
14506
14507 * symtab.h (Symbol::use_plt_offset): New function.
14508 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14509 * powerpc.cc (Relocate::relocate): Likewise.
14510 * sparc.cc (Relocate::relocate): Likewise.
14511 * x86_64.cc (Relocate::relocate): Likewise.
14512 * testsuite/weak_plt.sh: New test.
14513 * testsuite/weak_plt_main.cc: New test.
14514 * testsuite/weak_plt_shared.cc: New test.
14515 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14516 (check_PROGRAMS): Add weak_plt.
14517 (check_DATA): Add weak_plt_shared.so.
14518 (weak_plt_main_pic.o, weak_plt): New targets.
14519 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14520 * testsuite/Makefile.in: Rebuild.
14521
14522 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14523 gcctestdir/ld.
14524 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14525 * testsuite/Makefile.in: Rebuild.
14526
323ee3f4
AM
145272008-08-04 Alan Modra <amodra@bigpond.net.au>
14528
14529 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14530 * Makefile.in: Regenerate.
14531 * po/POTFILES.in: Regenerate.
14532
7c07ecec
ILT
145332008-07-29 Ian Lance Taylor <iant@google.com>
14534
14535 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14536 symbols before other symbols.
14537 * testsuite/script_test_2.cc (test_addr): Declare.
14538 (test_addr_alias): Declare.
14539 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14540 values.
7c07ecec
ILT
14541 * testsuite/script_test_2.t: Define test_addr_alias and
14542 test_addr.
14543
5778530e
ILT
145442008-07-24 Ian Lance Taylor <iant@google.com>
14545
2a00e4fb
ILT
14546 PR 5990
14547 * descriptors.cc: New file.
14548 * descriptors.h: New file.
14549 * gold-threads.h (class Hold_optional_lock): New class.
14550 * fileread.cc: Include "descriptors.h".
14551 (File_read::~File_read): Release descriptor rather than closing
14552 it.
14553 (File_read::open) [file]: Call open_descriptor rather than open.
14554 Set is_descriptor_opened_.
14555 (File_read::open) [memory]: Assert that descriptor is not open.
14556 (File_read::reopen_descriptor): New function.
14557 (File_read::release): Release descriptor.
14558 (File_read::do_read): Make non-const. Reopen descriptor.
14559 (File_read::read): Make non-const.
14560 (File_read::make_view): Reopen descriptor.
14561 (File_read::do_readv): Likewise.
14562 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14563 Update declarations.
14564 * layout.cc: Include "descriptors.h".
14565 (Layout::create_build_id): Use open_descriptor rather than open.
14566 * output.cc: Include "descriptors.h".
14567 (Output_file::open): Use open_descriptor rather than open.
14568 * archive.cc (Archive::const_iterator): Change Archive to be
14569 non-const.
14570 (Archive::begin, Archive::end): Make non-const.
14571 (Archive::count_members): Likewise.
14572 * archive.h (class Archive): Update declarations.
14573 * object.h (Object::read): Make non-const.
14574 * Makefile.am (CCFILES): Add descriptors.cc.
14575 (HFILES): Add descriptors.h.
14576 * Makefile.in: Rebuild.
14577
801647d1
ILT
14578 PR 6716
14579 * gold.h: Always include <clocale>. Add Solaris workarounds
14580 following code in binutils/sysdep.h.
14581
5edd166e
ILT
14582 PR 6048
14583 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14584 this->eh_frame_hdr_ is NULL before using it.
14585
c89ad728
ILT
14586 * dynobj.cc (Versions::Versions): Update comment.
14587
aa86f06b
ILT
14588 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14589 the base version name.
14590
5778530e
ILT
14591 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14592 array size plus one.
14593 (Stringpool_template::set_string_offsets): Subtract one from key
14594 before using it as an array index.
14595 (Stringpool_template::get_offset_with_length): Likewise.
14596 (Stringpool_template::write_to_buffer): Likewise.
14597 * stringpool.h (Stringpool_template::get_offset_from_key):
14598 Likewise.
14599
057ead22
ILT
146002008-07-23 Ian Lance Taylor <iant@google.com>
14601
7f649c59
ILT
14602 PR 6658
14603 * object.h (Merged_symbol_value::value): Do our best to handle a
14604 negative addend.
14605
057ead22
ILT
14606 PR 6647
14607 * script.cc (Version_script_info::get_versions): Don't add empty
14608 version tag to return value.
14609 (Version_script_info::get_symbol_version_helper): Change return
14610 type to bool. Add pversion parameter. Change all callers.
14611 (script_register_vers_node): Don't require a non-NULL tag.
14612 * script.h (class Version_script_info): Update declarations.
14613 (Version_script_info::get_symbol_version): Change return type to
14614 bool. Add version parameter. Change all callers.
14615 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14616 handling. Handle an empty version from a version script.
14617 (Symbol_table::define_special_symbol): Likewise.
14618 * testsuite/ver_test_10.script: New file.
14619 * testsuite/ver_test_10.sh: New file.
14620 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14621 (check_DATA): Add ver_test_10.syms.
14622 (ver_test_10.syms, ver_test_10.so): New target.
14623 * testsuite/Makefile.in: Rebuild.
14624
58e54ac2
CD
146252008-07-23 Simon Baldwin <simonb@google.com>
14626
14627 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14628 to zero for undefined symbols from dynamic libraries.
14629
95d14cd3
ILT
146302008-07-23 Ian Lance Taylor <iant@google.com>
14631
14632 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14633 Change all callers.
14634 * symtab.h (class Symbol_table): Update declaration.
14635 * testsuite/ver_test_9.cc: New file.
14636 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14637 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14638 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14639 (ver_test_9.so, ver_test_9.o): New targets.
14640 * testsuite/Makefile.in: Rebuild.
14641
92de84a6
ILT
146422008-07-22 Ian Lance Taylor <iant@google.com>
14643
34810851
ILT
14644 * options.h (class General_options): Define --check-sections.
14645 * layout.cc (Layout::set_segment_offsets): Handle
14646 --check-sections.
14647
af6156ef
ILT
14648 * options.h (class General_options): Define -n/--nmagic and
14649 -N/--omagic.
14650 * options.cc (General_options::finalize): For -n/--nmagic or
14651 -N/--omagic, set -static.
14652 * layout.cc (Layout::attach_allocated_section_to_segment): If
14653 -N/--omagic, don't put read-only and read-write sections in
14654 different segments.
14655 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14656 finding a read-only segment.
14657 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14658 don't set the minimum segment alignment to the common page size,
14659 and don't set the file offset to the address modulo the page size.
14660 * script-sections.cc (Script_sections::create_segments): If
14661 -n/--omagic, don't put read-only and read-write sections in
14662 different segments.
14663
92de84a6
ILT
14664 * cref.cc: New file.
14665 * cref.h: New file.
14666 * options.h (class General_options): Add --print-symbol-counts.
14667 * main.cc (main): Issue defined symbol report if requested.
14668 * archive.cc (Archive::interpret_header): Make into a const member
14669 function.
14670 (Archive::add_symbols): Call Input_objects::archive_start and
14671 archive_stop.
14672 (Archive::const_iterator): Define new class.
14673 (Archive::begin, Archive::end): New functions.
14674 (Archive::include_all_members): Rewrite to use iterator.
14675 (Archive::count_members): New function.
14676 * archive.h (class Archive): Update declarations.
14677 (Archive::filename): New function.
14678 * object.cc: Include "cref.h".
14679 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14680 (Sized_relobj::do_get_global_symbol_counts): New function.
14681 (Input_objects::add_object): Add object to cross-referencer.
14682 (Input_objects::archive_start): New function.
14683 (Input_objects::archive_stop): New function.
14684 (Input_objects::print_symbol_counts): New function.
14685 * object.h: Declare Cref and Archive.
14686 (Object::get_global_symbol_counts): New function.
14687 (Object::do_get_global_symbol_counts): New pure virtual function.
14688 (class Sized_relobj): Add defined_count_ field. Update
14689 declarations.
14690 (class Input_objects): Add cref_ field. Update constructor.
14691 Update declarations.
14692 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14693 defined_count_.
14694 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14695 symbol counts.
14696 (Sized_dynobj::do_get_global_symbol_counts): New function.
14697 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14698 defined_count_. Update declarations. Define Symbols typedef.
14699 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14700 parameter. Change all callers.
14701 (Symbol_table::add_from_dynobj): Add sympointers and defined
14702 parameters. Change all callers.
14703 * symtab.h (class Symbol_table): Update declarations.
14704 * Makefile.am (CCFILES): Add cref.cc.
14705 (HFILES): Add cref.h.
14706 * Makefile.in: Rebuild.
14707
3f7c5e1d
CD
147082008-07-22 Simon Baldwin <simonb@google.com>
14709
14710 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14711 to zero when writing undefined symbols.
14712
e0b64032
ILT
147132008-07-22 Ian Lance Taylor <iant@google.com>
14714
14715 * output.cc (Output_section::add_input_section): Don't try to
14716 merge empty merge sections.
14717
096b02cf
CS
147182008-07-21 Craig Silverstein <csilvers@google.com>
14719
14720 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14721 Include symbol version in error message.
cd536b21 14722
1d1f116d
CD
147232008-07-20 Chris Demetriou <cgd@google.com>
14724
cd536b21 14725 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14726 (RANDOM_SEED_CFLAGS): New substituted variable.
14727 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14728 * configure: Rebuild.
14729 * Makefile.in: Likewise.
14730 * testsuite/Makefile.in: Likewise.
14731
a18f591e
ILT
147322008-07-18 Ian Lance Taylor <iant@google.com>
14733
14734 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14735 where we see NAME/NULL and NAME/VERSION as separate symbols.
14736 * testsuite/ver_test_main.cc (main): Call t4.
14737 (t4, t4_2a): Define.
14738 * testsuite/ver_test_2.cc (t4_2): Define.
14739 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14740 * testsuite/ver_test_4.cc (t4_2a): Define.
14741 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14742 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14743
c6e3f6ed
ILT
147442008-07-17 Ian Lance Taylor <iant@google.com>
14745
14746 * dynobj.cc (Versions::add_def): If we give an error about a
14747 missing version, go ahead and create the version anyhow.
14748
ef9beddf
ILT
147492008-07-10 Ian Lance Taylor <iant@google.com>
14750
14751 Handle output sections with more than 0x7fffffff bytes.
14752 * object.h (class Relobj): Change map_to_output_ to
14753 output_sections_, and just keep a section pointer. Change all
14754 uses. Move comdat group support to Sized_relobj.
14755 (Relobj::is_section_specially_mapped): Remove.
14756 (Relobj::output_section): Remove poff parameter. Change all
14757 callers.
14758 (Relobj::output_section_offset): New function.
14759 (Relobj::set_section_offset): Rewrite.
14760 (Relobj::map_to_output): Remove.
14761 (Relobj::output_sections): New function.
14762 (Relobj::do_output_section_offset): New pure virtual function.
14763 (Relobj::do_set_section_offset): Likewise.
14764 (class Sized_relobj): Add section_offsets_ field. Add comdat
14765 group support from Relobj. Update declarations.
14766 (Sized_relobj::get_output_section_offset): New function.
14767 (Sized_relobj::do_output_section_offset): New function.
14768 (Sized_relobj::do_set_section_offset): New function.
14769 * object.cc (Relobj::output_section_address): Remove.
14770 (Sized_relobj::Sized_relobj): Initialize new fields.
14771 (Sized_relobj::include_section_group): Cast find_kept_object to
14772 Sized_relobj.
14773 (Sized_relobj::include_linkonce_section): Likewise.
14774 (Sized_relobj::do_layout): Use separate arrays for output section
14775 and output offset.
14776 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14777 output_sections.
14778 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14779 output_sections and section_offsets.
14780 (Sized_relobj::write_local_symbols): Likewise.
14781 (map_to_kept_section): Compute output address directly.
14782 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14783 output_sections and section_offsets.
14784 (Sized_relobj::write_sections): Likewise.
14785 (Sized_relobj::relocate_sections): Likewise.
14786 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14787 * output.h (class Output_reloc): Update declarations. Change
14788 u2_.relobj to Sized_relobj*.
14789 (class Output_data_reloc): Change add functions to use
14790 Sized_relobj*.
14791 * output.cc (Output_reloc::Output_reloc): Change relobj to
14792 Sized_relobj*.
14793 (Output_reloc::local_section_offset): Change return type to
14794 Elf_Addr. Use get_output_section_offset.
14795 (Output_reloc::get_address): Likewise.
14796 (Output_section::is_input_address_mapped): Don't call
14797 is_section_specially_mapped.
14798 (Output_section::output_offset): Likewise.
14799 (Output_section::output_address): Likewise.
14800 (Output_section::starting_output_address): Likewise.
14801 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14802 parameter to Sized_relobj*.
14803 (Copy_relocs::need_copy_reloc): Likewise.
14804 (Copy_relocs::save): Likewise.
14805 * copy-relocs.h (class Copy_relocs): Update declarations.
14806 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14807 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14808 * target-reloc.h (relocate_for_relocatable): Change
14809 offset_in_output_section type to Elf_Addr. Change code that uses
14810 it as well.
14811 * layout.cc (Layout::layout): Always set *off.
14812 * mapfile.cc (Mapfile::print_input_section): Use
14813 output_section_offset.
14814 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14815 Sized_relobj*.
14816 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14817 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14818 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14819
5cb66f97
ILT
148202008-07-03 Ian Lance Taylor <iant@google.com>
14821
14822 * layout.cc (Layout::include_section): Do not discard unrecognized
14823 SHT_STRTAB sections.
14824
afe47622
CS
148252008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14826
14827 * script.cc (Lex::can_continue_name): Make '?' allowable in
14828 version-script names.
14829 * testsuite/version_script.map: Change glob pattern to use '?'
14830
5adf9721
ILT
148312008-06-30 Manish Singh <yosh@gimp.org>
14832
14833 PR 6585
14834 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14835 Correct typo.
14836
e6fde208
ILT
148372008-06-30 Ian Lance Taylor <iant@google.com>
14838
14839 PR 6660
14840 PR 6682
14841 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14842 versions]: Don't try to read the value in the contents, since we
14843 don't use it. Use the template endianness when writing.
14844
3f2e6a2d
CC
148452008-06-25 Cary Coutant <ccoutant@google.com>
14846
14847 * fileread.cc (File_read::make_view): Assert on zero-length view.
14848 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14849 symbol table when there are no symbols to read.
14850
c43d3a48
CS
148512008-06-23 Craig Silverstein <csilvers@google.com>
14852
14853 * version.cc (version_string): Bump to 1.7
14854
5f494ea0
CS
148552008-06-18 Craig Silverstein <csilvers@google.com>
14856
14857 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14858 constant 0xFFFF to type Valtype.
14859 (Powerpc_relocate_functions::rel16_ha): Likewise.
14860
c42e122e
ILT
148612008-06-17 Ian Lance Taylor <iant@google.com>
14862
f34787f8
ILT
14863 * output.h (Output_section::Input_section): Initialize p2align_ to
14864 zero for Output_section_data constructors.
14865 (Output_section::Input_section::addralign): If not an input
14866 section, return the alignment of the Output_section_data.
14867 * testsuite/copy_test.cc: New file.
14868 * testsuite/copy_test_1.cc: New file.
14869 * testsuite/copy_test_2.cc: New file.
14870 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14871 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14872 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14873 (copy_test_1_pic.o, copy_test_1.so): New targets.
14874 (copy_test_2_pic.o, copy_test_2.so): New targets.
14875 * testsuite/Makefile.in: Rebuild.
14876
c42e122e
ILT
14877 * script-sections.cc (Script_sections::place_orphan): Initialize
14878 local variable exact.
14879
ce3ac18a
DE
148802008-06-13 David Edelsohn <edelsohn@gnu.org>
14881
14882 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14883
42cacb20
DE
148842008-06-12 David Edelsohn <edelsohn@gnu.org>
14885 David S. Miller <davem@davemloft.net>
14886
14887 * powerpc.cc: New file.
14888 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14889 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14890 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14891 * Makefile.in: Rebuild.
14892
7b308235
ILT
148932008-06-09 Ian Lance Taylor <iant@google.com>
14894
14895 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14896 <exception>.
14897 (throwing, orig_terminate): New static variables.
14898 (terminate_handler): New static function.
14899 (t2): Set terminate handler.
14900
f0b886e3
ILT
149012008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14902
14903 PR 6584
cd536b21 14904 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14905 alignment.
14906
3e90f135
CC
149072008-05-30 Cary Coutant <ccoutant@google.com>
14908
14909 * archive.cc (Archive::include_all_members) Correct to step
14910 over symbol table and extended name table in thin archives.
14911
e09ad04a
ILT
149122008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14913
14914 PR 6407
14915 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14916 calculation.
14917
62b01cb5
ILT
149182008-05-28 Caleb Howe <cshowe@google.com>
14919
14920 * reduced_debug_output.cc: New file.
14921 * reduced_debug_output.h: New file.
92de84a6 14922 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14923 * options.cc (General_options::finalize): Add strip_debug_non_line
14924 to the strip heirarchy.
14925 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14926 fields.
14927 * layout.cc: Include "reduced_debug_output.h".
14928 (Layout::Layout): Initialize new fields.
14929 (line_only_debug_sections): New static array.
14930 (is_lines_only_debug_sections): New static inline function.
14931 (Layout::include_section): Handle --strip-debug-non-line.
14932 (Layout::make_output_section): If --strip-debug-non-line, build
14933 new output sections for .debug_abbrev and .debug_info.
14934 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14935 gold. Warn about possible overflow.
14936 (read_signed_LEB_128): Likewise.
14937 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14938 (read_signed_LEB_128): Declare.
14939 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14940 (HFILES): Add reduced_debug_output.h.
14941 * Makefile.in: Rebuild.
14942
7d9e3d98
ILT
149432008-05-21 Ian Lance Taylor <iant@google.com>
14944
14945 * mapfile.cc: New file.
14946 * mapfile.h: New file.
14947 * options.h (class General_options): Add -M/--print-map and -Map.
14948 * options.cc (General_options::finalize): Make -M equivalent to
14949 -Map -.
14950 * main.cc: Include <cstdio> and "mapfile.h".
14951 (main): Open mapfile if requested.
14952 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14953 constructor. Change caller.
14954 (queue_initial_tasks): Add mapfile parameter. Change caller.
14955 (queue_middle_tasks): Likewise.
14956 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14957 declarations.
14958 * archive.cc: Include "mapfile.h".
14959 (Archive::add_symbols): Add mapfile parameter. Change all
14960 callers. Pass mapfile, symbol, and reason to include_member.
14961 (Archive::include_all_members): Add mapfile parameter. Change all
14962 callers.
14963 (Archive::include_member): Add mapfile, sym, and why parameters.
14964 Change all callers. Report inclusion to map file.
14965 * archive.h: Include "fileread.h".
14966 (class Archive): Update declarations.
14967 (Archive::file): New const method.
14968 (class Add_archive_symbols): Add mapfile_ field. Update
14969 constructor. Change all callers.
14970 * readsyms.h (class Read_symbols): Likewise.
14971 (class Finish_group): Likewise.
14972 (class Read_script): Likewise.
14973 * common.cc: Include "mapfile.h".
14974 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14975 all callers.
14976 (Symbol_table::do_allocate_commons): Likewise.
14977 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14978 symbol allocation to mapfile.
14979 * common.h (class Allocate_commons_task): Add mapfile_ field.
14980 Update constructor. Change all callers.
14981 * symtab.h (class Symbol_table): Update declarations.
14982 * layout.cc: Include "mapfile.h".
14983 (Layout_task_runner::run): Print information to mapfile.
14984 (Layout::create_gold_note): Change Output_data_fixed_space to
14985 Output_data_zero_fill.
14986 (Layout::create_build_id): Likewise.
14987 (Layout::print_to_mapfile): New function.
14988 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14989 constructor. Change caller.
14990 (class Layout): Declare print_to_mapfile.
14991 * output.cc (Output_section::Input_section::print_to_mapfile): New
14992 function.
14993 (Output_section::add_input_section): If producing a map, always
14994 add to input_sections_ list.
14995 (Output_section::do_print_to_mapfile): New function.
14996 (Output_segment::print_sections_to_mapfile): New function.
14997 (Output_segment::print_section_list_to_mapfile): New function.
14998 * output.h: Include "mapfile.h".
14999 (Output_data::print_to_mapfile): New function.
15000 (Output_data::do_print_to_mapfile): New virtual function.
15001 (Output_segment_headers::do_print_to_mapfile): New function.
15002 (Output_file_header::do_print_to_mapfile): New function.
15003 (Output_data_const::do_print_to_mapfile): New function.
15004 (class Output_data_const_buffer): Add map_name_ field. Update
15005 constructor. Change all callers. Add do_print_to_mapfile
15006 function.
15007 (class Output_data_fixed_space): Likewise.
15008 (class Output_data_space): Likewise.
15009 (class Output_data_zero_fill): New class.
15010 (Output_data_strtab::do_print_to_mapfile): New function.
15011 (Output_data_reloc_base::do_print_to_mapfile): New function.
15012 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15013 (Output_data_group::do_print_to_mapfile): New function.
15014 (Output_data_got::do_print_to_mapfile): New function.
15015 (Output_data_dynamic::do_print_to_mapfile): New function.
15016 (Output_symtab_xindex::do_print_to_mapfile): New function.
15017 (class Output_section): Declare do_print_to_mapflie. Declare
15018 print_to_mapfile in Input_section.
15019 (class Output_segment): Declare new functions.
15020 * object.h (Sized_relobj::symbol_count): New function.
15021 * script-sections.cc
15022 (Output_section_element_dot_assignment::set_section_addresses):
15023 Change Output_data_fixed_space to Output_data_zero_fill.
15024 (Output_data_expression::do_print_to_mapfile): New function.
15025 * script.cc (read_input_script): Add mapfile parameter. Change
15026 all callers.
15027 * script.h (read_input_script): Update declaration.
15028 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15029 (Eh_frame::do_print_to_mapfile): New function.
15030 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15031 (Output_merge_string::do_print_to_mapfile): New function.
15032 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15033 function.
15034 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15035 function.
15036 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15037 function.
15038 * Makefile.am (CCFILES): Add mapfile.cc.
15039 (HFILES): Add mapfile.h.
15040 * Makefile.in: Rebuild.
15041
9f1d377b
ILT
150422008-05-19 Ian Lance Taylor <iant@google.com>
15043
15044 * options.h (class General_options): Add -z relro.
15045 * layout.cc (Layout::Layout): Initialize relro_segment_.
15046 (Layout::add_output_section_data): Return the output section.
15047 (Layout::make_output_section): Rcognize relro sections and mark
15048 them appropriately.
15049 (Layout::attach_allocated_section_to_segment): Put relro sections
15050 in a PT_GNU_RELRO segment.
15051 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15052 section as relro.
15053 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15054 PT_TLS segments.
15055 (Layout::linkonce_mapping): Map d.rel.ro.local to
15056 .data.rel.ro.local.
15057 (Layout::output_section_name): Us .data.rel.ro.local for any
15058 section which begins with that.
15059 * layout.h (class Layout): Update add_output_section_data
15060 declaration. Add relro_segment_ field.
15061 * output.cc (Output_section::Output_section): Initialize is_relro_
15062 and is_relro_local_ fields.
15063 (Output_segment::add_output_section): Group relro sections.
15064 (Output_segment::is_first_section_relro): New function.
15065 (Output_segment::maximum_alignment): If there is a relro section,
15066 align the segment to the common page size.
15067 (Output_segment::set_section_addresses): Track whether we are
15068 looking at relro sections. If the last section is a relro
15069 section, align to the common page size.
15070 (Output_segment::set_section_list_addresses): Add in_relro
15071 parameter. Change all callers. Align to the page size when
15072 moving from relro to non-relro section.
15073 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15074 segment.
15075 * output.h (class Output_section): Add is_relro_ and
15076 is_relro_local_ fields.
15077 (Output_section::is_relro): New function.
15078 (Output_section::set_is_relro): New function.
15079 (Output_section::is_relro_local): New function.
15080 (Output_section::set_is_relro_local): New function.
15081 (class Output_segment): Update declarations.
15082 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15083 * sparc.cc (Target_sparc::got_section): Likewise.
15084 * x86_64.cc (Target_x86_64::got_section): Likewise.
15085 * testsuite/relro_test_main.cc: New file.
15086 * testsuite/relro_test.cc: New file.
15087 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15088 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15089 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15090 (relro_test.so, relro_test_pic.o): New targets.
15091 * testsuite/Makefile.in: Rebuild.
15092
a984ee1d
ILT
150932008-05-16 Ian Lance Taylor <iant@google.com>
15094
01676dcd
ILT
15095 * output.cc (Output_segment::add_output_section): Remove front
15096 parameter.
15097 * output.h (class Output_segment): Remove
15098 add_initial_output_section and overloaded add_output_section.
15099 Update declaration of remaining add_output_section.
15100 * layout.cc (Layout::create_interp): Call add_output_section
15101 rather than add_initial_output_section.
15102 (Layout::finish_dynamic_section): Likewise.
15103
497897f9
ILT
15104 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15105 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15106 know the dynamic type.
15107 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15108 field. Initialize it in constructor.
15109 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15110 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15111 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15112 reloc.
15113
a984ee1d
ILT
15114 * output.cc (Output_reloc::get_address): Change return type to
15115 Elf_Addr.
15116 * output.h (class Output_reloc): Update get_address declaration.
15117 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15118 for section addresses.
15119
55ba0940
ILT
151202008-05-09 Ian Lance Taylor <iant@google.com>
15121
15122 PR 6493
15123 * gold.cc (gold_nomem): Use return value of write.
15124
75517b77
ILT
151252008-05-08 Ian Lance Taylor <iant@google.com>
15126
15127 * symtab.c (Symbol::init_base_output_data): Add version
15128 parameter. Change all callers.
15129 (Symbol::init_base_output_segment): Likewise.
15130 (Symbol::init_base_constant): Likewise.
15131 (Symbol::init_base_undefined): Likewise.
15132 (Sized_symbol::init_output_data): Likewise.
15133 (Sized_symbol::init_output_segment): Likewise.
15134 (Sized_symbol::init_constant): Likewise.
15135 (Sized_symbol::init_undefined): Likewise.
15136 (Symbol_table::do_define_in_output_data): If the new symbol has a
15137 version, mark it as the default.
15138 (Symbol_table::do_define_in_output_segment): Likewise.
15139 (Symbol_table::do_define_as_constant): Likewise.
15140 * symtab.h (class Symbol): Update declarations.
15141 (class Sized_symbol): Likewise.
15142 * resolve.cc (Symbol::override_version): New function.
c42e122e 15143 (Symbol::override_base): Call override_version.
75517b77
ILT
15144 (Symbol::override_base_with_special): Likewise.
15145 * testsuite/ver_script_8.script: New file.
15146 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15147 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15148 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15149 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15150
f1f70eae
ILT
151512008-05-06 Ian Lance Taylor <iant@google.com>
15152
f3e9c5c5
ILT
15153 PR 6049
15154 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15155 functions.
15156 (class General_options): Remove existing --undefined, and add
15157 --no-undefined instead. Add new --undefined as synonym for -u.
15158 * archive.cc (Archive::add_symbols): Check whether symbol was
15159 named with -u.
15160 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15161 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15162 all uses. Add IS_UNDEFINED. Update declarations to split
15163 different versions of init_base. Declare init_base_undefined.
15164 (Symbol::is_defined): Handle IS_UNDEFINED.
15165 (Symbol::is_undefined): Likewise.
15166 (Symbol::is_weak_undefined): Call is_undefined.
15167 (Symbol::is_absolute): Handle IS_CONSTANT.
15168 (class Sized_symbol): Update declarations to split different
15169 versions of init. Declare init_undefined.
15170 (class Symbol_table): Declare new functions.
15171 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15172 Change all callers.
15173 (Symbol::init_base_output_data): Likewise.
15174 (Symbol::init_base_output_segment): Likewise.
15175 (Symbol::init_base_constant): Likewise.
15176 (Symbol::init_base_undefined): New function.
15177 (Sized_symbol::init_object): Rename from init. Change all
15178 callers.
15179 (Sized_symbol::init_output_data): Likewise.
15180 (Sized_symbol::init_output_segment): Likewise.
15181 (Sized_symbol::init_constant): Likewise.
15182 (Sized_symbol::init_undefined): New function.
15183 (Symbol_table::add_undefined_symbols_from_command_line): New
15184 function.
15185 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15186 function.
15187 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15188 (Symbol::output_section): Likewise.
15189 (Symbol::set_output_section): Likewise.
15190 (Symbol_table::sized_finalize_symbol): Likewise.
15191 (Symbol_table::sized_write_globals): Likewise.
15192 * resolve.cc (Symbol_table::should_override): Likewise.
15193 (Symbol::override_base_with_special): Likewise.
15194
8bdcdf2c
ILT
15195 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15196 symbol, change it to have default visibility.
15197 * testsuite/protected_1.cc: New file.
15198 * testsuite/protected_2.cc: New file.
15199 * testsuite/protected_3.cc: New file.
15200 * testsuite/protected_main_1.cc: New file.
15201 * testsuite/protected_main_2.cc: New file.
15202 * testsuite/protected_main_3.cc: New file.
15203 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15204 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15205 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15206 (protected_1.so): New target.
15207 (protected_1_pic.o, protected_2_pic.o): New targets.
15208 (protected_3_pic.o): New target.
15209 (check_PROGRAMS): Add protected_2.
15210 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15211 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15212 * testsuite/Makefile.in: Rebuild.
15213
2b706932
ILT
15214 * options.h (DEFINE_var): Add set_user_set_##varname__.
15215 (DEFINE_bool_alias): New macro.
15216 (class General_options): Define -Bstatic using DEFINE_bool_alias
15217 rather than DEFINE_special. Add --undefined as an alias for -z
15218 defs.
15219 * options.cc (General_options::parse_Bstatic): Remove.
15220
d82a5bcc
ILT
15221 * options.h (class General_options): Add --fatal-warnings.
15222 * main.cc (main): Implement --fatal-warnings.
15223 * errors.h (Errors::warning_count): New function.
15224
f1f70eae
ILT
15225 * options.h (class General_options): Add -Bsymbolic-functions.
15226 * symtab.h (Symbol::is_preemptible): Check for
15227 -Bsymbolic-functions.
15228
8825ac63
ILT
152292008-05-05 Ian Lance Taylor <iant@google.com>
15230
d98bc257
ILT
15231 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15232 as noVARNAME rather than no-VARNAME.
15233 (class General_options): Add option -z combreloc.
15234 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15235 get_address.
15236 (Output_reloc::sort_before) [SHT_REL]: New function.
15237 (Output_reloc::sort_before) [SHT_RELA]: New function.
15238 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15239 Sort_relocs_comparison.
15240 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15241 parameter. Change all callers.
15242 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15243 sort_relocs parameter. Change all callers.
15244 * output.cc (Output_reloc::get_address): New function, broken out
15245 of write_rel.
15246 (Output_reloc::write_rel): Call it.
15247 (Output_reloc::compare): New function.
15248 (Output_data_reloc_base::do_write): Optionally sort relocs.
15249
60b2b4e7
ILT
15250 * configure.ac: If targ_extra_obj is set, link it in.
15251 * configure.tgt: Initialize all variables.
15252 (x86_64*): Set targ_extra_obj and targ_extra_size.
15253 * configure: Rebuild.
15254
8825ac63
ILT
15255 * object.cc (Sized_relobj::include_section_group): Adjust section
15256 indexes read from group data. Build vector to pass to
15257 layout_group.
15258 * layout.cc (Layout::layout_group): Add flags and shndxes
15259 parameters. Remove contents parameter. Change caller. Update
15260 explicit instantiations.
15261 * layout.h (class Layout): Update layout_group declaration.
15262 * output.cc (Output_data_group::Output_data_group): Add flags and
15263 input_shndxes parameters. Remove contents parameter. Change
15264 caller.
15265 (Output_data_group::do_write): Change input_sections_ to
15266 input_shndxes_.
15267 * output.h (class Output_data_group): Update constructor
15268 declaration. Rename input_sections_ to input_shndxes_.
15269 * testsuite/many_sections_test.cc: Add template.
15270
e94cf127
CC
152712008-04-30 Cary Coutant <ccoutant@google.com>
15272
4418b2d5
CC
15273 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15274
e94cf127
CC
15275 * layout.cc (Layout::include_section): Refactored check for debug
15276 info section.
15277 (Layout::add_comdat): Add new parameters. Change type
15278 of signature parameter. Add object and shndx to signatures table.
15279 (Layout::find_kept_object): New function.
15280 * layout.h: Include <cstring>.
15281 (Layout::is_debug_info_section): New function.
15282 (Layout::add_comdat): Add new parameters.
15283 (Layout::find_kept_object): New function.
15284 (Layout::Kept_section): New struct.
15285 (Layout::Signatures): Change type of map range.
15286 * object.cc (Relobj::output_section_address): New function.
15287 (Sized_relobj::include_section_group): Add new parameters. Change
15288 calls to Layout::add_comdat. Change to build table of kept comdat
15289 groups and table mapping discarded sections to kept sections.
15290 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15291 (Sized_relobj::do_layout): Change calls to include_section_group and
15292 include_linkonce_section.
15293 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15294 value to zero when section is discarded.
15295 (Sized_relobj::map_to_kept_section): New function.
15296 * object.h (Relobj::output_section_address): New function.
15297 (Relobj::Comdat_group): New type.
15298 (Relobj::find_comdat_group): New function.
15299 (Relobj::Comdat_group_table): New type.
15300 (Relobj::Kept_comdat_section): New type.
15301 (Relobj::Kept_comdat_section_table): New type.
15302 (Relobj::add_comdat_group): New function.
15303 (Relobj::set_kept_comdat_section): New function.
15304 (Relobj::get_kept_comdat_section): New function.
15305 (Relobj::comdat_groups_): New field.
15306 (Relobj::kept_comdat_sections_): New field.
15307 (Symbol_value::input_value): Update comment.
15308 (Sized_relobj::map_to_kept_section) New function.
15309 (Sized_relobj::include_linkonce_section): Add new parameter.
15310 * target-reloc.h (Comdat_behavior): New type.
15311 (get_comdat_behavior): New function.
15312 (relocate_section): Add code to map a discarded section to the
15313 corresponding kept section when applying a relocation.
15314
e4e5049b
CS
153152008-04-30 Craig Silverstein <csilvers@google.com>
15316
15317 * dwarf_reader.cc (next_generation_count): New static var.
15318 (Addr2line_cache_entry): New struct.
15319 (addr2line_cache): New static var.
15320 (Dwarf_line_info::one_addr2line): Added caching.
15321 (Dwarf_line_info::clear_addr2line_cache): New function.
15322 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15323 cache-size parameter.
15324 (Dwarf_line_info::one_addr2line_cache): New function.
15325 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15326 new cache-size argument to one_addr2line(), and clear cache.
15327
d09e9154
CC
153282008-04-28 Cary Coutant <ccoutant@google.com>
15329
15330 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15331 R_386_PC8 relocations.
15332
7ef73768
ILT
153332008-04-23 Ian Lance Taylor <iant@google.com>
15334
55438702
ILT
15335 * object.cc (Sized_relobj::include_section_group): Check for
15336 invalid section group.
15337
c165fb93
ILT
15338 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15339 header size.
15340
7ef73768
ILT
15341 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15342 than read for file header.
15343 * archive.cc (Archive::include_member): Likewise.
15344
6194aaab
L
153452008-04-23 Paolo Bonzini <bonzini@gnu.org>
15346
15347 * aclocal.m4: Regenerate.
15348 * configure: Regenerate.
15349
d491d34e
ILT
153502008-04-19 Ian Lance Taylor <iant@google.com>
15351
5ea2bac6
ILT
15352 * version.cc (version_string): Bump to 1.6.
15353
7bc3e21a
ILT
15354 * testsuite/Makefile.am (many_sections_r_test): New target.
15355 (many_sections_r_test_SOURCES): Remove.
15356 (many_sections_r_test_DEPENDENCIES): Remove.
15357 (many_sections_r_test_LDFLAGS): Remove.
15358 (many_sections_r_test_LDADD): Remove.
15359
7fcd3aa9
ILT
15360 * object.cc (Sized_relobj::do_add_symbols): Always pass
15361 local_symbol_count_ to add_from_relobj.
15362
4c94d6ae
ILT
15363 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15364 every thousand variables.
15365 * testsuite/Makefile.in: Rebuild.
15366
d491d34e
ILT
15367 * object.cc (Xindex::initialize_symtab_xindex): New function.
15368 (Xindex::read_symtab_xindex): New function.
15369 (Xindex::sym_xindex_to_shndx): New function.
15370 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15371 available.
15372 (Sized_relobj::do_initialize_xindex): New function.
15373 (Sized_relobj::do_read_symbols): Adjust section links.
15374 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15375 parameter. Change all callers.
15376 (Sized_relobj::include_section_group): Adjust section links and
15377 symbol section indexes.
15378 (Sized_relobj::do_layout): Adjust section links.
15379 (Sized_relobj::do_count_local_symbols): Adjust section links and
15380 symbol section indexes.
15381 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15382 ordinary and special symbols.
15383 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15384 dynsym_xindex parameters. Change all callers. Adjust section
15385 links. Use SHN_XINDEX when needed.
15386 (Sized_relobj::get_symbol_location_info): Adjust section links.
15387 Don't get fooled by special symbols.
15388 * object.h (class Xindex): Define.
15389 (class Object): Add xindex_ parameter. Declare virtual functoin
15390 do_initialize_xindex.
15391 (Object::adjust_sym_shndx): New function.
15392 (Object::set_xindex): New protected function.
15393 (class Symbol_value): Add is_ordinary_shndx_ field.
15394 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15395 (Symbol_value::value): Assert ordinary section.
15396 (Symbol_value::initialize_input_to_output_map): Likewise.
15397 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15398 Change all callers.
15399 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15400 all callers.
15401 (class Sized_relobj): Update declarations.
15402 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15403 parameter. Change all callers.
15404 (Sized_relobj::adjust_shndx): New function.
15405 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15406 field.
15407 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15408 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15409 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15410 (Sized_dynobj::read_dynsym_section): Adjust section links.
15411 (Sized_dynobj::read_dynamic): Likewise.
15412 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15413 section links.
15414 (Sized_dynobj::do_initialize_xindex): New function.
15415 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15416 do_initialize_xindex.
15417 (Sized_dynobj::adjust_shndx): New function.
15418 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15419 dynsym_xindex_ fields.
15420 (Layout::finalize): Add a call to set_section_indexes before
15421 creating the symtab sections.
15422 (Layout::set_section_indexes): Don't do anything if the section
15423 already has a section index.
15424 (Layout::create_symtab_sections): Add shnum parameter. Change
15425 caller. Create .symtab_shndx section if needed.
15426 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15427 caller.
15428 (Layout::allocated_output_section_count): New function.
15429 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15430 needed.
15431 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15432 fields. Update declarations.
15433 (Layout::symtab_xindex): New function.
15434 (Layout::dynsym_xindex): New function.
15435 (class Write_symbols_task): Add layout_ field.
15436 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15437 Change caller.
15438 * output.cc (Output_section_headers::Output_section_headers): Add
15439 shstrtab_section parameter. Change all callers.
15440 (Output_section_headers::do_sized_write): Store overflow values
15441 for section count and section string table section index in
15442 section header zero.
15443 (Output_file_header::do_sized_write): Check for overflow of
15444 section count and section string table section index.
15445 (Output_symtab_xindex::do_write): New function.
15446 (Output_symtab_xindex::endian_do_write): New function.
15447 * output.h (class Output_section_headers): Add shstrtab_section_.
15448 Update declarations.
15449 (class Output_symtab_xindex): Define.
15450 (Output_section::has_out_shndx): New function.
15451 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15452 field.
15453 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15454 Change all callers.
15455 (Sized_symbol::init): Likewise.
15456 (Symbol::output_section): Check for ordinary symbol.
15457 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15458 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15459 callers.
15460 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15461 Change all callers. Simplify handling of symbols from sections
15462 not included in the link.
15463 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15464 distinction.
15465 (Weak_alias_sorter::operator()): Assert that symbols are
15466 ordinary.
15467 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15468 distinction.
15469 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15470 parameters. Change all callers.
15471 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15472 symbol distinction. Use SHN_XINDEX when needed.
15473 (Symbol_table::write_section_symbol): Add symtab_xindex
15474 parameter. Change all callers.
15475 (Symbol_table::sized_write_section_symbol): Likewise. Use
15476 SHN_XINDEX when needed.
15477 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15478 declarations.
15479 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15480 (Symbol::is_defined): Check is_ordinary.
15481 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15482 (Symbol::is_absolute, Symbol::is_common): Likewise.
15483 (class Sized_symbol): Update declarations.
15484 (class Symbol_table): Update declarations.
15485 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15486 parameters. Change all callers.
15487 (Sized_symbol::override): Likewise.
15488 (Symbol_table::override): Likewise.
15489 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15490 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15491 is_ordinary, and orig_st_shndx parameters. Change all callers.
15492 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15493 to be in an ordinary section.
15494 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15495 object and is_ordinary parameters. Change all callers.
15496 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15497 Change all callers. Don't add undefined or non-ordinary symbols
15498 to reloc_map_.
15499 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15500 Change all callers.
15501 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15502 declarations.
15503 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15504 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15505 (Sized_relobj::relocate_sections): Likewise.
15506 * target-reloc.h (scan_relocs): Adjust section symbol index.
15507 (scan_relocatable_relocs): Likewise.
15508 * i386.cc (Scan::local): Check for ordinary symbols.
15509 * sparc.cc (Scan::local): Likewise.
15510 * x86_64.cc (Scan::local): Likewise.
15511 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15512 to symbol_section_and_value.
15513 * testsuite/many_sections_test.cc: New file.
15514 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15515 (check_PROGRAMS): Add many_sections_test.
15516 (many_sections_test_SOURCES): Define.
15517 (many_sections_test_DEPENDENCIES): Define.
15518 (many_sections_test_LDFLAGS): Define.
15519 (BUILT_SOURCES): Add many_sections_define.h.
15520 (many_sections_define.h): New target.
15521 (BUILT_SOURCES): Add many_sections_check.h.
15522 (many_sections_check.h): New target.
15523 (check_PROGRAMS): Add many_sections_r_test.
15524 (many_sections_r_test_SOURCES): Define.
15525 (many_sections_r_test_DEPENDENCIES): Define.
15526 (many_sections_r_test_LDFLAGS): Define.
15527 (many_sections_r_test_LDADD): Define.
15528 (many_sections_r_test.o): New target.
15529 * testsuite/Makefile.in: Rebuild.
15530
c5818ff1
CC
155312008-04-17 Cary Coutant <ccoutant@google.com>
15532
15533 * errors.cc (Errors::info): New function.
15534 (gold_info): New function.
15535 * errors.h (Errors::info): New function.
15536 * gold.h (gold_info): New function.
15537 * object.cc (Input_objects::add_object): Print trace output.
15538 * options.cc (options::parse_set): New function.
15539 (General_options::parse_wrap): Deleted.
15540 (General_options::General_options): Deleted initializer.
15541 * options.h (options::String_set): New typedef.
15542 (options::parse_set): New function.
15543 (DEFINE_set): New macro.
15544 (General_options::wrap): Changed to use DEFINE_set. Changed
15545 callers of any_wrap_symbols and is_wrap_symbol.
15546 (General_options::trace, General_options::trace_symbol):
15547 New options.
15548 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15549 (General_options::wrap_symbols_): Deleted.
15550 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15551
b5be4a7c
DM
155522008-04-17 David S. Miller <davem@davemloft.net>
15553
15554 * options.cc (General_options::parse_V): New function.
15555 * options.h: Add entries for -V and -Qy.
15556
155a0dd7
ILT
155572008-04-17 Ian Lance Taylor <iant@google.com>
15558
15559 * common.cc (Symbol_table::allocate_commons): Remove options
15560 parameter. Change caller.
15561 (Symbol_table::do_allocate_commons): Remove options parameter.
15562 Change caller. Just call do_allocate_commons_list twice.
15563 (Symbol_table::do_allocate_commons_list): New function, broken out
15564 of do_allocate_commons.
15565 * common.h (class Allocate_commons_task): Remove options_ field.
15566 Update constructor.
15567 * symtab.cc (Symbol_table::Symbol_table): Initialize
15568 tls_commons_.
15569 (Symbol_table::add_from_object): Put TLS common symbols on
15570 tls_commons_ list.
15571 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15572 which are IN_OUTPUT_DATA.
15573 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15574 allocate_commons and do_allocate_commons declarations. Declare
15575 do_allocate_commons_list.
15576 * gold.cc (queue_middle_tasks): Update creation of
15577 Allocate_commons_task to not pass options.
15578 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15579 (TLS_TEST_C_FLAGS): New variable.
15580 (tls_test_c_pic.o): New target.
15581 (tls_test_shared.so): Link in tls_test_c_pic.o.
15582 (tls_test_c_pic_ie.o): New target.
15583 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15584 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15585 (tls_test_c.o): New target.
15586 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15587 (tls_pic_test_LDADD): Likewise.
15588 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15589 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15590 (tls_test_c_gnu2.o): New target.
15591 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15592 tls_test_c_gnu2.o.
15593 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15594 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15595 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15596 * testsuite/tls_test.cc: Include "config.h".
15597 (t_last): Call t11_last.
15598 * testsuite/tls_test.h (t11, t11_last): Declare.
15599 * testsuite/tls_test_c.c: New file.
15600 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15601 * configure.ac: Check for OpenMP support.
15602 * configure, config.in, Makefile.in: Rebuild.
15603 * testsuite/Makefile.in: Rebuild.
15604
edfbb029
CC
156052008-04-16 Cary Coutant <ccoutant@google.com>
15606
15607 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15608 (Target_i386::tls_base_symbol_defined_): New field.
15609 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15610 (Target_i386::Scan::global): Likewise.
15611 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15612 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15613 (Target_x86_64::tls_base_symbol_defined_): New field.
15614 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15615 (Target_x86_64::Scan::global): Likewise.
15616
f3c69fca
CC
156172008-04-16 Cary Coutant <ccoutant@google.com>
15618
15619 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15620 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15621 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15622 building shared libraries.
15623 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15624 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15625 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15626 * testsuite/Makefile.in: Rebuild.
15627 * testsuite/weak_undef.h: New file.
15628 * testsuite/weak_undef_file1.cc: Add extra test cases.
15629 * testsuite/weak_undef_file2.cc: Likewise.
15630 * testsuite/weak_undef_test.cc: Likewise.
15631
7c414435
DM
156322008-04-16 David S. Miller <davem@davemloft.net>
15633
32b769e1
DM
15634 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15635 Add issued_non_pic_error_ field. Declare check_non_pic.
15636 (Target_sparc::Scan::check_non_pic): New function.
15637 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15638 (Target_sparc::Scan::global): Likewise.
15639
11936fb1
DM
15640 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15641 * configure: Rebuild.
15642
7c414435
DM
15643 * options.h (DEFINE_enable): New macro.
15644 (new_dtags): New enable option.
15645 (initfirst, interpose, loadfltr, nodefaultlib,
15646 nodelete, nodlopen, nodump): New -z options.
15647 * layout.cc (Layout:finish_dynamic_section): If new
15648 dtags enabled, emit DT_RUNPATH. Also, emit a
15649 DT_FLAGS_1 containing any specified -z flags.
15650
85c7bf8b
ILT
156512008-04-16 Ian Lance Taylor <iant@google.com>
15652
12c0daef
ILT
15653 * copy-relocs.cc: New file.
15654 * copy-relocs.h: New file.
15655 * reloc.cc: Remove Copy_relocs code.
15656 * reloc.h: Likewise.
15657 * reloc-types.h (struct Reloc_types) [both versions]: Add
15658 get_reloc_addend_noerror.
15659 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15660 variants of add_global which take an addend which must be zero.
15661 * i386.cc: Include "copy-relocs.h".
15662 (class Target_i386): Change type of copy_relocs_ to variable,
15663 update initializer.
15664 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15665 Change all callers.
15666 (Target_i386::do_finalize_sections): Change handling of
15667 copy_relocs_.
15668 * sparc.cc: Include "copy-relocs.h".
15669 (class Target_sparc): Change type of copy_relocs_ to variable,
15670 update initializer.
15671 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15672 Change all callers.
15673 (Target_sparc::do_finalize_sections): Change handling of
15674 copy_relocs_.
15675 * x86_64.cc: Include "copy-relocs.h".
15676 (class Target_x86_64): Change type of copy_relocs_ to variable,
15677 update initializer.
15678 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15679 class. Change all callers.
15680 (Target_x86_64::do_finalize_sections): Change handling of
15681 copy_relocs_.
15682 * Makefile.am (CCFILES): Add copy-relocs.cc.
15683 (HFILES): Add copy-relocs.h.
15684
4f4995b6
ILT
15685 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15686
85c7bf8b
ILT
15687 * testsuite/script_test_4.sh: Permit leading zeroes.
15688
4f2a9edd
ILT
156892008-04-15 Ian Lance Taylor <iant@google.com>
15690
e6188289
ILT
15691 * script-sections.cc (Script_sections::create_segments): Use
15692 header_size_adjustment even when there is enough room for the
15693 headers.
15694 * testsuite/script_test_4.sh: New file.
15695 * testsuite/script_test_4.t: New file.
15696 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15697 (check_DATA): Add script_test_4.stdout.
15698 (MOSTLYCLEANFILES): Likewise.
15699 (script_test_4): New target.
15700 (script_test_4.stdout): New target.
15701 * testsuite/Makefile.in: Rebuild.
15702
4f2a9edd
ILT
15703 * sparc.cc: Add definitions for Output_data_plt_sparc class
15704 constants.
15705
f5314dd5
DM
157062008-04-14 David S. Miller <davem@davemloft.net>
15707
15708 * sparc.cc: New file.
15709 * Makefile.am (TARGETSOURCES): Add sparc.cc
15710 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15711 * configure.tgt: Document targ_extra_size and
15712 targ_extra_big_endian. Add entries for sparc-* and
15713 sparc64-*.
15714 * configure.ac: Handle targ_extra_size and
15715 targ_extra_big_endian.
15716 * Makefile.in: Rebuild.
15717 * configure: Likewise.
15718 * po/POTFILES.in: Likewise.
15719 * po/gold.pot: Likewise.
15720
154e0e9a
ILT
157212008-04-14 Ian Lance Taylor <iant@google.com>
15722
15723 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15724 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15725 in the name/type/flags to section mapping. Don't call
15726 allocate_output_section.
15727 (Layout::choose_output_section): Change parameter from adjust_name
15728 to is_input_section. Don't permit input sections after sections
15729 are attached to segments. Don't call allocate_output_section.
15730 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15731 not write_enable_output_section.
15732 (Layout::make_output_section): Don't push to
15733 unattached_section_list_ nor call attach_to_segment. Call
15734 attach_section_to_segment if sections are attached.
15735 (Layout::attach_sections_to_segments): New function.
15736 (Layout::attach_section_to_segment): New function.
15737 (Layout::attach_allocated_section_to_segment): Rename from
15738 attach_to_segment. Remove flags parameter.
15739 (Layout::allocate_output_section): Remove function.
15740 (Layout::write_enable_output_section): Remove function.
15741 * layout.h (class Layout): Update for above changes. Add new
15742 field sections_are_attached_.
15743 * output.h (Output_section::update_flags_for_input_section): New
15744 function.
15745 * output.cc (Output_section::add_input_section): Call
15746 update_flags_for_input_section.
15747 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15748
009a67a2
CC
157492008-04-11 Cary Coutant <ccoutant@google.com>
15750
15751 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15752 thought unnecessary.
15753 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15754
759b1a24
ILT
157552008-04-11 Ian Lance Taylor <iant@google.com>
15756
15757 * output.h (class Output_section_data): Remove inline definition
15758 of set_addralign.
15759 * output.cc (Output_section_data::set_addralign): New function.
15760
c2b45e22
CC
157612008-04-11 Cary Coutant <ccoutant@google.com>
15762
15763 Add support for TLS descriptors for i386 and x86_64.
15764 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15765 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15766 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15767 GOT_TYPE_TLS_DESC.
15768 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15769 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15770 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15771 relocations.
15772 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15773 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15774 Fix problem with initial-exec relocations.
15775 (Target_i386::Relocate::relocate_tls): Likewise.
15776 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15777 relaxation.
15778 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15779 support for section-plus-offset dynamic table entries.
15780 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15781 (Output_data_dynamic::Dynamic_entry): Add support for
15782 section-plus-offset dynamic table entries.
15783 (Output_data_dynamic::Classification): Likewise.
15784 (Output_data_dynamic::classification_): Renamed offset_.
15785 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15786 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15787 (Target_x86_64::make_plt_section): New function.
15788 (Target_x86_64::reserve_tlsdesc_entries): New function.
15789 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15790 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15791 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15792 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15793 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15794 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15795 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15796 add extra PLT entry for TLS descriptors.
15797 (Output_data_plt_x86_64::got_): New field.
15798 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15799 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15800 fields.
15801 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15802 descriptors.
15803 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15804 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15805 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15806 R_386_TLS_DESC_CALL relocations.
15807 (Target_x86_64::Scan::global): Likewise.
15808 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15809 for TLS descriptors.
15810 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15811 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15812 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15813 GD-to-IE relaxation.
15814 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15815 and TLS_DESCRIPTORS.
15816 * Makefile.in: Rebuild.
15817 * configure: Rebuild.
15818 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15819 (tls_test_shared2.so): New target.
15820 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15821 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15822 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15823 (tls_shared_gd_to_ie_test_LDADD): New variable.
15824 (tls_shared_gnu2_gd_to_ie_test): New target.
15825 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15826 New targets.
15827 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15828 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15829 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15830 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15831 (tls_shared_gnu2_test): New target.
15832 (tls_test_gnu2_shared.so): New target.
15833 (tls_shared_gnu2_test_SOURCES): New variable.
15834 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15835 (tls_shared_gnu2_test_LDFLAGS): New variable.
15836 (tls_shared_gnu2_test_LDADD): New variable.
15837 * testsuite/Makefile.in: Rebuild.
15838 * testsuite/Makefile.
15839
83bfb6b7
ILT
158402008-04-11 Ian Lance Taylor <iant@google.com>
15841
15842 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15843 justsyms.t.
15844 * testsuite/Makefile.in: Rebuild.
15845
15846 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15847 long.
15848 * testsuite/script_test_2.cc (main): Adjust test.
15849
706e1f5e
ILT
158502008-04-11 David S. Miller <davem@davemloft.net>
15851 Ian Lance Taylor <iant@google.com>
15852
15853 * options.h (General_options): Add entries for '-Y' and
15854 '-relax'.
15855 * options.cc (General_options:finalize): If -Y was used, add those
15856 entries to the library path instead of the default "/lib" and
15857 "/usr/lib".
15858
7c98e6bb
DM
158592008-04-11 David S. Miller <davem@davemloft.net>
15860
15861 * testsuite/justsyms.t: Start at 0x100.
15862 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15863 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15864 long.
15865 * testsuite/script_test_2.cc: Adjust string and section length
15866 checks.
7c98e6bb 15867
99a37bfd
ILT
158682008-04-09 Ian Lance Taylor <iant@google.com>
15869
2cefc357
ILT
15870 PR gold/5996
15871 * script-sections.cc (Sections_element::allocate_to_segment): Add
15872 orphan parameter.
15873 (Output_section_definition::allocate_to_segment): Likewise.
15874 (Orphan_output_section::allocate_to_segment): Likewise.
15875 (Script_sections::attach_sections_using_phdrs_clause): Don't
15876 propagate non-PT_LOAD segments to orphan sections.
15877 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15878 readelf rather than objdump.
15879 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15880 .interp section and PT_INTERP segment are the same size.
15881 * testsuite/Makefile.in: Rebuild.
15882
99a37bfd
ILT
15883 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15884 aliases for symbols defined in the same object.
15885 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15886 (weak_alias_test_SOURCES): New variable.
15887 (weak_alias_test_DEPENDENCIES): New variable.
15888 (weak_alias_test_LDFLAGS): New variable.
15889 (weak_alias_test_LDADD): New variable.
15890 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15891 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15892 (weak_alias_test_3.o): New target.
15893 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15894 * testsuite/weak_alias_test_main.cc: New file.
15895 * testsuite/weak_alias_test_1.cc: New file.
15896 * testsuite/weak_alias_test_2.cc: New file.
15897 * testsuite/weak_alias_test_3.cc: New file.
15898
780e49c5
ILT
158992008-04-08 Ian Lance Taylor <iant@google.com>
15900
cdb0b8f5
ILT
15901 * options.h (class General_options): Add --noinhibit-exec option.
15902 * main.cc (main): Check --noinhibit-exec.
15903
0864d551
ILT
15904 * options.h (class General_options): Define --wrap as a special
15905 option. Add wrap_symbols_ field.
15906 (General_options::any_wrap_symbols): New function.
15907 (General_options::is_wrap_symbol): New function.
15908 * options.cc (General_options::parse_wrap): New function.
15909 (General_options::General_options): Initialize wrap_symbols_.
15910 * symtab.cc (Symbol_table::wrap_symbol): New function.
15911 (Symbol_table::add_from_object): Handle --wrap.
15912 * symtab.h (class Symbol_table): Declare wrap_symbol.
15913 * target.h (Target::wrap_char): New function.
15914 (Target::Target_info): Add wrap_char field.
15915 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15916 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15917 * testsuite/testfile.cc (Target_test::test_target_info):
15918 Likewise.
15919
789aa6de
ILT
15920 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15921 there is one.
15922
2c38906f
ILT
15923 * layout.h (class Layout): Add added_eh_frame_data_ field.
15924 * layout.cc (Layout::Layout): Initialize new field.
15925 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15926 output section until we find a section we merged successfully.
15927 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15928 that the size be non-zero.
15929
780e49c5
ILT
15930 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15931 qualifier.
15932
7fcd0256
ILT
159332008-04-08 Craig Silverstein <csilvers@google.com>
15934
15935 * configure.ac: Export new conditional variable HAVE_ZLIB.
15936 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15937 on HAVE_ZLIB.
15938 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15939 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15940
6835af53
ILT
159412008-04-07 Ian Lance Taylor <iant@google.com>
15942
e24f324c
ILT
15943 * version.cc (version_string): Set to "1.5".
15944
a036edd8
ILT
15945 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15946 Add issued_non_pic_error_ field. Declare check_non_pic.
15947 (Target_x86_64::Scan::check_non_pic): New function.
15948 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15949 (Target_x86_64::Scan::global): Likewise.
15950
624f8810
ILT
15951 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15952 addend parameter. Change caller. Handle merge sections.
15953 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15954 Address to Addend. Don't add in the result of
15955 local_section_offset, pass down the addend and use the returned
15956 value.
15957 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15958 Update declarations of local_section_offset and symbol_value.
15959 * testsuite/two_file_test_1.cc (t18): New function.
15960 * testsuite/two_file_test_2.cc (f18): New function.
15961 * testsuite/two_file_test_main.cc (main): Call t18.
15962 * testsuite/two_file_test.h (t18, f18): Declare.
15963
6835af53
ILT
15964 * configure.ac: Don't test for objdump, c++filt, or readelf.
15965 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15966 conditionals.
15967 (TEST_READELF): New variable.
15968 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15969 (check_PROGRAMS): Add two_file_strip_test.
15970 (two_file_strip_test): New target.
15971 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15972 (two_file_same_shared_strip_test_SOURCES): New variable.
15973 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15974 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15975 (two_file_same_shared_strip_test_LDADD): New variable.
15976 (two_file_shared_strip.so): New target.
15977 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15978 (ver_test_5.syms, ver_test_7.syms): Likewise.
15979 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15980 (strip_test_3.stdout): Use TEST_OBJDUMP.
15981 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15982
86925eef
CC
159832008-04-04 Cary Coutant <ccoutant@google.com>
15984
15985 * symtab.h (Symbol::is_weak_undefined): New function.
15986 (Symbol::is_strong_undefined): New function.
15987 (Symbol::is_absolute): New function.
15988 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15989 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15990 absolute symbols.
15991 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15992 (weak_undef_test): New target.
15993 * testsuite/Makefile.in: Rebuild.
15994 * testsuite/weak_undef_file1.cc: New file.
15995 * testsuite/weak_undef_file2.cc: New file.
15996 * testsuite/weak_undef_test.cc: New file.
15997
126f3ece
ILT
159982008-04-03 Craig Silverstein <csilvers@google.com>
15999
16000 * compressed_output.h (class Output_compressed_section): Use
16001 unsigned buffer.
16002 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16003 add zlib header.
16004 (zlib_compressed_suffix): Removed.
16005 (Output_compressed_section::set_final_data_size): Use unsigned
16006 buffers.
16007 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16008 Fix linker invocation.
16009 (flagstest_o_specialfile_and_compress_debug_sections):
16010 Likewise.
16011 * testsuite/Makefile.in: Regenerated.
16012
deae2a14
DM
160132008-04-02 David S. Miller <davem@davemloft.net>
16014
16015 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16016 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16017
70752818
ILT
160182008-04-02 Craig Silverstein <csilvers@google.com>
16019
16020 * TODO: New file.
16021
39d0cb0e
ILT
160222008-04-02 Ian Lance Taylor <iant@google.com>
16023
16024 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16025 parameters. Update for new key type to views_. Change all
16026 callers.
16027 (File_read::read): Adjust for byteshift in returned view.
16028 (File_read::add_view): New function, broken out of
16029 find_and_make_view.
16030 (File_read::make_view): New function, broken out of
16031 find_and_make_view.
16032 (File_read::find_or_make_view): Add offset and aligned
16033 parameters. Rewrite accordingly. Change all callers.
16034 (File_read::get_view): Add offset and aligned parameters. Adjust
16035 for byteshift in return value.
16036 (File_read::get_lasting_view): Likewise.
16037 * fileread.h (class File_read): Update declarations.
16038 (class File_read::View): Add byteshift_ field. Add byteshift to
16039 constructor. Add byteshift method.
16040 * archive.h (Archive::clear_uncached_views): New function.
16041 (Archive::get_view): Add aligned parameter. Change all callers.
16042 * object.h (Object::get_view): Add aligned parameter. Change all
16043 callers.
16044 (Object::get_lasting_view): Likewise.
16045
16046 * fileread.cc (File_read::release): Don't call clear_views if
16047 there are multiple objects.
16048 * fileread.h (File_read::clear_uncached_views): New function.
16049 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16050 on the archive.
16051
a1207466
CC
160522008-03-31 Cary Coutant <ccoutant@google.com>
16053
16054 Add thin archive support.
16055 * archive.cc (Archive::armagt): New const.
16056 (Archive::setup): Remove task parameter and calls to unlock.
16057 (Archive::unlock_nested_archives): New function.
16058 (Archive::read_header): Add nested_off parameter. Change
16059 all callers.
16060 (Archive::interpret_header): Likewise.
16061 (Archive::include_all_members): Change to handle thin
16062 archives.
16063 (Archive::include_member): Likewise.
16064 * archive.h (Archive::Archive): Add new parameters and
16065 initializers.
16066 (Archive::armagt): New const.
16067 (Archive::setup): Remove task parameter.
16068 (Archive::unlock_nested_archives): New function.
16069 (Archive::read_header): Add nested_off parameter.
16070 (Archive::interpret_header): Likewise.
16071 (Archive::Nested_archive_table): New typedef.
16072 (Archive::is_thin_archive_): New field.
16073 (Archive::nested_archives_): New field.
16074 (Archive::options_): New field.
16075 (Archive::dirpath_): New field.
16076 (Archive::task_): New field.
16077 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16078 for thin archives. Pass additional parameters to
16079 Archive::Archive. Unlock the archive file after calling
16080 Archive::setup.
cd536b21 16081
479f6503
ILT
160822008-03-29 Ian Lance Taylor <iant@google.com>
16083
686c8caf
ILT
16084 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16085 version symbol to be local.
16086 * testsuite/ver_test_4.sh: New file.
16087 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16088 (check_DATA): Add ver_test_4.syms.
16089 (ver_test_4.syms): New target.
16090 * testsuite/Makefile.in: Rebuild.
16091
ab794b6b
ILT
16092 * output.cc
16093 (Output_section::Input_section_sort_entry::has_priority): New
16094 function.
16095 (Output_section::Input_section_sort_entry::match_file_name): New
16096 function.
16097 (Output_section::Input_section_sort_entry::match_section_name):
16098 Remove.
16099 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16100 Remove.
16101 (Output_section::Input_section_sort_entry::match_section_file):
16102 Remove.
16103 (Output_section::Input_section_sort_compare::operator()): Rewrite
16104 using new Input_section_sort_entry functions. Sort crtbegin and
16105 crtend first. Sort sections with no priority before sections with
16106 a priority.
16107 * testsuite/initpri1.c (d3): Check j != 4.
16108 (cd5): New constructor/destructor function.
16109 (main): Check j != 2.
16110
479f6503
ILT
16111 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16112 new symbol when resolving, don't call set_is_default.
16113 * testsuite/ver_test_7.cc: New file.
16114 * testsuite/ver_test_7.sh: New file.
16115 * testsuite/Makefile.am (ver_test_7.so): New target.
16116 (ver_test_7.o): New target.
16117 (check_SCRIPTS): Add ver_test_7.sh.
16118 (check_DATA): Add ver_test_7.syms.
16119 (ver_test_7.syms): New target.
16120
2fd32231
ILT
161212008-03-28 Ian Lance Taylor <iant@google.com>
16122
16123 * layout.cc (Layout::layout): If we see an input section with a
16124 name that needs sorting, set the must_sort flag for the output
16125 section.
16126 (Layout::make_output_section): If the name of the output section
16127 indicates that it might require sorting, set the may_sort flag.
16128 * output.h (Output_section::may_sort_attached_input_sections): New
16129 function.
16130 (Output_section::set_may_sort_attached_input_sections): New
16131 function.
16132 (Output_section::must_sort_attached_input_sections): New
16133 function.
16134 (Output_section::set_must_sort_attached_input_sections): New
16135 function.
16136 (class Output_section): Declare Input_section_sort_entry. Define
16137 Input_section_sort_compare. Declare
16138 sort_attached_input_sections. Add new fields:
16139 may_sort_attached_input_sections_,
16140 must_sort_attached_input_sections_,
16141 attached_input_sections_are_sorted_.
16142 * output.cc (Output_section::Output_section): Initialize new
16143 fields.
16144 (Output_section::add_input_section): Add an entry to
16145 input_sections_ if may_sort or must_sort are true.
16146 (Output_section::set_final_data_size): Call
16147 sort_attached_input_sections if necessary.
16148 (Output_section::Input_section_sort_entry): Define new class.
16149 (Output_section::Input_section_sort_compare::operator()): New
16150 function.
16151 (Output_section::sort_attached_input_sections): New function.
16152 * configure.ac: Check whether the compiler supports constructor
16153 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16154 * testsuite/initpri1.c: New file.
16155 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16156 CONSTRUCTOR_PRIORITY.
16157 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16158 (initpri1_LDFLAGS): New variable.
16159 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16160
18e6b24e
ILT
161612008-03-27 Ian Lance Taylor <iant@google.com>
16162
49bdd526
ILT
16163 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16164 * testsuite/common_test_1.c: New file.
16165 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16166 (common_test_1_SOURCES): New variable.
16167 (common_test_1_DEPENDENCIES): New variable.
16168 (common_test_1_LDFLAGS): New variable.
16169
18e6b24e
ILT
16170 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16171 and commons_ correctly when NAME/VERSION does not override
16172 NAME/NULL.
16173 * testsuite/ver_test_6.c: New file.
16174 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16175 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16176 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16177
04bf7072
ILT
161782008-03-26 Ian Lance Taylor <iant@google.com>
16179
5871526f
ILT
16180 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16181 of an undefined symbol from a version script.
16182 * testsuite/Makefile.am (ver_test_5.so): New target.
16183 (ver_test_5.o): New target.
16184 (check_SCRIPTS): Add ver_test_5.sh.
16185 (check_DATA): Add ver_test_5.syms.
16186 (ver_test_5.syms): New target.
16187 * testsuite/ver_test_5.cc: New file.
16188 * testsuite/ver_test_5.script: New file.
16189 * testsuite/ver_test_5.sh: New file.
16190 * Makefile.in, testsuite/Makefile.in: Rebuild.
16191
04bf7072
ILT
16192 PR gold/5986
16193 Fix problems building gold with gcc 4.3.0.
16194 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16195 (gold_error_at_location, gold_warning_at_location): Use it.
16196 * configure.ac: Check whether we can compile and use a template
16197 function with a printf attribute.
16198 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16199 when jumping over bytes.
16200 * object.cc: Instantiate Object::read_section_data.
16201 * debug.h: Include <cstring>
16202 * dwarf_reader.cc: Include <algorithm>
16203 * main.cc: Include <cstring>.
16204 * options.cc: Include <cstring>.
16205 * output.cc: Include <cstring>.
16206 * script.cc: Include <cstring>.
16207 * script.h: Include <string>.
16208 * symtab.cc: Include <cstring> and <algorithm>.
16209 * target-select.cc: Include <cstring>.
16210 * version.cc: Include <string>.
16211 * testsuite/testmain.cc: Include <cstdlib>.
16212 * configure, config.in: Rebuild.
16213
874c5b28
ILT
162142008-03-25 Ian Lance Taylor <iant@google.com>
16215
819d6c3a
ILT
16216 * options.cc: Include "../bfd/bfdver.h".
16217 (options::help): Print bug reporting address.
16218
f4b2c6f5
ILT
16219 * version.cc (print_version): Adjust output for current value of
16220 BFD_VERSION_STRING.
16221
16222 * NEWS: New file.
16223
e96caa79
ILT
16224 * options.cc (options::help): Print list of supported targets.
16225 * target-select.h: Include <vector>.
16226 (class Target_selector): Make machine_, size_, and is_big_endian_
16227 fields const. Add bfd_name_ and instantiated_target_ fields.
16228 (Target_selector::Target_selector): Add bfd_name parameter.
16229 (Target_selector::recognize): Make non-virtual, call
16230 do_recognize.
16231 (Target_selector::recognize_by_name): Make non-virtual, call
16232 do_recognize_by_name.
16233 (Target_selector::supported_names): New function.
16234 (Target_selector::bfd_name): New function.
16235 (Target_selector::do_instantiate_target): New pure virtual
16236 function.
16237 (Target_selector::do_recognize): New virtual function.
16238 (Target_selector::do_recognize_by_name): New virtual function.
16239 (Target_selector::instantiate_target): New private function.
16240 (supported_target_names): Declare.
16241 * target-select.cc (Target_selector::Target_selector): Update for
16242 new parameter and fields.
16243 (select_target_by_name): Check that the name matches before
16244 calling recognize_by_name.
16245 (supported_target_names): New function.
16246 * i386.cc (class Target_selector_i386): Update Target_selector
16247 constructor call. Remove recognize and recognize_by_name. Add
16248 do_instantiate_target.
16249 * x86_64.cc (class Target_selector_x86_64): Likewise.
16250 * testsuite/testfile.cc (class Target_selector_test): Update for
16251 changes to Target_selector.
16252
874c5b28
ILT
16253 * README: Rewrite, with some notes on unsupported features.
16254
0a65a3a7
CC
162552008-03-24 Cary Coutant <ccoutant@google.com>
16256
16257 * i386.cc (Target_i386::Got_type): New enum declaration.
16258 (Target_i386::Scan::local): Updated callers of Output_data_got
16259 member functions.
16260 (Target_i386::Scan::global): Likewise.
16261 (Target_i386::Relocate::relocate): Likewise.
16262 (Target_i386::Relocate::relocate_tls): Likewise.
16263 * object.h (Got_offset_list): New class.
16264 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16265 (Sized_relobj::local_got_offset): Likewise.
16266 (Sized_relobj::set_local_got_offset): Likewise.
16267 (Sized_relobj::local_has_tls_got_offset): Removed.
16268 (Sized_relobj::local_tls_got_offset): Removed.
16269 (Sized_relobj::set_local_tls_got_offset): Removed.
16270 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16271 * output.cc (Output_data_got::add_global): Added got_type parameter.
16272 (Output_data_got::add_global_with_rel): Likewise.
16273 (Output_data_got::add_global_with_rela): Likewise.
16274 (Output_data_got::add_global_pair_with_rel): New function.
16275 (Output_data_got::add_global_pair_with_rela): New function.
16276 (Output_data_got::add_local): Added got_type parameter.
16277 (Output_data_got::add_local_with_rel): Likewise.
16278 (Output_data_got::add_local_with_rela): Likewise.
16279 (Output_data_got::add_local_pair_with_rel): New function.
16280 (Output_data_got::add_local_pair_with_rela): New function.
16281 (Output_data_got::add_global_tls): Removed.
16282 (Output_data_got::add_global_tls_with_rel): Removed.
16283 (Output_data_got::add_global_tls_with_rela): Removed.
16284 (Output_data_got::add_local_tls): Removed.
16285 (Output_data_got::add_local_tls_with_rel): Removed.
16286 (Output_data_got::add_local_tls_with_rela): Removed.
16287 * output.h (Output_data_got::add_global): Added got_type parameter.
16288 (Output_data_got::add_global_with_rel): Likewise.
16289 (Output_data_got::add_global_with_rela): Likewise.
16290 (Output_data_got::add_global_pair_with_rel): New function.
16291 (Output_data_got::add_global_pair_with_rela): New function.
16292 (Output_data_got::add_local): Added got_type parameter.
16293 (Output_data_got::add_local_with_rel): Likewise.
16294 (Output_data_got::add_local_with_rela): Likewise.
16295 (Output_data_got::add_local_pair_with_rel): New function.
16296 (Output_data_got::add_local_pair_with_rela): New function.
16297 (Output_data_got::add_global_tls): Removed.
16298 (Output_data_got::add_global_tls_with_rel): Removed.
16299 (Output_data_got::add_global_tls_with_rela): Removed.
16300 (Output_data_got::add_local_tls): Removed.
16301 (Output_data_got::add_local_tls_with_rel): Removed.
16302 (Output_data_got::add_local_tls_with_rela): Removed.
16303 * resolve.cc (Symbol::override_base_with_special): Removed
16304 reference to has_got_offset_ field.
16305 * symtab.cc (Symbol::init_fields): Replaced initialization
16306 of got_offset_ with got_offsets_. Removed initialization
16307 of has_got_offset_
53fcba31 16308 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16309 (Symbol::got_offset): Likewise.
16310 (Symbol::set_got_offset): Likewise.
16311 (Symbol::has_tls_got_offset): Removed.
16312 (Symbol::tls_got_offset): Removed.
16313 (Symbol::set_tls_got_offset): Removed.
16314 (Symbol::got_offset_): Removed.
16315 (Symbol::tls_mod_got_offset_): Removed.
16316 (Symbol::tls_pair_got_offset_): Removed.
16317 (Symbol::got_offsets_): New field.
16318 (Symbol::has_got_offset): Removed.
16319 (Symbol::has_tls_mod_got_offset): Removed.
16320 (Symbol::has_tls_pair_got_offset): Removed.
16321 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16322 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16323 member functions.
16324 (Target_x86_64::Scan::global): Likewise.
16325 (Target_x86_64::Relocate::relocate): Likewise.
16326 (Target_x86_64::Relocate::relocate_tls): Likewise.
16327
bd52eafb
BE
163282008-03-25 Ben Elliston <bje@au.ibm.com>
16329
16330 * yyscript.y: Fix spelling error in comment.
16331
8b105e34
ILT
163322008-03-24 Ian Lance Taylor <iant@google.com>
16333
8ed814a9
ILT
16334 * options.h (class General_options): Define build_id option.
16335 * layout.h (class Layout): Declare write_build_id, create_note,
16336 create_build_id. Add build_id_note_ member.
16337 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16338 "libiberty.h", "md5.h", "sha1.h".
16339 (Layout::Layout): Initialize eh_frame_data_,
16340 eh_frame_hdr_section_, and build_id_note_.
16341 (Layout::finalize): Call create_build_id.
16342 (Layout::create_note): New function, broken out of
16343 Layout::create_gold_note.
16344 (Layout::create_gold_note): Call create_note.
16345 (Layout::create_build_id): New function.
16346 (Layout::write_build_id): New function.
16347 (Close_task_runner::run): Call write_build_id.
16348
8b105e34
ILT
16349 * x86_64.cc: Correct license to GPLv3.
16350
086a1841
ILT
163512008-03-23 Ian Lance Taylor <iant@google.com>
16352
16353 * options.cc: Include "demangle.h".
16354 (parse_optional_string): New function.
16355 (parse_long_option): Handle takes_optional_argument.
16356 (parse_short_option): Update dash_z initializer. Handle
16357 takes_optional_argument.
16358 (General_options::General_options): Initialize do_demangle_.
16359 (General_options::finalize): Set do_demangle_. Handle demangling
16360 style.
16361 * options.h (parse_optional_string): Declare.
16362 (struct One_option): Add optional_arg field. Update constructor.
16363 Update call constructor calls. Add takes_optional_argument
16364 function.
16365 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16366 (DEFINE_optional_string): Define.
16367 (General_options::demangle): Change from DEFINE_bool to
16368 DEFINE_optional_string.
16369 (General_options::no_demangle): New function.
16370 (General_options::do_demangle): New function.
16371 (General_options::set_do_demangle): New function.
16372 (General_options::execstack_status_): Move definition to end of
16373 class definition.
16374 (General_options::static_): Likewise.
16375 (General_options::do_demangle_): New field.
16376 * object.cc (big_endian>::get_symbol_location_info): Call
16377 Options::do_demangle, not Options::demangle.
16378 * symtab.cc (demangle): Likewise.
16379
cbb93e63
ILT
163802008-03-22 Ian Lance Taylor <iant@google.com>
16381
16382 * gold.h: Include <cstddef> and <sys/types.h>
16383 * options.h: Include <cstring>.
16384
ec531623
ILT
163852008-03-21 Ian Lance Taylor <iant@google.com>
16386
16387 * Added source code to GNU binutils.
752937aa 16388\f
4b95cf5c 16389Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16390
16391Copying and distribution of this file, with or without modification,
16392are permitted in any medium without royalty provided the copyright
16393notice and this notice are preserved.
16394
16395Local Variables:
16396mode: change-log
16397left-margin: 8
16398fill-column: 74
16399version-control: never
16400End:
This page took 1.011556 seconds and 4 git commands to generate.